@wjarka/cezarion 0.18.0-dev.8063 → 0.18.0-dev.8071
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/package.json +2 -2
- package/web/dist/assets/{accounts-section-D3P_Z-Nu.js → accounts-section-BkKQ8sVH.js} +1 -1
- package/web/dist/assets/{activity-motion-BW-0k8s7.js → activity-motion-D80Uv4-Z.js} +1 -1
- package/web/dist/assets/{activity-route-Bpgblioe.js → activity-route-DVT8IWTR.js} +1 -1
- package/web/dist/assets/{agent-config-section-Cj3w7UIn.js → agent-config-section-BbwkJunW.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-BJ4poe9c.js → agent-defaults-section-BLNTIZT_.js} +1 -1
- package/web/dist/assets/{appearance-BUsUTPF0.js → appearance-B6YBsmTo.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-D_kgBFNv.js → archive-on-merge-field-Bx1bEmI8.js} +1 -1
- package/web/dist/assets/attention-otQlgfRj.js +1 -0
- package/web/dist/assets/{automation-format-1lHzRTbq.js → automation-format-BsnXeUET.js} +1 -1
- package/web/dist/assets/automations-route-BOcGwfd4.js +1 -0
- package/web/dist/assets/{cez-idle-BY3rjM_y.js → cez-idle-Crszm9Ts.js} +1 -1
- package/web/dist/assets/{commit-diff-panel-xwLW6Ydr.js → commit-diff-panel-DKUnniap.js} +1 -1
- package/web/dist/assets/{diff-BB8SoL-s.js → diff-DUbLBjbg.js} +2 -2
- package/web/dist/assets/{diff-view-O8lx1ztb.js → diff-view-D_bjQyDl.js} +1 -1
- package/web/dist/assets/{file-preview-BS6M2tBo.js → file-preview-glEH09z8.js} +1 -1
- package/web/dist/assets/{folder-browser-Dsqz0Z1z.js → folder-browser-G_9ZgDjg.js} +1 -1
- package/web/dist/assets/{git-toolbar-DoPFA36c.js → git-toolbar-CTsmGICA.js} +1 -1
- package/web/dist/assets/{github-Bjy3WBvf.js → github-BqW9PaQO.js} +1 -1
- package/web/dist/assets/{global-activity-route-BXBZKz_9.js → global-activity-route-BP_Z7HNc.js} +1 -1
- package/web/dist/assets/index-DXIRYobS.js +21 -0
- package/web/dist/assets/{label-CZp8t0zE.js → label-BWld23ke.js} +1 -1
- package/web/dist/assets/live-protocol-BXzu6cSE.js +64 -0
- package/web/dist/assets/{markdown-KHcncamw.js → markdown-CT65TA_B.js} +1 -1
- package/web/dist/assets/{notifications-section-DD21Sd79.js → notifications-section-DuSzYLwP.js} +1 -1
- package/web/dist/assets/{open-in-menu-DdKs6X5r.js → open-in-menu-D03osLGE.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-BvTZv2SQ.js → preview-pane-connected-DHmgDHId.js} +1 -1
- package/web/dist/assets/{project-location-B3LBvkz2.js → project-location-BM-6wMI3.js} +1 -1
- package/web/dist/assets/{project-router-CIKODSHW.js → project-router-DtTvMbeA.js} +1 -1
- package/web/dist/assets/project-scope-context-Dgq8_2JZ.js +4 -0
- package/web/dist/assets/{projects-section-C0k8kyb-.js → projects-section-Dr0xJWTm.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-DNkosCni.js → prompt-templates-section-COKMgKMw.js} +1 -1
- package/web/dist/assets/queries-yuG-mM6_.js +1 -0
- package/web/dist/assets/{reference-chip-BWViAFIN.js → reference-chip-DTKtEtWv.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-DPCENbhz.js → remote-settings-notice-BV_sPAXc.js} +1 -1
- package/web/dist/assets/{repo-git-jKOnO3ba.js → repo-git-BgXC4opq.js} +1 -1
- package/web/dist/assets/{report-reader-DXYiKNcg.js → report-reader-CtHvvSln.js} +1 -1
- package/web/dist/assets/{reports-DEE0bHNv.js → reports-CdbDUzkK.js} +1 -1
- package/web/dist/assets/{resources-section-lqXgYTrv.js → resources-section-C8KZ4hre.js} +1 -1
- package/web/dist/assets/{run-header-CXlUbvDO.js → run-header-RQYKdIMw.js} +1 -1
- package/web/dist/assets/runners-CDw7wLfd.js +1 -0
- package/web/dist/assets/{settings-agent-picker-BRvZn4kM.js → settings-agent-picker-3uuSf9LK.js} +1 -1
- package/web/dist/assets/{settings-shell-DTtd-vIa.js → settings-shell-DnYRfclU.js} +1 -1
- package/web/dist/assets/{sidebar-section-BFW4ZfBR.js → sidebar-section-CCg4QGtg.js} +1 -1
- package/web/dist/assets/{skills-AImMlT1T.js → skills-L01dfEnP.js} +1 -1
- package/web/dist/assets/{tab-link-CM6SDBtV.js → tab-link-Dl5Mmavw.js} +1 -1
- package/web/dist/assets/{task-changes-01Z_ppIw.js → task-changes-DWPWp6ZV.js} +1 -1
- package/web/dist/assets/{task-commits-DRNIum3J.js → task-commits-D576LERH.js} +1 -1
- package/web/dist/assets/{task-files-Crz7Fo3C.js → task-files-1EjplVVb.js} +1 -1
- package/web/dist/assets/{task-github-item-psG2V47c.js → task-github-item-BubKlTej.js} +1 -1
- package/web/dist/assets/task-groups-D4RYW5I_.js +1 -0
- package/web/dist/assets/task-thread-yWACZZAo.js +9 -0
- package/web/dist/assets/{tasks-table-DHTEGteC.js → tasks-table-DTNcYbbN.js} +1 -1
- package/web/dist/assets/{thread-state-BWJ2YyXo.js → thread-state-BiS8rKQ-.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-DNROQerR.js → use-hand-to-agent-state-BFx3SZia.js} +1 -1
- package/web/dist/assets/{useInfiniteQuery-qJeCNhM7.js → useInfiniteQuery-BnyaEFle.js} +1 -1
- package/web/dist/assets/useQuery-BUslvRIM.js +1 -0
- package/web/dist/assets/{workflows-Cx9lgrEo.js → workflows-DbuTPPz7.js} +1 -1
- package/web/dist/assets/{workspace-tools-CVitt3kE.js → workspace-tools-DPnEZoDL.js} +1 -1
- package/web/dist/assets/{worktrees-section-DxUg4l9n.js → worktrees-section-Vr8s9cio.js} +1 -1
- package/web/dist/assets/{ws-BisMp6U5.js → ws-Bal5BUy2.js} +1 -1
- package/web/dist/index.html +17 -17
- package/web/dist/live-worker.js +1 -1
- package/web/dist/assets/attention-lvUYNNvV.js +0 -1
- package/web/dist/assets/automations-route-CZaUrmDs.js +0 -1
- package/web/dist/assets/index-CmadQXcg.js +0 -21
- package/web/dist/assets/live-protocol-D9ji1YCl.js +0 -64
- package/web/dist/assets/project-scope-context-D1bpJixc.js +0 -4
- package/web/dist/assets/queries-dHXhD3Hc.js +0 -1
- package/web/dist/assets/runners-CGQjSsir.js +0 -1
- package/web/dist/assets/task-groups-DF0XoB6U.js +0 -1
- package/web/dist/assets/task-thread-Bqg91ZVZ.js +0 -9
- package/web/dist/assets/useQuery-C3CQhXsT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,s as i,t as a}from"./utils-DSMR_WLb.js";import{Bn as o,Br as s,Hr as c,Rn as l,Rr as u,Ur as d,Vn as f,ci as p,gr as ee,qr as te,vr as ne,zn as m}from"./project-scope-context-D1bpJixc.js";import{B as h,H as g,L as _,P as v,R as y,j as b}from"./live-protocol-D9ji1YCl.js";import{N as x,Nt as S,Vt as C,qt as w,t as T}from"./queries-dHXhD3Hc.js";import{i as E,r as D}from"./cez-idle-BY3rjM_y.js";import{a as O}from"./dist-C5mlVBmd.js";var re=class extends EventTarget{readyState=0;release;constructor(e,t){super(),this.release=this.subscribe()}subscribe(){let e=()=>queueMicrotask(()=>{this.readyState===0&&(this.readyState=1,this.dispatchEvent(new Event(`open`)))});return c({kind:`workspace`},{ready:e,reset:()=>{this.readyState!==2&&(this.readyState=0,e())},frame:t=>{if(`data`in t&&t.event===`reconnect`){this.readyState=0,e();return}if(`data`in t&&t.event===`disconnect`){this.readyState===1&&(this.readyState=0,this.dispatchEvent(new Event(`error`)));return}`data`in t&&t.event===`ready`&&d(),`data`in t&&this.dispatchEvent(new MessageEvent(t.event,{data:t.data}))}})}requestReady(){return this.readyState!==2&&s()}close(){this.readyState=2,this.release()}},k=e(t(),1);y({runs:v(`summary`).optional()});var A=g().min(1),j=_().int().positive(),ie=y({project:A,seq:j,run:f,relationships:g().min(1)}),ae=y({project:A,seq:j,id:g().min(1)}),M=y({generation:g().min(1),seq:_().int().nonnegative()}),oe=y({project:A,usage:h(g(),l)});y({runs:b(o),referenceStatuses:m,perProjectLimit:_(),truncated:b(g()),generation:g().min(1),eventSeq:_().int().nonnegative()});function se(e,t){if(e===`ping`)return{project:null,event:{type:`ping`}};let n;try{n=JSON.parse(t)}catch{return null}switch(e){case`run-summary`:{let e=ie.safeParse(n);return e.success?{project:e.data.project,event:{type:`run-summary`,summary:e.data.run,seq:e.data.seq,relationships:e.data.relationships}}:null}case`run-deleted`:{let e=ae.safeParse(n);return e.success?{project:e.data.project,event:{type:`run-deleted`,id:e.data.id,seq:e.data.seq}}:null}case`usage`:{let e=oe.safeParse(n);return e.success?{project:e.data.project,event:{type:`usage`,usage:e.data.usage}}:null}case`ready`:{let e=M.safeParse(n);return e.success?{project:null,event:{type:`ready`,generation:e.data.generation,seq:e.data.seq}}:null}default:return null}}function N(){let e;return{ready(t){let n=e!==void 0&&t>e;return e=t,n},frame(t){let n=e!==void 0&&t!==e+1;return e=t,n},reset(){e=void 0}}}function P(e,t){if(!e)return;let n=e.findIndex(e=>e.id===t.id);if(n>=0){let r=[...e];return r[n]=t,r}let r=e.findIndex(e=>(e.createdAt??``).localeCompare(t.createdAt)<0),i=[...e];return i.splice(r<0?e.length:r,0,t),i}function ce(e,t){if(!e)return;let n=e.filter(e=>e.id!==t);return n.length===e.length?e:n}var F=Object.freeze({});function le(){let e=F,t=new Set;return{subscribe(e){return t.add(e),()=>t.delete(e)},get:()=>e,set(n){e=n;for(let e of t)e()}}}function I(e,t){let n=e.getQueryData(t);if(n?.finishBlocked===void 0)return;let{finishBlocked:r,...i}=n;e.setQueryData(t,i)}function ue(e){let t=new Map,n=t=>e.getQueryCache().find({queryKey:t,exact:!0}),r=t=>{if(!t.owed||t.timer!==void 0)return;let i=n(t.key);if(!i){t.owed=!1;return}if(!i.isActive()){t.owed=!1,e.invalidateQueries({queryKey:t.key,exact:!0,refetchType:`none`});return}if(i.state.fetchStatus!==`idle`)return;let a=t.lastStart+400-Date.now();if(a>0){t.timer=setTimeout(()=>{t.timer=void 0,r(t)},a);return}t.owed=!1,t.lastStart=Date.now(),e.refetchQueries({queryKey:t.key,exact:!0,type:`active`},{cancelRefetch:!1})},i=e.getQueryCache().subscribe(n=>{if(n.type!==`updated`||t.size===0)return;let i=t.get(JSON.stringify(n.query.queryKey));if(i){if(n.action.type===`success`&&!n.action.manual){let t=n.query.promise;t&&i.preEvent.has(t)&&(i.preEvent.delete(t),I(e,i.key),i.owed=!0)}n.query.state.fetchStatus===`idle`&&r(i)}});return{onEvent(i){let a=T.runs.detail(i),o=n(a);if(!o)return;let s=JSON.stringify(a),c=t.get(s);c||(c={key:a,owed:!1,lastStart:0,preEvent:new WeakSet},t.set(s,c)),o.state.fetchStatus!==`idle`&&o.promise&&c.preEvent.add(o.promise),I(e,a),c.owed=!0,r(c)},forget(e){let n=JSON.stringify(T.runs.detail(e));clearTimeout(t.get(n)?.timer),t.delete(n)},cancel(){i();for(let e of t.values())clearTimeout(e.timer);t.clear()}}}function de(e){let t=new Map;return{refresh(n){let r=T.runs.detail(n);if(!e.getQueryState(r))return;let i=JSON.stringify(r);clearTimeout(t.get(i)),e.cancelQueries({queryKey:r}),t.set(i,setTimeout(()=>{t.delete(i),e.invalidateQueries({queryKey:r})},400))},cancel(){for(let e of t.values())clearTimeout(e);t.clear()}}}var L=n(),fe=r(`/workspace/events?runs=summary`),R=2,z=3e3,B=[`run-summary`,`run-deleted`,`usage`,`ping`,`ready`],V=[`project-added`,`project-removed`,`checkout-progress`,`automation-change`,`project-ready`],H=new Set;function pe(e){return H.add(e),()=>{H.delete(e)}}function U(e){return e[1]===`runs`&&e[2]===`list`}function W(e,t){return e.cancelQueries({queryKey:t}).then(()=>e.invalidateQueries({queryKey:t}))}function G(e){return e.invalidateQueries({predicate:e=>U(e.queryKey),refetchType:`none`}),e.getQueryCache().findAll({predicate:e=>U(e.queryKey)&&(e.state.data!==void 0||e.state.fetchStatus!==`idle`)}).map(t=>W(e,t.queryKey))}var me=1e3,K=new WeakMap;function q(e){let t=T.repoBranches,n=K.get(e);if(n){n.set(JSON.stringify(t),t);return}K.set(e,new Map([[JSON.stringify(t),t]])),setTimeout(()=>{let t=K.get(e);K.delete(e);for(let n of t?.values()??[])e.invalidateQueries({queryKey:n})},me)}function J(e,t,n=!1){if(t?.aborted)return Promise.resolve();let r=[T.runs.all,S.runsIndex,S.projects,T.health,T.worktrees,T.repoBranches,S.providerStatus],i=()=>{for(let t of r)e.cancelQueries({queryKey:t})};return t?.addEventListener(`abort`,i,{once:!0}),E(()=>{for(let t of e.getQueryCache().findAll({predicate:e=>U(e.queryKey)}))t.state.data===void 0&&t.state.fetchStatus!==`idle`&&e.cancelQueries({queryKey:t.queryKey,exact:!0});return[e.invalidateQueries({queryKey:T.runs.all,...n?{predicate:e=>[`list`,`detail`,`relationships`,`archived`].includes(String(e.queryKey[2]))}:{}}),e.invalidateQueries({predicate:e=>U(e.queryKey)}),C(e).reconcile(),e.invalidateQueries({queryKey:S.projects}),W(e,T.health),e.invalidateQueries({queryKey:T.worktrees}),e.invalidateQueries({queryKey:T.repoBranches}),e.invalidateQueries({queryKey:S.providerStatus}),n?void 0:e.invalidateQueries({predicate:({queryKey:e})=>e.length===3&&e[1]===`github`&&(e[2]===null||typeof e[2]==`number`)})]}).finally(()=>t?.removeEventListener(`abort`,i))}function Y(e){return i()??X(e)}function X(e){let t=e.getQueryData(S.projects)?.bootProject;return typeof t==`string`&&t!==``?t:e.getQueryData(T.health)?.bootProject??e.getQueryData([`default`,`health`])?.bootProject}function he(e,t){return[w({projectId:e,boot:e===t}).cacheScope,`runs`,`list`]}function ge(e){let t=new Map,n=new Map,r=t=>{let r=n.get(JSON.stringify(t));if(!r)return;let i=e.getQueryCache().find({queryKey:t,exact:!0}),a=i?.promise;r.phase=`awaiting-fetch`,r.dirty=!1,e.invalidateQueries({queryKey:t,exact:!0}),i?.promise&&i.promise!==a&&(r.phase=`fetching`)},i=e.getQueryCache().subscribe(t=>{if(!n.size||t.type!==`updated`)return;let i=JSON.stringify(t.query.queryKey),a=n.get(i);if(a){if(t.action.type===`setState`){t.query.state.isInvalidated||e.invalidateQueries({queryKey:a.key,exact:!0,refetchType:`none`});return}if(t.action.type===`fetch`){a.phase===`awaiting-fetch`&&(a.phase=`fetching`),a.dirty=!1;return}if(t.action.type===`success`){if(!t.action.manual){a.phase===`fetching`&&!a.dirty?n.delete(i):r(a.key);return}a.phase!==`needs-start`&&(a.phase===`fetching`&&(a.dirty=!0),e.invalidateQueries({queryKey:a.key,exact:!0},{cancelRefetch:!1}))}}}),a=(t,r)=>{let i=JSON.stringify(t),a=e.getQueryCache().find({queryKey:t,exact:!0});if(!a)return;let o=n.get(i);!o&&(a.state.fetchStatus!==`idle`||a.state.isInvalidated)||o&&a.state.fetchStatus===`idle`?(n.set(i,{key:t,phase:`needs-start`,dirty:!1}),a.state.fetchStatus!==`idle`&&e.cancelQueries({queryKey:t,exact:!0}),r.some(e=>JSON.stringify(e)===i)||r.push(t)):o?.phase===`fetching`&&(o.dirty=!0)},o,s,c=(i=!1)=>{s!==void 0&&clearTimeout(s),s=void 0,o!==void 0&&cancelAnimationFrame(o),o=void 0;let c=[];for(let{key:r,baseList:i,baseQuery:o,baseUpdateCount:s,runs:l}of t.values()){let t=e.getQueryCache().find({queryKey:r,exact:!0});if(t!==o||t?.state.dataUpdateCount!==s||t?.state.data!==i){c.push(r),n.set(JSON.stringify(r),{key:r,phase:`needs-start`,dirty:!1}),e.cancelQueries({queryKey:r,exact:!0});continue}a(r,c),e.setQueryData(r,e=>{let t=e;for(let e of l.values())t=P(t,e);return t})}if(t.clear(),!i)for(let e of c)r(e);return c},l=t=>{let n=[he(t,X(e))],r=[t,`runs`,`list`];return(t===Y(e)||e.getQueryState(r))&&n.push(r),t===Y(e)&&n.push(T.runs.list()),[...new Map(n.map(e=>[JSON.stringify(e),e])).values()]};return{onEvent(i,u){let d=l(i);if(u.type===`run-summary`&&u.summary.archived&&d.every(t=>!e.getQueryData(t)?.find(e=>e.id===u.summary.id)?.archived)&&u.type===`run-summary`){for(let r of d){let i=JSON.stringify(r),a=n.get(i);a?.phase===`fetching`&&(a.dirty=!0);let o=t.get(i);if(!o){let n=e.getQueryCache().find({queryKey:r,exact:!0});o={key:r,baseList:n?.state.data,baseQuery:n,baseUpdateCount:n?.state.dataUpdateCount,runs:new Map},t.set(i,o)}o.runs.set(u.summary.id,u.summary)}s===void 0&&(s=setTimeout(()=>{c()},50),typeof requestAnimationFrame==`function`&&(o=requestAnimationFrame(()=>{c()})));return}let f=c(!0);for(let t of d)a(t,f),u.type===`run-summary`?e.setQueryData(t,e=>P(e,u.summary)):e.setQueryData(t,e=>ce(e,u.id));for(let e of f)r(e)},flush:c,cancel(){i(),n.clear()}}}var _e=400;function ve(e){let t=new Map,n=new Map,r=(t,r)=>{if(r&&!e.getQueryState(t))return;let i=JSON.stringify(t);n.has(i)||n.set(i,setTimeout(()=>{n.delete(i),e.invalidateQueries({queryKey:t})},_e))};return{onSummary(e,n){let i=e.delegation?.role===`worker`?e.delegation.parentRunId:void 0,a=e.delegation?.role===`worker`?e.delegation.supervisorRunId:void 0,o=t.get(e.id);if(t.set(e.id,{shape:n,...i===void 0?{}:{parentRunId:i},...a===void 0?{}:{supervisorRunId:a}}),o?.shape!==n){r(T.runs.relationships(e.id),!0);for(let e of[i,a])e!==void 0&&r(T.runs.relationships(e),!0)}},onDeleted(n){let i=t.get(n);t.delete(n),e.removeQueries({queryKey:T.runs.relationships(n)}),i?.supervisorRunId!==void 0&&r(T.runs.relationships(i.supervisorRunId),!0),i?.parentRunId===void 0?r([...T.runs.all,`relationships`],!1):r(T.runs.relationships(i.parentRunId),!0)},cancel(){for(let e of n.values())clearTimeout(e);n.clear(),t.clear()}}}var Z={predicate:e=>e.queryKey[1]===`runs`&&e.queryKey[2]===`archived`};function ye(e,t){if(t.delegation?.role===`worker`)return;let n=!1;for(let r of e.getQueryCache().findAll(Z)){let i=r.state.data;i&&(i.pages.some(e=>e.runs.some(e=>e.id===t.id))?(e.setQueryData(r.queryKey,{...i,pages:i.pages.map(e=>({...e,runs:e.runs.map(e=>e.id===t.id?t:e)}))}),(!t.archived||r.queryKey[3]!==``)&&(n=!0)):t.archived&&(n=!0))}n&&e.invalidateQueries(Z)}function be(e,t,n,r,i){switch(n.type){case`run-summary`:{let t=n.summary;if(ye(e,t),i.onSummary(t,n.relationships),r.fetcher.onEvent(t.id),t.delegation?.role===`worker`){let n=t.delegation.parentRunId;I(e,T.runs.detail(n)),r.refreshParent(n)}let a=T.runs.changes(t.id);e.getQueryData(a)!==void 0&&e.invalidateQueries({queryKey:a}),e.invalidateQueries({queryKey:T.worktrees}),q(e);return}case`run-deleted`:i.onDeleted(n.id),r.fetcher.forget(n.id),e.removeQueries({queryKey:T.runs.detail(n.id)}),e.removeQueries({queryKey:T.runs.diff(n.id)}),e.setQueriesData(Z,e=>e&&e.pages.some(e=>e.runs.some(e=>e.id===n.id))?{...e,pages:e.pages.map(e=>({...e,runs:e.runs.filter(e=>e.id!==n.id)}))}:e),e.invalidateQueries(Z),e.invalidateQueries({queryKey:T.worktrees}),q(e);return;case`usage`:t.set(n.usage);return;case`ping`:case`ready`:return}}function xe(e,t=fe){let n=p();(0,k.useEffect)(()=>{let r=re;if(typeof r!=`function`)return;let i=null,a=C(n);a.setUnknownGenerationHandler(()=>{let e=i?.requestReady;return typeof e==`function`&&e.call(i)});let o=de(n),s=ue(n),c={fetcher:s,refreshParent:o.refresh},l=N(),d=ge(n),f=ve(n),p=!1,m,h=!1,g=!1,_=!1,v=!1,y=()=>{_=!0,v=!1;let e=S.providerStatus;n.cancelQueries({queryKey:e,exact:!0}).then(()=>n.invalidateQueries({queryKey:e,exact:!0,refetchType:`active`})).finally(()=>{if(g||!v){_=!1;return}y()})},b=()=>{g||m!==void 0||(m=setTimeout(()=>{m=void 0,g||x()},z))},x=()=>{i?.close(),i=new r(t,{withCredentials:!0}),i.addEventListener(`open`,()=>{p=!0,l.reset(),a.detach(),D(!1),h&&(d.flush(),J(n)),h||(E(()=>G(n)),n.cancelQueries({queryKey:T.health}).then(()=>{g||n.invalidateQueries({queryKey:T.health})}),a.reconcile()),h=!0});for(let t of B)i.addEventListener(t,r=>{let i=se(t,r.data);if(!i)return;if(i.event.type===`ready`){let e=l.ready(i.event.seq);a.ready(i.event.generation,i.event.seq),e&&(d.flush(),J(n));return}let o=(i.event.type===`run-summary`||i.event.type===`run-deleted`)&&l.frame(i.event.seq);i.event.type===`ping`&&p&&(p=!1,E(()=>G(n)),D(!0)),i.project!==null&&(i.event.type===`run-summary`||i.event.type===`run-deleted`?a.run(i.project,i.event,o):i.event.type===`usage`&&a.usage(i.project,i.event.usage)),i.project!==null&&(i.event.type===`run-summary`||i.event.type===`run-deleted`)&&d.onEvent(i.project,i.event),(i.project===null||i.project===Y(n))&&be(n,e,i.event,c,f),o&&(d.flush(),J(n))});for(let e of V)i.addEventListener(e,t=>{let r;try{r=JSON.parse(t.data)}catch{return}if(e===`project-ready`?a.reconcile({hold:!0}):e!==`checkout-progress`&&e!==`automation-change`&&n.invalidateQueries({queryKey:S.projects}),e===`project-added`){let e=r?.project?.id;typeof e==`string`&&e!==``&&a.restoreProject(e),a.reconcile({hold:!0})}if(e===`project-removed`){let e=r?.id;typeof e==`string`&&e!==``&&a.dropProject(e)}for(let t of[...H])t(e,r)});i.addEventListener(`health`,e=>{let t;try{t=JSON.parse(e.data)}catch{return}let r=te.safeParse(t);r.success&&(n.cancelQueries({queryKey:T.health}),n.setQueryData(T.health,r.data))}),i.addEventListener(`provider-status`,e=>{let t;try{t=JSON.parse(e.data)}catch{return}let r=ne(t);if(!r)return;let i=S.providerStatus,a=ee(n.getQueryData(i),r);if(a!==void 0){n.setQueryData(i,a);return}if(_){v=!0;return}y()}),i.addEventListener(`error`,()=>{D(!1),a.detach(),i?.readyState===R&&b()})},w=()=>{document.visibilityState===`visible`&&(d.flush(),a.flush(),(!i||i.readyState===R)&&(clearTimeout(m),m=void 0,x()))},O=()=>{clearTimeout(m),m=void 0,d.flush()};document.addEventListener(`visibilitychange`,w),window.addEventListener(`pagehide`,O);let k=u((e,t)=>(d.flush(),J(n,e,t)));return x(),()=>{k(),g=!0,D(!1),clearTimeout(m),d.flush(),d.cancel(),a.stop(),o.cancel(),s.cancel(),a.setUnknownGenerationHandler(void 0),f.cancel(),document.removeEventListener(`visibilitychange`,w),window.removeEventListener(`pagehide`,O),i?.close(),i=null}},[n,e,t])}var Q=(0,k.createContext)(null);function Se({children:e}){let[t]=(0,k.useState)(le);return xe(t),x(),(0,L.jsx)(Q.Provider,{value:t,children:e})}function Ce(e){let t=(0,k.useContext)(Q),n=t?t.get:Te;return(0,k.useSyncExternalStore)(t?t.subscribe:we,()=>e?n()[e]:void 0,()=>void 0)}var we=()=>()=>void 0,Te=()=>F,Ee=`Label`,$=k.forwardRef((e,t)=>(0,L.jsx)(O.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));$.displayName=Ee;var De=$;function Oe({className:e,...t}){return(0,L.jsx)(De,{"data-slot":`label`,className:a(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}export{Ce as i,Se as n,pe as r,Oe as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,s as i,t as a}from"./utils-DSMR_WLb.js";import{Bn as o,Br as s,Hr as c,Rn as l,Rr as u,Ur as d,Vn as f,ci as p,gr as ee,qr as te,vr as ne,zn as m}from"./project-scope-context-Dgq8_2JZ.js";import{B as h,H as g,I as _,N as v,W as y,z as b}from"./live-protocol-BXzu6cSE.js";import{N as x,Nt as S,Vt as C,qt as w,t as T}from"./queries-yuG-mM6_.js";import{i as E,r as D}from"./cez-idle-Crszm9Ts.js";import{a as O}from"./dist-C5mlVBmd.js";var re=class extends EventTarget{readyState=0;release;constructor(e,t){super(),this.release=this.subscribe()}subscribe(){let e=()=>queueMicrotask(()=>{this.readyState===0&&(this.readyState=1,this.dispatchEvent(new Event(`open`)))});return c({kind:`workspace`},{ready:e,reset:()=>{this.readyState!==2&&(this.readyState=0,e())},frame:t=>{if(`data`in t&&t.event===`reconnect`){this.readyState=0,e();return}if(`data`in t&&t.event===`disconnect`){this.readyState===1&&(this.readyState=0,this.dispatchEvent(new Event(`error`)));return}`data`in t&&t.event===`ready`&&d(),`data`in t&&this.dispatchEvent(new MessageEvent(t.event,{data:t.data}))}})}requestReady(){return this.readyState!==2&&s()}close(){this.readyState=2,this.release()}},k=e(t(),1);h({runs:_(`summary`).optional()});var A=y().min(1),j=b().int().positive(),ie=h({project:A,seq:j,run:f,relationships:y().min(1)}),ae=h({project:A,seq:j,id:y().min(1)}),M=h({generation:y().min(1),seq:b().int().nonnegative()}),oe=h({project:A,usage:g(y(),l)});h({runs:v(o),referenceStatuses:m,perProjectLimit:b(),truncated:v(y()),generation:y().min(1),eventSeq:b().int().nonnegative()});function se(e,t){if(e===`ping`)return{project:null,event:{type:`ping`}};let n;try{n=JSON.parse(t)}catch{return null}switch(e){case`run-summary`:{let e=ie.safeParse(n);return e.success?{project:e.data.project,event:{type:`run-summary`,summary:e.data.run,seq:e.data.seq,relationships:e.data.relationships}}:null}case`run-deleted`:{let e=ae.safeParse(n);return e.success?{project:e.data.project,event:{type:`run-deleted`,id:e.data.id,seq:e.data.seq}}:null}case`usage`:{let e=oe.safeParse(n);return e.success?{project:e.data.project,event:{type:`usage`,usage:e.data.usage}}:null}case`ready`:{let e=M.safeParse(n);return e.success?{project:null,event:{type:`ready`,generation:e.data.generation,seq:e.data.seq}}:null}default:return null}}function N(){let e;return{ready(t){let n=e!==void 0&&t>e;return e=t,n},frame(t){let n=e!==void 0&&t!==e+1;return e=t,n},reset(){e=void 0}}}function P(e,t){if(!e)return;let n=e.findIndex(e=>e.id===t.id);if(n>=0){let r=[...e];return r[n]=t,r}let r=e.findIndex(e=>(e.createdAt??``).localeCompare(t.createdAt)<0),i=[...e];return i.splice(r<0?e.length:r,0,t),i}function ce(e,t){if(!e)return;let n=e.filter(e=>e.id!==t);return n.length===e.length?e:n}var F=Object.freeze({});function le(){let e=F,t=new Set;return{subscribe(e){return t.add(e),()=>t.delete(e)},get:()=>e,set(n){e=n;for(let e of t)e()}}}function I(e,t){let n=e.getQueryData(t);if(n?.finishBlocked===void 0)return;let{finishBlocked:r,...i}=n;e.setQueryData(t,i)}function ue(e){let t=new Map,n=t=>e.getQueryCache().find({queryKey:t,exact:!0}),r=t=>{if(!t.owed||t.timer!==void 0)return;let i=n(t.key);if(!i){t.owed=!1;return}if(!i.isActive()){t.owed=!1,e.invalidateQueries({queryKey:t.key,exact:!0,refetchType:`none`});return}if(i.state.fetchStatus!==`idle`)return;let a=t.lastStart+400-Date.now();if(a>0){t.timer=setTimeout(()=>{t.timer=void 0,r(t)},a);return}t.owed=!1,t.lastStart=Date.now(),e.refetchQueries({queryKey:t.key,exact:!0,type:`active`},{cancelRefetch:!1})},i=e.getQueryCache().subscribe(n=>{if(n.type!==`updated`||t.size===0)return;let i=t.get(JSON.stringify(n.query.queryKey));if(i){if(n.action.type===`success`&&!n.action.manual){let t=n.query.promise;t&&i.preEvent.has(t)&&(i.preEvent.delete(t),I(e,i.key),i.owed=!0)}n.query.state.fetchStatus===`idle`&&r(i)}});return{onEvent(i){let a=T.runs.detail(i),o=n(a);if(!o)return;let s=JSON.stringify(a),c=t.get(s);c||(c={key:a,owed:!1,lastStart:0,preEvent:new WeakSet},t.set(s,c)),o.state.fetchStatus!==`idle`&&o.promise&&c.preEvent.add(o.promise),I(e,a),c.owed=!0,r(c)},forget(e){let n=JSON.stringify(T.runs.detail(e));clearTimeout(t.get(n)?.timer),t.delete(n)},cancel(){i();for(let e of t.values())clearTimeout(e.timer);t.clear()}}}function de(e){let t=new Map;return{refresh(n){let r=T.runs.detail(n);if(!e.getQueryState(r))return;let i=JSON.stringify(r);clearTimeout(t.get(i)),e.cancelQueries({queryKey:r}),t.set(i,setTimeout(()=>{t.delete(i),e.invalidateQueries({queryKey:r})},400))},cancel(){for(let e of t.values())clearTimeout(e);t.clear()}}}var L=n(),fe=r(`/workspace/events?runs=summary`),R=2,z=3e3,B=[`run-summary`,`run-deleted`,`usage`,`ping`,`ready`],V=[`project-added`,`project-removed`,`checkout-progress`,`automation-change`,`project-ready`],H=new Set;function pe(e){return H.add(e),()=>{H.delete(e)}}function U(e){return e[1]===`runs`&&e[2]===`list`}function W(e,t){return e.cancelQueries({queryKey:t}).then(()=>e.invalidateQueries({queryKey:t}))}function G(e){return e.invalidateQueries({predicate:e=>U(e.queryKey),refetchType:`none`}),e.getQueryCache().findAll({predicate:e=>U(e.queryKey)&&(e.state.data!==void 0||e.state.fetchStatus!==`idle`)}).map(t=>W(e,t.queryKey))}var me=1e3,K=new WeakMap;function q(e){let t=T.repoBranches,n=K.get(e);if(n){n.set(JSON.stringify(t),t);return}K.set(e,new Map([[JSON.stringify(t),t]])),setTimeout(()=>{let t=K.get(e);K.delete(e);for(let n of t?.values()??[])e.invalidateQueries({queryKey:n})},me)}function J(e,t,n=!1){if(t?.aborted)return Promise.resolve();let r=[T.runs.all,S.runsIndex,S.projects,T.health,T.worktrees,T.repoBranches,S.providerStatus],i=()=>{for(let t of r)e.cancelQueries({queryKey:t})};return t?.addEventListener(`abort`,i,{once:!0}),E(()=>{for(let t of e.getQueryCache().findAll({predicate:e=>U(e.queryKey)}))t.state.data===void 0&&t.state.fetchStatus!==`idle`&&e.cancelQueries({queryKey:t.queryKey,exact:!0});return[e.invalidateQueries({queryKey:T.runs.all,...n?{predicate:e=>[`list`,`detail`,`relationships`,`archived`].includes(String(e.queryKey[2]))}:{}}),e.invalidateQueries({predicate:e=>U(e.queryKey)}),C(e).reconcile(),e.invalidateQueries({queryKey:S.projects}),W(e,T.health),e.invalidateQueries({queryKey:T.worktrees}),e.invalidateQueries({queryKey:T.repoBranches}),e.invalidateQueries({queryKey:S.providerStatus}),n?void 0:e.invalidateQueries({predicate:({queryKey:e})=>e.length===3&&e[1]===`github`&&(e[2]===null||typeof e[2]==`number`)})]}).finally(()=>t?.removeEventListener(`abort`,i))}function Y(e){return i()??X(e)}function X(e){let t=e.getQueryData(S.projects)?.bootProject;return typeof t==`string`&&t!==``?t:e.getQueryData(T.health)?.bootProject??e.getQueryData([`default`,`health`])?.bootProject}function he(e,t){return[w({projectId:e,boot:e===t}).cacheScope,`runs`,`list`]}function ge(e){let t=new Map,n=new Map,r=t=>{let r=n.get(JSON.stringify(t));if(!r)return;let i=e.getQueryCache().find({queryKey:t,exact:!0}),a=i?.promise;r.phase=`awaiting-fetch`,r.dirty=!1,e.invalidateQueries({queryKey:t,exact:!0}),i?.promise&&i.promise!==a&&(r.phase=`fetching`)},i=e.getQueryCache().subscribe(t=>{if(!n.size||t.type!==`updated`)return;let i=JSON.stringify(t.query.queryKey),a=n.get(i);if(a){if(t.action.type===`setState`){t.query.state.isInvalidated||e.invalidateQueries({queryKey:a.key,exact:!0,refetchType:`none`});return}if(t.action.type===`fetch`){a.phase===`awaiting-fetch`&&(a.phase=`fetching`),a.dirty=!1;return}if(t.action.type===`success`){if(!t.action.manual){a.phase===`fetching`&&!a.dirty?n.delete(i):r(a.key);return}a.phase!==`needs-start`&&(a.phase===`fetching`&&(a.dirty=!0),e.invalidateQueries({queryKey:a.key,exact:!0},{cancelRefetch:!1}))}}}),a=(t,r)=>{let i=JSON.stringify(t),a=e.getQueryCache().find({queryKey:t,exact:!0});if(!a)return;let o=n.get(i);!o&&(a.state.fetchStatus!==`idle`||a.state.isInvalidated)||o&&a.state.fetchStatus===`idle`?(n.set(i,{key:t,phase:`needs-start`,dirty:!1}),a.state.fetchStatus!==`idle`&&e.cancelQueries({queryKey:t,exact:!0}),r.some(e=>JSON.stringify(e)===i)||r.push(t)):o?.phase===`fetching`&&(o.dirty=!0)},o,s,c=(i=!1)=>{s!==void 0&&clearTimeout(s),s=void 0,o!==void 0&&cancelAnimationFrame(o),o=void 0;let c=[];for(let{key:r,baseList:i,baseQuery:o,baseUpdateCount:s,runs:l}of t.values()){let t=e.getQueryCache().find({queryKey:r,exact:!0});if(t!==o||t?.state.dataUpdateCount!==s||t?.state.data!==i){c.push(r),n.set(JSON.stringify(r),{key:r,phase:`needs-start`,dirty:!1}),e.cancelQueries({queryKey:r,exact:!0});continue}a(r,c),e.setQueryData(r,e=>{let t=e;for(let e of l.values())t=P(t,e);return t})}if(t.clear(),!i)for(let e of c)r(e);return c},l=t=>{let n=[he(t,X(e))],r=[t,`runs`,`list`];return(t===Y(e)||e.getQueryState(r))&&n.push(r),t===Y(e)&&n.push(T.runs.list()),[...new Map(n.map(e=>[JSON.stringify(e),e])).values()]};return{onEvent(i,u){let d=l(i);if(u.type===`run-summary`&&u.summary.archived&&d.every(t=>!e.getQueryData(t)?.find(e=>e.id===u.summary.id)?.archived)&&u.type===`run-summary`){for(let r of d){let i=JSON.stringify(r),a=n.get(i);a?.phase===`fetching`&&(a.dirty=!0);let o=t.get(i);if(!o){let n=e.getQueryCache().find({queryKey:r,exact:!0});o={key:r,baseList:n?.state.data,baseQuery:n,baseUpdateCount:n?.state.dataUpdateCount,runs:new Map},t.set(i,o)}o.runs.set(u.summary.id,u.summary)}s===void 0&&(s=setTimeout(()=>{c()},50),typeof requestAnimationFrame==`function`&&(o=requestAnimationFrame(()=>{c()})));return}let f=c(!0);for(let t of d)a(t,f),u.type===`run-summary`?e.setQueryData(t,e=>P(e,u.summary)):e.setQueryData(t,e=>ce(e,u.id));for(let e of f)r(e)},flush:c,cancel(){i(),n.clear()}}}var _e=400;function ve(e){let t=new Map,n=new Map,r=(t,r)=>{if(r&&!e.getQueryState(t))return;let i=JSON.stringify(t);n.has(i)||n.set(i,setTimeout(()=>{n.delete(i),e.invalidateQueries({queryKey:t})},_e))};return{onSummary(e,n){let i=e.delegation?.role===`worker`?e.delegation.parentRunId:void 0,a=e.delegation?.role===`worker`?e.delegation.supervisorRunId:void 0,o=t.get(e.id);if(t.set(e.id,{shape:n,...i===void 0?{}:{parentRunId:i},...a===void 0?{}:{supervisorRunId:a}}),o?.shape!==n){r(T.runs.relationships(e.id),!0);for(let e of[i,a])e!==void 0&&r(T.runs.relationships(e),!0)}},onDeleted(n){let i=t.get(n);t.delete(n),e.removeQueries({queryKey:T.runs.relationships(n)}),i?.supervisorRunId!==void 0&&r(T.runs.relationships(i.supervisorRunId),!0),i?.parentRunId===void 0?r([...T.runs.all,`relationships`],!1):r(T.runs.relationships(i.parentRunId),!0)},cancel(){for(let e of n.values())clearTimeout(e);n.clear(),t.clear()}}}var Z={predicate:e=>e.queryKey[1]===`runs`&&e.queryKey[2]===`archived`};function ye(e,t){if(t.delegation?.role===`worker`)return;let n=!1;for(let r of e.getQueryCache().findAll(Z)){let i=r.state.data;i&&(i.pages.some(e=>e.runs.some(e=>e.id===t.id))?(e.setQueryData(r.queryKey,{...i,pages:i.pages.map(e=>({...e,runs:e.runs.map(e=>e.id===t.id?t:e)}))}),(!t.archived||r.queryKey[3]!==``)&&(n=!0)):t.archived&&(n=!0))}n&&e.invalidateQueries(Z)}function be(e,t,n,r,i){switch(n.type){case`run-summary`:{let t=n.summary;if(ye(e,t),i.onSummary(t,n.relationships),r.fetcher.onEvent(t.id),t.delegation?.role===`worker`){let n=t.delegation.parentRunId;I(e,T.runs.detail(n)),r.refreshParent(n)}let a=T.runs.changes(t.id);e.getQueryData(a)!==void 0&&e.invalidateQueries({queryKey:a}),e.invalidateQueries({queryKey:T.worktrees}),q(e);return}case`run-deleted`:i.onDeleted(n.id),r.fetcher.forget(n.id),e.removeQueries({queryKey:T.runs.detail(n.id)}),e.removeQueries({queryKey:T.runs.diff(n.id)}),e.setQueriesData(Z,e=>e&&e.pages.some(e=>e.runs.some(e=>e.id===n.id))?{...e,pages:e.pages.map(e=>({...e,runs:e.runs.filter(e=>e.id!==n.id)}))}:e),e.invalidateQueries(Z),e.invalidateQueries({queryKey:T.worktrees}),q(e);return;case`usage`:t.set(n.usage);return;case`ping`:case`ready`:return}}function xe(e,t=fe){let n=p();(0,k.useEffect)(()=>{let r=re;if(typeof r!=`function`)return;let i=null,a=C(n);a.setUnknownGenerationHandler(()=>{let e=i?.requestReady;return typeof e==`function`&&e.call(i)});let o=de(n),s=ue(n),c={fetcher:s,refreshParent:o.refresh},l=N(),d=ge(n),f=ve(n),p=!1,m,h=!1,g=!1,_=!1,v=!1,y=()=>{_=!0,v=!1;let e=S.providerStatus;n.cancelQueries({queryKey:e,exact:!0}).then(()=>n.invalidateQueries({queryKey:e,exact:!0,refetchType:`active`})).finally(()=>{if(g||!v){_=!1;return}y()})},b=()=>{g||m!==void 0||(m=setTimeout(()=>{m=void 0,g||x()},z))},x=()=>{i?.close(),i=new r(t,{withCredentials:!0}),i.addEventListener(`open`,()=>{p=!0,l.reset(),a.detach(),D(!1),h&&(d.flush(),J(n)),h||(E(()=>G(n)),n.cancelQueries({queryKey:T.health}).then(()=>{g||n.invalidateQueries({queryKey:T.health})}),a.reconcile()),h=!0});for(let t of B)i.addEventListener(t,r=>{let i=se(t,r.data);if(!i)return;if(i.event.type===`ready`){let e=l.ready(i.event.seq);a.ready(i.event.generation,i.event.seq),e&&(d.flush(),J(n));return}let o=(i.event.type===`run-summary`||i.event.type===`run-deleted`)&&l.frame(i.event.seq);i.event.type===`ping`&&p&&(p=!1,E(()=>G(n)),D(!0)),i.project!==null&&(i.event.type===`run-summary`||i.event.type===`run-deleted`?a.run(i.project,i.event,o):i.event.type===`usage`&&a.usage(i.project,i.event.usage)),i.project!==null&&(i.event.type===`run-summary`||i.event.type===`run-deleted`)&&d.onEvent(i.project,i.event),(i.project===null||i.project===Y(n))&&be(n,e,i.event,c,f),o&&(d.flush(),J(n))});for(let e of V)i.addEventListener(e,t=>{let r;try{r=JSON.parse(t.data)}catch{return}if(e===`project-ready`?a.reconcile({hold:!0}):e!==`checkout-progress`&&e!==`automation-change`&&n.invalidateQueries({queryKey:S.projects}),e===`project-added`){let e=r?.project?.id;typeof e==`string`&&e!==``&&a.restoreProject(e),a.reconcile({hold:!0})}if(e===`project-removed`){let e=r?.id;typeof e==`string`&&e!==``&&a.dropProject(e)}for(let t of[...H])t(e,r)});i.addEventListener(`health`,e=>{let t;try{t=JSON.parse(e.data)}catch{return}let r=te.safeParse(t);r.success&&(n.cancelQueries({queryKey:T.health}),n.setQueryData(T.health,r.data))}),i.addEventListener(`provider-status`,e=>{let t;try{t=JSON.parse(e.data)}catch{return}let r=ne(t);if(!r)return;let i=S.providerStatus,a=ee(n.getQueryData(i),r);if(a!==void 0){n.setQueryData(i,a);return}if(_){v=!0;return}y()}),i.addEventListener(`error`,()=>{D(!1),a.detach(),i?.readyState===R&&b()})},w=()=>{document.visibilityState===`visible`&&(d.flush(),a.flush(),(!i||i.readyState===R)&&(clearTimeout(m),m=void 0,x()))},O=()=>{clearTimeout(m),m=void 0,d.flush()};document.addEventListener(`visibilitychange`,w),window.addEventListener(`pagehide`,O);let k=u((e,t)=>(d.flush(),J(n,e,t)));return x(),()=>{k(),g=!0,D(!1),clearTimeout(m),d.flush(),d.cancel(),a.stop(),o.cancel(),s.cancel(),a.setUnknownGenerationHandler(void 0),f.cancel(),document.removeEventListener(`visibilitychange`,w),window.removeEventListener(`pagehide`,O),i?.close(),i=null}},[n,e,t])}var Q=(0,k.createContext)(null);function Se({children:e}){let[t]=(0,k.useState)(le);return xe(t),x(),(0,L.jsx)(Q.Provider,{value:t,children:e})}function Ce(e){let t=(0,k.useContext)(Q),n=t?t.get:Te;return(0,k.useSyncExternalStore)(t?t.subscribe:we,()=>e?n()[e]:void 0,()=>void 0)}var we=()=>()=>void 0,Te=()=>F,Ee=`Label`,$=k.forwardRef((e,t)=>(0,L.jsx)(O.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));$.displayName=Ee;var De=$;function Oe({className:e,...t}){return(0,L.jsx)(De,{"data-slot":`label`,className:a(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}export{Ce as i,Se as n,pe as r,Oe as t};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var e={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},t=new class{#e=e;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function n(e){setTimeout(e,0)}var r=n;function i(){let e=[],t=0,n=e=>{e()},i=e=>{e()},a=r,o=r=>{t?e.push(r):a(()=>{n(r)})},s=()=>{let t=e;e=[],t.length&&a(()=>{i(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||s()}return n},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{a=e}}}var a=i(),o;function s(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var c=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},l=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(o=globalThis).__zod_globalConfig??(o.__zod_globalConfig={});var u=globalThis.__zod_globalConfig;function d(e){return e&&Object.assign(u,e),u}function f(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 p(e,t){return typeof t==`bigint`?t.toString():t}function ee(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function te(e){return e==null}function ne(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function re(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var ie=Symbol(`evaluating`);function m(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ie)return r===void 0&&(r=ie,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 g(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ae(e){return JSON.stringify(e)}function oe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var se=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function _(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ce=ee(()=>{if(u.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function v(e){if(_(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(_(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function le(e){return v(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ue=new Set([`string`,`number`,`symbol`]);function y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function b(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function x(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 de(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var fe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function pe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return b(e,g(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return h(this,`shape`,e),e},checks:[]}))}function me(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return b(e,g(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return h(this,`shape`,r),r},checks:[]}))}function he(e,t){if(!v(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return b(e,g(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return h(this,`shape`,n),n}}))}function ge(e,t){if(!v(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return b(e,g(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return h(this,`shape`,n),n}}))}function _e(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return b(e,g(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return h(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ve(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return b(t,g(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return h(this,`shape`,i),i},checks:[]}))}function ye(e,t,n){return b(t,g(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return h(this,`shape`,i),i}}))}function S(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 be(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 C(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function xe(e){return typeof e==`string`?e:e?.message}function w(e,t,n){let r=e.message?e.message:xe(e.inst?._zod.def?.error?.(e))??xe(t?.error?.(e))??xe(n.customError?.(e))??xe(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Se(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function T(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Ce=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,p,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},we=s(`$ZodError`,Ce),Te=s(`$ZodError`,Ce,{Parent:Error});function Ee(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function De(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];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var Oe=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new c;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>w(e,a,d())));throw se(t,i?.callee),t}return o.value},ke=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>w(e,a,d())));throw se(t,i?.callee),t}return o.value},Ae=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 c;return a.issues.length?{success:!1,error:new(e??we)(a.issues.map(e=>w(e,i,d())))}:{success:!0,data:a.value}},je=Ae(Te),Me=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?{success:!1,error:new e(a.issues.map(e=>w(e,i,d())))}:{success:!0,data:a.value}},Ne=Me(Te),Pe=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Oe(e)(t,n,i)},Fe=e=>(t,n,r)=>Oe(e)(t,n,r),Ie=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ke(e)(t,n,i)},Le=e=>async(t,n,r)=>ke(e)(t,n,r),Re=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ae(e)(t,n,i)},ze=e=>(t,n,r)=>Ae(e)(t,n,r),Be=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Me(e)(t,n,i)},Ve=e=>async(t,n,r)=>Me(e)(t,n,r),He=/^[cC][0-9a-z]{6,}$/,Ue=/^[0-9a-z]+$/,We=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ge=/^[0-9a-vA-V]{20}$/,Ke=/^[A-Za-z0-9]{27}$/,qe=/^[a-zA-Z0-9_-]{21}$/,Je=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ye=/^([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})$/,Xe=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)$/,Ze=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Qe=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function $e(){return new RegExp(Qe,`u`)}var et=/^(?:(?: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])$/,tt=/^(([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}|:))$/,nt=/^((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])$/,rt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,it=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,at=/^[A-Za-z0-9_-]*$/,ot=/^https?$/,st=/^\+[1-9]\d{6,14}$/,ct=`(?:(?:\\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])))`,lt=RegExp(`^${ct}$`);function ut(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function dt(e){return RegExp(`^${ut(e)}$`)}function ft(e){let t=ut({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${ct}T(?:${r})$`)}var pt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},mt=/^-?\d+$/,ht=/^-?\d+(?:\.\d+)?$/,gt=/^(?:true|false)$/i,_t=/^null$/i,vt=/^[^A-Z]*$/,yt=/^[^a-z]*$/,E=s(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),bt={number:`number`,bigint:`bigint`,object:`date`},xt=s(`$ZodCheckLessThan`,(e,t)=>{E.init(e,t);let n=bt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),St=s(`$ZodCheckGreaterThan`,(e,t)=>{E.init(e,t);let n=bt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ct=s(`$ZodCheckMultipleOf`,(e,t)=>{E.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):re(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})}}),wt=s(`$ZodCheckNumberFormat`,(e,t)=>{E.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=fe[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=mt)}),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})}}),Tt=s(`$ZodCheckMaxLength`,(e,t)=>{var n;E.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!te(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Se(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Et=s(`$ZodCheckMinLength`,(e,t)=>{var n;E.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!te(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Se(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Dt=s(`$ZodCheckLengthEquals`,(e,t)=>{var n;E.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!te(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Se(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ot=s(`$ZodCheckStringFormat`,(e,t)=>{var n,r;E.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),kt=s(`$ZodCheckRegex`,(e,t)=>{Ot.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})}}),At=s(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=vt,Ot.init(e,t)}),jt=s(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=yt,Ot.init(e,t)}),Mt=s(`$ZodCheckIncludes`,(e,t)=>{E.init(e,t);let n=y(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Nt=s(`$ZodCheckStartsWith`,(e,t)=>{E.init(e,t);let n=RegExp(`^${y(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Pt=s(`$ZodCheckEndsWith`,(e,t)=>{E.init(e,t);let n=RegExp(`.*${y(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Ft=s(`$ZodCheckOverwrite`,(e,t)=>{E.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),It=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
3
|
+
`))}},Lt={major:4,minor:4,patch:3},D=s(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Lt;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=S(e),i;for(let a of t){if(a._zod.def.when){if(be(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new c;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=S(e,t))});else{if(e.issues.length===t)continue;r||=S(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(S(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new c;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new c;return o.then(e=>t(e,r,a))}return t(o,r,a)}}m(e,`~standard`,()=>({validate:t=>{try{let n=je(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Ne(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Rt=s(`$ZodString`,(e,t)=>{D.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??pt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),O=s(`$ZodStringFormat`,(e,t)=>{Ot.init(e,t),Rt.init(e,t)}),zt=s(`$ZodGUID`,(e,t)=>{t.pattern??=Ye,O.init(e,t)}),Bt=s(`$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??=Xe(e)}else t.pattern??=Xe();O.init(e,t)}),Vt=s(`$ZodEmail`,(e,t)=>{t.pattern??=Ze,O.init(e,t)}),Ht=s(`$ZodURL`,(e,t)=>{O.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===ot.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ut=s(`$ZodEmoji`,(e,t)=>{t.pattern??=$e(),O.init(e,t)}),Wt=s(`$ZodNanoID`,(e,t)=>{t.pattern??=qe,O.init(e,t)}),Gt=s(`$ZodCUID`,(e,t)=>{t.pattern??=He,O.init(e,t)}),Kt=s(`$ZodCUID2`,(e,t)=>{t.pattern??=Ue,O.init(e,t)}),qt=s(`$ZodULID`,(e,t)=>{t.pattern??=We,O.init(e,t)}),Jt=s(`$ZodXID`,(e,t)=>{t.pattern??=Ge,O.init(e,t)}),Yt=s(`$ZodKSUID`,(e,t)=>{t.pattern??=Ke,O.init(e,t)}),Xt=s(`$ZodISODateTime`,(e,t)=>{t.pattern??=ft(t),O.init(e,t)}),Zt=s(`$ZodISODate`,(e,t)=>{t.pattern??=lt,O.init(e,t)}),Qt=s(`$ZodISOTime`,(e,t)=>{t.pattern??=dt(t),O.init(e,t)}),$t=s(`$ZodISODuration`,(e,t)=>{t.pattern??=Je,O.init(e,t)}),en=s(`$ZodIPv4`,(e,t)=>{t.pattern??=et,O.init(e,t),e._zod.bag.format=`ipv4`}),tn=s(`$ZodIPv6`,(e,t)=>{t.pattern??=tt,O.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),nn=s(`$ZodCIDRv4`,(e,t)=>{t.pattern??=nt,O.init(e,t)}),rn=s(`$ZodCIDRv6`,(e,t)=>{t.pattern??=rt,O.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function an(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var on=s(`$ZodBase64`,(e,t)=>{t.pattern??=it,O.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{an(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function sn(e){if(!at.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return an(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var cn=s(`$ZodBase64URL`,(e,t)=>{t.pattern??=at,O.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{sn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),ln=s(`$ZodE164`,(e,t)=>{t.pattern??=st,O.init(e,t)});function un(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 dn=s(`$ZodJWT`,(e,t)=>{O.init(e,t),e._zod.check=n=>{un(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),fn=s(`$ZodNumber`,(e,t)=>{D.init(e,t),e._zod.pattern=e._zod.bag.pattern??ht,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),pn=s(`$ZodNumberFormat`,(e,t)=>{wt.init(e,t),fn.init(e,t)}),mn=s(`$ZodBoolean`,(e,t)=>{D.init(e,t),e._zod.pattern=gt,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}}),hn=s(`$ZodNull`,(e,t)=>{D.init(e,t),e._zod.pattern=_t,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),gn=s(`$ZodAny`,(e,t)=>{D.init(e,t),e._zod.parse=e=>e}),_n=s(`$ZodUnknown`,(e,t)=>{D.init(e,t),e._zod.parse=e=>e}),vn=s(`$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 yn(e,t,n){e.issues.length&&t.issues.push(...C(n,e.issues)),t.value[n]=e.value}var bn=s(`$ZodArray`,(e,t)=>{D.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>yn(t,n,e))):yn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function xn(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...C(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Sn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=de(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Cn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>xn(e,n,i,t,u,d))):xn(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var wn=s(`$ZodObject`,(e,t)=>{if(D.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=ee(()=>Sn(t));m(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=_,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>xn(n,t,e,s,r,i))):xn(a,t,e,s,r,i)}return i?Cn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Tn=s(`$ZodObjectJIT`,(e,t)=>{wn.init(e,t);let n=e._zod.parse,r=ee(()=>Sn(t)),i=e=>{let t=new It([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ae(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=ae(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
4
|
+
if (${n}.issues.length) {
|
|
5
|
+
if (${o} in input) {
|
|
6
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
7
|
+
...iss,
|
|
8
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
9
|
+
})));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (${n}.value === undefined) {
|
|
14
|
+
if (${o} in input) {
|
|
15
|
+
newResult[${o}] = undefined;
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
newResult[${o}] = ${n}.value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
`):c?t.write(`
|
|
22
|
+
if (${n}.issues.length) {
|
|
23
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
24
|
+
...iss,
|
|
25
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (${n}.value === undefined) {
|
|
30
|
+
if (${o} in input) {
|
|
31
|
+
newResult[${o}] = undefined;
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
newResult[${o}] = ${n}.value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
`):t.write(`
|
|
38
|
+
const ${n}_present = ${o} in input;
|
|
39
|
+
if (${n}.issues.length) {
|
|
40
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
41
|
+
...iss,
|
|
42
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
46
|
+
payload.issues.push({
|
|
47
|
+
code: "invalid_type",
|
|
48
|
+
expected: "nonoptional",
|
|
49
|
+
input: undefined,
|
|
50
|
+
path: [${o}]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (${n}_present) {
|
|
55
|
+
if (${n}.value === undefined) {
|
|
56
|
+
newResult[${o}] = undefined;
|
|
57
|
+
} else {
|
|
58
|
+
newResult[${o}] = ${n}.value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=_,s=!u.jitless,c=s&&ce.value,l=t.catchall,d;e._zod.parse=(u,f)=>{d??=r.value;let p=u.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),u=a(u,f),l?Cn([],p,u,f,d,e):u):n(u,f):(u.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),u)}});function En(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=>!S(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=>w(e,r,d())))}),t)}var Dn=s(`$ZodUnion`,(e,t)=>{D.init(e,t),m(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),m(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),m(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),m(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ne(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=>En(t,r,e,i)):En(o,r,e,i)}}),On=s(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Dn.init(e,t);let n=e._zod.parse;m(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=ee(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!_(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._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()),input:o,path:[t.discriminator],inst:e}),i)}}),kn=s(`$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])=>jn(e,t,n)):jn(e,i,a)}});function An(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(v(e)&&v(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=An(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=An(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 jn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),S(e))return e;let o=An(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Mn=s(`$ZodRecord`,(e,t)=>{D.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!v(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>w(e,r,d())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...C(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...C(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&ht.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>w(e,r,d())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...C(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...C(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Nn=s(`$ZodEnum`,(e,t)=>{D.init(e,t);let n=f(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ue.has(typeof e)).map(e=>typeof e==`string`?y(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Pn=s(`$ZodLiteral`,(e,t)=>{if(D.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?y(e):e?y(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Fn=s(`$ZodTransform`,(e,t)=>{D.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new l(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.fallback=!0,n));if(i instanceof Promise)throw new c;return n.value=i,n.fallback=!0,n}});function In(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Ln=s(`$ZodOptional`,(e,t)=>{D.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ne(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>In(e,r)):In(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Rn=s(`$ZodExactOptional`,(e,t)=>{Ln.init(e,t),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),zn=s(`$ZodNullable`,(e,t)=>{D.init(e,t),m(e._zod,`optin`,()=>t.innerType._zod.optin),m(e._zod,`optout`,()=>t.innerType._zod.optout),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ne(e.source)}|null)$`):void 0}),m(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Bn=s(`$ZodDefault`,(e,t)=>{D.init(e,t),e._zod.optin=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Vn(e,t)):Vn(r,t)}});function Vn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Hn=s(`$ZodPrefault`,(e,t)=>{D.init(e,t),e._zod.optin=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Un=s(`$ZodNonOptional`,(e,t)=>{D.init(e,t),m(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Wn(t,e)):Wn(i,e)}});function Wn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Gn=s(`$ZodCatch`,(e,t)=>{D.init(e,t),e._zod.optin=`optional`,m(e._zod,`optout`,()=>t.innerType._zod.optout),m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>w(e,n,d()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>w(e,n,d()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Kn=s(`$ZodPipe`,(e,t)=>{D.init(e,t),m(e._zod,`values`,()=>t.in._zod.values),m(e._zod,`optin`,()=>t.in._zod.optin),m(e._zod,`optout`,()=>t.out._zod.optout),m(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>qn(e,t.in,n)):qn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>qn(e,t.out,n)):qn(r,t.out,n)}});function qn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Jn=s(`$ZodPreprocess`,(e,t)=>{Kn.init(e,t)}),Yn=s(`$ZodReadonly`,(e,t)=>{D.init(e,t),m(e._zod,`propValues`,()=>t.innerType._zod.propValues),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`optin`,()=>t.innerType?._zod?.optin),m(e._zod,`optout`,()=>t.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(Xn):Xn(r)}});function Xn(e){return e.value=Object.freeze(e.value),e}var Zn=s(`$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=>Qn(t,n,r,e));Qn(i,n,r,e)}});function Qn(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(T(e))}}var $n,er=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 tr(){return new er}($n=globalThis).__zod_globalRegistry??($n.__zod_globalRegistry=tr());var k=globalThis.__zod_globalRegistry;function nr(e,t){return new e({type:`string`,...x(t)})}function rr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...x(t)})}function ir(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...x(t)})}function ar(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...x(t)})}function or(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...x(t)})}function sr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...x(t)})}function cr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...x(t)})}function lr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...x(t)})}function ur(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...x(t)})}function dr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...x(t)})}function fr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...x(t)})}function pr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...x(t)})}function mr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...x(t)})}function hr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...x(t)})}function gr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...x(t)})}function _r(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...x(t)})}function vr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...x(t)})}function yr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...x(t)})}function br(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...x(t)})}function xr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...x(t)})}function Sr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...x(t)})}function Cr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...x(t)})}function wr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...x(t)})}function Tr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...x(t)})}function Er(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...x(t)})}function Dr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...x(t)})}function Or(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...x(t)})}function kr(e,t){return new e({type:`number`,checks:[],...x(t)})}function Ar(e,t){return new e({type:`number`,coerce:!0,checks:[],...x(t)})}function jr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...x(t)})}function Mr(e,t){return new e({type:`boolean`,...x(t)})}function Nr(e,t){return new e({type:`null`,...x(t)})}function Pr(e){return new e({type:`any`})}function Fr(e){return new e({type:`unknown`})}function Ir(e,t){return new e({type:`never`,...x(t)})}function Lr(e,t){return new xt({check:`less_than`,...x(t),value:e,inclusive:!1})}function Rr(e,t){return new xt({check:`less_than`,...x(t),value:e,inclusive:!0})}function zr(e,t){return new St({check:`greater_than`,...x(t),value:e,inclusive:!1})}function Br(e,t){return new St({check:`greater_than`,...x(t),value:e,inclusive:!0})}function Vr(e,t){return new Ct({check:`multiple_of`,...x(t),value:e})}function Hr(e,t){return new Tt({check:`max_length`,...x(t),maximum:e})}function Ur(e,t){return new Et({check:`min_length`,...x(t),minimum:e})}function Wr(e,t){return new Dt({check:`length_equals`,...x(t),length:e})}function Gr(e,t){return new kt({check:`string_format`,format:`regex`,...x(t),pattern:e})}function Kr(e){return new At({check:`string_format`,format:`lowercase`,...x(e)})}function qr(e){return new jt({check:`string_format`,format:`uppercase`,...x(e)})}function Jr(e,t){return new Mt({check:`string_format`,format:`includes`,...x(t),includes:e})}function Yr(e,t){return new Nt({check:`string_format`,format:`starts_with`,...x(t),prefix:e})}function Xr(e,t){return new Pt({check:`string_format`,format:`ends_with`,...x(t),suffix:e})}function A(e){return new Ft({check:`overwrite`,tx:e})}function Zr(e){return A(t=>t.normalize(e))}function Qr(){return A(e=>e.trim())}function $r(){return A(e=>e.toLowerCase())}function ei(){return A(e=>e.toUpperCase())}function ti(){return A(e=>oe(e))}function ni(e,t,n){return new e({type:`array`,element:t,...x(n)})}function ri(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...x(n)})}function ii(e,t){let n=ai(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(T(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(T(r))}},e(t.value,t)),t);return n}function ai(e,t){let n=new E({check:`custom`,...x(t)});return n._zod.check=e,n}function oi(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??k,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function j(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);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,j(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&M(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 si(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);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}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+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>
|
|
63
|
+
|
|
64
|
+
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);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ci(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)):Object.assign(i,s),Object.assign(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??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);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)}Object.assign(i,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??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}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:ui(t,`input`,e.processors),output:ui(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function M(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 M(r.element,n);if(r.type===`set`)return M(r.valueType,n);if(r.type===`lazy`)return M(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return M(r.innerType,n);if(r.type===`intersection`)return M(r.left,n)||M(r.right,n);if(r.type===`record`||r.type===`map`)return M(r.keyType,n)||M(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:M(r.in,n)||M(r.out,n);if(r.type===`object`){for(let e in r.shape)if(M(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(M(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(M(e,n))return!0;return!!(r.rest&&M(r.rest,n))}return!1}var li=(e,t={})=>n=>{let r=oi({...n,processors:t});return j(e,r),si(r,e),ci(r,e)},ui=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=oi({...i??{},target:a,io:t,processors:n});return j(e,o),si(o,e),ci(o,e)},di={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},fi=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=di[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},pi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},mi=(e,t,n,r)=>{n.type=`boolean`},hi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},gi=(e,t,n,r)=>{n.not={}},_i=(e,t,n,r)=>{let i=e._zod.def,a=f(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},vi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},yi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},bi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},xi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=j(a.element,t,{...r,path:[...r.path,`items`]})},Si=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=j(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=j(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ci=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>j(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},wi=(e,t,n,r)=>{let i=e._zod.def,a=j(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=j(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ti=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=j(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=j(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=j(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ei=(e,t,n,r)=>{let i=e._zod.def,a=j(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`}]},Di=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Oi=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ki=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ai=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},ji=(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;j(o,t,r);let s=t.seen.get(e);s.ref=o},Mi=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ni=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Pi=s(`ZodISODateTime`,(e,t)=>{Xt.init(e,t),R.init(e,t)});function N(e){return Tr(Pi,e)}var Fi=s(`ZodISODate`,(e,t)=>{Zt.init(e,t),R.init(e,t)});function Ii(e){return Er(Fi,e)}var Li=s(`ZodISOTime`,(e,t)=>{Qt.init(e,t),R.init(e,t)});function Ri(e){return Dr(Li,e)}var zi=s(`ZodISODuration`,(e,t)=>{$t.init(e,t),R.init(e,t)});function Bi(e){return Or(zi,e)}var P=s(`ZodError`,(e,t)=>{we.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>De(e,t)},flatten:{value:t=>Ee(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,p,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,p,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Vi=Oe(P),Hi=ke(P),Ui=Ae(P),Wi=Me(P),Gi=Pe(P),Ki=Fe(P),qi=Ie(P),Ji=Le(P),Yi=Re(P),Xi=ze(P),Zi=Be(P),Qi=Ve(P),$i=new WeakMap;function F(e,t,n){let r=Object.getPrototypeOf(e),i=$i.get(r);if(i||(i=new Set,$i.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var I=s(`ZodType`,(e,t)=>(D.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ui(e,`input`),output:ui(e,`output`)}}),e.toJSONSchema=li(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Vi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ui(e,t,n),e.parseAsync=async(t,n)=>Hi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Wi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Gi(e,t,n),e.decode=(t,n)=>Ki(e,t,n),e.encodeAsync=async(t,n)=>qi(e,t,n),e.decodeAsync=async(t,n)=>Ji(e,t,n),e.safeEncode=(t,n)=>Yi(e,t,n),e.safeDecode=(t,n)=>Xi(e,t,n),e.safeEncodeAsync=async(t,n)=>Zi(e,t,n),e.safeDecodeAsync=async(t,n)=>Qi(e,t,n),F(e,`ZodType`,{check(...e){let t=this.def;return this.clone(g(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 b(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(mo(e,t))},superRefine(e,t){return this.check(ho(e,t))},overwrite(e){return this.check(A(e))},optional(){return Ja(this)},exactOptional(){return Xa(this)},nullable(){return Qa(this)},nullish(){return Ja(Qa(this))},nonoptional(e){return io(this,e)},array(){return W(this)},or(e){return K([this,e])},and(e){return Ba(this,e)},transform(e){return co(this,Ka(e))},default(e){return eo(this,e)},prefault(e){return no(this,e)},catch(e){return oo(this,e)},pipe(e){return co(this,e)},readonly(){return fo(this)},describe(e){let t=this.clone();return k.add(t,{description:e}),t},meta(...e){if(e.length===0)return k.get(this);let t=this.clone();return k.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return k.get(e)?.description},configurable:!0}),e)),ea=s(`_ZodString`,(e,t)=>{Rt.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,F(e,`_ZodString`,{regex(...e){return this.check(Gr(...e))},includes(...e){return this.check(Jr(...e))},startsWith(...e){return this.check(Yr(...e))},endsWith(...e){return this.check(Xr(...e))},min(...e){return this.check(Ur(...e))},max(...e){return this.check(Hr(...e))},length(...e){return this.check(Wr(...e))},nonempty(...e){return this.check(Ur(1,...e))},lowercase(e){return this.check(Kr(e))},uppercase(e){return this.check(qr(e))},trim(){return this.check(Qr())},normalize(...e){return this.check(Zr(...e))},toLowerCase(){return this.check($r())},toUpperCase(){return this.check(ei())},slugify(){return this.check(ti())}})}),ta=s(`ZodString`,(e,t)=>{Rt.init(e,t),ea.init(e,t),e.email=t=>e.check(rr(na,t)),e.url=t=>e.check(lr(ia,t)),e.jwt=t=>e.check(wr(ba,t)),e.emoji=t=>e.check(ur(oa,t)),e.guid=t=>e.check(ir(ra,t)),e.uuid=t=>e.check(ar(z,t)),e.uuidv4=t=>e.check(or(z,t)),e.uuidv6=t=>e.check(sr(z,t)),e.uuidv7=t=>e.check(cr(z,t)),e.nanoid=t=>e.check(dr(sa,t)),e.guid=t=>e.check(ir(ra,t)),e.cuid=t=>e.check(fr(ca,t)),e.cuid2=t=>e.check(pr(la,t)),e.ulid=t=>e.check(mr(ua,t)),e.base64=t=>e.check(xr(_a,t)),e.base64url=t=>e.check(Sr(va,t)),e.xid=t=>e.check(hr(da,t)),e.ksuid=t=>e.check(gr(fa,t)),e.ipv4=t=>e.check(_r(pa,t)),e.ipv6=t=>e.check(vr(ma,t)),e.cidrv4=t=>e.check(yr(ha,t)),e.cidrv6=t=>e.check(br(ga,t)),e.e164=t=>e.check(Cr(ya,t)),e.datetime=t=>e.check(N(t)),e.date=t=>e.check(Ii(t)),e.time=t=>e.check(Ri(t)),e.duration=t=>e.check(Bi(t))});function L(e){return nr(ta,e)}var R=s(`ZodStringFormat`,(e,t)=>{O.init(e,t),ea.init(e,t)}),na=s(`ZodEmail`,(e,t)=>{Vt.init(e,t),R.init(e,t)}),ra=s(`ZodGUID`,(e,t)=>{zt.init(e,t),R.init(e,t)}),z=s(`ZodUUID`,(e,t)=>{Bt.init(e,t),R.init(e,t)});function B(e){return ar(z,e)}var ia=s(`ZodURL`,(e,t)=>{Ht.init(e,t),R.init(e,t)});function aa(e){return lr(ia,e)}var oa=s(`ZodEmoji`,(e,t)=>{Ut.init(e,t),R.init(e,t)}),sa=s(`ZodNanoID`,(e,t)=>{Wt.init(e,t),R.init(e,t)}),ca=s(`ZodCUID`,(e,t)=>{Gt.init(e,t),R.init(e,t)}),la=s(`ZodCUID2`,(e,t)=>{Kt.init(e,t),R.init(e,t)}),ua=s(`ZodULID`,(e,t)=>{qt.init(e,t),R.init(e,t)}),da=s(`ZodXID`,(e,t)=>{Jt.init(e,t),R.init(e,t)}),fa=s(`ZodKSUID`,(e,t)=>{Yt.init(e,t),R.init(e,t)}),pa=s(`ZodIPv4`,(e,t)=>{en.init(e,t),R.init(e,t)}),ma=s(`ZodIPv6`,(e,t)=>{tn.init(e,t),R.init(e,t)}),ha=s(`ZodCIDRv4`,(e,t)=>{nn.init(e,t),R.init(e,t)}),ga=s(`ZodCIDRv6`,(e,t)=>{rn.init(e,t),R.init(e,t)}),_a=s(`ZodBase64`,(e,t)=>{on.init(e,t),R.init(e,t)}),va=s(`ZodBase64URL`,(e,t)=>{cn.init(e,t),R.init(e,t)}),ya=s(`ZodE164`,(e,t)=>{ln.init(e,t),R.init(e,t)}),ba=s(`ZodJWT`,(e,t)=>{dn.init(e,t),R.init(e,t)}),xa=s(`ZodNumber`,(e,t)=>{fn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r),F(e,`ZodNumber`,{gt(e,t){return this.check(zr(e,t))},gte(e,t){return this.check(Br(e,t))},min(e,t){return this.check(Br(e,t))},lt(e,t){return this.check(Lr(e,t))},lte(e,t){return this.check(Rr(e,t))},max(e,t){return this.check(Rr(e,t))},int(e){return this.check(Ca(e))},safe(e){return this.check(Ca(e))},positive(e){return this.check(zr(0,e))},nonnegative(e){return this.check(Br(0,e))},negative(e){return this.check(Lr(0,e))},nonpositive(e){return this.check(Rr(0,e))},multipleOf(e,t){return this.check(Vr(e,t))},step(e,t){return this.check(Vr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function V(e){return kr(xa,e)}var Sa=s(`ZodNumberFormat`,(e,t)=>{pn.init(e,t),xa.init(e,t)});function Ca(e){return jr(Sa,e)}var wa=s(`ZodBoolean`,(e,t)=>{mn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r)});function H(e){return Mr(wa,e)}var Ta=s(`ZodNull`,(e,t)=>{hn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r)});function Ea(e){return Nr(Ta,e)}var Da=s(`ZodAny`,(e,t)=>{gn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Oa(){return Pr(Da)}var ka=s(`ZodUnknown`,(e,t)=>{_n.init(e,t),I.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function U(){return Fr(ka)}var Aa=s(`ZodNever`,(e,t)=>{vn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r)});function ja(e){return Ir(Aa,e)}var Ma=s(`ZodArray`,(e,t)=>{bn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.element=t.element,F(e,`ZodArray`,{min(e,t){return this.check(Ur(e,t))},nonempty(e){return this.check(Ur(1,e))},max(e,t){return this.check(Hr(e,t))},length(e,t){return this.check(Wr(e,t))},unwrap(){return this.element}})});function W(e,t){return ni(Ma,e,t)}var Na=s(`ZodObject`,(e,t)=>{Tn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),m(e,`shape`,()=>t.shape),F(e,`ZodObject`,{keyof(){return q(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:U()})},loose(){return this.clone({...this._zod.def,catchall:U()})},strict(){return this.clone({...this._zod.def,catchall:ja()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return he(this,e)},safeExtend(e){return ge(this,e)},merge(e){return _e(this,e)},pick(e){return pe(this,e)},omit(e){return me(this,e)},partial(...e){return ve(qa,this,e[0])},required(...e){return ye(ro,this,e[0])}})});function G(e,t){return new Na({type:`object`,shape:e??{},...x(t)})}function Pa(e,t){return new Na({type:`object`,shape:e,catchall:ja(),...x(t)})}function Fa(e,t){return new Na({type:`object`,shape:e,catchall:U(),...x(t)})}var Ia=s(`ZodUnion`,(e,t)=>{Dn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.options=t.options});function K(e,t){return new Ia({type:`union`,options:e,...x(t)})}var La=s(`ZodDiscriminatedUnion`,(e,t)=>{Ia.init(e,t),On.init(e,t)});function Ra(e,t,n){return new La({type:`union`,options:t,discriminator:e,...x(n)})}var za=s(`ZodIntersection`,(e,t)=>{kn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r)});function Ba(e,t){return new za({type:`intersection`,left:e,right:t})}var Va=s(`ZodRecord`,(e,t)=>{Mn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ha(e,t,n){return!t||!t._zod?new Va({type:`record`,keyType:L(),valueType:e,...x(t)}):new Va({type:`record`,keyType:e,valueType:t,...x(n)})}var Ua=s(`ZodEnum`,(e,t)=>{Nn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ua({...t,checks:[],...x(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 Ua({...t,checks:[],...x(r),entries:i})}});function q(e,t){return new Ua({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...x(t)})}var Wa=s(`ZodLiteral`,(e,t)=>{Pn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(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 J(e,t){return new Wa({type:`literal`,values:Array.isArray(e)?e:[e],...x(t)})}var Ga=s(`ZodTransform`,(e,t)=>{Fn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new l(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(T(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(T(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Ka(e){return new Ga({type:`transform`,transform:e})}var qa=s(`ZodOptional`,(e,t)=>{Ln.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ja(e){return new qa({type:`optional`,innerType:e})}var Ya=s(`ZodExactOptional`,(e,t)=>{Rn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xa(e){return new Ya({type:`optional`,innerType:e})}var Za=s(`ZodNullable`,(e,t)=>{zn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qa(e){return new Za({type:`nullable`,innerType:e})}var $a=s(`ZodDefault`,(e,t)=>{Bn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eo(e,t){return new $a({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var to=s(`ZodPrefault`,(e,t)=>{Hn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function no(e,t){return new to({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var ro=s(`ZodNonOptional`,(e,t)=>{Un.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function io(e,t){return new ro({type:`nonoptional`,innerType:e,...x(t)})}var ao=s(`ZodCatch`,(e,t)=>{Gn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function oo(e,t){return new ao({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var so=s(`ZodPipe`,(e,t)=>{Kn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.in=t.in,e.out=t.out});function co(e,t){return new so({type:`pipe`,in:e,out:t})}var lo=s(`ZodPreprocess`,(e,t)=>{so.init(e,t),Jn.init(e,t)}),uo=s(`ZodReadonly`,(e,t)=>{Yn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fo(e){return new uo({type:`readonly`,innerType:e})}var po=s(`ZodCustom`,(e,t)=>{Zn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r)});function mo(e,t={}){return ri(po,e,t)}function ho(e,t){return ii(e,t)}function go(e,t){return new lo({type:`pipe`,in:Ka(e),out:t})}function _o(e){return Ar(xa,e)}var Y={questions:4,id:64,header:12,question:400,minOptions:2,maxOptions:4,label:60,description:280,context:2e4},vo=L().min(1).max(Y.context),yo=G({label:L().min(1).max(Y.label),description:L().max(Y.description).optional()}).strict(),bo=G({id:L().min(1).max(Y.id).optional(),header:L().min(1).max(Y.header),question:L().min(1).max(Y.question),options:W(yo).min(Y.minOptions).max(Y.maxOptions).refine(e=>new Set(e.map(e=>e.label)).size===e.length,{message:`option labels must be unique within a question`}).optional(),multiSelect:H().optional(),allowFreeText:H().optional()}).strict(),xo=G({context:vo.optional(),questions:W(bo).min(1).max(Y.questions).refine(e=>new Set(e.map(e=>e.question)).size===e.length,{message:`question texts must be unique`})}).strict(),So=q([`low`,`medium`,`high`,`xhigh`,`max`]),Co=L().max(32).optional(),wo=q([`family`,`peer`]),To=G({senderRunId:B(),recipientRunId:B(),kind:q([`request`,`progress`,`follow-up`,`reply`]),requestId:B().optional(),relationship:wo.optional()}).strict(),X=To.extend({id:B(),text:L().min(1).max(1e5),createdAt:N(),deadline:N().optional(),requestHash:L().regex(/^[0-9a-f]{64}$/),state:q([`accepted`,`continuation-required`,`destroyed`,`late`]),resumed:J(!0).optional(),instruction:L().max(2048).optional(),question:xo.optional()}),Z=G({requestId:B(),status:q([`replied`,`replied-late`,`completed-without-reply`,`failed`,`cancelled`,`destroyed`,`timed-out`,`sender-closed`,`human-fallback`,`deleted`]),observedAt:N(),replyId:B().optional()}).strict(),Eo=G({messages:W(X).max(1024),outcomes:W(Z).max(1024)}).strict(),Do=L().max(128).regex(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z)~([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i,`Not a history cursor; pass nextBefore from an earlier page`);Eo.extend({hint:L().optional(),nextBefore:Do.optional()}),G({messages:W(X).max(32),outcomes:W(Z).max(32),receiptId:B().optional(),expiresAt:N().optional()}).strict().refine(e=>e.messages.length>0?e.receiptId!==void 0&&e.expiresAt!==void 0:e.receiptId===void 0&&e.expiresAt===void 0,{message:`A nonempty inbox batch requires a receipt and expiry`}),G({receiptId:B()}).strict(),G({receiptId:B(),status:q([`acknowledged`,`already-acknowledged`,`released`])}).strict(),G({id:B(),recipientRunId:B(),kind:To.shape.kind,requestId:B().optional(),text:L().min(1).max(1e5).refine(e=>e.trim().length>0),timeoutSeconds:V().int().min(1).max(86400).default(600),resume:H().optional(),model:L().trim().min(1).max(512).optional(),effort:Co}).strict().refine(e=>e.timeoutSeconds<=7200||e.resume===!0&&e.kind===`request`,{path:[`timeoutSeconds`],message:`Only --resume requests accept deadlines above 7200 seconds (maximum 86400)`}).refine(e=>(e.kind===`reply`||e.kind===`follow-up`)==(e.requestId!==void 0),{message:`Replies and follow-ups require a request ID; new messages must omit it`}).refine(e=>!e.resume||e.kind===`request`||e.kind===`progress`,{message:`--resume requires a new request or progress instruction`}).refine(e=>e.resume===!0||e.model===void 0&&e.effort===void 0,{message:`--model and --effort require --resume`});var Oo=q([`applied`,`unchanged`,`refused`,`unknown`]);G({message:X,delivery:q([`queued`,`delivered`,`consumed`,`not-delivered`]),outcome:Z.optional(),effect:Oo.optional()}).strict(),G({recipientRunId:B(),before:Do.optional()}).strict(),G({requestId:B()}).strict(),G({requestIds:W(B()).min(1).max(32).refine(e=>new Set(e).size===e.length),mode:q([`one`,`any`,`all`]).optional(),timeoutSeconds:V().int().min(1).max(7200).default(600)}).strict().refine(e=>e.mode!==`one`||e.requestIds.length===1,{message:`one requires exactly one request`});var ko=G({receiptId:B(),generation:B(),expiresAt:N(),acknowledgedAt:N().optional(),memberIds:W(B()).min(1).max(32).refine(e=>new Set(e).size===e.length).optional()}).strict(),Ao=G({conversation:To.optional(),id:B(),source:q([`agent`,`lifecycle`]),parentRunId:B(),text:L().min(1).max(1e5),createdAt:N(),deliveredAt:N().optional(),consumedAt:N().optional(),awaitingRead:J(!0).optional(),inboxClaim:ko.optional(),purpose:q([`completion-refusal`,`undelivered-question`]).optional(),requestHash:L().regex(/^[0-9a-f]{64}$/).optional(),deadline:N().optional()}).strict(),jo=G({workerId:B(),status:q([`review`,`done`,`failed`,`cancelled`]),observedAt:N(),summary:L().max(4e3).optional(),revision:V().int().nonnegative().optional()}).strict(),Mo=q([`one`,`any`,`all`]),Q=Fa({seq:V(),ts:L(),stepId:L().optional(),type:L()}),No=Q.extend({type:J(`conversation-message`),message:X,delivery:q([`queued`,`delivered`,`consumed`,`not-delivered`]),deliveredAt:N().optional(),consumedAt:N().optional()}),Po=Q.extend({type:J(`request-outcome`),outcome:Z}),Fo=Q.extend({type:J(`agent-input`),input:Ao}),Io=Q.extend({type:J(`human-input-delivered`),askSeq:V().int().nonnegative(),source:q([`human`,`parent`,`cezar`]).optional()}),Lo=Q.extend({type:J(`human-ask-closed`),askSeq:V().int().nonnegative(),reason:q([`finish`,`superseded`,`parent-stopped`,`worker-stopped`,`undeliverable`])});Q.extend({type:J(`worker-question-routed`),askSeq:V().int().nonnegative(),messageId:B(),parentRunId:B()}),Q.extend({type:J(`worker-question-fallback`),askSeq:V().int().nonnegative(),reason:L().min(1).max(200)}),Q.extend({type:J(`worker-question-undelivered`),askSeq:V().int().nonnegative(),reason:L().min(1).max(200)}),Q.extend({type:J(`worker-outcome`),outcome:jo});var Ro=G({id:L().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)}),$=L().min(1).max(2048);G({cursor:$.optional()}),G({cursor:$.optional(),afterSeq:_o().int().nonnegative().optional()});var zo=G({seq:V(),ts:L(),stepId:L().optional(),type:L()}).catchall(Oa()),Bo=G({events:W(zo),itemCount:V().int().min(0).max(100),olderCursor:$.optional(),newerCursor:$.optional(),liveCursor:$,asOfSeq:V().int().nonnegative(),hasOlder:H()}),Vo=G({contextEvents:W(zo),asOfSeq:V().int().nonnegative()}),Ho=G({checkoutId:L().optional(),name:L(),phase:q([`cloning`,`done`,`error`]),line:L().optional(),error:L().optional(),warning:L().optional()}),Uo=1024*1024,Wo=G({projectId:L().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),runId:Ro.shape.id,cursor:$.optional(),afterSeq:V().int().nonnegative().safe()});G({runs:W(Wo).min(1).max(32)}).refine(({runs:e})=>new Set(e.map(e=>`${e.projectId}/${e.runId}`)).size===e.length,{message:`duplicate run demand`});var Go=Wo.pick({projectId:!0,runId:!0}),Ko=Go.extend({type:q([`error`,`reset`]),status:K([J(400),J(404),J(409),J(413),J(503)]),error:L()}),qo=K([Go.extend({type:J(`batch`),events:W(zo).max(256),cursor:$,afterSeq:V().int().nonnegative(),hasMore:H()}),Ko]),Jo=G({generation:L(),results:W(qo)}),Yo=K([G({type:J(`ready`),generation:L()}),G({type:J(`ping`)}),Go.extend({type:J(`event`),name:q([`run-event`,`ui-event`]),event:zo}),Ko]),Xo=`cezar-live-v3`,Zo=15e3,Qo=5e3;function $o(e){return!e.startsWith(`/api/v1/`)||e.includes(`#`)||/[\\\r\n]/.test(e)?!1:/^\/api\/v1\/(?:workspace\/(?:runs-index|activity)|p\/[a-zA-Z0-9_-]+\/(?:reports\/state|runs\/[a-zA-Z0-9._-]+\/(?:changes|commits)|github(?:\/(?:checks|ref-status))?))(?:\?[^#]*)?$/.test(e)}var es=Ra(`kind`,[G({kind:J(`workspace`)}),Wo.extend({kind:J(`run`)}),G({kind:J(`topic`),topic:L().min(1).max(128)}),G({kind:J(`read`),path:L().max(4096).refine($o),intervalMs:V().int().min(1e3).max(2147483647)})]),ts=G({id:L().min(1).max(128),demand:es}),ns=G({version:J(3),documentId:L().min(1).max(128),epoch:V().int().nonnegative()}),rs=Ra(`type`,[ns.extend({type:J(`sync`),entries:W(ts).max(64),workspaceReady:J(!0).optional()}).refine(e=>new Set(e.entries.map(e=>e.id)).size===e.entries.length),ns.extend({type:J(`ack`),id:L(),seq:V().int().nonnegative()}),ns.extend({type:J(`refresh`),id:L()})]),is=G({event:L(),data:L(),id:L()}),as=Ra(`type`,[G({type:J(`unavailable`),version:J(3),epoch:V(),reason:L()}),G({type:J(`hello`),version:J(3)}),G({type:J(`alive`),version:J(3),epoch:V()}),G({type:J(`frame`),version:J(3),epoch:V(),id:L(),frame:K([is,Yo])}),G({type:J(`value`),version:J(3),epoch:V(),id:L(),value:U(),error:L().optional()}),G({type:J(`reset`),version:J(3),epoch:V(),id:L(),reason:L()})]),os=e=>`${e.projectId}/${e.runId}`,ss=`live channel refused`;export{_o as A,G as B,Ao as C,So as D,Co as E,Ra as F,K as G,Ha as H,J as I,B as J,U as K,Fa as L,Ea as M,W as N,vo as O,H as P,t as Q,ja as R,Mo as S,Z as T,Pa as U,go as V,L as W,Xe as X,N as Y,a as Z,Io as _,$o as a,Bo as b,as as c,Yo as d,Uo as f,Lo as g,No as h,Qo as i,q as j,xo as k,os as l,Ho as m,Zo as n,es as o,Fo as p,aa as q,Xo as r,rs as s,ss as t,Jo as u,Po as v,Eo as w,jo as x,Vo as y,V as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r}from"./utils-DSMR_WLb.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{d as a,f as o,p as s}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{Bt as c,Gt as l,Ht as ee,Kt as te,Ut as u,Vt as ne,Wt as d,qt as f}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r}from"./utils-DSMR_WLb.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{d as a,f as o,p as s}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{Bt as c,Gt as l,Ht as ee,Kt as te,Ut as u,Vt as ne,Wt as d,qt as f}from"./index-DXIRYobS.js";import{i as p,n as m,s as h}from"./chunk-BO2N2NFS-DQrpGzb-.js";import{i as re,o as g,r as ie,t as _}from"./highlighter-DvLzHjjY.js";var v=e(t(),1),y=n();function b({isOpen:e,onClose:t,onConfirm:n,url:r}){return(0,y.jsx)(c,{open:e,onOpenChange:e=>{e||t()},children:(0,y.jsxs)(u,{"data-slot":`link-safety-dialog`,children:[(0,y.jsxs)(te,{children:[(0,y.jsx)(f,{children:`Open this link?`}),(0,y.jsxs)(d,{children:[`It leaves Squawk in a new tab. The words of a link in a transcript are the agent's — the address below is where it actually goes.`,(0,y.jsx)(`span`,{"data-slot":`link-safety-url`,className:`mt-3 block wrap-anywhere rounded-md border border-border bg-muted px-3 py-2 font-mono text-xs text-foreground`,children:r})]})]}),(0,y.jsxs)(l,{children:[(0,y.jsx)(ee,{children:`Cancel`}),(0,y.jsx)(ne,{onClick:n,children:`Open link`})]})]})})}var x=String.raw`https?:\/\/(?:cdn\.jsdelivr\.net\/npm|unpkg\.com)\/`,ae=[{id:`tailwind-v3`,script:/^https?:\/\/cdn\.tailwindcss\.com(?:\/[\d.]+)?\/?(?:[?#]|$)/i},{id:`tailwind`,script:new RegExp(String.raw`^${x}@tailwindcss\/browser@4(?:\.[.\d]*)?(?:\/dist\/index\.global(?:\.min)?\.js)?\/?(?:[?#]|$)`,`i`)},{id:`mermaid`,script:new RegExp(String.raw`^${x}mermaid@11(?:\.[.\d]*)?\/dist\/mermaid(?:\.esm)?(?:\.min)?\.m?js(?:[?#]|$)`,`i`)}],S=new RegExp(String.raw`(['"])(${x}mermaid@11(?:\.[.\d]*)?(?:\/dist\/mermaid(?:\.esm)?(?:\.min)?\.mjs|\/\+esm)?)\1`,`gi`);function C(e){let t=e.trim();return ae.find(e=>e.script.test(t))?.id??null}function w(e){let t=new DOMParser().parseFromString(e,`text/html`),n=new Set;for(let e of t.querySelectorAll(`script`)){let t=e.getAttribute(`src`),r=t===null?null:C(t);r&&n.add(r===`tailwind-v3`?`tailwind`:r).add(r),t===null&&e.getAttribute(`type`)===`module`&&(e.textContent??``).search(S)>=0&&n.add(`mermaid`),S.lastIndex=0}return[...n].sort()}var T={tailwind:async()=>(await i(()=>import(`./index.global-D3Ga_D3Y.js`),[])).default,"tailwind-v3":()=>Promise.resolve(le),mermaid:async()=>(await i(()=>import(`./mermaid.min-3O9YjB2l.js`),[])).default};async function oe(e){let t=await Promise.all(e.map(e=>T[e]().then(t=>[e,t],()=>null)));return Object.fromEntries(t.filter(e=>e!==null))}function se(){let e={colors:`color`,fontFamily:`font`,fontSize:`text`,fontWeight:`font-weight`,spacing:`spacing`,borderRadius:`radius`,boxShadow:`shadow`,dropShadow:`drop-shadow`,blur:`blur`,screens:`breakpoint`,letterSpacing:`tracking`,lineHeight:`leading`,maxWidth:`container`,animation:`animate`,aspectRatio:`aspect`},t=e=>typeof e==`object`&&!!e&&!Array.isArray(e),n=t=>Object.hasOwn(e,t)?e[t]:void 0,r=(e,n,i,a)=>{if(t(a)){for(let[t,o]of Object.entries(a))r(e,n,t===`DEFAULT`?i:i?`${i}-${t}`:t,o);return}let o=i?`--${n}-${i}`:`--${n}`;if(n===`text`&&Array.isArray(a)){e.push(`${o}: ${String(a[0])};`);let n=t(a[1])?a[1].lineHeight:a[1];typeof n==`string`&&e.push(`${o}--line-height: ${n};`);return}typeof a==`string`||typeof a==`number`?e.push(`${o}: ${a};`):Array.isArray(a)&&e.push(`${o}: ${a.join(`, `)};`)},i=e=>{let[t,n]=Array.isArray(e)?e:[e];if(t!==`class`&&t!==`selector`)return``;let r=typeof n==`string`?n:`.dark`;return`@custom-variant dark (&:where(${r}, ${r} *));\n`},a=e=>{let a=t(e)?e:{},o=t(a.theme)?a.theme:{},s=[];for(let[e,t]of Object.entries(o)){let i=n(e);i&&(s.push(`--${i}-*: initial;`),r(s,i,``,t))}for(let[e,i]of Object.entries(t(o.extend)?o.extend:{})){let t=n(e);t&&r(s,t,``,i)}return`${i(a.darkMode)}@theme {\n${s.join(`
|
|
2
2
|
`)}\n}`},o=document.createElement(`style`);o.setAttribute(`type`,`text/tailwindcss`),document.currentScript?.before(o);let s={};Object.defineProperty(globalThis,"tailwind",{configurable:!0,value:{get config(){return s},set config(e){s=e,o.textContent=a(e)}}})}var ce=`(${se.toString()})()`,le=[`@import "tailwindcss/theme.css";@import "tailwindcss/preflight.css";@import "tailwindcss/utilities.css";`,`@theme{`,`--color-slate-50:#f8fafc;--color-slate-100:#f1f5f9;--color-slate-200:#e2e8f0;--color-slate-300:#cbd5e1;--color-slate-400:#94a3b8;--color-slate-500:#64748b;--color-slate-600:#475569;--color-slate-700:#334155;--color-slate-800:#1e293b;--color-slate-900:#0f172a;--color-slate-950:#020617;`,`--color-gray-50:#f9fafb;--color-gray-100:#f3f4f6;--color-gray-200:#e5e7eb;--color-gray-300:#d1d5db;--color-gray-400:#9ca3af;--color-gray-500:#6b7280;--color-gray-600:#4b5563;--color-gray-700:#374151;--color-gray-800:#1f2937;--color-gray-900:#111827;--color-gray-950:#030712;`,`--color-zinc-50:#fafafa;--color-zinc-100:#f4f4f5;--color-zinc-200:#e4e4e7;--color-zinc-300:#d4d4d8;--color-zinc-400:#a1a1aa;--color-zinc-500:#71717a;--color-zinc-600:#52525b;--color-zinc-700:#3f3f46;--color-zinc-800:#27272a;--color-zinc-900:#18181b;--color-zinc-950:#09090b;`,`--color-neutral-50:#fafafa;--color-neutral-100:#f5f5f5;--color-neutral-200:#e5e5e5;--color-neutral-300:#d4d4d4;--color-neutral-400:#a3a3a3;--color-neutral-500:#737373;--color-neutral-600:#525252;--color-neutral-700:#404040;--color-neutral-800:#262626;--color-neutral-900:#171717;--color-neutral-950:#0a0a0a;`,`--color-stone-50:#fafaf9;--color-stone-100:#f5f5f4;--color-stone-200:#e7e5e4;--color-stone-300:#d6d3d1;--color-stone-400:#a8a29e;--color-stone-500:#78716c;--color-stone-600:#57534e;--color-stone-700:#44403c;--color-stone-800:#292524;--color-stone-900:#1c1917;--color-stone-950:#0c0a09;`,`--color-red-50:#fef2f2;--color-red-100:#fee2e2;--color-red-200:#fecaca;--color-red-300:#fca5a5;--color-red-400:#f87171;--color-red-500:#ef4444;--color-red-600:#dc2626;--color-red-700:#b91c1c;--color-red-800:#991b1b;--color-red-900:#7f1d1d;--color-red-950:#450a0a;`,`--color-orange-50:#fff7ed;--color-orange-100:#ffedd5;--color-orange-200:#fed7aa;--color-orange-300:#fdba74;--color-orange-400:#fb923c;--color-orange-500:#f97316;--color-orange-600:#ea580c;--color-orange-700:#c2410c;--color-orange-800:#9a3412;--color-orange-900:#7c2d12;--color-orange-950:#431407;`,`--color-amber-50:#fffbeb;--color-amber-100:#fef3c7;--color-amber-200:#fde68a;--color-amber-300:#fcd34d;--color-amber-400:#fbbf24;--color-amber-500:#f59e0b;--color-amber-600:#d97706;--color-amber-700:#b45309;--color-amber-800:#92400e;--color-amber-900:#78350f;--color-amber-950:#451a03;`,`--color-yellow-50:#fefce8;--color-yellow-100:#fef9c3;--color-yellow-200:#fef08a;--color-yellow-300:#fde047;--color-yellow-400:#facc15;--color-yellow-500:#eab308;--color-yellow-600:#ca8a04;--color-yellow-700:#a16207;--color-yellow-800:#854d0e;--color-yellow-900:#713f12;--color-yellow-950:#422006;`,`--color-lime-50:#f7fee7;--color-lime-100:#ecfccb;--color-lime-200:#d9f99d;--color-lime-300:#bef264;--color-lime-400:#a3e635;--color-lime-500:#84cc16;--color-lime-600:#65a30d;--color-lime-700:#4d7c0f;--color-lime-800:#3f6212;--color-lime-900:#365314;--color-lime-950:#1a2e05;`,`--color-green-50:#f0fdf4;--color-green-100:#dcfce7;--color-green-200:#bbf7d0;--color-green-300:#86efac;--color-green-400:#4ade80;--color-green-500:#22c55e;--color-green-600:#16a34a;--color-green-700:#15803d;--color-green-800:#166534;--color-green-900:#14532d;--color-green-950:#052e16;`,`--color-emerald-50:#ecfdf5;--color-emerald-100:#d1fae5;--color-emerald-200:#a7f3d0;--color-emerald-300:#6ee7b7;--color-emerald-400:#34d399;--color-emerald-500:#10b981;--color-emerald-600:#059669;--color-emerald-700:#047857;--color-emerald-800:#065f46;--color-emerald-900:#064e3b;--color-emerald-950:#022c22;`,`--color-teal-50:#f0fdfa;--color-teal-100:#ccfbf1;--color-teal-200:#99f6e4;--color-teal-300:#5eead4;--color-teal-400:#2dd4bf;--color-teal-500:#14b8a6;--color-teal-600:#0d9488;--color-teal-700:#0f766e;--color-teal-800:#115e59;--color-teal-900:#134e4a;--color-teal-950:#042f2e;`,`--color-cyan-50:#ecfeff;--color-cyan-100:#cffafe;--color-cyan-200:#a5f3fc;--color-cyan-300:#67e8f9;--color-cyan-400:#22d3ee;--color-cyan-500:#06b6d4;--color-cyan-600:#0891b2;--color-cyan-700:#0e7490;--color-cyan-800:#155e75;--color-cyan-900:#164e63;--color-cyan-950:#083344;`,`--color-sky-50:#f0f9ff;--color-sky-100:#e0f2fe;--color-sky-200:#bae6fd;--color-sky-300:#7dd3fc;--color-sky-400:#38bdf8;--color-sky-500:#0ea5e9;--color-sky-600:#0284c7;--color-sky-700:#0369a1;--color-sky-800:#075985;--color-sky-900:#0c4a6e;--color-sky-950:#082f49;`,`--color-blue-50:#eff6ff;--color-blue-100:#dbeafe;--color-blue-200:#bfdbfe;--color-blue-300:#93c5fd;--color-blue-400:#60a5fa;--color-blue-500:#3b82f6;--color-blue-600:#2563eb;--color-blue-700:#1d4ed8;--color-blue-800:#1e40af;--color-blue-900:#1e3a8a;--color-blue-950:#172554;`,`--color-indigo-50:#eef2ff;--color-indigo-100:#e0e7ff;--color-indigo-200:#c7d2fe;--color-indigo-300:#a5b4fc;--color-indigo-400:#818cf8;--color-indigo-500:#6366f1;--color-indigo-600:#4f46e5;--color-indigo-700:#4338ca;--color-indigo-800:#3730a3;--color-indigo-900:#312e81;--color-indigo-950:#1e1b4b;`,`--color-violet-50:#f5f3ff;--color-violet-100:#ede9fe;--color-violet-200:#ddd6fe;--color-violet-300:#c4b5fd;--color-violet-400:#a78bfa;--color-violet-500:#8b5cf6;--color-violet-600:#7c3aed;--color-violet-700:#6d28d9;--color-violet-800:#5b21b6;--color-violet-900:#4c1d95;--color-violet-950:#2e1065;`,`--color-purple-50:#faf5ff;--color-purple-100:#f3e8ff;--color-purple-200:#e9d5ff;--color-purple-300:#d8b4fe;--color-purple-400:#c084fc;--color-purple-500:#a855f7;--color-purple-600:#9333ea;--color-purple-700:#7e22ce;--color-purple-800:#6b21a8;--color-purple-900:#581c87;--color-purple-950:#3b0764;`,`--color-fuchsia-50:#fdf4ff;--color-fuchsia-100:#fae8ff;--color-fuchsia-200:#f5d0fe;--color-fuchsia-300:#f0abfc;--color-fuchsia-400:#e879f9;--color-fuchsia-500:#d946ef;--color-fuchsia-600:#c026d3;--color-fuchsia-700:#a21caf;--color-fuchsia-800:#86198f;--color-fuchsia-900:#701a75;--color-fuchsia-950:#4a044e;`,`--color-pink-50:#fdf2f8;--color-pink-100:#fce7f3;--color-pink-200:#fbcfe8;--color-pink-300:#f9a8d4;--color-pink-400:#f472b6;--color-pink-500:#ec4899;--color-pink-600:#db2777;--color-pink-700:#be185d;--color-pink-800:#9d174d;--color-pink-900:#831843;--color-pink-950:#500724;`,`--color-rose-50:#fff1f2;--color-rose-100:#ffe4e6;--color-rose-200:#fecdd3;--color-rose-300:#fda4af;--color-rose-400:#fb7185;--color-rose-500:#f43f5e;--color-rose-600:#e11d48;--color-rose-700:#be123c;--color-rose-800:#9f1239;--color-rose-900:#881337;--color-rose-950:#4c0519;`,`--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";`,`--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;`,`--text-xs--line-height:1rem;--text-sm--line-height:1.25rem;--text-base--line-height:1.5rem;--text-lg--line-height:1.75rem;`,`--text-xl--line-height:1.75rem;--text-2xl--line-height:2rem;--text-3xl--line-height:2.25rem;--text-4xl--line-height:2.5rem;`,`--shadow-sm:0 1px 2px 0 rgb(0 0 0 / 0.05);--radius-sm:0.125rem;--blur-sm:4px;`,`}`,`body{line-height:inherit}`,`*,::after,::before,::backdrop,::file-selector-button{border-color:var(--color-gray-200,currentColor)}`,`input::placeholder,textarea::placeholder{color:var(--color-gray-400)}`,`button:not(:disabled),[role="button"]:not(:disabled){cursor:pointer}`].join(`
|
|
3
3
|
`),E=`default-src 'none'; script-src 'unsafe-inline' data:; img-src data:; media-src data:; font-src data:; style-src 'unsafe-inline' data:; form-action 'none'; base-uri 'none'`,ue=`${E}; frame-src 'none'`,D=`allow-scripts allow-popups allow-popups-to-escape-sandbox`,O=`clipboard-write`,k=`data:text/javascript,export%20default%20globalThis.mermaid`;function A(e){return/\.html?$/i.test(e)}var j=/^(?:https?:|mailto:)/i,M=/^data:/i,N=`http://www.w3.org/1999/xlink`,P=/^(?:[a-z][a-z\d+.-]*:|\/\/)/i,F=/url\(\s*(['"]?)([^'")]*)\1\s*\)|@import\s+(['"])([^'"]+)\3/gi,I=[`src`,`href`,`xlink:href`,`poster`,`background`],L=/(?:^|,)\s*(data:\S+|[^,\s]+)/gi,R=/\b(?:preconnect|dns-prefetch|prefetch|preload|modulepreload|prerender)\b/i;function z(e,t){let n=e.trim();!n||n.startsWith(`#`)||M.test(n)||(P.test(n)?t.remote++:t.relative++)}function B(e,t){for(let n of e.matchAll(F))z(n[2]??n[4]??``,t)}function V(e,t){let n=e.createElement(`script`);return n.textContent=t.replace(/<\/script/gi,`<\\/script`),n}function H(e,t){let n=e.createElement(`style`);return n.setAttribute(`type`,`text/tailwindcss`),n.textContent=t,n}var U=`http://www.w3.org/2000/svg`;function de(e){return e.namespaceURI===U?e.getAttribute(`href`)??e.getAttributeNS(N,`href`):e.getAttribute(`src`)}function fe(e,t,n,r){let i=r===void 0?[]:[H(e,r),V(e,ce)],a=V(e,n),o=t.hasAttribute(`defer`)||t.hasAttribute(`async`)||t.getAttribute(`type`)===`module`;o&&e.body.append(a),t.replaceWith(...i,...o?[]:[a])}function W(e,t,n){let r=new Set,i=new Set;for(let a of[...e.querySelectorAll(`script`)]){let o=de(a);if(o!==null&&M.test(o.trim()))continue;if(o===null){if(a.getAttribute(`type`)===`module`)for(let e of(a.textContent??``).matchAll(S))i.add(e[2]);continue}let s=C(o),c=s===`tailwind-v3`?`tailwind`:s,l=c?n[c]:void 0;if(!c||l===void 0||s===`tailwind-v3`&&n[`tailwind-v3`]===void 0){t.scripts++,a.remove();continue}if(r.has(c)){a.remove();continue}r.add(c),fe(e,a,l,s===`tailwind-v3`?n[`tailwind-v3`]:void 0)}if(!i.size)return;if(n.mermaid===void 0){t.scripts+=i.size;return}let a=e.createElement(`script`);a.setAttribute(`type`,`importmap`),a.textContent=JSON.stringify({imports:Object.fromEntries([...i].map(e=>[e,k]))}),e.head.prepend(a,...r.has(`mermaid`)?[]:[V(e,n.mermaid)])}function pe(e,t,n){let r=t=>{let n=[...e.querySelectorAll(t)];return n.forEach(e=>e.remove()),n.length};W(e,t,n),t.embeds=r(`iframe, frame, frameset, object, embed, portal`),r(`base, meta[http-equiv]`);for(let t of e.querySelectorAll(`link`))R.test(t.getAttribute(`rel`)??``)&&t.remove();for(let t of e.querySelectorAll(`[ping]`))t.removeAttribute(`ping`);for(let n of e.querySelectorAll(`form`))t.forms++,n.removeAttribute(`action`);for(let t of e.querySelectorAll(`[formaction]`))t.removeAttribute(`formaction`)}function me(e,t){for(let n of e.querySelectorAll(`a, area`)){let e=n.getAttribute(`href`)??n.getAttributeNS(N,`href`);if(e===null)continue;let r=e.trim();if(r.startsWith(`#`)){n.setAttribute(`href`,`about:srcdoc${r}`),n.removeAttributeNS(N,`href`),n.removeAttribute(`target`);continue}if(j.test(r)){n.setAttribute(`target`,`_blank`),n.setAttribute(`rel`,`noopener noreferrer`);continue}P.test(r)||t.relative++,n.removeAttribute(`href`),n.removeAttributeNS(N,`href`),n.removeAttribute(`target`)}}function he(e,t){for(let n of e.querySelectorAll(`[style]`))B(n.getAttribute(`style`),t);for(let n of e.querySelectorAll(`style`))/^(?:text\/css)?$/i.test(n.getAttribute(`type`)?.trim()??``)&&B(n.textContent??``,t);for(let n of e.querySelectorAll(`link[href]`))z(n.getAttribute(`href`),t);for(let n of e.querySelectorAll(`img, source, video, audio, track, input, image, use, body, table, td`)){for(let e of I){let r=n.getAttribute(e);r!==null&&z(r,t)}for(let e of(n.getAttribute(`srcset`)??``).matchAll(L))z(e[1],t)}}function ge(e,t={}){let n=new DOMParser().parseFromString(e,`text/html`),r={scripts:0,remote:0,relative:0,forms:0,embeds:0};pe(n,r,t),me(n,r),he(n,r);let i=n.createElement(`meta`);i.setAttribute(`http-equiv`,`Content-Security-Policy`),i.setAttribute(`content`,E);let a=n.createElement(`meta`);return a.setAttribute(`name`,`referrer`),a.setAttribute(`content`,`no-referrer`),n.head.prepend(i,a),{srcdoc:`<!DOCTYPE html>${n.documentElement.outerHTML}`,blocked:r}}var G=e=>e.replace(/&/g,`&`).replace(/"/g,`"`);function _e(e,t){return`<!DOCTYPE html><html><head><meta http-equiv="Content-Security-Policy" content="${ue}"><meta name="referrer" content="no-referrer"><style>html,body{margin:0;height:100%;overflow:hidden}iframe{display:block;border:0;width:100%;height:100%}</style></head><body><iframe title="${G(t)}" sandbox="${D}" allow="${O}" referrerpolicy="no-referrer" srcdoc="${G(e)}"></iframe></body></html>`}var K=(0,v.createContext)(null),ve=/^[0-9a-f-]{36}$/i,ye=/^(\/p\/[^/?#]+\/tasks\/[^/?#]+)\/files\?(artifact=[^&#]*)$/;function q(e){let t=new URLSearchParams(e);return[...t.keys()].length===1&&ve.test(t.get(`artifact`)??``)}function be(e,t,n){if(e.startsWith(`${t}?artifact=`))return q(e.slice(t.length+1))?n+e.slice(t.length):null;let r=ye.exec(e);return r&&q(r[2])?`${r[1]}/report?${r[2]}`:void 0}var xe=/^\/(?:api|p|tasks|new|settings|skills|workflows|git|github|inbox|automations)(?:\/|[?#]|$)/;function Se(e,t){let n=/^[a-z]:[\\/]/i.test(e),r=/^file:/i.test(e);if(!n&&/^[a-z][a-z\d+.-]*:/i.test(e)&&!r)return null;let i=r?e:decodeURIComponent(e);if(/[\u0000-\u001f]/.test(i))return null;if(!t||i.startsWith(`/`)||n||r)return i;let a=t.replaceAll(`\\`,`/`);return a.slice(0,a.lastIndexOf(`/`)+1)+i}function J(e,t){if(!e||/[\u0000-\u001f]/.test(e)||e.startsWith(`#`)||e.startsWith(`//`))return null;let n=e.indexOf(`#`),r=n<0?e:e.slice(0,n),i=n<0?``:e.slice(n),a=t.projectId?`/p/${encodeURIComponent(t.projectId)}`:``,o=`/tasks/${encodeURIComponent(t.runId)}/files`,s=`/tasks/${encodeURIComponent(t.runId)}/report`,c=be(r,o,a+s);if(c!==void 0)return c===null?null:c+i;if(xe.test(r))return null;let l=Se(r,t.basePath);return l===null?null:`${a}${A(l)?s:o}?path=${encodeURIComponent(l)}${i}`}var Y=`text-accent-text underline underline-offset-2`;function Ce({href:e,children:t,internal:n,...r}){let[i,o]=(0,v.useState)(!1),s=a();return e?n?s?(0,y.jsx)(we,{...r,href:e,children:t}):(0,y.jsx)(`a`,{...r,href:e,"data-streamdown":`link`,className:Y,children:t}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`a`,{...r,href:e,"data-streamdown":`link`,className:`cursor-pointer ${Y}`,onClick:e=>{e.preventDefault(),o(!0)},children:t}),(0,y.jsx)(b,{isOpen:i,url:e,onClose:()=>o(!1),onConfirm:()=>{window.open(e,`_blank`,`noreferrer`),o(!1)}})]}):(0,y.jsx)(`span`,{children:t})}function we({href:e,children:t,...n}){let r=s(),i=o();return(0,y.jsx)(`a`,{...n,href:e,"data-streamdown":`link`,className:Y,onClick:t=>X(t,r,e,i),children:t})}function X(e,t,n,r){e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),t(n,{state:{readerFrom:r.pathname+r.search,filesRestoreKey:r.key}}))}var Te={name:`shiki`,type:`code-highlighter`,getThemes:()=>[_,_],getSupportedLanguages:()=>g(),supportsLanguage:e=>g().includes(String(e).toLowerCase()),highlight:({code:e,language:t},n)=>re(e,String(t))||(ie(e,String(t)).then(e=>n?.(e)),null)};function Ee(){let e=t=>{if(!t.children)return;let n=[];for(let r of t.children)if(r.type===`text`&&r.value?.includes(`
|
|
4
4
|
`)){let e=r.value.split(/\r?\n/);e.forEach((t,r)=>{r>0&&!(t===``&&r===e.length-1)&&n.push({type:`break`}),t&&n.push({type:`text`,value:t})})}else e(r),n.push(r);t.children=n};return e}var Z=[...Object.values(m),Ee],De=[`p`,`strong`,`em`,`del`,`code`,`a`],Oe={p:`span`,a:`span`},ke={enabled:!0,renderModal:e=>(0,y.jsx)(b,{...e})},Ae=`https://refused.invalid/`,Q=new WeakSet;function $(e){let t=e.position?.start.offset,n=e.position?.end.offset;return t===void 0||n===void 0?null:`${t}:${n}`}function je(e){return(t,n)=>{let r=new Set,i=new Map,a=t=>{if((t.type===`link`||t.type===`definition`)&&t.url){let n=J(t.url,e);if(t.type===`definition`&&t.identifier&&!i.has(t.identifier)&&i.set(t.identifier,n!==null),n){t.url=n;let e=$(t);t.type===`link`&&e!==null&&r.add(e)}}t.children?.forEach(a)};a(t);let o=e=>{let t=$(e);e.type===`linkReference`&&e.identifier&&i.get(e.identifier)&&t!==null&&r.add(t),e.children?.forEach(o)};o(t),n.data.taskLinks=r}}function Me(){return(e,t)=>{let n=e=>{let r=$(e);e.tagName===`a`&&r!==null&&t.data.taskLinks instanceof Set&&t.data.taskLinks.has(r)&&Q.add(e),e.children?.forEach(n)};n(e)}}var Ne=0,Pe=(0,v.memo)(function({children:e,breaks:t=!1,inline:n=!1,document:i=!1,imageSrc:a}){let o=(0,v.useContext)(K),s=(0,v.useMemo)(()=>{let e={instance:++Ne},n=new Set;function r(){let e=t=>{if(t.type===`image`&&t.url&&a){let e=a(t.url);t.url=e?new URL(e,window.location.href).href:Ae,e&&n.add(t.url)}t.children?.forEach(e)};return e}let s=o?[[je,o]]:[],c=i&&a?[[r,e]]:[];return{remark:[...t?Z:Object.values(m),...s,...c],components:{...o||i?{a:({href:e,children:t,node:n})=>i&&!o&&!/^(?:https?:|mailto:|#)/i.test(e??``)?(0,y.jsx)(`span`,{children:t}):(0,y.jsx)(Ce,{href:e,internal:n!==void 0&&Q.has(n),children:t})}:{},...i?{img:({src:e,alt:t})=>typeof e==`string`&&n.has(e)?(0,y.jsx)(`img`,{src:e,alt:t??``,loading:`lazy`}):(0,y.jsxs)(`span`,{className:`text-muted-foreground`,children:[`[Image: `,t||`embedded image`,`]`]})}:{}}}},[o,t,i,a]);return(0,y.jsx)(p,{className:n?`thread-markdown thread-markdown-inline`:`thread-markdown`,plugins:{code:Te},shikiTheme:[_,_],...r({rehypePlugins:o?[...Object.values(h),Me]:void 0,remarkPlugins:o||i&&a?s.remark:t?Z:void 0,allowedElements:n?De:void 0,unwrapDisallowed:n||void 0,components:n?Oe:o||i?s.components:void 0}),linkSafety:ke,controls:{code:{copy:!0,download:!1},table:!1,mermaid:!1},lineNumbers:!1,children:e})});export{O as a,ge as c,oe as d,J as i,_e as l,X as n,D as o,K as r,A as s,Pe as t,w as u};
|
package/web/dist/assets/{notifications-section-DD21Sd79.js → notifications-section-DuSzYLwP.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Yt as r,ci as i}from"./project-scope-context-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Yt as r,ci as i}from"./project-scope-context-Dgq8_2JZ.js";import{Nt as a,jt as o}from"./queries-yuG-mM6_.js";import{n as s}from"./toaster-Bo5vCbz-.js";import{t as c}from"./switch-Bv2Zf1uU.js";import{ct as l,lt as u}from"./index-DXIRYobS.js";var d=e(t(),1),f=n();function p(){let e=i(),t=o(),[n,p]=d.useState(!1),[m,h]=d.useState(u),g=t.data;d.useEffect(()=>{g!==void 0&&p(l(g.notifications).enabled)},[g]);let _=d.useCallback(t=>{p(t),r({notifications:{enabled:t}}).then(t=>e.setQueryData(a.uiState,t)).catch(t=>{s(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:a.uiState})})},[e]),v=d.useCallback(e=>{if(!e){_(!1);return}if(u()!=="default"){_(!0);return}_(!0),Notification.requestPermission().then(e=>h(e)).catch(()=>h(u()))},[_]),y=m===`unsupported`;return(0,f.jsx)(`div`,{"data-slot":`notifications-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-7 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:(0,f.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,f.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:(0,f.jsx)(`label`,{htmlFor:`notifications-enabled`,children:`Notify when an agent needs you`})}),(0,f.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`A browser notification when a task starts waiting, asks for review, or fails — only while this tab is in the background. Off by default.`})]}),(0,f.jsx)(c,{id:`notifications-enabled`,"data-slot":`notifications-toggle`,checked:n,disabled:y,onCheckedChange:v})]}),y?null:(0,f.jsxs)(`p`,{"data-slot":`notifications-permission`,"data-permission":m,className:`mt-4 text-[13px] text-muted-foreground`,children:[`Browser permission · `,m===`granted`?`Allowed`:m===`denied`?`Blocked`:`Not requested`]}),(0,f.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Permission is requested only when you enable notifications.`}),y?(0,f.jsx)(`p`,{"data-slot":`notifications-unsupported`,className:`text-[13px] text-muted-foreground`,children:`This browser does not support notifications, so the toggle is unavailable here.`}):null,!y&&n&&m===`denied`?(0,f.jsxs)(`div`,{"data-slot":`notifications-denied`,className:`mt-5 flex flex-col gap-2`,children:[(0,f.jsx)(`h3`,{className:`text-sm`,children:`Allow notifications in your browser`}),(0,f.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`This browser is blocking notifications. Your preference is saved. Allow notifications in the browser’s site settings to receive them.`}),(0,f.jsx)(`p`,{className:`settings-readout`,children:`Notifications are blocked for this site.`})]}):null]})})}export{p as NotificationsSection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t,s as n}from"./runners-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t,s as n}from"./runners-CDw7wLfd.js";import{t as r}from"./createLucideIcon-BHp8sXmF.js";import{t as i}from"./bot-TkDIw4y-.js";import{t as a}from"./external-link-BE6y205O.js";import{t as o}from"./folder-o-AvL3y3.js";import{n as s,t as c}from"./smartphone-Lr8Ug2z_.js";import{t as l}from"./square-terminal-B6RYYieR.js";import{t as u}from"./button-BQ2y4XRB.js";import{i as d,l as f,p,r as m,t as h}from"./dropdown-menu-4e2iKSMT.js";import{t as g}from"./own-lookup-DS54wXvD.js";var _=r(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),v=r(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),y=r(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),b=r(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),x=r(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),S=r(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),C=r(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),w=r(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),T=r(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),E=r(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),D=r(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),O=r(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),k=r(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),A=r(`waves-horizontal`,[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]]),j=r(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),M=e(),N={folder:o,terminal:l,vscode:y,cursor:E,zed:j,windsurf:A,sublime:S,idea:x,pycharm:T,webstorm:s,goland:O,rubymine:C,phpstorm:v,clion:b,rider:_,"android-studio":c,xcode:w,warp:D,bot:i,sparkles:k};function P(e,n){let r=F(e.id);return g(N,r===void 0?e.icon:t(n,r)?.icon)??a}function F(e){let t=e.startsWith(`cli:`)?e.slice(4):``;return t===``?void 0:t}function I({choices:e,onPick:t,label:r=`Open in…`,title:i,triggerVariant:o=`ghost`,disabled:s=!1,leading:c,trailing:l,slot:g,className:_}){let v=n().data;return(0,M.jsxs)(h,{children:[(0,M.jsx)(p,{asChild:!0,children:(0,M.jsxs)(u,{variant:o,size:`sm`,title:i,disabled:s,"data-slot":g,className:_,children:[(0,M.jsx)(a,{"aria-hidden":`true`}),r]})}),(0,M.jsxs)(m,{align:`end`,children:[c,c&&e.length>0?(0,M.jsx)(f,{}):null,e.map(({target:e,suffix:n,title:r})=>{let i=P(e,v);return(0,M.jsxs)(d,{"data-target":e.id,title:r,onSelect:()=>t(e.id),children:[(0,M.jsx)(i,{"aria-hidden":`true`}),e.label,n??``]},e.id)}),l]})]})}export{F as n,P as r,I as t};
|