gitifact 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/README.md +2 -2
  2. package/dist/browser/assets/{Markdown-C8C4nHPG.js → Markdown-CqZ4w2H_.js} +1 -1
  3. package/dist/browser/assets/{MetadataListItem-CcPRe-aG.js → MetadataListItem-B6xUZEC3.js} +1 -1
  4. package/dist/browser/assets/{Table-B_rvjexw.js → Table-DDKWqCdD.js} +1 -1
  5. package/dist/browser/assets/{about-D6bBZN8p.js → about-Chl-XBQg.js} +1 -1
  6. package/dist/browser/assets/{activity-B7x648pR.js → activity-F2_AhgBS.js} +1 -1
  7. package/dist/browser/assets/{changelog-DaxXahXm.js → changelog-DrJfyXDZ.js} +1 -1
  8. package/dist/browser/assets/{contributors._email-BZevZqRL.js → contributors._email-CINLTSX2.js} +1 -1
  9. package/dist/browser/assets/{contributors.index-BgA9LkC0.js → contributors.index-ChB89wcL.js} +1 -1
  10. package/dist/browser/assets/{document-CFtIdIPN.js → document-Jy6Buepz.js} +1 -1
  11. package/dist/browser/assets/{features._featureId-BBYORTqC.js → features._featureId-FySsJ2tl.js} +1 -1
  12. package/dist/browser/assets/{features.index-DuwIen6d.js → features.index-DWfPG8WV.js} +1 -1
  13. package/dist/browser/assets/{git-DVoIz_Mx.js → git-AnH-8SBT.js} +1 -1
  14. package/dist/browser/assets/{index-BP3PrawI.js → index-DXK4gUTr.js} +3 -3
  15. package/dist/browser/assets/{page-header-Zwbd52Q5.js → page-header-N7A_M6-B.js} +2 -2
  16. package/dist/browser/assets/{product-euizlTTB.js → product-BKOKDrzZ.js} +1 -1
  17. package/dist/browser/assets/{product.index-B4D5SxOO.js → product.index-BohDJK9z.js} +1 -1
  18. package/dist/browser/assets/{request-state-Dz-oeAkg.js → request-state-CO3OLoay.js} +1 -1
  19. package/dist/browser/assets/{requirements-wk9Joy7M.js → requirements-Dh2NEqNw.js} +1 -1
  20. package/dist/browser/assets/{settings-DwA6H4Ax.js → settings-DylPhHVJ.js} +1 -1
  21. package/dist/browser/assets/{wiki-DkAnuzON.js → wiki-DYxjYiPl.js} +1 -1
  22. package/dist/browser/index.html +8 -8
  23. package/dist/i18n/ko/changelog.md +8 -0
  24. package/dist/main.js +130 -74
  25. package/package.json +1 -1
@@ -12,7 +12,7 @@ Gitifact CLI는 사용자가 문서 형식이나 복잡한 규칙을 고민하
12
12
  아래 프롬프트를 프로젝트에서 사용하는 에이전트에게 전달하세요.
13
13
 
14
14
  \`\`\`text
15
- 이 프로젝트에 gitifact가 없으면 npm install -g gitifact@latest로 설치하고 gitifact init을 실행하세요.
15
+ npm install -g gitifact@latest로 gitifact를 설치하세요. 이미 설치돼 있어도 최신 버전으로 올리기 위해 실행합니다. 그다음 이 프로젝트에서 gitifact init을 실행하세요.
16
16
  init이 AGENTS.md 등에 쓴 GITIFACT 블록을 읽고 이번 세션부터 따르세요.
17
17
  \`\`\`
18
18
 
@@ -121,4 +121,4 @@ Markdown 요구사항·설계와 커밋 시점의 변경 이유를 Git에 연결
121
121
 
122
122
  `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=$r,c=!R.jitless,l=c&&ei.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?xs([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function ws(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=>!F(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=>Ci(e,r,qi())))}),t)}var Ts=L(`$ZodUnion`,(e,t)=>{B.init(e,t),I(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),I(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),I(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),I(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Ur(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=>ws(t,r,e,i)):ws(o,r,e,i)}});function Es(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Ds=L(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Ts.init(e,t);let n=e._zod.parse;I(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||j(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Gr(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Vr(()=>Es(t));e._zod.parse=(i,a)=>{let o=i.value;if(!$r(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),Os=L(`$ZodIntersection`,(e,t)=>{B.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])=>As(e,t,n)):As(e,i,a)}});function ks(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ti(e)&&ti(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=ks(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=ks(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 As(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=ks(t.value,n.value);if(!c.valid){if(F(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var js=L(`$ZodEnum`,(e,t)=>{B.init(e,t);let n=Lr(t.entries),r=new Set(n);e._zod.values=r,I(e,`pattern`,e=>{let t=Lr(e.def.entries).filter(e=>ri.has(typeof e));return RegExp(t.length?`^(${t.map(e=>ii(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Ms=L(`$ZodLiteral`,(e,t)=>{B.init(e,t);let n=new Set(t.values);e._zod.values=n,I(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?ii(e):e?ii(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Ns=L(`$ZodTransform`,(e,t)=>{B.init(e,t),e._zod.optin=`optional`,R.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ki(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Gi;return n.value=i,n}});function Ps(e,t){return e.value=t.issues.length?void 0:t.value,e}var Fs=L(`$ZodOptional`,(e,t)=>{B.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,I(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),I(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ur(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Ps(e,t)):Ps(e,r)}return t.innerType._zod.run(e,n)}}),Is=L(`$ZodExactOptional`,(e,t)=>{Fs.init(e,t),I(e,`values`,e=>e.def.innerType._zod.values),I(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ls=L(`$ZodNullable`,(e,t)=>{B.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin),I(e,`optout`,e=>e.def.innerType._zod.optout),I(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ur(t.source)}|null)$`):void 0}),I(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Rs=L(`$ZodDefault`,(e,t)=>{B.init(e,t),e._zod.optin=`defaulted`,I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>zs(e,t)):zs(r,t)}});function zs(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Bs=L(`$ZodPrefault`,(e,t)=>{B.init(e,t),e._zod.optin=`defaulted`,I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Vs=L(`$ZodNonOptional`,(e,t)=>{B.init(e,t),I(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Hs(t,e)):Hs(i,e)}});function Hs(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Us(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Ci(e,r,qi()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Ws=L(`$ZodCatch`,(e,t)=>{B.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),I(e,`optout`,e=>e.def.innerType._zod.optout),I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Us(e,r,t,n)):Us(e,r,t,n)}}),Gs=L(`$ZodPipe`,(e,t)=>{B.init(e,t),I(e,`values`,e=>e.def.in._zod.values),I(e,`optin`,e=>e.def.in._zod.optin),I(e,`optout`,e=>e.def.out._zod.optout),I(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ks(e,t.in,n)):Ks(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ks(e,t.out,n)):Ks(r,t.out,n)}});function Ks(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var qs=L(`$ZodReadonly`,(e,t)=>{B.init(e,t),I(e,`propValues`,e=>e.def.innerType._zod.propValues),I(e,`values`,e=>e.def.innerType._zod.values),I(e,`optin`,e=>e.def.innerType?._zod?.optin),I(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Js):Js(r)}});function Js(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Ys=L(`$ZodCustom`,(e,t)=>{z.init(e,t),B.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=>Xs(t,n,r,e));Xs(i,n,r,e)}});function Xs(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(Oi(e))}}var Zs=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Qs=`~memo`,$s=[];function ec(e){return typeof e==`object`&&!!e}function tc(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var nc=new WeakMap,rc=0,ic=1,ac=2;function oc(e,t,n){let r=nc.get(e);if(r!==void 0)return r?ac:rc;if(t.has(e))return ac;t.add(e);let i=rc,a=e=>{if(i!==ac&&e?._zod){let r=oc(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=rc;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?ic:o.value?._zod?oc(o.value,t,n):rc;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Gr(c);s(e?o(e,!0):ic),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?oc(r,t,!1):ic);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),sc(e,i)}function sc(e,t){return t!==ic&&nc.set(e,t===ac),t}function cc(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var lc,uc=[],dc={alloc(e,t,n){let r=lc;if(!r)return n;lc=void 0;let i={value:n,issues:null};return r.set(t.value,i),uc.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&pc(n,e.value))throw new Zs;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=oc(e,new Set,!1);if(i===rc)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===ac||r?n=!0:r=!0}let l=s.value;if(!ec(l))return t(s,c);let u=c[Qs];u||(u={buckets:new WeakMap,backEdges:void 0},c[Qs]=u);let d;i===c?d=a:(d=cc(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...tc(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;lc=d;let p=uc.length,m=t(s,c);lc=void 0;let h=uc.length>p?uc.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?tc(e.issues):$s),e)):(h&&(h.issues=m.issues.length?tc(m.issues):$s),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function fc(){return dc}function pc(e,t){let n=e[Qs]?.backEdges;return n!==void 0&&ec(t)&&n.has(t)}var mc=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Di(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${oi(e.values[0])}`:`Invalid option: expected one of ${Rr(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Rr(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function hc(){return{localeError:mc()}}var gc,_c=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 vc(){return new _c}(gc=globalThis).__zod_globalRegistry??(gc.__zod_globalRegistry=vc());var yc=globalThis.__zod_globalRegistry;function bc(e){return e.checks&&=[...e.checks],e}function xc(e,t){return new e(bc({type:`string`,...P(t)}))}function Sc(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...P(t)})}function Cc(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...P(t)})}function wc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...P(t)})}function Tc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...P(t)})}function Ec(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...P(t)})}function Dc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...P(t)})}function Oc(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...P(t)})}function kc(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...P(t)})}function Ac(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...P(t)})}function jc(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...P(t)})}function Mc(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...P(t)})}function Nc(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...P(t)})}function Pc(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...P(t)})}function Fc(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...P(t)})}function Ic(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...P(t)})}function Lc(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...P(t)})}function Rc(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...P(t)})}function zc(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...P(t)})}function Bc(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...P(t)})}function Vc(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...P(t)})}function Hc(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...P(t)})}function Uc(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...P(t)})}function Wc(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...P(t)})}function Gc(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...P(t)})}function Kc(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...P(t)})}function qc(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...P(t)})}function Jc(e,t){return new e(bc({type:`number`,checks:[],...P(t)}))}function Yc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...P(t)})}function Xc(e,t){return new e({type:`boolean`,...P(t)})}function Zc(e,t){return new e({type:`null`,...P(t)})}function Qc(e){return new e({type:`unknown`})}function $c(e,t){return new e({type:`never`,...P(t)})}function el(e,t){return new io({check:`less_than`,...P(t),value:e,inclusive:!1})}function tl(e,t){return new io({check:`less_than`,...P(t),value:e,inclusive:!0})}function nl(e,t){return new ao({check:`greater_than`,...P(t),value:e,inclusive:!1})}function rl(e,t){return new ao({check:`greater_than`,...P(t),value:e,inclusive:!0})}function il(e,t){return new oo({check:`multiple_of`,...P(t),value:e})}function al(e,t){return new co({check:`max_length`,...P(t),maximum:e})}function ol(e,t){return new lo({check:`min_length`,...P(t),minimum:e})}function sl(e,t){return new uo({check:`length_equals`,...P(t),length:e})}function cl(e,t){return new po({check:`string_format`,format:`regex`,...P(t),pattern:e})}function ll(e){return new mo({check:`string_format`,format:`lowercase`,...P(e)})}function ul(e){return new ho({check:`string_format`,format:`uppercase`,...P(e)})}function dl(e,t){return new go({check:`string_format`,format:`includes`,...P(t),includes:e})}function fl(e,t){return new _o({check:`string_format`,format:`starts_with`,...P(t),prefix:e})}function pl(e,t){return new vo({check:`string_format`,format:`ends_with`,...P(t),suffix:e})}function ml(e){return new yo({check:`overwrite`,tx:e})}function hl(e){return ml(t=>t.normalize(e))}function gl(){return ml(e=>e.trim())}function _l(){return ml(e=>e.toLowerCase())}function vl(){return ml(e=>e.toUpperCase())}function yl(){return ml(e=>Zr(e))}function bl(e,t,n){return new e({type:`array`,element:t,...P(n)})}function xl(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...P(n)})}function Sl(e,t){let n=Cl(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Oi(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Oi(r))}},e(t.value,t)),t);return n}function Cl(e,t){let n=new z({check:`custom`,...P(t)});return n._zod.check=e,n}function wl(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&j(e,t,n[t]);return e}function Tl(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??yc,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function El(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function H(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,H(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&wl(o.schema,c),t.io===`input`&&U(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 Dl(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ol(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Dl(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Dl(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>
123
123
 
124
- 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}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function kl(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;kl(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Al=new Set([`type`,`properties`,`required`,`additionalProperties`]),jl=[`oneOf`,`anyOf`];function Ml(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Nl(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Al.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ml(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}j(n,r,e.length===1?e[0]:Nl(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ml(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Pl(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Al)if(t in e)return;let n=t.filter(e=>jl.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Nl(t);else{let e=n[0],i=jl.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Nl([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,wl(e,r))}function Fl(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)):wl(i,s),wl(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())kl(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Pl(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}wl(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,j(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ll(t,`input`,e.processors),output:Ll(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function U(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 U(r.element,n);if(r.type===`set`)return U(r.valueType,n);if(r.type===`lazy`)return U(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return U(r.innerType,n);if(r.type===`intersection`)return U(r.left,n)||U(r.right,n);if(r.type===`record`||r.type===`map`)return U(r.keyType,n)||U(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:U(r.in,n)||U(r.out,n);if(r.type===`object`){for(let e in r.shape)if(U(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(U(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(U(e,n))return!0;return!!(r.rest&&U(r.rest,n))}return!1}var Il=(e,t={})=>n=>{let r=Tl({...n,processors:t});return H(e,r),Ol(r,e),Fl(r,e)},Ll=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Tl({...i??{},target:a,io:t,processors:n});return H(e,o),Ol(o,e),Fl(o,e)},Rl=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},zl=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Bl=(e,t)=>{Rl(e,`minimum`,t),zl(e,`maximum`,t)},Vl=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Hl=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Ul=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Wl=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Gl=(e,t)=>Rl(e,`minimum`,t.minimum),Kl=(e,t)=>zl(e,`maximum`,t.maximum),ql=e=>(t,n)=>{Wl(t,n.format);let[r,i]=e[n.format];Rl(t,`minimum`,r),zl(t,`maximum`,i)},Jl={greater_than:(e,t)=>Rl(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>zl(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Vl(e,t.value),number_format:ql(ci),bigint_format:ql(li),min_length:Gl,max_length:Kl,length_equals:(e,t)=>Bl(e,t.length),min_size:Gl,max_size:Kl,size_equals:(e,t)=>Bl(e,t.size),string_format:(e,t)=>{Wl(e,t.format),t.pattern&&Hl(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Ul(e,t.mime)};function W(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Jl[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Rl(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Rl(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&zl(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&zl(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Vl(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Ul(t,i.mime);for(let e of i.patterns??[])Hl(t,e);return t}var Yl={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Xl=new Map([[ns,Ba],[is,Va]]),Zl=e=>Xl.get(e)??e,Ql=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=W(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Yl[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Zl);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}))])}},$l=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=W(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):El(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},eu=(e,t,n,r)=>{n.type=`boolean`},tu=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},nu=(e,t,n,r)=>{n.not={}},ru=(e,t,n,r)=>{let i=e._zod.def,a=Lr(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},iu=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(El(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(El(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},au=(e,t,n,r)=>{El(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},ou=(e,t,n,r)=>{El(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},su=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=W(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=H(a.element,t,{...r,path:[...r.path,`items`]})};function cu(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?cu(t.out):t.type===`catch`?cu(t.innerType):e._zod.optin}var lu=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&El(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)j(i.properties,e,H(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?cu(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=H(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},uu=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>H(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},du=(e,t,n,r)=>{let i=e._zod.def,a=H(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=H(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},fu=(e,t,n,r)=>{let i=e._zod.def,a=H(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`}]},pu=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},mu=Symbol();function hu(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(El(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),mu):JSON.parse(o)}var gu=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=hu(i.defaultValue,e,t,n,r);o!==mu&&(n.default=o)},_u=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=hu(i.defaultValue,e,t,n,r);o!==mu&&(n._prefault=o)},vu=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{El(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},yu=(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;H(o,t,r);let s=t.seen.get(e);s.ref=o},bu=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},xu=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Su=new WeakSet([Object.prototype,Error.prototype]);function Cu(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var G=L(`ZodError`,(e,t)=>{ea.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Su.has(n)||(Su.add(n),Cu(n,`format`,e=>t=>ra(e,t)),Cu(n,`flatten`,e=>t=>na(e,t)),Cu(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,zr,2)}),Cu(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,zr,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),wu=aa(G),Tu=oa(G),Eu=sa(G),Du=la(G),Ou=ha(G),ku=ga(G),Au=_a(G),ju=va(G),Mu=ya(G),Nu=ba(G),Pu=xa(G),Fu=Sa(G);function Iu(){R.localeError||qi(hc())}function Lu(){R.memoizer||qi({memoizer:fc()})}var K=L(`ZodType`,(e,t)=>(Iu(),B.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(N(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 ai(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check($d(e,t))},superRefine(e,t){return this.check(ef(e,t))},overwrite(e){return this.check(ml(e))},optional(){return Fd(this)},exactOptional(){return Ld(this)},nullable(){return zd(this)},nullish(){return Fd(zd(this))},nonoptional(e){return Gd(this,e)},array(){return Y(this)},or(e){return Td([this,e])},and(e){return kd(this,e)},transform(e){return Yd(this,Nd(e))},default(e){return Vd(this,e)},prefault(e){return Ud(this,e)},catch(e){return qd(this,e)},pipe(e){return Yd(this,e)},readonly(){return Zd(this)},describe(e){let t=this.clone();return yc.add(t,{description:e}),t},meta(...e){if(e.length===0)return yc.get(this);let t=this.clone();return yc.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ji(this,`~standard`,{...wo(this),jsonSchema:{input:Ll(this,`input`),output:Ll(this,`output`)}})},set"~standard"(e){Ai(this,`~standard`,e)},parse:function e(t,n){return wu(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Tu(this,t,n,{callee:e})},safeParse(e,t){return Eu(this,e,t)},async safeParseAsync(e,t){return Du(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ai(this,`spa`,e)},validate(e,t){return fa(this,e,t)},validateAsync(e,t){return ma(this,e,t)},encode:function e(t,n){return Ou(this,t,n,{callee:e})},decode:function e(t,n){return ku(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Au(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await ju(this,t,n,{callee:e})},safeEncode(e,t){return Mu(this,e,t)},safeDecode(e,t){return Nu(this,e,t)},async safeEncodeAsync(e,t){return Pu(this,e,t)},async safeDecodeAsync(e,t){return Fu(this,e,t)},toJSONSchema(e){return Il(this,{})(e)},get description(){return yc.get(this)?.description},get _def(){return this._zod.def}}),Ru=L(`_ZodString`,(e,t)=>{To.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ql(e,t,n,r)},Mi({format:e=>W(e).format??null,minLength:e=>W(e).minimum??null,maxLength:e=>W(e).maximum??null},{regex(...e){return this.check(cl(...e))},includes(...e){return this.check(dl(...e))},startsWith(...e){return this.check(fl(...e))},endsWith(...e){return this.check(pl(...e))},min(...e){return this.check(ol(...e))},max(...e){return this.check(al(...e))},length(...e){return this.check(sl(...e))},nonempty(...e){return this.check(ol(1,...e))},lowercase(e){return this.check(ll(e))},uppercase(e){return this.check(ul(e))},trim(){return this.check(gl())},normalize(...e){return this.check(hl(...e))},toLowerCase(){return this.check(_l())},toUpperCase(){return this.check(vl())},slugify(){return this.check(yl())}})),zu=L(`ZodString`,(e,t)=>{To.init(e,t),Ru.init(e,t)},{email(e){return this.check(Sc(Wu,e))},url(e){return this.check(Oc(Ju,e))},jwt(e){return this.check(Uc(ld,e))},emoji(e){return this.check(kc(Yu,e))},guid(e){return this.check(Cc(Gu,e))},uuid(e){return this.check(wc(Ku,e))},uuidv4(e){return this.check(Tc(Ku,e))},uuidv6(e){return this.check(Ec(Ku,e))},uuidv7(e){return this.check(Dc(Ku,e))},nanoid(e){return this.check(Ac(Xu,e))},cuid(e){return this.check(jc(Zu,e))},cuid2(e){return this.check(Mc(Qu,e))},ulid(e){return this.check(Nc($u,e))},base64(e){return this.check(Bc(od,e))},base64url(e){return this.check(Vc(sd,e))},xid(e){return this.check(Pc(ed,e))},ksuid(e){return this.check(Fc(td,e))},ipv4(e){return this.check(Ic(nd,e))},ipv6(e){return this.check(Lc(rd,e))},cidrv4(e){return this.check(Rc(id,e))},cidrv6(e){return this.check(zc(ad,e))},e164(e){return this.check(Hc(cd,e))},datetime(e){return this.check(Wc(Bu,e))},date(e){return this.check(Gc(Vu,e))},time(e){return this.check(Kc(Hu,e))},duration(e){return this.check(qc(Uu,e))}});function q(e){return xc(zu,e)}var J=L(`ZodStringFormat`,(e,t)=>{V.init(e,t),Ru.init(e,t)}),Bu=L(`ZodISODateTime`,(e,t)=>{Wo.init(e,t),J.init(e,t)}),Vu=L(`ZodISODate`,(e,t)=>{Go.init(e,t),J.init(e,t)}),Hu=L(`ZodISOTime`,(e,t)=>{Ko.init(e,t),J.init(e,t)}),Uu=L(`ZodISODuration`,(e,t)=>{qo.init(e,t),J.init(e,t)}),Wu=L(`ZodEmail`,(e,t)=>{Oo.init(e,t),J.init(e,t)}),Gu=L(`ZodGUID`,(e,t)=>{Eo.init(e,t),J.init(e,t)}),Ku=L(`ZodUUID`,(e,t)=>{Do.init(e,t),J.init(e,t)});function qu(e){return wc(Ku,e)}var Ju=L(`ZodURL`,(e,t)=>{Io.init(e,t),J.init(e,t)}),Yu=L(`ZodEmoji`,(e,t)=>{Lo.init(e,t),J.init(e,t)}),Xu=L(`ZodNanoID`,(e,t)=>{Ro.init(e,t),J.init(e,t)}),Zu=L(`ZodCUID`,(e,t)=>{zo.init(e,t),J.init(e,t)}),Qu=L(`ZodCUID2`,(e,t)=>{Bo.init(e,t),J.init(e,t)}),$u=L(`ZodULID`,(e,t)=>{Vo.init(e,t),J.init(e,t)}),ed=L(`ZodXID`,(e,t)=>{Ho.init(e,t),J.init(e,t)}),td=L(`ZodKSUID`,(e,t)=>{Uo.init(e,t),J.init(e,t)}),nd=L(`ZodIPv4`,(e,t)=>{Jo.init(e,t),J.init(e,t)}),rd=L(`ZodIPv6`,(e,t)=>{Zo.init(e,t),J.init(e,t)}),id=L(`ZodCIDRv4`,(e,t)=>{Qo.init(e,t),J.init(e,t)}),ad=L(`ZodCIDRv6`,(e,t)=>{es.init(e,t),J.init(e,t)}),od=L(`ZodBase64`,(e,t)=>{rs.init(e,t),J.init(e,t)}),sd=L(`ZodBase64URL`,(e,t)=>{os.init(e,t),J.init(e,t)}),cd=L(`ZodE164`,(e,t)=>{ss.init(e,t),J.init(e,t)}),ld=L(`ZodJWT`,(e,t)=>{ls.init(e,t),J.init(e,t)}),ud=L(`ZodNumber`,(e,t)=>{us.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$l(e,t,n,r),e.isFinite=!0},Mi({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=W(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=W(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=W(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>W(e).format??null},{gt(e,t){return this.check(nl(e,t))},gte(e,t){return this.check(rl(e,t))},min(e,t){return this.check(rl(e,t))},lt(e,t){return this.check(el(e,t))},lte(e,t){return this.check(tl(e,t))},max(e,t){return this.check(tl(e,t))},int(e){return this.check(pd(e))},safe(e){return this.check(pd(e))},positive(e){return this.check(nl(0,e))},nonnegative(e){return this.check(rl(0,e))},negative(e){return this.check(el(0,e))},nonpositive(e){return this.check(tl(0,e))},multipleOf(e,t){return this.check(il(e,t))},step(e,t){return this.check(il(e,t))},finite(){return this}}));function dd(e){return Jc(ud,e)}var fd=L(`ZodNumberFormat`,(e,t)=>{ds.init(e,t),ud.init(e,t)});function pd(e){return Yc(fd,e)}var md=L(`ZodBoolean`,(e,t)=>{fs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eu(e,t,n,r)});function hd(e){return Xc(md,e)}var gd=L(`ZodNull`,(e,t)=>{ps.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tu(e,t,n,r)});function _d(e){return Zc(gd,e)}var vd=L(`ZodUnknown`,(e,t)=>{ms.init(e,t),K.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function yd(){return Qc(vd)}var bd=L(`ZodNever`,(e,t)=>{hs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nu(e,t,n,r)});function xd(e){return $c(bd,e)}var Sd=L(`ZodArray`,(e,t)=>{Lu(),_s.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>su(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ol(e,t))},nonempty(e){return this.check(ol(1,e))},max(e,t){return this.check(al(e,t))},length(e,t){return this.check(sl(e,t))},unwrap(){return this.element}});function Y(e,t){return bl(Sd,e,t)}var Cd=L(`ZodObject`,(e,t)=>{Lu(),Cs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lu(e,t,n,r),Ri(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Z(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(N(this._zod.def,{catchall:e}))},passthrough(){return this.clone(N(this._zod.def,{catchall:yd()}))},loose(){return this.clone(N(this._zod.def,{catchall:yd()}))},strict(){return this.clone(N(this._zod.def,{catchall:xd()}))},strip(){return this.clone(N(this._zod.def,{catchall:void 0}))},extend(e){return pi(this,e)},safeExtend(e){return hi(this,e)},merge(e){return gi(this,e)},pick(e){return ui(this,e)},omit(e){return fi(this,e)},partial(...e){return _i(Pd,this,e[0])},exactPartial(...e){return _i(Id,this,e[0],`exactPartial`)},required(...e){return vi(Wd,this,e[0])}});function X(e,t){return new Cd({type:`object`,shape:e,catchall:xd(),...P(t)})}var wd=L(`ZodUnion`,(e,t)=>{Ts.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uu(e,t,n,r),e.options=t.options});function Td(e,t){return new wd({type:`union`,options:e,...P(t)})}var Ed=L(`ZodDiscriminatedUnion`,(e,t)=>{wd.init(e,t),Ds.init(e,t)});function Dd(e,t,n){return new Ed({type:`union`,options:t,discriminator:e,...P(n)})}var Od=L(`ZodIntersection`,(e,t)=>{Os.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>du(e,t,n,r)});function kd(e,t){return new Od({type:`intersection`,left:e,right:t})}var Ad=L(`ZodEnum`,(e,t)=>{js.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ru(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ad({...t,checks:[],...P(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 Ad({...t,checks:[],...P(r),entries:i})}});function Z(e,t){return new Ad({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var jd=L(`ZodLiteral`,(e,t)=>{Ms.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iu(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Q(e,t){return new jd({type:`literal`,values:Array.isArray(e)?e:[e],...P(t)})}var Md=L(`ZodTransform`,(e,t)=>{Lu(),Ns.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ou(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ki(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Oi(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Oi(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Nd(e){return new Md({type:`transform`,transform:e})}var Pd=L(`ZodOptional`,(e,t)=>{Fs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fd(e){return new Pd({type:`optional`,innerType:e})}var Id=L(`ZodExactOptional`,(e,t)=>{Is.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ld(e){return new Id({type:`optional`,innerType:e})}var Rd=L(`ZodNullable`,(e,t)=>{Ls.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zd(e){return new Rd({type:`nullable`,innerType:e})}var Bd=L(`ZodDefault`,(e,t)=>{Rs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Vd(e,t){return new Bd({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ni(t)}})}var Hd=L(`ZodPrefault`,(e,t)=>{Bs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_u(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ud(e,t){return new Hd({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ni(t)}})}var Wd=L(`ZodNonOptional`,(e,t)=>{Vs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gd(e,t){return new Wd({type:`nonoptional`,innerType:e,...P(t)})}var Kd=L(`ZodCatch`,(e,t)=>{Ws.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function qd(e,t){return new Kd({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Bi(t)})}var Jd=L(`ZodPipe`,(e,t)=>{Gs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yu(e,t,n,r),e.in=t.in,e.out=t.out});function Yd(e,t){return new Jd({type:`pipe`,in:e,out:t})}var Xd=L(`ZodReadonly`,(e,t)=>{qs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zd(e){return new Xd({type:`readonly`,innerType:e})}var Qd=L(`ZodCustom`,(e,t)=>{Ys.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>au(e,t,n,r)});function $d(e,t={}){return xl(Qd,e,t)}function ef(e,t){return Sl(e,t)}function tf(e){return Wc(Bu,e)}function nf(e){return Gc(Vu,e)}var rf=q().min(1).refine(e=>!e.includes(`\0`)&&!/[\uD800-\uDFFF]/u.test(e),`Paths must be lossless Unicode strings without NUL.`),af=rf.refine(e=>!e.startsWith(`/`)&&!/^[A-Za-z]:/.test(e)&&!(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`).some(e=>e===`.`||e===`..`||e===``)),of=q().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/).refine(e=>!/^0+$/.test(e)),sf=X({commitChanged:hd(),trackedChanges:hd(),untrackedChanges:hd()}).nullable(),cf=af.refine(e=>!e.endsWith(`/`)),lf=Dd(`kind`,[X({kind:Q(`tracked`),path:cf,xy:q().regex(/^[.MTAD]{2}$/).refine(e=>e!==`..`),submodule:sf}),X({kind:Q(`unmerged`),path:cf,xy:Z([`DD`,`AU`,`UD`,`UA`,`DU`,`AA`,`UU`]),submodule:sf}),X({kind:Q(`untracked`),path:af,xy:_d(),submodule:_d()})]),uf=Td([X({contract:Q(`repository-status`),version:Q(1),ok:Q(!0),observation:X({id:qu(),startedAt:tf(),completedAt:tf(),consistency:Q(`best-effort`)}),repository:X({key:q().regex(/^repo:[0-9a-f]{64}$/),worktreeKey:q().regex(/^worktree:[0-9a-f]{64}$/),rootPath:rf.refine(e=>e.startsWith(`/`)||/^[A-Za-z]:[/\\]/.test(e)||e.startsWith(`\\\\`)),objectFormat:Z([`sha1`,`sha256`])}),head:Dd(`state`,[X({state:Q(`branch`),branch:rf,commit:of}),X({state:Q(`detached`),branch:_d(),commit:of}),X({state:Q(`unborn`),branch:rf,commit:_d()})]),changes:Y(lf),summary:X({staged:pd().nonnegative(),unstaged:pd().nonnegative(),untracked:pd().nonnegative(),conflicted:pd().nonnegative()}),checks:X({state:Q(`not-run`),reason:Q(`git-status-only`)})}).superRefine((e,t)=>{e.head.commit&&e.head.commit.length!==(e.repository.objectFormat===`sha1`?40:64)&&t.addIssue({code:`custom`,message:`Object ID does not match objectFormat.`,path:[`head`,`commit`]});let n=new Set,r={staged:0,unstaged:0,untracked:0,conflicted:0};for(let i of e.changes)n.has(i.path)&&t.addIssue({code:`custom`,message:`Duplicate path.`,path:[`changes`]}),n.add(i.path),i.kind===`unmerged`?r.conflicted++:i.kind===`untracked`?r.untracked++:(i.xy[0]!==`.`&&r.staged++,i.xy[1]!==`.`&&r.unstaged++);for(let n of[`staged`,`unstaged`,`untracked`,`conflicted`])e.summary[n]!==r[n]&&t.addIssue({code:`custom`,message:`Summary does not match changes.`,path:[`summary`,n]})}),X({contract:Q(`repository-status`),version:Q(1),ok:Q(!1),error:X({code:Z([`GIT_NOT_FOUND`,`GIT_CONTEXT_OVERRIDE`,`NOT_A_REPOSITORY`,`UNSUPPORTED_REPOSITORY`,`GIT_UNSUPPORTED`,`GIT_FAILED`,`INVALID_GIT_OUTPUT`,`UNSUPPORTED_PATH_ENCODING`,`REPOSITORY_CHANGED`,`READ_LIMIT_EXCEEDED`]),message:q().min(1)})})]),df=X({contract:Q(`browser-http-error`),version:Q(1),error:X({code:Z([`BAD_REQUEST`,`FORBIDDEN`,`NOT_FOUND`,`METHOD_NOT_ALLOWED`,`SESSION_CHANGED`,`SERVER_CLOSING`,`INTERNAL_ERROR`]),message:q().min(1)})});Dd(`ok`,[X({contract:Q(`project-init`),version:Q(4),ok:Q(!0),outcome:Z([`planned`,`created`,`already-initialized`]),rootPath:q(),configPath:Q(`.gitifact/config.json`),schemaVersion:Q(2),baseline:Dd(`kind`,[X({kind:Q(`empty`)}),X({kind:Q(`commit`),objectFormat:Z([`sha1`,`sha256`]),commit:q()})]),agentDocs:X({mode:Z([`install`,`remove`,`skip`]),paths:Y(q())})}),X({contract:Q(`project-init`),version:Q(4),ok:Q(!1),error:X({code:q(),message:q()})})]);var ff=X({id:q(),title:q(),body:q()}),pf=X({email:q(),name:q(),commits:dd().int().nonnegative(),latest:q()}),mf=X({title:q(),path:q().optional(),url:q().optional(),note:q().optional()}),hf=X({id:q(),path:q(),title:q(),description:q(),requirements:Y(ff),design:X({title:q(),body:q(),requirements:Y(q()),sources:Y(mf)}).optional(),contributors:Y(pf),updatedAt:q().nullable()}),gf=ff.extend({specId:q(),path:q(),sources:Y(mf).optional()}).nullable(),_f=X({id:q(),path:q(),title:q(),body:q(),updatedAt:q().nullable()}),vf=X({contract:Q(`browser-specs`),version:Q(2),sessionId:q(),head:q().nullable(),observedAt:q(),working:hd(),features:Y(hf),documents:Y(_f).default([]),events:Y(X({key:q(),commit:q(),date:q(),author:q(),email:q(),committer:q(),message:q(),id:q(),kind:Z([`requirement`,`design`,`wiki`]).optional(),types:Y(Z([`created`,`modified`,`moved`,`deleted`])),before:gf,after:gf,reasons:Y(q())})),contributors:Y(pf),contributorsLimited:hd(),nextCursor:dd().int().nonnegative().nullable(),boundary:hd()}),yf=Y(q().min(1)),bf=X({version:q().regex(/^\d+\.\d+\.\d+$/),date:nf(),added:yf,changed:yf,removed:yf,fixed:yf}).refine(e=>e.added.length+e.changed.length+e.removed.length+e.fixed.length>0,`A version must list at least one change.`),xf=X({contract:Q(`changelog`),version:Q(1),language:q().regex(/^[a-z]{2}(?:-[A-Z]{2})?$/),fallback:hd(),entries:Y(bf)}).superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.entries.entries())n.has(i.version)&&t.addIssue({code:`custom`,path:[`entries`,r,`version`],message:`Duplicate version.`}),n.add(i.version)}),Sf=q().regex(/^\d+\.\d+\.\d+$/),Cf=X({status:Z([`checking`,`available`,`up-to-date`,`unavailable`,`disabled`]),latestVersion:Sf.nullable()}).refine(e=>(e.status===`available`||e.status===`up-to-date`)==(e.latestVersion!==null),`latestVersion is set exactly when the check produced a result.`),wf=X({contract:Q(`browser-session`),version:Q(2),sessionId:qu(),repository:X({key:q().regex(/^repo:[0-9a-f]{64}$/),worktreeKey:q().regex(/^worktree:[0-9a-f]{64}$/)}),cliVersion:q().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/),update:Cf}),Tf=Z([`untracked`,`other-changes`,`commit-failed`]),Ef=X({state:Z([`not-requested`,`nothing`,`committed`,`skipped`]),commit:q().nullable(),paths:Y(q()),message:q().nullable(),reason:Tf.nullable(),detail:q().nullable()}).refine(e=>e.state===`committed`==(e.commit!==null)&&e.state===`skipped`==(e.reason!==null),`commit is set exactly when committed, reason exactly when skipped.`);Dd(`ok`,[X({contract:Q(`update`),version:Q(3),ok:Q(!0),cliVersion:q().min(1),update:Cf,install:X({npmGlobal:q().min(1)}).nullable(),agentDocs:X({state:Z([`refreshed`,`current`,`not-initialized`,`no-block`]),paths:Y(q()),missing:Y(q())}),commit:Ef}),X({contract:Q(`update`),version:Q(3),ok:Q(!1),error:X({code:q(),message:q()})})]);var $=class extends Error{code;constructor(e,t){super(e),this.code=t,this.name=`ApiError`}};async function Df(e,t={}){let n;try{n=await fetch(e,{...t,cache:`no-store`})}catch(e){throw e instanceof Error&&e.name===`AbortError`?e:new $(k(`api.networkError`),`NETWORK_ERROR`)}try{return{response:n,data:await n.json()}}catch{throw new $(k(`api.unreadableResponse`),`INVALID_RESPONSE`)}}var Of=8,kf=[`browser-session`,2,window.location.origin];function Af(e){let t=df.safeParse(e);throw t.success?new $(t.data.error.message,t.data.error.code):new $(k(`api.invalidContract`),`INVALID_RESPONSE`)}var jf=()=>Pr({queryKey:kf,staleTime:0,gcTime:0,retry:!1,refetchOnWindowFocus:!0,refetchInterval:e=>e.state.data?.update.status===`checking`&&e.state.dataUpdateCount<Of&&1e3,queryFn:async({signal:e})=>{let{response:t,data:n}=await Df(`/api/v1/session`,{signal:e});if(!t.ok)return Af(n);let r=wf.safeParse(n);if(!r.success)throw new $(k(`api.invalidSession`),`INVALID_RESPONSE`);return r.data}});function Mf(e){return[`repository-status`,1,window.location.origin,e.sessionId,e.repository.key,e.repository.worktreeKey]}async function Nf(e,t,n){let{response:r,data:i}=await Df(`/api/v1/status`+(t?`/refresh`:``),{method:t?`POST`:`GET`,headers:{"X-Gitifact-Session":e.sessionId},...n?{signal:n}:{}}),a=uf.safeParse(i);if(!a.success)return Af(i);if(!a.data.ok)throw new $(a.data.error.message,a.data.error.code);if(!r.ok)throw new $(k(`api.statusMismatch`),`INVALID_RESPONSE`);if(a.data.repository.key!==e.repository.key||a.data.repository.worktreeKey!==e.repository.worktreeKey)throw new $(k(`api.otherCheckout`),`SESSION_CHANGED`);return a.data}var Pf=e=>Pr({queryKey:Mf(e),staleTime:5e3,retry:!1,queryFn:({signal:t})=>Nf(e,!1,t)}),Ff=e=>Nf(e,!0);function If(){let e=Nr(jf());return e.data?(0,T.jsx)(Lf,{session:e.data}):(0,T.jsx)(C,{type:`supporting`,color:`secondary`,children:k(`project.local`)})}function Lf({session:e}){let t=Nr(Pf(e)).data?.repository.rootPath;return(0,T.jsx)(C,{type:`supporting`,color:`secondary`,children:t?.split(/[\/]/).filter(Boolean).at(-1)??k(`project.local`)})}var Rf=e=>Fr({queryKey:[`browser-specs`,2,window.location.origin,e.sessionId,e.repository.worktreeKey],initialPageParam:{cursor:0,head:``},staleTime:5e3,retry:!1,queryFn:async({signal:t,pageParam:n})=>{let{response:r,data:i}=await Df(`/api/v1/specs`+(n.cursor?`?cursor=${n.cursor}&head=${n.head}`:``),{signal:t,headers:{"X-Gitifact-Session":e.sessionId}});if(!r.ok)return Af(i);let a=vf.safeParse(i);if(!a.success)throw new $(k(`api.invalidSpecs`),`INVALID_RESPONSE`);if(a.data.sessionId!==e.sessionId)throw new $(k(`api.serverChanged`),`SESSION_CHANGED`);return a.data},getNextPageParam:e=>e.nextCursor===null?void 0:{cursor:e.nextCursor,head:e.head??``}}),zf=(e,t)=>Pr({queryKey:[`changelog`,1,window.location.origin,e.sessionId,t],staleTime:1/0,retry:!1,queryFn:async({signal:n})=>{let{response:r,data:i}=await Df(`/api/v1/changelog?lang=`+t,{signal:n,headers:{"X-Gitifact-Session":e.sessionId}});if(!r.ok)return Af(i);let a=xf.safeParse(i);if(!a.success)throw new $(k(`api.invalidChangelog`),`INVALID_RESPONSE`);return a.data}}),Bf={contract:`browser-session`,version:2,sessionId:``,repository:{key:``,worktreeKey:``},cliVersion:`0.0.0`,update:{status:`disabled`,latestVersion:null}},Vf=/^\.(?:gitifact|tryce)\//;function Hf(){let e=Nr(jf()),t=Ir({...Rf(e.data??Bf),enabled:!1}),n=Nr({...Pf(e.data??Bf),enabled:!!e.data&&!e.error}),r=t.data?.pages[0]?.working,i=n.data?n.data.changes.some(e=>Vf.test(e.path)):void 0;if(r!==void 0||i!==void 0)return!!r||!!i}function Uf({data:e,size:t}){return(0,T.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`${t/16}rem`,height:`${t/16}rem`,style:{flexShrink:0},fill:`none`,"aria-hidden":`true`,focusable:`false`,children:e.map(([e,t],n)=>(0,w.createElement)(e,{...t,key:n}))})}function Wf({ref:e,justify:t,align:n,hAlign:r,vAlign:i,...a}){return(0,T.jsx)(sn,{...a,direction:`horizontal`,hAlign:r??t,vAlign:i??n,ref:e})}Wf.displayName=`HStack`;var Gf=[[`path`,{d:`M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C22 9.08996 22 10.1433 22 12.25C22 15.7612 22 17.5167 21.1573 18.7779C20.7926 19.3238 20.3238 19.7926 19.7779 20.1573C18.5167 21 16.7612 21 13.25 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}]];function Kf({size:e=16}){return(0,T.jsx)(Uf,{data:Gf,size:e})}var qf={bar:`_bar_2upas_2`,trail:`_trail_2upas_3`,crumb:`_crumb_2upas_4`};function Jf({trail:e,actions:t}){return(0,T.jsxs)(Wf,{as:`header`,"aria-label":k(`header.location`),gap:3,className:qf.bar,children:[(0,T.jsxs)(Wf,{gap:2,className:qf.trail,children:[(0,T.jsx)(Kf,{}),(0,T.jsx)(If,{}),e.map((t,n)=>(0,T.jsxs)(w.Fragment,{children:[(0,T.jsx)(C,{type:`supporting`,color:`secondary`,children:`/`}),t.to&&n<e.length-1?(0,T.jsx)(Kt,{to:t.to,search:t.search??{},className:qf.crumb,children:t.label}):(0,T.jsx)(C,{type:`supporting`,maxLines:1,children:t.label})]},n))]}),t]})}export{pt as $,Pn as A,Zt as B,An as C,ge as Ct,Cn as D,Dn as E,ue as Et,hn as F,Tt as G,Kt as H,k as I,yt as J,St as K,mn as L,Hn as M,vn as N,jn as O,_n as P,ft as Q,cn as R,wn as S,he as St,On as T,oe as Tt,Mt as U,qt as V,Et as W,gt as X,ut as Y,mt as Z,rr as _,ke as _t,Hf as a,et as at,Yn as b,Fe as bt,Ff as c,Ne as ct,Pf as d,O as dt,rt as et,$ as f,Re as ft,ir as g,Ie as gt,ur as h,Se as ht,Uf as i,Ye as it,Wn as j,A as k,jf as l,ze as lt,Nr as m,Pe as mt,Kf as n,Qe as nt,zf as o,Ve as ot,Ir as p,be as pt,_t as q,Wf as r,Ze as rt,Rf as s,Be as st,Jf as t,Xe as tt,Mf as u,Le as ut,$n as v,ye as vt,kn as w,me as wt,Jn as x,Te as xt,Qn as y,we as yt,an as z};
124
+ 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}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function kl(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;kl(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Al=new Set([`type`,`properties`,`required`,`additionalProperties`]),jl=[`oneOf`,`anyOf`];function Ml(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Nl(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Al.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ml(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}j(n,r,e.length===1?e[0]:Nl(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ml(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Pl(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Al)if(t in e)return;let n=t.filter(e=>jl.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Nl(t);else{let e=n[0],i=jl.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Nl([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,wl(e,r))}function Fl(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)):wl(i,s),wl(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())kl(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Pl(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}wl(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,j(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ll(t,`input`,e.processors),output:Ll(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function U(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 U(r.element,n);if(r.type===`set`)return U(r.valueType,n);if(r.type===`lazy`)return U(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return U(r.innerType,n);if(r.type===`intersection`)return U(r.left,n)||U(r.right,n);if(r.type===`record`||r.type===`map`)return U(r.keyType,n)||U(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:U(r.in,n)||U(r.out,n);if(r.type===`object`){for(let e in r.shape)if(U(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(U(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(U(e,n))return!0;return!!(r.rest&&U(r.rest,n))}return!1}var Il=(e,t={})=>n=>{let r=Tl({...n,processors:t});return H(e,r),Ol(r,e),Fl(r,e)},Ll=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Tl({...i??{},target:a,io:t,processors:n});return H(e,o),Ol(o,e),Fl(o,e)},Rl=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},zl=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Bl=(e,t)=>{Rl(e,`minimum`,t),zl(e,`maximum`,t)},Vl=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Hl=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Ul=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Wl=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Gl=(e,t)=>Rl(e,`minimum`,t.minimum),Kl=(e,t)=>zl(e,`maximum`,t.maximum),ql=e=>(t,n)=>{Wl(t,n.format);let[r,i]=e[n.format];Rl(t,`minimum`,r),zl(t,`maximum`,i)},Jl={greater_than:(e,t)=>Rl(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>zl(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Vl(e,t.value),number_format:ql(ci),bigint_format:ql(li),min_length:Gl,max_length:Kl,length_equals:(e,t)=>Bl(e,t.length),min_size:Gl,max_size:Kl,size_equals:(e,t)=>Bl(e,t.size),string_format:(e,t)=>{Wl(e,t.format),t.pattern&&Hl(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Ul(e,t.mime)};function W(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Jl[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Rl(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Rl(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&zl(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&zl(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Vl(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Ul(t,i.mime);for(let e of i.patterns??[])Hl(t,e);return t}var Yl={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Xl=new Map([[ns,Ba],[is,Va]]),Zl=e=>Xl.get(e)??e,Ql=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=W(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Yl[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Zl);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}))])}},$l=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=W(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):El(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},eu=(e,t,n,r)=>{n.type=`boolean`},tu=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},nu=(e,t,n,r)=>{n.not={}},ru=(e,t,n,r)=>{let i=e._zod.def,a=Lr(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},iu=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(El(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(El(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},au=(e,t,n,r)=>{El(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},ou=(e,t,n,r)=>{El(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},su=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=W(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=H(a.element,t,{...r,path:[...r.path,`items`]})};function cu(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?cu(t.out):t.type===`catch`?cu(t.innerType):e._zod.optin}var lu=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&El(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)j(i.properties,e,H(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?cu(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=H(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},uu=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>H(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},du=(e,t,n,r)=>{let i=e._zod.def,a=H(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=H(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},fu=(e,t,n,r)=>{let i=e._zod.def,a=H(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`}]},pu=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},mu=Symbol();function hu(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(El(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),mu):JSON.parse(o)}var gu=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=hu(i.defaultValue,e,t,n,r);o!==mu&&(n.default=o)},_u=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=hu(i.defaultValue,e,t,n,r);o!==mu&&(n._prefault=o)},vu=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{El(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},yu=(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;H(o,t,r);let s=t.seen.get(e);s.ref=o},bu=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},xu=(e,t,n,r)=>{let i=e._zod.def;H(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Su=new WeakSet([Object.prototype,Error.prototype]);function Cu(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var G=L(`ZodError`,(e,t)=>{ea.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Su.has(n)||(Su.add(n),Cu(n,`format`,e=>t=>ra(e,t)),Cu(n,`flatten`,e=>t=>na(e,t)),Cu(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,zr,2)}),Cu(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,zr,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),wu=aa(G),Tu=oa(G),Eu=sa(G),Du=la(G),Ou=ha(G),ku=ga(G),Au=_a(G),ju=va(G),Mu=ya(G),Nu=ba(G),Pu=xa(G),Fu=Sa(G);function Iu(){R.localeError||qi(hc())}function Lu(){R.memoizer||qi({memoizer:fc()})}var K=L(`ZodType`,(e,t)=>(Iu(),B.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(N(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 ai(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check($d(e,t))},superRefine(e,t){return this.check(ef(e,t))},overwrite(e){return this.check(ml(e))},optional(){return Fd(this)},exactOptional(){return Ld(this)},nullable(){return zd(this)},nullish(){return Fd(zd(this))},nonoptional(e){return Gd(this,e)},array(){return Y(this)},or(e){return Td([this,e])},and(e){return kd(this,e)},transform(e){return Yd(this,Nd(e))},default(e){return Vd(this,e)},prefault(e){return Ud(this,e)},catch(e){return qd(this,e)},pipe(e){return Yd(this,e)},readonly(){return Zd(this)},describe(e){let t=this.clone();return yc.add(t,{description:e}),t},meta(...e){if(e.length===0)return yc.get(this);let t=this.clone();return yc.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ji(this,`~standard`,{...wo(this),jsonSchema:{input:Ll(this,`input`),output:Ll(this,`output`)}})},set"~standard"(e){Ai(this,`~standard`,e)},parse:function e(t,n){return wu(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Tu(this,t,n,{callee:e})},safeParse(e,t){return Eu(this,e,t)},async safeParseAsync(e,t){return Du(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ai(this,`spa`,e)},validate(e,t){return fa(this,e,t)},validateAsync(e,t){return ma(this,e,t)},encode:function e(t,n){return Ou(this,t,n,{callee:e})},decode:function e(t,n){return ku(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Au(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await ju(this,t,n,{callee:e})},safeEncode(e,t){return Mu(this,e,t)},safeDecode(e,t){return Nu(this,e,t)},async safeEncodeAsync(e,t){return Pu(this,e,t)},async safeDecodeAsync(e,t){return Fu(this,e,t)},toJSONSchema(e){return Il(this,{})(e)},get description(){return yc.get(this)?.description},get _def(){return this._zod.def}}),Ru=L(`_ZodString`,(e,t)=>{To.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ql(e,t,n,r)},Mi({format:e=>W(e).format??null,minLength:e=>W(e).minimum??null,maxLength:e=>W(e).maximum??null},{regex(...e){return this.check(cl(...e))},includes(...e){return this.check(dl(...e))},startsWith(...e){return this.check(fl(...e))},endsWith(...e){return this.check(pl(...e))},min(...e){return this.check(ol(...e))},max(...e){return this.check(al(...e))},length(...e){return this.check(sl(...e))},nonempty(...e){return this.check(ol(1,...e))},lowercase(e){return this.check(ll(e))},uppercase(e){return this.check(ul(e))},trim(){return this.check(gl())},normalize(...e){return this.check(hl(...e))},toLowerCase(){return this.check(_l())},toUpperCase(){return this.check(vl())},slugify(){return this.check(yl())}})),zu=L(`ZodString`,(e,t)=>{To.init(e,t),Ru.init(e,t)},{email(e){return this.check(Sc(Wu,e))},url(e){return this.check(Oc(Ju,e))},jwt(e){return this.check(Uc(ld,e))},emoji(e){return this.check(kc(Yu,e))},guid(e){return this.check(Cc(Gu,e))},uuid(e){return this.check(wc(Ku,e))},uuidv4(e){return this.check(Tc(Ku,e))},uuidv6(e){return this.check(Ec(Ku,e))},uuidv7(e){return this.check(Dc(Ku,e))},nanoid(e){return this.check(Ac(Xu,e))},cuid(e){return this.check(jc(Zu,e))},cuid2(e){return this.check(Mc(Qu,e))},ulid(e){return this.check(Nc($u,e))},base64(e){return this.check(Bc(od,e))},base64url(e){return this.check(Vc(sd,e))},xid(e){return this.check(Pc(ed,e))},ksuid(e){return this.check(Fc(td,e))},ipv4(e){return this.check(Ic(nd,e))},ipv6(e){return this.check(Lc(rd,e))},cidrv4(e){return this.check(Rc(id,e))},cidrv6(e){return this.check(zc(ad,e))},e164(e){return this.check(Hc(cd,e))},datetime(e){return this.check(Wc(Bu,e))},date(e){return this.check(Gc(Vu,e))},time(e){return this.check(Kc(Hu,e))},duration(e){return this.check(qc(Uu,e))}});function q(e){return xc(zu,e)}var J=L(`ZodStringFormat`,(e,t)=>{V.init(e,t),Ru.init(e,t)}),Bu=L(`ZodISODateTime`,(e,t)=>{Wo.init(e,t),J.init(e,t)}),Vu=L(`ZodISODate`,(e,t)=>{Go.init(e,t),J.init(e,t)}),Hu=L(`ZodISOTime`,(e,t)=>{Ko.init(e,t),J.init(e,t)}),Uu=L(`ZodISODuration`,(e,t)=>{qo.init(e,t),J.init(e,t)}),Wu=L(`ZodEmail`,(e,t)=>{Oo.init(e,t),J.init(e,t)}),Gu=L(`ZodGUID`,(e,t)=>{Eo.init(e,t),J.init(e,t)}),Ku=L(`ZodUUID`,(e,t)=>{Do.init(e,t),J.init(e,t)});function qu(e){return wc(Ku,e)}var Ju=L(`ZodURL`,(e,t)=>{Io.init(e,t),J.init(e,t)}),Yu=L(`ZodEmoji`,(e,t)=>{Lo.init(e,t),J.init(e,t)}),Xu=L(`ZodNanoID`,(e,t)=>{Ro.init(e,t),J.init(e,t)}),Zu=L(`ZodCUID`,(e,t)=>{zo.init(e,t),J.init(e,t)}),Qu=L(`ZodCUID2`,(e,t)=>{Bo.init(e,t),J.init(e,t)}),$u=L(`ZodULID`,(e,t)=>{Vo.init(e,t),J.init(e,t)}),ed=L(`ZodXID`,(e,t)=>{Ho.init(e,t),J.init(e,t)}),td=L(`ZodKSUID`,(e,t)=>{Uo.init(e,t),J.init(e,t)}),nd=L(`ZodIPv4`,(e,t)=>{Jo.init(e,t),J.init(e,t)}),rd=L(`ZodIPv6`,(e,t)=>{Zo.init(e,t),J.init(e,t)}),id=L(`ZodCIDRv4`,(e,t)=>{Qo.init(e,t),J.init(e,t)}),ad=L(`ZodCIDRv6`,(e,t)=>{es.init(e,t),J.init(e,t)}),od=L(`ZodBase64`,(e,t)=>{rs.init(e,t),J.init(e,t)}),sd=L(`ZodBase64URL`,(e,t)=>{os.init(e,t),J.init(e,t)}),cd=L(`ZodE164`,(e,t)=>{ss.init(e,t),J.init(e,t)}),ld=L(`ZodJWT`,(e,t)=>{ls.init(e,t),J.init(e,t)}),ud=L(`ZodNumber`,(e,t)=>{us.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$l(e,t,n,r),e.isFinite=!0},Mi({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=W(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=W(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=W(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>W(e).format??null},{gt(e,t){return this.check(nl(e,t))},gte(e,t){return this.check(rl(e,t))},min(e,t){return this.check(rl(e,t))},lt(e,t){return this.check(el(e,t))},lte(e,t){return this.check(tl(e,t))},max(e,t){return this.check(tl(e,t))},int(e){return this.check(pd(e))},safe(e){return this.check(pd(e))},positive(e){return this.check(nl(0,e))},nonnegative(e){return this.check(rl(0,e))},negative(e){return this.check(el(0,e))},nonpositive(e){return this.check(tl(0,e))},multipleOf(e,t){return this.check(il(e,t))},step(e,t){return this.check(il(e,t))},finite(){return this}}));function dd(e){return Jc(ud,e)}var fd=L(`ZodNumberFormat`,(e,t)=>{ds.init(e,t),ud.init(e,t)});function pd(e){return Yc(fd,e)}var md=L(`ZodBoolean`,(e,t)=>{fs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eu(e,t,n,r)});function hd(e){return Xc(md,e)}var gd=L(`ZodNull`,(e,t)=>{ps.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tu(e,t,n,r)});function _d(e){return Zc(gd,e)}var vd=L(`ZodUnknown`,(e,t)=>{ms.init(e,t),K.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function yd(){return Qc(vd)}var bd=L(`ZodNever`,(e,t)=>{hs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nu(e,t,n,r)});function xd(e){return $c(bd,e)}var Sd=L(`ZodArray`,(e,t)=>{Lu(),_s.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>su(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ol(e,t))},nonempty(e){return this.check(ol(1,e))},max(e,t){return this.check(al(e,t))},length(e,t){return this.check(sl(e,t))},unwrap(){return this.element}});function Y(e,t){return bl(Sd,e,t)}var Cd=L(`ZodObject`,(e,t)=>{Lu(),Cs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lu(e,t,n,r),Ri(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Z(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(N(this._zod.def,{catchall:e}))},passthrough(){return this.clone(N(this._zod.def,{catchall:yd()}))},loose(){return this.clone(N(this._zod.def,{catchall:yd()}))},strict(){return this.clone(N(this._zod.def,{catchall:xd()}))},strip(){return this.clone(N(this._zod.def,{catchall:void 0}))},extend(e){return pi(this,e)},safeExtend(e){return hi(this,e)},merge(e){return gi(this,e)},pick(e){return ui(this,e)},omit(e){return fi(this,e)},partial(...e){return _i(Pd,this,e[0])},exactPartial(...e){return _i(Id,this,e[0],`exactPartial`)},required(...e){return vi(Wd,this,e[0])}});function X(e,t){return new Cd({type:`object`,shape:e,catchall:xd(),...P(t)})}var wd=L(`ZodUnion`,(e,t)=>{Ts.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uu(e,t,n,r),e.options=t.options});function Td(e,t){return new wd({type:`union`,options:e,...P(t)})}var Ed=L(`ZodDiscriminatedUnion`,(e,t)=>{wd.init(e,t),Ds.init(e,t)});function Dd(e,t,n){return new Ed({type:`union`,options:t,discriminator:e,...P(n)})}var Od=L(`ZodIntersection`,(e,t)=>{Os.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>du(e,t,n,r)});function kd(e,t){return new Od({type:`intersection`,left:e,right:t})}var Ad=L(`ZodEnum`,(e,t)=>{js.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ru(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ad({...t,checks:[],...P(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 Ad({...t,checks:[],...P(r),entries:i})}});function Z(e,t){return new Ad({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var jd=L(`ZodLiteral`,(e,t)=>{Ms.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iu(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Q(e,t){return new jd({type:`literal`,values:Array.isArray(e)?e:[e],...P(t)})}var Md=L(`ZodTransform`,(e,t)=>{Lu(),Ns.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ou(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ki(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Oi(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Oi(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Nd(e){return new Md({type:`transform`,transform:e})}var Pd=L(`ZodOptional`,(e,t)=>{Fs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fd(e){return new Pd({type:`optional`,innerType:e})}var Id=L(`ZodExactOptional`,(e,t)=>{Is.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ld(e){return new Id({type:`optional`,innerType:e})}var Rd=L(`ZodNullable`,(e,t)=>{Ls.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zd(e){return new Rd({type:`nullable`,innerType:e})}var Bd=L(`ZodDefault`,(e,t)=>{Rs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Vd(e,t){return new Bd({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ni(t)}})}var Hd=L(`ZodPrefault`,(e,t)=>{Bs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_u(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ud(e,t){return new Hd({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ni(t)}})}var Wd=L(`ZodNonOptional`,(e,t)=>{Vs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gd(e,t){return new Wd({type:`nonoptional`,innerType:e,...P(t)})}var Kd=L(`ZodCatch`,(e,t)=>{Ws.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function qd(e,t){return new Kd({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Bi(t)})}var Jd=L(`ZodPipe`,(e,t)=>{Gs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yu(e,t,n,r),e.in=t.in,e.out=t.out});function Yd(e,t){return new Jd({type:`pipe`,in:e,out:t})}var Xd=L(`ZodReadonly`,(e,t)=>{qs.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zd(e){return new Xd({type:`readonly`,innerType:e})}var Qd=L(`ZodCustom`,(e,t)=>{Ys.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>au(e,t,n,r)});function $d(e,t={}){return xl(Qd,e,t)}function ef(e,t){return Sl(e,t)}function tf(e){return Wc(Bu,e)}function nf(e){return Gc(Vu,e)}var rf=q().min(1).refine(e=>!e.includes(`\0`)&&!/[\uD800-\uDFFF]/u.test(e),`Paths must be lossless Unicode strings without NUL.`),af=rf.refine(e=>!e.startsWith(`/`)&&!/^[A-Za-z]:/.test(e)&&!(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`).some(e=>e===`.`||e===`..`||e===``)),of=q().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/).refine(e=>!/^0+$/.test(e)),sf=X({commitChanged:hd(),trackedChanges:hd(),untrackedChanges:hd()}).nullable(),cf=af.refine(e=>!e.endsWith(`/`)),lf=Dd(`kind`,[X({kind:Q(`tracked`),path:cf,xy:q().regex(/^[.MTAD]{2}$/).refine(e=>e!==`..`),submodule:sf}),X({kind:Q(`unmerged`),path:cf,xy:Z([`DD`,`AU`,`UD`,`UA`,`DU`,`AA`,`UU`]),submodule:sf}),X({kind:Q(`untracked`),path:af,xy:_d(),submodule:_d()})]),uf=Td([X({contract:Q(`repository-status`),version:Q(1),ok:Q(!0),observation:X({id:qu(),startedAt:tf(),completedAt:tf(),consistency:Q(`best-effort`)}),repository:X({key:q().regex(/^repo:[0-9a-f]{64}$/),worktreeKey:q().regex(/^worktree:[0-9a-f]{64}$/),rootPath:rf.refine(e=>e.startsWith(`/`)||/^[A-Za-z]:[/\\]/.test(e)||e.startsWith(`\\\\`)),objectFormat:Z([`sha1`,`sha256`])}),head:Dd(`state`,[X({state:Q(`branch`),branch:rf,commit:of}),X({state:Q(`detached`),branch:_d(),commit:of}),X({state:Q(`unborn`),branch:rf,commit:_d()})]),changes:Y(lf),summary:X({staged:pd().nonnegative(),unstaged:pd().nonnegative(),untracked:pd().nonnegative(),conflicted:pd().nonnegative()}),checks:X({state:Q(`not-run`),reason:Q(`git-status-only`)})}).superRefine((e,t)=>{e.head.commit&&e.head.commit.length!==(e.repository.objectFormat===`sha1`?40:64)&&t.addIssue({code:`custom`,message:`Object ID does not match objectFormat.`,path:[`head`,`commit`]});let n=new Set,r={staged:0,unstaged:0,untracked:0,conflicted:0};for(let i of e.changes)n.has(i.path)&&t.addIssue({code:`custom`,message:`Duplicate path.`,path:[`changes`]}),n.add(i.path),i.kind===`unmerged`?r.conflicted++:i.kind===`untracked`?r.untracked++:(i.xy[0]!==`.`&&r.staged++,i.xy[1]!==`.`&&r.unstaged++);for(let n of[`staged`,`unstaged`,`untracked`,`conflicted`])e.summary[n]!==r[n]&&t.addIssue({code:`custom`,message:`Summary does not match changes.`,path:[`summary`,n]})}),X({contract:Q(`repository-status`),version:Q(1),ok:Q(!1),error:X({code:Z([`GIT_NOT_FOUND`,`GIT_CONTEXT_OVERRIDE`,`NOT_A_REPOSITORY`,`UNSUPPORTED_REPOSITORY`,`GIT_UNSUPPORTED`,`GIT_FAILED`,`INVALID_GIT_OUTPUT`,`UNSUPPORTED_PATH_ENCODING`,`REPOSITORY_CHANGED`,`READ_LIMIT_EXCEEDED`]),message:q().min(1)})})]),df=X({contract:Q(`browser-http-error`),version:Q(1),error:X({code:Z([`BAD_REQUEST`,`FORBIDDEN`,`NOT_FOUND`,`METHOD_NOT_ALLOWED`,`SESSION_CHANGED`,`SERVER_CLOSING`,`INTERNAL_ERROR`]),message:q().min(1)})}),ff=q().regex(/^\d+\.\d+\.\d+$/),pf=X({status:Z([`checking`,`available`,`up-to-date`,`unavailable`,`disabled`]),latestVersion:ff.nullable()}).refine(e=>(e.status===`available`||e.status===`up-to-date`)==(e.latestVersion!==null),`latestVersion is set exactly when the check produced a result.`),mf=X({contract:Q(`browser-session`),version:Q(2),sessionId:qu(),repository:X({key:q().regex(/^repo:[0-9a-f]{64}$/),worktreeKey:q().regex(/^worktree:[0-9a-f]{64}$/)}),cliVersion:q().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/),update:pf});Dd(`ok`,[X({contract:Q(`project-init`),version:Q(5),ok:Q(!0),outcome:Z([`planned`,`created`,`replaced`,`already-initialized`]),rootPath:q(),configPath:Q(`.gitifact/config.json`),schemaVersion:Q(2),baseline:Dd(`kind`,[X({kind:Q(`empty`)}),X({kind:Q(`commit`),objectFormat:Z([`sha1`,`sha256`]),commit:q()})]),agentDocs:X({mode:Z([`install`,`remove`,`skip`]),paths:Y(q())}),update:pf,install:X({npmGlobal:q().min(1)}).nullable()}),X({contract:Q(`project-init`),version:Q(5),ok:Q(!1),error:X({code:q(),message:q()})})]);var hf=X({id:q(),title:q(),body:q()}),gf=X({email:q(),name:q(),commits:dd().int().nonnegative(),latest:q()}),_f=X({title:q(),path:q().optional(),url:q().optional(),note:q().optional()}),vf=X({id:q(),path:q(),title:q(),description:q(),requirements:Y(hf),design:X({title:q(),body:q(),requirements:Y(q()),sources:Y(_f)}).optional(),contributors:Y(gf),updatedAt:q().nullable()}),yf=hf.extend({specId:q(),path:q(),sources:Y(_f).optional()}).nullable(),bf=X({id:q(),path:q(),title:q(),body:q(),updatedAt:q().nullable()}),xf=X({contract:Q(`browser-specs`),version:Q(2),sessionId:q(),head:q().nullable(),observedAt:q(),working:hd(),features:Y(vf),documents:Y(bf).default([]),events:Y(X({key:q(),commit:q(),date:q(),author:q(),email:q(),committer:q(),message:q(),id:q(),kind:Z([`requirement`,`design`,`wiki`]).optional(),types:Y(Z([`created`,`modified`,`moved`,`deleted`])),before:yf,after:yf,reasons:Y(q())})),contributors:Y(gf),contributorsLimited:hd(),nextCursor:dd().int().nonnegative().nullable(),boundary:hd()}),Sf=Y(q().min(1)),Cf=X({version:q().regex(/^\d+\.\d+\.\d+$/),date:nf(),added:Sf,changed:Sf,removed:Sf,fixed:Sf}).refine(e=>e.added.length+e.changed.length+e.removed.length+e.fixed.length>0,`A version must list at least one change.`),wf=X({contract:Q(`changelog`),version:Q(1),language:q().regex(/^[a-z]{2}(?:-[A-Z]{2})?$/),fallback:hd(),entries:Y(Cf)}).superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.entries.entries())n.has(i.version)&&t.addIssue({code:`custom`,path:[`entries`,r,`version`],message:`Duplicate version.`}),n.add(i.version)}),Tf=Z([`untracked`,`other-changes`,`commit-failed`]),Ef=X({state:Z([`not-requested`,`nothing`,`committed`,`skipped`]),commit:q().nullable(),paths:Y(q()),message:q().nullable(),reason:Tf.nullable(),detail:q().nullable()}).refine(e=>e.state===`committed`==(e.commit!==null)&&e.state===`skipped`==(e.reason!==null),`commit is set exactly when committed, reason exactly when skipped.`);Dd(`ok`,[X({contract:Q(`update`),version:Q(3),ok:Q(!0),cliVersion:q().min(1),update:pf,install:X({npmGlobal:q().min(1)}).nullable(),agentDocs:X({state:Z([`refreshed`,`current`,`not-initialized`,`no-block`]),paths:Y(q()),missing:Y(q())}),commit:Ef}),X({contract:Q(`update`),version:Q(3),ok:Q(!1),error:X({code:q(),message:q()})})]);var $=class extends Error{code;constructor(e,t){super(e),this.code=t,this.name=`ApiError`}};async function Df(e,t={}){let n;try{n=await fetch(e,{...t,cache:`no-store`})}catch(e){throw e instanceof Error&&e.name===`AbortError`?e:new $(k(`api.networkError`),`NETWORK_ERROR`)}try{return{response:n,data:await n.json()}}catch{throw new $(k(`api.unreadableResponse`),`INVALID_RESPONSE`)}}var Of=8,kf=[`browser-session`,2,window.location.origin];function Af(e){let t=df.safeParse(e);throw t.success?new $(t.data.error.message,t.data.error.code):new $(k(`api.invalidContract`),`INVALID_RESPONSE`)}var jf=()=>Pr({queryKey:kf,staleTime:0,gcTime:0,retry:!1,refetchOnWindowFocus:!0,refetchInterval:e=>e.state.data?.update.status===`checking`&&e.state.dataUpdateCount<Of&&1e3,queryFn:async({signal:e})=>{let{response:t,data:n}=await Df(`/api/v1/session`,{signal:e});if(!t.ok)return Af(n);let r=mf.safeParse(n);if(!r.success)throw new $(k(`api.invalidSession`),`INVALID_RESPONSE`);return r.data}});function Mf(e){return[`repository-status`,1,window.location.origin,e.sessionId,e.repository.key,e.repository.worktreeKey]}async function Nf(e,t,n){let{response:r,data:i}=await Df(`/api/v1/status`+(t?`/refresh`:``),{method:t?`POST`:`GET`,headers:{"X-Gitifact-Session":e.sessionId},...n?{signal:n}:{}}),a=uf.safeParse(i);if(!a.success)return Af(i);if(!a.data.ok)throw new $(a.data.error.message,a.data.error.code);if(!r.ok)throw new $(k(`api.statusMismatch`),`INVALID_RESPONSE`);if(a.data.repository.key!==e.repository.key||a.data.repository.worktreeKey!==e.repository.worktreeKey)throw new $(k(`api.otherCheckout`),`SESSION_CHANGED`);return a.data}var Pf=e=>Pr({queryKey:Mf(e),staleTime:5e3,retry:!1,queryFn:({signal:t})=>Nf(e,!1,t)}),Ff=e=>Nf(e,!0);function If(){let e=Nr(jf());return e.data?(0,T.jsx)(Lf,{session:e.data}):(0,T.jsx)(C,{type:`supporting`,color:`secondary`,children:k(`project.local`)})}function Lf({session:e}){let t=Nr(Pf(e)).data?.repository.rootPath;return(0,T.jsx)(C,{type:`supporting`,color:`secondary`,children:t?.split(/[\/]/).filter(Boolean).at(-1)??k(`project.local`)})}var Rf=e=>Fr({queryKey:[`browser-specs`,2,window.location.origin,e.sessionId,e.repository.worktreeKey],initialPageParam:{cursor:0,head:``},staleTime:5e3,retry:!1,queryFn:async({signal:t,pageParam:n})=>{let{response:r,data:i}=await Df(`/api/v1/specs`+(n.cursor?`?cursor=${n.cursor}&head=${n.head}`:``),{signal:t,headers:{"X-Gitifact-Session":e.sessionId}});if(!r.ok)return Af(i);let a=xf.safeParse(i);if(!a.success)throw new $(k(`api.invalidSpecs`),`INVALID_RESPONSE`);if(a.data.sessionId!==e.sessionId)throw new $(k(`api.serverChanged`),`SESSION_CHANGED`);return a.data},getNextPageParam:e=>e.nextCursor===null?void 0:{cursor:e.nextCursor,head:e.head??``}}),zf=(e,t)=>Pr({queryKey:[`changelog`,1,window.location.origin,e.sessionId,t],staleTime:1/0,retry:!1,queryFn:async({signal:n})=>{let{response:r,data:i}=await Df(`/api/v1/changelog?lang=`+t,{signal:n,headers:{"X-Gitifact-Session":e.sessionId}});if(!r.ok)return Af(i);let a=wf.safeParse(i);if(!a.success)throw new $(k(`api.invalidChangelog`),`INVALID_RESPONSE`);return a.data}}),Bf={contract:`browser-session`,version:2,sessionId:``,repository:{key:``,worktreeKey:``},cliVersion:`0.0.0`,update:{status:`disabled`,latestVersion:null}},Vf=/^\.(?:gitifact|tryce)\//;function Hf(){let e=Nr(jf()),t=Ir({...Rf(e.data??Bf),enabled:!1}),n=Nr({...Pf(e.data??Bf),enabled:!!e.data&&!e.error}),r=t.data?.pages[0]?.working,i=n.data?n.data.changes.some(e=>Vf.test(e.path)):void 0;if(r!==void 0||i!==void 0)return!!r||!!i}function Uf({data:e,size:t}){return(0,T.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`${t/16}rem`,height:`${t/16}rem`,style:{flexShrink:0},fill:`none`,"aria-hidden":`true`,focusable:`false`,children:e.map(([e,t],n)=>(0,w.createElement)(e,{...t,key:n}))})}function Wf({ref:e,justify:t,align:n,hAlign:r,vAlign:i,...a}){return(0,T.jsx)(sn,{...a,direction:`horizontal`,hAlign:r??t,vAlign:i??n,ref:e})}Wf.displayName=`HStack`;var Gf=[[`path`,{d:`M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C22 9.08996 22 10.1433 22 12.25C22 15.7612 22 17.5167 21.1573 18.7779C20.7926 19.3238 20.3238 19.7926 19.7779 20.1573C18.5167 21 16.7612 21 13.25 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}]];function Kf({size:e=16}){return(0,T.jsx)(Uf,{data:Gf,size:e})}var qf={bar:`_bar_2upas_2`,trail:`_trail_2upas_3`,crumb:`_crumb_2upas_4`};function Jf({trail:e,actions:t}){return(0,T.jsxs)(Wf,{as:`header`,"aria-label":k(`header.location`),gap:3,className:qf.bar,children:[(0,T.jsxs)(Wf,{gap:2,className:qf.trail,children:[(0,T.jsx)(Kf,{}),(0,T.jsx)(If,{}),e.map((t,n)=>(0,T.jsxs)(w.Fragment,{children:[(0,T.jsx)(C,{type:`supporting`,color:`secondary`,children:`/`}),t.to&&n<e.length-1?(0,T.jsx)(Kt,{to:t.to,search:t.search??{},className:qf.crumb,children:t.label}):(0,T.jsx)(C,{type:`supporting`,maxLines:1,children:t.label})]},n))]}),t]})}export{pt as $,Pn as A,Zt as B,An as C,ge as Ct,Cn as D,Dn as E,ue as Et,hn as F,Tt as G,Kt as H,k as I,yt as J,St as K,mn as L,Hn as M,vn as N,jn as O,_n as P,ft as Q,cn as R,wn as S,he as St,On as T,oe as Tt,Mt as U,qt as V,Et as W,gt as X,ut as Y,mt as Z,rr as _,ke as _t,Hf as a,et as at,Yn as b,Fe as bt,Ff as c,Ne as ct,Pf as d,O as dt,rt as et,$ as f,Re as ft,ir as g,Ie as gt,ur as h,Se as ht,Uf as i,Ye as it,Wn as j,A as k,jf as l,ze as lt,Nr as m,Pe as mt,Kf as n,Qe as nt,zf as o,Ve as ot,Ir as p,be as pt,_t as q,Wf as r,Ze as rt,Rf as s,Be as st,Jf as t,Xe as tt,Mf as u,Le as ut,$n as v,ye as vt,kn as w,me as wt,Jn as x,Te as xt,Qn as y,we as yt,an as z};