progon-agent 1.3.1 → 1.3.2

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 (42) hide show
  1. package/extension-bundle.json +3 -3
  2. package/extension-dist/background/background.js +82 -82
  3. package/extension-dist/card/card.html +7 -7
  4. package/extension-dist/card/card.js +3 -3
  5. package/extension-dist/chunks/shared-9kMbf8PO.js +1 -0
  6. package/extension-dist/chunks/shared-Bi_ASAsl.js +377 -0
  7. package/extension-dist/chunks/{shared-CwW6XlwM.js → shared-Bts1WtwM.js} +1 -1
  8. package/extension-dist/chunks/shared-BvwA-cm2.css +1 -0
  9. package/extension-dist/chunks/shared-Bwk7ZjOr.js +21 -0
  10. package/extension-dist/chunks/{shared-BJIubFtc.js → shared-CInXPYm9.js} +1 -1
  11. package/extension-dist/chunks/shared-CX8XGwZc.js +1 -0
  12. package/extension-dist/chunks/shared-CZrS2BT6.js +111 -0
  13. package/extension-dist/chunks/{shared-SnJc3X_h.js → shared-C_dmgeUK.js} +12 -18
  14. package/extension-dist/chunks/shared-CeuPJn47.js +227 -0
  15. package/extension-dist/chunks/{shared-Bdgj5eQ5.js → shared-CiEEQWpw.js} +1 -1
  16. package/extension-dist/chunks/shared-Cxo909tK.js +1 -0
  17. package/extension-dist/chunks/shared-DyRhAmgo.js +51 -0
  18. package/extension-dist/chunks/shared-Xq2emDMe.js +98 -0
  19. package/extension-dist/chunks/shared-_jlBqdBD.css +1 -0
  20. package/extension-dist/content/content.css +1 -1
  21. package/extension-dist/content/content.js +211 -211
  22. package/extension-dist/manifest.json +23 -23
  23. package/extension-dist/offscreen/offscreen.html +2 -2
  24. package/extension-dist/offscreen/offscreen.js +1 -1
  25. package/extension-dist/popup/popup.html +7 -7
  26. package/extension-dist/popup/popup.js +3 -3
  27. package/extension-dist/sidepanel/sidepanel.html +10 -10
  28. package/extension-dist/sidepanel/sidepanel.js +1 -1
  29. package/extension-dist/workspace/workspace.html +11 -11
  30. package/extension-dist/workspace/workspace.js +56 -55
  31. package/package.json +1 -1
  32. package/extension-dist/chunks/shared-B3hsjAeB.js +0 -371
  33. package/extension-dist/chunks/shared-BJOAkaqO.js +0 -1
  34. package/extension-dist/chunks/shared-BUQXvbGJ.css +0 -1
  35. package/extension-dist/chunks/shared-BiDh2lEA.js +0 -1
  36. package/extension-dist/chunks/shared-Ccz3X65G.js +0 -51
  37. package/extension-dist/chunks/shared-CdkSNWvx.js +0 -21
  38. package/extension-dist/chunks/shared-DCs5uS1P.js +0 -1
  39. package/extension-dist/chunks/shared-DdJtX3_m.js +0 -105
  40. package/extension-dist/chunks/shared-O0OgUhxM.js +0 -227
  41. package/extension-dist/chunks/shared-UK_0TOj7.js +0 -98
  42. package/extension-dist/chunks/shared-c_EHmnKR.css +0 -1
@@ -0,0 +1 @@
1
+ import{Wn as e,Yt as t,fr as n,nr as r,or as i,qn as a,tr as o}from"./shared-Xq2emDMe.js";var s=e([`mapper`,`mapper_fallback`,`user`,`imported`,`agentic`]),c=r({id:i().uuid(),runId:i().uuid(),stepId:i().uuid(),proposedElementId:i().uuid().nullable(),confidence:o(),source:s,createdAt:i(),updatedAt:i(),elementAccessibleName:i(),elementRole:i(),pageUrl:i(),targetPageId:i().uuid().optional(),shadowLineage:t.optional()}),l=e([`high`,`grey`,`low`]);r({mappingId:n(),source:s,confidence:o().min(0).max(1),confidenceTier:l,pendingRemap:a()});export{c as t};
@@ -0,0 +1,51 @@
1
+ import{r as e}from"./shared-hePW80VL.js";import{$i as t,Di as n,Gn as r,Hr as i,Ki as a,Li as o,Qi as s,Qn as c,Rr as l,Vr as u,bi as d,ci as f,jr as p,la as m,mo as h,qi as g,si as _}from"./shared-CeuPJn47.js";import{Kn as v,Wn as y,fr as b,hr as x,nr as S,or as C,qn as w,t as ee,tr as T}from"./shared-Xq2emDMe.js"
2
+ /**
3
+ * @license lucide-react v0.574.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ ;var E=_(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),D=_(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),O=_(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),te=_(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ne=_(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),k=_(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),A=_(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),j=_(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),M=/* @__PURE__ */ e(g(),1),N=a(),re=[`M28 5 L52 16 L28 27 Z`,`M59 28 L48 52 L37 28 Z`,`M36 59 L12 48 L36 37 Z`,`M5 36 L16 12 L27 36 Z`],ie={brand:[`var(--color-primary-300)`,`var(--color-primary-400)`,`var(--color-secondary)`,`var(--color-primary)`],"primary-ramp":[`var(--color-primary-300)`,`var(--color-primary-400)`,`var(--color-primary-500)`,`var(--color-primary-600)`]}
9
+ /**
10
+ * @license lucide-react v0.574.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ /**
16
+ * @license lucide-react v0.574.0 - ISC
17
+ *
18
+ * This source code is licensed under the ISC license.
19
+ * See the LICENSE file in the root directory of this source tree.
20
+ */
21
+ /**
22
+ * @license lucide-react v0.574.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */
27
+ /**
28
+ * @license lucide-react v0.574.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */
33
+ /**
34
+ * @license lucide-react v0.574.0 - ISC
35
+ *
36
+ * This source code is licensed under the ISC license.
37
+ * See the LICENSE file in the root directory of this source tree.
38
+ */
39
+ /**
40
+ * @license lucide-react v0.574.0 - ISC
41
+ *
42
+ * This source code is licensed under the ISC license.
43
+ * See the LICENSE file in the root directory of this source tree.
44
+ */
45
+ /**
46
+ * @license lucide-react v0.574.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */
51
+ ;function P({className:e,palette:t=`brand`}){let n=ie[t];return/* @__PURE__ */ (0,N.jsx)(`svg`,{viewBox:`0 0 64 64`,"aria-hidden":`true`,className:e,children:re.map((e,t)=>/* @__PURE__ */ (0,N.jsx)(`path`,{d:e,fill:n[t],stroke:n[t],strokeWidth:`4`,strokeLinejoin:`round`},e))})}var ae=ee(`pgs-3273faf788`);function oe({subtitle:e,footer:t}){let{t:i}=d(),a=p(),o=(0,M.useId)(),[s,u]=(0,M.useState)(``),[f,h]=(0,M.useState)(``),[g,_]=(0,M.useState)(!1),[v,y]=(0,M.useState)(null),b=(0,M.useRef)(!1),x=async e=>{if(e.preventDefault(),!b.current){b.current=!0,_(!0);try{let e=await m.auth.login({email:s.trim(),password:f});y(null),a.signedIn(e.user)}catch(e){y(se(e))}finally{b.current=!1,_(!1)}}},S=(v==null?void 0:v.kind)===`refused`;return/* @__PURE__ */ (0,N.jsxs)(`form`,{className:`grid content-start gap-4.5 px-5 pt-7 pb-4`,"aria-labelledby":o,noValidate:!0,onSubmit:e=>{x(e)},"data-testid":`shell-sign-in`,children:[/* @__PURE__ */ (0,N.jsxs)(`div`,{className:`grid justify-items-center gap-1.5 text-center`,children:[/* @__PURE__ */ (0,N.jsx)(`span`,{className:`mb-1 grid size-16 place-items-center rounded-full bg-[radial-gradient(circle_at_50%_45%,color-mix(in_srgb,var(--color-primary)_24%,transparent)_0%,transparent_68%)]`,children:/* @__PURE__ */ (0,N.jsx)(P,{className:`size-10`})}),/* @__PURE__ */ (0,N.jsx)(`h1`,{id:o,className:`m-0 text-(length:--text-window-title) leading-(--leading-window-title) font-semibold tracking-(--tracking-window-title) text-fg-primary`,children:i(`shell.signIn.title`)}),/* @__PURE__ */ (0,N.jsx)(`p`,{className:`m-0 text-body-sm text-fg-muted`,children:e})]}),/* @__PURE__ */ (0,N.jsxs)(`div`,{className:`grid gap-3`,children:[/* @__PURE__ */ (0,N.jsx)(r,{type:`email`,label:i(`shell.signIn.email`),autoComplete:`username`,placeholder:i(`shell.signIn.emailPlaceholder`),value:s,onValueChange:u,invalid:S,autoFocus:!0}),/* @__PURE__ */ (0,N.jsx)(r,{type:`password`,label:i(`shell.signIn.password`),autoComplete:`current-password`,placeholder:i(`shell.signIn.passwordPlaceholder`),value:f,onValueChange:h,invalid:S}),v!==null&&/* @__PURE__ */ (0,N.jsx)(c,{tone:`error`,icon:v.kind===`noAnswer`?/* @__PURE__ */ (0,N.jsx)(j,{"aria-hidden":`true`}):void 0,title:v.kind===`noAnswer`?i(`shell.signIn.noAnswer`):v.message,"data-testid":`shell-sign-in-error`}),/* @__PURE__ */ (0,N.jsx)(l,{type:`submit`,size:`lg`,fullWidth:!0,loading:g,"data-testid":`shell-sign-in-submit`,children:i(`shell.signIn.submit`)}),/* @__PURE__ */ (0,N.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[/* @__PURE__ */ (0,N.jsx)(F,{onOpen:()=>n(`/forgot-password`),children:i(`shell.signIn.forgotPassword`)}),/* @__PURE__ */ (0,N.jsx)(F,{onOpen:()=>n(`/register`),external:!0,children:i(`shell.signIn.createAccount`)})]})]}),t!==void 0&&/* @__PURE__ */ (0,N.jsx)(`div`,{className:`flex justify-center border-t border-stroke-light pt-3.5`,children:t})]})}function F({onOpen:e,external:t=!1,children:n}){return/* @__PURE__ */ (0,N.jsxs)(`a`,{href:`#`,className:`rounded-xs px-0.5 py-1 text-body-sm font-medium text-fg-link no-underline hover:underline hover:underline-offset-3 focus-visible:outline-2 focus-visible:outline-stroke-focus`,onClick:t=>{t.preventDefault(),e()},children:[n,t&&/* @__PURE__ */ (0,N.jsx)(O,{"aria-hidden":`true`,className:`ml-0.75 inline size-3 align-[-1px]`})]})}function se(e){return e instanceof h&&e.status!==0?{kind:`refused`,message:s(t,e,`shell.signIn.refused`)}:(ae.error(`pgm-53794f16d4`,{error:e instanceof Error?e.message:String(e)}),{kind:`noAnswer`})}function ce({user:e,project:t,children:n}){let{id:r,number:i}=t,a=(0,M.useMemo)(()=>({projectId:r,projectNumber:i,user:e}),[r,i,e]);return/* @__PURE__ */ (0,N.jsx)(o,{value:a,children:n})}function le({label:e,loadingLabel:t,loading:n,onLoadMore:r,className:a,"data-testid":o}){return/* @__PURE__ */ (0,N.jsx)(`button`,{type:`button`,onClick:r,disabled:n,"aria-busy":n||void 0,"data-testid":o,className:i(`flex h-9 w-full items-center justify-center gap-2 rounded-md border border-dashed border-stroke-hover bg-transparent text-(length:--text-body-sm) font-medium text-fg-secondary transition-colors duration-(--motion-short) ease-out hover-enabled:border-solid hover-enabled:bg-surface-hover-layer hover-enabled:text-fg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-stroke-focus aria-busy:cursor-progress`,a),children:n?/* @__PURE__ */ (0,N.jsxs)(N.Fragment,{children:[/* @__PURE__ */ (0,N.jsx)(u,{}),t]}):e})}var I=6e4,L=Date.now(),R=/* @__PURE__ */ new Set,z;function B(e){return R.add(e),z===void 0&&(L=Date.now(),z=setInterval(()=>{L=Date.now(),R.forEach(e=>e())},I)),()=>{R.delete(e),R.size===0&&z!==void 0&&(clearInterval(z),z=void 0)}}function V(){return L}function H(){return(0,M.useSyncExternalStore)(B,V,V)}var U=`relative inline-block shrink-0 rounded-full bg-surface-active-layer shadow-[inset_0_0_0_1px_var(--color-border-hairline)] [transition:background-color_var(--motion-short)_var(--ease-out)] peer-checked:bg-primary after:absolute after:rounded-full after:bg-toggle-thumb after:shadow-toggle-thumb after:content-[''] after:[transition:translate_var(--motion-short)_var(--ease-out)]`,W=`peer-checked:bg-primary/40`,ue={md:`h-5 w-9 after:top-0.75 after:left-0.75 after:size-3.5 peer-checked:after:translate-x-4`,sm:`h-3.75 w-6.5 after:top-0.5 after:left-0.5 after:size-2.75 peer-checked:after:translate-x-2.75`},de={md:`peer-checked:*:translate-x-4`,sm:`peer-checked:*:translate-x-2.75`},fe={md:`top-0.75 left-0.75 size-3.5 [&>[data-slot=spinner]]:size-2.5`,sm:`top-0.5 left-0.5 size-2.75 [&>[data-slot=spinner]]:size-2 [&>[data-slot=spinner]]:border`},pe={md:`peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-stroke-focus`,sm:``},me={md:`gap-2.5 text-body-sm text-fg-primary`,sm:`h-8 gap-2 rounded-full px-2.5 text-xs font-medium text-fg-secondary [transition:background-color_var(--motion-short)_var(--ease-out)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-stroke-focus`},he={md:``,sm:`hover:bg-surface-hover-layer`};function G({checked:e,onChange:t,disabled:n=!1,saving:r=!1,muted:a=!1,size:o=`md`,id:s,className:c,label:l,"aria-label":d,"aria-describedby":f,"data-testid":p,...m}){let h=n||r;return/* @__PURE__ */ (0,N.jsxs)(`label`,{...m,className:i(`relative inline-flex select-none items-center`,me[o],n?`cursor-not-allowed opacity-disabled`:r?`cursor-progress`:i(`cursor-pointer`,he[o]),c),children:[/* @__PURE__ */ (0,N.jsx)(`input`,{type:`checkbox`,role:`switch`,id:s,checked:e,"aria-checked":e,disabled:h,"aria-busy":r||void 0,"aria-label":d,"aria-describedby":f,"data-testid":p,onChange:e=>t(e.target.checked),className:`peer sr-only`}),/* @__PURE__ */ (0,N.jsx)(`span`,{"aria-hidden":`true`,className:i(U,ue[o],pe[o],a&&W,r&&de[o]),children:r&&/* @__PURE__ */ (0,N.jsx)(`span`,{className:i(`absolute z-1 grid place-items-center text-(--color-primary-text) [transition:translate_var(--motion-short)_var(--ease-out)]`,fe[o]),children:/* @__PURE__ */ (0,N.jsx)(u,{})})}),l]})}function ge({hint:e,ref:t,...n}){return e===void 0?/* @__PURE__ */ (0,N.jsx)(G,{...n,ref:t}):/* @__PURE__ */ (0,N.jsx)(f,{relationship:`description`,content:e,children:/* @__PURE__ */ (0,N.jsx)(G,{...n,ref:t})})}S({maxEdgePx:T().int().min(1),patchPx:T().int().min(1).nullable(),maxPatches:T().int().min(1).nullable()}).refine(e=>e.patchPx===null==(e.maxPatches===null),{message:`patchPx and maxPatches are null together`});var _e=S({width:T().int().min(1),height:T().int().min(1)});function ve(e,t){return Math.ceil(e.width/t.patchPx)*Math.ceil(e.height/t.patchPx)}var K=y([`image/png`,`image/jpeg`,`image/webp`,`application/pdf`,`text/plain`,`text/markdown`]),ye=[`image/png`,`image/jpeg`,`image/webp`],be=[`text/plain`,`text/markdown`];function q(e){return ye.includes(e)}function xe(e){return be.includes(e)}var Se={"image/png":5e7,"image/jpeg":5e7,"image/webp":5e7,"application/pdf":5e7,"text/plain":4e6,"text/markdown":4e6},Ce=_e,we=y([`pending`,`sent`]),Te=S({id:b(),projectId:b(),fileName:C().min(1).max(255),mediaType:K,byteSize:T().int().min(1),pageCount:T().int().min(1).nullable(),image:Ce.nullable(),state:we,createdAt:x()}).strict().superRefine((e,t)=>{e.mediaType===`application/pdf`!=(e.pageCount!==null)&&t.addIssue({code:`custom`,message:`pageCount is set exactly for application/pdf`,path:[`pageCount`]}),q(e.mediaType)!==(e.image!==null)&&t.addIssue({code:`custom`,message:`image is set exactly for an image media type`,path:[`image`]})}),Ee=y([`media_type`,`file_bytes`,`image_bytes`,`image_edge`,`image_patches`,`pdf_pages`,`request_bytes`,`files_bytes`,`images_count`,`many_images_edge`,`context_window`]),De=S({requestMaxBytes:T().int().min(1).nullable(),fileMaxBytes:T().int().min(1).nullable(),filesMaxBytesPerRequest:T().int().min(1).nullable(),imageMaxBase64Bytes:T().int().min(1).nullable(),imageMaxEdgePx:T().int().min(1).nullable(),imageMaxPatches:S({patchPx:T().int().min(1),maxPatches:T().int().min(1)}).nullable(),manyImages:S({over:T().int().min(1),maxEdgePx:T().int().min(1)}).nullable(),imagesMaxPerRequest:T().int().min(1).nullable(),pdfMaxPagesPerRequest:T().int().min(1).nullable()}),Oe=S({mediaTypes:v(K).min(1),facts:De}).nullable();function ke(e){return 4*Math.ceil(e/3)}function Ae(e,t){let n=J(e,t);if(!n.ok||t===null)return n;if(e.mediaType===`application/pdf`){if(e.pageCount===null)throw Error(`checkAttachmentFitsModel: an application/pdf attachment has no page count`);let{pdfMaxPagesPerRequest:n}=t.facts;if(n!==null&&e.pageCount>n)return{ok:!1,fact:`pdf_pages`}}return{ok:!0}}function J(e,t){if(t===null||!t.mediaTypes.includes(e.mediaType))return{ok:!1,fact:`media_type`};let{facts:n}=t,r=q(e.mediaType),i=ke(e.byteSize);if(!r&&n.fileMaxBytes!==null&&e.byteSize>n.fileMaxBytes)return{ok:!1,fact:`file_bytes`};if(r&&n.imageMaxBase64Bytes!==null&&i>n.imageMaxBase64Bytes)return{ok:!1,fact:`image_bytes`};if(n.requestMaxBytes!==null&&i>n.requestMaxBytes)return{ok:!1,fact:`request_bytes`};if(r){let{image:t}=e;if(t===null)throw Error(`checkAttachmentFitsModel: an ${e.mediaType} attachment has no image size`);if(n.imageMaxEdgePx!==null&&Math.max(t.width,t.height)>n.imageMaxEdgePx)return{ok:!1,fact:`image_edge`};let r=n.imageMaxPatches;if(r!==null&&ve(t,r)>r.maxPatches)return{ok:!1,fact:`image_patches`}}return{ok:!0}}var je={invalidFileName:`chat_attachments.invalid_file_name`,emptyFile:`chat_attachments.empty_file`,contentMismatch:`chat_attachments.content_mismatch`,textNotUtf8:`chat_attachments.text_not_utf8`,pdfEncrypted:`chat_attachments.pdf_encrypted`,pdfUnreadable:`chat_attachments.pdf_unreadable`,imageUnreadable:`chat_attachments.image_unreadable`,notFound:`chat_attachments.not_found`,alreadySent:`chat_attachments.already_sent`,unsupportedByModel:`chat_attachments.unsupported_by_model`};S({declared:K}).strict(),S({attachmentIds:v(b()).min(1)}).strict();var Me=S({modelId:C().min(1),attachmentIds:v(b()).min(1),fact:Ee,factValue:T().nullable()}).strict(),Y=e=>encodeURIComponent(e);function X(e,t){let n=t.toString();return n===``?e:`${e}?${n}`}var Z={conversationList:{method:`GET`,path:e=>{let t=new URLSearchParams;return t.set(`projectId`,e.projectId),t.set(`limit`,String(e.limit)),e.cursor!==null&&t.set(`cursor`,e.cursor),e.search!==null&&t.set(`search`,e.search),X(`/assistant/conversations`,t)}},conversationCreate:{method:`POST`,path:()=>`/assistant/conversations`},conversationDelete:{method:`DELETE`,path:e=>`/assistant/conversations/${Y(e)}`},conversationPermissionMode:{method:`PATCH`,path:e=>`/assistant/conversations/${Y(e)}`},lastPermissionModeRead:{method:`GET`,path:()=>`/assistant/permission-mode`},lastPermissionModeWrite:{method:`PATCH`,path:()=>`/assistant/permission-mode`},conversationMessages:{method:`GET`,path:(e,t)=>{let n=new URLSearchParams({limit:String(t.limit)});switch(t.mode){case`latest`:n.set(`latest`,`true`),t.decisionLaneId!==null&&n.set(`decisionLaneId`,t.decisionLaneId),t.outstandingCallIds.length>0&&n.set(`outstandingCallIds`,t.outstandingCallIds.join(`,`));break;case`before`:n.set(`before`,t.olderCursor);break;case`offset`:n.set(`offset`,String(t.offset))}return X(`/assistant/conversations/${Y(e)}/messages`,n)}},browserApiHostActionResolve:{method:`POST`,path:(e,t)=>`/assistant/conversations/${Y(e)}/host-actions/${Y(t)}/resolve`},browserApiHostActionPersist:{method:`POST`,path:(e,t)=>`/assistant/conversations/${Y(e)}/host-actions/${Y(t)}/persist`},hostActionRefusal:{method:`POST`,path:(e,t)=>`/assistant/conversations/${Y(e)}/host-actions/${Y(t)}/refusal`},availableModels:{method:`GET`,path:()=>`/ai-settings/available-models`},subscription:{method:`GET`,path:()=>`/subscription`},aiSettingsUser:{method:`GET`,path:()=>`/ai-settings/user`},agentList:{method:`GET`,path:e=>X(`/agents`,new URLSearchParams({limit:String(e.limit),offset:String(e.offset)}))},myLiveBrowserTasks:{method:`GET`,path:(e,t)=>X(`/test-runs`,new URLSearchParams({projectId:e,assignedToMe:`true`,launchKind:`preset`,status:`in_progress`,executor:`browser`,limit:String(t.limit),offset:String(t.offset)}))},workflowCancel:{method:`POST`,path:e=>`/workflows/${Y(e)}/cancel`},attachmentUpload:{method:`POST`,path:(e,t)=>`/assistant/projects/${Y(e)}/attachments?fileName=${encodeURIComponent(t)}`},attachmentDelete:{method:`DELETE`,path:e=>`/assistant/attachments/${Y(e)}`},attachmentContent:{method:`GET`,path:e=>`/assistant/attachments/${Y(e)}/content`},changeSetSnapshot:{method:`GET`,path:(e,t)=>`/assistant/projects/${Y(e)}/change-sets/${Y(t)}`},changeSetCommand:{method:`POST`,path:(e,t,n)=>`/assistant/projects/${Y(e)}/change-sets/${Y(t)}/${n}`},changeSetUndo:{method:`POST`,path:e=>`/assistant/change-sets/${Y(e)}/undo`},changeSetSecretValue:{method:`POST`,path:(e,t,n)=>`/assistant/projects/${Y(e)}/change-sets/${Y(t)}/items/${Y(n)}/secret-value`},currentUser:{method:`GET`,path:()=>`/auth/me`},agentJobStatus:{method:`GET`,path:e=>`/agent-jobs/${Y(e)}/status`},agentJobCommand:{method:`POST`,path:(e,t)=>`/agent-jobs/${Y(e)}/${t}`},scenarioSteps:{method:`GET`,path:(e,t)=>X(`/scenarios/${Y(e)}/steps`,new URLSearchParams({limit:String(t.limit),offset:String(t.offset)}))},scenarioRuns:{method:`GET`,path:(e,t)=>X(`/scenario-runs/scenario/${Y(e)}`,new URLSearchParams({limit:String(t.limit),offset:String(t.offset),includeOutdated:`true`}))},searchPage:{method:`GET`,path:(e,t,n)=>{let r=new URLSearchParams;r.set(`q`,t.query);for(let e of t.entityTypes)r.append(`entityTypes`,e);return r.set(`limit`,String(n.limit)),r.set(`cursor`,n.cursor),X(`/assistant/projects/${Y(e)}/search`,r)}}};function Q(e){return e.selectable&&e.sendable}var Ne=[`fastest`,`balanced`,`smartest`],Pe=[`managed`,`company`,`personal`],Fe=S({id:C().min(1),name:C(),selectionId:C().min(1),selectable:w(),sendable:w(),disabledReason:y([`key_invalid`,`no_key`]).nullable(),tier:C(),reasoning:w(),attachments:Oe}),Ie=S({defaultSelectionId:C().nullable(),policyVersion:C(),providers:v(S({type:C(),models:v(Fe)}))}),Le=S({plan:C()});function $(e){return Pe.includes(e)}function Re(e){return Ne.includes(e)}var ze=[`Claude `,`Anthropic `];function Be(e){for(let t of ze)if(e.startsWith(t)){let n=e.slice(t.length).trim();if(n!==``)return n}return e}function Ve(e,t){let n=/* @__PURE__ */ new Map,r=[],i=[];for(let t of e.providers){if(!$(t.type)){r.push({type:t.type,modelIds:t.models.map(e=>e.id)});continue}let e=t.type,a=t.models.flatMap(t=>Re(t.tier)?[{id:t.id,name:t.name,shortName:Be(t.name),selectionId:t.selectionId,selectable:t.selectable,sendable:t.sendable,disabledReason:t.disabledReason,tier:t.tier,reasoning:t.reasoning,attachments:t.attachments}]:(i.push({type:e,modelId:t.id,tier:t.tier}),[]));if(a.length===0)continue;let o=n.get(e);n.set(e,o===void 0?{source:e,models:a}:{...o,models:[...o.models,...a]})}return(r.length>0||i.length>0)&&t.warn(`available-models: wire values outside the client contract were dropped`,{policyVersion:e.policyVersion,droppedBuckets:r,droppedModels:i}),{groups:[...n.values()],defaultSelectionId:e.defaultSelectionId}}function He(e,t){let n=e.groups.find(e=>e.source===t.keySource);if(n===void 0)return null;let r=n.models.find(e=>e.id===t.modelId);return r===void 0||!Q(r)?null:r.selectionId}function Ue(e,t,n){let{groups:r,defaultSelectionId:i}=e,a=e=>{for(let t of r){let n=t.models.find(t=>t.selectionId===e);if(n!==void 0)return{model:n,source:t.source}}return null};if(t!==null){let e=a(t);if(e!==null)return e}if(n!==null){let e=r.find(e=>e.source===n.provider),t=e==null?void 0:e.models.find(e=>e.id===n.model);if(e!==void 0&&t!==void 0)return{model:t,source:e.source}}if(i!==null){let e=a(i);if(e!==null&&Q(e.model))return e}return null}function We(e){let{http:t,logger:n}=e;return{async load(){let[e,r]=await Promise.all([t.request({method:Z.availableModels.method,path:Z.availableModels.path(),schema:Ie}),t.request({method:Z.subscription.method,path:Z.subscription.path(),schema:Le})]),i=Ve(e,n);return{groups:i.groups,defaultSelectionId:i.defaultSelectionId,isEnterprise:r.plan===`enterprise`}}}}var Ge=class extends Error{constructor(e){super(e.message),this.name=`ChatHttpError`,this.status=e.status,this.errorCode=e.errorCode,this.params=e.params}};export{k as C,D,O as E,E as O,A as S,te as T,le as _,He as a,P as b,Se as c,Ae as d,J as f,H as g,ge as h,Q as i,Te as l,xe as m,We as n,Z as o,q as p,Ue as r,je as s,Ge as t,Me as u,ce as v,ne as w,j as x,oe as y};
@@ -0,0 +1,98 @@
1
+ Object.freeze({status:`aborted`});function e(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:/* @__PURE__ */ new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=(n==null?void 0:n.Parent)??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n!=null&&n.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>{var r;return n!=null&&n.Parent&&t instanceof n.Parent?!0:t==null||(r=t._zod)==null||(r=r.traits)==null?void 0:r.has(e)}}),Object.defineProperty(o,"name",{value:e}),o}var t=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},n=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},r={};function i(e){return e&&Object.assign(r,e),r}function a(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function o(e,t){return typeof t==`bigint`?t.toString():t}function s(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function c(e){return e==null}function l(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function u(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e!=null&&e[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var ee=Symbol(`evaluating`);function d(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ee)return r===void 0&&(r=ee,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function f(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function p(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function te(e){return JSON.stringify(e)}function ne(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var re=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ae=s(()=>{var e;if(typeof navigator<`u`&&(e=navigator)!=null&&(e=e.userAgent)!=null&&e.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function oe(e){if(ie(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ie(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function se(e){return oe(e)?{...e}:Array.isArray(e)?[...e]:e}var ce=/* @__PURE__ */ new Set([`string`,`number`,`symbol`]),le=/* @__PURE__ */ new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function m(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function h(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function g(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ue(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var de={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function fe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return h(e,p(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return f(this,`shape`,e),e},checks:[]}))}function pe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return h(e,p(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return f(this,`shape`,r),r},checks:[]}))}function me(e,t){if(!oe(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return h(e,p(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return f(this,`shape`,n),n}}))}function he(e,t){if(!oe(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return h(e,p(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return f(this,`shape`,n),n}}))}function ge(e,t){return h(e,p(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return f(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function _e(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return h(t,p(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return f(this,`shape`,i),i},checks:[]}))}function ve(e,t,n){return h(t,p(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return f(this,`shape`,i),i}}))}function _(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++){var n;if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0}return!1}function v(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ye(e){return typeof e==`string`?e:e==null?void 0:e.message}function y(e,t,n){let r={...e,path:e.path??[]};if(!e.message){var i,a,o,s,c;r.message=ye((i=e.inst)==null||(i=i._zod.def)==null||(a=i.error)==null?void 0:a.call(i,e))??ye(t==null||(o=t.error)==null?void 0:o.call(t,e))??ye((s=n.customError)==null?void 0:s.call(n,e))??ye((c=n.localeError)==null?void 0:c.call(n,e))??`Invalid input`}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function be(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function xe(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Se=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,o,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ce=e(`$ZodError`,Se),we=e(`$ZodError`,Se,{Parent:Error});function Te(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ee(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var De=e=>(n,r,a,o)=>{let s=a?Object.assign(a,{async:!1}):{async:!1},c=n._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new t;if(c.issues.length){let t=new((o==null?void 0:o.Err)??e)(c.issues.map(e=>y(e,s,i())));throw re(t,o==null?void 0:o.callee),t}return c.value},Oe=e=>async(t,n,r,a)=>{let o=r?Object.assign(r,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new((a==null?void 0:a.Err)??e)(s.issues.map(e=>y(e,o,i())));throw re(t,a==null?void 0:a.callee),t}return s.value},ke=e=>(n,r,a)=>{let o=a?{...a,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new t;return s.issues.length?{success:!1,error:new(e??Ce)(s.issues.map(e=>y(e,o,i())))}:{success:!0,data:s.value}},Ae=/* @__PURE__*/ ke(we),je=e=>async(t,n,r)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>y(e,a,i())))}:{success:!0,data:o.value}},Me=/* @__PURE__*/ je(we),Ne=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return De(e)(t,n,i)},Pe=e=>(t,n,r)=>De(e)(t,n,r),Fe=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Oe(e)(t,n,i)},Ie=e=>async(t,n,r)=>Oe(e)(t,n,r),Le=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ke(e)(t,n,i)},Re=e=>(t,n,r)=>ke(e)(t,n,r),ze=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return je(e)(t,n,i)},Be=e=>async(t,n,r)=>je(e)(t,n,r),Ve=/^[cC][^\s-]{8,}$/,He=/^[0-9a-z]+$/,Ue=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,We=/^[0-9a-vA-V]{20}$/,Ge=/^[A-Za-z0-9]{27}$/,Ke=/^[a-zA-Z0-9_-]{21}$/,qe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Je=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ye=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Xe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ze=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Qe(){return new RegExp(Ze,`u`)}var $e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,et=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,tt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,nt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,it=/^[A-Za-z0-9_-]*$/,at=/^\+[1-9]\d{6,14}$/,ot=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,st=/*@__PURE__*/ RegExp(`^${ot}$`);function ct(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function lt(e){return RegExp(`^${ct(e)}$`)}function ut(e){let t=ct({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${ot}T(?:${r})$`)}var dt=e=>{let t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},ft=/^-?\d+n?$/,pt=/^-?\d+$/,mt=/^-?\d+(?:\.\d+)?$/,ht=/^(?:true|false)$/i,gt=/^null$/i,_t=/^[^A-Z]*$/,vt=/^[^a-z]*$/,b=/*@__PURE__*/ e(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),yt={number:`number`,bigint:`bigint`,object:`date`},bt=/*@__PURE__*/ e(`$ZodCheckLessThan`,(e,t)=>{b.init(e,t);let n=yt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xt=/*@__PURE__*/ e(`$ZodCheckGreaterThan`,(e,t)=>{b.init(e,t);let n=yt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),St=/*@__PURE__*/ e(`$ZodCheckMultipleOf`,(e,t)=>{b.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):u(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ct=/*@__PURE__*/ e(`$ZodCheckNumberFormat`,(e,t)=>{var n;b.init(e,t),t.format=t.format||`float64`;let r=(n=t.format)==null?void 0:n.includes(`int`),i=r?`int`:`number`,[a,o]=de[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=a,n.maximum=o,r&&(n.pattern=pt)}),e._zod.check=n=>{let s=n.value;if(r){if(!Number.isInteger(s)){n.issues.push({expected:i,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?n.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:i,inclusive:!0,continue:!t.abort}):n.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}s<a&&n.issues.push({origin:`number`,input:s,code:`too_small`,minimum:a,inclusive:!0,inst:e,continue:!t.abort}),s>o&&n.issues.push({origin:`number`,input:s,code:`too_big`,maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),wt=/*@__PURE__*/ e(`$ZodCheckMaxLength`,(e,t)=>{var n;b.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!c(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=be(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Tt=/*@__PURE__*/ e(`$ZodCheckMinLength`,(e,t)=>{var n;b.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!c(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=be(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Et=/*@__PURE__*/ e(`$ZodCheckLengthEquals`,(e,t)=>{var n;b.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!c(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=be(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Dt=/*@__PURE__*/ e(`$ZodCheckStringFormat`,(e,t)=>{var n,r;b.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=/* @__PURE__ */ new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ot=/*@__PURE__*/ e(`$ZodCheckRegex`,(e,t)=>{Dt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),kt=/*@__PURE__*/ e(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=_t,Dt.init(e,t)}),At=/*@__PURE__*/ e(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=vt,Dt.init(e,t)}),jt=/*@__PURE__*/ e(`$ZodCheckIncludes`,(e,t)=>{b.init(e,t);let n=m(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=/* @__PURE__ */ new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Mt=/*@__PURE__*/ e(`$ZodCheckStartsWith`,(e,t)=>{b.init(e,t);let n=RegExp(`^${m(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=/* @__PURE__ */ new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Nt=/*@__PURE__*/ e(`$ZodCheckEndsWith`,(e,t)=>{b.init(e,t);let n=RegExp(`.*${m(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=/* @__PURE__ */ new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Pt=/*@__PURE__*/ e(`$ZodCheckOverwrite`,(e,t)=>{b.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Ft=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
2
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){var e,t;let n=Function,r=(e=this)==null?void 0:e.args,i=[...(((t=this)==null?void 0:t.content)??[``]).map(e=>` ${e}`)];return new n(...r,i.join(`
3
+ `))}},It={major:4,minor:3,patch:6},x=/*@__PURE__*/ e(`$ZodType`,(e,n)=>{var r;e??={},e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=It;let i=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&i.unshift(e);for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0){var a;(r=e._zod).deferred??(r.deferred=[]),(a=e._zod.deferred)==null||a.push(()=>{e._zod.run=e._zod.parse})}else{let n=(e,n,r)=>{let i=_(e),a;for(let o of n){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(i)continue;let n=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&(r==null?void 0:r.async)===!1)throw new t;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,e.issues.length!==n&&(i||=_(e,n))});else{if(e.issues.length===n)continue;i||=_(e,n)}}return a?a.then(()=>e):e},r=(r,a,o)=>{if(_(r))return r.aborted=!0,r;let s=n(a,i,o);if(s instanceof Promise){if(o.async===!1)throw new t;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if(o.direction===`backward`){let t=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,o)):r(t,a,o)}let s=e._zod.parse(a,o);if(s instanceof Promise){if(o.async===!1)throw new t;return s.then(e=>n(e,i,o))}return n(s,i,o)}}d(e,`~standard`,()=>({validate:t=>{try{var n;let r=Ae(e,t);return r.success?{value:r.data}:{issues:(n=r.error)==null?void 0:n.issues}}catch{return Me(e,t).then(e=>{var t;return e.success?{value:e.data}:{issues:(t=e.error)==null?void 0:t.issues}})}},vendor:`zod`,version:1}))}),Lt=/*@__PURE__*/ e(`$ZodString`,(e,t)=>{var n;x.init(e,t),e._zod.pattern=[...(e==null||(n=e._zod.bag)==null?void 0:n.patterns)??[]].pop()??dt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),S=/*@__PURE__*/ e(`$ZodStringFormat`,(e,t)=>{Dt.init(e,t),Lt.init(e,t)}),Rt=/*@__PURE__*/ e(`$ZodGUID`,(e,t)=>{t.pattern??=Je,S.init(e,t)}),zt=/*@__PURE__*/ e(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ye(e)}else t.pattern??=Ye();S.init(e,t)}),Bt=/*@__PURE__*/ e(`$ZodEmail`,(e,t)=>{t.pattern??=Xe,S.init(e,t)}),Vt=/*@__PURE__*/ e(`$ZodURL`,(e,t)=>{S.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ht=/*@__PURE__*/ e(`$ZodEmoji`,(e,t)=>{t.pattern??=Qe(),S.init(e,t)}),Ut=/*@__PURE__*/ e(`$ZodNanoID`,(e,t)=>{t.pattern??=Ke,S.init(e,t)}),Wt=/*@__PURE__*/ e(`$ZodCUID`,(e,t)=>{t.pattern??=Ve,S.init(e,t)}),Gt=/*@__PURE__*/ e(`$ZodCUID2`,(e,t)=>{t.pattern??=He,S.init(e,t)}),Kt=/*@__PURE__*/ e(`$ZodULID`,(e,t)=>{t.pattern??=Ue,S.init(e,t)}),qt=/*@__PURE__*/ e(`$ZodXID`,(e,t)=>{t.pattern??=We,S.init(e,t)}),Jt=/*@__PURE__*/ e(`$ZodKSUID`,(e,t)=>{t.pattern??=Ge,S.init(e,t)}),Yt=/*@__PURE__*/ e(`$ZodISODateTime`,(e,t)=>{t.pattern??=ut(t),S.init(e,t)}),Xt=/*@__PURE__*/ e(`$ZodISODate`,(e,t)=>{t.pattern??=st,S.init(e,t)}),Zt=/*@__PURE__*/ e(`$ZodISOTime`,(e,t)=>{t.pattern??=lt(t),S.init(e,t)}),Qt=/*@__PURE__*/ e(`$ZodISODuration`,(e,t)=>{t.pattern??=qe,S.init(e,t)}),$t=/*@__PURE__*/ e(`$ZodIPv4`,(e,t)=>{t.pattern??=$e,S.init(e,t),e._zod.bag.format=`ipv4`}),en=/*@__PURE__*/ e(`$ZodIPv6`,(e,t)=>{t.pattern??=et,S.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),tn=/*@__PURE__*/ e(`$ZodCIDRv4`,(e,t)=>{t.pattern??=tt,S.init(e,t)}),nn=/*@__PURE__*/ e(`$ZodCIDRv6`,(e,t)=>{t.pattern??=nt,S.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function rn(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var an=/*@__PURE__*/ e(`$ZodBase64`,(e,t)=>{t.pattern??=rt,S.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{rn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function on(e){if(!it.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return rn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var sn=/*@__PURE__*/ e(`$ZodBase64URL`,(e,t)=>{t.pattern??=it,S.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{on(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),cn=/*@__PURE__*/ e(`$ZodE164`,(e,t)=>{t.pattern??=at,S.init(e,t)});function ln(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&(i==null?void 0:i.typ)!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var un=/*@__PURE__*/ e(`$ZodJWT`,(e,t)=>{S.init(e,t),e._zod.check=n=>{ln(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),dn=/*@__PURE__*/ e(`$ZodNumber`,(e,t)=>{x.init(e,t),e._zod.pattern=e._zod.bag.pattern??mt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),fn=/*@__PURE__*/ e(`$ZodNumberFormat`,(e,t)=>{Ct.init(e,t),dn.init(e,t)}),pn=/*@__PURE__*/ e(`$ZodBoolean`,(e,t)=>{x.init(e,t),e._zod.pattern=ht,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),mn=/*@__PURE__*/ e(`$ZodBigInt`,(e,t)=>{x.init(e,t),e._zod.pattern=ft,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),hn=/*@__PURE__*/ e(`$ZodNull`,(e,t)=>{x.init(e,t),e._zod.pattern=gt,e._zod.values=/* @__PURE__ */ new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),gn=/*@__PURE__*/ e(`$ZodUnknown`,(e,t)=>{x.init(e,t),e._zod.parse=e=>e}),_n=/*@__PURE__*/ e(`$ZodNever`,(e,t)=>{x.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function vn(e,t,n){e.issues.length&&t.issues.push(...v(n,e.issues)),t.value[n]=e.value}var yn=/*@__PURE__*/ e(`$ZodArray`,(e,t)=>{x.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>vn(t,n,e))):vn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function bn(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...v(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function xn(e){let t=Object.keys(e.shape);for(let r of t){var n;if(!((n=e.shape)!=null&&(n=n[r])!=null&&(n=n._zod)!=null&&(n=n.traits)!=null&&n.has(`$ZodType`)))throw Error(`Invalid element at key "${r}": expected a Zod schema`)}let r=ue(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Sn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>bn(e,n,i,t,u))):bn(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Cn=/*@__PURE__*/ e(`$ZodObject`,(e,t)=>{x.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`);if(!(n!=null&&n.get)){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let r=s(()=>xn(t));d(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=/* @__PURE__ */ new Set);for(let e of r.values)n[t].add(e)}}return n});let i=ie,a=t.catchall,o;e._zod.parse=(t,n)=>{o??=r.value;let s=t.value;if(!i(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=o.shape;for(let e of o.keys){let r=l[e],i=r._zod.optout===`optional`,a=r._zod.run({value:s[e],issues:[]},n);a instanceof Promise?c.push(a.then(n=>bn(n,t,e,s,i))):bn(a,t,e,s,i)}return a?Sn(c,s,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),wn=/*@__PURE__*/ e(`$ZodObjectJIT`,(e,t)=>{Cn.init(e,t);let n=e._zod.parse,i=s(()=>xn(t)),a=e=>{let t=new Ft([`shape`,`payload`,`ctx`]),n=i.value,r=e=>{let t=te(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let i of n.keys){var s;let n=a[i],o=te(i),c=e[i],l=(c==null||(s=c._zod)==null?void 0:s.optout)===`optional`;t.write(`const ${n} = ${r(i)};`),l?t.write(`
4
+ if (${n}.issues.length) {
5
+ if (${o} in input) {
6
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
7
+ ...iss,
8
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
9
+ })));
10
+ }
11
+ }
12
+
13
+ if (${n}.value === undefined) {
14
+ if (${o} in input) {
15
+ newResult[${o}] = undefined;
16
+ }
17
+ } else {
18
+ newResult[${o}] = ${n}.value;
19
+ }
20
+
21
+ `):t.write(`
22
+ if (${n}.issues.length) {
23
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
24
+ ...iss,
25
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
26
+ })));
27
+ }
28
+
29
+ if (${n}.value === undefined) {
30
+ if (${o} in input) {
31
+ newResult[${o}] = undefined;
32
+ }
33
+ } else {
34
+ newResult[${o}] = ${n}.value;
35
+ }
36
+
37
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let c=t.compile();return(t,n)=>c(e,t,n)},o,c=ie,l=!r.jitless,u=l&&ae.value,ee=t.catchall,d;e._zod.parse=(r,s)=>{d??=i.value;let f=r.value;return c(f)?l&&u&&(s==null?void 0:s.async)===!1&&s.jitless!==!0?(o||=a(t.shape),r=o(r,s),ee?Sn([],f,r,s,d,e):r):n(r,s):(r.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),r)}});function Tn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let a=e.filter(e=>!_(e));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>y(e,r,i())))}),t)}var En=/*@__PURE__*/ e(`$ZodUnion`,(e,t)=>{x.init(e,t),d(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),d(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),d(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),d(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>l(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Tn(t,i,e,a)):Tn(s,i,e,a)}}),Dn=/*@__PURE__*/ e(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,En.init(e,t);let n=e._zod.parse;d(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=/* @__PURE__ */ new Set);for(let r of n)e[t].add(r)}}return e});let r=s(()=>{let e=t.options,n=/* @__PURE__ */ new Map;for(let i of e){var r;let e=(r=i._zod.propValues)==null?void 0:r[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,i)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ie(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o==null?void 0:o[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),On=/*@__PURE__*/ e(`$ZodIntersection`,(e,t)=>{x.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>An(e,t,n)):An(e,i,a)}});function kn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(oe(e)&&oe(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=kn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=kn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function An(e,t,n){let r=/* @__PURE__ */ new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),_(e))return e;let o=kn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var jn=/*@__PURE__*/ e(`$ZodTuple`,(e,t)=>{x.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=[...n].reverse().findIndex(e=>e._zod.optin!==`optional`),c=s===-1?0:n.length-s;if(!t.rest){let t=a.length>n.length,i=a.length<c-1;if(t||i)return r.issues.push({...t?{code:`too_big`,maximum:n.length,inclusive:!0}:{code:`too_small`,minimum:n.length},input:a,inst:e,origin:`array`}),r}let l=-1;for(let e of n){if(l++,l>=a.length&&l>=c)continue;let t=e._zod.run({value:a[l],issues:[]},i);t instanceof Promise?o.push(t.then(e=>Mn(e,r,l))):Mn(t,r,l)}if(t.rest){let e=a.slice(n.length);for(let n of e){l++;let e=t.rest._zod.run({value:n,issues:[]},i);e instanceof Promise?o.push(e.then(e=>Mn(e,r,l))):Mn(e,r,l)}}return o.length?Promise.all(o).then(()=>r):r}});function Mn(e,t,n){e.issues.length&&t.issues.push(...v(n,e.issues)),t.value[n]=e.value}var Nn=/*@__PURE__*/ e(`$ZodRecord`,(e,t)=>{x.init(e,t),e._zod.parse=(n,r)=>{let a=n.value;if(!oe(a))return n.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),n;let o=[],s=t.keyType._zod.values;if(s){n.value={};let i=/* @__PURE__ */ new Set;for(let e of s)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){i.add(typeof e==`number`?e.toString():e);let s=t.valueType._zod.run({value:a[e],issues:[]},r);s instanceof Promise?o.push(s.then(t=>{t.issues.length&&n.issues.push(...v(e,t.issues)),n.value[e]=t.value})):(s.issues.length&&n.issues.push(...v(e,s.issues)),n.value[e]=s.value)}let c;for(let e in a)i.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c})}else{n.value={};for(let s of Reflect.ownKeys(a)){if(s===`__proto__`)continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof s==`string`&&mt.test(s)&&c.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(c=e)}if(c.issues.length){t.mode===`loose`?n.value[s]=a[s]:n.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>y(e,r,i())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:a[s],issues:[]},r);l instanceof Promise?o.push(l.then(e=>{e.issues.length&&n.issues.push(...v(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...v(s,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),Pn=/*@__PURE__*/ e(`$ZodEnum`,(e,t)=>{x.init(e,t);let n=a(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ce.has(typeof e)).map(e=>typeof e==`string`?m(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Fn=/*@__PURE__*/ e(`$ZodLiteral`,(e,t)=>{if(x.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?m(e):e?m(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),In=/*@__PURE__*/ e(`$ZodTransform`,(e,r)=>{x.init(e,r),e._zod.parse=(i,a)=>{if(a.direction===`backward`)throw new n(e.constructor.name);let o=r.transform(i.value,i);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(i.value=e,i));if(o instanceof Promise)throw new t;return i.value=o,i}});function Ln(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Rn=/*@__PURE__*/ e(`$ZodOptional`,(e,t)=>{x.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,d(e._zod,`values`,()=>t.innerType._zod.values?/* @__PURE__ */ new Set([...t.innerType._zod.values,void 0]):void 0),d(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${l(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Ln(t,e.value)):Ln(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),zn=/*@__PURE__*/ e(`$ZodExactOptional`,(e,t)=>{Rn.init(e,t),d(e._zod,`values`,()=>t.innerType._zod.values),d(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Bn=/*@__PURE__*/ e(`$ZodNullable`,(e,t)=>{x.init(e,t),d(e._zod,`optin`,()=>t.innerType._zod.optin),d(e._zod,`optout`,()=>t.innerType._zod.optout),d(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${l(e.source)}|null)$`):void 0}),d(e._zod,`values`,()=>t.innerType._zod.values?/* @__PURE__ */ new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Vn=/*@__PURE__*/ e(`$ZodDefault`,(e,t)=>{x.init(e,t),e._zod.optin=`optional`,d(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Hn(e,t)):Hn(r,t)}});function Hn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Un=/*@__PURE__*/ e(`$ZodPrefault`,(e,t)=>{x.init(e,t),e._zod.optin=`optional`,d(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Wn=/*@__PURE__*/ e(`$ZodNonOptional`,(e,t)=>{x.init(e,t),d(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Gn(t,e)):Gn(i,e)}});function Gn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Kn=/*@__PURE__*/ e(`$ZodCatch`,(e,t)=>{x.init(e,t),d(e._zod,`optin`,()=>t.innerType._zod.optin),d(e._zod,`optout`,()=>t.innerType._zod.optout),d(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>y(e,n,i()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>y(e,n,i()))},input:e.value}),e.issues=[]),e)}}),qn=/*@__PURE__*/ e(`$ZodPipe`,(e,t)=>{x.init(e,t),d(e._zod,`values`,()=>t.in._zod.values),d(e._zod,`optin`,()=>t.in._zod.optin),d(e._zod,`optout`,()=>t.out._zod.optout),d(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Jn(e,t.in,n)):Jn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Jn(e,t.out,n)):Jn(r,t.out,n)}});function Jn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Yn=/*@__PURE__*/ e(`$ZodReadonly`,(e,t)=>{x.init(e,t),d(e._zod,`propValues`,()=>t.innerType._zod.propValues),d(e._zod,`values`,()=>t.innerType._zod.values),d(e._zod,`optin`,()=>{var e;return(e=t.innerType)==null||(e=e._zod)==null?void 0:e.optin}),d(e._zod,`optout`,()=>{var e;return(e=t.innerType)==null||(e=e._zod)==null?void 0:e.optout}),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Xn):Xn(r)}});function Xn(e){return e.value=Object.freeze(e.value),e}var Zn=/*@__PURE__*/ e(`$ZodTemplateLiteral`,(e,t)=>{x.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||le.has(typeof e))n.push(m(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),Qn=/*@__PURE__*/ e(`$ZodLazy`,(e,t)=>{x.init(e,t),d(e._zod,`innerType`,()=>t.getter()),d(e._zod,`pattern`,()=>{var t;return(t=e._zod.innerType)==null||(t=t._zod)==null?void 0:t.pattern}),d(e._zod,`propValues`,()=>{var t;return(t=e._zod.innerType)==null||(t=t._zod)==null?void 0:t.propValues}),d(e._zod,`optin`,()=>{var t;return((t=e._zod.innerType)==null||(t=t._zod)==null?void 0:t.optin)??void 0}),d(e._zod,`optout`,()=>{var t;return((t=e._zod.innerType)==null||(t=t._zod)==null?void 0:t.optout)??void 0}),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),$n=/*@__PURE__*/ e(`$ZodCustom`,(e,t)=>{b.init(e,t),x.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>er(t,n,r,e));er(i,n,r,e)}});function er(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(xe(e))}}var tr,nr=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function rr(){return new nr}(tr=globalThis).__zod_globalRegistry??(tr.__zod_globalRegistry=rr());var ir=globalThis.__zod_globalRegistry;// @__NO_SIDE_EFFECTS__
38
+ function ar(e,t){return new e({type:`string`,...g(t)})}// @__NO_SIDE_EFFECTS__
39
+ function or(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
40
+ function sr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
41
+ function cr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
42
+ function lr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...g(t)})}// @__NO_SIDE_EFFECTS__
43
+ function ur(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...g(t)})}// @__NO_SIDE_EFFECTS__
44
+ function dr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...g(t)})}// @__NO_SIDE_EFFECTS__
45
+ function fr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
46
+ function pr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
47
+ function mr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
48
+ function hr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
49
+ function gr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
50
+ function _r(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
51
+ function vr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
52
+ function yr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
53
+ function br(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
54
+ function xr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
55
+ function Sr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
56
+ function Cr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
57
+ function wr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
58
+ function Tr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
59
+ function Er(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
60
+ function Dr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...g(t)})}// @__NO_SIDE_EFFECTS__
61
+ function Or(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...g(t)})}// @__NO_SIDE_EFFECTS__
62
+ function kr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...g(t)})}// @__NO_SIDE_EFFECTS__
63
+ function Ar(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...g(t)})}// @__NO_SIDE_EFFECTS__
64
+ function jr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...g(t)})}// @__NO_SIDE_EFFECTS__
65
+ function Mr(e,t){return new e({type:`number`,checks:[],...g(t)})}// @__NO_SIDE_EFFECTS__
66
+ function Nr(e,t){return new e({type:`number`,coerce:!0,checks:[],...g(t)})}// @__NO_SIDE_EFFECTS__
67
+ function Pr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...g(t)})}// @__NO_SIDE_EFFECTS__
68
+ function Fr(e,t){return new e({type:`boolean`,...g(t)})}// @__NO_SIDE_EFFECTS__
69
+ function Ir(e,t){return new e({type:`bigint`,coerce:!0,...g(t)})}// @__NO_SIDE_EFFECTS__
70
+ function Lr(e,t){return new e({type:`null`,...g(t)})}// @__NO_SIDE_EFFECTS__
71
+ function Rr(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
72
+ function zr(e,t){return new e({type:`never`,...g(t)})}// @__NO_SIDE_EFFECTS__
73
+ function Br(e,t){return new bt({check:`less_than`,...g(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
74
+ function C(e,t){return new bt({check:`less_than`,...g(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
75
+ function Vr(e,t){return new xt({check:`greater_than`,...g(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
76
+ function w(e,t){return new xt({check:`greater_than`,...g(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
77
+ function Hr(e,t){return new St({check:`multiple_of`,...g(t),value:e})}// @__NO_SIDE_EFFECTS__
78
+ function Ur(e,t){return new wt({check:`max_length`,...g(t),maximum:e})}// @__NO_SIDE_EFFECTS__
79
+ function Wr(e,t){return new Tt({check:`min_length`,...g(t),minimum:e})}// @__NO_SIDE_EFFECTS__
80
+ function Gr(e,t){return new Et({check:`length_equals`,...g(t),length:e})}// @__NO_SIDE_EFFECTS__
81
+ function Kr(e,t){return new Ot({check:`string_format`,format:`regex`,...g(t),pattern:e})}// @__NO_SIDE_EFFECTS__
82
+ function qr(e){return new kt({check:`string_format`,format:`lowercase`,...g(e)})}// @__NO_SIDE_EFFECTS__
83
+ function Jr(e){return new At({check:`string_format`,format:`uppercase`,...g(e)})}// @__NO_SIDE_EFFECTS__
84
+ function Yr(e,t){return new jt({check:`string_format`,format:`includes`,...g(t),includes:e})}// @__NO_SIDE_EFFECTS__
85
+ function Xr(e,t){return new Mt({check:`string_format`,format:`starts_with`,...g(t),prefix:e})}// @__NO_SIDE_EFFECTS__
86
+ function Zr(e,t){return new Nt({check:`string_format`,format:`ends_with`,...g(t),suffix:e})}// @__NO_SIDE_EFFECTS__
87
+ function T(e){return new Pt({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
88
+ function Qr(e){return/* @__PURE__ */ T(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
89
+ function $r(){return/* @__PURE__ */ T(e=>e.trim())}// @__NO_SIDE_EFFECTS__
90
+ function ei(){return/* @__PURE__ */ T(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
91
+ function ti(){return/* @__PURE__ */ T(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
92
+ function ni(){return/* @__PURE__ */ T(e=>ne(e))}// @__NO_SIDE_EFFECTS__
93
+ function ri(e,t,n){return new e({type:`array`,element:t,...g(n)})}// @__NO_SIDE_EFFECTS__
94
+ function ii(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...g(n)})}// @__NO_SIDE_EFFECTS__
95
+ function ai(e){let t=/* @__PURE__ */ oi(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(xe(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(xe(r))}},e(n.value,n)));return t}// @__NO_SIDE_EFFECTS__
96
+ function oi(e,t){let n=new b({check:`custom`,...g(t)});return n._zod.check=e,n}function si(e){let t=(e==null?void 0:e.target)??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??ir,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??`throw`,override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??`output`,counter:0,seen:/* @__PURE__ */ new Map,cycles:(e==null?void 0:e.cycles)??`ref`,reused:(e==null?void 0:e.reused)??`inline`,external:(e==null?void 0:e.external)??void 0}}function E(e,t,n={path:[],schemaPath:[]}){var r,i,a;let o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;let c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c);let l=(r=(i=e._zod).toJSONSchema)==null?void 0:r.call(i);if(l)c.schema=l;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,r);else{let n=c.schema,i=t.processors[o.type];if(!i)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,n,r)}let i=e._zod.parent;i&&(c.ref||=i,E(i,t,r),t.seen.get(i).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(c.schema,u),t.io===`input`&&D(e)&&(delete c.schema.examples,delete c.schema.default),t.io===`input`&&c.schema._prefault&&((a=c.schema).default??(a.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function ci(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){var i;let n=(i=e.metadataRegistry.get(t[0]))==null?void 0:i.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let a=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){var i;let n=(i=e.external.registry.get(t[0]))==null?void 0:i.id,a=e.external.uri??(e=>e);if(n)return{ref:a(n)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${a(`__shared`)}#/${r}/${o}`}}if(t[1]===n)return{ref:`#`};let a=`#/${r}/`,o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:a+o}},o=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=a(e);t.def={...t.schema},r&&(t.defId=r);let i=t.schema;for(let e in i)delete i[e];i.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle){var s;throw Error(`Cycle detected: #/${(s=e.cycle)==null?void 0:s.join(`/`)}/<root>
97
+
98
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}}for(let n of e.seen.entries()){var c;let r=n[1];if(t===n[0]){o(n);continue}if(e.external){var l;let r=(l=e.external.registry.get(n[0]))==null?void 0:l.id;if(t!==n[0]&&r){o(n);continue}}if((c=e.metadataRegistry.get(n[0]))!=null&&c.id){o(n);continue}if(r.cycle){o(n);continue}if(r.count>1&&e.reused===`ref`){o(n);continue}}}function li(e,t){var n,r;let i=e.seen.get(t);if(!i)throw Error(`Unprocessed schema. This is a bug in Zod.`);let a=t=>{let n=e.seen.get(t);if(n.ref===null)return;let r=n.def??n.schema,i={...r},o=n.ref;if(n.ref=null,o){a(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(r.allOf=r.allOf??[],r.allOf.push(s)):Object.assign(r,s),Object.assign(r,i),t._zod.parent===o)for(let e in r)e!==`$ref`&&e!==`allOf`&&(e in i||delete r[e]);if(s.$ref&&n.def)for(let e in r)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(r[e])===JSON.stringify(n.def[e])&&delete r[e]}let s=t._zod.parent;if(s&&s!==o){a(s);let t=e.seen.get(s);if(t!=null&&t.schema.$ref&&(r.$ref=t.schema.$ref,t.def))for(let e in r)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(r[e])===JSON.stringify(t.def[e])&&delete r[e]}e.override({zodSchema:t,jsonSchema:r,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())a(t[0]);let o={};if(e.target===`draft-2020-12`?o.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?o.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?o.$schema=`http://json-schema.org/draft-04/schema#`:e.target,(n=e.external)!=null&&n.uri){var s;let n=(s=e.external.registry.get(t))==null?void 0:s.id;if(!n)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(n)}Object.assign(o,i.def??i.schema);let c=((r=e.external)==null?void 0:r.defs)??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(c[e.defId]=e.def)}e.external||Object.keys(c).length>0&&(e.target===`draft-2020-12`?o.$defs=c:o.definitions=c);try{let n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:di(t,`input`,e.processors),output:di(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function D(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return D(r.element,n);if(r.type===`set`)return D(r.valueType,n);if(r.type===`lazy`)return D(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return D(r.innerType,n);if(r.type===`intersection`)return D(r.left,n)||D(r.right,n);if(r.type===`record`||r.type===`map`)return D(r.keyType,n)||D(r.valueType,n);if(r.type===`pipe`)return D(r.in,n)||D(r.out,n);if(r.type===`object`){for(let e in r.shape)if(D(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(D(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(D(e,n))return!0;return!!(r.rest&&D(r.rest,n))}return!1}var ui=(e,t={})=>n=>{let r=si({...n,processors:t});return E(e,r),ci(r,e),li(r,e)},di=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=si({...i??{},target:a,io:t,processors:n});return E(e,o),ci(o,e),li(o,e)},fi={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},pi=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=fi[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},mi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},hi=(e,t,n,r)=>{n.type=`boolean`},gi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},_i=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},vi=(e,t,n,r)=>{n.not={}},yi=(e,t,n,r)=>{let i=e._zod.def,o=a(i.entries);o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=o},bi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},xi=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Si=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ci=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},wi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=E(a.element,t,{...r,path:[...r.path,`items`]})},Ti=(e,t,n,r)=>{var i;let a=n,o=e._zod.def;a.type=`object`,a.properties={};let s=o.shape;for(let e in s)a.properties[e]=E(s[e],t,{...r,path:[...r.path,`properties`,e]});let c=new Set(Object.keys(s)),l=new Set([...c].filter(e=>{let n=o.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));l.size>0&&(a.required=Array.from(l)),((i=o.catchall)==null?void 0:i._zod.def.type)===`never`?a.additionalProperties=!1:o.catchall?o.catchall&&(a.additionalProperties=E(o.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(a.additionalProperties=!1)},Ei=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>E(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Di=(e,t,n,r)=>{let i=e._zod.def,a=E(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=E(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Oi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>E(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?E(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:ee}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof ee==`number`&&(i.maxItems=ee)},ki=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag,c=s==null?void 0:s.patterns;if(a.mode===`loose`&&c&&c.size>0){let e=E(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of c)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=E(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=E(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let l=o._zod.values;if(l){let e=[...l].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ai=(e,t,n,r)=>{let i=e._zod.def,a=E(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ji=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mi=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ni=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Pi=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Fi=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;E(a,t,r);let o=t.seen.get(e);o.ref=a},Ii=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Li=(e,t,n,r)=>{let i=e._zod.def;E(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ri=(e,t,n,r)=>{let i=e._zod.innerType;E(i,t,r);let a=t.seen.get(e);a.ref=i},zi=/*@__PURE__*/ e(`ZodISODateTime`,(e,t)=>{Yt.init(e,t),M.init(e,t)});function O(e){return/* @__PURE__ */ Or(zi,e)}var Bi=/*@__PURE__*/ e(`ZodISODate`,(e,t)=>{Xt.init(e,t),M.init(e,t)});function Vi(e){return/* @__PURE__ */ kr(Bi,e)}var Hi=/*@__PURE__*/ e(`ZodISOTime`,(e,t)=>{Zt.init(e,t),M.init(e,t)});function Ui(e){return/* @__PURE__ */ Ar(Hi,e)}var Wi=/*@__PURE__*/ e(`ZodISODuration`,(e,t)=>{Qt.init(e,t),M.init(e,t)});function Gi(e){return/* @__PURE__ */ jr(Wi,e)}var Ki=(e,t)=>{Ce.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ee(e,t)},flatten:{value:t=>Te(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,o,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,o,2)}},isEmpty:{get(){return e.issues.length===0}}})},qi=e(`ZodError`,Ki),k=e(`ZodError`,Ki,{Parent:Error}),Ji=/* @__PURE__ */ De(k),Yi=/* @__PURE__ */ Oe(k),Xi=/* @__PURE__ */ ke(k),Zi=/* @__PURE__ */ je(k),Qi=/* @__PURE__ */ Ne(k),$i=/* @__PURE__ */ Pe(k),ea=/* @__PURE__ */ Fe(k),ta=/* @__PURE__ */ Ie(k),na=/* @__PURE__ */ Le(k),ra=/* @__PURE__ */ Re(k),ia=/* @__PURE__ */ ze(k),aa=/* @__PURE__ */ Be(k),A=/*@__PURE__*/ e(`ZodType`,(e,t)=>(x.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:di(e,`input`),output:di(e,`output`)}}),e.toJSONSchema=ui(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(p(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>h(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Ji(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Xi(e,t,n),e.parseAsync=async(t,n)=>Yi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Zi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Qi(e,t,n),e.decode=(t,n)=>$i(e,t,n),e.encodeAsync=async(t,n)=>ea(e,t,n),e.decodeAsync=async(t,n)=>ta(e,t,n),e.safeEncode=(t,n)=>na(e,t,n),e.safeDecode=(t,n)=>ra(e,t,n),e.safeEncodeAsync=async(t,n)=>ia(e,t,n),e.safeDecodeAsync=async(t,n)=>aa(e,t,n),e.refine=(t,n)=>e.check(yo(t,n)),e.superRefine=t=>e.check(bo(t)),e.overwrite=t=>e.check(/* @__PURE__ */ T(t)),e.optional=()=>Xa(e),e.exactOptional=()=>Qa(e),e.nullable=()=>eo(e),e.nullish=()=>Xa(eo(e)),e.nonoptional=t=>oo(e,t),e.array=()=>B(e),e.or=t=>U([e,t]),e.and=t=>Va(e,t),e.transform=t=>uo(e,Ja(t)),e.default=t=>no(e,t),e.prefault=t=>io(e,t),e.catch=t=>co(e,t),e.pipe=t=>uo(e,t),e.readonly=()=>po(e),e.describe=t=>{let n=e.clone();return ir.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){var t;return(t=ir.get(e))==null?void 0:t.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return ir.get(e);let n=e.clone();return ir.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),oa=/*@__PURE__*/ e(`_ZodString`,(e,t)=>{Lt.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(/* @__PURE__ */ Kr(...t)),e.includes=(...t)=>e.check(/* @__PURE__ */ Yr(...t)),e.startsWith=(...t)=>e.check(/* @__PURE__ */ Xr(...t)),e.endsWith=(...t)=>e.check(/* @__PURE__ */ Zr(...t)),e.min=(...t)=>e.check(/* @__PURE__ */ Wr(...t)),e.max=(...t)=>e.check(/* @__PURE__ */ Ur(...t)),e.length=(...t)=>e.check(/* @__PURE__ */ Gr(...t)),e.nonempty=(...t)=>e.check(/* @__PURE__ */ Wr(1,...t)),e.lowercase=t=>e.check(/* @__PURE__ */ qr(t)),e.uppercase=t=>e.check(/* @__PURE__ */ Jr(t)),e.trim=()=>e.check(/* @__PURE__ */ $r()),e.normalize=(...t)=>e.check(/* @__PURE__ */ Qr(...t)),e.toLowerCase=()=>e.check(/* @__PURE__ */ ei()),e.toUpperCase=()=>e.check(/* @__PURE__ */ ti()),e.slugify=()=>e.check(/* @__PURE__ */ ni())}),sa=/*@__PURE__*/ e(`ZodString`,(e,t)=>{Lt.init(e,t),oa.init(e,t),e.email=t=>e.check(/* @__PURE__ */ or(ca,t)),e.url=t=>e.check(/* @__PURE__ */ fr(da,t)),e.jwt=t=>e.check(/* @__PURE__ */ Dr(Ea,t)),e.emoji=t=>e.check(/* @__PURE__ */ pr(fa,t)),e.guid=t=>e.check(/* @__PURE__ */ sr(la,t)),e.uuid=t=>e.check(/* @__PURE__ */ cr(ua,t)),e.uuidv4=t=>e.check(/* @__PURE__ */ lr(ua,t)),e.uuidv6=t=>e.check(/* @__PURE__ */ ur(ua,t)),e.uuidv7=t=>e.check(/* @__PURE__ */ dr(ua,t)),e.nanoid=t=>e.check(/* @__PURE__ */ mr(pa,t)),e.guid=t=>e.check(/* @__PURE__ */ sr(la,t)),e.cuid=t=>e.check(/* @__PURE__ */ hr(ma,t)),e.cuid2=t=>e.check(/* @__PURE__ */ gr(ha,t)),e.ulid=t=>e.check(/* @__PURE__ */ _r(ga,t)),e.base64=t=>e.check(/* @__PURE__ */ wr(Ca,t)),e.base64url=t=>e.check(/* @__PURE__ */ Tr(wa,t)),e.xid=t=>e.check(/* @__PURE__ */ vr(_a,t)),e.ksuid=t=>e.check(/* @__PURE__ */ yr(va,t)),e.ipv4=t=>e.check(/* @__PURE__ */ br(ya,t)),e.ipv6=t=>e.check(/* @__PURE__ */ xr(ba,t)),e.cidrv4=t=>e.check(/* @__PURE__ */ Sr(xa,t)),e.cidrv6=t=>e.check(/* @__PURE__ */ Cr(Sa,t)),e.e164=t=>e.check(/* @__PURE__ */ Er(Ta,t)),e.datetime=t=>e.check(O(t)),e.date=t=>e.check(Vi(t)),e.time=t=>e.check(Ui(t)),e.duration=t=>e.check(Gi(t))});function j(e){return/* @__PURE__ */ ar(sa,e)}var M=/*@__PURE__*/ e(`ZodStringFormat`,(e,t)=>{S.init(e,t),oa.init(e,t)}),ca=/*@__PURE__*/ e(`ZodEmail`,(e,t)=>{Bt.init(e,t),M.init(e,t)}),la=/*@__PURE__*/ e(`ZodGUID`,(e,t)=>{Rt.init(e,t),M.init(e,t)}),ua=/*@__PURE__*/ e(`ZodUUID`,(e,t)=>{zt.init(e,t),M.init(e,t)});function N(e){return/* @__PURE__ */ cr(ua,e)}var da=/*@__PURE__*/ e(`ZodURL`,(e,t)=>{Vt.init(e,t),M.init(e,t)});function P(e){return/* @__PURE__ */ fr(da,e)}var fa=/*@__PURE__*/ e(`ZodEmoji`,(e,t)=>{Ht.init(e,t),M.init(e,t)}),pa=/*@__PURE__*/ e(`ZodNanoID`,(e,t)=>{Ut.init(e,t),M.init(e,t)}),ma=/*@__PURE__*/ e(`ZodCUID`,(e,t)=>{Wt.init(e,t),M.init(e,t)}),ha=/*@__PURE__*/ e(`ZodCUID2`,(e,t)=>{Gt.init(e,t),M.init(e,t)}),ga=/*@__PURE__*/ e(`ZodULID`,(e,t)=>{Kt.init(e,t),M.init(e,t)}),_a=/*@__PURE__*/ e(`ZodXID`,(e,t)=>{qt.init(e,t),M.init(e,t)}),va=/*@__PURE__*/ e(`ZodKSUID`,(e,t)=>{Jt.init(e,t),M.init(e,t)}),ya=/*@__PURE__*/ e(`ZodIPv4`,(e,t)=>{$t.init(e,t),M.init(e,t)}),ba=/*@__PURE__*/ e(`ZodIPv6`,(e,t)=>{en.init(e,t),M.init(e,t)}),xa=/*@__PURE__*/ e(`ZodCIDRv4`,(e,t)=>{tn.init(e,t),M.init(e,t)}),Sa=/*@__PURE__*/ e(`ZodCIDRv6`,(e,t)=>{nn.init(e,t),M.init(e,t)}),Ca=/*@__PURE__*/ e(`ZodBase64`,(e,t)=>{an.init(e,t),M.init(e,t)}),wa=/*@__PURE__*/ e(`ZodBase64URL`,(e,t)=>{sn.init(e,t),M.init(e,t)}),Ta=/*@__PURE__*/ e(`ZodE164`,(e,t)=>{cn.init(e,t),M.init(e,t)}),Ea=/*@__PURE__*/ e(`ZodJWT`,(e,t)=>{un.init(e,t),M.init(e,t)}),Da=/*@__PURE__*/ e(`ZodNumber`,(e,t)=>{dn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r),e.gt=(t,n)=>e.check(/* @__PURE__ */ Vr(t,n)),e.gte=(t,n)=>e.check(/* @__PURE__ */ w(t,n)),e.min=(t,n)=>e.check(/* @__PURE__ */ w(t,n)),e.lt=(t,n)=>e.check(/* @__PURE__ */ Br(t,n)),e.lte=(t,n)=>e.check(/* @__PURE__ */ C(t,n)),e.max=(t,n)=>e.check(/* @__PURE__ */ C(t,n)),e.int=t=>e.check(ka(t)),e.safe=t=>e.check(ka(t)),e.positive=t=>e.check(/* @__PURE__ */ Vr(0,t)),e.nonnegative=t=>e.check(/* @__PURE__ */ w(0,t)),e.negative=t=>e.check(/* @__PURE__ */ Br(0,t)),e.nonpositive=t=>e.check(/* @__PURE__ */ C(0,t)),e.multipleOf=(t,n)=>e.check(/* @__PURE__ */ Hr(t,n)),e.step=(t,n)=>e.check(/* @__PURE__ */ Hr(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function F(e){return/* @__PURE__ */ Mr(Da,e)}var Oa=/*@__PURE__*/ e(`ZodNumberFormat`,(e,t)=>{fn.init(e,t),Da.init(e,t)});function ka(e){return/* @__PURE__ */ Pr(Oa,e)}var Aa=/*@__PURE__*/ e(`ZodBoolean`,(e,t)=>{pn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r)});function I(e){return/* @__PURE__ */ Fr(Aa,e)}var ja=/*@__PURE__*/ e(`ZodBigInt`,(e,t)=>{mn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),e.gte=(t,n)=>e.check(/* @__PURE__ */ w(t,n)),e.min=(t,n)=>e.check(/* @__PURE__ */ w(t,n)),e.gt=(t,n)=>e.check(/* @__PURE__ */ Vr(t,n)),e.gte=(t,n)=>e.check(/* @__PURE__ */ w(t,n)),e.min=(t,n)=>e.check(/* @__PURE__ */ w(t,n)),e.lt=(t,n)=>e.check(/* @__PURE__ */ Br(t,n)),e.lte=(t,n)=>e.check(/* @__PURE__ */ C(t,n)),e.max=(t,n)=>e.check(/* @__PURE__ */ C(t,n)),e.positive=t=>e.check(/* @__PURE__ */ Vr(BigInt(0),t)),e.negative=t=>e.check(/* @__PURE__ */ Br(BigInt(0),t)),e.nonpositive=t=>e.check(/* @__PURE__ */ C(BigInt(0),t)),e.nonnegative=t=>e.check(/* @__PURE__ */ w(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(/* @__PURE__ */ Hr(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null}),Ma=/*@__PURE__*/ e(`ZodNull`,(e,t)=>{hn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r)});function L(e){return/* @__PURE__ */ Lr(Ma,e)}var Na=/*@__PURE__*/ e(`ZodUnknown`,(e,t)=>{gn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function R(){return/* @__PURE__ */ Rr(Na)}var Pa=/*@__PURE__*/ e(`ZodNever`,(e,t)=>{_n.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r)});function z(e){return/* @__PURE__ */ zr(Pa,e)}var Fa=/*@__PURE__*/ e(`ZodArray`,(e,t)=>{yn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(/* @__PURE__ */ Wr(t,n)),e.nonempty=t=>e.check(/* @__PURE__ */ Wr(1,t)),e.max=(t,n)=>e.check(/* @__PURE__ */ Ur(t,n)),e.length=(t,n)=>e.check(/* @__PURE__ */ Gr(t,n)),e.unwrap=()=>e.element});function B(e,t){return/* @__PURE__ */ ri(Fa,e,t)}var Ia=/*@__PURE__*/ e(`ZodObject`,(e,t)=>{wn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),d(e,`shape`,()=>t.shape),e.keyof=()=>K(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:R()}),e.loose=()=>e.clone({...e._zod.def,catchall:R()}),e.strict=()=>e.clone({...e._zod.def,catchall:z()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>me(e,t),e.safeExtend=t=>he(e,t),e.merge=t=>ge(e,t),e.pick=t=>fe(e,t),e.omit=t=>pe(e,t),e.partial=(...t)=>_e(Ya,e,t[0]),e.required=(...t)=>ve(ao,e,t[0])});function V(e,t){return new Ia({type:`object`,shape:e??{},...g(t)})}function H(e,t){return new Ia({type:`object`,shape:e,catchall:z(),...g(t)})}function La(e,t){return new Ia({type:`object`,shape:e,catchall:R(),...g(t)})}var Ra=/*@__PURE__*/ e(`ZodUnion`,(e,t)=>{En.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.options=t.options});function U(e,t){return new Ra({type:`union`,options:e,...g(t)})}var za=/*@__PURE__*/ e(`ZodDiscriminatedUnion`,(e,t)=>{Ra.init(e,t),Dn.init(e,t)});function W(e,t,n){return new za({type:`union`,options:t,discriminator:e,...g(n)})}var Ba=/*@__PURE__*/ e(`ZodIntersection`,(e,t)=>{On.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r)});function Va(e,t){return new Ba({type:`intersection`,left:e,right:t})}var Ha=/*@__PURE__*/ e(`ZodTuple`,(e,t)=>{jn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Ua(e,t,n){let r=t instanceof x;return new Ha({type:`tuple`,items:e,rest:r?t:null,...g(r?n:t)})}var Wa=/*@__PURE__*/ e(`ZodRecord`,(e,t)=>{Nn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function G(e,t,n){return new Wa({type:`record`,keyType:e,valueType:t,...g(n)})}var Ga=/*@__PURE__*/ e(`ZodEnum`,(e,t)=>{Pn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ga({...t,checks:[],...g(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ga({...t,checks:[],...g(r),entries:i})}});function K(e,t){return new Ga({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...g(t)})}var Ka=/*@__PURE__*/ e(`ZodLiteral`,(e,t)=>{Fn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function q(e,t){return new Ka({type:`literal`,values:Array.isArray(e)?e:[e],...g(t)})}var qa=/*@__PURE__*/ e(`ZodTransform`,(e,t)=>{In.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e._zod.parse=(r,i)=>{if(i.direction===`backward`)throw new n(e.constructor.name);r.addIssue=n=>{if(typeof n==`string`)r.issues.push(xe(n,r.value,t));else{let t=n;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=r.value,t.inst??=e,r.issues.push(xe(t))}};let a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});function Ja(e){return new qa({type:`transform`,transform:e})}var Ya=/*@__PURE__*/ e(`ZodOptional`,(e,t)=>{Rn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xa(e){return new Ya({type:`optional`,innerType:e})}var Za=/*@__PURE__*/ e(`ZodExactOptional`,(e,t)=>{zn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qa(e){return new Za({type:`optional`,innerType:e})}var $a=/*@__PURE__*/ e(`ZodNullable`,(e,t)=>{Bn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function eo(e){return new $a({type:`nullable`,innerType:e})}var to=/*@__PURE__*/ e(`ZodDefault`,(e,t)=>{Vn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function no(e,t){return new to({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}var ro=/*@__PURE__*/ e(`ZodPrefault`,(e,t)=>{Un.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function io(e,t){return new ro({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}var ao=/*@__PURE__*/ e(`ZodNonOptional`,(e,t)=>{Wn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function oo(e,t){return new ao({type:`nonoptional`,innerType:e,...g(t)})}var so=/*@__PURE__*/ e(`ZodCatch`,(e,t)=>{Kn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function co(e,t){return new so({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var lo=/*@__PURE__*/ e(`ZodPipe`,(e,t)=>{qn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r),e.in=t.in,e.out=t.out});function uo(e,t){return new lo({type:`pipe`,in:e,out:t})}var fo=/*@__PURE__*/ e(`ZodReadonly`,(e,t)=>{Yn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function po(e){return new fo({type:`readonly`,innerType:e})}var mo=/*@__PURE__*/ e(`ZodTemplateLiteral`,(e,t)=>{Zn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r)});function ho(e,t){return new mo({type:`template_literal`,parts:e,...g(t)})}var go=/*@__PURE__*/ e(`ZodLazy`,(e,t)=>{Qn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function _o(e){return new go({type:`lazy`,getter:e})}var vo=/*@__PURE__*/ e(`ZodCustom`,(e,t)=>{$n.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r)});function yo(e,t={}){return/* @__PURE__ */ ii(vo,e,t)}function bo(e){return/* @__PURE__ */ ai(e)}function xo(e){let t=_o(()=>U([j(e),F(),I(),L(),B(t),G(j(),t)]));return t}function So(e,t){return uo(Ja(e),t)}function Co(e){return/* @__PURE__ */ Nr(Da,e)}function wo(e){return/* @__PURE__ */ Ir(ja,e)}var To=j().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,`Invalid UUID format`),Eo=/^pgat_[0-9A-Za-z]{43}$/,Do=1e3,Oo=604800,ko=K([`running`,`pausing`,`paused`,`stopping`,`finalizing`,`completed`,`cancelled`,`failed`]),Ao=[`completed`,`cancelled`,`failed`];K(Ao);var jo=[`running`,`pausing`,`paused`,`stopping`,`finalizing`];K(jo),K([`running`,`pausing`,`stopping`]);var Mo=K([`paused`,...Ao]),No=K([`user`,`credits`]);K([`exploring`,`final_analysis`,`done`]);var Po=K([`queued`,`running`,`done`,`failed`,`cancelled`]),Fo=K([`done`,`failed`,`cancelled`]),Io=K([`lead_finished`,`user_cancelled`,`lead_failed`]),Lo=K([`none`,`attached`,`lost`]),Ro=K([`idle`,`active`,`awaiting_user`]),zo=K([`atlas`,`make_auto`,`preset`]),Bo=K([`extension_atlas_card`,`extension_make_auto_modal`,`web_atlas_dialog`,`web_make_auto_dialog`,`web_job_repeat`,`chat`,`web_workflow_repeat`,`web_runs_prompt`,`web_test_run_dialog`,`web_map_dialog`,`web_scenarios_dialog`]),Vo=K([`web_runs_prompt`,`web_test_run_dialog`,`web_map_dialog`,`web_scenarios_dialog`]),Ho=U([Vo,q(`chat`)]),Uo=K([`extension_atlas_card`,`extension_make_auto_modal`,`web_make_auto_dialog`,`web_job_repeat`,`web_workflow_repeat`]),Wo=K([`browser`,`agent`,`none`]),Go=K([`browser`,`agent`]),Ko=K([`explore_app`,`find_bugs`,`create_tests`,`automate_scenarios`,`run_scenarios`,`custom`]),qo=[`file_bugs`,`write_tests`,`edit_project`],Jo=K(qo),Yo=[`text`,`auto`],Xo=K(Yo);K([`project`,`scenarios`,`test_run`,`test_plan`]);var Zo=K([`server`,`chat`]),Qo=K([`host_lost`,`awaiting_browser`,`awaiting_user`,`paused`]),$o=K([`opening`,`idle`,`busy`,`closing`,`closed`]),es=K([`lead`,`user`,`window_closed`,`workflow_ended`,`workflow_paused`]),ts=K([`make_auto`,`atlas`,`run`]),ns=K([`starting`,`running`,`ended`]),rs=K([`completed`,`cancelled`,`failed`,`start_failed`]),is=K([`lead`,`user`,`window_closed`,`host_lost`,`host_refused`,`workflow_ended`,`workflow_paused`]),as=K([`lead_choice`,`role_default`]),os=[`observe`,`main`,`dangerous`],ss=K(os),cs=K([`main`,`dangerous`]),ls=K([`workflow.access_hint_lost`,`workflow.window_refused`,`workflow.tab_refused`,`workflow.scenario_needs_conversion`]);K(/* @__PURE__ */ `workflows.not_found,workflows.not_initiator,workflows.not_initiator_or_admin,workflows.worker_not_found,workflows.not_running,workflows.host_held,workflows.host_mismatch,workflows.host_lost,workflows.host_attached,workflows.host_pending,workflows.executor_kind_mismatch,workflows.executor_mismatch,workflows.agent_mismatch,workflows.request_mismatch,workflows.agents_over_max,workflows.scope_not_found,workflows.scope_forbidden,workflows.conversation_busy,workflows.max_requires_browser,workflows.not_preset,workflows.not_pausable,workflows.not_continuable,workflows.not_amendable,workflows.place_mismatch,workflows.auto_requires_browser,workflows.segment_changed`.split(`,`)),V({status:ko});var us=V({status:ko}),ds=K([`conversation_deleted`]);us.extend({reason:ds.optional()}),V({segment:F().int().min(1)}),V({executorKind:Wo}),V({leaseExpiresAt:O()}),V({workflowId:N()}),V({agentId:N()});var fs=[`7d`,`14d`,`30d`,`90d`],ps=[`consistently_failing`,`flaky`,`monitoring`,`insufficient_history`,`stable`],ms=[`passed`,`failed`,`infra`,`cancelled`,`abandoned`],hs=[`scenario`,`page`,`feature`],gs=[`critical`,`high`,`watch`],_s=[`lt`,`gt`,`gte`],vs={kind:`last_runs`,maxRuns:20,maxAgeDays:90},ys=[`infra`,`cancelled`,`abandoned`],bs=[`queued`,`launching`,`in_progress`],xs=[`passed`,`failed`],Ss=[`before_hook_failed`,`no_start_page`,`no_path_for_page`],Cs=[`no_route_to_start_page`,`navigation_service_unavailable`,`scenario_load_failed`,`run_policy_unavailable`,`variables_load_failed`,`start_failed`],ws=[...Ss,...Cs];[...ms,...bs],W(`by`,[V({by:q(`human`),outcome:K(xs)}).strict(),V({by:q(`not_started`),cause:K(ws),hookSharedStepId:N().optional()}).strict().refine(e=>e.hookSharedStepId!==void 0==(e.cause===`before_hook_failed`),{message:`hookSharedStepId is required for before_hook_failed and forbidden for any other cause`,path:[`hookSharedStepId`]})]),V({outcome:K(xs)}).strict(),K([`queued`,`launching`,`in_progress`,`completed`,`failed`,`cancelled`]);var Ts=K([`queued`,`launching`,`in_progress`]);K([`claim_timeout`,`launch_timeout`,`launch_error`,`browser_gone`,`agent_lost`,`max_duration`,`killed`,`lease_lost`,`budget_exhausted`,...ws,`result_not_saved`]);var Es=K([`launch_error`,`browser_gone`,`max_duration`]),Ds=K([`name_not_resolved`,`unreachable`,`certificate`,`timeout`,`other`]),Os=K([`claim_timeout`,`launch_timeout`,`launch_error`,`browser_gone`,`agent_lost`,`max_duration`,`killed`,`stalled`,`capability_mismatch`,`subject_rejected`,`model_timeout`,`runs_not_started`,`credits_exhausted`,`tab_closed`,`slot_taken`,`ai_disabled`,`workflow_host_lost`]),ks=Os.exclude([`workflow_host_lost`]),As=K([`atlas.observe`,`atlas.act`,`agentic.observe`,`agentic.act`,`heal.observe`,`agentic.replay_step`]),js=[`unknown_op`,`invalid_payload`],Ms=K(js),Ns=/^[a-zA-Z0-9_][a-zA-Z0-9_]{0,99}$/,Ps=1e4,Fs=[`runtime`,`scenario`,`environment`,`project`,`company`],Is=/(?<!\\)\{\{(.+?)(?<!\\)\}\}/g,Ls={env:`environment`,environment:`environment`,project:`project`,company:`company`,scenario:`scenario`,runtime:`runtime`};function Rs(e){let t=e.indexOf(`:`);if(t===-1)return{name:e};let n=Ls[e.substring(0,t)];return n===void 0?{name:e}:{scope:n,name:e.substring(t+1)}}function zs(e){let t=[];Is.lastIndex=0;let n;for(;(n=Is.exec(e))!==null;){let e=n[0],{scope:r,name:i}=Rs(n[1].trim()),a=i.startsWith(`$`);t.push({raw:e,name:i,scope:r,isBuiltIn:a})}return t}function Bs(e){let t=zs(e);return t.length>0&&t.map(e=>e.raw).join(``)===e}var Vs=V({elementId:j().uuid(),pageFingerprint:j().min(1),accessibleName:j().nullable(),role:j().nullable(),bbox:V({x:F(),y:F(),w:F(),h:F()})}),Hs=V({depth:F().int().min(0),hostElementHash:j().regex(/^[0-9a-f]{16}$/,`host element hash must be 16-char lowercase hex`),hostSignature:Vs}),Us=V({kind:q(`open-shadow-chain`),hostChain:B(Hs).min(1).max(8,{message:`shadow chain exceeds 8 hops`})}),Ws=32768,Gs=V({x:F(),y:F(),w:F(),h:F()}).strict(),Ks=V({dataUrl:j().min(1).regex(/^data:image\/(png|jpeg|webp);base64,/,{message:`dataUrl must be an inline data:image/(png|jpeg|webp);base64,... URL`}),mediaType:K([`image/jpeg`,`image/webp`,`image/png`])}).strict().superRefine((e,t)=>{var n;let r=(n=e.dataUrl.match(/^data:([^;]+);base64,/))==null?void 0:n[1];r!==void 0&&r!==e.mediaType&&t.addIssue({code:`custom`,message:`dataUrl header media type (${r}) does not match the declared mediaType (${e.mediaType})`,path:[`mediaType`]})}),qs=V({selector:j().min(1),selectorIndex:F().int().nonnegative(),xpath:j().min(1),selectorStability:F().min(0).max(1).optional()}).strict(),Js=V({domain:j().min(1),pageFingerprint:j().min(1),tokens:B(j().max(64)).max(64),attributes:G(j(),j().max(256)),text:j().max(160),tagName:j().optional(),neighborText:j().max(160).optional(),role:j().optional(),accessibleName:j().max(160).optional(),dataTestId:j().optional(),placeholder:j().optional(),labelText:j().max(160).optional(),locatorIndex:F().int().optional(),shadowLineage:Us.optional()}).strict(),Ys=V({inputType:j().optional(),required:I().optional(),disabled:I().optional(),readonly:I().optional(),checked:I().optional(),pattern:j().max(256).optional(),minLength:F().int().optional(),maxLength:F().int().optional(),min:j().max(64).optional(),max:j().max(64).optional(),ariaInvalid:I().optional(),autocomplete:j().max(64).optional()}).strict(),Xs=V({ref:F().int().nonnegative(),role:j(),name:j().max(160),tag:j(),bbox:Gs,inViewport:I(),formState:Ys.optional(),locator:qs,signature:Js.nullable()}).strict(),Zs=W(`status`,[V({version:q(1),status:q(`ok`),captureRequestId:j().min(1),analyzeToolCallId:j().min(1),capturedAt:F().int(),page:V({url:P(),title:j().max(500),viewport:V({w:F().int(),h:F().int()}).strict()}).strict(),axTreeYaml:j().min(1).max(Ws),screenshot:Ks.nullable(),screenshotOmittedReason:K([`secret_tainted_step`,`budget_exceeded`,`foreground_lost`]).nullable(),elements:B(Xs).max(150),truncated:V({elements:F().int().nonnegative(),unresolvable:F().int().nonnegative()}).strict(),degradation:B(K([`screenshot_quality_reduced`,`screenshot_dropped`,`elements_capped`]))}).strict().superRefine((e,t)=>{e.screenshot!==null==(e.screenshotOmittedReason!==null)&&t.addIssue({code:`custom`,message:`Exactly one of screenshot / screenshotOmittedReason must be non-null`,path:[`screenshot`]})}),V({version:q(1),status:q(`failed`),captureRequestId:j().min(1),analyzeToolCallId:j().min(1),reason:K([`no_capturable_tab`,`capture_failed`,`capture_timeout`,`oversize_unrecoverable`]),message:j().max(500).optional()}).strict()]),J=V({stepId:N(),occurrence:F().int().nonnegative()}).strict(),Y={stepId:J.shape.stepId,occurrence:J.shape.occurrence.optional()};function Qs(e){return e.assertionType===`text_free`?!1:e.targetResolution===`resolved`?!0:$s(e)?!1:ec(e.targetSelector)||ec(e.targetXpath)}function $s(e){return e.targetHint!==null||e.source===`ai`&&e.targetXpath===null}function ec(e){return e!==null&&e!==``}var tc=j().min(1).max(200).nullable(),nc=[`click`,`input`,`select`,`navigate`,`type`],rc=K(nc),ic=V({role:j(),accessibleName:j()}),ac={actionId:N(),element:ic.nullable()};W(`actionType`,[V({...ac,actionType:q(`navigate`),targetUrl:j().nullable()}),...nc.filter(e=>e!==`navigate`).map(e=>V({...ac,actionType:q(e),targetUrl:L()}))]);var oc=K([`step-scoped`]),sc=V({status:K([`unknown`,`progress`,`no_progress`,`mistake`,`accomplished`]),evidence:j().min(1),reflection:j().min(1)}),X=V({somId:F().int().positive().optional(),bbox:V({x:F(),y:F(),w:F(),h:F()}).optional(),elementHints:V({role:j(),accessibleName:j()}).optional()}),cc=V({x:F().int().min(0),y:F().int().min(0)}),lc=K([`alert`,`confirm`,`prompt`,`beforeunload`]),uc=U([V({x:F(),y:F()}),X]),dc=V({text:j().min(1),verification:K([`browser`,`manual`]),evidence:j().min(1).optional(),after_action_id:j().nullable().optional()}),fc=W(`type`,[V({type:q(`click`),target:X.nullable(),point:cc.nullable()}).refine(e=>e.target===null!=(e.point===null),{message:`click names exactly one of target and point`}),V({type:q(`type`),target:X,text:j(),clearFirst:I().optional()}),V({type:q(`select-option`),target:X,option:V({label:j().optional(),value:j().optional()}).refine(e=>e.label!==void 0||e.value!==void 0,{message:`select-option.option must have at least one of label or value`})}),V({type:q(`clear-field`),target:X}),V({type:q(`hover`),target:X}),V({type:q(`drag`),from:X,to:uc}),V({type:q(`key-press`),key:j(),modifiers:B(j()).optional(),target:X.optional()}),V({type:q(`scroll`),direction:K([`up`,`down`,`left`,`right`]),deltaPx:F().int().positive(),target:X.nullable()}),V({type:q(`wait`),ms:F().int().positive(),reason:j().min(1),until:V({textVisible:j().min(1)}).nullable()}),V({type:q(`observe`),reason:j()}),V({type:q(`screenshot-region`),region:V({x:F(),y:F(),w:F(),h:F()})}),V({type:q(`navigate`),url:j(),targetPageId:N().nullable()}),V({type:q(`switch-tab`),tabId:F().int().positive()}),V({type:q(`open-tab`),url:j().nullable(),targetPageId:N().nullable()}),V({type:q(`close-tab`),tabId:F().int().positive()}),V({type:q(`go-back`)}),V({type:q(`reload`)}),V({type:q(`handle-dialog`),accept:I(),promptText:j().nullable()}),V({type:q(`agent_finish_step`),completed_by_action_id:j(),evidence:j().min(1),expected_results:B(dc).optional()}),V({type:q(`agent_give_up`),reason:j()}),V({type:q(`agent_goal_obsolete`),verdict:K([`already_satisfied`,`precondition_gone`]),evidence:j().min(1),reason:j().min(1),expected_results:B(dc).optional()}),V({type:q(`agent_fold_verification`),expected_results:B(dc).min(1),reason:j().min(1)}),V({type:q(`agent_ask_user`),questionId:j().uuid()}),V({type:q(`agent_ask_lead`),questionId:j().uuid()}),V({type:q(`message_lead`),messageId:j().uuid()})]),pc=V({kind:K([`value`,`select`]),fieldNonEmpty:I(),valueLengthAtLeastMin:I().optional(),plainValueContains:I().optional(),selectedTextRedactedOrPlain:j().optional()}),mc=V({channel:K([`full_navigation`,`spa_navigation`,`url_change`,`dom_subtree_replacement`]),settled:V({reason:K([`first_signal_then_quiet`,`hard_cap`]),elapsedMs:F().int().nonnegative(),quietWindowMs:F().int().positive(),hardCapMs:F().int().positive()}),url:V({before:j(),after:j(),changed:I(),navigationType:K([`push`,`replace`,`reload`,`traverse`]).optional()}).optional(),title:V({before:j(),after:j()}).optional(),domDelta:V({addedSignificant:F().int().nonnegative(),removedSignificant:F().int().nonnegative(),focusMoved:I(),salientNew:B(V({role:j(),text:j()})).max(5)}).optional(),summary:j().min(1)}),hc={somId:F().int().positive().optional(),bbox:V({x:F(),y:F(),w:F(),h:F()}).optional(),elementHints:V({role:j(),accessibleName:j()}).optional(),selector:j().optional(),selectorIndex:F().int().nonnegative().optional(),xpath:j().optional(),textSnapshot:j().optional(),signature:Js.optional(),name:tc.optional()},gc=V({...hc,secretField:I()}),_c=V({...hc,secretField:I().optional()}),vc={shadowLineage:z({error:`the open-shadow chain travels only in target.signature.shadowLineage`}).optional(),closedShadowRoot:q(!0).optional(),shadowChainTooDeep:q(!0).optional()},yc=V({target:gc,...vc}),bc=V({target:_c,...vc}),xc={actionId:j(),turnEventSeq:F().int().nonnegative(),requestId:j(),actionType:j(),urlBefore:j()},Sc=yc.extend(xc),Cc=bc.extend(xc),wc=V({kind:K([`aria-live-assertive`,`aria-invalid`,`role-alert`,`styled-error-class`,`url-error-param`,`i18n-error-text`]),label:j(),excerpt:j().optional()}),Tc=V({status:q(`executed`),postObservation:V({url:j(),domSettleMs:F().int().nonnegative(),readback:pc.optional(),effect:mc.optional()}),visibleErrorSignals:B(wc),navigationSignals:V({committed:I(),committedAt:F().optional(),url:j().optional(),openedTabIds:B(F().int().positive()).min(1).optional()}),mechanicalError:V({kind:K([`timeout`,`element-detached`,`cdp-error`]),detail:j()}).optional(),bindingCandidate:Sc.optional(),pointHit:V({tag:j(),elementHints:V({role:j(),accessibleName:j()}),boundable:I()}).optional(),until:V({met:I(),waitedMs:F().int().nonnegative()}).nullable().optional(),nativeDialog:V({type:lc}).optional()}),Ec=V({status:q(`rejected`),reason:j()}),Dc=W(`status`,[Tc,Ec]);W(`status`,[Tc.extend({bindingCandidate:Cc.optional()}),Ec]),V({mode:oc,evaluation_previous_goal:sc,memory:j(),next_goal:j(),reasoning:j(),action:fc}),V({tabId:F().int().positive(),openerTabId:F().int().positive().optional(),url:j(),title:j().optional(),status:K([`loading`,`complete`,`unknown`]),active:I(),ownedByRun:I(),lastCommittedAt:F().optional(),lastObservedAt:F().optional()}),V({runId:j(),...J.shape,stepIndex:F().int().nonnegative(),turnIndex:F().int().nonnegative(),actionId:j(),action:fc,tabId:F().int().positive(),requestId:j(),turnEventSeq:F().int().nonnegative(),status:K([`proposed`,`dispatching`,`dispatched`]),resumeEpoch:F().int().nonnegative(),runnerClaimEpoch:F().int().nonnegative().optional(),proposedAt:F().int().nonnegative(),urlBefore:j().optional(),dispatchedAt:F().optional(),navigationCorroboration:V({committedAt:F(),url:j(),tabId:F().int().positive(),frameId:q(0)}).optional()});var Oc={ordinal:F().int().min(0),inputValue:j().nullable(),targetUrl:j().nullable(),sourceTemplate:j().optional(),dispatchedValue:j().optional(),urlAtDispatch:j().min(1),observationEvidence:j().min(1)},kc=rc.exclude([`type`]),Ac=`agent-user-channel R25 (2)`;function jc(e,t){if(e.sourceTemplate!==void 0&&e.dispatchedValue===void 0&&t.addIssue({code:`custom`,path:[`dispatchedValue`],message:`dispatchedValue is required when sourceTemplate is present`}),e.secretValue===!0){if(e.inputValue!==null&&t.addIssue({code:`custom`,path:[`inputValue`],message:`a secretValue entry carries no inputValue (${Ac})`}),e.sourceTemplate===void 0){e.dispatchedValue!==void 0&&t.addIssue({code:`custom`,path:[`dispatchedValue`],message:`a secret literal carries no dispatchedValue (${Ac})`});return}Bs(e.sourceTemplate)||t.addIssue({code:`custom`,path:[`sourceTemplate`],message:`a secretValue entry carries sourceTemplate only when it is made wholly of {{...}} references (${Ac})`})}}W(`actionType`,[V({...Oc,actionType:q(`type`),bindingCandidate:Sc.nullable(),secretValue:I()}),V({...Oc,actionType:kc,bindingCandidate:Sc.nullable()})]).superRefine(jc);var Mc=W(`actionType`,[V({...Oc,actionType:q(`type`),bindingCandidate:Cc.nullable(),secretValue:I().optional()}),V({...Oc,actionType:kc,bindingCandidate:Cc.nullable()})]).superRefine(jc),Nc=K([`no_previous_step`,`previous_is_shared_step`,`lock_set`,`survivor_marked`,`step_scoped_run`,`goal_obsolete`,`actions_not_converted`]),Pc=V({expectedResultId:N(),targetStepId:N(),verification:K([`browser`,`manual`]),afterActionId:j().min(1).nullable()}),Fc=K([`no_action_in_window`,`element_hints_missing`,`completer_page_unknown`,`completer_type_mismatch`,`element_without_identity`]),Ic=W(`kind`,[V({kind:q(`element`),elementId:j().uuid()}),V({kind:q(`page`),pageId:j().uuid()})]),Lc=W(`kind`,[V({kind:q(`bound`)}),V({kind:q(`rebound`),previousTarget:Ic}),V({kind:q(`unbound`),reason:Fc})]),Rc=K([`url_template`,`url_redacted`,`element_without_identity`,`secret_literal`]),zc=W(`reason`,[V({reason:K([`step_scoped_run`,`not_text_step`,`lock_set`,`survivor_marked`,`text_edited`,`text_variable_uncarried`,`element_without_identity`,`secret_literal`]).exclude([`text_variable_uncarried`])}),V({reason:q(`text_variable_uncarried`),uncarriedVariables:B(j().min(1)).min(1)})]),Bc=V({convertedActions:F().int().nonnegative(),unconverted:B(V({actionIndex:F().int().nonnegative(),reason:Rc})),withheld:zc.nullable()}),Vc=V({anchorFound:I().nullable(),navigationObserved:I().nullable(),evidenceVerbatim:I(),binding:Lc.nullable(),conversion:Bc.nullable()}),Hc=K([`target_absent`,`scroll_lock`,`unexpected_tab`,`unexpected_window`,`native_dialog`]),Uc=K([`cookie_banner`,`modal_overlay`,`unexpected_tab`,`unexpected_window`,`native_dialog`,`unknown`]),Wc=K([`dismiss_click`,`keyboard`,`switch_tab`,`close_tab`,`open_tab`,`navigate`,`scroll`,`wait_retry`,`input`,`dialog_accept`,`dialog_dismiss`,`other`,`none_gave_up`]),Gc=V({tag:j(),role:j().nullable(),ariaModal:I(),position:K([`fixed`,`sticky`,`absolute`,`other`]),zIndex:F().nullable(),viewportCoverage:F().min(0).max(1),idClassHint:j().max(200).nullable()}),Kc=V({kind:K([`tab_created`,`tab_activated_away`,`window_focus_lost`]),tabId:F().nullable(),windowId:F().nullable(),openerTabId:F().nullable(),url:j().nullable(),at:F()}),qc=V({dialogType:K([`alert`,`confirm`,`prompt`,`beforeunload`]),messageExcerpt:j().max(500),url:j(),hasDefaultPrompt:I()});V({version:q(1),signal:Hc,stepId:j().uuid(),navigationEpoch:F().int(),attempt:F().int().min(1),evidence:V({occluder:Gc.nullable(),scrollLock:V({overflowHiddenOn:K([`html`,`body`,`both`])}).nullable(),tabEvents:B(Kc),dialog:qc.nullable()}).refine(e=>e.occluder!==null||e.scrollLock!==null||e.tabEvents.length>0||e.dialog!==null,`Gate 2: positive evidence is required \u2014 a recovery run may not be opened on a bare step failure`)});var Jc=V({version:q(1),obstructionKind:Uc,actionTaken:Wc,reason:j().max(2e3),stepId:j().uuid(),attempt:F().int().min(1),turnsUsed:F().int().min(0)});V({aiRunId:j().uuid(),stepId:j().uuid(),status:K([`resolved`,`failed`,`in_progress`]),obstructionKind:Uc.nullable(),actionTaken:Wc.nullable(),reason:j().nullable(),attempt:F().int(),occurredAt:j()});var Yc=`extraction_failed`,Xc=K([`element_not_found`,`element_not_found_page_busy`,`locator_absent`,`closed_shadow_root`,`action_dispatch_failed`,Yc,`executor_unavailable`,`variable_missing`,`native_dialog_open`]);K([`ai_refused_credits_exhausted`,`ai_refused_user_ai_disabled`,`ai_refused_user_credit_limit_reached`,`ai_run_scenario_busy`,`ai_run_create_failed`,`ai_run_start_refused`,`ai_run_start_invalid`,`ai_worker_unreachable`,`ai_run_no_project`]);var Zc={credits_exhausted:`ai_refused_credits_exhausted`,user_ai_disabled:`ai_refused_user_ai_disabled`,user_credit_limit_reached:`ai_refused_user_credit_limit_reached`},Qc=new Map(Object.keys(Zc).map(e=>[Zc[e],e])),$c=`ai_run_scenario_busy`,el=/* @__PURE__ */ new Map([[`element_not_found`,`unresolved`],[`element_not_found_page_busy`,`unresolved`],[`closed_shadow_root`,`unresolved`],[`locator_absent`,`locator_absent`]]);function tl(e){let t=Qc.get(e);if(t!==void 0)return{kind:`ai_refused`,refusal:t};if(e===$c)return{kind:`scenario_busy`};let n=el.get(e);return n===void 0?{kind:`technical`,line:e}:{kind:`miss`,reason:n}}var nl=65536,rl={outcome:z().optional(),replayStatus:z().optional()},il=V({event_type:q(`run_started`),payload:V({orchestratorType:j(),config:G(j(),R()).optional()})}),al=V({event_type:q(`run_paused`),payload:V({reason:j().optional()})}),ol=V({event_type:q(`run_resumed`),payload:V({reason:j().optional(),requestId:j().uuid().optional()})}),sl=V({event_type:q(`run_completed`),payload:V({pagesVisited:F().int().min(0),elementsFound:F().int().min(0),totalSteps:F().int().min(0)})}),cl=V({event_type:q(`run_failed`),payload:V({errorMessage:j(),errorCode:j().optional()})}),ll=V({event_type:q(`run_cancelled`),payload:V({cancelledBy:j().uuid().optional()})}),ul=V({event_type:q(`observation_captured`),payload:V({observation:R().optional(),sanitizedCount:F().int().min(0).optional()})}),dl=V({event_type:q(`action_dispatched`),payload:V({action:R().optional()})}),fl=V({...rl,action:R().optional(),verified:I(),stepIndex:F().int().nonnegative(),...Y,elementId:j().uuid(),durationMs:F().int().nonnegative(),finishFacts:Vc.optional()}),pl=V({...rl,verified:I(),stepIndex:F().int().nonnegative(),...Y,pageId:j().uuid(),durationMs:F().int().nonnegative(),finishFacts:Vc.optional()}),ml=V({...rl,action:G(j(),R())}),hl={verified:I(),stepIndex:F().int().nonnegative(),...Y},gl=W(`outcome`,[V({...hl,outcome:K([`user_skipped`,`obsolete_succeeded`])}),V({...hl,outcome:K([`text_step_completed`,`text_step_converted`]),finishFacts:Vc.optional()}),V({...hl,outcome:q(`finish_unbound`),finishFacts:Vc.refine(e=>{var t;return((t=e.binding)==null?void 0:t.kind)===`unbound`},{message:`finish_unbound carries finishFacts.binding.kind 'unbound'`})}),V({...hl,outcome:q(`recorded_step_replayed`),replayStatus:q(`executed`)}),V({...hl,outcome:q(`recorded_assert_skipped`),replayStatus:q(`skipped_assert`)})]),_l=V({event_type:q(`action_succeeded`),payload:U([fl,pl,ml,gl])}),vl=V({event_type:q(`action_failed`),payload:V({action:R().optional(),error:j().optional()})}),yl=V({event_type:q(`retry_attempted`),payload:V({attempt:F().int().min(1),reason:j().optional()})}),bl=V({event_type:q(`ws_connected`),payload:V({epoch:j()})}),xl=V({event_type:q(`ws_reconnected`),payload:V({epoch:j(),missedEvents:F().int().min(0).optional()})}),Sl=V({event_type:q(`ws_dropped`),payload:V({reason:j().optional()})}),Cl=V({event_type:q(`llm_called`),payload:V({model:j(),promptTokens:F().int().min(0).optional(),aiUsageLogId:j().optional(),source:j().optional()})}),wl=V({event_type:q(`llm_succeeded`),payload:V({model:j(),completionTokens:F().int().min(0).optional()})}),Tl=V({event_type:q(`llm_failed`),payload:V({model:j(),error:j().optional()})}),El=V({event_type:q(`llm_rate_limited`),payload:V({model:j(),retryAfterMs:F().int().min(0).optional()})}),Dl=V({event_type:q(`step_mapped`),payload:V({stepId:j().uuid(),proposedElementId:j().uuid().optional(),proposedPageId:j().uuid().optional(),confidence:F().min(0).max(1),reusedExisting:I().optional()})}),Ol=V({event_type:q(`mapping_failed`),payload:V({stepId:j().uuid(),reason:j().optional()})}),kl=V({event_type:q(`step_executed`),payload:V({stepId:j().uuid(),success:I()})}),Al=V({event_type:q(`mapping_corrected_by_user`),payload:V({stepId:j().uuid(),correctedElementId:j().uuid().optional()})}),jl=V({event_type:q(`page_described`),payload:V({pageId:j().uuid(),description:j().optional()})}),Ml=V({event_type:q(`element_updated`),payload:V({elementId:j().uuid()})}),Nl=V({event_type:q(`element_disappeared`),payload:V({elementId:j().uuid()})}),Pl=V({event_type:q(`review_item_created`),payload:V({reviewItemId:j().uuid(),kind:j()})}),Fl=V({event_type:q(`fallback_started`),payload:V({parentRunId:j().uuid(),reason:j().optional(),stepId:j().uuid().optional(),triggerReason:j().optional()})}),Il=V({event_type:q(`fallback_completed`),payload:V({result:R().optional(),callsUsed:F().int().min(0).optional()})}),Ll=V({event_type:q(`fallback_budget_exhausted`),payload:V({budgetMs:F().int().min(0).optional(),reason:j().optional(),callsMade:F().int().min(0).optional()})}),Rl=V({event_type:q(`ensemble_sample`),payload:V({sampleN:F().int().min(1),modelResponse:R().optional(),agreed:I().optional(),eventRef:j().uuid().optional()})}),zl=V({event_type:q(`credits_update`),payload:V({runId:j().uuid(),stepIndex:F().int().nonnegative(),deltaCredits:F().int(),totalCredits:F().int().nonnegative(),lastCallType:j().min(1)})}),Bl=V({event_type:q(`region_expanded`),payload:V({runId:N(),requestId:N(),regionId:j(),sizeBytes:F().int().nonnegative().max(nl),nodeCount:F().int().nonnegative().max(400),subtreeHash:j(),seq:F().int().nonnegative()})}),Vl=V({event_type:q(`tool_use_requested`),payload:V({runId:N(),requestId:N(),toolCallId:j().min(1),tool:K([`expand_region`,`zoom_out`]),args:W(`tool`,[V({tool:q(`expand_region`),regionId:j().min(1).max(256),maxDepth:F().int().min(1).max(6)}),V({tool:q(`zoom_out`)})]),seq:F().int().nonnegative()})}),Hl=V({event_type:q(`agent_heal_started`),payload:V({...Y,stepIndex:F().int().nonnegative(),requestId:j().uuid(),confidence:F().min(0).max(1).optional(),verdict:K([`moved`,`gone`]).optional(),mutationKind:K([`rebind`,`insert`,`delete`]).optional(),tier_3_consulted:I()})}),Ul=V({event_type:q(`agent_heal_succeeded`),payload:V({...Y,stepIndex:F().int().nonnegative(),requestId:j().uuid(),confidence:F().min(0).max(1).optional(),verdict:K([`moved`,`gone`]).optional(),mutationKind:K([`rebind`,`insert`,`delete`]).optional(),overrideStatus:K([`candidate`,`accepted`]).optional(),signatureVersionId:j().uuid().optional(),overrideId:j().uuid().optional(),insertedStepId:j().uuid().optional(),orderIndex:F().int().nonnegative().optional(),deletedStepId:j().uuid().optional(),tier_3_consulted:I()})}),Wl=V({event_type:q(`agent_heal_failed`),payload:V({reason:j(),requestId:j().uuid().optional(),stepId:j().uuid().optional(),mutationKind:K([`rebind`,`insert`,`delete`]).optional(),tier_3_consulted:I().optional()})}),Gl=V({requestId:j().uuid(),stepIndex:F().int().nonnegative(),...Y,proposal:V({elementHints:V({role:j(),accessibleName:j()}).passthrough(),confidence:F().min(0).max(1),bbox:V({x:F(),y:F(),w:F(),h:F()}),reasoning:j()}),candidates:B(V({}).passthrough()).nullable().optional(),gateReason:j(),redactedScreenshotHash:j().nullable()}),Kl=V({event_type:q(`agent_action_proposed`),payload:Gl}),ql=V({event_type:q(`agent_recovery_inserted_step`),payload:V({stepId:j().uuid().optional(),recoveryReason:j().optional()})}),Jl=V({event_type:q(`agent_turn_decided`),payload:V({seq:F().int().nonnegative(),turnIndex:F().int().nonnegative(),stepIndex:F().int().nonnegative(),...Y,brainTurn:R().refine(e=>e!==void 0,{message:`brainTurn is required \u2014 a turn event without a brain transcript is not valid`}),creditsUsed:F().int().nonnegative().optional(),finishFactsEventSeq:F().int().positive().nullable().optional()})}),Yl=V({event_type:q(`agent_tool_executed`),payload:V({seq:F().int().nonnegative(),actionId:j(),actionType:j(),turnIndex:F().int().nonnegative(),stepIndex:F().int().nonnegative(),...Y,action:fc,result:V({status:q(`executed`),bindingCandidate:Cc.nullable()}),durationMs:F().int().nonnegative().optional()})}),Xl=K([`ai.provider_auth_failed`,`ai.provider_rate_limited`,`ai.provider_unavailable`,`ai.provider_quota_exhausted`,`ai.provider_model_not_in_plan`,`ai.provider_region_blocked`,`ai.provider_error`]),Zl=Xl.options,Ql=V({event_type:q(`agent_brain_attempt_failed`),payload:V({...Y,stepIndex:F().int().nonnegative(),turnIndex:F().int().nonnegative(),errorCode:K([`agentic.brain_output_invalid`,`agentic.brain_turn_timeout`,...Zl]),finishReason:j().optional(),textSnippet:j().max(2048).optional(),zodIssuePaths:B(j()).optional()})}),$l=V({event_type:q(`agent_step_converted`),payload:V({sourceStepId:j().uuid(),sourceText:j().min(1),textHash:j().min(1),modelVersion:j().nullable(),promptVersion:j(),convertedStepIds:B(N()).min(1),actions:B(Mc).min(1),beforeState:V({actionType:q(`text_step`),customName:j().nullable(),expectedResultCount:F().int().min(0)})}).superRefine((e,t)=>{new Set(e.convertedStepIds).size!==e.convertedStepIds.length&&t.addIssue({code:`custom`,path:[`convertedStepIds`],message:`convertedStepIds must not contain duplicates`}),e.convertedStepIds.length>0&&e.convertedStepIds[e.convertedStepIds.length-1]!==e.sourceStepId&&t.addIssue({code:`custom`,path:[`convertedStepIds`,e.convertedStepIds.length-1],message:`convertedStepIds must end with sourceStepId`})})}),eu=V({event_type:q(`conversion_stale_step`),payload:V({sourceStepId:j().uuid(),expectedTextHash:j(),actualTextHash:j().nullable(),reason:K([`text_edited`,`lock_set`,`not_text_step`,`survivor_marked`])})}),tu=V({expectedResultId:j().uuid(),text:j().min(1),verification:K([`browser`,`manual`]),evidence:j().min(1).nullable(),target:W(`kind`,[V({kind:q(`produced_step`),stepId:j().uuid(),ordinal:F().int().min(0),afterActionId:j().min(1)}),V({kind:q(`previous_step`),stepId:j().uuid()}),V({kind:q(`carrier`),stepId:j().uuid()})])}),nu=V({event_type:q(`expected_results_distributed`),payload:V({sourceStepId:j().uuid(),sourceText:j().min(1),textHash:j().min(1),proposalEventSeq:F().int().min(1),stepIndex:F().int().min(0),occurrence:J.shape.occurrence.optional(),producedStepIds:B(j().uuid()),expectedResults:B(tu).min(1),fold:V({carrierDeleted:q(!0),totalStepsAfter:F().int().min(0)}).nullable(),keptReason:Nc.nullable(),reason:j().min(1).nullable()}).superRefine((e,t)=>{let n=e.producedStepIds.length>0,r=e.fold!==null;if([n,r,e.keptReason!==null].filter(Boolean).length!==1){t.addIssue({code:`custom`,path:[`fold`],message:`exactly one outcome must be stated: non-empty producedStepIds, a fold, or a keptReason`});return}let i=n?`produced_step`:r?`previous_step`:`carrier`;for(let[n,r]of e.expectedResults.entries())r.target.kind!==i&&t.addIssue({code:`custom`,path:[`expectedResults`,n,`target`,`kind`],message:`target.kind must be '${i}' for this outcome`});n&&(new Set(e.producedStepIds).size!==e.producedStepIds.length&&t.addIssue({code:`custom`,path:[`producedStepIds`],message:`producedStepIds must not contain duplicates`}),e.producedStepIds[e.producedStepIds.length-1]!==e.sourceStepId&&t.addIssue({code:`custom`,path:[`producedStepIds`,e.producedStepIds.length-1],message:`producedStepIds must end with sourceStepId`}))})}),ru=V({event_type:q(`run_instructions_attached`),payload:V({present:q(!0),version:q(1)})}),iu=V({event_type:q(`run_context_access`),payload:V({accessMode:K([`push`,`tool`,`direct`]),tool:K([`get_run_instructions`,`get_scenario_context`]).nullable(),status:K([`available`,`absent`,`error`]),consumer:K([`actor`,`supervisor`]),turnIndex:F().int().min(0).nullable(),stepIndex:F().int().min(0).nullable(),stepId:J.shape.stepId.nullable().optional(),occurrence:J.shape.occurrence.nullable().optional()}).superRefine((e,t)=>{if(e.stepId===void 0&&e.occurrence===void 0)return;let n=[e.stepIndex,e.stepId,e.occurrence],r=n.every(e=>e===null),i=n.every(e=>e!=null);!r&&!i&&t.addIssue({code:`custom`,path:[`stepIndex`],message:`run_context_access stepIndex, stepId and occurrence must be null together or present together`})})}),au=V({event_type:q(`ai_recovery_resolved`),payload:Jc}),ou=V({event_type:q(`ai_recovery_failed`),payload:Jc}),su=V({event_type:q(`recorded_navigate_replayed`),payload:V({stepIndex:F().int().nonnegative(),...Y,requestId:N(),recordedTargetUrl:j().min(1),urlBefore:P(),urlAfter:P(),navigated:I(),attempts:F().int().min(1),domSettleMs:F().int().nonnegative(),pageId:N()})}),cu={stepIndex:F().int().nonnegative(),...Y,requestId:N(),elementId:N().nullable(),urlBefore:P(),urlAfter:P(),domSettleMs:F().int().nonnegative()},lu=j().min(1).refine(e=>e!==`navigate`&&e!==`assert`),uu=V({code:Xc,preFired:I()}),du=W(`replayStatus`,[V({...cu,actionType:lu,replayStatus:q(`executed`),skipReason:L()}),V({...cu,actionType:q(`assert`),replayStatus:q(`skipped_assert`),skipReason:q(`binding_mode_assert`)}),V({...cu,actionType:lu,replayStatus:q(`failed`),failure:uu,skipReason:L(),domSettleMs:q(0)})]);W(`event_type`,[il,al,ol,sl,cl,ll,ul,dl,_l,vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,Kl,ql,Hl,Ul,Wl,zl,Bl,Vl,Jl,Yl,Ql,$l,eu,nu,ru,iu,au,ou,su,V({event_type:q(`recorded_step_replayed`),payload:du})]);var fu=K([`url_secret_navigation_authority_mismatch`,`url_secret_evaluation_failed`,`url_secret_mask_blocked`,`agentic.secret_surface_unavailable`,`agentic_run.url_secret_masking_failed`,`runtime_secrets_lost_on_restart`,`runtime_state_lost`,`runtime_fault`,`server_refused`,`executor_protocol_error`,`scenario_changed`,`scenario_unavailable`,`user_changed`,`user_signed_out`,`step_edit_locked`,`native_dialog_unreachable`]).extract([`url_secret_navigation_authority_mismatch`,`url_secret_evaluation_failed`,`url_secret_mask_blocked`,`agentic.secret_surface_unavailable`,`agentic_run.url_secret_masking_failed`]);fu.options;var pu=V({cause:K([`company_changed`,`signed_out_unreported`,`session_expired`])}).strict();V({code:fu}).strict(),V({errorClass:j().regex(/^[A-Za-z0-9_.:-]{1,80}$/)}).strict(),V({httpStatus:F().int().min(400).max(499),errorCode:j().regex(/^[a-z0-9_.]{1,80}$/).nullable()}).strict(),V({op:As,code:Ms}).strict();var mu=W(`kind`,[V({kind:q(`provider_error`),code:U([Xl,L()])}).strict(),V({kind:q(`limit`),limitSec:F().int().min(1)}).strict(),V({kind:q(`give_up`),explanation:U([j().min(1),L()])}).strict()]),hu=[`element-missing`,`budget-exhausted`,`vision-rate-limit`,`network`,`tab-closed`,`llm-response-invalid`,`agent-launch`,`propose-step-timeout`,`outcome-wrong-effect`,`give-up`,`unsupported-step`,`navigation-resume-refused`,`recorded-navigate-unresolvable`,`recorded-navigate-unreachable`],gu=[`runtime-state-lost`,`runtime-secrets-lost`,`scenario-changed`,`scenario-unavailable`,`user-changed`,`user-signed-out`,`secret-not-persistable`,`step-edit-locked`,`native-dialog-unreachable`,`url-secret-refused`,`runtime-fault`,`server-refused`,`executor-protocol-error`,`step-turn-limit`,`step-time-limit`,`client-outdated`,`lease-expired`,`runner-disconnected`,`queue-executor-lost`,`set-aside`,`ai-disabled`,`runner-capability-mismatch`,`user-credit-limit-reached`],_u=[...hu,...gu],vu=`propose-step-provider-error`,yu=`agent-job-time-limit`,bu=`recorded-step-unreplayable`,xu=K([..._u,vu,yu,bu]),Su=K(_u),Cu={errorMessage:j().optional(),countdownSeconds:F().int().optional(),retryAttempts:V({current:F().int(),max:F().int()}).optional(),detail:j().optional()},wu=V({reason:Su,...Cu}),Tu=V({reason:q(vu),providerCode:Xl.optional(),...Cu}),Eu=V({reason:q(yu),limitSec:F().int().min(1),...Cu}),Du=I().optional(),Ou=V({reason:q(bu),detail:Xc,preFired:Du,errorMessage:z().optional(),countdownSeconds:z().optional(),retryAttempts:z().optional()});V({reason:q(bu),detail:q(Yc),preFired:Du,errorMessage:z().optional(),countdownSeconds:z().optional(),retryAttempts:z().optional()}),W(`reason`,[wu,Tu,Eu,Ou]),W(`variant`,[V({variant:q(`captcha`)}),V({variant:q(`permission`),permission:V({type:K([`geolocation`,`notifications`,`camera`,`microphone`])})})]);var ku=K([`created`,`running`,`paused`,`completed`,`failed`,`cancelled`]),Au=K([`mapping`,`explorer`,`agentic_fallback`,`agentic`]),ju=V({totalSteps:F().int().nonnegative(),mapped:F().int().nonnegative(),reviewQueued:F().int().nonnegative(),failed:F().int().nonnegative(),inProgress:F().int().nonnegative()}),Mu=V({stepIndex:F().int().nonnegative(),stepId:N()}),Nu=K(/* @__PURE__ */ `user-cancel.fail-element-missing.fail-budget-exhausted.fail-vision-rate-limit.fail-network.fail-tab-closed.fail-llm-response-invalid.fail-credits-cap-exceeded.fail-captcha-aborted.fail-tool-cap-exceeded.fail-agent-launch.fail-propose-step-timeout.fail-outcome-wrong-effect.fail-give-up.fail-propose-step-provider-error.fail-unsupported-step.fail-recorded-navigate-unresolvable.fail-recorded-navigate-unreachable.fail-recorded-step-unreplayable.fail-navigation-resume-refused.fail-runtime-state-lost.fail-runtime-secrets-lost.fail-scenario-changed.fail-scenario-unavailable.fail-user-changed.fail-user-signed-out.fail-secret-not-persistable.fail-step-edit-locked.fail-native-dialog-unreachable.fail-url-secret-refused.fail-runtime-fault.fail-server-refused.fail-executor-protocol-error.fail-step-turn-limit.fail-step-time-limit.fail-client-outdated.fail-lease-expired.fail-runner-disconnected.fail-agent-job-time-limit.fail-queue-executor-lost.fail-set-aside.fail-ai-disabled.fail-runner-capability-mismatch.fail-user-credit-limit-reached`.split(`.`)),Pu=V({runId:N(),totalCredits:F().int().nonnegative(),capCredits:F().int().nonnegative().nullable(),capped:I(),aggregatedAt:j().datetime()}).refine(e=>e.capped===(e.capCredits!==null),{message:`capped must equal (capCredits !== null) \u2014 0 is a real cap, null is the only uncapped shape`}),Fu=V({version:q(1),expectedSteps:F().int().nonnegative(),resolvedSteps:F().int().nonnegative()}),Iu=V({from:j().datetime(),to:U([j().datetime(),L()]),retries:F().int().nonnegative(),providerStatus:U([F().int().min(100).max(599),L()])}).strict();V({runId:N(),scenarioId:N(),projectId:N(),status:ku,orchestratorType:Au,startedAt:j().datetime().nullable(),completedAt:j().datetime().nullable(),cancelledBy:N().nullable(),errorMessage:j().nullable(),counts:ju,secretInputHints:B(Mu),totalSteps:F().int().nonnegative(),committedBindings:F().int().nonnegative(),durationSeconds:F().int().nonnegative().nullable(),costSummary:Pu,abortReason:Nu.optional(),abortParams:U([mu,L()]),providerWaits:B(Iu),awaitingAnswer:U([V({questionId:N(),conversationId:U([N(),L()])}).strict(),L()]),reviewInEditorUrl:j(),runnerLastSeenAt:j().datetime().nullable(),scenarioRunId:j().uuid().nullable(),elapsedSinceLastEventMs:F().int().nonnegative(),resumeStepIndex:F().int().nonnegative().nullable(),appliedAgenticStepIds:B(j().uuid()).nullable(),turnsUsedThisStep:F().int().nonnegative().nullable(),turnsUsedThisRun:F().int().nonnegative().nullable(),stepStartedAt:j().datetime().nullable(),runStartedAt:j().datetime().nullable(),ownedTabIds:B(F().int().min(1)).nullable(),completionCoverage:Fu.nullable(),manualChecks:F().int().nonnegative()});var Lu=V({projectId:N(),scenarioId:N(),orchestratorType:q(`mapping`),currentUrl:j().url().optional(),config:V({startUrl:j().url().optional()}).default({})});V({id:N(),status:q(`cancelled`),finishedAt:j().datetime()}),V({reason:xu.extract([`agent-launch`,`unsupported-step`,`tab-closed`,`runtime-state-lost`,`runtime-secrets-lost`,`scenario-changed`,`scenario-unavailable`,`user-changed`,`user-signed-out`,`step-edit-locked`,`native-dialog-unreachable`,`url-secret-refused`,`runtime-fault`,`server-refused`,`executor-protocol-error`])}),V({id:N()}),V({fromSeq:Co().int().nonnegative().optional(),limit:Co().int().min(1).max(500).default(100),eventType:j().max(40).optional()}),V({events:B(V({id:N(),runId:N().nullable(),seq:F().int().nonnegative().nullable(),eventType:j(),recordedAt:j().datetime(),actorType:K([`system`,`user`,`llm`,`runner`]),actorUserId:N().nullable(),scenarioId:N().nullable(),stepId:N().nullable(),pageId:N().nullable(),elementId:N().nullable(),payload:R(),payloadVersion:j()})),nextSeq:F().int().nullable(),total:F().int().nonnegative()});var Ru=j().trim().min(1).max(60).refine(e=>!/\p{Cc}/u.test(e),{message:`One line, no line breaks`}),zu=V({kind:q(`make_auto`),scenarioCount:F().int().min(1),scenarioName:j().nullable()}).strict().refine(e=>e.scenarioCount===1==(e.scenarioName!==null),{message:`scenarioName is present exactly when scenarioCount is 1`,path:[`scenarioName`]}),Bu=V({kind:q(`atlas`),projectName:j()}).strict(),Vu=V({kind:q(`preset`),presetId:Ko,name:Ru.nullable(),briefLine:j().min(1)}).strict(),Hu=W(`kind`,[zu,Bu,Vu]),Uu=W(`kind`,[V({kind:q(`project`)}).strict(),V({kind:q(`scenarios`),count:F().int().min(1)}).strict(),V({kind:q(`test_run`),testRunId:N(),number:F().int().min(1),name:j().nullable()}).strict(),V({kind:q(`test_plan`),testPlanId:N(),name:j()}).strict()]),Wu=V({total:F().int().min(0),bugs:F().int().min(0),undecided:F().int().min(0)}).strict(),Gu=V({done:F().int().min(0),total:F().int().min(1)}).strict().refine(e=>e.done<=e.total,{message:`done is at most total`,path:[`done`]}),Ku=2e3,qu=`Entry URL is longer than ${Ku} characters once normalised (spaces and non-ASCII characters are percent-encoded); shorten it`;function Ju(e){return!URL.canParse(e)||new URL(e).href.length<=Ku}var Yu=j().max(Ku).refine(Ju,{message:qu}),Xu=[`ask`,`bypass`],Zu=[`normal`,`thinking`,`max`],Qu=`normal`;function $u(e){return e!==`normal`}var ed=2147483647,td=K(Zu),nd=K([`normal`,`thinking`]);K([`normal`,`thinking`]);var rd=F().int().min(1).max(ed),id=W(`effort`,[V({effort:nd}).strict(),V({effort:q(`max`),maxAgents:rd}).strict()]),ad=W(`effort`,[V({effort:nd,maxAgents:L()}),V({effort:q(`max`),maxAgents:rd})]),od=V({maxAgents:rd}).strict(),sd=[`make_auto`,`bind_elements`],cd=[`admin_disabled`,`credits_exhausted`,`personal_limit_reached`,`model_unavailable`],ld=V({isUnassigned:I(),hasUnboundElementSteps:I(),hasUnlockedTextSteps:I()}).strict().refine(e=>e.isUnassigned||e.hasUnboundElementSteps||e.hasUnlockedTextSteps,{message:`needs_binding must name at least one true cause`}),ud=V({status:q(`needs_binding`),offeredActions:B(K(sd)).min(1),causes:ld}).strict(),dd=V({status:q(`no_steps`)}).strict(),fd=V({status:q(`ai_unavailable_for_text_steps`),details:V({cause:K(cd)}).strict()}).strict(),pd=W(`status`,[ud,dd,fd,V({status:q(`ready`)}).strict()]),md=W(`status`,[ud,dd,fd]);function hd(e){return e.status===`needs_binding`&&e.offeredActions.includes(`make_auto`)}var gd=Do;V({scenarioIds:B(N()).min(1).max(gd)}).strict();var _d=V({error_code:q(`scenarios.not_found`),message:j()}).strict(),vd=V({position:F().int().min(0),scenarioId:N(),outcome:q(`rejected`),error:_d}).strict(),yd=W(`outcome`,[V({position:F().int().min(0),scenarioId:N(),outcome:q(`decided`),decision:pd}).strict(),vd]),bd=V({items:B(yd)}).strict();wd(pd);var xd=wd(md),Sd=wd(yd),Cd=wd(bd);function wd(e){return Td(e)}function Td(e){if(e instanceof Ia)return Ed(e);if(e instanceof za){let t=e.options.map(Ed);return W(e._zod.def.discriminator,t)}if(e instanceof Fa)return e.clone({...e._zod.def,element:Td(e.element)});switch(e._zod.def.type){case`literal`:case`enum`:case`string`:case`number`:case`boolean`:return e;default:throw Error(`clientVariantOf: cannot derive a client variant of a '${e._zod.def.type}' schema`)}}function Ed(e){if(!(e instanceof Ia))throw Error(`clientVariantOf: a discriminated union option must be an object, got '${e._zod.def.type}'`);let t=V(Object.fromEntries(Object.entries(e.shape).map(([e,t])=>[e,Td(t)])));return t.clone({...t._zod.def,checks:e._zod.def.checks})}var Dd=Do,Od=K([`running`,`paused`,`completed`,`cancelled`]),kd=[`running`,`paused`],Ad=K([`executor_lost`,`awaiting_answer`]);K([`extension`,`agent`]);var jd=[`queued`,`running`,`awaiting_answer`,`completed`,`failed`,`skipped`,`cancelled`],Md=K(jd),Nd=[`completed`,`failed`,`skipped`,`cancelled`],Pd=[`already_queued`,`no_steps`,`binding_not_needed`,`ai_unavailable`,`test_run_open`,`scenario_busy`,`scenario_not_found`],Fd=[`run_failed`,`launch_refused`,`executor_lost`,`server_error`],Id=[`cancelled_by_user`];K([...Pd,...Fd,...Id]);var Ld=[`already_queued`,`no_steps`,`binding_not_needed`,`ai_unavailable`,`test_run_open`],Rd=K(Pd),zd=K(Fd),Bd=K(Id),Vd=K(Ld),Hd=K(cd),Ud=V({id:N(),status:ku,abortReason:U([Nu,L()]),abortParams:U([mu,L()]),totalSteps:F().int().min(0),boundSteps:F().int().min(0),stoppedAtStep:F().int().min(1).nullable(),manualChecks:F().int().min(0)}).strict(),Wd={reason:L(),aiUnavailableCause:L(),launchErrorCode:L(),holderRunId:L()};function Gd(e){let{open:t,final:n,awaiting:r}=e;return{queued:V({...t,status:q(`queued`),...Wd}).strict(),running:V({...t,status:q(`running`),...Wd}).strict(),awaiting_answer:V({...t,...r,status:q(`awaiting_answer`),...Wd}).strict(),completed:V({...n,status:q(`completed`),...Wd}).strict(),failed:W(`reason`,[V({...n,status:q(`failed`),reason:q(`launch_refused`),aiUnavailableCause:L(),launchErrorCode:j(),holderRunId:L()}).strict(),V({...n,status:q(`failed`),reason:zd.exclude([`launch_refused`]),aiUnavailableCause:L(),launchErrorCode:L(),holderRunId:L()}).strict()]),skipped:W(`reason`,[V({...n,status:q(`skipped`),reason:q(`ai_unavailable`),aiUnavailableCause:Hd,launchErrorCode:L(),holderRunId:L()}).strict(),V({...n,status:q(`skipped`),reason:q(`scenario_busy`),aiUnavailableCause:L(),launchErrorCode:L(),holderRunId:U([N(),L()])}).strict(),V({...n,status:q(`skipped`),reason:Rd.exclude([`ai_unavailable`,`scenario_busy`]),aiUnavailableCause:L(),launchErrorCode:L(),holderRunId:L()}).strict()]),cancelled:V({...n,status:q(`cancelled`),reason:Bd,aiUnavailableCause:L(),launchErrorCode:L(),holderRunId:L()}).strict()}}function Kd(e){let{queued:t,running:n,awaiting_answer:r,completed:i,failed:a,skipped:o,cancelled:s}=Gd({...e,awaiting:{}});return W(`status`,[t,n,r,i,a,o,s])}Kd({open:{},final:{}});var qd=V({code:K([`executor_lost`]),aiRunId:U([N(),L()])}).strict(),Jd={id:N(),queueId:N(),position:F().int().min(0),scenarioId:N(),scenarioName:j(),hasInstructions:I(),run:Ud.nullable(),lastAttempt:qd.nullable(),startedAt:O().nullable(),createdAt:O()},Yd=W(`addressee`,[V({questionId:N(),addressee:q(`user`),conversationId:N().nullable()}).strict(),V({questionId:N(),addressee:q(`lead`)}).strict()]),Z=Gd({open:{...Jd,finishedAt:L()},final:{...Jd,finishedAt:O()},awaiting:{awaitingAnswer:Yd}}),Xd=W(`status`,[Z.queued,Z.running,Z.awaiting_answer,Z.completed,Z.failed,Z.skipped,Z.cancelled]),Zd=Z.running,Qd=V({queued:F().int().min(0),running:F().int().min(0),awaiting_answer:F().int().min(0),completed:F().int().min(0),failed:F().int().min(0),skipped:F().int().min(0),cancelled:F().int().min(0),total:F().int().min(0)}).strict(),$d=V({kind:q(`extension`),executorId:N(),leaseExpiresAt:O()}).strict(),ef={kind:q(`agent`),agentId:N(),agentJobId:N()},tf=U([$d,V({...ef,executorId:N(),leaseExpiresAt:O()}).strict(),V({...ef,executorId:L(),leaseExpiresAt:L()}).strict()]),nf={id:N(),projectId:N(),initiatorUserId:N(),environmentId:N().nullable(),entryUrl:j().nullable(),counts:Qd,currentItem:Zd.nullable(),revision:F().int().min(0),createdAt:O(),updatedAt:O()},rf=V({...nf,status:q(`running`),executor:tf,pauseReason:L(),finishedAt:L()}).strict(),af=V({...nf,status:q(`paused`),executor:L(),pauseReason:Ad,finishedAt:L()}).strict(),of=V({...nf,status:q(`completed`),executor:L(),pauseReason:L(),finishedAt:O()}).strict(),sf=W(`status`,[rf,af,of,V({...nf,status:q(`cancelled`),executor:L(),pauseReason:L(),finishedAt:O()}).strict()]),cf=B(N()).min(1).max(Dd),lf=j().nullable(),uf=W(`kind`,[V({kind:q(`extension`),executorId:N()}).strict(),V({kind:q(`agent`),agentId:N(),headful:I()}).strict()]);V({id:N()}).strict(),V({id:N(),itemId:N()}).strict(),V({projectId:N(),scenarioIds:cf,queueId:N().nullable()}).strict();var df={position:F().int().min(0),scenarioId:N()},ff=W(`outcome`,[V({...df,outcome:q(`admitted`)}).strict(),W(`reason`,[V({...df,outcome:q(`skipped`),reason:q(`ai_unavailable`),aiUnavailableCause:Hd}).strict(),V({...df,outcome:q(`skipped`),reason:Vd.exclude([`ai_unavailable`]),aiUnavailableCause:L()}).strict()]),vd]),pf=V({items:B(ff)}).strict(),mf=V({clientRequestId:N(),projectId:N(),scenarioIds:cf,instructions:lf,environmentId:N().nullable(),entryUrl:Yu.nullable(),executor:uf,effort:nd}).strict();V({clientRequestId:N(),scenarioIds:cf,instructions:lf}).strict();var hf=V({queue:sf,added:B(Xd)}).strict(),gf=V({queue:sf,item:Xd}).strict();V({executor:uf}).strict();var _f=V({expiresAt:O()}).strict();V({executorId:N(),runConfig:Lu.shape.config.unwrap()}).strict();var vf=V({item:V({...Zd.shape,run:Ud}).strict(),runId:N(),startUrl:P({protocol:/^https?$/}).nullable()}).strict(),yf=U([V({queue:rf,lease:_f,work:vf}).strict(),V({queue:rf,lease:_f,work:L()}).strict(),V({queue:of,lease:_f,work:L()}).strict()]);V({executorId:N()}).strict();var bf=V({lease:_f}).strict(),xf=V({items:B(sf),total:F().int().min(0),limit:F().int().min(1),offset:F().int().min(0)}).strict(),Sf=V({items:B(Xd),total:F().int().min(0),limit:F().int().min(1),offset:F().int().min(0)}).strict();K([`make_auto_queues.not_found`,`make_auto_queues.scenarios_not_found`,`make_auto_queues.not_initiator`,`make_auto_queues.not_live`,`make_auto_queues.item_not_live`,`make_auto_queues.not_paused`,`make_auto_queues.not_running`,`make_auto_queues.executor_mismatch`,`make_auto_queues.executor_forbidden`,`make_auto_queues.idempotency_conflict`,`make_auto_queues.item_start_unavailable`]),V({scenarioIds:B(N()).min(1)}).strict(),V({status:Od}).strict(),V({status:Md}).strict(),V({clientRequestId:N()}).strict(),V({leaseExpiresAt:O()}).strict();var Cf=[`managed`,`company`,`personal`];function wf(e){return`/ai-settings/model-preferences/${e}`}function Tf(e){return{get:(t,n)=>e(wf(t),{signal:n==null?void 0:n.signal}),select:(t,n,r)=>e(wf(t),{method:`PATCH`,body:JSON.stringify({selection:n}),signal:r==null?void 0:r.signal}),reset:(t,n)=>e(wf(t),{method:`PATCH`,body:JSON.stringify({selection:null}),signal:n==null?void 0:n.signal})}}var Ef=K([`company`,`project`,`environment`,`scenario`]),Df=[`company`,`project`,`environment`],Of=K(Df),kf=V({id:N(),name:j().min(1)}),Af=V({id:N(),name:j().min(1)}),jf=V({environmentId:N(),variableNames:B(j().regex(Ns)).min(1).refine(e=>new Set(e).size===e.length,`variableNames must be unique`),role:j().trim().min(1).nullable()}).strict().omit({environmentId:!0}),Mf=W(`state`,[V({name:j().min(1),state:q(`present`),isSecret:I(),valueSet:I(),scope:Of}),V({name:j().min(1),state:q(`missing`)})]),Nf=V({environment:kf,role:j().nullable(),variables:B(Mf).min(1)}),Pf=W(`kind`,[V({kind:q(`variable`),scope:Ef,environment:kf.nullable(),scenario:Af.nullable(),variableName:j().min(1),viaRunBinding:I()}).refine(e=>e.scope===`environment`==(e.environment!==null),{message:`environment must be set if and only if scope is 'environment'`,path:[`environment`]}).refine(e=>e.scope===`scenario`==(e.scenario!==null),{message:`scenario must be set if and only if scope is 'scenario'`,path:[`scenario`]}),V({kind:q(`chat_message`),setAt:j().datetime()})]),Ff=V({variableName:j().min(1),source:Pf,firstUsedAt:j().datetime(),lastUsedAt:j().datetime(),firstUsedStep:F().int().min(0).nullable(),lastUsedStep:F().int().min(0).nullable()}).refine(e=>e.firstUsedStep===null==(e.lastUsedStep===null),{message:`firstUsedStep and lastUsedStep must be both null or both set`,path:[`lastUsedStep`]}).refine(e=>e.firstUsedStep===null||e.lastUsedStep===null||e.lastUsedStep>=e.firstUsedStep,{message:`lastUsedStep must be \u2265 firstUsedStep`,path:[`lastUsedStep`]});V({unitId:N(),unitKind:ts,environment:kf.nullable(),entryUrl:j().min(1).nullable(),credentialRef:Nf.nullable(),uses:B(Ff)}).refine(e=>e.unitKind!==`atlas`||e.environment!==null&&e.entryUrl!==null,{message:`an atlas unit always has environment and entryUrl`,path:[`environment`]});var If=[`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`OPTIONS`,`HEAD`],Lf=[`none`,`json`,`raw`,`form-data`,`x-www-form-urlencoded`],Rf=[`none`,`bearer`,`basic`,`apiKey`],zf=[`status_code`,`header`,`body_jsonpath`,`body_regex`,`response_time`],Bf=[`captured_sync`,`manual_save`,`import_postman`,`import_openapi`,`import_curl`,`import_swagger`,`builder_save`,`history_save`],Vf=[`manual`,`generated`],Hf=[`equals`,`not_equals`,`greater_than`,`less_than`,`contains`,`exists`,`not_exists`,`type_is`,`matches`,`not_matches`],Uf=[`capture`,`user`],Wf=[`cell_missing`,`address_required`,`not_configured`],Gf=[`host`,`pending`,`group`],Kf=[`text_free`,`text_contains`,`text_equals`,`assert_text`,`element_visible`,`element_exists`,`element_not_exists`,`input_value`],qf=[`manual`,`recorded`,`ai`],Jf=[`unresolved`,`resolved`,`needs_review`],Yf=[`ai`,`user`],Xf=[`no_candidate`,`low_confidence`,`no_page`,`no_hint`,`llm_error`],Zf=V({assertionType:K(Kf),assertionConfig:G(j(),R()),label:U([j(),L()]),text:U([j(),L()])}).strict(),Qf={text_free:[`text_free`],text:[`text_contains`,`text_equals`],element:[`element_visible`,`element_exists`,`element_not_exists`],input:[`input_value`],legacy:[`assert_text`]};function $f(e){for(let t of Object.keys(Qf))if(Qf[t].includes(e))return t;throw Error(`Unknown assertion type: ${String(e)}`)}var ep=/* @__PURE__ */ new Set([`assert_text`]);function tp(e){return ep.has(e)}function np(e,t){if(e===t)return!0;let n=$f(e),r=$f(t);return n===r&&n!==`legacy`&&r!==`legacy`&&n!==`text_free`&&r!==`text_free`}var rp=K([`critical`,`high`,`medium`,`low`]),ip=K([`secret_on_screen`,`window_not_in_front`,`capture_refused`,`wrong_tab`,`host_lost`,`upload_failed`,`launch_ended`]),ap=j().min(1).refine(e=>{let t;try{t=new URL(e).protocol}catch{return!1}return t===`http:`||t===`https:`},{message:`must be an absolute http(s) URL`}),op=[`atlas_turn`,`run_step`,`server_step`],sp=K([`secret_on_screen`,`window_not_in_front`,`capture_refused`,`wrong_tab`,`upload_failed`]),cp=W(`kind`,[V({kind:q(`atlas_turn`),atlasRunId:N(),contextMessageId:N(),callIndex:F().int().min(0),title:j().min(1),observed:j().min(1),expected:j().min(1).nullable(),severity:rp}).strict(),V({kind:q(`run_step`),scenarioRunId:N(),stepId:N(),stepIndex:F().int().min(0)}).strict(),V({kind:q(`server_step`),scenarioRunId:N(),apiExecutionId:N(),stepId:N().nullable(),planItemId:N().nullable()}).strict()]),lp=W(`state`,[V({state:q(`awaiting`)}).strict(),V({state:q(`ready`),screenshotUrl:j().startsWith(`/api/bug-candidates/`)}).strict(),V({state:q(`unavailable`),reason:ip}).strict(),V({state:q(`no_screen`)}).strict()]),up=W(`state`,[V({state:q(`open`)}).strict(),V({state:q(`filed`),bugId:N(),bugNumber:F().int().min(1)}).strict(),V({state:q(`duplicate`),bugId:N(),bugNumber:F().int().min(1)}).strict(),V({state:q(`confirmed`),note:j().min(1)}).strict(),V({state:q(`dismissed`),reason:j().min(1)}).strict()]),dp=V({type:K(zf),comparator:K(Hf),target:U([j(),L()]),expected:U([j(),L()])}).strict(),fp=W(`kind`,[V({kind:q(`atlas_turn`),apiCapture:K([`on`,`off`])}).strict(),V({kind:q(`run_step`),actionType:j().min(1),failureCode:U([j().min(1),L()]),stepName:j(),actual:U([j(),L()]),failedCheck:U([Zf,L()])}).strict(),V({kind:q(`server_step`),historyId:N(),method:j().min(1),url:j().min(1),responseStatus:F().int(),responseStatusText:U([j(),L()]),assertionsPassed:F().int().min(0),assertionsTotal:F().int().min(0),failedChecks:B(dp).min(1)}).strict()]),pp=W(`kind`,[V({kind:q(`atlas_turn`),agentNumber:F().int().min(1),title:j().min(1).max(60).nullable(),stepNumber:F().int().min(0)}).strict(),V({kind:q(`run_step`),agentNumber:F().int().min(1),scenarioName:U([j(),L()])}).strict(),V({kind:q(`server_step`),savedRequestId:U([N(),L()]),requestName:U([j(),L()]),testRun:U([V({id:N(),number:F().int().min(1),name:U([j(),L()])}).strict(),L()])}).strict()]),mp=V({id:N(),workflowId:N(),projectId:N(),source:cp,pageUrl:U([ap,L()]),capture:lp,status:up,evidence:fp,origin:pp,createdAt:O()}).strict(),hp=V({items:B(mp),total:F().int().min(0),limit:F().int().min(1),offset:F().int().min(0)}).strict();V({clientCandidateId:N(),scenarioRunId:N(),stepId:N(),pageUrl:ap}).strict(),V({reason:sp}).strict(),V({bugCandidateId:N()}).strict();var gp=`x-workflow-host-id`,_p=`x-workflow-host-epoch`;V({[gp]:N(),[_p]:j().regex(/^(0|[1-9]\d*)$/,`must be a non-negative integer`).transform(Number)});var vp=K([`draft`,`final`,`partial`]),yp=[`final`,`partial`];K(yp);var bp=K([`ok`,`problem`,`not_done`,`info`]),xp=K([`bug`,`bug_candidate`,`scenario`,`checklist`,`scenario_run`,`test_run`,`atlas_run`,`make_auto_queue`,`api_saved_request`]),Sp=K([`checklist_not_supported`,`scenario_deleted`,`execution_error`,`not_reached`]);V({kind:xp,id:N()}).strict();var Cp=W(`state`,[V({state:q(`exists`),kind:xp,id:N(),title:j().nullable()}).strict(),V({state:q(`deleted`),kind:xp,id:N()}).strict()]),wp=V({key:j().min(1).max(100),position:F().int().min(0),title:j().min(1),body:j(),outcome:bp,links:B(Cp),updatedAt:O()}).strict(),Tp=K(/* @__PURE__ */ `project.application.feature.environment.environment_variable.environment_preference.project_variable.company_variable.scenario_variable.shared_step.step.checklist_item.checklist_item_step.api_collection.api_folder.api_endpoint.extracted_variable.capture_ruleset.capture_ruleset_version.capture_variable.custom_field_definition.custom_field_option.project_field_config.comment.page.element.canvas_element.element_group.page_connection.incident`.split(`.`)),Ep=U([Cp,W(`state`,[V({state:q(`exists`),kind:q(`project_object`),objectType:Tp,id:N(),title:j().nullable()}).strict(),V({state:q(`deleted`),kind:q(`project_object`),objectType:Tp,id:N()}).strict()])]),Dp=V({action:K([`created`,`updated`,`deleted`]),entity:Ep,at:O()}).strict(),Op=W(`kind`,[V({kind:q(`unit`),unitId:N(),agentNumber:F().int().min(1)}).strict(),V({kind:q(`lead`)}).strict()]),kp=K([`completed`,`failed`,`interrupted`]),Ap=V({subject:U([Cp,L()]),launchedBy:Op,outcome:kp,reason:j().min(1).nullable()}).strict(),jp=V({planItemId:N().nullable(),scenarioId:N().nullable(),title:j().nullable(),reason:Sp}).strict(),Mp=V({cause:Io,failureReason:j().min(1).nullable(),hostNeverAttached:I(),at:O()}).strict(),Np=W(`access`,[V({access:q(`hidden`),state:q(`draft`)}).strict(),V({access:q(`visible`),state:vp,summary:j().min(1).nullable()}).strict()]),Pp=W(`access`,[V({workflowId:N(),access:q(`hidden`),state:q(`draft`)}).strict(),V({workflowId:N(),access:q(`visible`),state:vp,summary:j().min(1).nullable(),items:B(wp),changes:B(Dp),work:B(Ap),candidates:B(mp),notDone:B(jp),end:Mp.nullable()}).strict()]),Fp=mf.shape.scenarioIds,Q=Yu.min(1),$=F().int().min(1),Ip=V({userId:N(),displayName:j()}).strict(),Lp=V({keySource:K(Cf),vendor:j().min(1),modelId:j().min(1)}).strict(),Rp=V({keySource:K(Cf),vendor:j().min(1),modelId:j().min(1),name:j().min(1)}).strict(),zp=V({standMode:ss,accountLabel:j().min(1),role:j().min(1)}).strict(),Bp=V({kind:q(`atlas`),standMode:cs,accountLabel:j().min(1),role:j().min(1),locale:j().min(1),viewportWidth:$,viewportHeight:$,entryUrl:Q,environmentId:N().nullable(),accessHintPresent:I()}).strict(),Vp=V({kind:q(`make_auto`),scenarioIds:Fp,instructions:j().nullable(),environmentId:N().nullable(),entryUrl:Q.nullable(),crawl:V({locale:j().min(1),viewportWidth:$,viewportHeight:$}).strict()}).strict(),Hp=V({locale:j().min(1),viewportWidth:$,viewportHeight:$}).strict(),Up=U([V({kind:q(`project`)}).strict(),V({kind:q(`scenarios`),scenarioIds:Fp}).strict(),V({kind:q(`test_run`),testRunId:N()}).strict(),V({kind:q(`test_plan`),testPlanId:N()}).strict()]),Wp=V({kind:q(`preset`),presetId:Ko,brief:j().trim().min(1),allowedChanges:B(Jo).refine(e=>new Set(e).size===e.length,{message:`allowedChanges names a change more than once`}),captureApi:I().nullable(),standMode:ss.nullable(),scope:Up,entryUrl:Q.nullable(),environmentId:N().nullable(),window:Hp.nullable()}).strict(),Gp=W(`kind`,[Bp,Vp]);W(`kind`,[Bp,Vp,Wp]);var Kp=Vp.omit({instructions:!0}).extend({hasInstructions:I()}).strict(),qp=W(`kind`,[V({kind:q(`project`)}).strict(),V({kind:q(`scenarios`),scenarioIds:Fp}).strict(),V({kind:q(`test_run`),testRunId:N(),testPlanId:N().nullable()}).strict(),V({kind:q(`test_plan`),testPlanId:N(),testRunId:N().nullable()}).strict()]),Jp=V({applicationName:j().nullable(),environmentName:j(),entryUrl:Q}).strict(),Yp=W(`kind`,[Bp,Kp,V({kind:q(`preset`),presetId:Ko,name:Ru.nullable(),briefLine:j().min(1),brief:j().nullable(),scope:qp,scopeLabel:Uu,address:Jp.nullable(),environmentId:N().nullable(),captureApi:I().nullable(),standMode:U([ss,L()]),allowedChanges:B(Jo),surface:Ho,newScenarioKind:U([Xo,L()]),credentialRef:Nf.nullable(),amendments:B(V({id:N(),text:j().nullable(),createdAt:O()}).strict())}).strict().refine(e=>e.standMode===null==(e.address===null),{message:`standMode is present exactly when the task has a browser (an address)`,path:[`standMode`]})]),Xp=V({kind:q(`agent`),agentId:N(),headful:I()}).strict(),Zp=V({kind:q(`browser`)}).strict(),Qp=W(`kind`,[Zp,Xp]),$p=W(`kind`,[Zp,Xp,V({kind:q(`none`)}).strict()]),em=Rp.extend({origin:as}).strict(),tm=V({kind:q(`make_auto`),scenarioIds:Fp,hasInstructions:I(),environmentId:N().nullable(),entryUrl:Q.nullable()}).strict(),nm=V({kind:q(`atlas`),title:j().min(1).max(60).nullable(),goal:j().min(1),entryUrl:Q.nullable()}).strict(),rm=V({kind:q(`run`),scenarioId:N(),planItemId:N().nullable()}).strict(),im={id:N(),status:ns,endStatus:U([rs,L()]),endReason:j().nullable(),startedAt:O().nullable(),endedAt:O().nullable()},am=W(`kind`,[V({...im,kind:q(`make_auto`),model:em,assignment:tm,crawlTuple:L(),subject:V({kind:q(`make_auto_queue`),queueId:N(),deeplink:j(),revision:F().int().min(1)}).strict().nullable(),progress:V({kind:q(`make_auto`),done:F().int().min(0),failed:F().int().min(0),total:F().int().min(0)}).strict().nullable()}).strict(),V({...im,kind:q(`atlas`),model:em,assignment:nm,crawlTuple:zp,subject:V({kind:q(`atlas_run`),runId:N(),deeplink:j()}).strict().nullable(),progress:V({kind:q(`atlas`),steps:F().int().min(0),screensCreated:F().int().min(0),awaitingLead:I()}).strict().nullable()}).strict(),V({...im,kind:q(`run`),model:L(),assignment:rm,crawlTuple:L(),subject:V({kind:q(`scenario_run`),scenarioRunId:N(),deeplink:j()}).strict(),progress:L()}).strict()]),om=V({id:N(),ordinal:F().int().min(1),status:$o,closeCause:U([es,L()]),windowOpen:I(),unit:U([am,L()]),unitCount:F().int().min(0)}).strict(),sm=V({state:Po,failureReason:j().min(1).nullable(),startedAt:O().nullable(),endedAt:O().nullable()}).strict().refine(e=>e.failureReason!==null==(e.state===`failed`),{message:`failureReason is present exactly when the analysis failed`,path:[`failureReason`]}).refine(e=>e.endedAt!==null==(e.state===`done`||e.state===`failed`||e.state===`cancelled`),{message:`endedAt is present exactly when the analysis ended`,path:[`endedAt`]}),cm=V({canStop:I(),canPause:I(),canContinue:I(),continueBlockedReason:ds.nullable(),canWriteToLead:I(),canResume:I(),canChangeAllowed:I()}).strict(),lm=V({effort:td,maxAgents:F().int().min(0)}).strict(),um=V({reason:U([Os,L()]),entryFailure:U([Ds,L()]),runnerLine:j().nullable()}).strict().refine(e=>e.entryFailure===null||e.reason===`launch_error`,{message:`entryFailure is present only beside reason 'launch_error'`,path:[`entryFailure`]}),dm=V({environmentName:j().nullable(),applicationName:j().nullable(),origin:j().refine(e=>URL.canParse(e)&&new URL(e).origin===e,{message:`origin is scheme://host[:port]`}).nullable()}).strict().refine(e=>e.applicationName===null||e.environmentName!==null&&e.origin!==null,{message:`an application is named only with the environment and the address it recognised`,path:[`applicationName`]}),fm=V({id:N(),projectId:N(),initiator:Ip,launchKind:zo,launchSurface:Bo,topic:Hu,goal:j().nullable(),launch:Yp,executor:$p,agentJobId:N().nullable(),maxAgents:F().int().min(0),leadKind:Zo,level:lm,permissionMode:U([K(Xu),L()]),report:Np,workPlaces:B(dm).nullable(),attention:U([Qo,L()]),openAsk:I(),findings:Wu,testRunProgress:U([Gu,L()]),leadModel:Rp,conversationId:N().nullable(),status:ko,segment:F().int().min(1),pauseCause:U([No,L()]),pausedBy:Ip.nullable(),finalAnalysis:sm.nullable(),endCause:U([Io,L()]),stoppedBy:Ip.nullable(),failureReason:j().nullable(),hostState:Lo,runnerJobEnd:um.nullable(),leadState:Ro,workers:B(om),openQuestionCount:F().int().min(0),createdAt:O(),endedAt:O().nullable(),permissions:cm}).strict().refine(e=>e.runnerJobEnd!==null==(e.executor.kind===`agent`&&e.attention===`host_lost`),{message:`runnerJobEnd is present exactly on a runner swarm whose host is lost`,path:[`runnerJobEnd`]}).refine(e=>e.workPlaces===null==(e.launch.kind===`preset`),{message:`workPlaces is null exactly for an AI task`,path:[`workPlaces`]}).refine(e=>e.pauseCause!==null==(e.status===`pausing`||e.status===`paused`),{message:`pauseCause is present exactly while pausing or paused`,path:[`pauseCause`]}).refine(e=>e.pausedBy!==null==(e.pauseCause===`user`),{message:`pausedBy is present exactly when a person paused the run`,path:[`pausedBy`]}),pm=V({workerId:N(),ordinal:F().int().min(1),desired:K([`open`,`closed`]),windowOpen:I(),unit:U([W(`kind`,[V({unitId:N(),kind:q(`make_auto`),queueId:N()}).strict(),V({unitId:N(),kind:q(`atlas`),runId:N(),entryUrl:Q,accessHintNeeded:I()}).strict(),V({unitId:N(),kind:q(`run`),scenarioRunId:N(),scenarioId:N(),environmentId:N(),entryUrl:Q}).strict()]),L()])}).strict(),mm=V({hostId:N(),epoch:F().int().min(0),leaseExpiresAt:O(),workers:B(pm)}).strict(),hm=V({workerId:N(),windowOpen:I(),windowClosedByUser:I(),unitRefusal:V({unitId:N(),errorCode:ls}).strict().nullable()}).strict(),gm=/^S\d+$/;function _m(e){if(!URL.canParse(e))return!1;let t=new URL(e);return t.host!==``&&t.origin===e}var vm=j().regex(gm),ym=W(`kind`,[H({kind:q(`map_application`),id:N()}),H({kind:q(`map_unbound_address`),id:j().refine(_m,`id must be an origin scheme://host[:port]`)}),H({kind:q(`map_page`),id:vm}),H({kind:q(`map_state`),id:vm}),H({kind:q(`map_scenario`),id:N()})]),bm=j().uuid(),xm=B(V({questionId:bm,selectedOptionIds:B(bm).min(1).max(6).refine(e=>new Set(e).size===e.length,`selectedOptionIds must be unique`).optional(),customText:j().optional(),skip:q(!0).optional()}).strict().superRefine((e,t)=>{[e.selectedOptionIds!==void 0,e.customText!==void 0,e.skip===!0].filter(Boolean).length!==1&&t.addIssue({code:`custom`,message:`exactly one answer resolution is required`})})).min(1).max(10).refine(e=>new Set(e.map(e=>e.questionId)).size===e.length,`questionId must be unique within answers`),Sm=V({name:q(`chat-question-answer`),batchId:bm,revision:F().int().positive(),idempotencyKey:bm,answers:xm,modelSelectionId:j().min(1).optional(),tabFreeTestRunId:j().uuid().nullable().optional()}).strict(),Cm=V({name:q(`chat-question-cancel`),batchId:bm,revision:F().int().positive(),idempotencyKey:bm,tabFreeTestRunId:j().uuid().nullable().optional()}).strict(),wm=V({t:q(`hello`),protocol_version:q(`1c.1`),resume:V({epoch:j().nullable(),last_seen_seq:wo().nonnegative()}).optional(),runner_type:K([`extension`,`web`,`playwright`]).optional(),client_capabilities:B(j().min(1).max(64)).max(16).optional(),panel_id:N().optional()}),Tm=V({t:q(`ping`),ts:F().int()}),Em=W(`kind`,[V({kind:q(`this_browser`)}).strict(),V({kind:q(`runner`),agentId:N()}).strict(),V({kind:q(`none`)}).strict()]),Dm=[`calling_conversation`,`new_conversation`],Om=Wp.omit({kind:!0,window:!0}).extend({place:Em,target:K(Dm)}).strict(),km=W(`name`,[V({name:q(`chat-send`),message:j(),mode:j(),effort:K(Zu),maxAgents:F().int().min(1).nullable(),place:Em,modelSelectionId:j().min(1).optional(),policyVersion:j().min(1).optional(),pageSnapshot:Zs.optional(),tabFreeTestRunId:j().uuid().nullable().optional(),attachmentIds:B(N()).min(1).optional(),activeObject:ym.optional()}).strict().superRefine((e,t)=>{e.attachmentIds!==void 0&&(e.pageSnapshot!==void 0&&t.addIssue({code:`custom`,message:`attachmentIds are not allowed on a snapshot-delivery send`,path:[`attachmentIds`]}),new Set(e.attachmentIds).size!==e.attachmentIds.length&&t.addIssue({code:`custom`,message:`attachmentIds must be distinct`,path:[`attachmentIds`]})),e.effort===`max`!=(e.maxAgents!==null)&&t.addIssue({code:`custom`,message:`maxAgents is required with effort 'max' and must be null otherwise`,path:[`maxAgents`]}),e.pageSnapshot===void 0&&e.message.length===0&&t.addIssue({code:`custom`,message:`message is required`,path:[`message`]}),e.pageSnapshot!==void 0&&e.message.length!==0&&t.addIssue({code:`custom`,message:`message must be empty on a snapshot-delivery send`,path:[`message`]})}),V({name:q(`chat-stop`)}),V({name:q(`chat-host-action-complete`),conversationId:j().uuid(),toolCallId:j().min(1),historyId:j().uuid(),tabFreeTestRunId:j().uuid().nullable().optional()}),V({name:q(`chat-atlas-host-action-complete`),conversationId:j().uuid(),toolCallId:j().min(1),atlasRunId:j().uuid(),tabFreeTestRunId:j().uuid().nullable().optional()}),V({name:q(`chat-ai-host-action-complete`),conversationId:j().uuid(),toolCallId:j().min(1),aiRunId:j().uuid(),tabFreeTestRunId:j().uuid().nullable().optional()}),V({name:q(`chat-tool-confirm`),toolCallId:j(),modelSelectionId:j().min(1).optional(),tabFreeTestRunId:j().uuid().nullable().optional(),edits:Om.optional()}),V({name:q(`chat-tool-reject`),toolCallId:j(),modelSelectionId:j().min(1).optional(),tabFreeTestRunId:j().uuid().nullable().optional()}),V({name:q(`run-cancel`)}),V({name:q(`session-bye`),release_runner:I().optional()}),V({name:q(`onboarding-start`)}).strict(),V({name:q(`onboarding-send`),message:j().min(1).max(4e3)}).strict(),V({name:q(`onboarding-advance`),action:K([`continue`,`skip_stage`]),stageId:j().min(1).max(50),stateRevision:F().int().positive()}).strict(),Sm,Cm]);W(`t`,[wm,Tm,V({t:q(`cmd`),request_id:j().guid(),cmd:km}),V({t:q(`auth:refresh`),token:j().min(1)})]);var Am=[`scenario-run`,`make-auto-queue`,`user-notifications`,`workflow`];W(`t`,[V({t:q(`hello-ack`),session_id:j().guid(),channel:K([`run`,`conversation`,...Am]),channel_id:j().guid(),epoch:j(),top_seq:wo(),recovered:I(),server_time:F().int()}),V({t:q(`event`),seq:wo().positive(),epoch:j(),event_type:j(),recorded_at:F().int().nonnegative(),payload:R(),payload_version:j()}),V({t:q(`notify`),channel:K(Am),channel_id:j().guid(),seq:wo().positive()}).strict(),V({t:q(`ack`),request_id:j().guid(),status:K([`accepted`,`duplicate`,`rejected`]),result:R().optional(),error_code:j().optional(),error_message:j().optional()}),V({t:q(`pong`),ts:F().int(),server_ts:F().int()}),V({t:q(`auth:refresh-required`),expires_in_ms:F().int().nonnegative()}),V({t:q(`auth:refreshed`),expires_at:F().int()})]);var jm=(()=>{let e=globalThis.PROGON_DEBUG;if(typeof e==`boolean`)return e;let t={};if(t!=null&&t.PROGON_DEBUG){let e=t.PROGON_DEBUG;return e===`true`||e===`1`}try{if(typeof localStorage<`u`)return localStorage.getItem(`progon-debug`)===`true`}catch{}return!1})(),Mm=`Progon`;function Nm(e){return e?`[${Mm} ${e}]`:`[${Mm}]`}function Pm(e,t,n,r){r===void 0?console[e](t,n):console[e](t,n,r)}function Fm(e){let t=typeof e==`function`?()=>Nm(e()):()=>Nm(e);return{debug:(e,n)=>{jm&&Pm(`log`,t(),e,n)},info:(e,n)=>{Pm(`info`,t(),e,n)},warn:(e,n)=>{Pm(`warn`,t(),e,n)},error:(e,n)=>{Pm(`error`,t(),e,n)}}}export{kd as $,La as $n,Ns as $t,Yf as A,Go as An,Uu as At,Vf as B,Oo as Bn,Xc as Bt,rp as C,Ho as Cn,nd as Ct,Qf as D,Io as Dn,$u as Dt,ap as E,Mo as En,Qu as Et,tp as F,Vo as Fn,ku as Ft,Bf as G,L as Gn,tc as Gt,Rf as H,To as Hn,Pc as Ht,Gf as I,rs as In,pu as It,kf as J,W as Jn,Zs as Jt,Df as K,B as Kn,Qs as Kt,Hf as L,as as Ln,mu as Lt,Xf as M,Ro as Mn,Vu as Mt,np as N,No as Nn,Gu as Nt,qf as O,Wo as On,Xu as Ot,$f as P,ko as Pn,Nu as Pt,jd as Q,q as Qn,Fs as Qt,zf as R,is as Rn,Zl as Rt,mp as S,Ko as Sn,id as St,ip as T,Uo as Tn,od as Tt,Lf as U,Co as Un,Dc as Ut,If as V,Eo as Vn,Nc as Vt,Uf as W,K as Wn,yc as Wt,Tf as X,xo as Xn,zs as Xt,Nf as Y,ka as Yn,Us as Yt,Nd as Z,_o as Zn,Ps as Zt,Qp as _,Jo as _n,Sd as _t,hm as a,ys as an,H as ar,gf as at,Pp as b,Fo as bn,md as bt,Hp as c,hs as cn,Ua as cr,bf as ct,Xp as d,vs as dn,P as dr,xf as dt,js as en,z as er,Dd as et,Gp as f,ps as fn,N as fr,Ad as ft,Ip as g,jo as gn,hd as gt,fm as h,Yo as hn,O as hr,gd as ht,Em as i,ks as in,G as ir,hf as it,Jf as j,zo as jn,Hu as jt,Kf as k,Lo as kn,Wu as kt,Lp as l,fs as ln,U as lr,Xd as lt,lm as m,os as mn,Vi as mr,Od as mt,Dm as n,Es as nn,V as nr,pf as nt,Jp as o,gs as on,j as or,yf as ot,mm as p,qo as pn,qi as pr,sf as pt,jf as q,I as qn,J as qt,Om as r,Ts as rn,So as rr,vf as rt,Up as s,_s as sn,ho as sr,Qd as st,Fm as t,Ds as tn,F as tr,ff as tt,Q as u,ms as un,R as ur,Sf as ut,yp as v,cs as vn,Cd as vt,hp as w,Qo as wn,rd as wt,op as x,Xo as xn,ad as xt,Np as y,ss as yn,xd as yt,Wf as z,$o as zn,tl as zt};