{"ast":null,"code":"import Database from \"libsql\";\nimport { Buffer } from \"node:buffer\";\nimport { LibsqlError } from \"@libsql/core/api\";\nimport { expandConfig, isInMemoryConfig } from \"@libsql/core/config\";\nimport { supportedUrlLink, transactionModeToBegin, ResultSetImpl } from \"@libsql/core/util\";\nexport * from \"@libsql/core/api\";\nexport function createClient(config) {\n return _createClient(expandConfig(config, true));\n}\n/** @private */\nexport function _createClient(config) {\n if (config.scheme !== \"file\") {\n throw new LibsqlError(`URL scheme ${JSON.stringify(config.scheme + \":\")} is not supported by the local sqlite3 client. ` + `For more information, please read ${supportedUrlLink}`, \"URL_SCHEME_NOT_SUPPORTED\");\n }\n const authority = config.authority;\n if (authority !== undefined) {\n const host = authority.host.toLowerCase();\n if (host !== \"\" && host !== \"localhost\") {\n throw new LibsqlError(`Invalid host in file URL: ${JSON.stringify(authority.host)}. ` + 'A \"file:\" URL with an absolute path should start with one slash (\"file:/absolute/path.db\") ' + 'or with three slashes (\"file:///absolute/path.db\"). ' + `For more information, please read ${supportedUrlLink}`, \"URL_INVALID\");\n }\n if (authority.port !== undefined) {\n throw new LibsqlError(\"File URL cannot have a port\", \"URL_INVALID\");\n }\n if (authority.userinfo !== undefined) {\n throw new LibsqlError(\"File URL cannot have username and password\", \"URL_INVALID\");\n }\n }\n let isInMemory = isInMemoryConfig(config);\n if (isInMemory && config.syncUrl) {\n throw new LibsqlError(`Embedded replica must use file for local db but URI with in-memory mode were provided instead: ${config.path}`, \"URL_INVALID\");\n }\n let path = config.path;\n if (isInMemory) {\n // note: we should prepend file scheme in order for SQLite3 to recognize :memory: connection query parameters\n path = `${config.scheme}:${config.path}`;\n }\n const options = {\n authToken: config.authToken,\n encryptionKey: config.encryptionKey,\n syncUrl: config.syncUrl,\n syncPeriod: config.syncInterval\n };\n const db = new Database(path, options);\n executeStmt(db, \"SELECT 1 AS checkThatTheDatabaseCanBeOpened\", config.intMode);\n return new Sqlite3Client(path, options, db, config.intMode);\n}\nexport class Sqlite3Client {\n #path;\n #options;\n #db;\n #intMode;\n closed;\n protocol;\n /** @private */\n constructor(path, options, db, intMode) {\n this.#path = path;\n this.#options = options;\n this.#db = db;\n this.#intMode = intMode;\n this.closed = false;\n this.protocol = \"file\";\n }\n async execute(stmtOrSql, args) {\n let stmt;\n if (typeof stmtOrSql === \"string\") {\n stmt = {\n sql: stmtOrSql,\n args: args || []\n };\n } else {\n stmt = stmtOrSql;\n }\n this.#checkNotClosed();\n return executeStmt(this.#getDb(), stmt, this.#intMode);\n }\n async batch(stmts, mode = \"deferred\") {\n this.#checkNotClosed();\n const db = this.#getDb();\n try {\n executeStmt(db, transactionModeToBegin(mode), this.#intMode);\n const resultSets = stmts.map(stmt => {\n if (!db.inTransaction) {\n throw new LibsqlError(\"The transaction has been rolled back\", \"TRANSACTION_CLOSED\");\n }\n return executeStmt(db, stmt, this.#intMode);\n });\n executeStmt(db, \"COMMIT\", this.#intMode);\n return resultSets;\n } finally {\n if (db.inTransaction) {\n executeStmt(db, \"ROLLBACK\", this.#intMode);\n }\n }\n }\n async migrate(stmts) {\n this.#checkNotClosed();\n const db = this.#getDb();\n try {\n executeStmt(db, \"PRAGMA foreign_keys=off\", this.#intMode);\n executeStmt(db, transactionModeToBegin(\"deferred\"), this.#intMode);\n const resultSets = stmts.map(stmt => {\n if (!db.inTransaction) {\n throw new LibsqlError(\"The transaction has been rolled back\", \"TRANSACTION_CLOSED\");\n }\n return executeStmt(db, stmt, this.#intMode);\n });\n executeStmt(db, \"COMMIT\", this.#intMode);\n return resultSets;\n } finally {\n if (db.inTransaction) {\n executeStmt(db, \"ROLLBACK\", this.#intMode);\n }\n executeStmt(db, \"PRAGMA foreign_keys=on\", this.#intMode);\n }\n }\n async transaction(mode = \"write\") {\n const db = this.#getDb();\n executeStmt(db, transactionModeToBegin(mode), this.#intMode);\n this.#db = null; // A new connection will be lazily created on next use\n return new Sqlite3Transaction(db, this.#intMode);\n }\n async executeMultiple(sql) {\n this.#checkNotClosed();\n const db = this.#getDb();\n try {\n return executeMultiple(db, sql);\n } finally {\n if (db.inTransaction) {\n executeStmt(db, \"ROLLBACK\", this.#intMode);\n }\n }\n }\n async sync() {\n this.#checkNotClosed();\n const rep = await this.#getDb().sync();\n return {\n frames_synced: rep.frames_synced,\n frame_no: rep.frame_no\n };\n }\n close() {\n this.closed = true;\n if (this.#db !== null) {\n this.#db.close();\n }\n }\n #checkNotClosed() {\n if (this.closed) {\n throw new LibsqlError(\"The client is closed\", \"CLIENT_CLOSED\");\n }\n }\n // Lazily creates the database connection and returns it\n #getDb() {\n if (this.#db === null) {\n this.#db = new Database(this.#path, this.#options);\n }\n return this.#db;\n }\n}\nexport class Sqlite3Transaction {\n #database;\n #intMode;\n /** @private */\n constructor(database, intMode) {\n this.#database = database;\n this.#intMode = intMode;\n }\n async execute(stmtOrSql, args) {\n let stmt;\n if (typeof stmtOrSql === \"string\") {\n stmt = {\n sql: stmtOrSql,\n args: args || []\n };\n } else {\n stmt = stmtOrSql;\n }\n this.#checkNotClosed();\n return executeStmt(this.#database, stmt, this.#intMode);\n }\n async batch(stmts) {\n return stmts.map(stmt => {\n this.#checkNotClosed();\n return executeStmt(this.#database, stmt, this.#intMode);\n });\n }\n async executeMultiple(sql) {\n this.#checkNotClosed();\n return executeMultiple(this.#database, sql);\n }\n async rollback() {\n if (!this.#database.open) {\n return;\n }\n this.#checkNotClosed();\n executeStmt(this.#database, \"ROLLBACK\", this.#intMode);\n }\n async commit() {\n this.#checkNotClosed();\n executeStmt(this.#database, \"COMMIT\", this.#intMode);\n }\n close() {\n if (this.#database.inTransaction) {\n executeStmt(this.#database, \"ROLLBACK\", this.#intMode);\n }\n }\n get closed() {\n return !this.#database.inTransaction;\n }\n #checkNotClosed() {\n if (this.closed) {\n throw new LibsqlError(\"The transaction is closed\", \"TRANSACTION_CLOSED\");\n }\n }\n}\nfunction executeStmt(db, stmt, intMode) {\n let sql;\n let args;\n if (typeof stmt === \"string\") {\n sql = stmt;\n args = [];\n } else {\n sql = stmt.sql;\n if (Array.isArray(stmt.args)) {\n args = stmt.args.map(value => valueToSql(value, intMode));\n } else {\n args = {};\n for (const name in stmt.args) {\n const argName = name[0] === \"@\" || name[0] === \"$\" || name[0] === \":\" ? name.substring(1) : name;\n args[argName] = valueToSql(stmt.args[name], intMode);\n }\n }\n }\n try {\n const sqlStmt = db.prepare(sql);\n sqlStmt.safeIntegers(true);\n let returnsData = true;\n try {\n sqlStmt.raw(true);\n } catch {\n // raw() throws an exception if the statement does not return data\n returnsData = false;\n }\n if (returnsData) {\n const columns = Array.from(sqlStmt.columns().map(col => col.name));\n const columnTypes = Array.from(sqlStmt.columns().map(col => col.type ?? \"\"));\n const rows = sqlStmt.all(args).map(sqlRow => {\n return rowFromSql(sqlRow, columns, intMode);\n });\n // TODO: can we get this info from better-sqlite3?\n const rowsAffected = 0;\n const lastInsertRowid = undefined;\n return new ResultSetImpl(columns, columnTypes, rows, rowsAffected, lastInsertRowid);\n } else {\n const info = sqlStmt.run(args);\n const rowsAffected = info.changes;\n const lastInsertRowid = BigInt(info.lastInsertRowid);\n return new ResultSetImpl([], [], [], rowsAffected, lastInsertRowid);\n }\n } catch (e) {\n throw mapSqliteError(e);\n }\n}\nfunction rowFromSql(sqlRow, columns, intMode) {\n const row = {};\n // make sure that the \"length\" property is not enumerable\n Object.defineProperty(row, \"length\", {\n value: sqlRow.length\n });\n for (let i = 0; i < sqlRow.length; ++i) {\n const value = valueFromSql(sqlRow[i], intMode);\n Object.defineProperty(row, i, {\n value\n });\n const column = columns[i];\n if (!Object.hasOwn(row, column)) {\n Object.defineProperty(row, column, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n }\n }\n return row;\n}\nfunction valueFromSql(sqlValue, intMode) {\n if (typeof sqlValue === \"bigint\") {\n if (intMode === \"number\") {\n if (sqlValue < minSafeBigint || sqlValue > maxSafeBigint) {\n throw new RangeError(\"Received integer which cannot be safely represented as a JavaScript number\");\n }\n return Number(sqlValue);\n } else if (intMode === \"bigint\") {\n return sqlValue;\n } else if (intMode === \"string\") {\n return \"\" + sqlValue;\n } else {\n throw new Error(\"Invalid value for IntMode\");\n }\n } else if (sqlValue instanceof Buffer) {\n return sqlValue.buffer;\n }\n return sqlValue;\n}\nconst minSafeBigint = -9007199254740991n;\nconst maxSafeBigint = 9007199254740991n;\nfunction valueToSql(value, intMode) {\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) {\n throw new RangeError(\"Only finite numbers (not Infinity or NaN) can be passed as arguments\");\n }\n return value;\n } else if (typeof value === \"bigint\") {\n if (value < minInteger || value > maxInteger) {\n throw new RangeError(\"bigint is too large to be represented as a 64-bit integer and passed as argument\");\n }\n return value;\n } else if (typeof value === \"boolean\") {\n switch (intMode) {\n case \"bigint\":\n return value ? 1n : 0n;\n case \"string\":\n return value ? \"1\" : \"0\";\n default:\n return value ? 1 : 0;\n }\n } else if (value instanceof ArrayBuffer) {\n return Buffer.from(value);\n } else if (value instanceof Date) {\n return value.valueOf();\n } else if (value === undefined) {\n throw new TypeError(\"undefined cannot be passed as argument to the database\");\n } else {\n return value;\n }\n}\nconst minInteger = -9223372036854775808n;\nconst maxInteger = 9223372036854775807n;\nfunction executeMultiple(db, sql) {\n try {\n db.exec(sql);\n } catch (e) {\n throw mapSqliteError(e);\n }\n}\nfunction mapSqliteError(e) {\n if (e instanceof Database.SqliteError) {\n return new LibsqlError(e.message, e.code, e.rawCode, e);\n }\n return e;\n}","map":{"version":3,"names":["Database","Buffer","LibsqlError","expandConfig","isInMemoryConfig","supportedUrlLink","transactionModeToBegin","ResultSetImpl","createClient","config","_createClient","scheme","JSON","stringify","authority","undefined","host","toLowerCase","port","userinfo","isInMemory","syncUrl","path","options","authToken","encryptionKey","syncPeriod","syncInterval","db","executeStmt","intMode","Sqlite3Client","closed","protocol","constructor","execute","stmtOrSql","args","stmt","sql","checkNotClosed","getDb","batch","stmts","mode","resultSets","map","inTransaction","migrate","transaction","Sqlite3Transaction","executeMultiple","sync","rep","frames_synced","frame_no","close","#checkNotClosed","#getDb","database","rollback","open","commit","Array","isArray","value","valueToSql","name","argName","substring","sqlStmt","prepare","safeIntegers","returnsData","raw","columns","from","col","columnTypes","type","rows","all","sqlRow","rowFromSql","rowsAffected","lastInsertRowid","info","run","changes","BigInt","e","mapSqliteError","row","Object","defineProperty","length","i","valueFromSql","column","hasOwn","enumerable","configurable","writable","sqlValue","minSafeBigint","maxSafeBigint","RangeError","Number","Error","buffer","isFinite","minInteger","maxInteger","ArrayBuffer","Date","valueOf","TypeError","exec","SqliteError","message","code","rawCode"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@libsql/client/lib-esm/sqlite3.js"],"sourcesContent":["import Database from \"libsql\";\nimport { Buffer } from \"node:buffer\";\nimport { LibsqlError } from \"@libsql/core/api\";\nimport { expandConfig, isInMemoryConfig } from \"@libsql/core/config\";\nimport { supportedUrlLink, transactionModeToBegin, ResultSetImpl, } from \"@libsql/core/util\";\nexport * from \"@libsql/core/api\";\nexport function createClient(config) {\n return _createClient(expandConfig(config, true));\n}\n/** @private */\nexport function _createClient(config) {\n if (config.scheme !== \"file\") {\n throw new LibsqlError(`URL scheme ${JSON.stringify(config.scheme + \":\")} is not supported by the local sqlite3 client. ` +\n `For more information, please read ${supportedUrlLink}`, \"URL_SCHEME_NOT_SUPPORTED\");\n }\n const authority = config.authority;\n if (authority !== undefined) {\n const host = authority.host.toLowerCase();\n if (host !== \"\" && host !== \"localhost\") {\n throw new LibsqlError(`Invalid host in file URL: ${JSON.stringify(authority.host)}. ` +\n 'A \"file:\" URL with an absolute path should start with one slash (\"file:/absolute/path.db\") ' +\n 'or with three slashes (\"file:///absolute/path.db\"). ' +\n `For more information, please read ${supportedUrlLink}`, \"URL_INVALID\");\n }\n if (authority.port !== undefined) {\n throw new LibsqlError(\"File URL cannot have a port\", \"URL_INVALID\");\n }\n if (authority.userinfo !== undefined) {\n throw new LibsqlError(\"File URL cannot have username and password\", \"URL_INVALID\");\n }\n }\n let isInMemory = isInMemoryConfig(config);\n if (isInMemory && config.syncUrl) {\n throw new LibsqlError(`Embedded replica must use file for local db but URI with in-memory mode were provided instead: ${config.path}`, \"URL_INVALID\");\n }\n let path = config.path;\n if (isInMemory) {\n // note: we should prepend file scheme in order for SQLite3 to recognize :memory: connection query parameters\n path = `${config.scheme}:${config.path}`;\n }\n const options = {\n authToken: config.authToken,\n encryptionKey: config.encryptionKey,\n syncUrl: config.syncUrl,\n syncPeriod: config.syncInterval,\n };\n const db = new Database(path, options);\n executeStmt(db, \"SELECT 1 AS checkThatTheDatabaseCanBeOpened\", config.intMode);\n return new Sqlite3Client(path, options, db, config.intMode);\n}\nexport class Sqlite3Client {\n #path;\n #options;\n #db;\n #intMode;\n closed;\n protocol;\n /** @private */\n constructor(path, options, db, intMode) {\n this.#path = path;\n this.#options = options;\n this.#db = db;\n this.#intMode = intMode;\n this.closed = false;\n this.protocol = \"file\";\n }\n async execute(stmtOrSql, args) {\n let stmt;\n if (typeof stmtOrSql === \"string\") {\n stmt = {\n sql: stmtOrSql,\n args: args || [],\n };\n }\n else {\n stmt = stmtOrSql;\n }\n this.#checkNotClosed();\n return executeStmt(this.#getDb(), stmt, this.#intMode);\n }\n async batch(stmts, mode = \"deferred\") {\n this.#checkNotClosed();\n const db = this.#getDb();\n try {\n executeStmt(db, transactionModeToBegin(mode), this.#intMode);\n const resultSets = stmts.map((stmt) => {\n if (!db.inTransaction) {\n throw new LibsqlError(\"The transaction has been rolled back\", \"TRANSACTION_CLOSED\");\n }\n return executeStmt(db, stmt, this.#intMode);\n });\n executeStmt(db, \"COMMIT\", this.#intMode);\n return resultSets;\n }\n finally {\n if (db.inTransaction) {\n executeStmt(db, \"ROLLBACK\", this.#intMode);\n }\n }\n }\n async migrate(stmts) {\n this.#checkNotClosed();\n const db = this.#getDb();\n try {\n executeStmt(db, \"PRAGMA foreign_keys=off\", this.#intMode);\n executeStmt(db, transactionModeToBegin(\"deferred\"), this.#intMode);\n const resultSets = stmts.map((stmt) => {\n if (!db.inTransaction) {\n throw new LibsqlError(\"The transaction has been rolled back\", \"TRANSACTION_CLOSED\");\n }\n return executeStmt(db, stmt, this.#intMode);\n });\n executeStmt(db, \"COMMIT\", this.#intMode);\n return resultSets;\n }\n finally {\n if (db.inTransaction) {\n executeStmt(db, \"ROLLBACK\", this.#intMode);\n }\n executeStmt(db, \"PRAGMA foreign_keys=on\", this.#intMode);\n }\n }\n async transaction(mode = \"write\") {\n const db = this.#getDb();\n executeStmt(db, transactionModeToBegin(mode), this.#intMode);\n this.#db = null; // A new connection will be lazily created on next use\n return new Sqlite3Transaction(db, this.#intMode);\n }\n async executeMultiple(sql) {\n this.#checkNotClosed();\n const db = this.#getDb();\n try {\n return executeMultiple(db, sql);\n }\n finally {\n if (db.inTransaction) {\n executeStmt(db, \"ROLLBACK\", this.#intMode);\n }\n }\n }\n async sync() {\n this.#checkNotClosed();\n const rep = await this.#getDb().sync();\n return {\n frames_synced: rep.frames_synced,\n frame_no: rep.frame_no,\n };\n }\n close() {\n this.closed = true;\n if (this.#db !== null) {\n this.#db.close();\n }\n }\n #checkNotClosed() {\n if (this.closed) {\n throw new LibsqlError(\"The client is closed\", \"CLIENT_CLOSED\");\n }\n }\n // Lazily creates the database connection and returns it\n #getDb() {\n if (this.#db === null) {\n this.#db = new Database(this.#path, this.#options);\n }\n return this.#db;\n }\n}\nexport class Sqlite3Transaction {\n #database;\n #intMode;\n /** @private */\n constructor(database, intMode) {\n this.#database = database;\n this.#intMode = intMode;\n }\n async execute(stmtOrSql, args) {\n let stmt;\n if (typeof stmtOrSql === \"string\") {\n stmt = {\n sql: stmtOrSql,\n args: args || [],\n };\n }\n else {\n stmt = stmtOrSql;\n }\n this.#checkNotClosed();\n return executeStmt(this.#database, stmt, this.#intMode);\n }\n async batch(stmts) {\n return stmts.map((stmt) => {\n this.#checkNotClosed();\n return executeStmt(this.#database, stmt, this.#intMode);\n });\n }\n async executeMultiple(sql) {\n this.#checkNotClosed();\n return executeMultiple(this.#database, sql);\n }\n async rollback() {\n if (!this.#database.open) {\n return;\n }\n this.#checkNotClosed();\n executeStmt(this.#database, \"ROLLBACK\", this.#intMode);\n }\n async commit() {\n this.#checkNotClosed();\n executeStmt(this.#database, \"COMMIT\", this.#intMode);\n }\n close() {\n if (this.#database.inTransaction) {\n executeStmt(this.#database, \"ROLLBACK\", this.#intMode);\n }\n }\n get closed() {\n return !this.#database.inTransaction;\n }\n #checkNotClosed() {\n if (this.closed) {\n throw new LibsqlError(\"The transaction is closed\", \"TRANSACTION_CLOSED\");\n }\n }\n}\nfunction executeStmt(db, stmt, intMode) {\n let sql;\n let args;\n if (typeof stmt === \"string\") {\n sql = stmt;\n args = [];\n }\n else {\n sql = stmt.sql;\n if (Array.isArray(stmt.args)) {\n args = stmt.args.map((value) => valueToSql(value, intMode));\n }\n else {\n args = {};\n for (const name in stmt.args) {\n const argName = name[0] === \"@\" || name[0] === \"$\" || name[0] === \":\"\n ? name.substring(1)\n : name;\n args[argName] = valueToSql(stmt.args[name], intMode);\n }\n }\n }\n try {\n const sqlStmt = db.prepare(sql);\n sqlStmt.safeIntegers(true);\n let returnsData = true;\n try {\n sqlStmt.raw(true);\n }\n catch {\n // raw() throws an exception if the statement does not return data\n returnsData = false;\n }\n if (returnsData) {\n const columns = Array.from(sqlStmt.columns().map((col) => col.name));\n const columnTypes = Array.from(sqlStmt.columns().map((col) => col.type ?? \"\"));\n const rows = sqlStmt.all(args).map((sqlRow) => {\n return rowFromSql(sqlRow, columns, intMode);\n });\n // TODO: can we get this info from better-sqlite3?\n const rowsAffected = 0;\n const lastInsertRowid = undefined;\n return new ResultSetImpl(columns, columnTypes, rows, rowsAffected, lastInsertRowid);\n }\n else {\n const info = sqlStmt.run(args);\n const rowsAffected = info.changes;\n const lastInsertRowid = BigInt(info.lastInsertRowid);\n return new ResultSetImpl([], [], [], rowsAffected, lastInsertRowid);\n }\n }\n catch (e) {\n throw mapSqliteError(e);\n }\n}\nfunction rowFromSql(sqlRow, columns, intMode) {\n const row = {};\n // make sure that the \"length\" property is not enumerable\n Object.defineProperty(row, \"length\", { value: sqlRow.length });\n for (let i = 0; i < sqlRow.length; ++i) {\n const value = valueFromSql(sqlRow[i], intMode);\n Object.defineProperty(row, i, { value });\n const column = columns[i];\n if (!Object.hasOwn(row, column)) {\n Object.defineProperty(row, column, {\n value,\n enumerable: true,\n configurable: true,\n writable: true,\n });\n }\n }\n return row;\n}\nfunction valueFromSql(sqlValue, intMode) {\n if (typeof sqlValue === \"bigint\") {\n if (intMode === \"number\") {\n if (sqlValue < minSafeBigint || sqlValue > maxSafeBigint) {\n throw new RangeError(\"Received integer which cannot be safely represented as a JavaScript number\");\n }\n return Number(sqlValue);\n }\n else if (intMode === \"bigint\") {\n return sqlValue;\n }\n else if (intMode === \"string\") {\n return \"\" + sqlValue;\n }\n else {\n throw new Error(\"Invalid value for IntMode\");\n }\n }\n else if (sqlValue instanceof Buffer) {\n return sqlValue.buffer;\n }\n return sqlValue;\n}\nconst minSafeBigint = -9007199254740991n;\nconst maxSafeBigint = 9007199254740991n;\nfunction valueToSql(value, intMode) {\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) {\n throw new RangeError(\"Only finite numbers (not Infinity or NaN) can be passed as arguments\");\n }\n return value;\n }\n else if (typeof value === \"bigint\") {\n if (value < minInteger || value > maxInteger) {\n throw new RangeError(\"bigint is too large to be represented as a 64-bit integer and passed as argument\");\n }\n return value;\n }\n else if (typeof value === \"boolean\") {\n switch (intMode) {\n case \"bigint\":\n return value ? 1n : 0n;\n case \"string\":\n return value ? \"1\" : \"0\";\n default:\n return value ? 1 : 0;\n }\n }\n else if (value instanceof ArrayBuffer) {\n return Buffer.from(value);\n }\n else if (value instanceof Date) {\n return value.valueOf();\n }\n else if (value === undefined) {\n throw new TypeError(\"undefined cannot be passed as argument to the database\");\n }\n else {\n return value;\n }\n}\nconst minInteger = -9223372036854775808n;\nconst maxInteger = 9223372036854775807n;\nfunction executeMultiple(db, sql) {\n try {\n db.exec(sql);\n }\n catch (e) {\n throw mapSqliteError(e);\n }\n}\nfunction mapSqliteError(e) {\n if (e instanceof Database.SqliteError) {\n return new LibsqlError(e.message, e.code, e.rawCode, e);\n }\n return e;\n}\n"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,QAAQ;AAC7B,SAASC,MAAM,QAAQ,aAAa;AACpC,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,qBAAqB;AACpE,SAASC,gBAAgB,EAAEC,sBAAsB,EAAEC,aAAa,QAAS,mBAAmB;AAC5F,cAAc,kBAAkB;AAChC,OAAO,SAASC,YAAYA,CAACC,MAAM,EAAE;EACjC,OAAOC,aAAa,CAACP,YAAY,CAACM,MAAM,EAAE,IAAI,CAAC,CAAC;AACpD;AACA;AACA,OAAO,SAASC,aAAaA,CAACD,MAAM,EAAE;EAClC,IAAIA,MAAM,CAACE,MAAM,KAAK,MAAM,EAAE;IAC1B,MAAM,IAAIT,WAAW,CAAC,cAAcU,IAAI,CAACC,SAAS,CAACJ,MAAM,CAACE,MAAM,GAAG,GAAG,CAAC,iDAAiD,GACpH,qCAAqCN,gBAAgB,EAAE,EAAE,0BAA0B,CAAC;EAC5F;EACA,MAAMS,SAAS,GAAGL,MAAM,CAACK,SAAS;EAClC,IAAIA,SAAS,KAAKC,SAAS,EAAE;IACzB,MAAMC,IAAI,GAAGF,SAAS,CAACE,IAAI,CAACC,WAAW,CAAC,CAAC;IACzC,IAAID,IAAI,KAAK,EAAE,IAAIA,IAAI,KAAK,WAAW,EAAE;MACrC,MAAM,IAAId,WAAW,CAAC,6BAA6BU,IAAI,CAACC,SAAS,CAACC,SAAS,CAACE,IAAI,CAAC,IAAI,GACjF,6FAA6F,GAC7F,sDAAsD,GACtD,qCAAqCX,gBAAgB,EAAE,EAAE,aAAa,CAAC;IAC/E;IACA,IAAIS,SAAS,CAACI,IAAI,KAAKH,SAAS,EAAE;MAC9B,MAAM,IAAIb,WAAW,CAAC,6BAA6B,EAAE,aAAa,CAAC;IACvE;IACA,I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