@powersync/web 0.0.0-dev-20240807140418 → 0.0.0-dev-20240815073141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/lib/src/db/PowerSyncDatabase.js +0 -1
  2. package/lib/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.js +0 -1
  3. package/lib/src/db/adapters/AbstractWebSQLOpenFactory.js +0 -1
  4. package/lib/src/db/adapters/SSRDBAdapter.js +0 -1
  5. package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.js +4 -5
  6. package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.js +0 -1
  7. package/lib/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.js +0 -1
  8. package/lib/src/db/adapters/web-sql-flags.js +0 -1
  9. package/lib/src/db/sync/SSRWebStreamingSyncImplementation.js +0 -1
  10. package/lib/src/db/sync/SharedWebStreamingSyncImplementation.d.ts +3 -3
  11. package/lib/src/db/sync/SharedWebStreamingSyncImplementation.js +7 -4
  12. package/lib/src/db/sync/WebRemote.js +0 -1
  13. package/lib/src/db/sync/WebStreamingSyncImplementation.js +0 -1
  14. package/lib/src/index.js +0 -1
  15. package/lib/src/shared/open-db.js +12 -2
  16. package/lib/src/shared/types.d.ts +2 -2
  17. package/lib/src/shared/types.js +0 -1
  18. package/lib/src/worker/db/SharedWASQLiteDB.worker.js +0 -1
  19. package/lib/src/worker/db/WASQLiteDB.worker.js +0 -1
  20. package/lib/src/worker/db/open-worker-database.js +0 -1
  21. package/lib/src/worker/sync/AbstractSharedSyncClientProvider.js +0 -1
  22. package/lib/src/worker/sync/BroadcastLogger.js +0 -1
  23. package/lib/src/worker/sync/SharedSyncImplementation.d.ts +7 -3
  24. package/lib/src/worker/sync/SharedSyncImplementation.js +93 -69
  25. package/lib/src/worker/sync/SharedSyncImplementation.worker.js +0 -1
  26. package/lib/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +5 -14
  28. package/dist/_2e65-_0749-_dcb9-_0b6f-_ff61-_ec48-_1dff-_983a.index.umd.js +0 -84
  29. package/dist/_2e65-_0749-_dcb9-_0b6f-_ff61-_ec48-_1dff-_983a.index.umd.js.map +0 -1
  30. package/dist/a7933e62dba1e4ff0664.wasm +0 -0
  31. package/dist/index.umd.js +0 -4816
  32. package/dist/index.umd.js.map +0 -1
  33. package/dist/lib_src_worker_db_SharedWASQLiteDB_worker_js.index.umd.js +0 -490
  34. package/dist/lib_src_worker_db_SharedWASQLiteDB_worker_js.index.umd.js.map +0 -1
  35. package/dist/lib_src_worker_db_WASQLiteDB_worker_js.index.umd.js +0 -443
  36. package/dist/lib_src_worker_db_WASQLiteDB_worker_js.index.umd.js.map +0 -1
  37. package/dist/lib_src_worker_sync_SharedSyncImplementation_worker_js.index.umd.js +0 -1698
  38. package/dist/lib_src_worker_sync_SharedSyncImplementation_worker_js.index.umd.js.map +0 -1
  39. package/dist/vendors-node_modules_async-mutex_index_mjs-node_modules_comlink_dist_esm_comlink_mjs-node_mod-037150.index.umd.js +0 -2339
  40. package/dist/vendors-node_modules_async-mutex_index_mjs-node_modules_comlink_dist_esm_comlink_mjs-node_mod-037150.index.umd.js.map +0 -1
  41. package/dist/vendors-node_modules_bson_lib_bson_mjs.index.umd.js +0 -4437
  42. package/dist/vendors-node_modules_bson_lib_bson_mjs.index.umd.js.map +0 -1
  43. package/dist/vendors-node_modules_crypto-browserify_index_js.index.umd.js +0 -33502
  44. package/dist/vendors-node_modules_crypto-browserify_index_js.index.umd.js.map +0 -1
  45. package/dist/vendors-node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.index.umd.js +0 -173
  46. package/dist/vendors-node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.index.umd.js.map +0 -1
  47. package/dist/vendors-node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.index.umd.js +0 -1926
  48. package/dist/vendors-node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.index.umd.js.map +0 -1
  49. package/lib/src/db/PowerSyncDatabase.js.map +0 -1
  50. package/lib/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.js.map +0 -1
  51. package/lib/src/db/adapters/AbstractWebSQLOpenFactory.js.map +0 -1
  52. package/lib/src/db/adapters/SSRDBAdapter.js.map +0 -1
  53. package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.js.map +0 -1
  54. package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.js.map +0 -1
  55. package/lib/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.js.map +0 -1
  56. package/lib/src/db/adapters/web-sql-flags.js.map +0 -1
  57. package/lib/src/db/sync/SSRWebStreamingSyncImplementation.js.map +0 -1
  58. package/lib/src/db/sync/SharedWebStreamingSyncImplementation.js.map +0 -1
  59. package/lib/src/db/sync/WebRemote.js.map +0 -1
  60. package/lib/src/db/sync/WebStreamingSyncImplementation.js.map +0 -1
  61. package/lib/src/index.js.map +0 -1
  62. package/lib/src/shared/open-db.js.map +0 -1
  63. package/lib/src/shared/types.js.map +0 -1
  64. package/lib/src/worker/db/SharedWASQLiteDB.worker.js.map +0 -1
  65. package/lib/src/worker/db/WASQLiteDB.worker.js.map +0 -1
  66. package/lib/src/worker/db/open-worker-database.js.map +0 -1
  67. package/lib/src/worker/sync/AbstractSharedSyncClientProvider.js.map +0 -1
  68. package/lib/src/worker/sync/BroadcastLogger.js.map +0 -1
  69. package/lib/src/worker/sync/SharedSyncImplementation.js.map +0 -1
  70. package/lib/src/worker/sync/SharedSyncImplementation.worker.js.map +0 -1
@@ -1,490 +0,0 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else if(typeof exports === 'object')
7
- exports["sdk_web"] = factory();
8
- else
9
- root["sdk_web"] = factory();
10
- })(self, () => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ "./lib/src/shared/open-db.js":
16
- /*!***********************************!*\
17
- !*** ./lib/src/shared/open-db.js ***!
18
- \***********************************/
19
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
20
-
21
- __webpack_require__.r(__webpack_exports__);
22
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23
- /* harmony export */ _openDB: () => (/* binding */ _openDB)
24
- /* harmony export */ });
25
- /* harmony import */ var _journeyapps_wa_sqlite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @journeyapps/wa-sqlite */ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js");
26
- /* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! comlink */ "../../node_modules/comlink/dist/esm/comlink.mjs");
27
- /* harmony import */ var async_mutex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! async-mutex */ "../../node_modules/async-mutex/index.mjs");
28
-
29
-
30
-
31
-
32
- let nextId = 1;
33
- async function _openDB(dbFileName, options = { useWebWorker: true }) {
34
- const { default: moduleFactory } = await __webpack_require__.e(/*! import() */ "vendors-node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs").then(__webpack_require__.bind(__webpack_require__, /*! @journeyapps/wa-sqlite/dist/wa-sqlite-async.mjs */ "../../node_modules/@journeyapps/wa-sqlite/dist/wa-sqlite-async.mjs"));
35
- const module = await moduleFactory();
36
- const sqlite3 = _journeyapps_wa_sqlite__WEBPACK_IMPORTED_MODULE_0__.Factory(module);
37
- const { IDBBatchAtomicVFS } = await __webpack_require__.e(/*! import() */ "vendors-node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js").then(__webpack_require__.bind(__webpack_require__, /*! @journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js */ "../../node_modules/@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js"));
38
- const vfs = new IDBBatchAtomicVFS(dbFileName);
39
- sqlite3.vfs_register(vfs, true);
40
- const db = await sqlite3.open_v2(dbFileName);
41
- const statementMutex = new async_mutex__WEBPACK_IMPORTED_MODULE_1__.Mutex();
42
- /**
43
- * Listeners are exclusive to the DB connection.
44
- */
45
- const listeners = new Map();
46
- sqlite3.register_table_onchange_hook(db, (opType, tableName, rowId) => {
47
- Array.from(listeners.values()).forEach((l) => l(opType, tableName, rowId));
48
- });
49
- /**
50
- * This executes single SQL statements inside a requested lock.
51
- */
52
- const execute = async (sql, bindings) => {
53
- // Running multiple statements on the same connection concurrently should not be allowed
54
- return _acquireExecuteLock(async () => {
55
- return executeSingleStatement(sql, bindings);
56
- });
57
- };
58
- /**
59
- * This requests a lock for executing statements.
60
- * Should only be used internally.
61
- */
62
- const _acquireExecuteLock = (callback) => {
63
- return statementMutex.runExclusive(callback);
64
- };
65
- /**
66
- * This executes a single statement using SQLite3.
67
- */
68
- const executeSingleStatement = async (sql, bindings) => {
69
- const results = [];
70
- for await (const stmt of sqlite3.statements(db, sql)) {
71
- let columns;
72
- const wrappedBindings = bindings ? [bindings] : [[]];
73
- for (const binding of wrappedBindings) {
74
- // TODO not sure why this is needed currently, but booleans break
75
- binding.forEach((b, index, arr) => {
76
- if (typeof b == 'boolean') {
77
- arr[index] = b ? 1 : 0;
78
- }
79
- });
80
- sqlite3.reset(stmt);
81
- if (bindings) {
82
- sqlite3.bind_collection(stmt, binding);
83
- }
84
- const rows = [];
85
- while ((await sqlite3.step(stmt)) === _journeyapps_wa_sqlite__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ROW) {
86
- const row = sqlite3.row(stmt);
87
- rows.push(row);
88
- }
89
- columns = columns ?? sqlite3.column_names(stmt);
90
- if (columns.length) {
91
- results.push({ columns, rows });
92
- }
93
- }
94
- // When binding parameters, only a single statement is executed.
95
- if (bindings) {
96
- break;
97
- }
98
- }
99
- const rows = [];
100
- for (const resultset of results) {
101
- for (const row of resultset.rows) {
102
- const outRow = {};
103
- resultset.columns.forEach((key, index) => {
104
- outRow[key] = row[index];
105
- });
106
- rows.push(outRow);
107
- }
108
- }
109
- const result = {
110
- insertId: sqlite3.last_insert_id(db),
111
- rowsAffected: sqlite3.changes(db),
112
- rows: {
113
- _array: rows,
114
- length: rows.length
115
- }
116
- };
117
- return result;
118
- };
119
- /**
120
- * This executes SQL statements in a batch.
121
- */
122
- const executeBatch = async (sql, bindings) => {
123
- return _acquireExecuteLock(async () => {
124
- let affectedRows = 0;
125
- const str = sqlite3.str_new(db, sql);
126
- const query = sqlite3.str_value(str);
127
- try {
128
- await executeSingleStatement('BEGIN TRANSACTION');
129
- //Prepare statement once
130
- const prepared = await sqlite3.prepare_v2(db, query);
131
- if (prepared === null) {
132
- return {
133
- rowsAffected: 0,
134
- rows: { _array: [], length: 0 }
135
- };
136
- }
137
- const wrappedBindings = bindings ? bindings : [];
138
- for (const binding of wrappedBindings) {
139
- // TODO not sure why this is needed currently, but booleans break
140
- for (let i = 0; i < binding.length; i++) {
141
- const b = binding[i];
142
- if (typeof b == 'boolean') {
143
- binding[i] = b ? 1 : 0;
144
- }
145
- }
146
- //Reset bindings
147
- sqlite3.reset(prepared.stmt);
148
- if (bindings) {
149
- sqlite3.bind_collection(prepared.stmt, binding);
150
- }
151
- const result = await sqlite3.step(prepared.stmt);
152
- if (result === _journeyapps_wa_sqlite__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DONE) {
153
- //The value returned by sqlite3_changes() immediately after an INSERT, UPDATE or DELETE statement run on a view is always zero.
154
- affectedRows += sqlite3.changes(db);
155
- }
156
- }
157
- //Finalize prepared statement
158
- await sqlite3.finalize(prepared.stmt);
159
- await executeSingleStatement('COMMIT');
160
- }
161
- catch (err) {
162
- await executeSingleStatement('ROLLBACK');
163
- return {
164
- rowsAffected: 0,
165
- rows: { _array: [], length: 0 }
166
- };
167
- }
168
- finally {
169
- sqlite3.str_finish(str);
170
- }
171
- const result = {
172
- rowsAffected: affectedRows,
173
- rows: { _array: [], length: 0 }
174
- };
175
- return result;
176
- });
177
- };
178
- if (options.useWebWorker) {
179
- const registerOnTableChange = (callback) => {
180
- const id = nextId++;
181
- listeners.set(id, callback);
182
- return comlink__WEBPACK_IMPORTED_MODULE_2__.proxy(() => {
183
- listeners.delete(id);
184
- });
185
- };
186
- return {
187
- execute: comlink__WEBPACK_IMPORTED_MODULE_2__.proxy(execute),
188
- executeBatch: comlink__WEBPACK_IMPORTED_MODULE_2__.proxy(executeBatch),
189
- registerOnTableChange: comlink__WEBPACK_IMPORTED_MODULE_2__.proxy(registerOnTableChange),
190
- close: comlink__WEBPACK_IMPORTED_MODULE_2__.proxy(() => {
191
- sqlite3.close(db);
192
- })
193
- };
194
- }
195
- const registerOnTableChange = (callback) => {
196
- const id = nextId++;
197
- listeners.set(id, callback);
198
- return () => {
199
- listeners.delete(id);
200
- };
201
- };
202
- return {
203
- execute: execute,
204
- executeBatch: executeBatch,
205
- registerOnTableChange: registerOnTableChange,
206
- close: () => sqlite3.close(db)
207
- };
208
- }
209
-
210
-
211
- /***/ }),
212
-
213
- /***/ "./lib/src/worker/db/SharedWASQLiteDB.worker.js":
214
- /*!******************************************************!*\
215
- !*** ./lib/src/worker/db/SharedWASQLiteDB.worker.js ***!
216
- \******************************************************/
217
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
218
-
219
- __webpack_require__.r(__webpack_exports__);
220
- /* harmony import */ var _journeyapps_wa_sqlite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @journeyapps/wa-sqlite */ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js");
221
- /* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! comlink */ "../../node_modules/comlink/dist/esm/comlink.mjs");
222
- /* harmony import */ var _shared_open_db__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/open-db */ "./lib/src/shared/open-db.js");
223
-
224
-
225
-
226
- const _self = self;
227
- const DBMap = new Map();
228
- const OPEN_DB_LOCK = 'open-wasqlite-db';
229
- let nextClientId = 1;
230
- const openDB = async (dbFileName) => {
231
- // Prevent multiple simultaneous opens from causing race conditions
232
- return navigator.locks.request(OPEN_DB_LOCK, async () => {
233
- const clientId = nextClientId++;
234
- if (!DBMap.has(dbFileName)) {
235
- const clientIds = new Set();
236
- const connection = await (0,_shared_open_db__WEBPACK_IMPORTED_MODULE_1__._openDB)(dbFileName);
237
- DBMap.set(dbFileName, {
238
- clientIds,
239
- db: connection
240
- });
241
- }
242
- const dbEntry = DBMap.get(dbFileName);
243
- dbEntry.clientIds.add(clientId);
244
- const { db } = dbEntry;
245
- const wrappedConnection = {
246
- ...db,
247
- close: comlink__WEBPACK_IMPORTED_MODULE_2__.proxy(() => {
248
- const { clientIds } = dbEntry;
249
- clientIds.delete(clientId);
250
- if (clientIds.size == 0) {
251
- console.debug(`Closing connection to ${dbFileName}.`);
252
- DBMap.delete(dbFileName);
253
- return db.close?.();
254
- }
255
- console.debug(`Connection to ${dbFileName} not closed yet due to active clients.`);
256
- })
257
- };
258
- return comlink__WEBPACK_IMPORTED_MODULE_2__.proxy(wrappedConnection);
259
- });
260
- };
261
- _self.onconnect = function (event) {
262
- const port = event.ports[0];
263
- console.debug('Exposing db on port', port);
264
- comlink__WEBPACK_IMPORTED_MODULE_2__.expose(openDB, port);
265
- };
266
- addEventListener('unload', () => {
267
- Array.from(DBMap.values()).forEach(async (dbConnection) => {
268
- const db = await dbConnection.db;
269
- db.close?.();
270
- });
271
- });
272
-
273
-
274
- /***/ })
275
-
276
- /******/ });
277
- /************************************************************************/
278
- /******/ // The module cache
279
- /******/ var __webpack_module_cache__ = {};
280
- /******/
281
- /******/ // The require function
282
- /******/ function __webpack_require__(moduleId) {
283
- /******/ // Check if module is in cache
284
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
285
- /******/ if (cachedModule !== undefined) {
286
- /******/ return cachedModule.exports;
287
- /******/ }
288
- /******/ // Create a new module (and put it into the cache)
289
- /******/ var module = __webpack_module_cache__[moduleId] = {
290
- /******/ // no module.id needed
291
- /******/ // no module.loaded needed
292
- /******/ exports: {}
293
- /******/ };
294
- /******/
295
- /******/ // Execute the module function
296
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
297
- /******/
298
- /******/ // Return the exports of the module
299
- /******/ return module.exports;
300
- /******/ }
301
- /******/
302
- /******/ // expose the modules object (__webpack_modules__)
303
- /******/ __webpack_require__.m = __webpack_modules__;
304
- /******/
305
- /******/ // the startup function
306
- /******/ __webpack_require__.x = () => {
307
- /******/ // Load entry module and return exports
308
- /******/ // This entry module depends on other loaded chunks and execution need to be delayed
309
- /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["vendors-node_modules_async-mutex_index_mjs-node_modules_comlink_dist_esm_comlink_mjs-node_mod-037150"], () => (__webpack_require__("./lib/src/worker/db/SharedWASQLiteDB.worker.js")))
310
- /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
311
- /******/ return __webpack_exports__;
312
- /******/ };
313
- /******/
314
- /************************************************************************/
315
- /******/ /* webpack/runtime/chunk loaded */
316
- /******/ (() => {
317
- /******/ var deferred = [];
318
- /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
319
- /******/ if(chunkIds) {
320
- /******/ priority = priority || 0;
321
- /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
322
- /******/ deferred[i] = [chunkIds, fn, priority];
323
- /******/ return;
324
- /******/ }
325
- /******/ var notFulfilled = Infinity;
326
- /******/ for (var i = 0; i < deferred.length; i++) {
327
- /******/ var [chunkIds, fn, priority] = deferred[i];
328
- /******/ var fulfilled = true;
329
- /******/ for (var j = 0; j < chunkIds.length; j++) {
330
- /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
331
- /******/ chunkIds.splice(j--, 1);
332
- /******/ } else {
333
- /******/ fulfilled = false;
334
- /******/ if(priority < notFulfilled) notFulfilled = priority;
335
- /******/ }
336
- /******/ }
337
- /******/ if(fulfilled) {
338
- /******/ deferred.splice(i--, 1)
339
- /******/ var r = fn();
340
- /******/ if (r !== undefined) result = r;
341
- /******/ }
342
- /******/ }
343
- /******/ return result;
344
- /******/ };
345
- /******/ })();
346
- /******/
347
- /******/ /* webpack/runtime/define property getters */
348
- /******/ (() => {
349
- /******/ // define getter functions for harmony exports
350
- /******/ __webpack_require__.d = (exports, definition) => {
351
- /******/ for(var key in definition) {
352
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
353
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
354
- /******/ }
355
- /******/ }
356
- /******/ };
357
- /******/ })();
358
- /******/
359
- /******/ /* webpack/runtime/ensure chunk */
360
- /******/ (() => {
361
- /******/ __webpack_require__.f = {};
362
- /******/ // This file contains only the entry chunk.
363
- /******/ // The chunk loading function for additional chunks
364
- /******/ __webpack_require__.e = (chunkId) => {
365
- /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
366
- /******/ __webpack_require__.f[key](chunkId, promises);
367
- /******/ return promises;
368
- /******/ }, []));
369
- /******/ };
370
- /******/ })();
371
- /******/
372
- /******/ /* webpack/runtime/get javascript chunk filename */
373
- /******/ (() => {
374
- /******/ // This function allow to reference async chunks and sibling chunks for the entrypoint
375
- /******/ __webpack_require__.u = (chunkId) => {
376
- /******/ // return url for filenames based on template
377
- /******/ return "" + chunkId + ".index.umd.js";
378
- /******/ };
379
- /******/ })();
380
- /******/
381
- /******/ /* webpack/runtime/global */
382
- /******/ (() => {
383
- /******/ __webpack_require__.g = (function() {
384
- /******/ if (typeof globalThis === 'object') return globalThis;
385
- /******/ try {
386
- /******/ return this || new Function('return this')();
387
- /******/ } catch (e) {
388
- /******/ if (typeof window === 'object') return window;
389
- /******/ }
390
- /******/ })();
391
- /******/ })();
392
- /******/
393
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
394
- /******/ (() => {
395
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
396
- /******/ })();
397
- /******/
398
- /******/ /* webpack/runtime/make namespace object */
399
- /******/ (() => {
400
- /******/ // define __esModule on exports
401
- /******/ __webpack_require__.r = (exports) => {
402
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
403
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
404
- /******/ }
405
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
406
- /******/ };
407
- /******/ })();
408
- /******/
409
- /******/ /* webpack/runtime/publicPath */
410
- /******/ (() => {
411
- /******/ var scriptUrl;
412
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
413
- /******/ var document = __webpack_require__.g.document;
414
- /******/ if (!scriptUrl && document) {
415
- /******/ if (document.currentScript)
416
- /******/ scriptUrl = document.currentScript.src;
417
- /******/ if (!scriptUrl) {
418
- /******/ var scripts = document.getElementsByTagName("script");
419
- /******/ if(scripts.length) {
420
- /******/ var i = scripts.length - 1;
421
- /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
422
- /******/ }
423
- /******/ }
424
- /******/ }
425
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
426
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
427
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
428
- /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
429
- /******/ __webpack_require__.p = scriptUrl;
430
- /******/ })();
431
- /******/
432
- /******/ /* webpack/runtime/importScripts chunk loading */
433
- /******/ (() => {
434
- /******/ __webpack_require__.b = self.location + "";
435
- /******/
436
- /******/ // object to store loaded chunks
437
- /******/ // "1" means "already loaded"
438
- /******/ var installedChunks = {
439
- /******/ "lib_src_worker_db_SharedWASQLiteDB_worker_js": 1
440
- /******/ };
441
- /******/
442
- /******/ // importScripts chunk loading
443
- /******/ var installChunk = (data) => {
444
- /******/ var [chunkIds, moreModules, runtime] = data;
445
- /******/ for(var moduleId in moreModules) {
446
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
447
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
448
- /******/ }
449
- /******/ }
450
- /******/ if(runtime) runtime(__webpack_require__);
451
- /******/ while(chunkIds.length)
452
- /******/ installedChunks[chunkIds.pop()] = 1;
453
- /******/ parentChunkLoadingFunction(data);
454
- /******/ };
455
- /******/ __webpack_require__.f.i = (chunkId, promises) => {
456
- /******/ // "1" is the signal for "already loaded"
457
- /******/ if(!installedChunks[chunkId]) {
458
- /******/ if(true) { // all chunks have JS
459
- /******/ importScripts(__webpack_require__.p + __webpack_require__.u(chunkId));
460
- /******/ }
461
- /******/ }
462
- /******/ };
463
- /******/
464
- /******/ var chunkLoadingGlobal = self["webpackChunksdk_web"] = self["webpackChunksdk_web"] || [];
465
- /******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);
466
- /******/ chunkLoadingGlobal.push = installChunk;
467
- /******/
468
- /******/ // no HMR
469
- /******/
470
- /******/ // no HMR manifest
471
- /******/ })();
472
- /******/
473
- /******/ /* webpack/runtime/startup chunk dependencies */
474
- /******/ (() => {
475
- /******/ var next = __webpack_require__.x;
476
- /******/ __webpack_require__.x = () => {
477
- /******/ return __webpack_require__.e("vendors-node_modules_async-mutex_index_mjs-node_modules_comlink_dist_esm_comlink_mjs-node_mod-037150").then(next);
478
- /******/ };
479
- /******/ })();
480
- /******/
481
- /************************************************************************/
482
- /******/
483
- /******/ // run startup
484
- /******/ var __webpack_exports__ = __webpack_require__.x();
485
- /******/
486
- /******/ return __webpack_exports__;
487
- /******/ })()
488
- ;
489
- });
490
- //# sourceMappingURL=lib_src_worker_db_SharedWASQLiteDB_worker_js.index.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lib_src_worker_db_SharedWASQLiteDB_worker_js.index.umd.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACVA;AACA;AACA;AAEA;AAEA;AAEA;AAIA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;;AAEA;AACA;AAEA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;AAGA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACnNA;AACA;AACA;AAYA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACRA;AACA;AACA;AACA;AACA;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACpCA;AACA;AACA;AACA;;;;;AEHA;AACA","sources":["webpack://sdk_web/webpack/universalModuleDefinition","webpack://sdk_web/./src/shared/open-db.ts","webpack://sdk_web/./src/worker/db/SharedWASQLiteDB.worker.ts","webpack://sdk_web/webpack/bootstrap","webpack://sdk_web/webpack/runtime/chunk loaded","webpack://sdk_web/webpack/runtime/define property getters","webpack://sdk_web/webpack/runtime/ensure chunk","webpack://sdk_web/webpack/runtime/get javascript chunk filename","webpack://sdk_web/webpack/runtime/global","webpack://sdk_web/webpack/runtime/hasOwnProperty shorthand","webpack://sdk_web/webpack/runtime/make namespace object","webpack://sdk_web/webpack/runtime/publicPath","webpack://sdk_web/webpack/runtime/importScripts chunk loading","webpack://sdk_web/webpack/runtime/startup chunk dependencies","webpack://sdk_web/webpack/before-startup","webpack://sdk_web/webpack/startup","webpack://sdk_web/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"sdk_web\"] = factory();\n\telse\n\t\troot[\"sdk_web\"] = factory();\n})(self, () => {\nreturn ","import * as SQLite from '@journeyapps/wa-sqlite';\nimport '@journeyapps/wa-sqlite';\nimport * as Comlink from 'comlink';\nimport type { DBFunctionsInterface, OnTableChangeCallback, WASQLExecuteResult } from './types';\nimport { Mutex } from 'async-mutex';\n\nlet nextId = 1;\n\nexport async function _openDB(\n dbFileName: string,\n options: { useWebWorker: boolean } = { useWebWorker: true }\n): Promise<DBFunctionsInterface> {\n const { default: moduleFactory } = await import('@journeyapps/wa-sqlite/dist/wa-sqlite-async.mjs');\n const module = await moduleFactory();\n const sqlite3 = SQLite.Factory(module);\n\n const { IDBBatchAtomicVFS } = await import('@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js');\n const vfs = new IDBBatchAtomicVFS(dbFileName);\n sqlite3.vfs_register(vfs, true);\n\n const db = await sqlite3.open_v2(dbFileName);\n const statementMutex = new Mutex();\n\n /**\n * Listeners are exclusive to the DB connection.\n */\n const listeners = new Map<number, OnTableChangeCallback>();\n\n sqlite3.register_table_onchange_hook(db, (opType: number, tableName: string, rowId: number) => {\n Array.from(listeners.values()).forEach((l) => l(opType, tableName, rowId));\n });\n\n /**\n * This executes single SQL statements inside a requested lock.\n */\n const execute = async (sql: string | TemplateStringsArray, bindings?: any[]): Promise<WASQLExecuteResult> => {\n // Running multiple statements on the same connection concurrently should not be allowed\n return _acquireExecuteLock(async () => {\n return executeSingleStatement(sql, bindings);\n });\n };\n\n /**\n * This requests a lock for executing statements.\n * Should only be used internally.\n */\n const _acquireExecuteLock = <T>(callback: () => Promise<T>): Promise<T> => {\n return statementMutex.runExclusive(callback);\n };\n\n /**\n * This executes a single statement using SQLite3.\n */\n const executeSingleStatement = async (\n sql: string | TemplateStringsArray,\n bindings?: any[]\n ): Promise<WASQLExecuteResult> => {\n const results = [];\n for await (const stmt of sqlite3.statements(db, sql as string)) {\n let columns;\n const wrappedBindings = bindings ? [bindings] : [[]];\n for (const binding of wrappedBindings) {\n // TODO not sure why this is needed currently, but booleans break\n binding.forEach((b, index, arr) => {\n if (typeof b == 'boolean') {\n arr[index] = b ? 1 : 0;\n }\n });\n\n sqlite3.reset(stmt);\n if (bindings) {\n sqlite3.bind_collection(stmt, binding);\n }\n\n const rows = [];\n while ((await sqlite3.step(stmt)) === SQLite.SQLITE_ROW) {\n const row = sqlite3.row(stmt);\n rows.push(row);\n }\n\n columns = columns ?? sqlite3.column_names(stmt);\n if (columns.length) {\n results.push({ columns, rows });\n }\n }\n\n // When binding parameters, only a single statement is executed.\n if (bindings) {\n break;\n }\n }\n\n const rows: Record<string, any>[] = [];\n for (const resultset of results) {\n for (const row of resultset.rows) {\n const outRow: Record<string, any> = {};\n resultset.columns.forEach((key, index) => {\n outRow[key] = row[index];\n });\n rows.push(outRow);\n }\n }\n\n const result = {\n insertId: sqlite3.last_insert_id(db),\n rowsAffected: sqlite3.changes(db),\n rows: {\n _array: rows,\n length: rows.length\n }\n };\n\n return result;\n };\n\n /**\n * This executes SQL statements in a batch.\n */\n const executeBatch = async (sql: string, bindings?: any[][]): Promise<WASQLExecuteResult> => {\n return _acquireExecuteLock(async (): Promise<WASQLExecuteResult> => {\n let affectedRows = 0;\n\n const str = sqlite3.str_new(db, sql);\n const query = sqlite3.str_value(str);\n try {\n await executeSingleStatement('BEGIN TRANSACTION');\n\n //Prepare statement once\n const prepared = await sqlite3.prepare_v2(db, query);\n if (prepared === null) {\n return {\n rowsAffected: 0,\n rows: { _array: [], length: 0 }\n };\n }\n const wrappedBindings = bindings ? bindings : [];\n for (const binding of wrappedBindings) {\n // TODO not sure why this is needed currently, but booleans break\n for (let i = 0; i < binding.length; i++) {\n const b = binding[i];\n if (typeof b == 'boolean') {\n binding[i] = b ? 1 : 0;\n }\n }\n\n //Reset bindings\n sqlite3.reset(prepared.stmt);\n if (bindings) {\n sqlite3.bind_collection(prepared.stmt, binding);\n }\n\n const result = await sqlite3.step(prepared.stmt);\n if (result === SQLite.SQLITE_DONE) {\n //The value returned by sqlite3_changes() immediately after an INSERT, UPDATE or DELETE statement run on a view is always zero.\n affectedRows += sqlite3.changes(db);\n }\n }\n //Finalize prepared statement\n await sqlite3.finalize(prepared.stmt);\n await executeSingleStatement('COMMIT');\n } catch (err) {\n await executeSingleStatement('ROLLBACK');\n return {\n rowsAffected: 0,\n rows: { _array: [], length: 0 }\n };\n } finally {\n sqlite3.str_finish(str);\n }\n const result = {\n rowsAffected: affectedRows,\n rows: { _array: [], length: 0 }\n };\n\n return result;\n });\n };\n\n if (options.useWebWorker) {\n const registerOnTableChange = (callback: OnTableChangeCallback) => {\n const id = nextId++;\n listeners.set(id, callback);\n return Comlink.proxy(() => {\n listeners.delete(id);\n });\n };\n\n return {\n execute: Comlink.proxy(execute),\n executeBatch: Comlink.proxy(executeBatch),\n registerOnTableChange: Comlink.proxy(registerOnTableChange),\n close: Comlink.proxy(() => {\n sqlite3.close(db);\n })\n };\n }\n\n const registerOnTableChange = (callback: OnTableChangeCallback) => {\n const id = nextId++;\n listeners.set(id, callback);\n return () => {\n listeners.delete(id);\n };\n };\n\n return {\n execute: execute,\n executeBatch: executeBatch,\n registerOnTableChange: registerOnTableChange,\n close: () => sqlite3.close(db)\n };\n}\n","import '@journeyapps/wa-sqlite';\nimport * as Comlink from 'comlink';\nimport { _openDB } from '../../shared/open-db';\nimport type { DBFunctionsInterface } from '../../shared/types';\n\n/**\n * Keeps track of open DB connections and the clients which\n * are using it.\n */\ntype SharedDBWorkerConnection = {\n clientIds: Set<number>;\n db: DBFunctionsInterface;\n};\n\nconst _self: SharedWorkerGlobalScope = self as any;\n\nconst DBMap = new Map<string, SharedDBWorkerConnection>();\nconst OPEN_DB_LOCK = 'open-wasqlite-db';\n\nlet nextClientId = 1;\n\nconst openDB = async (dbFileName: string): Promise<DBFunctionsInterface> => {\n // Prevent multiple simultaneous opens from causing race conditions\n return navigator.locks.request(OPEN_DB_LOCK, async () => {\n const clientId = nextClientId++;\n\n if (!DBMap.has(dbFileName)) {\n const clientIds = new Set<number>();\n const connection = await _openDB(dbFileName);\n DBMap.set(dbFileName, {\n clientIds,\n db: connection\n });\n }\n\n const dbEntry = DBMap.get(dbFileName)!;\n dbEntry.clientIds.add(clientId);\n const { db } = dbEntry;\n\n const wrappedConnection = {\n ...db,\n close: Comlink.proxy(() => {\n const { clientIds } = dbEntry;\n clientIds.delete(clientId);\n if (clientIds.size == 0) {\n console.debug(`Closing connection to ${dbFileName}.`);\n DBMap.delete(dbFileName);\n return db.close?.();\n }\n console.debug(`Connection to ${dbFileName} not closed yet due to active clients.`);\n })\n };\n\n return Comlink.proxy(wrappedConnection);\n });\n};\n\n_self.onconnect = function (event: MessageEvent<string>) {\n const port = event.ports[0];\n console.debug('Exposing db on port', port);\n Comlink.expose(openDB, port);\n};\n\naddEventListener('unload', () => {\n Array.from(DBMap.values()).forEach(async (dbConnection) => {\n const db = await dbConnection.db;\n db.close?.();\n });\n});\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [\"vendors-node_modules_async-mutex_index_mjs-node_modules_comlink_dist_esm_comlink_mjs-node_mod-037150\"], () => (__webpack_require__(\"./lib/src/worker/db/SharedWASQLiteDB.worker.js\")))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".index.umd.js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = self.location + \"\";\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t\"lib_src_worker_db_SharedWASQLiteDB_worker_js\": 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = self[\"webpackChunksdk_web\"] = self[\"webpackChunksdk_web\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn __webpack_require__.e(\"vendors-node_modules_async-mutex_index_mjs-node_modules_comlink_dist_esm_comlink_mjs-node_mod-037150\").then(next);\n};","","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n",""],"names":[],"sourceRoot":""}