@knpkv/jcf-web 0.2.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 (62) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +315 -0
  3. package/dist/client/assets/AgentSettingsPanel-NhTzwiq6.js +1 -0
  4. package/dist/client/assets/Schema-DUFTUil2.js +2 -0
  5. package/dist/client/assets/UrlParams-ZN2s8OM_.js +6 -0
  6. package/dist/client/assets/agentSettings-nw9lCgBQ.js +1 -0
  7. package/dist/client/assets/api-BQCWhiKV.js +4 -0
  8. package/dist/client/assets/decoding-CebF86HD.js +1 -0
  9. package/dist/client/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  10. package/dist/client/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  11. package/dist/client/assets/index-Ch0W9DhA.css +1 -0
  12. package/dist/client/assets/index-N2vhoKYl.js +51 -0
  13. package/dist/client/assets/rolldown-runtime-hePW80VL.js +1 -0
  14. package/dist/client/assets/transport-AcByYfLh.js +1 -0
  15. package/dist/client/index.html +19 -0
  16. package/dist/index.d.ts +11 -0
  17. package/dist/index.js +12 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/main.d.ts +2 -0
  20. package/dist/main.js +32 -0
  21. package/dist/main.js.map +1 -0
  22. package/dist/server/Api.d.ts +789 -0
  23. package/dist/server/Api.js +98 -0
  24. package/dist/server/Api.js.map +1 -0
  25. package/dist/server/Confirm.d.ts +94 -0
  26. package/dist/server/Confirm.js +243 -0
  27. package/dist/server/Confirm.js.map +1 -0
  28. package/dist/server/Handlers.d.ts +14 -0
  29. package/dist/server/Handlers.js +157 -0
  30. package/dist/server/Handlers.js.map +1 -0
  31. package/dist/server/HttpApplication.d.ts +7 -0
  32. package/dist/server/HttpApplication.js +62 -0
  33. package/dist/server/HttpApplication.js.map +1 -0
  34. package/dist/server/OwnerSession.d.ts +62 -0
  35. package/dist/server/OwnerSession.js +219 -0
  36. package/dist/server/OwnerSession.js.map +1 -0
  37. package/dist/server/RowDescriptions.d.ts +19 -0
  38. package/dist/server/RowDescriptions.js +42 -0
  39. package/dist/server/RowDescriptions.js.map +1 -0
  40. package/dist/server/SavedEntryOperations.d.ts +27 -0
  41. package/dist/server/SavedEntryOperations.js +171 -0
  42. package/dist/server/SavedEntryOperations.js.map +1 -0
  43. package/dist/server/Server.d.ts +13 -0
  44. package/dist/server/Server.js +29 -0
  45. package/dist/server/Server.js.map +1 -0
  46. package/dist/server/WeekPlan.d.ts +110 -0
  47. package/dist/server/WeekPlan.js +258 -0
  48. package/dist/server/WeekPlan.js.map +1 -0
  49. package/dist/server/WeekPlans.d.ts +30 -0
  50. package/dist/server/WeekPlans.js +190 -0
  51. package/dist/server/WeekPlans.js.map +1 -0
  52. package/dist/server/WeekRead.d.ts +435 -0
  53. package/dist/server/WeekRead.js +189 -0
  54. package/dist/server/WeekRead.js.map +1 -0
  55. package/dist/shared/contracts.d.ts +901 -0
  56. package/dist/shared/contracts.js +365 -0
  57. package/dist/shared/contracts.js.map +1 -0
  58. package/dist/shared/writePlanning.d.ts +6 -0
  59. package/dist/shared/writePlanning.js +19 -0
  60. package/dist/shared/writePlanning.js.map +1 -0
  61. package/dist/tsconfig.tsbuildinfo +1 -0
  62. package/package.json +60 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 knpkv
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,315 @@
1
+ # @knpkv/jcf-web
2
+
3
+ A week of Jira and Clockify time in a browser, with the gaps a Coding Agent's sessions evidence
4
+ offered for confirmation one row at a time.
5
+
6
+ `jcf sync reconcile --agent claude` already derives those gaps and writes them from a terminal. This
7
+ is the same engine — `@knpkv/jira-clockify`, the same services against the same config — behind a
8
+ grid, because a gap only means something next to the time already logged around it, and a week is how
9
+ a timesheet is actually read.
10
+
11
+ ## Running it
12
+
13
+ ```bash
14
+ pnpm --filter @knpkv/jcf-web build # the client is a static bundle the server serves
15
+ pnpm --filter @knpkv/jcf-web start # prints the URL that gets you in
16
+ ```
17
+
18
+ When installed from the published package, run `jcf-web` from the package's bin directory
19
+ (`pnpm exec jcf-web` in a pnpm project). The archive includes the built server and client;
20
+ it does not need the workspace source tree or `tsx` to start.
21
+
22
+ The printed URL carries a one-time code in its fragment. Opening it exchanges the code for a session
23
+ cookie and strips it from the address bar; reloading afterwards works because the cookie is what
24
+ authenticates. The code expires a minute after the server binds, so restart to get a fresh one.
25
+
26
+ For development, `pnpm --filter @knpkv/jcf-web dev` runs the server and Vite together and prints a
27
+ URL on the dev origin, which proxies the API and the bootstrap exchange so the browser stays on one
28
+ origin.
29
+
30
+ `PORT` moves the server (3111 by default).
31
+
32
+ ## What the calendar shows
33
+
34
+ Hours down, days across, and every block at the time it actually happened — one ISO week, Monday
35
+ first, so a week is the same week every time you open it. Saturday and Sunday appear only when they
36
+ hold something. The visible hours are a working day, widened to cover anything outside it, because a
37
+ 23:40 session is exactly what someone opens this to find.
38
+
39
+ Four independently switchable calendar layers:
40
+
41
+ - **Jira** shows every Jira worklog at its reported start and duration.
42
+ - **Clockify** shows every Clockify entry at its reported interval. Both provider layers remain
43
+ visible when they hold the same time. Each block names its provider and uses its Rly service rail.
44
+ - **No overlap** shows suggestions outside saved time in the visible provider layers, selected by default.
45
+ - **Overlap** shows only suggestions intersecting those entries.
46
+ - **All** shows both. These three suggestion filters are mutually exclusive.
47
+
48
+ The summary shows saved and suggested amounts separately for each provider, without adding the
49
+ same work twice into a combined total. Layer switches filter the calendar and phone agenda locally;
50
+ only selected provider layers receive new time. The header scope controls which systems are read.
51
+ Saved cards name their provider without comparing its total to the other system.
52
+
53
+ Overlapping ticket proposals become sequential allocations within the evidenced
54
+ stretch. Tickets share it evenly, with a fifteen-minute floor by default. When
55
+ there is not enough time for every ticket, the tickets with the most credited
56
+ evidence keep the available slots. These are proposed allocations, not exact
57
+ per-ticket activity timestamps. Separate work, idle gaps, wholly unplaced stretches and local
58
+ midnight remain boundaries. Mixed stretches reserve their unplaced share before
59
+ allocating known tickets, so changing shares do not create tiny blocks. A standalone stretch shorter than the floor stays
60
+ short; JCF never invents minutes. `jcf config set dwell <seconds>` changes the
61
+ floor; zero retains raw overlapping credit.
62
+
63
+ Ownership exceptions and days excluded by running timers appear below the calendar.
64
+
65
+ ## One system or both
66
+
67
+ The header picks what the week is about: both, Jira only, or Clockify only. The choice is remembered
68
+ per browser, because someone who tracks in one system does so every week.
69
+
70
+ A system that is out is not read, not proposed for, and not written to. That is stronger than
71
+ skipping its write, and it matters: a side nobody read holds an unknown amount, and treating unknown
72
+ as zero would propose the whole day for it. In a Jira-only week no Clockify request is made at all,
73
+ so a Clockify workspace you do not use cannot fail a run that never needed it.
74
+
75
+ The confirmation panel carries the selected provider layers as write targets. A hidden provider
76
+ is disabled in that panel and excluded from both approval and manual requests, even if the editor
77
+ was opened before the layer changed. A side you did not ask for is reported as skipped and
78
+ its gap is left exactly as it was, so asking for Jira today and both tomorrow writes the Clockify
79
+ half tomorrow.
80
+
81
+ ## Filling a gap
82
+
83
+ Clicking a dashed block opens a panel, not a modal — filling several in a row means comparing each
84
+ against the calendar it came from. The panel states the evidence, when the work happened, what each
85
+ system already holds, and the exact text that will be written, before its confirm button does
86
+ anything. Clicking empty space offers a manual entry at the time clicked, which is the gesture a
87
+ calendar teaches.
88
+
89
+ Two things may be overruled, and both are said out loud in what gets written:
90
+
91
+ - **The amount**, downward to any duration and upward only to the credited evidence. Above that the
92
+ write is refused with the ceiling named, because a tool that can invent hours is the one failure
93
+ every rule in the engine exists to prevent. Time no session evidences is logged as a manual entry
94
+ instead, which claims no evidence at all.
95
+ - **The Issue Key.** An override is re-tallied against the bucket it moves to before anything is
96
+ written: the target may already hold time the row knew nothing about, and sizing the write from the
97
+ plan's own numbers would log that time twice. Confirmed source blocks are linked to the resulting
98
+ provider entry IDs in a private owner-only ledger. Editing a description, including removal of a
99
+ `[jcf-source:…]` suffix, does not make confirmed time eligible again after a restart.
100
+
101
+ ## Safety
102
+
103
+ - Loopback only, one process, one operator. A read needs the session cookie; a write needs the
104
+ cookie, a matching origin, and the CSRF token this tab holds.
105
+ - A confirmation names a row of a plan the server still holds and carries no evidence of its own, so
106
+ a browser cannot post its own spans or its own credited seconds.
107
+ - Every write re-reads what Jira and Clockify hold at that moment and combines their current entry
108
+ durations with private provider-ID source bindings. Confirming the same row twice writes once;
109
+ editing its description does not reset consumption. Nothing is remembered about what was declined.
110
+ - An ordinary unlinked Clockify entry overlapping a proposed source block is ambiguous, not consumed
111
+ time. The plan and preview mark that block's Clockify side held; Confirm checks the fresh read and
112
+ refuses that side while independent Jira or nonoverlapping blocks may proceed. The browser sees
113
+ only the normalized hold, never provider entry IDs or account scopes.
114
+ - A retained plan keeps its provider account/site identity on the server. Confirm refuses a changed
115
+ identity before writing, and the provider adapters check it again at the write boundary. A provider
116
+ not read in the original scope is bound when an explicit confirmation first reads that side.
117
+ - A provider create with an uncertain result is held for manual recovery, not retried. Older
118
+ unlinked entries also require private review before first use; a missing or unreadable ledger is
119
+ never treated as proof that historical time was not written.
120
+ - Browser confirmations, manual entries and saved-entry edits share the machine writer guard with
121
+ `jcf watch`. A browser write is refused while the watch runs; a browser mutation holds the guard
122
+ only until its provider operation finishes and does not publish a watch resume cursor.
123
+ - Reconciliation only adds. Nothing is ever deleted in either system, and the only edits are the
124
+ ones you save explicitly in the saved-entry editor, which update that Jira worklog or Clockify entry.
125
+
126
+ ## Responsive review and progress
127
+
128
+ The calendar uses Rly's Geist fonts, semantic colors, fields, controls and state
129
+ panels. Appearance can follow the system or use light or dark mode.
130
+
131
+ On phones, the week opens as an agenda with readable ticket titles and times.
132
+ Calendar and Agenda controls switch presentations at any width. The calendar
133
+ scrolls inside its own area, keeping the page and editor within the viewport.
134
+ The editor has a reserved column beside the week on wide screens. On smaller screens
135
+ it floats over at most 75% of the viewport and scrolls internally. Opening, saving,
136
+ and closing it preserve the calendar's visible time position. Save results and totals
137
+ refresh progress appear in compact floating feedback without moving the calendar.
138
+ Opening an editor moves keyboard focus into it without scrolling; Escape or Cancel
139
+ returns focus to its trigger. If saving removes that suggestion, focus returns to the week.
140
+ Use Log time to enter work without clicking a calendar slot, including selecting
141
+ the day and start time.
142
+
143
+ Explicit session scans stream authenticated NDJSON from `/api/week/stream`. The existing JSON
144
+ read remains available. Progress names the actual stages: reading sessions,
145
+ matching tickets, reading logged time, checking Jira titles and ownership, and
146
+ building the calendar. AI attribution includes completed and total session counts.
147
+ Agent activity shows a read-only conversation for each batch: the supplied request first,
148
+ then the live response underneath. Both are selectable text with separate scroll areas;
149
+ complete JSON answers are indented. Partial output preserves its text as it arrives.
150
+ Batch buttons select concurrent conversations.
151
+ Scans open their progress, stage details and conversation in the right panel, sharing the calendar editor's reserved
152
+ space. Close or Escape dismisses it; Agent requests and responses reopens it. Narrow
153
+ screens use the bounded editor overlay, so the conversation does not push the calendar down.
154
+ Completed conversations remain available after loading and after totals-only refreshes.
155
+ Status-only events leave the text unchanged. No terminal renderer or input connection is required.
156
+ The response streams visible Claude text and structured answer fragments before each batch finishes.
157
+ It retains up to eight batches with up to 64,000 characters each for request and response;
158
+ longer text is explicitly marked as truncated. Requests contain the supplied session evidence.
159
+ Output is owner-authenticated; system configuration and reasoning events are excluded.
160
+ Loading details expands the stage history; elapsed time is measured in the browser.
161
+ The progress bar is indeterminate when the server cannot report a total.
162
+
163
+ The last loaded calendar remains visible during a refresh. Cancel read disconnects
164
+ that request and cancels its scoped server work; it never logs time. Choosing a
165
+ new week or system cancels the earlier read. Only the newest read may update the
166
+ calendar or its status. Writes are disabled while the displayed week is stale or
167
+ loading, and remain explicit actions that recheck server-held evidence.
168
+ Partial provider failures are shown as incomplete writes, never as full success.
169
+
170
+ After a confirmed or manual write, `/api/week/recorded` rereads Jira/Clockify totals
171
+ and running timers against the server-held session evidence. It recalculates gaps
172
+ without reopening transcripts, rerunning attribution, or looking up ownership again.
173
+ Navigation is available once the write returns; time-entry controls wait for current
174
+ totals. Retrying a failed totals refresh uses the same evidence and never repeats the
175
+ write.
176
+
177
+ Reload restores the selected week and scope through `/api/week/saved`, then refreshes
178
+ provider totals. The server retains the six most recent week/scope plans in memory.
179
+ When no plan is retained, `/api/week/recorded-only` loads saved provider entries
180
+ and running timers without reading sessions. Manual logging remains available.
181
+ A restart or eviction requires Rescan sessions only to restore suggestions.
182
+ Navigation, Refresh totals and configuration changes never start an agent automatically.
183
+
184
+ Agent settings selects Claude or Codex, an optional model name and a provider-supported
185
+ effort. Blank model and default effort leave those choices to the CLI. Saving persists
186
+ `sessionAgent` in JCF config and applies to subsequent attribution and description
187
+ operations. It does not rescan the displayed week. The selected CLI must be installed
188
+ and authenticated. Both providers receive only the supplied evidence in prompt-only
189
+ mode; their visible activity streams into the conversation.
190
+
191
+ Rescan sessions reads both Claude Code and Codex history within the configured session roots,
192
+ regardless of the matching agent selected. Codex sessions resumed from older date directories
193
+ are included. Reload continues to restore the existing plan; use Rescan sessions to pick up new
194
+ work or newly supported transcripts. The 15-minute suggestion minimum still applies.
195
+
196
+ Effect Atom shows pending Jira and Clockify slots immediately when a write starts.
197
+ Each provider settles separately: failed entries disappear and successful entries
198
+ remain visible while totals refresh, including when that refresh fails. The server
199
+ still sizes the actual write from live provider totals.
200
+
201
+ Use the + button on any calendar or agenda suggestion to queue its suggested time
202
+ with the current provider layers and default note. It skips the editor and never
203
+ requests a generated description. The ordinary card keeps its selected Review first
204
+ or Quick approve behavior. Its provider slots appear
205
+ immediately, with Undo available for at least five seconds and until saving starts.
206
+ Keep selecting other suggestions while the queue saves serially in the background.
207
+ The bounded queue floats beside the calendar, so + and Undo keep the visible time fixed.
208
+ The app refreshes provider totals once the queue drains. A queued write captures the
209
+ selected provider layers; hiding a provider before dispatch removes it from that
210
+ write. Showing another provider does not add it to an existing approval.
211
+ Week navigation and manual entry wait for the queue to finish. Reload cancels unsent
212
+ approvals; a request already sent can still finish. Undo does not delete saved entries.
213
+ Choose Review first to adjust the clicked block's amount or note before logging.
214
+ The editor shows that block's time range and submits only that block.
215
+ Work descriptions use a resizable multiline textarea in both suggestion and manual entry forms.
216
+ Opening it requests a work description from the retained sessions for that ticket and
217
+ day, using the current agent settings. The field fills when the suggestion arrives;
218
+ typing or deliberately clearing it prevents later responses from replacing your draft.
219
+ Switching blocks of the same row keeps the draft, and approval can proceed while the
220
+ description is pending. A progress bar and loading placeholder show when the agent is
221
+ preparing the text; they clear on completion, failure or your first edit. Quick approve
222
+ never starts description generation.
223
+ Description requests share a cache for the retained plan, row and agent settings,
224
+ including an unavailable suggestion. Transport and settings errors offer Retry;
225
+ no description generation happens secretly during a write.
226
+
227
+ Jira and Clockify have independent controls and counts. Suggestions use one filter:
228
+ No overlap, Overlap, or All.
229
+ Saved entries and no-overlap suggestions are shown by default; overlapping suggestions
230
+ are available through their labelled count. Clockify entries without a ticket remain visible and editable, and contribute
231
+ to Clockify totals. Overlap checks use only the provider layers currently shown,
232
+ regardless of ticket identity. Touching endpoints do not overlap. Suggestions keep
233
+ their complete durations when changing categories; this filter never splits them.
234
+ Solid blocks are saved entries, dashed blocks are suggestions, and dotted blocks
235
+ are pending writes. Provider totals stay visible when their calendar layer is hidden.
236
+
237
+ Calendar placement is memoized per plan, pending writes and layer selection. Minimum card height
238
+ participates in collision detection, so adjacent short intervals cannot cover each other.
239
+ Suggestions require at least 15 minutes of credited time, wall duration and remaining
240
+ time in a selected provider. This filter also applies to restored scans and retains
241
+ the original block indexes. Short saved Jira/Clockify records keep their actual duration.
242
+ Narrow cards prioritize the ticket key; provider labels remain in their accessible
243
+ description, hover text and layer controls.
244
+ Overnight entries retain every affected day, including weekends. Elapsed-time updates render separately.
245
+ Response validation loads separately from the initial interface. Recorded-time
246
+ reads and running-timer checks run concurrently within the existing provider scope.
247
+
248
+ The missing-suggestions message and its Scan sessions button sit beside the desktop
249
+ calendar and below the mobile calendar, without adding a banner above the week.
250
+
251
+ ## Edit saved time
252
+
253
+ Click a solid Jira or Clockify entry to open its details in the right panel. Edit the
254
+ start, end or multiline description, then Save changes. Save updates only the clicked
255
+ provider entry; it never creates another entry. Midnight slices open the entire entry.
256
+ Changed intervals must have ended by the time Save runs. A description-only edit keeps
257
+ the original interval, even for an older entry already dated in the future; it cannot
258
+ move that entry or create new future time.
259
+ The calendar previews the edit immediately with Effect Atom and rolls back on failure,
260
+ keeping the draft available to retry. Hiding the entry's provider layer disables Save.
261
+ Successful edits remain visible if the following
262
+ totals refresh fails. Reload restores the retained edit without rescanning sessions.
263
+
264
+ Generate description explicitly matches retained scanned sessions by ticket and their
265
+ individual active intervals. The loading indicator stays visible while the agent runs;
266
+ text typed or cleared during generation is preserved. Review the generated text before
267
+ saving. Clockify keeps the `[KEY]` prefix for a ticketed entry; Jira receives plain text.
268
+ Unkeyed Clockify entries require exactly one overlapping session. Missing or ambiguous
269
+ evidence produces no suggestion. Generation never rescans sessions or writes time.
270
+
271
+ Description edits accept up to 32,000 characters; generated text is at most 500.
272
+ Changed times use whole seconds, span at most 24 hours and overlap the selected week.
273
+ Jira starts must remain in that week and changed durations must be at least one minute;
274
+ existing shorter worklogs still allow description-only edits. Running, locked, time-off
275
+ or custom-field Clockify entries cannot be edited here. Jira description changes use
276
+ plain paragraphs, replacing formatting and embedded content; time-only edits preserve the original rich comment. Saves recheck
277
+ ownership and the retained snapshot. An opaque entry revision rejects stale drafts from
278
+ another tab; unchanged totals refreshes keep that revision valid. Older scans and
279
+ refreshes cannot replace entries edited while the read was running. Provider APIs cannot prevent an external edit
280
+ between that check and the update; local updates are serialized.
281
+ Saved-entry updates use the same machine writer guard as confirmations, so they are also refused
282
+ while `jcf watch` owns it.
283
+
284
+ ## Review boundaries
285
+
286
+ `weekReview.ts` owns read replacement, freshness, cancellation, mutation locking and
287
+ refresh after writes through an Effect Atom registry. `useWeek.ts` only connects React
288
+ mounting and observation. React owns the open editor and presentation choices.
289
+ `rowDescriptions.ts` owns per-row draft atoms and pending description requests. Totals
290
+ refresh preserves them; replacement plans discard them, and settings changes invalidate
291
+ generated text while keeping user edits. The authenticated `/api/rows/describe` route
292
+ uses only the server-held proposal, digests and title, without rescanning sessions.
293
+
294
+ `calendarProjection.ts` produces provider layers, suggestion overlap counts, placements
295
+ and totals. Both calendar and agenda consume that projection. It does not allocate
296
+ session evidence or authorize writes.
297
+
298
+ The engine's pure `agent/writePlanning.ts` resolves selected blocks, ticket overrides,
299
+ amounts and per-provider starts. Preview uses cached totals; confirmation rereads live
300
+ totals and sends the resulting concrete plan to the writer. CLI and watch retain their
301
+ existing write policy through the same anchoring calculation.
302
+
303
+ ## Browser checks
304
+
305
+ ```bash
306
+ pnpm --filter @knpkv/jcf-web exec playwright install chromium
307
+ pnpm --filter @knpkv/jcf-web test:browser
308
+ ```
309
+
310
+ The browser suite runs the production client, authenticated HTTP application and
311
+ reconciliation engine with fake provider services. It covers streamed status and
312
+ cancellation, competing reads, block selection, queued approval and Undo, keyboard focus, manual entry,
313
+ partial writes, selected write layers, agent settings, weeks without scans,
314
+ mobile overflow and both themes.
315
+ It never contacts Jira or Clockify or uses an operator's credentials.
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ai as t,fr as n}from"./UrlParams-ZN2s8OM_.js";import{h as r}from"./Schema-DUFTUil2.js";import{c as i,s as a}from"./api-BQCWhiKV.js";import{_ as o,d as s,l as c,u as l,v as u}from"./index-N2vhoKYl.js";import{n as d,t as f}from"./agentSettings-nw9lCgBQ.js";var p=e(u(),1),m=o(),h=r(f);function g(e){let[r,o]=(0,p.useState)(null),[u,f]=(0,p.useState)(!1),[g,_]=(0,p.useState)(null),[v,y]=(0,p.useState)(!1);(0,p.useEffect)(()=>{let e=new AbortController;return a(e.signal).then(t=>{e.signal.aborted||o(t)},n=>{e.signal.aborted||_(t(n)?n.message:String(n))}),()=>e.abort()},[]);let b=e=>{let t=h(e);n(t)&&(o(t.value),y(!1))},x=async()=>{if(!(r===null||u||e.disabled)){f(!0),e.onSaving(!0),_(null);try{o(await i(r)),y(!0),e.onSaved()}catch(e){_(t(e)?e.message:String(e))}finally{f(!1),e.onSaving(!1)}}};return(0,m.jsxs)(`section`,{className:`jcf-agent-settings`,"aria-label":`Session agent settings`,children:[(0,m.jsx)(`p`,{children:`Used for Rescan sessions and suggested work descriptions. Blank model and default effort use the agent CLI settings.`}),g===null?null:(0,m.jsx)(c,{title:`Could not update agent settings`,description:g,tone:`critical`}),r===null?(0,m.jsx)(`p`,{children:g===null?`Loading agent settings…`:`Close and reopen agent settings to retry.`}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`jcf-agent-settings-fields`,children:[(0,m.jsx)(l,{label:`Agent`,children:t=>(0,m.jsxs)(`select`,{...t,value:r.provider,disabled:u||e.disabled,onChange:e=>{b({provider:e.target.value,model:null,effort:null})},children:[(0,m.jsx)(`option`,{value:`claude`,children:`Claude`}),(0,m.jsx)(`option`,{value:`codex`,children:`Codex`})]})}),(0,m.jsx)(l,{label:`Model`,children:t=>(0,m.jsx)(`input`,{...t,value:r.model??``,placeholder:`CLI default`,maxLength:200,disabled:u||e.disabled,onChange:e=>{b({...r,model:e.target.value.trim()===``?null:e.target.value.trim()})}})}),(0,m.jsx)(l,{label:`Effort`,children:t=>(0,m.jsxs)(`select`,{...t,value:r.effort??`default`,disabled:u||e.disabled,onChange:e=>{b({...r,effort:e.target.value==="default"?null:e.target.value})},children:[(0,m.jsx)(`option`,{value:`default`,children:`CLI default`}),d(r.provider).map(e=>(0,m.jsx)(`option`,{value:e,children:e},e))]})})]}),(0,m.jsx)(s,{size:`compact`,disabled:e.disabled||u,loading:u,onClick:()=>void x(),children:`Save agent settings`}),v?(0,m.jsx)(`p`,{role:`status`,children:`Saved. Applies on the next Rescan sessions.`}):null]})]})}export{g as default};
@@ -0,0 +1,2 @@
1
+ import{$r as e,A as t,Cr as n,D as r,E as i,Ei as a,Gn as o,Gr as s,Hn as c,Ir as l,Jt as u,Kr as d,Kt as f,Lr as p,Nn as m,P as ee,Rr as te,Si as h,Sn as g,Sr as _,Ti as ne,Tn as re,Tr as ie,Un as ae,Ur as v,Ut as y,Vn as oe,Vr as se,W as ce,Wt as le,Xr as ue,Zr as de,Zt as fe,_r as pe,an as me,bi as he,br as ge,ci as _e,ct as ve,di as ye,dn as b,ei as be,gr as xe,ht as Se,ii as Ce,in as we,j as x,jr as S,k as Te,kr as Ee,li as De,mt as C,ni as Oe,oi as ke,ot as Ae,pi as je,qt as Me,ri as w,si as Ne,ui as Pe,w as Fe,wi as Ie,wr as Le,x as Re,xi as ze,xn as Be,xr as Ve,yt as He,zn as Ue}from"./UrlParams-ZN2s8OM_.js";var We=`~effect/DateTime`,Ge=`~effect/DateTime/TimeZone`,Ke={[We]:We,pipe(){return a(this,arguments)},[se](){return this.toString()},toJSON(){return Je(this).toJSON()}};({...Ke}),{...Ke};var qe={[Ge]:Ge,[se](){return this.toString()}};({...qe}),{...qe};var Je=e=>new Date(e.epochMilliseconds),Ye=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Xe=new Uint8Array(123).fill(255);for(let e=0;e<64;e++)Xe[Ye.charCodeAt(e)]=e;Xe[61]=0;var Ze=`~effect/BigDecimal`,Qe={[Ze]:Ze,[Oe](){let t=at(this);return de(be(String(t.value)),e(t.scale))},[ue](e){return $e(e)&&ut(this,e)===0},toString(){return`BigDecimal(${ft(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[se](){return this.toJSON()},pipe(){return a(this,arguments)}},$e=e=>w(e,Ze),et=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let n=Object.create(Qe);return n.value=e,n.scale=t,n},tt=(e,t)=>{let n=et(e,t);return n.normalized=n,n},T=BigInt(0),nt=BigInt(1),rt=BigInt(10),it=tt(T,0),at=e=>{if(e.normalized===void 0){if(e.value===T)e.normalized=it;else{let t=`${e.value}`,n=t.length;for(;t[n-1]===`0`;)n--;e.normalized=tt(BigInt(t.slice(0,n)),e.scale-(t.length-n))}}return e.normalized},ot=100,st=[nt],ct=(e,t)=>e===t?0:e<t?-1:1,lt=(e,t)=>{let n=`${e.value<T?-e.value:e.value}`,r=`${t.value<T?-t.value:t.value}`,i=BigInt(n.length-r.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==T)return i<T?-1:1;let a=Math.max(n.length,r.length);return Ve(n.padEnd(a,`0`),r.padEnd(a,`0`))},ut=(e,t)=>{if(e.scale===t.scale)return ct(e.value,t.value);let n=dt(e),r=dt(t);if(n!==r)return n<r?-1:1;if(n===0)return 0;let i=e.scale-t.scale,a=Math.abs(i);if(a>ot)return n===-1?lt(t,e):lt(e,t);let o=st[a]??=rt**BigInt(a);return i>0?ct(e.value,t.value*o):ct(e.value*o,t.value)},dt=e=>e.value===T?0:e.value<T?-1:1,ft=e=>{let t=at(e);if(Math.abs(t.scale)>=16)return pt(t);let n=t.value<T,r=`${n?-t.value:t.value}`,i=t.scale>0?r.padStart(t.scale+1,`0`):r.padEnd(r.length-t.scale,`0`),a=i.length-t.scale,o=t.scale>0?`${i.slice(0,a)}.${i.slice(a)}`:i;return n?`-${o}`:o},pt=e=>{if(mt(e))return`0e+0`;let t=at(e),n=`${t.value}`,r=t.value<T?2:1,i=n.slice(0,r),a=n.slice(r),o=a.length-t.scale;return`${i}${a===``?``:`.${a}`}e${o>=0?`+`:``}${o}`},mt=e=>e.value===T;function ht(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}var gt=`~structural`,_t=`~sentinels`,vt=`~constructor`,yt=ze(e=>{let t=ht(e)?.identifier;return typeof t==`string`?t:e.getExpected(yt)}),E=Symbol(),D=Me,O=D(E),k=D(E),bt=e=>e===E?xe():pe(e),xt=e=>e._tag===`None`?O:D(e.value),St=`~effect/SchemaIssue/Issue`;function Ct(e){return w(e,St)&&e[St]===St}function wt(e){return Object.hasOwn(e,`input`)}var A=class{[St]=St;constructor(e,t){t?.reportInput===!0&&e!==E&&(this.input=e)}},Tt=class extends A{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},Et=class extends A{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},j=class extends A{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},Dt=class extends A{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},Ot=class extends A{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},M=class extends A{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},N=class extends A{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},P=class extends A{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},kt=class extends A{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},At=class extends A{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function jt(e,t,n){if(Ct(e))return e;if(typeof e==`string`)return new P({message:e},t,n);let r=typeof e.issue==`string`?new P({message:e.issue},t,n):e.issue;return new j(e.path,r)}function Mt(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new P(void 0,t,n):jt(e,t,n)}function Nt(e,t,n,r){return Array.isArray(t)?ae(t)?t.length===1?jt(t[0],n,r):new M(e,o(t,e=>jt(e,n,r)),n,r):void 0:Mt(t,n,r)}var Pt=e=>{let t=Ut(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return Rt(yt(e.ast),e);case`InvalidValue`:{let t=Lt(e);if(t!==void 0)return Rt(t,e);let n=It(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=It(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=It(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},Ft=e=>Ut(e.issue)??Ut(e);function It(e){return wt(e)?v(e.input):void 0}function Lt(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function Rt(e,t){let n=It(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function zt(e){let t=e.annotations?.expected;if(typeof t==`string`)return t;switch(e._tag){case`Filter`:return`<filter>`;case`FilterGroup`:return e.checks.map(e=>zt(e)).join(` & `)}}function Bt(){return e=>Ht(e,``)}var Vt=Bt();function Ht(e,t){let n;switch(e._tag){case`Filter`:{let r=Ft(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return Ht(e.issue,t);let r=Lt(e.issue);n=r===void 0?Rt(zt(e.filter),e):Rt(r,e.issue)}break}case`Encoding`:return Ht(e.issue,t);case`Pointer`:return Ht(e.issue,t+s(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>Ht(e,t)).join(`
2
+ `);n=Ut(e)??Rt(yt(e.ast),e);break;default:n=Pt(e)}return t?`${n}\n at ${t}`:n}function Ut(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return Ut(e.issue);let t=(e._tag===`Filter`?e.filter.annotations:`annotations`in e?e.annotations:e.ast.annotations)?.[e._tag===`MissingKey`?`messageMissingKey`:e._tag===`UnexpectedKey`?`messageUnexpectedKey`:`message`];if(typeof t==`string`)return t}function Wt(e){let t;for(let n of e.reasons){if(!we(n)||!Ct(n.error))return;t??=n.error}return t}function Gt(e,t){let n=Wt(e);if(n===void 0)throw Error(t,{cause:e});return n}var Kt=e=>Object.assign(Object.create(ne),e),qt=Kt({_tag:`Passthrough`});function Jt(){return qt}function F(e){return Kt({_tag:`Transform`,transform:e})}function Yt(e){return Kt({_tag:`TransformEffect`,transform:e})}function Xt(){return F(globalThis.String)}function Zt(){return F(globalThis.Number)}function Qt(e){return Yt((t,n)=>He({try:()=>JSON.parse(t,e?.reviver),catch:()=>new P({expected:`a valid JSON string`},t,n)}))}function $t(e){return Yt((t,n)=>He({try:()=>{let n=JSON.stringify(t,e?.replacer,e?.space);if(n===void 0)throw TypeError(`Value cannot be represented as JSON`);return n},catch:()=>new P({expected:`a JSON-serializable value`},t,n)}))}var en=class extends Ie{_tag=`Middleware`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new en(this.encode,this.decode)}},I=`~effect/SchemaTransformation/Transformation`,L=class extends Ie{[I]=I;_tag=`Transformation`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new L(this.encode,this.decode)}};function tn(e){return w(e,I)&&e[I]===I}var nn=e=>tn(e)?e:new L(e.decode,e.encode),rn=new L(Jt(),Jt());function an(){return rn}var on=new L(Zt(),Xt());function sn(e){return new L(Qt(e??{}),$t(e))}function R(e){return t=>t._tag===e}var cn=R(`Declaration`),ln=R(`Never`),z=R(`Literal`),un=R(`UniqueSymbol`),dn=R(`Arrays`),fn=R(`Objects`),pn=R(`Suspend`),B=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},mn={},V=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},hn=`~effect/Schema`,H=class{[hn]=hn;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},gn=class extends H{_tag=`Declaration`;typeParameters;run;encodingChecks;encodingRun;constructor(e,t,n,r,i,a,o,s){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o,this.encodingRun=s}getParser(){let e;return(t,n)=>t===E?O:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(e,t,n,r,i){let a=J(this.typeParameters,e);return a===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&i===this.encodingRun?this:new gn(a,r,this.annotations,t,void 0,this.context,n,i)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}},_n=new class extends H{_tag=`Null`;getParser(){return Gr(this,null)}getExpected(){return`null`}},vn=class extends H{_tag=`Undefined`;getParser(){return Gr(this,void 0)}toCodecJson(){return K(this,[yn])}getExpected(){return`undefined`}},yn=new B(_n,new L(F(()=>void 0),F(()=>null))),bn=new vn,xn=new class extends H{_tag=`Unknown`;getParser(){return Kr(this,je)}getExpected(){return`unknown`}},Sn=class extends H{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${v(e)}`);this.literal=e}getParser(){return Gr(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?Cn(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:Cn(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function Cn(e){let t=globalThis.String(e.literal);return K(e,[new B(new Sn(t),new L(F(()=>e.literal),F(()=>t)))])}var U=new class extends H{_tag=`String`;getParser(){return Kr(this,ye)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&Z(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},wn=class extends H{_tag=`Number`;getParser(){return Kr(this,_e)}matchKey(e,t){return this._match(Xr,e,t)}matchPart(e,t){return this._match(Yr,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:Z(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(Tn(this.checks,`effect/schema/isFinite`)||Tn(this.checks,`effect/schema/isInt`))?this:K(this,[hr])}toCodecStringTree(){return this.toCodecJson()===this?K(this,[$r]):K(this,[ei])}getExpected(){return`number`}};function Tn(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&Tn(e.checks,t))}var En=new wn,Dn=new class extends H{_tag=`Boolean`;getParser(){return Kr(this,Ce)}getExpected(){return`boolean`}},On=class extends H{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(Y(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(Y(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,n=e){let i=this,a,o,s=i.elements.length,c=Math.max(0,i.rest.length-1);function l(e,t){return t<s?a[t]:t>=e?o[t-e+1]:o[0]}let u=e=>{let{input:t,len:n,options:a}=e;if(i.rest.length===0&&n>s)for(let o=s;o<n;o++){let n=new Ot(i,t[o],a),s=new j([o],n);if(a.errors===`all`)e.issues?e.issues.push(s):e.issues=[s];else return r(new M(i,[s],t,a))}return e.issues?r(new M(i,e.issues,t,a)):D(e.output)},d=(e,n)=>{let r=e.length,a={ast:i,getParser:l,input:e,len:r,tailThreshold:Math.max(s,r-c),output:new globalThis.Array(r),issues:void 0,options:n},o=i.rest.length===0?s:Math.max(r,s+c),f=n.concurrency===void 0?1:re(n.concurrency),p=f===1?jn(a,e,0,o):Mn(a,e,{concurrency:f,end:o});if(!p)return u(a);if(b(p))return x(p,()=>u(a));let m=!0;return Se(()=>m?(m=!1,t(p,()=>u(a))):d(e,n))};return(e,t)=>{if(e===E)return O;try{return Array.isArray(e)?(a||(a=i.elements.map(e=>({ast:e,parser:n(e)})),o=i.rest.map(e=>({ast:e,parser:n(e)}))),d(e,t)):r(new N(i,e,t))}catch(e){return Fe(e)}}}_rebuild(e,t,n){let r=J(this.elements,e),i=J(this.rest,e);return r===this.elements&&i===this.rest&&t===this.checks&&n===this.encodingChecks?this:new On(this.isMutable,r,i,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}};function kn(e,t,n,r){if(n._tag===`Failure`)return Nn(e,e.ast,r,n);let i=n===k?t:n[S];if(i!==E)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(Y(t.ast))return;let n=new j([r],new Dt(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return y(new M(e.ast,[n],e.input,e.options))}}var An={onItem(e,t,n){let r=n<e.len?t:E;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step:kn},jn=g()(An),Mn=Be()(An),Nn=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=Wt(r.cause);if(i===void 0)return le(me(r.cause,r=>new M(t,[new j([n],r)],e.input,e.options)));let a=new j([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return y(new M(t,[a],e.input,e.options))},Pn=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function Fn(e,t,n=mn){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(r=>Object.prototype.propertyIsEnumerable.call(e,r)&&t.matchKey(r,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(qr(Hr(t)))}var In=class{name;type;constructor(e,t){this.name=e,this.type=t}};function Ln(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(Ln);default:return!1}}function Rn(e){let t=br(e);switch(t._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return t.types.every(Rn);default:return!1}}function zn(e){return Ln(e)&&Rn(e)}var Bn=class{parameter;type;constructor(e,t){if(!zn(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Y(t)&&!Wr(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},Vn=class extends H{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o}getParser(e,n=e){let a=this,o=a.propertySignatures.length,s=a.indexSignatures.length;if(!o&&!s)return Kr(a,Ne);let c,d,f=()=>(c||(c=a.propertySignatures.map(e=>({parser:n(e.type),name:e.name,type:e.type})),d=s?a.indexSignatures.map(t=>({is:t,parserKey:e(qr(t.parameter)),parserValue:n(t.type)})):void 0),c),p=()=>{let e=new Set(a.propertySignatures.map(e=>typeof e.name==`number`?globalThis.String(e.name):e.name)),n=(t,n,r,i,s)=>{if(s._tag===`Failure`)return Nn(t,a,n,s)??u;let c=s===k?i:s[S];if(r!==E&&c!==E){if(o&&(e.has(n)||e.has(typeof r==`number`?globalThis.String(r):r)))return u;l(t.out,r,c)}return u},p=(e,r,o,s)=>{if(!s){let n=o.parserKey(r,e.options);if(!b(n))return t(i(n),t=>p(e,r,o,t));s=n}if(s._tag===`Failure`)return Nn(e,a,r,s)??u;let c=s===k?r:s[S],l=e.input[r],d=o.parserValue(l,e.options);return b(d)?n(e,r,c,l,d):t(i(d),t=>n(e,r,c,l,t))},m=(e,r,a)=>{let o=e.input[r],s=a.parserValue(o,e.options);return b(s)?n(e,r,r,o,s):t(i(s),t=>n(e,r,r,o,t))},te=s?Be()({onItem:(e,[t,n])=>n.is.parameter===U?m(e,t,n):p(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return ee(function*(t,n){if(t===E)return E;if(typeof t!=`object`||!t||Array.isArray(t))return yield*r(new N(a,t,n));f();let i=t,l={},u={ast:a,input:i,out:l,issues:void 0,options:n},ee=n.errors===`all`,h=n.onExcessProperty===`error`,g=n.concurrency===void 0?1:re(n.concurrency),_=s&&h?a.indexSignatures.map(e=>Fn(i,e.parameter,n)):void 0;if(h){let o=_?new Set(e):e;if(_)for(let e of _)for(let t of e)o.add(t);let s=Reflect.ownKeys(i);for(let e=0;e<s.length;e++){let c=s[e];if(!o.has(c)&&Object.prototype.propertyIsEnumerable.call(i,c)){let e=new Ot(a,i[c],n),o=new j([c],e);if(ee){u.issues?u.issues.push(o):u.issues=[o];continue}return yield*r(new M(a,[o],t,n))}}}if(o){let e=g===1?Wn(u,c):Gn(u,c,{concurrency:g});e&&(yield*e)}if(s&&g===1)for(let e=0;e<s;e++){let t=d[e],r=t.is.parameter===U?m:p,a=_?.[e]??(t.is.parameter===U?Object.keys(i):Fn(i,t.is.parameter,n));for(let e=0;e<a.length;e++){let n=r(u,a[e],t);if(!b(n))yield*n;else if(n._tag===`Failure`)return yield*n}}else if(te){let e=oe();for(let t=0;t<s;t++){let r=d[t],a=_?.[t]??(r.is.parameter===U?Object.keys(i):Fn(i,r.is.parameter,n));for(let t=0;t<a.length;t++)e.push([a[t],r])}let t=te(u,e,{concurrency:g});t&&(yield*t)}return u.issues?yield*r(new M(a,u.issues,t,n)):l})};if(s)return p();let m,te=(e,n,r)=>{let a=c[n];return t(i(r),t=>{let r=Hn(e,a,t);if(r)return r;let i=()=>D(e.out),o=Wn(e,c.slice(n+1));return o?x(o,i):i()})};return(e,t)=>{if(e===E)return O;if(t.errors===`all`||t.onExcessProperty!==void 0||t.concurrency!==void 0&&re(t.concurrency)!==1)return(m??=p())(e,t);if(typeof e!=`object`||!e||Array.isArray(e))return r(new N(a,e,t));let n=f(),i=e,o={},s={ast:a,input:i,out:o,issues:void 0,options:t};try{for(let e=0;e<n.length;e++){let r=n[e],a=r.name,c=W(i,a),u=c?i[a]:E,d=r.parser(u,t);if(!b(d))return te(s,e,d);if(d===k){c&&l(o,a,u);continue}let f=Hn(s,r,d);if(f)return f}}catch(e){return Fe(e)}return D(o)}}_rebuild(e,t,n,r){let i=J(this.propertySignatures,t=>{let n=e(t.type);return n===t.type?t:new In(t.name,n)}),a=J(this.indexSignatures,n=>{let r=t(n.parameter),i=e(n.type);return r===n.parameter&&i===n.type?n:new Bn(r,i)});return i===this.propertySignatures&&a===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new Vn(i,a,this.annotations,n,void 0,this.context,r)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}};function Hn(e,t,n){if(n._tag===`Failure`)return Nn(e,e.ast,t.name,n);if(n===k)return;let r=n[S];if(r!==E){l(e.out,t.name,r);return}if(delete e.out[t.name],!Y(t.type)){let n=new j([t.name],new Dt(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return y(new M(e.ast,[n],e.input,e.options))}}var Un={onItem(e,t){if(!W(e.input,t.name))return t.parser(E,e.options);let n=e.input[t.name];return l(e.out,t.name,n),t.parser(n,e.options)},step:Hn},Wn=g()(Un),Gn=Be()(Un);function Kn(e,t){return e?t?[...e,...t]:e:t}function qn(e,t,n){return new Vn(Reflect.ownKeys(e).map(t=>new In(t,e[t].ast)),[],n,t)}function Jn(e){return e.ast}function Yn(e,t,n){return new G(e.map(Jn),t,void 0,n)}var Xn=h(e=>{for(;;){if(pn(e))return xn;let t=e.encoding;if(!t)return e.recur?.(Xn,he)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==he))return xn;e=t[t.length-1].to}});function Zn(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(Zn)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Qn(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[_t];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!Y(t)){if(z(t))return[{key:e.name,literal:t.literal}];if(un(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!Y(e)){if(z(e))return[{key:t,literal:e.literal}];if(un(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Qn(Xn(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Qn(e.thunk())}}var $n=new WeakMap,er=Object.freeze([]),tr=e=>e===null?`null`:Array.isArray(e)?`array`:typeof e,W=(e,t)=>t===`__proto__`?Object.hasOwn(e,t):t in e;function nr(e){let t=$n.get(e);if(t)return t;let n,r=0,i,a,o=!0,s=[];for(let t=0;t<e.length;t++){let c=e[t],l=Xn(c);if(ln(l))continue;if(z(l)||un(l)){a??=new Map;let e=z(l)?l.literal:l.symbol;s[t]=e;let n=a.get(e);n||a.set(e,n=[]),n.push(t)}else o=!1;let u=Qn(l);if(u.length){n??=new Map,r++;for(let{key:e,literal:r}of u){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=Zn(l);for(let n of e)(i[n]??=[]).push(t)}}let c={},l=e=>c[e]??=Object.freeze(i?.[e]??er);if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??er;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=new Map;for(let[e,t]of i)a.set(e,Object.freeze(Array.from(t)));let o=Object.freeze(e.map((e,t)=>t));t=(e,t)=>{if(De(e)){let n=W(e,r)?e[r]:void 0;if(n!==void 0)return a.get(n)??er;if(t)return o}return er}}else if(n){let e;for(let t of n)(!e||t[1][0].size>e[1][0].size)&&t[1][1].size===r&&(e=t);t=(t,r)=>{let a=tr(t);if(!De(t))return l(a);let o=new Set(i?.[a]),s;if(e){let[n,[i]]=e,c=W(t,n),u=c?t[n]:void 0;if(c&&(!r||u!==void 0)){let e=i.get(u);if(!e)return l(a);for(let t of e)o.add(t);s=n}}if(s===void 0)for(let[e,[i,a]]of n){let n=W(t,e),s=n?t[e]:void 0;if(n&&(!r||s!==void 0)){let e=i.get(s);if(e)for(let t of e)o.add(t)}else if(r)for(let e of a)o.add(e)}for(let[e,[i,a]]of n){if(e===s)continue;let n=W(t,e),c=n?t[e]:void 0;if(n&&(!r||c!==void 0)){let e=i.get(c);for(let t of o)a.has(t)&&!e?.has(t)&&o.delete(t)}}return Array.from(o).sort((e,t)=>e-t)}}else t=e=>{let t=l(tr(e));return a?t.filter(t=>s[t]===void 0||s[t]===e):t};return $n.set(e,t),t}var G=class extends H{_tag=`Union`;types;options;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.options=t,this.encodingChecks=o}getParser(e,t){let n=this,i=t!==void 0,a=[],o=t=>a[t]??=e(n.types[t]),s;return(e,t)=>{if(e===E)return O;let a=(s??=nr(n.types))(e,i);if(a.length===0)return r(new kt(n,[],e,t));if(a.length===1){let r=o(a[0])(e,t);return r._tag===`Success`?r:b(r)?rr(n,r.cause,e,t):ir(n,r,e,t)}return ar(n,o,a,e,t)}}_rebuild(e,t,n){let r=J(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new G(r,this.options,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=Hr(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(z);if(t.length>0)return`${lr(n.isMutable)}[ ${t.map(t=>e(t)+ur(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>z(e.type));if(t.length>0)return`{ ${t.map(t=>`${lr(t.type.context?.isMutable)}${d(t.name)}${ur(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function rr(e,t,n,r){let i=Wt(t);return i?y(new kt(e,[i],n,r)):le(t)}function ir(e,t,n,r){return Re(t,t=>rr(e,t,n,r))}function ar(e,t,n,i,a){let o={ast:e,parser:t,input:i,out:void 0,successes:e.options?.mode===`oneOf`?[]:void 0,issues:void 0,options:a},s=sr(o,n);return s?or(s,o):o.out?o.out:r(new kt(e,o.issues??[],i,a))}function or(e,t){return x(e,e=>t.out===k?C(t.input):t.out?t.out:r(new kt(t.ast,t.issues??[],t.input,t.options)))}var sr=g()({onItem(e,t){return e.parser(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=Wt(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(e.ast.types[t]),y(new At(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(e.ast.types[t]);else return u}}}),cr=new G([new Sn(`Infinity`),new Sn(`-Infinity`),new Sn(`NaN`)]);function lr(e){return e?``:`readonly `}function ur(e){return e?`?`:``}var dr=class extends Ie{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(e){return new dr(this.run,{...this.annotations,...e},this.aborted)}abort(){return new dr(this.run,this.annotations,!0)}and(e,t){return new fr([this,e],t)}},fr=class extends Ie{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new fr(this.checks,{...this.annotations,...e})}and(e,t){return new fr([this,e],t)}};function pr(e,t,n=!1){return new dr((t,n,r)=>Nt(n,e(t,n,r),t,r),t,n)}function mr(e){return pr(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitraryConstraint:{number:`finite`},...e})}var hr=new B(new G([Cr(En,[mr()]),cr]),new L(Zt(),F(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function gr(e,t){let n=new globalThis.RegExp(e),r={source:n.source,flags:n.flags};return pr(e=>(n.lastIndex=0,n.test(e)),{expected:`a string matching the RegExp ${r.source}`,representation:{id:`effect/schema/isPattern`,payload:r},toJsonSchema:()=>[{},!0],arbitraryConstraint:{patterns:[r]},...t})}var _r=new WeakMap;function vr(e,t){let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(e=>e===`context`||e===`encoding`)&&_r.set(n,yr(e)),n}function yr(e){let t=_r.get(e);if(t!==void 0)return t;if(e.encoding===void 0)return e;let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,{encoding:void 0});return _r.set(e,n),n}function K(e,t){return e.encoding===t?e:vr(e,{encoding:t})}function q(e,t){if(e.context===t)return e;let n=yr(e);return n.context===t&&n.encoding===e.encoding?n:vr(e,{context:t})}function br(e){return e.encoding?br(e.encoding[e.encoding.length-1].to):e}function xr(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return Sr(e,Ue(e.checks.slice(0,-1),n.annotate(t)))}return vr(e,{annotations:{...e.annotations,...t}})}function Sr(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:vr(e,{checks:t})}function Cr(e,t){return Sr(e,Kn(e.checks,t))}function wr(e,t){let n=t(e.to);return n===e.to?e:new B(n,e.transformation)}function Tr(e,t){let n=e,r=n[n.length-1],i=wr(r,t);return i===r?e:Ue(e.slice(0,e.length-1),i)}function Er(e){return t=>t.encoding?K(t,Tr(t.encoding,e)):t}function Dr(e,t){return Er(e=>q(e,t))(e)}function Or(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:K(r,Tr(r.encoding,n))}return e(r)}return h(n)}function kr(e,t,n){let r=new B(e,t);return K(n,n.encoding?[...n.encoding,r]:[r])}function J(e,t){let n;for(let r=0;r<e.length;r++){let i=e[r],a=t(i);if(n)n[r]=a;else if(a!==i){n=Array(e.length);for(let t=0;t<r;t++)n[t]=e[t];n[r]=a}}return n??e}function Ar(e,t){return q(e,e.context?new V(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new V(!1,!1,void 0,t))}var jr=h(e=>Mr(q(e,e.context?e.context.isOptional===!1?new V(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new V(!0,!1)))),Mr=Er(jr),Nr=ze(e=>jr(new G([e,bn])));function Pr(e,t){return q(e,e.context?new V(e.context.isOptional,e.context.isMutable,t,e.context.annotations):new V(!1,!1,t))}function Fr(e,t,n){return kr(e,n,t)}function Ir(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:Pe(e.literal)&&!t.includes(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.includes(e.symbol)||t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function Lr(e,t){let{literals:n,parameters:r}=Ir(e);return new Vn(n.map(e=>new In(e,t)),r.map(e=>new Bn(e,t)))}function Y(e){return e.context?.isOptional??!1}function Rr(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(Rr)}function zr(e){function t(e){return Rr(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return c(n)?n:void 0}function Br(e){let t=!0;function n(e){return t=t&&!e.encoding&&!pn(e),t&&`recur`in e&&e.recur(n),e}return`recur`in e&&e.recur(n),t}var Vr=h(e=>{let t=yr(e);if(t!==e){let n=Vr(t);return n===t&&e.encoding===void 0?e:q(n,e.context)}let n=`recur`in e?e.recur(Vr):e;if(`encodingChecks`in n&&n.encodingChecks){let t=Br(e)?n.encodingChecks:dn(n)||fn(n)||cn(n)&&n.typeParameters.length>0?zr(n.encodingChecks):void 0;return vr(n,{encodingChecks:void 0,checks:Kn(n.checks,t)})}return n}),Hr=h(e=>Vr(X(e)));function Ur(e,t){let n=t,r=n.length,i=n[r-1],a=[new B(X(K(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new B(X(n[e-1].to),n[e].transformation.flip()));let o=X(i.to);return o.encoding?K(o,[...o.encoding,...a]):K(o,a)}var X=ze(e=>{if(e.encoding)return Ur(e,e.encoding);let t=yr(e);if(t!==e){let n=X(t);return n===t?e:q(n,e.context)}return`flip`in e?e.flip(X):`recur`in e?e.recur(X):e});function Wr(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(Wr);default:return!1}}function Gr(e,t){let n=t===0?k:D(t);return(i,a)=>i===E?O:i===t?n:r(new N(e,i,a))}function Kr(e,t){return(n,i)=>n===E?O:t(n)?k:r(new N(e,n,i))}var qr=Or(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(qr)}}),Jr=Or(e=>{switch(e._tag){default:return e;case`Symbol`:case`UniqueSymbol`:return e.toCodecStringTree();case`Union`:return e.recur(Jr)}}),Yr=new globalThis.RegExp(`^${Pn}$`),Xr=new globalThis.RegExp(`^(?:${Pn}|Infinity|-Infinity|NaN)$`);function Zr(e){return gr(Yr,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:Yr.source}),...e})}var Qr=Cr(U,[Zr()]),$r=new B(Qr,on),ei=new B(new G([Qr,cr]),on);function Z(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=Z(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new Tt(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function ti(e){if(!cn(e))return;let t=e.annotations?.[vt];return ke(t)?t(e.typeParameters):void 0}function ni(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&globalThis.Number.isFinite(e)}function ri(e){return e===void 0||typeof e==`string`}function ii(e,t){let n=new WeakMap,r=[];outer:for(;;){if(typeof e!=`object`||!e){if(!t(e))return!1}else{let t=e,i=n.get(t);if(i===!1)return!1;if(i===void 0){let e=Array.isArray(t);if(!e){let e=Object.getPrototypeOf(t);if(e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null)return!1}n.set(t,!1),r.push({value:t,keys:e?t.length:Object.keys(t),index:0})}}for(;r.length>0;){let t=r[r.length-1],i=t.keys;if(typeof i==`number`){if(t.index<i){e=t.value[t.index++];continue outer}}else if(t.index<i.length){e=t.value[i[t.index++]];continue outer}n.set(t.value,!0),r.pop()}return!0}}function ai(e){return ii(e,ni)}var oi=new gn([],()=>(e,t,n)=>ai(e)?k:r(new N(t,e,n)),{representation:{id:`effect/schema/Json`,payload:null},expected:`JSON value`,toCodecJson:()=>void 0,toCodecStringTree:()=>ui}),si=new B(oi,an()),ci=new B(new G([new On(!1,[],[oi]),new Vn([],[new Bn(U,oi)])]),an());function li(e){return ii(e,ri)}var ui=new B(new gn([],()=>(e,t,n)=>li(e)?k:r(new N(t,e,n)),{expected:`StringTree`,toCodecStringTree:()=>void 0}),an()),di=(e,t,n)=>e===k?n(t):x(e,n);function fi(e){if(e._tag===`Middleware`)return(t,n,r)=>pi(t===k?e.decode(D(bt(n)),r):e.decode(ce(t,bt),r));let t=e.decode;switch(t._tag){case`Passthrough`:return(e,t)=>e===k?D(t):e;case`Transform`:{let e=e=>e===E?O:D(t.transform(e));return(t,n)=>di(t,n,e)}case`TransformOptional`:{let e=e=>xt(t.transform(bt(e)));return(t,n)=>di(t,n,e)}case`TransformEffect`:return(e,n,r)=>di(e,n,e=>e===E?O:t.transform(e,r));case`TransformOptionalEffect`:return(e,n,r)=>di(e,n,e=>pi(t.transform(bt(e),r)))}}var pi=e=>x(e,xt),mi=(e,t,n,r)=>Re(r,r=>Te(()=>me(r,r=>new Et(e,r,t,n))));function hi(e,t){let n=fi(e.link.transformation),r;return(i,a)=>{if(i===E)return O;if(e.isConstructed(i))return k;let o=(r??=t(e.link.to))(i,a);return n(o,i,a)}}function gi(e,t){let n=e.context.constructorDefault;return(r,i)=>{if(r!==E&&r!==void 0)return t(r,i);let a=n;if(b(a)&&a._tag===`Success`){let e=t(a[S],i);return e===k?a:e}return x(mi(e,r,i,a),e=>{let n=t(e,i);return n===k?D(e):n})}}function _i(e,t){let n=t(e);return e.context?.constructorDefault===void 0?n:gi(e,n)}function vi(e,n,i,a,o){if(e._tag===`Declaration`)for(let t of e.typeParameters)n(t);let s=i?ti(e):void 0,c=s?hi(s,n):a??e.getParser(n,i),l=e.checks,u=e.encoding,d=u?.map(e=>fi(e.transformation)),f=e.encodingChecks;if(!u&&!l&&!f)return c;let p,m=(n,i)=>{let a=c(n,i);if(f&&!i.disableChecks){if(b(a)){if(a._tag===`Success`){let t=a===k?n:a[S];if(n!==E&&t!==E){let t=Z(f,n,void 0,e,i);t&&(a=r(new M(e,t,n,i)))}}}else a=t(a,t=>{if(n!==E&&t!==E){let t=Z(f,n,void 0,e,i);if(t)return r(new M(e,t,n,i))}return C(t)})}if(l&&!i.disableChecks){if(b(a)){if(a._tag===`Success`){let t=a===k?n:a[S];if(t===E)return a;let o=Z(l,t,void 0,e,i);o&&(a=r(new M(e,o,t,i)))}}else a=t(a,t=>{if(t!==E){let n=Z(l,t,void 0,e,i);if(n)return r(new M(e,n,t,i))}return C(t)})}return a},ee=o===void 0?m:o(m);return u?(t,r)=>{let i=p??=u.map(e=>n(e.to)),a=t,o=i[i.length-1](t,r);for(let e=u.length-1;e>=0;e--)if(o=d[e](o,a,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[S],o=t(a,r)):o=x(o,e=>{let n=t(e,r);return n===k?D(e):n})}if(o._tag===`Success`){let e=o[S],t=ee(e,r);return t===k?o:t}return o=mi(e,t,r,o),x(o,e=>{let t=ee(e,r);return t===k?D(e):t})}:ee}var yi=Symbol(),bi=new WeakMap,xi=e=>Ti(e).parser,Si=e=>Ti(e).makeEffect,Ci=e=>_i(e,Si),wi=class{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=vi(this.ast,xi)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=vi(this.ast,Si,Ci)}};function Ti(e){let t=bi.get(e);if(t!==void 0)return t;let n=new wi(e);return bi.set(e,n),n}function Ei(e){let t=e.ast,n;return(e,r)=>(n??=Fi(Vi,Vr(t)))(e,r?.disableChecks?r?.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions)}function Di(e){let t=Ei(e);return(e,n)=>{let r=ve(t(e,n));return f(r)?pe(r.value):(Gt(r.cause,`Option adapter can only return none for schema issues`),xe())}}function Oi(e){return zi(Vr(e.ast))}function ki(e,t){let n=Ni(e.ast);return t===void 0?n:(e,r)=>n(e,ji(t,r))}function Ai(e,t){return Li(ki(e,t))}var ji=(e,t)=>t?{...e,...t}:e,Mi=e=>e===E?r(new P):C(e);function Ni(e){return Fi(Bi,e)}function Pi(e,t){return e===k?C(t):b(e)?e[S]===E?Mi(E):e:x(e,Mi)}function Fi(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??mn);return a===k?C(r):b(a)?a[S]===E?Mi(E):a:x(a,Mi)}}function Ii(e){return(t,n)=>ve(e(t,n))}function Li(e){let t=Ii(e);return(e,n)=>{let r=t(e,n);return f(r)?pe(r.value):(Gt(r.cause,`Option adapter can only return none for schema issues`),xe())}}function Ri(e,t){let n=ve(e);if(f(n))return n.value;let r=Gt(n.cause,t);throw Error(`Schema validation failed`,{cause:r})}function zi(e){let t,n;return(r,i)=>{t??=Ti(e);let a=i?.disableChecks?i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i?.parseOptions??mn,o=t.make;if(o!==void 0&&r!==E){let e;try{e=o(r,a)}catch(e){throw Gt(fe(e),`Constructor adapter can only throw schema issues`),e}if(e!==yi&&e!==E)return e}return Ri(Pi((n??=t.makeEffect)(r,a),r),`Constructor adapter can only throw schema issues`)}}var Bi=e=>Ti(e).parser,Vi=e=>Ti(e).makeEffect,Hi=`~effect/Schema/Schema`,Ui=Symbol(),Wi={[Hi]:Hi,get make(){let e=Oi(this);return Object.defineProperty(this,"make",{value:e,enumerable:!0}),e},get makeEffect(){let e=Ei(this);return Object.defineProperty(this,"makeEffect",{value:e,enumerable:!0}),e},get makeOption(){let e=Di(this);return Object.defineProperty(this,"makeOption",{value:e,enumerable:!0}),e},pipe(){return a(this,arguments)},annotate(e){return this.rebuild(xr(this.ast,e))},annotateKey(e){return this.rebuild(Ar(this.ast,e))},check(...e){return this.rebuild(Cr(this.ast,e))},rebuild(e){return Gi(e,this[Ui])}};function Gi(e,t){function n(){}let r=Object.setPrototypeOf(n,Wi);return t&&(Object.hasOwn(t,`name`)||Object.hasOwn(t,`length`)||Object.hasOwn(t,`__proto__`))?Object.defineProperties(r,Object.getOwnPropertyDescriptors({...t})):Object.assign(r,t),r[Ui]=t,r.ast=e,r}function Ki(e){return Gi(qi(e.ast),{schema:e})}var qi=Or(e=>{let t=Qi(e,qi),n=e.context;return t===e||n===void 0?t:Dr(t,Ji(n))});function Ji(e){return e.constructorDefault===void 0?e:new V(e.isOptional,e.isMutable,void 0,e.annotations)}function Yi(e){if(e.propertySignatures.some(e=>typeof e.name!=`string`))throw new globalThis.Error(`Objects property names must be strings`,{cause:e})}function Xi(e){return t=>{let n=[...t].sort((t,n)=>e(Hr(t))-e(Hr(n)));return n.some((e,n)=>e!==t[n])?n:t}}var Zi=Xi(e=>{switch(e._tag){case`BigInt`:case`Symbol`:case`UniqueSymbol`:return 0;default:return 1}});function Qi(e,t){switch(e._tag){case`Declaration`:{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!ke(n))return K(e,[si]);let r=n(e.typeParameters.map(e=>Gi(Hr(e))));return r===void 0?e:K(e,[wr(r,t)])}case`Unknown`:return K(e,[si]);case`ObjectKeyword`:return K(e,[ci]);case`Undefined`:case`Void`:case`Literal`:case`Number`:return e.toCodecJson();case`UniqueSymbol`:case`Symbol`:case`BigInt`:return e.toCodecStringTree();case`Objects`:return Yi(e),e.recur(t,Jr);case`Union`:{let n=Zi(e.types);return n===e.types?e.recur(t):new G(n,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t)}case`Arrays`:case`Suspend`:return e.recur(t)}return e}var $i=e=>e,ea=`~effect/Schema/SchemaError`;function ta(e){return w(e,`~effect/Schema/SchemaError`)&&e[`~effect/Schema/SchemaError`]===`~effect/Schema/SchemaError`}var na=Hi,ra=class extends m(`SchemaError`){[ea]=ea;constructor(e){let t=p();te(0);try{super({issue:e})}finally{te(t)}}get message(){return Vt(this.issue)}toString(){return`SchemaError(${this.message})`}};function ia(e){return ta(e)}function aa(e){return b(e)?oa(e):Re(e,e=>Te(()=>me(e,e=>new ra(e))))}function oa(e){return f(e)?e:le(me(e.cause,e=>new ra(e)))}function sa(e,t){let n;for(let r of e.reasons){if(!we(r)||!ia(r.error))throw new globalThis.Error(t,{cause:e});n??=r.error}if(n===void 0)throw new globalThis.Error(t,{cause:e});return n}function ca(e){return Ae(e).then(e=>{if(f(e))return e.value;throw sa(e.cause,`Promise adapter can only reject schema errors`)})}function la(e,t){let n=ki(e,t);return(e,t)=>aa(n(e,t))}var ua=Ai;function da(e,t){let n=la(e,t);return(e,t)=>ca(n(e,t))}var Q=Gi;function fa(e){return w(e,na)&&e[na]===na}var pa=$i(e=>Q(jr(e.ast),{schema:e})),ma=$i(e=>{let t=Aa(e);return Q(Nr(e.ast),{schema:t})});function ha(e){let t=Q(new Sn(e),{literal:e,transform(n){return t.pipe(Ma(ha(n),{decode:F(()=>n),encode:F(()=>e)}))}});return t}var ga=Q(xn),_a=Q(_n),va=Q(bn),ya=Q(U),ba=Q(En),xa=Q(Dn);function Sa(e,t){return Q(e,{fields:t,mapFields(e,t){let n=e(this.fields);return Sa(qn(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function Ca(e){return Sa(qn(e,void 0),e)}function wa(e,t){return Q(Lr(e.ast,t.ast),{key:e,value:t})}var Ta=$i(e=>Q(new On(!1,[],[e.ast]),{value:e}));function Ea(e,t){return Q(e,{members:t,mapMembers(e,t){let n=e(this.members);return Ea(Yn(n,this.ast.options,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function Da(e,t){return Ea(Yn(e,t,void 0),e)}function Oa(e){let t=e.map(ha);return Q(Yn(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return Da(e(this.members))},pick(e){return Oa(e)},transform(e){return Da(t.map((t,n)=>t.transform(e[n])))}})}var ka=$i(e=>Da([e,_a])),Aa=$i(e=>Da([e,va]));function ja(...e){return t=>t.check(...e)}function Ma(e,t){return n=>Q(Fr(n.ast,e.ast,t?nn(t):an()),{from:n,to:e})}function Na(e){return t=>Q(Pr(t.ast,e),{schema:t})}function Pa(e){return ha(e).pipe(Na(C(e)))}function Fa(e,t){return Ca({_tag:Pa(e),...t})}var $=pr,Ia=`^\\S[\\s\\S]*\\S$|^\\S$|^$`;function La(e){let t=new globalThis.RegExp(Ia);return $(e=>e.trim()===e,{expected:`a string with no leading or trailing whitespace`,representation:{id:`effect/schema/isTrimmed`,payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:`Schema.isTrimmed()`}),arbitraryConstraint:{patterns:[{source:Ia,flags:``}]},...e})}function Ra(e,t){let n=e.source,r=e.flags,i=/^[dg]*uy?$/.test(r),a=r===``?`new RegExp(${v(n)})`:`new RegExp(${v(n)}, ${v(r)})`;return gr(e,{toJsonSchema:()=>i?{pattern:r.endsWith(`y`)?`^(?:${n})`:n}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${a})`}),...t})}function za(e){let t=n(e.order),r=_(e.order),i=ie(e.order),a=Le(e.order),o=e.formatter??v;return(n,s)=>{let c=n.exclusiveMinimum?r:t,l=n.exclusiveMaximum?a:i;return $(e=>c(e,n.minimum)&&l(e,n.maximum),{expected:`a value between ${o(n.minimum)}${n.exclusiveMinimum?` (excluded)`:``} and ${o(n.maximum)}${n.exclusiveMaximum?` (excluded)`:``}`,arbitraryConstraint:{order:e.order,minimum:n.minimum,maximum:n.maximum,...n.exclusiveMinimum&&{exclusiveMinimum:!0},...n.exclusiveMaximum&&{exclusiveMaximum:!0}},...e.annotate?.(n),...s})}}function Ba(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${v(e)}`);return e}var Va=za({order:ge,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,n=e.exclusiveMaximum?!0:void 0;return{representation:{id:`effect/schema/isBetween`,payload:{minimum:Ba(e.minimum),maximum:Ba(e.maximum),...t&&{exclusiveMinimum:t},...n&&{exclusiveMaximum:n}}},toJsonSchema:()=>({[t?`exclusiveMinimum`:`minimum`]:e.minimum,[n?`exclusiveMaximum`:`maximum`]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${v(e.minimum)}, maximum: ${v(e.maximum)}, exclusiveMinimum: ${v(t)}, exclusiveMaximum: ${v(n)} })`})}}});function Ha(e){return $(e=>globalThis.Number.isSafeInteger(e),{expected:`an integer`,representation:{id:`effect/schema/isInt`,payload:null},toJsonSchema:()=>[{type:`integer`},!0],toCode:()=>({runtime:`Schema.isInt()`}),arbitraryConstraint:{number:`integer`},...e})}function Ua(e,t){return e=Ka(e),Wa(e,Math.ceil(e/2),t)}function Wa(e,t,n){return $(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:n})=>n===`string`?e<=1?{minLength:t}:[{minLength:t},!0]:n===`array`?{minItems:e}:n===void 0?[{minLength:t,minItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[gt]:!0,arbitraryConstraint:{minLength:e},...n})}function Ga(e,t){return e=Ka(e),$(t=>t.length<=e,{expected:`a value with a length of at most ${e}`,representation:{id:`effect/schema/isMaxLength`,payload:{maxLength:e}},toJsonSchema:({type:t})=>t===`string`?e===0?{maxLength:e}:[{maxLength:e},!0]:t===`array`?{maxItems:e}:t===void 0?[{maxLength:e,maxItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMaxLength(${e})`}),[gt]:!0,arbitraryConstraint:{maxLength:e},...t})}function Ka(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${e}`);return Math.max(0,Math.floor(e))}globalThis.RegExp,globalThis.URL;var qa=ya.annotate({expected:`a string that will be decoded as JSON`,contentMediaType:`application/json`});function Ja(e,t){return qa.pipe(Ma(e,sn(t)))}globalThis.File,globalThis.FormData,globalThis.URLSearchParams,globalThis.Uint8Array;var Ya=globalThis.Symbol.for(`immer-draftable`),Xa={};function Za(e,t,n,r,i){let o=eo(n,t,r),s=$a(t),c=class extends e{constructor(...[e,t]){let r=t?.[`~payload`],i=r?.token===Xa?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:Xa,value:i}})}static[na]=na;get[s](){return s}static[Ya]=!0;static identifier=t;static fields=n.fields;static get ast(){return o(this).ast}static pipe(){return a(this,arguments)}static rebuild(e){return o(this).rebuild(e)}static make(e,t){return Oi(o(this))(e??{},t)}static makeOption(e,t){return Di(o(this))(e??{},t)}static makeEffect(e,t){return o(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(xr(this.ast,e))}static annotateKey(e){return this.rebuild(Ar(this.ast,e))}static check(...e){return this.rebuild(Cr(this.ast,e))}static extend(e){return(t,r)=>{let a=to(t)?t:Ca(t),o={...n.fields,...a.fields},s=qn(o,n.ast.checks,{identifier:e});return Za(this,e,Sa(Cr(s,a.ast.checks),o),r,i)}}static mapFields(e,t){return n.mapFields(e,t)}};return i!==void 0&&Object.assign(c.prototype,i(t)),c}function Qa(e){return new L(F(t=>new e(t,{"~payload":{token:Xa,value:t}})),Jt())}function $a(e){return`~effect/Schema/Class/${e}`}function eo(e,t,n){let i;return a=>{if(i!==void 0)return i;let o=$a(t),s=e=>e instanceof a||w(e,o),c=Qa(a);return i=Ma(Q(new gn([e.ast],()=>(e,t,n)=>s(e)?C(e):r(new N(t,e,n)),{identifier:t,[vt]:([e])=>({isConstructed:s,link:new B(e,c)}),toCodec:([e])=>new B(e.ast,c),toEquivalence:([e])=>e,toFormatter:([e])=>t=>`${a.identifier}(${e(t)})`,[_t]:Qn(e.ast),...n})),c)(e)}}function to(e){return fa(e)}var no=e=>(t,n)=>{let r=to(t)?t:Ca(t);return Za(Ee,e,r,n,e=>({name:e}))},ro=e=>(t,n,r)=>{let i=to(n)?n.mapFields(e=>({_tag:Pa(t),...e}),{unsafePreserveChecks:!0}):Fa(t,n);return no(e??t)(i,r)},io=Ki;export{La as C,io as E,Ra as S,pa as T,Ja as _,ka as a,Ga as b,ya as c,Fa as d,Da as f,da as g,ua as h,Oa as i,Ca as l,ja as m,xa as n,ba as o,ga as p,ha as r,wa as s,Ta as t,ro as u,Va as v,ma as w,Ua as x,Ha as y};
@@ -0,0 +1,6 @@
1
+ var e=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},t={pipe(){return e(this,arguments)}},n=function(){function e(){}return e.prototype=t,e}(),r=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},i=e=>e,a=e=>()=>e,o=a(!0),s=a(!1),c=a(void 0),l=c;function u(t,...n){return e(t,n)}function d(e,t,n,r,i,a,o,s,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return a(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return o(a(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(o(a(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return c(s(o(a(i(r(n(t(e.apply(this,arguments)))))))))}}}function f(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function ee(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i!==n&&t.set(i,i),i}}var te=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},ne=new WeakSet,re=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ie=0,ae=()=>{ie++};function oe(e){return typeof e==`string`}function se(e){return typeof e==`number`}function ce(e){return typeof e==`boolean`}function le(e){return typeof e==`symbol`}function ue(e){return oe(e)||se(e)||le(e)}function de(e){return typeof e==`function`}function fe(e){return e!=null}function pe(e){return!0}function me(e){return typeof e==`object`&&!!e||de(e)}var p=r(2,(e,t)=>me(e)&&t in e),he=r(2,(e,t)=>p(e,`_tag`)&&e._tag===t);function ge(e){return e instanceof Error}var m=`~effect/Hash`,h=e=>{switch(typeof e){case`number`:return be(e);case`bigint`:return v(e.toString(10));case`string`:return v(e);case`function`:case`object`:if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?v(`Invalid Date`):v(e.toISOString());if(e instanceof RegExp)return v(e.toString());{if(ne.has(e))return _e(e);let t=ke.get(e);if(t!==void 0)return t;if(Ae.has(e))return ae(),v(`[Circular]`);Ae.add(e);let n=ie,r;try{r=`~effect/Hash`in e?e[m]():typeof e==`function`?_e(e):e instanceof DataView?we(re(e)):Array.isArray(e)||ArrayBuffer.isView(e)?we(e):e instanceof Map?Te(e):e instanceof Set?De(e):Se(e)}finally{Ae.delete(e)}return n===ie&&ke.set(e,r),r}}return _(ve(v(String(e))))},_e=e=>(Oe.has(e)||Oe.set(e,_(Math.random()*4294967296|0)),Oe.get(e)),ve=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),g=r(2,(e,t)=>ve(Math.imul(e,2654435761)+Math.imul(t,2246822507))),_=e=>e&3221225471|e>>>1&1073741824,ye=new DataView(new ArrayBuffer(8)),be=e=>{let t=e|0;return t===e?_(t):(ye.setFloat64(0,e===e?e:NaN),_(g(ye.getInt32(0),ye.getInt32(4))))},v=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return _(t)},xe=(e,t)=>{let n=12289;for(let r of t)n^=g(h(r),h(e[r]));return _(n)},Se=e=>xe(e,te(e)),Ce=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return _(r)},we=e=>{let t=6151;for(let n of e)t=g(t,h(n));return _(t)},Te=Ce(v(`Map`),([e,t])=>g(h(e),h(t))),Ee=v(`Set`),De=Ce(Ee,e=>g(Ee,h(e))),Oe=new WeakMap,ke=new WeakMap,Ae=new WeakSet,y=`~effect/Equal`;function b(){return arguments.length===1?e=>je(e,arguments[0]):je(arguments[0],arguments[1])}function je(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||ne.has(e)||ne.has(t)?!1:Me(e,t):!1}function Me(e,t){let n=Pe.length;for(let r=n;r-->0;)if(Pe[r]===e&&Fe[r]===t)return!0;if(n)return Ne(e,t);let r=Ie.get(e);r||Ie.set(e,r=new WeakMap);let i=r.get(t);return i===void 0&&r.set(t,i=Ne(e,t)),i}function Ne(e,t){Pe.push(e),Fe.push(t);try{return Le(e,t)}finally{Pe.pop(),Fe.pop()}}var Pe=[],Fe=[],Ie=new WeakMap;function Le(e,t){if(h(e)!==h(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=We(e);if(n!==We(t)||typeof e==`function`&&!n)return!1;if(n)return e[y](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Re(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?ze(re(e),re(t)):ze(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:Ve(e,t,He,Ue):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:Ve(e,t,h,je):Be(e,t)}function Re(e,t){for(let n=0;n<e.length;n++)if(!je(e[n],t[n]))return!1;return!0}function ze(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Be(e,t){let n=te(e),r=te(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!je(e[i],t[i]))return!1;return!0}function Ve(e,t,n,r){let i=new Map;for(let e of t){let t=n(e),r=i.get(t);r?r.push(e):i.set(t,[e])}outer:for(let t of e){let e=i.get(n(t));if(e){for(let n=0;n<e.length;n++)if(r(t,e[n])){e[n]=e[e.length-1],e.pop();continue outer}}return!1}return!0}var He=e=>h(e[0]),Ue=(e,t)=>je(e[0],t[0])&&je(e[1],t[1]),We=e=>p(e,y),Ge=Symbol.for(`~effect/Redactable`),Ke=e=>p(e,Ge);function qe(e){return Ke(e)?Je(e):e}function Je(e){return e[Ge](globalThis[`~effect/Fiber/currentFiber`]?.context??Ze)}var Ye=`~effect/Fiber/currentFiber`,Xe=new Map,Ze={"~effect/Context":{},base:Xe,depth:0,mapUnsafe:Xe,pipe(){return e(this,arguments)}};function x(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,t=0){try{return l(e,t)}catch{return(typeof e==`object`&&e||typeof e==`function`)&&r.delete(e),`[inspection threw]`}}function l(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return Qe;r.add(e);let l;if(Ge in e)l=c(Je(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
2
+ `+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=tt(e);else if(!t?.ignoreToString&&p(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=nt(e);l=e instanceof Error&&e.cause!==void 0?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${$e(t)}:${c(rt(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${$e(t)}: ${c(rt(e,t),n+1)}`).join(`,
3
+ `)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var Qe=`[Circular]`;function $e(e){return typeof e==`string`?JSON.stringify(e):String(e)}function et(e){return e.map(e=>`[${$e(e)}]`).join(``)}function tt(e){try{return e.toISOString()}catch{return`Invalid Date`}}function nt(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function rt(e,t){try{return e[t]}catch{return`[property access threw]`}}var it=Symbol.for(`nodejs.util.inspect.custom`),at=e=>{try{return e=qe(e),p(e,`toJSON`)&&de(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(at):e}catch{return`[toJSON threw]`}},ot={toJSON(){return at(this)},[it](){return this.toJSON()},toString(){return x(this.toJSON())}},st=class{[it](){return this.toJSON()}toString(){return x(this.toJSON())}},ct=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),lt=()=>Error.stackTraceLimit,ut=e=>{ct&&(Error.stackTraceLimit=e)},dt=class{constructor(e){this.value=e,this.done=!1}next(e){return this.done?(this.value=e,this):(this.done=!0,{value:this.value,done:!1})}},ft=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return lt()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})();function pt(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function mt(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&pt(e,n,t[n])}var S=`~effect/Effect`,ht=`~effect/Exit`,gt={_A:i,_E:i,_R:i},_t=`${S}/identifier`,C=`${S}/args`,w=`${S}/evaluate`,T=`${S}/successCont`,E=`${S}/failureCont`,vt=`${S}/ensureCont`,yt=Symbol.for(`effect/Effect/Yield`),bt={pipe(){return e(this,arguments)},toJSON(){return{...this}},toString(){return x(this.toJSON(),{ignoreToString:!0,space:2})},[it](){return this.toJSON()}},xt={[S]:gt,...bt,[Symbol.iterator](){return new dt(this)},toJSON(){return{_id:`Effect`,op:this[_t],...C in this?{args:this[C]}:void 0}}},D=e=>p(e,S),St=e=>p(e,ht),Ct=`~effect/Cause`,wt=`~effect/Cause/Reason`,Tt=e=>p(e,Ct),Et=class{constructor(e){this[Ct]=Ct,this.reasons=e}pipe(){return e(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${x(this.reasons)})`}[it](){return this.toJSON()}[y](e){return Tt(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>b(t,e.reasons[n]))}[m](){return we(this.reasons)}},Dt=new WeakMap,Ot=class{[wt];annotations;_tag;constructor(e,t,n){if(this[wt]=wt,this._tag=e,t!==kt&&typeof n==`object`&&n&&t.size>0){let e=Dt.get(n);e&&(t=new Map([...e,...t])),Dt.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return e(this,arguments)}toString(){return x(this)}[it](){return this.toString()}},kt=new Map,At=class extends Ot{constructor(e,t=kt){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${x(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[y](e){return It(e)&&b(this.error,e.error)&&b(this.annotations,e.annotations)}[m](){return g(v(this._tag))(g(h(this.error))(h(this.annotations)))}},jt=e=>new Et(e),Mt=e=>new Et([new At(e)]),Nt=class extends Ot{constructor(e,t=kt){super(`Die`,t,e),this.defect=e}toString(){return`Die(${x(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[y](e){return Lt(e)&&b(this.defect,e.defect)&&b(this.annotations,e.annotations)}[m](){return g(v(this._tag))(g(h(this.defect))(h(this.annotations)))}},Pt=e=>new Et([new Nt(e)]),Ft=r(e=>Tt(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new Et(e.reasons.map(e=>e.annotate(t,n)))),It=e=>e._tag===`Fail`,Lt=e=>e._tag===`Die`,Rt=e=>e._tag===`Interrupt`;function zt(e){return M(`Effect.evaluate: Not implemented`)}var O=e=>({...xt,[_t]:e.op,[w]:e[w]??zt,[T]:e[T],[E]:e[E],[vt]:e[vt]}),k=e=>{let t=O(e),n=function(e){this[C]=e};return n.prototype=t,function(e){return new n(e)}},Bt=e=>{let t={[ht]:ht,_tag:e.op,get[e.prop](){return this[C]},...O(e),toString(){return`${e.op}(${x(this[C])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[C]}},[y](e){return St(e)&&e._tag===this._tag&&b(this[C],e[C])},[m](){return g(v(e.op),h(this[C]))}},n=function(e){this[C]=e};return n.prototype=t,function(e){return new n(e)}},A=Bt({op:`Success`,prop:`value`,[w](e){let t=e.getCont(T);return t?t[T](this[C],e,this):e.yieldWith(this)}}),Vt={key:`effect/Cause/StackTrace`},Ht={key:`effect/Cause/InterruptorStackTrace`},j=Bt({op:`Failure`,prop:`cause`,[w](e){let t=this[C],n=!1;e.cache.stackFrame&&(t=Ft(t,{mapUnsafe:new Map([[Vt.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(E);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(E);return r?r[E](t,e,n?void 0:this):e.yieldWith(n?j(t):this)}}),Ut=e=>j(Mt(e)),M=e=>j(Pt(e)),N=k({op:`WithFiber`,[w](e){return this[C](e)}}),Wt=function(){class e extends globalThis.Error{}let t=O({op:`YieldableError`,[w](){return Ut(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),Gt=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends Wt{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(mt(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),Kt=e=>{class t extends Gt{_tag=e}return t.prototype.name=e,t},qt=`~effect/Cause/NoSuchElementError`,Jt=class extends Kt(`NoSuchElementError`){[qt]=qt;constructor(e){super({message:e})}},Yt=`~effect/Cause/Done`,Xt=e=>p(e,Yt),Zt={[Yt]:Yt,_tag:`Done`,value:void 0},Qt=e=>e===void 0?Zt:{[Yt]:Yt,_tag:`Done`,value:e},$t=Ut(Zt),en=e=>e===void 0?$t:Ut(Qt(e)),tn=e=>O({op:e.label,[w]:e.evaluate}),nn=e=>(t,n)=>t===n||e(t,n),rn=(e,t)=>e===t,an=()=>rn;function on(e){return nn((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e[r](t[r],n[r]))return!1;return!0})}function sn(e){return nn((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0})}var cn=`~effect/Option`,ln={[cn]:{_A:e=>e},...bt,[Symbol.iterator](){return new dt(this)}},un=Object.defineProperty(Object.assign(Object.create(ln),{_tag:`Some`,_op:`Some`,[y](e){return pn(e)&&hn(e)&&b(this.value,e.value)},[m](){return g(h(this._tag))(h(this.value))},toString(){return`some(${x(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:at(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),dn=h(`None`),fn=Object.assign(Object.create(ln),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[y](e){return pn(e)&&mn(e)},[m](){return dn},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),pn=e=>p(e,cn),mn=e=>e._tag===`None`,hn=e=>e._tag===`Some`,gn=Object.create(fn),_n=function(e){this.value=e};_n.prototype=un;var vn=e=>new _n(e),yn=`~effect/Result`,bn={[yn]:{_A:e=>e,_E:e=>e},...bt,[Symbol.iterator](){return new dt(this)}},xn=Object.assign(Object.create(bn),{_tag:`Success`,_op:`Success`,[y](e){return Cn(e)&&Tn(e)&&b(this.success,e.success)},[m](){return g(h(this._tag))(h(this.success))},toString(){return`success(${x(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:at(this.success)}}}),Sn=Object.assign(Object.create(bn),{_tag:`Failure`,_op:`Failure`,[y](e){return Cn(e)&&wn(e)&&b(this.failure,e.failure)},[m](){return g(h(this._tag))(h(this.failure))},toString(){return`failure(${x(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:at(this.failure)}}}),Cn=e=>p(e,yn),wn=e=>e._tag===`Failure`,Tn=e=>e._tag===`Success`,En=function(e){this.failure=e};En.prototype=Sn;var Dn=e=>new En(e),On=function(e){this.success=e};On.prototype=xn;var kn=e=>new On(e);function An(e){return(t,n)=>t===n?0:e(t,n)}var jn=An((e,t)=>e<t?-1:1),Mn=An((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),Nn=An((e,t)=>e<t?-1:1),Pn=r(2,(e,t)=>An((n,r)=>e(t(n),t(r)))),Fn=Pn(Mn,e=>e.getTime()),In=e=>r(2,(t,n)=>e(t,n)===-1),Ln=e=>r(2,(t,n)=>e(t,n)===1),Rn=e=>r(2,(t,n)=>e(t,n)!==1),zn=e=>r(2,(t,n)=>e(t,n)!==-1),P=()=>gn,Bn=vn,Vn=mn,Hn=hn,Un=r(2,(e,{onNone:t,onSome:n})=>Vn(e)?t():n(e.value)),Wn=r(2,(e,t)=>Vn(e)?t():e.value),Gn=e=>e==null?P():Bn(e),Kn=Wn(c),qn=e=>(...t)=>{try{return Bn(e(...t))}catch{return P()}},Jn=r(2,(e,t)=>{if(Hn(e))return e.value;throw t()}),Yn=r(2,(e,t)=>Vn(e)?P():Bn(t(e.value))),Xn=r(2,(e,t)=>Vn(e)?P():t(e.value)),Zn=`~effect/Context/Service`,Qn=function(){function e(){}let t=e;Object.setPrototypeOf(t,$n);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[tr]=tr,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&er.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},$n={[Zn]:Zn,...tn({label:`Service`,evaluate(e){return A(L(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return _r(this,e)},use(e){return N(t=>e(L(t.context,this)))},useSync(e){return N(t=>A(e(L(t.context,this))))}},er=new Set,tr=`~effect/Context/Reference`,nr=`~effect/Context`,rr=8,ir=8,ar=(e,t,n,r)=>{let i=Object.create(fr);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},or=(e,t)=>{t&&(or(e,t.parent),e.set(t.key,t.value))},sr=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return or(t,e.overlay),e._flat=t},cr=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),dr(n)},lr=Symbol(),ur=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?lr:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=ir&&(n.base=sr(n),n.overlay=void 0,n.depth=0),r)},dr=e=>ar(void 0,e,void 0,0),fr={get mapUnsafe(){return sr(this)},...bt,[nr]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[y](e){if(!mr(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!b(r,n.get(e)))return!1;return!0},[m](){return be(this.mapUnsafe.size)}},pr=(e,t)=>e.cacheRoot===t.cacheRoot,mr=e=>p(e,nr),hr=e=>!!e[tr],F=()=>gr,gr=dr(new Map),_r=(e,t)=>dr(new Map([[e.key,t]])),I=r(3,(e,t,n)=>vr(e,t.key,n)),vr=(e,t,n)=>{let r=e,i=er.has(t)?void 0:r.cacheRoot;if(r.depth>=rr){let e=new Map(r.mapUnsafe);return e.set(t,n),ar(i,e,void 0,0)}return ar(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},yr=r(2,(e,t)=>br(e,t.key)),br=(e,t)=>{let n=ur(e,t);return n===lr?void 0:n},xr=r(2,(e,t)=>{let n=ur(e,t.key);if(n===lr){if(hr(t))return Cr(t);throw wr(t)}return n}),L=xr,Sr=`~effect/Context/defaultValue`,Cr=e=>Sr in e?e[Sr]:e[Sr]=e.defaultValue(),wr=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
4
+ `);e.splice(1,3),t.stack=e.join(`
5
+ `)}return t},Tr=r(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:cr(e,e=>t.mapUnsafe.forEach((t,n)=>e.set(n,t)))),Er=(...e)=>{let t=new Map;for(let n=0;n<e.length;n++)e[n].mapUnsafe.forEach((e,n)=>{t.set(n,e)});return dr(t)},R=Qn,Dr=e=>e.length>0,z=kn,B=Dn,Or=e=>{if(de(e))try{return z(e())}catch(e){return B(e)}try{return z(e.try())}catch(t){return B(e.catch(t))}},kr=wn,Ar=Tn,jr=r(2,(e,{onFailure:t,onSuccess:n})=>kr(e)?t(e.failure):n(e.success)),Mr=r(2,(e,t)=>{if(Ar(e))return e.success;throw t(e.failure)})(i),Nr=on,Pr=r(2,(e,t)=>Object.hasOwn(e,t)),Fr=r(2,(e,t)=>{let n={...e};for(let r of Ir(e))pt(n,r,t(e[r],r));return n}),Ir=e=>Object.keys(e),Lr=e=>r(2,(t,n)=>{for(let r of Ir(t))if(!Pr(n,r)||!e(t[r],n[r]))return!1;return!0}),Rr=e=>{let t=Lr(e);return(e,n)=>t(e,n)&&t(n,e)},zr=globalThis.Array,Br=e=>zr.isArray(e)?e:zr.from(e),Vr=r(2,(e,t)=>[...e,t]),Hr=r(2,(e,t)=>Br(e).concat(Br(t)));zr.isArray;var Ur=Dr,Wr=Dr,Gr=e=>e[e.length-1],Kr=()=>[],qr=e=>[e],Jr=r(2,(e,t)=>e.map(t)),Yr=sn,Xr=`~effect/Duration`,Zr=BigInt(0),Qr=BigInt(1),$r=BigInt(2),ei=BigInt(10),ti=BigInt(1e3),ni=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),ri=e=>ni(e*1e6),ii=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=ei**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t,s=o/a+(o%a*$r>=a?Qr:Zr);return r?-s:s},ai=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,V=e=>{switch(typeof e){case`number`:return _i(e);case`bigint`:return gi(e);case`string`:{if(e===`Infinity`)return mi;if(e===`-Infinity`)return hi;let t=ai.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return gi(ii(r,Qr));if(i===`micro`||i===`micros`)return gi(ii(r,ti));let a=Number(r);switch(i){case`milli`:case`millis`:return _i(a);case`second`:case`seconds`:return vi(a);case`minute`:case`minutes`:return yi(a);case`hour`:case`hours`:return bi(a);case`day`:case`days`:return xi(a);case`week`:case`weeks`:return Si(a)}break}case`object`:{if(e===null)break;if(Xr in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(se)?oi(e):Number.isNaN(e[0])||Number.isNaN(e[1])?pi:e[0]===-1/0||e[1]===-1/0?hi:e[0]===1/0||e[1]===1/0?mi:H(ni(e[0]*1e9+e[1]));let t=e,n=0;return t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds?H(n):H(ni(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return oi(e)},oi=e=>{throw Error(`Invalid Input: ${e}`)},si={_tag:`Millis`,millis:0},ci={_tag:`Infinity`},li={_tag:`NegativeInfinity`},ui={[Xr]:Xr,[m](){switch(this.value._tag){case`Millis`:{let e=this.value.millis*1e6;return Number.isFinite(e)?h(ni(e)):be(this.value.millis)}case`Nanos`:return h(this.value.nanos);default:return Se(this.value)}},[y](e){return di(e)&&ki(this,e)},toString(){switch(this.value._tag){case`Infinity`:return`Infinity`;case`NegativeInfinity`:return`-Infinity`;case`Nanos`:return`${this.value.nanos} nanos`;case`Millis`:return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case`Millis`:return{_id:`Duration`,_tag:`Millis`,millis:this.value.millis};case`Nanos`:return{_id:`Duration`,_tag:`Nanos`,nanos:String(this.value.nanos)};case`Infinity`:return{_id:`Duration`,_tag:`Infinity`};case`NegativeInfinity`:return{_id:`Duration`,_tag:`NegativeInfinity`}}},[it](){return this.toJSON()},pipe(){return e(this,arguments)}},H=e=>{let t=Object.create(ui);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?si:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:ri(e)}:e>0?ci:li:e===Zr?si:{_tag:`Nanos`,nanos:e},t},di=e=>p(e,Xr),fi=e=>e.value._tag!==`Infinity`&&e.value._tag!==`NegativeInfinity`,pi=H(0),mi=H(1/0),hi=H(-1/0),gi=e=>H(e),_i=e=>H(e),vi=e=>H(e*1e3),yi=e=>H(e*6e4),bi=e=>H(e*36e5),xi=e=>H(e*864e5),Si=e=>H(e*6048e5),Ci=e=>Ei(V(e),{onMillis:i,onNanos:e=>Number(e)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),wi=e=>Ei(V(e),{onMillis:e=>e/1e3,onNanos:e=>Number(e)/1e9,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),Ti=e=>{let t=V(e);switch(t.value._tag){case`Infinity`:case`NegativeInfinity`:throw Error(`Cannot convert infinite duration to nanos`);case`Nanos`:return t.value.nanos;case`Millis`:return ri(t.value.millis)}},Ei=r(2,(e,t)=>{switch(e.value._tag){case`Millis`:return t.onMillis(e.value.millis);case`Nanos`:return t.onNanos(e.value.nanos);case`Infinity`:return t.onInfinity();case`NegativeInfinity`:return(t.onNegativeInfinity??t.onInfinity)()}}),Di=r(3,(e,t,n)=>e.value._tag===`Infinity`||e.value._tag===`NegativeInfinity`||t.value._tag===`Infinity`||t.value._tag===`NegativeInfinity`?n.onInfinity(e,t):e.value._tag===`Millis`?t.value._tag===`Millis`?n.onMillis(e.value.millis,t.value.millis):n.onNanos(Ti(e),t.value.nanos):n.onNanos(e.value.nanos,Ti(t))),Oi=(e,t)=>Di(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),ki=r(2,(e,t)=>Oi(e,t)),Ai=R(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new Fi}),ji=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Mi=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},Ni=e=>{try{return Mi(e)}catch{return ji(e)}},Pi=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},Fi=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?ji:Ni)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new Ii(this.setImmediate)}},Ii=class{tasks=new Pi;running=void 0;setImmediate;constructor(e=Ni){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},Li=R(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),Ri=R(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),zi=Gt,Bi=Kt,Vi=e=>{switch(e){case 16:return Wi();case 32:return Gi();default:{let t=``;for(let n=e>>>3;n>0;n--)t+=Ui();return t}}},U=Uint8Array.from(`0123456789abcdef`,e=>e.charCodeAt(0)),Hi=()=>Math.random()*4294967296>>>0,Ui=()=>{let e=Hi();return String.fromCharCode(U[e>>>28],U[e>>>24&15],U[e>>>20&15],U[e>>>16&15],U[e>>>12&15],U[e>>>8&15],U[e>>>4&15],U[e&15])},Wi=()=>{let e=Hi(),t=Hi();return String.fromCharCode(U[e>>>28],U[e>>>24&15],U[e>>>20&15],U[e>>>16&15],U[e>>>12&15],U[e>>>8&15],U[e>>>4&15],U[e&15],U[t>>>28],U[t>>>24&15],U[t>>>20&15],U[t>>>16&15],U[t>>>12&15],U[t>>>8&15],U[t>>>4&15],U[t&15])},Gi=()=>{let e=Hi(),t=Hi(),n=Hi(),r=Hi();return String.fromCharCode(U[e>>>28],U[e>>>24&15],U[e>>>20&15],U[e>>>16&15],U[e>>>12&15],U[e>>>8&15],U[e>>>4&15],U[e&15],U[t>>>28],U[t>>>24&15],U[t>>>20&15],U[t>>>16&15],U[t>>>12&15],U[t>>>8&15],U[t>>>4&15],U[t&15],U[n>>>28],U[n>>>24&15],U[n>>>20&15],U[n>>>16&15],U[n>>>12&15],U[n>>>8&15],U[n>>>4&15],U[n&15],U[r>>>28],U[r>>>24&15],U[r>>>20&15],U[r>>>16&15],U[r>>>12&15],U[r>>>8&15],U[r>>>4&15],U[r&15])},Ki=`effect/Tracer/ParentSpan`,qi=class extends Qn()(Ki,{fiberCached:!0}){},Ji=e=>e,Yi=R(`effect/Tracer/DisablePropagation`,{defaultValue:s}),Xi=R(`effect/Tracer/CurrentTraceLevel`,{defaultValue:()=>`Info`}),Zi=R(`effect/Tracer/MinimumTraceLevel`,{defaultValue:()=>`All`}),Qi=`effect/Tracer`,$i=Ji({span:e=>new ea(e)}),ea=class{_tag=`Span`;sampled;name;parent;annotations;links;startTime;kind;status;_traceId=void 0;_spanId=void 0;_attributes=void 0;_events=void 0;constructor(e){this.name=e.name,this.parent=e.parent,this.annotations=e.annotations,this.links=e.links,this.startTime=e.startTime,this.kind=e.kind,this.sampled=e.sampled,this.status={_tag:`Started`,startTime:e.startTime}}get traceId(){return this._traceId??=Kn(this.parent)?.traceId??Vi(32)}get spanId(){return this._spanId??=Vi(16)}get attributes(){return this._attributes??=new Map}get events(){return this._events??=[]}end(e,t){this.status={_tag:`Ended`,endTime:e,exit:t,startTime:this.status.startTime}}attribute(e,t){this.attributes.set(e,t)}event(e,t,n){this.events.push([e,t,n??{}])}addLinks(e){this.links.push(...e)}},ta=`effect/Metric/FiberRuntimeMetrics`,na=R(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:c}),ra=R(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:o}),ia=R(`effect/References/TracerTimingEnabled`,{defaultValue:o}),aa=R(`effect/References/TracerSpanAnnotations`,{defaultValue:()=>({})}),oa=R(`effect/References/TracerSpanLinks`,{defaultValue:()=>[]}),sa=R(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),ca=R(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),la=e=>{if(e?.captureStackTrace===!1||e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!=`boolean`)return e;let t=lt();if(t===0&&e?.captureStackTrace!==!0)return{...e,captureStackTrace:!1};ut(3);let n=Error();return ut(t),{...e,captureStackTrace:ua(()=>n.stack)}},ua=(e=>t=>{let n;return()=>{if(n!==void 0)return n;let r=t();if(!r)return;let i=r.split(`
6
+ `);if(i[e]!==void 0)return n=i[e].trim(),n}})(3),da=class extends Ot{constructor(e,t=kt){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[y](e){return Rt(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[m](){return g(v(`${this._tag}:${this.fiberId}`))(_e(this.annotations))}},fa=e=>new Et([new da(e)]),pa=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return z(n.error)}return B(e)},ma=e=>e.reasons.some(Rt),ha=e=>{let t;for(let n=0;n<e.reasons.length;n++){let r=e.reasons[n];r._tag===`Interrupt`&&(t??=new Set,r.fiberId!==void 0&&t.add(r.fiberId))}return t?z(t):B(e)},ga=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=h(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>b(e,i)))continue;else t.push(i);r.push(i)}return r},_a=r(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new Et(ga(e.reasons,t.reasons));return b(e,n)?e:n}),va=r(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>It(e)?(n=!0,new At(t(e.error),e.annotations)):e);return n?jt(r):e}),ya=e=>{let t;for(let n of e.reasons){if(n._tag===`Fail`)return n.error;n._tag===`Die`&&(t??=n)}return t===void 0?e.reasons.length>0?new globalThis.Error(`All fibers interrupted without error`):new globalThis.Error(`Empty cause`):t.defect},ba=`~effect/Fiber`,xa={_A:i,_E:i},Sa={id:0},Ca=()=>globalThis[Ye],wa=class{constructor(e,t=!0){this.setContext(e),this.id=++Sa.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[ba](){return xa}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return L(this.context,e)}addObserver(e){return this._exit?(e(this._exit),l):(this._observers===void 0?this._observers=[e]:this._observers.push(e),()=>this.removeObserver(e))}removeObserver(e){if(this._exit||this._observers===void 0)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)}interruptUnsafe(e,t){if(this._exit)return;let n=fa(e);this.cache.stackFrame&&(n=Ft(n,_r(Vt,this.cache.stackFrame))),t&&(n=Ft(n,t)),this._interruptedCause=this._interruptedCause?_a(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(G(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===yt)return;let n=Oa.interruptChildren&&Oa.interruptChildren(this);if(n!==void 0)return this.evaluate(Z(n,()=>t));if(this._exit=t,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&=(this._parent._children?.delete(this),void 0),this._observers!==void 0){let e=this._observers;this._observers=void 0;for(let n=0;n<e.length;n++)e[n](t)}this._stack.length=0,this._children=void 0,this.context=F()}runLoop(e){let t=globalThis[Ye];globalThis[Ye]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;){this._deferredInterrupt&&(this._deferredInterrupt=!1,i=G(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=Z(za,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[w](this),i===yt){let e=this._yielded;if(ht in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return yt}}}catch(e){return p(i,w)?this.runLoop(M(e)):M(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[Ye]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,Ea;for(;;){let t=this._stack.pop();if(!t)return;let n=t[vt];if(n!==void 0){let r=n.call(t,this);if(r)return r[e]=r,r}if(t[e])return t}}succeedWith(e){if(!(++this.currentOpCount&Da-1))return A(e);let t=this.getCont(T);return t?t[T](e,this):this.yieldWith(A(e))}yieldWith(e){return this._yielded=e,yt}children(){return this._children??=new Set}pipe(){return e(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&pr(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=Ta(e);this.cache?.scheduler!==r.scheduler&&(this._dispatcher=void 0),this.cache=r}get currentSpanLocal(){let e=this.cache.span;return e?._tag===`Span`?e:void 0}},Ta=e=>{let t=br(e,Qi);return{scheduler:L(e,Ai),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:L(e,ra),span:br(e,Ki),logLevel:L(e,sa),minimumLogLevel:L(e,ca),stackFrame:L(e,na),runtimeMetrics:br(e,ta),maxOpsBeforeYield:L(e,Li),preventYield:L(e,Ri)}},Ea={[T](e,t){return G(t._interruptedCause)},[E](e,t){return G(t._interruptedCause)}},Da=32,Oa={interruptChildren:void 0},ka=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Ht.key,e.cache.stackFrame),dr(t)},Aa=e=>{let t=e;return t._exit?W(t._exit):Y(n=>t._exit?n(W(t._exit)):K(e.addObserver(e=>n(W(e)))))},ja=e=>Y(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(W(r))}return a(),K(()=>i?.())}),Ma=e=>{let t=e;return t._exit?t._exit:Y(n=>t._exit?n(t._exit):K(e.addObserver(n)))},Na=e=>Y(t=>{let n=Array.from(e);if(n.length===0)return t(W(Kr()));let r=Array(n.length),i=Kr(),a=()=>{for(let e=0;e<i.length;e++)n[e].removeObserver(i[e])},o=0,s=!1;for(let e=0;e<n.length&&!s;e++){let c=i=>{if(o++,i._tag===`Failure`)return s=!0,a(),t(i);r[e]=i.value,o===n.length&&t(W(r))};i.push(c),n[e].addObserver(c)}return K(()=>{s=!0,a()})}),Pa=e=>N(t=>Fa(e,t.id)),Fa=r(e=>p(e[0],ba),(e,t,n)=>N(r=>{let i=ka(r);return i=i&&n?Tr(i,n):i??n,e.interruptUnsafe(t,i),_o(Aa(e))})),Ia=e=>N(t=>{let n=ka(t),r=Kr();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return _o(ja(r))}),W=A,G=j,La=Ut,K=k({op:`Sync`,[w](e){let t=this[C](),n=e.getCont(T);return n?n[T](t,e):e.yieldWith(A(t))}}),q=k({op:`Suspend`,[w](e){return this[C]()}}),Ra=jr({onFailure:La,onSuccess:W}),za=k({op:`Yield`,[w](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate($)},this[C]??0),e.yieldWith(()=>{t=!0})}})(0),Ba=W(P()),Va=e=>q(()=>G(e())),Ha=e=>M(e),Ua=e=>q(()=>La(e())),J=W(void 0),Wa=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new Mc(e,`An error occurred in Effect.try`):e.catch;return q(()=>{try{return W(t())}catch(e){return La(n(e))}})},Ga=e=>Ja(function(t,n){e(n).then(e=>t(W(e)),e=>t(Ha(e)))},e.length!==0),Ka=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new Mc(e,`An error occurred in Effect.tryPromise`):e.catch;return Ja(function(e,r){let i=t=>{try{e(La(ft(()=>n(t))))}catch(t){e(Ha(t))}};try{t(r).then(t=>e(W(t)),i)}catch(e){i(e)}},t.length!==0)},qa=e=>N(t=>e(t.id)),Ja=function(){let e=O({op:`Async`,[w](e){let t=!1,n=!1,r=this.withSignal?new AbortController:void 0,i=this.register.call(e.cache.scheduler,r=>{t||(t=!0,n?e.evaluate(r):n=r)},r?.signal);return n===!1?(n=!0,e._yielded=()=>{t=!0},r===void 0&&i===void 0||e._stack.push(Ya(()=>(t=!0,r?.abort(),i??$))),yt):n}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),Ya=k({op:`AsyncFinalizer`,[vt](e){e.interruptible&&(e.interruptible=!1,e._stack.push(As))},[E](e,t){return ma(e)?Z(rs(j(e),this[C]()),()=>G(e)):G(e)}}),Y=e=>Ja(e,e.length>=2),Xa=Y(l),Za=(...e)=>{if(e.length===1){let t=e[0];return q(()=>no(t()))}let[t,n]=e;return q(()=>no(n.call(t.self)))},Qa=(e,...t)=>{let n=t.length===0?function(){return q(()=>no(e.apply(this,arguments)))}:function(){let n=q(()=>no(e.apply(this,arguments)));for(let e=0;e<t.length;e++)n=t[e](n,...arguments);return n};return $a(e.length,n)},$a=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),eo=(e,...t)=>$a(e.length,t.length===0?function(){return to(()=>e.apply(this,arguments))}:function(){let n=to(()=>e.apply(this,arguments));for(let e of t)n=e(n,...arguments);return n}),to=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return W(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return q(()=>n?(n=!1,Z(r.value,e=>no(t,e))):q(()=>no(e())))}}}catch(e){return Ha(e)}},no=function(){let e=O({op:`Iterator`,[T](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return W(r.value);if(!Q(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[w](e){return this[T](this.initial,e)}}),t=function(e,t){this.iterator=e,this.initial=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),ro=r(2,(e,t)=>new X(e,oo,W(t))),io=function(e){return e._stack.push(this),this[C]},ao=O({op:`OnSuccess`,[w]:io}),X=function(e,t,n){this[C]=e,this[T]=t,this.payload=n};X.prototype=ao;var oo=function(){return this.payload},so=function(e,t){return t.succeedWith(this.payload)},co=(()=>{let e=`~effect/Effect/stackProbe`;return{[e]:function(){return Error().stack}}[e]()?.includes(`[as `+e+`]`)===!0})(),lo=function(e,t){let n=this.payload;return t.succeedWith(co?n(e):ft(()=>n(e)))},uo=function(e){let t=this.payload;return t(e)},fo=function(e){let t=this.payload;return new X(t(e),so,e)},po=function(e){return new X(this.payload,so,e)},mo=e=>bo(e,Bn),ho=r(2,(e,t)=>new X(e,D(t)?oo:uo,t)),go=r(2,(e,t)=>new X(e,D(t)?po:fo,t)),_o=e=>new X(e,oo,$),Z=r(2,(e,t)=>new X(e,uo,t)),Q=e=>e[ht]!==void 0,vo=r(2,(e,t)=>Q(e)?e._tag===`Success`?t(e.value):e:Z(e,t)),yo=e=>Z(e,i),bo=r(2,(e,t)=>new X(e,lo,t)),xo=r(2,(e,t)=>Q(e)?Eo(e,t):bo(e,t)),So=r(2,(e,t)=>Q(e)?Do(e,t):Go(e,t)),Co=e=>j(fa(e)),wo=e=>e._tag===`Success`,To=e=>e._tag===`Failure`?z(e.cause):B(e),$=A(void 0),Eo=r(2,(e,t)=>e._tag===`Success`?A(t(e.value)):e),Do=r(2,(e,t)=>{if(e._tag===`Success`)return e;let n=pa(e.cause);return kr(n)?e:Ut(t(n.success))}),Oo=r(2,(e,t)=>wo(e)?t:e),ko=e=>{let t=[];for(let n of e)n._tag===`Failure`&&t.push(...n.cause.reasons);return t.length===0?$:j(jt(t))},Ao=r(2,(e,t)=>N(n=>{let r=n.context,i=t(r);return r===i?e:(n.setContext(i),ys(n,()=>{n.setContext(r)}),e)})),jo=r(3,(e,t,n)=>Ao(e,e=>{let r=xr(e,t),i=n(r);return r===i?e:I(e,t,i)})),Mo=()=>No,No=N(e=>W(e.context)),Po=e=>N(t=>e(t.context)),Fo=r(2,(e,t)=>Q(e)?e:Ao(e,Tr(t))),Io=function(){return arguments.length===1?r(2,(e,t)=>Lo(e,arguments[0],t)):r(3,(e,t,n)=>Lo(e,t,n)).apply(this,arguments)},Lo=(e,t,n)=>Ao(e,I(t,n)),Ro=r(2,(e,t)=>Z(t,t=>t?mo(e):Ba)),zo=r(e=>D(e[0]),(e,t)=>Is({while:o,body:a(t?.disableYield?e:Z(e,e=>za)),step:l})),Bo=r(2,(e,t)=>new Ho(e,t.length===1?t:e=>t(e))),Vo=O({op:`OnFailure`,[w]:io}),Ho=function(e,t){this[C]=e,this[E]=t};Ho.prototype=Vo;var Uo=r(3,(e,t,n)=>Bo(e,e=>{let r=t(e);return kr(r)?G(r.failure):n(r.success,e)})),Wo=r(2,(e,t)=>Uo(e,pa,e=>t(e))),Go=r(2,(e,t)=>Wo(e,e=>Ua(()=>t(e)))),Ko=r(2,(e,t)=>new Jo(e,t.onSuccess.length===1?t.onSuccess:e=>t.onSuccess(e),t.onFailure.length===1?t.onFailure:e=>t.onFailure(e))),qo=O({op:`OnSuccessAndFailure`,[w]:io}),Jo=function(e,t,n){this[C]=e,this[T]=t,this[E]=n};Jo.prototype=qo;var Yo=e=>Q(e)?A(e):Xo(e),Xo=k({op:`Exit`,[w](e){return e._stack.push(this),this[C]},[T](e,t,n){return t.succeedWith(n??A(e))},[E](e,t,n){return t.succeedWith(n??j(e))}}),Zo=`~effect/Scope`,Qo=`~effect/Scope/Closeable`,$o=Qn(`effect/Scope`),es=(e,t)=>N(n=>{let r=ts(e,t);return r===void 0?J:(Ns(n),r)}),ts=(e,t)=>{let n=e.state;if(n._tag===`Closed`||(e.state={_tag:`Closed`,exit:t},e.parent!==void 0&&ls(e.parent,e),n._tag===`Empty`))return;if(n.finalizer!==void 0)return ns(n.finalizer,t);let r=n.finalizers;return r.size===1?ns(r.values().next().value,t):is(e,r,t)},ns=(e,t)=>{try{return e(t)}catch(e){return M(e)}},rs=(e,t)=>wo(e)?t:Bo(t,t=>G(_a(e.cause,t))),is=Qa(function*(e,t,n){let r=[],i=[],a=Array.from(t.values()),o=Ca();for(let t=a.length-1;t>=0;t--){let s=a[t];e.strategy===`sequential`?r.push(yield*Yo(ns(s,n))):i.push(Ws(o,ns(s,n),!0,!0,`inherit`))}return i.length>0&&(r=yield*ja(i)),yield*ko(r)}),as=(e,t)=>{let n=ds(t,e);return e.state._tag===`Closed`?(n.state=e.state,n):(cs(e,n,e=>es(n,e)),n)},os=(e,t)=>q(()=>e.state._tag===`Closed`?t(e.state.exit):(cs(e,{},t),J)),ss=(e,t)=>os(e,a(t)),cs=(e,t,n)=>{if(e.state._tag===`Empty`)e.state={_tag:`Open`,finalizerKey:t,finalizer:n,finalizers:void 0};else if(e.state._tag===`Open`){let r=e.state;r.finalizer===void 0?r.finalizers.set(t,n):(r.finalizers=new Map([[r.finalizerKey,r.finalizer]]),r.finalizerKey=void 0,r.finalizer=void 0,r.finalizers.set(t,n))}},ls=(e,t)=>{if(e.state._tag!==`Open`)return;let n=e.state;n.finalizerKey===t?e.state=fs:n.finalizers!==void 0&&(n.finalizers.delete(t),n.finalizers.size===0&&(e.state=fs))},us=e=>ds(e,void 0),ds=(e=`sequential`,t)=>({[Qo]:Qo,[Zo]:Zo,strategy:e,parent:t,state:fs}),fs={_tag:`Empty`},ps=$o,ms=Io($o),hs=e=>N(t=>{let n=t.context,r=us();return t.setContext(I(t.context,$o,r)),ys(t,e=>(t.setContext(n),ts(r,e))),e}),gs=e=>q(()=>{let t=us();return bs(e(t),e=>q(()=>ts(t,e)??J))}),_s=function(){let e=O({op:`OnExit`,[w](e){return e._stack.push(this),this.effect},[vt](e){e.interruptible&&this.interruptible!==!0&&(e._stack.push(As),e.interruptible=!1)},[T](e,t,n){n??=A(e);let r;try{r=this.onExit(n)}catch(e){r=M(e)}return r?Z(r,e=>n):n},[E](e,t,n){n??=j(e);let r;try{r=this.onExit(n)}catch(e){r=M(e)}return r?Z(rs(n,r),e=>n):n}}),t=function(e,t,n){this.effect=e,this.onExit=t,this.interruptible=n};return t.prototype=e,t}(),vs=(e,t,n)=>new _s(e,t,n),ys=(e,t)=>{e._stack.push(new _s(void 0,t,void 0))},bs=r(2,vs),xs=r(2,(e,t)=>bs(e,e=>t)),Ss=r(3,(e,t,n)=>bs(e,e=>{let r=t(e);return kr(r)?J:n(r.success,e)})),Cs=r(2,(e,t)=>Ss(e,To,t)),ws=r(3,(e,t,n)=>bs(e,e=>{if(e._tag!==`Failure`)return J;let r=t(e.cause);return kr(r)?J:n(r.success,e.cause)})),Ts=r(2,(e,t)=>ws(ha,t)(e)),Es=e=>K(()=>{let t=cc(!1),n=!1,r,i=Z(t.await,()=>r);return N(a=>r===void 0?n?i:(n=!0,ys(a,e=>K(()=>{r=e,t.openUnsafe()})),e):r)}),Ds=N(e=>G(fa(e.id))),Os=e=>N(t=>t.interruptible?(t.interruptible=!1,t._stack.push(As),e):e),ks=k({op:`SetInterruptible`,[vt](e){if(e.interruptible=this[C],e._interruptedCause&&e.interruptible)return()=>G(e._interruptedCause)}}),As=ks(!0),js=ks(!1),Ms=e=>{if(e.interruptible=!0,e._stack.push(js),e._interruptedCause)return G(e._interruptedCause)},Ns=e=>{let t=e;t.interruptible&&(t.interruptible=!1,t._stack.push(As))},Ps=e=>N(t=>t.interruptible?e:Ms(t)??e),Fs=e=>N(t=>t.interruptible?(t.interruptible=!1,t._stack.push(As),e(Ps)):e(i)),Is=k({op:`While`,[T](e,t){return this[C].step(e),this[C].while()?(t._stack.push(this),this[C].body()):$},[w](e){return this[C].while()?(e._stack.push(this),this[C].body()):$}}),Ls=r(e=>typeof e[1]==`function`,(e,t,n)=>q(()=>{let r=zs(n?.concurrency);if(r===1)return Rs(e,t,n);let i=Br(e),a=i.length;if(a===0)return n?.discard?J:W([]);let o=n?.discard?void 0:Array(a),s=Us({f:t,out:o},i,{concurrency:r});return s?ro(s,o):W(o)})),Rs=(e,t,n)=>q(()=>{let r=n?.discard?void 0:[],i=e[Symbol.iterator](),a=i.next(),o=0;return ro(Is({while:()=>!a.done,body:()=>t(a.value,o++),step:e=>{r&&r.push(e),a=i.next()}}),r)}),zs=e=>e===`unbounded`?1/0:Math.max(1,e??1),Bs=()=>e=>{let t=e.onItem,n=e.step,r=(e,t,r,a,o)=>Z(Yo(o),o=>n(e,t[r],o,r)??i(e,t,r+1,a)??J),i=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!Q(c))return r(e,i,a,o,c);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return i},Vs=e=>{let t=e.onItem,n=e.step;return(e,r,i)=>{let a=0,o=i.end??r.length,s=i.concurrency,c=!1,l,u,d,f,ee,te=e=>{let t=M(e);return f=t,c=!0,u&&u.size>0?Z(Os(Ia(Array.from(u))),()=>f??t):t},ne=()=>{let i=!1;for(;!f&&a<o;a++){let o=r[a],re=ee??t(e,o,a);if(Q(re)){if(f=n(e,o,re,a),f)break}else if(l){ee=void 0;let t=Ws(l,re,!0,!0,`inherit`);if(t._exit){if(f=n(e,o,t._exit,a),f)break;continue}u.add(t);let r=a;if(t.addObserver(a=>{u.delete(t);try{if(f){if(a._tag===`Failure`){let e=a.cause.reasons.filter(e=>e._tag!==`Interrupt`);if(e.length>0){let t=jt(e);f=j(f._tag===`Failure`?_a(f.cause,t):t)}}}else{let t=n(e,o,a,r);t&&(f=t,ne())}if(i){let e=ne();e&&d(e)}else c&&u.size===0&&d(f??J)}catch(e){d(te(e))}}),u.size<s)continue;i=!0,a++;return}else return Y(e=>{l=Ca(),u=new Set,ee=re,d=e;let t;try{t=ne()}catch(t){return e(te(t))}return t?e(t):q(()=>(f??=$,Z(u?Ia(u):J,()=>f?._tag===`Failure`?f:J)))})}if(c=!0,f){if(u&&u.size>0){let e=ka(l);u.forEach(t=>t.interruptUnsafe(l.id,e));return}if(d||f._tag===`Failure`)return f}else if(d){if(u)u.size===0&&d(J);else return $}};return ne()}},Hs=()=>e=>Vs(e),Us=Vs({onItem(e,t,n){return e.f(t,n)},step(e,t,n,r){if(n._tag===`Failure`)return n;e.out&&(e.out[r]=n.value)}}),Ws=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new wa(a.context,o);return n?s.evaluate(t):a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0),!r&&!s._exit&&(a.children().add(s),s._parent=a),s},Gs=r(e=>D(e[0]),(e,t)=>N(n=>W(Ws(n,e,t?.startImmediately,!0,t?.uninterruptible)))),Ks=r(e=>D(e[0]),(e,t,n)=>N(r=>{let i=Ws(r,e,n?.startImmediately,!0,n?.uninterruptible);if(!i._exit){if(t.state._tag!==`Closed`){let e={};cs(t,e,()=>qa(e=>e===i.id?J:Pa(i))),i.addObserver(()=>ls(t,e))}else i.interruptUnsafe(r.id,ka(r))}return W(i)})),qs=e=>(t,n)=>{let r=new wa(n?.scheduler?I(e,Ai,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},Js=r(2,(e,t)=>{if(e._exit)return e;if(t.state._tag===`Closed`)return e.interruptUnsafe(e.id),e;let n={};return cs(t,n,()=>Pa(e)),e.addObserver(()=>ls(t,n)),e}),Ys=qs(F()),Xs=e=>{let t=qs(e);return(e,n)=>{let r=t(e,n);return n?.onExit&&r.addObserver(n.onExit),e=>r.interruptUnsafe(e)}},Zs=Xs(F()),Qs=e=>{let t=qs(e);return(e,n)=>{let r=t(e,n);return new Promise(e=>{r.addObserver(t=>e(t))})}},$s=Qs(F()),ec=(e=>{let t=Qs(e);return(e,n)=>t(e,n).then(e=>{if(e._tag===`Failure`)throw ya(e.cause);return e.value})})(F()),tc=e=>{let t=qs(e);return e=>{if(Q(e))return e;let n=new Fi(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??M(new Ac(r))}},nc=tc(F()),rc=e=>{let t=tc(e);return e=>{let n=t(e);if(n._tag===`Failure`)throw ya(n.cause);return n.value}},ic=rc(F()),ac=W(!0),oc=W(!1),sc=class{waiters=[];scheduled=void 0;_isOpen;constructor(e){this._isOpen=e}scheduleUnsafe(e){if(this.waiters.length===0)return ac;if(this.scheduled===void 0)this.scheduled=this.waiters,e.currentDispatcher.scheduleTask(this.flushScheduled,0);else for(let e=0;e<this.waiters.length;e++)this.scheduled.push(this.waiters[e]);return this.waiters=[],ac}flushScheduled=()=>{if(this.scheduled===void 0)return;let e=this.scheduled;this.scheduled=void 0;for(let t=0;t<e.length;t++)e[t]($)};flushWaiters(){let e=this.waiters;this.waiters=[],this.flushScheduled();for(let t=0;t<e.length;t++)e[t]($)}open=N(e=>this._isOpen?oc:(this._isOpen=!0,this.scheduleUnsafe(e)));release=N(e=>this._isOpen?oc:this.scheduleUnsafe(e));openUnsafe(){return!this._isOpen&&(this._isOpen=!0,this.flushWaiters(),!0)}await=Y(e=>this._isOpen?e(J):(this.waiters.push(e),K(()=>{let t=this.waiters.indexOf(e);t===-1?this.scheduled!==void 0&&(t=this.scheduled.indexOf(e),t!==-1&&this.scheduled.splice(t,1)):this.waiters.splice(t,1)})));closeUnsafe(){return this._isOpen?(this._isOpen=!1,!0):!1}close=K(()=>this.closeUnsafe());whenOpen=e=>Z(this.await,()=>e);isOpen(){return this._isOpen}},cc=e=>new sc(e??!1),lc=BigInt(0),uc={_tag:`Span`,spanId:`noop`,traceId:`noop`,sampled:!1,status:{_tag:`Ended`,startTime:lc,endTime:lc,exit:$},attributes:new Map,links:[],kind:`internal`,attribute(){},event(){},end(){},addLinks(){}},dc=e=>Object.assign(Object.create(uc),e),fc=e=>e?L(e.annotations,Yi)?e._tag===`Span`?fc(Kn(e.parent)):P():Bn(e):P(),pc=(e,t,n)=>{let r=!e.cache.tracerEnabled||n?.annotations&&L(n.annotations,Yi),i=n?.parent===void 0?n?.root?P():fc(e.cache.span):Bn(n.parent),a;if(r)a=dc({name:t,parent:i,annotations:I(n?.annotations??F(),Yi,!0)});else{let r=e.cache.tracer??$i,o=e.getRef(yc),s=e.getRef(ia),c=e.getRef(aa),l=e.getRef(oa),u=n?.level??e.getRef(Xi),d=n?.links===void 0?l.length===0?[]:l.slice():[...l,...n.links];a=r.span({name:t,parent:i,annotations:n?.annotations??F(),links:d,startTime:s?o.currentTimeNanosUnsafe():lc,kind:n?.kind??`internal`,root:n?.root??Vn(i),sampled:n?.sampled??(Hn(i)&&i.value.sampled===!1?!1:!Nc(e.getRef(Zi),u))});for(let e in c)a.attribute(e,c[e]);if(n?.attributes!==void 0)for(let e in n.attributes)a.attribute(e,n.attributes[e])}return a},mc=(e,t)=>(t=typeof t==`function`?t:c,jo(na,n=>({name:e,stack:t,parent:n}))),hc=(e,t,n,r)=>K(()=>{e.status._tag!==`Ended`&&e.end(r?n.currentTimeNanosUnsafe():lc,t)}),gc=(e,...t)=>{let n=t.length===1?void 0:t[0],r=t[t.length-1];return N(t=>{let i=pc(t,e,n),a=t.getRef(yc),o=t.getRef(ia);return ys(t,e=>hc(i,e,a,o)),r(i)})},_c=Io(qi),vc=function(){let e=D(arguments[0]),t=e?arguments[1]:arguments[0],n=e?arguments[2]:arguments[1],r=i;return t._tag===`Span`&&(n=la(n),r=mc(t.name,n?.captureStackTrace)),e?_c(r(arguments[0]),t):e=>_c(r(e),t)},yc=R(`effect/Clock`,{defaultValue:()=>new xc}),bc=2**31-1,xc=class{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=K(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return wc()}currentTimeNanos=K(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return Cc()}monotonicTimeNanos=K(()=>this.monotonicTimeNanosUnsafe());sleep(e){return this.sleepMillis(Ci(e))}sleepMillis(e){return e<=0?za:Number.isFinite(e)?Y(t=>{let n=e>bc?this.sleepMillis(e-bc):J,r=setTimeout(()=>t(n),Math.min(e,bc));return K(()=>clearTimeout(r))}):Xa}},Sc=BigInt(1e6),Cc=function(){let e=globalThis.process?.hrtime;if(typeof e?.bigint==`function`)return()=>e.bigint();if(typeof performance<`u`&&typeof performance.now==`function`)return()=>BigInt(Math.round(performance.now()*1e6));let t=BigInt(0);return()=>{let e=BigInt(Date.now())*Sc;return e>t&&(t=e),t}}(),wc=function(){let e=BigInt(1e9),t;return()=>{let n=Cc(),r=BigInt(Date.now())*Sc;if(t===void 0)t=r-n;else{let i=t+n;(r>i?r-i:i-r)>e&&(t=r-n)}return t+n}}(),Tc=e=>N(t=>e(t.getRef(yc))),Ec=e=>Tc(t=>t.sleep(V(e))),Dc=`~effect/Cause/IllegalArgumentError`,Oc=class extends Kt(`IllegalArgumentError`){[Dc]=Dc;constructor(e){super({message:e})}},kc=`~effect/Cause/AsyncFiberError`,Ac=class extends Kt(`AsyncFiberError`){[kc]=kc;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},jc=`~effect/Cause/UnknownError`,Mc=class extends Kt(`UnknownError`){[jc]=jc;constructor(e,t){super({message:t,cause:e})}},Nc=Ln(Pn(Mn,e=>{switch(e){case`All`:return-(2**53-1);case`Fatal`:return 5e4;case`Error`:return 4e4;case`Warn`:return 3e4;case`Info`:return 2e4;case`Debug`:return 1e4;case`Trace`:return 0;case`None`:return 2**53-1}})),Pc={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Pc.gray,Pc.blue,Pc.green,Pc.yellow,Pc.red,Pc.bgBrightRed,Pc.black;var Fc=It,Ic=jt,Lc=Mt,Rc=Pt,zc=fa,Bc=va,Vc=ya,Hc=ma,Uc=Jt,Wc=Xt,Gc=en,Kc=Oc,qc=St,Jc=A,Yc=j,Xc=Ut,Zc=$,Qc=wo,$c={"~effect/Deferred":{_A:i,_E:i},pipe(){return e(this,arguments)}},el=function(){this.resumes=void 0,this.effect=void 0};el.prototype=$c;var tl=()=>new el,nl=e=>Y(t=>e.effect?t(e.effect):(e.resumes??=[],e.resumes.push(t),K(()=>{let n=e.resumes;if(n===void 0)return;let r=n.indexOf(t);r>=0&&n.splice(r,1)}))),rl=r(2,(e,t)=>K(()=>ol(e,t))),il=r(2,(e,t)=>rl(e,j(t))),al=r(2,(e,t)=>il(e,fa(t))),ol=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){let n=e.resumes;e.resumes=void 0;for(let e=0;e<n.length;e++)n[e](t)}return!0},sl=$o,cl=us,ll=ms,ul=os,dl=ss,fl=as,pl=es,ml=`~effect/Layer`,hl=`~effect/Layer/MemoMap`,gl=(e,t)=>{let n={observers:0,deferred:tl(),scope:cl(),finalizer:r=>q(()=>--n.observers>0?J:(e.map.delete(t),pl(n.scope,r)))};return n},_l=(e,t)=>t.state._tag!==`Closed`&&(e.observers++,cs(t,{},e.finalizer),!0),vl={[ml]:{_ROut:i,_E:i,_RIn:i},pipe(){return e(this,arguments)}},yl=e=>{let t=Object.create(vl);return t.build=e,t},bl=e=>yl((t,n)=>{let r=fl(n);return bs(e(t,r),e=>e._tag===`Failure`?pl(r,e):J)}),xl=e=>{let t=bl((n,r)=>n.getOrElseMemoize(t,r,e));return t},Sl=class{get[hl](){return hl}parent;constructor(e){this.parent=e}map=new Map;get(e,t){let n=this.map.get(e);return n?(_l(n,t),n.deferred.effect??nl(n.deferred)):this.parent?.get(e,t)}getOrElseMemoize(e,t,n){return q(()=>{let r;return vs(q(()=>{let i=this.get(e,t);if(i)return i;let a=gl(this,e);return _l(a,t)?(r=a.deferred,this.map.set(e,a),n(this,a.scope)):n(this,t)}),e=>{r&&ol(r,e)})})}},Cl=()=>new Sl,wl=e=>new Sl(e),Tl=class e extends Qn()(`effect/Layer/CurrentMemoMap`){static forkOrCreate(t){let n=yr(t,e);return n?wl(n):Cl()}},El=r(3,(e,t,n)=>Io(bo(e.build(t,n),I(Tl,t)),Tl,t)),Dl=r(2,(e,t)=>N(n=>El(e,Tl.forkOrCreate(n.context),t))),Ol=function(){return arguments.length===1?e=>kl(arguments[0],e):kl(arguments[0],arguments[1])},kl=(e,t)=>Al(bo(t,t=>_r(e,t))),Al=e=>xl((t,n)=>ll(e,n)),jl=(e,t,n)=>{let r=fl(n,`parallel`);return Ls(e,e=>e.build(t,fl(r,`sequential`)),{concurrency:e.length}).pipe(bo(e=>Er(...e)))},Ml=(...e)=>bl((t,n)=>jl(e,t,n)),Nl=(e,t,n)=>bl((r,i)=>Z(Array.isArray(t)?jl(t,r,i):t.build(r,i),t=>e.build(r,i).pipe(Fo(t),bo(e=>n(e,t))))),Pl=r(2,(e,t)=>Nl(e,t,i)),Fl=r(2,(e,t)=>Nl(e,t,(e,t)=>Tr(t,e))),Il=(e,t,n)=>gs(r=>Z(n?.local?El(t,Cl(),r):Dl(t,r),t=>Fo(e,t))),Ll=r(e=>D(e[0]),(e,t,n)=>mr(t)?Fo(e,t):Il(e,Array.isArray(t)?Ml(...t):t,n)),Rl=D,zl=Ls,Bl=Is,Vl=Ga,Hl=Ka,Ul=W,Wl=q,Gl=K,Kl=J,ql=Y,Jl=Xa,Yl=Za,Xl=La,Zl=G,Ql=Va,$l=Ha,eu=Wa,tu=N,nu=Ra,ru=Z,iu=yo,au=ho,ou=go,su=Yo,cu=bo,lu=ro,uu=_o,du=Bo,fu=Ec,pu=Ro,mu=Ko,hu=Mo,gu=Po,_u=Ll,vu=Fo,yu=Ao,bu=Io,xu=ps,Su=hs,Cu=gs,wu=xs,Tu=Cs,Eu=bs,Du=Es,Ou=Ds,ku=Ts,Au=Os,ju=Fs,Mu=zo,Nu=gc,Pu=vc,Fu=Ks,Iu=Gs,Lu=Ys,Ru=qs,zu=Xs,Bu=Zs,Vu=ec,Hu=$s,Uu=ic,Wu=rc,Gu=nc,Ku=Qa,qu=xo,Ju=So,Yu=vo,Xu=eo,Zu=`~effect/http/Cookies`,Qu=e=>p(e,Zu),$u=`~effect/http/Cookies/Cookie`,ed=e=>p(e,$u),td=`~effect/http/Cookies/CookieError`,nd=class extends zi{},rd=class e extends Bi(`CookiesError`){static fromReason(t,n){return new e({reason:new nd({_tag:t,cause:n})})}[td]=td;get message(){return this.reason._tag}},id={[Zu]:Zu,...ot,toJSON(){return{_id:`effect/Cookies`,cookies:Fr(this.cookies,e=>e.toJSON())}},pipe(){return e(this,arguments)}},ad=e=>{let t=Object.create(id);return t.cookies=e,t},od=e=>{let t={};for(let n of e)pt(t,n.name,n);return ad(t)},sd=e=>{let t=typeof e==`string`?[e]:e,n=[];for(let e of t){let t=cd(e.trim());t&&n.push(t)}return od(n)};function cd(e){let t=e.split(`;`).map(e=>e.trim()).filter(e=>e!==``);if(t.length===0)return;let n=t[0].indexOf(`=`);if(n===-1)return;let r=t[0].slice(0,n);if(!ud.test(r))return;let i=t[0].slice(n+1),a=bd(i);if(t.length===1)return Object.assign(Object.create(pd),{name:r,value:a,valueEncoded:i});let o={};for(let e=1;e<t.length;e++){let n=t[e],r=n.indexOf(`=`),i=r===-1?n:n.slice(0,r).trim(),a=r===-1?void 0:n.slice(r+1).trim();switch(i.toLowerCase()){case`domain`:{if(a===void 0)break;let e=a.trim().replace(/^\./,``);e&&(o.domain=e);break}case`expires`:{if(a===void 0)break;let e=new Date(a);isNaN(e.getTime())||(o.expires=e);break}case`max-age`:{if(a===void 0)break;let e=parseInt(a,10);isNaN(e)||(o.maxAge=vi(e));break}case`path`:if(a===void 0)break;a[0]===`/`&&(o.path=a);break;case`priority`:if(a===void 0)break;switch(a.toLowerCase()){case`low`:o.priority=`low`;break;case`medium`:o.priority=`medium`;break;case`high`:o.priority=`high`}break;case`httponly`:o.httpOnly=!0;break;case`secure`:o.secure=!0;break;case`partitioned`:o.partitioned=!0;break;case`samesite`:if(a===void 0)break;switch(a.toLowerCase()){case`lax`:o.sameSite=`lax`;break;case`strict`:o.sameSite=`strict`;break;case`none`:o.sameSite=`none`}}}return Object.assign(Object.create(pd),{name:r,value:a,valueEncoded:i,options:Object.keys(o).length>0?o:void 0})}var ld=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ud=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,dd=/^[\u0009\u0020-\u003a\u003c-\u007e\u0080-\u00ff]+$/,fd=/^[\u0020-\u003a\u003c-\u007e]+$/,pd={[$u]:$u,...ot,toJSON(){return{_id:`effect/Cookies/Cookie`,name:this.name,value:this.value,options:this.options}}};function md(e,t,n){let r=encodeURIComponent(t),i=hd(e,r,n);return i===void 0?z(Object.assign(Object.create(pd),{name:e,value:t,valueEncoded:r,options:n})):B(i)}function hd(e,t,n){if(!ud.test(e))return rd.fromReason(`InvalidCookieName`);if(t&&!ld.test(t))return rd.fromReason(`InvalidCookieValue`);if(n?.domain!==void 0&&!dd.test(n.domain))return rd.fromReason(`InvalidCookieDomain`);if(n?.path!==void 0&&!fd.test(n.path))return rd.fromReason(`InvalidCookiePath`);if(n?.maxAge!==void 0&&!fi(V(n.maxAge)))return rd.fromReason(`CookieInfinityMaxAge`)}var gd=(e,t,n)=>Mr(md(e,t,n));function _d(e){let t=hd(e.name,e.valueEncoded,e.options);if(t!==void 0)throw t;let n=e.name+`=`+e.valueEncoded;if(e.options===void 0)return n;let r=e.options;if(r.maxAge!==void 0){let e=wi(V(r.maxAge));n+=`; Max-Age=`+Math.trunc(e)}if(r.domain!==void 0&&(n+=`; Domain=`+r.domain),r.path!==void 0&&(n+=`; Path=`+r.path),r.priority!==void 0)switch(r.priority){case`low`:n+=`; Priority=Low`;break;case`medium`:n+=`; Priority=Medium`;break;case`high`:n+=`; Priority=High`}if(r.expires!==void 0&&(n+=`; Expires=`+r.expires.toUTCString()),r.httpOnly&&(n+=`; HttpOnly`),r.secure&&(n+=`; Secure`),r.partitioned&&(n+=`; Partitioned`),r.sameSite!==void 0)switch(r.sameSite){case`lax`:n+=`; SameSite=Lax`;break;case`strict`:n+=`; SameSite=Strict`;break;case`none`:n+=`; SameSite=None`}return n}var vd=e=>{let t={},n=Object.values(e.cookies);for(let e=0;e<n.length;e++){let r=n[e];pt(t,r.name,r.value)}return t},yd=e=>Object.values(e.cookies).map(_d),bd=e=>{try{return decodeURIComponent(e)}catch{return e}},xd=`~effect/http/UrlParams`,Sd=e=>p(e,xd),Cd={...bt,[xd]:xd,[Symbol.iterator](){return this.params[Symbol.iterator]()},toJSON(){return{_id:`UrlParams`,params:Object.fromEntries(this.params)}},[y](e){return Dd(this,e)},[m](){return we(this.params.flat())}},wd=e=>{let t=Object.create(Cd);return t.params=e,t},Td=e=>{if(Sd(e))return e;let t=Ed(e),n=[];for(let e=0;e<t.length;e++)if(Array.isArray(t[e][0])){let[r,i]=t[e];n.push([`${r[0]}[${r.slice(1).join(`][`)}]`,i])}else n.push(t[e]);return wd(n)},Ed=e=>{let t=typeof e[Symbol.iterator]==`function`?Br(e):Object.entries(e),n=[];for(let[e,r]of t)if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]!==void 0&&n.push([e,String(r[t])]);else if(typeof r==`object`&&r){let t=Ed(r);for(let[r,i]of t)n.push([[e,...typeof r==`string`?[r]:r],i])}else r!==void 0&&n.push([e,String(r)]);return n},Dd=nn((e,t)=>Od(e.params,t.params)),Od=Yr(Nr([an(),an()])),kd=wd([]),Ad=r(2,(e,t)=>{let n=Td(t).params.slice(),r=new Set;for(let e=0;e<n.length;e++)r.add(n[e][0]);for(let t=0;t<e.params.length;t++)r.has(e.params[t][0])||n.push(e.params[t]);return wd(n)}),jd=e=>{let t={};for(let[n,r]of e.params)if(!Object.hasOwn(t,n))pt(t,n,r);else{let e=t[n];typeof e==`string`?pt(t,n,[e,r]):e.push(r)}return t};export{vu as $,Or as $n,be as $r,Lc as $t,ru as A,Fs as An,bt as Ar,Ol as At,Yl as B,Hr as Bn,st as Br,ll as Bt,gu as C,u as Ci,cc as Cn,zn as Cr,Nu as Ct,Xl as D,Ba as Dn,an as Dr,tu as Dt,su as E,e as Ei,W as En,An as Er,Bl as Et,zl as F,Ai as Fn,N as Fr,dl as Ft,Ju as G,Jr as Gn,et as Gr,qc as Gt,Rl as H,Ur as Hn,at as Hr,tl as Ht,Mu as I,V as In,pt as Ir,ul as It,Tu as J,B as Jn,Ge as Jr,Zc as Jt,mu as K,qr as Kn,$e as Kr,Qc as Kt,Iu as L,fi as Ln,lt as Lr,pl as Lt,iu as M,Yi as Mn,Ut as Mr,Pl as Mt,Ku as N,Bi as Nn,j as Nr,Fl as Nt,Zl as O,q as On,Qt as Or,Pu as Ot,Xu as P,Fi as Pn,A as Pr,sl as Pt,_u as Q,z as Qn,h as Qr,Gc as Qt,Fu as R,Ci as Rn,ut as Rr,fl as Rt,hu as S,ee as Si,Bs as Sn,Ln as Sr,yu as St,wu as T,t as Ti,zs as Tn,Rn as Tr,pu as Tt,cu as U,Wr as Un,x as Ur,Xc as Ut,Ou as V,Kr as Vn,it as Vr,al as Vt,qu as W,Gr as Wn,tt as Wr,Yc as Wt,ku as X,Ar as Xn,y as Xr,Uc as Xt,Eu as Y,kr as Yn,b as Yr,Kc as Yt,Vl as Z,jr as Zn,g as Zr,Rc as Zt,lu as _,a as _i,Na as _n,Bn as _r,ou as _t,wd as a,ge as ai,Bc as an,yr as ar,Vu as at,ql as b,i as bi,Ca as bn,Mn as br,Au as bt,od as c,se as ci,mo as cn,Gn as cr,Gu as ct,ed as d,oe as di,Q as dn,Vn as dr,Su as dt,v as ei,Ic as en,R as er,bu as et,Qu as f,he as fi,Co as fn,Hn as fr,Cu as ft,au as g,l as gi,Ma as gn,P as gr,Gl as gt,yd as h,o as hi,Pa as hn,Un as hr,Wl as ht,Sd as i,ce as ii,Fc as in,L as ir,Ru as it,Yu as j,J as jn,C as jr,Cl as jt,Ql as k,K as kn,Gt as kr,El as kt,ad as l,me as li,Y as ln,Jn as lr,Wu as lt,vd as m,s as mi,Oo as mn,Yn as mr,Ul as mt,kd as n,m as ni,zc as nn,I as nr,zu as nt,Ad as o,de as oi,Vc as on,Tr as or,Hu as ot,gd as p,pe as pi,$ as pn,qn as pr,fu as pt,Jl as q,Rr as qn,qe as qr,Jc as qt,Td as r,p as ri,Wc as rn,F as rr,Lu as rt,jd as s,fe as si,ho as sn,Xn as sr,Uu as st,Dd as t,Se as ti,Hc as tn,Qn as tr,Bu as tt,sd as u,ue as ui,Uo as un,Kn as ur,xu as ut,uu as v,r as vi,Js as vn,Nn as vr,Hl as vt,$l as w,n as wi,vs as wn,In as wr,Kl as wt,du as x,f as xi,Hs as xn,jn as xr,ju as xt,Du as y,d as yi,Z as yn,Fn as yr,eu as yt,nu as z,Vr as zn,ot as zr,cl as zt};
@@ -0,0 +1 @@
1
+ import{C as e,a as t,b as n,c as r,f as i,i as a,l as o,r as s,x as c}from"./Schema-DUFTUil2.js";var l=a([`low`,`medium`,`high`,`xhigh`,`max`]),u=a([`minimal`,`low`,`medium`,`high`,`xhigh`]),d=t(r.check(c(1),n(200),e())),f=i([o({provider:s(`claude`),model:d,effort:t(l)}),o({provider:s(`codex`),model:d,effort:t(u)})]),p=e=>e===`claude`?l.literals:u.literals;export{p as n,f as t};