@kedem/okdb 1.9.1 → 2.0.0

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 (48) hide show
  1. package/README.md +3 -2
  2. package/bin/okdb.js +1 -1
  3. package/docs/deployment.md +155 -0
  4. package/docs/diagnostics.md +115 -0
  5. package/docs/embeddings.md +1 -1
  6. package/docs/functions.md +30 -27
  7. package/docs/getting-started.md +14 -3
  8. package/docs/http-api.md +3 -3
  9. package/docs/http-cluster.md +93 -60
  10. package/docs/index.md +13 -1
  11. package/docs/manifest.json +6 -3
  12. package/docs/pipelines.md +1 -1
  13. package/docs/process-registry.md +5 -5
  14. package/docs/processors.md +35 -18
  15. package/docs/queue.md +112 -42
  16. package/docs/sync.md +10 -7
  17. package/docs/ttl.md +1 -1
  18. package/docs/upgrade-2.0.md +290 -0
  19. package/okdb-functions-sandbox-worker.js +1 -1
  20. package/okdb-http-worker-child.js +1 -1
  21. package/okdb-views-bootstrap-worker.js +1 -1
  22. package/okdb.js +1 -1
  23. package/package.json +1 -1
  24. package/public/layouts/_default.ok.html +1 -1
  25. package/public/sections/db/modals/create-env-modal.ok.js +1 -1
  26. package/public/sections/db/modals/demo-env-modal.ok.js +1 -1
  27. package/public/sections/db/parts/db-overview.ok.js +1 -1
  28. package/public/sections/engines/engine-ui-utils.js +1 -1
  29. package/public/sections/engines/parts/engine-declaration-editor.ok.js +1 -1
  30. package/public/sections/engines/parts/generic-engine-panel.ok.js +1 -1
  31. package/public/sections/queue/parts/code-panel.ok.js +1 -1
  32. package/public/sections/queue/parts/job-log-panel.ok.js +1 -1
  33. package/public/sections/queue/parts/queue-jobs.ok.js +1 -1
  34. package/public/sections/sync/parts/sync-topology.ok.js +1 -1
  35. package/public/sections/system/index.ok.html +1 -1
  36. package/public/sections/system/parts/system-process-panel.ok.js +1 -1
  37. package/public/sections/system/parts/system-processing-panel.ok.js +1 -1
  38. package/public/sections/system/parts/system-runtime-overview.ok.js +1 -1
  39. package/public/setup-app.js +1 -1
  40. package/public/setup.html +116 -55
  41. package/types/index.d.ts +33 -3
  42. package/types/options.d.ts +19 -10
  43. package/docs/worker-fleet.md +0 -139
  44. package/okdb-functions-runner-child.js +0 -1
  45. package/okdb-queue-load-handler.js +0 -1
  46. package/okdb-queue-spawn-child.js +0 -1
  47. package/okdb-worker-child.js +0 -1
  48. package/public/sections/system/parts/system-workers-panel.ok.js +0 -1
@@ -0,0 +1,290 @@
1
+ # Upgrading to okdb 2.0
2
+
3
+ okdb 2.0 is a **breaking redesign of the runtime model**. The document model, storage
4
+ formats, HLC, sync wire protocol, and query/index APIs are **unchanged** — your data and
5
+ your read/write code keep working as-is. What changed is **how a process declares the work
6
+ it does**.
7
+
8
+ > **The one-sentence shift.** okdb stops being a runtime _orchestrator_ (a managed,
9
+ > auto-scaled "worker population") and becomes a _substrate_: **the process is the control
10
+ > unit**, it **declares** what it runs (it is never told by a supervisor), the per-`(env,type)`
11
+ > lease is the load balancer, and **spawning/placement is the launcher's job** — `bin/okdb`,
12
+ > systemd/k8s, or your own code. `new OKDB(path)` is still a correct, do-everything
13
+ > single-process node; you only add nodes when you decide you need them.
14
+
15
+ If you only ever used `new OKDB(path)` and the built-in CLI, **most of this doesn't affect
16
+ you** — the zero-config default is unchanged. The breaking surface is concentrated in the
17
+ constructor options and a few cluster/worker APIs.
18
+
19
+ ---
20
+
21
+ ## Constructor: now pure policy
22
+
23
+ The constructor declares **what role a node plays**. Every _mechanism_ that used to be a flag
24
+ is now **derived** — okdb turns it on the moment it's needed.
25
+
26
+ ```js
27
+ new OKDB(path, {
28
+ processors: true | false, // does this node participate in processing? (claim leases + drain)
29
+ engines: true | false, // embeddings/vector-search this node runs
30
+ compaction: true | false, // eligible to claim the per-env compaction lease
31
+ auth,
32
+ encryptionKey,
33
+ });
34
+ ```
35
+
36
+ There is no `http` constructor option — the HTTP server exists only when you call
37
+ `db.http.listen(port)`.
38
+
39
+ > **`processors` is a plain boolean.** An earlier 2.0 draft exposed a _filtered_ claim API
40
+ > (`processors: '<filter>'`, `db.processors.process()/processRest()/processEverything()`,
41
+ > per-node "dedication" + intent/complement). That was **removed** before release — it is one
42
+ > boolean: `true` = participate (claim every unclaimed `single` lease, the default), `false` =
43
+ > passive (claim nothing). Passing a filter string/array throws. See _Processors: one boolean_ below.
44
+
45
+ ### Removed options — they now **throw** with a migration message
46
+
47
+ | 1.9 option | 2.0 | Error |
48
+ | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
49
+ | `asyncProcessors: true` | `processors: true` (participate — claim every unclaimed lease) | _(thrown, with message)_ |
50
+ | `asyncProcessors: false` | `processors: false` (passive — claim nothing) | _(thrown, with message)_ |
51
+ | `processors: '<filter>'` (2.0 draft) | `processors: true \| false` — the filtered claim form was removed before release | _(thrown, with message)_ |
52
+ | `bus: true \| false` | **removed** — auto-enabled when the LMDB path is shared and the shmbuf native binding is present | `BUS_OPTION_REMOVED` |
53
+ | `envs: 'all' \| 'core' \| […]` | **removed** — envs always open lazily; `removeEnvironment` broadcasts a release signal so handles close | `ENVS_REMOVED` |
54
+ | `sync: false` (per env) | **removed** — the changelog auto-enables for every user env; a pure local store simply never gets a consumer | `SYNC_OPTION_REMOVED` |
55
+ | `processing: 'auto' \| 'main'` | **removed** — participation is the `processors` boolean (see below) | `PROCESSING_REMOVED` _(thrown)_ |
56
+ | `processing: 'threads' \| 'processes'` | **removed** — there is no execution placement to configure: all drains run on the owner's loop in bounded quanta (see _Execution_ below) | `PROCESSING_REMOVED` _(thrown)_ |
57
+ | `workers: …` | **removed** — there is no managed population (see _Workers dissolved_) | _(see `db.workers` below)_ |
58
+ | `compaction: 'active' \| 'passive'` | **removed** (pre-release draft alias, never shipped) — `compaction` is boolean-only, like the other role flags | `COMPACTION_ALIAS_REMOVED` |
59
+
60
+ **Why these are safe to remove:** `bus` is load-bearing but detectable (shared path ⇒ on);
61
+ `envs` was never a real boundary (self-trusted embedded code can `openEnv()` anything) — its
62
+ only job was a Windows file-deletion race, now fixed by the env-release broadcast; the
63
+ changelog only costs anything when something consumes it, so it switches on with the first
64
+ consumer (a view, FTS, processor, subscription, or replication peer) — pre-existing writes are
65
+ covered by that consumer's normal bootstrap (snapshot scan + replay tail).
66
+
67
+ ---
68
+
69
+ ## Processors: one boolean
70
+
71
+ A node either **participates** in processing or it doesn't. That's the whole control surface.
72
+
73
+ ```js
74
+ new OKDB(path, { processors: true }); // participate: claim every unclaimed `single` lease (default)
75
+ new OKDB(path, { processors: false }); // passive: claim nothing (reads/writes + inline still work)
76
+ ```
77
+
78
+ - `new OKDB(path)` (no `processors` option) ⇒ **`processors: true`** — a single node claims
79
+ everything, exactly like 1.9's default full-role instance.
80
+ - The per-`(env,type)` `OKDBLock` lease is the load balancer: with N participating nodes, each
81
+ `single` processor is claimed by exactly one of them (1-of-N); a dead node's leases lapse and a
82
+ survivor re-claims (failover).
83
+ - Under sustained load the lease **load-shares by cooperative hold-window claiming**: a holder
84
+ drains for up to `OKDB_LEASE_HOLD_MS` (200 ms) per window and yields **only if a peer has
85
+ signalled it wants a turn** (a decaying marker in `~lock:want`). A lone process therefore keeps
86
+ its leases and drains at full speed with zero lock churn; when a second process has backlog they
87
+ rotate, splitting the work ≈evenly.
88
+ - Coverage is guaranteed while ≥1 participating node is live. A `single` processor that **no**
89
+ live node claims surfaces as **`unclaimed`** in the Processors view (a warning).
90
+
91
+ `asyncProcessors: true` ≡ `processors: true`; `asyncProcessors: false` ≡ `processors: false`.
92
+
93
+ > **Removed:** the filtered claim API — `processors: '<filter>'`, `db.processors.process(filter)`,
94
+ > `processRest()`, `processEverything()`, and per-node dedication/intent/complement. There is no
95
+ > per-type claim filter: every participating node is identical and the lease distributes the work.
96
+ > The verbs throw with a migration message; a filter value throws at construction. To **dedicate**
97
+ > hardware to processing, invert the flag: run the dedicated node with `processors: true` and open
98
+ > every other node `processors: false` — participation is per-node, so the passive nodes serve
99
+ > reads/writes while the dedicated one drains everything.
100
+
101
+ ---
102
+
103
+ ## Execution: everything on the owner's loop
104
+
105
+ There is exactly **one** execution model, and it is the simple one:
106
+
107
+ - **The event loop** runs reads/writes, sync apply, and every derived-work drain (FTS, views,
108
+ time-machine, materializer, embeddings). A drain never runs monolithically: `_flush` works in
109
+ **FLUSH_QUANTUM-bounded batches** (default 5 000 changes, `OKDB_PROCESSOR_FLUSH_QUANTUM`;
110
+ heavy per-item handlers like FTS use a smaller per-processor quantum), yielding to the loop
111
+ between chunks. The single async **`OKDBWriter`** per env keeps commit fsyncs on lmdb-js's
112
+ native committer thread, so the loop is never blocked on durability.
113
+ - **The sandbox** is the one thread in the engine — it runs **untrusted** per-call function code
114
+ only. Its concurrency is capped per process (`OKDB_FN_SANDBOX_CONCURRENCY`).
115
+ - There is **no processing pool, no slot threads, no off-loop trusted compute**. This was built
116
+ and measured: okdb's derived work is write-dominated (posting/group read-modify-write + fsync),
117
+ which cannot leave the owner — threads bought ~1.0× at real workloads while adding shared-env
118
+ lifecycle hazards. If one process's loop is not enough, run more processes — the 1-of-N lease
119
+ spreads the processors across them (see _Processors_ above).
120
+
121
+ **Ephemeral nodes** (CLI one-shots, serverless, short-lived scripts) should pass
122
+ `processors: false`: a process that grabs a 1-of-N lease and exits mid-quantum would thrash it.
123
+ `bin/okdb`'s one-shot subcommands already open passive.
124
+
125
+ ---
126
+
127
+ ## Workers dissolved — placement is the launcher's job
128
+
129
+ There is **no managed worker population** in 2.0. A "worker" was only ever a process that
130
+ opened the root and claimed processors.
131
+
132
+ | 1.9 | 2.0 |
133
+ | --------------------------------------------- | --------------------------------------------------------------------------------------------------- |
134
+ | `db.workers.ensure({ scale })` | **throws `WORKERS_REMOVED`.** Fork your own nodes: `new OKDB(path, { processors: true })`. |
135
+ | `db.workers.destroy()` | **throws `WORKERS_REMOVED`.** |
136
+ | autoscaler / desired-state / supervisor | gone from the library; survives only as **`bin/okdb`** launcher internals (the reference launcher). |
137
+ | `GET /api/workers`, `POST /api/workers/scale` | **410 `WORKERS_REMOVED`.** |
138
+
139
+ **To run a multi-process processing tier:** start more nodes over the same path — a plain
140
+ `new OKDB(path, { processors: true })` in a process you launch (pm2, systemd, docker, k8s, or
141
+ your own `child_process`). Opening the path _is_ joining — the leases distribute the work across
142
+ whatever nodes exist, and the hold-window rotation load-shares under sustained backlog.
143
+
144
+ okdb still **exposes the scaling signals** (per-processor durable lag, writer queue depth,
145
+ loop-lag) on the Processors/Processes admin surfaces so an external orchestrator can decide when
146
+ to add or retire nodes — but the _policy_ lives wherever you run the processes, not inside okdb.
147
+
148
+ ---
149
+
150
+ ## HTTP clustering: launcher-level only
151
+
152
+ A library node **never forks**. The embeddable child-entry clustering API is removed.
153
+
154
+ | 1.9 | 2.0 |
155
+ | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
156
+ | `http.listen(port, { workers, makeOkdb, primaryOkdb })` | **throws `HTTP_CLUSTER_REMOVED`.** |
157
+ | `bin/okdb` HTTP cluster | **N identical capable nodes** — each forked worker serves HTTP **and** processes (claims leases, drains on its own loop). No privileged processor; the Node-cluster primary is a thin **passive supervisor** (seeds the shared token secret, owns the registry). A dead worker's claims fail over to the rest. |
158
+ | embedder wants socket-sharing | use plain Node `cluster` yourself — a cluster worker calling `http.listen(port)` shares the socket natively, no okdb involvement. Or run **N independent `new OKDB(path)` full nodes** behind your balancer (same "N capable nodes" shape; they coordinate via the shared LMDB + bus + the 1-of-N lease). |
159
+
160
+ `http.listen(port)` (single-process) is **unchanged** and still returns a plain `http.Server`.
161
+
162
+ ---
163
+
164
+ ## Queue & functions
165
+
166
+ **Queue.** The queue is a **substrate okdb coordinates but does not place** — handlers are trusted
167
+ user code of unknown nature. Single-execution and at-least-once come from the CAS claim on the
168
+ durable job row, not from any pool. One verb:
169
+
170
+ - `queue.process(type, closure)` — an in-process consumer on **this** loop.
171
+
172
+ Scale by running more independent consumer processes (pm2, systemd, docker, kubernetes). Each opens
173
+ okdb and calls `process()` — the durable CAS claim hands each job to exactly one consumer without
174
+ coordination. The canonical pattern is a `workers/default.js` standalone script (see docs/queue.md).
175
+
176
+ `queue.worker(type, module)` — the auto-adopted "shared pool" form — was **removed** (throws
177
+ `QUEUE_WORKER_REMOVED`). `queue.spawn(type, module)` — the dedicated forked child — was also
178
+ **removed** in 2.0. Run independent consumer processes instead; they claim the same durable jobs
179
+ exactly once via CAS. The orphan-lock hazard (a forked okdb child that outlives its parent holds
180
+ the LMDB lock) is avoided by using independent processes instead of `child_process.fork`.
181
+
182
+ **Functions.** A function runs on **the node it was asked on**, in that node's per-process
183
+ sandbox thread — no `~fn:requests` round-trip for synchronous calls. Durable / run-eventually
184
+ functions become a queue job on a designated node. `OKDB_FN_LEGACY_POOL` and the fork-pool
185
+ path are gone.
186
+
187
+ ---
188
+
189
+ ## Processor handlers: named-registry vocab
190
+
191
+ okdb 2.0 adopts the **named-registry vocab** for processor handlers (PV-04). The document
192
+ model, storage formats, HLC, sync wire protocol, query/index, and view APIs are **unchanged**.
193
+
194
+ ### Breaking: closure handlers rejected without a quantum or durable definition
195
+
196
+ Bare closures passed as `handler` to `processor.register()` are no longer accepted for
197
+ `single`/`fanout` processors. Replace them with one of:
198
+
199
+ - **Named handler** (built-in, resolved at runtime):
200
+
201
+ ```js
202
+ // Register once at feature-load time:
203
+ OKDBProcessor.registerHandler('my:handler', async (ctx, changes, info) => { ... });
204
+
205
+ // Then register the processor:
206
+ env.processor.register('MyType', { handler: 'my:handler', mode: 'async', distribution: 'single', cursorKey: 'my:key' });
207
+ ```
208
+
209
+ - **Module reference** (external file, resolved via `require`):
210
+ ```js
211
+ env.processor.register('MyType', {
212
+ module: { path: require.resolve('./my-handler.js'), export: 'apply' },
213
+ mode: 'async',
214
+ distribution: 'single',
215
+ cursorKey: 'my:key',
216
+ });
217
+ ```
218
+
219
+ Internal processors that need a closure snapshot-handler must pair it with a `quantum`
220
+ (the reconstructible drain module — FTS, time-machine, materializer use this form) or declare
221
+ `definition: { durable: true }` for inline processors.
222
+
223
+ ### New: handler identity in status output
224
+
225
+ `processor.status()`, `GET /api/processors`, and `GET /api/processors/status` now include:
226
+
227
+ - `handler`: the registered handler name (`'my:handler'`), or `null`
228
+ - `module`: the module spec (`{ path, export }`), or `null`
229
+
230
+ These fields are also persisted to `~proc:state` as `<cursorKey>:handlerMeta` so the
231
+ handler identity is durable across restarts.
232
+
233
+ ### Stored-meta migration
234
+
235
+ On open, FTS type meta (`typesDb`) and procmode desired-state records are automatically
236
+ migrated: `runIn` is dropped, and old mode tokens (`worker`→`single`, `async`→`fanout`)
237
+ are normalized. This migration is idempotent and runs at most once per env.
238
+
239
+ ---
240
+
241
+ ## Compaction, replication, engines — claimed responsibilities
242
+
243
+ Three things that were "a role flag standing in for a cross-process lock" are now explicit
244
+ **claims on the existing flat `OKDBLock`** — which fixes real latent bugs:
245
+
246
+ - **Compaction** is a per-env lease. Concurrent compaction is now impossible by construction
247
+ (1.9 had _no_ lock — two `active` nodes could race the `data.mdb` swap). `compaction: true`
248
+ means "eligible to claim," not "the sole compactor by fiat." A **two-phase drain** shrinks
249
+ reader unavailability from the whole compaction to just the file swap.
250
+ - **Replication** is a `replicate:<peer>` claim — one local owner per remote peer, with
251
+ **lease failover** (1.9 had none; if the syncing process died, replication stopped). The peer
252
+ set stays a durable definition; `sync` never returns as a constructor flag.
253
+ - **Engines** (`vector-search`) fold into the same filter/claim model: a node loads only the
254
+ engines it's placed to run, lazy-loads the HNSW on first query, and evicts when idle (fixing
255
+ the eager-load memory bomb). `embeddings.search()` is **location-transparent** — it resolves
256
+ the index holder and proxies the query over internal HTTP, so search works on any node. The
257
+ `affinity`-tag placement mechanism is deleted.
258
+
259
+ ---
260
+
261
+ ## Persisted records — one open-time shim (automatic)
262
+
263
+ On the first 2.0 `open()`, an idempotent shim reconciles old records. You do nothing.
264
+
265
+ | Record | 2.0 action |
266
+ | --------------------------------------- | ------------------------------------------ |
267
+ | desired-state scope `'workers'` (scale) | obsolete — ignored + deleted |
268
+ | scope `'queue-worker'` definitions | obsolete — auto-adoption removed; inert |
269
+ | scope `'procmode'` records | kept — already canonical `single`/`fanout` |
270
+ | `~engines` records: `affinity` field | stripped/ignored — placement is claims now |
271
+ | `~engines` records: definition fields | kept — the durable engine config |
272
+ | scope `'node'` registry rows | kept |
273
+
274
+ ---
275
+
276
+ ## Quick checklist
277
+
278
+ 1. Remove `asyncProcessors`, `bus`, `envs`, `sync`, `processing`, `workers` from your
279
+ constructor calls. Map `asyncProcessors:true/false` → `processors:true/false`.
280
+ 2. Replace any filtered claim (`processors:'<filter>'`, `db.processors.process()/processRest()/
281
+ processEverything()`) with the boolean `processors: true|false`. Place a processor type by
282
+ running a node where you want it — claiming is first-come on the lease, not configured.
283
+ 3. Replace `queue.worker(type, module)` or `queue.spawn(type, module)` with `queue.process(type, fn)`
284
+ (in-loop), or run a consumer on another independent process/node.
285
+ 4. Replace `db.workers.ensure({scale})` with launching extra `new OKDB(path, { processors: true })`
286
+ nodes (or let `bin/okdb` do it). Use `processors: false` for short-lived/ephemeral processes.
287
+ 5. Replace any `http.listen(port, { workers })` with `bin/okdb` clustering or plain Node `cluster`.
288
+ 6. Drop `sync: false` on environments — a pure local store simply never attaches a consumer.
289
+ 7. If you scraped `/api/workers`, read the registry-sourced `/api/processes/tree` +
290
+ `/api/processors/status` instead.
@@ -1 +1 @@
1
- 'use strict';const _0x3d7a3b=_0x4839;(function(_0x173cac,_0x2f9533){const _0x147bcb=_0x4839,_0x29f596=_0x173cac();while(!![]){try{const _0x2179cf=parseInt(_0x147bcb(0x178))/0x1*(-parseInt(_0x147bcb(0x203))/0x2)+-parseInt(_0x147bcb(0x259))/0x3*(parseInt(_0x147bcb(0x1bd))/0x4)+-parseInt(_0x147bcb(0x222))/0x5*(parseInt(_0x147bcb(0x24c))/0x6)+parseInt(_0x147bcb(0x256))/0x7*(parseInt(_0x147bcb(0x2ce))/0x8)+parseInt(_0x147bcb(0x1f5))/0x9*(-parseInt(_0x147bcb(0x1e7))/0xa)+-parseInt(_0x147bcb(0x170))/0xb*(-parseInt(_0x147bcb(0x266))/0xc)+-parseInt(_0x147bcb(0x1b2))/0xd*(-parseInt(_0x147bcb(0x1e1))/0xe);if(_0x2179cf===_0x2f9533)break;else _0x29f596['push'](_0x29f596['shift']());}catch(_0xa8e78){_0x29f596['push'](_0x29f596['shift']());}}}(_0x1613,0x77828));var require$$0$3=require(_0x3d7a3b(0x2ad)),require$$1=require('v8'),require$$0=require(_0x3d7a3b(0x1cc)),require$$0$2=require(_0x3d7a3b(0x268)),require$$0$1=require(_0x3d7a3b(0x28a)),require$$5=require(_0x3d7a3b(0x2c1));function getDefaultExportFromCjs(_0x1f60e5){const _0xf2ca50=_0x3d7a3b;return _0x1f60e5&&_0x1f60e5[_0xf2ca50(0x1f1)]&&Object['prototype'][_0xf2ca50(0x1de)][_0xf2ca50(0x1c7)](_0x1f60e5,'default')?_0x1f60e5[_0xf2ca50(0x25e)]:_0x1f60e5;}var okdbFunctionsSandboxWorker$1={},okdbFunctionsSandbox,hasRequiredOkdbFunctionsSandbox;function requireOkdbFunctionsSandbox(){if(hasRequiredOkdbFunctionsSandbox)return okdbFunctionsSandbox;hasRequiredOkdbFunctionsSandbox=0x1;const _0x3fd5e2=require$$0;function _0x17a5dd(_0x85a926){const _0x396efc=_0x4839,_0x507157=_0x85a926==='*',_0x4e1b0d=_0x507157?null:new Set(Array[_0x396efc(0x2af)](_0x85a926)?_0x85a926:[]);return function _0x307164(_0x457924,_0x9edcbd){const _0x702a7b=_0x396efc;if(!_0x507157){let _0x19b508;try{const _0x4d46bb=new URL(typeof _0x457924===_0x702a7b(0x21c)?_0x457924:_0x457924?.[_0x702a7b(0x18a)]??String(_0x457924));_0x19b508=_0x4d46bb[_0x702a7b(0x1e8)];}catch{const _0x576b35=new Error(_0x702a7b(0x1fd));return _0x576b35[_0x702a7b(0x28e)]=_0x702a7b(0x254),Promise['reject'](_0x576b35);}if(!_0x4e1b0d[_0x702a7b(0x2cb)](_0x19b508)){const _0x2c0b61=new Error(_0x4e1b0d[_0x702a7b(0x1c6)]===0x0?_0x702a7b(0x2b2):'fetch\x20blocked:\x20hostname\x20\x22'+_0x19b508+_0x702a7b(0x20f));return _0x2c0b61[_0x702a7b(0x28e)]='FETCH_NOT_ALLOWED',Promise[_0x702a7b(0x1d0)](_0x2c0b61);}}return fetch(_0x457924,_0x9edcbd);};}function _0x214b86(_0x3bf0bf={}){const _0x5c9994=_0x4839,_0x3f5bbd=_0x3bf0bf['allowFetch']!==![],_0x364328=_0x3bf0bf['allowedFetchDomains']??[],_0x337b3b={'Date':Date,'Math':Math,'JSON':JSON,'Array':Array,'Object':Object,'String':String,'Number':Number,'Boolean':Boolean,'Map':Map,'Set':Set,'Promise':Promise,'URL':URL,'URLSearchParams':URLSearchParams,'TextEncoder':TextEncoder,'TextDecoder':TextDecoder,'AbortController':AbortController,'AbortSignal':AbortSignal,'setTimeout':setTimeout,'clearTimeout':clearTimeout,'setInterval':setInterval,'clearInterval':clearInterval,'queueMicrotask':queueMicrotask,'structuredClone':structuredClone,'crypto':globalThis[_0x5c9994(0x185)]};return _0x3f5bbd&&typeof fetch===_0x5c9994(0x19b)&&(_0x337b3b[_0x5c9994(0x171)]=_0x17a5dd(_0x364328)),_0x337b3b['globalThis']=_0x337b3b,_0x337b3b;}function _0x5f4a10(_0x3ed1dd,_0x2ab0d8={}){const _0x185105=_0x4839,_0x23a43d=_0x214b86(_0x2ab0d8),_0xe4a2da=_0x3fd5e2[_0x185105(0x22f)](_0x23a43d,{'name':_0x185105(0x2b6),'codeGeneration':{'strings':![],'wasm':![]}});let _0x3d0e3b;try{_0x3d0e3b=new _0x3fd5e2['Script']('('+_0x3ed1dd+')',{'filename':_0x2ab0d8[_0x185105(0x184)]??_0x185105(0x1fc)});}catch(_0x294d3b){const _0x442ade=new Error(_0x294d3b?.[_0x185105(0x2ab)]||'Function\x20script\x20failed\x20to\x20compile');_0x442ade['code']=_0x185105(0x21d),_0x442ade[_0x185105(0x19d)]=_0x294d3b;throw _0x442ade;}let _0x2e05f6;try{_0x2e05f6=_0x3d0e3b[_0x185105(0x167)](_0xe4a2da,{'timeout':_0x2ab0d8[_0x185105(0x16d)]??0x64});}catch(_0x4c00dd){const _0x138fb4=new Error(_0x4c00dd?.['message']||'Function\x20script\x20failed\x20to\x20initialize');_0x138fb4[_0x185105(0x28e)]=_0x185105(0x21d),_0x138fb4[_0x185105(0x19d)]=_0x4c00dd;throw _0x138fb4;}if(typeof _0x2e05f6!=='function'){const _0x305bde=new Error('Function\x20script\x20must\x20evaluate\x20to\x20a\x20callable\x20function');_0x305bde[_0x185105(0x28e)]=_0x185105(0x2c7);throw _0x305bde;}return _0x2e05f6;}return okdbFunctionsSandbox={'createSandboxGlobals':_0x214b86,'compileFunctionExpression':_0x5f4a10,'_buildRestrictedFetch':_0x17a5dd},okdbFunctionsSandbox;}var okdbFunctionsIpc,hasRequiredOkdbFunctionsIpc;function requireOkdbFunctionsIpc(){if(hasRequiredOkdbFunctionsIpc)return okdbFunctionsIpc;hasRequiredOkdbFunctionsIpc=0x1;function _0x237b55(_0x38a4ff){const _0x4afc77=_0x4839;if(!_0x38a4ff)return null;return{'message':_0x38a4ff[_0x4afc77(0x2ab)]||String(_0x38a4ff),'stack':_0x38a4ff[_0x4afc77(0x214)]||null,'code':_0x38a4ff[_0x4afc77(0x28e)]||null,'details':_0x38a4ff[_0x4afc77(0x2b0)]||null};}function _0x462c0b(_0x372494){const _0x1586b9=_0x4839;if(!_0x372494)return new Error(_0x1586b9(0x21e));const _0x29503b=new Error(_0x372494['message']||String(_0x372494));if(_0x372494[_0x1586b9(0x214)])_0x29503b[_0x1586b9(0x214)]=_0x372494['stack'];if(_0x372494['code'])_0x29503b[_0x1586b9(0x28e)]=_0x372494['code'];if(_0x372494['details'])_0x29503b[_0x1586b9(0x2b0)]=_0x372494[_0x1586b9(0x2b0)];return _0x29503b;}return okdbFunctionsIpc={'serializeError':_0x237b55,'deserializeError':_0x462c0b},okdbFunctionsIpc;}var okdbEnums,hasRequiredOkdbEnums;function requireOkdbEnums(){const _0x1dda4f=_0x3d7a3b;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x34dbe8={'PUT':'put','REMOVE':_0x1dda4f(0x211),'INDEX_DROP':_0x1dda4f(0x1cf),'INDEX_REGISTER':_0x1dda4f(0x18e),'INDEX_RESET':_0x1dda4f(0x17a),'TYPE_REGISTER':_0x1dda4f(0x279),'TYPE_DROP':_0x1dda4f(0x21a),'FTS_REGISTER':_0x1dda4f(0x243),'FTS_DROP':_0x1dda4f(0x239),'FTS_RESET':'resetFts','SCHEMA_SET':'setSchema','SCHEMA_DROP':'dropSchema','TTL_SET':_0x1dda4f(0x193),'TTL_CLEAR':_0x1dda4f(0x188)},_0x50e1ff={'SYSTEM_READY':_0x1dda4f(0x20e),'SYSTEM_STOPPED':_0x1dda4f(0x1f3),'SYSTEM_CLOCK_CHANGE':_0x1dda4f(0x275),'SYSTEM_POKE':_0x1dda4f(0x271),'SYSTEM_DRAIN':_0x1dda4f(0x1a3),'SYSTEM_TYPE_DROP':_0x1dda4f(0x179),'SYSTEM_PROC':_0x1dda4f(0x1c5),'SYSTEM_BUS_STATE_CHANGE':_0x1dda4f(0x17f),'ITEM_CREATE':_0x1dda4f(0x282),'ITEM_UPDATE':_0x1dda4f(0x291),'ITEM_REMOVE':_0x1dda4f(0x18f),'INDEX_RESET':_0x1dda4f(0x183),'INDEX_READY':_0x1dda4f(0x1ab),'INDEX_PROGRESS':_0x1dda4f(0x225),'VIEW_PROGRESS':'view:progress','INDEX_DROP':_0x1dda4f(0x241),'INDEX_REGISTERED':_0x1dda4f(0x226),'FTS_REGISTERED':_0x1dda4f(0x2b8),'FTS_DROP':_0x1dda4f(0x2bc),'FTS_RESET':_0x1dda4f(0x28f),'SCHEMA_SET':_0x1dda4f(0x2a1),'SCHEMA_DROP':_0x1dda4f(0x1ba),'UNIQUE_VIOLATION':_0x1dda4f(0x298),'UNIQUE_VIOLATION_RESOLVED':'unique:violation_resolved','REF_VIOLATION':'ref:violation','REF_VIOLATION_RESOLVED':_0x1dda4f(0x16e),'SYNC_APPLY':'sync:apply','TXN_START':_0x1dda4f(0x284),'TXN_END':_0x1dda4f(0x235),'TXN_ROLLBACK':'txn:rollback','TYPE_REGISTERED':_0x1dda4f(0x16c),'TYPE_DROP':_0x1dda4f(0x1a8),'ENV_OPENED':_0x1dda4f(0x258),'ENV_REMOVED':_0x1dda4f(0x28d),'TTL_EXPIRED':_0x1dda4f(0x1be),'TTL_SET':_0x1dda4f(0x196),'TTL_CLEAR':'ttl:clear','LICENSE_INVALID':_0x1dda4f(0x1e0),'LICENSE_ADDED':_0x1dda4f(0x2a0),'LICENSE_ACTIVATED':'license:activated','LICENSE_REMOVED':'license:removed'},_0x21c082={'CREATING':'creating','RESETTING':_0x1dda4f(0x16f),'READY':'ready','DROPPING':_0x1dda4f(0x23e),'WAITING':_0x1dda4f(0x169)},_0x523e1a={'CREATED':_0x1dda4f(0x186),'STARTING':_0x1dda4f(0x29e),'STARTED':_0x1dda4f(0x1df),'STOPPING':'stopping','STOPPED':'stopped'},_0x101964={'CREATING':_0x1dda4f(0x2a4),'READY':_0x1dda4f(0x2c0),'HALTED':'halted','STOPPED':_0x1dda4f(0x20a),'RESETTING':'resetting'},_0x53db1b=Object[_0x1dda4f(0x2c5)]({'POKE':_0x1dda4f(0x250),'DRAIN':'bus:drain','TYPE_DROP':'bus:type_drop','PROC':_0x1dda4f(0x217)});return okdbEnums={'BUS_EVENTS':_0x53db1b,'CHANGE_ACTIONS':_0x34dbe8,'EVENTS':_0x50e1ff,'INDEX_STATE':_0x21c082,'OKDB_STATE':_0x523e1a,'VIEW_STATE':_0x101964},okdbEnums;}var okdbError,hasRequiredOkdbError;function _0x1613(){const _0x19ebc=['txn:start','\x22\x20is\x20used\x20by:\x20',',\x20got\x20','clearTTL','_windowCbs','mode','node:perf_hooks','\x20documents\x20fail\x20validation','_undoHooks','env:removed','code','fts:reset','\x27\x20on\x20type\x20\x27','item:update','tries','INVALID_INDEX_KEY','unsafe','now','NOT_FOUND','addBucket','unique:violation','UNIQUE_CONSTRAINT','cancelled\x20by\x20caller','key','sourceEnv','label','starting','OKDBInvalidValueError','license:added','schema:set','txn\x20ops\x20must\x20be\x20an\x20array','getBucket','creating','_assertOpen','global','getValues','_closeReadTransaction','ms\x20p99=','entries','message','engineKey','worker_threads','ms/','isArray','details','get','fetch\x20is\x20not\x20allowed\x20in\x20this\x20function\x20sandbox\x20(no\x20allowedFetchDomains\x20configured)','rollback','processor','envName','okdb-function-sandbox','Cannot\x20delete\x20','fts:registered','readTransaction','TXN_END','OKDBUniqueConstraintError','fts:drop','stringify','INDEX_ALREADY_REGISTERED','_startAdmission','ready','./okdb','listBuckets','cron','slice','freeze','options','FUNCTION_SCRIPT_INVALID_SHAPE','removeJob',']\x20already\x20maps\x20to\x20\x27','okdb','has','OKDBForeignKeyError','getJob','8zWYNWk','runInContext','pid','waiting','getMany','requestedAt','type:registered','compileTimeoutMs','ref:violation_resolved','resetting','3263227GBdlcw','fetch','start','env','OKDBError','Index\x20\x22','hasIndex','close','376499UbVTwG','system:type_drop','resetIndex','dryRun','ms\x20mean=','value','done','system:bus_state_change','sandbox\x20worker:\x20rootPath\x20missing\x20from\x20workerData','materializer','toFixed','index:reset','filename','crypto','created','job_heartbeat','clearTtl','~system','url','Type\x20\x27','materializerContext','SCHEMA_COLLECTION_INVALID','registerIndex','item:remove','TXN_INVALID_OP','targetType','_drainHandler','setTtl','update','getChanges','ttl:set','_buckets','length','_started','dryRunActions','function','unref','cause','enable','postMessage','FOREIGN_KEY_DELETE_RESTRICTED','getIndexStatus','onDo','system:drain','getTTL','TXN_INVALID_OPS','functionName','_report','type:drop','warn','OKDBIndexNotRegisteredError','index:ready','Version\x20mismatch\x20for\x20','VERSION_MISMATCH','Unsupported\x20transaction\x20action:\x20','passive','signal','args','9186593LQGFDR','txn','OKDBVersionMismatchError','OKDBForeignKeyDeleteError','removeEnvironment','transaction','OKDBIndexHasConsumersError','useReadTransaction','schema:drop','_log','\x27,\x20cannot\x20map\x20to\x20\x27','18808kUukYe','ttl:expired','Invalid\x20primary\x20key\x20type:\x20','getCount','range','version','INDEX_NOT_REGISTERED','loop-lag','system:proc','size','call','targetKey','timeoutMs','\x22\x20on\x20\x22','set','node:vm','reduce','allowedFetchDomains','dropIndex','reject','listTTL','name','getHeapStatistics','setTTL','ensureType','\x20which\x20does\x20not\x20exist','kind','OKDBInvalidIndexKeyError',':\x20expected\x20','hasType','any','updateJob','TXN_ERROR','hasOwnProperty','started','license:invalid','28dEWEBf','queue','used_heap_size','count','openEnv','Transaction\x20already\x20closed','80MDCllU','hostname','Index\x20\x27','_admissionTimer','Schema\x20validation\x20failed\x20for\x20','create','OKDBSchemaValidationError','runId','delete','result','__esModule','OKDBNotFoundError','system:stopped','TYPE_NOT_REGISTERED','272817MNqboi','stderr','note','FOREIGN_KEY_VIOLATION','error','getDefaultTTL','TXN_INVALID_ACTION','okdb-function.js','fetch\x20blocked:\x20invalid\x20URL','bind','TXN_START','type','put','indexReady','4XjYeYQ','Unique\x20constraint\x20violated\x20on\x20','jobContext','actions','upload','targetEnv','_admissionStarted','stopped','processorContext','files','priority','system:ready','\x22\x20is\x20not\x20in\x20the\x20allowedFetchDomains\x20list','\x27\x20already\x20registered','remove','job','setDefaultTTL','stack','max','true','bus:proc','keys','errors','dropType','\x20does\x20not\x20exist','string','FUNCTION_SCRIPT_COMPILE_FAILED','Unknown\x20custom\x20function\x20error','push','enabled','sweepExpiredTTL','56410fQpoQh','transactionSync','sandbox-','index:progress','index:registered','enqueue','tags','join','stats','getEntry','run','maxExtra','createWriteFacade','createContext','getClock','reset','percentile','TXN_ROLLBACK','ttl','txn:end','action','events','query','dropFts','getRange','txn\x20op\x20must\x20be\x20an\x20object\x20or\x20tuple','info','INVALID_VALUE','dropping','sourceKey','catch','index:drop','fatal','registerFts','OKDBSchemaCollectionError','emit','maxMs','.okdb-function.js','_closed','add','object','runtime','120ybXjjc','ftsQuery','getByPrefix','getByPath','bus:poke','TXN_CLOSED','map','onUndo','FETCH_NOT_ALLOWED','requestId','1874789eOEiXr','txn-commit','env:opened','549DArSvg','ttlStats','list','sdk','cursorKey','default','stream','SCHEMA_VALIDATION_FAILED','\x27\x20doesn\x27t\x20exist','INDEX_HAS_CONSUMERS','debug','TYPE_ALREADY_REGISTERED','_envs','36GRaIlK','Unknown\x20transaction\x20action:\x20','uuid','ms\x20busy=','clearDefaultTTL','stop','getIndex','commit','references','claimId','_timer','system:poke','OKDBTypeAlreadyRegisteredError','mean','Unknown\x20OKDB\x20transaction\x20error','system:clock_change','getKeys','byIndex','cancel','registerType','Foreign\x20key\x20violation:\x20','offWindow','timeout','ms\x20max=','_doHooks','patch','(worst\x20','disable','item:create','sourceType'];_0x1613=function(){return _0x19ebc;};return _0x1613();}function requireOkdbError(){if(hasRequiredOkdbError)return okdbError;hasRequiredOkdbError=0x1;class _0x4cee9d extends Error{constructor(_0xdc132e,_0x5a3010,_0xc7c652={}){const _0x1acaa1=_0x4839;super(_0xdc132e),this[_0x1acaa1(0x1d2)]=_0x1acaa1(0x174),this['code']=_0x5a3010,this[_0x1acaa1(0x2b0)]=_0xc7c652,_0xc7c652[_0x1acaa1(0x19d)]&&(this['cause']=_0xc7c652['cause']),Error['captureStackTrace'](this,this['constructor']);}}class _0x46eb7e extends _0x4cee9d{constructor(_0x296291,_0xc9e9c2,_0x5d87a2,_0x10fd66){const _0x4670e0=_0x4839;super(_0x4670e0(0x1ac)+_0x296291+'@'+_0xc9e9c2+_0x4670e0(0x1d9)+_0x5d87a2+_0x4670e0(0x286)+_0x10fd66,_0x4670e0(0x1ad),{'type':_0x296291,'key':_0xc9e9c2,'expectedVersion':_0x5d87a2,'actualVersion':_0x10fd66}),this[_0x4670e0(0x1d2)]=_0x4670e0(0x1b4);}}class _0x1d5696 extends _0x4cee9d{constructor(_0x1c8ca4,_0x14cda2){const _0x3cdb49=_0x4839;super(_0x1c8ca4+'@'+_0x14cda2+_0x3cdb49(0x21b),_0x3cdb49(0x296),{'type':_0x1c8ca4,'key':_0x14cda2}),this['name']=_0x3cdb49(0x1f2);}}class _0x4d335d extends _0x4cee9d{constructor(_0x49dced,_0xebbbd5){const _0x18cba2=_0x4839;super(_0x49dced+'@'+_0xebbbd5+'\x20already\x20exists','ALREADY_EXISTS',{'type':_0x49dced,'key':_0xebbbd5}),this[_0x18cba2(0x1d2)]='OKDBAlreadyExistsError';}}class _0x5cc98f extends _0x4cee9d{constructor(_0x1cc904,_0x5a607f){const _0x112b93=_0x4839,_0x473cd8=typeof _0x5a607f;super('Invalid\x20index\x20key\x20type\x20for\x20\x27'+_0x1cc904+'\x27:\x20'+_0x473cd8+'.\x20Only\x20primitives,\x20null,\x20Buffers,\x20and\x20arrays\x20are\x20allowed.\x20Got:\x20'+_0x5a607f,_0x112b93(0x293),{'index':_0x1cc904,'key':_0x5a607f,'keyType':_0x473cd8}),this[_0x112b93(0x1d2)]=_0x112b93(0x1d8);}}class _0x3360f5 extends _0x4cee9d{constructor(_0x5f261c){const _0x4966d5=_0x4839,_0x41922a=typeof _0x5f261c;super(_0x4966d5(0x1bf)+_0x41922a+'.\x20Primary\x20keys\x20must\x20be\x20string\x20or\x20number.\x20Got:\x20'+_0x5f261c,'INVALID_PRIMARY_KEY',{'key':_0x5f261c,'keyType':_0x41922a}),this[_0x4966d5(0x1d2)]='OKDBInvalidPrimaryKeyError';}}class _0x3acb5f extends _0x4cee9d{constructor(_0x1d7dc7){const _0x5e2a23=_0x4839;super(_0x5e2a23(0x18b)+_0x1d7dc7+_0x5e2a23(0x261),_0x5e2a23(0x1f4),{'type':_0x1d7dc7}),this[_0x5e2a23(0x1d2)]='OKDBTypeNotRegisteredError';}}class _0x2348aa extends _0x4cee9d{constructor(_0x201efb){const _0xd22ac8=_0x4839;super(_0xd22ac8(0x18b)+_0x201efb+_0xd22ac8(0x210),_0xd22ac8(0x264),{'type':_0x201efb}),this['name']=_0xd22ac8(0x272);}}class _0x3bfd65 extends _0x4cee9d{constructor(_0x5d06bc,_0x59041c){const _0x39538c=_0x4839;super(_0x39538c(0x1e9)+_0x59041c+'\x27\x20on\x20type\x20\x27'+_0x5d06bc+'\x27\x20doesn\x27t\x20exist',_0x39538c(0x1c3),{'type':_0x5d06bc,'index':_0x59041c}),this[_0x39538c(0x1d2)]=_0x39538c(0x1aa);}}class _0x5a0d15 extends _0x4cee9d{constructor(_0x8bbca2,_0x3c3475){const _0x1a88d0=_0x4839;super(_0x1a88d0(0x1e9)+_0x3c3475+_0x1a88d0(0x290)+_0x8bbca2+'\x27\x20is\x20already\x20registered',_0x1a88d0(0x2be),{'type':_0x8bbca2,'index':_0x3c3475}),this['name']='OKDBIndexAlreadyRegisteredError';}}class _0x27b997 extends _0x4cee9d{constructor(_0x5bcfaa,_0x4cdac6={}){const _0xb061af=_0x4839;super(_0x5bcfaa,_0xb061af(0x23d),_0x4cdac6),this['name']=_0xb061af(0x29f);}}class _0x1afe2d extends _0x4cee9d{constructor(_0x568053,_0x5d8521,_0x3ff0fe,_0x2084e3,_0x14be6f){const _0x2d40fe=_0x4839;super(_0x2d40fe(0x204)+_0x568053+'@'+_0x5d8521+':\x20key\x20['+_0x3ff0fe+_0x2d40fe(0x2c9)+_0x2084e3+_0x2d40fe(0x1bc)+_0x14be6f+'\x27',_0x2d40fe(0x299),{'type':_0x568053,'index':_0x5d8521,'indexKey':_0x3ff0fe,'existingKey':_0x2084e3,'conflictingKey':_0x14be6f}),this[_0x2d40fe(0x1d2)]=_0x2d40fe(0x2bb);}}class _0x236a92 extends _0x4cee9d{constructor(_0x33572e,_0x1b7cf9,_0x4204c2){const _0x1b1aa0=_0x4839;super(_0x1b1aa0(0x1eb)+_0x33572e+'@'+_0x1b7cf9,_0x1b1aa0(0x260),{'type':_0x33572e,'key':_0x1b7cf9,'errors':_0x4204c2}),this['name']=_0x1b1aa0(0x1ed),this[_0x1b1aa0(0x200)]=_0x33572e,this[_0x1b1aa0(0x29b)]=_0x1b7cf9,this[_0x1b1aa0(0x219)]=_0x4204c2;}}class _0x5c1c45 extends _0x4cee9d{constructor(_0x485b74,_0x44547d){const _0x55676b=_0x4839;super('Cannot\x20set\x20enforce\x20schema\x20on\x20'+_0x485b74+':\x20'+_0x44547d[_0x55676b(0x198)]+_0x55676b(0x28b),_0x55676b(0x18d),{'type':_0x485b74,'failures':_0x44547d}),this[_0x55676b(0x1d2)]=_0x55676b(0x244),this[_0x55676b(0x200)]=_0x485b74,this['failures']=_0x44547d;}}class _0x2839de extends _0x4cee9d{constructor(_0xa16d36,_0x42e16e,_0x53fa2b,_0x5b57dd,_0x2e87cf){const _0x43d5e2=_0x4839;super(_0x43d5e2(0x27a)+_0xa16d36+'@'+_0x42e16e+'.'+_0x53fa2b+'\x20references\x20'+_0x5b57dd+'@'+_0x2e87cf+_0x43d5e2(0x1d6),_0x43d5e2(0x1f8),{'sourceType':_0xa16d36,'sourceKey':_0x42e16e,'fieldPath':_0x53fa2b,'targetType':_0x5b57dd,'targetKey':_0x2e87cf}),this[_0x43d5e2(0x1d2)]=_0x43d5e2(0x2cc),this[_0x43d5e2(0x283)]=_0xa16d36,this[_0x43d5e2(0x23f)]=_0x42e16e,this['fieldPath']=_0x53fa2b,this[_0x43d5e2(0x191)]=_0x5b57dd,this[_0x43d5e2(0x1c8)]=_0x2e87cf;}}class _0x39a3a5 extends _0x4cee9d{constructor(_0x23b8cf,_0x3291a7,_0x1dcf5c){const _0x58cccd=_0x4839;super(_0x58cccd(0x2b7)+_0x23b8cf+'@'+_0x3291a7+':\x20'+_0x1dcf5c[_0x58cccd(0x198)]+'\x20document(s)\x20reference\x20it\x20with\x20onDelete:restrict',_0x58cccd(0x1a0),{'targetType':_0x23b8cf,'targetKey':_0x3291a7,'references':_0x1dcf5c}),this['name']=_0x58cccd(0x1b5),this[_0x58cccd(0x191)]=_0x23b8cf,this[_0x58cccd(0x1c8)]=_0x3291a7,this[_0x58cccd(0x26e)]=_0x1dcf5c;}}class _0x3b8abb extends _0x4cee9d{constructor(_0x2c98ec,_0x396243,_0x3abc14){const _0xd56a83=_0x4839;super(_0xd56a83(0x175)+_0x396243+_0xd56a83(0x1ca)+_0x2c98ec+_0xd56a83(0x285)+_0x3abc14[_0xd56a83(0x252)](_0x4d61ed=>_0x4d61ed[_0xd56a83(0x1d7)]+':'+_0x4d61ed[_0xd56a83(0x1d2)])[_0xd56a83(0x229)](',\x20'),_0xd56a83(0x262),{'type':_0x2c98ec,'index':_0x396243,'usedBy':_0x3abc14}),this[_0xd56a83(0x1d2)]=_0xd56a83(0x1b8);}}return okdbError={'OKDBError':_0x4cee9d,'OKDBVersionMismatchError':_0x46eb7e,'OKDBNotFoundError':_0x1d5696,'OKDBAlreadyExistsError':_0x4d335d,'OKDBInvalidIndexKeyError':_0x5cc98f,'OKDBInvalidPrimaryKeyError':_0x3360f5,'OKDBTypeNotRegisteredError':_0x3acb5f,'OKDBTypeAlreadyRegisteredError':_0x2348aa,'OKDBIndexNotRegisteredError':_0x3bfd65,'OKDBIndexAlreadyRegisteredError':_0x5a0d15,'OKDBInvalidValueError':_0x27b997,'OKDBUniqueConstraintError':_0x1afe2d,'OKDBSchemaValidationError':_0x236a92,'OKDBSchemaCollectionError':_0x5c1c45,'OKDBForeignKeyError':_0x2839de,'OKDBForeignKeyDeleteError':_0x39a3a5,'OKDBIndexHasConsumersError':_0x3b8abb},okdbError;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x439e4a=_0x3d7a3b;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x226968,performance:_0x49f68e}=require$$0$1,_0x389bb5=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG===_0x439e4a(0x216),_0x14e825=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x2a7639=process.env.OKDB_LOOP_LAG_ALL==='1',_0x3db318=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x17af6f{constructor(){const _0x1d86a5=_0x439e4a;this['enabled']=_0x389bb5,this['_buckets']=new Map(),this['_h']=null,this[_0x1d86a5(0x270)]=null,this[_0x1d86a5(0x199)]=![],this[_0x1d86a5(0x1bb)]=(_0x5bbf12,_0x1ac915)=>process[_0x1d86a5(0x1f6)]['write'](_0x5bbf12+(_0x1ac915?'\x20'+JSON[_0x1d86a5(0x2bd)](_0x1ac915):'')+'\x0a');}[_0x439e4a(0x295)](){const _0x403b44=_0x439e4a;return _0x49f68e[_0x403b44(0x295)]();}['setLogger'](_0x2c5456){const _0x4c4877=_0x439e4a;if(typeof _0x2c5456===_0x4c4877(0x19b))this['_log']=_0x2c5456;}[_0x439e4a(0x1f7)](_0x4bfcb3,_0x5e2692,_0x2bc570){const _0xfa4b0e=_0x439e4a;if(!this[_0xfa4b0e(0x220)])return;let _0x176dd2=this[_0xfa4b0e(0x197)][_0xfa4b0e(0x2b1)](_0x4bfcb3);!_0x176dd2&&(_0x176dd2={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this[_0xfa4b0e(0x197)][_0xfa4b0e(0x1cb)](_0x4bfcb3,_0x176dd2)),_0x176dd2['ms']+=_0x5e2692,_0x176dd2[_0xfa4b0e(0x1e4)]+=0x1,_0x5e2692>_0x176dd2['maxMs']&&(_0x176dd2['maxMs']=_0x5e2692,_0x176dd2['maxExtra']=_0x2bc570||'');}[_0x439e4a(0x172)](_0x235cda){const _0x1977ce=_0x439e4a;if(!this[_0x1977ce(0x220)]||this[_0x1977ce(0x199)])return;this[_0x1977ce(0x199)]=!![];if(_0x235cda)this[_0x1977ce(0x1bb)]=_0x235cda;this['_h']=_0x226968({'resolution':0xa}),this['_h'][_0x1977ce(0x19e)](),this[_0x1977ce(0x270)]=setInterval(()=>this[_0x1977ce(0x1a7)](),_0x14e825);if(this[_0x1977ce(0x270)]['unref'])this[_0x1977ce(0x270)][_0x1977ce(0x19c)]();}['onWindow'](_0x49d2fe){const _0x16e386=_0x439e4a;if(!this[_0x16e386(0x288)])this[_0x16e386(0x288)]=new Set();this[_0x16e386(0x288)][_0x16e386(0x249)](_0x49d2fe);if(!this[_0x16e386(0x199)])this[_0x16e386(0x2bf)]();}[_0x439e4a(0x27b)](_0x2a63db){const _0x444964=_0x439e4a;this[_0x444964(0x288)]?.[_0x444964(0x1ef)](_0x2a63db);}['_startAdmission'](){const _0x18e60c=_0x439e4a;if(this[_0x18e60c(0x209)])return;this[_0x18e60c(0x209)]=!![];!this['_h']&&(this['_h']=_0x226968({'resolution':0xa}),this['_h'][_0x18e60c(0x19e)]());const _0x147b94=_0x14e825;this[_0x18e60c(0x1ea)]=setInterval(()=>{const _0x1ea93e=_0x18e60c,_0x15f6f6=this['_h'];if(!_0x15f6f6)return;const _0x169850=_0x15f6f6['percentile'](0x63)/0xf4240,_0x38a75f=_0x15f6f6[_0x1ea93e(0x215)]/0xf4240,_0x2cb050=_0x15f6f6['mean']/0xf4240;_0x15f6f6[_0x1ea93e(0x231)]();if(this[_0x1ea93e(0x288)])for(const _0x4a2c78 of this[_0x1ea93e(0x288)]){try{_0x4a2c78({'p99Ms':_0x169850,'maxMs':_0x38a75f,'meanMs':_0x2cb050,'reportMs':_0x147b94});}catch{}}},_0x147b94);if(this[_0x18e60c(0x1ea)][_0x18e60c(0x19c)])this[_0x18e60c(0x1ea)][_0x18e60c(0x19c)]();}[_0x439e4a(0x1a7)](){const _0x1f8eff=_0x439e4a,_0x4f99dd=this['_h'],_0x4b44fc=_0x4f99dd[_0x1f8eff(0x215)]/0xf4240,_0x355fc8=_0x4f99dd[_0x1f8eff(0x232)](0x63)/0xf4240,_0x431827=_0x4f99dd[_0x1f8eff(0x273)]/0xf4240;_0x4f99dd[_0x1f8eff(0x231)]();const _0x418434=[...this[_0x1f8eff(0x197)][_0x1f8eff(0x2aa)]()][_0x1f8eff(0x252)](([_0x3c2ff4,_0x5a084e])=>({'label':_0x3c2ff4,..._0x5a084e}))['sort']((_0x30ec26,_0x3d74af)=>_0x3d74af['ms']-_0x30ec26['ms'])[_0x1f8eff(0x2c4)](0x0,0x8);this[_0x1f8eff(0x197)]['clear']();const _0x47610d=_0x418434[_0x1f8eff(0x1cd)]((_0x4a186d,_0x555d79)=>_0x4a186d+_0x555d79['ms'],0x0),_0x50fa6b=_0x418434[_0x1f8eff(0x252)](_0x4c2d71=>_0x4c2d71[_0x1f8eff(0x29d)]+'='+_0x4c2d71['ms'][_0x1f8eff(0x182)](0x0)+_0x1f8eff(0x2ae)+_0x4c2d71[_0x1f8eff(0x1e4)]+(_0x4c2d71[_0x1f8eff(0x246)]>0x5?_0x1f8eff(0x280)+_0x4c2d71[_0x1f8eff(0x246)]['toFixed'](0x0)+'ms'+(_0x4c2d71[_0x1f8eff(0x22d)]?'\x20'+_0x4c2d71[_0x1f8eff(0x22d)]:'')+')':''));(_0x2a7639||_0x4b44fc>=_0x3db318)&&this[_0x1f8eff(0x1bb)]('loop-lag\x20'+_0x14e825+_0x1f8eff(0x27d)+_0x4b44fc[_0x1f8eff(0x182)](0x0)+_0x1f8eff(0x2a9)+_0x355fc8[_0x1f8eff(0x182)](0x0)+_0x1f8eff(0x17c)+_0x431827[_0x1f8eff(0x182)](0x0)+_0x1f8eff(0x269)+_0x47610d['toFixed'](0x0)+'ms'+(_0x50fa6b[_0x1f8eff(0x198)]?'\x20│\x20'+_0x50fa6b['join']('\x20\x20'):''),{'feature':_0x1f8eff(0x1c4)});if(this[_0x1f8eff(0x288)])for(const _0x2933a1 of this['_windowCbs']){try{_0x2933a1({'p99Ms':_0x355fc8,'maxMs':_0x4b44fc,'meanMs':_0x431827,'reportMs':_0x14e825});}catch{}}}['stop'](){const _0x524c4a=_0x439e4a;if(this['_timer'])clearInterval(this[_0x524c4a(0x270)]);if(this['_h'])this['_h'][_0x524c4a(0x281)]();this[_0x524c4a(0x270)]=null,this['_h']=null,this[_0x524c4a(0x199)]=![];}}const _0xe9581c=new _0x17af6f();if(_0xe9581c['enabled'])_0xe9581c[_0x439e4a(0x172)]();return okdbLoopMonitor={'LOOP':_0xe9581c},okdbLoopMonitor;}var okdbTransaction,hasRequiredOkdbTransaction;function requireOkdbTransaction(){const _0x4e3532=_0x3d7a3b;if(hasRequiredOkdbTransaction)return okdbTransaction;hasRequiredOkdbTransaction=0x1;const _0x15ddfd=require$$0$2,{EVENTS:_0xe24c3b}=requireOkdbEnums(),{OKDBError:_0x32551b}=requireOkdbError(),{LOOP:_0x36d27f}=requireOkdbLoopMonitor();class _0x2f8c1e{[_0x4e3532(0x2ca)];[_0x4e3532(0x206)]=[];[_0x4e3532(0x27e)]=[];[_0x4e3532(0x28c)]=[];constructor(_0x368125,_0x295ac1={'useReadTransaction':![]}){const _0x49e201=_0x4e3532;this[_0x49e201(0x2ca)]=_0x368125,this[_0x49e201(0x2c6)]=_0x295ac1,this['id']=_0x15ddfd['v4'](),this['readTransaction']=this['options']['useReadTransaction']?this['okdb']['db'][_0x49e201(0x1b9)]():null,this[_0x49e201(0x248)]=![];}[_0x4e3532(0x1a2)](_0x9adb78){const _0x5e909f=_0x4e3532;this[_0x5e909f(0x27e)][_0x5e909f(0x21f)](_0x9adb78);}[_0x4e3532(0x253)](_0x237f99){const _0x3ab858=_0x4e3532;this['_undoHooks'][_0x3ab858(0x21f)](_0x237f99);}[_0x4e3532(0x2a8)](){const _0x403a0d=_0x4e3532;if(!this[_0x403a0d(0x2b9)])return;try{this[_0x403a0d(0x2b9)][_0x403a0d(0x17e)]();}catch(_0x2b5636){}this[_0x403a0d(0x2b9)]=null;}[_0x4e3532(0x2a5)](){const _0x56ceb3=_0x4e3532;if(this[_0x56ceb3(0x248)])throw new _0x32551b('Transaction\x20already\x20closed',_0x56ceb3(0x251));}[_0x4e3532(0x2b1)](_0x3528a7,_0x51e5c7){const _0x5b45b7=_0x4e3532;return this['_assertOpen'](),this['okdb'][_0x5b45b7(0x2b1)](_0x3528a7,_0x51e5c7,{'transaction':this[_0x5b45b7(0x2b9)]});}['getEntry'](_0x32013c,_0x11cf75){const _0x3cd996=_0x4e3532;return this[_0x3cd996(0x2a5)](),this[_0x3cd996(0x2ca)]['getEntry'](_0x32013c,_0x11cf75,{'transaction':this[_0x3cd996(0x2b9)]});}[_0x4e3532(0x16a)](_0x4770ba,_0x4bf686){const _0x1f68a8=_0x4e3532;return this[_0x1f68a8(0x2a5)](),this['okdb'][_0x1f68a8(0x16a)](_0x4770ba,_0x4bf686,{'transaction':this[_0x1f68a8(0x2b9)]});}['getRange'](_0x3d270b,_0x350c3a={}){const _0x2cd72a=_0x4e3532;return this[_0x2cd72a(0x2a5)](),this[_0x2cd72a(0x2ca)]['getRange'](_0x3d270b,{'transaction':this[_0x2cd72a(0x2b9)],..._0x350c3a});}[_0x4e3532(0x2a7)](_0x4c7030,_0x34d9e0={}){const _0x20ee88=_0x4e3532;return this[_0x20ee88(0x2a5)](),this[_0x20ee88(0x2ca)][_0x20ee88(0x2a7)](_0x4c7030,{'transaction':this['readTransaction'],..._0x34d9e0});}[_0x4e3532(0x276)](_0x740d61,_0x503b69={}){const _0x167cea=_0x4e3532;return this[_0x167cea(0x2a5)](),this[_0x167cea(0x2ca)][_0x167cea(0x276)](_0x740d61,{'transaction':this['readTransaction'],..._0x503b69});}[_0x4e3532(0x277)](_0x71d572,_0x2ecb69,_0x415767={}){const _0x54953a=_0x4e3532;return this[_0x54953a(0x2a5)](),this[_0x54953a(0x2ca)][_0x54953a(0x277)](_0x71d572,_0x2ecb69,{'transaction':this[_0x54953a(0x2b9)],..._0x415767});}[_0x4e3532(0x238)](_0x4db6de,_0x473c91,_0x5ef118={}){const _0x1690c4=_0x4e3532;return this[_0x1690c4(0x2a5)](),this[_0x1690c4(0x2ca)][_0x1690c4(0x238)](_0x4db6de,_0x473c91,{'transaction':this['readTransaction'],..._0x5ef118});}[_0x4e3532(0x230)](_0x5c47d9=null){const _0x57b150=_0x4e3532;return this[_0x57b150(0x2a5)](),this[_0x57b150(0x2ca)][_0x57b150(0x230)](_0x5c47d9,{'transaction':this[_0x57b150(0x2b9)]});}[_0x4e3532(0x1c0)](_0x1814b3){const _0x161a15=_0x4e3532;return this[_0x161a15(0x2a5)](),this[_0x161a15(0x2ca)]['getCount'](_0x1814b3,{'transaction':this[_0x161a15(0x2b9)]});}[_0x4e3532(0x201)](_0x5726a1,_0x44e6fb,_0x3aa828,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date[_0x4e3532(0x295)](),origin:origin=null,ttl:ttl=null}={}){const _0x259904=_0x4e3532;this[_0x259904(0x206)][_0x259904(0x21f)]({'action':'put','args':[_0x5726a1,_0x44e6fb,_0x3aa828,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}['update'](_0x25632f,_0xbfccb5,_0x4b8621,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date['now'](),origin:origin=null,ttl:ttl=null}={}){const _0x5049cc=_0x4e3532;this[_0x5049cc(0x206)][_0x5049cc(0x21f)]({'action':_0x5049cc(0x194),'args':[_0x25632f,_0xbfccb5,_0x4b8621,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}['patch'](_0x50070f,_0x23ef14,_0x11e6c1,{ifVersion:ifVersion=null,timestamp:timestamp=Date['now'](),origin:origin=null,ttl:ttl=null}={}){const _0x502720=_0x4e3532;this[_0x502720(0x206)][_0x502720(0x21f)]({'action':'patch','args':[_0x50070f,_0x23ef14,_0x11e6c1,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x4e3532(0x1ec)](_0x372c57,_0x5e2b85,_0x202cfd,{version:version=null,timestamp:timestamp=Date[_0x4e3532(0x295)](),origin:origin=null,ttl:ttl=null}={}){const _0x400bad=_0x4e3532;this['actions']['push']({'action':_0x400bad(0x1ec),'args':[_0x372c57,_0x5e2b85,_0x202cfd,{'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}['remove'](_0x599d9d,_0x464a1c,{ifVersion:ifVersion=null,timestamp:timestamp=Date[_0x4e3532(0x295)](),origin:origin=null}={}){const _0x416532=_0x4e3532;this[_0x416532(0x206)][_0x416532(0x21f)]({'action':_0x416532(0x211),'args':[_0x599d9d,_0x464a1c,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin}]});}[_0x4e3532(0x1d4)](_0x3587d4,_0x7b87a3,_0x3e5b91){const _0x4a6271=_0x4e3532;this[_0x4a6271(0x206)][_0x4a6271(0x21f)]({'action':_0x4a6271(0x1d4),'args':[_0x3587d4,_0x7b87a3,_0x3e5b91]});}['clearTTL'](_0x224bf2,_0x71df54){const _0x1b4959=_0x4e3532;this[_0x1b4959(0x206)][_0x1b4959(0x21f)]({'action':_0x1b4959(0x287),'args':[_0x224bf2,_0x71df54]});}['rollback'](){const _0xedd645=_0x4e3532;if(this[_0xedd645(0x248)])return;for(const _0x3337ff of this[_0xedd645(0x28c)]){try{_0x3337ff();}catch{}}this['okdb']['events'][_0xedd645(0x245)](_0xe24c3b[_0xedd645(0x233)],{'id':this['id']}),this[_0xedd645(0x206)]=[],this[_0xedd645(0x2a8)](),this[_0xedd645(0x248)]=!![];}async['commit'](){const _0x5cb39b=_0x4e3532;if(this[_0x5cb39b(0x248)])throw new Error(_0x5cb39b(0x1e6));const _0x374b57={'id':this['id'],'timestamp':Date['now'](),'actions':this['actions']};this[_0x5cb39b(0x2ca)][_0x5cb39b(0x237)][_0x5cb39b(0x245)](_0xe24c3b[_0x5cb39b(0x1ff)],_0x374b57);try{const _0x521692=_0x36d27f[_0x5cb39b(0x220)]?_0x36d27f[_0x5cb39b(0x295)]():0x0;this[_0x5cb39b(0x2ca)]['db'][_0x5cb39b(0x223)](()=>{const _0x457fef=_0x5cb39b;for(const _0x397999 of this[_0x457fef(0x206)]){const _0x7593ee=this[_0x457fef(0x2ca)]['_'+_0x397999[_0x457fef(0x236)]];if(typeof _0x7593ee!=='function')throw new Error(_0x457fef(0x267)+_0x397999['action']);_0x7593ee[_0x457fef(0x1c7)](this[_0x457fef(0x2ca)],this,..._0x397999[_0x457fef(0x1b1)]);}}),_0x36d27f[_0x5cb39b(0x220)]&&_0x36d27f[_0x5cb39b(0x1f7)](_0x5cb39b(0x257),_0x36d27f[_0x5cb39b(0x295)]()-_0x521692,(this[_0x5cb39b(0x2ca)][_0x5cb39b(0x1d2)]??'?')+'\x20actions='+this[_0x5cb39b(0x206)][_0x5cb39b(0x198)]);}catch(_0x9dbfb8){for(const _0x5dc3e9 of this['_undoHooks']){try{_0x5dc3e9();}catch{}}this[_0x5cb39b(0x2a8)](),this[_0x5cb39b(0x248)]=!![];if(_0x9dbfb8 instanceof _0x32551b)throw _0x9dbfb8;throw new _0x32551b(_0x9dbfb8?.['message']||_0x5cb39b(0x274),_0x5cb39b(0x1dd),{'cause':_0x9dbfb8});}this[_0x5cb39b(0x2ca)][_0x5cb39b(0x237)][_0x5cb39b(0x245)](_0xe24c3b[_0x5cb39b(0x2ba)],_0x374b57);for(const _0x261bbe of this['_doHooks']){try{_0x261bbe();}catch{}}this[_0x5cb39b(0x206)]=[],this['_closeReadTransaction'](),this['_closed']=!![];}static['createWriteFacade'](_0x32b0a7){const _0x2f4446=_0x4e3532;return Object[_0x2f4446(0x2c5)]({'id':_0x32b0a7['id'],'put':_0x32b0a7[_0x2f4446(0x201)][_0x2f4446(0x1fe)](_0x32b0a7),'update':_0x32b0a7[_0x2f4446(0x194)][_0x2f4446(0x1fe)](_0x32b0a7),'patch':_0x32b0a7['patch'][_0x2f4446(0x1fe)](_0x32b0a7),'create':_0x32b0a7[_0x2f4446(0x1ec)]['bind'](_0x32b0a7),'remove':_0x32b0a7[_0x2f4446(0x211)][_0x2f4446(0x1fe)](_0x32b0a7),'setTTL':_0x32b0a7[_0x2f4446(0x1d4)]['bind'](_0x32b0a7),'clearTTL':_0x32b0a7[_0x2f4446(0x287)]['bind'](_0x32b0a7),'commit':_0x32b0a7[_0x2f4446(0x26d)]['bind'](_0x32b0a7),'rollback':_0x32b0a7['rollback']['bind'](_0x32b0a7),'get':_0x32b0a7[_0x2f4446(0x2b1)][_0x2f4446(0x1fe)](_0x32b0a7),'getEntry':_0x32b0a7[_0x2f4446(0x22b)]['bind'](_0x32b0a7),'getMany':_0x32b0a7[_0x2f4446(0x16a)][_0x2f4446(0x1fe)](_0x32b0a7),'getRange':_0x32b0a7[_0x2f4446(0x23a)]['bind'](_0x32b0a7),'getValues':_0x32b0a7[_0x2f4446(0x2a7)][_0x2f4446(0x1fe)](_0x32b0a7),'getKeys':_0x32b0a7[_0x2f4446(0x276)]['bind'](_0x32b0a7),'byIndex':_0x32b0a7[_0x2f4446(0x277)]['bind'](_0x32b0a7),'query':_0x32b0a7[_0x2f4446(0x238)][_0x2f4446(0x1fe)](_0x32b0a7),'getClock':_0x32b0a7[_0x2f4446(0x230)][_0x2f4446(0x1fe)](_0x32b0a7),'getCount':_0x32b0a7[_0x2f4446(0x1c0)][_0x2f4446(0x1fe)](_0x32b0a7),'read':_0x32b0a7,'raw':_0x32b0a7});}static['applyOps'](_0x3b63d9,_0x55b408=[]){const _0x2a2f04=_0x4e3532;if(!Array[_0x2a2f04(0x2af)](_0x55b408))throw new _0x32551b(_0x2a2f04(0x2a2),_0x2a2f04(0x1a5));for(const _0x4ac8e4 of _0x55b408){if(Array[_0x2a2f04(0x2af)](_0x4ac8e4)){const [_0x455662,..._0x34d6c8]=_0x4ac8e4;if(typeof _0x3b63d9[_0x455662]!==_0x2a2f04(0x19b))throw new _0x32551b(_0x2a2f04(0x267)+_0x455662,_0x2a2f04(0x1fb),{'action':_0x455662});_0x3b63d9[_0x455662](..._0x34d6c8);continue;}if(!_0x4ac8e4||typeof _0x4ac8e4!==_0x2a2f04(0x24a))throw new _0x32551b(_0x2a2f04(0x23b),_0x2a2f04(0x190));const {action:_0x220580}=_0x4ac8e4;if(typeof _0x220580!=='string'||typeof _0x3b63d9[_0x220580]!=='function')throw new _0x32551b(_0x2a2f04(0x267)+_0x220580,_0x2a2f04(0x1fb),{'action':_0x220580});switch(_0x220580){case _0x2a2f04(0x201):case _0x2a2f04(0x194):case'create':_0x3b63d9[_0x220580](_0x4ac8e4['type'],_0x4ac8e4[_0x2a2f04(0x29b)],_0x4ac8e4[_0x2a2f04(0x17d)],{..._0x4ac8e4[_0x2a2f04(0x2c6)],'ttl':_0x4ac8e4[_0x2a2f04(0x234)]??_0x4ac8e4[_0x2a2f04(0x2c6)]?.[_0x2a2f04(0x234)]??null});break;case _0x2a2f04(0x27f):_0x3b63d9[_0x2a2f04(0x27f)](_0x4ac8e4[_0x2a2f04(0x200)],_0x4ac8e4[_0x2a2f04(0x29b)],_0x4ac8e4['patch'],{..._0x4ac8e4[_0x2a2f04(0x2c6)],'ttl':_0x4ac8e4['ttl']??_0x4ac8e4[_0x2a2f04(0x2c6)]?.[_0x2a2f04(0x234)]??null});break;case _0x2a2f04(0x211):_0x3b63d9[_0x2a2f04(0x211)](_0x4ac8e4['type'],_0x4ac8e4[_0x2a2f04(0x29b)],_0x4ac8e4['options']||{});break;case _0x2a2f04(0x1d4):_0x3b63d9['setTTL'](_0x4ac8e4[_0x2a2f04(0x200)],_0x4ac8e4[_0x2a2f04(0x29b)],_0x4ac8e4[_0x2a2f04(0x234)]);break;case _0x2a2f04(0x287):_0x3b63d9['clearTTL'](_0x4ac8e4['type'],_0x4ac8e4[_0x2a2f04(0x29b)]);break;default:throw new _0x32551b(_0x2a2f04(0x1ae)+_0x220580,_0x2a2f04(0x1fb),{'action':_0x220580});}}}static async[_0x4e3532(0x22c)](_0x2afad0,_0x48ab6a,_0x4a0dc9={}){const _0x4ed791=_0x4e3532,_0x36f495=new _0x2f8c1e(_0x2afad0,_0x4a0dc9),_0x40b308=_0x2f8c1e[_0x4ed791(0x22e)](_0x36f495);try{typeof _0x48ab6a==='function'?await _0x48ab6a(_0x40b308):_0x2f8c1e['applyOps'](_0x36f495,_0x48ab6a||[]);const _0x12c586=_0x36f495[_0x4ed791(0x206)][_0x4ed791(0x198)];return await _0x36f495['commit'](),{'id':_0x36f495['id'],'actions':_0x12c586};}catch(_0x40ee77){try{_0x36f495[_0x4ed791(0x2b3)]();}catch(_0x2d0032){}throw _0x40ee77;}}}return okdbTransaction=_0x2f8c1e,okdbTransaction;}var okdbFunctionsFacades,hasRequiredOkdbFunctionsFacades;function requireOkdbFunctionsFacades(){if(hasRequiredOkdbFunctionsFacades)return okdbFunctionsFacades;hasRequiredOkdbFunctionsFacades=0x1;const _0x3f30dc=requireOkdbTransaction();function _0x2cc2b7(_0xddae08){const _0x56b679=_0x4839;return{'transaction':typeof _0xddae08[_0x56b679(0x1b7)]===_0x56b679(0x19b)?_0xddae08[_0x56b679(0x1b7)][_0x56b679(0x1fe)](_0xddae08):_0x8c1526=>new _0x3f30dc(_0xddae08,_0x8c1526),'txn':typeof _0xddae08[_0x56b679(0x1b3)]===_0x56b679(0x19b)?_0xddae08[_0x56b679(0x1b3)]['bind'](_0xddae08):(_0x4866ef,_0x42db6b)=>_0x3f30dc[_0x56b679(0x22c)](_0xddae08,_0x4866ef,_0x42db6b)};}function _0x5d790c(_0x5d4058){const _0x2b2b28=_0x4839;return{'name':_0x5d4058['name'],..._0x2cc2b7(_0x5d4058),'put':_0x5d4058[_0x2b2b28(0x201)][_0x2b2b28(0x1fe)](_0x5d4058),'update':_0x5d4058['update'][_0x2b2b28(0x1fe)](_0x5d4058),'patch':_0x5d4058[_0x2b2b28(0x27f)][_0x2b2b28(0x1fe)](_0x5d4058),'create':_0x5d4058[_0x2b2b28(0x1ec)][_0x2b2b28(0x1fe)](_0x5d4058),'remove':_0x5d4058[_0x2b2b28(0x211)]['bind'](_0x5d4058),'get':_0x5d4058[_0x2b2b28(0x2b1)][_0x2b2b28(0x1fe)](_0x5d4058),'getMany':_0x5d4058[_0x2b2b28(0x16a)][_0x2b2b28(0x1fe)](_0x5d4058),'getEntry':_0x5d4058[_0x2b2b28(0x22b)][_0x2b2b28(0x1fe)](_0x5d4058),'getRange':_0x5d4058[_0x2b2b28(0x23a)][_0x2b2b28(0x1fe)](_0x5d4058),'getValues':_0x5d4058[_0x2b2b28(0x2a7)][_0x2b2b28(0x1fe)](_0x5d4058),'getKeys':_0x5d4058[_0x2b2b28(0x276)][_0x2b2b28(0x1fe)](_0x5d4058),'getCount':_0x5d4058[_0x2b2b28(0x1c0)][_0x2b2b28(0x1fe)](_0x5d4058),'getByPrefix':_0x5d4058[_0x2b2b28(0x24e)][_0x2b2b28(0x1fe)](_0x5d4058),'getIndex':_0x5d4058['getIndex'][_0x2b2b28(0x1fe)](_0x5d4058),'byIndex':_0x5d4058[_0x2b2b28(0x277)][_0x2b2b28(0x1fe)](_0x5d4058),'query':_0x5d4058[_0x2b2b28(0x238)][_0x2b2b28(0x1fe)](_0x5d4058),'geoQuery':_0x5d4058['geoQuery'][_0x2b2b28(0x1fe)](_0x5d4058),'ftsQuery':_0x5d4058[_0x2b2b28(0x24d)][_0x2b2b28(0x1fe)](_0x5d4058),'setTTL':_0x5d4058['setTTL'][_0x2b2b28(0x1fe)](_0x5d4058),'getTTL':_0x5d4058['getTTL'][_0x2b2b28(0x1fe)](_0x5d4058),'clearTTL':_0x5d4058[_0x2b2b28(0x287)][_0x2b2b28(0x1fe)](_0x5d4058),'sweepExpiredTTL':_0x5d4058['sweepExpiredTTL'][_0x2b2b28(0x1fe)](_0x5d4058),'listTTL':_0x5d4058['listTTL'][_0x2b2b28(0x1fe)](_0x5d4058),'ttlStats':_0x5d4058['ttlStats'][_0x2b2b28(0x1fe)](_0x5d4058),'setDefaultTTL':_0x5d4058['setDefaultTTL'][_0x2b2b28(0x1fe)](_0x5d4058),'getDefaultTTL':_0x5d4058[_0x2b2b28(0x1fa)][_0x2b2b28(0x1fe)](_0x5d4058),'clearDefaultTTL':_0x5d4058[_0x2b2b28(0x26a)][_0x2b2b28(0x1fe)](_0x5d4058),'registerType':_0x5d4058[_0x2b2b28(0x279)]['bind'](_0x5d4058),'ensureType':_0x5d4058[_0x2b2b28(0x1d5)][_0x2b2b28(0x1fe)](_0x5d4058),'hasType':_0x5d4058[_0x2b2b28(0x1da)][_0x2b2b28(0x1fe)](_0x5d4058),'dropType':_0x5d4058['dropType'][_0x2b2b28(0x1fe)](_0x5d4058),'registerIndex':_0x5d4058[_0x2b2b28(0x18e)][_0x2b2b28(0x1fe)](_0x5d4058),'hasIndex':_0x5d4058[_0x2b2b28(0x176)][_0x2b2b28(0x1fe)](_0x5d4058),'dropIndex':_0x5d4058[_0x2b2b28(0x1cf)][_0x2b2b28(0x1fe)](_0x5d4058),'resetIndex':_0x5d4058[_0x2b2b28(0x17a)][_0x2b2b28(0x1fe)](_0x5d4058),'indexReady':_0x5d4058['indexReady'][_0x2b2b28(0x1fe)](_0x5d4058),'getIndexStatus':_0x5d4058[_0x2b2b28(0x1a1)]['bind'](_0x5d4058),'getClock':_0x5d4058[_0x2b2b28(0x230)]['bind'](_0x5d4058),'getChanges':_0x5d4058[_0x2b2b28(0x195)]['bind'](_0x5d4058),'count':_0x5d4058[_0x2b2b28(0x1e4)]['bind'](_0x5d4058),'range':_0x5d4058[_0x2b2b28(0x1c1)][_0x2b2b28(0x1fe)](_0x5d4058),'now':_0x5d4058[_0x2b2b28(0x295)][_0x2b2b28(0x1fe)](_0x5d4058)};}function _0x322235(_0x11d8e6){const _0x59fe80=_0x4839;if(!_0x11d8e6)return null;const _0x19f207={};for(const _0x50db7b of[_0x59fe80(0x227),_0x59fe80(0x2cd),_0x59fe80(0x25b),'updateJob',_0x59fe80(0x2c8),_0x59fe80(0x297),_0x59fe80(0x2a3),_0x59fe80(0x2c2)]){if(typeof _0x11d8e6[_0x50db7b]===_0x59fe80(0x19b))_0x19f207[_0x50db7b]=_0x11d8e6[_0x50db7b][_0x59fe80(0x1fe)](_0x11d8e6);}return Object[_0x59fe80(0x218)](_0x19f207)[_0x59fe80(0x198)]?_0x19f207:null;}function _0x4c26ca(_0x15f7f9){const _0x53e447=_0x4839;if(!_0x15f7f9)return null;const _0xd4b27a={};for(const _0x241b3f of[_0x53e447(0x207),'stream',_0x53e447(0x211),_0x53e447(0x2b1),_0x53e447(0x25b),_0x53e447(0x24f)]){if(typeof _0x15f7f9[_0x241b3f]==='function')_0xd4b27a[_0x241b3f]=_0x15f7f9[_0x241b3f]['bind'](_0x15f7f9);}return Object['keys'](_0xd4b27a)['length']?_0xd4b27a:null;}function _0x5dac23(_0x1e5007){const _0xea7c1=_0x4839;return{'env':_0x1e5007[_0xea7c1(0x173)][_0xea7c1(0x1fe)](_0x1e5007),'createEnvironment':_0x1e5007['createEnvironment'][_0xea7c1(0x1fe)](_0x1e5007),'removeEnvironment':_0x1e5007[_0xea7c1(0x1b6)][_0xea7c1(0x1fe)](_0x1e5007),'info':_0x1e5007[_0xea7c1(0x23c)],..._0x2cc2b7(_0x1e5007),'put':_0x1e5007['put']['bind'](_0x1e5007),'update':_0x1e5007[_0xea7c1(0x194)]['bind'](_0x1e5007),'patch':_0x1e5007[_0xea7c1(0x27f)][_0xea7c1(0x1fe)](_0x1e5007),'create':_0x1e5007[_0xea7c1(0x1ec)][_0xea7c1(0x1fe)](_0x1e5007),'remove':_0x1e5007[_0xea7c1(0x211)]['bind'](_0x1e5007),'get':_0x1e5007[_0xea7c1(0x2b1)][_0xea7c1(0x1fe)](_0x1e5007),'getMany':_0x1e5007[_0xea7c1(0x16a)]['bind'](_0x1e5007),'getEntry':_0x1e5007[_0xea7c1(0x22b)]['bind'](_0x1e5007),'getRange':_0x1e5007[_0xea7c1(0x23a)][_0xea7c1(0x1fe)](_0x1e5007),'getValues':_0x1e5007[_0xea7c1(0x2a7)][_0xea7c1(0x1fe)](_0x1e5007),'getKeys':_0x1e5007[_0xea7c1(0x276)][_0xea7c1(0x1fe)](_0x1e5007),'getCount':_0x1e5007[_0xea7c1(0x1c0)][_0xea7c1(0x1fe)](_0x1e5007),'getByPrefix':_0x1e5007['getByPrefix'][_0xea7c1(0x1fe)](_0x1e5007),'getIndex':_0x1e5007[_0xea7c1(0x26c)]['bind'](_0x1e5007),'byIndex':_0x1e5007[_0xea7c1(0x277)]['bind'](_0x1e5007),'query':_0x1e5007['query'][_0xea7c1(0x1fe)](_0x1e5007),'setTTL':_0x1e5007[_0xea7c1(0x1d4)][_0xea7c1(0x1fe)](_0x1e5007),'getTTL':_0x1e5007[_0xea7c1(0x1a4)][_0xea7c1(0x1fe)](_0x1e5007),'clearTTL':_0x1e5007[_0xea7c1(0x287)][_0xea7c1(0x1fe)](_0x1e5007),'sweepExpiredTTL':_0x1e5007['sweepExpiredTTL'][_0xea7c1(0x1fe)](_0x1e5007),'listTTL':_0x1e5007[_0xea7c1(0x1d1)][_0xea7c1(0x1fe)](_0x1e5007),'ttlStats':_0x1e5007[_0xea7c1(0x25a)][_0xea7c1(0x1fe)](_0x1e5007),'setDefaultTTL':_0x1e5007[_0xea7c1(0x213)][_0xea7c1(0x1fe)](_0x1e5007),'getDefaultTTL':_0x1e5007['getDefaultTTL'][_0xea7c1(0x1fe)](_0x1e5007),'clearDefaultTTL':_0x1e5007[_0xea7c1(0x26a)][_0xea7c1(0x1fe)](_0x1e5007),'ensureType':_0x1e5007[_0xea7c1(0x1d5)]['bind'](_0x1e5007),'registerType':_0x1e5007['registerType'][_0xea7c1(0x1fe)](_0x1e5007),'hasType':_0x1e5007[_0xea7c1(0x1da)]['bind'](_0x1e5007),'dropType':_0x1e5007[_0xea7c1(0x21a)][_0xea7c1(0x1fe)](_0x1e5007),'registerIndex':_0x1e5007[_0xea7c1(0x18e)]['bind'](_0x1e5007),'hasIndex':_0x1e5007[_0xea7c1(0x176)][_0xea7c1(0x1fe)](_0x1e5007),'dropIndex':_0x1e5007[_0xea7c1(0x1cf)]['bind'](_0x1e5007),'resetIndex':_0x1e5007[_0xea7c1(0x17a)]['bind'](_0x1e5007),'indexReady':_0x1e5007[_0xea7c1(0x202)][_0xea7c1(0x1fe)](_0x1e5007),'getIndexStatus':_0x1e5007[_0xea7c1(0x1a1)][_0xea7c1(0x1fe)](_0x1e5007),'getClock':_0x1e5007[_0xea7c1(0x230)][_0xea7c1(0x1fe)](_0x1e5007),'getChanges':_0x1e5007['getChanges'][_0xea7c1(0x1fe)](_0x1e5007),'queue':_0x1e5007[_0xea7c1(0x1e2)],'files':_0x1e5007[_0xea7c1(0x20c)]};}return okdbFunctionsFacades={'createEnvFacade':_0x5d790c,'createQueueFacade':_0x322235,'createFilesFacade':_0x4c26ca,'createGlobalFacade':_0x5dac23},okdbFunctionsFacades;}var okdbFunctionsDryrun,hasRequiredOkdbFunctionsDryrun;function requireOkdbFunctionsDryrun(){const _0x3f5a41=_0x3d7a3b;if(hasRequiredOkdbFunctionsDryrun)return okdbFunctionsDryrun;hasRequiredOkdbFunctionsDryrun=0x1;const _0xa20061=new Set([_0x3f5a41(0x201),_0x3f5a41(0x27f),'create',_0x3f5a41(0x211),_0x3f5a41(0x194),_0x3f5a41(0x1d4),_0x3f5a41(0x287),_0x3f5a41(0x221),_0x3f5a41(0x213),_0x3f5a41(0x26a),_0x3f5a41(0x21a),_0x3f5a41(0x1cf),_0x3f5a41(0x17a)]),_0x699e28=new Set([_0x3f5a41(0x227),'updateJob',_0x3f5a41(0x2c8),_0x3f5a41(0x297)]),_0x31134e=new Set(['upload','remove']);function _0xbdfd50(_0x261155,_0x30208f){const _0x41a084=_0x3f5a41;if(_0x261155===_0x41a084(0x173)||_0x261155===_0x41a084(0x2a6))return _0xa20061[_0x41a084(0x2cb)](_0x30208f);if(_0x261155===_0x41a084(0x1e2))return _0x699e28[_0x41a084(0x2cb)](_0x30208f);if(_0x261155===_0x41a084(0x20c))return _0x31134e[_0x41a084(0x2cb)](_0x30208f);return![];}function _0x10420f(_0x389f01,_0x14f98a,_0x257529,_0xdb6e5b){if(!_0x389f01)return _0x389f01;return new Proxy(_0x389f01,{'get'(_0x1e2e4e,_0x575cca,_0x3caeb3){const _0x5c6ee5=_0x4839,_0x1d2c5a=Reflect[_0x5c6ee5(0x2b1)](_0x1e2e4e,_0x575cca,_0x3caeb3);if(typeof _0x1d2c5a!==_0x5c6ee5(0x19b))return _0x1d2c5a;if(!_0xbdfd50(_0x14f98a,_0x575cca))return _0x1d2c5a[_0x5c6ee5(0x1fe)](_0x1e2e4e);return function(..._0x458bd5){const _0x59258e=_0x5c6ee5;return _0xdb6e5b[_0x59258e(0x21f)]({'scope':_0x14f98a,'method':_0x575cca,'envName':_0x257529,'args':_0x458bd5}),null;};}});}function _0x22209c(_0x2dd729,_0x558c18,_0x15003f,_0x41b6a2){const _0x37b6c8={};for(const _0x16dff9 of _0x15003f){_0x37b6c8[_0x16dff9]=(..._0x3f59dd)=>{return _0xbdfd50(_0x2dd729,_0x16dff9)&&_0x41b6a2['push']({'scope':_0x2dd729,'method':_0x16dff9,'envName':_0x558c18,'args':_0x3f59dd}),null;};}return _0x37b6c8;}return okdbFunctionsDryrun={'isWriteMethod':_0xbdfd50,'wrapForDryRun':_0x10420f,'syntheticDryRunFacade':_0x22209c,'ENV_WRITE_METHODS':_0xa20061,'QUEUE_WRITE_METHODS':_0x699e28,'FILES_WRITE_METHODS':_0x31134e},okdbFunctionsDryrun;}function _0x4839(_0x12d41d,_0x19ea63){_0x12d41d=_0x12d41d-0x167;const _0x16131a=_0x1613();let _0x4839b3=_0x16131a[_0x12d41d];return _0x4839b3;}var okdbFunctionsContext,hasRequiredOkdbFunctionsContext;function requireOkdbFunctionsContext(){const _0x41c1a3=_0x3d7a3b;if(hasRequiredOkdbFunctionsContext)return okdbFunctionsContext;hasRequiredOkdbFunctionsContext=0x1;const {createEnvFacade:_0x5b49f3,createQueueFacade:_0x30d3bf,createFilesFacade:_0x2a644e,createGlobalFacade:_0x5e4c47}=requireOkdbFunctionsFacades(),{wrapForDryRun:_0x14dc4e,syntheticDryRunFacade:_0x1da87f}=requireOkdbFunctionsDryrun(),_0x4fa5d9=[_0x41c1a3(0x227),_0x41c1a3(0x2cd),'list',_0x41c1a3(0x1dc),_0x41c1a3(0x2c8),'addBucket',_0x41c1a3(0x2a3),_0x41c1a3(0x2c2)],_0x6f9da5=[_0x41c1a3(0x207),_0x41c1a3(0x25f),'remove',_0x41c1a3(0x2b1),_0x41c1a3(0x25b),_0x41c1a3(0x24f)];function _0x17fa80(_0x512678,_0x2e3a97){const _0x344df1=_0x41c1a3,_0x540d68=(_0xd144d5,_0x2d0670,_0xb5ddfb)=>_0x2e3a97({'type':'log','requestId':_0x512678[_0x344df1(0x255)],'runId':_0x512678[_0x344df1(0x1ee)],'entry':{'level':_0xd144d5,'msg':_0x2d0670,'context':_0xb5ddfb,'ts':Date['now']()}}),_0x203bfe=(_0x12c330,_0x547f86)=>_0x540d68(_0x344df1(0x23c),_0x12c330,_0x547f86);return _0x203bfe['info']=(_0x2babd6,_0x45f4db)=>_0x540d68(_0x344df1(0x23c),_0x2babd6,_0x45f4db),_0x203bfe['warn']=(_0x450f89,_0x4ae7ea)=>_0x540d68(_0x344df1(0x1a9),_0x450f89,_0x4ae7ea),_0x203bfe[_0x344df1(0x1f9)]=(_0x314445,_0x184f0f)=>_0x540d68(_0x344df1(0x1f9),_0x314445,_0x184f0f),_0x203bfe[_0x344df1(0x263)]=(_0x5cf179,_0x80dc03)=>_0x540d68(_0x344df1(0x263),_0x5cf179,_0x80dc03),_0x203bfe;}function _0xcf3848(_0x17a74d,_0x524561,_0x11f483){const _0x3ddcd2=_0x41c1a3;if(!_0x17a74d)return null;return{'id':_0x17a74d['id']??null,'type':_0x17a74d[_0x3ddcd2(0x200)]??null,'tries':_0x17a74d[_0x3ddcd2(0x292)]??null,'created':_0x17a74d['created']??null,'tags':_0x17a74d[_0x3ddcd2(0x228)]??null,'priority':_0x17a74d[_0x3ddcd2(0x20d)]??null,'bucket':_0x17a74d['bucket']??null,'cron':_0x17a74d[_0x3ddcd2(0x2c3)]??null,'heartbeat'(){const _0x396779=_0x3ddcd2;_0x11f483({'type':_0x396779(0x187),'requestId':_0x524561['requestId'],'runId':_0x524561['runId'],'jobId':_0x17a74d['id'],'claimId':_0x17a74d[_0x396779(0x26f)]});},'markProgress'(_0x59dcaf){const _0x582f8d=_0x3ddcd2;_0x11f483({'type':'job_progress','requestId':_0x524561[_0x582f8d(0x255)],'runId':_0x524561['runId'],'jobId':_0x17a74d['id'],'claimId':_0x17a74d[_0x582f8d(0x26f)],'message':_0x59dcaf});}};}function _0x2b0b23(_0x175db4){const _0x2bce8a=_0x41c1a3;if(!_0x175db4)return null;return{'mode':_0x175db4['mode']??null,'sourceType':_0x175db4['sourceType']??null,'sourceEnv':_0x175db4[_0x2bce8a(0x29c)]??null,'processor':_0x175db4[_0x2bce8a(0x2b4)]??null,'engineKey':_0x175db4[_0x2bce8a(0x2ac)]??null,'cursorKey':_0x175db4[_0x2bce8a(0x25d)]??null};}function _0x1ddb71(_0x175e66){const _0x4abdb4=_0x41c1a3;if(!_0x175e66)return null;return{'mode':_0x175e66[_0x4abdb4(0x289)]??null,'sourceType':_0x175e66[_0x4abdb4(0x283)]??null,'targetType':_0x175e66[_0x4abdb4(0x191)]??null,'sourceEnv':_0x175e66[_0x4abdb4(0x29c)]??null,'targetEnv':_0x175e66[_0x4abdb4(0x208)]??null,'engineKey':_0x175e66['engineKey']??null,'cursorKey':_0x175e66[_0x4abdb4(0x25d)]??null};}function _0x157955(_0x47eef5,_0x36ba26,_0x57df4b,_0x2ebc73=null,_0x24e0d2=null){const _0x15d5b7=_0x41c1a3,_0x3e524f={'runId':_0x36ba26[_0x15d5b7(0x1ee)],'scope':_0x15d5b7(0x173),'env':_0x36ba26[_0x15d5b7(0x2b5)]??null,'functionName':_0x36ba26['functionName'],'trigger':_0x36ba26[_0x15d5b7(0x23c)]?.['trigger']??_0x15d5b7(0x25c),'requestedAt':_0x36ba26[_0x15d5b7(0x23c)]?.[_0x15d5b7(0x16b)]??Date['now']()},_0x35299b=_0x17fa80(_0x36ba26,_0x57df4b),_0xa499fc=AbortSignal[_0x15d5b7(0x27c)](Math[_0x15d5b7(0x215)](0x1,_0x36ba26[_0x15d5b7(0x24b)]?.[_0x15d5b7(0x1c9)]??0x3e8)),_0x105d82=_0x24e0d2?AbortSignal[_0x15d5b7(0x1db)]([_0xa499fc,_0x24e0d2]):_0xa499fc,_0x5ab8e0=_0x47eef5[_0x15d5b7(0x173)](_0x36ba26[_0x15d5b7(0x2b5)]),_0x1e0bbc=_0x2ebc73?_0x14dc4e(_0x5ab8e0,_0x15d5b7(0x173),_0x36ba26[_0x15d5b7(0x2b5)],_0x2ebc73):_0x5ab8e0,_0x54d535=_0x2ebc73?_0x5ab8e0[_0x15d5b7(0x1e2)]?_0x14dc4e(_0x5ab8e0['queue'],_0x15d5b7(0x1e2),_0x36ba26['envName'],_0x2ebc73):_0x1da87f(_0x15d5b7(0x1e2),_0x36ba26[_0x15d5b7(0x2b5)],_0x4fa5d9,_0x2ebc73):_0x5ab8e0[_0x15d5b7(0x1e2)],_0x48011a=_0x2ebc73?_0x5ab8e0[_0x15d5b7(0x20c)]?_0x14dc4e(_0x5ab8e0[_0x15d5b7(0x20c)],'files',_0x36ba26['envName'],_0x2ebc73):_0x1da87f(_0x15d5b7(0x20c),_0x36ba26[_0x15d5b7(0x2b5)],_0x6f9da5,_0x2ebc73):_0x5ab8e0[_0x15d5b7(0x20c)],_0xeb87c7=_0x5b49f3(_0x1e0bbc),_0x430963=_0x30d3bf(_0x54d535),_0x18c6a1=_0x2a644e(_0x48011a);if(_0x430963)_0xeb87c7[_0x15d5b7(0x1e2)]=_0x430963;if(_0x18c6a1)_0xeb87c7[_0x15d5b7(0x20c)]=_0x18c6a1;const _0x4c3d95={'payload':_0x36ba26['payload']??null,'info':_0x3e524f,'signal':_0x105d82,'log':_0x35299b,'env':_0xeb87c7},_0x21ac0e=_0xcf3848(_0x36ba26[_0x15d5b7(0x205)],_0x36ba26,_0x57df4b);if(_0x21ac0e)_0x4c3d95[_0x15d5b7(0x212)]=_0x21ac0e;const _0x51e61e=_0x2b0b23(_0x36ba26[_0x15d5b7(0x20b)]);if(_0x51e61e)_0x4c3d95[_0x15d5b7(0x2b4)]=_0x51e61e;const _0x25d7e5=_0x1ddb71(_0x36ba26[_0x15d5b7(0x18c)]);if(_0x25d7e5)_0x4c3d95[_0x15d5b7(0x181)]=_0x25d7e5;if(_0x36ba26[_0x15d5b7(0x294)]){const _0x6f1c51=_0x2ebc73?_0x14dc4e(_0x47eef5,'global',null,_0x2ebc73):_0x47eef5;_0x4c3d95['okdb']=_0x5e4c47(_0x6f1c51);}return _0x4c3d95;}return okdbFunctionsContext={'createExecutionContext':_0x157955,'createScriptLogger':_0x17fa80},okdbFunctionsContext;}var hasRequiredOkdbFunctionsSandboxWorker;function requireOkdbFunctionsSandboxWorker(){const _0x3c75f9=_0x3d7a3b;if(hasRequiredOkdbFunctionsSandboxWorker)return okdbFunctionsSandboxWorker$1;hasRequiredOkdbFunctionsSandboxWorker=0x1;const {parentPort:_0x5f3068,workerData:_0x52a69a}=require$$0$3,_0x43b399=require$$1,{compileFunctionExpression:_0x360d15}=requireOkdbFunctionsSandbox(),{serializeError:_0x7e632e}=requireOkdbFunctionsIpc(),{createExecutionContext:_0x37c7eb}=requireOkdbFunctionsContext(),_0x12196f=require$$5;let _0x4ae046=null,_0x58085f=![];const _0x396558=new Map(),_0x3feef9=new Map();function _0x332a36(_0x452d65){const _0x5cf048=_0x4839;try{_0x5f3068[_0x5cf048(0x19f)](_0x452d65);}catch{}}function _0x1a403b(_0x8cd8fe){const _0x51f706=_0x4839,_0xa8e528=(_0x8cd8fe[_0x51f706(0x2b5)]||_0x51f706(0x189))+':'+_0x8cd8fe[_0x51f706(0x1a6)]+':'+_0x8cd8fe[_0x51f706(0x1c2)]+':'+_0x8cd8fe['hash'];let _0x2a0b7b=_0x396558[_0x51f706(0x2b1)](_0xa8e528);return!_0x2a0b7b&&(_0x2a0b7b=_0x360d15(_0x8cd8fe['script'],{'allowFetch':_0x8cd8fe[_0x51f706(0x24b)]?.['allowFetch']!==![],'allowedFetchDomains':_0x8cd8fe[_0x51f706(0x24b)]?.[_0x51f706(0x1ce)],'filename':_0x8cd8fe['functionName']+_0x51f706(0x247)}),_0x396558[_0x51f706(0x1cb)](_0xa8e528,_0x2a0b7b)),_0x2a0b7b;}async function _0x293139(_0x427153){const _0x15a9bf=_0x4839,_0x408dd2=Date[_0x15a9bf(0x295)](),_0x4f819c=new AbortController();_0x3feef9[_0x15a9bf(0x1cb)](_0x427153['requestId'],_0x4f819c);try{const _0x2ffc0a=_0x1a403b(_0x427153);if(_0x427153[_0x15a9bf(0x2b5)])await _0x4ae046[_0x15a9bf(0x1e5)](_0x427153[_0x15a9bf(0x2b5)]);const _0x412fde=_0x427153[_0x15a9bf(0x17b)]?[]:null,_0x2cd6a1=_0x37c7eb(_0x4ae046,_0x427153,_0x332a36,_0x412fde,_0x4f819c[_0x15a9bf(0x1b0)]),_0x5cfb48=await _0x2ffc0a(_0x2cd6a1),_0x203f01={'type':_0x15a9bf(0x1f0),'requestId':_0x427153[_0x15a9bf(0x255)],'runId':_0x427153['runId'],'result':_0x5cfb48,'meta':{'runnerId':'sandbox-'+process[_0x15a9bf(0x168)],'startedAt':_0x408dd2,'finishedAt':Date['now'](),'durationMs':Date['now']()-_0x408dd2}};if(_0x412fde)_0x203f01[_0x15a9bf(0x19a)]=_0x412fde;_0x332a36(_0x203f01);}catch(_0x2f1876){_0x332a36({'type':_0x15a9bf(0x1f9),'requestId':_0x427153['requestId'],'runId':_0x427153[_0x15a9bf(0x1ee)],'error':_0x7e632e(_0x2f1876),'meta':{'runnerId':_0x15a9bf(0x224)+process['pid'],'startedAt':_0x408dd2,'finishedAt':Date[_0x15a9bf(0x295)](),'durationMs':Date[_0x15a9bf(0x295)]()-_0x408dd2}});}finally{_0x3feef9[_0x15a9bf(0x1ef)](_0x427153[_0x15a9bf(0x255)]);}}async function _0xc2a241(){const _0x217a19=_0x4839;if(_0x58085f)return;_0x58085f=!![];try{await _0x4ae046?.[_0x217a19(0x177)]?.();}catch{}process['exit'](0x0);}async function _0xd63b9e(){const _0x311b7f=_0x4839,{rootPath:_0x48cdf2}=_0x52a69a??{};if(!_0x48cdf2)throw new Error(_0x311b7f(0x180));_0x4ae046=new _0x12196f(_0x48cdf2,{'engines':![],'asyncProcessors':![],'compaction':_0x311b7f(0x1af),'http':![],'auth':{'open':!![]}}),await _0x4ae046['open']();const _0x2e1ab6=setInterval(()=>{const _0x50c3a6=_0x311b7f;if(_0x58085f)return;for(const [,_0x54eafb]of _0x4ae046[_0x50c3a6(0x265)]){try{_0x54eafb[_0x50c3a6(0x192)]?.();}catch{}}},0xc8);if(typeof _0x2e1ab6['unref']===_0x311b7f(0x19b))_0x2e1ab6[_0x311b7f(0x19c)]();_0x5f3068['on'](_0x311b7f(0x2ab),_0x30226b=>{const _0x1fd015=_0x311b7f;if(!_0x30226b||typeof _0x30226b!==_0x1fd015(0x24a))return;if(_0x30226b['type']===_0x1fd015(0x26b))return void _0xc2a241();if(_0x30226b['type']===_0x1fd015(0x278)){_0x3feef9[_0x1fd015(0x2b1)](_0x30226b['requestId'])?.['abort'](new Error(_0x1fd015(0x29a)));return;}_0x30226b[_0x1fd015(0x200)]===_0x1fd015(0x22c)&&void _0x293139(_0x30226b[_0x1fd015(0x212)]);});const _0xbea31d=Math[_0x311b7f(0x215)](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0x1d8914=setInterval(()=>{const _0x2d659f=_0x311b7f;try{_0x332a36({'type':_0x2d659f(0x22a),'heapUsed':_0x43b399[_0x2d659f(0x1d3)]()[_0x2d659f(0x1e3)]});}catch{}},_0xbea31d);if(typeof _0x1d8914[_0x311b7f(0x19c)]==='function')_0x1d8914[_0x311b7f(0x19c)]();_0x332a36({'type':_0x311b7f(0x2c0)});}return _0xd63b9e()[_0x3c75f9(0x240)](_0x38ee20=>{const _0x4c3292=_0x3c75f9;_0x332a36({'type':_0x4c3292(0x242),'error':_0x7e632e(_0x38ee20)}),process['exit'](0x1);}),okdbFunctionsSandboxWorker$1;}var okdbFunctionsSandboxWorkerExports=requireOkdbFunctionsSandboxWorker(),okdbFunctionsSandboxWorker=getDefaultExportFromCjs(okdbFunctionsSandboxWorkerExports);module['exports']=okdbFunctionsSandboxWorker;
1
+ 'use strict';const _0x17c8b9=_0x1403;(function(_0x23f997,_0x4ec4ff){const _0x2a3a20=_0x1403,_0x1d26b4=_0x23f997();while(!![]){try{const _0x12a7c3=parseInt(_0x2a3a20(0x1b1))/0x1+parseInt(_0x2a3a20(0x184))/0x2+parseInt(_0x2a3a20(0x1c8))/0x3+-parseInt(_0x2a3a20(0x197))/0x4+-parseInt(_0x2a3a20(0x86))/0x5+parseInt(_0x2a3a20(0x146))/0x6*(parseInt(_0x2a3a20(0x1cd))/0x7)+-parseInt(_0x2a3a20(0x137))/0x8*(parseInt(_0x2a3a20(0x1ce))/0x9);if(_0x12a7c3===_0x4ec4ff)break;else _0x1d26b4['push'](_0x1d26b4['shift']());}catch(_0x2865a7){_0x1d26b4['push'](_0x1d26b4['shift']());}}}(_0x1c24,0xe03eb));var require$$0$3=require(_0x17c8b9(0x180)),require$$2=require('v8'),require$$0=require(_0x17c8b9(0x149)),require$$0$2=require('uuid'),require$$0$1=require(_0x17c8b9(0xc3)),require$$6=require('./okdb');function getDefaultExportFromCjs(_0x48bc3c){const _0x2579e0=_0x17c8b9;return _0x48bc3c&&_0x48bc3c[_0x2579e0(0x19e)]&&Object[_0x2579e0(0x11d)][_0x2579e0(0x85)][_0x2579e0(0x1ad)](_0x48bc3c,_0x2579e0(0x1b9))?_0x48bc3c[_0x2579e0(0x1b9)]:_0x48bc3c;}var okdbFunctionsSandboxWorker$1={},okdbFatalReport,hasRequiredOkdbFatalReport;function requireOkdbFatalReport(){if(hasRequiredOkdbFatalReport)return okdbFatalReport;hasRequiredOkdbFatalReport=0x1;function _0x551c9a(_0x35b93f){const _0x9b670b=_0x1403;if(process.env.OKDB_FATAL_REPORT!=='1')return;try{if(!process[_0x9b670b(0xfe)])return;process['report'][_0x9b670b(0x1b8)]=!![];try{if(_0x9b670b(0x104)in process[_0x9b670b(0xfe)])process['report'][_0x9b670b(0x104)]=process.env.OKDB_FATAL_REPORT_ENV!=='1';}catch{}if(process['platform']!=='win32')try{process[_0x9b670b(0xfe)][_0x9b670b(0x17b)]=!![];if(typeof process[_0x9b670b(0xfe)][_0x9b670b(0x1a5)]===_0x9b670b(0x108))process['report'][_0x9b670b(0x1a5)]=_0x9b670b(0x16e);}catch{}if(process.env.OKDB_REPORT_DIR)try{require('fs')[_0x9b670b(0xcf)](process.env.OKDB_REPORT_DIR,{'recursive':!![]}),process['report'][_0x9b670b(0x13e)]=process.env.OKDB_REPORT_DIR;}catch{}try{process[_0x9b670b(0xfe)][_0x9b670b(0x166)]='';}catch{}if(_0x35b93f)process.env.OKDB_REPORT_TAG=String(_0x35b93f);}catch{}}return okdbFatalReport={'enableFatalReport':_0x551c9a},okdbFatalReport;}var okdbFunctionsSandbox,hasRequiredOkdbFunctionsSandbox;function requireOkdbFunctionsSandbox(){if(hasRequiredOkdbFunctionsSandbox)return okdbFunctionsSandbox;hasRequiredOkdbFunctionsSandbox=0x1;const _0x39a6f2=require$$0;function _0x5db1b7(_0x3f02a3){const _0x383aa7=_0x1403,_0x2d25d3=_0x3f02a3==='*',_0x473623=_0x2d25d3?null:new Set(Array[_0x383aa7(0xce)](_0x3f02a3)?_0x3f02a3:[]);return function _0x4abc06(_0x4528c0,_0x38b40f){const _0xd5309d=_0x383aa7;if(!_0x2d25d3){let _0x19258b;try{const _0x26f710=new URL(typeof _0x4528c0===_0xd5309d(0x108)?_0x4528c0:_0x4528c0?.[_0xd5309d(0xf3)]??String(_0x4528c0));_0x19258b=_0x26f710[_0xd5309d(0xeb)];}catch{const _0xe85f42=new Error(_0xd5309d(0x1b2));return _0xe85f42[_0xd5309d(0xf8)]=_0xd5309d(0x1bf),Promise[_0xd5309d(0xa7)](_0xe85f42);}if(!_0x473623['has'](_0x19258b)){const _0x5a3ff1=new Error(_0x473623[_0xd5309d(0x6d)]===0x0?_0xd5309d(0x193):_0xd5309d(0x19b)+_0x19258b+_0xd5309d(0x160));return _0x5a3ff1['code']='FETCH_NOT_ALLOWED',Promise['reject'](_0x5a3ff1);}}return fetch(_0x4528c0,_0x38b40f);};}function _0x435f21(_0x4a079f={}){const _0x32bffb=_0x1403,_0xd2233e=_0x4a079f[_0x32bffb(0x6c)]!==![],_0x53a0ef=_0x4a079f[_0x32bffb(0x136)]??[],_0x45f720={'Date':Date,'Math':Math,'JSON':JSON,'Array':Array,'Object':Object,'String':String,'Number':Number,'Boolean':Boolean,'Map':Map,'Set':Set,'Promise':Promise,'URL':URL,'URLSearchParams':URLSearchParams,'TextEncoder':TextEncoder,'TextDecoder':TextDecoder,'AbortController':AbortController,'AbortSignal':AbortSignal,'setTimeout':setTimeout,'clearTimeout':clearTimeout,'setInterval':setInterval,'clearInterval':clearInterval,'queueMicrotask':queueMicrotask,'structuredClone':structuredClone,'crypto':globalThis[_0x32bffb(0xb1)]};return _0xd2233e&&typeof fetch===_0x32bffb(0x74)&&(_0x45f720[_0x32bffb(0x16b)]=_0x5db1b7(_0x53a0ef)),_0x45f720[_0x32bffb(0xe5)]=_0x45f720,_0x45f720;}function _0x35dc5d(_0x36c14f,_0x18d945={}){const _0x3d3f43=_0x1403,_0x50eb42=_0x435f21(_0x18d945),_0x111878=_0x39a6f2[_0x3d3f43(0x68)](_0x50eb42,{'name':'okdb-function-sandbox','codeGeneration':{'strings':![],'wasm':![]}});let _0x242882;try{_0x242882=new _0x39a6f2['Script']('('+_0x36c14f+')',{'filename':_0x18d945['filename']??_0x3d3f43(0x7b)});}catch(_0x5d3ccf){const _0x1569b1=new Error(_0x5d3ccf?.['message']||_0x3d3f43(0x6e));_0x1569b1[_0x3d3f43(0xf8)]=_0x3d3f43(0x92),_0x1569b1[_0x3d3f43(0xa8)]=_0x5d3ccf;throw _0x1569b1;}let _0x7900a4;try{_0x7900a4=_0x242882[_0x3d3f43(0x9a)](_0x111878,{'timeout':_0x18d945[_0x3d3f43(0x130)]??0x64});}catch(_0x4f6122){const _0x58d5fc=new Error(_0x4f6122?.[_0x3d3f43(0x132)]||_0x3d3f43(0x129));_0x58d5fc[_0x3d3f43(0xf8)]=_0x3d3f43(0x92),_0x58d5fc['cause']=_0x4f6122;throw _0x58d5fc;}if(typeof _0x7900a4!=='function'){const _0x3731be=new Error(_0x3d3f43(0x176));_0x3731be[_0x3d3f43(0xf8)]='FUNCTION_SCRIPT_INVALID_SHAPE';throw _0x3731be;}return _0x7900a4;}return okdbFunctionsSandbox={'createSandboxGlobals':_0x435f21,'compileFunctionExpression':_0x35dc5d,'_buildRestrictedFetch':_0x5db1b7},okdbFunctionsSandbox;}var okdbFunctionsIpc,hasRequiredOkdbFunctionsIpc;function requireOkdbFunctionsIpc(){if(hasRequiredOkdbFunctionsIpc)return okdbFunctionsIpc;hasRequiredOkdbFunctionsIpc=0x1;function _0x1072a1(_0x19514d){const _0x3cb01b=_0x1403;if(!_0x19514d)return null;return{'message':_0x19514d[_0x3cb01b(0x132)]||String(_0x19514d),'stack':_0x19514d[_0x3cb01b(0x174)]||null,'code':_0x19514d[_0x3cb01b(0xf8)]||null,'details':_0x19514d[_0x3cb01b(0xab)]||null};}function _0x3e6a17(_0x40cc7c){const _0x165fd4=_0x1403;if(!_0x40cc7c)return new Error('Unknown\x20custom\x20function\x20error');const _0x34aec3=new Error(_0x40cc7c[_0x165fd4(0x132)]||String(_0x40cc7c));if(_0x40cc7c[_0x165fd4(0x174)])_0x34aec3[_0x165fd4(0x174)]=_0x40cc7c['stack'];if(_0x40cc7c[_0x165fd4(0xf8)])_0x34aec3[_0x165fd4(0xf8)]=_0x40cc7c[_0x165fd4(0xf8)];if(_0x40cc7c['details'])_0x34aec3['details']=_0x40cc7c['details'];return _0x34aec3;}return okdbFunctionsIpc={'serializeError':_0x1072a1,'deserializeError':_0x3e6a17},okdbFunctionsIpc;}var okdbEnums,hasRequiredOkdbEnums;function requireOkdbEnums(){const _0x117c38=_0x17c8b9;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x138c7c={'PUT':_0x117c38(0xcd),'REMOVE':_0x117c38(0x12d),'INDEX_DROP':_0x117c38(0x10b),'INDEX_REGISTER':'registerIndex','INDEX_RESET':_0x117c38(0x88),'TYPE_REGISTER':_0x117c38(0xd2),'TYPE_DROP':_0x117c38(0xc1),'FTS_REGISTER':'registerFts','FTS_DROP':_0x117c38(0x127),'FTS_RESET':_0x117c38(0x8a),'SCHEMA_SET':_0x117c38(0x157),'SCHEMA_DROP':_0x117c38(0x17f),'TTL_SET':_0x117c38(0x15e),'TTL_CLEAR':_0x117c38(0x1b5)},_0x4c33e0={'SYSTEM_READY':_0x117c38(0xc0),'SYSTEM_STOPPED':_0x117c38(0xed),'SYSTEM_CLOCK_CHANGE':_0x117c38(0x1ae),'SYSTEM_POKE':_0x117c38(0x10c),'SYSTEM_DRAIN':_0x117c38(0x1b3),'SYSTEM_TYPE_DROP':'system:type_drop','SYSTEM_PROC':_0x117c38(0x96),'SYSTEM_BUS_STATE_CHANGE':_0x117c38(0x9b),'ITEM_CREATE':'item:create','ITEM_UPDATE':'item:update','ITEM_REMOVE':_0x117c38(0x126),'INDEX_RESET':'index:reset','INDEX_READY':_0x117c38(0x143),'INDEX_PROGRESS':_0x117c38(0x1ab),'VIEW_PROGRESS':_0x117c38(0x155),'INDEX_DROP':_0x117c38(0xa1),'INDEX_REGISTERED':'index:registered','FTS_REGISTERED':'fts:registered','FTS_DROP':_0x117c38(0x1c1),'FTS_RESET':_0x117c38(0x161),'SCHEMA_SET':_0x117c38(0x76),'SCHEMA_DROP':_0x117c38(0x1bb),'UNIQUE_VIOLATION':'unique:violation','UNIQUE_VIOLATION_RESOLVED':_0x117c38(0xd0),'REF_VIOLATION':_0x117c38(0x84),'REF_VIOLATION_RESOLVED':_0x117c38(0x11c),'SYNC_APPLY':'sync:apply','TXN_START':_0x117c38(0x158),'TXN_END':'txn:end','TXN_ROLLBACK':_0x117c38(0xdd),'TYPE_REGISTERED':_0x117c38(0x120),'TYPE_DROP':_0x117c38(0x17a),'ENV_OPENED':_0x117c38(0xc7),'ENV_REMOVED':'env:removed','SYSTEM_ENV_RELEASE':_0x117c38(0x9f),'TTL_EXPIRED':_0x117c38(0x78),'TTL_SET':_0x117c38(0x7a),'TTL_CLEAR':_0x117c38(0x13c),'LICENSE_INVALID':_0x117c38(0x1cf),'LICENSE_ADDED':_0x117c38(0xdc),'LICENSE_ACTIVATED':'license:activated','LICENSE_REMOVED':_0x117c38(0x19f)},_0x236460={'CREATING':'creating','RESETTING':'resetting','READY':'ready','DROPPING':_0x117c38(0xbc),'WAITING':_0x117c38(0x101)},_0x16dab1={'CREATED':_0x117c38(0x187),'STARTING':_0x117c38(0x121),'STARTED':_0x117c38(0x103),'STOPPING':_0x117c38(0xa3),'STOPPED':_0x117c38(0x1bd)},_0x40c0da={'CREATING':'creating','READY':_0x117c38(0x8e),'HALTED':_0x117c38(0xe6),'STOPPED':_0x117c38(0x1bd),'RESETTING':'resetting'},_0x4bb6e4=Object['freeze']({'POKE':_0x117c38(0xde),'DRAIN':_0x117c38(0x15b),'TYPE_DROP':_0x117c38(0x173),'PROC':_0x117c38(0x178),'ENV_RELEASE':'bus:env_release'});return okdbEnums={'BUS_EVENTS':_0x4bb6e4,'CHANGE_ACTIONS':_0x138c7c,'EVENTS':_0x4c33e0,'INDEX_STATE':_0x236460,'OKDB_STATE':_0x16dab1,'VIEW_STATE':_0x40c0da},okdbEnums;}var okdbError,hasRequiredOkdbError;function requireOkdbError(){if(hasRequiredOkdbError)return okdbError;hasRequiredOkdbError=0x1;class _0x339c63 extends Error{constructor(_0x4a2025,_0x563697,_0xdb30d6={}){const _0x4c081d=_0x1403;super(_0x4a2025),this[_0x4c081d(0x145)]='OKDBError',this[_0x4c081d(0xf8)]=_0x563697,this[_0x4c081d(0xab)]=_0xdb30d6,_0xdb30d6['cause']&&(this[_0x4c081d(0xa8)]=_0xdb30d6['cause']),Error[_0x4c081d(0x7d)](this,this[_0x4c081d(0xf2)]);}}class _0x1ab5e0 extends _0x339c63{constructor(_0x45c1b5,_0xf4630,_0x35bbfb,_0x335277){const _0x4e5ae7=_0x1403;super('Version\x20mismatch\x20for\x20'+_0x45c1b5+'@'+_0xf4630+_0x4e5ae7(0x97)+_0x35bbfb+_0x4e5ae7(0x95)+_0x335277,_0x4e5ae7(0x142),{'type':_0x45c1b5,'key':_0xf4630,'expectedVersion':_0x35bbfb,'actualVersion':_0x335277}),this[_0x4e5ae7(0x145)]='OKDBVersionMismatchError';}}class _0x2ce5d1 extends _0x339c63{constructor(_0x2ac82e,_0xdd7f70){const _0x511c84=_0x1403;super(_0x2ac82e+'@'+_0xdd7f70+_0x511c84(0x1cc),_0x511c84(0x172),{'type':_0x2ac82e,'key':_0xdd7f70}),this['name']=_0x511c84(0xf0);}}class _0x593b96 extends _0x339c63{constructor(_0x15e1e1,_0x75d15c){const _0x511f62=_0x1403;super(_0x15e1e1+'@'+_0x75d15c+_0x511f62(0x1a7),_0x511f62(0x1a0),{'type':_0x15e1e1,'key':_0x75d15c}),this['name']=_0x511f62(0xe3);}}class _0xdda65c extends _0x339c63{constructor(_0x11fdd7,_0x44ed23){const _0x3213b8=_0x1403,_0xfcaea5=typeof _0x44ed23;super(_0x3213b8(0xd4)+_0x11fdd7+_0x3213b8(0xe4)+_0xfcaea5+_0x3213b8(0xbf)+_0x44ed23,_0x3213b8(0x11b),{'index':_0x11fdd7,'key':_0x44ed23,'keyType':_0xfcaea5}),this[_0x3213b8(0x145)]=_0x3213b8(0x171);}}class _0x5e158e extends _0x339c63{constructor(_0x30a0be){const _0x5c369d=_0x1403,_0x5790fb=typeof _0x30a0be;super(_0x5c369d(0x8f)+_0x5790fb+_0x5c369d(0xd7)+_0x30a0be,'INVALID_PRIMARY_KEY',{'key':_0x30a0be,'keyType':_0x5790fb}),this[_0x5c369d(0x145)]=_0x5c369d(0x1aa);}}class _0x3f67bb extends _0x339c63{constructor(_0x4acf01){const _0x15f97c=_0x1403;super(_0x15f97c(0x11f)+_0x4acf01+_0x15f97c(0x1a1),_0x15f97c(0x1ac),{'type':_0x4acf01}),this[_0x15f97c(0x145)]=_0x15f97c(0x1a2);}}class _0x1c7b5a extends _0x339c63{constructor(_0xeafcd3){const _0x38ac46=_0x1403;super(_0x38ac46(0x11f)+_0xeafcd3+_0x38ac46(0xfc),'TYPE_ALREADY_REGISTERED',{'type':_0xeafcd3}),this[_0x38ac46(0x145)]=_0x38ac46(0xc8);}}class _0x4bfbdb extends _0x339c63{constructor(_0x27868c,_0x4cfc09){const _0x29ef4b=_0x1403;super(_0x29ef4b(0xb3)+_0x4cfc09+_0x29ef4b(0xf4)+_0x27868c+_0x29ef4b(0x1a1),_0x29ef4b(0x175),{'type':_0x27868c,'index':_0x4cfc09}),this[_0x29ef4b(0x145)]='OKDBIndexNotRegisteredError';}}class _0x521700 extends _0x339c63{constructor(_0xbfa9f4,_0x1b96ab){const _0x4e8bb8=_0x1403;super('Index\x20\x27'+_0x1b96ab+_0x4e8bb8(0xf4)+_0xbfa9f4+_0x4e8bb8(0x1cb),_0x4e8bb8(0x16d),{'type':_0xbfa9f4,'index':_0x1b96ab}),this[_0x4e8bb8(0x145)]=_0x4e8bb8(0x188);}}class _0x5d4c67 extends _0x339c63{constructor(_0x457946,_0x28d23e={}){const _0x467dad=_0x1403;super(_0x457946,_0x467dad(0xa6),_0x28d23e),this[_0x467dad(0x145)]=_0x467dad(0x186);}}class _0x23d793 extends _0x339c63{constructor(_0x36a355,_0x13e582,_0x2b5b63,_0xfb4483,_0x53f059){const _0x26eb7b=_0x1403;super(_0x26eb7b(0xe9)+_0x36a355+'@'+_0x13e582+_0x26eb7b(0x165)+_0x2b5b63+_0x26eb7b(0xc4)+_0xfb4483+_0x26eb7b(0x13b)+_0x53f059+'\x27','UNIQUE_CONSTRAINT',{'type':_0x36a355,'index':_0x13e582,'indexKey':_0x2b5b63,'existingKey':_0xfb4483,'conflictingKey':_0x53f059}),this[_0x26eb7b(0x145)]=_0x26eb7b(0x1a8);}}class _0x426d05 extends _0x339c63{constructor(_0x1884f7,_0x3a5d03,_0x4efac0){const _0x458ed6=_0x1403;super('Schema\x20validation\x20failed\x20for\x20'+_0x1884f7+'@'+_0x3a5d03,_0x458ed6(0xd9),{'type':_0x1884f7,'key':_0x3a5d03,'errors':_0x4efac0}),this[_0x458ed6(0x145)]='OKDBSchemaValidationError',this[_0x458ed6(0x91)]=_0x1884f7,this['key']=_0x3a5d03,this['errors']=_0x4efac0;}}class _0x5d9b63 extends _0x339c63{constructor(_0x8e86fd,_0x3a28ae){const _0x4a1e0f=_0x1403;super(_0x4a1e0f(0xa2)+_0x8e86fd+':\x20'+_0x3a28ae[_0x4a1e0f(0xaa)]+_0x4a1e0f(0x16f),_0x4a1e0f(0x1ba),{'type':_0x8e86fd,'failures':_0x3a28ae}),this[_0x4a1e0f(0x145)]='OKDBSchemaCollectionError',this['type']=_0x8e86fd,this[_0x4a1e0f(0x1c3)]=_0x3a28ae;}}class _0x3117d2 extends _0x339c63{constructor(_0x441023,_0x4ab055,_0x2e582c,_0x5eb2d6,_0x58bf9e){const _0x3a4fdf=_0x1403;super(_0x3a4fdf(0x1bc)+_0x441023+'@'+_0x4ab055+'.'+_0x2e582c+'\x20references\x20'+_0x5eb2d6+'@'+_0x58bf9e+_0x3a4fdf(0x10a),'FOREIGN_KEY_VIOLATION',{'sourceType':_0x441023,'sourceKey':_0x4ab055,'fieldPath':_0x2e582c,'targetType':_0x5eb2d6,'targetKey':_0x58bf9e}),this[_0x3a4fdf(0x145)]='OKDBForeignKeyError',this['sourceType']=_0x441023,this[_0x3a4fdf(0x139)]=_0x4ab055,this['fieldPath']=_0x2e582c,this[_0x3a4fdf(0x1b6)]=_0x5eb2d6,this['targetKey']=_0x58bf9e;}}class _0x69af44 extends _0x339c63{constructor(_0x1b0997,_0x779256,_0x12087a){const _0x3e5959=_0x1403;super(_0x3e5959(0x141)+_0x1b0997+'@'+_0x779256+':\x20'+_0x12087a[_0x3e5959(0xaa)]+'\x20document(s)\x20reference\x20it\x20with\x20onDelete:restrict','FOREIGN_KEY_DELETE_RESTRICTED',{'targetType':_0x1b0997,'targetKey':_0x779256,'references':_0x12087a}),this[_0x3e5959(0x145)]='OKDBForeignKeyDeleteError',this['targetType']=_0x1b0997,this[_0x3e5959(0x151)]=_0x779256,this['references']=_0x12087a;}}class _0x27c2fd extends _0x339c63{constructor(_0xcbedfd,_0x5521f9,_0x5c939f){const _0x487470=_0x1403;super(_0x487470(0x65)+_0x5521f9+'\x22\x20on\x20\x22'+_0xcbedfd+'\x22\x20is\x20used\x20by:\x20'+_0x5c939f['map'](_0x2c6538=>_0x2c6538['kind']+':'+_0x2c6538[_0x487470(0x145)])[_0x487470(0x167)](',\x20'),_0x487470(0xee),{'type':_0xcbedfd,'index':_0x5521f9,'usedBy':_0x5c939f}),this[_0x487470(0x145)]=_0x487470(0xad);}}return okdbError={'OKDBError':_0x339c63,'OKDBVersionMismatchError':_0x1ab5e0,'OKDBNotFoundError':_0x2ce5d1,'OKDBAlreadyExistsError':_0x593b96,'OKDBInvalidIndexKeyError':_0xdda65c,'OKDBInvalidPrimaryKeyError':_0x5e158e,'OKDBTypeNotRegisteredError':_0x3f67bb,'OKDBTypeAlreadyRegisteredError':_0x1c7b5a,'OKDBIndexNotRegisteredError':_0x4bfbdb,'OKDBIndexAlreadyRegisteredError':_0x521700,'OKDBInvalidValueError':_0x5d4c67,'OKDBUniqueConstraintError':_0x23d793,'OKDBSchemaValidationError':_0x426d05,'OKDBSchemaCollectionError':_0x5d9b63,'OKDBForeignKeyError':_0x3117d2,'OKDBForeignKeyDeleteError':_0x69af44,'OKDBIndexHasConsumersError':_0x27c2fd},okdbError;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x1b7917=_0x17c8b9;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x35b366,performance:_0x4228aa}=require$$0$1,_0x91e8ed=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG===_0x1b7917(0x1be),_0x158fec=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x1dd06a=process.env.OKDB_LOOP_LAG_ALL==='1',_0x1d8bfe=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x18c21c{constructor(){const _0x587965=_0x1b7917;this[_0x587965(0x198)]=_0x91e8ed,this[_0x587965(0x77)]=new Map(),this['_h']=null,this['_timer']=null,this[_0x587965(0x12f)]=![],this['_log']=(_0x1868fc,_0x2b3451)=>process[_0x587965(0x19d)]['write'](_0x1868fc+(_0x2b3451?'\x20'+JSON[_0x587965(0x1d0)](_0x2b3451):'')+'\x0a');}[_0x1b7917(0xfa)](){const _0x4f47cd=_0x1b7917;return _0x4228aa[_0x4f47cd(0xfa)]();}[_0x1b7917(0xbe)](_0x3c76b3){const _0x13b27c=_0x1b7917;if(typeof _0x3c76b3===_0x13b27c(0x74))this[_0x13b27c(0x119)]=_0x3c76b3;}[_0x1b7917(0x153)](_0x2c29df,_0x17f7f3,_0x3e0366){const _0x18b317=_0x1b7917;if(!this[_0x18b317(0x198)])return;let _0x32089b=this[_0x18b317(0x77)][_0x18b317(0x73)](_0x2c29df);!_0x32089b&&(_0x32089b={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this[_0x18b317(0x77)][_0x18b317(0x114)](_0x2c29df,_0x32089b)),_0x32089b['ms']+=_0x17f7f3,_0x32089b[_0x18b317(0x181)]+=0x1,_0x17f7f3>_0x32089b[_0x18b317(0x138)]&&(_0x32089b[_0x18b317(0x138)]=_0x17f7f3,_0x32089b[_0x18b317(0x71)]=_0x3e0366||'');}[_0x1b7917(0xae)](_0x490c64){const _0x5b5ba9=_0x1b7917;if(!this['enabled']||this[_0x5b5ba9(0x12f)])return;this[_0x5b5ba9(0x12f)]=!![];if(_0x490c64)this[_0x5b5ba9(0x119)]=_0x490c64;this['_h']=_0x35b366({'resolution':0xa}),this['_h'][_0x5b5ba9(0x147)](),this[_0x5b5ba9(0x168)]=setInterval(()=>this[_0x5b5ba9(0x1b4)](),_0x158fec);if(this[_0x5b5ba9(0x168)]['unref'])this[_0x5b5ba9(0x168)][_0x5b5ba9(0xb4)]();}[_0x1b7917(0xac)](_0x6ac1c1){const _0xdc8a5f=_0x1b7917;if(!this[_0xdc8a5f(0x112)])this[_0xdc8a5f(0x112)]=new Set();this[_0xdc8a5f(0x112)]['add'](_0x6ac1c1);if(!this[_0xdc8a5f(0x12f)])this[_0xdc8a5f(0x1a9)]();}[_0x1b7917(0x69)](_0x5e74fd){const _0x123c3f=_0x1b7917;this[_0x123c3f(0x112)]?.[_0x123c3f(0x15d)](_0x5e74fd);}['_startAdmission'](){const _0x32924c=_0x1b7917;if(this[_0x32924c(0x72)])return;this[_0x32924c(0x72)]=!![];!this['_h']&&(this['_h']=_0x35b366({'resolution':0xa}),this['_h'][_0x32924c(0x147)]());const _0x33d3c8=_0x158fec;this[_0x32924c(0x140)]=setInterval(()=>{const _0x2b3773=_0x32924c,_0x3e1815=this['_h'];if(!_0x3e1815)return;const _0x568837=_0x3e1815[_0x2b3773(0xa9)](0x63)/0xf4240,_0x2beab6=_0x3e1815[_0x2b3773(0x1c7)]/0xf4240,_0x492fd2=_0x3e1815[_0x2b3773(0x13a)]/0xf4240;_0x3e1815[_0x2b3773(0x191)]();if(this[_0x2b3773(0x112)])for(const _0x293d06 of this[_0x2b3773(0x112)]){try{_0x293d06({'p99Ms':_0x568837,'maxMs':_0x2beab6,'meanMs':_0x492fd2,'reportMs':_0x33d3c8});}catch{}}},_0x33d3c8);if(this[_0x32924c(0x140)][_0x32924c(0xb4)])this[_0x32924c(0x140)][_0x32924c(0xb4)]();}[_0x1b7917(0x1b4)](){const _0x104759=_0x1b7917,_0x357df7=this['_h'],_0x49d67b=_0x357df7[_0x104759(0x1c7)]/0xf4240,_0x1e6508=_0x357df7[_0x104759(0xa9)](0x63)/0xf4240,_0x432b62=_0x357df7[_0x104759(0x13a)]/0xf4240;_0x357df7[_0x104759(0x191)]();const _0x254494=[...this[_0x104759(0x77)]['entries']()]['map'](([_0x5ad551,_0x4c61de])=>({'label':_0x5ad551,..._0x4c61de}))['sort']((_0x40672f,_0x16a010)=>_0x16a010['ms']-_0x40672f['ms'])[_0x104759(0xb7)](0x0,0x8);this[_0x104759(0x77)][_0x104759(0xdf)]();const _0x4ac2a3=_0x254494[_0x104759(0x13d)]((_0x254e82,_0x2538df)=>_0x254e82+_0x2538df['ms'],0x0),_0x4ebd37=_0x254494['map'](_0x5f18d9=>_0x5f18d9[_0x104759(0x179)]+'='+_0x5f18d9['ms']['toFixed'](0x0)+'ms/'+_0x5f18d9[_0x104759(0x181)]+(_0x5f18d9[_0x104759(0x138)]>0x5?_0x104759(0x82)+_0x5f18d9[_0x104759(0x138)][_0x104759(0xdb)](0x0)+'ms'+(_0x5f18d9[_0x104759(0x71)]?'\x20'+_0x5f18d9[_0x104759(0x71)]:'')+')':''));(_0x1dd06a||_0x49d67b>=_0x1d8bfe)&&this[_0x104759(0x119)](_0x104759(0x148)+_0x158fec+_0x104759(0xc6)+_0x49d67b[_0x104759(0xdb)](0x0)+_0x104759(0x131)+_0x1e6508[_0x104759(0xdb)](0x0)+_0x104759(0x93)+_0x432b62[_0x104759(0xdb)](0x0)+_0x104759(0xe7)+_0x4ac2a3['toFixed'](0x0)+'ms'+(_0x4ebd37[_0x104759(0xaa)]?'\x20│\x20'+_0x4ebd37[_0x104759(0x167)]('\x20\x20'):''),{'feature':_0x104759(0x133)});if(this[_0x104759(0x112)])for(const _0x310ef0 of this['_windowCbs']){try{_0x310ef0({'p99Ms':_0x1e6508,'maxMs':_0x49d67b,'meanMs':_0x432b62,'reportMs':_0x158fec});}catch{}}}[_0x1b7917(0xe0)](){const _0x5723ba=_0x1b7917;if(this[_0x5723ba(0x168)])clearInterval(this[_0x5723ba(0x168)]);if(this['_h'])this['_h'][_0x5723ba(0x199)]();this[_0x5723ba(0x168)]=null,this['_h']=null,this[_0x5723ba(0x12f)]=![];}}const _0x45fd13=new _0x18c21c();if(_0x45fd13[_0x1b7917(0x198)])_0x45fd13[_0x1b7917(0xae)]();return okdbLoopMonitor={'LOOP':_0x45fd13},okdbLoopMonitor;}var okdbTransaction,hasRequiredOkdbTransaction;function requireOkdbTransaction(){const _0x29ab7d=_0x17c8b9;if(hasRequiredOkdbTransaction)return okdbTransaction;hasRequiredOkdbTransaction=0x1;const _0x1c3bf0=require$$0$2,{EVENTS:_0x2bf331}=requireOkdbEnums(),{OKDBError:_0xfe62ed}=requireOkdbError(),{LOOP:_0x20544b}=requireOkdbLoopMonitor();function _0xd630e9(_0x5ee014){const _0x2af538=_0x1403;return _0x5ee014[_0x2af538(0x162)](_0x868274=>{const _0x49ae5e=_0x2af538,[_0x37b360,_0x121494]=_0x868274[_0x49ae5e(0xaf)]||[];return{'action':_0x868274['action'],'type':_0x37b360,'key':_0x121494};});}class _0x53d5f1{['okdb'];['actions']=[];['_doHooks']=[];[_0x29ab7d(0x16c)]=[];constructor(_0xe5ad28,_0x587c3b={'useReadTransaction':![]}){const _0x1dc65c=_0x29ab7d;this[_0x1dc65c(0x83)]=_0xe5ad28,this['options']=_0x587c3b,this['id']=_0x1c3bf0['v4'](),this[_0x1dc65c(0x190)]=this[_0x1dc65c(0x10f)][_0x1dc65c(0xd3)]?this[_0x1dc65c(0x83)]['db'][_0x1dc65c(0xd3)]():null,this[_0x1dc65c(0x8d)]=![];}[_0x29ab7d(0x6a)](_0x1a1c2c){const _0x1f766c=_0x29ab7d;this[_0x1f766c(0x15f)][_0x1f766c(0xc5)](_0x1a1c2c);}[_0x29ab7d(0x113)](_0x31e72f){const _0x246ba7=_0x29ab7d;this['_undoHooks'][_0x246ba7(0xc5)](_0x31e72f);}[_0x29ab7d(0xcc)](){const _0x49e98d=_0x29ab7d;if(!this['readTransaction'])return;try{this[_0x49e98d(0x190)][_0x49e98d(0xa4)]();}catch(_0x45b224){}this['readTransaction']=null;}[_0x29ab7d(0x170)](){const _0x8313da=_0x29ab7d;if(this['_closed'])throw new _0xfe62ed(_0x8313da(0xd8),_0x8313da(0x134));}[_0x29ab7d(0x73)](_0x281cda,_0x157548){const _0x10c988=_0x29ab7d;return this[_0x10c988(0x170)](),this[_0x10c988(0x83)]['get'](_0x281cda,_0x157548,{'transaction':this[_0x10c988(0x190)]});}[_0x29ab7d(0x110)](_0x12a9dc,_0x3bb1ae){const _0x189334=_0x29ab7d;return this[_0x189334(0x170)](),this[_0x189334(0x83)]['getEntry'](_0x12a9dc,_0x3bb1ae,{'transaction':this[_0x189334(0x190)]});}[_0x29ab7d(0xb2)](_0xff7b91,_0xc8d3bf){const _0x473328=_0x29ab7d;return this[_0x473328(0x170)](),this[_0x473328(0x83)][_0x473328(0xb2)](_0xff7b91,_0xc8d3bf,{'transaction':this['readTransaction']});}[_0x29ab7d(0x13f)](_0x545afc,_0x588062={}){const _0x5097d1=_0x29ab7d;return this['_assertOpen'](),this['okdb'][_0x5097d1(0x13f)](_0x545afc,{'transaction':this['readTransaction'],..._0x588062});}[_0x29ab7d(0xf5)](_0x19b2b7,_0x26cd18={}){const _0xc9dff5=_0x29ab7d;return this[_0xc9dff5(0x170)](),this['okdb'][_0xc9dff5(0xf5)](_0x19b2b7,{'transaction':this['readTransaction'],..._0x26cd18});}['getKeys'](_0x5abc52,_0x48b838={}){const _0x4cd8cd=_0x29ab7d;return this['_assertOpen'](),this['okdb'][_0x4cd8cd(0x118)](_0x5abc52,{'transaction':this[_0x4cd8cd(0x190)],..._0x48b838});}[_0x29ab7d(0x163)](_0x10c67b,_0x5e0cd7,_0x527329={}){const _0x5b79c5=_0x29ab7d;return this['_assertOpen'](),this[_0x5b79c5(0x83)][_0x5b79c5(0x163)](_0x10c67b,_0x5e0cd7,{'transaction':this[_0x5b79c5(0x190)],..._0x527329});}[_0x29ab7d(0x7f)](_0x5a4823,_0x36c125,_0x5d3bb2={}){const _0x10cee7=_0x29ab7d;return this[_0x10cee7(0x170)](),this[_0x10cee7(0x83)][_0x10cee7(0x7f)](_0x5a4823,_0x36c125,{'transaction':this['readTransaction'],..._0x5d3bb2});}['getClock'](_0x5e673c=null){const _0x33a850=_0x29ab7d;return this['_assertOpen'](),this[_0x33a850(0x83)]['getClock'](_0x5e673c,{'transaction':this[_0x33a850(0x190)]});}[_0x29ab7d(0xca)](_0x258c41){const _0x2c1590=_0x29ab7d;return this[_0x2c1590(0x170)](),this[_0x2c1590(0x83)]['getCount'](_0x258c41,{'transaction':this[_0x2c1590(0x190)]});}['put'](_0xb4cbea,_0x87b705,_0x32afba,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date['now'](),origin:origin=null,ttl:ttl=null}={}){const _0x104690=_0x29ab7d;this['actions'][_0x104690(0xc5)]({'action':'put','args':[_0xb4cbea,_0x87b705,_0x32afba,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x29ab7d(0x195)](_0x5457f3,_0x33c163,_0x337abc,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date['now'](),origin:origin=null,ttl:ttl=null}={}){const _0x4edb63=_0x29ab7d;this[_0x4edb63(0x1af)][_0x4edb63(0xc5)]({'action':_0x4edb63(0x195),'args':[_0x5457f3,_0x33c163,_0x337abc,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x29ab7d(0x189)](_0x431eda,_0x267ce0,_0x3f7903,{ifVersion:ifVersion=null,timestamp:timestamp=Date[_0x29ab7d(0xfa)](),origin:origin=null,ttl:ttl=null}={}){const _0x396cb4=_0x29ab7d;this[_0x396cb4(0x1af)][_0x396cb4(0xc5)]({'action':_0x396cb4(0x189),'args':[_0x431eda,_0x267ce0,_0x3f7903,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x29ab7d(0x116)](_0x94344e,_0xb7e373,_0x26bd84,{version:version=null,timestamp:timestamp=Date['now'](),origin:origin=null,ttl:ttl=null}={}){const _0x22853d=_0x29ab7d;this[_0x22853d(0x1af)][_0x22853d(0xc5)]({'action':_0x22853d(0x116),'args':[_0x94344e,_0xb7e373,_0x26bd84,{'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x29ab7d(0x12d)](_0x2457bf,_0x535ac8,{ifVersion:ifVersion=null,timestamp:timestamp=Date[_0x29ab7d(0xfa)](),origin:origin=null}={}){const _0x38f3b8=_0x29ab7d;this['actions'][_0x38f3b8(0xc5)]({'action':_0x38f3b8(0x12d),'args':[_0x2457bf,_0x535ac8,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin}]});}[_0x29ab7d(0x152)](_0x10deba,_0xc796a5,_0x32c494){const _0x283f2e=_0x29ab7d;this[_0x283f2e(0x1af)][_0x283f2e(0xc5)]({'action':_0x283f2e(0x152),'args':[_0x10deba,_0xc796a5,_0x32c494]});}['clearTTL'](_0x31d0f9,_0xd5d52b){const _0x200355=_0x29ab7d;this[_0x200355(0x1af)][_0x200355(0xc5)]({'action':_0x200355(0x14c),'args':[_0x31d0f9,_0xd5d52b]});}[_0x29ab7d(0xb9)](){const _0x2b7f83=_0x29ab7d;if(this[_0x2b7f83(0x8d)])return;for(const _0x55da2f of this[_0x2b7f83(0x16c)]){try{_0x55da2f();}catch{}}this[_0x2b7f83(0x83)][_0x2b7f83(0x64)]['emit'](_0x2bf331[_0x2b7f83(0xba)],{'id':this['id']}),this[_0x2b7f83(0x1af)]=[],this[_0x2b7f83(0xcc)](),this[_0x2b7f83(0x8d)]=!![];}async[_0x29ab7d(0xe2)](){const _0x1aa3dc=_0x29ab7d;if(this[_0x1aa3dc(0x8d)])throw new Error(_0x1aa3dc(0xd8));const _0xf4007c={'id':this['id'],'timestamp':Date['now'](),'actions':this[_0x1aa3dc(0x1af)]};this['okdb']['events'][_0x1aa3dc(0x99)](_0x2bf331['TXN_START'],_0xf4007c);try{const _0x293380=_0x20544b[_0x1aa3dc(0x198)]?_0x20544b[_0x1aa3dc(0xfa)]():0x0;await this['okdb']['_writer'][_0x1aa3dc(0x106)](()=>{const _0x2f1c1e=_0x1aa3dc;for(const _0x259ca4 of this[_0x2f1c1e(0x1af)]){const _0x53e50f=this[_0x2f1c1e(0x83)]['_'+_0x259ca4[_0x2f1c1e(0x1b7)]];if(typeof _0x53e50f!==_0x2f1c1e(0x74))throw new Error('Unknown\x20transaction\x20action:\x20'+_0x259ca4[_0x2f1c1e(0x1b7)]);_0x53e50f[_0x2f1c1e(0x1ad)](this[_0x2f1c1e(0x83)],this,..._0x259ca4[_0x2f1c1e(0xaf)]);}}),_0x20544b[_0x1aa3dc(0x198)]&&_0x20544b[_0x1aa3dc(0x153)](_0x1aa3dc(0xa5),_0x20544b['now']()-_0x293380,(this[_0x1aa3dc(0x83)]['name']??'?')+_0x1aa3dc(0x19c)+this[_0x1aa3dc(0x1af)]['length']);}catch(_0x255357){for(const _0x20ae3c of this[_0x1aa3dc(0x16c)]){try{_0x20ae3c();}catch{}}this[_0x1aa3dc(0xcc)](),this[_0x1aa3dc(0x8d)]=!![];if(_0x255357 instanceof _0xfe62ed)throw _0x255357;const _0x310243={'cause':_0x255357,'env':this[_0x1aa3dc(0x83)]?.[_0x1aa3dc(0x145)],'envPath':this[_0x1aa3dc(0x83)]?.[_0x1aa3dc(0x18b)],'pid':process[_0x1aa3dc(0x1c6)],'txnId':this['id'],'actionCount':this[_0x1aa3dc(0x1af)][_0x1aa3dc(0xaa)],'actions':_0xd630e9(this[_0x1aa3dc(0x1af)]),'nativeCode':_0x255357?.['code'],'nativeName':_0x255357?.[_0x1aa3dc(0x145)]};try{this['okdb']?.[_0x1aa3dc(0x17c)]?.[_0x1aa3dc(0x192)]?.('transaction\x20commit\x20failed',{'env':_0x310243[_0x1aa3dc(0xf6)],'envPath':_0x310243[_0x1aa3dc(0x8c)],'pid':_0x310243[_0x1aa3dc(0x1c6)],'txnId':_0x310243[_0x1aa3dc(0x87)],'actionCount':_0x310243[_0x1aa3dc(0xc2)],'actions':_0x310243[_0x1aa3dc(0x1af)],'nativeCode':_0x310243[_0x1aa3dc(0xe1)],'error':_0x255357?.[_0x1aa3dc(0x132)],'stack':_0x255357?.[_0x1aa3dc(0x174)]});}catch{}throw new _0xfe62ed(_0x255357?.[_0x1aa3dc(0x132)]||'Unknown\x20OKDB\x20transaction\x20error','TXN_ERROR',_0x310243);}this['okdb'][_0x1aa3dc(0x64)][_0x1aa3dc(0x99)](_0x2bf331[_0x1aa3dc(0x6f)],_0xf4007c);for(const _0x176e86 of this[_0x1aa3dc(0x15f)]){try{await _0x176e86();}catch{}}this[_0x1aa3dc(0x1af)]=[],this['_closeReadTransaction'](),this[_0x1aa3dc(0x8d)]=!![];}static[_0x29ab7d(0x183)](_0x718b28){const _0x6558a5=_0x29ab7d;return Object[_0x6558a5(0x1c4)]({'id':_0x718b28['id'],'put':_0x718b28[_0x6558a5(0xcd)][_0x6558a5(0x128)](_0x718b28),'update':_0x718b28[_0x6558a5(0x195)]['bind'](_0x718b28),'patch':_0x718b28[_0x6558a5(0x189)][_0x6558a5(0x128)](_0x718b28),'create':_0x718b28['create'][_0x6558a5(0x128)](_0x718b28),'remove':_0x718b28['remove'][_0x6558a5(0x128)](_0x718b28),'setTTL':_0x718b28['setTTL'][_0x6558a5(0x128)](_0x718b28),'clearTTL':_0x718b28[_0x6558a5(0x14c)][_0x6558a5(0x128)](_0x718b28),'commit':_0x718b28[_0x6558a5(0xe2)][_0x6558a5(0x128)](_0x718b28),'rollback':_0x718b28['rollback'][_0x6558a5(0x128)](_0x718b28),'get':_0x718b28[_0x6558a5(0x73)][_0x6558a5(0x128)](_0x718b28),'getEntry':_0x718b28[_0x6558a5(0x110)]['bind'](_0x718b28),'getMany':_0x718b28[_0x6558a5(0xb2)][_0x6558a5(0x128)](_0x718b28),'getRange':_0x718b28[_0x6558a5(0x13f)]['bind'](_0x718b28),'getValues':_0x718b28['getValues'][_0x6558a5(0x128)](_0x718b28),'getKeys':_0x718b28[_0x6558a5(0x118)][_0x6558a5(0x128)](_0x718b28),'byIndex':_0x718b28[_0x6558a5(0x163)][_0x6558a5(0x128)](_0x718b28),'query':_0x718b28['query'][_0x6558a5(0x128)](_0x718b28),'getClock':_0x718b28[_0x6558a5(0x9e)][_0x6558a5(0x128)](_0x718b28),'getCount':_0x718b28[_0x6558a5(0xca)]['bind'](_0x718b28),'read':_0x718b28,'raw':_0x718b28});}static['applyOps'](_0x451809,_0x4f0d18=[]){const _0x2723e4=_0x29ab7d;if(!Array[_0x2723e4(0xce)](_0x4f0d18))throw new _0xfe62ed(_0x2723e4(0x1a6),'TXN_INVALID_OPS');for(const _0x1fe59a of _0x4f0d18){if(Array[_0x2723e4(0xce)](_0x1fe59a)){const [_0x480420,..._0x5a552b]=_0x1fe59a;if(typeof _0x451809[_0x480420]!=='function')throw new _0xfe62ed('Unknown\x20transaction\x20action:\x20'+_0x480420,'TXN_INVALID_ACTION',{'action':_0x480420});_0x451809[_0x480420](..._0x5a552b);continue;}if(!_0x1fe59a||typeof _0x1fe59a!=='object')throw new _0xfe62ed('txn\x20op\x20must\x20be\x20an\x20object\x20or\x20tuple',_0x2723e4(0x16a));const {action:_0x13ee30}=_0x1fe59a;if(typeof _0x13ee30!==_0x2723e4(0x108)||typeof _0x451809[_0x13ee30]!==_0x2723e4(0x74))throw new _0xfe62ed(_0x2723e4(0x169)+_0x13ee30,_0x2723e4(0xfd),{'action':_0x13ee30});switch(_0x13ee30){case _0x2723e4(0xcd):case'update':case'create':_0x451809[_0x13ee30](_0x1fe59a[_0x2723e4(0x91)],_0x1fe59a[_0x2723e4(0x14f)],_0x1fe59a[_0x2723e4(0x1c9)],{..._0x1fe59a[_0x2723e4(0x10f)],'ttl':_0x1fe59a[_0x2723e4(0x109)]??_0x1fe59a[_0x2723e4(0x10f)]?.[_0x2723e4(0x109)]??null});break;case _0x2723e4(0x189):_0x451809['patch'](_0x1fe59a[_0x2723e4(0x91)],_0x1fe59a[_0x2723e4(0x14f)],_0x1fe59a[_0x2723e4(0x189)],{..._0x1fe59a['options'],'ttl':_0x1fe59a['ttl']??_0x1fe59a[_0x2723e4(0x10f)]?.['ttl']??null});break;case _0x2723e4(0x12d):_0x451809[_0x2723e4(0x12d)](_0x1fe59a[_0x2723e4(0x91)],_0x1fe59a['key'],_0x1fe59a[_0x2723e4(0x10f)]||{});break;case'setTTL':_0x451809[_0x2723e4(0x152)](_0x1fe59a['type'],_0x1fe59a[_0x2723e4(0x14f)],_0x1fe59a[_0x2723e4(0x109)]);break;case _0x2723e4(0x14c):_0x451809[_0x2723e4(0x14c)](_0x1fe59a[_0x2723e4(0x91)],_0x1fe59a[_0x2723e4(0x14f)]);break;default:throw new _0xfe62ed(_0x2723e4(0x10d)+_0x13ee30,_0x2723e4(0xfd),{'action':_0x13ee30});}}}static async['run'](_0x1a0adc,_0x451c9e,_0x468a91={}){const _0x259c48=_0x29ab7d,_0x3df53a=new _0x53d5f1(_0x1a0adc,_0x468a91),_0x33574f=_0x53d5f1['createWriteFacade'](_0x3df53a);try{typeof _0x451c9e===_0x259c48(0x74)?await _0x451c9e(_0x33574f):_0x53d5f1['applyOps'](_0x3df53a,_0x451c9e||[]);const _0x7d3337=_0x3df53a[_0x259c48(0x1af)]['length'];return await _0x3df53a[_0x259c48(0xe2)](),{'id':_0x3df53a['id'],'actions':_0x7d3337};}catch(_0x576d22){try{_0x3df53a['rollback']();}catch(_0x16fcf0){}throw _0x576d22;}}}return okdbTransaction=_0x53d5f1,okdbTransaction;}var okdbFunctionsFacades,hasRequiredOkdbFunctionsFacades;function _0x1403(_0xf9f2b1,_0x1535a2){_0xf9f2b1=_0xf9f2b1-0x64;const _0x1c2409=_0x1c24();let _0x1403ed=_0x1c2409[_0xf9f2b1];return _0x1403ed;}function requireOkdbFunctionsFacades(){if(hasRequiredOkdbFunctionsFacades)return okdbFunctionsFacades;hasRequiredOkdbFunctionsFacades=0x1;const _0x3a9ad8=requireOkdbTransaction();function _0x5b81ae(_0xc6f303){const _0x2b7481=_0x1403;return{'transaction':typeof _0xc6f303[_0x2b7481(0x106)]===_0x2b7481(0x74)?_0xc6f303[_0x2b7481(0x106)][_0x2b7481(0x128)](_0xc6f303):_0x53aa29=>new _0x3a9ad8(_0xc6f303,_0x53aa29),'txn':typeof _0xc6f303['txn']===_0x2b7481(0x74)?_0xc6f303[_0x2b7481(0x81)]['bind'](_0xc6f303):(_0x372ea7,_0x3d6dd1)=>_0x3a9ad8['run'](_0xc6f303,_0x372ea7,_0x3d6dd1)};}function _0x25eba3(_0xe406ec){const _0x36f955=_0x1403;return{'name':_0xe406ec['name'],..._0x5b81ae(_0xe406ec),'put':_0xe406ec['put'][_0x36f955(0x128)](_0xe406ec),'update':_0xe406ec[_0x36f955(0x195)][_0x36f955(0x128)](_0xe406ec),'patch':_0xe406ec[_0x36f955(0x189)][_0x36f955(0x128)](_0xe406ec),'create':_0xe406ec[_0x36f955(0x116)][_0x36f955(0x128)](_0xe406ec),'remove':_0xe406ec[_0x36f955(0x12d)]['bind'](_0xe406ec),'get':_0xe406ec[_0x36f955(0x73)][_0x36f955(0x128)](_0xe406ec),'getMany':_0xe406ec[_0x36f955(0xb2)][_0x36f955(0x128)](_0xe406ec),'getEntry':_0xe406ec[_0x36f955(0x110)][_0x36f955(0x128)](_0xe406ec),'getRange':_0xe406ec['getRange'][_0x36f955(0x128)](_0xe406ec),'getValues':_0xe406ec[_0x36f955(0xf5)][_0x36f955(0x128)](_0xe406ec),'getKeys':_0xe406ec[_0x36f955(0x118)][_0x36f955(0x128)](_0xe406ec),'getCount':_0xe406ec[_0x36f955(0xca)][_0x36f955(0x128)](_0xe406ec),'getByPrefix':_0xe406ec['getByPrefix'][_0x36f955(0x128)](_0xe406ec),'getIndex':_0xe406ec['getIndex'][_0x36f955(0x128)](_0xe406ec),'byIndex':_0xe406ec[_0x36f955(0x163)][_0x36f955(0x128)](_0xe406ec),'query':_0xe406ec[_0x36f955(0x7f)][_0x36f955(0x128)](_0xe406ec),'geoQuery':_0xe406ec[_0x36f955(0x15c)][_0x36f955(0x128)](_0xe406ec),'ftsQuery':_0xe406ec[_0x36f955(0x150)][_0x36f955(0x128)](_0xe406ec),'setTTL':_0xe406ec['setTTL'][_0x36f955(0x128)](_0xe406ec),'getTTL':_0xe406ec[_0x36f955(0x17d)]['bind'](_0xe406ec),'clearTTL':_0xe406ec['clearTTL'][_0x36f955(0x128)](_0xe406ec),'sweepExpiredTTL':_0xe406ec[_0x36f955(0xf7)][_0x36f955(0x128)](_0xe406ec),'listTTL':_0xe406ec[_0x36f955(0x94)][_0x36f955(0x128)](_0xe406ec),'ttlStats':_0xe406ec['ttlStats'][_0x36f955(0x128)](_0xe406ec),'setDefaultTTL':_0xe406ec[_0x36f955(0x107)][_0x36f955(0x128)](_0xe406ec),'getDefaultTTL':_0xe406ec[_0x36f955(0x135)][_0x36f955(0x128)](_0xe406ec),'clearDefaultTTL':_0xe406ec[_0x36f955(0x122)][_0x36f955(0x128)](_0xe406ec),'registerType':_0xe406ec[_0x36f955(0xd2)]['bind'](_0xe406ec),'ensureType':_0xe406ec[_0x36f955(0x1c5)][_0x36f955(0x128)](_0xe406ec),'hasType':_0xe406ec[_0x36f955(0x6b)][_0x36f955(0x128)](_0xe406ec),'dropType':_0xe406ec[_0x36f955(0xc1)][_0x36f955(0x128)](_0xe406ec),'registerIndex':_0xe406ec['registerIndex'][_0x36f955(0x128)](_0xe406ec),'hasIndex':_0xe406ec['hasIndex'][_0x36f955(0x128)](_0xe406ec),'dropIndex':_0xe406ec[_0x36f955(0x10b)]['bind'](_0xe406ec),'resetIndex':_0xe406ec['resetIndex'][_0x36f955(0x128)](_0xe406ec),'indexReady':_0xe406ec[_0x36f955(0xa0)][_0x36f955(0x128)](_0xe406ec),'getIndexStatus':_0xe406ec[_0x36f955(0xda)][_0x36f955(0x128)](_0xe406ec),'getClock':_0xe406ec[_0x36f955(0x9e)]['bind'](_0xe406ec),'getChanges':_0xe406ec[_0x36f955(0x117)][_0x36f955(0x128)](_0xe406ec),'count':_0xe406ec['count'][_0x36f955(0x128)](_0xe406ec),'range':_0xe406ec[_0x36f955(0x14e)][_0x36f955(0x128)](_0xe406ec),'now':_0xe406ec[_0x36f955(0xfa)][_0x36f955(0x128)](_0xe406ec)};}function _0x2fa408(_0x231509){const _0x4e646c=_0x1403;if(!_0x231509)return null;const _0x2771d9={};for(const _0x38538e of[_0x4e646c(0x164),_0x4e646c(0x18f),_0x4e646c(0x18c),_0x4e646c(0x159),_0x4e646c(0xd5),_0x4e646c(0x12c),'getBucket',_0x4e646c(0x90)]){if(typeof _0x231509[_0x38538e]==='function')_0x2771d9[_0x38538e]=_0x231509[_0x38538e]['bind'](_0x231509);}return Object[_0x4e646c(0x100)](_0x2771d9)[_0x4e646c(0xaa)]?_0x2771d9:null;}function _0x2d61ce(_0x5657ff){const _0x1f21a3=_0x1403;if(!_0x5657ff)return null;const _0x3913a4={};for(const _0x3355eb of[_0x1f21a3(0x144),_0x1f21a3(0x17e),_0x1f21a3(0x12d),'get','list','getByPath']){if(typeof _0x5657ff[_0x3355eb]===_0x1f21a3(0x74))_0x3913a4[_0x3355eb]=_0x5657ff[_0x3355eb][_0x1f21a3(0x128)](_0x5657ff);}return Object[_0x1f21a3(0x100)](_0x3913a4)['length']?_0x3913a4:null;}function _0x1aaa2f(_0xef6f84){const _0x161e90=_0x1403;return{'env':_0xef6f84[_0x161e90(0xf6)][_0x161e90(0x128)](_0xef6f84),'createEnvironment':_0xef6f84[_0x161e90(0xef)][_0x161e90(0x128)](_0xef6f84),'removeEnvironment':_0xef6f84['removeEnvironment'][_0x161e90(0x128)](_0xef6f84),'info':_0xef6f84[_0x161e90(0x7e)],..._0x5b81ae(_0xef6f84),'put':_0xef6f84[_0x161e90(0xcd)][_0x161e90(0x128)](_0xef6f84),'update':_0xef6f84[_0x161e90(0x195)][_0x161e90(0x128)](_0xef6f84),'patch':_0xef6f84[_0x161e90(0x189)][_0x161e90(0x128)](_0xef6f84),'create':_0xef6f84[_0x161e90(0x116)][_0x161e90(0x128)](_0xef6f84),'remove':_0xef6f84[_0x161e90(0x12d)][_0x161e90(0x128)](_0xef6f84),'get':_0xef6f84['get']['bind'](_0xef6f84),'getMany':_0xef6f84[_0x161e90(0xb2)][_0x161e90(0x128)](_0xef6f84),'getEntry':_0xef6f84[_0x161e90(0x110)][_0x161e90(0x128)](_0xef6f84),'getRange':_0xef6f84[_0x161e90(0x13f)][_0x161e90(0x128)](_0xef6f84),'getValues':_0xef6f84[_0x161e90(0xf5)][_0x161e90(0x128)](_0xef6f84),'getKeys':_0xef6f84[_0x161e90(0x118)][_0x161e90(0x128)](_0xef6f84),'getCount':_0xef6f84[_0x161e90(0xca)][_0x161e90(0x128)](_0xef6f84),'getByPrefix':_0xef6f84['getByPrefix'][_0x161e90(0x128)](_0xef6f84),'getIndex':_0xef6f84[_0x161e90(0x75)][_0x161e90(0x128)](_0xef6f84),'byIndex':_0xef6f84['byIndex'][_0x161e90(0x128)](_0xef6f84),'query':_0xef6f84['query'][_0x161e90(0x128)](_0xef6f84),'setTTL':_0xef6f84[_0x161e90(0x152)][_0x161e90(0x128)](_0xef6f84),'getTTL':_0xef6f84[_0x161e90(0x17d)][_0x161e90(0x128)](_0xef6f84),'clearTTL':_0xef6f84[_0x161e90(0x14c)][_0x161e90(0x128)](_0xef6f84),'sweepExpiredTTL':_0xef6f84[_0x161e90(0xf7)]['bind'](_0xef6f84),'listTTL':_0xef6f84[_0x161e90(0x94)]['bind'](_0xef6f84),'ttlStats':_0xef6f84[_0x161e90(0x185)][_0x161e90(0x128)](_0xef6f84),'setDefaultTTL':_0xef6f84[_0x161e90(0x107)][_0x161e90(0x128)](_0xef6f84),'getDefaultTTL':_0xef6f84[_0x161e90(0x135)][_0x161e90(0x128)](_0xef6f84),'clearDefaultTTL':_0xef6f84['clearDefaultTTL'][_0x161e90(0x128)](_0xef6f84),'ensureType':_0xef6f84[_0x161e90(0x1c5)][_0x161e90(0x128)](_0xef6f84),'registerType':_0xef6f84[_0x161e90(0xd2)][_0x161e90(0x128)](_0xef6f84),'hasType':_0xef6f84[_0x161e90(0x6b)][_0x161e90(0x128)](_0xef6f84),'dropType':_0xef6f84[_0x161e90(0xc1)][_0x161e90(0x128)](_0xef6f84),'registerIndex':_0xef6f84[_0x161e90(0xd1)][_0x161e90(0x128)](_0xef6f84),'hasIndex':_0xef6f84['hasIndex']['bind'](_0xef6f84),'dropIndex':_0xef6f84[_0x161e90(0x10b)]['bind'](_0xef6f84),'resetIndex':_0xef6f84[_0x161e90(0x88)][_0x161e90(0x128)](_0xef6f84),'indexReady':_0xef6f84[_0x161e90(0xa0)][_0x161e90(0x128)](_0xef6f84),'getIndexStatus':_0xef6f84[_0x161e90(0xda)][_0x161e90(0x128)](_0xef6f84),'getClock':_0xef6f84[_0x161e90(0x9e)]['bind'](_0xef6f84),'getChanges':_0xef6f84['getChanges'][_0x161e90(0x128)](_0xef6f84),'queue':_0xef6f84[_0x161e90(0x115)],'files':_0xef6f84[_0x161e90(0x105)]};}return okdbFunctionsFacades={'createEnvFacade':_0x25eba3,'createQueueFacade':_0x2fa408,'createFilesFacade':_0x2d61ce,'createGlobalFacade':_0x1aaa2f},okdbFunctionsFacades;}var okdbFunctionsDryrun,hasRequiredOkdbFunctionsDryrun;function requireOkdbFunctionsDryrun(){const _0x208243=_0x17c8b9;if(hasRequiredOkdbFunctionsDryrun)return okdbFunctionsDryrun;hasRequiredOkdbFunctionsDryrun=0x1;const _0x32ce75=new Set([_0x208243(0xcd),_0x208243(0x189),_0x208243(0x116),_0x208243(0x12d),_0x208243(0x195),_0x208243(0x152),_0x208243(0x14c),_0x208243(0xf7),'setDefaultTTL','clearDefaultTTL','dropType',_0x208243(0x10b),'resetIndex']),_0x36cb51=new Set([_0x208243(0x164),'updateJob',_0x208243(0xd5),'addBucket']),_0x8447e4=new Set([_0x208243(0x144),'remove']);function _0xf51cef(_0x9a5b50,_0x323b26){const _0x56b3aa=_0x208243;if(_0x9a5b50==='env'||_0x9a5b50==='global')return _0x32ce75[_0x56b3aa(0x14b)](_0x323b26);if(_0x9a5b50===_0x56b3aa(0x115))return _0x36cb51[_0x56b3aa(0x14b)](_0x323b26);if(_0x9a5b50===_0x56b3aa(0x105))return _0x8447e4[_0x56b3aa(0x14b)](_0x323b26);return![];}function _0xfcd78d(_0xf36093,_0x2f480a,_0x2ebb49,_0x494a94){if(!_0xf36093)return _0xf36093;return new Proxy(_0xf36093,{'get'(_0x3de567,_0x1015dc,_0x330f17){const _0x369bec=_0x1403,_0x43dd69=Reflect['get'](_0x3de567,_0x1015dc,_0x330f17);if(typeof _0x43dd69!==_0x369bec(0x74))return _0x43dd69;if(!_0xf51cef(_0x2f480a,_0x1015dc))return _0x43dd69['bind'](_0x3de567);return function(..._0x111cf1){const _0x486a04=_0x369bec;return _0x494a94[_0x486a04(0xc5)]({'scope':_0x2f480a,'method':_0x1015dc,'envName':_0x2ebb49,'args':_0x111cf1}),null;};}});}function _0xdf3db4(_0x25228e,_0x537b6b,_0x218e59,_0x45c380){const _0x449c12={};for(const _0x298243 of _0x218e59){_0x449c12[_0x298243]=(..._0x42a2d5)=>{const _0x34a6ef=_0x1403;return _0xf51cef(_0x25228e,_0x298243)&&_0x45c380[_0x34a6ef(0xc5)]({'scope':_0x25228e,'method':_0x298243,'envName':_0x537b6b,'args':_0x42a2d5}),null;};}return _0x449c12;}return okdbFunctionsDryrun={'isWriteMethod':_0xf51cef,'wrapForDryRun':_0xfcd78d,'syntheticDryRunFacade':_0xdf3db4,'ENV_WRITE_METHODS':_0x32ce75,'QUEUE_WRITE_METHODS':_0x36cb51,'FILES_WRITE_METHODS':_0x8447e4},okdbFunctionsDryrun;}var okdbFunctionsContext,hasRequiredOkdbFunctionsContext;function requireOkdbFunctionsContext(){const _0x182a78=_0x17c8b9;if(hasRequiredOkdbFunctionsContext)return okdbFunctionsContext;hasRequiredOkdbFunctionsContext=0x1;const {createEnvFacade:_0x42789f,createQueueFacade:_0x1ec890,createFilesFacade:_0x3779a0,createGlobalFacade:_0x13aff4}=requireOkdbFunctionsFacades(),{wrapForDryRun:_0x148525,syntheticDryRunFacade:_0x328dd3}=requireOkdbFunctionsDryrun(),_0x523a56=[_0x182a78(0x164),_0x182a78(0x18f),_0x182a78(0x18c),'updateJob',_0x182a78(0xd5),_0x182a78(0x12c),_0x182a78(0xc9),_0x182a78(0x90)],_0xae119=[_0x182a78(0x144),_0x182a78(0x17e),'remove',_0x182a78(0x73),_0x182a78(0x18c),_0x182a78(0x7c)];function _0xda0b96(_0x4206c7,_0x484539){const _0x599bc0=_0x182a78,_0xf4e7e8=(_0x5637c1,_0x10a8bf,_0x27d38e)=>_0x484539({'type':_0x599bc0(0x17c),'requestId':_0x4206c7['requestId'],'runId':_0x4206c7[_0x599bc0(0x12a)],'entry':{'level':_0x5637c1,'msg':_0x10a8bf,'context':_0x27d38e,'ts':Date[_0x599bc0(0xfa)]()}}),_0x5dd92f=(_0x277ea1,_0xb263c4)=>_0xf4e7e8(_0x599bc0(0x7e),_0x277ea1,_0xb263c4);return _0x5dd92f[_0x599bc0(0x7e)]=(_0x552d7b,_0x6f8c7e)=>_0xf4e7e8(_0x599bc0(0x7e),_0x552d7b,_0x6f8c7e),_0x5dd92f[_0x599bc0(0x194)]=(_0x9733fa,_0x1c0cbe)=>_0xf4e7e8('warn',_0x9733fa,_0x1c0cbe),_0x5dd92f[_0x599bc0(0x192)]=(_0x113cba,_0x38e1a4)=>_0xf4e7e8(_0x599bc0(0x192),_0x113cba,_0x38e1a4),_0x5dd92f['debug']=(_0x4fbd53,_0x4c6c59)=>_0xf4e7e8(_0x599bc0(0xb5),_0x4fbd53,_0x4c6c59),_0x5dd92f;}function _0x26ae00(_0x50284e,_0x56a0b0,_0xa02570){const _0x4727f2=_0x182a78;if(!_0x50284e)return null;return{'id':_0x50284e['id']??null,'type':_0x50284e['type']??null,'tries':_0x50284e[_0x4727f2(0x9d)]??null,'created':_0x50284e[_0x4727f2(0x187)]??null,'tags':_0x50284e['tags']??null,'priority':_0x50284e[_0x4727f2(0xf9)]??null,'bucket':_0x50284e[_0x4727f2(0x156)]??null,'cron':_0x50284e[_0x4727f2(0x1ca)]??null,'heartbeat'(){const _0x2e0bf4=_0x4727f2;_0xa02570({'type':_0x2e0bf4(0xec),'requestId':_0x56a0b0['requestId'],'runId':_0x56a0b0[_0x2e0bf4(0x12a)],'jobId':_0x50284e['id'],'claimId':_0x50284e[_0x2e0bf4(0x1a3)]});},'markProgress'(_0x27a170){const _0x264970=_0x4727f2;_0xa02570({'type':_0x264970(0x10e),'requestId':_0x56a0b0[_0x264970(0xd6)],'runId':_0x56a0b0[_0x264970(0x12a)],'jobId':_0x50284e['id'],'claimId':_0x50284e[_0x264970(0x1a3)],'message':_0x27a170});}};}function _0x2e732c(_0x2ed454){const _0x2ff0e5=_0x182a78;if(!_0x2ed454)return null;return{'mode':_0x2ed454[_0x2ff0e5(0x1b0)]??null,'sourceType':_0x2ed454[_0x2ff0e5(0x177)]??null,'sourceEnv':_0x2ed454[_0x2ff0e5(0x111)]??null,'processor':_0x2ed454[_0x2ff0e5(0xea)]??null,'engineKey':_0x2ed454[_0x2ff0e5(0x182)]??null,'cursorKey':_0x2ed454[_0x2ff0e5(0xbb)]??null};}function _0x5be1c6(_0x4b9829){const _0x4b8adc=_0x182a78;if(!_0x4b9829)return null;return{'mode':_0x4b9829[_0x4b8adc(0x1b0)]??null,'sourceType':_0x4b9829[_0x4b8adc(0x177)]??null,'targetType':_0x4b9829[_0x4b8adc(0x1b6)]??null,'sourceEnv':_0x4b9829['sourceEnv']??null,'targetEnv':_0x4b9829['targetEnv']??null,'engineKey':_0x4b9829[_0x4b8adc(0x182)]??null,'cursorKey':_0x4b9829[_0x4b8adc(0xbb)]??null};}function _0x1417b6(_0x4ee70f,_0x10d092,_0x424717,_0x1dbe80=null,_0x485b08=null){const _0x2c0c9b=_0x182a78,_0x43f52d={'runId':_0x10d092[_0x2c0c9b(0x12a)],'scope':_0x2c0c9b(0xf6),'env':_0x10d092[_0x2c0c9b(0xcb)]??null,'functionName':_0x10d092[_0x2c0c9b(0x124)],'trigger':_0x10d092[_0x2c0c9b(0x7e)]?.['trigger']??_0x2c0c9b(0x123),'requestedAt':_0x10d092[_0x2c0c9b(0x7e)]?.[_0x2c0c9b(0x70)]??Date[_0x2c0c9b(0xfa)]()},_0x3146a4=_0xda0b96(_0x10d092,_0x424717),_0x95dedb=AbortSignal[_0x2c0c9b(0x125)](Math['max'](0x1,_0x10d092['runtime']?.[_0x2c0c9b(0x11e)]??0x3e8)),_0x169001=_0x485b08?AbortSignal[_0x2c0c9b(0xb0)]([_0x95dedb,_0x485b08]):_0x95dedb,_0x5f41ca=_0x4ee70f[_0x2c0c9b(0xf6)](_0x10d092[_0x2c0c9b(0xcb)]),_0x1485c8=_0x1dbe80?_0x148525(_0x5f41ca,_0x2c0c9b(0xf6),_0x10d092['envName'],_0x1dbe80):_0x5f41ca,_0x1394b1=_0x1dbe80?_0x5f41ca['queue']?_0x148525(_0x5f41ca['queue'],'queue',_0x10d092[_0x2c0c9b(0xcb)],_0x1dbe80):_0x328dd3('queue',_0x10d092[_0x2c0c9b(0xcb)],_0x523a56,_0x1dbe80):_0x5f41ca['queue'],_0x1910fe=_0x1dbe80?_0x5f41ca[_0x2c0c9b(0x105)]?_0x148525(_0x5f41ca['files'],_0x2c0c9b(0x105),_0x10d092[_0x2c0c9b(0xcb)],_0x1dbe80):_0x328dd3('files',_0x10d092[_0x2c0c9b(0xcb)],_0xae119,_0x1dbe80):_0x5f41ca['files'],_0x548aef=_0x42789f(_0x1485c8),_0x1e6dd6=_0x1ec890(_0x1394b1),_0x246d17=_0x3779a0(_0x1910fe);if(_0x1e6dd6)_0x548aef[_0x2c0c9b(0x115)]=_0x1e6dd6;if(_0x246d17)_0x548aef[_0x2c0c9b(0x105)]=_0x246d17;const _0x3fcc3b={'payload':_0x10d092[_0x2c0c9b(0x12e)]??null,'info':_0x43f52d,'signal':_0x169001,'log':_0x3146a4,'env':_0x548aef},_0x43dca5=_0x26ae00(_0x10d092[_0x2c0c9b(0x1a4)],_0x10d092,_0x424717);if(_0x43dca5)_0x3fcc3b['job']=_0x43dca5;const _0x5274cf=_0x2e732c(_0x10d092[_0x2c0c9b(0x14a)]);if(_0x5274cf)_0x3fcc3b[_0x2c0c9b(0xea)]=_0x5274cf;const _0x208dfb=_0x5be1c6(_0x10d092[_0x2c0c9b(0xb8)]);if(_0x208dfb)_0x3fcc3b[_0x2c0c9b(0xb6)]=_0x208dfb;if(_0x10d092['unsafe']){const _0xf20af5=_0x1dbe80?_0x148525(_0x4ee70f,_0x2c0c9b(0x18d),null,_0x1dbe80):_0x4ee70f;_0x3fcc3b[_0x2c0c9b(0x83)]=_0x13aff4(_0xf20af5);}return _0x3fcc3b;}return okdbFunctionsContext={'createExecutionContext':_0x1417b6,'createScriptLogger':_0xda0b96},okdbFunctionsContext;}var hasRequiredOkdbFunctionsSandboxWorker;function requireOkdbFunctionsSandboxWorker(){const _0x5b83a6=_0x17c8b9;if(hasRequiredOkdbFunctionsSandboxWorker)return okdbFunctionsSandboxWorker$1;hasRequiredOkdbFunctionsSandboxWorker=0x1;const {parentPort:_0xd738b5,workerData:_0x452f76}=require$$0$3;requireOkdbFatalReport()[_0x5b83a6(0xe8)]('sandbox');const _0x4b298f=require$$2,{compileFunctionExpression:_0x33ef02}=requireOkdbFunctionsSandbox(),{serializeError:_0x13d0ca}=requireOkdbFunctionsIpc(),{createExecutionContext:_0x59827a}=requireOkdbFunctionsContext(),_0x4dcecc=require$$6;let _0x38f9b4=null,_0x3e3d00=![];const _0x46bda1=new Map(),_0x39b031=new Map();function _0x2cb42c(_0x29e1f5){const _0x4a5054=_0x5b83a6;try{_0xd738b5[_0x4a5054(0x14d)](_0x29e1f5);}catch{}}function _0xc3069c(_0x2888b5){const _0x24760c=_0x5b83a6,_0x487796=(_0x2888b5[_0x24760c(0xcb)]||_0x24760c(0x1c2))+':'+_0x2888b5[_0x24760c(0x124)]+':'+_0x2888b5[_0x24760c(0x98)]+':'+_0x2888b5[_0x24760c(0x18a)];let _0x51d26b=_0x46bda1[_0x24760c(0x73)](_0x487796);return!_0x51d26b&&(_0x51d26b=_0x33ef02(_0x2888b5[_0x24760c(0x66)],{'allowFetch':_0x2888b5['runtime']?.[_0x24760c(0x6c)]!==![],'allowedFetchDomains':_0x2888b5[_0x24760c(0xfb)]?.[_0x24760c(0x136)],'filename':_0x2888b5[_0x24760c(0x124)]+'.okdb-function.js'}),_0x46bda1[_0x24760c(0x114)](_0x487796,_0x51d26b)),_0x51d26b;}async function _0x31f060(_0x2b72d2){const _0x160202=_0x5b83a6,_0xddb339=Date[_0x160202(0xfa)](),_0x590e74=new AbortController();_0x39b031[_0x160202(0x114)](_0x2b72d2[_0x160202(0xd6)],_0x590e74);try{const _0x5c6782=_0xc3069c(_0x2b72d2);if(_0x2b72d2[_0x160202(0xcb)])await _0x38f9b4[_0x160202(0x67)](_0x2b72d2[_0x160202(0xcb)]);const _0x537943=_0x2b72d2['dryRun']?[]:null,_0x25c281=_0x59827a(_0x38f9b4,_0x2b72d2,_0x2cb42c,_0x537943,_0x590e74[_0x160202(0x1a5)]),_0x42cc62=await _0x5c6782(_0x25c281),_0x17b73b={'type':'result','requestId':_0x2b72d2[_0x160202(0xd6)],'runId':_0x2b72d2[_0x160202(0x12a)],'result':_0x42cc62,'meta':{'runnerId':_0x160202(0x12b)+process[_0x160202(0x1c6)],'startedAt':_0xddb339,'finishedAt':Date['now'](),'durationMs':Date[_0x160202(0xfa)]()-_0xddb339}};if(_0x537943)_0x17b73b[_0x160202(0x89)]=_0x537943;_0x2cb42c(_0x17b73b);}catch(_0x4b7922){_0x2cb42c({'type':'error','requestId':_0x2b72d2[_0x160202(0xd6)],'runId':_0x2b72d2[_0x160202(0x12a)],'error':_0x13d0ca(_0x4b7922),'meta':{'runnerId':_0x160202(0x12b)+process[_0x160202(0x1c6)],'startedAt':_0xddb339,'finishedAt':Date[_0x160202(0xfa)](),'durationMs':Date['now']()-_0xddb339}});}finally{_0x39b031['delete'](_0x2b72d2[_0x160202(0xd6)]);}}async function _0x4ce826(){if(_0x3e3d00)return;_0x3e3d00=!![];try{await _0x38f9b4?.['close']?.();}catch{}process['exit'](0x0);}async function _0x1f5184(){const _0x1b25fd=_0x5b83a6,{rootPath:_0x54cf6c}=_0x452f76??{};if(!_0x54cf6c)throw new Error(_0x1b25fd(0xf1));_0x38f9b4=new _0x4dcecc(_0x54cf6c,{'engines':![],'processors':![],'compaction':![],'http':![],'auth':{'open':!![]},'processes':![]}),await _0x38f9b4[_0x1b25fd(0x1c0)]();const _0x230d5a=setInterval(()=>{const _0x5a28d3=_0x1b25fd;if(_0x3e3d00)return;for(const [,_0x28bd4d]of _0x38f9b4[_0x5a28d3(0x18e)]){try{_0x28bd4d['_drainHandler']?.();}catch{}}},0xc8);if(typeof _0x230d5a['unref']===_0x1b25fd(0x74))_0x230d5a[_0x1b25fd(0xb4)]();_0xd738b5['on'](_0x1b25fd(0x132),_0x24d7ce=>{const _0x36aa91=_0x1b25fd;if(!_0x24d7ce||typeof _0x24d7ce!==_0x36aa91(0x15a))return;if(_0x24d7ce[_0x36aa91(0x91)]==='stop')return void _0x4ce826();if(_0x24d7ce[_0x36aa91(0x91)]===_0x36aa91(0x11a)){_0x39b031[_0x36aa91(0x73)](_0x24d7ce[_0x36aa91(0xd6)])?.[_0x36aa91(0x102)](new Error('cancelled\x20by\x20caller'));return;}_0x24d7ce[_0x36aa91(0x91)]===_0x36aa91(0x80)&&void _0x31f060(_0x24d7ce[_0x36aa91(0x79)]);});const _0x140b54=Math[_0x1b25fd(0x1c7)](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0xcbfe58=setInterval(()=>{const _0x4528d6=_0x1b25fd;try{_0x2cb42c({'type':_0x4528d6(0x154),'heapUsed':_0x4b298f[_0x4528d6(0x196)]()[_0x4528d6(0x9c)]});}catch{}},_0x140b54);if(typeof _0xcbfe58[_0x1b25fd(0xb4)]===_0x1b25fd(0x74))_0xcbfe58[_0x1b25fd(0xb4)]();_0x2cb42c({'type':_0x1b25fd(0x8e)});}return _0x1f5184()[_0x5b83a6(0xff)](_0x1da701=>{const _0x29ed4f=_0x5b83a6;_0x2cb42c({'type':_0x29ed4f(0x19a),'error':_0x13d0ca(_0x1da701)}),process[_0x29ed4f(0xbd)](0x1);}),okdbFunctionsSandboxWorker$1;}var okdbFunctionsSandboxWorkerExports=requireOkdbFunctionsSandboxWorker(),okdbFunctionsSandboxWorker=getDefaultExportFromCjs(okdbFunctionsSandboxWorkerExports);module[_0x17c8b9(0x8b)]=okdbFunctionsSandboxWorker;function _0x1c24(){const _0x587cc6=['3128406etxnLJ','ttlStats','OKDBInvalidValueError','created','OKDBIndexAlreadyRegisteredError','patch','hash','path','list','global','_envs','getJob','readTransaction','reset','error','fetch\x20is\x20not\x20allowed\x20in\x20this\x20function\x20sandbox\x20(no\x20allowedFetchDomains\x20configured)','warn','update','getHeapStatistics','5802480harfWB','enabled','disable','fatal','fetch\x20blocked:\x20hostname\x20\x22','\x20actions=','stderr','__esModule','license:removed','ALREADY_EXISTS','\x27\x20doesn\x27t\x20exist','OKDBTypeNotRegisteredError','claimId','jobContext','signal','txn\x20ops\x20must\x20be\x20an\x20array','\x20already\x20exists','OKDBUniqueConstraintError','_startAdmission','OKDBInvalidPrimaryKeyError','index:progress','TYPE_NOT_REGISTERED','call','system:clock_change','actions','mode','1359916YlfEXR','fetch\x20blocked:\x20invalid\x20URL','system:drain','_report','clearTtl','targetType','action','reportOnFatalError','default','SCHEMA_COLLECTION_INVALID','schema:drop','Foreign\x20key\x20violation:\x20','stopped','true','FETCH_NOT_ALLOWED','open','fts:drop','~system','failures','freeze','ensureType','pid','max','3818514GSEJiL','value','cron','\x27\x20is\x20already\x20registered','\x20does\x20not\x20exist','844669PUJzrz','1241397aiuoAX','license:invalid','stringify','events','Index\x20\x22','script','openEnv','createContext','offWindow','onDo','hasType','allowFetch','size','Function\x20script\x20failed\x20to\x20compile','TXN_END','requestedAt','maxExtra','_admissionStarted','get','function','getIndex','schema:set','_buckets','ttl:expired','job','ttl:set','okdb-function.js','getByPath','captureStackTrace','info','query','run','txn','(worst\x20','okdb','ref:violation','hasOwnProperty','6638505IkTVof','txnId','resetIndex','dryRunActions','resetFts','exports','envPath','_closed','ready','Invalid\x20primary\x20key\x20type:\x20','listBuckets','type','FUNCTION_SCRIPT_COMPILE_FAILED','ms\x20mean=','listTTL',',\x20got\x20','system:proc',':\x20expected\x20','version','emit','runInContext','system:bus_state_change','used_heap_size','tries','getClock','system:env_release','indexReady','index:drop','Cannot\x20set\x20enforce\x20schema\x20on\x20','stopping','done','txn-commit','INVALID_VALUE','reject','cause','percentile','length','details','onWindow','OKDBIndexHasConsumersError','start','args','any','crypto','getMany','Index\x20\x27','unref','debug','materializer','slice','materializerContext','rollback','TXN_ROLLBACK','cursorKey','dropping','exit','setLogger','.\x20Only\x20primitives,\x20null,\x20Buffers,\x20and\x20arrays\x20are\x20allowed.\x20Got:\x20','system:ready','dropType','actionCount','node:perf_hooks',']\x20already\x20maps\x20to\x20\x27','push','ms\x20max=','env:opened','OKDBTypeAlreadyRegisteredError','getBucket','getCount','envName','_closeReadTransaction','put','isArray','mkdirSync','unique:violation_resolved','registerIndex','registerType','useReadTransaction','Invalid\x20index\x20key\x20type\x20for\x20\x27','removeJob','requestId','.\x20Primary\x20keys\x20must\x20be\x20string\x20or\x20number.\x20Got:\x20','Transaction\x20already\x20closed','SCHEMA_VALIDATION_FAILED','getIndexStatus','toFixed','license:added','txn:rollback','bus:poke','clear','stop','nativeCode','commit','OKDBAlreadyExistsError','\x27:\x20','globalThis','halted','ms\x20busy=','enableFatalReport','Unique\x20constraint\x20violated\x20on\x20','processor','hostname','job_heartbeat','system:stopped','INDEX_HAS_CONSUMERS','createEnvironment','OKDBNotFoundError','sandbox\x20worker:\x20rootPath\x20missing\x20from\x20workerData','constructor','url','\x27\x20on\x20type\x20\x27','getValues','env','sweepExpiredTTL','code','priority','now','runtime','\x27\x20already\x20registered','TXN_INVALID_ACTION','report','catch','keys','waiting','abort','started','excludeEnv','files','transaction','setDefaultTTL','string','ttl','\x20which\x20does\x20not\x20exist','dropIndex','system:poke','Unsupported\x20transaction\x20action:\x20','job_progress','options','getEntry','sourceEnv','_windowCbs','onUndo','set','queue','create','getChanges','getKeys','_log','cancel','INVALID_INDEX_KEY','ref:violation_resolved','prototype','timeoutMs','Type\x20\x27','type:registered','starting','clearDefaultTTL','sdk','functionName','timeout','item:remove','dropFts','bind','Function\x20script\x20failed\x20to\x20initialize','runId','sandbox-','addBucket','remove','payload','_started','compileTimeoutMs','ms\x20p99=','message','loop-lag','TXN_CLOSED','getDefaultTTL','allowedFetchDomains','64DOVzvo','maxMs','sourceKey','mean','\x27,\x20cannot\x20map\x20to\x20\x27','ttl:clear','reduce','directory','getRange','_admissionTimer','Cannot\x20delete\x20','VERSION_MISMATCH','index:ready','upload','name','30nxPyoL','enable','loop-lag\x20','node:vm','processorContext','has','clearTTL','postMessage','range','key','ftsQuery','targetKey','setTTL','note','stats','view:progress','bucket','setSchema','txn:start','updateJob','object','bus:drain','geoQuery','delete','setTtl','_doHooks','\x22\x20is\x20not\x20in\x20the\x20allowedFetchDomains\x20list','fts:reset','map','byIndex','enqueue',':\x20key\x20[','filename','join','_timer','Unknown\x20transaction\x20action:\x20','TXN_INVALID_OP','fetch','_undoHooks','INDEX_ALREADY_REGISTERED','SIGSEGV','\x20documents\x20fail\x20validation','_assertOpen','OKDBInvalidIndexKeyError','NOT_FOUND','bus:type_drop','stack','INDEX_NOT_REGISTERED','Function\x20script\x20must\x20evaluate\x20to\x20a\x20callable\x20function','sourceType','bus:proc','label','type:drop','reportOnSignal','log','getTTL','stream','dropSchema','worker_threads','count','engineKey','createWriteFacade'];_0x1c24=function(){return _0x587cc6;};return _0x1c24();}