@spencerboucher/switchyard 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/dist/bridge/agent-channel.js +449 -0
- package/dist/bridge/agent-tools.js +235 -0
- package/dist/bridge/message-delivery.js +185 -0
- package/dist/bridge/policy.js +213 -0
- package/dist/bridge/switchyard-bridge.js +73 -3
- package/dist/bridge/switchyard-terminal.js +77 -11
- package/dist/bridge/tool-preflight.js +155 -0
- package/dist/policies/worker.js +2951 -0
- package/dist/switchyard.mjs +15480 -6064
- package/package.json +3 -1
- package/web-dist/assets/AutomationView-Cg7yk8nb.js +2 -0
- package/web-dist/assets/AutomationView-Cg7yk8nb.js.map +1 -0
- package/web-dist/assets/{Card-XMb6DfZU.js → Card-sHm0eI2Q.js} +2 -2
- package/web-dist/assets/{Card-XMb6DfZU.js.map → Card-sHm0eI2Q.js.map} +1 -1
- package/web-dist/assets/{Checkbox-CeUPbVi7.js → Checkbox-CEvKyfJz.js} +2 -2
- package/web-dist/assets/{Checkbox-CeUPbVi7.js.map → Checkbox-CEvKyfJz.js.map} +1 -1
- package/web-dist/assets/{Copy-CGnl0Vga.js → Copy-BHOLVthK.js} +2 -2
- package/web-dist/assets/{Copy-CGnl0Vga.js.map → Copy-BHOLVthK.js.map} +1 -1
- package/web-dist/assets/{InteractionCard-1ePc4XOF.js → InteractionCard-B-yhxwKs.js} +4 -4
- package/web-dist/assets/{InteractionCard-1ePc4XOF.js.map → InteractionCard-B-yhxwKs.js.map} +1 -1
- package/web-dist/assets/{Menu-CYZQ97c0.js → Menu-Cyt18mF2.js} +2 -2
- package/web-dist/assets/{Menu-CYZQ97c0.js.map → Menu-Cyt18mF2.js.map} +1 -1
- package/web-dist/assets/Overlay-BPNYBq3V.js +2 -0
- package/web-dist/assets/{Overlay-DlLhg1cK.js.map → Overlay-BPNYBq3V.js.map} +1 -1
- package/web-dist/assets/{Priority-BCHLJqWN.js → Priority-xSUsxoXm.js} +2 -2
- package/web-dist/assets/{Priority-BCHLJqWN.js.map → Priority-xSUsxoXm.js.map} +1 -1
- package/web-dist/assets/{SegmentedControl-CSO0EMTX.js → SegmentedControl-DaBwumC0.js} +2 -2
- package/web-dist/assets/{SegmentedControl-CSO0EMTX.js.map → SegmentedControl-DaBwumC0.js.map} +1 -1
- package/web-dist/assets/{Select-Dgmnmpz3.js → Select-C5xlhWYb.js} +2 -2
- package/web-dist/assets/{Select-Dgmnmpz3.js.map → Select-C5xlhWYb.js.map} +1 -1
- package/web-dist/assets/{Switch-DS4NRENd.js → Switch-dVcf-7Je.js} +2 -2
- package/web-dist/assets/{Switch-DS4NRENd.js.map → Switch-dVcf-7Je.js.map} +1 -1
- package/web-dist/assets/{Tabs-9xp-tGja.js → Tabs-93APobOB.js} +2 -2
- package/web-dist/assets/{Tabs-9xp-tGja.js.map → Tabs-93APobOB.js.map} +1 -1
- package/web-dist/assets/{TextArea-PfVKaz29.js → TextArea-D8WB5GD8.js} +2 -2
- package/web-dist/assets/{TextArea-PfVKaz29.js.map → TextArea-D8WB5GD8.js.map} +1 -1
- package/web-dist/assets/{TextLink-CYqiAUlK.js → TextLink-CrfA8AeH.js} +2 -2
- package/web-dist/assets/{TextLink-CYqiAUlK.js.map → TextLink-CrfA8AeH.js.map} +1 -1
- package/web-dist/assets/attention-C8rfu6Uw.js +2 -0
- package/web-dist/assets/{attention-CTkX5JXq.js.map → attention-C8rfu6Uw.js.map} +1 -1
- package/web-dist/assets/{automations-CsdtA3xp.js → automations-DQxUzi5Q.js} +2 -2
- package/web-dist/assets/{automations-CsdtA3xp.js.map → automations-DQxUzi5Q.js.map} +1 -1
- package/web-dist/assets/board-aS6ooJpx.js +10 -0
- package/web-dist/assets/board-aS6ooJpx.js.map +1 -0
- package/web-dist/assets/code-Zr5DqwWI.js +25 -0
- package/web-dist/assets/code-Zr5DqwWI.js.map +1 -0
- package/web-dist/assets/{describe-DjRsBpcB.js → describe-w4KmQFfU.js} +3 -3
- package/web-dist/assets/{describe-DjRsBpcB.js.map → describe-w4KmQFfU.js.map} +1 -1
- package/web-dist/assets/{enroll-DcEYGgoX.js → enroll-DPKdD0en.js} +2 -2
- package/web-dist/assets/{enroll-DcEYGgoX.js.map → enroll-DPKdD0en.js.map} +1 -1
- package/web-dist/assets/index-DFNY2EUd.css +2 -0
- package/web-dist/assets/index-DPScWz2I.js +11 -0
- package/web-dist/assets/index-DPScWz2I.js.map +1 -0
- package/web-dist/assets/{more-BQSa_-H6.js → more-CiyGP5GD.js} +2 -2
- package/web-dist/assets/{more-BQSa_-H6.js.map → more-CiyGP5GD.js.map} +1 -1
- package/web-dist/assets/policyLogic-7OOzM_xa.js +2 -0
- package/web-dist/assets/policyLogic-7OOzM_xa.js.map +1 -0
- package/web-dist/assets/{preload-helper-Huh16h6r.js → preload-helper-B2m1UyXR.js} +5 -5
- package/web-dist/assets/preload-helper-B2m1UyXR.js.map +1 -0
- package/web-dist/assets/queue-BcbJqzTY.js +2 -0
- package/web-dist/assets/{queue-CCjBjQhT.js.map → queue-BcbJqzTY.js.map} +1 -1
- package/web-dist/assets/{repo-pkFfpra6.js → repo-BA_bnCvu.js} +2 -2
- package/web-dist/assets/{repo-pkFfpra6.js.map → repo-BA_bnCvu.js.map} +1 -1
- package/web-dist/assets/settings-D03MF_Kx.js +7 -0
- package/web-dist/assets/settings-D03MF_Kx.js.map +1 -0
- package/web-dist/assets/shared-Bxc2JM1K.js +3 -0
- package/web-dist/assets/shared-Bxc2JM1K.js.map +1 -0
- package/web-dist/assets/states-DynH8-o6.js +58 -0
- package/web-dist/assets/states-DynH8-o6.js.map +1 -0
- package/web-dist/assets/terminal-login-C0n8cXqn.js +2 -0
- package/web-dist/assets/{terminal-login-D9enO0EH.js.map → terminal-login-C0n8cXqn.js.map} +1 -1
- package/web-dist/assets/{useBreakpoint-LY_qlpRG.js → useBreakpoint-CYDIV-KM.js} +2 -2
- package/web-dist/assets/{useBreakpoint-LY_qlpRG.js.map → useBreakpoint-CYDIV-KM.js.map} +1 -1
- package/web-dist/assets/useNow-0tMsLHnB.js +2 -0
- package/web-dist/assets/useNow-0tMsLHnB.js.map +1 -0
- package/web-dist/assets/{useResource-Dul6MTDM.js → useResource-DHtFcID5.js} +2 -2
- package/web-dist/assets/{useResource-Dul6MTDM.js.map → useResource-DHtFcID5.js.map} +1 -1
- package/web-dist/index.html +8 -8
- package/web-dist/sw.js +1 -1
- package/web-dist/sw.js.map +1 -1
- package/web-dist/assets/AutomationView-CrKqim2i.js +0 -2
- package/web-dist/assets/AutomationView-CrKqim2i.js.map +0 -1
- package/web-dist/assets/Field-DVurWE-E.js +0 -2
- package/web-dist/assets/Field-DVurWE-E.js.map +0 -1
- package/web-dist/assets/Overlay-DlLhg1cK.js +0 -2
- package/web-dist/assets/attention-CTkX5JXq.js +0 -2
- package/web-dist/assets/board-CJL75uGb.js +0 -10
- package/web-dist/assets/board-CJL75uGb.js.map +0 -1
- package/web-dist/assets/code-CEYPZt-J.js +0 -21
- package/web-dist/assets/code-CEYPZt-J.js.map +0 -1
- package/web-dist/assets/index-BeJqGnFE.css +0 -2
- package/web-dist/assets/index-DSJZdQ79.js +0 -11
- package/web-dist/assets/index-DSJZdQ79.js.map +0 -1
- package/web-dist/assets/preload-helper-Huh16h6r.js.map +0 -1
- package/web-dist/assets/queue-CCjBjQhT.js +0 -2
- package/web-dist/assets/settings-vrxspmWN.js +0 -7
- package/web-dist/assets/settings-vrxspmWN.js.map +0 -1
- package/web-dist/assets/shared-Bm6Rhfqw.js +0 -3
- package/web-dist/assets/shared-Bm6Rhfqw.js.map +0 -1
- package/web-dist/assets/states-BQxrRFdh.js +0 -56
- package/web-dist/assets/states-BQxrRFdh.js.map +0 -1
- package/web-dist/assets/terminal-login-D9enO0EH.js +0 -2
- package/web-dist/assets/useNow-BUvGqrfn.js +0 -2
- package/web-dist/assets/useNow-BUvGqrfn.js.map +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{_ as e,i as t,m as n,n as r,t as i}from"./jsx-runtime-D13aM9HY.js";import{O as a,c as o}from"./Overlay-DlLhg1cK.js";import{B as s,Dt as c,S as l,Z as u,f as d,v as f}from"./states-BQxrRFdh.js";import{a as p,i as m,p as h,t as g}from"./useBreakpoint-LY_qlpRG.js";import{t as _}from"./key-round-VDbE9E4X.js";var v={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};v.node;var y=r(v),b={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};b.node;var x=r(b),S={name:`database-backup`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 12a9 3 0 0 0 5 2.69`,key:`1ui2ym`}],[`path`,{d:`M21 9.3V5`,key:`6k6cib`}],[`path`,{d:`M3 5v14a9 3 0 0 0 6.47 2.88`,key:`i62tjy`}],[`path`,{d:`M12 12v4h4`,key:`1bxaet`}],[`path`,{d:`M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16`,key:`1f4ei9`}]]};S.node;var C=r(S),w={name:`folder-git-2`,size:24,node:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]};w.node;var T=r(w),E={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};E.node;var D=r(E),O={name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]};O.node;var k=r(O),A={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};A.node;var j=r(A),M={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};M.node;var N=r(M),P={name:`stethoscope`,size:24,node:[[`path`,{d:`M11 2v2`,key:`1539x4`}],[`path`,{d:`M5 2v2`,key:`1yf1q8`}],[`path`,{d:`M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1`,key:`rb5t3r`}],[`path`,{d:`M8 15a6 6 0 0 0 12 0v-3`,key:`x18d4x`}],[`circle`,{cx:`20`,cy:`10`,r:`2`,key:`ts1r5v`}]]};P.node;var F=r(P);function I(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var L=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return L(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return L(t)(e)}}}},R=(e,t)=>(n,r,i)=>{let a={storage:I(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(...e)=>(f(...e),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return L(u.getItem.bind(u))(a.name).then(e=>{if(e){if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state]}return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{++s,u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p},z={navigator:{min:220,max:360,default:264},inspector:{min:320,max:600,default:380},boardColumn:{min:288,max:360,default:320}};function B(e,t){let n=z[e];return Math.round(Math.min(n.max,Math.max(n.min,t)))}function V(){return typeof window>`u`||!window.matchMedia||window.matchMedia(`(min-width: 768px) and (pointer: fine)`).matches}var H=c()(R(e=>({selectedProjectId:null,lastSessionId:null,lastNewSessionProjectId:null,paneSizes:{navigator:z.navigator.default,inspector:z.inspector.default,boardColumn:z.boardColumn.default},inspectorCollapsed:!1,railExpanded:!1,sendWithEnter:V(),collapseWork:!0,filters:{},set:(t,n)=>e({[t]:n}),setPaneSize:(t,n)=>e(e=>({paneSizes:{...e.paneSizes,[t]:B(t,n)}})),setFilter:(t,n)=>e(e=>({filters:{...e.filters,[t]:n}}))}),{name:`sy:prefs`,version:1,storage:I(()=>localStorage),partialize:({set:e,setPaneSize:t,setFilter:n,...r})=>r}));function U(e,t){let n=H(t=>t.filters[e]),r=H(e=>e.setFilter);return[n??t,t=>r(e,t)]}var W=e(n(),1),G=i(),K=[{path:`projects`,label:`Projects`,description:`Repositories, checkouts and workspaces`,icon:T,group:`Workspace`},{path:`profiles`,label:`Pi profiles`,description:`Provider, model and thinking presets`,icon:N,group:`Workspace`},{path:`hosts`,label:`Hosts`,description:`Execution hosts, capabilities and versions`,icon:j,group:`Infrastructure`},{path:`adapters`,label:`Adapters`,description:`Extension adapters on each host`,icon:l,group:`Infrastructure`},{path:`backups`,label:`Backups`,description:`Back up and restore the coordinator`,icon:C,group:`Infrastructure`},{path:`diagnostics`,label:`Diagnostics`,description:`Versions, migrations, events and recent problems`,icon:F,group:`Infrastructure`},{path:`sign-in`,label:`Sign-in`,description:`Passkeys, single sign-on and signing out`,icon:_,group:`Access`},{path:`devices`,label:`Devices`,description:`Signed-in browsers, apps and terminals`,icon:k,group:`Access`},{path:`notifications`,label:`Notifications`,description:`Push, quiet hours and previews`,icon:y,group:`This device`},{path:`device`,label:`This device`,description:`Preferences stored on this device`,icon:D,group:`This device`}],q=[`Workspace`,`Infrastructure`,`Access`,`This device`].map(e=>({label:e,sections:K.filter(t=>t.group===e)})),J=e=>e?`/settings/${e}`:`/settings`;function Y({title:e,description:n,actions:r,back:i,testId:o,children:s}){let c=g()===`mobile`,l=i??(c?{to:J(),label:`Settings`}:null),u=p(l?.to??J()),f=c&&!!l;return(0,G.jsxs)(`section`,{"data-testid":o,className:`flex w-full min-w-0 flex-col gap-4 px-4 py-4 md:px-6`,children:[f&&l?(0,G.jsxs)(`header`,{className:`sticky top-0 z-20 -mx-4 -mt-4 flex min-w-0 items-center gap-1 border-b border-border bg-surface px-1 pb-1 safe-pt-1`,children:[(0,G.jsx)(t,{to:l.to,onClick:m(u),"aria-label":`Back to ${l.label}`,title:`Back to ${l.label}`,className:d(`ghost`,`md`,`size-11 px-0`),children:(0,G.jsx)(a,{"aria-hidden":!0,className:`size-5`})}),(0,G.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-base font-semibold`,children:e})]}):l&&(0,G.jsxs)(t,{to:l.to,onClick:m(u),className:`tap -ml-2 inline-flex w-fit items-center gap-1 rounded-md px-2 py-1 text-sm font-medium text-accent hover:bg-surface-2`,children:[(0,G.jsx)(x,{"aria-hidden":!0,className:`size-4`}),`Back to `,l.label]}),(!f||n||r)&&(0,G.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-start gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-[1_1_15rem]`,children:[!f&&(0,G.jsx)(`h1`,{className:`break-words text-lg font-semibold`,children:e}),n&&(0,G.jsx)(`p`,{className:`text-sm text-muted`,children:n})]}),r&&(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:r})]}),s]})}function X({items:e}){return(0,G.jsx)(`dl`,{className:`grid min-w-0 gap-x-4 gap-y-1 text-sm sm:grid-cols-[minmax(8rem,12rem)_minmax(0,1fr)]`,children:e.map(([e,t],n)=>(0,G.jsxs)(`div`,{className:`contents`,children:[(0,G.jsx)(`dt`,{className:`text-muted`,children:e}),(0,G.jsx)(`dd`,{className:`mb-1 min-w-0 break-words sm:mb-0`,children:t})]},n))})}function Z(){return s(e=>e.hydrated)}var Q={darwin:`macOS`,linux:`Linux`};function $({host:e}){return e.piVersion?e.piCompatible?(0,G.jsx)(o,{icon:h,tone:`success`,label:`Pi ${e.piVersion} (compatible)`}):(0,G.jsx)(o,{icon:f,tone:`danger`,label:`Pi ${e.piVersion} (incompatible, needs ${u})`}):(0,G.jsx)(o,{icon:f,tone:`warning`,label:`Pi not detected (incompatible)`})}function ee(e){let t=e.trim();return t?t.startsWith(`/`)?null:`Use an absolute path that starts with /, e.g. /Users/me/src/app.`:`Enter the path of the checkout on the host.`}function te(e){if(typeof e!=`object`||!e)return!1;let t=e;return Array.isArray(t.passkeys)&&typeof t.passkeyAvailability==`object`}function ne(e){return e.split(`
|
|
2
|
-
`).map(e=>e.trim()).filter(Boolean)}function re(e){let[t,n]=(0,W.useState)(()=>Date.now());if((0,W.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),!e)return null;let r=Date.parse(e);return Number.isNaN(r)?null:Math.max(0,r-t)}function ie(e){let t=Math.ceil(e/1e3);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}export{y as S,N as _,q as a,T as b,te as c,re as d,Z as f,H as g,U as h,K as i,J as l,z as m,Q as n,Y as o,ee as p,$ as r,ie as s,X as t,ne as u,j as v,x,k as y};
|
|
3
|
-
//# sourceMappingURL=shared-Bm6Rhfqw.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared-Bm6Rhfqw.js","names":["__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","useState","__toESM","Link","require_react","createLucideIcon","require_jsx_runtime","ArrowLeft","InlineStatus","useSyncStore","create","Puzzle","PI_SUPPORTED_RANGE","buttonClasses","TriangleAlert","useBackTo","backLinkClick","CircleCheck","useBreakpoint","KeyRound","__iconData$8","Bell","__iconData$7","ChevronLeft","__iconData$6","DatabaseBackup","__iconData$5","FolderGit2","__iconData$4","Keyboard","__iconData$3","MonitorSmartphone","__iconData$2","Server","__iconData$1","SlidersHorizontal","__iconData","Stethoscope","createJSONStorage","storage","getStorage","parse","str2","options","str","name","newValue","toThenable","result","fn","input","onFulfilled","onRejected","persist","state","currentState","persistedState","baseOptions","hasHydrated","hydrationVersion","hydrationListeners","finishHydrationListeners","config","args","set","get","api","setItem","savedSetState","configResult","stateFromStorage","hydrate","currentVersion","cb","postRehydrationCallback","deserializedStorageValue","migration","migrated","migratedState","migrationResult","e","newOptions","PANE_LIMITS","clampPane","l","pane","px","defaultSendWithEnter","usePrefs","key","value","s","view","_s","_p","_f","prefs","useFilter","setFilter","fallback","v","import_react","import_jsx_runtime","SECTIONS","SECTION_GROUPS","label","settingsPath","sub","SectionPage","mobile","backLink","back","goBack","compactBack","testId","title","description","actions","children","KeyValues","items","k","i","useHydrated","PLATFORM_LABEL","PiCompat","host","validateAbsolutePath","p","path","isAuthMethods","m","splitLines","text","useCountdown","now","setNow","iso","at","formatCountdown","ms"],"sources":["../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/bell.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/chevron-left.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/database-backup.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/folder-git-2.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/keyboard.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/monitor-smartphone.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/server.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/sliders-horizontal.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/stethoscope.mjs","../../../../node_modules/.pnpm/zustand@5.0.16_@types+react@19.3.0_react@19.3.1/node_modules/zustand/esm/middleware.mjs","../../src/prefs.ts","../../src/features/settings/shared.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"bell\",\n size: 24,\n node: [\n [\"path\", { d: \"M10.268 21a2 2 0 0 0 3.464 0\", key: \"vwvbt9\" }],\n [\n \"path\",\n {\n d: \"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\",\n key: \"11g9vi\"\n }\n ]\n ]\n};\n__iconData.node;\nconst Bell = createLucideIcon(__iconData);\n\nexport { __iconData, Bell as default };\n//# sourceMappingURL=bell.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"chevron-left\",\n size: 24,\n node: [[\"path\", { d: \"m15 18-6-6 6-6\", key: \"1wnfg3\" }]]\n};\n__iconData.node;\nconst ChevronLeft = createLucideIcon(__iconData);\n\nexport { __iconData, ChevronLeft as default };\n//# sourceMappingURL=chevron-left.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"database-backup\",\n size: 24,\n node: [\n [\"ellipse\", { cx: \"12\", cy: \"5\", rx: \"9\", ry: \"3\", key: \"msslwz\" }],\n [\"path\", { d: \"M3 12a9 3 0 0 0 5 2.69\", key: \"1ui2ym\" }],\n [\"path\", { d: \"M21 9.3V5\", key: \"6k6cib\" }],\n [\"path\", { d: \"M3 5v14a9 3 0 0 0 6.47 2.88\", key: \"i62tjy\" }],\n [\"path\", { d: \"M12 12v4h4\", key: \"1bxaet\" }],\n [\n \"path\",\n {\n d: \"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16\",\n key: \"1f4ei9\"\n }\n ]\n ]\n};\n__iconData.node;\nconst DatabaseBackup = createLucideIcon(__iconData);\n\nexport { __iconData, DatabaseBackup as default };\n//# sourceMappingURL=database-backup.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"folder-git-2\",\n size: 24,\n node: [\n [\"path\", { d: \"M18 19a5 5 0 0 1-5-5v8\", key: \"sz5oeg\" }],\n [\n \"path\",\n {\n d: \"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5\",\n key: \"1w6njk\"\n }\n ],\n [\"circle\", { cx: \"13\", cy: \"12\", r: \"2\", key: \"1j92g6\" }],\n [\"circle\", { cx: \"20\", cy: \"19\", r: \"2\", key: \"1obnsp\" }]\n ]\n};\n__iconData.node;\nconst FolderGit2 = createLucideIcon(__iconData);\n\nexport { __iconData, FolderGit2 as default };\n//# sourceMappingURL=folder-git-2.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"keyboard\",\n size: 24,\n node: [\n [\"path\", { d: \"M10 8h.01\", key: \"1r9ogq\" }],\n [\"path\", { d: \"M12 12h.01\", key: \"1mp3jc\" }],\n [\"path\", { d: \"M14 8h.01\", key: \"1primd\" }],\n [\"path\", { d: \"M16 12h.01\", key: \"1l6xoz\" }],\n [\"path\", { d: \"M18 8h.01\", key: \"emo2bl\" }],\n [\"path\", { d: \"M6 8h.01\", key: \"x9i8wu\" }],\n [\"path\", { d: \"M7 16h10\", key: \"wp8him\" }],\n [\"path\", { d: \"M8 12h.01\", key: \"czm47f\" }],\n [\"rect\", { width: \"20\", height: \"16\", x: \"2\", y: \"4\", rx: \"2\", key: \"18n3k1\" }]\n ]\n};\n__iconData.node;\nconst Keyboard = createLucideIcon(__iconData);\n\nexport { __iconData, Keyboard as default };\n//# sourceMappingURL=keyboard.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"monitor-smartphone\",\n size: 24,\n node: [\n [\"path\", { d: \"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8\", key: \"10dyio\" }],\n [\"path\", { d: \"M10 19v-3.96 3.15\", key: \"1irgej\" }],\n [\"path\", { d: \"M7 19h5\", key: \"qswx4l\" }],\n [\"rect\", { width: \"6\", height: \"10\", x: \"16\", y: \"12\", rx: \"2\", key: \"1egngj\" }]\n ]\n};\n__iconData.node;\nconst MonitorSmartphone = createLucideIcon(__iconData);\n\nexport { __iconData, MonitorSmartphone as default };\n//# sourceMappingURL=monitor-smartphone.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"server\",\n size: 24,\n node: [\n [\"rect\", { width: \"20\", height: \"8\", x: \"2\", y: \"2\", rx: \"2\", ry: \"2\", key: \"ngkwjq\" }],\n [\"rect\", { width: \"20\", height: \"8\", x: \"2\", y: \"14\", rx: \"2\", ry: \"2\", key: \"iecqi9\" }],\n [\"line\", { x1: \"6\", x2: \"6.01\", y1: \"6\", y2: \"6\", key: \"16zg32\" }],\n [\"line\", { x1: \"6\", x2: \"6.01\", y1: \"18\", y2: \"18\", key: \"nzw8ys\" }]\n ]\n};\n__iconData.node;\nconst Server = createLucideIcon(__iconData);\n\nexport { __iconData, Server as default };\n//# sourceMappingURL=server.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"sliders-horizontal\",\n size: 24,\n node: [\n [\"path\", { d: \"M10 5H3\", key: \"1qgfaw\" }],\n [\"path\", { d: \"M12 19H3\", key: \"yhmn1j\" }],\n [\"path\", { d: \"M14 3v4\", key: \"1sua03\" }],\n [\"path\", { d: \"M16 17v4\", key: \"1q0r14\" }],\n [\"path\", { d: \"M21 12h-9\", key: \"1o4lsq\" }],\n [\"path\", { d: \"M21 19h-5\", key: \"1rlt1p\" }],\n [\"path\", { d: \"M21 5h-7\", key: \"1oszz2\" }],\n [\"path\", { d: \"M8 10v4\", key: \"tgpxqk\" }],\n [\"path\", { d: \"M8 12H3\", key: \"a7s4jb\" }]\n ]\n};\n__iconData.node;\nconst SlidersHorizontal = createLucideIcon(__iconData);\n\nexport { __iconData, SlidersHorizontal as default };\n//# sourceMappingURL=sliders-horizontal.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"stethoscope\",\n size: 24,\n node: [\n [\"path\", { d: \"M11 2v2\", key: \"1539x4\" }],\n [\"path\", { d: \"M5 2v2\", key: \"1yf1q8\" }],\n [\"path\", { d: \"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1\", key: \"rb5t3r\" }],\n [\"path\", { d: \"M8 15a6 6 0 0 0 12 0v-3\", key: \"x18d4x\" }],\n [\"circle\", { cx: \"20\", cy: \"10\", r: \"2\", key: \"ts1r5v\" }]\n ]\n};\n__iconData.node;\nconst Stethoscope = createLucideIcon(__iconData);\n\nexport { __iconData, Stethoscope as default };\n//# sourceMappingURL=stethoscope.mjs.map\n","const reduxImpl = (reducer, initial) => (set, _get, api) => {\n api.dispatch = (action) => {\n set((state) => reducer(state, action), false, action);\n return action;\n };\n api.dispatchFromDevtools = true;\n return { dispatch: (...args) => api.dispatch(...args), ...initial };\n};\nconst redux = reduxImpl;\n\nconst shouldDispatchFromDevtools = (api) => !!api.dispatchFromDevtools && typeof api.dispatch === \"function\";\nconst trackedConnections = /* @__PURE__ */ new Map();\nconst getTrackedConnectionState = (name) => {\n const api = trackedConnections.get(name);\n if (!api) return {};\n return Object.fromEntries(\n Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])\n );\n};\nconst extractConnectionInformation = (store, extensionConnector, options) => {\n if (store === void 0) {\n return {\n type: \"untracked\",\n connection: extensionConnector.connect(options)\n };\n }\n const existingConnection = trackedConnections.get(options.name);\n if (existingConnection) {\n return { type: \"tracked\", store, ...existingConnection };\n }\n const newConnection = {\n connection: extensionConnector.connect(options),\n stores: {}\n };\n trackedConnections.set(options.name, newConnection);\n return { type: \"tracked\", store, ...newConnection };\n};\nconst removeStoreFromTrackedConnections = (name, store, api) => {\n if (store === void 0) return;\n const connectionInfo = trackedConnections.get(name);\n if ((connectionInfo == null ? void 0 : connectionInfo.stores[store]) !== api) return;\n delete connectionInfo.stores[store];\n if (Object.keys(connectionInfo.stores).length === 0) {\n trackedConnections.delete(name);\n }\n};\nconst v8StackLineRe = /^at (?:new |async )?(.+?) \\(/;\nconst geckoStackLineRe = /^([^@]+)@/;\nfunction findCallerName(stack) {\n var _a, _b, _c;\n if (!stack) return void 0;\n const traceLines = stack.split(\"\\n\");\n const apiSetStateLineIndex = traceLines.findIndex(\n (traceLine) => traceLine.includes(\"api.setState\")\n );\n if (apiSetStateLineIndex < 0) return void 0;\n const callerLine = ((_a = traceLines[apiSetStateLineIndex + 1]) == null ? void 0 : _a.trim()) || \"\";\n return ((_b = v8StackLineRe.exec(callerLine)) == null ? void 0 : _b[1]) || ((_c = geckoStackLineRe.exec(callerLine)) == null ? void 0 : _c[1]);\n}\nconst devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {\n const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;\n let extensionConnector;\n try {\n extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (e) {\n }\n if (!extensionConnector) {\n return fn(set, get, api);\n }\n const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);\n let isRecording = true;\n api.setState = ((state, replace, nameOrAction) => {\n const r = set(state, replace);\n if (!isRecording) return r;\n const action = nameOrAction === void 0 ? {\n type: anonymousActionType || findCallerName(new Error().stack) || \"anonymous\"\n } : typeof nameOrAction === \"string\" ? { type: nameOrAction } : nameOrAction;\n if (store === void 0) {\n connection == null ? void 0 : connection.send(action, get());\n return r;\n }\n connection == null ? void 0 : connection.send(\n {\n ...action,\n type: `${store}/${action.type}`\n },\n {\n ...getTrackedConnectionState(options.name),\n [store]: api.getState()\n }\n );\n return r;\n });\n let unsubscribeFromStore;\n api.devtools = {\n cleanup: () => {\n unsubscribeFromStore == null ? void 0 : unsubscribeFromStore();\n unsubscribeFromStore = void 0;\n removeStoreFromTrackedConnections(options.name, store, api);\n if ((store === void 0 || !trackedConnections.has(options.name)) && connection && typeof connection.unsubscribe === \"function\") {\n connection.unsubscribe();\n }\n }\n };\n const setStateFromDevtools = (...a) => {\n const originalIsRecording = isRecording;\n isRecording = false;\n set(...a);\n isRecording = originalIsRecording;\n };\n const initialState = fn(api.setState, get, api);\n if (connectionInformation.type === \"untracked\") {\n connection == null ? void 0 : connection.init(initialState);\n } else {\n connectionInformation.stores[connectionInformation.store] = api;\n connection == null ? void 0 : connection.init(\n Object.fromEntries(\n Object.entries(connectionInformation.stores).map(([key, store2]) => [\n key,\n key === connectionInformation.store ? initialState : store2.getState()\n ])\n )\n );\n }\n if (shouldDispatchFromDevtools(api)) {\n let didWarnAboutReservedActionType = false;\n const originalDispatch = api.dispatch;\n api.dispatch = (...args) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && args[0].type === \"__setState\" && !didWarnAboutReservedActionType) {\n console.warn(\n '[zustand devtools middleware] \"__setState\" action type is reserved to set state from the devtools. Avoid using it.'\n );\n didWarnAboutReservedActionType = true;\n }\n originalDispatch(...args);\n };\n }\n unsubscribeFromStore = connection.subscribe((message) => {\n var _a;\n const reviver = typeof options.serialize === \"object\" ? options.serialize.reviver : void 0;\n switch (message.type) {\n case \"ACTION\":\n if (typeof message.payload !== \"string\") {\n console.error(\n \"[zustand devtools middleware] Unsupported action format\"\n );\n return;\n }\n return parseJsonThen(\n message.payload,\n reviver,\n (action) => {\n if (action.type === \"__setState\") {\n if (store === void 0) {\n setStateFromDevtools(action.state);\n return;\n }\n if (Object.keys(action.state).length !== 1) {\n console.error(\n `\n [zustand devtools middleware] Unsupported __setState action format.\n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n `\n );\n }\n const stateFromDevtools = action.state[store];\n if (stateFromDevtools === void 0 || stateFromDevtools === null) {\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {\n setStateFromDevtools(stateFromDevtools);\n }\n return;\n }\n if (shouldDispatchFromDevtools(api)) {\n api.dispatch(action);\n }\n }\n );\n case \"DISPATCH\":\n switch (message.payload.type) {\n case \"RESET\":\n setStateFromDevtools(initialState);\n if (store === void 0) {\n return connection == null ? void 0 : connection.init(api.getState());\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"COMMIT\":\n if (store === void 0) {\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"ROLLBACK\":\n return parseJsonThen(message.state, reviver, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n setStateFromDevtools(state[store]);\n connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n });\n case \"JUMP_TO_STATE\":\n case \"JUMP_TO_ACTION\":\n return parseJsonThen(message.state, reviver, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {\n setStateFromDevtools(state[store]);\n }\n });\n case \"IMPORT_STATE\": {\n const { nextLiftedState } = message.payload;\n const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;\n if (!lastComputedState) return;\n if (store === void 0) {\n setStateFromDevtools(lastComputedState);\n } else {\n setStateFromDevtools(lastComputedState[store]);\n }\n connection == null ? void 0 : connection.send(\n null,\n // FIXME no-any\n nextLiftedState\n );\n return;\n }\n case \"PAUSE_RECORDING\":\n return isRecording = !isRecording;\n }\n return;\n }\n });\n return initialState;\n};\nconst devtools = devtoolsImpl;\nconst parseJsonThen = (stringified, reviver, fn) => {\n let parsed;\n try {\n parsed = JSON.parse(stringified, reviver);\n } catch (e) {\n console.error(\n \"[zustand devtools middleware] Could not parse the received json\",\n e\n );\n }\n if (parsed !== void 0) fn(parsed);\n};\n\nconst subscribeWithSelectorImpl = (fn) => (set, get, api) => {\n const origSubscribe = api.subscribe;\n api.subscribe = ((selector, optListener, options) => {\n let listener = selector;\n if (optListener) {\n const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;\n let currentSlice = selector(api.getState());\n listener = (state) => {\n const nextSlice = selector(state);\n if (!equalityFn(currentSlice, nextSlice)) {\n const previousSlice = currentSlice;\n optListener(currentSlice = nextSlice, previousSlice);\n }\n };\n if (options == null ? void 0 : options.fireImmediately) {\n optListener(currentSlice, currentSlice);\n }\n }\n return origSubscribe(listener);\n });\n const initialState = fn(set, get, api);\n return initialState;\n};\nconst subscribeWithSelector = subscribeWithSelectorImpl;\n\nfunction combine(initialState, create) {\n return (...args) => Object.assign({}, initialState, create(...args));\n}\n\nfunction createJSONStorage(getStorage, options) {\n let storage;\n try {\n storage = getStorage();\n } catch (e) {\n return;\n }\n const persistStorage = {\n getItem: (name) => {\n var _a;\n const parse = (str2) => {\n if (str2 === null) {\n return null;\n }\n return JSON.parse(str2, options == null ? void 0 : options.reviver);\n };\n const str = (_a = storage.getItem(name)) != null ? _a : null;\n if (str instanceof Promise) {\n return str.then(parse);\n }\n return parse(str);\n },\n setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, options == null ? void 0 : options.replacer)),\n removeItem: (name) => storage.removeItem(name)\n };\n return persistStorage;\n}\nconst toThenable = (fn) => (input) => {\n try {\n const result = fn(input);\n if (result instanceof Promise) {\n return result;\n }\n return {\n then(onFulfilled) {\n return toThenable(onFulfilled)(result);\n },\n catch(_onRejected) {\n return this;\n }\n };\n } catch (e) {\n return {\n then(_onFulfilled) {\n return this;\n },\n catch(onRejected) {\n return toThenable(onRejected)(e);\n }\n };\n }\n};\nconst persistImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n storage: createJSONStorage(() => window.localStorage),\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n let hydrationVersion = 0;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage = options.storage;\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const setItem = () => {\n const state = options.partialize({ ...get() });\n return storage.setItem(options.name, {\n state,\n version: options.version\n });\n };\n const savedSetState = api.setState;\n api.setState = (...args) => {\n savedSetState(...args);\n return setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n return setItem();\n },\n get,\n api\n );\n api.getInitialState = () => configResult;\n let stateFromStorage;\n const hydrate = () => {\n var _a, _b;\n if (!storage) return;\n const currentVersion = ++hydrationVersion;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => {\n var _a2;\n return cb((_a2 = get()) != null ? _a2 : configResult);\n });\n const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n const migration = options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n if (migration instanceof Promise) {\n return migration.then((result) => [true, result]);\n }\n return [true, migration];\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return [false, deserializedStorageValue.state];\n }\n }\n return [false, void 0];\n }).then((migrationResult) => {\n var _a2;\n if (currentVersion !== hydrationVersion) {\n return;\n }\n const [migrated, migratedState] = migrationResult;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n if (migrated) {\n return setItem();\n }\n }).then(() => {\n if (currentVersion !== hydrationVersion) {\n return;\n }\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(get(), void 0);\n stateFromStorage = get();\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n if (currentVersion !== hydrationVersion) {\n return;\n }\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.storage) {\n storage = newOptions.storage;\n }\n },\n clearStorage: () => {\n ++hydrationVersion;\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n if (!options.skipHydration) {\n hydrate();\n }\n return stateFromStorage || configResult;\n};\nconst persist = persistImpl;\n\nfunction ssrSafe(config, isSSR = typeof window === \"undefined\") {\n return (set, get, api) => {\n if (!isSSR) {\n return config(set, get, api);\n }\n const ssrSet = () => {\n throw new Error(\"Cannot set state of Zustand store in SSR\");\n };\n api.setState = ssrSet;\n return config(ssrSet, get, api);\n };\n}\n\nexport { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector, ssrSafe as unstable_ssrSafe };\n","import { create } from \"zustand\";\nimport { createJSONStorage, persist } from \"zustand/middleware\";\n\n/**\n * Per-device preferences persisted under `sy:prefs` (spec 10: filters,\n * selected project, pane sizes and last session persist per device).\n */\n\nexport const PANE_LIMITS = {\n navigator: { min: 220, max: 360, default: 264 },\n inspector: { min: 320, max: 600, default: 380 },\n boardColumn: { min: 288, max: 360, default: 320 },\n} as const;\n\nexport type PaneName = keyof typeof PANE_LIMITS;\n\nexport interface Prefs {\n /** Selected project for Board/Code filters; null means all projects. */\n selectedProjectId: string | null;\n /** Last opened session (Code view reopens it). */\n lastSessionId: string | null;\n /** Project of the last session created with New session (prefills the next one). */\n lastNewSessionProjectId: string | null;\n paneSizes: Record<PaneName, number>;\n inspectorCollapsed: boolean;\n /** Rail labels expanded (desktop/compact). */\n railExpanded: boolean;\n /** Desktop composer: Enter sends, Shift+Enter inserts a newline. */\n sendWithEnter: boolean;\n /** Fold the tool calls and thinking of finished turns into one row. */\n collapseWork: boolean;\n /** Free-form per-view filter state, keyed by view (e.g. \"board\", \"navigator\"). */\n filters: Record<string, unknown>;\n}\n\nexport interface PrefsStore extends Prefs {\n set<K extends keyof Prefs>(key: K, value: Prefs[K]): void;\n setPaneSize(pane: PaneName, px: number): void;\n setFilter<T>(view: string, value: T): void;\n}\n\nexport function clampPane(pane: PaneName, px: number): number {\n const l = PANE_LIMITS[pane];\n return Math.round(Math.min(l.max, Math.max(l.min, px)));\n}\n\nfunction defaultSendWithEnter(): boolean {\n if (typeof window === \"undefined\" || !window.matchMedia) return true;\n // Desktop (fine pointer, wide) defaults to Enter-to-send; touch devices use the Send button.\n return window.matchMedia(\"(min-width: 768px) and (pointer: fine)\").matches;\n}\n\nexport const usePrefs = create<PrefsStore>()(\n persist(\n (set) => ({\n selectedProjectId: null,\n lastSessionId: null,\n lastNewSessionProjectId: null,\n paneSizes: {\n navigator: PANE_LIMITS.navigator.default,\n inspector: PANE_LIMITS.inspector.default,\n boardColumn: PANE_LIMITS.boardColumn.default,\n },\n inspectorCollapsed: false,\n railExpanded: false,\n sendWithEnter: defaultSendWithEnter(),\n collapseWork: true,\n filters: {},\n set: (key, value) => set({ [key]: value } as Partial<Prefs>),\n setPaneSize: (pane, px) =>\n set((s) => ({ paneSizes: { ...s.paneSizes, [pane]: clampPane(pane, px) } })),\n setFilter: (view, value) => set((s) => ({ filters: { ...s.filters, [view]: value } })),\n }),\n {\n name: \"sy:prefs\",\n version: 1,\n storage: createJSONStorage(() => localStorage),\n partialize: ({ set: _s, setPaneSize: _p, setFilter: _f, ...prefs }) => prefs,\n },\n ),\n);\n\n/** Read a persisted filter for a view with a fallback. */\nexport function useFilter<T>(view: string, fallback: T): [T, (v: T) => void] {\n const value = usePrefs((s) => s.filters[view]) as T | undefined;\n const setFilter = usePrefs((s) => s.setFilter);\n return [value ?? fallback, (v: T) => setFilter(view, v)];\n}\n","import type { Host } from \"@switchyard/protocol\";\nimport { PI_SUPPORTED_RANGE } from \"@switchyard/protocol\";\nimport {\n ArrowLeft,\n Bell,\n ChevronLeft,\n CircleCheck,\n DatabaseBackup,\n FolderGit2,\n Keyboard,\n KeyRound,\n type LucideIcon,\n MonitorSmartphone,\n Puzzle,\n Server,\n SlidersHorizontal,\n Stethoscope,\n TriangleAlert,\n} from \"lucide-react\";\nimport { type ReactNode, useEffect, useState } from \"react\";\nimport { Link } from \"react-router\";\nimport { backLinkClick, useBackTo } from \"../../app/useBackTo\";\nimport { useBreakpoint } from \"../../app/useBreakpoint\";\nimport { buttonClasses } from \"../../components/ui/Button\";\nimport { InlineStatus } from \"../../components/ui/StatusChip\";\nimport { useSyncStore } from \"../../sync/store\";\n\n/* ------------------------------------------------------------------ */\n/* Sections */\n/* ------------------------------------------------------------------ */\n\nexport type SectionGroup = \"Workspace\" | \"Infrastructure\" | \"Access\" | \"This device\";\n\nexport interface SectionDef {\n path: string;\n label: string;\n description: string;\n icon: LucideIcon;\n group: SectionGroup;\n}\n\nexport const SECTIONS: SectionDef[] = [\n {\n path: \"projects\",\n label: \"Projects\",\n description: \"Repositories, checkouts and workspaces\",\n icon: FolderGit2,\n group: \"Workspace\",\n },\n {\n path: \"profiles\",\n label: \"Pi profiles\",\n description: \"Provider, model and thinking presets\",\n icon: SlidersHorizontal,\n group: \"Workspace\",\n },\n {\n path: \"hosts\",\n label: \"Hosts\",\n description: \"Execution hosts, capabilities and versions\",\n icon: Server,\n group: \"Infrastructure\",\n },\n {\n path: \"adapters\",\n label: \"Adapters\",\n description: \"Extension adapters on each host\",\n icon: Puzzle,\n group: \"Infrastructure\",\n },\n {\n path: \"backups\",\n label: \"Backups\",\n description: \"Back up and restore the coordinator\",\n icon: DatabaseBackup,\n group: \"Infrastructure\",\n },\n {\n path: \"diagnostics\",\n label: \"Diagnostics\",\n description: \"Versions, migrations, events and recent problems\",\n icon: Stethoscope,\n group: \"Infrastructure\",\n },\n {\n path: \"sign-in\",\n label: \"Sign-in\",\n description: \"Passkeys, single sign-on and signing out\",\n icon: KeyRound,\n group: \"Access\",\n },\n {\n path: \"devices\",\n label: \"Devices\",\n description: \"Signed-in browsers, apps and terminals\",\n icon: MonitorSmartphone,\n group: \"Access\",\n },\n {\n path: \"notifications\",\n label: \"Notifications\",\n description: \"Push, quiet hours and previews\",\n icon: Bell,\n group: \"This device\",\n },\n {\n path: \"device\",\n label: \"This device\",\n description: \"Preferences stored on this device\",\n icon: Keyboard,\n group: \"This device\",\n },\n];\n\nexport const SECTION_GROUPS: { label: SectionGroup; sections: SectionDef[] }[] = (\n [\"Workspace\", \"Infrastructure\", \"Access\", \"This device\"] as const\n).map((label) => ({ label, sections: SECTIONS.filter((s) => s.group === label) }));\n\nexport const settingsPath = (sub?: string) => (sub ? `/settings/${sub}` : \"/settings\");\n\n/* ------------------------------------------------------------------ */\n/* Page scaffolding */\n/* ------------------------------------------------------------------ */\n\n/**\n * A settings page: heading, optional actions and a Back link. Top-level\n * sections show \"Back to Settings\" on mobile only (desktop has the section\n * nav); detail pages pass an explicit `back` shown everywhere.\n */\nexport function SectionPage({\n title,\n description,\n actions,\n back,\n testId,\n children,\n}: {\n title: ReactNode;\n description?: ReactNode;\n actions?: ReactNode;\n back?: { to: string; label: string };\n testId?: string;\n children?: ReactNode;\n}) {\n const mobile = useBreakpoint() === \"mobile\";\n const backLink = back ?? (mobile ? { to: settingsPath(), label: \"Settings\" } : null);\n const goBack = useBackTo(backLink?.to ?? settingsPath());\n const compactBack = mobile && !!backLink;\n return (\n <section data-testid={testId} className=\"flex w-full min-w-0 flex-col gap-4 px-4 py-4 md:px-6\">\n {compactBack && backLink ? (\n <header className=\"sticky top-0 z-20 -mx-4 -mt-4 flex min-w-0 items-center gap-1 border-b border-border bg-surface px-1 pb-1 safe-pt-1\">\n <Link\n to={backLink.to}\n onClick={backLinkClick(goBack)}\n aria-label={`Back to ${backLink.label}`}\n title={`Back to ${backLink.label}`}\n className={buttonClasses(\"ghost\", \"md\", \"size-11 px-0\")}\n >\n <ArrowLeft aria-hidden className=\"size-5\" />\n </Link>\n <h1 className=\"min-w-0 flex-1 truncate text-base font-semibold\">{title}</h1>\n </header>\n ) : (\n backLink && (\n <Link\n to={backLink.to}\n onClick={backLinkClick(goBack)}\n className=\"tap -ml-2 inline-flex w-fit items-center gap-1 rounded-md px-2 py-1 text-sm font-medium text-accent hover:bg-surface-2\"\n >\n <ChevronLeft aria-hidden className=\"size-4\" />\n Back to {backLink.label}\n </Link>\n )\n )}\n {(!compactBack || description || actions) && (\n <header className=\"flex min-w-0 flex-wrap items-start gap-3\">\n <div className=\"min-w-0 flex-[1_1_15rem]\">\n {!compactBack && <h1 className=\"break-words text-lg font-semibold\">{title}</h1>}\n {description && <p className=\"text-sm text-muted\">{description}</p>}\n </div>\n {actions && <div className=\"flex flex-wrap items-center gap-2\">{actions}</div>}\n </header>\n )}\n {children}\n </section>\n );\n}\n\n/** Key/value list that stacks on narrow screens. */\nexport function KeyValues({ items }: { items: [ReactNode, ReactNode][] }) {\n return (\n <dl className=\"grid min-w-0 gap-x-4 gap-y-1 text-sm sm:grid-cols-[minmax(8rem,12rem)_minmax(0,1fr)]\">\n {items.map(([k, v], i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static, order-stable list\n <div key={i} className=\"contents\">\n <dt className=\"text-muted\">{k}</dt>\n <dd className=\"mb-1 min-w-0 break-words sm:mb-0\">{v}</dd>\n </div>\n ))}\n </dl>\n );\n}\n\n/** Whether store-backed data is available yet. */\nexport function useHydrated(): boolean {\n return useSyncStore((s) => s.hydrated);\n}\n\nexport const PLATFORM_LABEL: Record<Host[\"platform\"], string> = {\n darwin: \"macOS\",\n linux: \"Linux\",\n};\n\n/** Pi version plus compatible/incompatible text. */\nexport function PiCompat({ host }: { host: Pick<Host, \"piVersion\" | \"piCompatible\"> }) {\n if (!host.piVersion) {\n return (\n <InlineStatus icon={TriangleAlert} tone=\"warning\" label=\"Pi not detected (incompatible)\" />\n );\n }\n return host.piCompatible ? (\n <InlineStatus icon={CircleCheck} tone=\"success\" label={`Pi ${host.piVersion} (compatible)`} />\n ) : (\n <InlineStatus\n icon={TriangleAlert}\n tone=\"danger\"\n label={`Pi ${host.piVersion} (incompatible, needs ${PI_SUPPORTED_RANGE})`}\n />\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Form controls */\n/* ------------------------------------------------------------------ */\n\n/** Validate an absolute host path; returns an error message or null. */\nexport function validateAbsolutePath(path: string): string | null {\n const p = path.trim();\n if (!p) return \"Enter the path of the checkout on the host.\";\n if (!p.startsWith(\"/\")) return \"Use an absolute path that starts with /, e.g. /Users/me/src/app.\";\n return null;\n}\n\n/** Shape check for GET /api/auth/methods. */\nexport function isAuthMethods(v: unknown): boolean {\n if (typeof v !== \"object\" || v === null) return false;\n const m = v as { passkeys?: unknown; passkeyAvailability?: unknown };\n return Array.isArray(m.passkeys) && typeof m.passkeyAvailability === \"object\";\n}\n\n/** Split a textarea into trimmed non-empty lines. */\nexport function splitLines(text: string): string[] {\n return text\n .split(\"\\n\")\n .map((l) => l.trim())\n .filter(Boolean);\n}\n\n/* ------------------------------------------------------------------ */\n/* Expiry countdown */\n/* ------------------------------------------------------------------ */\n\n/** Milliseconds until `iso`, ticking every second; null without a time. */\nexport function useCountdown(iso: string | null | undefined): number | null {\n const [now, setNow] = useState(() => Date.now());\n useEffect(() => {\n if (!iso) return;\n setNow(Date.now());\n const t = setInterval(() => setNow(Date.now()), 1000);\n return () => clearInterval(t);\n }, [iso]);\n if (!iso) return null;\n const at = Date.parse(iso);\n if (Number.isNaN(at)) return null;\n return Math.max(0, at - now);\n}\n\nexport function formatCountdown(ms: number): string {\n const s = Math.ceil(ms / 1000);\n return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, \"0\")}`;\n}\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9],"mappings":"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"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import{_ as e,i as t,m as n,n as r,t as i}from"./jsx-runtime-D13aM9HY.js";var a=e(n(),1),o=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},s=(e=>e?o(e):o),c=e=>e;function l(e,t=c){let n=a.useSyncExternalStore(e.subscribe,a.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return a.useDebugValue(n),n}var u=e=>{let t=s(e),n=e=>l(t,e);return Object.assign(n,t),n},d=(e=>e?u(e):u),f=class extends Error{code;status;details;constructor(e,t,n,r){super(t),this.name=`ApiClientError`,this.code=e,this.status=n,this.details=r}};function p(e,t){return e instanceof f&&(t===void 0||e.code===t)}function m(e){return e instanceof Error?e.message:String(e)}var ee=new Set;function te(e){return ee.add(e),()=>ee.delete(e)}function ne(e,t){if(!t)return e;let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r!=null&&n.set(e,String(r));let r=n.toString();return r?`${e}${e.includes(`?`)?`&`:`?`}${r}`:e}async function re(e,t={}){let n=t.method??(t.body===void 0?`GET`:`POST`),r={Accept:`application/json`,"X-Switchyard-Request":`1`,...t.headers},i;t.body!==void 0&&(r[`Content-Type`]=`application/json`,i=JSON.stringify(t.body));let a;try{a=await fetch(ne(e,t.query),{method:n,headers:r,body:i,credentials:`include`,signal:t.signal})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?e:new f(`network`,`Could not reach the coordinator`,0)}let o=await a.text(),s;if(o)try{s=JSON.parse(o)}catch{s=void 0}if(!a.ok){let e=ie(s),t=e?new f(e.code,e.message,a.status,e.details):new f(a.status===401?`unauthorized`:`http`,`Request failed (${a.status}${a.statusText?` ${a.statusText}`:``})`,a.status);if(a.status===401)for(let e of ee)e(t.code);throw t}return s}function ie(e){if(!e||typeof e!=`object`)return null;let t=e.error;if(!t||typeof t!=`object`)return null;let{code:n,message:r,details:i}=t;return typeof n==`string`?{code:n,message:typeof r==`string`?r:n,details:i}:null}var ae=(e,t,n)=>re(e,{method:`GET`,query:t,signal:n}),oe=(e,t,n)=>re(e,{method:`POST`,body:t??{},signal:n}),se=(e,t)=>re(e,{method:`PATCH`,body:t}),ce=(e,t)=>re(e,{method:`DELETE`,body:t}),le=`switchyard`,ue=`kv`,de=`sync`,fe=`transcripts`,pe=50,me=`sy:sync-cache`,he=null;function ge(){return he||(he=new Promise(e=>{if(typeof indexedDB>`u`)return e(null);try{let t=indexedDB.open(le,2);t.onupgradeneeded=()=>{let e=t.result;e.objectStoreNames.contains(ue)||e.createObjectStore(ue),e.objectStoreNames.contains(fe)||e.createObjectStore(fe)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}catch{e(null)}}),he)}function _e(e,t){return ge().then(n=>new Promise((r,i)=>{if(!n)return i(Error(`no indexeddb`));let a=t(n.transaction(ue,e).objectStore(ue));a.onsuccess=()=>r(a.result),a.onerror=()=>i(a.error)}))}async function ve(){try{let e=await _e(`readonly`,e=>e.get(de));if(e)return e}catch{}try{let e=localStorage.getItem(me);return e?JSON.parse(e):null}catch{return null}}async function ye(e){try{await _e(`readwrite`,t=>t.put(e,de));return}catch{}try{localStorage.setItem(me,JSON.stringify(e))}catch{}}function be(e,t){return ge().then(n=>new Promise((r,i)=>{if(!n)return i(Error(`no indexeddb`));let a=t(n.transaction(fe,e).objectStore(fe));a.onsuccess=()=>r(a.result),a.onerror=()=>i(a.error)}))}async function xe(e){try{return await be(`readonly`,t=>t.get(e))??null}catch{return null}}async function Se(e){try{await be(`readwrite`,t=>t.put(e,e.sessionId));let t=await be(`readonly`,e=>e.count());if(t<=pe)return;let n=await be(`readonly`,e=>e.getAll());n.sort((e,t)=>e.savedAt.localeCompare(t.savedAt));for(let e of n.slice(0,t-pe))await be(`readwrite`,t=>t.delete(e.sessionId))}catch{}}async function Ce(){try{await _e(`readwrite`,e=>e.delete(de))}catch{}try{await be(`readwrite`,e=>e.clear())}catch{}try{localStorage.removeItem(me)}catch{}}function we(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 Te(e,t=`|`){return e.map(e=>Je(e)).join(t)}function Ee(e,t){return typeof t==`bigint`?t.toString():t}var De=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Oe(e){return new De(e)}function ke(e){return e==null}function Ae(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function je(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Me=Symbol(`evaluating`);function Ne(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Me)return r===void 0&&(r=Me,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function h(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Pe(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function g(e){return Pe(e._zod.def)??e._zod.def.shape}function Fe(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return h(this,t,e),e},enumerable:!0,configurable:!0})}function Ie(e,t,n){t in e?h(e,t,n):e[t]=n}function Le(e,t,n,r){let i=g(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Fe(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):Ie(e,a,r?r(n.value,a):n.value))}}function Re(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Fe(e,n,()=>t[n]):Ie(e,n,r.value))}}function _(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ze(e){return JSON.stringify(e)}function Be(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Ve=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function He(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ue=Oe(()=>{if(w.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function We(e){if(He(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return He(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Ge(e){return We(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Ke=new Set([`string`,`number`,`symbol`]);function qe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function v(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function y(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(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 Je(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Ye(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Xe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ze={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Qe(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`);let i={};return Le(i,e,$e(e,t)),v(e,_(n,{shape:i,checks:[]}))}function $e(e,t){let n=g(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function et(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`);let i=new Set($e(e,t)),a={};return Le(a,e,Reflect.ownKeys(g(e)).filter(e=>!i.has(e))),v(e,_(n,{shape:a,checks:[]}))}function tt(e,t){if(!We(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=g(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return v(e,_(e._zod.def,{shape:nt(e,t)}))}function nt(e,t){let n={};return Le(n,e,Reflect.ownKeys(g(e))),Re(n,t),n}function rt(e,t){if(!We(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return v(e,_(e._zod.def,{shape:nt(e,t)}))}function it(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Le(n,e,Reflect.ownKeys(g(e))),Le(n,t,Reflect.ownKeys(g(t))),v(e,_(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function at(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set($e(t,n)):void 0,o={};return Le(o,t,Reflect.ownKeys(g(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),v(t,_(t._zod.def,{shape:o,checks:[]}))}function ot(e,t,n){let r=n?new Set($e(t,n)):void 0,i={};return Le(i,t,Reflect.ownKeys(g(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),v(t,_(t._zod.def,{shape:i}))}function b(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function st(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ct(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function lt(e){return typeof e==`string`?e:e?.message}function ut(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function dt(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function x(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:lt(e.inst?._zod.def?.error?.(e))??lt(a?.(e))??lt(t?.error?.(e))??lt(n.customError?.(e))??lt(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var ft=/[\uD800-\uDBFF]/;function pt(e){let t=e.length;if(!ft.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function mt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function ht(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function gt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function _t(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):xt(e,n,r.value)}}function vt(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function yt(e,t,n){return vt(e,t,n,!1)}function bt(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return vt(this,n,r(this))},set(e){vt(this,n,e)}})}return t}function xt(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:vt(this,t,n.bind(this))},set(e){vt(this,t,e)}})}function St(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Ct,wt=!1,Tt={configurable:!0,get(){wt=!0}};function S(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Ct!==e._zod?Ct=void 0:(Ct=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Tt);let e=wt;wt=!1;try{let r=n(this);return wt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),wt||=e,r}catch(n){throw delete this[t],wt||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Et(e,t,n,r){let i=St(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Dt=`~constantCatch`;function Ot(e){let t=()=>e;return t[Dt]=!0,t}var kt,At={value:void 0,enumerable:!1},jt=`captureStackTrace`in Error?Error:null;function Mt(e){let t=jt;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return jt=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function C(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){At.value=new a(r);try{Object.defineProperty(n,"_zod",At)}finally{At.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),_t(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Mt(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Nt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Pt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(kt=globalThis).__zod_globalConfig??(kt.__zod_globalConfig={});var w=globalThis.__zod_globalConfig;function T(e){return e&&Object.assign(w,e),w}function Ft(){let e=this._zod;return e.message??=JSON.stringify(e.def,Ee,2),e.message}function It(e){this._zod.message=e}var Lt={get:Ft,set:It,enumerable:!0,configurable:!0},Rt={value:void 0,enumerable:!1},zt=new WeakSet([Object.prototype,Error.prototype]),Bt=C(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Rt.value=t,Object.defineProperty(e,"issues",Rt),Rt.value=void 0,Object.defineProperty(e,"message",Lt);let n=Object.getPrototypeOf(e);zt.has(n)||(zt.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function Vt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Ht(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Vt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ut(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Wt(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Gt=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Nt;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>x(e,o,T())));throw Ve(n,a?.callee??t),n}return s.value};return t},Kt=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>x(e,o,T())));throw Ve(n,a?.callee??t),n}return s.value};return t},qt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Nt;return a.issues.length?Jt(e,a.issues,i):{success:!0,data:a.value}};function Jt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>x(e,n,T()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Yt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Jt(e,a.issues,i):{success:!0,data:a.value}},Xt=Symbol.for(`zod.compile.invalid`),Zt=Symbol.for(`zod.compile.fallback`),Qt=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Xt)return!0;if(r.definite===!0&&n===void 0)return!1}return $t(e,t,n)});function $t(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Zt]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Nt;return a.issues.length===0}var en=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},tn=e=>{let t=Gt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Wt(n,a))};return n},nn=e=>{let t=Gt(e),n=(e,r,i,a)=>t(e,r,i,Wt(n,a));return n},rn=e=>{let t=Kt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Wt(n,a))};return n},an=e=>{let t=Kt(e),n=async(e,r,i,a)=>await t(e,r,i,Wt(n,a));return n},on=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return qt(e)(t,n,i)},sn=e=>(t,n,r)=>qt(e)(t,n,r),cn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Yt(e)(t,n,i)},ln=e=>async(t,n,r)=>Yt(e)(t,n,r),un=/^[cC][0-9a-z]{6,}$/,dn=/^[0-9a-z]+$/,fn=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,pn=/^[0-9a-vA-V]{20}$/,mn=/^[A-Za-z0-9]{27}$/,hn=/^[a-zA-Z0-9_-]{21}$/;function gn(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var _n=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vn=/^([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})$/,yn=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)$/,bn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,xn=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Sn(){return new RegExp(xn,`u`)}var Cn=/^(?:(?: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])$/,wn=/^(([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}|:))$/,Tn=/^((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])$/,En=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Dn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,On=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,kn=/^https?$/,An=/^\+[1-9]\d{6,14}$/,jn=`(?:(?:\\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])))`;function Mn(e){return RegExp(`^${e}$`)}var Nn=Mn(jn);function Pn(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Fn(e){return RegExp(`^${Pn(e)}$`)}function In(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Pn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Pn({precision:e.precision})}`:n;return RegExp(`^${jn}T(?:${r})$`)}var Ln=/^[\s\S]{0,}$/,Rn=/^-?\d+$/,zn=/^-?\d+(?:\.\d+)?$/,Bn=/^(?:true|false)$/i,Vn=/^[^A-Z]*$/,Hn=/^[^a-z]*$/,E=C(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Un=e=>{let t=e.value;return!ke(t)&&t.length!==void 0},Wn={number:`number`,bigint:`bigint`,object:`date`},Gn=C(`$ZodCheckLessThan`,(e,t)=>{E.init(e,t);let n=Wn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Wn[typeof r.value]??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})}}),Kn=C(`$ZodCheckGreaterThan`,(e,t)=>{E.init(e,t);let n=Wn[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Wn[typeof r.value]??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})}}),qn=C(`$ZodCheckMultipleOf`,(e,t)=>{E.init(e,t),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`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):je(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})}}),Jn=C(`$ZodCheckNumberFormat`,(e,t)=>{E.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Xe[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Yn=C(`$ZodCheckMaxLength`,(e,t)=>{var n;E.init(e,t),(n=e._zod.def).when??(n.when=Un),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?pt(r):i)<=t.maximum)return;let a=mt(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Xn=C(`$ZodCheckMinLength`,(e,t)=>{var n;E.init(e,t),(n=e._zod.def).when??(n.when=Un),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?pt(r):i)>=t.minimum)return;let a=mt(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Zn=C(`$ZodCheckLengthEquals`,(e,t)=>{var n;E.init(e,t),(n=e._zod.def).when??(n.when=Un),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?pt(r):i;if(a===t.length)return;let o=mt(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Qn=C(`$ZodCheckStringFormat`,(e,t)=>{var n,r;E.init(e,t),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=()=>{})}),$n=C(`$ZodCheckRegex`,(e,t)=>{Qn.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})}}),er=C(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Vn,Qn.init(e,t)}),tr=C(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Hn,Qn.init(e,t)}),nr=C(`$ZodCheckIncludes`,(e,t)=>{E.init(e,t);let n=qe(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),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})}}),rr=C(`$ZodCheckStartsWith`,(e,t)=>{E.init(e,t);let n=RegExp(`^${qe(t.prefix)}.*`);t.pattern??=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})}}),ir=C(`$ZodCheckEndsWith`,(e,t)=>{E.init(e,t);let n=RegExp(`.*${qe(t.suffix)}$`);t.pattern??=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})}}),ar=C(`$ZodCheckOverwrite`,(e,t)=>{E.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),or=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--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(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
3
|
-
`)}\n};`)(...Object.values(this.closed))}},sr={major:4,minor:6,patch:7},D=C(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=sr;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=b(t),a;for(let o of n){if(o._zod.def.when){if(st(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Nt;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(dt(t.issues,n,e),i||=b(t,n))});else{if(t.issues.length===n)continue;dt(t.issues,n,e),i||=b(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(b(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Nt;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Nt;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return yt(this,`~standard`,ur(this))},set"~standard"(e){vt(this,`~standard`,e)}}),cr=(e,t)=>e.issues.length?{issues:e.issues.map(e=>x(e,t,T()))}:{value:e.value};async function lr(e,t){let n={async:!0};return cr(await e._zod.run({value:t,issues:[]},n),n)}function ur(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return cr(r,n)}catch{}return lr(e,t)},vendor:`zod`,version:1}}var dr=C(`$ZodString`,(e,t)=>{D.init(e,t),e._zod.pattern=t.pattern??Ln,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}}),O=C(`$ZodStringFormat`,(e,t)=>{Qn.init(e,t),dr.init(e,t)}),fr=C(`$ZodGUID`,(e,t)=>{t.pattern??=vn,O.init(e,t)}),pr=C(`$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??=yn(e)}else t.pattern??=yn();O.init(e,t)}),mr=C(`$ZodEmail`,(e,t)=>{t.pattern??=bn,O.init(e,t)});function hr(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function gr(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?hr(e)||2:_r(e,t)}function _r(e,t){if(!t.normalize&&t.protocol?.source===kn.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var vr=/[\t\n\r]/g;function yr(e){return e.replace(vr,``)}function br(e,t){return t.lastIndex=0,t.test(e.hostname)}function xr(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Sr=C(`$ZodURL`,(e,t)=>{O.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=gr(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=yr(r);return}t.hostname&&!br(i,t.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&&!xr(i,t.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:yr(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Cr=C(`$ZodEmoji`,(e,t)=>{t.pattern??=Sn(),O.init(e,t)}),wr=C(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?hn:gn(t.length),O.init(e,t)}),Tr=C(`$ZodCUID`,(e,t)=>{t.pattern??=un,O.init(e,t)}),Er=C(`$ZodCUID2`,(e,t)=>{t.pattern??=dn,O.init(e,t)}),Dr=C(`$ZodULID`,(e,t)=>{t.pattern??=fn,O.init(e,t)}),Or=C(`$ZodXID`,(e,t)=>{t.pattern??=pn,O.init(e,t)}),kr=C(`$ZodKSUID`,(e,t)=>{t.pattern??=mn,O.init(e,t)}),Ar=C(`$ZodISODateTime`,(e,t)=>{t.pattern??=In(t),O.init(e,t)}),jr=C(`$ZodISODate`,(e,t)=>{t.pattern??=Nn,O.init(e,t)}),Mr=C(`$ZodISOTime`,(e,t)=>{t.pattern??=Fn(t),O.init(e,t)}),Nr=C(`$ZodISODuration`,(e,t)=>{t.pattern??=_n,O.init(e,t)}),Pr=C(`$ZodIPv4`,(e,t)=>{t.pattern??=Cn,O.init(e,t)}),Fr=/^[0-9a-fA-F:.]+$/;function Ir(e){return Fr.test(e)?hr(`http://[${e}]`):!1}var Lr=C(`$ZodIPv6`,(e,t)=>{t.pattern??=wn,O.init(e,t),e._zod.check=n=>{Ir(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Rr=C(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Tn,O.init(e,t)});function zr(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Ir(n)}var Br=C(`$ZodCIDRv6`,(e,t)=>{t.pattern??=En,O.init(e,t),e._zod.check=n=>{zr(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Vr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Hr=/^[0-9a-zA-Z+/]*={0,2}$/,Ur=C(`$ZodBase64`,(e,t)=>{t.pattern??=Hr,O.init(e,t),e._zod.check=n=>{Vr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Wr=/^[A-Za-z0-9_-]*$/;function Gr(e){if(!Wr.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Vr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Kr=C(`$ZodBase64URL`,(e,t)=>{t.pattern??=Wr,O.init(e,t),e._zod.check=n=>{Gr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),qr=C(`$ZodE164`,(e,t)=>{t.pattern??=An,O.init(e,t)});function Jr(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?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Yr=C(`$ZodJWT`,(e,t)=>{O.init(e,t),e._zod.check=n=>{Jr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Xr=C(`$ZodNumber`,(e,t)=>{D.init(e,t),e._zod.pattern=zn,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:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Zr=C(`$ZodNumberFormat`,(e,t)=>{Jn.init(e,t),Xr.init(e,t)}),Qr=C(`$ZodBoolean`,(e,t)=>{D.init(e,t),e._zod.pattern=Bn,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}}),$r=C(`$ZodUnknown`,(e,t)=>{D.init(e,t),e._zod.parse=e=>e}),ei=C(`$ZodNever`,(e,t)=>{D.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ti(e,t){let n=ut(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of ut(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,dt(n.issues,t,e),n}}return i(n,a)}}var ni=e=>Array.isArray(e)?e.length:-1;function ri(e,t,n){e.issues.length&&t.issues.push(...ct(n,e.issues)),t.value[n]=e.value}var ii=C(`$ZodArray`,(e,t)=>{D.init(e,t);let n=w.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>ri(t,r,e)));else if(ri(c,r,e),s&&c.issues.length!==0&&b(c))break}return o.length?Promise.all(o).then(()=>r):r},ti(e,ni)});function ai(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...ct(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var oi=[];function si(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:oi,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Ye(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function ci(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(b(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>ai(e,n,i,t,d,f))):ai(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var li=C(`$ZodObject`,(e,t)=>{D.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Oe(()=>si(t));S(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||h(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=He,o=t.catchall,s,c=w.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(b(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>ai(n,t,e,r,a,o))):ai(s,t,e,r,a,o)}return o?ci(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),ui=C(`$ZodObjectJIT`,(e,t)=>{li.init(e,t);let n=e._zod.parse,r=Oe(()=>si(t)),i=w.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new or([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
4
|
-
let ${e}_ab = false;
|
|
5
|
-
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
6
|
-
const iss = ${e}.issues[i];
|
|
7
|
-
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
8
|
-
payload.issues.push(iss);
|
|
9
|
-
if (iss.continue !== true) ${e}_ab = true;
|
|
10
|
-
}
|
|
11
|
-
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
12
|
-
payload.value = newResult;
|
|
13
|
-
return payload;
|
|
14
|
-
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:ze(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
15
|
-
const ${n}_present = ${i};
|
|
16
|
-
if (!${n}.issues.length || ${n}_present) {
|
|
17
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (${e}) {
|
|
21
|
-
newResult[${r}] = ${n}.value;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
`)}else f?(o.write(`
|
|
26
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
27
|
-
}
|
|
28
|
-
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
29
|
-
if (${n}.value !== undefined || ${i}) {
|
|
30
|
-
newResult[${r}] = ${n}.value;
|
|
31
|
-
}
|
|
32
|
-
`)):o.write(`
|
|
33
|
-
const ${n}_present = ${i};
|
|
34
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
35
|
-
}
|
|
36
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
37
|
-
payload.issues.push({
|
|
38
|
-
code: "invalid_type",
|
|
39
|
-
expected: "nonoptional",
|
|
40
|
-
input: undefined,
|
|
41
|
-
path: [${r}]
|
|
42
|
-
});
|
|
43
|
-
if (ctx && ctx.abortEarly) {
|
|
44
|
-
payload.value = newResult;
|
|
45
|
-
return payload;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (${n}_present) {
|
|
50
|
-
newResult[${r}] = ${n}.value;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=He,c=!w.jitless,l=c&&Ue.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?ci([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function di(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!b(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>x(e,r,T())))}),t)}var fi=C(`$ZodUnion`,(e,t)=>{D.init(e,t),S(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),S(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),S(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),S(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Ae(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>di(t,r,e,i)):di(o,r,e,i)}});function pi(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var mi=C(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,fi.init(e,t);let n=e._zod.parse;S(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||h(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Pe(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Oe(()=>pi(t));e._zod.parse=(i,a)=>{let o=i.value;if(!He(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),hi=C(`$ZodIntersection`,(e,t)=>{D.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])=>_i(e,t,n)):_i(e,i,a)}});function gi(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(We(e)&&We(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=gi(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=gi(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 _i(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=gi(t.value,n.value);if(!c.valid){if(b(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var vi=C(`$ZodRecord`,(e,t)=>{D.init(e,t);let n=w.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!We(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>x(e,i,T())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...ct(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...ct(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&zn.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>x(e,i,T())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...ct(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...ct(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),yi=C(`$ZodEnum`,(e,t)=>{D.init(e,t);let n=we(t.entries),r=new Set(n);e._zod.values=r,S(e,`pattern`,e=>{let t=we(e.def.entries).filter(e=>Ke.has(typeof e));return RegExp(t.length?`^(${t.map(e=>qe(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),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}}),bi=C(`$ZodLiteral`,(e,t)=>{D.init(e,t);let n=new Set(t.values);e._zod.values=n,S(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?qe(e):e?qe(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),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}}),xi=C(`$ZodTransform`,(e,t)=>{D.init(e,t),e._zod.optin=`optional`,w.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Pt(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Nt;return n.value=i,n}});function Si(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ci=C(`$ZodOptional`,(e,t)=>{D.init(e,t),S(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,S(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),S(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ae(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Si(e,t)):Si(e,r)}return t.innerType._zod.run(e,n)}}),wi=C(`$ZodExactOptional`,(e,t)=>{Ci.init(e,t),S(e,`values`,e=>e.def.innerType._zod.values),S(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ti=C(`$ZodNullable`,(e,t)=>{D.init(e,t),S(e,`optin`,e=>e.def.innerType._zod.optin),S(e,`optout`,e=>e.def.innerType._zod.optout),S(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ae(t.source)}|null)$`):void 0}),S(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ei=C(`$ZodDefault`,(e,t)=>{D.init(e,t),e._zod.optin=`defaulted`,S(e,`values`,e=>e.def.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=>Di(e,t)):Di(r,t)}});function Di(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Oi=C(`$ZodPrefault`,(e,t)=>{D.init(e,t),e._zod.optin=`defaulted`,S(e,`values`,e=>e.def.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))}),ki=C(`$ZodNonOptional`,(e,t)=>{D.init(e,t),S(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].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=>Ai(t,e)):Ai(i,e)}});function Ai(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function ji(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>x(e,r,T()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Mi=C(`$ZodCatch`,(e,t)=>{D.init(e,t),S(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),S(e,`optout`,e=>e.def.innerType._zod.optout),S(e,`values`,e=>e.def.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({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>ji(e,r,t,n)):ji(e,r,t,n)}}),Ni=C(`$ZodPipe`,(e,t)=>{D.init(e,t),S(e,`values`,e=>e.def.in._zod.values),S(e,`optin`,e=>e.def.in._zod.optin),S(e,`optout`,e=>e.def.out._zod.optout),S(e,`propValues`,e=>e.def.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=>Pi(e,t.in,n)):Pi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Pi(e,t.out,n)):Pi(r,t.out,n)}});function Pi(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Fi=C(`$ZodPreprocess`,(e,t)=>{Ni.init(e,t)}),Ii=C(`$ZodReadonly`,(e,t)=>{D.init(e,t),S(e,`propValues`,e=>e.def.innerType._zod.propValues),S(e,`values`,e=>e.def.innerType._zod.values),S(e,`optin`,e=>e.def.innerType?._zod?.optin),S(e,`optout`,e=>e.def.innerType?._zod?.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(Li):Li(r)}});function Li(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Ri=C(`$ZodLazy`,(e,t)=>{D.init(e,t),Ne(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),S(e,`pattern`,e=>e.innerType?._zod?.pattern),S(e,`propValues`,e=>e.innerType?._zod?.propValues),S(e,`optin`,e=>e.innerType?._zod?.optin??void 0),S(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),zi=C(`$ZodCustom`,(e,t)=>{E.init(e,t),D.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=>Bi(t,n,r,e));Bi(i,n,r,e)}});function Bi(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(gt(e))}}var Vi=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Hi=`~memo`,Ui=[];function Wi(e){return typeof e==`object`&&!!e}function Gi(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Ki=new WeakMap,qi=0,Ji=1,Yi=2;function Xi(e,t,n){let r=Ki.get(e);if(r!==void 0)return r?Yi:qi;if(t.has(e))return Yi;t.add(e);let i=qi,a=e=>{if(i!==Yi&&e?._zod){let r=Xi(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=qi;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Ji:o.value?._zod?Xi(o.value,t,n):qi;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Pe(c);s(e?o(e,!0):Ji),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Xi(r,t,!1):Ji);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Zi(e,i)}function Zi(e,t){return t!==Ji&&Ki.set(e,t===Yi),t}function Qi(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var $i,ea=[],ta={alloc(e,t,n){let r=$i;if(!r)return n;$i=void 0;let i={value:n,issues:null};return r.set(t.value,i),ea.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&ra(n,e.value))throw new Vi;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Xi(e,new Set,!1);if(i===qi)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Yi||r?n=!0:r=!0}let l=s.value;if(!Wi(l))return t(s,c);let u=c[Hi];u||(u={buckets:new WeakMap,backEdges:void 0},c[Hi]=u);let d;i===c?d=a:(d=Qi(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Gi(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;$i=d;let p=ea.length,m=t(s,c);$i=void 0;let ee=ea.length>p?ea.pop():void 0;return m instanceof Promise?m.then(e=>(ee&&(ee.issues=e.issues.length?Gi(e.issues):Ui),e)):(ee&&(ee.issues=m.issues.length?Gi(m.issues):Ui),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function na(){return ta}function ra(e,t){let n=e[Hi]?.backEdges;return n!==void 0&&Wi(t)&&n.has(t)}var ia=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(ht(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Je(e.values[0])}`:`Invalid option: expected one of ${Te(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Te(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function aa(){return{localeError:ia()}}var oa,sa=class{constructor(){this._map=new WeakMap,this._idmap=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=new WeakMap,this._idmap=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 ca(){return new sa}(oa=globalThis).__zod_globalRegistry??(oa.__zod_globalRegistry=ca());var la=globalThis.__zod_globalRegistry;function ua(e){return e.checks&&=[...e.checks],e}function da(e,t){return new e(ua({type:`string`,...y(t)}))}function fa(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...y(t)})}function pa(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...y(t)})}function ma(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...y(t)})}function ha(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...y(t)})}function ga(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...y(t)})}function _a(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...y(t)})}function va(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...y(t)})}function ya(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...y(t)})}function ba(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...y(t)})}function xa(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...y(t)})}function Sa(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...y(t)})}function Ca(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...y(t)})}function wa(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...y(t)})}function Ta(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...y(t)})}function Ea(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...y(t)})}function Da(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...y(t)})}function Oa(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...y(t)})}function ka(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...y(t)})}function Aa(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...y(t)})}function ja(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...y(t)})}function Ma(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...y(t)})}function Na(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...y(t)})}function Pa(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...y(t)})}function Fa(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...y(t)})}function Ia(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...y(t)})}function La(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...y(t)})}function Ra(e,t){return new e(ua({type:`number`,checks:[],...y(t)}))}function za(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...y(t)})}function Ba(e,t){return new e({type:`boolean`,...y(t)})}function Va(e){return new e({type:`unknown`})}function Ha(e,t){return new e({type:`never`,...y(t)})}function Ua(e,t){return new Gn({check:`less_than`,...y(t),value:e,inclusive:!1})}function Wa(e,t){return new Gn({check:`less_than`,...y(t),value:e,inclusive:!0})}function Ga(e,t){return new Kn({check:`greater_than`,...y(t),value:e,inclusive:!1})}function Ka(e,t){return new Kn({check:`greater_than`,...y(t),value:e,inclusive:!0})}function qa(e,t){return new qn({check:`multiple_of`,...y(t),value:e})}function Ja(e,t){return new Yn({check:`max_length`,...y(t),maximum:e})}function Ya(e,t){return new Xn({check:`min_length`,...y(t),minimum:e})}function Xa(e,t){return new Zn({check:`length_equals`,...y(t),length:e})}function Za(e,t){return new $n({check:`string_format`,format:`regex`,...y(t),pattern:e})}function Qa(e){return new er({check:`string_format`,format:`lowercase`,...y(e)})}function $a(e){return new tr({check:`string_format`,format:`uppercase`,...y(e)})}function eo(e,t){return new nr({check:`string_format`,format:`includes`,...y(t),includes:e})}function to(e,t){return new rr({check:`string_format`,format:`starts_with`,...y(t),prefix:e})}function no(e,t){return new ir({check:`string_format`,format:`ends_with`,...y(t),suffix:e})}function ro(e){return new ar({check:`overwrite`,tx:e})}function io(e){return ro(t=>t.normalize(e))}function ao(){return ro(e=>e.trim())}function oo(){return ro(e=>e.toLowerCase())}function so(){return ro(e=>e.toUpperCase())}function co(){return ro(e=>Be(e))}function lo(e,t,n){return new e({type:`array`,element:t,...y(n)})}function uo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...y(n)})}function fo(e,t){let n=po(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(gt(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(gt(r))}},e(t.value,t)),t);return n}function po(e,t){let n=new E({check:`custom`,...y(t)});return n._zod.check=e,n}function mo(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&h(e,t,n[t]);return e}function ho(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??la,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function k(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function A(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,A(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&mo(o.schema,c),t.io===`input`&&j(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function go(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function _o(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.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 i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${go(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+go(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
54
|
-
|
|
55
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function vo(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;vo(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var yo=new Set([`type`,`properties`,`required`,`additionalProperties`]),bo=[`oneOf`,`anyOf`];function xo(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function So(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!yo.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??xo(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}h(n,r,e.length===1?e[0]:So(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=xo(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Co(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of yo)if(t in e)return;let n=t.filter(e=>bo.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=So(t);else{let e=n[0],i=bo.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>So([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,mo(e,r))}function wo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(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`)?(i.allOf=i.allOf??[],i.allOf.push(s)):mo(i,s),mo(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())vo(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Co(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}mo(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,h(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Eo(t,`input`,e.processors),output:Eo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function j(e,t){let n=t??{seen: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 j(r.element,n);if(r.type===`set`)return j(r.valueType,n);if(r.type===`lazy`)return j(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`||r.type===`catch`)return j(r.innerType,n);if(r.type===`intersection`)return j(r.left,n)||j(r.right,n);if(r.type===`record`||r.type===`map`)return j(r.keyType,n)||j(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:j(r.in,n)||j(r.out,n);if(r.type===`object`){for(let e in r.shape)if(j(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(j(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(j(e,n))return!0;return!!(r.rest&&j(r.rest,n))}return!1}var To=(e,t={})=>n=>{let r=ho({...n,processors:t});return A(e,r),_o(r,e),wo(r,e)},Eo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ho({...i??{},target:a,io:t,processors:n});return A(e,o),_o(o,e),wo(o,e)},Do=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Oo=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},ko=(e,t)=>{Do(e,`minimum`,t),Oo(e,`maximum`,t)},Ao=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},jo=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Mo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},No=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Po=(e,t)=>Do(e,`minimum`,t.minimum),Fo=(e,t)=>Oo(e,`maximum`,t.maximum),Io=e=>(t,n)=>{No(t,n.format);let[r,i]=e[n.format];Do(t,`minimum`,r),Oo(t,`maximum`,i)},Lo={greater_than:(e,t)=>Do(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Oo(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Ao(e,t.value),number_format:Io(Xe),bigint_format:Io(Ze),min_length:Po,max_length:Fo,length_equals:(e,t)=>ko(e,t.length),min_size:Po,max_size:Fo,size_equals:(e,t)=>ko(e,t.size),string_format:(e,t)=>{No(e,t.format),t.pattern&&jo(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Mo(e,t.mime)};function M(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Lo[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Do(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Do(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Oo(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Oo(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Ao(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Mo(t,i.mime);for(let e of i.patterns??[])jo(t,e);return t}var Ro={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},zo=new Map([[Hr,Dn],[Wr,On]]),Bo=e=>zo.get(e)??e,Vo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=M(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ro[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Bo);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}))])}},Ho=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=M(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):k(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Uo=(e,t,n,r)=>{n.type=`boolean`},Wo=(e,t,n,r)=>{n.not={}},Go=(e,t,n,r)=>{let i=e._zod.def,a=we(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Ko=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(k(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(k(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);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}},qo=(e,t,n,r)=>{k(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Jo=(e,t,n,r)=>{k(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Yo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=M(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=A(a.element,t,{...r,path:[...r.path,`items`]})};function Xo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Xo(t.out):t.type===`catch`?Xo(t.innerType):e._zod.optin}var Zo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&k(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)h(i.properties,e,A(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Xo(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=A(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Qo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>A(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},$o=(e,t,n,r)=>{let i=e._zod.def,a=A(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=A(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function es(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=es(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>es(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?zn:Rn).source)),p}var ts=new WeakMap;function ns(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of ts.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=es(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var rs=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=M(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=A(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)h(i.patternProperties,Bo(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=A(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=ts.get(t);n||(n=[],ts.set(t,n),t.deferred.push(()=>ns(t))),n.push(e)}i.additionalProperties=A(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Xo(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},is=(e,t,n,r)=>{let i=e._zod.def,a=A(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`}]},as=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},os=Symbol();function ss(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(k(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),os):JSON.parse(o)}var cs=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=ss(i.defaultValue,e,t,n,r);o!==os&&(n.default=o)},ls=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=ss(i.defaultValue,e,t,n,r);o!==os&&(n._prefault=o)},us=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{k(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},ds=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;A(o,t,r);let s=t.seen.get(e);s.ref=o},fs=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ps=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ms=(e,t,n,r)=>{let i=e._zod.innerType;A(i,t,r);let a=t.seen.get(e);a.ref=i},hs=new WeakSet([Object.prototype,Error.prototype]);function gs(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var N=C(`ZodError`,(e,t)=>{Bt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);hs.has(n)||(hs.add(n),gs(n,`format`,e=>t=>Ut(e,t)),gs(n,`flatten`,e=>t=>Ht(e,t)),gs(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ee,2)}),gs(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ee,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),_s=Gt(N),vs=Kt(N),ys=qt(N),bs=Yt(N),xs=tn(N),Ss=nn(N),Cs=rn(N),ws=an(N),Ts=on(N),Es=sn(N),Ds=cn(N),Os=ln(N);function ks(){w.localeError||T(aa())}function As(){w.memoizer||T({memoizer:na()})}var P=C(`ZodType`,(e,t)=>(ks(),D.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(_(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return v(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Uc(e,t))},superRefine(e,t){return this.check(Wc(e,t))},overwrite(e){return this.check(ro(e))},optional(){return Sc(this)},exactOptional(){return wc(this)},nullable(){return Ec(this)},nullish(){return Sc(Ec(this))},nonoptional(e){return Mc(this,e)},array(){return B(this)},or(e){return H([this,e])},and(e){return mc(this,e)},transform(e){return Ic(this,bc(e))},default(e){return Oc(this,e)},prefault(e){return Ac(this,e)},catch(e){return Pc(this,e)},pipe(e){return Ic(this,e)},readonly(){return zc(this)},describe(e){let t=this.clone();return la.add(t,{description:e}),t},meta(...e){if(e.length===0)return la.get(this);let t=this.clone();return la.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return yt(this,`~standard`,{...ur(this),jsonSchema:{input:Eo(this,`input`),output:Eo(this,`output`)}})},set"~standard"(e){vt(this,`~standard`,e)},parse:function e(t,n){return _s(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await vs(this,t,n,{callee:e})},safeParse(e,t){return ys(this,e,t)},async safeParseAsync(e,t){return bs(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){vt(this,`spa`,e)},validate(e,t){return Qt(this,e,t)},validateAsync(e,t){return en(this,e,t)},encode:function e(t,n){return xs(this,t,n,{callee:e})},decode:function e(t,n){return Ss(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Cs(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await ws(this,t,n,{callee:e})},safeEncode(e,t){return Ts(this,e,t)},safeDecode(e,t){return Es(this,e,t)},async safeEncodeAsync(e,t){return Ds(this,e,t)},async safeDecodeAsync(e,t){return Os(this,e,t)},toJSONSchema(e){return To(this,{})(e)},get description(){return la.get(this)?.description},get _def(){return this._zod.def}}),js=C(`_ZodString`,(e,t)=>{dr.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vo(e,t,n,r)},bt({format:e=>M(e).format??null,minLength:e=>M(e).minimum??null,maxLength:e=>M(e).maximum??null},{regex(...e){return this.check(Za(...e))},includes(...e){return this.check(eo(...e))},startsWith(...e){return this.check(to(...e))},endsWith(...e){return this.check(no(...e))},min(...e){return this.check(Ya(...e))},max(...e){return this.check(Ja(...e))},length(...e){return this.check(Xa(...e))},nonempty(...e){return this.check(Ya(1,...e))},lowercase(e){return this.check(Qa(e))},uppercase(e){return this.check($a(e))},trim(){return this.check(ao())},normalize(...e){return this.check(io(...e))},toLowerCase(){return this.check(oo())},toUpperCase(){return this.check(so())},slugify(){return this.check(co())}})),Ms=C(`ZodString`,(e,t)=>{dr.init(e,t),js.init(e,t)},{email(e){return this.check(fa(Ls,e))},url(e){return this.check(va(Bs,e))},jwt(e){return this.check(Na(tc,e))},emoji(e){return this.check(ya(Vs,e))},guid(e){return this.check(pa(Rs,e))},uuid(e){return this.check(ma(zs,e))},uuidv4(e){return this.check(ha(zs,e))},uuidv6(e){return this.check(ga(zs,e))},uuidv7(e){return this.check(_a(zs,e))},nanoid(e){return this.check(ba(Hs,e))},cuid(e){return this.check(xa(Us,e))},cuid2(e){return this.check(Sa(Ws,e))},ulid(e){return this.check(Ca(Gs,e))},base64(e){return this.check(Aa(Qs,e))},base64url(e){return this.check(ja($s,e))},xid(e){return this.check(wa(Ks,e))},ksuid(e){return this.check(Ta(qs,e))},ipv4(e){return this.check(Ea(Js,e))},ipv6(e){return this.check(Da(Ys,e))},cidrv4(e){return this.check(Oa(Xs,e))},cidrv6(e){return this.check(ka(Zs,e))},e164(e){return this.check(Ma(ec,e))},datetime(e){return this.check(Pa(Ns,e))},date(e){return this.check(Fa(Ps,e))},time(e){return this.check(Ia(Fs,e))},duration(e){return this.check(La(Is,e))}});function F(e){return da(Ms,e)}var I=C(`ZodStringFormat`,(e,t)=>{O.init(e,t),js.init(e,t)}),Ns=C(`ZodISODateTime`,(e,t)=>{Ar.init(e,t),I.init(e,t)}),Ps=C(`ZodISODate`,(e,t)=>{jr.init(e,t),I.init(e,t)}),Fs=C(`ZodISOTime`,(e,t)=>{Mr.init(e,t),I.init(e,t)}),Is=C(`ZodISODuration`,(e,t)=>{Nr.init(e,t),I.init(e,t)}),Ls=C(`ZodEmail`,(e,t)=>{mr.init(e,t),I.init(e,t)}),Rs=C(`ZodGUID`,(e,t)=>{fr.init(e,t),I.init(e,t)}),zs=C(`ZodUUID`,(e,t)=>{pr.init(e,t),I.init(e,t)}),Bs=C(`ZodURL`,(e,t)=>{Sr.init(e,t),I.init(e,t)}),Vs=C(`ZodEmoji`,(e,t)=>{Cr.init(e,t),I.init(e,t)}),Hs=C(`ZodNanoID`,(e,t)=>{wr.init(e,t),I.init(e,t)}),Us=C(`ZodCUID`,(e,t)=>{Tr.init(e,t),I.init(e,t)}),Ws=C(`ZodCUID2`,(e,t)=>{Er.init(e,t),I.init(e,t)}),Gs=C(`ZodULID`,(e,t)=>{Dr.init(e,t),I.init(e,t)}),Ks=C(`ZodXID`,(e,t)=>{Or.init(e,t),I.init(e,t)}),qs=C(`ZodKSUID`,(e,t)=>{kr.init(e,t),I.init(e,t)}),Js=C(`ZodIPv4`,(e,t)=>{Pr.init(e,t),I.init(e,t)}),Ys=C(`ZodIPv6`,(e,t)=>{Lr.init(e,t),I.init(e,t)}),Xs=C(`ZodCIDRv4`,(e,t)=>{Rr.init(e,t),I.init(e,t)}),Zs=C(`ZodCIDRv6`,(e,t)=>{Br.init(e,t),I.init(e,t)}),Qs=C(`ZodBase64`,(e,t)=>{Ur.init(e,t),I.init(e,t)}),$s=C(`ZodBase64URL`,(e,t)=>{Kr.init(e,t),I.init(e,t)}),ec=C(`ZodE164`,(e,t)=>{qr.init(e,t),I.init(e,t)}),tc=C(`ZodJWT`,(e,t)=>{Yr.init(e,t),I.init(e,t)}),nc=C(`ZodNumber`,(e,t)=>{Xr.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ho(e,t,n,r),e.isFinite=!0},bt({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=M(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=M(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=M(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>M(e).format??null},{gt(e,t){return this.check(Ga(e,t))},gte(e,t){return this.check(Ka(e,t))},min(e,t){return this.check(Ka(e,t))},lt(e,t){return this.check(Ua(e,t))},lte(e,t){return this.check(Wa(e,t))},max(e,t){return this.check(Wa(e,t))},int(e){return this.check(ic(e))},safe(e){return this.check(ic(e))},positive(e){return this.check(Ga(0,e))},nonnegative(e){return this.check(Ka(0,e))},negative(e){return this.check(Ua(0,e))},nonpositive(e){return this.check(Wa(0,e))},multipleOf(e,t){return this.check(qa(e,t))},step(e,t){return this.check(qa(e,t))},finite(){return this}}));function L(e){return Ra(nc,e)}var rc=C(`ZodNumberFormat`,(e,t)=>{Zr.init(e,t),nc.init(e,t)});function ic(e){return za(rc,e)}var ac=C(`ZodBoolean`,(e,t)=>{Qr.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r)});function R(e){return Ba(ac,e)}var oc=C(`ZodUnknown`,(e,t)=>{$r.init(e,t),P.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function z(){return Va(oc)}var sc=C(`ZodNever`,(e,t)=>{ei.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r)});function cc(e){return Ha(sc,e)}var lc=C(`ZodArray`,(e,t)=>{As(),ii.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Ya(e,t))},nonempty(e){return this.check(Ya(1,e))},max(e,t){return this.check(Ja(e,t))},length(e,t){return this.check(Xa(e,t))},unwrap(){return this.element}});function B(e,t){return lo(lc,e,t)}var uc=C(`ZodObject`,(e,t)=>{As(),ui.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r),Et(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return W(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(_(this._zod.def,{catchall:e}))},passthrough(){return this.clone(_(this._zod.def,{catchall:z()}))},loose(){return this.clone(_(this._zod.def,{catchall:z()}))},strict(){return this.clone(_(this._zod.def,{catchall:cc()}))},strip(){return this.clone(_(this._zod.def,{catchall:void 0}))},extend(e){return tt(this,e)},safeExtend(e){return rt(this,e)},merge(e){return it(this,e)},pick(e){return Qe(this,e)},omit(e){return et(this,e)},partial(...e){return at(xc,this,e[0])},exactPartial(...e){return at(Cc,this,e[0],`exactPartial`)},required(...e){return ot(jc,this,e[0])}});function V(e,t){return new uc({type:`object`,shape:e??{},...y(t)})}var dc=C(`ZodUnion`,(e,t)=>{fi.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qo(e,t,n,r),e.options=t.options});function H(e,t){return new dc({type:`union`,options:e,...y(t)})}var fc=C(`ZodDiscriminatedUnion`,(e,t)=>{dc.init(e,t),mi.init(e,t)});function U(e,t,n){return new fc({type:`union`,options:t,discriminator:e,...y(n)})}var pc=C(`ZodIntersection`,(e,t)=>{hi.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r)});function mc(e,t){return new pc({type:`intersection`,left:e,right:t})}var hc=C(`ZodRecord`,(e,t)=>{As(),vi.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rs(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function gc(e,t,n){return!t||!t._zod?new hc({type:`record`,keyType:F(),valueType:e,...y(t)}):new hc({type:`record`,keyType:e,valueType:t,...y(n)})}var _c=C(`ZodEnum`,(e,t)=>{yi.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];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 _c({...t,checks:[],...y(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 _c({...t,checks:[],...y(r),entries:i})}});function W(e,t){return new _c({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...y(t)})}var vc=C(`ZodLiteral`,(e,t)=>{bi.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ko(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 G(e,t){return new vc({type:`literal`,values:Array.isArray(e)?e:[e],...y(t)})}var yc=C(`ZodTransform`,(e,t)=>{As(),xi.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Pt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(gt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(gt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function bc(e){return new yc({type:`transform`,transform:e})}var xc=C(`ZodOptional`,(e,t)=>{Ci.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sc(e){return new xc({type:`optional`,innerType:e})}var Cc=C(`ZodExactOptional`,(e,t)=>{wi.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wc(e){return new Cc({type:`optional`,innerType:e})}var Tc=C(`ZodNullable`,(e,t)=>{Ti.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>is(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ec(e){return new Tc({type:`nullable`,innerType:e})}var Dc=C(`ZodDefault`,(e,t)=>{Ei.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Oc(e,t){return new Dc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ge(t)}})}var kc=C(`ZodPrefault`,(e,t)=>{Oi.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ls(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ac(e,t){return new kc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ge(t)}})}var jc=C(`ZodNonOptional`,(e,t)=>{ki.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mc(e,t){return new jc({type:`nonoptional`,innerType:e,...y(t)})}var Nc=C(`ZodCatch`,(e,t)=>{Mi.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>us(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Pc(e,t){return new Nc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ot(t)})}var Fc=C(`ZodPipe`,(e,t)=>{Ni.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ds(e,t,n,r),e.in=t.in,e.out=t.out});function Ic(e,t){return new Fc({type:`pipe`,in:e,out:t})}var Lc=C(`ZodPreprocess`,(e,t)=>{Fc.init(e,t),Fi.init(e,t)}),Rc=C(`ZodReadonly`,(e,t)=>{Ii.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zc(e){return new Rc({type:`readonly`,innerType:e})}var Bc=C(`ZodLazy`,(e,t)=>{Ri.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Vc(e){return new Bc({type:`lazy`,getter:e})}var Hc=C(`ZodCustom`,(e,t)=>{zi.init(e,t),P.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qo(e,t,n,r)});function Uc(e,t={}){return uo(Hc,e,t)}function Wc(e,t){return fo(e,t)}function Gc(e,t){return new Lc({type:`pipe`,in:bc(e),out:t})}var Kc=V({code:W(`unauthorized.forbidden.not_found.invalid_request.conflict.already_answered.stale_control.host_unreachable.pi_incompatible.native_session_missing.invalid_transition.dependency_cycle.workspace_dirty.workspace_unmerged.workspace_active_sessions.branch_invalid.path_collision.not_a_git_repo.repo_mismatch.enrollment_expired.enrollment_used.device_revoked.unsupported_capability.too_large.ui_tree_too_large.timeout.rate_limited.internal`.split(`.`)),message:F(),details:z().optional()});V({error:Kc});var qc=W([`default`,`muted`,`success`,`warning`,`danger`]),Jc=V({field:F(),values:B(F())}),Yc=V({value:F(),label:F(),description:F().optional(),preview:F().optional()}),Xc=V({label:F(),placeholder:F().optional()}),Zc=U(`kind`,[V({kind:G(`select`),name:F(),label:F(),options:B(Yc),allowOther:Xc.optional(),showIf:Jc.optional()}),V({kind:G(`multiselect`),name:F(),label:F(),options:B(Yc),allowOther:Xc.optional(),min:L().int().min(0).optional(),max:L().int().min(1).optional(),showIf:Jc.optional()}),V({kind:G(`text`),name:F(),label:F(),placeholder:F().optional(),multiline:R().optional(),prefill:F().optional(),showIf:Jc.optional()})]),Qc=U(`kind`,[V({kind:G(`file`),path:F()}),V({kind:G(`session`),sessionId:F()}),V({kind:G(`task`),taskId:F()}),V({kind:G(`native_session`),hostId:F(),sessionFile:F()})]),$c=Vc(()=>U(`t`,[V({t:G(`text`),text:F(),tone:qc.optional()}),V({t:G(`markdown`),text:F()}),V({t:G(`code`),text:F(),lang:F().optional()}),V({t:G(`diff`),patch:F()}),V({t:G(`list`),items:B($c),ordered:R().optional()}),V({t:G(`table`),columns:B(F()),rows:B(B(F()))}),V({t:G(`section`),title:F().optional(),collapsible:R().optional(),children:B($c)}),V({t:G(`tabs`),tabs:B(V({id:F(),label:F(),children:B($c)}))}),V({t:G(`progress`),label:F(),value:L().min(0).max(1).optional(),status:W([`running`,`ok`,`error`]).optional()}),V({t:G(`ref`),ref:Qc,label:F()}),V({t:G(`form`),formId:F(),fields:B(Zc),submitLabel:F(),cancelLabel:F().optional()}),V({t:G(`confirm`),message:F(),confirmLabel:F(),cancelLabel:F(),destructive:R().optional()}),V({t:G(`actions`),actions:B(V({id:F(),label:F(),tone:W([`default`,`primary`,`danger`]).optional()}))})]));function el(e,t){if(!e.showIf)return!0;let n=t[e.showIf.field];return n===void 0?!1:typeof n==`string`?e.showIf.values.includes(n):Array.isArray(n)?n.some(t=>e.showIf.values.includes(t)):!1}var tl=H([F(),B(F()),V({other:F()})]),nl=U(`kind`,[V({kind:G(`form`),values:gc(F(),tl)}),V({kind:G(`confirm`),confirmed:R()}),V({kind:G(`action`),actionId:F()}),V({kind:G(`cancel`)})]),K=F(),q=F(),rl=W([`connected`,`reconnecting`,`unreachable`]),il=W([`automation`,`human`]),al=W([`darwin`,`linux`]),ol=W([`browser`,`pwa`,`terminal`,`cli`]),sl=W([`info`,`warning`,`error`]),cl=`.worktrees`,ll=V({prompt:R(),steer:R(),followUp:R(),abort:R(),resume:R(),rename:R(),importInactive:R(),extensionDialogs:R(),customUi:R(),widgetsText:R(),widgetsComponent:R(),tokenAccounting:R(),costAccounting:R()}),ul=ll.keyof().options,dl=ll.extend({terminal:R().optional(),sessionControls:R().optional(),treeNavigation:R().optional(),unsupported:B(V({capability:F(),reason:F()}))}),fl=V({state:W([`running`,`done`,`failed`]),startedAt:K,finishedAt:K.nullable(),repositories:L().int(),projectsCreated:L().int(),checkoutsAdded:L().int(),errors:B(F())}),pl=V({id:W([`five_hour`,`weekly`]),usedPct:L(),resetsAt:K.nullable()}),ml=V({provider:W([`anthropic`,`openai-codex`]),status:W([`available`,`expired`,`rejected`,`error`]),message:F().nullable(),windows:B(pl),fetchedAt:K}),hl=V({id:q,name:F(),platform:al,agentVersion:F(),piVersion:F().nullable(),piCompatible:R(),capabilities:dl.nullable(),connectivity:rl,lastSeenAt:K.nullable(),revokedAt:K.nullable(),createdAt:K,projectFolders:B(F()).optional(),projectScan:fl.nullable().optional(),usage:B(ml).optional()}),gl=F().min(1).refine(e=>!e.startsWith(`/`)&&!e.includes(`\\`),`must be a relative path`).refine(e=>!e.split(`/`).includes(`..`),`must stay inside the repository`).refine(e=>e.split(`/`).every(e=>e.length>0&&e!==`.`),`must be a plain relative path`),_l=V({id:q,name:F().min(1),repoIdentity:F(),defaultProfileId:q.nullable(),defaultHostId:q.nullable(),maxConcurrentRuns:L().int().min(1).max(32),automationEnabled:R(),setupCommand:F().nullable(),checks:B(F()),workspaceSharing:W([`single_writer`,`shared`]),worktreeDir:gl.default(cl),createdAt:K,updatedAt:K}),vl=V({id:q,projectId:q,hostId:q,path:F(),commonDir:F(),defaultBranch:F(),createdAt:K}),yl=V({dirty:R(),changedFiles:L().int(),ahead:L().int(),behind:L().int(),unmerged:R()}),bl=V({id:q,checkoutId:q,projectId:q,hostId:q,path:F(),branch:F().nullable(),baseBranch:F().nullable(),provenance:W([`managed`,`discovered`,`main`]),git:yl,setup:V({state:W([`none`,`running`,`succeeded`,`failed`]),log:F()}),archivedAt:K.nullable(),updatedAt:K}),xl=W([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`]),Sl=V({provider:F(),id:F(),name:F().nullable(),contextWindow:L().nullable(),reasoning:R(),scoped:R().optional(),thinkingLevels:B(xl),promptCache:V({short:L().optional(),long:L().optional()}).nullable().optional()}),Cl=V({name:F().min(1),description:F().nullable(),source:W([`extension`,`prompt`,`skill`]),argumentHint:F().nullable().optional()}),wl=V({tokens:L().nullable(),window:L(),percent:L().nullable()}),Tl=[`--mode`,`--fork`,`--no-session`,`-e`,`--extension`],El=F().refine(e=>e.startsWith(`--`)||!e.startsWith(`-`),`extra args must be long flags`).refine(e=>!Tl.includes(e.split(`=`)[0])&&!e.startsWith(`--session`),`this flag is managed by Switchyard`),Dl=V({id:q,name:F().min(1),provider:F().nullable(),model:F().nullable(),thinking:xl.nullable(),projectTrust:W([`ask`,`approve`,`ignore`]),extraArgs:B(El),resources:W([`all`,`vanilla`]).optional()}),Ol=V({id:F().min(1),kind:W([`herdr`,`tmux`]),name:F().min(1),machine:F().min(1),lastSeenAt:K}),kl=V({id:q,name:F().min(1).max(60),mode:W([`all`,`pinned`]),projectIds:B(F()).nullable(),hostIds:B(F()).nullable(),sessionIds:B(F()),clients:B(Ol),createdAt:K,updatedAt:K}),Al=W([`starting`,`idle`,`running`,`waiting_input`,`interrupted`,`failed`,`stopped`]),jl=V({sessionId:F(),sessionFile:F()}),Ml=V({tokens:L().nullable(),costUsd:L().nullable(),context:wl.nullable().optional()}),Nl=V({at:K,provider:F(),model:F(),cacheRead:L(),cacheWrite:L(),cacheWrite1h:L()}),Pl=V({id:q,title:F(),subtitle:F().nullable(),hostId:q,workspaceId:q.nullable(),projectId:q.nullable(),cwd:F(),nativeHandle:jl.nullable(),profileSnapshot:Dl,runtime:Al,runtimeDetail:F().nullable(),connectivity:rl,runId:q.nullable(),taskId:q.nullable(),provenance:W([`created`,`imported`,`subagent`]),readOnly:R(),lastActivityAt:K,archivedAt:K.nullable(),queue:V({steering:B(F()),followUp:B(F())}),stats:Ml.nullable(),model:Sl.nullable().optional(),thinking:xl.nullable().optional(),compacting:R().optional(),lastAssistantText:F().nullable(),createdAt:K,terminal:R().optional(),unreadSince:K.nullable().optional(),transcriptEpoch:L().int().min(0).optional(),promptCache:Nl.nullable().optional(),cacheAlert:V({ttlSec:L().int().min(60).max(86400).nullable(),warnedFor:K.nullable()}).nullable().optional()}),Fl=U(`enabled`,[V({enabled:G(!1)}),V({enabled:G(!0),objective:F().min(1),maxContinuations:L().int().min(1).max(50),maxElapsedMinutes:L().int().min(1).max(1440),maxTokens:L().int().positive().nullable(),maxCostUsd:L().positive().nullable()})]),Il=V({checks:B(F()).nullable(),requireHumanReview:R()}),Ll=U(`mode`,[V({mode:G(`new_worktree`),branch:F().nullable(),base:F().nullable()}),V({mode:G(`existing`),workspaceId:q})]),Rl=V({hostId:q.nullable(),profileId:q.nullable(),workspace:Ll,continuation:Fl,completion:Il}),zl=W([`backlog`,`ready`,`in_progress`,`review`,`done`,`canceled`]),Bl=H([G(0),G(1),G(2),G(3)]),Vl=[`Urgent`,`High`,`Normal`,`Low`],Hl=U(`kind`,[V({kind:G(`manual`)}),V({kind:G(`automation`),automationId:q,occurrenceId:q,routine:R()})]),Ul=V({id:q,projectId:q,title:F().min(1),objective:F(),acceptanceCriteria:B(F()),dependencies:B(q),priority:Bl,position:L(),state:zl,blocked:V({reason:F()}).nullable(),notBefore:K.nullable(),policy:Rl,origin:Hl,groupingKey:F().nullable(),currentRunId:q.nullable(),sessionId:q.nullable(),review:V({feedback:B(F()),changesRequested:R()}),hiddenFromBoard:R(),lastActivityAt:K,createdAt:K,updatedAt:K}),Wl=W([`queued`,`dispatching`,`uncertain`,`running`,`waiting_input`,`checking`,`succeeded`,`failed`,`interrupted`,`canceled`]),Gl=V({command:F(),exitCode:L().int().nullable(),outputTail:F()}),Kl=V({id:q,taskId:q,sessionId:q.nullable(),hostId:q.nullable(),dispatchKey:F(),attempt:L().int().min(1),state:Wl,controlMode:il,controlRevision:L().int().min(1),continuationsUsed:L().int().min(0),infraRetries:L().int().min(0),nextAttemptAt:K.nullable(),startedAt:K.nullable(),endedAt:K.nullable(),outcome:V({kind:W([`review`,`failed`,`blocked`,`no_change`,`canceled`]),summary:F()}).nullable(),limits:Fl,usage:V({tokens:L().nullable(),costUsd:L().nullable(),accounting:W([`available`,`unavailable`]),note:F().nullable()}),checks:B(Gl),createdAt:K,updatedAt:K}),ql=U(`kind`,[V({kind:G(`manual`)}),V({kind:G(`once`),at:K}),V({kind:G(`cron`),expr:F().min(1),timezone:F().min(1)}),V({kind:G(`webhook`)}),V({kind:G(`dependency`),taskId:q})]),Jl=V({title:F().min(1),objective:F(),acceptanceCriteria:B(F()),priority:Bl}),Yl=V({id:q,name:F().min(1),enabled:R(),projectId:q,trigger:ql,filters:B(V({path:F(),equals:F()})),template:Jl,hostId:q.nullable(),profileId:q.nullable(),mode:W([`fresh`,`continue`,`watch`]),groupingKey:F().nullable(),overlap:W([`skip`,`queue_one`,`append`]),missed:W([`skip`,`run_once`]),continuation:Fl,completion:Il,nextAt:K.nullable(),lastEvaluatedAt:K.nullable(),lastOutcome:F().nullable(),failureCount:L().int().min(0),webhookTokenSet:R(),createdAt:K,updatedAt:K}),Xl=W([`fired`,`skipped_overlap`,`skipped_missed`,`queued`,`appended`,`failed`,`filtered`]),Zl=V({id:q,automationId:q,key:F(),scheduledFor:K.nullable(),state:Xl,taskId:q.nullable(),reason:F().nullable(),outcome:F().nullable(),createdAt:K}),Ql=Gc(e=>e===`cancelled`?`canceled`:e,W([`pending`,`resolved`,`expired`,`canceled`,`unsupported`])),$l=V({id:q,sessionId:q,revision:L().int().min(1),source:U(`kind`,[V({kind:G(`extension_ui`),method:W([`select`,`confirm`,`input`,`editor`]),piRequestIds:B(F())}),V({kind:G(`unsupported_custom`),title:F().nullable()})]),adapterId:F().nullable(),title:F(),presentation:$c,state:Ql,resolution:V({by:F(),summary:F(),at:K}).nullable(),createdAt:K}),eu=W([`needs_input`,`failed`,`ready_for_review`,`unsupported_interaction`,`host_unreachable`,`cache_expiring`]),tu=V({id:q,sessionId:q.nullable(),taskId:q.nullable(),projectId:q.nullable(),reason:eu,severity:W([`info`,`warning`,`critical`]),summary:F(),interactionId:q.nullable(),deepLink:F(),acknowledgedAt:K.nullable(),resolvedAt:K.nullable(),createdAt:K}),nu=V({id:q,name:F(),kind:ol,createdAt:K,lastSeenAt:K.nullable(),revokedAt:K.nullable(),push:V({subscribed:R(),permission:W([`granted`,`denied`,`default`,`unknown`])}),preferredMobile:R(),enrolledVia:W([`enrollment`,`passkey`,`oidc`,`admin`,`approval`]).default(`enrollment`)}),ru=V({toolCallId:F(),name:F(),status:W([`running`,`ok`,`error`]),args:z(),summary:F(),output:F(),startedAt:K,durationMs:L().nullable(),card:$c.nullable(),adapterId:F().nullable()}),iu=U(`kind`,[V({id:q,sessionId:q,order:L().int(),at:K,kind:G(`user`),data:V({text:F(),images:L().int().optional(),entryId:F().optional()})}),V({id:q,sessionId:q,order:L().int(),at:K,kind:G(`assistant`),data:V({text:F(),streaming:R().optional()})}),V({id:q,sessionId:q,order:L().int(),at:K,kind:G(`thinking`),data:V({text:F()})}),V({id:q,sessionId:q,order:L().int(),at:K,kind:G(`tool`),data:ru}),V({id:q,sessionId:q,order:L().int(),at:K,kind:G(`notice`),data:V({level:sl,text:F()})}),V({id:q,sessionId:q,order:L().int(),at:K,kind:G(`interaction`),data:V({interactionId:q})}),V({id:q,sessionId:q,order:L().int(),at:K,kind:G(`subagent`),data:V({runId:F(),label:F(),status:F(),sessionFile:F().nullable(),linkedSessionId:q.nullable()})}),V({id:q,sessionId:q,order:L().int(),at:K,kind:G(`system`),data:V({text:F(),suggestion:R().optional()})})]),au=V({sessionId:q,adapterId:F(),slot:F(),title:F(),node:$c.nullable(),webRenderer:R(),mobileFallback:F().nullable(),updatedAt:K}),ou=V({sessionId:q.nullable(),adapterId:F().nullable(),level:sl,message:F(),at:K}),su=V({id:F(),version:F(),tier:W([`project`,`owner`,`plugin`,`bundled`]),target:V({extension:F(),versionRange:F(),testedVersions:B(F())}),capabilities:B(F()),webRenderer:R(),status:W([`active`,`disabled`,`error`]),detail:F().nullable()}),cu=V({id:F(),name:F(),createdAt:K,lastUsedAt:K.nullable(),transports:B(F())}),lu={"host.updated":hl,"project.updated":_l,"project.deleted":V({id:F()}),"checkout.updated":vl,"workspace.updated":bl,"workspace.deleted":V({id:F()}),"profile.updated":Dl,"profile.deleted":V({id:F()}),"view.updated":kl,"view.deleted":V({id:F()}),"session.updated":Pl,"transcript.item":iu,"transcript.reset":V({sessionId:F(),epoch:L().int()}),"interaction.updated":$l,"panel.updated":au,"adapters.updated":V({hostId:F(),adapters:B(su)}),diagnostic:ou,"task.updated":Ul,"task.deleted":V({id:F()}),"run.updated":Kl,"automation.updated":Yl,"automation.deleted":V({id:F()}),"occurrence.created":Zl,"occurrence.updated":Zl,"attention.updated":tu,"device.updated":nu,"settings.updated":V({dispatchPaused:R()})},uu=Object.keys(lu),du={"workspace.removed":`workspace.deleted`};function fu(e){return du[e]??e}var pu=e=>typeof e==`string`?fu(e):e,mu=Gc(pu,W(uu)),hu=V({hostId:F().optional(),sessionId:F().optional(),taskId:F().optional(),projectId:F().optional()}),gu=hu.extend({seq:L().int(),id:F(),type:mu,at:F(),data:z()}),_u=hu.extend({eventId:F(),type:Gc(pu,W([`session.updated`,`transcript.item`,`interaction.updated`,`panel.updated`,`adapters.updated`,`diagnostic`,`workspace.updated`,`workspace.deleted`])),at:F(),data:z()}),vu=V({sessionId:F(),itemId:F(),kind:W([`text`,`thinking`,`tool_args`,`tool_output`]),delta:F(),order:L().int().optional()}),yu=L().int().min(10).max(1e3),bu=L().int().min(5).max(500);U(`t`,[V({t:G(`in`),d:F()}),V({t:G(`resize`),cols:yu,rows:bu}),V({t:G(`claim`)})]);var xu=U(`t`,[V({t:G(`out`),d:F()}),V({t:G(`closed`),reason:F()}),V({t:G(`size`),cols:yu,rows:bu,owner:R()})]),Su=U(`t`,[V({t:G(`open`),sessionId:F(),cols:yu,rows:bu,passive:R().optional()}),V({t:G(`claim`)}),V({t:G(`in`),d:F()}),V({t:G(`resize`),cols:yu,rows:bu}),V({t:G(`close`)})]),Cu=W([`human`,`automation`]),wu=U(`type`,[V({type:G(`session.start`),sessionId:F(),title:F(),workspacePath:F(),projectId:F().nullable(),profile:Dl,nativeHandle:jl.nullable(),initialPrompt:F().nullable(),dispatchKey:F().nullable(),controlRevision:L().int(),controlMode:il,origin:Cu,readOnly:R().default(!1)}),V({type:G(`session.prompt`),sessionId:F(),text:F(),images:B(V({mimeType:F(),data:F()})).default([]),mode:W([`prompt`,`steer`,`followUp`]),origin:Cu,controlRevision:L().int()}),V({type:G(`session.abort`),sessionId:F(),clearQueue:R()}),V({type:G(`session.stop`),sessionId:F()}),V({type:G(`session.answer`),sessionId:F(),interactionId:F(),revision:L().int(),response:nl,deviceId:F()}),V({type:G(`session.adapterAction`),sessionId:F(),adapterId:F(),actionId:F(),payload:z()}),V({type:G(`session.setControl`),sessionId:F(),controlRevision:L().int(),mode:il}),V({type:G(`session.rename`),sessionId:F(),title:F()}),V({type:G(`session.importable`)}),V({type:G(`session.readNative`),sessionFile:F()}),V({type:G(`session.snapshot`),sessionId:F()}),V({type:G(`session.models`),sessionId:F()}),V({type:G(`session.commands`),sessionId:F()}),V({type:G(`session.complete`),sessionId:F(),text:F().max(500)}),V({type:G(`session.tree`),sessionId:F()}),V({type:G(`session.branch`),sessionId:F(),entryId:F().nullable(),fork:R()}),V({type:G(`session.navigate`),sessionId:F(),entryId:F(),summarize:R(),instructions:F().max(2e3).nullable()}),V({type:G(`session.reload`),sessionId:F()}),V({type:G(`session.export`),sessionId:F()}),V({type:G(`session.setModel`),sessionId:F(),provider:F().min(1),modelId:F().min(1)}),V({type:G(`session.setThinking`),sessionId:F(),level:xl}),V({type:G(`session.compact`),sessionId:F(),instructions:F().nullable()}),V({type:G(`checkout.inspect`),path:F()}),V({type:G(`projects.scan`),folder:F().min(1)}),V({type:G(`projects.suggest`),days:L().int().min(1).max(365).default(30)}),V({type:G(`workspace.discover`),checkoutPath:F(),worktreeDir:F().default(cl)}),V({type:G(`workspace.create`),checkoutPath:F(),branch:F(),base:F(),setupCommand:F().nullable(),worktreeDir:F().default(cl)}),V({type:G(`workspace.status`),path:F(),base:F().nullable()}),V({type:G(`workspace.remove`),path:F(),checkoutPath:F(),base:F().nullable(),force:V({dirty:R(),unmerged:R()})}),V({type:G(`workspace.diff`),path:F(),base:F().nullable(),file:F().nullable()}),V({type:G(`workspace.files`),path:F(),dir:F()}),V({type:G(`workspace.readFile`),path:F(),file:F()}),V({type:G(`dispatch.start`),dispatchKey:F(),runId:F(),taskId:F(),sessionId:F(),projectId:F(),title:F(),workspace:H([V({path:F()}),V({createFrom:V({checkoutPath:F(),branch:F(),base:F(),setupCommand:F().nullable(),worktreeDir:F().default(cl)})})]),nativeHandle:jl.nullable(),profile:Dl,prompt:F(),controlRevision:L().int(),controlMode:il.default(`automation`)}),V({type:G(`dispatch.reconcile`),dispatchKey:F()}),V({type:G(`checks.run`),sessionId:F(),path:F(),commands:B(F())})]);V({sessionFile:F(),sessionId:F(),cwd:F(),name:F().nullable(),mtime:F(),inactive:R()}),V({path:F(),head:F().nullable(),branch:F().nullable(),bare:R(),detached:R(),locked:R(),prunable:R(),provenance:W([`managed`,`discovered`,`main`]),git:yl.nullable()});var Tu=V({root:F(),commonDir:F(),repoIdentity:F(),defaultBranch:F()}).extend({name:F()});V({folder:F(),repositories:B(Tu)});var Eu=V({rootPath:F(),sessionCount:L().int(),lastActivityAt:F()});V({suggestions:B(Eu)});var Du=V({path:F(),oldPath:F().nullable(),added:L().int(),deleted:L().int(),status:W([`added`,`modified`,`deleted`,`renamed`,`untracked`,`binary`])});V({base:F(),files:B(Du),patch:F().nullable()}),V({name:F(),path:F(),kind:W([`file`,`dir`,`symlink`]),size:L().int().nullable()}),H([V({known:G(!1)}),V({known:G(!0),sessionId:F().nullable(),state:W([`accepted`,`workspace_ready`,`started`,`failed`]),runtime:Al.nullable(),workspacePath:F().nullable(),nativeHandle:jl.nullable(),error:F().nullable(),errorDetails:gc(F(),z()).nullable().default(null)})]),V({sessionId:F(),workspacePath:F(),nativeHandle:jl.nullable(),reused:R(),promptError:F().nullable().optional()}),V({status:W([`answered`,`already_answered`]),interaction:$l}),V({partial:B(iu),pendingInteractions:B($l)}),V({results:B(Gl)});var Ou=H([V({commandId:F(),ok:G(!0),result:z()}),V({commandId:F(),ok:G(!1),error:Kc})]);U(`type`,[V({type:G(`hello`),hostId:F(),credential:F(),name:F(),agentVersion:F(),piVersion:F().nullable(),piCompatible:R(),platform:al,capabilities:dl.nullable(),protocolVersion:L().int()}),V({type:G(`event`),hostSeq:L().int(),event:_u}),V({type:G(`stream`),delta:vu}),V({type:G(`receipt`),receipt:Ou}),V({type:G(`pong`)}),V({type:G(`usage`),usage:B(ml)}),V({type:G(`term`),streamId:F(),msg:xu})]),U(`type`,[V({type:G(`welcome`),coordinatorVersion:F(),ackedHostSeq:L().int()}),V({type:G(`ack`),hostSeq:L().int()}),V({type:G(`command`),commandId:F(),command:wu}),V({type:G(`ping`)}),V({type:G(`reject`),error:Kc}),V({type:G(`term`),streamId:F(),msg:Su})]),V({token:F().min(1),name:F().min(1).max(80),kind:ol}),V({deviceId:F(),credential:F()}),V({kind:W([`device`,`host`])}),V({token:F(),url:F(),expiresAt:F(),qrSvg:F(),command:F().nullable()}),H([V({token:F().min(1),name:F().min(1).max(80),platform:al}),V({secret:F().min(1),name:F().min(1).max(80),platform:al})]),V({hostId:F(),credential:F()}),V({name:F().min(1),hostId:F(),path:F().min(1),defaultProfileId:F().nullable().optional(),setupCommand:F().nullable().optional(),checks:B(F()).optional(),maxConcurrentRuns:L().int().min(1).max(32).optional(),worktreeDir:gl.optional()}),V({name:F().min(1).optional(),defaultProfileId:F().nullable().optional(),defaultHostId:F().nullable().optional(),maxConcurrentRuns:L().int().min(1).max(32).optional(),automationEnabled:R().optional(),setupCommand:F().nullable().optional(),checks:B(F()).optional(),workspaceSharing:W([`single_writer`,`shared`]).optional(),worktreeDir:gl.optional()}),V({hostId:F(),path:F().min(1)});function ku(e){return e.includes(`\0`)?!1:e===`~`||e.startsWith(`~/`)||e.startsWith(`/`)}V({projectFolders:B(F().trim().min(1).max(1024).refine(ku,`must be an absolute path or start with ~/`)).max(20).optional()}),fl.extend({added:B(V({projectId:F(),name:F(),path:F(),newProject:R()}))}),V({name:F().min(1),provider:F().nullable().default(null),model:F().nullable().default(null),thinking:xl.nullable().default(null),projectTrust:W([`ask`,`approve`,`ignore`]).default(`ask`),extraArgs:B(El).default([]),resources:W([`all`,`vanilla`]).default(`all`)}),V({checkoutId:F(),branch:F().min(1),base:F().nullable().optional()}),V({force:V({dirty:R(),unmerged:R()}).default({dirty:!1,unmerged:!1})}),V({projectId:F(),workspace:H([V({existingId:F()}),V({checkoutId:F(),newBranch:F().min(1),base:F().nullable().optional()})]),profileId:F().nullable().optional(),prompt:F().default(``),title:F().optional(),viewId:F().optional()}),V({text:F().min(1),mode:W([`prompt`,`steer`,`followUp`]).default(`prompt`),images:B(V({mimeType:F(),data:F()})).default([]),clientMessageId:F().optional()}),V({enabled:R(),ttlSec:L().int().min(60).max(86400).nullable().default(null)}),V({title:F().min(1).max(200)}),V({provider:F().min(1),modelId:F().min(1)}),V({level:xl}),V({instructions:F().max(4e3).optional()}),V({models:B(Sl)}),V({commands:B(Cl)}),V({text:F().min(1).max(500)}),V({items:B(V({value:F(),label:F(),description:F().nullable()})).max(50),prefix:F()}),V({rows:B(V({entryId:F(),parentId:F().nullable(),depth:L().int(),role:W([`user`,`assistant`]),text:F(),activeBranch:R(),leaf:R(),label:F().nullable(),at:F().nullable()}))}),V({entryId:F().nullable(),fork:R().default(!1)}),V({sessionFile:F().nullable(),prefill:F().nullable()}),V({items:B(iu),hasMore:R(),epoch:L().int().optional(),rev:L().int().optional(),delta:R().optional(),reset:R().optional()}),V({entryId:F().min(1),summarize:R().default(!1),instructions:F().max(2e3).nullable().default(null)}),V({items:B(iu),prefill:F().nullable()}),V({prefill:F().nullable(),epoch:L().int()}),V({session:Pl.nullable(),prefill:F().nullable()}),V({fileName:F(),content:F()});var Au=V({label:F().min(1).max(80),command:F().startsWith(`/`).max(500),tone:W([`default`,`primary`,`danger`]).optional()});V({title:F().min(1).max(200),body:$c,actions:B(Au).max(30).default([])}),V({model:Sl.nullable(),thinking:xl.nullable()}),V({hostId:F(),sessionFile:F(),projectId:F().nullable().optional()}),V({revision:L().int(),response:nl}),V({adapterId:F(),actionId:F(),payload:z().optional()});var ju=V({hostId:F().nullable().optional(),profileId:F().nullable().optional(),workspace:V({mode:W([`new_worktree`,`existing`]).optional(),branch:F().nullable().optional(),base:F().nullable().optional(),workspaceId:F().optional()}).optional(),continuation:V({enabled:R().optional(),objective:F().min(1).optional(),maxContinuations:L().int().min(1).max(50).optional(),maxElapsedMinutes:L().int().min(1).max(1440).optional(),maxTokens:L().int().positive().nullable().optional(),maxCostUsd:L().positive().nullable().optional()}).optional(),completion:Il.partial().optional()});V({projectId:F(),title:F().min(1).max(300),objective:F().default(``),acceptanceCriteria:B(F()).default([]),dependencies:B(F()).default([]),priority:Bl.default(2),state:W([`backlog`,`ready`]).default(`backlog`),notBefore:F().nullable().optional(),policy:ju.optional()}),V({title:F().min(1).max(300).optional(),objective:F().optional(),acceptanceCriteria:B(F()).optional(),dependencies:B(F()).optional(),priority:Bl.optional(),position:L().optional(),notBefore:F().nullable().optional(),policy:ju.optional()}),V({to:zl,confirm:R().optional(),onRunning:W([`pause`,`stop`]).optional(),position:L().optional()}),V({feedback:B(F().min(1)).min(1)});var Mu=H([V({eligible:G(!0),hostId:F(),hostName:F()}),V({eligible:G(!1),wait:W([`dependency`,`host_offline`,`project_limit`,`workspace_occupied`,`scheduled_time`,`invalid_configuration`,`dispatch_paused`,`project_automation_disabled`,`not_ready`,`already_dispatched`,`retry_backoff`]),message:F()})]);V({running:B(V({taskId:F(),runId:F(),sessionId:F().nullable()})),queued:B(V({taskId:F(),eligibility:Mu})),dispatchPaused:R()});var Nu=V({name:F().min(1),enabled:R().default(!0),projectId:F(),trigger:ql,filters:B(V({path:F(),equals:F()})).default([]),template:Jl,hostId:F().nullable().default(null),profileId:F().nullable().default(null),mode:W([`fresh`,`continue`,`watch`]).default(`fresh`),groupingKey:F().nullable().default(null),overlap:W([`skip`,`queue_one`,`append`]).default(`skip`),missed:W([`skip`,`run_once`]).default(`skip`),continuation:Fl.default({enabled:!1}),completion:Il.default({checks:null,requireHumanReview:!0})}),Pu=Yl.extend({summary:F()});V({summary:F(),task:Jl,next:B(F())});var Fu=V({token:F(),url:F()});V({endpoint:F().url(),keys:V({p256dh:F(),auth:F()}),permission:W([`granted`,`denied`,`default`,`unknown`]).default(`granted`)}),V({quietHours:V({start:F().regex(/^\d{2}:\d{2}$/),end:F().regex(/^\d{2}:\d{2}$/),timezone:F()}).nullable(),privatePreviews:R(),preferredDeviceId:F().nullable()}),H([V({type:G(`show`),title:F(),body:F(),tag:F(),url:F(),renotify:R()}),V({type:G(`clear`),tag:F()})]),V({passkey:V({available:R(),registered:R(),reason:F().nullable()}),oidc:V({label:F()}).nullable()}),V({challengeId:F(),options:z()}),V({challengeId:F(),name:F().min(1).max(80),response:z()}),V({challengeId:F(),options:z()}),V({challengeId:F(),response:z(),deviceName:F().min(1).max(80),kind:ol.extract([`browser`,`pwa`])}),V({deviceName:F().min(1).max(80),kind:ol.extract([`browser`,`pwa`]),next:F().default(`/`),handoff:R().default(!1)}),V({authorizeUrl:F(),flowId:F().nullable(),pollToken:F().nullable()}),V({flowId:F(),pollToken:F()}),H([V({status:G(`pending`)}),V({status:G(`done`),deviceId:F()})]),V({name:F().min(1).max(80)}),V({userCode:F(),pollToken:F(),verifyUrl:F(),expiresAt:F(),intervalMs:L().int()}),V({userCode:F().min(1),pollToken:F().min(1)}),H([V({status:G(`pending`)}),V({status:G(`denied`)}),V({status:G(`done`),deviceId:F(),credential:F()})]),V({userCode:F(),name:F(),requestedFrom:F(),createdAt:F(),expiresAt:F(),status:W([`pending`,`approved`,`denied`])}),V({passkeys:B(cu),passkeyAvailability:V({available:R(),reason:F().nullable()}),oidc:V({issuer:F(),label:F(),ownerMatch:F(),status:W([`ready`,`error`]),error:F().nullable()}).nullable()}),V({device:nu,admin:R(),publicUrl:F()}),kl.pick({name:!0,mode:!0,projectIds:!0,hostIds:!0}).partial({mode:!0,projectIds:!0,hostIds:!0}).partial(),Ol.omit({lastSeenAt:!0}),V({suggestions:B(Eu.extend({name:F(),preselected:R()}))});var Iu=V({hosts:B(hl),projects:B(_l),checkouts:B(vl),workspaces:B(bl),profiles:B(Dl),views:B(kl),sessions:B(Pl),tasks:B(Ul),runs:B(Kl),automations:B(Yl),attention:B(tu),interactions:B($l),panels:B(au),devices:B(nu),adapters:gc(F(),B(su)),dispatchPaused:R()}),Lu=V({foreground:R(),interactedAt:F().nullable(),viewing:V({sessionId:F()}).nullable()});U(`type`,[V({type:G(`hello`),cursor:L().int().nullable()}),V({type:G(`presence`),presence:Lu}),V({type:G(`ping`)})]),U(`type`,[V({type:G(`replay`),seq:L().int(),events:B(gu)}),V({type:G(`snapshot`),seq:L().int(),state:Iu}),V({type:G(`event`),event:gu}),V({type:G(`stream`),delta:vu}),V({type:G(`pong`)}),V({type:G(`force_logout`),reason:F()})]);var Ru=`0123456789ABCDEFGHJKMNPQRSTVWXYZ`,zu=32,Bu=16,Vu=0xffffffffffff,Hu;(function(e){e.Base32IncorrectEncoding=`B32_ENC_INVALID`,e.DecodeTimeInvalidCharacter=`DEC_TIME_CHAR`,e.DecodeTimeValueMalformed=`DEC_TIME_MALFORMED`,e.EncodeTimeNegative=`ENC_TIME_NEG`,e.EncodeTimeSizeExceeded=`ENC_TIME_SIZE_EXCEED`,e.EncodeTimeValueMalformed=`ENC_TIME_MALFORMED`,e.PRNGDetectFailure=`PRNG_DETECT`,e.ULIDInvalid=`ULID_INVALID`,e.Unexpected=`UNEXPECTED`,e.UUIDInvalid=`UUID_INVALID`})(Hu||={});var Uu=class extends Error{constructor(e,t){super(`${t} (${e})`),this.name=`ULIDError`,this.code=e}};function Wu(e){let t=Math.floor(e()*zu)%zu;return Ru.charAt(t)}function Gu(e,t,n){return t>e.length-1?e:e.substr(0,t)+n+e.substr(t+1)}function Ku(e){let t,n=e.length,r,i,a=e;for(;!t&&n-->=0;){if(r=a[n],i=Ru.indexOf(r),i===-1)throw new Uu(Hu.Base32IncorrectEncoding,`Incorrectly encoded string`);i===31?a=Gu(a,n,Ru[0]):t=Gu(a,n,Ru[i+1])}if(typeof t==`string`)return t;throw new Uu(Hu.Base32IncorrectEncoding,`Failed incrementing string`)}function qu(e){let t=Ju(),n=t&&(t.crypto||t.msCrypto)||null;if(typeof n?.getRandomValues==`function`)return()=>{let e=new Uint8Array(1);return n.getRandomValues(e),e[0]/256};if(typeof n?.randomBytes==`function`)return()=>n.randomBytes(1).readUInt8()/256;throw new Uu(Hu.PRNGDetectFailure,`Failed to find a reliable PRNG`)}function Ju(){return Zu()?self:typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:null}function Yu(e,t){let n=``;for(;e>0;e--)n=Wu(t)+n;return n}function Xu(e,t=10){if(isNaN(e))throw new Uu(Hu.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>0xffffffffffff)throw new Uu(Hu.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Vu}: ${e}`);if(e<0)throw new Uu(Hu.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Uu(Hu.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let n,r=``;for(let i=t;i>0;i--)n=e%zu,r=Ru.charAt(n)+r,e=(e-n)/zu;return r}function Zu(){return typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope}function Qu(e){let t=e||qu(),n=0,r;return function(e){let i=!e||isNaN(e)?Date.now():e;if(i<=n){let e=r=Ku(r);return Xu(n,10)+e}n=i;let a=r=Yu(Bu,t);return Xu(i,10)+a}}Qu();var $u=4e3,ed=U(`type`,[V({type:G(`action`),actionId:F().min(1).max(200),payload:z().optional()}),V({type:G(`resize`),height:L().finite().min(0).max($u)})]);function td(e){let t=ed.safeParse(e);return t.success?t.data:void 0}function nd(e,t){return{type:`render`,node:e,state:t}}var rd=`>=1.4.0 <1.6.0`,id=new Set([`starting`,`running`,`waiting_input`]),ad=new Set([`starting`,`idle`,`running`,`waiting_input`]),od=new Set([`running`,`waiting_input`]),sd=e=>id.has(e),cd=e=>ad.has(e),ld=e=>od.has(e),ud=e=>e.state===`pending`;function dd(e,t){return Object.values(e).filter(e=>e.sessionId===t&&ud(e)).sort((e,t)=>e.createdAt.localeCompare(t.createdAt))}function fd(e,t){return Object.values(e).filter(e=>ud(e)&&t.has(e.sessionId)).sort((e,t)=>e.createdAt.localeCompare(t.createdAt))}function pd(e,t){let n=0;for(let r of Object.values(e))r.sessionId===t&&ud(r)&&n++;return n}var md=e=>!e.resolvedAt,hd=e=>!e.resolvedAt&&!e.acknowledgedAt;function gd(e,t){let n=new Set;for(let t of Object.values(e))t.sessionId&&md(t)&&n.add(t.sessionId);for(let e of Object.values(t))ud(e)&&n.add(e.sessionId);return n}function _d(e,t,n){return`${e}:${t}:${n}`}function vd(e){return e.node!==null||e.webRenderer}function yd(){return{seq:null,hosts:{},projects:{},checkouts:{},workspaces:{},profiles:{},views:{},sessions:{},tasks:{},runs:{},automations:{},attention:{},interactions:{},panels:{},devices:{},adapters:{},occurrences:{},diagnostics:[],dispatchPaused:!1}}function bd(){return{...yd(),transcripts:{},streaming:{}}}function xd(){return{items:[],loaded:!1,loading:!1,hasMore:!1,stale:!1,error:null,epoch:null,rev:null,cachedAt:null}}function J(e){let t={};for(let n of e)t[n.id]=n;return t}function Y(e,t,n){return{...e,[t]:n}}function X(e,t){if(!(t in e))return e;let n={...e};return delete n[t],n}function Sd(e){let t=e;for(let[n,r]of Object.entries(e))r.error!==null&&(t===e&&(t={...e}),t[n]={...r,error:null});return t}function Cd(e,t,n){let r={};for(let e of n.panels)vd(e)&&(r[_d(e.sessionId,e.adapterId,e.slot)]=e);let i={};for(let[t,n]of Object.entries(e.transcripts))i[t]={...n,stale:!0,error:null};return{...e,seq:t,hosts:J(n.hosts),projects:J(n.projects),checkouts:J(n.checkouts),workspaces:J(n.workspaces),profiles:J(n.profiles),views:J(n.views),sessions:J(n.sessions),tasks:J(n.tasks),runs:J(n.runs),automations:J(n.automations),attention:J(n.attention.filter(md)),interactions:J(n.interactions),panels:r,devices:J(n.devices),adapters:{...n.adapters},dispatchPaused:n.dispatchPaused,transcripts:i,streaming:{}}}function wd(e){return{hosts:Object.values(e.hosts),projects:Object.values(e.projects),checkouts:Object.values(e.checkouts),workspaces:Object.values(e.workspaces),profiles:Object.values(e.profiles),views:Object.values(e.views),sessions:Object.values(e.sessions),tasks:Object.values(e.tasks),runs:Object.values(e.runs),automations:Object.values(e.automations),attention:Object.values(e.attention),interactions:Object.values(e.interactions),panels:Object.values(e.panels),devices:Object.values(e.devices),adapters:e.adapters,dispatchPaused:e.dispatchPaused}}function Td(e,t){if(t.length===0)return e;let n=new Map;for(let t of e)n.set(t.id,t);for(let e of t)n.set(e.id,e);return[...n.values()].sort((e,t)=>e.order-t.order||e.id.localeCompare(t.id))}function Ed(e,t,n,r){let i=e.transcripts[t]??xd(),a={epoch:r.epoch??i.epoch,rev:r.rev??i.rev},o;if(r.delta)o={...i,items:Td(i.items,n),loaded:!0,loading:!1,stale:!1,error:null,cachedAt:null,...a};else{let e=!r.older&&(i.stale||r.reset)?[]:i.items;o={...i,items:Td(e,n),loaded:!0,loading:!1,stale:r.older?i.stale:!1,error:null,hasMore:r.older||!i.loaded||i.stale||r.reset?r.hasMore:i.hasMore,cachedAt:r.older?i.cachedAt:null,...a}}return{...e,transcripts:{...e.transcripts,[t]:o}}}function Dd(e,t){let n=e.transcripts[t.sessionId];if(n?.loaded)return e;let r={...n??xd(),items:Td(t.items,n?.items??[]),loaded:!0,loading:!1,stale:!0,hasMore:t.hasMore,error:null,epoch:t.epoch,rev:t.rev,cachedAt:t.savedAt};return{...e,transcripts:{...e.transcripts,[t.sessionId]:r}}}function Od(e,t){let n=e.transcripts[t.sessionId]??xd(),r={...e.transcripts,[t.sessionId]:{...n,items:Td(n.items,[t])}},i=X(e.streaming,t.id);return{...e,transcripts:r,streaming:i}}function kd(e,t){return e.seq!==null&&t.seq<=e.seq?e:{...jd(e,fu(t.type),t.data),seq:t.seq}}function Ad(e,t){let n=e;for(let e of[...t].sort((e,t)=>e.seq-t.seq))n=kd(n,e);return n}function jd(e,t,n){switch(t){case`host.updated`:{let t=n;return{...e,hosts:Y(e.hosts,t.id,t)}}case`project.updated`:{let t=n;return{...e,projects:Y(e.projects,t.id,t)}}case`project.deleted`:{let t=n;return{...e,projects:X(e.projects,t.id)}}case`checkout.updated`:{let t=n;return{...e,checkouts:Y(e.checkouts,t.id,t)}}case`workspace.updated`:{let t=n;return{...e,workspaces:t.archivedAt?X(e.workspaces,t.id):Y(e.workspaces,t.id,t)}}case`workspace.deleted`:{let t=n;return{...e,workspaces:X(e.workspaces,t.id)}}case`view.updated`:{let t=n;return{...e,views:Y(e.views,t.id,t)}}case`view.deleted`:{let t=n;return{...e,views:X(e.views,t.id)}}case`profile.updated`:{let t=n;return{...e,profiles:Y(e.profiles,t.id,t)}}case`session.updated`:{let t=n,r={...e,sessions:Y(e.sessions,t.id,t)};return sd(t.runtime)?r:Nd(r,t.id)}case`transcript.item`:return Od(e,n);case`transcript.reset`:{let t=n,r=Nd(e,t.sessionId);return r.transcripts[t.sessionId]?{...r,transcripts:{...r.transcripts,[t.sessionId]:xd()}}:r}case`interaction.updated`:{let t=n,r=e.interactions[t.id];return r&&r.revision>t.revision?e:{...e,interactions:Y(e.interactions,t.id,t)}}case`panel.updated`:{let t=n,r=_d(t.sessionId,t.adapterId,t.slot);return{...e,panels:vd(t)?Y(e.panels,r,t):X(e.panels,r)}}case`adapters.updated`:{let t=n;return{...e,adapters:{...e.adapters,[t.hostId]:t.adapters}}}case`diagnostic`:{let t=n;return{...e,diagnostics:[...e.diagnostics,t].slice(-100)}}case`task.updated`:{let t=n;return{...e,tasks:Y(e.tasks,t.id,t)}}case`task.deleted`:{let t=n;return{...e,tasks:X(e.tasks,t.id)}}case`run.updated`:{let t=n;return{...e,runs:Y(e.runs,t.id,t)}}case`automation.updated`:{let t=n;return{...e,automations:Y(e.automations,t.id,t)}}case`automation.deleted`:{let t=n,r={...e.occurrences};return delete r[t.id],{...e,automations:X(e.automations,t.id),occurrences:r}}case`occurrence.created`:{let t=n,r=(e.occurrences[t.automationId]??[]).filter(e=>e.id!==t.id);return{...e,occurrences:{...e.occurrences,[t.automationId]:[t,...r].slice(0,50)}}}case`occurrence.updated`:{let t=n,r=e.occurrences[t.automationId]??[],i=r.some(e=>e.id===t.id)?r.map(e=>e.id===t.id?t:e):[t,...r].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)).slice(0,50);return{...e,occurrences:{...e.occurrences,[t.automationId]:i}}}case`attention.updated`:{let t=n;return{...e,attention:t.resolvedAt?X(e.attention,t.id):Y(e.attention,t.id,t)}}case`device.updated`:{let t=n;return{...e,devices:t.revokedAt?X(e.devices,t.id):Y(e.devices,t.id,t)}}case`settings.updated`:{let t=n;return{...e,dispatchPaused:t.dispatchPaused}}default:return e}}function Md(e,t){let n=e.streaming[t.itemId]??{sessionId:t.sessionId,itemId:t.itemId,order:t.order??null,text:``,thinking:``,toolArgs:``,toolOutput:``},r=t.kind===`text`?`text`:t.kind===`thinking`?`thinking`:t.kind===`tool_args`?`toolArgs`:`toolOutput`,i={...n,order:n.order??t.order??null,[r]:n[r]+t.delta};return{...e,streaming:{...e.streaming,[t.itemId]:i}}}function Nd(e,t){let n={},r=!1;for(let[i,a]of Object.entries(e.streaming))a.sessionId===t?r=!0:n[i]=a;return r?{...e,streaming:n}:e}function Pd(e,t){let n=Array.isArray(e)?e:e.items??[];return{items:n,hasMore:(Array.isArray(e)?void 0:e.hasMore)??n.length>=t,...Array.isArray(e)?{}:{epoch:e.epoch,rev:e.rev,delta:e.delta,reset:e.reset}}}var Fd=new Set,Id=new Map,Z=d()((e,t)=>({...bd(),hydrated:!1,synced:!1,connection:{state:`connecting`,attempts:0},lastSyncedAt:null,hydrateFromCache(n,r,i){t().synced||e(e=>({...Cd(e,n,r),hydrated:!0,lastSyncedAt:e.lastSyncedAt??i}))},applySnapshot(t,n){e(e=>({...Cd(e,t,n),hydrated:!0,synced:!0,lastSyncedAt:new Date().toISOString()}))},applyReplay(t,n){e(e=>{let r=Ad({...e,streaming:{}},n);return{...r,transcripts:Sd(r.transcripts),seq:Math.max(r.seq??0,t),hydrated:!0,synced:!0,lastSyncedAt:new Date().toISOString()}})},applyEvent(t){e(e=>({...kd(e,t),lastSyncedAt:new Date().toISOString()}))},applyStream(t){e(e=>Md(e,t))},setConnection(t){e(e=>({connection:{...e.connection,...t}}))},markSynced(){e({lastSyncedAt:new Date().toISOString()})},upsertInteraction(t){e(e=>{let n=e.interactions[t.id];return n&&n.revision>t.revision?{}:{interactions:{...e.interactions,[t.id]:t}}})},upsertSessionIfMissing(t){e(e=>e.sessions[t.id]?{}:{sessions:{...e.sessions,[t.id]:t}})},loadTranscript(n,r){let i=t().transcripts[n];if(i?.loaded&&!i.stale&&!r?.force)return Promise.resolve();let a=`${n}:newest`,o=Id.get(a);if(o)return o;Ld(e,n,{loading:!0,error:null});let s=(async()=>{if(!t().transcripts[n]?.loaded&&!Fd.has(n)){Fd.add(n);let t=await xe(n);t&&e(e=>Dd(e,t))}let r=t().transcripts[n],i=r?.loaded&&r.epoch!==null&&r.rev!==null?{afterRev:r.rev,epoch:r.epoch,limit:200}:{limit:200};return ae(`/api/sessions/${encodeURIComponent(n)}/transcript`,i)})().then(t=>{let r=Pd(t,200);e(e=>Ed(e,n,r.items,{hasMore:r.hasMore??!1,older:!1,epoch:r.epoch,rev:r.rev,delta:r.delta,reset:r.reset}))}).catch(t=>Ld(e,n,{loading:!1,error:m(t)})).finally(()=>Id.delete(a));return Id.set(a,s),s},loadOlderTranscript(n){let r=t().transcripts[n];if(!r?.loaded||!r.hasMore||r.items.length===0)return Promise.resolve();let i=r.items[0].order,a=`${n}:before:${i}`,o=Id.get(a);if(o)return o;Ld(e,n,{loading:!0,error:null});let s=ae(`/api/sessions/${encodeURIComponent(n)}/transcript`,{before:i,limit:200}).then(t=>{let r=Pd(t,200);e(e=>Ed(e,n,r.items,{hasMore:r.hasMore??!1,older:!0}))}).catch(t=>Ld(e,n,{loading:!1,error:m(t)})).finally(()=>Id.delete(a));return Id.set(a,s),s},reset(){Fd.clear(),e({...bd(),hydrated:!1,synced:!1,connection:{state:`connecting`,attempts:0},lastSyncedAt:null})}}));function Ld(e,t,n){e(e=>({transcripts:{...e.transcripts,[t]:{...e.transcripts[t]??xd(),...n}}}))}var Rd=Z;function zd(e){return Object.values(e).filter(md).sort((e,t)=>t.createdAt.localeCompare(e.createdAt))}function Bd(e){let t=0;for(let n of Object.values(e))hd(n)&&t++;return t}function Vd(e,t){return Object.values(e).filter(e=>e.taskId===t).sort((e,t)=>t.attempt-e.attempt||t.createdAt.localeCompare(e.createdAt))}function Hd(e,t){return Object.values(e).filter(e=>e.sessionId===t).sort((e,t)=>e.adapterId.localeCompare(t.adapterId)||e.slot.localeCompare(t.slot))}function Ud(e,t){return Object.values(e).filter(e=>e.sessionId===t)}var Wd=()=>Z(e=>e.connection.state),Gd=()=>Z(e=>e.connection.state===`live`?null:e.lastSyncedAt),Kd=e=>Z(t=>e?t.hosts[e]:void 0),qd=e=>Z(t=>e?t.sessions[e]:void 0),Jd=e=>Z(t=>e?t.tasks[e]:void 0);function Yd(){let e=Z(e=>e.projects);return(0,a.useMemo)(()=>Object.values(e).sort((e,t)=>e.name.localeCompare(t.name)),[e])}function Xd(){let e=Z(e=>e.hosts);return(0,a.useMemo)(()=>Object.values(e).filter(e=>e.revokedAt===null).sort((e,t)=>e.name.localeCompare(t.name)),[e])}function Zd(){let e=Z(e=>e.attention);return(0,a.useMemo)(()=>zd(e),[e])}function Qd(){return Z(e=>Bd(e.attention))}function $d(e){let t=Z(e=>e.interactions);return(0,a.useMemo)(()=>e?dd(t,e):[],[t,e])}function ef(e){let t=Z(e=>e.runs);return(0,a.useMemo)(()=>e?Vd(t,e):[],[t,e])}function tf(e){let t=Z(e=>e.panels);return(0,a.useMemo)(()=>e?Hd(t,e):[],[t,e])}function nf(e){let t=Z(e=>e.streaming);return(0,a.useMemo)(()=>e?Ud(t,e):[],[t,e])}var rf=xd();function af(e){let t=Z(t=>e?t.transcripts[e]:void 0),n=Z(e=>e.loadTranscript),r=!!e&&(!t||(!t.loaded||t.stale)&&!t.loading&&!t.error);return(0,a.useEffect)(()=>{r&&e&&n(e)},[r,e,n]),t??rf}var of={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};of.node;var sf=r(of),cf={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};cf.node;var lf=r(cf),uf={name:`message-circle-question-mark`,size:24,node:[[`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`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};uf.node;var df=r(uf),ff={name:`puzzle`,size:24,node:[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]};ff.node;var pf=r(ff),mf={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};mf.node;var hf=r(mf),gf={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};gf.node;var _f=r(gf),vf={name:`server-off`,size:24,node:[[`path`,{d:`M7 2h13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-5`,key:`bt2siv`}],[`path`,{d:`M10 10 2.5 2.5C2 2 2 2.5 2 5v3a2 2 0 0 0 2 2h6z`,key:`1hjrv1`}],[`path`,{d:`M22 17v-1a2 2 0 0 0-2-2h-1`,key:`1iynyr`}],[`path`,{d:`M4 14a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16.5l1-.5.5.5-8-8H4z`,key:`161ggg`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};vf.node;var yf=r(vf),bf={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};bf.node;var xf=r(bf);function Q(...e){return e.filter(Boolean).join(` `)}var Sf=typeof Intl<`u`&&`RelativeTimeFormat`in Intl?new Intl.RelativeTimeFormat(void 0,{numeric:`auto`}):null;function Cf(e,t=Date.now()){if(!e)return`never`;let n=Date.parse(e);if(Number.isNaN(n))return e;let r=Math.round((n-t)/1e3),i=Math.abs(r);return i<30?`just now`:Sf?i<3600?Sf.format(Math.round(r/60),`minute`):i<86400?Sf.format(Math.round(r/3600),`hour`):i<2592e3?Sf.format(Math.round(r/86400),`day`):new Date(n).toLocaleDateString():new Date(n).toLocaleString()}function wf(e){if(e==null)return`unknown`;let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toDateString()===new Date().toDateString()?t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`}):t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function Tf(e){if(e==null||Number.isNaN(e))return``;if(e<1e3)return`${Math.round(e)} ms`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${String(t%60).padStart(2,`0`)}s`:`${Math.floor(n/60)}h ${String(n%60).padStart(2,`0`)}m`}var $=i();function Ef({className:e,label:t}){return(0,$.jsxs)(`svg`,{className:Q(`size-4 shrink-0 animate-spin`,e),viewBox:`0 0 24 24`,fill:`none`,role:t?`img`:void 0,"aria-label":t,"aria-hidden":!t||void 0,children:[(0,$.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,stroke:`currentColor`,strokeOpacity:`0.25`,strokeWidth:`3`}),(0,$.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`})]})}var Df={primary:`bg-accent text-accent-fg border-accent hover:bg-accent-hover hover:border-accent-hover`,secondary:`bg-surface text-text border-border hover:bg-surface-2`,ghost:`bg-transparent text-text border-transparent hover:bg-surface-2`,danger:`bg-danger text-danger-fg border-danger hover:bg-danger-hover hover:border-danger-hover`},Of={sm:`h-8 px-2.5 text-sm gap-1.5`,md:`h-9 px-3.5 text-sm gap-2`};function kf(e=`secondary`,t=`md`,n){return Q(`tap inline-flex items-center justify-center rounded-md border font-medium whitespace-nowrap select-none`,`transition-colors disabled:opacity-55 disabled:pointer-events-none`,Df[e],Of[t],n)}var Af=(0,a.forwardRef)(function({variant:e=`secondary`,size:t=`md`,icon:n,busy:r,block:i,className:a,children:o,disabled:s,type:c,...l},u){return(0,$.jsxs)(`button`,{ref:u,type:c??`button`,disabled:s||r,"aria-busy":r||void 0,className:kf(e,t,Q(i&&`w-full`,a)),...l,children:[r?(0,$.jsx)(Ef,{}):n,o]})});function jf({action:e,primary:n=!0}){return`to`in e?(0,$.jsxs)(t,{to:e.to,className:kf(n?`primary`:`secondary`),children:[e.icon,e.label]}):(0,$.jsx)(Af,{variant:n?`primary`:`secondary`,icon:e.icon,onClick:e.onClick,children:e.label})}function Mf({icon:e,title:t,children:n,actions:r,className:i,role:a}){return(0,$.jsxs)(`div`,{role:a,className:Q(`mx-auto flex w-full max-w-md flex-col items-center gap-3 px-4 py-10 text-center`,i),children:[(0,$.jsx)(`div`,{className:`text-muted`,"aria-hidden":!0,children:e}),(0,$.jsx)(`h2`,{className:`text-base font-semibold`,children:t}),n&&(0,$.jsx)(`div`,{className:`text-sm text-muted`,children:n}),r&&(0,$.jsx)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:r})]})}function Nf({label:e=`Loading…`,className:t}){return(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:Q(`flex items-center justify-center gap-2 px-4 py-10 text-sm text-muted`,t),children:[(0,$.jsx)(Ef,{}),(0,$.jsx)(`span`,{children:e})]})}function Pf({title:e,description:t,action:n,secondaryAction:r,icon:i,className:a}){return(0,$.jsx)(Mf,{icon:i??(0,$.jsx)(lf,{className:`size-8`}),title:e,className:a,actions:(n||r)&&(0,$.jsxs)($.Fragment,{children:[n&&(0,$.jsx)(jf,{action:n}),r&&(0,$.jsx)(jf,{action:r,primary:!1})]}),children:t})}function Ff({state:e,lastSyncedAt:t,onRetry:n,className:r}){if(e===`live`||e===`connecting`&&!t)return null;let i=e===`offline`,a=t?wf(t):`an earlier session`;return(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:Q(`flex items-center gap-2 border-b border-border bg-warning-soft px-3 pb-1.5 safe-pt-1.5 text-sm text-text`,r),children:[i?(0,$.jsx)(yf,{"aria-hidden":!0,className:`size-4 shrink-0 text-warning`}):(0,$.jsx)(Ef,{className:`size-4 text-warning`}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[i?`Offline`:`Reconnecting…`,(0,$.jsx)(`span`,{"aria-hidden":!0,children:` · `}),(0,$.jsx)(`span`,{className:`sr-only`,children:`, `}),`showing last known data from `,(0,$.jsx)(`time`,{dateTime:t??void 0,children:a})]}),n&&(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`tap shrink-0 rounded px-2 py-0.5 font-medium text-accent hover:bg-surface-2`,children:`Retry now`})]})}function If(e,t){return`Showing last known ${e}${t?` from ${wf(t)}`:``}.`}function Lf({subject:e=`data`,consequence:t=`Changes made elsewhere appear after reconnecting.`,show:n=!0,className:r}){let i=Wd(),a=Gd();return!n||i===`live`||i===`connecting`&&!a?null:(0,$.jsxs)(`p`,{role:`status`,className:Q(`flex items-start gap-1.5 text-sm text-muted`,r),children:[(0,$.jsx)(_f,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),(0,$.jsxs)(`span`,{children:[If(e,a),` `,t]})]})}function Rf({hostName:e,connectivity:t=`unreachable`,lastSeenAt:n,detail:r,compact:i,className:a}){let o=t===`reconnecting`?`Host ${e} is reconnecting`:`Host ${e} is unreachable`,s=(0,$.jsxs)($.Fragment,{children:[n?`Last seen ${Cf(n)}. `:``,r??`Work on this host keeps its last known state; nothing is restarted elsewhere.`]});return i?(0,$.jsxs)(`div`,{role:`status`,className:Q(`flex items-start gap-2 rounded-md border border-border bg-danger-soft px-3 py-2 text-sm`,a),children:[(0,$.jsx)(yf,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-danger`}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`font-medium`,children:o}),(0,$.jsx)(`div`,{className:`text-muted`,children:s})]})]}):(0,$.jsx)(Mf,{role:`status`,icon:(0,$.jsx)(yf,{className:`size-8`}),title:o,className:a,children:s})}function zf({count:e,to:n,onOpen:r,label:i,className:a}){if(e<=0)return null;let o=i??(e===1?`Needs input`:`${e} questions need input`),s=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(df,{"aria-hidden":!0,className:`size-4 shrink-0 text-warning`}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:o}),(0,$.jsx)(`span`,{className:`shrink-0 text-accent`,children:`Answer`})]}),c=Q(`tap flex w-full items-center gap-2 border border-border bg-warning-soft px-3 py-2 text-left text-sm rounded-md`,a);return n?(0,$.jsx)(t,{to:n,className:c,role:`status`,children:s}):(0,$.jsx)(`button`,{type:`button`,onClick:r,className:c,children:s})}function Bf({capability:e,reason:t,fallback:n,className:r}){return(0,$.jsxs)(`div`,{role:`note`,className:Q(`flex items-start gap-2 rounded-md border border-border bg-surface-2 px-3 py-2 text-sm`,r),children:[(0,$.jsx)(pf,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-muted`}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsxs)(`div`,{className:`font-medium`,children:[e,` is not available here`]}),(0,$.jsx)(`div`,{className:`text-muted`,children:t}),n&&(0,$.jsx)(`div`,{className:`mt-1`,children:n})]})]})}function Vf({title:e=`Something went wrong`,error:t,onRetry:n,compact:r,className:i}){let a=t instanceof Error?t.message:String(t??``);return r?(0,$.jsxs)(`div`,{role:`alert`,className:Q(`flex items-start gap-2 rounded-md border border-border bg-danger-soft px-3 py-2 text-sm`,i),children:[(0,$.jsx)(xf,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-danger`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`font-medium`,children:e}),a&&(0,$.jsx)(`div`,{className:`break-words text-muted`,children:a})]}),n&&(0,$.jsx)(Af,{size:`sm`,onClick:n,icon:(0,$.jsx)(hf,{className:`size-3.5`}),children:`Retry`})]}):(0,$.jsx)(Mf,{role:`alert`,icon:(0,$.jsx)(xf,{className:`size-8 text-danger`}),title:e,className:i,actions:n&&(0,$.jsx)(Af,{variant:`primary`,onClick:n,icon:(0,$.jsx)(hf,{className:`size-4`}),children:`Retry`}),children:(0,$.jsx)(`span`,{className:`break-words`,children:a})})}function Hf({title:e=`Switchyard cannot show this view`,error:t,diagnosticsHref:n=`/settings/diagnostics`,className:r}){let i=t instanceof Error?t.message:String(t??``);return(0,$.jsx)(Mf,{role:`alert`,icon:(0,$.jsx)(sf,{className:`size-8 text-danger`}),title:e,className:r,actions:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`a`,{href:n,className:kf(`primary`),children:`Open diagnostics`}),(0,$.jsx)(Af,{onClick:()=>location.reload(),children:`Reload`})]}),children:(0,$.jsx)(`span`,{className:`break-words`,children:i})})}function Uf({error:e}){return e?(0,$.jsxs)(`p`,{role:`alert`,className:`flex items-start gap-2 rounded-md border border-border bg-danger-soft px-3 py-2 text-sm`,children:[(0,$.jsx)(xf,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0 text-danger`}),(0,$.jsx)(`span`,{className:`min-w-0 break-words`,children:m(e)})]}):null}export{td as $,Kd as A,Z as B,df as C,oe as Ct,Rd as D,d as Dt,Vd as E,te as Et,Yd as F,ld as G,af as H,ef as I,dd as J,cd as K,qd as L,Zd as M,tf as N,Qd as O,$d as P,$u as Q,Gd as R,pf as S,se as St,sf as T,p as Tt,wd as U,Jd as V,pd as W,gd as X,fd as Y,rd as Z,Q as _,Se as _t,Uf as a,Yl as at,_f as b,ce as bt,Nf as c,El as ct,Af as d,xl as dt,nd as et,kf as f,gl as ft,wf as g,ye as gt,Cf as h,ve as ht,Rf as i,ku as it,Xd as j,Wd as k,Ff as l,Ql as lt,Tf as m,Ce as mt,Vf as n,Pu as nt,zf as o,ul as ot,Ef as p,el as pt,md as q,Hf as r,Fu as rt,Lf as s,cl as st,Pf as t,Nu as tt,Bf as u,Vl as ut,xf as v,f as vt,lf as w,m as wt,hf as x,ae as xt,yf as y,re as yt,nf as z};
|
|
56
|
-
//# sourceMappingURL=states-BQxrRFdh.js.map
|