@sazabi/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -0
- package/README.md +28 -0
- package/dist/index.js +495 -0
- package/package.json +28 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var VV=Object.create;var{getPrototypeOf:OV,defineProperty:oU,getOwnPropertyNames:WV}=Object;var LV=Object.prototype.hasOwnProperty;function NV($){return this[$]}var qV,kV,o4=($,v,U)=>{var D=$!=null&&typeof $==="object";if(D){var _=v?qV??=new WeakMap:kV??=new WeakMap,I=_.get($);if(I)return I}U=$!=null?VV(OV($)):{};let G=v||!$||!$.__esModule?oU(U,"default",{value:$,enumerable:!0}):U;for(let J of WV($))if(!LV.call(G,J))oU(G,J,{get:NV.bind($,J),enumerable:!0});if(D)_.set($,G);return G};var HV=($,v)=>()=>(v||$((v={exports:{}}).exports,v),v.exports);var FV=($)=>$;function bV($,v){this[$]=FV.bind(null,v)}var i$=($,v)=>{for(var U in v)oU($,U,{get:v[U],enumerable:!0,configurable:!0,set:bV.bind(v,U)})};var L=($,v)=>()=>($&&(v=$($=0)),v);var dv=HV(($q,tU)=>{var I1=process||{},Zw=I1.argv||[],D1=I1.env||{},gV=!(!!D1.NO_COLOR||Zw.includes("--no-color"))&&(!!D1.FORCE_COLOR||Zw.includes("--color")||I1.platform==="win32"||(I1.stdout||{}).isTTY&&D1.TERM!=="dumb"||!!D1.CI),SV=($,v,U=$)=>(D)=>{let _=""+D,I=_.indexOf(v,$.length);return~I?$+BV(_,v,U,I)+v:$+_+v},BV=($,v,U,D)=>{let _="",I=0;do _+=$.substring(I,D)+U,I=D+v.length,D=$.indexOf(v,I);while(~D);return _+$.substring(I)},Mw=($=gV)=>{let v=$?SV:()=>String;return{isColorSupported:$,reset:v("\x1B[0m","\x1B[0m"),bold:v("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:v("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:v("\x1B[3m","\x1B[23m"),underline:v("\x1B[4m","\x1B[24m"),inverse:v("\x1B[7m","\x1B[27m"),hidden:v("\x1B[8m","\x1B[28m"),strikethrough:v("\x1B[9m","\x1B[29m"),black:v("\x1B[30m","\x1B[39m"),red:v("\x1B[31m","\x1B[39m"),green:v("\x1B[32m","\x1B[39m"),yellow:v("\x1B[33m","\x1B[39m"),blue:v("\x1B[34m","\x1B[39m"),magenta:v("\x1B[35m","\x1B[39m"),cyan:v("\x1B[36m","\x1B[39m"),white:v("\x1B[37m","\x1B[39m"),gray:v("\x1B[90m","\x1B[39m"),bgBlack:v("\x1B[40m","\x1B[49m"),bgRed:v("\x1B[41m","\x1B[49m"),bgGreen:v("\x1B[42m","\x1B[49m"),bgYellow:v("\x1B[43m","\x1B[49m"),bgBlue:v("\x1B[44m","\x1B[49m"),bgMagenta:v("\x1B[45m","\x1B[49m"),bgCyan:v("\x1B[46m","\x1B[49m"),bgWhite:v("\x1B[47m","\x1B[49m"),blackBright:v("\x1B[90m","\x1B[39m"),redBright:v("\x1B[91m","\x1B[39m"),greenBright:v("\x1B[92m","\x1B[39m"),yellowBright:v("\x1B[93m","\x1B[39m"),blueBright:v("\x1B[94m","\x1B[39m"),magentaBright:v("\x1B[95m","\x1B[39m"),cyanBright:v("\x1B[96m","\x1B[39m"),whiteBright:v("\x1B[97m","\x1B[39m"),bgBlackBright:v("\x1B[100m","\x1B[49m"),bgRedBright:v("\x1B[101m","\x1B[49m"),bgGreenBright:v("\x1B[102m","\x1B[49m"),bgYellowBright:v("\x1B[103m","\x1B[49m"),bgBlueBright:v("\x1B[104m","\x1B[49m"),bgMagentaBright:v("\x1B[105m","\x1B[49m"),bgCyanBright:v("\x1B[106m","\x1B[49m"),bgWhiteBright:v("\x1B[107m","\x1B[49m")}};tU.exports=Mw();tU.exports.createColors=Mw});var Tw=()=>{};var U$,O$,pU=($,v)=>{let U=v??$,D=$.trim().toUpperCase(),I={ERROR:U$.default.red,FATAL:U$.default.red,WARN:U$.default.yellow,WARNING:U$.default.yellow,INFO:U$.default.blue,DEBUG:U$.default.gray,TRACE:U$.default.gray}[D];return I?I(U):U},ov=($,v)=>{let U=v??$;if($==="user")return U$.default.blue(U);if($==="assistant")return U$.default.green(U);return U$.default.gray(U)};var zw=L(()=>{U$=o4(dv(),1),O$={success:($)=>U$.default.green($),error:($)=>U$.default.red($),warning:($)=>U$.default.yellow($),info:($)=>U$.default.blue($),muted:($)=>U$.default.dim($),bold:($)=>U$.default.bold($),cyan:($)=>U$.default.cyan($),gray:($)=>U$.default.gray($)}});var G1=($,v=60)=>{if($.length<=v)return $;return`${$.substring(0,v-3)}...`},I$=($)=>{return new Date($).toLocaleString()},n$=($)=>{return`${$.substring(0,8)}...`};var Aw,Q$=($)=>{return Aw.default.bold($)};var jw=L(()=>{Aw=o4(dv(),1)});var aU=()=>{};var t4,eU="✓",sU="✗",Ew="⚠",xw="ℹ",ZV,MV,TV,zV;var $D=L(()=>{t4=o4(dv(),1),ZV=t4.default.green(eU),MV=t4.default.red(sU),TV=t4.default.yellow(Ew),zV=t4.default.cyan(xw)});var vD=()=>{};var Rw=L(()=>{aU();$D();vD()});var Yv,t=($)=>{console.log(Yv.default.yellow($))},M=($)=>{console.log(JSON.stringify($,null,2))},q=($,v=1)=>{console.error(JSON.stringify(typeof $==="string"?{success:!1,error:$}:$,null,2)),process.exit(v)},Y$=($)=>{console.log(Yv.default.bold($))},c=($)=>{console.log(Yv.default.dim($))},u=($)=>{console.log(Yv.default.green($))},Pv=($)=>{console.log(Yv.default.red($))},Kv=($)=>{console.log(Yv.default.yellow($))},G$=($)=>Yv.default.dim($);var _D=L(()=>{Yv=o4(dv(),1)});var tv,Vv=($)=>{if($.type==="cursor")if($.nextCursor)console.log(tv.default.dim(`Next: --cursor ${$.nextCursor}`));else console.log(tv.default.dim("End of results"));else console.log(tv.default.dim(`Page ${$.page} of ${$.totalPages}`))},UD=($,v)=>{console.log(tv.default.bold(`${$} (${v} total)`))},DD=($,v)=>{console.log(tv.default.bold(`${$} (${v} results)`))};var ID=L(()=>{tv=o4(dv(),1)});var Cw=L(()=>{aU();vD()});var uV=($)=>{console.error($)},N=($,v=1)=>{uV($),process.exit(v)},H$=($)=>{console.log($)},J1=($="─",v=80)=>{console.log($.repeat(v))},r=()=>{console.log("")},r$=($,v=2)=>{console.log(`${" ".repeat(v)}${$}`)},_$=($,v=0)=>{for(let[U,D]of Object.entries($))console.log(`${" ".repeat(v)}${U}: ${D}`)},a=($,v,U)=>{if($.length===0)return;if(U?.header){let X=typeof U.header==="string"?{title:U.header}:U.header,Q=X.variant??"section",Y=X.count??$.length;if(Q==="results")UD(X.title,Y);else if(Q==="search")DD(X.title,Y);else Y$(X.title)}let D=/\u001B\[[0-?]*[ -/]*[@-~]/g,_=(X)=>(X??"").replace(D,"").length,I=(X,Q,Y)=>{let P=_(X),V=Math.max(0,Q-P);return Y==="right"?`${" ".repeat(V)}${X}`:`${X}${" ".repeat(V)}`},G=v.map((X)=>{if(X.width)return X.width;let Q=_(X.header),Y=Math.max(...$.map((P)=>_(P[X.key]||"")));return Math.max(Q,Y)}),J=[v.map((X,Q)=>{let Y=G[Q]||0;return I(X.header,Y,"left")}),...$.map((X)=>v.map((Q,Y)=>{let P=X[Q.key]||"",V=G[Y]||0,O=Q.align||"left";return I(P,V,O)}))];for(let X of J)r$(X.join(" "));r()};var n=L(()=>{Tw();zw();jw();Rw();$D();_D();ID();Cw();_D();ID()});function uw($){return $[0]??{}}function Wv($){return Array.isArray($)?$:$===void 0||$===null?[]:[$]}function w1($){let v;return()=>{if(v)return v.result;let U=$();return v={result:U},U}}function cV($){let v=Promise.resolve();return(...U)=>{return v=v.catch(()=>{}).then(()=>{return $(...U)})}}function p4(){return globalThis[rV]}function X1($,v={},U){return p4()?.tracer?.startSpan($,v,U)}function Ov($,v,U={}){if(!$)return;let D=mV(v);if($.recordException(D),!U.signal?.aborted||U.signal.reason!==v)$.setStatus({code:hV,message:D.message})}function mV($){if($ instanceof Error){let v={message:$.message,name:$.name,stack:$.stack};if("code"in $&&(typeof $.code==="string"||typeof $.code==="number"))v.code=$.code;return v}return{message:String($)}}async function Rv({name:$,context:v,...U},D){let _=p4()?.tracer;if(!_)return D();let I=async(G)=>{try{return await D(G)}catch(J){throw Ov(G,J,U),J}finally{G.end()}};if(v)return _.startActiveSpan($,U,v,I);else return _.startActiveSpan($,U,I)}async function xv($,v){let U=p4();if(!$||!U)return v();let D=U.trace.setSpan(U.context.active(),$);return U.context.with(D,v)}function x$($){if(!$||typeof $!=="object")return!1;return"next"in $&&typeof $.next==="function"&&Symbol.asyncIterator in $&&typeof $[Symbol.asyncIterator]==="function"}function wD({name:$,...v},U){let D;return new d$(async()=>{D??=X1($);try{let _=await xv(D,()=>U.next());return D?.addEvent(_.done?"completed":"yielded"),_}catch(_){throw Ov(D,_,v),_}},async(_)=>{try{if(_!=="next")await xv(D,()=>U.return?.())}catch(I){throw Ov(D,I,v),I}finally{D?.end()}})}class yw{#$=new Map;#v;constructor($={}){this.#v=$.maxBufferedEvents??100}get size(){return this.#$.size}publish($,v){let U=this.#$.get($);if(!U)return;for(let D of U)D(v)}subscribe($,v){if(typeof v==="function"){let X=this.#$.get($);if(!X)this.#$.set($,X=[]);return X.push(v),w1(()=>{if(X.splice(X.indexOf(v),1),X.length===0)this.#$.delete($)})}let U=v?.signal,D=v?.maxBufferedEvents??this.#v;U?.throwIfAborted();let _=[],I=[],G=this.subscribe($,(X)=>{let Q=I.shift();if(Q)Q[0]({done:!1,value:X});else if(_.push(X),_.length>D)_.shift()}),J=(X)=>{G(),I.forEach((Q)=>Q[1](X.target.reason)),I.length=0,_.length=0};return U?.addEventListener("abort",J,{once:!0}),new d$(async()=>{if(U?.aborted)throw U.reason;if(_.length>0)return{done:!1,value:_.shift()};return new Promise((X,Q)=>{I.push([X,Q])})},async()=>{G(),U?.removeEventListener("abort",J),I.forEach((X)=>X[0]({done:!0,value:void 0})),I.length=0,_.length=0})}}class nV{index=BigInt(1);generate(){let $=this.index.toString(36);return this.index++,$}}function a4($,v,U){let D=(_,I)=>{let G=$[I];if(!G)return U(_);return G({..._,next:(J=_)=>D(J,I+1)})};return D(v,0)}function e4($){if(!$)return;return JSON.parse($)}function pv($){return JSON.stringify($)}function fw($){if(!C$($))return null;return Object.getPrototypeOf($)?.constructor}function R$($){if(!$||typeof $!=="object")return!1;let v=Object.getPrototypeOf($);return v===Object.prototype||!v||!v.constructor}function C$($){return!!$&&(typeof $==="object"||typeof $==="function")}function Q1($,v){let U=$;for(let D of v){if(!C$(U))return;U=U[D]}return U}function Y1($,...v){if(typeof $==="function")return $(...v);return $}function QD($){return new Proxy($,{get(v,U,D){let _=Reflect.get(v,U,D);if(U!=="then"||typeof _!=="function")return _;return new Proxy(_,{apply(I,G,J){if(J.length!==2||J.some((Q)=>!oV(Q)))return Reflect.apply(I,G,J);let X=!0;J[0].call(G,QD(new Proxy(v,{get:(Q,Y,P)=>{if(X&&Y==="then"){X=!1;return}return Reflect.get(Q,Y,P)}})))}})}})}function oV($){return typeof $==="function"&&dV.test($.toString())}function cw($){try{return decodeURIComponent($)}catch{return $}}var GD="orpc",yV="@orpc/shared",fV="1.13.13",JD,hV=2,rV,lV,iV,d$,XD,dV;var W$=L(()=>{JD=class JD extends Error{constructor(...$){super(...$);this.name="AbortError"}};rV=`__${yV}@${fV}/otel/config__`;lV=Symbol.for("asyncDispose"),iV=Symbol.asyncDispose??lV;d$=class d${#$=!1;#v=!1;#_;#U;constructor($,v){this.#_=v,this.#U=cV(async()=>{if(this.#$)return{done:!0,value:void 0};try{let U=await $();if(U.done)this.#$=!0;return U}catch(U){throw this.#$=!0,U}finally{if(this.#$&&!this.#v)this.#v=!0,await this.#_("next")}})}next(){return this.#U()}async return($){if(this.#$=!0,!this.#v)this.#v=!0,await this.#_("return");return{done:!0,value:$}}async throw($){if(this.#$=!0,!this.#v)this.#v=!0,await this.#_("throw");throw $}async[iV](){if(this.#$=!0,!this.#v)this.#v=!0,await this.#_("dispose")}[Symbol.asyncIterator](){return this}};XD=(()=>{let $=function(){};return $.prototype=Object.create(null),Object.freeze($.prototype),$})();dV=/^\s*function\s*\(\)\s*\{\s*\[native code\]\s*\}\s*$/});function PD($,v){return v??s4[$]?.status??500}function mw($,v){return v||s4[$]?.message||$}function $6($){return $ instanceof D$?$:new D$("INTERNAL_SERVER_ERROR",{message:"Internal server error",cause:$})}function _v($){return $<200||$>=400}function av($){if(!R$($))return!1;let v=["defined","code","status","message","data"];if(Object.keys($).some((U)=>!v.includes(U)))return!1;return"defined"in $&&typeof $.defined==="boolean"&&"code"in $&&typeof $.code==="string"&&"status"in $&&typeof $.status==="number"&&_v($.status)&&"message"in $&&typeof $.message==="string"}function ev($,v={}){return new D$($.code,{...v,...$})}var hw="@orpc/client",rw="1.13.13",s4,lw,YD,D$;var sv=L(()=>{W$();s4={BAD_REQUEST:{status:400,message:"Bad Request"},UNAUTHORIZED:{status:401,message:"Unauthorized"},FORBIDDEN:{status:403,message:"Forbidden"},NOT_FOUND:{status:404,message:"Not Found"},METHOD_NOT_SUPPORTED:{status:405,message:"Method Not Supported"},NOT_ACCEPTABLE:{status:406,message:"Not Acceptable"},TIMEOUT:{status:408,message:"Request Timeout"},CONFLICT:{status:409,message:"Conflict"},PRECONDITION_FAILED:{status:412,message:"Precondition Failed"},PAYLOAD_TOO_LARGE:{status:413,message:"Payload Too Large"},UNSUPPORTED_MEDIA_TYPE:{status:415,message:"Unsupported Media Type"},UNPROCESSABLE_CONTENT:{status:422,message:"Unprocessable Content"},TOO_MANY_REQUESTS:{status:429,message:"Too Many Requests"},CLIENT_CLOSED_REQUEST:{status:499,message:"Client Closed Request"},INTERNAL_SERVER_ERROR:{status:500,message:"Internal Server Error"},NOT_IMPLEMENTED:{status:501,message:"Not Implemented"},BAD_GATEWAY:{status:502,message:"Bad Gateway"},SERVICE_UNAVAILABLE:{status:503,message:"Service Unavailable"},GATEWAY_TIMEOUT:{status:504,message:"Gateway Timeout"}};lw=Symbol.for(`__${hw}@${rw}/error/ORPC_ERROR_CONSTRUCTORS__`);globalThis[lw]??=new WeakSet;YD=globalThis[lw];D$=class D$ extends Error{defined;code;status;data;constructor($,...v){let U=uw(v);if(U.status!==void 0&&!_v(U.status))throw Error("[ORPCError] Invalid error status code.");let D=mw($,U.message);super(D,U);this.code=$,this.status=PD($,U.status),this.defined=U.defined??!1,this.data=U.data}toJSON(){return{defined:this.defined,code:this.code,status:this.status,message:this.message,data:this.data}}static[Symbol.hasInstance]($){if(YD.has(this)){let v=fw($);if(v&&YD.has(v))return!0}return super[Symbol.hasInstance]($)}};YD.add(D$)});function tV($){let v=$.replace(/\n+$/,"").split(/\n/),U={data:void 0,event:void 0,id:void 0,retry:void 0,comments:[]};for(let D of v){let _=D.indexOf(":"),I=_===-1?D:D.slice(0,_),G=_===-1?"":D.slice(_+1).replace(/^\s/,"");if(_===0)U.comments.push(G);else if(I==="data")U.data??="",U.data+=`${G}
|
|
3
|
+
`;else if(I==="event")U.event=G;else if(I==="id")U.id=G;else if(I==="retry"){let J=Number.parseInt(G);if(Number.isInteger(J)&&J>=0&&J.toString()===G)U.retry=J}}return U.data=U.data?.replace(/\n$/,""),U}class nw{constructor($={}){this.options=$}incomplete="";feed($){this.incomplete+=$;let v=this.incomplete.lastIndexOf(`
|
|
4
|
+
|
|
5
|
+
`);if(v===-1)return;let U=this.incomplete.slice(0,v).split(/\n\n/);this.incomplete=this.incomplete.slice(v+2);for(let D of U){let _=tV(`${D}
|
|
6
|
+
|
|
7
|
+
`);if(this.options.onEvent)this.options.onEvent(_)}}end(){if(this.incomplete)throw new iw("Event Iterator ended before complete")}}function dw($){if($.includes(`
|
|
8
|
+
`))throw new v6("Event's id must not contain a newline character")}function pV($){if($.includes(`
|
|
9
|
+
`))throw new v6("Event's event must not contain a newline character")}function ow($){if(!Number.isInteger($)||$<0)throw new v6("Event's retry must be a integer and >= 0")}function tw($){if($.includes(`
|
|
10
|
+
`))throw new v6("Event's comment must not contain a newline character")}function aV($){let v=$?.split(/\n/)??[],U="";for(let D of v)U+=`data: ${D}
|
|
11
|
+
`;return U}function eV($){let v="";for(let U of $??[])tw(U),v+=`: ${U}
|
|
12
|
+
`;return v}function _6($){let v="";if(v+=eV($.comments),$.event!==void 0)pV($.event),v+=`event: ${$.event}
|
|
13
|
+
`;if($.retry!==void 0)ow($.retry),v+=`retry: ${$.retry}
|
|
14
|
+
`;if($.id!==void 0)dw($.id),v+=`id: ${$.id}
|
|
15
|
+
`;return v+=aV($.data),v+=`
|
|
16
|
+
`,v}function Lv($,v){if(v.id===void 0&&v.retry===void 0&&!v.comments?.length)return $;if(v.id!==void 0)dw(v.id);if(v.retry!==void 0)ow(v.retry);if(v.comments!==void 0)for(let U of v.comments)tw(U);return new Proxy($,{get(U,D,_){if(D===pw)return v;return Reflect.get(U,D,_)}})}function Cv($){return C$($)?Reflect.get($,pw):void 0}function aw($){let v=$.replace(/[^\x20-\x7E]/g,"_").replace(/"/g,"\\\""),U=encodeURIComponent($).replace(/['()*]/g,(D)=>`%${D.charCodeAt(0).toString(16).toUpperCase()}`).replace(/%(7C|60|5E)/g,(D,_)=>String.fromCharCode(Number.parseInt(_,16)));return`inline; filename="${v}"; filename*=utf-8''${U}`}function ew($){let v=$.match(/filename\*=(UTF-8'')?([^;]*)/i);if(v&&typeof v[2]==="string")return cw(v[2]);let U=$.match(/filename="((?:\\"|[^"])*)"/i);if(U&&typeof U[1]==="string")return U[1].replace(/\\"/g,'"')}function P1($,v){let U={...$};for(let D in v)if(Array.isArray(v[D]))U[D]=[...Wv(U[D]),...v[D]];else if(v[D]!==void 0)if(Array.isArray(U[D]))U[D]=[...U[D],v[D]];else if(U[D]!==void 0)U[D]=[U[D],v[D]];else U[D]=v[D];return U}var v6,iw,T$,KD,pw;var Uv=L(()=>{W$();v6=class v6 extends TypeError{};iw=class iw extends TypeError{};T$=class T$ extends Error{data;constructor($){super($?.message??"An error event was received",$);this.data=$?.data}};KD=class KD extends TransformStream{constructor(){let $;super({start(v){$=new nw({onEvent:(U)=>{v.enqueue(U)}})},transform(v){$.feed(v)},flush(){$.end()}})}};pw=Symbol("ORPC_EVENT_SOURCE_META")});function Nv($,v){let U=async(D)=>{let _=await v.error(D);if(_!==D){let I=Cv(D);if(I&&C$(_))_=Lv(_,I)}return _};return new d$(async()=>{let{done:D,value:_}=await(async()=>{try{return await $.next()}catch(G){throw await U(G)}})(),I=await v.value(_,D);if(I!==_){let G=Cv(_);if(G&&C$(I))I=Lv(I,G)}return{done:D,value:I}},async()=>{try{await $.return?.()}catch(D){throw await U(D)}})}var U6=L(()=>{W$();Uv()});function sV($){return{...$,context:$.context??{}}}function VD($,v={}){let U=v.path??[],_=new Proxy(async(...[I,G={}])=>{return await $.call(U,I,sV(G))},{get(I,G){if(typeof G!=="string")return Reflect.get(I,G);return VD($,{...v,path:[...U,G]})}});return QD(_)}var qv=L(()=>{W$();W$();sv();sv();U6();Uv()});function $5($,v={}){let D=$?.pipeThrough(new TextDecoderStream).pipeThrough(new KD)?.getReader(),_,I=!1;return new d$(async()=>{_??=X1("consume_event_iterator_stream");try{while(!0){if(D===void 0)return{done:!0,value:void 0};let{done:G,value:J}=await xv(_,()=>D.read());if(G){if(I)throw new JD("Stream was cancelled");return{done:!0,value:void 0}}switch(J.event){case"message":{let X=e4(J.data);if(C$(X))X=Lv(X,J);return _?.addEvent("message"),{done:!1,value:X}}case"error":{let X=new T$({data:e4(J.data)});throw X=Lv(X,J),_?.addEvent("error"),X}case"done":{let X=e4(J.data);if(C$(X))X=Lv(X,J);return _?.addEvent("done"),{done:!0,value:X}}default:_?.addEvent("maybe_keepalive")}}}catch(G){if(!(G instanceof T$))Ov(_,G,v);throw G}},async(G)=>{try{if(G!=="next")I=!0,_?.addEvent("cancelled");await xv(_,()=>D?.cancel())}catch(J){throw Ov(_,J,v),J}finally{_?.end()}})}function v5($,v={}){let U=v.eventIteratorKeepAliveEnabled??!0,D=v.eventIteratorKeepAliveInterval??5000,_=v.eventIteratorKeepAliveComment??"",I=v.eventIteratorInitialCommentEnabled??!0,G=v.eventIteratorInitialComment??"",J=!1,X,Q;return new ReadableStream({start(P){if(Q=X1("stream_event_iterator"),I)P.enqueue(_6({comments:[G]}))},async pull(P){try{if(U)X=setInterval(()=>{P.enqueue(_6({comments:[_]})),Q?.addEvent("keepalive")},D);let V=await xv(Q,()=>$.next());if(clearInterval(X),J)return;let O=Cv(V.value);if(!V.done||V.value!==void 0||O!==void 0){let S=V.done?"done":"message";P.enqueue(_6({...O,event:S,data:pv(V.value)})),Q?.addEvent(S)}if(V.done)P.close(),Q?.end()}catch(V){if(clearInterval(X),J)return;if(V instanceof T$)P.enqueue(_6({...Cv(V),event:"error",data:pv(V.data)})),Q?.addEvent("error"),P.close();else Ov(Q,V),P.error(V);Q?.end()}},async cancel(){try{J=!0,clearInterval(X),Q?.addEvent("cancelled"),await xv(Q,()=>$.return?.())}catch(P){throw Ov(Q,P),P}finally{Q?.end()}}}).pipeThrough(new TextEncoderStream)}function _5($,v={}){return Rv({name:"parse_standard_body",signal:v.signal},async()=>{let U=$.headers.get("content-disposition");if(typeof U==="string"){let I=ew(U)??"blob",G=await $.blob();return new File([G],I,{type:G.type})}let D=$.headers.get("content-type");if(!D||D.startsWith("application/json")){let I=await $.text();return e4(I)}if(D.startsWith("multipart/form-data"))return await $.formData();if(D.startsWith("application/x-www-form-urlencoded")){let I=await $.text();return new URLSearchParams(I)}if(D.startsWith("text/event-stream"))return $5($.body,v);if(D.startsWith("text/plain"))return await $.text();let _=await $.blob();return new File([_],"blob",{type:_.type})})}function U5($,v,U={}){let D=v.get("content-disposition");if(v.delete("content-type"),v.delete("content-disposition"),$===void 0)return;if($ instanceof Blob)return v.set("content-type",$.type),v.set("content-length",$.size.toString()),v.set("content-disposition",D??aw($ instanceof File?$.name:"blob")),$;if($ instanceof FormData)return $;if($ instanceof URLSearchParams)return $;if(x$($))return v.set("content-type","text/event-stream"),v5($,U);return v.set("content-type","application/json"),pv($)}function OD($,v={}){return $.forEach((U,D)=>{if(Array.isArray(v[D]))v[D].push(U);else if(v[D]!==void 0)v[D]=[v[D],U];else v[D]=U}),v}function D5($,v=new Headers){for(let[U,D]of Object.entries($))if(Array.isArray(D))for(let _ of D)v.append(U,_);else if(D!==void 0)v.append(U,D);return v}function sw($,v={}){let U=D5($.headers),D=U5($.body,U,v);return new Request($.url,{signal:$.signal,method:$.method,headers:U,body:D})}function $X($,v={}){return{body:w1(()=>_5($,v)),status:$.status,get headers(){let U=OD($.headers);return Object.defineProperty(this,"headers",{value:U,writable:!0}),U},set headers(U){Object.defineProperty(this,"headers",{value:U,writable:!0})}}}var K1=L(()=>{W$();Uv()});class D6{plugins;constructor($=[]){this.plugins=[...$].sort((v,U)=>(v.order??0)-(U.order??0))}init($){for(let v of this.plugins)v.init?.($)}}class V1{constructor($,v,U={}){this.codec=$,this.sender=v,new D6(U.plugins).init(U),this.interceptors=Wv(U.interceptors),this.clientInterceptors=Wv(U.clientInterceptors)}interceptors;clientInterceptors;call($,v,U){return Rv({name:`${GD}.${$.join("/")}`,signal:U.signal},(D)=>{if(D?.setAttribute("rpc.system",GD),D?.setAttribute("rpc.method",$.join(".")),x$(v))v=wD({name:"consume_event_iterator_input",signal:U.signal},v);return a4(this.interceptors,{...U,path:$,input:v},async({path:_,input:I,...G})=>{let J=p4(),X,Q=J?.trace.getActiveSpan()??D;if(Q&&J)X=J?.trace.setSpan(J.context.active(),Q);let Y=await Rv({name:"encode_request",context:X},()=>this.codec.encode(_,I,G)),P=await a4(this.clientInterceptors,{...G,input:I,path:_,request:Y},({input:O,path:S,request:B,...h})=>{return Rv({name:"send_request",signal:h.signal,context:X},()=>this.sender.call(B,h,S,O))}),V=await Rv({name:"decode_response",context:X},()=>this.codec.decode(P,G,_,I));if(x$(V))return wD({name:"consume_event_iterator_output",signal:G.signal},V);return V})})}}function I6($){return`/${$.map(encodeURIComponent).join("/")}`}function WD($){if(typeof $.forEach==="function")return OD($);return $}function LD($){return Object.entries(s4).find(([,v])=>v.status===$)?.[0]??"MALFORMED_ORPC_ERROR_RESPONSE"}class vX{constructor($){this.jsonSerializer=$}serialize($){if(x$($))return Nv($,{value:async(v)=>this.#$(v,!1),error:async(v)=>{return new T$({data:this.#$($6(v).toJSON(),!1),cause:v})}});return this.#$($,!0)}#$($,v){let[U,D,_,I]=this.jsonSerializer.serialize($),G=D.length===0?void 0:D;if(!v||I.length===0)return{json:U,meta:G};let J=new FormData;return J.set("data",pv({json:U,meta:G,maps:_})),I.forEach((X,Q)=>{J.set(Q.toString(),X)}),J}deserialize($){if(x$($))return Nv($,{value:async(v)=>this.#v(v),error:async(v)=>{if(!(v instanceof T$))return v;let U=this.#v(v.data);if(av(U))return ev(U,{cause:v});return new T$({data:U,cause:v})}});return this.#v($)}#v($){if($===void 0)return;if(!($ instanceof FormData))return this.jsonSerializer.deserialize($.json,$.meta??[]);let v=JSON.parse($.get("data"));return this.jsonSerializer.deserialize(v.json,v.meta??[],v.maps,(U)=>$.get(U.toString()))}}var ND=L(()=>{W$();Uv();sv();K1();U6()});class qD{fetch;toFetchRequestOptions;adapterInterceptors;constructor($){new _X($.plugins).initRuntimeAdapter($),this.fetch=$.fetch??globalThis.fetch.bind(globalThis),this.toFetchRequestOptions=$,this.adapterInterceptors=Wv($.adapterInterceptors)}async call($,v,U,D){let _=sw($,this.toFetchRequestOptions),I=await a4(this.adapterInterceptors,{...v,request:_,path:U,input:D,init:{redirect:"manual"}},({request:J,path:X,input:Q,init:Y,...P})=>this.fetch(J,Y,P,X,Q));return $X(I,{signal:_.signal})}}var _X;var UX=L(()=>{W$();K1();ND();Uv();sv();U6();_X=class _X extends D6{initRuntimeAdapter($){for(let v of this.plugins)v.initRuntimeAdapter?.($)}}});function kD($,v){return{...$,...v}}class G6{"~orpc";constructor($){if($.route?.successStatus&&_v($.route.successStatus))throw Error("[ContractProcedure] Invalid successStatus.");if(Object.values($.errorMap).some((v)=>v&&v.status&&!_v(v.status)))throw Error("[ContractProcedure] Invalid error status code.");this["~orpc"]=$}}function J6($){if($ instanceof G6)return!0;return(typeof $==="object"||typeof $==="function")&&$!==null&&"~orpc"in $&&typeof $["~orpc"]==="object"&&$["~orpc"]!==null&&"errorMap"in $["~orpc"]&&"route"in $["~orpc"]&&"meta"in $["~orpc"]}var HD=L(()=>{qv()});var O1=L(()=>{ND();W$();Uv();sv();K1();U6()});function G5($,v){return{...$,...v}}function J5($,v){return{...$,...v}}function w5($,v){if(!$.path)return $;return{...$,path:`${v}${$.path}`}}function X5($,v){return{...$,tags:[...v,...$.tags??[]]}}function Q5($,v){return $?`${$}${v}`:v}function Y5($,v){return $?[...$,...v]:v}function P5($,v){let U=$;if(v.prefix)U=w5(U,v.prefix);if(v.tags?.length)U=X5(U,v.tags);return U}function DX($,v){if(J6($))return new G6({...$["~orpc"],errorMap:kD(v.errorMap,$["~orpc"].errorMap),route:P5($["~orpc"].route,v)});let U={};for(let D in $)U[D]=DX($[D],v);return U}function w6($,v){if(v===void 0)return K5[$];return v}var u$,IX,K5,ak;var W1=L(()=>{HD();HD();O1();W$();W$();qv();qv();u$=class u$ extends G6{constructor($){super($);this["~orpc"].prefix=$.prefix,this["~orpc"].tags=$.tags}$meta($){return new u$({...this["~orpc"],meta:$})}$route($){return new u$({...this["~orpc"],route:$})}$input($){return new u$({...this["~orpc"],inputSchema:$})}errors($){return new u$({...this["~orpc"],errorMap:kD(this["~orpc"].errorMap,$)})}meta($){return new u$({...this["~orpc"],meta:G5(this["~orpc"].meta,$)})}route($){return new u$({...this["~orpc"],route:J5(this["~orpc"].route,$)})}input($){return new u$({...this["~orpc"],inputSchema:$})}output($){return new u$({...this["~orpc"],outputSchema:$})}prefix($){return new u$({...this["~orpc"],prefix:Q5(this["~orpc"].prefix,$)})}tag(...$){return new u$({...this["~orpc"],tags:Y5(this["~orpc"].tags,$)})}router($){return DX($,this["~orpc"])}};IX=new u$({errorMap:{},route:{},meta:{}}),K5={defaultMethod:"POST",defaultSuccessStatus:200,defaultSuccessDescription:"OK",defaultInputStructure:"compact",defaultOutputStructure:"compact"};ak=Symbol("ORPC_EVENT_ITERATOR_DETAILS")});class bD{maxArrayIndex;constructor($={}){this.maxArrayIndex=$.maxBracketNotationArrayIndex??9999}serialize($,v=[],U=[]){if(Array.isArray($))$.forEach((D,_)=>{this.serialize(D,[...v,_],U)});else if(R$($))for(let D in $)this.serialize($[D],[...v,D],U);else U.push([this.stringifyPath(v),$]);return U}deserialize($){if($.length===0)return{};let v=new WeakSet,U={value:[]};for(let[D,_]of $){let I=this.parsePath(D),G=U,J="value";if(I.forEach((X,Q)=>{if(!Array.isArray(G[J])&&!R$(G[J]))G[J]=[];if(Q!==I.length-1){if(Array.isArray(G[J])&&!GX(X,this.maxArrayIndex))if(v.has(G[J]))v.delete(G[J]),G[J]=JX(G[J]);else G[J]=FD(G[J])}else if(Array.isArray(G[J])){if(X===""){if(G[J].length&&!v.has(G[J]))G[J]=FD(G[J])}else if(v.has(G[J]))v.delete(G[J]),G[J]=JX(G[J]);else if(!GX(X,this.maxArrayIndex))G[J]=FD(G[J])}G=G[J],J=X}),Array.isArray(G)&&J==="")v.add(G),G.push(_);else if(J in G)if(Array.isArray(G[J]))G[J].push(_);else G[J]=[G[J],_];else G[J]=_}return U.value}stringifyPath($){return $.map((v)=>{return v.toString().replace(/[\\[\]]/g,(U)=>{switch(U){case"\\":return"\\\\";case"[":return"\\[";case"]":return"\\]";default:return U}})}).reduce((v,U,D)=>{if(D===0)return U;return`${v}[${U}]`},"")}parsePath($){let v=[],U=!1,D="",_=0;for(let I=0;I<$.length;I++){let G=$[I],J=$[I+1];if(U&&G==="]"&&(J===void 0||J==="[")&&_%2===0){if(J===void 0)U=!1;v.push(D),D="",I++}else if(v.length===0&&G==="["&&_%2===0)U=!0,v.push(D),D="";else if(G==="\\")_++;else D+="\\".repeat(_/2)+G,_=0}return U||v.length===0?[$]:v}}function GX($,v){return/^0$|^[1-9]\d*$/.test($)&&Number($)<=v}function FD($){let v=new XD;return $.forEach((U,D)=>{v[D]=U}),v}function JX($){let v=new XD;return v[""]=$.length===1?$[0]:$,v}var gD=L(()=>{W$()});class XX{customSerializers;constructor($={}){this.customSerializers=$.customJsonSerializers??[]}serialize($,v={value:!1}){for(let U of this.customSerializers)if(U.condition($))return this.serialize(U.serialize($),v);if($ instanceof Blob)return v.value=!0,[$,v.value];if($ instanceof Set)return this.serialize(Array.from($),v);if($ instanceof Map)return this.serialize(Array.from($.entries()),v);if(Array.isArray($))return[$.map((D)=>D===void 0?null:this.serialize(D,v)[0]),v.value];if(R$($)){let U={};for(let D in $){if(D==="toJSON"&&typeof $[D]==="function")continue;U[D]=this.serialize($[D],v)[0]}return[U,v.value]}if(typeof $==="bigint"||$ instanceof RegExp||$ instanceof URL)return[$.toString(),v.value];if($ instanceof Date)return[Number.isNaN($.getTime())?null:$.toISOString(),v.value];if(Number.isNaN($))return[null,v.value];return[$,v.value]}}function SD($){return`/${$.replace(/\/{2,}/g,"/").replace(/^\/|\/$/g,"")}`}function wX($){return $?SD($).match(/\/\{[^}]+\}/g)?.map((v)=>({raw:v,name:v.match(/\{\+?([^}]+)\}/)[1]})):void 0}class QX{constructor($,v,U){this.contract=$,this.serializer=v,this.baseUrl=U.url,this.headers=U.headers??{},this.customErrorResponseBodyDecoder=U.customErrorResponseBodyDecoder}baseUrl;headers;customErrorResponseBodyDecoder;async encode($,v,U){let D=WD(await Y1(this.headers,U,$,v));if(U.lastEventId!==void 0)D=P1(D,{"last-event-id":U.lastEventId});let _=await Y1(this.baseUrl,U,$,v),I=Q1(this.contract,$);if(!J6(I))throw Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${$.join(".")}`);return w6("defaultInputStructure",I["~orpc"].route.inputStructure)==="compact"?this.#$(I,$,v,U,_,D):this.#v(I,$,v,U,_,D)}#$($,v,U,D,_,I){let G=SD($["~orpc"].route.path??I6(v)),J=U,X=wX(G);if(X?.length){if(!R$(U))throw TypeError(`[StandardOpenapiLinkCodec] Invalid input shape for "compact" structure when has dynamic params at ${v.join(".")}.`);let P={...U};for(let V of X){let O=U[V.name];G=G.replace(V.raw,`/${encodeURIComponent(`${this.serializer.serialize(O)}`)}`),delete P[V.name]}J=Object.keys(P).length?P:void 0}let Q=w6("defaultMethod",$["~orpc"].route.method),Y=new URL(_);if(Y.pathname=`${Y.pathname.replace(/\/$/,"")}${G}`,Q==="GET"){let P=this.serializer.serialize(J,{outputFormat:"URLSearchParams"});for(let[V,O]of P)Y.searchParams.append(V,O);return{url:Y,method:Q,headers:I,body:void 0,signal:D.signal}}return{url:Y,method:Q,headers:I,body:this.serializer.serialize(J),signal:D.signal}}#v($,v,U,D,_,I){let G=SD($["~orpc"].route.path??I6(v)),J=wX(G);if(!R$(U)&&U!==void 0)throw TypeError(`[StandardOpenapiLinkCodec] Invalid input shape for "detailed" structure at ${v.join(".")}.`);if(J?.length){if(!R$(U?.params))throw TypeError(`[StandardOpenapiLinkCodec] Invalid input.params shape for "detailed" structure when has dynamic params at ${v.join(".")}.`);for(let P of J){let V=U.params[P.name];G=G.replace(P.raw,`/${encodeURIComponent(`${this.serializer.serialize(V)}`)}`)}}let X=I;if(U?.headers!==void 0){if(!R$(U.headers))throw TypeError(`[StandardOpenapiLinkCodec] Invalid input.headers shape for "detailed" structure at ${v.join(".")}.`);X=P1(U.headers,I)}let Q=w6("defaultMethod",$["~orpc"].route.method),Y=new URL(_);if(Y.pathname=`${Y.pathname.replace(/\/$/,"")}${G}`,U?.query!==void 0){let P=this.serializer.serialize(U.query,{outputFormat:"URLSearchParams"});for(let[V,O]of P)Y.searchParams.append(V,O)}if(Q==="GET")return{url:Y,method:Q,headers:X,body:void 0,signal:D.signal};return{url:Y,method:Q,headers:X,body:this.serializer.serialize(U?.body),signal:D.signal}}async decode($,v,U){let D=!_v($.status),_=await(async()=>{let J=!1;try{let X=await $.body();return J=!0,this.serializer.deserialize(X)}catch(X){if(!J)throw Error("Cannot parse response body, please check the response body and content-type.",{cause:X});throw Error("Invalid OpenAPI response format.",{cause:X})}})();if(!D){let J=this.customErrorResponseBodyDecoder?.(_,$);if(J!==null&&J!==void 0)throw J;if(av(_))throw ev(_);throw new D$(LD($.status),{status:$.status,data:{...$,body:_}})}let I=Q1(this.contract,U);if(!J6(I))throw Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${U.join(".")}`);if(w6("defaultOutputStructure",I["~orpc"].route.outputStructure)==="compact")return _;return{status:$.status,headers:$.headers,body:_}}}class YX{constructor($,v){this.jsonSerializer=$,this.bracketNotation=v}serialize($,v={}){if(x$($)&&!v.outputFormat)return Nv($,{value:async(U)=>this.#$(U,{outputFormat:"plain"}),error:async(U)=>{return new T$({data:this.#$($6(U).toJSON(),{outputFormat:"plain"}),cause:U})}});return this.#$($,v)}#$($,v){let[U,D]=this.jsonSerializer.serialize($);if(v.outputFormat==="plain")return U;if(v.outputFormat==="URLSearchParams"){let I=new URLSearchParams;for(let[G,J]of this.bracketNotation.serialize(U))if(typeof J==="string"||typeof J==="number"||typeof J==="boolean")I.append(G,J.toString());return I}if(U instanceof Blob||U===void 0||!D)return U;let _=new FormData;for(let[I,G]of this.bracketNotation.serialize(U))if(typeof G==="string"||typeof G==="number"||typeof G==="boolean")_.append(I,G.toString());else if(G instanceof Blob)_.append(I,G);return _}deserialize($){if($ instanceof URLSearchParams||$ instanceof FormData)return this.bracketNotation.deserialize(Array.from($.entries()));if(x$($))return Nv($,{value:async(v)=>v,error:async(v)=>{if(v instanceof T$&&av(v.data))return ev(v.data,{cause:v});return v}});return $}}var BD;var PX=L(()=>{O1();gD();W$();qv();W1();Uv();BD=class BD extends V1{constructor($,v,U){let D=new XX(U),_=new bD({maxBracketNotationArrayIndex:4294967294}),I=new YX(D,_),G=new QX($,I,U);super(G,v,U)}}});var ZD;var KX=L(()=>{UX();W$();W1();PX();qv();O1();Uv();gD();ZD=class ZD extends BD{constructor($,v){let U=new qD(v);super($,U,v)}}});function K($,v,U){function D(J,X){if(!J._zod)Object.defineProperty(J,"_zod",{value:{def:X,constr:G,traits:new Set},enumerable:!1});if(J._zod.traits.has($))return;J._zod.traits.add($),v(J,X);let Q=G.prototype,Y=Object.keys(Q);for(let P=0;P<Y.length;P++){let V=Y[P];if(!(V in J))J[V]=Q[V].bind(J)}}let _=U?.Parent??Object;class I extends _{}Object.defineProperty(I,"name",{value:$});function G(J){var X;let Q=U?.Parent?new I:this;D(Q,J),(X=Q._zod).deferred??(X.deferred=[]);for(let Y of Q._zod.deferred)Y();return Q}return Object.defineProperty(G,"init",{value:D}),Object.defineProperty(G,Symbol.hasInstance,{value:(J)=>{if(U?.Parent&&J instanceof U.Parent)return!0;return J?._zod?.traits?.has($)}}),Object.defineProperty(G,"name",{value:$}),G}function v$($){if($)Object.assign(X6,$);return X6}var MD,TD,o$,uv,X6;var $4=L(()=>{MD=Object.freeze({status:"aborted"});TD=Symbol("zod_brand");o$=class o$ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};uv=class uv extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};X6={}});var b={};i$(b,{unwrapMessage:()=>Q6,uint8ArrayToHex:()=>y5,uint8ArrayToBase64url:()=>C5,uint8ArrayToBase64:()=>WX,stringifyPrimitive:()=>H,slugify:()=>jD,shallowClone:()=>xD,safeExtend:()=>z5,required:()=>E5,randomString:()=>b5,propertyKeyTypes:()=>K6,promiseAllObject:()=>F5,primitiveTypes:()=>RD,prefixIssues:()=>z$,pick:()=>Z5,partial:()=>j5,parsedType:()=>F,optionalKeys:()=>CD,omit:()=>M5,objectClone:()=>q5,numKeys:()=>g5,nullish:()=>kv,normalizeParams:()=>g,mergeDefs:()=>Dv,merge:()=>A5,jsonStringifyReplacer:()=>v4,joinValues:()=>W,issue:()=>U4,isPlainObject:()=>Fv,isObject:()=>yv,hexToUint8Array:()=>u5,getSizableOrigin:()=>V6,getParsedType:()=>S5,getLengthableOrigin:()=>O6,getEnumValues:()=>Y6,getElementAtPath:()=>H5,floatSafeRemainder:()=>AD,finalizeIssue:()=>F$,extend:()=>T5,escapeRegex:()=>y$,esc:()=>L1,defineLazy:()=>C,createTransparentProxy:()=>B5,cloneDef:()=>k5,clone:()=>L$,cleanRegex:()=>P6,cleanEnum:()=>x5,captureStackTrace:()=>N1,cached:()=>_4,base64urlToUint8Array:()=>R5,base64ToUint8Array:()=>OX,assignProp:()=>Hv,assertNotEqual:()=>O5,assertNever:()=>L5,assertIs:()=>W5,assertEqual:()=>V5,assert:()=>N5,allowsEval:()=>ED,aborted:()=>bv,NUMBER_FORMAT_RANGES:()=>uD,Class:()=>LX,BIGINT_FORMAT_RANGES:()=>yD});function V5($){return $}function O5($){return $}function W5($){}function L5($){throw Error("Unexpected value in exhaustive check")}function N5($){}function Y6($){let v=Object.values($).filter((D)=>typeof D==="number");return Object.entries($).filter(([D,_])=>v.indexOf(+D)===-1).map(([D,_])=>_)}function W($,v="|"){return $.map((U)=>H(U)).join(v)}function v4($,v){if(typeof v==="bigint")return v.toString();return v}function _4($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw Error("cached value already set")}}}function kv($){return $===null||$===void 0}function P6($){let v=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(v,U)}function AD($,v){let U=($.toString().split(".")[1]||"").length,D=v.toString(),_=(D.split(".")[1]||"").length;if(_===0&&/\d?e-\d?/.test(D)){let X=D.match(/\d?e-(\d?)/);if(X?.[1])_=Number.parseInt(X[1])}let I=U>_?U:_,G=Number.parseInt($.toFixed(I).replace(".","")),J=Number.parseInt(v.toFixed(I).replace(".",""));return G%J/10**I}function C($,v,U){let D=void 0;Object.defineProperty($,v,{get(){if(D===VX)return;if(D===void 0)D=VX,D=U();return D},set(_){Object.defineProperty($,v,{value:_})},configurable:!0})}function q5($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function Hv($,v,U){Object.defineProperty($,v,{value:U,writable:!0,enumerable:!0,configurable:!0})}function Dv(...$){let v={};for(let U of $){let D=Object.getOwnPropertyDescriptors(U);Object.assign(v,D)}return Object.defineProperties({},v)}function k5($){return Dv($._zod.def)}function H5($,v){if(!v)return $;return v.reduce((U,D)=>U?.[D],$)}function F5($){let v=Object.keys($),U=v.map((D)=>$[D]);return Promise.all(U).then((D)=>{let _={};for(let I=0;I<v.length;I++)_[v[I]]=D[I];return _})}function b5($=10){let U="";for(let D=0;D<$;D++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function L1($){return JSON.stringify($)}function jD($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function yv($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function Fv($){if(yv($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let U=v.prototype;if(yv(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function xD($){if(Fv($))return{...$};if(Array.isArray($))return[...$];return $}function g5($){let v=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))v++;return v}function y$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function L$($,v,U){let D=new $._zod.constr(v??$._zod.def);if(!v||U?.parent)D._zod.parent=$;return D}function g($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function B5($){let v;return new Proxy({},{get(U,D,_){return v??(v=$()),Reflect.get(v,D,_)},set(U,D,_,I){return v??(v=$()),Reflect.set(v,D,_,I)},has(U,D){return v??(v=$()),Reflect.has(v,D)},deleteProperty(U,D){return v??(v=$()),Reflect.deleteProperty(v,D)},ownKeys(U){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(U,D){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,D)},defineProperty(U,D,_){return v??(v=$()),Reflect.defineProperty(v,D,_)}})}function H($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function CD($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}function Z5($,v){let U=$._zod.def,D=U.checks;if(D&&D.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let I=Dv($._zod.def,{get shape(){let G={};for(let J in v){if(!(J in U.shape))throw Error(`Unrecognized key: "${J}"`);if(!v[J])continue;G[J]=U.shape[J]}return Hv(this,"shape",G),G},checks:[]});return L$($,I)}function M5($,v){let U=$._zod.def,D=U.checks;if(D&&D.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let I=Dv($._zod.def,{get shape(){let G={...$._zod.def.shape};for(let J in v){if(!(J in U.shape))throw Error(`Unrecognized key: "${J}"`);if(!v[J])continue;delete G[J]}return Hv(this,"shape",G),G},checks:[]});return L$($,I)}function T5($,v){if(!Fv(v))throw Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0){let I=$._zod.def.shape;for(let G in v)if(Object.getOwnPropertyDescriptor(I,G)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let _=Dv($._zod.def,{get shape(){let I={...$._zod.def.shape,...v};return Hv(this,"shape",I),I}});return L$($,_)}function z5($,v){if(!Fv(v))throw Error("Invalid input to safeExtend: expected a plain object");let U=Dv($._zod.def,{get shape(){let D={...$._zod.def.shape,...v};return Hv(this,"shape",D),D}});return L$($,U)}function A5($,v){let U=Dv($._zod.def,{get shape(){let D={...$._zod.def.shape,...v._zod.def.shape};return Hv(this,"shape",D),D},get catchall(){return v._zod.def.catchall},checks:[]});return L$($,U)}function j5($,v,U){let _=v._zod.def.checks;if(_&&_.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let G=Dv(v._zod.def,{get shape(){let J=v._zod.def.shape,X={...J};if(U)for(let Q in U){if(!(Q in J))throw Error(`Unrecognized key: "${Q}"`);if(!U[Q])continue;X[Q]=$?new $({type:"optional",innerType:J[Q]}):J[Q]}else for(let Q in J)X[Q]=$?new $({type:"optional",innerType:J[Q]}):J[Q];return Hv(this,"shape",X),X},checks:[]});return L$(v,G)}function E5($,v,U){let D=Dv(v._zod.def,{get shape(){let _=v._zod.def.shape,I={..._};if(U)for(let G in U){if(!(G in I))throw Error(`Unrecognized key: "${G}"`);if(!U[G])continue;I[G]=new $({type:"nonoptional",innerType:_[G]})}else for(let G in _)I[G]=new $({type:"nonoptional",innerType:_[G]});return Hv(this,"shape",I),I}});return L$(v,D)}function bv($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function z$($,v){return v.map((U)=>{var D;return(D=U).path??(D.path=[]),U.path.unshift($),U})}function Q6($){return typeof $==="string"?$:$?.message}function F$($,v,U){let D={...$,path:$.path??[]};if(!$.message){let _=Q6($.inst?._zod.def?.error?.($))??Q6(v?.error?.($))??Q6(U.customError?.($))??Q6(U.localeError?.($))??"Invalid input";D.message=_}if(delete D.inst,delete D.continue,!v?.reportInput)delete D.input;return D}function V6($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function O6($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function F($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let U=$;if(U&&Object.getPrototypeOf(U)!==Object.prototype&&"constructor"in U&&U.constructor)return U.constructor.name}}return v}function U4(...$){let[v,U,D]=$;if(typeof v==="string")return{message:v,code:"custom",input:U,inst:D};return{...v}}function x5($){return Object.entries($).filter(([v,U])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function OX($){let v=atob($),U=new Uint8Array(v.length);for(let D=0;D<v.length;D++)U[D]=v.charCodeAt(D);return U}function WX($){let v="";for(let U=0;U<$.length;U++)v+=String.fromCharCode($[U]);return btoa(v)}function R5($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-v.length%4)%4);return OX(v+U)}function C5($){return WX($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function u5($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array(v.length/2);for(let D=0;D<v.length;D+=2)U[D/2]=Number.parseInt(v.slice(D,D+2),16);return U}function y5($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class LX{constructor(...$){}}var VX,N1,ED,S5=($)=>{let v=typeof $;switch(v){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},K6,RD,uD,yD;var A=L(()=>{VX=Symbol("evaluating");N1="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};ED=_4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});K6=new Set(["string","number","symbol"]),RD=new Set(["string","number","bigint","boolean","symbol","undefined"]);uD={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},yD={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function L6($,v=(U)=>U.message){let U={},D=[];for(let _ of $.issues)if(_.path.length>0)U[_.path[0]]=U[_.path[0]]||[],U[_.path[0]].push(v(_));else D.push(v(_));return{formErrors:D,fieldErrors:U}}function N6($,v=(U)=>U.message){let U={_errors:[]},D=(_)=>{for(let I of _.issues)if(I.code==="invalid_union"&&I.errors.length)I.errors.map((G)=>D({issues:G}));else if(I.code==="invalid_key")D({issues:I.issues});else if(I.code==="invalid_element")D({issues:I.issues});else if(I.path.length===0)U._errors.push(v(I));else{let G=U,J=0;while(J<I.path.length){let X=I.path[J];if(J!==I.path.length-1)G[X]=G[X]||{_errors:[]};else G[X]=G[X]||{_errors:[]},G[X]._errors.push(v(I));G=G[X],J++}}};return D($),U}function fD($,v=(U)=>U.message){let U={errors:[]},D=(_,I=[])=>{var G,J;for(let X of _.issues)if(X.code==="invalid_union"&&X.errors.length)X.errors.map((Q)=>D({issues:Q},X.path));else if(X.code==="invalid_key")D({issues:X.issues},X.path);else if(X.code==="invalid_element")D({issues:X.issues},X.path);else{let Q=[...I,...X.path];if(Q.length===0){U.errors.push(v(X));continue}let Y=U,P=0;while(P<Q.length){let V=Q[P],O=P===Q.length-1;if(typeof V==="string")Y.properties??(Y.properties={}),(G=Y.properties)[V]??(G[V]={errors:[]}),Y=Y.properties[V];else Y.items??(Y.items=[]),(J=Y.items)[V]??(J[V]={errors:[]}),Y=Y.items[V];if(O)Y.errors.push(v(X));P++}}};return D($),U}function qX($){let v=[],U=$.map((D)=>typeof D==="object"?D.key:D);for(let D of U)if(typeof D==="number")v.push(`[${D}]`);else if(typeof D==="symbol")v.push(`[${JSON.stringify(String(D))}]`);else if(/[^\w$]/.test(D))v.push(`[${JSON.stringify(D)}]`);else{if(v.length)v.push(".");v.push(D)}return v.join("")}function cD($){let v=[],U=[...$.issues].sort((D,_)=>(D.path??[]).length-(_.path??[]).length);for(let D of U)if(v.push(`✖ ${D.message}`),D.path?.length)v.push(` → at ${qX(D.path)}`);return v.join(`
|
|
17
|
+
`)}var NX=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,v4,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},W6,b$;var hD=L(()=>{$4();A();W6=K("$ZodError",NX),b$=K("$ZodError",NX,{Parent:Error})});var D4=($)=>(v,U,D,_)=>{let I=D?Object.assign(D,{async:!1}):{async:!1},G=v._zod.run({value:U,issues:[]},I);if(G instanceof Promise)throw new o$;if(G.issues.length){let J=new(_?.Err??$)(G.issues.map((X)=>F$(X,I,v$())));throw N1(J,_?.callee),J}return G.value},q1,I4=($)=>async(v,U,D,_)=>{let I=D?Object.assign(D,{async:!0}):{async:!0},G=v._zod.run({value:U,issues:[]},I);if(G instanceof Promise)G=await G;if(G.issues.length){let J=new(_?.Err??$)(G.issues.map((X)=>F$(X,I,v$())));throw N1(J,_?.callee),J}return G.value},k1,G4=($)=>(v,U,D)=>{let _=D?{...D,async:!1}:{async:!1},I=v._zod.run({value:U,issues:[]},_);if(I instanceof Promise)throw new o$;return I.issues.length?{success:!1,error:new($??W6)(I.issues.map((G)=>F$(G,_,v$())))}:{success:!0,data:I.value}},rD,J4=($)=>async(v,U,D)=>{let _=D?Object.assign(D,{async:!0}):{async:!0},I=v._zod.run({value:U,issues:[]},_);if(I instanceof Promise)I=await I;return I.issues.length?{success:!1,error:new $(I.issues.map((G)=>F$(G,_,v$())))}:{success:!0,data:I.value}},mD,H1=($)=>(v,U,D)=>{let _=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return D4($)(v,U,_)},c5,F1=($)=>(v,U,D)=>{return D4($)(v,U,D)},h5,b1=($)=>async(v,U,D)=>{let _=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return I4($)(v,U,_)},r5,g1=($)=>async(v,U,D)=>{return I4($)(v,U,D)},m5,S1=($)=>(v,U,D)=>{let _=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return G4($)(v,U,_)},l5,B1=($)=>(v,U,D)=>{return G4($)(v,U,D)},i5,Z1=($)=>async(v,U,D)=>{let _=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return J4($)(v,U,_)},n5,M1=($)=>async(v,U,D)=>{return J4($)(v,U,D)},d5;var lD=L(()=>{$4();hD();A();q1=D4(b$),k1=I4(b$),rD=G4(b$),mD=J4(b$),c5=H1(b$),h5=F1(b$),r5=b1(b$),m5=g1(b$),l5=S1(b$),i5=B1(b$),n5=Z1(b$),d5=M1(b$)});var f$={};i$(f$,{xid:()=>oD,uuid7:()=>a5,uuid6:()=>p5,uuid4:()=>t5,uuid:()=>fv,uppercase:()=>NI,unicodeEmail:()=>kX,undefined:()=>WI,ulid:()=>dD,time:()=>XI,string:()=>YI,sha512_hex:()=>NO,sha512_base64url:()=>kO,sha512_base64:()=>qO,sha384_hex:()=>OO,sha384_base64url:()=>LO,sha384_base64:()=>WO,sha256_hex:()=>PO,sha256_base64url:()=>VO,sha256_base64:()=>KO,sha1_hex:()=>XO,sha1_base64url:()=>YO,sha1_base64:()=>QO,rfc5322Email:()=>s5,number:()=>q6,null:()=>OI,nanoid:()=>pD,md5_hex:()=>GO,md5_base64url:()=>wO,md5_base64:()=>JO,mac:()=>UI,lowercase:()=>LI,ksuid:()=>tD,ipv6:()=>_I,ipv4:()=>vI,integer:()=>KI,idnEmail:()=>$O,html5Email:()=>e5,hostname:()=>UO,hex:()=>IO,guid:()=>eD,extendedDuration:()=>o5,emoji:()=>$I,email:()=>sD,e164:()=>JI,duration:()=>aD,domain:()=>DO,datetime:()=>QI,date:()=>wI,cuid2:()=>nD,cuid:()=>iD,cidrv6:()=>II,cidrv4:()=>DI,browserEmail:()=>vO,boolean:()=>VI,bigint:()=>PI,base64url:()=>T1,base64:()=>GI});function $I(){return new RegExp(_O,"u")}function FX($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function XI($){return new RegExp(`^${FX($)}$`)}function QI($){let v=FX({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let D=`${v}(?:${U.join("|")})`;return new RegExp(`^${HX}T(?:${D})$`)}function k6($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function H6($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var iD,nD,dD,oD,tD,pD,aD,o5,eD,fv=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},t5,p5,a5,sD,e5,s5,kX,$O,vO,_O="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",vI,_I,UI=($)=>{let v=y$($??":");return new RegExp(`^(?:[0-9A-F]{2}${v}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${v}){5}[0-9a-f]{2}$`)},DI,II,GI,T1,UO,DO,JI,HX="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",wI,YI=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},PI,KI,q6,VI,OI,WI,LI,NI,IO,GO,JO,wO,XO,QO,YO,PO,KO,VO,OO,WO,LO,NO,qO,kO;var z1=L(()=>{A();iD=/^[cC][^\s-]{8,}$/,nD=/^[0-9a-z]+$/,dD=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,oD=/^[0-9a-vA-V]{20}$/,tD=/^[A-Za-z0-9]{27}$/,pD=/^[a-zA-Z0-9_-]{21}$/,aD=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,o5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,eD=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,t5=fv(4),p5=fv(6),a5=fv(7),sD=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,e5=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,s5=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,kX=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,$O=kX,vO=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;vI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_I=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,DI=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,II=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,GI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,T1=/^[A-Za-z0-9_-]*$/,UO=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,DO=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,JI=/^\+[1-9]\d{6,14}$/,wI=new RegExp(`^${HX}$`);PI=/^-?\d+n?$/,KI=/^-?\d+$/,q6=/^-?\d+(?:\.\d+)?$/,VI=/^(?:true|false)$/i,OI=/^null$/i,WI=/^undefined$/i,LI=/^[^A-Z]*$/,NI=/^[^a-z]*$/,IO=/^[0-9a-fA-F]*$/;GO=/^[0-9a-fA-F]{32}$/,JO=k6(22,"=="),wO=H6(22),XO=/^[0-9a-fA-F]{40}$/,QO=k6(27,"="),YO=H6(27),PO=/^[0-9a-fA-F]{64}$/,KO=k6(43,"="),VO=H6(43),OO=/^[0-9a-fA-F]{96}$/,WO=k6(64,""),LO=H6(64),NO=/^[0-9a-fA-F]{128}$/,qO=k6(86,"=="),kO=H6(86)});function bX($,v,U){if($.issues.length)v.issues.push(...z$(U,$.issues))}var d,gX,A1,j1,qI,kI,HI,FI,bI,gI,SI,BI,ZI,w4,MI,TI,zI,AI,jI,EI,xI,RI,CI;var E1=L(()=>{$4();z1();A();d=K("$ZodCheck",($,v)=>{var U;$._zod??($._zod={}),$._zod.def=v,(U=$._zod).onattach??(U.onattach=[])}),gX={number:"number",bigint:"bigint",object:"date"},A1=K("$ZodCheckLessThan",($,v)=>{d.init($,v);let U=gX[typeof v.value];$._zod.onattach.push((D)=>{let _=D._zod.bag,I=(v.inclusive?_.maximum:_.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<I)if(v.inclusive)_.maximum=v.value;else _.exclusiveMaximum=v.value}),$._zod.check=(D)=>{if(v.inclusive?D.value<=v.value:D.value<v.value)return;D.issues.push({origin:U,code:"too_big",maximum:typeof v.value==="object"?v.value.getTime():v.value,input:D.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),j1=K("$ZodCheckGreaterThan",($,v)=>{d.init($,v);let U=gX[typeof v.value];$._zod.onattach.push((D)=>{let _=D._zod.bag,I=(v.inclusive?_.minimum:_.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>I)if(v.inclusive)_.minimum=v.value;else _.exclusiveMinimum=v.value}),$._zod.check=(D)=>{if(v.inclusive?D.value>=v.value:D.value>v.value)return;D.issues.push({origin:U,code:"too_small",minimum:typeof v.value==="object"?v.value.getTime():v.value,input:D.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),qI=K("$ZodCheckMultipleOf",($,v)=>{d.init($,v),$._zod.onattach.push((U)=>{var D;(D=U._zod.bag).multipleOf??(D.multipleOf=v.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%v.value===BigInt(0):AD(U.value,v.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:v.value,input:U.value,inst:$,continue:!v.abort})}}),kI=K("$ZodCheckNumberFormat",($,v)=>{d.init($,v),v.format=v.format||"float64";let U=v.format?.includes("int"),D=U?"int":"number",[_,I]=uD[v.format];$._zod.onattach.push((G)=>{let J=G._zod.bag;if(J.format=v.format,J.minimum=_,J.maximum=I,U)J.pattern=KI}),$._zod.check=(G)=>{let J=G.value;if(U){if(!Number.isInteger(J)){G.issues.push({expected:D,format:v.format,code:"invalid_type",continue:!1,input:J,inst:$});return}if(!Number.isSafeInteger(J)){if(J>0)G.issues.push({input:J,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:D,inclusive:!0,continue:!v.abort});else G.issues.push({input:J,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:D,inclusive:!0,continue:!v.abort});return}}if(J<_)G.issues.push({origin:"number",input:J,code:"too_small",minimum:_,inclusive:!0,inst:$,continue:!v.abort});if(J>I)G.issues.push({origin:"number",input:J,code:"too_big",maximum:I,inclusive:!0,inst:$,continue:!v.abort})}}),HI=K("$ZodCheckBigIntFormat",($,v)=>{d.init($,v);let[U,D]=yD[v.format];$._zod.onattach.push((_)=>{let I=_._zod.bag;I.format=v.format,I.minimum=U,I.maximum=D}),$._zod.check=(_)=>{let I=_.value;if(I<U)_.issues.push({origin:"bigint",input:I,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!v.abort});if(I>D)_.issues.push({origin:"bigint",input:I,code:"too_big",maximum:D,inclusive:!0,inst:$,continue:!v.abort})}}),FI=K("$ZodCheckMaxSize",($,v)=>{var U;d.init($,v),(U=$._zod.def).when??(U.when=(D)=>{let _=D.value;return!kv(_)&&_.size!==void 0}),$._zod.onattach.push((D)=>{let _=D._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<_)D._zod.bag.maximum=v.maximum}),$._zod.check=(D)=>{let _=D.value;if(_.size<=v.maximum)return;D.issues.push({origin:V6(_),code:"too_big",maximum:v.maximum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),bI=K("$ZodCheckMinSize",($,v)=>{var U;d.init($,v),(U=$._zod.def).when??(U.when=(D)=>{let _=D.value;return!kv(_)&&_.size!==void 0}),$._zod.onattach.push((D)=>{let _=D._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>_)D._zod.bag.minimum=v.minimum}),$._zod.check=(D)=>{let _=D.value;if(_.size>=v.minimum)return;D.issues.push({origin:V6(_),code:"too_small",minimum:v.minimum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),gI=K("$ZodCheckSizeEquals",($,v)=>{var U;d.init($,v),(U=$._zod.def).when??(U.when=(D)=>{let _=D.value;return!kv(_)&&_.size!==void 0}),$._zod.onattach.push((D)=>{let _=D._zod.bag;_.minimum=v.size,_.maximum=v.size,_.size=v.size}),$._zod.check=(D)=>{let _=D.value,I=_.size;if(I===v.size)return;let G=I>v.size;D.issues.push({origin:V6(_),...G?{code:"too_big",maximum:v.size}:{code:"too_small",minimum:v.size},inclusive:!0,exact:!0,input:D.value,inst:$,continue:!v.abort})}}),SI=K("$ZodCheckMaxLength",($,v)=>{var U;d.init($,v),(U=$._zod.def).when??(U.when=(D)=>{let _=D.value;return!kv(_)&&_.length!==void 0}),$._zod.onattach.push((D)=>{let _=D._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<_)D._zod.bag.maximum=v.maximum}),$._zod.check=(D)=>{let _=D.value;if(_.length<=v.maximum)return;let G=O6(_);D.issues.push({origin:G,code:"too_big",maximum:v.maximum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),BI=K("$ZodCheckMinLength",($,v)=>{var U;d.init($,v),(U=$._zod.def).when??(U.when=(D)=>{let _=D.value;return!kv(_)&&_.length!==void 0}),$._zod.onattach.push((D)=>{let _=D._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>_)D._zod.bag.minimum=v.minimum}),$._zod.check=(D)=>{let _=D.value;if(_.length>=v.minimum)return;let G=O6(_);D.issues.push({origin:G,code:"too_small",minimum:v.minimum,inclusive:!0,input:_,inst:$,continue:!v.abort})}}),ZI=K("$ZodCheckLengthEquals",($,v)=>{var U;d.init($,v),(U=$._zod.def).when??(U.when=(D)=>{let _=D.value;return!kv(_)&&_.length!==void 0}),$._zod.onattach.push((D)=>{let _=D._zod.bag;_.minimum=v.length,_.maximum=v.length,_.length=v.length}),$._zod.check=(D)=>{let _=D.value,I=_.length;if(I===v.length)return;let G=O6(_),J=I>v.length;D.issues.push({origin:G,...J?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:D.value,inst:$,continue:!v.abort})}}),w4=K("$ZodCheckStringFormat",($,v)=>{var U,D;if(d.init($,v),$._zod.onattach.push((_)=>{let I=_._zod.bag;if(I.format=v.format,v.pattern)I.patterns??(I.patterns=new Set),I.patterns.add(v.pattern)}),v.pattern)(U=$._zod).check??(U.check=(_)=>{if(v.pattern.lastIndex=0,v.pattern.test(_.value))return;_.issues.push({origin:"string",code:"invalid_format",format:v.format,input:_.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(D=$._zod).check??(D.check=()=>{})}),MI=K("$ZodCheckRegex",($,v)=>{w4.init($,v),$._zod.check=(U)=>{if(v.pattern.lastIndex=0,v.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),TI=K("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=LI),w4.init($,v)}),zI=K("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=NI),w4.init($,v)}),AI=K("$ZodCheckIncludes",($,v)=>{d.init($,v);let U=y$(v.includes),D=new RegExp(typeof v.position==="number"?`^.{${v.position}}${U}`:U);v.pattern=D,$._zod.onattach.push((_)=>{let I=_._zod.bag;I.patterns??(I.patterns=new Set),I.patterns.add(D)}),$._zod.check=(_)=>{if(_.value.includes(v.includes,v.position))return;_.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:_.value,inst:$,continue:!v.abort})}}),jI=K("$ZodCheckStartsWith",($,v)=>{d.init($,v);let U=new RegExp(`^${y$(v.prefix)}.*`);v.pattern??(v.pattern=U),$._zod.onattach.push((D)=>{let _=D._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(U)}),$._zod.check=(D)=>{if(D.value.startsWith(v.prefix))return;D.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:D.value,inst:$,continue:!v.abort})}}),EI=K("$ZodCheckEndsWith",($,v)=>{d.init($,v);let U=new RegExp(`.*${y$(v.suffix)}$`);v.pattern??(v.pattern=U),$._zod.onattach.push((D)=>{let _=D._zod.bag;_.patterns??(_.patterns=new Set),_.patterns.add(U)}),$._zod.check=(D)=>{if(D.value.endsWith(v.suffix))return;D.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:D.value,inst:$,continue:!v.abort})}});xI=K("$ZodCheckProperty",($,v)=>{d.init($,v),$._zod.check=(U)=>{let D=v.schema._zod.run({value:U.value[v.property],issues:[]},{});if(D instanceof Promise)return D.then((_)=>bX(_,U,v.property));bX(D,U,v.property);return}}),RI=K("$ZodCheckMimeType",($,v)=>{d.init($,v);let U=new Set(v.mime);$._zod.onattach.push((D)=>{D._zod.bag.mime=v.mime}),$._zod.check=(D)=>{if(U.has(D.value.type))return;D.issues.push({code:"invalid_value",values:v.mime,input:D.value.type,inst:$,continue:!v.abort})}}),CI=K("$ZodCheckOverwrite",($,v)=>{d.init($,v),$._zod.check=(U)=>{U.value=v.tx(U.value)}})});class x1{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
|
|
18
|
+
`).filter((I)=>I),D=Math.min(...U.map((I)=>I.length-I.trimStart().length)),_=U.map((I)=>I.slice(D)).map((I)=>" ".repeat(this.indent*2)+I);for(let I of _)this.content.push(I)}compile(){let $=Function,v=this?.args,D=[...(this?.content??[""]).map((_)=>` ${_}`)];return new $(...v,D.join(`
|
|
19
|
+
`))}}var uI;var yI=L(()=>{uI={major:4,minor:3,patch:6}});function G2($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function uX($){if(!T1.test($))return!1;let v=$.replace(/[-_]/g,(D)=>D==="-"?"+":"/"),U=v.padEnd(Math.ceil(v.length/4)*4,"=");return G2(U)}function yX($,v=null){try{let U=$.split(".");if(U.length!==3)return!1;let[D]=U;if(!D)return!1;let _=JSON.parse(atob(D));if("typ"in _&&_?.typ!=="JWT")return!1;if(!_.alg)return!1;if(v&&(!("alg"in _)||_.alg!==v))return!1;return!0}catch{return!1}}function BX($,v,U){if($.issues.length)v.issues.push(...z$(U,$.issues));v.value[U]=$.value}function f1($,v,U,D,_){if($.issues.length){if(_&&!(U in D))return;v.issues.push(...z$(U,$.issues))}if($.value===void 0){if(U in D)v.value[U]=void 0}else v.value[U]=$.value}function fX($){let v=Object.keys($.shape);for(let D of v)if(!$.shape?.[D]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${D}": expected a Zod schema`);let U=CD($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(U)}}function cX($,v,U,D,_,I){let G=[],J=_.keySet,X=_.catchall._zod,Q=X.def.type,Y=X.optout==="optional";for(let P in v){if(J.has(P))continue;if(Q==="never"){G.push(P);continue}let V=X.run({value:v[P],issues:[]},D);if(V instanceof Promise)$.push(V.then((O)=>f1(O,U,P,v,Y)));else f1(V,U,P,v,Y)}if(G.length)U.issues.push({code:"unrecognized_keys",keys:G,input:v,inst:I});if(!$.length)return U;return Promise.all($).then(()=>{return U})}function ZX($,v,U,D){for(let I of $)if(I.issues.length===0)return v.value=I.value,v;let _=$.filter((I)=>!bv(I));if(_.length===1)return v.value=_[0].value,_[0];return v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:$.map((I)=>I.issues.map((G)=>F$(G,D,v$())))}),v}function MX($,v,U,D){let _=$.filter((I)=>I.issues.length===0);if(_.length===1)return v.value=_[0].value,v;if(_.length===0)v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:$.map((I)=>I.issues.map((G)=>F$(G,D,v$())))});else v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:[],inclusive:!1});return v}function fI($,v){if($===v)return{valid:!0,data:$};if($ instanceof Date&&v instanceof Date&&+$===+v)return{valid:!0,data:$};if(Fv($)&&Fv(v)){let U=Object.keys(v),D=Object.keys($).filter((I)=>U.indexOf(I)!==-1),_={...$,...v};for(let I of D){let G=fI($[I],v[I]);if(!G.valid)return{valid:!1,mergeErrorPath:[I,...G.mergeErrorPath]};_[I]=G.data}return{valid:!0,data:_}}if(Array.isArray($)&&Array.isArray(v)){if($.length!==v.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let D=0;D<$.length;D++){let _=$[D],I=v[D],G=fI(_,I);if(!G.valid)return{valid:!1,mergeErrorPath:[D,...G.mergeErrorPath]};U.push(G.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function TX($,v,U){let D=new Map,_;for(let J of v.issues)if(J.code==="unrecognized_keys"){_??(_=J);for(let X of J.keys){if(!D.has(X))D.set(X,{});D.get(X).l=!0}}else $.issues.push(J);for(let J of U.issues)if(J.code==="unrecognized_keys")for(let X of J.keys){if(!D.has(X))D.set(X,{});D.get(X).r=!0}else $.issues.push(J);let I=[...D].filter(([,J])=>J.l&&J.r).map(([J])=>J);if(I.length&&_)$.issues.push({..._,keys:I});if(bv($))return $;let G=fI(v.value,U.value);if(!G.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(G.mergeErrorPath)}`);return $.value=G.data,$}function R1($,v,U){if($.issues.length)v.issues.push(...z$(U,$.issues));v.value[U]=$.value}function zX($,v,U,D,_,I,G){if($.issues.length)if(K6.has(typeof D))U.issues.push(...z$(D,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:_,inst:I,issues:$.issues.map((J)=>F$(J,G,v$()))});if(v.issues.length)if(K6.has(typeof D))U.issues.push(...z$(D,v.issues));else U.issues.push({origin:"map",code:"invalid_element",input:_,inst:I,key:D,issues:v.issues.map((J)=>F$(J,G,v$()))});U.value.set($.value,v.value)}function AX($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}function jX($,v){if($.issues.length&&v===void 0)return{issues:[],value:void 0};return $}function EX($,v){if($.value===void 0)$.value=v.defaultValue;return $}function xX($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}function C1($,v,U){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues},U)}function u1($,v,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let _=v.transform($.value,$);if(_ instanceof Promise)return _.then((I)=>y1($,I,v.out,U));return y1($,_,v.out,U)}else{let _=v.reverseTransform($.value,$);if(_ instanceof Promise)return _.then((I)=>y1($,I,v.in,U));return y1($,_,v.in,U)}}function y1($,v,U,D){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:v,issues:$.issues},D)}function RX($){return $.value=Object.freeze($.value),$}function CX($,v,U,D){if(!$){let _={code:"custom",input:U,inst:D,path:[...D._zod.def.path??[]],continue:!D._zod.def.abort};if(D._zod.def.params)_.params=D._zod.def.params;v.issues.push(U4(_))}}var E,cv,l,cI,hI,rI,mI,lI,iI,nI,dI,oI,tI,pI,aI,eI,sI,$2,v2,_2,U2,D2,I2,J2,w2,X2,Q2,Y2,c1,P2,F6,h1,K2,V2,O2,W2,L2,N2,q2,k2,H2,F2,hX,b2,b6,g2,S2,B2,r1,Z2,M2,T2,z2,A2,j2,E2,m1,x2,R2,C2,u2,y2,f2,c2,h2,r2,g6,m2,l2,i2,n2,d2,o2;var t2=L(()=>{E1();$4();lD();z1();A();yI();A();E=K("$ZodType",($,v)=>{var U;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=uI;let D=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))D.unshift($);for(let _ of D)for(let I of _._zod.onattach)I($);if(D.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let _=(G,J,X)=>{let Q=bv(G),Y;for(let P of J){if(P._zod.def.when){if(!P._zod.def.when(G))continue}else if(Q)continue;let V=G.issues.length,O=P._zod.check(G);if(O instanceof Promise&&X?.async===!1)throw new o$;if(Y||O instanceof Promise)Y=(Y??Promise.resolve()).then(async()=>{if(await O,G.issues.length===V)return;if(!Q)Q=bv(G,V)});else{if(G.issues.length===V)continue;if(!Q)Q=bv(G,V)}}if(Y)return Y.then(()=>{return G});return G},I=(G,J,X)=>{if(bv(G))return G.aborted=!0,G;let Q=_(J,D,X);if(Q instanceof Promise){if(X.async===!1)throw new o$;return Q.then((Y)=>$._zod.parse(Y,X))}return $._zod.parse(Q,X)};$._zod.run=(G,J)=>{if(J.skipChecks)return $._zod.parse(G,J);if(J.direction==="backward"){let Q=$._zod.parse({value:G.value,issues:[]},{...J,skipChecks:!0});if(Q instanceof Promise)return Q.then((Y)=>{return I(Y,G,J)});return I(Q,G,J)}let X=$._zod.parse(G,J);if(X instanceof Promise){if(J.async===!1)throw new o$;return X.then((Q)=>_(Q,D,J))}return _(X,D,J)}}C($,"~standard",()=>({validate:(_)=>{try{let I=rD($,_);return I.success?{value:I.data}:{issues:I.error?.issues}}catch(I){return mD($,_).then((G)=>G.success?{value:G.data}:{issues:G.error?.issues})}},vendor:"zod",version:1}))}),cv=K("$ZodString",($,v)=>{E.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??YI($._zod.bag),$._zod.parse=(U,D)=>{if(v.coerce)try{U.value=String(U.value)}catch(_){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),l=K("$ZodStringFormat",($,v)=>{w4.init($,v),cv.init($,v)}),cI=K("$ZodGUID",($,v)=>{v.pattern??(v.pattern=eD),l.init($,v)}),hI=K("$ZodUUID",($,v)=>{if(v.version){let D={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[v.version];if(D===void 0)throw Error(`Invalid UUID version: "${v.version}"`);v.pattern??(v.pattern=fv(D))}else v.pattern??(v.pattern=fv());l.init($,v)}),rI=K("$ZodEmail",($,v)=>{v.pattern??(v.pattern=sD),l.init($,v)}),mI=K("$ZodURL",($,v)=>{l.init($,v),$._zod.check=(U)=>{try{let D=U.value.trim(),_=new URL(D);if(v.hostname){if(v.hostname.lastIndex=0,!v.hostname.test(_.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v.hostname.source,input:U.value,inst:$,continue:!v.abort})}if(v.protocol){if(v.protocol.lastIndex=0,!v.protocol.test(_.protocol.endsWith(":")?_.protocol.slice(0,-1):_.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:v.protocol.source,input:U.value,inst:$,continue:!v.abort})}if(v.normalize)U.value=_.href;else U.value=D;return}catch(D){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!v.abort})}}}),lI=K("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=$I()),l.init($,v)}),iI=K("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=pD),l.init($,v)}),nI=K("$ZodCUID",($,v)=>{v.pattern??(v.pattern=iD),l.init($,v)}),dI=K("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=nD),l.init($,v)}),oI=K("$ZodULID",($,v)=>{v.pattern??(v.pattern=dD),l.init($,v)}),tI=K("$ZodXID",($,v)=>{v.pattern??(v.pattern=oD),l.init($,v)}),pI=K("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=tD),l.init($,v)}),aI=K("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=QI(v)),l.init($,v)}),eI=K("$ZodISODate",($,v)=>{v.pattern??(v.pattern=wI),l.init($,v)}),sI=K("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=XI(v)),l.init($,v)}),$2=K("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=aD),l.init($,v)}),v2=K("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=vI),l.init($,v),$._zod.bag.format="ipv4"}),_2=K("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=_I),l.init($,v),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!v.abort})}}}),U2=K("$ZodMAC",($,v)=>{v.pattern??(v.pattern=UI(v.delimiter)),l.init($,v),$._zod.bag.format="mac"}),D2=K("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=DI),l.init($,v)}),I2=K("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=II),l.init($,v),$._zod.check=(U)=>{let D=U.value.split("/");try{if(D.length!==2)throw Error();let[_,I]=D;if(!I)throw Error();let G=Number(I);if(`${G}`!==I)throw Error();if(G<0||G>128)throw Error();new URL(`http://[${_}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!v.abort})}}});J2=K("$ZodBase64",($,v)=>{v.pattern??(v.pattern=GI),l.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(G2(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!v.abort})}});w2=K("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=T1),l.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(uX(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!v.abort})}}),X2=K("$ZodE164",($,v)=>{v.pattern??(v.pattern=JI),l.init($,v)});Q2=K("$ZodJWT",($,v)=>{l.init($,v),$._zod.check=(U)=>{if(yX(U.value,v.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!v.abort})}}),Y2=K("$ZodCustomStringFormat",($,v)=>{l.init($,v),$._zod.check=(U)=>{if(v.fn(U.value))return;U.issues.push({code:"invalid_format",format:v.format,input:U.value,inst:$,continue:!v.abort})}}),c1=K("$ZodNumber",($,v)=>{E.init($,v),$._zod.pattern=$._zod.bag.pattern??q6,$._zod.parse=(U,D)=>{if(v.coerce)try{U.value=Number(U.value)}catch(G){}let _=U.value;if(typeof _==="number"&&!Number.isNaN(_)&&Number.isFinite(_))return U;let I=typeof _==="number"?Number.isNaN(_)?"NaN":!Number.isFinite(_)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:_,inst:$,...I?{received:I}:{}}),U}}),P2=K("$ZodNumberFormat",($,v)=>{kI.init($,v),c1.init($,v)}),F6=K("$ZodBoolean",($,v)=>{E.init($,v),$._zod.pattern=VI,$._zod.parse=(U,D)=>{if(v.coerce)try{U.value=Boolean(U.value)}catch(I){}let _=U.value;if(typeof _==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:_,inst:$}),U}}),h1=K("$ZodBigInt",($,v)=>{E.init($,v),$._zod.pattern=PI,$._zod.parse=(U,D)=>{if(v.coerce)try{U.value=BigInt(U.value)}catch(_){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),K2=K("$ZodBigIntFormat",($,v)=>{HI.init($,v),h1.init($,v)}),V2=K("$ZodSymbol",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{let _=U.value;if(typeof _==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:_,inst:$}),U}}),O2=K("$ZodUndefined",($,v)=>{E.init($,v),$._zod.pattern=WI,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,D)=>{let _=U.value;if(typeof _>"u")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:_,inst:$}),U}}),W2=K("$ZodNull",($,v)=>{E.init($,v),$._zod.pattern=OI,$._zod.values=new Set([null]),$._zod.parse=(U,D)=>{let _=U.value;if(_===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:_,inst:$}),U}}),L2=K("$ZodAny",($,v)=>{E.init($,v),$._zod.parse=(U)=>U}),N2=K("$ZodUnknown",($,v)=>{E.init($,v),$._zod.parse=(U)=>U}),q2=K("$ZodNever",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),k2=K("$ZodVoid",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{let _=U.value;if(typeof _>"u")return U;return U.issues.push({expected:"void",code:"invalid_type",input:_,inst:$}),U}}),H2=K("$ZodDate",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{if(v.coerce)try{U.value=new Date(U.value)}catch(J){}let _=U.value,I=_ instanceof Date;if(I&&!Number.isNaN(_.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:_,...I?{received:"Invalid Date"}:{},inst:$}),U}});F2=K("$ZodArray",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{let _=U.value;if(!Array.isArray(_))return U.issues.push({expected:"array",code:"invalid_type",input:_,inst:$}),U;U.value=Array(_.length);let I=[];for(let G=0;G<_.length;G++){let J=_[G],X=v.element._zod.run({value:J,issues:[]},D);if(X instanceof Promise)I.push(X.then((Q)=>BX(Q,U,G)));else BX(X,U,G)}if(I.length)return Promise.all(I).then(()=>U);return U}});hX=K("$ZodObject",($,v)=>{if(E.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let J=v.shape;Object.defineProperty(v,"shape",{get:()=>{let X={...J};return Object.defineProperty(v,"shape",{value:X}),X}})}let D=_4(()=>fX(v));C($._zod,"propValues",()=>{let J=v.shape,X={};for(let Q in J){let Y=J[Q]._zod;if(Y.values){X[Q]??(X[Q]=new Set);for(let P of Y.values)X[Q].add(P)}}return X});let _=yv,I=v.catchall,G;$._zod.parse=(J,X)=>{G??(G=D.value);let Q=J.value;if(!_(Q))return J.issues.push({expected:"object",code:"invalid_type",input:Q,inst:$}),J;J.value={};let Y=[],P=G.shape;for(let V of G.keys){let O=P[V],S=O._zod.optout==="optional",B=O._zod.run({value:Q[V],issues:[]},X);if(B instanceof Promise)Y.push(B.then((h)=>f1(h,J,V,Q,S)));else f1(B,J,V,Q,S)}if(!I)return Y.length?Promise.all(Y).then(()=>J):J;return cX(Y,Q,J,X,D.value,$)}}),b2=K("$ZodObjectJIT",($,v)=>{hX.init($,v);let U=$._zod.parse,D=_4(()=>fX(v)),_=(V)=>{let O=new x1(["shape","payload","ctx"]),S=D.value,B=($$)=>{let V$=L1($$);return`shape[${V$}]._zod.run({ value: input[${V$}], issues: [] }, ctx)`};O.write("const input = payload.value;");let h=Object.create(null),p=0;for(let $$ of S.keys)h[$$]=`key_${p++}`;O.write("const newResult = {};");for(let $$ of S.keys){let V$=h[$$],M$=L1($$),KV=V[$$]?._zod?.optout==="optional";if(O.write(`const ${V$} = ${B($$)};`),KV)O.write(`
|
|
20
|
+
if (${V$}.issues.length) {
|
|
21
|
+
if (${M$} in input) {
|
|
22
|
+
payload.issues = payload.issues.concat(${V$}.issues.map(iss => ({
|
|
23
|
+
...iss,
|
|
24
|
+
path: iss.path ? [${M$}, ...iss.path] : [${M$}]
|
|
25
|
+
})));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (${V$}.value === undefined) {
|
|
30
|
+
if (${M$} in input) {
|
|
31
|
+
newResult[${M$}] = undefined;
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
newResult[${M$}] = ${V$}.value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
`);else O.write(`
|
|
38
|
+
if (${V$}.issues.length) {
|
|
39
|
+
payload.issues = payload.issues.concat(${V$}.issues.map(iss => ({
|
|
40
|
+
...iss,
|
|
41
|
+
path: iss.path ? [${M$}, ...iss.path] : [${M$}]
|
|
42
|
+
})));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (${V$}.value === undefined) {
|
|
46
|
+
if (${M$} in input) {
|
|
47
|
+
newResult[${M$}] = undefined;
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
newResult[${M$}] = ${V$}.value;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
`)}O.write("payload.value = newResult;"),O.write("return payload;");let X$=O.compile();return($$,V$)=>X$(V,$$,V$)},I,G=yv,J=!X6.jitless,Q=J&&ED.value,Y=v.catchall,P;$._zod.parse=(V,O)=>{P??(P=D.value);let S=V.value;if(!G(S))return V.issues.push({expected:"object",code:"invalid_type",input:S,inst:$}),V;if(J&&Q&&O?.async===!1&&O.jitless!==!0){if(!I)I=_(v.shape);if(V=I(V,O),!Y)return V;return cX([],S,V,O,P,$)}return U(V,O)}});b6=K("$ZodUnion",($,v)=>{E.init($,v),C($._zod,"optin",()=>v.options.some((_)=>_._zod.optin==="optional")?"optional":void 0),C($._zod,"optout",()=>v.options.some((_)=>_._zod.optout==="optional")?"optional":void 0),C($._zod,"values",()=>{if(v.options.every((_)=>_._zod.values))return new Set(v.options.flatMap((_)=>Array.from(_._zod.values)));return}),C($._zod,"pattern",()=>{if(v.options.every((_)=>_._zod.pattern)){let _=v.options.map((I)=>I._zod.pattern);return new RegExp(`^(${_.map((I)=>P6(I.source)).join("|")})$`)}return});let U=v.options.length===1,D=v.options[0]._zod.run;$._zod.parse=(_,I)=>{if(U)return D(_,I);let G=!1,J=[];for(let X of v.options){let Q=X._zod.run({value:_.value,issues:[]},I);if(Q instanceof Promise)J.push(Q),G=!0;else{if(Q.issues.length===0)return Q;J.push(Q)}}if(!G)return ZX(J,_,$,I);return Promise.all(J).then((X)=>{return ZX(X,_,$,I)})}});g2=K("$ZodXor",($,v)=>{b6.init($,v),v.inclusive=!1;let U=v.options.length===1,D=v.options[0]._zod.run;$._zod.parse=(_,I)=>{if(U)return D(_,I);let G=!1,J=[];for(let X of v.options){let Q=X._zod.run({value:_.value,issues:[]},I);if(Q instanceof Promise)J.push(Q),G=!0;else J.push(Q)}if(!G)return MX(J,_,$,I);return Promise.all(J).then((X)=>{return MX(X,_,$,I)})}}),S2=K("$ZodDiscriminatedUnion",($,v)=>{v.inclusive=!1,b6.init($,v);let U=$._zod.parse;C($._zod,"propValues",()=>{let _={};for(let I of v.options){let G=I._zod.propValues;if(!G||Object.keys(G).length===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(I)}"`);for(let[J,X]of Object.entries(G)){if(!_[J])_[J]=new Set;for(let Q of X)_[J].add(Q)}}return _});let D=_4(()=>{let _=v.options,I=new Map;for(let G of _){let J=G._zod.propValues?.[v.discriminator];if(!J||J.size===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(G)}"`);for(let X of J){if(I.has(X))throw Error(`Duplicate discriminator value "${String(X)}"`);I.set(X,G)}}return I});$._zod.parse=(_,I)=>{let G=_.value;if(!yv(G))return _.issues.push({code:"invalid_type",expected:"object",input:G,inst:$}),_;let J=D.value.get(G?.[v.discriminator]);if(J)return J._zod.run(_,I);if(v.unionFallback)return U(_,I);return _.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:v.discriminator,input:G,path:[v.discriminator],inst:$}),_}}),B2=K("$ZodIntersection",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{let _=U.value,I=v.left._zod.run({value:_,issues:[]},D),G=v.right._zod.run({value:_,issues:[]},D);if(I instanceof Promise||G instanceof Promise)return Promise.all([I,G]).then(([X,Q])=>{return TX(U,X,Q)});return TX(U,I,G)}});r1=K("$ZodTuple",($,v)=>{E.init($,v);let U=v.items;$._zod.parse=(D,_)=>{let I=D.value;if(!Array.isArray(I))return D.issues.push({input:I,inst:$,expected:"tuple",code:"invalid_type"}),D;D.value=[];let G=[],J=[...U].reverse().findIndex((Y)=>Y._zod.optin!=="optional"),X=J===-1?0:U.length-J;if(!v.rest){let Y=I.length>U.length,P=I.length<X-1;if(Y||P)return D.issues.push({...Y?{code:"too_big",maximum:U.length,inclusive:!0}:{code:"too_small",minimum:U.length},input:I,inst:$,origin:"array"}),D}let Q=-1;for(let Y of U){if(Q++,Q>=I.length){if(Q>=X)continue}let P=Y._zod.run({value:I[Q],issues:[]},_);if(P instanceof Promise)G.push(P.then((V)=>R1(V,D,Q)));else R1(P,D,Q)}if(v.rest){let Y=I.slice(U.length);for(let P of Y){Q++;let V=v.rest._zod.run({value:P,issues:[]},_);if(V instanceof Promise)G.push(V.then((O)=>R1(O,D,Q)));else R1(V,D,Q)}}if(G.length)return Promise.all(G).then(()=>D);return D}});Z2=K("$ZodRecord",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{let _=U.value;if(!Fv(_))return U.issues.push({expected:"record",code:"invalid_type",input:_,inst:$}),U;let I=[],G=v.keyType._zod.values;if(G){U.value={};let J=new Set;for(let Q of G)if(typeof Q==="string"||typeof Q==="number"||typeof Q==="symbol"){J.add(typeof Q==="number"?Q.toString():Q);let Y=v.valueType._zod.run({value:_[Q],issues:[]},D);if(Y instanceof Promise)I.push(Y.then((P)=>{if(P.issues.length)U.issues.push(...z$(Q,P.issues));U.value[Q]=P.value}));else{if(Y.issues.length)U.issues.push(...z$(Q,Y.issues));U.value[Q]=Y.value}}let X;for(let Q in _)if(!J.has(Q))X=X??[],X.push(Q);if(X&&X.length>0)U.issues.push({code:"unrecognized_keys",input:_,inst:$,keys:X})}else{U.value={};for(let J of Reflect.ownKeys(_)){if(J==="__proto__")continue;let X=v.keyType._zod.run({value:J,issues:[]},D);if(X instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof J==="string"&&q6.test(J)&&X.issues.length){let P=v.keyType._zod.run({value:Number(J),issues:[]},D);if(P instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(P.issues.length===0)X=P}if(X.issues.length){if(v.mode==="loose")U.value[J]=_[J];else U.issues.push({code:"invalid_key",origin:"record",issues:X.issues.map((P)=>F$(P,D,v$())),input:J,path:[J],inst:$});continue}let Y=v.valueType._zod.run({value:_[J],issues:[]},D);if(Y instanceof Promise)I.push(Y.then((P)=>{if(P.issues.length)U.issues.push(...z$(J,P.issues));U.value[X.value]=P.value}));else{if(Y.issues.length)U.issues.push(...z$(J,Y.issues));U.value[X.value]=Y.value}}}if(I.length)return Promise.all(I).then(()=>U);return U}}),M2=K("$ZodMap",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{let _=U.value;if(!(_ instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:_,inst:$}),U;let I=[];U.value=new Map;for(let[G,J]of _){let X=v.keyType._zod.run({value:G,issues:[]},D),Q=v.valueType._zod.run({value:J,issues:[]},D);if(X instanceof Promise||Q instanceof Promise)I.push(Promise.all([X,Q]).then(([Y,P])=>{zX(Y,P,U,G,_,$,D)}));else zX(X,Q,U,G,_,$,D)}if(I.length)return Promise.all(I).then(()=>U);return U}});T2=K("$ZodSet",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{let _=U.value;if(!(_ instanceof Set))return U.issues.push({input:_,inst:$,expected:"set",code:"invalid_type"}),U;let I=[];U.value=new Set;for(let G of _){let J=v.valueType._zod.run({value:G,issues:[]},D);if(J instanceof Promise)I.push(J.then((X)=>AX(X,U)));else AX(J,U)}if(I.length)return Promise.all(I).then(()=>U);return U}});z2=K("$ZodEnum",($,v)=>{E.init($,v);let U=Y6(v.entries),D=new Set(U);$._zod.values=D,$._zod.pattern=new RegExp(`^(${U.filter((_)=>K6.has(typeof _)).map((_)=>typeof _==="string"?y$(_):_.toString()).join("|")})$`),$._zod.parse=(_,I)=>{let G=_.value;if(D.has(G))return _;return _.issues.push({code:"invalid_value",values:U,input:G,inst:$}),_}}),A2=K("$ZodLiteral",($,v)=>{if(E.init($,v),v.values.length===0)throw Error("Cannot create literal schema with no valid values");let U=new Set(v.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${v.values.map((D)=>typeof D==="string"?y$(D):D?y$(D.toString()):String(D)).join("|")})$`),$._zod.parse=(D,_)=>{let I=D.value;if(U.has(I))return D;return D.issues.push({code:"invalid_value",values:v.values,input:I,inst:$}),D}}),j2=K("$ZodFile",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{let _=U.value;if(_ instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:_,inst:$}),U}}),E2=K("$ZodTransform",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new uv($.constructor.name);let _=v.transform(U.value,U);if(D.async)return(_ instanceof Promise?_:Promise.resolve(_)).then((G)=>{return U.value=G,U});if(_ instanceof Promise)throw new o$;return U.value=_,U}});m1=K("$ZodOptional",($,v)=>{E.init($,v),$._zod.optin="optional",$._zod.optout="optional",C($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,void 0]):void 0}),C($._zod,"pattern",()=>{let U=v.innerType._zod.pattern;return U?new RegExp(`^(${P6(U.source)})?$`):void 0}),$._zod.parse=(U,D)=>{if(v.innerType._zod.optin==="optional"){let _=v.innerType._zod.run(U,D);if(_ instanceof Promise)return _.then((I)=>jX(I,U.value));return jX(_,U.value)}if(U.value===void 0)return U;return v.innerType._zod.run(U,D)}}),x2=K("$ZodExactOptional",($,v)=>{m1.init($,v),C($._zod,"values",()=>v.innerType._zod.values),C($._zod,"pattern",()=>v.innerType._zod.pattern),$._zod.parse=(U,D)=>{return v.innerType._zod.run(U,D)}}),R2=K("$ZodNullable",($,v)=>{E.init($,v),C($._zod,"optin",()=>v.innerType._zod.optin),C($._zod,"optout",()=>v.innerType._zod.optout),C($._zod,"pattern",()=>{let U=v.innerType._zod.pattern;return U?new RegExp(`^(${P6(U.source)}|null)$`):void 0}),C($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,null]):void 0}),$._zod.parse=(U,D)=>{if(U.value===null)return U;return v.innerType._zod.run(U,D)}}),C2=K("$ZodDefault",($,v)=>{E.init($,v),$._zod.optin="optional",C($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(U,D)=>{if(D.direction==="backward")return v.innerType._zod.run(U,D);if(U.value===void 0)return U.value=v.defaultValue,U;let _=v.innerType._zod.run(U,D);if(_ instanceof Promise)return _.then((I)=>EX(I,v));return EX(_,v)}});u2=K("$ZodPrefault",($,v)=>{E.init($,v),$._zod.optin="optional",C($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(U,D)=>{if(D.direction==="backward")return v.innerType._zod.run(U,D);if(U.value===void 0)U.value=v.defaultValue;return v.innerType._zod.run(U,D)}}),y2=K("$ZodNonOptional",($,v)=>{E.init($,v),C($._zod,"values",()=>{let U=v.innerType._zod.values;return U?new Set([...U].filter((D)=>D!==void 0)):void 0}),$._zod.parse=(U,D)=>{let _=v.innerType._zod.run(U,D);if(_ instanceof Promise)return _.then((I)=>xX(I,$));return xX(_,$)}});f2=K("$ZodSuccess",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new uv("ZodSuccess");let _=v.innerType._zod.run(U,D);if(_ instanceof Promise)return _.then((I)=>{return U.value=I.issues.length===0,U});return U.value=_.issues.length===0,U}}),c2=K("$ZodCatch",($,v)=>{E.init($,v),C($._zod,"optin",()=>v.innerType._zod.optin),C($._zod,"optout",()=>v.innerType._zod.optout),C($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(U,D)=>{if(D.direction==="backward")return v.innerType._zod.run(U,D);let _=v.innerType._zod.run(U,D);if(_ instanceof Promise)return _.then((I)=>{if(U.value=I.value,I.issues.length)U.value=v.catchValue({...U,error:{issues:I.issues.map((G)=>F$(G,D,v$()))},input:U.value}),U.issues=[];return U});if(U.value=_.value,_.issues.length)U.value=v.catchValue({...U,error:{issues:_.issues.map((I)=>F$(I,D,v$()))},input:U.value}),U.issues=[];return U}}),h2=K("$ZodNaN",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{if(typeof U.value!=="number"||!Number.isNaN(U.value))return U.issues.push({input:U.value,inst:$,expected:"nan",code:"invalid_type"}),U;return U}}),r2=K("$ZodPipe",($,v)=>{E.init($,v),C($._zod,"values",()=>v.in._zod.values),C($._zod,"optin",()=>v.in._zod.optin),C($._zod,"optout",()=>v.out._zod.optout),C($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(U,D)=>{if(D.direction==="backward"){let I=v.out._zod.run(U,D);if(I instanceof Promise)return I.then((G)=>C1(G,v.in,D));return C1(I,v.in,D)}let _=v.in._zod.run(U,D);if(_ instanceof Promise)return _.then((I)=>C1(I,v.out,D));return C1(_,v.out,D)}});g6=K("$ZodCodec",($,v)=>{E.init($,v),C($._zod,"values",()=>v.in._zod.values),C($._zod,"optin",()=>v.in._zod.optin),C($._zod,"optout",()=>v.out._zod.optout),C($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(U,D)=>{if((D.direction||"forward")==="forward"){let I=v.in._zod.run(U,D);if(I instanceof Promise)return I.then((G)=>u1(G,v,D));return u1(I,v,D)}else{let I=v.out._zod.run(U,D);if(I instanceof Promise)return I.then((G)=>u1(G,v,D));return u1(I,v,D)}}});m2=K("$ZodReadonly",($,v)=>{E.init($,v),C($._zod,"propValues",()=>v.innerType._zod.propValues),C($._zod,"values",()=>v.innerType._zod.values),C($._zod,"optin",()=>v.innerType?._zod?.optin),C($._zod,"optout",()=>v.innerType?._zod?.optout),$._zod.parse=(U,D)=>{if(D.direction==="backward")return v.innerType._zod.run(U,D);let _=v.innerType._zod.run(U,D);if(_ instanceof Promise)return _.then(RX);return RX(_)}});l2=K("$ZodTemplateLiteral",($,v)=>{E.init($,v);let U=[];for(let D of v.parts)if(typeof D==="object"&&D!==null){if(!D._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...D._zod.traits].shift()}`);let _=D._zod.pattern instanceof RegExp?D._zod.pattern.source:D._zod.pattern;if(!_)throw Error(`Invalid template literal part: ${D._zod.traits}`);let I=_.startsWith("^")?1:0,G=_.endsWith("$")?_.length-1:_.length;U.push(_.slice(I,G))}else if(D===null||RD.has(typeof D))U.push(y$(`${D}`));else throw Error(`Invalid template literal part: ${D}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(D,_)=>{if(typeof D.value!=="string")return D.issues.push({input:D.value,inst:$,expected:"string",code:"invalid_type"}),D;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(D.value))return D.issues.push({input:D.value,inst:$,code:"invalid_format",format:v.format??"template_literal",pattern:$._zod.pattern.source}),D;return D}}),i2=K("$ZodFunction",($,v)=>{return E.init($,v),$._def=v,$._zod.def=v,$.implement=(U)=>{if(typeof U!=="function")throw Error("implement() must be called with a function");return function(...D){let _=$._def.input?q1($._def.input,D):D,I=Reflect.apply(U,this,_);if($._def.output)return q1($._def.output,I);return I}},$.implementAsync=(U)=>{if(typeof U!=="function")throw Error("implementAsync() must be called with a function");return async function(...D){let _=$._def.input?await k1($._def.input,D):D,I=await Reflect.apply(U,this,_);if($._def.output)return await k1($._def.output,I);return I}},$._zod.parse=(U,D)=>{if(typeof U.value!=="function")return U.issues.push({code:"invalid_type",expected:"function",input:U.value,inst:$}),U;if($._def.output&&$._def.output._zod.def.type==="promise")U.value=$.implementAsync(U.value);else U.value=$.implement(U.value);return U},$.input=(...U)=>{let D=$.constructor;if(Array.isArray(U[0]))return new D({type:"function",input:new r1({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new D({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),n2=K("$ZodPromise",($,v)=>{E.init($,v),$._zod.parse=(U,D)=>{return Promise.resolve(U.value).then((_)=>v.innerType._zod.run({value:_,issues:[]},D))}}),d2=K("$ZodLazy",($,v)=>{E.init($,v),C($._zod,"innerType",()=>v.getter()),C($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),C($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),C($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),C($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,D)=>{return $._zod.innerType._zod.run(U,D)}}),o2=K("$ZodCustom",($,v)=>{d.init($,v),E.init($,v),$._zod.parse=(U,D)=>{return U},$._zod.check=(U)=>{let D=U.value,_=v.fn(D);if(_ instanceof Promise)return _.then((I)=>CX(I,U,D,$));CX(_,U,D,$);return}})});function p2(){return{localeError:FO()}}var FO=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function v(_){return $[_]??null}let U={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},D={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${_.expected}، ولكن تم إدخال ${J}`;return`مدخلات غير مقبولة: يفترض إدخال ${I}، ولكن تم إدخال ${J}`}case"invalid_value":if(_.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${H(_.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return` أكبر من اللازم: يفترض أن تكون ${_.origin??"القيمة"} ${I} ${_.maximum.toString()} ${G.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${_.origin??"القيمة"} ${I} ${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`أصغر من اللازم: يفترض لـ ${_.origin} أن يكون ${I} ${_.minimum.toString()} ${G.unit}`;return`أصغر من اللازم: يفترض لـ ${_.origin} أن يكون ${I} ${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${_.prefix}"`;if(I.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${I.suffix}"`;if(I.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${I.includes}"`;if(I.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${I.pattern}`;return`${U[I.format]??_.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${_.divisor}`;case"unrecognized_keys":return`معرف${_.keys.length>1?"ات":""} غريب${_.keys.length>1?"ة":""}: ${W(_.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${_.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${_.origin}`;default:return"مدخل غير مقبول"}}};var rX=L(()=>{A()});function a2(){return{localeError:bO()}}var bO=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function v(_){return $[_]??null}let U={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",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},D={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Yanlış dəyər: gözlənilən instanceof ${_.expected}, daxil olan ${J}`;return`Yanlış dəyər: gözlənilən ${I}, daxil olan ${J}`}case"invalid_value":if(_.values.length===1)return`Yanlış dəyər: gözlənilən ${H(_.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Çox böyük: gözlənilən ${_.origin??"dəyər"} ${I}${_.maximum.toString()} ${G.unit??"element"}`;return`Çox böyük: gözlənilən ${_.origin??"dəyər"} ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Çox kiçik: gözlənilən ${_.origin} ${I}${_.minimum.toString()} ${G.unit}`;return`Çox kiçik: gözlənilən ${_.origin} ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Yanlış mətn: "${I.prefix}" ilə başlamalıdır`;if(I.format==="ends_with")return`Yanlış mətn: "${I.suffix}" ilə bitməlidir`;if(I.format==="includes")return`Yanlış mətn: "${I.includes}" daxil olmalıdır`;if(I.format==="regex")return`Yanlış mətn: ${I.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${U[I.format]??_.format}`}case"not_multiple_of":return`Yanlış ədəd: ${_.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${_.keys.length>1?"lar":""}: ${W(_.keys,", ")}`;case"invalid_key":return`${_.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${_.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};var mX=L(()=>{A()});function lX($,v,U,D){let _=Math.abs($),I=_%10,G=_%100;if(G>=11&&G<=19)return D;if(I===1)return v;if(I>=2&&I<=4)return U;return D}function e2(){return{localeError:gO()}}var gO=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function v(_){return $[_]??null}let U={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},D={nan:"NaN",number:"лік",array:"масіў"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Няправільны ўвод: чакаўся instanceof ${_.expected}, атрымана ${J}`;return`Няправільны ўвод: чакаўся ${I}, атрымана ${J}`}case"invalid_value":if(_.values.length===1)return`Няправільны ўвод: чакалася ${H(_.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G){let J=Number(_.maximum),X=lX(J,G.unit.one,G.unit.few,G.unit.many);return`Занадта вялікі: чакалася, што ${_.origin??"значэнне"} павінна ${G.verb} ${I}${_.maximum.toString()} ${X}`}return`Занадта вялікі: чакалася, што ${_.origin??"значэнне"} павінна быць ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G){let J=Number(_.minimum),X=lX(J,G.unit.one,G.unit.few,G.unit.many);return`Занадта малы: чакалася, што ${_.origin} павінна ${G.verb} ${I}${_.minimum.toString()} ${X}`}return`Занадта малы: чакалася, што ${_.origin} павінна быць ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${I.prefix}"`;if(I.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${I.suffix}"`;if(I.format==="includes")return`Няправільны радок: павінен змяшчаць "${I.includes}"`;if(I.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${I.pattern}`;return`Няправільны ${U[I.format]??_.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${_.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${_.keys.length>1?"ключы":"ключ"}: ${W(_.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${_.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${_.origin}`;default:return"Няправільны ўвод"}}};var iX=L(()=>{A()});function s2(){return{localeError:SO()}}var SO=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function v(_){return $[_]??null}let U={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},D={nan:"NaN",number:"число",array:"масив"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Невалиден вход: очакван instanceof ${_.expected}, получен ${J}`;return`Невалиден вход: очакван ${I}, получен ${J}`}case"invalid_value":if(_.values.length===1)return`Невалиден вход: очакван ${H(_.values[0])}`;return`Невалидна опция: очаквано едно от ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Твърде голямо: очаква се ${_.origin??"стойност"} да съдържа ${I}${_.maximum.toString()} ${G.unit??"елемента"}`;return`Твърде голямо: очаква се ${_.origin??"стойност"} да бъде ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Твърде малко: очаква се ${_.origin} да съдържа ${I}${_.minimum.toString()} ${G.unit}`;return`Твърде малко: очаква се ${_.origin} да бъде ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Невалиден низ: трябва да започва с "${I.prefix}"`;if(I.format==="ends_with")return`Невалиден низ: трябва да завършва с "${I.suffix}"`;if(I.format==="includes")return`Невалиден низ: трябва да включва "${I.includes}"`;if(I.format==="regex")return`Невалиден низ: трябва да съвпада с ${I.pattern}`;let G="Невалиден";if(I.format==="emoji")G="Невалидно";if(I.format==="datetime")G="Невалидно";if(I.format==="date")G="Невалидна";if(I.format==="time")G="Невалидно";if(I.format==="duration")G="Невалидна";return`${G} ${U[I.format]??_.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${_.divisor}`;case"unrecognized_keys":return`Неразпознат${_.keys.length>1?"и":""} ключ${_.keys.length>1?"ове":""}: ${W(_.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${_.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${_.origin}`;default:return"Невалиден вход"}}};var nX=L(()=>{A()});function $0(){return{localeError:BO()}}var BO=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function v(_){return $[_]??null}let U={regex:"entrada",email:"adreça electrònica",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:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},D={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Tipus invàlid: s'esperava instanceof ${_.expected}, s'ha rebut ${J}`;return`Tipus invàlid: s'esperava ${I}, s'ha rebut ${J}`}case"invalid_value":if(_.values.length===1)return`Valor invàlid: s'esperava ${H(_.values[0])}`;return`Opció invàlida: s'esperava una de ${W(_.values," o ")}`;case"too_big":{let I=_.inclusive?"com a màxim":"menys de",G=v(_.origin);if(G)return`Massa gran: s'esperava que ${_.origin??"el valor"} contingués ${I} ${_.maximum.toString()} ${G.unit??"elements"}`;return`Massa gran: s'esperava que ${_.origin??"el valor"} fos ${I} ${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?"com a mínim":"més de",G=v(_.origin);if(G)return`Massa petit: s'esperava que ${_.origin} contingués ${I} ${_.minimum.toString()} ${G.unit}`;return`Massa petit: s'esperava que ${_.origin} fos ${I} ${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Format invàlid: ha de començar amb "${I.prefix}"`;if(I.format==="ends_with")return`Format invàlid: ha d'acabar amb "${I.suffix}"`;if(I.format==="includes")return`Format invàlid: ha d'incloure "${I.includes}"`;if(I.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${I.pattern}`;return`Format invàlid per a ${U[I.format]??_.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${_.divisor}`;case"unrecognized_keys":return`Clau${_.keys.length>1?"s":""} no reconeguda${_.keys.length>1?"s":""}: ${W(_.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${_.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${_.origin}`;default:return"Entrada invàlida"}}};var dX=L(()=>{A()});function v0(){return{localeError:ZO()}}var ZO=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function v(_){return $[_]??null}let U={regex:"regulární výraz",email:"e-mailová adresa",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:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},D={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Neplatný vstup: očekáváno instanceof ${_.expected}, obdrženo ${J}`;return`Neplatný vstup: očekáváno ${I}, obdrženo ${J}`}case"invalid_value":if(_.values.length===1)return`Neplatný vstup: očekáváno ${H(_.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Hodnota je příliš velká: ${_.origin??"hodnota"} musí mít ${I}${_.maximum.toString()} ${G.unit??"prvků"}`;return`Hodnota je příliš velká: ${_.origin??"hodnota"} musí být ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Hodnota je příliš malá: ${_.origin??"hodnota"} musí mít ${I}${_.minimum.toString()} ${G.unit??"prvků"}`;return`Hodnota je příliš malá: ${_.origin??"hodnota"} musí být ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Neplatný řetězec: musí začínat na "${I.prefix}"`;if(I.format==="ends_with")return`Neplatný řetězec: musí končit na "${I.suffix}"`;if(I.format==="includes")return`Neplatný řetězec: musí obsahovat "${I.includes}"`;if(I.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${I.pattern}`;return`Neplatný formát ${U[I.format]??_.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${_.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${W(_.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${_.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${_.origin}`;default:return"Neplatný vstup"}}};var oX=L(()=>{A()});function _0(){return{localeError:MO()}}var MO=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function v(_){return $[_]??null}let U={regex:"input",email:"e-mailadresse",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 dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},D={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Ugyldigt input: forventede instanceof ${_.expected}, fik ${J}`;return`Ugyldigt input: forventede ${I}, fik ${J}`}case"invalid_value":if(_.values.length===1)return`Ugyldig værdi: forventede ${H(_.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin),J=D[_.origin]??_.origin;if(G)return`For stor: forventede ${J??"value"} ${G.verb} ${I} ${_.maximum.toString()} ${G.unit??"elementer"}`;return`For stor: forventede ${J??"value"} havde ${I} ${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin),J=D[_.origin]??_.origin;if(G)return`For lille: forventede ${J} ${G.verb} ${I} ${_.minimum.toString()} ${G.unit}`;return`For lille: forventede ${J} havde ${I} ${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Ugyldig streng: skal starte med "${I.prefix}"`;if(I.format==="ends_with")return`Ugyldig streng: skal ende med "${I.suffix}"`;if(I.format==="includes")return`Ugyldig streng: skal indeholde "${I.includes}"`;if(I.format==="regex")return`Ugyldig streng: skal matche mønsteret ${I.pattern}`;return`Ugyldig ${U[I.format]??_.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${W(_.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${_.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${_.origin}`;default:return"Ugyldigt input"}}};var tX=L(()=>{A()});function U0(){return{localeError:TO()}}var TO=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function v(_){return $[_]??null}let U={regex:"Eingabe",email:"E-Mail-Adresse",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-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},D={nan:"NaN",number:"Zahl",array:"Array"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Ungültige Eingabe: erwartet instanceof ${_.expected}, erhalten ${J}`;return`Ungültige Eingabe: erwartet ${I}, erhalten ${J}`}case"invalid_value":if(_.values.length===1)return`Ungültige Eingabe: erwartet ${H(_.values[0])}`;return`Ungültige Option: erwartet eine von ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Zu groß: erwartet, dass ${_.origin??"Wert"} ${I}${_.maximum.toString()} ${G.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${_.origin??"Wert"} ${I}${_.maximum.toString()} ist`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Zu klein: erwartet, dass ${_.origin} ${I}${_.minimum.toString()} ${G.unit} hat`;return`Zu klein: erwartet, dass ${_.origin} ${I}${_.minimum.toString()} ist`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Ungültiger String: muss mit "${I.prefix}" beginnen`;if(I.format==="ends_with")return`Ungültiger String: muss mit "${I.suffix}" enden`;if(I.format==="includes")return`Ungültiger String: muss "${I.includes}" enthalten`;if(I.format==="regex")return`Ungültiger String: muss dem Muster ${I.pattern} entsprechen`;return`Ungültig: ${U[I.format]??_.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${_.divisor} sein`;case"unrecognized_keys":return`${_.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${W(_.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${_.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${_.origin}`;default:return"Ungültige Eingabe"}}};var pX=L(()=>{A()});function S6(){return{localeError:zO()}}var zO=()=>{let $={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 v(_){return $[_]??null}let U={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",jwt:"JWT",template_literal:"input"},D={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;return`Invalid input: expected ${I}, received ${J}`}case"invalid_value":if(_.values.length===1)return`Invalid input: expected ${H(_.values[0])}`;return`Invalid option: expected one of ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Too big: expected ${_.origin??"value"} to have ${I}${_.maximum.toString()} ${G.unit??"elements"}`;return`Too big: expected ${_.origin??"value"} to be ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Too small: expected ${_.origin} to have ${I}${_.minimum.toString()} ${G.unit}`;return`Too small: expected ${_.origin} to be ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Invalid string: must start with "${I.prefix}"`;if(I.format==="ends_with")return`Invalid string: must end with "${I.suffix}"`;if(I.format==="includes")return`Invalid string: must include "${I.includes}"`;if(I.format==="regex")return`Invalid string: must match pattern ${I.pattern}`;return`Invalid ${U[I.format]??_.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${_.divisor}`;case"unrecognized_keys":return`Unrecognized key${_.keys.length>1?"s":""}: ${W(_.keys,", ")}`;case"invalid_key":return`Invalid key in ${_.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${_.origin}`;default:return"Invalid input"}}};var D0=L(()=>{A()});function I0(){return{localeError:AO()}}var AO=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function v(_){return $[_]??null}let U={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},D={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Nevalida enigo: atendiĝis instanceof ${_.expected}, riceviĝis ${J}`;return`Nevalida enigo: atendiĝis ${I}, riceviĝis ${J}`}case"invalid_value":if(_.values.length===1)return`Nevalida enigo: atendiĝis ${H(_.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Tro granda: atendiĝis ke ${_.origin??"valoro"} havu ${I}${_.maximum.toString()} ${G.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${_.origin??"valoro"} havu ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Tro malgranda: atendiĝis ke ${_.origin} havu ${I}${_.minimum.toString()} ${G.unit}`;return`Tro malgranda: atendiĝis ke ${_.origin} estu ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${I.prefix}"`;if(I.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${I.suffix}"`;if(I.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${I.includes}"`;if(I.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${I.pattern}`;return`Nevalida ${U[I.format]??_.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${_.divisor}`;case"unrecognized_keys":return`Nekonata${_.keys.length>1?"j":""} ŝlosilo${_.keys.length>1?"j":""}: ${W(_.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${_.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${_.origin}`;default:return"Nevalida enigo"}}};var aX=L(()=>{A()});function G0(){return{localeError:jO()}}var jO=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function v(_){return $[_]??null}let U={regex:"entrada",email:"dirección de correo electrónico",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:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},D={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Entrada inválida: se esperaba instanceof ${_.expected}, recibido ${J}`;return`Entrada inválida: se esperaba ${I}, recibido ${J}`}case"invalid_value":if(_.values.length===1)return`Entrada inválida: se esperaba ${H(_.values[0])}`;return`Opción inválida: se esperaba una de ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin),J=D[_.origin]??_.origin;if(G)return`Demasiado grande: se esperaba que ${J??"valor"} tuviera ${I}${_.maximum.toString()} ${G.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${J??"valor"} fuera ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin),J=D[_.origin]??_.origin;if(G)return`Demasiado pequeño: se esperaba que ${J} tuviera ${I}${_.minimum.toString()} ${G.unit}`;return`Demasiado pequeño: se esperaba que ${J} fuera ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Cadena inválida: debe comenzar con "${I.prefix}"`;if(I.format==="ends_with")return`Cadena inválida: debe terminar en "${I.suffix}"`;if(I.format==="includes")return`Cadena inválida: debe incluir "${I.includes}"`;if(I.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${I.pattern}`;return`Inválido ${U[I.format]??_.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${_.divisor}`;case"unrecognized_keys":return`Llave${_.keys.length>1?"s":""} desconocida${_.keys.length>1?"s":""}: ${W(_.keys,", ")}`;case"invalid_key":return`Llave inválida en ${D[_.origin]??_.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${D[_.origin]??_.origin}`;default:return"Entrada inválida"}}};var eX=L(()=>{A()});function J0(){return{localeError:EO()}}var EO=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function v(_){return $[_]??null}let U={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},D={nan:"NaN",number:"عدد",array:"آرایه"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`ورودی نامعتبر: میبایست instanceof ${_.expected} میبود، ${J} دریافت شد`;return`ورودی نامعتبر: میبایست ${I} میبود، ${J} دریافت شد`}case"invalid_value":if(_.values.length===1)return`ورودی نامعتبر: میبایست ${H(_.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${W(_.values,"|")} میبود`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`خیلی بزرگ: ${_.origin??"مقدار"} باید ${I}${_.maximum.toString()} ${G.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${_.origin??"مقدار"} باید ${I}${_.maximum.toString()} باشد`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`خیلی کوچک: ${_.origin} باید ${I}${_.minimum.toString()} ${G.unit} باشد`;return`خیلی کوچک: ${_.origin} باید ${I}${_.minimum.toString()} باشد`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`رشته نامعتبر: باید با "${I.prefix}" شروع شود`;if(I.format==="ends_with")return`رشته نامعتبر: باید با "${I.suffix}" تمام شود`;if(I.format==="includes")return`رشته نامعتبر: باید شامل "${I.includes}" باشد`;if(I.format==="regex")return`رشته نامعتبر: باید با الگوی ${I.pattern} مطابقت داشته باشد`;return`${U[I.format]??_.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${_.divisor} باشد`;case"unrecognized_keys":return`کلید${_.keys.length>1?"های":""} ناشناس: ${W(_.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${_.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${_.origin}`;default:return"ورودی نامعتبر"}}};var sX=L(()=>{A()});function w0(){return{localeError:xO()}}var xO=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function v(_){return $[_]??null}let U={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},D={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Virheellinen tyyppi: odotettiin instanceof ${_.expected}, oli ${J}`;return`Virheellinen tyyppi: odotettiin ${I}, oli ${J}`}case"invalid_value":if(_.values.length===1)return`Virheellinen syöte: täytyy olla ${H(_.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Liian suuri: ${G.subject} täytyy olla ${I}${_.maximum.toString()} ${G.unit}`.trim();return`Liian suuri: arvon täytyy olla ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Liian pieni: ${G.subject} täytyy olla ${I}${_.minimum.toString()} ${G.unit}`.trim();return`Liian pieni: arvon täytyy olla ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${I.prefix}"`;if(I.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${I.suffix}"`;if(I.format==="includes")return`Virheellinen syöte: täytyy sisältää "${I.includes}"`;if(I.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${I.pattern}`;return`Virheellinen ${U[I.format]??_.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${_.divisor} monikerta`;case"unrecognized_keys":return`${_.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${W(_.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};var $Q=L(()=>{A()});function X0(){return{localeError:RO()}}var RO=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function v(_){return $[_]??null}let U={regex:"entrée",email:"adresse e-mail",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:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},D={nan:"NaN",number:"nombre",array:"tableau"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Entrée invalide : instanceof ${_.expected} attendu, ${J} reçu`;return`Entrée invalide : ${I} attendu, ${J} reçu`}case"invalid_value":if(_.values.length===1)return`Entrée invalide : ${H(_.values[0])} attendu`;return`Option invalide : une valeur parmi ${W(_.values,"|")} attendue`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Trop grand : ${_.origin??"valeur"} doit ${G.verb} ${I}${_.maximum.toString()} ${G.unit??"élément(s)"}`;return`Trop grand : ${_.origin??"valeur"} doit être ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Trop petit : ${_.origin} doit ${G.verb} ${I}${_.minimum.toString()} ${G.unit}`;return`Trop petit : ${_.origin} doit être ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Chaîne invalide : doit commencer par "${I.prefix}"`;if(I.format==="ends_with")return`Chaîne invalide : doit se terminer par "${I.suffix}"`;if(I.format==="includes")return`Chaîne invalide : doit inclure "${I.includes}"`;if(I.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${I.pattern}`;return`${U[I.format]??_.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${_.divisor}`;case"unrecognized_keys":return`Clé${_.keys.length>1?"s":""} non reconnue${_.keys.length>1?"s":""} : ${W(_.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${_.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${_.origin}`;default:return"Entrée invalide"}}};var vQ=L(()=>{A()});function Q0(){return{localeError:CO()}}var CO=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function v(_){return $[_]??null}let U={regex:"entrée",email:"adresse courriel",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:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},D={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Entrée invalide : attendu instanceof ${_.expected}, reçu ${J}`;return`Entrée invalide : attendu ${I}, reçu ${J}`}case"invalid_value":if(_.values.length===1)return`Entrée invalide : attendu ${H(_.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"≤":"<",G=v(_.origin);if(G)return`Trop grand : attendu que ${_.origin??"la valeur"} ait ${I}${_.maximum.toString()} ${G.unit}`;return`Trop grand : attendu que ${_.origin??"la valeur"} soit ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?"≥":">",G=v(_.origin);if(G)return`Trop petit : attendu que ${_.origin} ait ${I}${_.minimum.toString()} ${G.unit}`;return`Trop petit : attendu que ${_.origin} soit ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Chaîne invalide : doit commencer par "${I.prefix}"`;if(I.format==="ends_with")return`Chaîne invalide : doit se terminer par "${I.suffix}"`;if(I.format==="includes")return`Chaîne invalide : doit inclure "${I.includes}"`;if(I.format==="regex")return`Chaîne invalide : doit correspondre au motif ${I.pattern}`;return`${U[I.format]??_.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${_.divisor}`;case"unrecognized_keys":return`Clé${_.keys.length>1?"s":""} non reconnue${_.keys.length>1?"s":""} : ${W(_.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${_.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${_.origin}`;default:return"Entrée invalide"}}};var _Q=L(()=>{A()});function Y0(){return{localeError:uO()}}var uO=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},v={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},U=(Q)=>Q?$[Q]:void 0,D=(Q)=>{let Y=U(Q);if(Y)return Y.label;return Q??$.unknown.label},_=(Q)=>`ה${D(Q)}`,I=(Q)=>{return(U(Q)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},G=(Q)=>{if(!Q)return null;return v[Q]??null},J={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},X={nan:"NaN"};return(Q)=>{switch(Q.code){case"invalid_type":{let Y=Q.expected,P=X[Y??""]??D(Y),V=F(Q.input),O=X[V]??$[V]?.label??V;if(/^[A-Z]/.test(Q.expected))return`קלט לא תקין: צריך להיות instanceof ${Q.expected}, התקבל ${O}`;return`קלט לא תקין: צריך להיות ${P}, התקבל ${O}`}case"invalid_value":{if(Q.values.length===1)return`ערך לא תקין: הערך חייב להיות ${H(Q.values[0])}`;let Y=Q.values.map((O)=>H(O));if(Q.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${Y[0]} או ${Y[1]}`;let P=Y[Y.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${Y.slice(0,-1).join(", ")} או ${P}`}case"too_big":{let Y=G(Q.origin),P=_(Q.origin??"value");if(Q.origin==="string")return`${Y?.longLabel??"ארוך"} מדי: ${P} צריכה להכיל ${Q.maximum.toString()} ${Y?.unit??""} ${Q.inclusive?"או פחות":"לכל היותר"}`.trim();if(Q.origin==="number"){let S=Q.inclusive?`קטן או שווה ל-${Q.maximum}`:`קטן מ-${Q.maximum}`;return`גדול מדי: ${P} צריך להיות ${S}`}if(Q.origin==="array"||Q.origin==="set"){let S=Q.origin==="set"?"צריכה":"צריך",B=Q.inclusive?`${Q.maximum} ${Y?.unit??""} או פחות`:`פחות מ-${Q.maximum} ${Y?.unit??""}`;return`גדול מדי: ${P} ${S} להכיל ${B}`.trim()}let V=Q.inclusive?"<=":"<",O=I(Q.origin??"value");if(Y?.unit)return`${Y.longLabel} מדי: ${P} ${O} ${V}${Q.maximum.toString()} ${Y.unit}`;return`${Y?.longLabel??"גדול"} מדי: ${P} ${O} ${V}${Q.maximum.toString()}`}case"too_small":{let Y=G(Q.origin),P=_(Q.origin??"value");if(Q.origin==="string")return`${Y?.shortLabel??"קצר"} מדי: ${P} צריכה להכיל ${Q.minimum.toString()} ${Y?.unit??""} ${Q.inclusive?"או יותר":"לפחות"}`.trim();if(Q.origin==="number"){let S=Q.inclusive?`גדול או שווה ל-${Q.minimum}`:`גדול מ-${Q.minimum}`;return`קטן מדי: ${P} צריך להיות ${S}`}if(Q.origin==="array"||Q.origin==="set"){let S=Q.origin==="set"?"צריכה":"צריך";if(Q.minimum===1&&Q.inclusive){let h=Q.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${P} ${S} להכיל ${h}`}let B=Q.inclusive?`${Q.minimum} ${Y?.unit??""} או יותר`:`יותר מ-${Q.minimum} ${Y?.unit??""}`;return`קטן מדי: ${P} ${S} להכיל ${B}`.trim()}let V=Q.inclusive?">=":">",O=I(Q.origin??"value");if(Y?.unit)return`${Y.shortLabel} מדי: ${P} ${O} ${V}${Q.minimum.toString()} ${Y.unit}`;return`${Y?.shortLabel??"קטן"} מדי: ${P} ${O} ${V}${Q.minimum.toString()}`}case"invalid_format":{let Y=Q;if(Y.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${Y.prefix}"`;if(Y.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${Y.suffix}"`;if(Y.format==="includes")return`המחרוזת חייבת לכלול "${Y.includes}"`;if(Y.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${Y.pattern}`;let P=J[Y.format],V=P?.label??Y.format,S=(P?.gender??"m")==="f"?"תקינה":"תקין";return`${V} לא ${S}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${Q.divisor}`;case"unrecognized_keys":return`מפתח${Q.keys.length>1?"ות":""} לא מזוה${Q.keys.length>1?"ים":"ה"}: ${W(Q.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${_(Q.origin??"array")}`;default:return"קלט לא תקין"}}};var UQ=L(()=>{A()});function P0(){return{localeError:yO()}}var yO=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function v(_){return $[_]??null}let U={regex:"bemenet",email:"email cím",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 időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},D={nan:"NaN",number:"szám",array:"tömb"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Érvénytelen bemenet: a várt érték instanceof ${_.expected}, a kapott érték ${J}`;return`Érvénytelen bemenet: a várt érték ${I}, a kapott érték ${J}`}case"invalid_value":if(_.values.length===1)return`Érvénytelen bemenet: a várt érték ${H(_.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Túl nagy: ${_.origin??"érték"} mérete túl nagy ${I}${_.maximum.toString()} ${G.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${_.origin??"érték"} túl nagy: ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Túl kicsi: a bemeneti érték ${_.origin} mérete túl kicsi ${I}${_.minimum.toString()} ${G.unit}`;return`Túl kicsi: a bemeneti érték ${_.origin} túl kicsi ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Érvénytelen string: "${I.prefix}" értékkel kell kezdődnie`;if(I.format==="ends_with")return`Érvénytelen string: "${I.suffix}" értékkel kell végződnie`;if(I.format==="includes")return`Érvénytelen string: "${I.includes}" értéket kell tartalmaznia`;if(I.format==="regex")return`Érvénytelen string: ${I.pattern} mintának kell megfelelnie`;return`Érvénytelen ${U[I.format]??_.format}`}case"not_multiple_of":return`Érvénytelen szám: ${_.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${_.keys.length>1?"s":""}: ${W(_.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${_.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${_.origin}`;default:return"Érvénytelen bemenet"}}};var DQ=L(()=>{A()});function IQ($,v,U){return Math.abs($)===1?v:U}function X4($){if(!$)return"";let v=["ա","ե","ը","ի","ո","ու","օ"],U=$[$.length-1];return $+(v.includes(U)?"ն":"ը")}function K0(){return{localeError:fO()}}var fO=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function v(_){return $[_]??null}let U={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},D={nan:"NaN",number:"թիվ",array:"զանգված"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${_.expected}, ստացվել է ${J}`;return`Սխալ մուտքագրում․ սպասվում էր ${I}, ստացվել է ${J}`}case"invalid_value":if(_.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${H(_.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G){let J=Number(_.maximum),X=IQ(J,G.unit.one,G.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${X4(_.origin??"արժեք")} կունենա ${I}${_.maximum.toString()} ${X}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${X4(_.origin??"արժեք")} լինի ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G){let J=Number(_.minimum),X=IQ(J,G.unit.one,G.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${X4(_.origin)} կունենա ${I}${_.minimum.toString()} ${X}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${X4(_.origin)} լինի ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${I.prefix}"-ով`;if(I.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${I.suffix}"-ով`;if(I.format==="includes")return`Սխալ տող․ պետք է պարունակի "${I.includes}"`;if(I.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${I.pattern} ձևաչափին`;return`Սխալ ${U[I.format]??_.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${_.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${_.keys.length>1?"ներ":""}. ${W(_.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${X4(_.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${X4(_.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};var GQ=L(()=>{A()});function V0(){return{localeError:cO()}}var cO=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function v(_){return $[_]??null}let U={regex:"input",email:"alamat email",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:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},D={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Input tidak valid: diharapkan instanceof ${_.expected}, diterima ${J}`;return`Input tidak valid: diharapkan ${I}, diterima ${J}`}case"invalid_value":if(_.values.length===1)return`Input tidak valid: diharapkan ${H(_.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Terlalu besar: diharapkan ${_.origin??"value"} memiliki ${I}${_.maximum.toString()} ${G.unit??"elemen"}`;return`Terlalu besar: diharapkan ${_.origin??"value"} menjadi ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Terlalu kecil: diharapkan ${_.origin} memiliki ${I}${_.minimum.toString()} ${G.unit}`;return`Terlalu kecil: diharapkan ${_.origin} menjadi ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`String tidak valid: harus dimulai dengan "${I.prefix}"`;if(I.format==="ends_with")return`String tidak valid: harus berakhir dengan "${I.suffix}"`;if(I.format==="includes")return`String tidak valid: harus menyertakan "${I.includes}"`;if(I.format==="regex")return`String tidak valid: harus sesuai pola ${I.pattern}`;return`${U[I.format]??_.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${_.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${_.keys.length>1?"s":""}: ${W(_.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${_.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${_.origin}`;default:return"Input tidak valid"}}};var JQ=L(()=>{A()});function O0(){return{localeError:hO()}}var hO=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function v(_){return $[_]??null}let U={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},D={nan:"NaN",number:"númer",array:"fylki"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Rangt gildi: Þú slóst inn ${J} þar sem á að vera instanceof ${_.expected}`;return`Rangt gildi: Þú slóst inn ${J} þar sem á að vera ${I}`}case"invalid_value":if(_.values.length===1)return`Rangt gildi: gert ráð fyrir ${H(_.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Of stórt: gert er ráð fyrir að ${_.origin??"gildi"} hafi ${I}${_.maximum.toString()} ${G.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${_.origin??"gildi"} sé ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Of lítið: gert er ráð fyrir að ${_.origin} hafi ${I}${_.minimum.toString()} ${G.unit}`;return`Of lítið: gert er ráð fyrir að ${_.origin} sé ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Ógildur strengur: verður að byrja á "${I.prefix}"`;if(I.format==="ends_with")return`Ógildur strengur: verður að enda á "${I.suffix}"`;if(I.format==="includes")return`Ógildur strengur: verður að innihalda "${I.includes}"`;if(I.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${I.pattern}`;return`Rangt ${U[I.format]??_.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${_.divisor}`;case"unrecognized_keys":return`Óþekkt ${_.keys.length>1?"ir lyklar":"ur lykill"}: ${W(_.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${_.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${_.origin}`;default:return"Rangt gildi"}}};var wQ=L(()=>{A()});function W0(){return{localeError:rO()}}var rO=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function v(_){return $[_]??null}let U={regex:"input",email:"indirizzo email",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:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},D={nan:"NaN",number:"numero",array:"vettore"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Input non valido: atteso instanceof ${_.expected}, ricevuto ${J}`;return`Input non valido: atteso ${I}, ricevuto ${J}`}case"invalid_value":if(_.values.length===1)return`Input non valido: atteso ${H(_.values[0])}`;return`Opzione non valida: atteso uno tra ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Troppo grande: ${_.origin??"valore"} deve avere ${I}${_.maximum.toString()} ${G.unit??"elementi"}`;return`Troppo grande: ${_.origin??"valore"} deve essere ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Troppo piccolo: ${_.origin} deve avere ${I}${_.minimum.toString()} ${G.unit}`;return`Troppo piccolo: ${_.origin} deve essere ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Stringa non valida: deve iniziare con "${I.prefix}"`;if(I.format==="ends_with")return`Stringa non valida: deve terminare con "${I.suffix}"`;if(I.format==="includes")return`Stringa non valida: deve includere "${I.includes}"`;if(I.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${I.pattern}`;return`Invalid ${U[I.format]??_.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${_.divisor}`;case"unrecognized_keys":return`Chiav${_.keys.length>1?"i":"e"} non riconosciut${_.keys.length>1?"e":"a"}: ${W(_.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${_.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${_.origin}`;default:return"Input non valido"}}};var XQ=L(()=>{A()});function L0(){return{localeError:mO()}}var mO=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function v(_){return $[_]??null}let U={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},D={nan:"NaN",number:"数値",array:"配列"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`無効な入力: instanceof ${_.expected}が期待されましたが、${J}が入力されました`;return`無効な入力: ${I}が期待されましたが、${J}が入力されました`}case"invalid_value":if(_.values.length===1)return`無効な入力: ${H(_.values[0])}が期待されました`;return`無効な選択: ${W(_.values,"、")}のいずれかである必要があります`;case"too_big":{let I=_.inclusive?"以下である":"より小さい",G=v(_.origin);if(G)return`大きすぎる値: ${_.origin??"値"}は${_.maximum.toString()}${G.unit??"要素"}${I}必要があります`;return`大きすぎる値: ${_.origin??"値"}は${_.maximum.toString()}${I}必要があります`}case"too_small":{let I=_.inclusive?"以上である":"より大きい",G=v(_.origin);if(G)return`小さすぎる値: ${_.origin}は${_.minimum.toString()}${G.unit}${I}必要があります`;return`小さすぎる値: ${_.origin}は${_.minimum.toString()}${I}必要があります`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`無効な文字列: "${I.prefix}"で始まる必要があります`;if(I.format==="ends_with")return`無効な文字列: "${I.suffix}"で終わる必要があります`;if(I.format==="includes")return`無効な文字列: "${I.includes}"を含む必要があります`;if(I.format==="regex")return`無効な文字列: パターン${I.pattern}に一致する必要があります`;return`無効な${U[I.format]??_.format}`}case"not_multiple_of":return`無効な数値: ${_.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${_.keys.length>1?"群":""}: ${W(_.keys,"、")}`;case"invalid_key":return`${_.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${_.origin}内の無効な値`;default:return"無効な入力"}}};var QQ=L(()=>{A()});function N0(){return{localeError:lO()}}var lO=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function v(_){return $[_]??null}let U={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},D={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${_.expected}, მიღებული ${J}`;return`არასწორი შეყვანა: მოსალოდნელი ${I}, მიღებული ${J}`}case"invalid_value":if(_.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${H(_.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${W(_.values,"|")}-დან`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`ზედმეტად დიდი: მოსალოდნელი ${_.origin??"მნიშვნელობა"} ${G.verb} ${I}${_.maximum.toString()} ${G.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${_.origin??"მნიშვნელობა"} იყოს ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`ზედმეტად პატარა: მოსალოდნელი ${_.origin} ${G.verb} ${I}${_.minimum.toString()} ${G.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${_.origin} იყოს ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${I.prefix}"-ით`;if(I.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${I.suffix}"-ით`;if(I.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${I.includes}"-ს`;if(I.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${I.pattern}`;return`არასწორი ${U[I.format]??_.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${_.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${_.keys.length>1?"ები":"ი"}: ${W(_.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${_.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${_.origin}-ში`;default:return"არასწორი შეყვანა"}}};var YQ=L(()=>{A()});function B6(){return{localeError:iO()}}var iO=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function v(_){return $[_]??null}let U={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},D={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${_.expected} ប៉ុន្តែទទួលបាន ${J}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${I} ប៉ុន្តែទទួលបាន ${J}`}case"invalid_value":if(_.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${H(_.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`ធំពេក៖ ត្រូវការ ${_.origin??"តម្លៃ"} ${I} ${_.maximum.toString()} ${G.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${_.origin??"តម្លៃ"} ${I} ${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`តូចពេក៖ ត្រូវការ ${_.origin} ${I} ${_.minimum.toString()} ${G.unit}`;return`តូចពេក៖ ត្រូវការ ${_.origin} ${I} ${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${I.prefix}"`;if(I.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${I.suffix}"`;if(I.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${I.includes}"`;if(I.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${I.pattern}`;return`មិនត្រឹមត្រូវ៖ ${U[I.format]??_.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${_.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${W(_.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${_.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${_.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};var q0=L(()=>{A()});function k0(){return B6()}var PQ=L(()=>{q0()});function H0(){return{localeError:nO()}}var nO=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function v(_){return $[_]??null}let U={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},D={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`잘못된 입력: 예상 타입은 instanceof ${_.expected}, 받은 타입은 ${J}입니다`;return`잘못된 입력: 예상 타입은 ${I}, 받은 타입은 ${J}입니다`}case"invalid_value":if(_.values.length===1)return`잘못된 입력: 값은 ${H(_.values[0])} 이어야 합니다`;return`잘못된 옵션: ${W(_.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let I=_.inclusive?"이하":"미만",G=I==="미만"?"이어야 합니다":"여야 합니다",J=v(_.origin),X=J?.unit??"요소";if(J)return`${_.origin??"값"}이 너무 큽니다: ${_.maximum.toString()}${X} ${I}${G}`;return`${_.origin??"값"}이 너무 큽니다: ${_.maximum.toString()} ${I}${G}`}case"too_small":{let I=_.inclusive?"이상":"초과",G=I==="이상"?"이어야 합니다":"여야 합니다",J=v(_.origin),X=J?.unit??"요소";if(J)return`${_.origin??"값"}이 너무 작습니다: ${_.minimum.toString()}${X} ${I}${G}`;return`${_.origin??"값"}이 너무 작습니다: ${_.minimum.toString()} ${I}${G}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`잘못된 문자열: "${I.prefix}"(으)로 시작해야 합니다`;if(I.format==="ends_with")return`잘못된 문자열: "${I.suffix}"(으)로 끝나야 합니다`;if(I.format==="includes")return`잘못된 문자열: "${I.includes}"을(를) 포함해야 합니다`;if(I.format==="regex")return`잘못된 문자열: 정규식 ${I.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${U[I.format]??_.format}`}case"not_multiple_of":return`잘못된 숫자: ${_.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${W(_.keys,", ")}`;case"invalid_key":return`잘못된 키: ${_.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${_.origin}`;default:return"잘못된 입력"}}};var KQ=L(()=>{A()});function VQ($){let v=Math.abs($),U=v%10,D=v%100;if(D>=11&&D<=19||U===0)return"many";if(U===1)return"one";return"few"}function F0(){return{localeError:dO()}}var Z6=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)},dO=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function v(_,I,G,J){let X=$[_]??null;if(X===null)return X;return{unit:X.unit[I],verb:X.verb[J][G?"inclusive":"notInclusive"]}}let U={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},D={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Gautas tipas ${J}, o tikėtasi - instanceof ${_.expected}`;return`Gautas tipas ${J}, o tikėtasi - ${I}`}case"invalid_value":if(_.values.length===1)return`Privalo būti ${H(_.values[0])}`;return`Privalo būti vienas iš ${W(_.values,"|")} pasirinkimų`;case"too_big":{let I=D[_.origin]??_.origin,G=v(_.origin,VQ(Number(_.maximum)),_.inclusive??!1,"smaller");if(G?.verb)return`${Z6(I??_.origin??"reikšmė")} ${G.verb} ${_.maximum.toString()} ${G.unit??"elementų"}`;let J=_.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Z6(I??_.origin??"reikšmė")} turi būti ${J} ${_.maximum.toString()} ${G?.unit}`}case"too_small":{let I=D[_.origin]??_.origin,G=v(_.origin,VQ(Number(_.minimum)),_.inclusive??!1,"bigger");if(G?.verb)return`${Z6(I??_.origin??"reikšmė")} ${G.verb} ${_.minimum.toString()} ${G.unit??"elementų"}`;let J=_.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Z6(I??_.origin??"reikšmė")} turi būti ${J} ${_.minimum.toString()} ${G?.unit}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Eilutė privalo prasidėti "${I.prefix}"`;if(I.format==="ends_with")return`Eilutė privalo pasibaigti "${I.suffix}"`;if(I.format==="includes")return`Eilutė privalo įtraukti "${I.includes}"`;if(I.format==="regex")return`Eilutė privalo atitikti ${I.pattern}`;return`Neteisingas ${U[I.format]??_.format}`}case"not_multiple_of":return`Skaičius privalo būti ${_.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${_.keys.length>1?"i":"as"} rakt${_.keys.length>1?"ai":"as"}: ${W(_.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let I=D[_.origin]??_.origin;return`${Z6(I??_.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};var OQ=L(()=>{A()});function b0(){return{localeError:oO()}}var oO=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function v(_){return $[_]??null}let U={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},D={nan:"NaN",number:"број",array:"низа"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Грешен внес: се очекува instanceof ${_.expected}, примено ${J}`;return`Грешен внес: се очекува ${I}, примено ${J}`}case"invalid_value":if(_.values.length===1)return`Invalid input: expected ${H(_.values[0])}`;return`Грешана опција: се очекува една ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Премногу голем: се очекува ${_.origin??"вредноста"} да има ${I}${_.maximum.toString()} ${G.unit??"елементи"}`;return`Премногу голем: се очекува ${_.origin??"вредноста"} да биде ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Премногу мал: се очекува ${_.origin} да има ${I}${_.minimum.toString()} ${G.unit}`;return`Премногу мал: се очекува ${_.origin} да биде ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Неважечка низа: мора да започнува со "${I.prefix}"`;if(I.format==="ends_with")return`Неважечка низа: мора да завршува со "${I.suffix}"`;if(I.format==="includes")return`Неважечка низа: мора да вклучува "${I.includes}"`;if(I.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${I.pattern}`;return`Invalid ${U[I.format]??_.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${W(_.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${_.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${_.origin}`;default:return"Грешен внес"}}};var WQ=L(()=>{A()});function g0(){return{localeError:tO()}}var tO=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function v(_){return $[_]??null}let U={regex:"input",email:"alamat e-mel",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:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},D={nan:"NaN",number:"nombor"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Input tidak sah: dijangka instanceof ${_.expected}, diterima ${J}`;return`Input tidak sah: dijangka ${I}, diterima ${J}`}case"invalid_value":if(_.values.length===1)return`Input tidak sah: dijangka ${H(_.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Terlalu besar: dijangka ${_.origin??"nilai"} ${G.verb} ${I}${_.maximum.toString()} ${G.unit??"elemen"}`;return`Terlalu besar: dijangka ${_.origin??"nilai"} adalah ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Terlalu kecil: dijangka ${_.origin} ${G.verb} ${I}${_.minimum.toString()} ${G.unit}`;return`Terlalu kecil: dijangka ${_.origin} adalah ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`String tidak sah: mesti bermula dengan "${I.prefix}"`;if(I.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${I.suffix}"`;if(I.format==="includes")return`String tidak sah: mesti mengandungi "${I.includes}"`;if(I.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${I.pattern}`;return`${U[I.format]??_.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${_.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${W(_.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${_.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${_.origin}`;default:return"Input tidak sah"}}};var LQ=L(()=>{A()});function S0(){return{localeError:pO()}}var pO=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function v(_){return $[_]??null}let U={regex:"invoer",email:"emailadres",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 datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},D={nan:"NaN",number:"getal"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Ongeldige invoer: verwacht instanceof ${_.expected}, ontving ${J}`;return`Ongeldige invoer: verwacht ${I}, ontving ${J}`}case"invalid_value":if(_.values.length===1)return`Ongeldige invoer: verwacht ${H(_.values[0])}`;return`Ongeldige optie: verwacht één van ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin),J=_.origin==="date"?"laat":_.origin==="string"?"lang":"groot";if(G)return`Te ${J}: verwacht dat ${_.origin??"waarde"} ${I}${_.maximum.toString()} ${G.unit??"elementen"} ${G.verb}`;return`Te ${J}: verwacht dat ${_.origin??"waarde"} ${I}${_.maximum.toString()} is`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin),J=_.origin==="date"?"vroeg":_.origin==="string"?"kort":"klein";if(G)return`Te ${J}: verwacht dat ${_.origin} ${I}${_.minimum.toString()} ${G.unit} ${G.verb}`;return`Te ${J}: verwacht dat ${_.origin} ${I}${_.minimum.toString()} is`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Ongeldige tekst: moet met "${I.prefix}" beginnen`;if(I.format==="ends_with")return`Ongeldige tekst: moet op "${I.suffix}" eindigen`;if(I.format==="includes")return`Ongeldige tekst: moet "${I.includes}" bevatten`;if(I.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${I.pattern}`;return`Ongeldig: ${U[I.format]??_.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${_.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${_.keys.length>1?"s":""}: ${W(_.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${_.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${_.origin}`;default:return"Ongeldige invoer"}}};var NQ=L(()=>{A()});function B0(){return{localeError:aO()}}var aO=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function v(_){return $[_]??null}let U={regex:"input",email:"e-postadresse",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 dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},D={nan:"NaN",number:"tall",array:"liste"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Ugyldig input: forventet instanceof ${_.expected}, fikk ${J}`;return`Ugyldig input: forventet ${I}, fikk ${J}`}case"invalid_value":if(_.values.length===1)return`Ugyldig verdi: forventet ${H(_.values[0])}`;return`Ugyldig valg: forventet en av ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`For stor(t): forventet ${_.origin??"value"} til å ha ${I}${_.maximum.toString()} ${G.unit??"elementer"}`;return`For stor(t): forventet ${_.origin??"value"} til å ha ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`For lite(n): forventet ${_.origin} til å ha ${I}${_.minimum.toString()} ${G.unit}`;return`For lite(n): forventet ${_.origin} til å ha ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Ugyldig streng: må starte med "${I.prefix}"`;if(I.format==="ends_with")return`Ugyldig streng: må ende med "${I.suffix}"`;if(I.format==="includes")return`Ugyldig streng: må inneholde "${I.includes}"`;if(I.format==="regex")return`Ugyldig streng: må matche mønsteret ${I.pattern}`;return`Ugyldig ${U[I.format]??_.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${W(_.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${_.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${_.origin}`;default:return"Ugyldig input"}}};var qQ=L(()=>{A()});function Z0(){return{localeError:eO()}}var eO=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function v(_){return $[_]??null}let U={regex:"giren",email:"epostagâh",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 hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},D={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Fâsit giren: umulan instanceof ${_.expected}, alınan ${J}`;return`Fâsit giren: umulan ${I}, alınan ${J}`}case"invalid_value":if(_.values.length===1)return`Fâsit giren: umulan ${H(_.values[0])}`;return`Fâsit tercih: mûteberler ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Fazla büyük: ${_.origin??"value"}, ${I}${_.maximum.toString()} ${G.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${_.origin??"value"}, ${I}${_.maximum.toString()} olmalıydı.`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Fazla küçük: ${_.origin}, ${I}${_.minimum.toString()} ${G.unit} sahip olmalıydı.`;return`Fazla küçük: ${_.origin}, ${I}${_.minimum.toString()} olmalıydı.`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Fâsit metin: "${I.prefix}" ile başlamalı.`;if(I.format==="ends_with")return`Fâsit metin: "${I.suffix}" ile bitmeli.`;if(I.format==="includes")return`Fâsit metin: "${I.includes}" ihtivâ etmeli.`;if(I.format==="regex")return`Fâsit metin: ${I.pattern} nakşına uymalı.`;return`Fâsit ${U[I.format]??_.format}`}case"not_multiple_of":return`Fâsit sayı: ${_.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${_.keys.length>1?"s":""}: ${W(_.keys,", ")}`;case"invalid_key":return`${_.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${_.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};var kQ=L(()=>{A()});function M0(){return{localeError:sO()}}var sO=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function v(_){return $[_]??null}let U={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},D={nan:"NaN",number:"عدد",array:"ارې"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`ناسم ورودي: باید instanceof ${_.expected} وای, مګر ${J} ترلاسه شو`;return`ناسم ورودي: باید ${I} وای, مګر ${J} ترلاسه شو`}case"invalid_value":if(_.values.length===1)return`ناسم ورودي: باید ${H(_.values[0])} وای`;return`ناسم انتخاب: باید یو له ${W(_.values,"|")} څخه وای`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`ډیر لوی: ${_.origin??"ارزښت"} باید ${I}${_.maximum.toString()} ${G.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${_.origin??"ارزښت"} باید ${I}${_.maximum.toString()} وي`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`ډیر کوچنی: ${_.origin} باید ${I}${_.minimum.toString()} ${G.unit} ولري`;return`ډیر کوچنی: ${_.origin} باید ${I}${_.minimum.toString()} وي`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`ناسم متن: باید د "${I.prefix}" سره پیل شي`;if(I.format==="ends_with")return`ناسم متن: باید د "${I.suffix}" سره پای ته ورسيږي`;if(I.format==="includes")return`ناسم متن: باید "${I.includes}" ولري`;if(I.format==="regex")return`ناسم متن: باید د ${I.pattern} سره مطابقت ولري`;return`${U[I.format]??_.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${_.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${_.keys.length>1?"کلیډونه":"کلیډ"}: ${W(_.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${_.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${_.origin} کې`;default:return"ناسمه ورودي"}}};var HQ=L(()=>{A()});function T0(){return{localeError:$W()}}var $W=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function v(_){return $[_]??null}let U={regex:"wyrażenie",email:"adres email",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:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},D={nan:"NaN",number:"liczba",array:"tablica"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${_.expected}, otrzymano ${J}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${I}, otrzymano ${J}`}case"invalid_value":if(_.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${H(_.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Za duża wartość: oczekiwano, że ${_.origin??"wartość"} będzie mieć ${I}${_.maximum.toString()} ${G.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${_.origin??"wartość"} będzie wynosić ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Za mała wartość: oczekiwano, że ${_.origin??"wartość"} będzie mieć ${I}${_.minimum.toString()} ${G.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${_.origin??"wartość"} będzie wynosić ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${I.prefix}"`;if(I.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${I.suffix}"`;if(I.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${I.includes}"`;if(I.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${I.pattern}`;return`Nieprawidłow(y/a/e) ${U[I.format]??_.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${_.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${_.keys.length>1?"s":""}: ${W(_.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${_.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${_.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};var FQ=L(()=>{A()});function z0(){return{localeError:vW()}}var vW=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function v(_){return $[_]??null}let U={regex:"padrão",email:"endereço de e-mail",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:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},D={nan:"NaN",number:"número",null:"nulo"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Tipo inválido: esperado instanceof ${_.expected}, recebido ${J}`;return`Tipo inválido: esperado ${I}, recebido ${J}`}case"invalid_value":if(_.values.length===1)return`Entrada inválida: esperado ${H(_.values[0])}`;return`Opção inválida: esperada uma das ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Muito grande: esperado que ${_.origin??"valor"} tivesse ${I}${_.maximum.toString()} ${G.unit??"elementos"}`;return`Muito grande: esperado que ${_.origin??"valor"} fosse ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Muito pequeno: esperado que ${_.origin} tivesse ${I}${_.minimum.toString()} ${G.unit}`;return`Muito pequeno: esperado que ${_.origin} fosse ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Texto inválido: deve começar com "${I.prefix}"`;if(I.format==="ends_with")return`Texto inválido: deve terminar com "${I.suffix}"`;if(I.format==="includes")return`Texto inválido: deve incluir "${I.includes}"`;if(I.format==="regex")return`Texto inválido: deve corresponder ao padrão ${I.pattern}`;return`${U[I.format]??_.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${_.divisor}`;case"unrecognized_keys":return`Chave${_.keys.length>1?"s":""} desconhecida${_.keys.length>1?"s":""}: ${W(_.keys,", ")}`;case"invalid_key":return`Chave inválida em ${_.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${_.origin}`;default:return"Campo inválido"}}};var bQ=L(()=>{A()});function gQ($,v,U,D){let _=Math.abs($),I=_%10,G=_%100;if(G>=11&&G<=19)return D;if(I===1)return v;if(I>=2&&I<=4)return U;return D}function A0(){return{localeError:_W()}}var _W=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function v(_){return $[_]??null}let U={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},D={nan:"NaN",number:"число",array:"массив"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Неверный ввод: ожидалось instanceof ${_.expected}, получено ${J}`;return`Неверный ввод: ожидалось ${I}, получено ${J}`}case"invalid_value":if(_.values.length===1)return`Неверный ввод: ожидалось ${H(_.values[0])}`;return`Неверный вариант: ожидалось одно из ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G){let J=Number(_.maximum),X=gQ(J,G.unit.one,G.unit.few,G.unit.many);return`Слишком большое значение: ожидалось, что ${_.origin??"значение"} будет иметь ${I}${_.maximum.toString()} ${X}`}return`Слишком большое значение: ожидалось, что ${_.origin??"значение"} будет ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G){let J=Number(_.minimum),X=gQ(J,G.unit.one,G.unit.few,G.unit.many);return`Слишком маленькое значение: ожидалось, что ${_.origin} будет иметь ${I}${_.minimum.toString()} ${X}`}return`Слишком маленькое значение: ожидалось, что ${_.origin} будет ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Неверная строка: должна начинаться с "${I.prefix}"`;if(I.format==="ends_with")return`Неверная строка: должна заканчиваться на "${I.suffix}"`;if(I.format==="includes")return`Неверная строка: должна содержать "${I.includes}"`;if(I.format==="regex")return`Неверная строка: должна соответствовать шаблону ${I.pattern}`;return`Неверный ${U[I.format]??_.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${_.divisor}`;case"unrecognized_keys":return`Нераспознанн${_.keys.length>1?"ые":"ый"} ключ${_.keys.length>1?"и":""}: ${W(_.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${_.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${_.origin}`;default:return"Неверные входные данные"}}};var SQ=L(()=>{A()});function j0(){return{localeError:UW()}}var UW=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function v(_){return $[_]??null}let U={regex:"vnos",email:"e-poštni naslov",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 datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},D={nan:"NaN",number:"število",array:"tabela"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Neveljaven vnos: pričakovano instanceof ${_.expected}, prejeto ${J}`;return`Neveljaven vnos: pričakovano ${I}, prejeto ${J}`}case"invalid_value":if(_.values.length===1)return`Neveljaven vnos: pričakovano ${H(_.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Preveliko: pričakovano, da bo ${_.origin??"vrednost"} imelo ${I}${_.maximum.toString()} ${G.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${_.origin??"vrednost"} ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Premajhno: pričakovano, da bo ${_.origin} imelo ${I}${_.minimum.toString()} ${G.unit}`;return`Premajhno: pričakovano, da bo ${_.origin} ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Neveljaven niz: mora se začeti z "${I.prefix}"`;if(I.format==="ends_with")return`Neveljaven niz: mora se končati z "${I.suffix}"`;if(I.format==="includes")return`Neveljaven niz: mora vsebovati "${I.includes}"`;if(I.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${I.pattern}`;return`Neveljaven ${U[I.format]??_.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${_.divisor}`;case"unrecognized_keys":return`Neprepoznan${_.keys.length>1?"i ključi":" ključ"}: ${W(_.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${_.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${_.origin}`;default:return"Neveljaven vnos"}}};var BQ=L(()=>{A()});function E0(){return{localeError:DW()}}var DW=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function v(_){return $[_]??null}let U={regex:"reguljärt uttryck",email:"e-postadress",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-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},D={nan:"NaN",number:"antal",array:"lista"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Ogiltig inmatning: förväntat instanceof ${_.expected}, fick ${J}`;return`Ogiltig inmatning: förväntat ${I}, fick ${J}`}case"invalid_value":if(_.values.length===1)return`Ogiltig inmatning: förväntat ${H(_.values[0])}`;return`Ogiltigt val: förväntade en av ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`För stor(t): förväntade ${_.origin??"värdet"} att ha ${I}${_.maximum.toString()} ${G.unit??"element"}`;return`För stor(t): förväntat ${_.origin??"värdet"} att ha ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`För lite(t): förväntade ${_.origin??"värdet"} att ha ${I}${_.minimum.toString()} ${G.unit}`;return`För lite(t): förväntade ${_.origin??"värdet"} att ha ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Ogiltig sträng: måste börja med "${I.prefix}"`;if(I.format==="ends_with")return`Ogiltig sträng: måste sluta med "${I.suffix}"`;if(I.format==="includes")return`Ogiltig sträng: måste innehålla "${I.includes}"`;if(I.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${I.pattern}"`;return`Ogiltig(t) ${U[I.format]??_.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${W(_.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${_.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${_.origin??"värdet"}`;default:return"Ogiltig input"}}};var ZQ=L(()=>{A()});function x0(){return{localeError:IW()}}var IW=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function v(_){return $[_]??null}let U={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",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 தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},D={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${_.expected}, பெறப்பட்டது ${J}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${I}, பெறப்பட்டது ${J}`}case"invalid_value":if(_.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${H(_.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${W(_.values,"|")} இல் ஒன்று`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${_.origin??"மதிப்பு"} ${I}${_.maximum.toString()} ${G.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${_.origin??"மதிப்பு"} ${I}${_.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${_.origin} ${I}${_.minimum.toString()} ${G.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${_.origin} ${I}${_.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`தவறான சரம்: "${I.prefix}" இல் தொடங்க வேண்டும்`;if(I.format==="ends_with")return`தவறான சரம்: "${I.suffix}" இல் முடிவடைய வேண்டும்`;if(I.format==="includes")return`தவறான சரம்: "${I.includes}" ஐ உள்ளடக்க வேண்டும்`;if(I.format==="regex")return`தவறான சரம்: ${I.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${U[I.format]??_.format}`}case"not_multiple_of":return`தவறான எண்: ${_.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${_.keys.length>1?"கள்":""}: ${W(_.keys,", ")}`;case"invalid_key":return`${_.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${_.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};var MQ=L(()=>{A()});function R0(){return{localeError:GW()}}var GW=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function v(_){return $[_]??null}let U={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},D={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${_.expected} แต่ได้รับ ${J}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${I} แต่ได้รับ ${J}`}case"invalid_value":if(_.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${H(_.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"ไม่เกิน":"น้อยกว่า",G=v(_.origin);if(G)return`เกินกำหนด: ${_.origin??"ค่า"} ควรมี${I} ${_.maximum.toString()} ${G.unit??"รายการ"}`;return`เกินกำหนด: ${_.origin??"ค่า"} ควรมี${I} ${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?"อย่างน้อย":"มากกว่า",G=v(_.origin);if(G)return`น้อยกว่ากำหนด: ${_.origin} ควรมี${I} ${_.minimum.toString()} ${G.unit}`;return`น้อยกว่ากำหนด: ${_.origin} ควรมี${I} ${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${I.prefix}"`;if(I.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${I.suffix}"`;if(I.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${I.includes}" อยู่ในข้อความ`;if(I.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${I.pattern}`;return`รูปแบบไม่ถูกต้อง: ${U[I.format]??_.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${_.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${W(_.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${_.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${_.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};var TQ=L(()=>{A()});function C0(){return{localeError:JW()}}var JW=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function v(_){return $[_]??null}let U={regex:"girdi",email:"e-posta adresi",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 tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},D={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Geçersiz değer: beklenen instanceof ${_.expected}, alınan ${J}`;return`Geçersiz değer: beklenen ${I}, alınan ${J}`}case"invalid_value":if(_.values.length===1)return`Geçersiz değer: beklenen ${H(_.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Çok büyük: beklenen ${_.origin??"değer"} ${I}${_.maximum.toString()} ${G.unit??"öğe"}`;return`Çok büyük: beklenen ${_.origin??"değer"} ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Çok küçük: beklenen ${_.origin} ${I}${_.minimum.toString()} ${G.unit}`;return`Çok küçük: beklenen ${_.origin} ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Geçersiz metin: "${I.prefix}" ile başlamalı`;if(I.format==="ends_with")return`Geçersiz metin: "${I.suffix}" ile bitmeli`;if(I.format==="includes")return`Geçersiz metin: "${I.includes}" içermeli`;if(I.format==="regex")return`Geçersiz metin: ${I.pattern} desenine uymalı`;return`Geçersiz ${U[I.format]??_.format}`}case"not_multiple_of":return`Geçersiz sayı: ${_.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${_.keys.length>1?"lar":""}: ${W(_.keys,", ")}`;case"invalid_key":return`${_.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${_.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};var zQ=L(()=>{A()});function M6(){return{localeError:wW()}}var wW=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function v(_){return $[_]??null}let U={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},D={nan:"NaN",number:"число",array:"масив"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Неправильні вхідні дані: очікується instanceof ${_.expected}, отримано ${J}`;return`Неправильні вхідні дані: очікується ${I}, отримано ${J}`}case"invalid_value":if(_.values.length===1)return`Неправильні вхідні дані: очікується ${H(_.values[0])}`;return`Неправильна опція: очікується одне з ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Занадто велике: очікується, що ${_.origin??"значення"} ${G.verb} ${I}${_.maximum.toString()} ${G.unit??"елементів"}`;return`Занадто велике: очікується, що ${_.origin??"значення"} буде ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Занадто мале: очікується, що ${_.origin} ${G.verb} ${I}${_.minimum.toString()} ${G.unit}`;return`Занадто мале: очікується, що ${_.origin} буде ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Неправильний рядок: повинен починатися з "${I.prefix}"`;if(I.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${I.suffix}"`;if(I.format==="includes")return`Неправильний рядок: повинен містити "${I.includes}"`;if(I.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${I.pattern}`;return`Неправильний ${U[I.format]??_.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${_.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${_.keys.length>1?"і":""}: ${W(_.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${_.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${_.origin}`;default:return"Неправильні вхідні дані"}}};var u0=L(()=>{A()});function y0(){return M6()}var AQ=L(()=>{u0()});function f0(){return{localeError:XW()}}var XW=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function v(_){return $[_]??null}let U={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},D={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`غلط ان پٹ: instanceof ${_.expected} متوقع تھا، ${J} موصول ہوا`;return`غلط ان پٹ: ${I} متوقع تھا، ${J} موصول ہوا`}case"invalid_value":if(_.values.length===1)return`غلط ان پٹ: ${H(_.values[0])} متوقع تھا`;return`غلط آپشن: ${W(_.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`بہت بڑا: ${_.origin??"ویلیو"} کے ${I}${_.maximum.toString()} ${G.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${_.origin??"ویلیو"} کا ${I}${_.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`بہت چھوٹا: ${_.origin} کے ${I}${_.minimum.toString()} ${G.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${_.origin} کا ${I}${_.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`غلط سٹرنگ: "${I.prefix}" سے شروع ہونا چاہیے`;if(I.format==="ends_with")return`غلط سٹرنگ: "${I.suffix}" پر ختم ہونا چاہیے`;if(I.format==="includes")return`غلط سٹرنگ: "${I.includes}" شامل ہونا چاہیے`;if(I.format==="regex")return`غلط سٹرنگ: پیٹرن ${I.pattern} سے میچ ہونا چاہیے`;return`غلط ${U[I.format]??_.format}`}case"not_multiple_of":return`غلط نمبر: ${_.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${_.keys.length>1?"ز":""}: ${W(_.keys,"، ")}`;case"invalid_key":return`${_.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${_.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};var jQ=L(()=>{A()});function c0(){return{localeError:QW()}}var QW=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function v(_){return $[_]??null}let U={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},D={nan:"NaN",number:"raqam",array:"massiv"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${_.expected}, qabul qilingan ${J}`;return`Noto‘g‘ri kirish: kutilgan ${I}, qabul qilingan ${J}`}case"invalid_value":if(_.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${H(_.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Juda katta: kutilgan ${_.origin??"qiymat"} ${I}${_.maximum.toString()} ${G.unit} ${G.verb}`;return`Juda katta: kutilgan ${_.origin??"qiymat"} ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Juda kichik: kutilgan ${_.origin} ${I}${_.minimum.toString()} ${G.unit} ${G.verb}`;return`Juda kichik: kutilgan ${_.origin} ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Noto‘g‘ri satr: "${I.prefix}" bilan boshlanishi kerak`;if(I.format==="ends_with")return`Noto‘g‘ri satr: "${I.suffix}" bilan tugashi kerak`;if(I.format==="includes")return`Noto‘g‘ri satr: "${I.includes}" ni o‘z ichiga olishi kerak`;if(I.format==="regex")return`Noto‘g‘ri satr: ${I.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${U[I.format]??_.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${_.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${_.keys.length>1?"lar":""}: ${W(_.keys,", ")}`;case"invalid_key":return`${_.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${_.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};var EQ=L(()=>{A()});function h0(){return{localeError:YW()}}var YW=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function v(_){return $[_]??null}let U={regex:"đầu vào",email:"địa chỉ email",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:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},D={nan:"NaN",number:"số",array:"mảng"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${_.expected}, nhận được ${J}`;return`Đầu vào không hợp lệ: mong đợi ${I}, nhận được ${J}`}case"invalid_value":if(_.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${H(_.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Quá lớn: mong đợi ${_.origin??"giá trị"} ${G.verb} ${I}${_.maximum.toString()} ${G.unit??"phần tử"}`;return`Quá lớn: mong đợi ${_.origin??"giá trị"} ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Quá nhỏ: mong đợi ${_.origin} ${G.verb} ${I}${_.minimum.toString()} ${G.unit}`;return`Quá nhỏ: mong đợi ${_.origin} ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${I.prefix}"`;if(I.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${I.suffix}"`;if(I.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${I.includes}"`;if(I.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${I.pattern}`;return`${U[I.format]??_.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${_.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${W(_.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${_.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${_.origin}`;default:return"Đầu vào không hợp lệ"}}};var xQ=L(()=>{A()});function r0(){return{localeError:PW()}}var PW=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function v(_){return $[_]??null}let U={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},D={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`无效输入:期望 instanceof ${_.expected},实际接收 ${J}`;return`无效输入:期望 ${I},实际接收 ${J}`}case"invalid_value":if(_.values.length===1)return`无效输入:期望 ${H(_.values[0])}`;return`无效选项:期望以下之一 ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`数值过大:期望 ${_.origin??"值"} ${I}${_.maximum.toString()} ${G.unit??"个元素"}`;return`数值过大:期望 ${_.origin??"值"} ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`数值过小:期望 ${_.origin} ${I}${_.minimum.toString()} ${G.unit}`;return`数值过小:期望 ${_.origin} ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`无效字符串:必须以 "${I.prefix}" 开头`;if(I.format==="ends_with")return`无效字符串:必须以 "${I.suffix}" 结尾`;if(I.format==="includes")return`无效字符串:必须包含 "${I.includes}"`;if(I.format==="regex")return`无效字符串:必须满足正则表达式 ${I.pattern}`;return`无效${U[I.format]??_.format}`}case"not_multiple_of":return`无效数字:必须是 ${_.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${W(_.keys,", ")}`;case"invalid_key":return`${_.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${_.origin} 中包含无效值(value)`;default:return"无效输入"}}};var RQ=L(()=>{A()});function m0(){return{localeError:KW()}}var KW=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function v(_){return $[_]??null}let U={regex:"輸入",email:"郵件地址",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 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},D={nan:"NaN"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`無效的輸入值:預期為 instanceof ${_.expected},但收到 ${J}`;return`無效的輸入值:預期為 ${I},但收到 ${J}`}case"invalid_value":if(_.values.length===1)return`無效的輸入值:預期為 ${H(_.values[0])}`;return`無效的選項:預期為以下其中之一 ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`數值過大:預期 ${_.origin??"值"} 應為 ${I}${_.maximum.toString()} ${G.unit??"個元素"}`;return`數值過大:預期 ${_.origin??"值"} 應為 ${I}${_.maximum.toString()}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`數值過小:預期 ${_.origin} 應為 ${I}${_.minimum.toString()} ${G.unit}`;return`數值過小:預期 ${_.origin} 應為 ${I}${_.minimum.toString()}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`無效的字串:必須以 "${I.prefix}" 開頭`;if(I.format==="ends_with")return`無效的字串:必須以 "${I.suffix}" 結尾`;if(I.format==="includes")return`無效的字串:必須包含 "${I.includes}"`;if(I.format==="regex")return`無效的字串:必須符合格式 ${I.pattern}`;return`無效的 ${U[I.format]??_.format}`}case"not_multiple_of":return`無效的數字:必須為 ${_.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${_.keys.length>1?"們":""}:${W(_.keys,"、")}`;case"invalid_key":return`${_.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${_.origin} 中有無效的值`;default:return"無效的輸入值"}}};var CQ=L(()=>{A()});function l0(){return{localeError:VW()}}var VW=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function v(_){return $[_]??null}let U={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},D={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(_)=>{switch(_.code){case"invalid_type":{let I=D[_.expected]??_.expected,G=F(_.input),J=D[G]??G;if(/^[A-Z]/.test(_.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${_.expected}, àmọ̀ a rí ${J}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${I}, àmọ̀ a rí ${J}`}case"invalid_value":if(_.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${H(_.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${W(_.values,"|")}`;case"too_big":{let I=_.inclusive?"<=":"<",G=v(_.origin);if(G)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${_.origin??"iye"} ${G.verb} ${I}${_.maximum} ${G.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${I}${_.maximum}`}case"too_small":{let I=_.inclusive?">=":">",G=v(_.origin);if(G)return`Kéré ju: a ní láti jẹ́ pé ${_.origin} ${G.verb} ${I}${_.minimum} ${G.unit}`;return`Kéré ju: a ní láti jẹ́ ${I}${_.minimum}`}case"invalid_format":{let I=_;if(I.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${I.prefix}"`;if(I.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${I.suffix}"`;if(I.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${I.includes}"`;if(I.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${I.pattern}`;return`Aṣìṣe: ${U[I.format]??_.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${_.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${W(_.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${_.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${_.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};var uQ=L(()=>{A()});var T6={};i$(T6,{zhTW:()=>m0,zhCN:()=>r0,yo:()=>l0,vi:()=>h0,uz:()=>c0,ur:()=>f0,uk:()=>M6,ua:()=>y0,tr:()=>C0,th:()=>R0,ta:()=>x0,sv:()=>E0,sl:()=>j0,ru:()=>A0,pt:()=>z0,ps:()=>M0,pl:()=>T0,ota:()=>Z0,no:()=>B0,nl:()=>S0,ms:()=>g0,mk:()=>b0,lt:()=>F0,ko:()=>H0,km:()=>B6,kh:()=>k0,ka:()=>N0,ja:()=>L0,it:()=>W0,is:()=>O0,id:()=>V0,hy:()=>K0,hu:()=>P0,he:()=>Y0,frCA:()=>Q0,fr:()=>X0,fi:()=>w0,fa:()=>J0,es:()=>G0,eo:()=>I0,en:()=>S6,de:()=>U0,da:()=>_0,cs:()=>v0,ca:()=>$0,bg:()=>s2,be:()=>e2,az:()=>a2,ar:()=>p2});var i0=L(()=>{rX();mX();iX();nX();dX();oX();tX();pX();D0();aX();eX();sX();$Q();vQ();_Q();UQ();DQ();GQ();JQ();wQ();XQ();QQ();YQ();PQ();q0();KQ();OQ();WQ();LQ();NQ();qQ();kQ();HQ();FQ();bQ();SQ();BQ();ZQ();MQ();TQ();zQ();AQ();u0();jQ();EQ();xQ();RQ();CQ();uQ()});class o0{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...v){let U=v[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U)this._idmap.set(U.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let v=this._map.get($);if(v&&typeof v==="object"&&"id"in v)this._idmap.delete(v.id);return this._map.delete($),this}get($){let v=$._zod.parent;if(v){let U={...this.get(v)??{}};delete U.id;let D={...U,...this._map.get($)};return Object.keys(D).length?D:void 0}return this._map.get($)}has($){return this._map.has($)}}function l1(){return new o0}var yQ,n0,d0,P$;var z6=L(()=>{n0=Symbol("ZodOutput"),d0=Symbol("ZodInput");(yQ=globalThis).__zod_globalRegistry??(yQ.__zod_globalRegistry=l1());P$=globalThis.__zod_globalRegistry});function t0($,v){return new $({type:"string",...g(v)})}function p0($,v){return new $({type:"string",coerce:!0,...g(v)})}function i1($,v){return new $({type:"string",format:"email",check:"string_format",abort:!1,...g(v)})}function A6($,v){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...g(v)})}function n1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...g(v)})}function d1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(v)})}function o1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(v)})}function t1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(v)})}function j6($,v){return new $({type:"string",format:"url",check:"string_format",abort:!1,...g(v)})}function p1($,v){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...g(v)})}function a1($,v){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(v)})}function e1($,v){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...g(v)})}function s1($,v){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(v)})}function $_($,v){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...g(v)})}function v_($,v){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...g(v)})}function __($,v){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(v)})}function U_($,v){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(v)})}function D_($,v){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(v)})}function a0($,v){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...g(v)})}function I_($,v){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(v)})}function G_($,v){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(v)})}function J_($,v){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...g(v)})}function w_($,v){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...g(v)})}function X_($,v){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...g(v)})}function Q_($,v){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...g(v)})}function s0($,v){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(v)})}function $G($,v){return new $({type:"string",format:"date",check:"string_format",...g(v)})}function vG($,v){return new $({type:"string",format:"time",check:"string_format",precision:null,...g(v)})}function _G($,v){return new $({type:"string",format:"duration",check:"string_format",...g(v)})}function UG($,v){return new $({type:"number",checks:[],...g(v)})}function DG($,v){return new $({type:"number",coerce:!0,checks:[],...g(v)})}function IG($,v){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...g(v)})}function GG($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...g(v)})}function JG($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...g(v)})}function wG($,v){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...g(v)})}function XG($,v){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...g(v)})}function QG($,v){return new $({type:"boolean",...g(v)})}function YG($,v){return new $({type:"boolean",coerce:!0,...g(v)})}function PG($,v){return new $({type:"bigint",...g(v)})}function KG($,v){return new $({type:"bigint",coerce:!0,...g(v)})}function VG($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...g(v)})}function OG($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...g(v)})}function WG($,v){return new $({type:"symbol",...g(v)})}function LG($,v){return new $({type:"undefined",...g(v)})}function NG($,v){return new $({type:"null",...g(v)})}function qG($){return new $({type:"any"})}function kG($){return new $({type:"unknown"})}function HG($,v){return new $({type:"never",...g(v)})}function FG($,v){return new $({type:"void",...g(v)})}function bG($,v){return new $({type:"date",...g(v)})}function gG($,v){return new $({type:"date",coerce:!0,...g(v)})}function SG($,v){return new $({type:"nan",...g(v)})}function t$($,v){return new A1({check:"less_than",...g(v),value:$,inclusive:!1})}function A$($,v){return new A1({check:"less_than",...g(v),value:$,inclusive:!0})}function p$($,v){return new j1({check:"greater_than",...g(v),value:$,inclusive:!1})}function N$($,v){return new j1({check:"greater_than",...g(v),value:$,inclusive:!0})}function Y_($){return p$(0,$)}function P_($){return t$(0,$)}function K_($){return A$(0,$)}function V_($){return N$(0,$)}function gv($,v){return new qI({check:"multiple_of",...g(v),value:$})}function Sv($,v){return new FI({check:"max_size",...g(v),maximum:$})}function a$($,v){return new bI({check:"min_size",...g(v),minimum:$})}function hv($,v){return new gI({check:"size_equals",...g(v),size:$})}function rv($,v){return new SI({check:"max_length",...g(v),maximum:$})}function Iv($,v){return new BI({check:"min_length",...g(v),minimum:$})}function mv($,v){return new ZI({check:"length_equals",...g(v),length:$})}function Q4($,v){return new MI({check:"string_format",format:"regex",...g(v),pattern:$})}function Y4($){return new TI({check:"string_format",format:"lowercase",...g($)})}function P4($){return new zI({check:"string_format",format:"uppercase",...g($)})}function K4($,v){return new AI({check:"string_format",format:"includes",...g(v),includes:$})}function V4($,v){return new jI({check:"string_format",format:"starts_with",...g(v),prefix:$})}function O4($,v){return new EI({check:"string_format",format:"ends_with",...g(v),suffix:$})}function O_($,v,U){return new xI({check:"property",property:$,schema:v,...g(U)})}function W4($,v){return new RI({check:"mime_type",mime:$,...g(v)})}function m$($){return new CI({check:"overwrite",tx:$})}function L4($){return m$((v)=>v.normalize($))}function N4(){return m$(($)=>$.trim())}function q4(){return m$(($)=>$.toLowerCase())}function k4(){return m$(($)=>$.toUpperCase())}function H4(){return m$(($)=>jD($))}function BG($,v,U){return new $({type:"array",element:v,...g(U)})}function WW($,v,U){return new $({type:"union",options:v,...g(U)})}function LW($,v,U){return new $({type:"union",options:v,inclusive:!1,...g(U)})}function NW($,v,U,D){return new $({type:"union",options:U,discriminator:v,...g(D)})}function qW($,v,U){return new $({type:"intersection",left:v,right:U})}function kW($,v,U,D){let _=U instanceof E;return new $({type:"tuple",items:v,rest:_?U:null,...g(_?D:U)})}function HW($,v,U,D){return new $({type:"record",keyType:v,valueType:U,...g(D)})}function FW($,v,U,D){return new $({type:"map",keyType:v,valueType:U,...g(D)})}function bW($,v,U){return new $({type:"set",valueType:v,...g(U)})}function gW($,v,U){let D=Array.isArray(v)?Object.fromEntries(v.map((_)=>[_,_])):v;return new $({type:"enum",entries:D,...g(U)})}function SW($,v,U){return new $({type:"enum",entries:v,...g(U)})}function BW($,v,U){return new $({type:"literal",values:Array.isArray(v)?v:[v],...g(U)})}function ZG($,v){return new $({type:"file",...g(v)})}function ZW($,v){return new $({type:"transform",transform:v})}function MW($,v){return new $({type:"optional",innerType:v})}function TW($,v){return new $({type:"nullable",innerType:v})}function zW($,v,U){return new $({type:"default",innerType:v,get defaultValue(){return typeof U==="function"?U():xD(U)}})}function AW($,v,U){return new $({type:"nonoptional",innerType:v,...g(U)})}function jW($,v){return new $({type:"success",innerType:v})}function EW($,v,U){return new $({type:"catch",innerType:v,catchValue:typeof U==="function"?U:()=>U})}function xW($,v,U){return new $({type:"pipe",in:v,out:U})}function RW($,v){return new $({type:"readonly",innerType:v})}function CW($,v,U){return new $({type:"template_literal",parts:v,...g(U)})}function uW($,v){return new $({type:"lazy",getter:v})}function yW($,v){return new $({type:"promise",innerType:v})}function MG($,v,U){let D=g(U);return D.abort??(D.abort=!0),new $({type:"custom",check:"custom",fn:v,...D})}function TG($,v,U){return new $({type:"custom",check:"custom",fn:v,...g(U)})}function zG($){let v=fQ((U)=>{return U.addIssue=(D)=>{if(typeof D==="string")U.issues.push(U4(D,U.value,v._zod.def));else{let _=D;if(_.fatal)_.continue=!1;_.code??(_.code="custom"),_.input??(_.input=U.value),_.inst??(_.inst=v),_.continue??(_.continue=!v._zod.def.abort),U.issues.push(U4(_))}},$(U.value,U)});return v}function fQ($,v){let U=new d({check:"custom",...g(v)});return U._zod.check=$,U}function AG($){let v=new d({check:"describe"});return v._zod.onattach=[(U)=>{let D=P$.get(U)??{};P$.add(U,{...D,description:$})}],v._zod.check=()=>{},v}function jG($){let v=new d({check:"meta"});return v._zod.onattach=[(U)=>{let D=P$.get(U)??{};P$.add(U,{...D,...$})}],v._zod.check=()=>{},v}function EG($,v){let U=g(v),D=U.truthy??["true","1","yes","on","y","enabled"],_=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")D=D.map((O)=>typeof O==="string"?O.toLowerCase():O),_=_.map((O)=>typeof O==="string"?O.toLowerCase():O);let I=new Set(D),G=new Set(_),J=$.Codec??g6,X=$.Boolean??F6,Y=new($.String??cv)({type:"string",error:U.error}),P=new X({type:"boolean",error:U.error}),V=new J({type:"pipe",in:Y,out:P,transform:(O,S)=>{let B=O;if(U.case!=="sensitive")B=B.toLowerCase();if(I.has(B))return!0;else if(G.has(B))return!1;else return S.issues.push({code:"invalid_value",expected:"stringbool",values:[...I,...G],input:S.value,inst:V,continue:!1}),{}},reverseTransform:(O,S)=>{if(O===!0)return D[0]||"true";else return _[0]||"false"},error:U.error});return V}function F4($,v,U,D={}){let _=g(D),I={...g(D),check:"string_format",type:"string",format:v,fn:typeof U==="function"?U:(J)=>U.test(J),..._};if(U instanceof RegExp)I.pattern=U;return new $(I)}var e0;var cQ=L(()=>{E1();z6();t2();A();e0={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Bv($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??P$,target:v,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function m($,v,U={path:[],schemaPath:[]}){var D;let _=$._zod.def,I=v.seen.get($);if(I){if(I.count++,U.schemaPath.includes($))I.cycle=U.path;return I.schema}let G={schema:{},count:1,cycle:void 0,path:U.path};v.seen.set($,G);let J=$._zod.toJSONSchema?.();if(J)G.schema=J;else{let Y={...U,schemaPath:[...U.schemaPath,$],path:U.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(v,G.schema,Y);else{let V=G.schema,O=v.processors[_.type];if(!O)throw Error(`[toJSONSchema]: Non-representable type encountered: ${_.type}`);O($,v,V,Y)}let P=$._zod.parent;if(P){if(!G.ref)G.ref=P;m(P,v,Y),v.seen.get(P).isParent=!0}}let X=v.metadataRegistry.get($);if(X)Object.assign(G.schema,X);if(v.io==="input"&&q$($))delete G.schema.examples,delete G.schema.default;if(v.io==="input"&&G.schema._prefault)(D=G.schema).default??(D.default=G.schema._prefault);return delete G.schema._prefault,v.seen.get($).schema}function Zv($,v){let U=$.seen.get(v);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let D=new Map;for(let G of $.seen.entries()){let J=$.metadataRegistry.get(G[0])?.id;if(J){let X=D.get(J);if(X&&X!==G[0])throw Error(`Duplicate schema id "${J}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);D.set(J,G[0])}}let _=(G)=>{let J=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let P=$.external.registry.get(G[0])?.id,V=$.external.uri??((S)=>S);if(P)return{ref:V(P)};let O=G[1].defId??G[1].schema.id??`schema${$.counter++}`;return G[1].defId=O,{defId:O,ref:`${V("__shared")}#/${J}/${O}`}}if(G[1]===U)return{ref:"#"};let Q=`${"#"}/${J}/`,Y=G[1].schema.id??`__schema${$.counter++}`;return{defId:Y,ref:Q+Y}},I=(G)=>{if(G[1].schema.$ref)return;let J=G[1],{ref:X,defId:Q}=_(G);if(J.def={...J.schema},Q)J.defId=Q;let Y=J.schema;for(let P in Y)delete Y[P];Y.$ref=X};if($.cycles==="throw")for(let G of $.seen.entries()){let J=G[1];if(J.cycle)throw Error(`Cycle detected: #/${J.cycle?.join("/")}/<root>
|
|
54
|
+
|
|
55
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let G of $.seen.entries()){let J=G[1];if(v===G[0]){I(G);continue}if($.external){let Q=$.external.registry.get(G[0])?.id;if(v!==G[0]&&Q){I(G);continue}}if($.metadataRegistry.get(G[0])?.id){I(G);continue}if(J.cycle){I(G);continue}if(J.count>1){if($.reused==="ref"){I(G);continue}}}}function Mv($,v){let U=$.seen.get(v);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let D=(G)=>{let J=$.seen.get(G);if(J.ref===null)return;let X=J.def??J.schema,Q={...X},Y=J.ref;if(J.ref=null,Y){D(Y);let V=$.seen.get(Y),O=V.schema;if(O.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))X.allOf=X.allOf??[],X.allOf.push(O);else Object.assign(X,O);if(Object.assign(X,Q),G._zod.parent===Y)for(let B in X){if(B==="$ref"||B==="allOf")continue;if(!(B in Q))delete X[B]}if(O.$ref&&V.def)for(let B in X){if(B==="$ref"||B==="allOf")continue;if(B in V.def&&JSON.stringify(X[B])===JSON.stringify(V.def[B]))delete X[B]}}let P=G._zod.parent;if(P&&P!==Y){D(P);let V=$.seen.get(P);if(V?.schema.$ref){if(X.$ref=V.schema.$ref,V.def)for(let O in X){if(O==="$ref"||O==="allOf")continue;if(O in V.def&&JSON.stringify(X[O])===JSON.stringify(V.def[O]))delete X[O]}}}$.override({zodSchema:G,jsonSchema:X,path:J.path??[]})};for(let G of[...$.seen.entries()].reverse())D(G[0]);let _={};if($.target==="draft-2020-12")_.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")_.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")_.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let G=$.external.registry.get(v)?.id;if(!G)throw Error("Schema is missing an `id` property");_.$id=$.external.uri(G)}Object.assign(_,U.def??U.schema);let I=$.external?.defs??{};for(let G of $.seen.entries()){let J=G[1];if(J.def&&J.defId)I[J.defId]=J.def}if($.external);else if(Object.keys(I).length>0)if($.target==="draft-2020-12")_.$defs=I;else _.definitions=I;try{let G=JSON.parse(JSON.stringify(_));return Object.defineProperty(G,"~standard",{value:{...v["~standard"],jsonSchema:{input:b4(v,"input",$.processors),output:b4(v,"output",$.processors)}},enumerable:!1,writable:!1}),G}catch(G){throw Error("Error converting schema to JSON.")}}function q$($,v){let U=v??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let D=$._zod.def;if(D.type==="transform")return!0;if(D.type==="array")return q$(D.element,U);if(D.type==="set")return q$(D.valueType,U);if(D.type==="lazy")return q$(D.getter(),U);if(D.type==="promise"||D.type==="optional"||D.type==="nonoptional"||D.type==="nullable"||D.type==="readonly"||D.type==="default"||D.type==="prefault")return q$(D.innerType,U);if(D.type==="intersection")return q$(D.left,U)||q$(D.right,U);if(D.type==="record"||D.type==="map")return q$(D.keyType,U)||q$(D.valueType,U);if(D.type==="pipe")return q$(D.in,U)||q$(D.out,U);if(D.type==="object"){for(let _ in D.shape)if(q$(D.shape[_],U))return!0;return!1}if(D.type==="union"){for(let _ of D.options)if(q$(_,U))return!0;return!1}if(D.type==="tuple"){for(let _ of D.items)if(q$(_,U))return!0;if(D.rest&&q$(D.rest,U))return!0;return!1}return!1}var xG=($,v={})=>(U)=>{let D=Bv({...U,processors:v});return m($,D),Zv(D,$),Mv(D,$)},b4=($,v,U={})=>(D)=>{let{libraryOptions:_,target:I}=D??{},G=Bv({..._??{},target:I,io:v,processors:U});return m($,G),Zv(G,$),Mv(G,$)};var E6=L(()=>{z6()});function q_($,v){if("_idmap"in $){let D=$,_=Bv({...v,processors:W_}),I={};for(let X of D._idmap.entries()){let[Q,Y]=X;m(Y,_)}let G={},J={registry:D,uri:v?.uri,defs:I};_.external=J;for(let X of D._idmap.entries()){let[Q,Y]=X;Zv(_,Y),G[Q]=Mv(_,Y)}if(Object.keys(I).length>0){let X=_.target==="draft-2020-12"?"$defs":"definitions";G.__shared={[X]:I}}return{schemas:G}}let U=Bv({...v,processors:W_});return m($,U),Zv(U,$),Mv(U,$)}var fW,RG=($,v,U,D)=>{let _=U;_.type="string";let{minimum:I,maximum:G,format:J,patterns:X,contentEncoding:Q}=$._zod.bag;if(typeof I==="number")_.minLength=I;if(typeof G==="number")_.maxLength=G;if(J){if(_.format=fW[J]??J,_.format==="")delete _.format;if(J==="time")delete _.format}if(Q)_.contentEncoding=Q;if(X&&X.size>0){let Y=[...X];if(Y.length===1)_.pattern=Y[0].source;else if(Y.length>1)_.allOf=[...Y.map((P)=>({...v.target==="draft-07"||v.target==="draft-04"||v.target==="openapi-3.0"?{type:"string"}:{},pattern:P.source}))]}},CG=($,v,U,D)=>{let _=U,{minimum:I,maximum:G,format:J,multipleOf:X,exclusiveMaximum:Q,exclusiveMinimum:Y}=$._zod.bag;if(typeof J==="string"&&J.includes("int"))_.type="integer";else _.type="number";if(typeof Y==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")_.minimum=Y,_.exclusiveMinimum=!0;else _.exclusiveMinimum=Y;if(typeof I==="number"){if(_.minimum=I,typeof Y==="number"&&v.target!=="draft-04")if(Y>=I)delete _.minimum;else delete _.exclusiveMinimum}if(typeof Q==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")_.maximum=Q,_.exclusiveMaximum=!0;else _.exclusiveMaximum=Q;if(typeof G==="number"){if(_.maximum=G,typeof Q==="number"&&v.target!=="draft-04")if(Q<=G)delete _.maximum;else delete _.exclusiveMaximum}if(typeof X==="number")_.multipleOf=X},uG=($,v,U,D)=>{U.type="boolean"},yG=($,v,U,D)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},fG=($,v,U,D)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},cG=($,v,U,D)=>{if(v.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},hG=($,v,U,D)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},rG=($,v,U,D)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},mG=($,v,U,D)=>{U.not={}},lG=($,v,U,D)=>{},iG=($,v,U,D)=>{},nG=($,v,U,D)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},dG=($,v,U,D)=>{let _=$._zod.def,I=Y6(_.entries);if(I.every((G)=>typeof G==="number"))U.type="number";if(I.every((G)=>typeof G==="string"))U.type="string";U.enum=I},oG=($,v,U,D)=>{let _=$._zod.def,I=[];for(let G of _.values)if(G===void 0){if(v.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof G==="bigint")if(v.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else I.push(Number(G));else I.push(G);if(I.length===0);else if(I.length===1){let G=I[0];if(U.type=G===null?"null":typeof G,v.target==="draft-04"||v.target==="openapi-3.0")U.enum=[G];else U.const=G}else{if(I.every((G)=>typeof G==="number"))U.type="number";if(I.every((G)=>typeof G==="string"))U.type="string";if(I.every((G)=>typeof G==="boolean"))U.type="boolean";if(I.every((G)=>G===null))U.type="null";U.enum=I}},tG=($,v,U,D)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},pG=($,v,U,D)=>{let _=U,I=$._zod.pattern;if(!I)throw Error("Pattern not found in template literal");_.type="string",_.pattern=I.source},aG=($,v,U,D)=>{let _=U,I={type:"string",format:"binary",contentEncoding:"binary"},{minimum:G,maximum:J,mime:X}=$._zod.bag;if(G!==void 0)I.minLength=G;if(J!==void 0)I.maxLength=J;if(X)if(X.length===1)I.contentMediaType=X[0],Object.assign(_,I);else Object.assign(_,I),_.anyOf=X.map((Q)=>({contentMediaType:Q}));else Object.assign(_,I)},eG=($,v,U,D)=>{U.type="boolean"},sG=($,v,U,D)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},$J=($,v,U,D)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},vJ=($,v,U,D)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},_J=($,v,U,D)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},UJ=($,v,U,D)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},DJ=($,v,U,D)=>{let _=U,I=$._zod.def,{minimum:G,maximum:J}=$._zod.bag;if(typeof G==="number")_.minItems=G;if(typeof J==="number")_.maxItems=J;_.type="array",_.items=m(I.element,v,{...D,path:[...D.path,"items"]})},IJ=($,v,U,D)=>{let _=U,I=$._zod.def;_.type="object",_.properties={};let G=I.shape;for(let Q in G)_.properties[Q]=m(G[Q],v,{...D,path:[...D.path,"properties",Q]});let J=new Set(Object.keys(G)),X=new Set([...J].filter((Q)=>{let Y=I.shape[Q]._zod;if(v.io==="input")return Y.optin===void 0;else return Y.optout===void 0}));if(X.size>0)_.required=Array.from(X);if(I.catchall?._zod.def.type==="never")_.additionalProperties=!1;else if(!I.catchall){if(v.io==="output")_.additionalProperties=!1}else if(I.catchall)_.additionalProperties=m(I.catchall,v,{...D,path:[...D.path,"additionalProperties"]})},L_=($,v,U,D)=>{let _=$._zod.def,I=_.inclusive===!1,G=_.options.map((J,X)=>m(J,v,{...D,path:[...D.path,I?"oneOf":"anyOf",X]}));if(I)U.oneOf=G;else U.anyOf=G},GJ=($,v,U,D)=>{let _=$._zod.def,I=m(_.left,v,{...D,path:[...D.path,"allOf",0]}),G=m(_.right,v,{...D,path:[...D.path,"allOf",1]}),J=(Q)=>("allOf"in Q)&&Object.keys(Q).length===1,X=[...J(I)?I.allOf:[I],...J(G)?G.allOf:[G]];U.allOf=X},JJ=($,v,U,D)=>{let _=U,I=$._zod.def;_.type="array";let G=v.target==="draft-2020-12"?"prefixItems":"items",J=v.target==="draft-2020-12"?"items":v.target==="openapi-3.0"?"items":"additionalItems",X=I.items.map((V,O)=>m(V,v,{...D,path:[...D.path,G,O]})),Q=I.rest?m(I.rest,v,{...D,path:[...D.path,J,...v.target==="openapi-3.0"?[I.items.length]:[]]}):null;if(v.target==="draft-2020-12"){if(_.prefixItems=X,Q)_.items=Q}else if(v.target==="openapi-3.0"){if(_.items={anyOf:X},Q)_.items.anyOf.push(Q);if(_.minItems=X.length,!Q)_.maxItems=X.length}else if(_.items=X,Q)_.additionalItems=Q;let{minimum:Y,maximum:P}=$._zod.bag;if(typeof Y==="number")_.minItems=Y;if(typeof P==="number")_.maxItems=P},wJ=($,v,U,D)=>{let _=U,I=$._zod.def;_.type="object";let G=I.keyType,X=G._zod.bag?.patterns;if(I.mode==="loose"&&X&&X.size>0){let Y=m(I.valueType,v,{...D,path:[...D.path,"patternProperties","*"]});_.patternProperties={};for(let P of X)_.patternProperties[P.source]=Y}else{if(v.target==="draft-07"||v.target==="draft-2020-12")_.propertyNames=m(I.keyType,v,{...D,path:[...D.path,"propertyNames"]});_.additionalProperties=m(I.valueType,v,{...D,path:[...D.path,"additionalProperties"]})}let Q=G._zod.values;if(Q){let Y=[...Q].filter((P)=>typeof P==="string"||typeof P==="number");if(Y.length>0)_.required=Y}},XJ=($,v,U,D)=>{let _=$._zod.def,I=m(_.innerType,v,D),G=v.seen.get($);if(v.target==="openapi-3.0")G.ref=_.innerType,U.nullable=!0;else U.anyOf=[I,{type:"null"}]},QJ=($,v,U,D)=>{let _=$._zod.def;m(_.innerType,v,D);let I=v.seen.get($);I.ref=_.innerType},YJ=($,v,U,D)=>{let _=$._zod.def;m(_.innerType,v,D);let I=v.seen.get($);I.ref=_.innerType,U.default=JSON.parse(JSON.stringify(_.defaultValue))},PJ=($,v,U,D)=>{let _=$._zod.def;m(_.innerType,v,D);let I=v.seen.get($);if(I.ref=_.innerType,v.io==="input")U._prefault=JSON.parse(JSON.stringify(_.defaultValue))},KJ=($,v,U,D)=>{let _=$._zod.def;m(_.innerType,v,D);let I=v.seen.get($);I.ref=_.innerType;let G;try{G=_.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}U.default=G},VJ=($,v,U,D)=>{let _=$._zod.def,I=v.io==="input"?_.in._zod.def.type==="transform"?_.out:_.in:_.out;m(I,v,D);let G=v.seen.get($);G.ref=I},OJ=($,v,U,D)=>{let _=$._zod.def;m(_.innerType,v,D);let I=v.seen.get($);I.ref=_.innerType,U.readOnly=!0},WJ=($,v,U,D)=>{let _=$._zod.def;m(_.innerType,v,D);let I=v.seen.get($);I.ref=_.innerType},N_=($,v,U,D)=>{let _=$._zod.def;m(_.innerType,v,D);let I=v.seen.get($);I.ref=_.innerType},LJ=($,v,U,D)=>{let _=$._zod.innerType;m(_,v,D);let I=v.seen.get($);I.ref=_},W_;var x6=L(()=>{E6();A();fW={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},W_={string:RG,number:CG,boolean:uG,bigint:yG,symbol:fG,null:cG,undefined:hG,void:rG,never:mG,any:lG,unknown:iG,date:nG,enum:dG,literal:oG,nan:tG,template_literal:pG,file:aG,success:eG,custom:sG,function:$J,transform:vJ,map:_J,set:UJ,array:DJ,object:IJ,union:L_,intersection:GJ,tuple:JJ,record:wJ,nullable:XJ,nonoptional:QJ,default:YJ,prefault:PJ,catch:KJ,pipe:VJ,readonly:OJ,promise:WJ,optional:N_,lazy:LJ}});class NJ{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";this.ctx=Bv({processors:W_,target:v,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,v={path:[],schemaPath:[]}){return m($,this.ctx,v)}emit($,v){if(v){if(v.cycles)this.ctx.cycles=v.cycles;if(v.reused)this.ctx.reused=v.reused;if(v.external)this.ctx.external=v.external}Zv(this.ctx,$);let U=Mv(this.ctx,$),{"~standard":D,..._}=U;return _}}var hQ=L(()=>{x6();E6()});var rQ={};var mQ=()=>{};var Gv={};i$(Gv,{version:()=>uI,util:()=>b,treeifyError:()=>fD,toJSONSchema:()=>q_,toDotPath:()=>qX,safeParseAsync:()=>mD,safeParse:()=>rD,safeEncodeAsync:()=>n5,safeEncode:()=>l5,safeDecodeAsync:()=>d5,safeDecode:()=>i5,registry:()=>l1,regexes:()=>f$,process:()=>m,prettifyError:()=>cD,parseAsync:()=>k1,parse:()=>q1,meta:()=>jG,locales:()=>T6,isValidJWT:()=>yX,isValidBase64URL:()=>uX,isValidBase64:()=>G2,initializeContext:()=>Bv,globalRegistry:()=>P$,globalConfig:()=>X6,formatError:()=>N6,flattenError:()=>L6,finalize:()=>Mv,extractDefs:()=>Zv,encodeAsync:()=>r5,encode:()=>c5,describe:()=>AG,decodeAsync:()=>m5,decode:()=>h5,createToJSONSchemaMethod:()=>xG,createStandardJSONSchemaMethod:()=>b4,config:()=>v$,clone:()=>L$,_xor:()=>LW,_xid:()=>v_,_void:()=>FG,_uuidv7:()=>t1,_uuidv6:()=>o1,_uuidv4:()=>d1,_uuid:()=>n1,_url:()=>j6,_uppercase:()=>P4,_unknown:()=>kG,_union:()=>WW,_undefined:()=>LG,_ulid:()=>$_,_uint64:()=>OG,_uint32:()=>XG,_tuple:()=>kW,_trim:()=>N4,_transform:()=>ZW,_toUpperCase:()=>k4,_toLowerCase:()=>q4,_templateLiteral:()=>CW,_symbol:()=>WG,_superRefine:()=>zG,_success:()=>jW,_stringbool:()=>EG,_stringFormat:()=>F4,_string:()=>t0,_startsWith:()=>V4,_slugify:()=>H4,_size:()=>hv,_set:()=>bW,_safeParseAsync:()=>J4,_safeParse:()=>G4,_safeEncodeAsync:()=>Z1,_safeEncode:()=>S1,_safeDecodeAsync:()=>M1,_safeDecode:()=>B1,_regex:()=>Q4,_refine:()=>TG,_record:()=>HW,_readonly:()=>RW,_property:()=>O_,_promise:()=>yW,_positive:()=>Y_,_pipe:()=>xW,_parseAsync:()=>I4,_parse:()=>D4,_overwrite:()=>m$,_optional:()=>MW,_number:()=>UG,_nullable:()=>TW,_null:()=>NG,_normalize:()=>L4,_nonpositive:()=>K_,_nonoptional:()=>AW,_nonnegative:()=>V_,_never:()=>HG,_negative:()=>P_,_nativeEnum:()=>SW,_nanoid:()=>a1,_nan:()=>SG,_multipleOf:()=>gv,_minSize:()=>a$,_minLength:()=>Iv,_min:()=>N$,_mime:()=>W4,_maxSize:()=>Sv,_maxLength:()=>rv,_max:()=>A$,_map:()=>FW,_mac:()=>a0,_lte:()=>A$,_lt:()=>t$,_lowercase:()=>Y4,_literal:()=>BW,_length:()=>mv,_lazy:()=>uW,_ksuid:()=>__,_jwt:()=>Q_,_isoTime:()=>vG,_isoDuration:()=>_G,_isoDateTime:()=>s0,_isoDate:()=>$G,_ipv6:()=>D_,_ipv4:()=>U_,_intersection:()=>qW,_int64:()=>VG,_int32:()=>wG,_int:()=>IG,_includes:()=>K4,_guid:()=>A6,_gte:()=>N$,_gt:()=>p$,_float64:()=>JG,_float32:()=>GG,_file:()=>ZG,_enum:()=>gW,_endsWith:()=>O4,_encodeAsync:()=>b1,_encode:()=>H1,_emoji:()=>p1,_email:()=>i1,_e164:()=>X_,_discriminatedUnion:()=>NW,_default:()=>zW,_decodeAsync:()=>g1,_decode:()=>F1,_date:()=>bG,_custom:()=>MG,_cuid2:()=>s1,_cuid:()=>e1,_coercedString:()=>p0,_coercedNumber:()=>DG,_coercedDate:()=>gG,_coercedBoolean:()=>YG,_coercedBigint:()=>KG,_cidrv6:()=>G_,_cidrv4:()=>I_,_check:()=>fQ,_catch:()=>EW,_boolean:()=>QG,_bigint:()=>PG,_base64url:()=>w_,_base64:()=>J_,_array:()=>BG,_any:()=>qG,TimePrecision:()=>e0,NEVER:()=>MD,JSONSchemaGenerator:()=>NJ,JSONSchema:()=>rQ,Doc:()=>x1,$output:()=>n0,$input:()=>d0,$constructor:()=>K,$brand:()=>TD,$ZodXor:()=>g2,$ZodXID:()=>tI,$ZodVoid:()=>k2,$ZodUnknown:()=>N2,$ZodUnion:()=>b6,$ZodUndefined:()=>O2,$ZodUUID:()=>hI,$ZodURL:()=>mI,$ZodULID:()=>oI,$ZodType:()=>E,$ZodTuple:()=>r1,$ZodTransform:()=>E2,$ZodTemplateLiteral:()=>l2,$ZodSymbol:()=>V2,$ZodSuccess:()=>f2,$ZodStringFormat:()=>l,$ZodString:()=>cv,$ZodSet:()=>T2,$ZodRegistry:()=>o0,$ZodRecord:()=>Z2,$ZodRealError:()=>b$,$ZodReadonly:()=>m2,$ZodPromise:()=>n2,$ZodPrefault:()=>u2,$ZodPipe:()=>r2,$ZodOptional:()=>m1,$ZodObjectJIT:()=>b2,$ZodObject:()=>hX,$ZodNumberFormat:()=>P2,$ZodNumber:()=>c1,$ZodNullable:()=>R2,$ZodNull:()=>W2,$ZodNonOptional:()=>y2,$ZodNever:()=>q2,$ZodNanoID:()=>iI,$ZodNaN:()=>h2,$ZodMap:()=>M2,$ZodMAC:()=>U2,$ZodLiteral:()=>A2,$ZodLazy:()=>d2,$ZodKSUID:()=>pI,$ZodJWT:()=>Q2,$ZodIntersection:()=>B2,$ZodISOTime:()=>sI,$ZodISODuration:()=>$2,$ZodISODateTime:()=>aI,$ZodISODate:()=>eI,$ZodIPv6:()=>_2,$ZodIPv4:()=>v2,$ZodGUID:()=>cI,$ZodFunction:()=>i2,$ZodFile:()=>j2,$ZodExactOptional:()=>x2,$ZodError:()=>W6,$ZodEnum:()=>z2,$ZodEncodeError:()=>uv,$ZodEmoji:()=>lI,$ZodEmail:()=>rI,$ZodE164:()=>X2,$ZodDiscriminatedUnion:()=>S2,$ZodDefault:()=>C2,$ZodDate:()=>H2,$ZodCustomStringFormat:()=>Y2,$ZodCustom:()=>o2,$ZodCodec:()=>g6,$ZodCheckUpperCase:()=>zI,$ZodCheckStringFormat:()=>w4,$ZodCheckStartsWith:()=>jI,$ZodCheckSizeEquals:()=>gI,$ZodCheckRegex:()=>MI,$ZodCheckProperty:()=>xI,$ZodCheckOverwrite:()=>CI,$ZodCheckNumberFormat:()=>kI,$ZodCheckMultipleOf:()=>qI,$ZodCheckMinSize:()=>bI,$ZodCheckMinLength:()=>BI,$ZodCheckMimeType:()=>RI,$ZodCheckMaxSize:()=>FI,$ZodCheckMaxLength:()=>SI,$ZodCheckLowerCase:()=>TI,$ZodCheckLessThan:()=>A1,$ZodCheckLengthEquals:()=>ZI,$ZodCheckIncludes:()=>AI,$ZodCheckGreaterThan:()=>j1,$ZodCheckEndsWith:()=>EI,$ZodCheckBigIntFormat:()=>HI,$ZodCheck:()=>d,$ZodCatch:()=>c2,$ZodCUID2:()=>dI,$ZodCUID:()=>nI,$ZodCIDRv6:()=>I2,$ZodCIDRv4:()=>D2,$ZodBoolean:()=>F6,$ZodBigIntFormat:()=>K2,$ZodBigInt:()=>h1,$ZodBase64URL:()=>w2,$ZodBase64:()=>J2,$ZodAsyncError:()=>o$,$ZodArray:()=>F2,$ZodAny:()=>L2});var j$=L(()=>{A();z1();i0();x6();hQ();mQ();$4();lD();hD();t2();E1();yI();z6();cQ();E6()});var k_={};i$(k_,{uppercase:()=>P4,trim:()=>N4,toUpperCase:()=>k4,toLowerCase:()=>q4,startsWith:()=>V4,slugify:()=>H4,size:()=>hv,regex:()=>Q4,property:()=>O_,positive:()=>Y_,overwrite:()=>m$,normalize:()=>L4,nonpositive:()=>K_,nonnegative:()=>V_,negative:()=>P_,multipleOf:()=>gv,minSize:()=>a$,minLength:()=>Iv,mime:()=>W4,maxSize:()=>Sv,maxLength:()=>rv,lte:()=>A$,lt:()=>t$,lowercase:()=>Y4,length:()=>mv,includes:()=>K4,gte:()=>N$,gt:()=>p$,endsWith:()=>O4});var H_=L(()=>{j$()});var g4={};i$(g4,{time:()=>HJ,duration:()=>FJ,datetime:()=>qJ,date:()=>kJ,ZodISOTime:()=>g_,ZodISODuration:()=>S_,ZodISODateTime:()=>F_,ZodISODate:()=>b_});function qJ($){return s0(F_,$)}function kJ($){return $G(b_,$)}function HJ($){return vG(g_,$)}function FJ($){return _G(S_,$)}var F_,b_,g_,S_;var R6=L(()=>{j$();u6();F_=K("ZodISODateTime",($,v)=>{aI.init($,v),i.init($,v)});b_=K("ZodISODate",($,v)=>{eI.init($,v),i.init($,v)});g_=K("ZodISOTime",($,v)=>{sI.init($,v),i.init($,v)});S_=K("ZodISODuration",($,v)=>{$2.init($,v),i.init($,v)})});var lQ=($,v)=>{W6.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>N6($,U)},flatten:{value:(U)=>L6($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,v4,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,v4,2)}},isEmpty:{get(){return $.issues.length===0}}})},hW,g$;var bJ=L(()=>{j$();j$();A();hW=K("ZodError",lQ),g$=K("ZodError",lQ,{Parent:Error})});var gJ,SJ,BJ,ZJ,MJ,TJ,zJ,AJ,jJ,EJ,xJ,RJ;var CJ=L(()=>{j$();bJ();gJ=D4(g$),SJ=I4(g$),BJ=G4(g$),ZJ=J4(g$),MJ=H1(g$),TJ=F1(g$),zJ=b1(g$),AJ=g1(g$),jJ=S1(g$),EJ=B1(g$),xJ=Z1(g$),RJ=M1(g$)});var C6={};i$(C6,{xor:()=>R8,xid:()=>D8,void:()=>T8,uuidv7:()=>pQ,uuidv6:()=>tQ,uuidv4:()=>oQ,uuid:()=>dQ,url:()=>aQ,unknown:()=>lv,union:()=>d_,undefined:()=>Z8,ulid:()=>U8,uint64:()=>S8,uint32:()=>F8,tuple:()=>$9,transform:()=>t_,templateLiteral:()=>o8,symbol:()=>B8,superRefine:()=>Z9,success:()=>i8,stringbool:()=>_Y,stringFormat:()=>O8,string:()=>B_,strictObject:()=>E8,set:()=>c8,refine:()=>B9,record:()=>v9,readonly:()=>k9,promise:()=>t8,preprocess:()=>DY,prefault:()=>K9,pipe:()=>h6,partialRecord:()=>u8,optional:()=>f6,object:()=>j8,number:()=>yJ,nullish:()=>l8,nullable:()=>c6,null:()=>mJ,nonoptional:()=>V9,never:()=>n_,nativeEnum:()=>h8,nanoid:()=>$8,nan:()=>n8,meta:()=>$Y,map:()=>f8,mac:()=>J8,looseRecord:()=>y8,looseObject:()=>x8,literal:()=>r8,lazy:()=>b9,ksuid:()=>I8,keyof:()=>A8,jwt:()=>V8,json:()=>UY,ipv6:()=>w8,ipv4:()=>G8,intersection:()=>eJ,int64:()=>g8,int32:()=>H8,int:()=>Z_,instanceof:()=>vY,httpUrl:()=>eQ,hostname:()=>W8,hex:()=>L8,hash:()=>N8,guid:()=>nQ,function:()=>p8,float64:()=>k8,float32:()=>q8,file:()=>m8,exactOptional:()=>w9,enum:()=>o_,emoji:()=>sQ,email:()=>iQ,e164:()=>K8,discriminatedUnion:()=>C8,describe:()=>s8,date:()=>z8,custom:()=>e8,cuid2:()=>_8,cuid:()=>v8,codec:()=>d8,cidrv6:()=>Q8,cidrv4:()=>X8,check:()=>a8,catch:()=>L9,boolean:()=>fJ,bigint:()=>b8,base64url:()=>P8,base64:()=>Y8,array:()=>l6,any:()=>M8,_function:()=>p8,_default:()=>Y9,_ZodString:()=>M_,ZodXor:()=>tJ,ZodXID:()=>R_,ZodVoid:()=>dJ,ZodUnknown:()=>iJ,ZodUnion:()=>n6,ZodUndefined:()=>hJ,ZodUUID:()=>e$,ZodURL:()=>r6,ZodULID:()=>x_,ZodType:()=>x,ZodTuple:()=>sJ,ZodTransform:()=>G9,ZodTemplateLiteral:()=>H9,ZodSymbol:()=>cJ,ZodSuccess:()=>O9,ZodStringFormat:()=>i,ZodString:()=>B4,ZodSet:()=>U9,ZodRecord:()=>d6,ZodReadonly:()=>q9,ZodPromise:()=>g9,ZodPrefault:()=>P9,ZodPipe:()=>e_,ZodOptional:()=>p_,ZodObject:()=>i6,ZodNumberFormat:()=>iv,ZodNumber:()=>M4,ZodNullable:()=>X9,ZodNull:()=>rJ,ZodNonOptional:()=>a_,ZodNever:()=>nJ,ZodNanoID:()=>A_,ZodNaN:()=>N9,ZodMap:()=>_9,ZodMAC:()=>uJ,ZodLiteral:()=>D9,ZodLazy:()=>F9,ZodKSUID:()=>C_,ZodJWT:()=>l_,ZodIntersection:()=>aJ,ZodIPv6:()=>y_,ZodIPv4:()=>u_,ZodGUID:()=>y6,ZodFunction:()=>S9,ZodFile:()=>I9,ZodExactOptional:()=>J9,ZodEnum:()=>S4,ZodEmoji:()=>z_,ZodEmail:()=>T_,ZodE164:()=>m_,ZodDiscriminatedUnion:()=>pJ,ZodDefault:()=>Q9,ZodDate:()=>m6,ZodCustomStringFormat:()=>Z4,ZodCustom:()=>o6,ZodCodec:()=>s_,ZodCatch:()=>W9,ZodCUID2:()=>E_,ZodCUID:()=>j_,ZodCIDRv6:()=>c_,ZodCIDRv4:()=>f_,ZodBoolean:()=>T4,ZodBigIntFormat:()=>i_,ZodBigInt:()=>z4,ZodBase64URL:()=>r_,ZodBase64:()=>h_,ZodArray:()=>oJ,ZodAny:()=>lJ});function B_($){return t0(B4,$)}function iQ($){return i1(T_,$)}function nQ($){return A6(y6,$)}function dQ($){return n1(e$,$)}function oQ($){return d1(e$,$)}function tQ($){return o1(e$,$)}function pQ($){return t1(e$,$)}function aQ($){return j6(r6,$)}function eQ($){return j6(r6,{protocol:/^https?$/,hostname:f$.domain,...b.normalizeParams($)})}function sQ($){return p1(z_,$)}function $8($){return a1(A_,$)}function v8($){return e1(j_,$)}function _8($){return s1(E_,$)}function U8($){return $_(x_,$)}function D8($){return v_(R_,$)}function I8($){return __(C_,$)}function G8($){return U_(u_,$)}function J8($){return a0(uJ,$)}function w8($){return D_(y_,$)}function X8($){return I_(f_,$)}function Q8($){return G_(c_,$)}function Y8($){return J_(h_,$)}function P8($){return w_(r_,$)}function K8($){return X_(m_,$)}function V8($){return Q_(l_,$)}function O8($,v,U={}){return F4(Z4,$,v,U)}function W8($){return F4(Z4,"hostname",f$.hostname,$)}function L8($){return F4(Z4,"hex",f$.hex,$)}function N8($,v){let U=v?.enc??"hex",D=`${$}_${U}`,_=f$[D];if(!_)throw Error(`Unrecognized hash format: ${D}`);return F4(Z4,D,_,v)}function yJ($){return UG(M4,$)}function Z_($){return IG(iv,$)}function q8($){return GG(iv,$)}function k8($){return JG(iv,$)}function H8($){return wG(iv,$)}function F8($){return XG(iv,$)}function fJ($){return QG(T4,$)}function b8($){return PG(z4,$)}function g8($){return VG(i_,$)}function S8($){return OG(i_,$)}function B8($){return WG(cJ,$)}function Z8($){return LG(hJ,$)}function mJ($){return NG(rJ,$)}function M8(){return qG(lJ)}function lv(){return kG(iJ)}function n_($){return HG(nJ,$)}function T8($){return FG(dJ,$)}function z8($){return bG(m6,$)}function l6($,v){return BG(oJ,$,v)}function A8($){let v=$._zod.def.shape;return o_(Object.keys(v))}function j8($,v){let U={type:"object",shape:$??{},...b.normalizeParams(v)};return new i6(U)}function E8($,v){return new i6({type:"object",shape:$,catchall:n_(),...b.normalizeParams(v)})}function x8($,v){return new i6({type:"object",shape:$,catchall:lv(),...b.normalizeParams(v)})}function d_($,v){return new n6({type:"union",options:$,...b.normalizeParams(v)})}function R8($,v){return new tJ({type:"union",options:$,inclusive:!1,...b.normalizeParams(v)})}function C8($,v,U){return new pJ({type:"union",options:v,discriminator:$,...b.normalizeParams(U)})}function eJ($,v){return new aJ({type:"intersection",left:$,right:v})}function $9($,v,U){let D=v instanceof E,_=D?U:v;return new sJ({type:"tuple",items:$,rest:D?v:null,...b.normalizeParams(_)})}function v9($,v,U){return new d6({type:"record",keyType:$,valueType:v,...b.normalizeParams(U)})}function u8($,v,U){let D=L$($);return D._zod.values=void 0,new d6({type:"record",keyType:D,valueType:v,...b.normalizeParams(U)})}function y8($,v,U){return new d6({type:"record",keyType:$,valueType:v,mode:"loose",...b.normalizeParams(U)})}function f8($,v,U){return new _9({type:"map",keyType:$,valueType:v,...b.normalizeParams(U)})}function c8($,v){return new U9({type:"set",valueType:$,...b.normalizeParams(v)})}function o_($,v){let U=Array.isArray($)?Object.fromEntries($.map((D)=>[D,D])):$;return new S4({type:"enum",entries:U,...b.normalizeParams(v)})}function h8($,v){return new S4({type:"enum",entries:$,...b.normalizeParams(v)})}function r8($,v){return new D9({type:"literal",values:Array.isArray($)?$:[$],...b.normalizeParams(v)})}function m8($){return ZG(I9,$)}function t_($){return new G9({type:"transform",transform:$})}function f6($){return new p_({type:"optional",innerType:$})}function w9($){return new J9({type:"optional",innerType:$})}function c6($){return new X9({type:"nullable",innerType:$})}function l8($){return f6(c6($))}function Y9($,v){return new Q9({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():b.shallowClone(v)}})}function K9($,v){return new P9({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():b.shallowClone(v)}})}function V9($,v){return new a_({type:"nonoptional",innerType:$,...b.normalizeParams(v)})}function i8($){return new O9({type:"success",innerType:$})}function L9($,v){return new W9({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}function n8($){return SG(N9,$)}function h6($,v){return new e_({type:"pipe",in:$,out:v})}function d8($,v,U){return new s_({type:"pipe",in:$,out:v,transform:U.decode,reverseTransform:U.encode})}function k9($){return new q9({type:"readonly",innerType:$})}function o8($,v){return new H9({type:"template_literal",parts:$,...b.normalizeParams(v)})}function b9($){return new F9({type:"lazy",getter:$})}function t8($){return new g9({type:"promise",innerType:$})}function p8($){return new S9({type:"function",input:Array.isArray($?.input)?$9($?.input):$?.input??l6(lv()),output:$?.output??lv()})}function a8($){let v=new d({check:"custom"});return v._zod.check=$,v}function e8($,v){return MG(o6,$??(()=>!0),v)}function B9($,v={}){return TG(o6,$,v)}function Z9($){return zG($)}function vY($,v={}){let U=new o6({type:"custom",check:"custom",fn:(D)=>D instanceof $,abort:!0,...b.normalizeParams(v)});return U._zod.bag.Class=$,U._zod.check=(D)=>{if(!(D.value instanceof $))D.issues.push({code:"invalid_type",expected:$.name,input:D.value,inst:U,path:[...U._zod.def.path??[]]})},U}function UY($){let v=b9(()=>{return d_([B_($),yJ(),fJ(),mJ(),l6(v),v9(B_(),v)])});return v}function DY($,v){return h6(t_($),v)}var x,M_,B4,i,T_,y6,e$,r6,z_,A_,j_,E_,x_,R_,C_,u_,uJ,y_,f_,c_,h_,r_,m_,l_,Z4,M4,iv,T4,z4,i_,cJ,hJ,rJ,lJ,iJ,nJ,dJ,m6,oJ,i6,n6,tJ,pJ,aJ,sJ,d6,_9,U9,S4,D9,I9,G9,p_,J9,X9,Q9,P9,a_,O9,W9,N9,e_,s_,q9,H9,F9,g9,S9,o6,s8,$Y,_Y=(...$)=>EG({Codec:s_,Boolean:T4,String:B4},...$);var u6=L(()=>{j$();j$();x6();E6();H_();R6();CJ();x=K("ZodType",($,v)=>{return E.init($,v),Object.assign($["~standard"],{jsonSchema:{input:b4($,"input"),output:b4($,"output")}}),$.toJSONSchema=xG($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.check=(...U)=>{return $.clone(b.mergeDefs(v,{checks:[...v.checks??[],...U.map((D)=>typeof D==="function"?{_zod:{check:D,def:{check:"custom"},onattach:[]}}:D)]}),{parent:!0})},$.with=$.check,$.clone=(U,D)=>L$($,U,D),$.brand=()=>$,$.register=(U,D)=>{return U.add($,D),$},$.parse=(U,D)=>gJ($,U,D,{callee:$.parse}),$.safeParse=(U,D)=>BJ($,U,D),$.parseAsync=async(U,D)=>SJ($,U,D,{callee:$.parseAsync}),$.safeParseAsync=async(U,D)=>ZJ($,U,D),$.spa=$.safeParseAsync,$.encode=(U,D)=>MJ($,U,D),$.decode=(U,D)=>TJ($,U,D),$.encodeAsync=async(U,D)=>zJ($,U,D),$.decodeAsync=async(U,D)=>AJ($,U,D),$.safeEncode=(U,D)=>jJ($,U,D),$.safeDecode=(U,D)=>EJ($,U,D),$.safeEncodeAsync=async(U,D)=>xJ($,U,D),$.safeDecodeAsync=async(U,D)=>RJ($,U,D),$.refine=(U,D)=>$.check(B9(U,D)),$.superRefine=(U)=>$.check(Z9(U)),$.overwrite=(U)=>$.check(m$(U)),$.optional=()=>f6($),$.exactOptional=()=>w9($),$.nullable=()=>c6($),$.nullish=()=>f6(c6($)),$.nonoptional=(U)=>V9($,U),$.array=()=>l6($),$.or=(U)=>d_([$,U]),$.and=(U)=>eJ($,U),$.transform=(U)=>h6($,t_(U)),$.default=(U)=>Y9($,U),$.prefault=(U)=>K9($,U),$.catch=(U)=>L9($,U),$.pipe=(U)=>h6($,U),$.readonly=()=>k9($),$.describe=(U)=>{let D=$.clone();return P$.add(D,{description:U}),D},Object.defineProperty($,"description",{get(){return P$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return P$.get($);let D=$.clone();return P$.add(D,U[0]),D},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(U)=>U($),$}),M_=K("_ZodString",($,v)=>{cv.init($,v),x.init($,v),$._zod.processJSONSchema=(D,_,I)=>RG($,D,_,I);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...D)=>$.check(Q4(...D)),$.includes=(...D)=>$.check(K4(...D)),$.startsWith=(...D)=>$.check(V4(...D)),$.endsWith=(...D)=>$.check(O4(...D)),$.min=(...D)=>$.check(Iv(...D)),$.max=(...D)=>$.check(rv(...D)),$.length=(...D)=>$.check(mv(...D)),$.nonempty=(...D)=>$.check(Iv(1,...D)),$.lowercase=(D)=>$.check(Y4(D)),$.uppercase=(D)=>$.check(P4(D)),$.trim=()=>$.check(N4()),$.normalize=(...D)=>$.check(L4(...D)),$.toLowerCase=()=>$.check(q4()),$.toUpperCase=()=>$.check(k4()),$.slugify=()=>$.check(H4())}),B4=K("ZodString",($,v)=>{cv.init($,v),M_.init($,v),$.email=(U)=>$.check(i1(T_,U)),$.url=(U)=>$.check(j6(r6,U)),$.jwt=(U)=>$.check(Q_(l_,U)),$.emoji=(U)=>$.check(p1(z_,U)),$.guid=(U)=>$.check(A6(y6,U)),$.uuid=(U)=>$.check(n1(e$,U)),$.uuidv4=(U)=>$.check(d1(e$,U)),$.uuidv6=(U)=>$.check(o1(e$,U)),$.uuidv7=(U)=>$.check(t1(e$,U)),$.nanoid=(U)=>$.check(a1(A_,U)),$.guid=(U)=>$.check(A6(y6,U)),$.cuid=(U)=>$.check(e1(j_,U)),$.cuid2=(U)=>$.check(s1(E_,U)),$.ulid=(U)=>$.check($_(x_,U)),$.base64=(U)=>$.check(J_(h_,U)),$.base64url=(U)=>$.check(w_(r_,U)),$.xid=(U)=>$.check(v_(R_,U)),$.ksuid=(U)=>$.check(__(C_,U)),$.ipv4=(U)=>$.check(U_(u_,U)),$.ipv6=(U)=>$.check(D_(y_,U)),$.cidrv4=(U)=>$.check(I_(f_,U)),$.cidrv6=(U)=>$.check(G_(c_,U)),$.e164=(U)=>$.check(X_(m_,U)),$.datetime=(U)=>$.check(qJ(U)),$.date=(U)=>$.check(kJ(U)),$.time=(U)=>$.check(HJ(U)),$.duration=(U)=>$.check(FJ(U))});i=K("ZodStringFormat",($,v)=>{l.init($,v),M_.init($,v)}),T_=K("ZodEmail",($,v)=>{rI.init($,v),i.init($,v)});y6=K("ZodGUID",($,v)=>{cI.init($,v),i.init($,v)});e$=K("ZodUUID",($,v)=>{hI.init($,v),i.init($,v)});r6=K("ZodURL",($,v)=>{mI.init($,v),i.init($,v)});z_=K("ZodEmoji",($,v)=>{lI.init($,v),i.init($,v)});A_=K("ZodNanoID",($,v)=>{iI.init($,v),i.init($,v)});j_=K("ZodCUID",($,v)=>{nI.init($,v),i.init($,v)});E_=K("ZodCUID2",($,v)=>{dI.init($,v),i.init($,v)});x_=K("ZodULID",($,v)=>{oI.init($,v),i.init($,v)});R_=K("ZodXID",($,v)=>{tI.init($,v),i.init($,v)});C_=K("ZodKSUID",($,v)=>{pI.init($,v),i.init($,v)});u_=K("ZodIPv4",($,v)=>{v2.init($,v),i.init($,v)});uJ=K("ZodMAC",($,v)=>{U2.init($,v),i.init($,v)});y_=K("ZodIPv6",($,v)=>{_2.init($,v),i.init($,v)});f_=K("ZodCIDRv4",($,v)=>{D2.init($,v),i.init($,v)});c_=K("ZodCIDRv6",($,v)=>{I2.init($,v),i.init($,v)});h_=K("ZodBase64",($,v)=>{J2.init($,v),i.init($,v)});r_=K("ZodBase64URL",($,v)=>{w2.init($,v),i.init($,v)});m_=K("ZodE164",($,v)=>{X2.init($,v),i.init($,v)});l_=K("ZodJWT",($,v)=>{Q2.init($,v),i.init($,v)});Z4=K("ZodCustomStringFormat",($,v)=>{Y2.init($,v),i.init($,v)});M4=K("ZodNumber",($,v)=>{c1.init($,v),x.init($,v),$._zod.processJSONSchema=(D,_,I)=>CG($,D,_,I),$.gt=(D,_)=>$.check(p$(D,_)),$.gte=(D,_)=>$.check(N$(D,_)),$.min=(D,_)=>$.check(N$(D,_)),$.lt=(D,_)=>$.check(t$(D,_)),$.lte=(D,_)=>$.check(A$(D,_)),$.max=(D,_)=>$.check(A$(D,_)),$.int=(D)=>$.check(Z_(D)),$.safe=(D)=>$.check(Z_(D)),$.positive=(D)=>$.check(p$(0,D)),$.nonnegative=(D)=>$.check(N$(0,D)),$.negative=(D)=>$.check(t$(0,D)),$.nonpositive=(D)=>$.check(A$(0,D)),$.multipleOf=(D,_)=>$.check(gv(D,_)),$.step=(D,_)=>$.check(gv(D,_)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});iv=K("ZodNumberFormat",($,v)=>{P2.init($,v),M4.init($,v)});T4=K("ZodBoolean",($,v)=>{F6.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>uG($,U,D,_)});z4=K("ZodBigInt",($,v)=>{h1.init($,v),x.init($,v),$._zod.processJSONSchema=(D,_,I)=>yG($,D,_,I),$.gte=(D,_)=>$.check(N$(D,_)),$.min=(D,_)=>$.check(N$(D,_)),$.gt=(D,_)=>$.check(p$(D,_)),$.gte=(D,_)=>$.check(N$(D,_)),$.min=(D,_)=>$.check(N$(D,_)),$.lt=(D,_)=>$.check(t$(D,_)),$.lte=(D,_)=>$.check(A$(D,_)),$.max=(D,_)=>$.check(A$(D,_)),$.positive=(D)=>$.check(p$(BigInt(0),D)),$.negative=(D)=>$.check(t$(BigInt(0),D)),$.nonpositive=(D)=>$.check(A$(BigInt(0),D)),$.nonnegative=(D)=>$.check(N$(BigInt(0),D)),$.multipleOf=(D,_)=>$.check(gv(D,_));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});i_=K("ZodBigIntFormat",($,v)=>{K2.init($,v),z4.init($,v)});cJ=K("ZodSymbol",($,v)=>{V2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>fG($,U,D,_)});hJ=K("ZodUndefined",($,v)=>{O2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>hG($,U,D,_)});rJ=K("ZodNull",($,v)=>{W2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>cG($,U,D,_)});lJ=K("ZodAny",($,v)=>{L2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>lG($,U,D,_)});iJ=K("ZodUnknown",($,v)=>{N2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>iG($,U,D,_)});nJ=K("ZodNever",($,v)=>{q2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>mG($,U,D,_)});dJ=K("ZodVoid",($,v)=>{k2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>rG($,U,D,_)});m6=K("ZodDate",($,v)=>{H2.init($,v),x.init($,v),$._zod.processJSONSchema=(D,_,I)=>nG($,D,_,I),$.min=(D,_)=>$.check(N$(D,_)),$.max=(D,_)=>$.check(A$(D,_));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});oJ=K("ZodArray",($,v)=>{F2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>DJ($,U,D,_),$.element=v.element,$.min=(U,D)=>$.check(Iv(U,D)),$.nonempty=(U)=>$.check(Iv(1,U)),$.max=(U,D)=>$.check(rv(U,D)),$.length=(U,D)=>$.check(mv(U,D)),$.unwrap=()=>$.element});i6=K("ZodObject",($,v)=>{b2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>IJ($,U,D,_),b.defineLazy($,"shape",()=>{return v.shape}),$.keyof=()=>o_(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:lv()}),$.loose=()=>$.clone({...$._zod.def,catchall:lv()}),$.strict=()=>$.clone({...$._zod.def,catchall:n_()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return b.extend($,U)},$.safeExtend=(U)=>{return b.safeExtend($,U)},$.merge=(U)=>b.merge($,U),$.pick=(U)=>b.pick($,U),$.omit=(U)=>b.omit($,U),$.partial=(...U)=>b.partial(p_,$,U[0]),$.required=(...U)=>b.required(a_,$,U[0])});n6=K("ZodUnion",($,v)=>{b6.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>L_($,U,D,_),$.options=v.options});tJ=K("ZodXor",($,v)=>{n6.init($,v),g2.init($,v),$._zod.processJSONSchema=(U,D,_)=>L_($,U,D,_),$.options=v.options});pJ=K("ZodDiscriminatedUnion",($,v)=>{n6.init($,v),S2.init($,v)});aJ=K("ZodIntersection",($,v)=>{B2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>GJ($,U,D,_)});sJ=K("ZodTuple",($,v)=>{r1.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>JJ($,U,D,_),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});d6=K("ZodRecord",($,v)=>{Z2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>wJ($,U,D,_),$.keyType=v.keyType,$.valueType=v.valueType});_9=K("ZodMap",($,v)=>{M2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>_J($,U,D,_),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...U)=>$.check(a$(...U)),$.nonempty=(U)=>$.check(a$(1,U)),$.max=(...U)=>$.check(Sv(...U)),$.size=(...U)=>$.check(hv(...U))});U9=K("ZodSet",($,v)=>{T2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>UJ($,U,D,_),$.min=(...U)=>$.check(a$(...U)),$.nonempty=(U)=>$.check(a$(1,U)),$.max=(...U)=>$.check(Sv(...U)),$.size=(...U)=>$.check(hv(...U))});S4=K("ZodEnum",($,v)=>{z2.init($,v),x.init($,v),$._zod.processJSONSchema=(D,_,I)=>dG($,D,_,I),$.enum=v.entries,$.options=Object.values(v.entries);let U=new Set(Object.keys(v.entries));$.extract=(D,_)=>{let I={};for(let G of D)if(U.has(G))I[G]=v.entries[G];else throw Error(`Key ${G} not found in enum`);return new S4({...v,checks:[],...b.normalizeParams(_),entries:I})},$.exclude=(D,_)=>{let I={...v.entries};for(let G of D)if(U.has(G))delete I[G];else throw Error(`Key ${G} not found in enum`);return new S4({...v,checks:[],...b.normalizeParams(_),entries:I})}});D9=K("ZodLiteral",($,v)=>{A2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>oG($,U,D,_),$.values=new Set(v.values),Object.defineProperty($,"value",{get(){if(v.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return v.values[0]}})});I9=K("ZodFile",($,v)=>{j2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>aG($,U,D,_),$.min=(U,D)=>$.check(a$(U,D)),$.max=(U,D)=>$.check(Sv(U,D)),$.mime=(U,D)=>$.check(W4(Array.isArray(U)?U:[U],D))});G9=K("ZodTransform",($,v)=>{E2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>vJ($,U,D,_),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new uv($.constructor.name);U.addIssue=(I)=>{if(typeof I==="string")U.issues.push(b.issue(I,U.value,v));else{let G=I;if(G.fatal)G.continue=!1;G.code??(G.code="custom"),G.input??(G.input=U.value),G.inst??(G.inst=$),U.issues.push(b.issue(G))}};let _=v.transform(U.value,U);if(_ instanceof Promise)return _.then((I)=>{return U.value=I,U});return U.value=_,U}});p_=K("ZodOptional",($,v)=>{m1.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>N_($,U,D,_),$.unwrap=()=>$._zod.def.innerType});J9=K("ZodExactOptional",($,v)=>{x2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>N_($,U,D,_),$.unwrap=()=>$._zod.def.innerType});X9=K("ZodNullable",($,v)=>{R2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>XJ($,U,D,_),$.unwrap=()=>$._zod.def.innerType});Q9=K("ZodDefault",($,v)=>{C2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>YJ($,U,D,_),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});P9=K("ZodPrefault",($,v)=>{u2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>PJ($,U,D,_),$.unwrap=()=>$._zod.def.innerType});a_=K("ZodNonOptional",($,v)=>{y2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>QJ($,U,D,_),$.unwrap=()=>$._zod.def.innerType});O9=K("ZodSuccess",($,v)=>{f2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>eG($,U,D,_),$.unwrap=()=>$._zod.def.innerType});W9=K("ZodCatch",($,v)=>{c2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>KJ($,U,D,_),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});N9=K("ZodNaN",($,v)=>{h2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>tG($,U,D,_)});e_=K("ZodPipe",($,v)=>{r2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>VJ($,U,D,_),$.in=v.in,$.out=v.out});s_=K("ZodCodec",($,v)=>{e_.init($,v),g6.init($,v)});q9=K("ZodReadonly",($,v)=>{m2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>OJ($,U,D,_),$.unwrap=()=>$._zod.def.innerType});H9=K("ZodTemplateLiteral",($,v)=>{l2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>pG($,U,D,_)});F9=K("ZodLazy",($,v)=>{d2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>LJ($,U,D,_),$.unwrap=()=>$._zod.def.getter()});g9=K("ZodPromise",($,v)=>{n2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>WJ($,U,D,_),$.unwrap=()=>$._zod.def.innerType});S9=K("ZodFunction",($,v)=>{i2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>$J($,U,D,_)});o6=K("ZodCustom",($,v)=>{o2.init($,v),x.init($,v),$._zod.processJSONSchema=(U,D,_)=>sG($,U,D,_)});s8=AG,$Y=jG});function lW($){v$({customError:$})}function iW(){return v$().customError}var mW,M9;var IY=L(()=>{j$();mW={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};(function($){})(M9||(M9={}))});function dW($,v){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return v??"draft-2020-12"}function oW($,v){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return v.rootSchema;let D=v.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===D){let _=U[1];if(!_||!v.defs[_])throw Error(`Reference not found: ${$}`);return v.defs[_]}throw Error(`Reference not found: ${$}`)}function GY($,v){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return Z.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let _=$.$ref;if(v.refs.has(_))return v.refs.get(_);if(v.processing.has(_))return Z.lazy(()=>{if(!v.refs.has(_))throw Error(`Circular reference not resolved: ${_}`);return v.refs.get(_)});v.processing.add(_);let I=oW(_,v),G=K$(I,v);return v.refs.set(_,G),v.processing.delete(_),G}if($.enum!==void 0){let _=$.enum;if(v.version==="openapi-3.0"&&$.nullable===!0&&_.length===1&&_[0]===null)return Z.null();if(_.length===0)return Z.never();if(_.length===1)return Z.literal(_[0]);if(_.every((G)=>typeof G==="string"))return Z.enum(_);let I=_.map((G)=>Z.literal(G));if(I.length<2)return I[0];return Z.union([I[0],I[1],...I.slice(2)])}if($.const!==void 0)return Z.literal($.const);let U=$.type;if(Array.isArray(U)){let _=U.map((I)=>{let G={...$,type:I};return GY(G,v)});if(_.length===0)return Z.never();if(_.length===1)return _[0];return Z.union(_)}if(!U)return Z.any();let D;switch(U){case"string":{let _=Z.string();if($.format){let I=$.format;if(I==="email")_=_.check(Z.email());else if(I==="uri"||I==="uri-reference")_=_.check(Z.url());else if(I==="uuid"||I==="guid")_=_.check(Z.uuid());else if(I==="date-time")_=_.check(Z.iso.datetime());else if(I==="date")_=_.check(Z.iso.date());else if(I==="time")_=_.check(Z.iso.time());else if(I==="duration")_=_.check(Z.iso.duration());else if(I==="ipv4")_=_.check(Z.ipv4());else if(I==="ipv6")_=_.check(Z.ipv6());else if(I==="mac")_=_.check(Z.mac());else if(I==="cidr")_=_.check(Z.cidrv4());else if(I==="cidr-v6")_=_.check(Z.cidrv6());else if(I==="base64")_=_.check(Z.base64());else if(I==="base64url")_=_.check(Z.base64url());else if(I==="e164")_=_.check(Z.e164());else if(I==="jwt")_=_.check(Z.jwt());else if(I==="emoji")_=_.check(Z.emoji());else if(I==="nanoid")_=_.check(Z.nanoid());else if(I==="cuid")_=_.check(Z.cuid());else if(I==="cuid2")_=_.check(Z.cuid2());else if(I==="ulid")_=_.check(Z.ulid());else if(I==="xid")_=_.check(Z.xid());else if(I==="ksuid")_=_.check(Z.ksuid())}if(typeof $.minLength==="number")_=_.min($.minLength);if(typeof $.maxLength==="number")_=_.max($.maxLength);if($.pattern)_=_.regex(new RegExp($.pattern));D=_;break}case"number":case"integer":{let _=U==="integer"?Z.number().int():Z.number();if(typeof $.minimum==="number")_=_.min($.minimum);if(typeof $.maximum==="number")_=_.max($.maximum);if(typeof $.exclusiveMinimum==="number")_=_.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")_=_.gt($.minimum);if(typeof $.exclusiveMaximum==="number")_=_.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")_=_.lt($.maximum);if(typeof $.multipleOf==="number")_=_.multipleOf($.multipleOf);D=_;break}case"boolean":{D=Z.boolean();break}case"null":{D=Z.null();break}case"object":{let _={},I=$.properties||{},G=new Set($.required||[]);for(let[X,Q]of Object.entries(I)){let Y=K$(Q,v);_[X]=G.has(X)?Y:Y.optional()}if($.propertyNames){let X=K$($.propertyNames,v),Q=$.additionalProperties&&typeof $.additionalProperties==="object"?K$($.additionalProperties,v):Z.any();if(Object.keys(_).length===0){D=Z.record(X,Q);break}let Y=Z.object(_).passthrough(),P=Z.looseRecord(X,Q);D=Z.intersection(Y,P);break}if($.patternProperties){let X=$.patternProperties,Q=Object.keys(X),Y=[];for(let V of Q){let O=K$(X[V],v),S=Z.string().regex(new RegExp(V));Y.push(Z.looseRecord(S,O))}let P=[];if(Object.keys(_).length>0)P.push(Z.object(_).passthrough());if(P.push(...Y),P.length===0)D=Z.object({}).passthrough();else if(P.length===1)D=P[0];else{let V=Z.intersection(P[0],P[1]);for(let O=2;O<P.length;O++)V=Z.intersection(V,P[O]);D=V}break}let J=Z.object(_);if($.additionalProperties===!1)D=J.strict();else if(typeof $.additionalProperties==="object")D=J.catchall(K$($.additionalProperties,v));else D=J.passthrough();break}case"array":{let{prefixItems:_,items:I}=$;if(_&&Array.isArray(_)){let G=_.map((X)=>K$(X,v)),J=I&&typeof I==="object"&&!Array.isArray(I)?K$(I,v):void 0;if(J)D=Z.tuple(G).rest(J);else D=Z.tuple(G);if(typeof $.minItems==="number")D=D.check(Z.minLength($.minItems));if(typeof $.maxItems==="number")D=D.check(Z.maxLength($.maxItems))}else if(Array.isArray(I)){let G=I.map((X)=>K$(X,v)),J=$.additionalItems&&typeof $.additionalItems==="object"?K$($.additionalItems,v):void 0;if(J)D=Z.tuple(G).rest(J);else D=Z.tuple(G);if(typeof $.minItems==="number")D=D.check(Z.minLength($.minItems));if(typeof $.maxItems==="number")D=D.check(Z.maxLength($.maxItems))}else if(I!==void 0){let G=K$(I,v),J=Z.array(G);if(typeof $.minItems==="number")J=J.min($.minItems);if(typeof $.maxItems==="number")J=J.max($.maxItems);D=J}else D=Z.array(Z.any());break}default:throw Error(`Unsupported type: ${U}`)}if($.description)D=D.describe($.description);if($.default!==void 0)D=D.default($.default);return D}function K$($,v){if(typeof $==="boolean")return $?Z.any():Z.never();let U=GY($,v),D=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let J=$.anyOf.map((Q)=>K$(Q,v)),X=Z.union(J);U=D?Z.intersection(U,X):X}if($.oneOf&&Array.isArray($.oneOf)){let J=$.oneOf.map((Q)=>K$(Q,v)),X=Z.xor(J);U=D?Z.intersection(U,X):X}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=D?U:Z.any();else{let J=D?U:K$($.allOf[0],v),X=D?0:1;for(let Q=X;Q<$.allOf.length;Q++)J=Z.intersection(J,K$($.allOf[Q],v));U=J}if($.nullable===!0&&v.version==="openapi-3.0")U=Z.nullable(U);if($.readOnly===!0)U=Z.readonly(U);let _={},I=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let J of I)if(J in $)_[J]=$[J];let G=["contentEncoding","contentMediaType","contentSchema"];for(let J of G)if(J in $)_[J]=$[J];for(let J of Object.keys($))if(!nW.has(J))_[J]=$[J];if(Object.keys(_).length>0)v.registry.add(U,_);return U}function JY($,v){if(typeof $==="boolean")return $?Z.any():Z.never();let U=dW($,v?.defaultTarget),D=$.$defs||$.definitions||{},_={version:U,defs:D,refs:new Map,processing:new Set,rootSchema:$,registry:v?.registry??P$};return K$($,_)}var Z,nW;var wY=L(()=>{z6();H_();R6();u6();Z={...C6,...k_,iso:g4},nW=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var T9={};i$(T9,{string:()=>tW,number:()=>pW,date:()=>sW,boolean:()=>aW,bigint:()=>eW});function tW($){return p0(B4,$)}function pW($){return DG(M4,$)}function aW($){return YG(T4,$)}function eW($){return KG(z4,$)}function sW($){return gG(m6,$)}var XY=L(()=>{j$();u6()});var w={};i$(w,{xor:()=>R8,xid:()=>D8,void:()=>T8,uuidv7:()=>pQ,uuidv6:()=>tQ,uuidv4:()=>oQ,uuid:()=>dQ,util:()=>b,url:()=>aQ,uppercase:()=>P4,unknown:()=>lv,union:()=>d_,undefined:()=>Z8,ulid:()=>U8,uint64:()=>S8,uint32:()=>F8,tuple:()=>$9,trim:()=>N4,treeifyError:()=>fD,transform:()=>t_,toUpperCase:()=>k4,toLowerCase:()=>q4,toJSONSchema:()=>q_,templateLiteral:()=>o8,symbol:()=>B8,superRefine:()=>Z9,success:()=>i8,stringbool:()=>_Y,stringFormat:()=>O8,string:()=>B_,strictObject:()=>E8,startsWith:()=>V4,slugify:()=>H4,size:()=>hv,setErrorMap:()=>lW,set:()=>c8,safeParseAsync:()=>ZJ,safeParse:()=>BJ,safeEncodeAsync:()=>xJ,safeEncode:()=>jJ,safeDecodeAsync:()=>RJ,safeDecode:()=>EJ,registry:()=>l1,regexes:()=>f$,regex:()=>Q4,refine:()=>B9,record:()=>v9,readonly:()=>k9,property:()=>O_,promise:()=>t8,prettifyError:()=>cD,preprocess:()=>DY,prefault:()=>K9,positive:()=>Y_,pipe:()=>h6,partialRecord:()=>u8,parseAsync:()=>SJ,parse:()=>gJ,overwrite:()=>m$,optional:()=>f6,object:()=>j8,number:()=>yJ,nullish:()=>l8,nullable:()=>c6,null:()=>mJ,normalize:()=>L4,nonpositive:()=>K_,nonoptional:()=>V9,nonnegative:()=>V_,never:()=>n_,negative:()=>P_,nativeEnum:()=>h8,nanoid:()=>$8,nan:()=>n8,multipleOf:()=>gv,minSize:()=>a$,minLength:()=>Iv,mime:()=>W4,meta:()=>$Y,maxSize:()=>Sv,maxLength:()=>rv,map:()=>f8,mac:()=>J8,lte:()=>A$,lt:()=>t$,lowercase:()=>Y4,looseRecord:()=>y8,looseObject:()=>x8,locales:()=>T6,literal:()=>r8,length:()=>mv,lazy:()=>b9,ksuid:()=>I8,keyof:()=>A8,jwt:()=>V8,json:()=>UY,iso:()=>g4,ipv6:()=>w8,ipv4:()=>G8,intersection:()=>eJ,int64:()=>g8,int32:()=>H8,int:()=>Z_,instanceof:()=>vY,includes:()=>K4,httpUrl:()=>eQ,hostname:()=>W8,hex:()=>L8,hash:()=>N8,guid:()=>nQ,gte:()=>N$,gt:()=>p$,globalRegistry:()=>P$,getErrorMap:()=>iW,function:()=>p8,fromJSONSchema:()=>JY,formatError:()=>N6,float64:()=>k8,float32:()=>q8,flattenError:()=>L6,file:()=>m8,exactOptional:()=>w9,enum:()=>o_,endsWith:()=>O4,encodeAsync:()=>zJ,encode:()=>MJ,emoji:()=>sQ,email:()=>iQ,e164:()=>K8,discriminatedUnion:()=>C8,describe:()=>s8,decodeAsync:()=>AJ,decode:()=>TJ,date:()=>z8,custom:()=>e8,cuid2:()=>_8,cuid:()=>v8,core:()=>Gv,config:()=>v$,coerce:()=>T9,codec:()=>d8,clone:()=>L$,cidrv6:()=>Q8,cidrv4:()=>X8,check:()=>a8,catch:()=>L9,boolean:()=>fJ,bigint:()=>b8,base64url:()=>P8,base64:()=>Y8,array:()=>l6,any:()=>M8,_function:()=>p8,_default:()=>Y9,_ZodString:()=>M_,ZodXor:()=>tJ,ZodXID:()=>R_,ZodVoid:()=>dJ,ZodUnknown:()=>iJ,ZodUnion:()=>n6,ZodUndefined:()=>hJ,ZodUUID:()=>e$,ZodURL:()=>r6,ZodULID:()=>x_,ZodType:()=>x,ZodTuple:()=>sJ,ZodTransform:()=>G9,ZodTemplateLiteral:()=>H9,ZodSymbol:()=>cJ,ZodSuccess:()=>O9,ZodStringFormat:()=>i,ZodString:()=>B4,ZodSet:()=>U9,ZodRecord:()=>d6,ZodRealError:()=>g$,ZodReadonly:()=>q9,ZodPromise:()=>g9,ZodPrefault:()=>P9,ZodPipe:()=>e_,ZodOptional:()=>p_,ZodObject:()=>i6,ZodNumberFormat:()=>iv,ZodNumber:()=>M4,ZodNullable:()=>X9,ZodNull:()=>rJ,ZodNonOptional:()=>a_,ZodNever:()=>nJ,ZodNanoID:()=>A_,ZodNaN:()=>N9,ZodMap:()=>_9,ZodMAC:()=>uJ,ZodLiteral:()=>D9,ZodLazy:()=>F9,ZodKSUID:()=>C_,ZodJWT:()=>l_,ZodIssueCode:()=>mW,ZodIntersection:()=>aJ,ZodISOTime:()=>g_,ZodISODuration:()=>S_,ZodISODateTime:()=>F_,ZodISODate:()=>b_,ZodIPv6:()=>y_,ZodIPv4:()=>u_,ZodGUID:()=>y6,ZodFunction:()=>S9,ZodFirstPartyTypeKind:()=>M9,ZodFile:()=>I9,ZodExactOptional:()=>J9,ZodError:()=>hW,ZodEnum:()=>S4,ZodEmoji:()=>z_,ZodEmail:()=>T_,ZodE164:()=>m_,ZodDiscriminatedUnion:()=>pJ,ZodDefault:()=>Q9,ZodDate:()=>m6,ZodCustomStringFormat:()=>Z4,ZodCustom:()=>o6,ZodCodec:()=>s_,ZodCatch:()=>W9,ZodCUID2:()=>E_,ZodCUID:()=>j_,ZodCIDRv6:()=>c_,ZodCIDRv4:()=>f_,ZodBoolean:()=>T4,ZodBigIntFormat:()=>i_,ZodBigInt:()=>z4,ZodBase64URL:()=>r_,ZodBase64:()=>h_,ZodArray:()=>oJ,ZodAny:()=>lJ,TimePrecision:()=>e0,NEVER:()=>MD,$output:()=>n0,$input:()=>d0,$brand:()=>TD});var z9=L(()=>{j$();j$();D0();j$();x6();wY();i0();R6();R6();XY();u6();H_();bJ();CJ();IY();v$(S6())});var k$=L(()=>{z9();z9()});var T=($)=>{let v={operationId:$.operationId,backend:$.backend,pagination:$.pagination,async:$.async,examples:$.examples??[]};return{...$,contract:IX.$meta(v).route({method:$.route.method,path:$.route.path,tags:$.route.tags,operationId:$.operationId,description:$.description,successStatus:$.route.successStatus,successDescription:$.route.successDescription,deprecated:$.route.deprecated,inputStructure:$.route.inputStructure}).input($.input).output($.output)}};var S$=L(()=>{W1()});var $L;var QY=L(()=>{$L=`
|
|
56
|
+
# Fly.io Data Source Setup
|
|
57
|
+
|
|
58
|
+
Walk the user through creating a Fly.io read-only API token scoped to their organization. The resulting token and org slug are entered into the Sazabi dashboard to enable native Fly.io log shipping.
|
|
59
|
+
|
|
60
|
+
**Principle:** Do the work. Only pause when the user must act (browser auth, org selection). If a step fails, diagnose and retry before asking the user to intervene.
|
|
61
|
+
|
|
62
|
+
**UX:** Use \`AskUserQuestion\` for all user-facing questions.
|
|
63
|
+
|
|
64
|
+
## Phase 0: Pre-flight — flyctl CLI
|
|
65
|
+
|
|
66
|
+
### Check flyctl installation
|
|
67
|
+
|
|
68
|
+
\`\`\`bash
|
|
69
|
+
which flyctl && flyctl version 2>/dev/null || echo "FLYCTL_NOT_FOUND"
|
|
70
|
+
\`\`\`
|
|
71
|
+
|
|
72
|
+
**If FLYCTL_NOT_FOUND:**
|
|
73
|
+
|
|
74
|
+
AskUserQuestion: The \`flyctl\` CLI is required but not installed. Would you like installation instructions?
|
|
75
|
+
|
|
76
|
+
- **Yes** — Show: "Install the Fly.io CLI from https://fly.io/docs/flyctl/install/ then restart your terminal and re-run this skill."
|
|
77
|
+
- **I'll install it now** — Wait for user to confirm, then re-check \`which flyctl\`.
|
|
78
|
+
|
|
79
|
+
Do not proceed until \`flyctl\` is available.
|
|
80
|
+
|
|
81
|
+
### Check authentication
|
|
82
|
+
|
|
83
|
+
\`\`\`bash
|
|
84
|
+
flyctl auth whoami 2>/dev/null
|
|
85
|
+
\`\`\`
|
|
86
|
+
|
|
87
|
+
**If not authenticated:** Tell the user a browser window will open for Fly.io authentication, then run:
|
|
88
|
+
|
|
89
|
+
\`\`\`bash
|
|
90
|
+
flyctl auth login
|
|
91
|
+
\`\`\`
|
|
92
|
+
|
|
93
|
+
This is interactive — the user must complete the browser flow. After it returns, verify:
|
|
94
|
+
|
|
95
|
+
\`\`\`bash
|
|
96
|
+
flyctl auth whoami 2>/dev/null
|
|
97
|
+
\`\`\`
|
|
98
|
+
|
|
99
|
+
## Phase 1: Select Organization
|
|
100
|
+
|
|
101
|
+
### List available organizations
|
|
102
|
+
|
|
103
|
+
\`\`\`bash
|
|
104
|
+
flyctl orgs list
|
|
105
|
+
\`\`\`
|
|
106
|
+
|
|
107
|
+
AskUserQuestion: Which Fly.io organization should Sazabi collect logs from?
|
|
108
|
+
|
|
109
|
+
Present the list of orgs. If only one org exists, confirm it with the user.
|
|
110
|
+
|
|
111
|
+
Capture the selected org slug as \`ORG_SLUG\`.
|
|
112
|
+
|
|
113
|
+
## Phase 2: Create Read-Only Token
|
|
114
|
+
|
|
115
|
+
### Check for existing Sazabi tokens
|
|
116
|
+
|
|
117
|
+
\`\`\`bash
|
|
118
|
+
flyctl tokens list -o \${ORG_SLUG} 2>/dev/null
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
**If a token named "Sazabi" already exists:** AskUserQuestion: A Sazabi token already exists for this org. What would you like to do?
|
|
122
|
+
|
|
123
|
+
- **Create a new one** — proceed
|
|
124
|
+
- **Revoke and recreate** — \`flyctl tokens revoke <TOKEN_ID>\` then create fresh
|
|
125
|
+
|
|
126
|
+
### Create the token
|
|
127
|
+
|
|
128
|
+
\`\`\`bash
|
|
129
|
+
flyctl tokens create readonly \${ORG_SLUG} -n "Sazabi" --json
|
|
130
|
+
\`\`\`
|
|
131
|
+
|
|
132
|
+
Extract the \`token\` field from the JSON output. This is the API token the user will enter in Sazabi.
|
|
133
|
+
|
|
134
|
+
## Phase 3: Deliver the Token
|
|
135
|
+
|
|
136
|
+
Tell the user the token and org slug:
|
|
137
|
+
|
|
138
|
+
> Your Fly.io API token has been created.
|
|
139
|
+
>
|
|
140
|
+
> **Organization slug:** \`$ORG_SLUG\`
|
|
141
|
+
>
|
|
142
|
+
> **Next steps:**
|
|
143
|
+
>
|
|
144
|
+
> **Option A — Dashboard:** Go to Settings > Data Sources > Fly.io in the Sazabi dashboard. Enter the API token and organization slug (\`$ORG_SLUG\`), then click Connect.
|
|
145
|
+
>
|
|
146
|
+
> **Option B — CLI:** Use \`sazabi data-sources create-connection --type fly_io --metadata '{"apiToken":"<token>","organizationSlug":"$ORG_SLUG"}'\` to create the connection via the CLI.
|
|
147
|
+
|
|
148
|
+
AskUserQuestion: Would you like to copy the token to your clipboard?
|
|
149
|
+
|
|
150
|
+
- **Yes** — copy:
|
|
151
|
+
- macOS: \`echo -n "\${TOKEN}" | pbcopy\`
|
|
152
|
+
- Linux (X11): \`echo -n "\${TOKEN}" | xclip -selection clipboard\`
|
|
153
|
+
- Linux (Wayland): \`echo -n "\${TOKEN}" | wl-copy\`
|
|
154
|
+
- **No** — done
|
|
155
|
+
|
|
156
|
+
## Troubleshooting
|
|
157
|
+
|
|
158
|
+
### "failed retrieving org" error during token creation
|
|
159
|
+
|
|
160
|
+
The org slug may be incorrect. Re-run \`flyctl orgs list\` to verify available organizations.
|
|
161
|
+
|
|
162
|
+
### Token works but Sazabi shows "Invalid API token"
|
|
163
|
+
|
|
164
|
+
Read-only tokens are scoped to a single org. Verify the org slug entered in Sazabi matches the one used during token creation.
|
|
165
|
+
|
|
166
|
+
### "not authenticated" error
|
|
167
|
+
|
|
168
|
+
Run \`flyctl auth login\` to re-authenticate. Fly.io tokens expire — if the CLI token is stale, the browser flow will refresh it.
|
|
169
|
+
`.trim()});var vL;var YY=L(()=>{vL=`
|
|
170
|
+
# GCP Data Source Setup
|
|
171
|
+
|
|
172
|
+
Walk the user through creating a GCP service account with the correct permissions for Sazabi's native GCL (Google Cloud Logging) integration. The resulting JSON key can be pasted into the Sazabi dashboard or used via the API.
|
|
173
|
+
|
|
174
|
+
**Principle:** Do the work. Only pause when the user must act (browser auth, project selection). If a step fails, diagnose and retry before asking the user to intervene.
|
|
175
|
+
|
|
176
|
+
**UX:** Use \`AskUserQuestion\` for all user-facing questions.
|
|
177
|
+
|
|
178
|
+
## Phase 0: Pre-flight — gcloud CLI
|
|
179
|
+
|
|
180
|
+
### Check gcloud installation
|
|
181
|
+
|
|
182
|
+
\`\`\`bash
|
|
183
|
+
which gcloud && gcloud version --format=json 2>/dev/null || echo "GCLOUD_NOT_FOUND"
|
|
184
|
+
\`\`\`
|
|
185
|
+
|
|
186
|
+
**If GCLOUD_NOT_FOUND:**
|
|
187
|
+
|
|
188
|
+
AskUserQuestion: The \`gcloud\` CLI is required but not installed. Would you like installation instructions?
|
|
189
|
+
|
|
190
|
+
- **Yes** — Show: "Install the Google Cloud SDK from https://cloud.google.com/sdk/docs/install then restart your terminal and re-run this skill."
|
|
191
|
+
- **I'll install it now** — Wait for user to confirm, then re-check \`which gcloud\`.
|
|
192
|
+
|
|
193
|
+
Do not proceed until \`gcloud\` is available.
|
|
194
|
+
|
|
195
|
+
### Check authentication
|
|
196
|
+
|
|
197
|
+
\`\`\`bash
|
|
198
|
+
gcloud auth list --filter="status:ACTIVE" --format="value(account)" 2>/dev/null
|
|
199
|
+
\`\`\`
|
|
200
|
+
|
|
201
|
+
**If no active account:** Tell the user a browser window will open for Google authentication, then run:
|
|
202
|
+
|
|
203
|
+
\`\`\`bash
|
|
204
|
+
gcloud auth login
|
|
205
|
+
\`\`\`
|
|
206
|
+
|
|
207
|
+
This is interactive — the user must complete the browser flow. After it returns, verify:
|
|
208
|
+
|
|
209
|
+
\`\`\`bash
|
|
210
|
+
gcloud auth list --filter="status:ACTIVE" --format="value(account)"
|
|
211
|
+
\`\`\`
|
|
212
|
+
|
|
213
|
+
### Select target project
|
|
214
|
+
|
|
215
|
+
\`\`\`bash
|
|
216
|
+
CURRENT_PROJECT=$(gcloud config get-value project 2>/dev/null)
|
|
217
|
+
echo "Current project: \${CURRENT_PROJECT:-<none>}"
|
|
218
|
+
\`\`\`
|
|
219
|
+
|
|
220
|
+
AskUserQuestion: Which GCP project should Sazabi collect logs from?
|
|
221
|
+
|
|
222
|
+
- **Use current project (\`$CURRENT_PROJECT\`)** — if one is set
|
|
223
|
+
- **Choose a different project** — list available projects with \`gcloud projects list --format="table(projectId,name)"\` and let user pick
|
|
224
|
+
- **Enter project ID manually** — user types the project ID
|
|
225
|
+
|
|
226
|
+
Once selected:
|
|
227
|
+
|
|
228
|
+
\`\`\`bash
|
|
229
|
+
gcloud config set project <PROJECT_ID>
|
|
230
|
+
\`\`\`
|
|
231
|
+
|
|
232
|
+
Capture \`PROJECT_ID\` for all subsequent commands.
|
|
233
|
+
|
|
234
|
+
## Phase 1: Enable Required APIs
|
|
235
|
+
|
|
236
|
+
These APIs are needed for Sazabi to provision log sinks, Pub/Sub topics, and manage IAM:
|
|
237
|
+
|
|
238
|
+
\`\`\`bash
|
|
239
|
+
gcloud services enable \\
|
|
240
|
+
logging.googleapis.com \\
|
|
241
|
+
pubsub.googleapis.com \\
|
|
242
|
+
cloudresourcemanager.googleapis.com \\
|
|
243
|
+
iam.googleapis.com
|
|
244
|
+
\`\`\`
|
|
245
|
+
|
|
246
|
+
This is idempotent — already-enabled APIs are skipped.
|
|
247
|
+
|
|
248
|
+
Verify:
|
|
249
|
+
|
|
250
|
+
\`\`\`bash
|
|
251
|
+
gcloud services list --enabled --filter="config.name:(logging.googleapis.com OR pubsub.googleapis.com OR cloudresourcemanager.googleapis.com OR iam.googleapis.com)" --format="table(config.name,state)"
|
|
252
|
+
\`\`\`
|
|
253
|
+
|
|
254
|
+
All four must show \`ENABLED\`. If any are missing, check permissions — the authenticated user needs \`roles/serviceusage.serviceUsageAdmin\` or \`roles/owner\` on the project.
|
|
255
|
+
|
|
256
|
+
## Phase 2: Create Service Account
|
|
257
|
+
|
|
258
|
+
### Prompt for name
|
|
259
|
+
|
|
260
|
+
AskUserQuestion: What should the service account be named?
|
|
261
|
+
|
|
262
|
+
- **Use default (\`sazabi-log-export\`)** — recommended
|
|
263
|
+
- **Custom name** — user provides a name (6-30 chars, must start with a lowercase letter, may contain lowercase letters, digits, and hyphens, must not end with a hyphen)
|
|
264
|
+
|
|
265
|
+
Capture as \`SA_NAME\`.
|
|
266
|
+
|
|
267
|
+
### Check if SA already exists
|
|
268
|
+
|
|
269
|
+
\`\`\`bash
|
|
270
|
+
gcloud iam service-accounts describe \${SA_NAME}@\${PROJECT_ID}.iam.gserviceaccount.com --format="value(email)" 2>/dev/null
|
|
271
|
+
\`\`\`
|
|
272
|
+
|
|
273
|
+
**If exists:** AskUserQuestion: A service account named \`$SA_NAME\` already exists. What would you like to do?
|
|
274
|
+
|
|
275
|
+
- **Use existing** — skip creation, proceed to role assignment
|
|
276
|
+
- **Delete and recreate** — \`gcloud iam service-accounts delete \${SA_NAME}@\${PROJECT_ID}.iam.gserviceaccount.com --quiet\` then create fresh
|
|
277
|
+
|
|
278
|
+
### Create the service account
|
|
279
|
+
|
|
280
|
+
\`\`\`bash
|
|
281
|
+
gcloud iam service-accounts create \${SA_NAME} \\
|
|
282
|
+
--display-name="Sazabi Log Export" \\
|
|
283
|
+
--description="Service account for Sazabi GCL native log pipeline provisioning"
|
|
284
|
+
\`\`\`
|
|
285
|
+
|
|
286
|
+
### Assign IAM roles
|
|
287
|
+
|
|
288
|
+
The service account needs these roles on the project:
|
|
289
|
+
|
|
290
|
+
| Role | Purpose |
|
|
291
|
+
|------|---------|
|
|
292
|
+
| \`roles/logging.configWriter\` | Create and manage log sinks |
|
|
293
|
+
| \`roles/pubsub.admin\` | Create and manage Pub/Sub topics and subscriptions |
|
|
294
|
+
| \`roles/resourcemanager.projectViewer\` | List accessible GCP projects |
|
|
295
|
+
|
|
296
|
+
\`\`\`bash
|
|
297
|
+
SA_EMAIL="\${SA_NAME}@\${PROJECT_ID}.iam.gserviceaccount.com"
|
|
298
|
+
|
|
299
|
+
gcloud projects add-iam-policy-binding \${PROJECT_ID} \\
|
|
300
|
+
--member="serviceAccount:\${SA_EMAIL}" \\
|
|
301
|
+
--role="roles/logging.configWriter" \\
|
|
302
|
+
--quiet
|
|
303
|
+
|
|
304
|
+
gcloud projects add-iam-policy-binding \${PROJECT_ID} \\
|
|
305
|
+
--member="serviceAccount:\${SA_EMAIL}" \\
|
|
306
|
+
--role="roles/pubsub.admin" \\
|
|
307
|
+
--quiet
|
|
308
|
+
|
|
309
|
+
gcloud projects add-iam-policy-binding \${PROJECT_ID} \\
|
|
310
|
+
--member="serviceAccount:\${SA_EMAIL}" \\
|
|
311
|
+
--role="roles/resourcemanager.projectViewer" \\
|
|
312
|
+
--quiet
|
|
313
|
+
\`\`\`
|
|
314
|
+
|
|
315
|
+
Each binding is idempotent — duplicates are ignored.
|
|
316
|
+
|
|
317
|
+
### Generate JSON key
|
|
318
|
+
|
|
319
|
+
Each call to \`gcloud iam service-accounts keys create\` creates a new key. GCP enforces a limit of **10 user-managed keys per service account**. Before creating a new key, check for existing ones:
|
|
320
|
+
|
|
321
|
+
\`\`\`bash
|
|
322
|
+
gcloud iam service-accounts keys list \\
|
|
323
|
+
--iam-account="\${SA_EMAIL}" \\
|
|
324
|
+
--managed-by=user \\
|
|
325
|
+
--format="table(name.basename(),validAfterTime,validBeforeTime)"
|
|
326
|
+
\`\`\`
|
|
327
|
+
|
|
328
|
+
**If user-managed keys already exist:** AskUserQuestion: This service account already has existing keys. What would you like to do?
|
|
329
|
+
|
|
330
|
+
- **Create a new key** — proceed (warn if at 9+ keys)
|
|
331
|
+
- **Delete old keys first** — \`gcloud iam service-accounts keys delete <KEY_ID> --iam-account="\${SA_EMAIL}" --quiet\` for each stale key, then create
|
|
332
|
+
|
|
333
|
+
Create the key to a well-known path in the user's home directory:
|
|
334
|
+
|
|
335
|
+
\`\`\`bash
|
|
336
|
+
KEY_DIR="\${HOME}/.config/sazabi"
|
|
337
|
+
mkdir -p "\${KEY_DIR}" && chmod 700 "\${KEY_DIR}"
|
|
338
|
+
KEY_FILE="\${KEY_DIR}/gcl-sa-key-\${PROJECT_ID}.json"
|
|
339
|
+
gcloud iam service-accounts keys create "\${KEY_FILE}" \\
|
|
340
|
+
--iam-account="\${SA_EMAIL}"
|
|
341
|
+
chmod 600 "\${KEY_FILE}"
|
|
342
|
+
\`\`\`
|
|
343
|
+
|
|
344
|
+
## Phase 3: Deliver the Key
|
|
345
|
+
|
|
346
|
+
Tell the user where the key file is and how to use it:
|
|
347
|
+
|
|
348
|
+
> Your service account key has been saved to:
|
|
349
|
+
>
|
|
350
|
+
> \`$KEY_FILE\`
|
|
351
|
+
>
|
|
352
|
+
> **Next steps:**
|
|
353
|
+
>
|
|
354
|
+
> **Option A — Dashboard:** Go to Settings > Data Sources > Google Cloud Logging > "Service account" tab. Paste the contents of this file and click Connect.
|
|
355
|
+
>
|
|
356
|
+
> **Option B — CLI:** Use \`sazabi data-sources create-connection --type gcp --metadata "{\\"serviceAccountKey\\": $(cat $KEY_FILE | jq -c '.')}"\` to create the connection via the CLI.
|
|
357
|
+
>
|
|
358
|
+
> **Option C — Clipboard:** Copy the key to your clipboard, then paste it into the dashboard.
|
|
359
|
+
|
|
360
|
+
AskUserQuestion: Would you like to copy the key to your clipboard?
|
|
361
|
+
|
|
362
|
+
- **Yes** — copy without mutation:
|
|
363
|
+
- macOS: \`cat "\${KEY_FILE}" | pbcopy\`
|
|
364
|
+
- Linux (X11): \`cat "\${KEY_FILE}" | xclip -selection clipboard\`
|
|
365
|
+
- Linux (Wayland): \`cat "\${KEY_FILE}" | wl-copy\`
|
|
366
|
+
- **No** — done
|
|
367
|
+
|
|
368
|
+
The key file remains at \`$KEY_FILE\` for the user to manage. Do not delete it.
|
|
369
|
+
|
|
370
|
+
## Troubleshooting
|
|
371
|
+
|
|
372
|
+
### "Permission denied" on API enablement
|
|
373
|
+
|
|
374
|
+
The authenticated user needs \`roles/serviceusage.serviceUsageAdmin\` or \`roles/owner\`. Check:
|
|
375
|
+
|
|
376
|
+
\`\`\`bash
|
|
377
|
+
gcloud projects get-iam-policy \${PROJECT_ID} --flatten="bindings[].members" --filter="bindings.members:user:$(gcloud config get-value account)" --format="table(bindings.role)"
|
|
378
|
+
\`\`\`
|
|
379
|
+
|
|
380
|
+
### "Permission denied" on IAM binding
|
|
381
|
+
|
|
382
|
+
The authenticated user needs \`roles/resourcemanager.projectIamAdmin\` or \`roles/owner\` to grant roles.
|
|
383
|
+
|
|
384
|
+
### Service account key creation fails
|
|
385
|
+
|
|
386
|
+
Check if the org has a constraint blocking key creation:
|
|
387
|
+
|
|
388
|
+
\`\`\`bash
|
|
389
|
+
gcloud resource-manager org-policies describe iam.disableServiceAccountKeyCreation --project=\${PROJECT_ID} 2>/dev/null
|
|
390
|
+
\`\`\`
|
|
391
|
+
|
|
392
|
+
If enforced, the user must use Workload Identity Federation instead (manual setup flow in the dashboard).
|
|
393
|
+
|
|
394
|
+
### Key works but Sazabi shows "cannot access any active GCP projects"
|
|
395
|
+
|
|
396
|
+
The \`roles/resourcemanager.projectViewer\` role may not have propagated yet. IAM changes can take up to 60 seconds. Wait and retry.
|
|
397
|
+
`.trim()});var A9,_L,UL,PY,j9,E9,KY,VY,$U,OY,WY,A4,LY,NY,vU,qY,kY,j4,HY,FY,_U,bY,gY,UU,SY,BY,DU,DL;var x9=L(()=>{k$();S$();QY();YY();A9=w.enum(["vercel","cloudflare","railway","render","fly_io","heroku","netlify","supabase","planetscale","digital_ocean","inngest","trigger_dev","temporal","mastra","langchain","daytona","e2b","cloudwatch","convex","datadog","sentry","openrouter","posthog","gcl","gcp","otel"]),_L=w.enum(["pending","provisioning","active","error"]),UL=w.object({name:w.string().describe("Field name used as the JSON key in metadata."),type:w.string().describe('Zod type name, e.g. "string", "boolean", "enum".'),required:w.boolean().describe("Whether the field is required."),sensitive:w.boolean().describe("Whether the field contains a secret and will be encrypted."),description:w.string().nullable().describe("Human-readable description of the field.")}),PY=w.object({id:w.string().describe("Data source type identifier."),name:w.string().describe("Human-readable display name."),metadataFields:w.array(UL).describe("Fields required in the metadata object when creating a connection."),setupSkill:w.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),j9=w.object({id:w.string().uuid(),projectId:w.string().uuid(),dataSourceType:A9,displayName:w.string().nullable(),createdAt:w.string().datetime()}),E9=w.object({id:w.string().uuid(),connectionId:w.string().uuid(),displayName:w.string(),config:w.record(w.string(),w.unknown()),status:_L,errorMessage:w.string().nullable(),createdAt:w.string().datetime()}),KY=w.object({}),VY=w.object({types:w.array(PY)}),$U=T({operationId:"dataSources.listTypes",description:"List all supported data source types with their metadata requirements.",backend:"api",route:{method:"GET",path:"/data-sources/types",tags:["Data Sources"]},input:KY,output:VY,pagination:"none",async:"sync"}),OY=w.object({projectId:w.string().uuid().optional().describe("Project to list connections for. Auto-filled from SDK context when omitted."),dataSourceType:A9.optional().describe("Filter connections by data source type.")}),WY=w.object({connections:w.array(j9)}),A4=T({operationId:"dataSources.listConnections",description:"List data source connections within one project.",backend:"api",route:{method:"GET",path:"/data-sources/connections",tags:["Data Sources"]},input:OY,output:WY,pagination:"none",async:"sync"}),LY=w.object({connectionId:w.string().uuid().describe("Connection ID to fetch.")}),NY=w.object({connection:j9}),vU=T({operationId:"dataSources.getConnection",description:"Get one data source connection by ID.",backend:"api",route:{method:"GET",path:"/data-sources/connections/{connectionId}",tags:["Data Sources"]},input:LY,output:NY,pagination:"none",async:"sync"}),qY=w.object({projectId:w.string().uuid().optional().describe("Project to create the connection in. Auto-filled from SDK context when omitted."),dataSourceType:A9.describe("Data source type identifier."),metadata:w.record(w.string(),w.unknown()).describe("Platform-specific credentials. Fields vary by data source type."),displayName:w.string().optional().describe("Optional human-readable name for this connection.")}),kY=w.object({connectionId:w.string().uuid().describe("ID of the created connection."),publicKey:w.string().describe("Auto-generated public API key for this connection. Store this securely — it is only shown once.")}),j4=T({operationId:"dataSources.createConnection",description:"Create a new data source connection. Validates credentials, encrypts sensitive fields, and auto-generates a public API key.",backend:"api",route:{method:"POST",path:"/data-sources/connections",successStatus:201,tags:["Data Sources"]},input:qY,output:kY,pagination:"none",async:"sync"}),HY=w.object({connectionId:w.string().uuid().describe("Connection ID to list streams for.")}),FY=w.object({streams:w.array(E9)}),_U=T({operationId:"dataSources.listStreams",description:"List streams for a data source connection.",backend:"api",route:{method:"GET",path:"/data-sources/connections/{connectionId}/streams",tags:["Data Sources"]},input:HY,output:FY,pagination:"none",async:"sync"}),bY=w.object({connectionId:w.string().uuid().describe("Connection ID to create the stream under."),displayName:w.string().describe("Resource name, e.g. service or app name."),config:w.record(w.string(),w.unknown()).describe("Platform-specific stream configuration.")}),gY=w.object({streamId:w.string().uuid().describe("ID of the created stream.")}),UU=T({operationId:"dataSources.createStream",description:"Create a new stream for a data source connection. Triggers async provisioning.",backend:"api",route:{method:"POST",path:"/data-sources/connections/{connectionId}/streams",successStatus:201,tags:["Data Sources"]},input:bY,output:gY,pagination:"none",async:"sync"}),SY=w.object({streamId:w.string().uuid().describe("Stream ID to fetch.")}),BY=w.object({stream:E9}),DU=T({operationId:"dataSources.getStream",description:"Get one data source stream by ID. Use to poll provisioning status.",backend:"api",route:{method:"GET",path:"/data-sources/streams/{streamId}",tags:["Data Sources"]},input:SY,output:BY,pagination:"none",async:"sync"}),DL={listTypes:$U.contract,listConnections:A4.contract,getConnection:vU.contract,createConnection:j4.contract,listStreams:_U.contract,createStream:UU.contract,getStream:DU.contract}});var IU,ZY,GU,JU,MY,TY,zY,AY,R9,C9,jY,EY,xY,RY,CY,u9,uY,yY,fY,cY,hY,E4,x4,R4,C4,u4,wU,XU,QU,YU,PU,IL,GL;var y9=L(()=>{k$();S$();IU=/^[a-zA-Z0-9\s\-_]+$/,ZY=w.object({id:w.string().uuid(),name:w.string(),expiresAt:w.string().datetime().nullable(),lastUsedAt:w.string().datetime().nullable(),createdAt:w.string().datetime()}),GU=ZY.extend({projectId:w.string().uuid(),dataSourceConnectionId:w.string().uuid().nullable().describe("Linked data source connection ID when this key is scoped to one data source.")}),JU=ZY.extend({projectId:w.string().uuid().nullable()}),MY=w.object({projectId:w.string().uuid().optional().describe("Project to list keys for. Auto-filled from CLI and SDK context when omitted."),limit:w.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:w.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),TY=w.object({publicKeys:w.array(GU),nextCursor:w.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),zY=w.object({secretKeys:w.array(JU),nextCursor:w.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),AY=w.object({projectId:w.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:w.string().uuid().describe("Key ID to fetch.")}),R9=w.object({publicKey:GU}),C9=w.object({secretKey:JU}),jY=w.object({projectId:w.string().uuid().optional().describe("Project to create the key in. Auto-filled from CLI and SDK context when omitted."),name:w.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(IU,"Name can only contain letters, numbers, spaces, hyphens, and underscores").describe("Human-readable name for the key."),expiresAt:w.string().datetime().optional().describe("Optional expiration timestamp for the key.")}),EY=w.object({publicKey:GU.extend({value:w.string()})}),xY=w.object({secretKey:JU.extend({value:w.string()})}),RY=w.object({projectId:w.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted."),keyId:w.string().uuid().describe("Key ID to update."),name:w.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(IU,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:w.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),CY=w.object({params:w.object({keyId:w.string().uuid().describe("Key ID to delete.")}),query:w.object({projectId:w.string().uuid().optional().describe("Project containing the key. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:$,query:v})=>({...v,...$})),u9=w.object({}),uY=w.object({limit:w.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of keys to return per page."),cursor:w.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),yY=w.object({keyId:w.string().uuid().describe("Key ID to fetch.")}),fY=w.object({projectId:w.string().uuid().optional().describe("Project to scope this key to. When set, the key can only access resources within this project. Omit for organization-wide access."),name:w.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(IU,"Name can only contain letters, numbers, spaces, hyphens, and underscores").describe("Human-readable name for the key."),expiresAt:w.string().datetime().optional().describe("Optional expiration timestamp for the key.")}),cY=w.object({keyId:w.string().uuid().describe("Key ID to update."),name:w.string().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(IU,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional().describe("New human-readable name for the key."),expiresAt:w.string().datetime().nullable().optional().describe("New expiration timestamp for the key, or null to clear it.")}),hY=w.object({params:w.object({keyId:w.string().uuid().describe("Key ID to delete.")})}).transform(({params:$})=>({...$})),E4=T({operationId:"publicKeys.list",description:"List public keys within one project.",backend:"api",route:{method:"GET",path:"/public-keys",tags:["Public Keys"]},input:MY,output:TY,pagination:"cursor",async:"sync",examples:[{name:"list-public-keys",input:{projectId:"11111111-1111-4111-8111-111111111111",limit:25},output:{publicKeys:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),x4=T({operationId:"publicKeys.get",description:"Get one public key within one project.",backend:"api",route:{method:"GET",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:AY,output:R9,pagination:"none",async:"sync",examples:[{name:"get-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),R4=T({operationId:"publicKeys.create",description:"Create one public key within one project.",backend:"api",route:{method:"POST",path:"/public-keys",successStatus:201,tags:["Public Keys"]},input:jY,output:EY,pagination:"none",async:"sync",examples:[{name:"create-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"CLI forwarder",dataSourceConnectionId:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_public_example"}}}]}),C4=T({operationId:"publicKeys.update",description:"Update one public key within one project.",backend:"api",route:{method:"PATCH",path:"/public-keys/{keyId}",tags:["Public Keys"]},input:RY,output:R9,pagination:"none",async:"sync",examples:[{name:"rename-public-key",input:{projectId:"11111111-1111-4111-8111-111111111111",keyId:"22222222-2222-4222-8222-222222222222",name:"Updated CLI forwarder"},output:{publicKey:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",name:"Updated CLI forwarder",dataSourceConnectionId:null,expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),u4=T({operationId:"publicKeys.delete",description:"Delete one public key within one project.",backend:"api",route:{method:"DELETE",path:"/public-keys/{keyId}",successStatus:204,tags:["Public Keys"],inputStructure:"detailed"},input:CY,output:u9,pagination:"none",async:"sync"}),wU=T({operationId:"secretKeys.list",description:"List secret keys within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys",tags:["Secret Keys"]},input:uY,output:zY,pagination:"cursor",async:"sync",examples:[{name:"list-secret-keys",input:{limit:25},output:{secretKeys:[{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),XU=T({operationId:"secretKeys.get",description:"Get one secret key within the organization.",backend:"api",route:{method:"GET",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:yY,output:C9,pagination:"none",async:"sync",examples:[{name:"get-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),QU=T({operationId:"secretKeys.create",description:"Create one secret key within the organization.",backend:"api",route:{method:"POST",path:"/secret-keys",successStatus:201,tags:["Secret Keys"]},input:fY,output:xY,pagination:"none",async:"sync",examples:[{name:"create-secret-key",input:{name:"CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z",value:"sazabi_secret_example"}}}]}),YU=T({operationId:"secretKeys.update",description:"Update one secret key within the organization.",backend:"api",route:{method:"PATCH",path:"/secret-keys/{keyId}",tags:["Secret Keys"]},input:cY,output:C9,pagination:"none",async:"sync",examples:[{name:"rename-secret-key",input:{keyId:"33333333-3333-4333-8333-333333333333",name:"Updated CI agent"},output:{secretKey:{id:"33333333-3333-4333-8333-333333333333",projectId:null,name:"Updated CI agent",expiresAt:null,lastUsedAt:null,createdAt:"2026-01-01T00:00:00.000Z"}}}]}),PU=T({operationId:"secretKeys.delete",description:"Delete one secret key within the organization.",backend:"api",route:{method:"DELETE",path:"/secret-keys/{keyId}",successStatus:204,tags:["Secret Keys"],inputStructure:"detailed"},input:hY,output:u9,pagination:"none",async:"sync"}),IL={list:E4.contract,get:x4.contract,create:R4.contract,update:C4.contract,delete:u4.contract},GL={list:wU.contract,get:XU.contract,create:QU.contract,update:YU.contract,delete:PU.contract}});var rY,mY,lY,iY,nY,dY,oY,JL,tY,pY,y4,wL;var f9=L(()=>{k$();S$();rY=w.enum(["eq","neq","in","contains","starts_with","gt","gte","lt","lte","between","exists"]).describe("Filter operator: 'eq' (equals), 'neq' (not equals), 'in' (in array), 'contains' (substring), 'starts_with' (prefix), 'gt' (greater than), 'gte' (greater than or equal), 'lt' (less than), 'lte' (less than or equal), 'between' (range), 'exists' (field exists)"),mY=w.enum(["any","all","phrase"]).describe("Search mode: 'any' (match any token), 'all' (match all tokens), 'phrase' (exact phrase match)"),lY=w.object({query:w.string().min(1,"Search query must be at least 1 character").max(500,"Search query must be at most 500 characters").describe("Search query text (1-500 characters)"),fields:w.array(w.string()).optional().describe("Fields to search in (defaults to backend allowlist)"),mode:mY.optional().default("all").describe("Token matching mode")}),iY=w.object({field:w.string().describe("Field name to filter on"),op:rY.describe("Filter operator"),value:w.union([w.string(),w.number(),w.boolean(),w.array(w.union([w.string(),w.number()])),w.object({from:w.string(),to:w.string()})]).describe("Filter value (type depends on operator)")}).superRefine(($,v)=>{if($.op==="in"&&!Array.isArray($.value))v.addIssue({code:w.ZodIssueCode.custom,message:"Value must be an array when op is 'in'",path:["value"]});if($.op==="between"){let U=$.value;if(!(typeof U==="object"&&U!==null&&("from"in U)&&("to"in U)))v.addIssue({code:w.ZodIssueCode.custom,message:"Value must be an object with from/to when op is 'between'",path:["value"]})}if($.op==="exists"&&typeof $.value!=="boolean")v.addIssue({code:w.ZodIssueCode.custom,message:"Value must be boolean when op is 'exists'",path:["value"]})}),nY=w.object({field:w.string().describe("Field name to sort by"),direction:w.enum(["asc","desc"]).default("desc").describe("Sort direction: 'asc' for ascending, 'desc' for descending")}),dY=w.object({limit:w.number().int().min(1,"Limit must be at least 1").max(1000,"Limit must be at most 1000").default(50).describe("Maximum number of rows to return"),cursor:w.string().optional().describe("Opaque cursor from previous response for pagination")}),oY=w.object({projectId:w.string().uuid().optional().describe("Project to query logs for. Auto-filled from CLI and SDK context when omitted."),search:lY.optional().describe("Full-text search configuration"),filters:w.array(iY).optional().describe("Structured filter clauses (ANDed together)"),select:w.array(w.string()).optional().describe("Fields to return (defaults to backend default set)"),sort:nY.optional().describe("Sort configuration (defaults to timestamp desc)"),pagination:dY.optional().describe("Pagination configuration")}),JL=w.object({cursor:w.string().nullable().describe("Cursor for next page (null if no more results)"),hasMore:w.boolean().describe("Whether more results are available")}),tY=w.object({count:w.number().int().nonnegative().describe("Number of log rows returned in this response"),took:w.number().nonnegative().describe("Query execution time in milliseconds")}),pY=w.object({data:w.array(w.record(w.string(),w.any())).describe("Array of log rows with selected fields"),nextCursor:w.string().nullable().describe("Pass as 'cursor' in the next query to fetch the next page. Null when there are no more results."),meta:tY.describe("Query execution metadata")}),y4=T({operationId:"logs.query",description:"Query logs within one project via the platform API proxy.",backend:"api",route:{method:"POST",path:"/logs/query",tags:["Logs"]},input:oY,output:pY,pagination:"cursor",async:"sync"}),wL={query:y4.contract}});var nv,aY,eY,sY,$P,vP,_P,UP,KU,XL;var t6=L(()=>{k$();S$();nv=w.enum(["admin","member"]),aY=w.object({id:w.string().min(1),name:w.string(),slug:w.string(),logo:w.string().nullable().optional(),role:nv}),eY=w.object({id:w.string().min(1),name:w.string().nullable(),email:w.string().email()}),sY=w.object({credentialType:w.literal("user"),user:eY,activeOrganizationId:w.string().min(1).nullable(),organizations:w.array(aY).describe("Organizations the user belongs to, including membership role.")}),$P=w.object({credentialType:w.literal("secret"),organization:w.object({id:w.string().min(1),name:w.string(),slug:w.string(),logo:w.string().nullable().optional()}),keyName:w.string()}),vP=w.object({credentialType:w.literal("partner"),superorganization:w.object({id:w.string().uuid(),name:w.string()})}),_P=w.object({}),UP=w.discriminatedUnion("credentialType",[sY,$P,vP]),KU=T({operationId:"me.get",description:"Return the identity and available context for the current credential.",backend:"api",route:{method:"GET",path:"/me",tags:["Auth"]},input:_P,output:UP,pagination:"none",async:"sync"}),XL=KU.contract});var c9,DP,IP,GP,JP,wP,XP,VU,OU,WU,QL;var h9=L(()=>{k$();S$();t6();c9=w.object({membershipId:w.string().min(1).describe("Organization membership record ID."),userId:w.string().min(1).describe("User ID for the organization member."),name:w.string().nullable().describe("Display name for the member, when available."),email:w.string().email().describe("Email address for the member."),imageUrl:w.string().nullable().describe("Profile image URL for the member, when available."),role:nv.describe("Organization role."),createdAt:w.string().datetime().describe("When the membership was created.")}),DP=w.object({organizationId:w.string().min(1).optional().describe("Organization to list members for. Auto-filled from CLI and SDK context when omitted.")}),IP=w.object({members:w.array(c9).describe("Members visible within the selected organization.")}),GP=w.object({organizationId:w.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted."),userId:w.string().min(1).describe("User ID of the member to update."),role:nv.describe("Role to assign.")}),JP=w.object({member:c9.describe("Updated organization member.")}),wP=w.object({params:w.object({userId:w.string().min(1).describe("User ID of the member to remove.")}),query:w.object({organizationId:w.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted.")})}).transform(({params:$,query:v})=>({...v,...$})),XP=w.object({removedUserId:w.string().min(1).describe("User ID removed from the organization.")}),VU=T({operationId:"members.list",description:"List members in an organization.",backend:"api",route:{method:"GET",path:"/members",tags:["Members"]},input:DP,output:IP,pagination:"none",async:"sync",examples:[{name:"organization-members",input:{organizationId:"organization-123"},output:{members:[{membershipId:"membership-123",userId:"user-123",name:"Alex Admin",email:"alex@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}]}}]}),OU=T({operationId:"members.updateRole",description:"Update a member's organization role.",backend:"api",route:{method:"PATCH",path:"/members/{userId}/role",tags:["Members"]},input:GP,output:JP,pagination:"none",async:"sync",examples:[{name:"promote-member",input:{organizationId:"organization-123",userId:"user-456",role:"admin"},output:{member:{membershipId:"membership-456",userId:"user-456",name:"Mina Member",email:"mina@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}}}]}),WU=T({operationId:"members.remove",description:"Remove a member from an organization.",backend:"api",route:{method:"DELETE",path:"/members/{userId}",tags:["Members"],inputStructure:"detailed"},input:wP,output:XP,pagination:"none",async:"sync"}),QL={list:VU.contract,updateRole:OU.contract,remove:WU.contract}});var QP,r9,YP,PP,KP,VP,OP,f4,WP,LU,NU,qU,YL;var p6=L(()=>{k$();S$();QP=w.enum(["processing","completed","aborted","error"]),r9=w.object({id:w.string().uuid(),threadId:w.string().uuid(),userMessageId:w.string().uuid().nullable(),assistantMessageId:w.string().uuid().nullable(),parentRunId:w.string().uuid().nullable(),workflowRunId:w.string().nullable(),status:QP,source:w.enum(["web","api","mcp","slack","agent","cli"]),createdAt:w.string().datetime(),updatedAt:w.string().datetime(),completedAt:w.string().datetime().nullable()}),YP=w.object({projectId:w.string().uuid().optional().describe("Project ID to list runs for. Auto-filled from CLI and SDK context when omitted."),limit:w.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:w.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),PP=w.object({runs:w.array(r9),nextCursor:w.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),KP=w.object({threadId:w.string().uuid().describe("Thread ID to list runs for."),limit:w.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:w.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),VP=w.object({runs:w.array(r9),nextCursor:w.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),OP=w.object({runId:w.string().uuid().describe("Run ID returned by a deferred operation.")}),f4=w.object({completed:w.boolean().describe("Whether the run has reached a terminal status."),threadId:w.string().uuid().describe("Thread ID associated with the run."),runId:w.string().uuid().describe("Run ID for subsequent polling."),status:QP.describe("Current run lifecycle status."),response:w.string().nullable().describe("Assistant response text when the run has completed.")}),WP=f4.describe("Current run state and, when complete, the assistant response."),LU=T({operationId:"runs.list",description:"List deferred runs within one project.",backend:"api",route:{method:"GET",path:"/runs",tags:["Runs"]},input:YP,output:PP,pagination:"cursor",async:"sync"}),NU=T({operationId:"runs.listForThread",description:"List deferred runs for one thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/runs",tags:["Runs"]},input:KP,output:VP,pagination:"cursor",async:"sync"}),qU=T({operationId:"runs.get",description:"Get the current result for a deferred run by run ID.",backend:"api",route:{method:"GET",path:"/runs/{runId}",tags:["Runs"]},input:OP,output:WP,pagination:"none",async:"sync",examples:[{name:"processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),YL={list:LU.contract,listForThread:NU.contract,get:qU.contract}});var kU,PL,KL,VL,OL,WL,LL,NL,qL,HU,LP,NP,qP,kP,HP,FP,bP,gP,SP,BP,FU,bU,gU,SU,BU,kL;var ZU=L(()=>{k$();S$();p6();kU=w.object({id:w.string().uuid(),projectId:w.string().uuid(),title:w.string().nullable(),status:w.enum(["regular","archived"]),createdAt:w.string().datetime(),updatedAt:w.string().datetime()}),PL=w.object({type:w.literal("message"),message:w.string()}),KL=w.object({type:w.literal("reasoning"),reasoning:w.string(),status:w.enum(["in_progress","complete"]).optional()}),VL=w.object({type:w.literal("tool_call"),name:w.string(),params:w.any().optional(),result:w.any().optional(),status:w.enum(["in_progress","success","error","unknown"]).optional(),toolCallId:w.string().optional(),durationMs:w.number().nonnegative().optional()}),OL=w.object({type:w.literal("artifact"),name:w.enum(["timeseries","table","log_detail","integration_required","alert_card"]),data:w.any(),toolCallId:w.string().optional()}),WL=w.object({type:w.literal("fork"),sourceThreadId:w.string(),sourceMessageId:w.string(),sourceThreadTitle:w.string().nullable()}),LL=w.object({type:w.literal("summary"),summary:w.string()}),NL=w.object({type:w.literal("slack_context"),channelId:w.string(),isTruncated:w.boolean().optional(),messages:w.array(w.object({timestamp:w.string(),slackUserId:w.string().optional(),displayName:w.string(),text:w.string(),isBot:w.boolean(),files:w.array(w.object({name:w.string(),mimetype:w.string(),size:w.number().optional(),attachmentId:w.string().uuid().optional(),ingestionStatus:w.enum(["attached","unsupported","oversized","skipped","unavailable"]).optional()})).optional()}))}),qL=w.union([PL,KL,VL,OL,WL,LL,NL]),HU=w.object({id:w.string().uuid(),role:w.enum(["user","assistant"]),content:w.array(qL),createdAt:w.string().datetime()}),LP=w.object({projectId:w.string().uuid().optional().describe("Project to list threads for. Auto-filled from CLI and SDK context when omitted."),limit:w.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of threads to return per page."),cursor:w.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:w.enum(["regular","archived"]).optional().describe("Filter by thread status. 'regular' returns active threads, 'archived' returns archived threads.")}),NP=w.object({threads:w.array(kU).describe("The page of threads matching the query."),nextCursor:w.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),qP=w.object({threadId:w.string().uuid().describe("Thread ID returned by threads.list or threads.create.")}),kP=w.object({thread:kU.describe("The requested thread."),messages:w.array(HU).describe("Messages currently stored on the thread in chronological order.")}),HP=w.object({projectId:w.string().uuid().optional().describe("Project to create the thread in. Auto-filled from CLI and SDK context when omitted."),message:w.string().min(1,"Message cannot be empty").max(1e4,"Message cannot exceed 10000 characters").describe("Initial user message that starts the thread."),wait:w.boolean().default(!0).describe("Whether the server should wait for the agent run before responding."),timeoutSeconds:w.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling.")}),FP=f4.describe("Deferred run result for creating a thread."),bP=w.object({threadId:w.string().uuid().describe("Thread ID whose current processing status should be returned.")}),gP=w.object({status:w.enum(["idle","processing"]),lastRunStatus:w.enum(["error"]).nullable()}),SP=w.object({threadId:w.string().uuid().describe("Thread ID of the thread to update."),status:w.enum(["regular","archived"]).describe("New status for the thread. 'archived' hides the thread from the sidebar.")}),BP=w.object({thread:kU.describe("The updated thread.")}),FU=T({operationId:"threads.list",description:"List threads in a project, optionally filtered by status.",backend:"api",route:{method:"GET",path:"/threads",tags:["Threads"]},input:LP,output:NP,pagination:"cursor",async:"sync",examples:[{name:"active-threads",input:{projectId:"11111111-1111-4111-8111-111111111111",status:"regular",limit:10},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"regular",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:05:00.000Z"}],nextCursor:null}}]}),bU=T({operationId:"threads.get",description:"Get a thread and its messages.",backend:"api",route:{method:"GET",path:"/threads/{threadId}",tags:["Threads"]},input:qP,output:kP,pagination:"none",async:"sync"}),gU=T({operationId:"threads.getStatus",description:"Get the current processing status for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/status",tags:["Threads"]},input:bP,output:gP,pagination:"none",async:"sync",examples:[{name:"processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{status:"processing",lastRunStatus:null}}]}),SU=T({operationId:"threads.create",description:"Create a thread with an initial message and optionally wait for the agent response.",backend:"api",route:{method:"POST",path:"/threads",tags:["Threads"],successStatus:201},input:HP,output:FP,pagination:"none",async:"deferred",examples:[{name:"async-handoff",input:{projectId:"11111111-1111-4111-8111-111111111111",message:"Investigate elevated 500s in production.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),BU=T({operationId:"threads.update",description:"Update a thread's status.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}",tags:["Threads"]},input:SP,output:BP,pagination:"none",async:"sync",examples:[{name:"archive-thread",input:{threadId:"22222222-2222-4222-8222-222222222222",status:"archived"},output:{thread:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"archived",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:10:00.000Z"}}}]}),kL={list:FU.contract,get:bU.contract,getStatus:gU.contract,create:SU.contract,update:BU.contract}});var ZP,MP,TP,zP,m9,l9;var i9=L(()=>{k$();S$();p6();ZU();ZP=w.object({threadId:w.string().uuid().describe("Thread ID to list messages for."),limit:w.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of messages to return per page."),cursor:w.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),MP=w.object({messages:w.array(HU),nextCursor:w.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),TP=w.object({threadId:w.string().uuid().describe("Thread ID to append the message to."),message:w.string().min(1,"Message cannot be empty").max(1e4,"Message cannot exceed 10000 characters"),wait:w.boolean().default(!0).describe("Whether the server should wait for the appended message run before responding."),timeoutSeconds:w.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling.")}),zP=f4.describe("Deferred run result for appending a message to an existing thread."),m9=T({operationId:"messages.list",description:"List messages in a thread with cursor pagination.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/messages",tags:["Messages"]},input:ZP,output:MP,pagination:"cursor",async:"sync",examples:[{name:"thread-messages",input:{threadId:"22222222-2222-4222-8222-222222222222",limit:2},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",role:"user",content:[{type:"message",message:"What changed in the intake pipeline?"}],createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),l9=T({operationId:"messages.append",description:"Append a user message to an existing thread and trigger a deferred run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/messages",successStatus:201,tags:["Messages"]},input:TP,output:zP,pagination:"none",async:"deferred",examples:[{name:"append-processing",input:{threadId:"22222222-2222-4222-8222-222222222222",message:"Follow up on the intake backlog.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]})});var MU,AP,jP,EP,xP,RP,CP,uP,TU,zU,AU,HL;var n9=L(()=>{k$();S$();t6();MU=w.object({id:w.string().min(1),name:w.string(),slug:w.string(),logo:w.string().nullable().optional()}),AP=MU.extend({role:nv.optional()}),jP=w.object({}),EP=w.object({organizations:w.array(AP).describe("Organizations available to the current credential.")}),xP=w.object({organizationId:w.string().min(1).describe("Organization ID to fetch.")}),RP=w.object({organization:MU}),CP=w.object({organizationId:w.string().min(1).describe("Organization ID to update. SDK and CLI callers can auto-fill this before dispatch."),name:w.string().trim().min(1).max(100).describe("New organization name.")}),uP=w.object({organization:MU.describe("Updated organization.")}),TU=T({operationId:"organizations.list",description:"List organizations available to the current credential.",backend:"api",route:{method:"GET",path:"/organizations",tags:["Organizations"]},input:jP,output:EP,pagination:"none",async:"sync"}),zU=T({operationId:"organizations.get",description:"Get one organization by ID.",backend:"api",route:{method:"GET",path:"/organizations/{organizationId}",tags:["Organizations"]},input:xP,output:RP,pagination:"none",async:"sync"}),AU=T({operationId:"organizations.update",description:"Update one organization.",backend:"api",route:{method:"PATCH",path:"/organizations/{organizationId}",tags:["Organizations"]},input:CP,output:uP,pagination:"none",async:"sync",examples:[{name:"rename-organization",input:{organizationId:"organization-123",name:"Observed Platform"},output:{organization:{id:"organization-123",name:"Observed Platform",slug:"acme",logo:null}}}]}),HL={list:TU.contract,get:zU.contract,update:AU.contract}});var jU,d9,yP,fP,cP,hP,EU,xU,FL;var o9=L(()=>{k$();S$();jU=w.enum(["us-east-1","us-east-2","us-west-1","us-west-2","eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3"]),d9=w.object({id:w.string().uuid(),organizationId:w.string().min(1),name:w.string(),region:jU}),yP=w.object({organizationId:w.string().min(1).optional().describe("Organization to list projects for. Auto-filled from CLI and SDK context when omitted.")}),fP=w.object({projects:w.array(d9).describe("Projects visible within the selected organization.")}),cP=w.object({projectId:w.string().uuid().describe("Project ID to fetch.")}),hP=w.object({project:d9}),EU=T({operationId:"projects.list",description:"List projects in an organization.",backend:"api",route:{method:"GET",path:"/projects",tags:["Projects"]},input:yP,output:fP,pagination:"none",async:"sync"}),xU=T({operationId:"projects.get",description:"Get one project by ID.",backend:"api",route:{method:"GET",path:"/projects/{projectId}",tags:["Projects"]},input:cP,output:hP,pagination:"none",async:"sync"}),FL={list:EU.contract,get:xU.contract}});var t9,rP,mP,lP,iP,c4,h4,bL;var p9=L(()=>{k$();S$();t9=w.object({projectId:w.string().uuid().optional().describe("Project to search within. Auto-filled from CLI and SDK context when omitted."),query:w.string().trim().min(1,"Query must be at least 1 character").max(500,"Query must be at most 500 characters"),limit:w.coerce.number().min(1).max(100).default(20).describe("Maximum number of search results to return."),page:w.coerce.number().min(1).default(1).describe("One-based page number.")}),rP=t9.extend({status:w.enum(["regular","archived"]).optional().describe("Optional thread status filter.")}),mP=t9.extend({threadId:w.string().uuid().optional().describe("Optional thread restriction for message search."),role:w.enum(["user","assistant"]).optional().describe("Optional message role filter.")}),lP=w.object({threads:w.array(w.object({id:w.string().uuid(),projectId:w.string().uuid().optional(),title:w.string(),status:w.enum(["regular","archived"]),labels:w.array(w.string()),createdAt:w.string().datetime(),updatedAt:w.string().datetime(),highlights:w.array(w.string()),score:w.number().optional()})),pagination:w.object({page:w.number(),limit:w.number(),totalResults:w.number(),totalPages:w.number()}).describe("Page-based pagination metadata for the current search result.")}),iP=w.object({messages:w.array(w.object({id:w.string().uuid(),threadId:w.string().uuid(),threadTitle:w.string(),role:w.enum(["user","assistant"]),content:w.string(),createdAt:w.string().datetime(),updatedAt:w.string().datetime(),highlights:w.array(w.string()),score:w.number().optional()})),pagination:w.object({page:w.number(),limit:w.number(),totalResults:w.number(),totalPages:w.number()}).describe("Page-based pagination metadata for the current search result.")}),c4=T({operationId:"search.threads",description:"Search threads within one project.",backend:"api",route:{method:"GET",path:"/search/threads",tags:["Search"]},input:rP,output:lP,pagination:"page",async:"sync",examples:[{name:"search-open-incidents",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"payment timeout",status:"regular",limit:10,page:1},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"Payment timeout in us-west-2",status:"regular",labels:["payments","timeout"],createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["payment timeout"],score:123.45}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),h4=T({operationId:"search.messages",description:"Search messages within one project.",backend:"api",route:{method:"GET",path:"/search/messages",tags:["Search"]},input:mP,output:iP,pagination:"page",async:"sync",examples:[{name:"search-assistant-messages",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"rollback",role:"assistant",limit:10,page:1},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",threadId:"22222222-2222-4222-8222-222222222222",threadTitle:"Deployment rollback guidance",role:"assistant",content:"Rollback the ingestion deployment and confirm queue depth.",createdAt:"2026-01-02T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["Rollback the ingestion deployment"],score:98.76}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),bL={threads:c4.contract,messages:h4.contract}});var a9;var nP=L(()=>{x9();y9();f9();t6();h9();i9();n9();o9();p6();p9();ZU();a9={me:KU.contract,logs:{query:y4.contract},dataSources:{listTypes:$U.contract,listConnections:A4.contract,getConnection:vU.contract,createConnection:j4.contract,listStreams:_U.contract,createStream:UU.contract,getStream:DU.contract},organizations:{list:TU.contract,get:zU.contract,update:AU.contract},members:{list:VU.contract,updateRole:OU.contract,remove:WU.contract},publicKeys:{list:E4.contract,get:x4.contract,create:R4.contract,update:C4.contract,delete:u4.contract},secretKeys:{list:wU.contract,get:XU.contract,create:QU.contract,update:YU.contract,delete:PU.contract},projects:{list:EU.contract,get:xU.contract},search:{threads:c4.contract,messages:h4.contract},messages:{list:m9.contract,append:l9.contract},threads:{list:FU.contract,get:bU.contract,getStatus:gU.contract,create:SU.contract,update:BU.contract},runs:{list:LU.contract,listForThread:NU.contract,get:qU.contract}}});var r4,e9,dP,oP,a6,tP,pP,aP,eP,sP,$K,vK,_K,UK,DK,e6,IK,GK,JK,wK,XK,QK,YK,PK,KK,VK,s9,OK,WK,LK,NK,qK,kK,$w,HK,FK,bK,gK,SK,BK,ZK,MK,TK,zK,AK,jK,EK,xK,RK,CK,uK,yK,fK,cK,hK,rK,mK,gL;var lK=L(()=>{k$();S$();r4=/^[a-zA-Z0-9\s\-_]+$/,e9=w.enum(["us-west-2","us-east-1","eu-central-1"]),dP=w.object({id:w.string().uuid(),name:w.string(),createdAt:w.string().datetime()}),oP=w.object({superorganization:dP}),a6=w.object({id:w.string(),name:w.string(),createdAt:w.string().datetime()}),tP=w.object({limit:w.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of organizations to return per page."),cursor:w.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),pP=w.object({organizations:w.array(a6),nextCursor:w.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),aP=w.object({organizationId:w.string()}),eP=w.object({organization:a6}),sP=w.object({name:w.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(r4,"Name can only contain letters, numbers, spaces, hyphens, and underscores")}),$K=w.object({organization:a6}),vK=w.object({organizationId:w.string(),name:w.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(r4,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional()}),_K=w.object({organization:a6}),UK=w.object({params:w.object({organizationId:w.string()}),query:w.object({})}).transform(({params:$})=>$),DK=w.object({}),e6=w.object({id:w.string().uuid(),organizationId:w.string(),name:w.string(),region:e9,createdAt:w.string().datetime()}),IK=w.object({organizationId:w.string(),limit:w.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of projects to return per page."),cursor:w.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),GK=w.object({projects:w.array(e6),nextCursor:w.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),JK=w.object({organizationId:w.string(),projectId:w.string().uuid().describe("Project ID to fetch.")}),wK=w.object({project:e6}),XK=w.object({organizationId:w.string(),name:w.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(r4,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),region:e9.optional().default("us-west-2").describe("AWS region where the new project should be created.")}),QK=w.object({project:e6}),YK=w.object({organizationId:w.string(),projectId:w.string().uuid().describe("Project ID to update."),name:w.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(r4,"Name can only contain letters, numbers, spaces, hyphens, and underscores").optional()}),PK=w.object({project:e6}),KK=w.object({params:w.object({organizationId:w.string(),projectId:w.string().uuid().describe("Project ID to delete.")}),query:w.object({})}).transform(({params:$})=>$),VK=w.object({}),s9=w.object({id:w.string().uuid(),projectId:w.string().uuid().nullable(),name:w.string(),expiresAt:w.string().datetime().nullable(),lastUsedAt:w.string().datetime().nullable(),createdAt:w.string().datetime()}),OK=w.object({organizationId:w.string(),limit:w.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of secret keys to return per page."),cursor:w.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),WK=w.object({secretKeys:w.array(s9),nextCursor:w.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),LK=w.object({organizationId:w.string(),name:w.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(r4,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),expiresAt:w.string().datetime().optional(),projectId:w.string().uuid().optional().describe("Project to scope this key to. When set, the key can only access resources within this project.")}),NK=w.object({secretKey:s9.extend({value:w.string()})}),qK=w.object({params:w.object({organizationId:w.string(),keyId:w.string().uuid().describe("Secret key ID to delete.")}),query:w.object({})}).transform(({params:$})=>$),kK=w.object({}),$w=w.object({id:w.string().uuid(),projectId:w.string().uuid(),name:w.string(),expiresAt:w.string().datetime().nullable(),lastUsedAt:w.string().datetime().nullable(),createdAt:w.string().datetime()}),HK=w.object({organizationId:w.string(),projectId:w.string().uuid().describe("Project ID to list public keys for."),limit:w.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of public keys to return per page."),cursor:w.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),FK=w.object({publicKeys:w.array($w),nextCursor:w.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),bK=w.object({organizationId:w.string(),projectId:w.string().uuid().describe("Project ID where the key should be created."),name:w.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(r4,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),expiresAt:w.string().datetime().optional()}),gK=w.object({publicKey:$w.extend({value:w.string()})}),SK=w.object({params:w.object({organizationId:w.string(),projectId:w.string().uuid().describe("Project ID that owns the key."),keyId:w.string().uuid().describe("Public key ID to delete.")}),query:w.object({})}).transform(({params:$})=>$),BK=w.object({}),ZK=T({operationId:"partner.superorganization.get",description:"Get the authenticated partner superorganization.",backend:"partner",route:{method:"GET",path:"/superorganization",tags:["Partner - Superorganization"]},input:w.object({}),output:oP,pagination:"none",async:"sync"}),MK=T({operationId:"partner.organizations.list",description:"List organizations under the authenticated superorganization.",backend:"partner",route:{method:"GET",path:"/organizations",tags:["Partner - Organizations"]},input:tP,output:pP,pagination:"cursor",async:"sync"}),TK=T({operationId:"partner.organizations.get",description:"Get one organization under the authenticated superorganization.",backend:"partner",route:{method:"GET",path:"/organizations/{organizationId}",tags:["Partner - Organizations"]},input:aP,output:eP,pagination:"none",async:"sync"}),zK=T({operationId:"partner.organizations.create",description:"Create one organization under the authenticated superorganization.",backend:"partner",route:{method:"POST",path:"/organizations",tags:["Partner - Organizations"],successStatus:201},input:sP,output:$K,pagination:"none",async:"sync"}),AK=T({operationId:"partner.organizations.update",description:"Update one organization under the authenticated superorganization.",backend:"partner",route:{method:"PATCH",path:"/organizations/{organizationId}",tags:["Partner - Organizations"]},input:vK,output:_K,pagination:"none",async:"sync"}),jK=T({operationId:"partner.organizations.delete",description:"Delete one organization under the authenticated superorganization.",backend:"partner",route:{method:"DELETE",path:"/organizations/{organizationId}",tags:["Partner - Organizations"],successStatus:204,inputStructure:"detailed"},input:UK,output:DK,pagination:"none",async:"sync"}),EK=T({operationId:"partner.projects.list",description:"List projects under one partner-managed organization.",backend:"partner",route:{method:"GET",path:"/organizations/{organizationId}/projects",tags:["Partner - Projects"]},input:IK,output:GK,pagination:"cursor",async:"sync"}),xK=T({operationId:"partner.projects.get",description:"Get one project under one partner-managed organization.",backend:"partner",route:{method:"GET",path:"/organizations/{organizationId}/projects/{projectId}",tags:["Partner - Projects"]},input:JK,output:wK,pagination:"none",async:"sync"}),RK=T({operationId:"partner.projects.create",description:"Create one project under one partner-managed organization.",backend:"partner",route:{method:"POST",path:"/organizations/{organizationId}/projects",tags:["Partner - Projects"],successStatus:201},input:XK,output:QK,pagination:"none",async:"sync"}),CK=T({operationId:"partner.projects.update",description:"Update one project under one partner-managed organization.",backend:"partner",route:{method:"PATCH",path:"/organizations/{organizationId}/projects/{projectId}",tags:["Partner - Projects"]},input:YK,output:PK,pagination:"none",async:"sync"}),uK=T({operationId:"partner.projects.delete",description:"Delete one project under one partner-managed organization.",backend:"partner",route:{method:"DELETE",path:"/organizations/{organizationId}/projects/{projectId}",tags:["Partner - Projects"],successStatus:204,inputStructure:"detailed"},input:KK,output:VK,pagination:"none",async:"sync"}),yK=T({operationId:"partner.secretKeys.list",description:"List secret keys under one partner-managed organization.",backend:"partner",route:{method:"GET",path:"/organizations/{organizationId}/secret-keys",tags:["Partner - Secret Keys"]},input:OK,output:WK,pagination:"cursor",async:"sync"}),fK=T({operationId:"partner.secretKeys.create",description:"Create one secret key under one partner-managed organization.",backend:"partner",route:{method:"POST",path:"/organizations/{organizationId}/secret-keys",tags:["Partner - Secret Keys"],successStatus:201},input:LK,output:NK,pagination:"none",async:"sync"}),cK=T({operationId:"partner.secretKeys.delete",description:"Delete one secret key under one partner-managed organization.",backend:"partner",route:{method:"DELETE",path:"/organizations/{organizationId}/secret-keys/{keyId}",tags:["Partner - Secret Keys"],successStatus:204,inputStructure:"detailed"},input:qK,output:kK,pagination:"none",async:"sync"}),hK=T({operationId:"partner.publicKeys.list",description:"List public keys under one partner-managed project.",backend:"partner",route:{method:"GET",path:"/organizations/{organizationId}/projects/{projectId}/public-keys",tags:["Partner - Public Keys"]},input:HK,output:FK,pagination:"cursor",async:"sync"}),rK=T({operationId:"partner.publicKeys.create",description:"Create one public key under one partner-managed project.",backend:"partner",route:{method:"POST",path:"/organizations/{organizationId}/projects/{projectId}/public-keys",tags:["Partner - Public Keys"],successStatus:201},input:bK,output:gK,pagination:"none",async:"sync"}),mK=T({operationId:"partner.publicKeys.delete",description:"Delete one public key under one partner-managed project.",backend:"partner",route:{method:"DELETE",path:"/organizations/{organizationId}/projects/{projectId}/public-keys/{keyId}",tags:["Partner - Public Keys"],successStatus:204,inputStructure:"detailed"},input:SK,output:BK,pagination:"none",async:"sync"}),gL={superorganization:{get:ZK.contract},organizations:{list:MK.contract,get:TK.contract,create:zK.contract,update:AK.contract,delete:jK.contract},projects:{list:EK.contract,get:xK.contract,create:RK.contract,update:CK.contract,delete:uK.contract},keys:{secretKeys:{list:yK.contract,create:fK.contract,delete:cK.contract},publicKeys:{list:hK.contract,create:rK.contract,delete:mK.contract}}}});var vw=L(()=>{nP();x9();S$();y9();f9();t6();h9();i9();n9();lK();o9();p6();p9();ZU()});var SL,yS,BL,RU=($)=>{return BL.includes($)};var _w=L(()=>{SL={"eu-central-1":"EU Central (Frankfurt)"},yS={"us-west-2":"US West","us-east-1":"US East","eu-central-1":SL["eu-central-1"]},BL=["us-west-2","us-east-1","eu-central-1"]});var Uw,Dw,Iw,iK;var nK=L(()=>{k$();Uw=w.object({severities:w.array(w.string()).optional().describe("Limit results to the listed severities."),services:w.array(w.string()).optional().describe("Limit results to the listed service names."),environments:w.array(w.string()).optional().describe("Limit results to the listed deployment environments."),searchTerm:w.string().optional().describe("Case-insensitive substring match against the log body."),traceId:w.string().optional().describe("Limit results to one trace ID.")}),Dw=w.object({service:w.string(),namespace:w.string(),environment:w.string(),host:w.string(),container:w.string(),pod:w.string()}),Iw=w.object({id:w.string(),timestamp:w.string().datetime(),severity:w.string(),body:w.string(),service:w.string(),traceId:w.string(),spanId:w.string(),attributes:w.record(w.string(),w.string()),resource:Dw}),iK=w.object({type:w.literal("logs"),timestamp:w.string().datetime(),data:w.array(Iw)})});var ZL="https://{region}.intake.sazabi.com",ML="wss://{region}.tail.sazabi.com",TL=3,oK=500,tK="sazabi.public_key",zL=($)=>{return $.startsWith("[")&&$.endsWith("]")?$.slice(1,-1):$},pK=($)=>{let v=zL($);return v==="localhost"||v==="127.0.0.1"||v==="::1"},AL,jL,EL,aK=($)=>{let v=new Map;return{tail:async(U)=>{let D=await hL($.credentialProvider,U.projectId,"logs.tail"),_=await rL($,v,D,U.region,"logs.tail"),I=xL({projectId:D,region:_,filters:U.filters,tailBaseUrl:$.tailBaseUrl}),G=await $.credentialProvider.getToken(),J=$.webSocket??globalThis.WebSocket;if(!J)throw Error("WebSocket transport is not available in this runtime.");return iL({token:G,url:I,signal:U.signal,webSocket:J})},forward:async(U)=>{let D=await mL($,v,U.projectId??await $.credentialProvider.getProjectId?.(),U.region,"logs.forward"),_=uL(D,$.intakeBaseUrl),I=$.fetch??globalThis.fetch,G=fL(U.logs,U.publicKey),J=tL(G);return await oL(I,_,G),{forwardedCount:J,failedCount:0}}}},xL=($)=>{let v=($.tailBaseUrl??ML).replace("{region}",$.region),U=RL(v)??new URL(v);U.searchParams.set("projectId",$.projectId);let D=CL($.filters);if(D)U.searchParams.set("filters",D);return U.toString()},RL=($)=>{let v=(()=>{try{return new URL($)}catch{return null}})();if(!v)return;if(!pK(v.hostname))return;return v.protocol="ws:",v.pathname="/tail",v},CL=($)=>{if(!$)return;let v=Object.entries($).filter(([,U])=>U!==void 0&&(!Array.isArray(U)||U.length>0)&&U!=="");if(v.length===0)return;return JSON.stringify(Object.fromEntries(v))},uL=($,v)=>{let U=(v??ZL).replace("{region}",$),D=U.endsWith("/")?U.slice(0,-1):U,_=yL(D);if(_)return _;let I=D.match(/^https:\/\/([a-z0-9-]+)\.intake\.([a-z0-9.]+)$/);return`${I?`https://otlp.${I[1]}.intake.${I[2]}`:D}/v1/logs`},yL=($)=>{let v=(()=>{try{return new URL($)}catch{return null}})();if(!v)return;if(!pK(v.hostname))return;return v.pathname="/adapters/otlp",v.toString()},fL=($,v)=>{let U=$.resourceLogs;if(!U||U.length===0)return{...$,resourceLogs:[{resource:{attributes:[eK(v)]},scopeLogs:[]}]};return{...$,resourceLogs:U.map((D)=>({...D,resource:{...D.resource,attributes:cL(D.resource?.attributes,v)}}))}},cL=($,v)=>{return[...($??[]).filter((D)=>D?.key!==tK),eK(v)]},eK=($)=>({key:tK,value:{stringValue:$}}),hL=async($,v,U)=>{let D=v??await $.getProjectId?.();if(D)return D;throw $7(U,"Project ID is required",["projectId"])},rL=async($,v,U,D,_)=>{let I=D??await sK($,v,U);return lL(I,_)},mL=async($,v,U,D,_)=>{if(D)return D;if(!U)throw $7(_,"Project ID is required",["projectId"]);return sK($,v,U)},sK=async($,v,U)=>{let D=v.get(U);if(D)return D;let _=$.raw.projects.get({projectId:U}).then((I)=>I.project.region);v.set(U,_);try{return await _}catch(I){throw v.delete(U),I}},lL=($,v)=>{if(RU($))return $;throw new D$("BAD_REQUEST",{message:`Log tail is not supported for project region ${$}.`,data:{operationId:v,missingContext:[]}})},iL=async($)=>{let v=[],U=[],D=!1,_=!1,I,G=0,J,X=(O)=>{if(D)return;D=!0,I=O;while(U.length>0){let S=U.shift();if(S)S({value:void 0,done:!0})}},Q=(O)=>{let S=U.shift();if(S){S({value:O,done:!1});return}v.push(O)},Y=()=>{if(J&&J.readyState<J.CLOSING)J.close(1000,"Client closed stream")},P=async()=>{await new Promise((O,S)=>{let B=!1,h;try{h=new $.webSocket($.url,[$.token])}catch(p){S(p instanceof Error?p:Error("Failed to open WebSocket connection."));return}J=h,h.onopen=()=>{if(G=0,!B)B=!0,O()},h.onmessage=(p)=>{let X$=nL(p.data);for(let $$ of X$)Q($$)},h.onerror=()=>{if(!B)B=!0,S(Error("WebSocket connection failed. Check the close event for details."))},h.onclose=(p)=>{if(!B){B=!0,S(dK(p.code,p.reason));return}if(_||D){X();return}if(dL(p.code)&&G<TL){G+=1,globalThis.setTimeout(()=>{P().catch((X$)=>{X(X$ instanceof Error?X$:Error(String(X$)))})},oK*2**(G-1));return}X(dK(p.code,p.reason))}})};$.signal?.addEventListener("abort",()=>{_=!0,Y(),X()},{once:!0}),await P();let V={[Symbol.asyncIterator](){return V},next:async()=>{if(v.length>0)return{value:v.shift(),done:!1};if(D){if(I)throw I;return{value:void 0,done:!0}}return new Promise((O)=>{U.push(O)}).then((O)=>{if(O.done&&I)throw I;return O})},return:async()=>{return _=!0,Y(),X(),{value:void 0,done:!0}},throw:async(O)=>{throw _=!0,Y(),X(O instanceof Error?O:Error(String(O))),O}};return V},nL=($)=>{let v=(()=>{if(typeof $==="string")return $;if($ instanceof ArrayBuffer)return new TextDecoder().decode($);return null})();if(!v)return[];try{let U=iK.safeParse(JSON.parse(v));if(!U.success)return[];return U.data.data}catch{return[]}},dL=($)=>{return![1000,1001,1008,4001,4003,4004].includes($)},dK=($,v)=>{if(v)return Error(v);let U={1000:"Normal closure",1001:"Endpoint going away",1002:"Protocol error",1003:"Unsupported data",1006:"Connection closed abnormally (no close frame received)",1007:"Invalid payload data",1008:"Policy violation",1009:"Message too big",1010:"Missing extension",1011:"Internal server error",1015:"TLS handshake failure",4001:"Authentication failed - check your credential",4003:"Forbidden - credential may not have access to this project",4004:"Project not found"}[$]??`Unknown close code: ${$}`;return Error(`Connection closed: ${U}`)},oL=async($,v,U,D=3,_=1e4)=>{let I;for(let G=0;G<=D;G+=1){let J=new AbortController,X=globalThis.setTimeout(()=>J.abort(),_);try{let Q=await $(v,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(U),signal:J.signal});if(Q.ok)return;let Y=await Q.text();if(Q.status===401||Q.status===403)throw Error("Authentication failed. Check your public key.");if(Q.status>=400&&Q.status<500&&Q.status!==429)throw Error(`Client error (${Q.status}): ${Y}`);I=Error(Q.status===429?`Rate limited (429): ${Y}`:`Server error (${Q.status}): ${Y}`)}catch(Q){let Y=Q instanceof Error?Q.message:String(Q);if(Y.startsWith("Authentication failed")||Y.startsWith("Client error ("))throw Q instanceof Error?Q:Error(Y);I=Q instanceof Error&&Q.name==="AbortError"?Error("Request timed out"):Q instanceof Error?Q:Error(String(Q))}finally{globalThis.clearTimeout(X)}if(G<D)await pL(oK*2**G)}throw Error(`Failed after ${D+1} attempts: ${I?.message??"Unknown error"}`)},tL=($)=>{return $.resourceLogs?.reduce((v,U)=>v+(U.scopeLogs?.reduce((D,_)=>D+(_.logRecords?.length??0),0)??0),0)??0},pL=async($)=>{await new Promise((v)=>globalThis.setTimeout(v,$))},$7=($,v,U)=>{return new D$("BAD_REQUEST",{message:v,data:{operationId:$,missingContext:U}})};var Gw=L(()=>{qv();_w();nK();k$();AL=w.object({projectId:w.string().uuid().optional().describe("Project to tail logs for. Auto-filled from CLI and SDK context when omitted."),filters:Uw.optional().describe("Optional filters applied by the tail WebSocket service.")}),jL=w.object({publicKey:w.string().min(1).describe("Public key for intake auth. Create or list one via the public key endpoints."),logs:w.custom(($)=>typeof $==="object"&&$!==null).describe("OTLP logs export request payload to send to the intake service.")}),EL=w.object({forwardedCount:w.number().int().nonnegative().describe("Number of log records accepted by the intake request."),failedCount:w.number().int().nonnegative().describe("Number of log records rejected by the intake request.")})});var aL="https://api.sazabi.com",U7="https://api.platform.sazabi.com",D7="sazabi-cli",eL="urn:ietf:params:oauth:grant-type:device_code",v7=($)=>{if($&&typeof $==="object")return $;return{}},I7=($)=>{let v=VD(new ZD(a9,{url:sL($.apiBaseUrl??aL),headers:async()=>new Headers({authorization:`Bearer ${await $.credentialProvider.getToken()}`}),fetch:$.fetch,customErrorResponseBodyDecoder:(D,_)=>{let I=GN(D);if(!I)return null;return new D$(I.code,{message:I.message,status:_.status,data:{operationId:I.operationId,missingContext:I.missingContext}})}})),U=aK({raw:v,credentialProvider:$.credentialProvider,fetch:$.fetch,intakeBaseUrl:$.intakeBaseUrl,tailBaseUrl:$.tailBaseUrl,webSocket:$.webSocket});return{raw:v,me:async()=>v.me({}),logs:{...U,query:async(D={})=>v.logs.query(await s$($.credentialProvider,D,y4.operationId))},organizations:{list:async()=>v.organizations.list({}),get:async(D)=>v.organizations.get(D),update:async(D)=>v.organizations.update(await vN($.credentialProvider,D))},members:{list:async(D={})=>v.members.list(await CU($.credentialProvider,D)),updateRole:async(D)=>v.members.updateRole(await CU($.credentialProvider,D)),remove:async(D)=>{let _=await CU($.credentialProvider,D);return v.members.remove({params:{userId:_.userId},query:{organizationId:_.organizationId}})}},publicKeys:{list:async(D={})=>v.publicKeys.list(await s$($.credentialProvider,D,E4.operationId)),get:async(D)=>v.publicKeys.get(await s$($.credentialProvider,D,x4.operationId)),create:async(D)=>v.publicKeys.create(await s$($.credentialProvider,D,R4.operationId)),update:async(D)=>v.publicKeys.update(await s$($.credentialProvider,D,C4.operationId)),delete:async(D)=>{let _=await s$($.credentialProvider,D,u4.operationId);return v7(await v.publicKeys.delete({params:{keyId:_.keyId},query:{projectId:_.projectId}}))}},secretKeys:{list:async(D={})=>v.secretKeys.list(D),get:async(D)=>v.secretKeys.get(D),create:async(D)=>v.secretKeys.create(D),update:async(D)=>v.secretKeys.update(D),delete:async(D)=>v7(await v.secretKeys.delete({params:{keyId:D.keyId}}))},search:{threads:async(D)=>v.search.threads(await s$($.credentialProvider,D,c4.operationId)),messages:async(D)=>v.search.messages(await s$($.credentialProvider,D,h4.operationId))},projects:{list:async(D={})=>v.projects.list(await $N($.credentialProvider,D)),get:async(D)=>v.projects.get(D)},messages:{list:async(D)=>v.messages.list(D),append:async(D)=>_7(v,await v.messages.append(IN(D)))},threads:{list:async(D={})=>v.threads.list(await _N($.credentialProvider,D)),get:async(D)=>v.threads.get(D),getStatus:async(D)=>v.threads.getStatus(D),create:async(D)=>_7(v,await v.threads.create(await DN($.credentialProvider,D))),update:async(D)=>v.threads.update(D)},runs:{list:async(D={})=>v.runs.list(await UN($.credentialProvider,D)),listForThread:async(D)=>v.runs.listForThread(D),get:async(D)=>v.runs.get(D)},dataSources:{listTypes:async()=>v.dataSources.listTypes({}),connections:{list:async(D={})=>v.dataSources.listConnections(await s$($.credentialProvider,D,A4.operationId)),get:async(D)=>v.dataSources.getConnection(D),create:async(D)=>v.dataSources.createConnection(await s$($.credentialProvider,D,j4.operationId))},streams:{list:async(D)=>v.dataSources.listStreams(D),get:async(D)=>v.dataSources.getStream(D),create:async(D)=>v.dataSources.createStream(D)}}}},G7=async($={})=>{let v=await Q7($.fetch)(w7($.apiBaseUrl??U7,"/device/code"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:$.clientId??D7,...$.scope?{scope:$.scope}:{}})}),U=await v.json();if(!v.ok)throw JN(U,v.status);let D=U;return{deviceCode:m4(D.device_code,"device_code"),userCode:m4(D.user_code,"user_code"),verificationUri:m4(D.verification_uri,"verification_uri"),verificationUriComplete:m4(D.verification_uri_complete,"verification_uri_complete"),expiresIn:Jw(D.expires_in,"expires_in"),interval:Jw(D.interval,"interval")}},J7=async($)=>{let v=await Q7($.fetch)(w7($.apiBaseUrl??U7,"/device/token"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:eL,device_code:$.deviceCode,client_id:$.clientId??D7})}),U=await v.json();if(v.ok){let _=U;return{status:"authorized",accessToken:m4(_.access_token,"access_token"),tokenType:m4(_.token_type,"token_type"),expiresIn:Jw(_.expires_in,"expires_in"),scope:typeof _.scope==="string"?_.scope:""}}let D=X7(U);if(!D)throw Error(`Device authorization failed with status ${v.status}`);if(D.error==="authorization_pending")return{status:"pending"};if(D.error==="slow_down")return{status:"pending",interval:10};if(D.error==="access_denied")return{status:"denied",message:D.errorDescription};if(D.error==="expired_token"||D.error==="invalid_grant")return{status:"expired",message:D.errorDescription};throw Error(D.errorDescription)},sL=($)=>{let v=$.replace(/\/+$/,"");return v.endsWith("/v1")?v:`${v}/v1`},w7=($,v)=>{return`${$.replace(/\/+$/,"")}/api/auth${v}`},$N=async($,v)=>{return CU($,v)},CU=async($,v)=>{let U=v.organizationId??await $.getOrganizationId?.();return U?{...v,organizationId:U}:v},vN=async($,v)=>{let U=v.organizationId??await $.getOrganizationId?.();if(!U)throw new D$("BAD_REQUEST",{message:"Organization ID is required",data:{operationId:"organizations.update",missingContext:["organizationId"]},status:400});return{...v,organizationId:U}},s$=async($,v,U)=>{let D=v.projectId??await $.getProjectId?.();if(!D)throw new D$("BAD_REQUEST",{message:"Project ID is required",data:{operationId:U,missingContext:["projectId"]},status:400});return{...v,projectId:D}},_N=async($,v)=>{let U=v.projectId??await $.getProjectId?.();return U?{...v,projectId:U}:v},UN=async($,v)=>{let U=v.projectId??await $.getProjectId?.();return U?{...v,projectId:U}:v},DN=async($,v)=>{let U=v.projectId??await $.getProjectId?.();return U?{...v,projectId:U}:v},IN=($)=>{return{threadId:$.threadId,message:$.message,wait:$.wait??!0,timeoutSeconds:$.timeoutSeconds??20}},GN=($)=>{if(!$||typeof $!=="object")return null;let v=$;if(typeof v.code!=="string"||typeof v.message!=="string"||typeof v.operationId!=="string")return null;return{code:v.code,message:v.message,operationId:v.operationId,missingContext:Array.isArray(v.missingContext)?v.missingContext.filter((U)=>typeof U==="string"):[]}},X7=($)=>{if(!$||typeof $!=="object")return null;let v=$;if(typeof v.error!=="string"||typeof v.error_description!=="string")return null;return{error:v.error,errorDescription:v.error_description}},JN=($,v)=>{let U=X7($);return Error(U?.errorDescription??`Device authorization failed with status ${v}`)},Q7=($)=>{return $??globalThis.fetch},_7=($,v)=>({result:v,poll:()=>$.runs.get({runId:v.runId}),waitForCompletion:async(U={})=>wN($,v,U)}),wN=async($,v,U)=>{if(v.completed)return v;let D=U.intervalMs??2000,_=Date.now(),I=v;while(!I.completed){if(U.timeoutMs!==void 0&&Date.now()-_>=U.timeoutMs)return I;await XN(D),I=await $.runs.get({runId:I.runId})}return I},XN=async($)=>{await new Promise((v)=>globalThis.setTimeout(v,$))},m4=($,v)=>{if(typeof $==="string")return $;throw Error(`Expected '${v}' to be a string.`)},Jw=($,v)=>{if(typeof $==="number")return $;throw Error(`Expected '${v}' to be a number.`)};var ww=L(()=>{qv();KX();vw();Gw();Gw()});var c$=($)=>({success:!0,value:$}),Tv=($,v,U)=>({success:!1,error:$,...v!==void 0&&{statusCode:v},...U!==void 0&&{errorPayload:U}}),k=($,v,U)=>{if(!$.success){let D=`${v}: ${$.error}`;if(U)return q($.errorPayload??D);return N(D)}return $.value};var e=L(()=>{n()});var YN="https://api.sazabi.com",f=async($)=>{try{return c$(await $())}catch(v){let U=PN(v),D=KN(v),_=v instanceof Error?v.message:String(v);return Tv(_,D,U)}},PN=($)=>{if(!$||typeof $!=="object")return;let v=$;if(typeof v.code!=="string"||typeof v.message!=="string"||!v.data||typeof v.data!=="object")return;let U=v.data;if(typeof U.operationId!=="string")return;return{code:v.code,message:v.message,operationId:U.operationId,missingContext:Array.isArray(U.missingContext)?U.missingContext.filter((D)=>typeof D==="string"):[]}},KN=($)=>{if(!$||typeof $!=="object")return;let v=$;return typeof v.status==="number"?v.status:void 0},Jv=($)=>{let v=I7({apiBaseUrl:$.baseUrl??YN,credentialProvider:{getToken:()=>$.token,getOrganizationId:()=>$.organizationId,getProjectId:()=>$.projectId},intakeBaseUrl:$.intakeBaseUrl,tailBaseUrl:$.tailBaseUrl});return{me:()=>f(()=>v.me()),logs:{tail:(U)=>f(()=>v.logs.tail(U)),forward:(U)=>f(()=>v.logs.forward(U))},organizations:{list:()=>f(()=>v.organizations.list()),get:(U)=>f(()=>v.organizations.get({organizationId:U})),rename:(U,D)=>f(()=>v.organizations.update({organizationId:D,name:U}))},members:{list:(U={})=>f(()=>v.members.list(U)),updateRole:(U,D,_)=>f(()=>v.members.updateRole({organizationId:_,userId:U,role:D})),remove:(U,D)=>f(()=>v.members.remove({organizationId:D,userId:U}))},projects:{list:(U={})=>f(()=>v.projects.list(U)),get:(U)=>f(()=>v.projects.get({projectId:U}))},threads:{list:(U={})=>f(()=>v.threads.list(U)),get:(U)=>f(()=>v.threads.get({threadId:U})),create:(U)=>f(()=>v.threads.create(U)),getStatus:(U)=>f(()=>v.threads.getStatus({threadId:U})),update:(U,D)=>f(()=>v.threads.update({threadId:U,status:D}))},messages:{list:(U,D={})=>f(()=>v.messages.list({threadId:U,...D})),append:(U,D,_,I)=>f(()=>v.messages.append({threadId:U,message:D,wait:_,timeoutSeconds:I}))},runs:{get:(U)=>f(()=>v.runs.get({runId:U}))},search:{threads:(U)=>f(()=>v.search.threads(U)),messages:(U)=>f(()=>v.search.messages(U))},publicKeys:{list:(U)=>f(()=>v.publicKeys.list(U)),get:(U,D)=>f(()=>v.publicKeys.get(D?{keyId:U,projectId:D}:{keyId:U})),create:(U)=>f(()=>v.publicKeys.create(U)),update:(U)=>f(()=>v.publicKeys.update(U)),delete:(U)=>f(()=>v.publicKeys.delete(U))},secretKeys:{list:(U)=>f(()=>v.secretKeys.list(U)),get:(U)=>f(()=>v.secretKeys.get({keyId:U})),create:(U)=>f(()=>v.secretKeys.create(U)),update:(U)=>f(()=>v.secretKeys.update(U)),delete:(U)=>f(()=>v.secretKeys.delete(U))},dataSources:{listTypes:()=>f(()=>v.dataSources.listTypes()),connections:{list:(U)=>f(()=>v.dataSources.connections.list(U)),get:(U)=>f(()=>v.dataSources.connections.get({connectionId:U})),create:(U)=>f(()=>v.dataSources.connections.create(U))},streams:{list:(U)=>f(()=>v.dataSources.streams.list({connectionId:U})),get:(U)=>f(()=>v.dataSources.streams.get({streamId:U})),create:(U)=>f(()=>v.dataSources.streams.create(U))}}}};var s6=L(()=>{ww();e()});var Y7;var P7=L(()=>{Y7={version:2,activeProfile:"default",profiles:{default:{}}}});import*as wv from"node:fs";import*as K7 from"node:os";import*as Yw from"node:path";var B$=($)=>{if($===void 0||$===null)return;if(typeof $==="string")return $.length>0?$:void 0;return},Xw,l4,VN=()=>{if(!wv.existsSync(Xw))wv.mkdirSync(Xw,{recursive:!0,mode:448})},Qw,V7=($)=>{Qw=$},O7=($)=>({token:B$($.token),activeOrganizationId:B$($.activeOrganizationId??$.organizationId),organizationName:B$($.organizationName),activeProjectId:B$($.activeProjectId??$.defaultProjectId),apiBaseUrl:B$($.apiBaseUrl),webBaseUrl:B$($.webBaseUrl),intakeBaseUrl:B$($.intakeBaseUrl),tailBaseUrl:B$($.tailBaseUrl),apiDomain:B$($.apiDomain),webDomain:B$($.webDomain),intakeDomain:B$($.intakeDomain),tailDomain:B$($.tailDomain),forwardPublicKey:B$($.forwardPublicKey)}),ON=($)=>({version:2,activeProfile:"default",profiles:{default:O7($)}}),WN=($)=>{let v=B$($.activeProfile)??"default",U=typeof $.profiles==="object"&&$.profiles!==null?$.profiles:{},D={};for(let[_,I]of Object.entries(U)){if(typeof I!=="object"||I===null)continue;D[_]=O7(I)}if(!D[v])D[v]={};return{version:2,activeProfile:v,profiles:D}},s=()=>{try{if(!wv.existsSync(l4))return c$(Y7);let $=wv.readFileSync(l4,"utf-8"),v=JSON.parse($),U=typeof v.version==="number"?v.version:void 0;if(U!==void 0&&U>2)return Tv("Settings file requires a newer CLI version. Please upgrade.");if(U===2)return c$(WN(v));let D=ON(v),_=J$(D);if(!_.success)return _;return c$(D)}catch($){let v=$ instanceof Error?$.message:String($);return Tv(`Failed to read settings: ${v}`)}},J$=($)=>{try{return VN(),wv.writeFileSync(l4,JSON.stringify($,null,2),{encoding:"utf-8",mode:384}),c$(void 0)}catch(v){let U=v instanceof Error?v.message:String(v);return Tv(`Failed to write settings: ${U}`)}},Xv=($,v)=>{if(v)return v;if(Qw)return Qw;let U=process.env.SAZABI_PROFILE?.trim();if(U)return U;return $.activeProfile??"default"},l$=($,v)=>{let U=Xv($,v),D=$.profiles[U];if(D)return c$(D);if(U==="default")return c$({});return Tv(`Profile '${U}' does not exist. Run 'sazabi profiles create ${U}' first.`)},Qv=()=>{let $=s();if(!$.success)return $;return l$($.value)},E$=($,v,U)=>{let D=Xv($,U);if(!$.profiles[D])return Tv(`Profile '${D}' does not exist. Run 'sazabi profiles create ${D}' first.`);return c$({...$,profiles:{...$.profiles,[D]:{...$.profiles[D],...v}}})};var h$=L(()=>{P7();e();Xw=Yw.join(K7.homedir(),".sazabi"),l4=Yw.join(Xw,"settings.json")});var $v=($)=>{let{cliFlag:v,globalUrl:U,globalDomain:D,buildUrlFromDomain:_,defaultUrl:I}=$;if(v)return v;let G=process.env.SAZABI_API_URL?.trim();if(G)return G;if(U)return U;if(D)return _(D);return I},R=($)=>{let{tokenFlag:v,organizationIdFlag:U,projectIdFlag:D,jsonMode:_}=$,I=v?.trim(),G=process.env.SAZABI_TOKEN?.trim(),J=process.env.SAZABI_ORGANIZATION_ID?.trim(),X=process.env.SAZABI_PROJECT_ID?.trim(),Q=k(Qv(),"Failed to read settings",_),Y=Q.token?.trim(),P=(I&&I.length>0?I:void 0)||(G&&G.length>0?G:void 0)||Y,V=I&&I.length>0?"flag":G&&G.length>0?"environment":"settings";if(!P||P.length===0){if(_)return q("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.");return N("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.")}let O,S;if(U)O=U,S="flag";else if(J&&J.length>0)O=J,S="environment";else if(Q.activeOrganizationId)O=Q.activeOrganizationId,S="settings";let B,h;if(D)B=D,h="flag";else if(X&&X.length>0)B=X,h="environment";else if(Q.activeProjectId)B=Q.activeProjectId,h="settings";return{token:P,type:"token",projectId:B,organizationId:O,tokenSource:V,organizationSource:S,projectSource:h}},y=($)=>{let v=k(Qv(),"Failed to read settings",$.jsonMode),U=$v({cliFlag:$.apiBaseUrlFlag,globalUrl:v.apiBaseUrl,globalDomain:v.apiDomain,buildUrlFromDomain:(D)=>`https://api.${D}`,defaultUrl:"https://api.sazabi.com"});return Jv({token:$.token,baseUrl:U,organizationId:$.organizationId,projectId:$.projectId})},W7,Pw,uU=async($)=>{let v=k(Qv(),"Failed to read settings",$.jsonMode),U=$v({cliFlag:$.apiBaseUrlFlag,globalUrl:v.apiBaseUrl,globalDomain:v.apiDomain,buildUrlFromDomain:(X)=>`https://api.${X}`,defaultUrl:"https://api.sazabi.com"}),D=`${$.token}@${U}@${$.projectId??""}`,_=W7.get(D);if(_)return _;let I=Pw.get(D);if(I)return I;if(!$.projectId){if($.jsonMode)return q("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.");return N("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.")}let G=$.projectId,J=(async()=>{let Q=await Jv({token:$.token,baseUrl:U,projectId:G}).projects.get(G),P=k(Q,"Failed to fetch project info",$.jsonMode).project;return W7.set(D,P),P})();Pw.set(D,J);try{return await J}finally{Pw.delete(D)}},$1=($)=>{if($)return $;let v=k(Qv(),"Failed to read settings");if(v.webBaseUrl)return v.webBaseUrl;if(v.webDomain)return`https://app.${v.webDomain}`;if(v.apiDomain)return`https://app.${v.apiDomain}`;if(v.apiBaseUrl?.includes("sazabi.dev"))return"https://app.sazabi.dev";return"https://app.sazabi.com"},yU=($,v,U)=>{return`${$1(U)}/projects/${$}/threads/${v}`},L7=($,v)=>{return`https://otlp.${v}.intake.${$}`};var w$=L(()=>{n();s6();e();h$();W7=new Map,Pw=new Map});var iU,_V=($)=>{iU.set($.name,$)},nU=($)=>{return iU.get($)},_1=()=>{return Array.from(iU.values())},UV=($)=>{return iU.has($)};var kw=L(()=>{iU=new Map});async function Sw($){let v=await $.publicKeys.list({limit:20});if(!v.success)return[];return v.value.publicKeys.map((U)=>({value:U.id,description:U.name}))}async function Bw($){let v=await $.secretKeys.list({limit:20});if(!v.success)return[];return v.value.secretKeys.map((U)=>({value:U.id,description:U.name}))}async function h3($){let v=await $.dataSources.connections.list();if(!v.success)return[];return v.value.connections.map((U)=>({value:U.id,description:U.displayName??void 0}))}async function JV($){let v=await $.members.list();if(!v.success)return[];return v.value.members.map((U)=>({value:U.userId,description:U.name??U.email}))}var f3=3000,c3,wV=async($,v,U)=>{try{let D=c3[$]?.[v];if(!D)return[];let _=Qv();if(!_.success)return[];let I=_.value,G=process.env.SAZABI_TOKEN?.trim()||I.token?.trim();if(!G)return[];let J=$v({globalUrl:I.apiBaseUrl,globalDomain:I.apiDomain,buildUrlFromDomain:(Y)=>`https://api.${Y}`,defaultUrl:"https://api.sazabi.com"}),X=Jv({token:G,baseUrl:J,organizationId:I.activeOrganizationId,projectId:I.activeProjectId});return(await Promise.race([D(X),new Promise((Y)=>setTimeout(()=>Y([]),f3))])).filter((Y)=>Y.value.startsWith(U))}catch{return[]}};var XV=L(()=>{s6();w$();h$();c3={threads:{get:async($)=>{let v=await $.threads.list({limit:20});if(!v.success)return[];return v.value.threads.map((U)=>({value:U.id,description:U.title??void 0}))}},projects:{use:async($)=>{let v=await $.projects.list();if(!v.success)return[];return v.value.projects.map((U)=>({value:U.id,description:U.name}))}},organizations:{use:async($)=>{let v=await $.organizations.list();if(!v.success)return[];return v.value.organizations.map((U)=>({value:U.id,description:U.name}))},rename:async($)=>{let v=await $.organizations.list();if(!v.success)return[];return v.value.organizations.map((U)=>({value:U.id,description:U.name}))}},"public-keys":{get:Sw,update:Sw,delete:Sw},"secret-keys":{get:Bw,update:Bw,delete:Bw},"data-sources":{"get-connection":h3},members:{"update-role":JV,remove:JV}}});var YV={};i$(YV,{parseCompletionContext:()=>l3,getCompletions:()=>i3});var r3,m3,l3=($)=>{let v=$.length>0?$:[""],U=v.length-1,D=v[U]??"";return{words:v,currentIndex:U,partial:D}},i3=async($)=>{let{words:v,currentIndex:U,partial:D}=$,_=v[U-1];if(_==="--profile")return t3(D);let I=o3(v),G=Math.max(0,I.length-(v.length-U));if(G===0)return n3(D);let J=I[0]??"",X=nU(J);if(!X)return[];if(G===1&&X.subcommands){if(D.startsWith("-"))return QV(X.options,I);return d3(X,D)}let Q=X.subcommands?I[1]:void 0,P=(Q?X.subcommands?.[Q]:void 0)?.options??X.options;if(D.startsWith("-"))return QV(P,I);if(_?.startsWith("--")){let V=_.slice(2);if(P?.[V]?.type==="string"){let S=`${J}:${Q??""}`,B=m3[S]?.[V]??r3[V];if(B)return B.filter((h)=>h.startsWith(D)).map((h)=>({value:h}));return[]}}return wV(J,Q??"",D)},n3=($)=>{let U=_1().filter((_)=>_.name.startsWith($)).map((_)=>({value:_.name,description:_.description})),D=[{value:"--help",description:"Show help"},{value:"--version",description:"Show version"},{value:"--profile",description:"Use a named profile"}];for(let _ of D)if(_.value.startsWith($))U.push(_);return U},d3=($,v)=>{if(!$.subcommands)return[];return Object.values($.subcommands).filter((U)=>U.name.startsWith(v)).map((U)=>({value:U.name,description:U.description}))},QV=($,v)=>{let U=v[v.length-1]??"",D=new Set(v.filter((I)=>I.startsWith("--")).map((I)=>I.replace(/=.*/,""))),_=[];if(!D.has("--help")&&"--help".startsWith(U))_.push({value:"--help",description:"Show help"});if(!D.has("--profile")&&"--profile".startsWith(U))_.push({value:"--profile",description:"Use a named profile"});if(!$)return _;for(let[I,G]of Object.entries($)){let J=`--${I}`;if(D.has(J))continue;if(!J.startsWith(U))continue;_.push({value:J,description:G.description})}return _},o3=($)=>{let v=[];for(let U=0;U<$.length;U++){let D=$[U];if(D==="--profile"&&U+1<$.length)U++;else if(D.startsWith("--profile="));else v.push(D)}return v},t3=($)=>{try{let v=s();if(!v.success)return[];return Object.keys(v.value.profiles).filter((U)=>U.startsWith($)).map((U)=>({value:U,description:U===v.value.activeProfile?"active":void 0}))}catch{return[]}};var PV=L(()=>{kw();h$();XV();r3={status:["regular","archived"],format:["json","text"]},m3={"members:update-role":{role:["admin","member"]},"messages:search":{role:["user","assistant"]},"messages:list":{role:["user","assistant"]}}});n();n();ww();import{spawn as LN}from"node:child_process";n();import{parseArgs as QN}from"node:util";var j=($,v,U={})=>{let D=QN({args:$,options:v,allowPositionals:Boolean(U.allowPositionals),strict:!1,tokens:!0}),_=Object.hasOwn(v,"json")&&D.values.json===!0,I=new Set(Object.keys(v)),G=new Set(Object.entries(v).map(([,X])=>X.short).filter((X)=>Boolean(X))),J=[];if(Array.isArray(D.tokens))for(let X of D.tokens){if(X.kind!=="option")continue;let Q=X.name,Y=Q.length>1;if(!(I.has(Q)||!Y&&G.has(Q))){let V=Y?`--${Q}`:`-${Q}`;if(!J.includes(V))J.push(V)}}for(let X of Object.keys(D.values))if(!I.has(X)){let Q=X.length>1?`--${X}`:`-${X}`;if(!J.includes(Q))J.push(Q)}if(J.length>0){let X=`Unknown option${J.length>1?"s":""}: ${J.join(", ")}`;if(_)q(X);N(X)}for(let[X,Q]of Object.entries(v))if(Q.type==="string"&&D.values[X]===!0){let P=`Option ${X.length===1?`-${X}`:`--${X}`} requires a value`;if(_)q(P);N(P)}for(let[X,Q]of Object.entries(v)){let Y=D.values[X];if(Q.type==="string"&&typeof Y==="string"){if(Y.startsWith("--")||Y.length===2&&Y[0]==="-"&&/[a-zA-Z]/.test(Y.charAt(1))){let O=`Option ${X.length===1?`-${X}`:`--${X}`} received "${Y}" as its value. Did you forget to provide a value?`;if(_)q(O);N(O)}}}return{values:D.values,positionals:D.positionals}};w$();var fU=($,v)=>{let U=$?.json;if(!U||U.type!=="boolean")throw Error(`${v} must include a boolean --json option (enforced by CommandBuilder)`)};class N7{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor($,v,U){this.name=$,this.description=v,this.handler=U}withOptions($){return this.options=$,this}withSubcommands($){return this.subcommands=$,this}withExamples($){return this.examples=$,this}withPositionalArgs($){return this.positionalArgs=$,this}build(){if(!this.handler&&!this.subcommands)throw Error(`Subcommand "${this.name}" must have either a handler or subcommands`);if(!this.allowNoJson&&this.handler)fU(this.options,`Subcommand "${this.name}"`);if(!this.allowNoJson&&this.subcommands){for(let[$,v]of Object.entries(this.subcommands))if(!v.subcommands)fU(v.options,`Subcommand "${this.name} ${$}"`)}return{name:this.name,description:this.description,handler:this.handler,subcommands:this.subcommands,options:this.options,examples:this.examples,positionalArgs:this.positionalArgs}}allowWithoutJson(){return this.allowNoJson=!0,this}}class q7{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor($,v){this.name=$,this.description=v}withHandler($){return this.handler=$,this}withSubcommands($){return this.subcommands=$,this}withOptions($){return this.options=$,this}withExamples($){return this.examples=$,this}withPositionalArgs($){return this.positionalArgs=$,this}build(){if(!this.handler&&!this.subcommands)throw Error(`Command "${this.name}" must have either a handler or subcommands`);if(!this.allowNoJson){if(this.handler)fU(this.options,`Command "${this.name}"`);if(this.subcommands)for(let[$,v]of Object.entries(this.subcommands)){if(v.subcommands)continue;fU(v.options,`Subcommand "${this.name} ${$}"`)}}return{name:this.name,description:this.description,handler:this.handler,subcommands:this.subcommands,options:this.options,examples:this.examples,positionalArgs:this.positionalArgs}}allowWithoutJson(){return this.allowNoJson=!0,this}}var o=($,v)=>{return new q7($,v)},z=($,v,U)=>{return new N7($,v,U)};e();h$();var i4=($)=>{if($==="flag")return"from flag";if($==="environment")return"from environment";return"from settings"},NN=async($={})=>{let v=R({jsonMode:$.json}),U=y({token:v.token,organizationId:v.organizationId,projectId:v.projectId,apiBaseUrlFlag:$.apiBaseUrl,jsonMode:$.json}),D=k(await U.me(),"Failed to fetch authentication details",$.json);if($.json){M({credential:D,activeOrganizationId:v.organizationId,activeProjectId:v.projectId,tokenSource:v.tokenSource,organizationSource:v.organizationSource,projectSource:v.projectSource});return}if(Y$("Authentication"),D.credentialType==="user"){_$({Type:`User token (${i4(v.tokenSource)})`,User:D.user.name??D.user.email,Email:D.user.email,"Active Organization":v.organizationId&&v.organizationSource?`${v.organizationId} (${i4(v.organizationSource)})`:G$("(none)"),"Active Project":v.projectId&&v.projectSource?`${v.projectId} (${i4(v.projectSource)})`:G$("(none)"),Organizations:D.organizations.length.toString(),"Dashboard URL":$1()});return}if(D.credentialType==="secret"){_$({Type:`Secret key (${i4(v.tokenSource)})`,Organization:D.organization.name,"Key Name":D.keyName,"Active Project":v.projectId&&v.projectSource?`${v.projectId} (${i4(v.projectSource)})`:G$("(none)"),"Dashboard URL":$1()});return}_$({Type:`Partner key (${i4(v.tokenSource)})`,Superorganization:D.superorganization.name,"Dashboard URL":$1()})},qN=async($,v={})=>{let U=$.trim();if(!U){if(v.json)return q("Token is required.");return N("Token is required.")}let D=k(s(),"Failed to read settings",v.json);await k7({token:U,options:v,cliSettings:D,status:"saved"})},kN=($)=>{let v=process.platform,U,D;if(v==="darwin")U="open",D=[$];else if(v==="win32")U="cmd",D=["/c","start","",$];else U="xdg-open",D=[$];let _=LN(U,D,{detached:!0,stdio:"ignore"});_.on("error",()=>{}),_.unref()},HN=($)=>new Promise((v)=>setTimeout(v,$)),FN=async($={})=>{let v=k(s(),"Failed to read settings",$.json),U=Xv(v),D=v.profiles[U]??{},_=ZN(D,$.apiBaseUrl),I=MN(_,$.authBaseUrl),G;try{G=await G7({apiBaseUrl:I})}catch(Y){let P=Y instanceof Error?Y.message:String(Y);if($.json)return q(`Failed to initiate login: ${P}`);return N(`Failed to initiate login: ${P}`)}let J=TN(G.verificationUriComplete,$.webBaseUrl),X=new Date(Date.now()+G.expiresIn*1000),Q=G.interval*1000;if(!$.json)r(),Y$("Login to Sazabi"),r(),r$("Enter this code in your browser:"),r(),r$(O$.bold(G.userCode),4),r(),r$(`Opening ${O$.info(J)}`),r(),kN(J),c("Waiting for authorization...");while(new Date<X){await HN(Q);try{let Y=await J7({apiBaseUrl:I,deviceCode:G.deviceCode});if(Y.status==="pending"){Q=(Y.interval??G.interval)*1000;continue}if(Y.status==="denied"){if($.json)return q("Authorization was denied.");return r(),N("Authorization was denied.")}if(Y.status==="expired"){if($.json)return q("Authorization request expired. Please try again.");return r(),N("Authorization request expired. Please try again.")}await k7({token:Y.accessToken,options:$,cliSettings:v,status:"authorized"});return}catch(Y){let P=Y instanceof Error?Y.message:String(Y);if($.json)return q(`Authorization failed: ${P}`);return r(),N(`Authorization failed: ${P}`)}}if($.json)return q("Authorization request expired. Please try again.");return r(),N("Authorization request expired. Please try again.")},bN=($)=>{let v=k(s(),"Failed to read settings",$.json),U=k(l$(v),"Failed to resolve profile",$.json),D=Boolean(U.token),_=k(E$(v,{token:void 0,activeOrganizationId:void 0,organizationName:void 0,activeProjectId:void 0}),"Failed to update profile",$.json);if(k(J$(_),"Failed to remove credentials",$.json),$.json){M({removed:D});return}if(D){u("Logged out successfully.");return}c("No credentials were saved.")},k7=async({token:$,options:v,cliSettings:U,status:D})=>{let _=y({token:$,apiBaseUrlFlag:v.apiBaseUrl,jsonMode:v.json}),I=k(await _.me(),"Failed to resolve authenticated context",v.json);if(D==="authorized"&&I.credentialType!=="user"){if(v.json)return q("Expected a user session from device authorization.");return N("Expected a user session from device authorization.")}let G=Xv(U),J=U.profiles[G]?U:{...U,profiles:{...U.profiles,[G]:{}}},X=J.profiles[G],Q=await gN({client:_,credential:I,currentProjectId:X.activeProjectId,jsonMode:v.json}),Y=k(E$(J,{token:$,activeOrganizationId:Q.activeOrganizationId,organizationName:Q.activeOrganizationName,activeProjectId:Q.activeProjectId,apiBaseUrl:v.apiBaseUrl??X.apiBaseUrl}),"Failed to update profile",v.json);if(k(J$(Y),"Failed to save credentials",v.json),v.json){M({status:D,credential:I,activeOrganizationId:Q.activeOrganizationId,activeProjectId:Q.activeProjectId,projects:Q.projects});return}if(r(),u(D==="authorized"?"Successfully authenticated!":"Saved token."),r(),BN({credential:I,activeOrganizationName:Q.activeOrganizationName,activeProjectId:Q.activeProjectId,projects:Q.projects}),Q.projects.length>0){r(),Y$("Available Projects");for(let P of Q.projects){let O=P.id===Q.activeProjectId?O$.success(" (active)"):"";r$(`${P.name} (${P.region})${O}`)}}},gN=async({client:$,credential:v,currentProjectId:U,jsonMode:D})=>{if(v.credentialType==="partner")return{projects:[]};let _=v.credentialType==="user"?v.activeOrganizationId??v.organizations[0]?.id:v.organization.id,I=v.credentialType==="user"?v.organizations.find((J)=>J.id===_)?.name:v.organization.name,G=_?k(await $.projects.list({organizationId:_}),"Failed to fetch projects",D).projects:[];return{activeOrganizationId:_,activeOrganizationName:I,activeProjectId:SN(G,U),projects:G}},SN=($,v)=>{if(v&&$.some((U)=>U.id===v))return v;return $[0]?.id},BN=({credential:$,activeOrganizationName:v,activeProjectId:U,projects:D})=>{if($.credentialType==="user"){_$({Type:"User token",User:$.user.name??$.user.email,Organizations:$.organizations.length.toString(),"Active Organization":v??"(none)","Active Project":D.find((_)=>_.id===U)?.name??"(none)"});return}if($.credentialType==="secret"){_$({Type:"Secret key",Organization:$.organization.name,"Key Name":$.keyName,"Active Project":D.find((_)=>_.id===U)?.name??"(none)"});return}_$({Type:"Partner key",Superorganization:$.superorganization.name})},ZN=($,v)=>{return $v({cliFlag:v,globalUrl:$.apiBaseUrl,globalDomain:$.apiDomain,buildUrlFromDomain:(U)=>`https://api.${U}`,defaultUrl:"https://api.sazabi.com"})},MN=($,v)=>{if(v)return v;try{let U=new URL($);if(["localhost","127.0.0.1"].includes(U.hostname)&&["15005","15009"].includes(U.port))return U.port="15001",U.toString().replace(/\/$/,"");if(U.hostname==="api.sazabi.com")return U.hostname="api.platform.sazabi.com",U.toString().replace(/\/$/,"");if(U.hostname==="api.sazabi.dev")return U.hostname="api.platform.sazabi.dev",U.toString().replace(/\/$/,"");return U.toString().replace(/\/$/,"")}catch{return $}},TN=($,v)=>{if(!v)return $;let U=new URL($),D=new URL(v);return U.protocol=D.protocol,U.host=D.host,U.toString()},H7=o("auth","").withSubcommands({login:z("login","Authenticate via browser",async($)=>{let{values:v,positionals:U}=j($,{json:{type:"boolean"},"api-base-url":{type:"string"},"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(U.length>0){let D=U.join(", ");if(v.json)return q(`Unexpected arguments: ${D}`);return N(`Unexpected arguments: ${D}`)}await FN({json:v.json,apiBaseUrl:v["api-base-url"],authBaseUrl:v["auth-base-url"],webBaseUrl:v["web-base-url"]})}).withOptions({json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override public API base URL"},"auth-base-url":{type:"string",description:"Override Better Auth API base URL"},"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth login # Authenticate via browser","sazabi auth login --api-base-url http://localhost:15009 --auth-base-url http://localhost:15001 --web-base-url https://localhost:5173 # Authenticate against local development"]).build(),save:z("save","Save an existing bearer token",async($)=>{let{values:v,positionals:U}=j($,{json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Token is required.");return N("Token is required.")}if(U.length>1){let _=U.slice(1).join(", ");if(v.json)return q(`Unexpected arguments: ${_}`);return N(`Unexpected arguments: ${_}`)}await qN(D,{json:v.json,apiBaseUrl:v["api-base-url"]})}).withPositionalArgs("<token>").withOptions({json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi auth save sazabi_secret_xxx # Save a secret key for future commands","sazabi auth save session_token_xxx --api-base-url http://localhost:15009 # Save a token against local development"]).build(),logout:z("logout","Remove saved credentials",async($)=>{let{values:v,positionals:U}=j($,{json:{type:"boolean"}},{allowPositionals:!0});if(U.length>0){let D=U.join(", ");if(v.json)return q(`Unexpected arguments: ${D}`);return N(`Unexpected arguments: ${D}`)}bN({json:v.json})}).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi auth logout # Remove saved credentials"]).build(),whoami:z("whoami","Display current authentication context",async($)=>{let{values:v,positionals:U}=j($,{json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0});if(U.length>0){let D=U.join(", ");if(v.json)return q(`Unexpected arguments: ${D}`);return N(`Unexpected arguments: ${D}`)}await NN({json:v.json,apiBaseUrl:v["api-base-url"]})}).withOptions({json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi auth whoami # Show current context","sazabi auth whoami --json # Output as JSON"]).build()}).withExamples(["sazabi auth login # Authenticate via browser","sazabi auth save sazabi_secret_xxx # Save an existing token","sazabi auth logout # Remove saved credentials","sazabi auth whoami # Show current context"]).build();n();var F7=()=>`
|
|
398
|
+
_sazabi() {
|
|
399
|
+
local -a completions
|
|
400
|
+
local line IFS=$'\\n'
|
|
401
|
+
|
|
402
|
+
# words[1] is 'sazabi' in zsh; pass words[2] through words[CURRENT]
|
|
403
|
+
for line in $(sazabi --get-completions -- "\${words[@]:1}" 2>/dev/null); do
|
|
404
|
+
local val="\${line%%$'\\t'*}"
|
|
405
|
+
local desc="\${line#*$'\\t'}"
|
|
406
|
+
if [[ "$val" != "$desc" ]]; then
|
|
407
|
+
completions+=("\${val}:\${desc}")
|
|
408
|
+
else
|
|
409
|
+
completions+=("\${val}")
|
|
410
|
+
fi
|
|
411
|
+
done
|
|
412
|
+
|
|
413
|
+
_describe 'sazabi' completions
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
compdef _sazabi sazabi
|
|
417
|
+
`.trim(),b7=()=>`
|
|
418
|
+
_sazabi() {
|
|
419
|
+
local cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
420
|
+
local IFS=$'\\n'
|
|
421
|
+
local completions
|
|
422
|
+
|
|
423
|
+
# Pass words after 'sazabi' to the completion engine
|
|
424
|
+
completions=$(sazabi --get-completions -- "\${COMP_WORDS[@]:1}" 2>/dev/null)
|
|
425
|
+
|
|
426
|
+
COMPREPLY=()
|
|
427
|
+
local vals=()
|
|
428
|
+
while IFS=$'\\t' read -r val desc; do
|
|
429
|
+
[[ -n "$val" ]] && vals+=("$val")
|
|
430
|
+
done <<< "$completions"
|
|
431
|
+
|
|
432
|
+
COMPREPLY=($(compgen -W "\${vals[*]}" -- "$cur"))
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
complete -F _sazabi sazabi
|
|
436
|
+
`.trim();var zN=async($)=>{let{values:v}=j($,{json:{type:"boolean"}}),U=F7();if(v.json){M({shell:"zsh",script:U});return}console.log(U)},AN=async($)=>{let{values:v}=j($,{json:{type:"boolean"}}),U=b7();if(v.json){M({shell:"bash",script:U});return}console.log(U)},g7=o("completions","Shell completion scripts").withSubcommands({zsh:z("zsh","Output zsh completion script",zN).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(['eval "$(sazabi completions zsh)" # Add to .zshrc']).build(),bash:z("bash","Output bash completion script",AN).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(['eval "$(sazabi completions bash)" # Add to .bashrc']).build()}).withExamples(['eval "$(sazabi completions zsh)" # Enable zsh completions','eval "$(sazabi completions bash)" # Enable bash completions']).build();n();w$();e();var Av={token:{type:"string"},"api-base-url":{type:"string"},json:{type:"boolean"}},zv={token:{type:"string",description:"Auth token override"},"api-base-url":{type:"string",description:"API base URL override"},json:{type:"boolean",description:"Output as JSON"}},jv=($)=>{let v=$.json,U=R({tokenFlag:$.token,jsonMode:v});return{client:y({token:U.token,organizationId:U.organizationId,projectId:U.projectId,apiBaseUrlFlag:$["api-base-url"],jsonMode:v}),json:v}},jN=async($)=>{let{values:v}=j($,Av),{client:U,json:D}=jv(v),{types:_}=k(await U.dataSources.listTypes(),"Failed to list data source types",D),I=[..._].sort((G,J)=>G.name.localeCompare(J.name));if(D){M({types:I});return}a(I.map((G)=>({id:G.id,name:G.name})),[{header:"ID",key:"id"},{header:"Name",key:"name"}],{header:"Data source types"})},EN=async($)=>{let{values:v}=j($,{...Av,type:{type:"string"},"project-id":{type:"string"}}),{client:U,json:D}=jv(v),{connections:_}=k(await U.dataSources.connections.list({projectId:v["project-id"],dataSourceType:v.type}),"Failed to list connections",D);if(D){M({connections:_});return}if(_.length===0){t("No data source connections found.");return}a(_.map((I)=>({id:I.id,type:I.dataSourceType,name:I.displayName??"-",created:I$(I.createdAt)})),[{header:"ID",key:"id"},{header:"Type",key:"type"},{header:"Name",key:"name"},{header:"Created",key:"created"}],{header:"Connections"})},xN=async($)=>{let{values:v,positionals:U}=j($,Av,{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Connection ID is required.");return N("Connection ID is required.")}let{client:_,json:I}=jv(v),{connection:G}=k(await _.dataSources.connections.get(D),"Failed to get connection",I);if(I){M({connection:G});return}Y$("Connection"),_$({ID:G.id,Type:G.dataSourceType,Name:G.displayName??"-",Project:G.projectId,Created:I$(G.createdAt)})},RN=async($)=>{let{values:v}=j($,{...Av,type:{type:"string"},metadata:{type:"string"},"display-name":{type:"string"},"project-id":{type:"string"}});if(!v.type){if(v.json)return q("--type is required.");return N("--type is required. Use 'sazabi data-sources types' to see available types.")}if(!v.metadata){if(v.json)return q("--metadata is required.");return N("--metadata is required. Pass a JSON object with the required fields.")}let U;try{U=JSON.parse(v.metadata)}catch{if(v.json)return q("--metadata must be valid JSON.");return N("--metadata must be valid JSON.")}let{client:D,json:_}=jv(v),I=k(await D.dataSources.connections.create({dataSourceType:v.type,metadata:U,displayName:v["display-name"],projectId:v["project-id"]}),"Failed to create connection",_);if(_){M(I);return}u("Connection created."),_$({"Connection ID":I.connectionId,"Public key":I.publicKey})},CN=async($)=>{let{values:v}=j($,{...Av,"connection-id":{type:"string"}});if(!v["connection-id"]){if(v.json)return q("--connection-id is required.");return N("--connection-id is required.")}let{client:U,json:D}=jv(v),{streams:_}=k(await U.dataSources.streams.list(v["connection-id"]),"Failed to list streams",D);if(D){M({streams:_});return}if(_.length===0){t("No streams found for this connection.");return}a(_.map((I)=>({id:I.id,name:I.displayName,status:I.status,error:I.errorMessage??"-",created:I$(I.createdAt)})),[{header:"ID",key:"id"},{header:"Name",key:"name"},{header:"Status",key:"status"},{header:"Error",key:"error"},{header:"Created",key:"created"}],{header:"Streams"})},uN=async($)=>{let{values:v}=j($,{...Av,"connection-id":{type:"string"},"display-name":{type:"string"},config:{type:"string"}});if(!v["connection-id"]){if(v.json)return q("--connection-id is required.");return N("--connection-id is required.")}if(!v["display-name"]){if(v.json)return q("--display-name is required.");return N("--display-name is required.")}let U={};if(v.config)try{U=JSON.parse(v.config)}catch{if(v.json)return q("--config must be valid JSON.");return N("--config must be valid JSON.")}let{client:D,json:_}=jv(v),I=k(await D.dataSources.streams.create({connectionId:v["connection-id"],displayName:v["display-name"],config:U}),"Failed to create stream",_);if(_){M(I);return}u("Stream created. Provisioning started."),_$({"Stream ID":I.streamId})},yN=async($)=>{let{values:v,positionals:U}=j($,Av,{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Stream ID is required.");return N("Stream ID is required.")}let{client:_,json:I}=jv(v),{stream:G}=k(await _.dataSources.streams.get(D),"Failed to get stream",I);if(I){M({stream:G});return}Y$("Stream"),_$({ID:G.id,Connection:G.connectionId,Name:G.displayName,Status:G.status,Error:G.errorMessage??"-",Created:I$(G.createdAt)})},fN=async($)=>{let{values:v}=j($,{...Av,type:{type:"string"}});if(!v.type){if(v.json)return q("--type is required.");return N("--type is required. Use 'sazabi data-sources types' to see types with skills.")}let{client:U,json:D}=jv(v),{types:_}=k(await U.dataSources.listTypes(),"Failed to list data source types",D),I=_.find((G)=>G.id===v.type);if(!I){if(D)return q(`Unknown data source type: ${v.type}`);return N(`Unknown data source type: ${v.type}`)}if(!I.setupSkill){if(D)return q(`No setup skill available for ${v.type}.`);return N(`No setup skill available for ${v.type}. This data source does not have an agent-ready skill yet.`)}if(D){M({type:I.id,setupSkill:I.setupSkill});return}console.log(I.setupSkill)},S7=o("data-sources","Manage data source connections and streams").withSubcommands({types:z("types","List supported data source types",jN).withOptions(zv).withExamples(["sazabi data-sources types # List all types","sazabi data-sources types --json # Output as JSON"]).build(),connections:z("connections","Manage data source connections").withSubcommands({list:z("list","List data source connections",EN).withOptions({...zv,type:{type:"string",description:"Filter by data source type"},"project-id":{type:"string",description:"Project ID"}}).withExamples(["sazabi data-sources connections list # List all connections","sazabi data-sources connections list --type vercel # Filter by type"]).build(),get:z("get","Get one data source connection",xN).withPositionalArgs("<connection-id>").withOptions(zv).withExamples(["sazabi data-sources connections get <id> # Get connection details"]).build(),create:z("create","Create a data source connection",RN).withOptions({...zv,type:{type:"string",description:"Data source type (required)"},metadata:{type:"string",description:"JSON metadata (required)"},"display-name":{type:"string",description:"Human-readable name"},"project-id":{type:"string",description:"Project ID"}}).withExamples([`sazabi data-sources connections create --type fly_io --metadata '{"apiToken":"..."}' # Create Fly.io connection`]).build()}).withExamples(["sazabi data-sources connections list # List all connections","sazabi data-sources connections list --type vercel # Filter by type"]).build(),streams:z("streams","Manage data source streams").withSubcommands({list:z("list","List streams for a connection",CN).withOptions({...zv,"connection-id":{type:"string",description:"Connection ID (required)"}}).withExamples(["sazabi data-sources streams list --connection-id <id> # List streams"]).build(),get:z("get","Get one stream (check provisioning status)",yN).withPositionalArgs("<stream-id>").withOptions(zv).withExamples(["sazabi data-sources streams get <id> # Check stream status"]).build(),create:z("create","Create a stream for a connection",uN).withOptions({...zv,"connection-id":{type:"string",description:"Connection ID (required)"},"display-name":{type:"string",description:"Resource name (required)"},config:{type:"string",description:"JSON stream config"}}).withExamples(['sazabi data-sources streams create --connection-id <id> --display-name "my-app" # Create stream']).build()}).withExamples(["sazabi data-sources streams list --connection-id <id> # List streams"]).build(),skill:z("skill","Show setup skill for a data source type",fN).withOptions({...zv,type:{type:"string",description:"Data source type (required)"}}).withExamples(["sazabi data-sources skill --type gcp # Show GCP setup skill","sazabi data-sources skill --type fly_io # Show Fly.io setup skill"]).build()}).withExamples(["sazabi data-sources types # List available types","sazabi data-sources connections create --type fly_io --metadata '{...}' # Create connection","sazabi data-sources streams list --connection-id <id> # List streams","sazabi data-sources skill --type gcp # Show agent setup skill"]).build();n();w$();e();var cN=async($,v)=>{let U=R({tokenFlag:v.token,projectIdFlag:$==="public"?v.projectId:void 0,jsonMode:v.json}),D=y({token:U.token,organizationId:U.organizationId,projectId:$==="public"?U.projectId:void 0,apiBaseUrlFlag:v.apiBaseUrl,jsonMode:v.json});if($==="public"){let I=k(await D.publicKeys.list({projectId:U.projectId,limit:v.limit,cursor:v.cursor}),"Failed to list public keys",v.json);if(v.json){M(I);return}B7($,I.publicKeys);return}let _=k(await D.secretKeys.list({limit:v.limit,cursor:v.cursor}),"Failed to list secret keys",v.json);if(v.json){M(_);return}B7($,_.secretKeys)},hN=async($,v,U)=>{let D=R({tokenFlag:U.token,projectIdFlag:$==="public"?U.projectId:void 0,jsonMode:U.json}),_=y({token:D.token,organizationId:D.organizationId,projectId:$==="public"?D.projectId:void 0,apiBaseUrlFlag:U.apiBaseUrl,jsonMode:U.json});if($==="public"){let G=k(await _.publicKeys.get(v,D.projectId),"Failed to get public key",U.json);if(U.json){M(G);return}n4($,G.publicKey);return}let I=k(await _.secretKeys.get(v),"Failed to get secret key",U.json);if(U.json){M(I);return}n4($,I.secretKey)},rN=async($,v,U)=>{let D=R({tokenFlag:U.token,projectIdFlag:$==="public"?U.projectId:void 0,jsonMode:U.json}),_=y({token:D.token,organizationId:D.organizationId,projectId:$==="public"?D.projectId:void 0,apiBaseUrlFlag:U.apiBaseUrl,jsonMode:U.json});if($==="public"){let J={projectId:D.projectId,name:v,...U.expiresAt?{expiresAt:U.expiresAt}:{}},X=k(await _.publicKeys.create(J),"Failed to create public key",U.json);if(U.json){M(X);return}u(`Created public key ${X.publicKey.name}.`),_$({Value:X.publicKey.value}),n4($,X.publicKey);return}let I={name:v,...U.expiresAt?{expiresAt:U.expiresAt}:{}},G=k(await _.secretKeys.create(I),"Failed to create secret key",U.json);if(U.json){M(G);return}u(`Created secret key ${G.secretKey.name}.`),_$({Value:G.secretKey.value}),n4($,G.secretKey)},mN=async($,v,U)=>{if(U.name===void 0&&U.expiresAt===void 0&&!U.clearExpiresAt){if(U.json)return q("At least one update is required. Pass --name, --expires-at, or --clear-expires-at.");return N("At least one update is required. Pass --name, --expires-at, or --clear-expires-at.")}if(U.expiresAt&&U.clearExpiresAt){if(U.json)return q("Use either --expires-at or --clear-expires-at, not both.");return N("Use either --expires-at or --clear-expires-at, not both.")}let D=R({tokenFlag:U.token,projectIdFlag:$==="public"?U.projectId:void 0,jsonMode:U.json}),_=y({token:D.token,organizationId:D.organizationId,projectId:$==="public"?D.projectId:void 0,apiBaseUrlFlag:U.apiBaseUrl,jsonMode:U.json}),I=U.clearExpiresAt?null:U.expiresAt!==void 0?U.expiresAt:void 0;if($==="public"){let X={projectId:D.projectId,keyId:v,...U.name!==void 0?{name:U.name}:{},...I!==void 0?{expiresAt:I}:{}},Q=k(await _.publicKeys.update(X),"Failed to update public key",U.json);if(U.json){M(Q);return}u(`Updated public key ${Q.publicKey.name}.`),n4($,Q.publicKey);return}let G={keyId:v,...U.name!==void 0?{name:U.name}:{},...I!==void 0?{expiresAt:I}:{}},J=k(await _.secretKeys.update(G),"Failed to update secret key",U.json);if(U.json){M(J);return}u(`Updated secret key ${J.secretKey.name}.`),n4($,J.secretKey)},lN=async($,v,U)=>{let D=R({tokenFlag:U.token,projectIdFlag:$==="public"?U.projectId:void 0,jsonMode:U.json}),_=y({token:D.token,organizationId:D.organizationId,projectId:$==="public"?D.projectId:void 0,apiBaseUrlFlag:U.apiBaseUrl,jsonMode:U.json});if($==="public")k(await _.publicKeys.delete({projectId:D.projectId,keyId:v}),"Failed to delete public key",U.json);else k(await _.secretKeys.delete({keyId:v}),"Failed to delete secret key",U.json);if(U.json){M({deleted:!0,keyId:v});return}u(`Deleted ${$} key ${v}.`)},Z7=($)=>{let v=iN($),U=Kw($),D=`${U} Keys`,_=$==="secret",I=_?"the organization":"the active project",G={token:{type:"string"},"project-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},Q=_?{token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}:{token:{type:"string",description:"Override token"},"project-id":{type:"string",description:"Override project selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}};return o(v,"").withSubcommands({list:z("list",`List ${$} keys in ${I}`,async(Y)=>{let{values:P,positionals:V}=j(Y,{...G,limit:{type:"string"},cursor:{type:"string"}},{allowPositionals:!0});if(V.length>0){let O=V.join(", ");if(P.json)return q(`Unexpected arguments: ${O}`);return N(`Unexpected arguments: ${O}`)}await cN($,{token:P.token,projectId:P["project-id"],limit:P.limit?Number(P.limit):void 0,cursor:P.cursor,json:P.json,apiBaseUrl:P["api-base-url"]})}).withOptions({...Q,limit:{type:"string",description:"Maximum number of keys to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples([`sazabi ${v} list # List ${$} keys in ${I}`]).build(),get:z("get",`Get one ${$} key by ID`,async(Y)=>{let{values:P,positionals:V}=j(Y,G,{allowPositionals:!0}),O=V[0];if(!O){let S=`${U} key ID is required.`;if(P.json)return q(S);return N(S)}await hN($,O,{token:P.token,projectId:P["project-id"],json:P.json,apiBaseUrl:P["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(Q).withExamples([`sazabi ${v} get <key-id> # Get one ${$} key`]).build(),create:z("create",`Create one ${$} key in ${I}`,async(Y)=>{let{values:P,positionals:V}=j(Y,{...G,"expires-at":{type:"string"}},{allowPositionals:!0}),O=V.join(" ");if(!O){let S=`${U} key name is required.`;if(P.json)return q(S);return N(S)}await rN($,O,{token:P.token,projectId:P["project-id"],expiresAt:P["expires-at"],json:P.json,apiBaseUrl:P["api-base-url"]})}).withPositionalArgs("<name>").withOptions({...Q,"expires-at":{type:"string",description:"Optional ISO timestamp when the key should expire"}}).withExamples([`sazabi ${v} create "CI agent" # Create one ${$} key`]).build(),update:z("update",`Update one ${$} key in ${I}`,async(Y)=>{let{values:P,positionals:V}=j(Y,{...G,name:{type:"string"},"expires-at":{type:"string"},"clear-expires-at":{type:"boolean"}},{allowPositionals:!0}),O=V[0];if(!O){let S=`${U} key ID is required.`;if(P.json)return q(S);return N(S)}await mN($,O,{token:P.token,projectId:P["project-id"],name:P.name,expiresAt:P["expires-at"],clearExpiresAt:P["clear-expires-at"],json:P.json,apiBaseUrl:P["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions({...Q,name:{type:"string",description:`New ${$} key name`},"expires-at":{type:"string",description:"New ISO timestamp when the key should expire"},"clear-expires-at":{type:"boolean",description:"Clear any configured expiration"}}).withExamples([`sazabi ${v} update <key-id> --name "Renamed key" # Update one ${$} key`]).build(),delete:z("delete",`Delete one ${$} key from ${I}`,async(Y)=>{let{values:P,positionals:V}=j(Y,G,{allowPositionals:!0}),O=V[0];if(!O){let S=`${U} key ID is required.`;if(P.json)return q(S);return N(S)}await lN($,O,{token:P.token,projectId:P["project-id"],json:P.json,apiBaseUrl:P["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(Q).withExamples([`sazabi ${v} delete <key-id> # Delete one ${$} key`]).build()}).withExamples([`sazabi ${v} list # List ${$} keys in ${I}`,`sazabi ${v} create "CI agent" # Create one ${$} key`]).build()},B7=($,v)=>{if(v.length===0){t(`No ${$} keys found.`);return}a(v.map((U)=>({id:n$(U.id),name:U.name,expiresAt:cU(U.expiresAt),lastUsedAt:cU(U.lastUsedAt),createdAt:I$(U.createdAt)})),[{header:"ID",key:"id"},{header:"Name",key:"name"},{header:"Expires",key:"expiresAt"},{header:"Last Used",key:"lastUsedAt"},{header:"Created",key:"createdAt"}],{header:`${Kw($)} Keys`})},n4=($,v)=>{let U={Type:`${Kw($)} key`,ID:v.id};if("projectId"in v&&v.projectId)U["Project ID"]=v.projectId;U.Name=v.name,U.Expires=cU(v.expiresAt),U["Last Used"]=cU(v.lastUsedAt),U.Created=I$(v.createdAt),_$(U)},cU=($)=>{return $?I$($):G$("(never)")},iN=($)=>{return $==="public"?"public-keys":"secret-keys"},Kw=($)=>{return $==="public"?"Public":"Secret"},M7=Z7("public"),T7=Z7("secret");n();var Z$=($,v,U,D,_)=>{let I=Number.parseInt($,10);if(Number.isNaN(I)||I<v||I>U){let G=`${D} must be between ${v} and ${U}`;if(_)return q(G);return N(G)}return I},v1=($,v,U,D)=>{if(!v.includes($)){let _=v.map((G)=>`"${G}"`).join(" or "),I=`${U} must be ${_}`;if(D)return q(I);return N(I)}return $};n();vw();s6();w$();import*as vv from"node:fs";import*as rU from"node:readline";var hU=($)=>new Promise((v)=>setTimeout(v,$));var nN=($)=>{return`${$.getTime()*1e6}`},z7=($,v)=>{let D=nN(new Date),_=$.filter((I)=>I.trim().length>0).map((I)=>({timeUnixNano:D,observedTimeUnixNano:D,severityNumber:9,severityText:"INFO",body:{stringValue:I},attributes:[]}));return{resourceLogs:[{resource:{attributes:[{key:"service.name",value:{stringValue:"sazabi-cli"}},{key:"sazabi.public_key",value:{stringValue:v}}]},scopeLogs:[{scope:{name:"sazabi-cli-forward",version:"1.0.0"},logRecords:_}]}]}};e();h$();var dN="15003",oN=($)=>{return $.startsWith("[")&&$.endsWith("]")?$.slice(1,-1):$},tN=($)=>{let v=oN($);return v==="localhost"||v==="127.0.0.1"||v==="::1"},pN=($)=>{let v=(()=>{try{return new URL($)}catch{return null}})();if(!v)return;if(!tN(v.hostname))return;return v.protocol="http:",v.port=dN,v.pathname="",v.search="",v.hash="",v.toString()},aN=async($,v)=>{if(!v)c("Ensuring public key exists...");let U=await $.publicKeys.create({name:"sazabi-cli-forward"});if(!U.success){if(!v)Pv(`Failed to create public key: ${U.error}`);return null}if(!v)u(`Created new public key: ${U.value.publicKey.name}`);return U.value.publicKey.value},Vw=($,v,U,D,_,I,G,J)=>{return async()=>{if($.length===0)return;let X=z7($,D),Q=v3(X);if($.length=0,Q===0)return;if(!G)c(`Forwarding ${Q} logs...`);let Y=await U.logs.forward({publicKey:D,logs:X,region:_,...I?{projectId:I}:{}});if(!Y.success){if(_3(Y)){k(Y,"Failed to forward logs",G);return}if(v.totalFailed+=Q,!G)Kv(`Failed to forward logs: ${Y.error}`);J?.({forwarded:0,failed:Q});return}v.totalForwarded+=Y.value.forwardedCount,v.totalFailed+=Y.value.failedCount,J?.({forwarded:Y.value.forwardedCount,failed:Y.value.failedCount})}},eN=async($,v,U,D,_,I,G,J)=>{let X=vv.createReadStream($),Q=rU.createInterface({input:X,crlfDelay:Number.POSITIVE_INFINITY}),Y=[],P={totalForwarded:0,totalFailed:0},V=Vw(Y,P,v,U,D,_,G,(O)=>J?.push(O));try{for await(let O of Q)if(Y.push(O),Y.length>=I)await V()}catch(O){Pv(`Failed to read ${$}: ${O instanceof Error?O.message:String(O)}`);return}if(await V(),G);else if(r(),H$(O$.muted("─".repeat(80))),u(`Forwarded ${P.totalForwarded} logs`),P.totalFailed>0)Kv(`Failed to forward ${P.totalFailed} logs`)},sN=async($,v,U,D,_,I,G)=>{let J=rU.createInterface({input:process.stdin,output:process.stdout,terminal:!1}),X=[],Q={totalForwarded:0,totalFailed:0},Y=Vw(X,Q,$,v,U,D,I,(P)=>G?.push(P));try{for await(let P of J)if(X.push(P),X.length>=_)await Y()}catch(P){Pv(`Failed to read from stdin: ${P instanceof Error?P.message:String(P)}`);return}if(await Y(),I);else if(r(),H$(O$.muted("─".repeat(80))),u(`Forwarded ${Q.totalForwarded} logs`),Q.totalFailed>0)Kv(`Failed to forward ${Q.totalFailed} logs`)},$3=async($,v,U,D,_,I,G,J)=>{let X=[],Q={totalForwarded:0,totalFailed:0},Y=Vw(X,Q,v,U,D,_,G,($$)=>J?.push($$)),P=null,V=null,O=async()=>{if(V)clearTimeout(V);if(P)P.close();if(await Y(),G);else if(r(),H$(O$.muted("─".repeat(80))),u(`Forwarded ${Q.totalForwarded} logs`),Q.totalFailed>0)Kv(`Failed to forward ${Q.totalFailed} logs`)};process.on("SIGINT",async()=>{r(),c("Interrupted, flushing remaining logs..."),await O(),process.exit(0)});let S=null,B=null,h=!1,p=0,X$=async()=>{if(h)return;h=!0;try{if((await vv.promises.stat($)).size<p)p=0;S=vv.createReadStream($,{encoding:"utf8",start:p}),B=rU.createInterface({input:S,crlfDelay:Number.POSITIVE_INFINITY});for await(let M$ of B)if(X.push(M$),X.length>=I)await Y();p=(await vv.promises.stat($)).size}catch($$){Pv(`Failed to read ${$}: ${$$ instanceof Error?$$.message:String($$)}`)}finally{h=!1}};await X$(),P=vv.watch($,async($$)=>{if($$==="change"){if(V)clearTimeout(V);V=setTimeout(async()=>{if(h)return;if(S)S.close();if(B)B.close();await hU(50),await X$()},100)}})},A7=async($)=>{let v=$.batchSize??100;if(v<=0){if($.json)return q("Batch size must be a positive number");throw N("Batch size must be a positive number"),Error("Unreachable")}if($.follow&&!$.file){if($.json)return q("--follow flag requires --file to be specified");throw N("--follow flag requires --file to be specified"),Error("Unreachable")}let U=(()=>{let B=s();if(!B.success)throw N(`Failed to read settings: ${B.error}`),Error("Unreachable");return B.value})(),D=k(l$(U),"Failed to resolve profile"),_=$.json===!0,I=R({tokenFlag:$.token,jsonMode:_}),G=$v({cliFlag:$.apiBaseUrl,globalUrl:D.apiBaseUrl,globalDomain:D.apiDomain,buildUrlFromDomain:(B)=>`https://api.${B}`,defaultUrl:"https://api.sazabi.com"});if(!_)Y$("Forwarding logs...");let J=await uU({token:I.token,projectId:I.projectId,apiBaseUrlFlag:$.apiBaseUrl,jsonMode:_});if(!_)c(`Project: ${J.name}`);let X;if($.region)X=U3($.region,_);else X=J.region;if(!_)c(`Region: ${X}`);if(!_)c(`Batch size: ${v}`);let Q=$.intakeBaseUrl??D.intakeBaseUrl??pN(G)??(D.intakeDomain?L7(D.intakeDomain,X):void 0)??`https://otlp.${X}.intake.sazabi.com`;try{let B=new URL(Q);if(!_&&/\.intake\.sazabi\.(dev|com)$/.test(B.host)&&!B.host.startsWith("otlp."))Kv("Intake base URL may not be the OTLP endpoint. For Sazabi, prefer https://otlp.{region}.intake.sazabi.dev or .com as appropriate.")}catch{}let Y=Jv({token:I.token,projectId:I.projectId,baseUrl:G,intakeBaseUrl:Q}),P=$.publicKey?.trim()||D.forwardPublicKey?.trim()||void 0;if(!P){let B=await aN(Y,_);if(!B)throw N("Failed to get or create public key"),Error("Unreachable");P=B;let h=E$(U,{forwardPublicKey:P});if(h.success){let p=J$(h.value);if(!p.success)Kv(`Failed to store public key: ${p.error}`)}}if(!_)r(),H$(O$.muted("─".repeat(80))),r();let V=!$.follow,O=[],S={forwarded:0,failed:0};if($.follow&&$.file)await $3($.file,Y,P,X,I.projectId,v,_,V?O:void 0);else if($.file)await eN($.file,Y,P,X,I.projectId,v,_,O);else await sN(Y,P,X,I.projectId,v,_,O);for(let B of O)S.forwarded+=B.forwarded,S.failed+=B.failed;if(_){let B={forwardedCount:S.forwarded,failedCount:S.failed,batches:O,project:{id:J.id,name:J.name,region:X},intakeBaseUrl:Q,batchSize:v,follow:Boolean($.follow),file:$.file??void 0};console.log(JSON.stringify(B))}},v3=($)=>{return $.resourceLogs?.reduce((v,U)=>v+(U.scopeLogs?.reduce((D,_)=>D+(_.logRecords?.length??0),0)??0),0)??0},_3=($)=>{if($.success)return!1;if($.errorPayload)return!0;if($.statusCode!==void 0&&$.statusCode<500)return!0;return $.error.startsWith("Authentication failed")||$.error.startsWith("Client error (")},U3=($,v)=>{let U=jU.safeParse($);if(U.success)return U.data;let D=`Invalid region: ${$}.`;if(v)return q(D);return N(D)};n();_w();s6();w$();e();h$();var j7=["ERROR","WARN","INFO","DEBUG","TRACE"],D3="15006",I3=($)=>{return $.startsWith("[")&&$.endsWith("]")?$.slice(1,-1):$},G3=($)=>{let v=I3($);return v==="localhost"||v==="127.0.0.1"||v==="::1"},J3=($)=>{let v=new Date($.timestamp).toISOString().split("T")[1],U=pU($.severity,$.severity.padEnd(7)),D=O$.cyan($.service.padEnd(20)),_=$.body.length>120?`${$.body.substring(0,117)}...`:$.body;return`[${v}] ${U} ${D} ${_}`},x7=async($)=>{let v=k(Qv(),"Failed to read settings"),U=$.json??!1,D=Q3(v,$.apiBaseUrl),_=X3($.severities,U),I=Ow($.services),G=Ow($.environments),J=R({tokenFlag:$.token,jsonMode:U}),X=await K3({apiBaseUrlFlag:$.apiBaseUrl,jsonMode:U,projectId:J.projectId,regionFlag:$.region,token:J.token}),Q=Jv({token:J.token,projectId:J.projectId,baseUrl:D,tailBaseUrl:P3(v,$.tailBaseUrl,X,D)}),Y={severities:_,services:I,environments:G,searchTerm:$.search,traceId:$.traceId},P=new AbortController,V,O=0,S,B,h=()=>{V="interrupted",P.abort()};if(!U)w3({environments:G,region:X,search:$.search,services:I,severities:_,traceId:$.traceId});let p=k(await Q.logs.tail({...J.projectId?{projectId:J.projectId}:{},...X?{region:X}:{},filters:Y,signal:P.signal}),"Failed to tail logs",U);if(!U)u("Connected! Waiting for logs..."),r();if(process.on("SIGINT",h),$.duration&&$.duration>0)B=setTimeout(()=>{V="duration",P.abort()},$.duration*1000);try{for await(let X$ of p){if(O+=1,U){M(X$);continue}H$(J3(X$))}}catch(X$){S=X$ instanceof Error?X$:Error(String(X$))}finally{if(process.removeListener("SIGINT",h),B)clearTimeout(B)}if(S){if(U)return q(S.message);r(),J1(),Pv(S.message);return}if(U)return;if(r(),V==="duration")c("Duration reached, closing connection...");if(V==="interrupted")c("Interrupted, closing connection...");J1(),c(`Connection closed. Received ${O} logs.`)},w3=($)=>{if(Y$("Tailing logs..."),$.severities?.length)c(`Severities: ${$.severities.join(", ")}`);if($.services?.length)c(`Services: ${$.services.join(", ")}`);if($.environments?.length)c(`Environments: ${$.environments.join(", ")}`);if($.search)c(`Search: ${$.search}`);if($.traceId)c(`Trace ID: ${$.traceId}`);if($.region)c(`Region: ${$.region}`);J1(),r()},Ow=($)=>{if(!$)return;let v=$.split(",").map((U)=>U.trim()).filter((U)=>U.length>0);return v.length>0?v:void 0},X3=($,v)=>{let U=Ow($)?.map((I)=>I.toUpperCase());if(!U)return;let D=U.find((I)=>!j7.includes(I));if(!D)return U;let _=`Invalid severity: ${D}. Valid values: ${j7.join(", ")}`;if(v)return q(_);return N(_)},Q3=($,v)=>{return $v({cliFlag:v,globalUrl:$.apiBaseUrl,globalDomain:$.apiDomain,buildUrlFromDomain:(U)=>`https://api.${U}`,defaultUrl:"https://api.sazabi.com"})},Y3=($)=>{let v=(()=>{try{return new URL($)}catch{return null}})();if(!v)return;if(!G3(v.hostname))return;return v.protocol="ws:",v.port=D3,v.pathname="/tail",v.search="",v.hash="",v.toString()},P3=($,v,U,D)=>{if(v)return v;if($.tailBaseUrl)return $.tailBaseUrl;let _=Y3(D);if(_)return _;if($.tailDomain&&U)return`wss://${U}.tail.${$.tailDomain}`;if(U)return`wss://${U}.tail.sazabi.com`;return},K3=async($)=>{if($.regionFlag)return E7($.regionFlag,$.jsonMode);if(!$.projectId)return;let v=await uU({token:$.token,projectId:$.projectId,apiBaseUrlFlag:$.apiBaseUrlFlag,jsonMode:$.jsonMode});return E7(v.region,$.jsonMode)},E7=($,v)=>{if(RU($))return $;let U=`Log tail is not supported for project region ${$}.`;if(v)return q(U);return N(U)};var R7=o("logs","").withSubcommands({tail:z("tail","Stream logs from current project in real-time",async($)=>{let{values:v}=j($,{token:{type:"string"},severities:{type:"string"},services:{type:"string"},environments:{type:"string"},search:{type:"string"},"trace-id":{type:"string"},duration:{type:"string"},json:{type:"boolean"},"tail-base-url":{type:"string"},region:{type:"string"},"api-base-url":{type:"string"}}),U={};if(v.token)U.token=v.token;if(v.severities)U.severities=v.severities;if(v.services)U.services=v.services;if(v.environments)U.environments=v.environments;if(v.search)U.search=v.search;if(v["trace-id"])U.traceId=v["trace-id"];if(v.duration)U.duration=Z$(v.duration,1,Number.MAX_SAFE_INTEGER,"Duration",v.json);if(v.json)U.json=!0;if(v["tail-base-url"])U.tailBaseUrl=v["tail-base-url"];if(v.region)U.region=v.region;if(v["api-base-url"])U.apiBaseUrl=v["api-base-url"];await x7(U)}).withOptions({token:{type:"string",description:"Override authentication token"},severities:{type:"string",description:"Filter by comma-separated severities (e.g., ERROR,WARN,INFO)"},services:{type:"string",description:"Filter by comma-separated service names"},environments:{type:"string",description:"Filter by comma-separated environments"},search:{type:"string",description:"Filter by search term (case-insensitive)"},"trace-id":{type:"string",description:"Filter by trace ID"},duration:{type:"string",description:"Duration to tail in seconds (default: unlimited)"},json:{type:"boolean",description:"Output as JSON (default: pretty-print)"},"tail-base-url":{type:"string",description:"Override tail WebSocket base URL"},region:{type:"string",description:"Override project region"},"api-base-url":{type:"string",description:"Override API base URL (for project lookup)"}}).withExamples(["sazabi logs tail # Tail all logs in real-time","sazabi logs tail --severities ERROR,WARN # Tail only errors and warnings","sazabi logs tail --services api,worker # Tail specific services","sazabi logs tail --environments production,staging # Tail specific environments",'sazabi logs tail --search "database" # Tail logs matching search term',"sazabi logs tail --json # Output as JSON"]).build(),forward:z("forward","Forward plaintext logs to current project",async($)=>{let{values:v}=j($,{token:{type:"string"},file:{type:"string",short:"f"},follow:{type:"boolean"},"batch-size":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"},"intake-base-url":{type:"string"},"public-key":{type:"string"},region:{type:"string"}}),U={};if(v.token)U.token=v.token;if(v.file)U.file=v.file;if(v.follow)U.follow=v.follow;if(v["batch-size"])U.batchSize=Z$(v["batch-size"],1,Number.MAX_SAFE_INTEGER,"Batch size",v.json);if(v["api-base-url"])U.apiBaseUrl=v["api-base-url"];if(v["intake-base-url"])U.intakeBaseUrl=v["intake-base-url"];if(v.region)U.region=v.region;if(v["public-key"])U.publicKey=v["public-key"];await A7({...U,json:v.json})}).withOptions({token:{type:"string",description:"Override authentication token"},file:{type:"string",short:"f",description:"Read from file instead of stdin"},follow:{type:"boolean",description:"Follow file for new lines (like tail -f)"},"batch-size":{type:"string",description:"Number of logs to batch before sending (default: 100)"},json:{type:"boolean",description:"Output a final JSON summary"},"api-base-url":{type:"string",description:"Override API base URL"},"intake-base-url":{type:"string",description:"Override intake base URL"},"public-key":{type:"string",description:"Use this public key value (skip creating/storing)"},region:{type:"string",description:"Override project region"}}).withExamples(['echo "Log message" | sazabi logs forward # Forward from stdin',"sazabi logs forward --file app.log # Forward from file","sazabi logs forward --file app.log --follow # Forward file with tail -f behavior","sazabi logs forward --file app.log --batch-size 50 # Forward with custom batch size"]).build()}).withExamples(["sazabi logs tail # Tail all logs in real-time","sazabi logs tail --severities ERROR,WARN # Tail only errors and warnings","sazabi logs forward --file app.log # Forward from file"]).build();n();w$();e();var V3=async($)=>{let v=R({tokenFlag:$.token,organizationIdFlag:$.organizationId,jsonMode:$.json}),U=y({token:v.token,organizationId:v.organizationId,projectId:v.projectId,apiBaseUrlFlag:$.apiBaseUrl,jsonMode:$.json}),D=k(await U.members.list({organizationId:v.organizationId}),"Failed to list members",$.json);if($.json){M(D);return}if(D.members.length===0){t("No members found.");return}a(D.members.map((_)=>({membershipId:_.membershipId,userId:_.userId,name:_.name??"",email:_.email,role:_.role})),[{header:"Membership ID",key:"membershipId"},{header:"User ID",key:"userId"},{header:"Name",key:"name"},{header:"Email",key:"email"},{header:"Role",key:"role"}],{header:"Members"})},O3=async($,v)=>{let U=R({tokenFlag:v.token,organizationIdFlag:v.organizationId,jsonMode:v.json}),D=y({token:U.token,organizationId:U.organizationId,projectId:U.projectId,apiBaseUrlFlag:v.apiBaseUrl,jsonMode:v.json}),_=k(await D.members.updateRole($,v.role,U.organizationId),"Failed to update member role",v.json);if(v.json){M(_);return}u(`Updated ${_.member.email} to ${_.member.role} in the active organization.`)},W3=async($,v)=>{let U=R({tokenFlag:v.token,organizationIdFlag:v.organizationId,jsonMode:v.json}),D=y({token:U.token,organizationId:U.organizationId,projectId:U.projectId,apiBaseUrlFlag:v.apiBaseUrl,jsonMode:v.json}),_=k(await D.members.remove($,U.organizationId),"Failed to remove member",v.json);if(v.json){M(_);return}u(`Removed ${_.removedUserId} from the active organization.`)},C7=o("members","").withSubcommands({list:z("list","List members in the active organization",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},"organization-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0});if(U.length>0){let D=U.join(", ");if(v.json)return q(`Unexpected arguments: ${D}`);return N(`Unexpected arguments: ${D}`)}await V3({token:v.token,organizationId:v["organization-id"],json:v.json,apiBaseUrl:v["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi members list # List members in the active organization"]).build(),"update-role":z("update-role","Update one member's organization role",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},"organization-id":{type:"string"},role:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("User ID is required.");return N("User ID is required.")}if(v.role!=="admin"&&v.role!=="member"){if(v.json)return q("Role must be either 'admin' or 'member'.");return N("Role must be either 'admin' or 'member'.")}await O3(D,{token:v.token,organizationId:v["organization-id"],role:v.role,json:v.json,apiBaseUrl:v["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},role:{type:"string",description:"New role: admin or member"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi members update-role user_123 --role admin # Promote a member to admin"]).build(),remove:z("remove","Remove one member from the active organization",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},"organization-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("User ID is required.");return N("User ID is required.")}await W3(D,{token:v.token,organizationId:v["organization-id"],json:v.json,apiBaseUrl:v["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi members remove user_123 # Remove a member from the active organization"]).build()}).withExamples(["sazabi members list # List members in the active organization","sazabi members update-role user_123 --role admin # Promote a member to admin","sazabi members remove user_123 # Remove a member from the active organization"]).build();n();w$();e();n();w$();e();e();var L3=2000,mU=async($)=>{let v=$.pollIntervalMs??L3,U=Date.now(),D=!1,_={completed:!1,threadId:$.threadId,runId:$.runId,status:"processing",response:null};while(!0){let I=await $.client.runs.get($.runId);if(!I.success){if(!q3(I))return Ww($.printProgress,D),I}else if(_=I.value,I.value.completed)return Ww($.printProgress,D),I;if($.timeoutMs!==void 0&&Date.now()-U>=$.timeoutMs)return Ww($.printProgress,D),c$(_);D=N3($.printProgress,D),await hU(v)}},N3=($,v)=>{if(!$)return v;if(!v)process.stdout.write(`
|
|
437
|
+
`);return process.stdout.write("."),!0},Ww=($,v)=>{if(!$||!v)return;process.stdout.write(`
|
|
438
|
+
`)},q3=($)=>{return $.statusCode===404};var h7=async($,v={})=>{let U=Date.now(),D=R({tokenFlag:v.token,jsonMode:v.json}),_=y({token:D.token,projectId:D.projectId,apiBaseUrlFlag:v.apiBaseUrl}),I=await k3({message:$,threadId:v.threadId,projectId:D.projectId,json:v.json,client:_,wait:v.wait,timeoutMs:v.timeout});if(!v.wait){if(v.json){M(lU(I));return}if(Lw(I),I.status!=="processing")c(`Status: ${I.status}`);return}if(I.status!=="processing"){if(v.json){M(lU(I));return}if(Lw(I),y7(I.status)){f7(I.status,I.response??null);return}c(`Status: ${I.status}`);return}if(!v.json)Lw(I);let G=v.timeout===void 0?void 0:Math.max(0,v.timeout-(Date.now()-U)),J=k(await mU({client:_,runId:I.runId,threadId:I.threadId,timeoutMs:G,printProgress:!v.json}),"Failed to get run",v.json);if(!J.completed){let Q={...I,status:J.status,response:J.response};if(v.json){M(lU(Q));return}c(`Not ready. Poll with: ${Nw(I.runId)}`);return}let X={...I,status:J.status,response:J.response};if(v.json){M(lU(X));return}if(!y7(J.status)){c(`Not ready. Poll with: ${Nw(I.runId)}`);return}f7(J.status,J.response)},k3=async($)=>{if($.threadId){let U=k(await $.client.messages.append($.threadId,$.message,$.wait??!1,u7($.timeoutMs)),"Failed to send message",$.json);return{threadId:$.threadId,runId:U.result.runId,status:U.result.status,response:U.result.response}}let v=k(await $.client.threads.create({message:$.message,...$.projectId?{projectId:$.projectId}:{},wait:$.wait??!1,timeoutSeconds:u7($.timeoutMs)}),"Failed to create thread",$.json);return{threadId:v.result.threadId,runId:v.result.runId,status:v.result.status,response:v.result.response,threadUrl:$.projectId?yU($.projectId,v.result.threadId):void 0}},Nw=($)=>{return`sazabi runs get ${$}`},Lw=($)=>{if(c(`Thread ID: ${$.threadId}`),$.threadUrl)c(`View URL: ${$.threadUrl}`);c(`Run ID: ${$.runId}`),c(`Poll with: ${Nw($.runId)}`)},lU=($)=>{return{threadId:$.threadId,runId:$.runId,status:$.status,...$.response!==void 0?{response:$.response}:{},...$.threadUrl?{url:$.threadUrl}:{}}},u7=($)=>{if($===void 0)return 20;return Math.max(1,Math.min(Math.ceil($/1000),20))},y7=($)=>{return $==="completed"||$==="error"||$==="aborted"},f7=($,v)=>{if($==="completed"){if(!c7(v)){c("Status: completed");return}H$(v);return}if(c(`Status: ${$}`),!c7(v))return;H$(v)},c7=($)=>{return Boolean($&&$.trim().length>0)};var H3=async($,v)=>{let U=R({tokenFlag:v.token,jsonMode:v.json}),D=y({token:U.token,projectId:U.projectId,apiBaseUrlFlag:v.apiBaseUrl}),{messages:_,nextCursor:I}=k(await D.messages.list($,{limit:v.limit,cursor:v.cursor}),"Failed to list messages",v.json);if(v.json){M({messages:_,nextCursor:I});return}if(_.length===0){t("No messages found.");return}let G=_.map((J)=>{let X=J.content.find((Y)=>Y.type==="message"&&Boolean(Y.message)),Q=X?G1(X.message):G$("(no text)");return{id:n$(J.id),role:ov(J.role),content:Q,created:I$(J.createdAt)}});a(G,[{header:"ID",key:"id"},{header:"Role",key:"role"},{header:"Content",key:"content"},{header:"Created",key:"created"}],{header:"Messages"}),Vv({type:"cursor",nextCursor:I})},F3=async($,v)=>{let U=R({tokenFlag:v.token,jsonMode:v.json}),D=y({token:U.token,projectId:U.projectId,apiBaseUrlFlag:v.apiBaseUrl}),{messages:_,pagination:I}=k(await D.search.messages({query:$,limit:v.limit,page:v.page,threadId:v.threadId,role:v.role}),"Failed to search messages",v.json);if(v.json){M({messages:_,pagination:I});return}if(_.length===0){t("No matching messages found.");return}let G=_.map((J)=>({id:n$(J.id),thread:J.threadTitle||G$("(no title)"),role:ov(J.role),content:G1(J.content),score:J.score?.toFixed(2)??"-"}));a(G,[{header:"ID",key:"id"},{header:"Thread",key:"thread"},{header:"Role",key:"role"},{header:"Content",key:"content"},{header:"Score",key:"score",align:"right"}],{header:{title:"Search Results",variant:"search",count:I.totalResults}}),Vv({type:"page",page:I.page,totalPages:I.totalPages})},r7=o("messages","").withSubcommands({send:z("send","Send a message (creates new thread if --thread-id omitted)",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},"thread-id":{type:"string",short:"t"},wait:{type:"boolean"},timeout:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U.join(" ");if(!D){if(v.json)return q("Message is required. Usage: sazabi messages send <message> [--thread-id <id>]");return N("Message is required. Usage: sazabi messages send <message> [--thread-id <id>]")}let _=v.timeout?Z$(v.timeout,1,3600,"Timeout",v.json)*1000:void 0,I={token:v.token,threadId:v["thread-id"],wait:v.wait,timeout:_,json:v.json,apiBaseUrl:v["api-base-url"]};await h7(D,I)}).withPositionalArgs("<message>").withOptions({token:{type:"string",description:"Override authentication token"},"thread-id":{type:"string",short:"t",description:"Thread ID to append to (creates new thread if omitted)"},wait:{type:"boolean",description:"Wait for assistant response and print it"},timeout:{type:"string",description:"Timeout in seconds to wait for response before returning processing state"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi messages send 'Hello' # Start a new thread","sazabi messages send 'Hello' --thread-id abc123 # Append to existing thread","sazabi messages send 'Hello' -t abc123 --wait # Append and wait for reply","sazabi messages send 'Hello' --wait # New thread, wait for reply","sazabi messages send 'Hello' --wait --timeout 120 # Wait up to 2 minutes"]).build(),list:z("list","List messages in a thread",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},limit:{type:"string"},cursor:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Thread ID is required. Usage: sazabi messages list <thread-id>");return N("Thread ID is required. Usage: sazabi messages list <thread-id>")}if(U.length>1){let I=U.slice(1).join(", ");if(v.json)return q(`Unexpected arguments: ${I}`);return N(`Unexpected arguments: ${I}`)}let _={token:v.token,json:v.json,apiBaseUrl:v["api-base-url"]};if(v.limit)_.limit=Z$(v.limit,1,100,"Limit",v.json);if(v.cursor)_.cursor=v.cursor;await H3(D,_)}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override authentication token"},limit:{type:"string",description:"Maximum number of messages to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi messages list <thread-id> # List all messages in thread","sazabi messages list <thread-id> --limit 20 # List with custom limit","sazabi messages list <thread-id> --cursor xyz # List next page"]).build(),search:z("search","Search messages in current project",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},limit:{type:"string"},page:{type:"string"},"thread-id":{type:"string"},role:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U.join(" ");if(!D){if(v.json)return q("Search query is required. Usage: sazabi messages search <query>");return N("Search query is required. Usage: sazabi messages search <query>")}let _={token:v.token,json:v.json,apiBaseUrl:v["api-base-url"]};if(v.limit)_.limit=Z$(v.limit,1,100,"Limit",v.json);if(v.page)_.page=Z$(v.page,1,Number.MAX_SAFE_INTEGER,"Page",v.json);if(v["thread-id"])_.threadId=v["thread-id"];if(v.role)_.role=v1(v.role,["user","assistant"],"Role",v.json);await F3(D,_)}).withPositionalArgs("<query>").withOptions({token:{type:"string",description:"Override authentication token"},limit:{type:"string",description:"Maximum number of results (default: 20, max: 100)"},page:{type:"string",description:"Page number for pagination (default: 1)"},"thread-id":{type:"string",description:"Filter messages by thread ID"},role:{type:"string",description:"Filter by role: user or assistant"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(['sazabi messages search "error handling" # Search messages','sazabi messages search "bug" --limit 50 # Search with limit','sazabi messages search "user input" --role user # Search user messages only','sazabi messages search "response" --thread-id thread-123 # Search in specific thread']).build()}).withExamples(["sazabi messages send 'Hello' # Start a new thread","sazabi messages send 'Follow up' -t <thread-id> # Append to thread","sazabi messages list <thread-id> # List messages in thread",'sazabi messages search "error" # Search messages']).build();n();w$();e();h$();var b3=async($)=>{let v=R({tokenFlag:$.token,jsonMode:$.json}),U=y({token:v.token,organizationId:v.organizationId,projectId:v.projectId,apiBaseUrlFlag:$.apiBaseUrl,jsonMode:$.json}),D=k(await U.organizations.list(),"Failed to list organizations",$.json);if($.json){M(D);return}if(D.organizations.length===0){t("No organizations found.");return}a(D.organizations.map((_)=>({id:_.id,name:_.name,slug:_.slug,role:_.role??""})),[{header:"ID",key:"id"},{header:"Name",key:"name"},{header:"Slug",key:"slug"},{header:"Role",key:"role"}],{header:"Organizations"})},g3=async($,v)=>{let U=R({tokenFlag:v.token,jsonMode:v.json}),D=k(s(),"Failed to read settings",v.json),_=y({token:U.token,organizationId:$,projectId:U.projectId,apiBaseUrlFlag:v.apiBaseUrl,jsonMode:v.json}),I=k(await _.organizations.get($),"Failed to select organization",v.json).organization,G=k(await _.projects.list({organizationId:$}),"Failed to fetch organization projects",v.json).projects,J=k(l$(D),"Failed to resolve profile",v.json),X=k(E$(D,{activeOrganizationId:I.id,organizationName:I.name,activeProjectId:J.activeProjectId&&G.some((Q)=>Q.id===J.activeProjectId)?J.activeProjectId:G[0]?.id}),"Failed to update profile",v.json);if(k(J$(X),"Failed to persist active organization",v.json),v.json){M({organization:I,activeProjectId:k(l$(X),"Failed to resolve profile",v.json).activeProjectId});return}u(`Active organization set to ${I.name}.`)},S3=async($,v)=>{let U=R({tokenFlag:v.token,organizationIdFlag:v.organizationId,jsonMode:v.json}),D=y({token:U.token,organizationId:U.organizationId,projectId:U.projectId,apiBaseUrlFlag:v.apiBaseUrl,jsonMode:v.json}),_=k(await D.organizations.rename($,U.organizationId),"Failed to rename organization",v.json);if(B3(_.organization.id,_.organization.name),v.json){M(_);return}u(`Renamed organization to ${_.organization.name}.`)},B3=($,v)=>{let U=s();if(!U.success)return;let D=U.value,_=l$(D);if(!_.success)return;if(_.value.activeOrganizationId!==$)return;let I=E$(D,{organizationName:v});if(I.success)J$(I.value)},m7=o("organizations","").withSubcommands({list:z("list","List organizations available to the current credential",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0});if(U.length>0){let D=U.join(", ");if(v.json)return q(`Unexpected arguments: ${D}`);return N(`Unexpected arguments: ${D}`)}await b3({token:v.token,json:v.json,apiBaseUrl:v["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi organizations list # List available organizations"]).build(),use:z("use","Set the active organization for future commands",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Organization ID is required.");return N("Organization ID is required.")}await g3(D,{token:v.token,json:v.json,apiBaseUrl:v["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi organizations use org_123 # Set the active organization"]).build(),rename:z("rename","Rename the active organization",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},"organization-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Organization name is required.");return N("Organization name is required.")}if(U.length>1){let _=U.slice(1).join(", ");if(v.json)return q(`Unexpected arguments: ${_}`);return N(`Unexpected arguments: ${_}`)}await S3(D,{token:v.token,organizationId:v["organization-id"],json:v.json,apiBaseUrl:v["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(['sazabi organizations rename "Observed Platform" # Rename the active organization']).build()}).withExamples(["sazabi organizations list # List available organizations","sazabi organizations use org_123 # Set the active organization",'sazabi organizations rename "Observed Platform" # Rename the active organization']).build();n();e();h$();var Z3=($)=>{let v=k(s(),"Failed to read settings",$.json);if($.json){M({activeProfile:v.activeProfile,profiles:Object.keys(v.profiles).map((D)=>({name:D,active:D===v.activeProfile}))});return}let U=Object.keys(v.profiles);if(U.length===0){t("No profiles configured.");return}a(U.map((D)=>({name:D,active:D===v.activeProfile?O$.success("*"):""})),[{header:"Profile",key:"name"},{header:"Active",key:"active",width:8}])},M3=($,v)=>{let U=k(s(),"Failed to read settings",v.json);if(!U.profiles[$]){let D=`Profile '${$}' does not exist. Run 'sazabi profiles list' to see available profiles.`;if(v.json)q(D);N(D)}if(U.activeProfile=$,k(J$(U),"Failed to write settings",v.json),v.json){M({activeProfile:$});return}u(`Active profile set to '${$}'.`)},T3=($,v)=>{let U=k(s(),"Failed to read settings",v.json);if(U.profiles[$]){let D=`Profile '${$}' already exists.`;if(v.json)q(D);N(D)}if(U.profiles[$]={},k(J$(U),"Failed to write settings",v.json),v.json){M({created:$});return}u(`Created profile '${$}'.`)},z3=($,v)=>{let U=k(s(),"Failed to read settings",v.json);if(!U.profiles[$]){let D=`Profile '${$}' does not exist.`;if(v.json)q(D);N(D)}if($===U.activeProfile){let D=`Cannot delete the active profile '${$}'. Switch to a different profile first with 'sazabi profiles use <name>'.`;if(v.json)q(D);N(D)}if(delete U.profiles[$],k(J$(U),"Failed to write settings",v.json),v.json){M({deleted:$});return}u(`Deleted profile '${$}'.`)},l7=o("profiles","").withSubcommands({list:z("list","List all profiles",async($)=>{let{values:v}=j($,{json:{type:"boolean"}});Z3({json:v.json})}).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi profiles list # List all profiles"]).build(),use:z("use","Set the active profile",async($)=>{let{values:v,positionals:U}=j($,{json:{type:"boolean"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Profile name is required. Usage: sazabi profiles use <name>");return N("Profile name is required. Usage: sazabi profiles use <name>")}M3(D,{json:v.json})}).withPositionalArgs("<name>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi profiles use staging # Switch to staging profile"]).build(),create:z("create","Create a new empty profile",async($)=>{let{values:v,positionals:U}=j($,{json:{type:"boolean"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Profile name is required. Usage: sazabi profiles create <name>");return N("Profile name is required. Usage: sazabi profiles create <name>")}T3(D,{json:v.json})}).withPositionalArgs("<name>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi profiles create staging # Create a new profile"]).build(),delete:z("delete","Delete a profile",async($)=>{let{values:v,positionals:U}=j($,{json:{type:"boolean"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Profile name is required. Usage: sazabi profiles delete <name>");return N("Profile name is required. Usage: sazabi profiles delete <name>")}z3(D,{json:v.json})}).withPositionalArgs("<name>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi profiles delete staging # Delete a profile"]).build()}).withExamples(["sazabi profiles list # List all profiles","sazabi profiles use staging # Switch to staging profile","sazabi profiles create local # Create a new profile","sazabi profiles delete staging # Delete a profile"]).build();n();w$();e();h$();var A3=async($)=>{let v=R({tokenFlag:$.token,organizationIdFlag:$.organizationId,jsonMode:$.json}),U=y({token:v.token,organizationId:v.organizationId,projectId:v.projectId,apiBaseUrlFlag:$.apiBaseUrl,jsonMode:$.json}),D=k(await U.projects.list({organizationId:v.organizationId}),"Failed to list projects",$.json);if($.json){M(D);return}if(D.projects.length===0){t("No projects found.");return}a(D.projects.map((_)=>({id:_.id,name:_.name,region:_.region,active:_.id===v.projectId?"yes":""})),[{header:"ID",key:"id"},{header:"Name",key:"name"},{header:"Region",key:"region"},{header:"Active",key:"active"}],{header:"Projects"})},j3=async($,v)=>{let U=R({tokenFlag:v.token,jsonMode:v.json}),D=k(s(),"Failed to read settings",v.json),_=y({token:U.token,organizationId:U.organizationId,projectId:U.projectId,apiBaseUrlFlag:v.apiBaseUrl,jsonMode:v.json}),I=k(await _.projects.get($),"Failed to select project",v.json).project,G=I.organizationId!==D.profiles[Xv(D)]?.activeOrganizationId,J=k(E$(D,{activeOrganizationId:I.organizationId,activeProjectId:I.id,...G&&{organizationName:void 0}}),"Failed to update profile",v.json);if(k(J$(J),"Failed to persist active project",v.json),v.json){M({project:I});return}u(`Active project set to ${I.name}.`)},i7=o("projects","").withSubcommands({list:z("list","List projects in the active organization",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},"organization-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0});if(U.length>0){let D=U.join(", ");if(v.json)return q(`Unexpected arguments: ${D}`);return N(`Unexpected arguments: ${D}`)}await A3({token:v.token,organizationId:v["organization-id"],json:v.json,apiBaseUrl:v["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},"organization-id":{type:"string",description:"Override organization selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi projects list # List projects in the active organization"]).build(),use:z("use","Set the active project for future commands",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Project ID is required.");return N("Project ID is required.")}await j3(D,{token:v.token,json:v.json,apiBaseUrl:v["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi projects use 11111111-1111-4111-8111-111111111111 # Set the active project"]).build()}).withExamples(["sazabi projects list # List projects in the active organization","sazabi projects use 11111111-1111-4111-8111-111111111111 # Set the active project"]).build();n();w$();e();var E3=async($,v={})=>{let U=R({tokenFlag:v.token,jsonMode:v.json}),D=y({token:U.token,projectId:U.projectId,apiBaseUrlFlag:v.apiBaseUrl}),_=k(await D.runs.get($),"Failed to get run",v.json),I=v.wait&&!_.completed?k(await mU({client:D,runId:$,threadId:_.threadId,timeoutMs:v.timeout,printProgress:!v.json}),"Failed to get run",v.json):_;if(v.json){M(I);return}if(c(`Thread ID: ${I.threadId}`),c(`Run ID: ${I.runId}`),c(`Status: ${I.status}`),!I.completed){c(`Poll with: sazabi runs get ${I.runId}`);return}if(!x3(I.response))return;r(),H$(I.response)},n7=o("runs","").withSubcommands({get:z("get","Get a deferred run by run ID",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},wait:{type:"boolean"},timeout:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Run ID is required. Usage: sazabi runs get <run-id>");return N("Run ID is required. Usage: sazabi runs get <run-id>")}if(U.length>1){let I=U.slice(1).join(", ");if(v.json)return q(`Unexpected arguments: ${I}`);return N(`Unexpected arguments: ${I}`)}let _=v.timeout?Z$(v.timeout,1,3600,"Timeout",v.json)*1000:void 0;await E3(D,{token:v.token,wait:v.wait,timeout:_,json:v.json,apiBaseUrl:v["api-base-url"]})}).withPositionalArgs("<run-id>").withOptions({token:{type:"string",description:"Override authentication token"},wait:{type:"boolean",description:"Wait for terminal status and print the final result"},timeout:{type:"string",description:"Timeout in seconds to wait before returning processing state"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi runs get <run-id> # Check current run status","sazabi runs get <run-id> --wait # Wait until the run is terminal","sazabi runs get <run-id> --wait --timeout 60 # Wait up to 60 seconds","sazabi runs get <run-id> --json # Output run state as JSON"]).build()}).withExamples(["sazabi runs get <run-id> # Check current run status","sazabi runs get <run-id> --wait # Wait until the run is terminal"]).build(),x3=($)=>{return Boolean($&&$.trim().length>0)};n();e();h$();var qw=["apiBaseUrl","webBaseUrl","intakeBaseUrl","tailBaseUrl","apiDomain","webDomain","intakeDomain","tailDomain","forwardPublicKey"],d7=($)=>{return qw.includes($)},R3=($={})=>{let v=k(s(),"Failed to read settings",$.json),U=Xv(v),D=k(l$(v),"Failed to resolve profile",$.json);if($.json){M({success:!0,settingsFile:l4,profile:U,settings:D});return}_$({"Settings file":l4,"Active profile":U}),r();let _=Object.entries(D).filter(([,G])=>G!=null);if(_.length===0){t("No settings configured.");return}let I=_.map(([G,J])=>({key:G,value:String(J)})).sort((G,J)=>G.key.localeCompare(J.key));a(I,[{header:"Key",key:"key",width:20},{header:"Value",key:"value"}],{header:"Settings"})},C3=($,v,U={})=>{if(!d7($)){let I=qw.join(", "),G=`Invalid setting key: '${$}'. Valid keys: ${I}`;if(U.json){q(G);return}N(G);return}let D=k(s(),"Failed to read settings",U.json),_=k(E$(D,{[$]:v}),"Failed to update profile",U.json);if(k(J$(_),"Failed to write settings",U.json),U.json){M({success:!0,key:$,value:v});return}u(`Set ${$} to ${v}`)},u3=($,v={})=>{if(!d7($)){let _=qw.join(", "),I=`Invalid setting key: '${$}'. Valid keys: ${_}`;if(v.json){q(I);return}N(I);return}let U=k(s(),"Failed to read settings",v.json),D=k(E$(U,{[$]:void 0}),"Failed to update profile",v.json);if(k(J$(D),"Failed to write settings",v.json),v.json){M({success:!0,key:$});return}u(`Cleared ${$}`)},o7=o("settings","").withSubcommands({view:z("view","Show current CLI settings and file location",async($)=>{let{values:v}=j($,{json:{type:"boolean"}});R3({json:v.json})}).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi settings view # Show current settings","sazabi settings view --json # Output as JSON"]).build(),set:z("set","Set a global configuration value",async($)=>{let{values:v,positionals:U}=j($,{json:{type:"boolean"}},{allowPositionals:!0}),D=U[0],_=U[1];if(!D){if(v.json)return q("Setting key is required. Usage: sazabi settings set <key> <value>");return N("Setting key is required. Usage: sazabi settings set <key> <value>")}if(!_){if(v.json)return q("Value is required. Usage: sazabi settings set <key> <value>");return N("Value is required. Usage: sazabi settings set <key> <value>")}C3(D,_,{json:v.json})}).withPositionalArgs("<key> <value>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi settings set apiBaseUrl https://api.example.com # Set API base URL","sazabi settings set webBaseUrl https://app.example.com # Set web app base URL","sazabi settings set --json apiBaseUrl https://api.example.com # Output as JSON"]).build(),unset:z("unset","Clear a global configuration value",async($)=>{let{values:v,positionals:U}=j($,{json:{type:"boolean"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Setting key is required. Usage: sazabi settings unset <key>");return N("Setting key is required. Usage: sazabi settings unset <key>")}u3(D,{json:v.json})}).withPositionalArgs("<key>").withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi settings unset apiBaseUrl # Clear API base URL override","sazabi settings unset --json apiBaseUrl # Output as JSON"]).build()}).withExamples(["sazabi settings view # Show current settings","sazabi settings set apiBaseUrl https://api.example.com # Set API base URL","sazabi settings unset apiBaseUrl # Clear API base URL override"]).build();n();n();w$();e();var t7=async($,v)=>{let U=R({tokenFlag:v.token,jsonMode:v.json}),D=y({token:U.token,projectId:U.projectId,apiBaseUrlFlag:v.apiBaseUrl}),{thread:_}=k(await D.threads.update($,"archived"),"Failed to archive thread",v.json);if(v.json){M({thread:_});return}u(`Thread ${_.id} archived.`)};n();w$();e();var p7=async($,v)=>{let U=R({tokenFlag:v.token,jsonMode:v.json}),D=y({token:U.token,projectId:U.projectId,apiBaseUrlFlag:v.apiBaseUrl}),{thread:_,messages:I}=k(await D.threads.get($),"Failed to get thread",v.json);if(v.json){M({thread:_,messages:I});return}if(Y$("Thread"),_$({ID:_.id,URL:yU(_.projectId,_.id),Title:_.title||"(no title)",Status:_.status,Created:I$(_.createdAt),Updated:I$(_.updatedAt)}),r(),Y$("Messages"),I.length===0){t("No messages.");return}for(let G of I){H$(ov(G.role,`[${G.role}] ${I$(G.createdAt)}`));for(let J of G.content)if(J.type==="message"&&J.message)r$(J.message);else if(J.type==="tool_call")r$(G$("[tool call]"));else if(J.type==="artifact")r$(G$("[artifact]"));else r$(G$(`[${J.type}]`));r()}};n();w$();e();var a7=async($)=>{let v=R({tokenFlag:$.token,jsonMode:$.json}),D=await y({token:v.token,projectId:v.projectId,apiBaseUrlFlag:$.apiBaseUrl}).threads.list({limit:$.limit,cursor:$.cursor,status:$.status}),{threads:_,nextCursor:I}=k(D,"Failed to list threads",$.json);if($.json){M({threads:_,nextCursor:I});return}if(_.length===0){t("No threads found.");return}let G=_.map((J)=>({id:n$(J.id),title:J.title||G$("(no title)"),status:J.status,updated:I$(J.updatedAt)}));a(G,[{header:"ID",key:"id"},{header:"Title",key:"title"},{header:"Status",key:"status"},{header:"Updated",key:"updated"}],{header:"Threads"}),Vv({type:"cursor",nextCursor:I})};n();w$();e();var e7=async($,v)=>{let U=R({tokenFlag:v.token,jsonMode:v.json}),D=y({token:U.token,projectId:U.projectId,apiBaseUrlFlag:v.apiBaseUrl}),{threads:_,pagination:I}=k(await D.search.threads({query:$,limit:v.limit,page:v.page,status:v.status}),"Failed to search threads",v.json);if(v.json){M({threads:_,pagination:I});return}if(_.length===0){t("No matching threads found.");return}let G=_.map((J)=>({id:n$(J.id),title:J.title||G$("(no title)"),status:J.status,score:J.score?.toFixed(2)??"-"}));a(G,[{header:"ID",key:"id"},{header:"Title",key:"title"},{header:"Status",key:"status"},{header:"Score",key:"score",align:"right"}],{header:{title:"Search Results",variant:"search",count:I.totalResults}}),Vv({type:"page",page:I.page,totalPages:I.totalPages})};n();w$();e();var s7=async($,v)=>{let U=R({tokenFlag:v.token,jsonMode:v.json}),D=y({token:U.token,projectId:U.projectId,apiBaseUrlFlag:v.apiBaseUrl}),{thread:_}=k(await D.threads.update($,"regular"),"Failed to unarchive thread",v.json);if(v.json){M({thread:_});return}u(`Thread ${_.id} unarchived.`)};var $V=o("threads","").withSubcommands({list:z("list","List threads from current project",async($)=>{let{values:v}=j($,{token:{type:"string"},limit:{type:"string"},cursor:{type:"string"},status:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}}),U={token:v.token,json:v.json,apiBaseUrl:v["api-base-url"]};if(v.limit)U.limit=Z$(v.limit,1,100,"Limit",v.json);if(v.cursor)U.cursor=v.cursor;if(v.status)U.status=v1(v.status,["regular","archived"],"Status",v.json);await a7(U)}).withOptions({token:{type:"string",description:"Override authentication token"},limit:{type:"string",description:"Maximum number of threads to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},status:{type:"string",description:"Filter by status: regular or archived"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads list # List all threads","sazabi threads list --limit 50 # List with custom limit","sazabi threads list --status archived # List archived threads","sazabi threads list --cursor xyz # List next page"]).build(),get:z("get","Get thread with messages",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Thread ID is required. Usage: sazabi threads get <thread-id>");return N("Thread ID is required. Usage: sazabi threads get <thread-id>")}if(U.length>1){let _=U.slice(1).join(", ");if(v.json)return q(`Unexpected arguments: ${_}`);return N(`Unexpected arguments: ${_}`)}await p7(D,{token:v.token,json:v.json,apiBaseUrl:v["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override authentication token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads get <thread-id> # Get thread with messages","sazabi threads get <thread-id> --json # Output as JSON"]).build(),search:z("search","Search threads in current project",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},limit:{type:"string"},page:{type:"string"},status:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U.join(" ");if(!D){if(v.json)return q("Search query is required. Usage: sazabi threads search <query>");return N("Search query is required. Usage: sazabi threads search <query>")}let _={token:v.token,json:v.json,apiBaseUrl:v["api-base-url"]};if(v.limit)_.limit=Z$(v.limit,1,100,"Limit",v.json);if(v.page)_.page=Z$(v.page,1,Number.MAX_SAFE_INTEGER,"Page",v.json);if(v.status)_.status=v1(v.status,["regular","archived"],"Status",v.json);await e7(D,_)}).withPositionalArgs("<query>").withOptions({token:{type:"string",description:"Override authentication token"},limit:{type:"string",description:"Maximum number of results (default: 20, max: 100)"},page:{type:"string",description:"Page number for pagination (default: 1)"},status:{type:"string",description:"Filter by status: regular or archived"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(['sazabi threads search "error handling" # Search threads','sazabi threads search "bug" --limit 50 # Search with limit','sazabi threads search "authentication" --status regular # Search only regular threads']).build(),archive:z("archive","Archive a thread",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Thread ID is required. Usage: sazabi threads archive <thread-id>");return N("Thread ID is required. Usage: sazabi threads archive <thread-id>")}if(U.length>1){let _=U.slice(1).join(", ");if(v.json)return q(`Unexpected arguments: ${_}`);return N(`Unexpected arguments: ${_}`)}await t7(D,{token:v.token,json:v.json,apiBaseUrl:v["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override authentication token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads archive <thread-id> # Archive a thread","sazabi threads archive <thread-id> --json # Output as JSON"]).build(),unarchive:z("unarchive","Unarchive a thread",async($)=>{let{values:v,positionals:U}=j($,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),D=U[0];if(!D){if(v.json)return q("Thread ID is required. Usage: sazabi threads unarchive <thread-id>");return N("Thread ID is required. Usage: sazabi threads unarchive <thread-id>")}if(U.length>1){let _=U.slice(1).join(", ");if(v.json)return q(`Unexpected arguments: ${_}`);return N(`Unexpected arguments: ${_}`)}await s7(D,{token:v.token,json:v.json,apiBaseUrl:v["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override authentication token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads unarchive <thread-id> # Unarchive a thread","sazabi threads unarchive <thread-id> --json # Output as JSON"]).build()}).withExamples(["sazabi threads list # List all threads","sazabi threads get <thread-id> # Get thread with messages",'sazabi threads search "error" # Search threads',"sazabi threads archive <thread-id> # Archive a thread","sazabi threads unarchive <thread-id> # Unarchive a thread"]).build();var vV=[H7,g7,S7,m7,C7,l7,i7,M7,T7,o7,R7,$V,r7,n7];kw();n();var d4=($,v=!1)=>{let U=Object.entries($);if(U.length===0&&!v)return"";let D=v?[["help",{type:"boolean",short:"h",description:"Show help for this command"}],...U]:U,_=Math.max(...D.map(([G,J])=>{return`${J.short?`-${J.short}, `:""}--${G}`.length})),I=D.map(([G,J])=>{let Q=`${J.short?`-${J.short}, `:""}--${G}`,Y=J.description.includes("(required)"),P=J.required&&!Y?" (required)":"";return` ${Q.padEnd(_)} ${J.description}${P}`});return`
|
|
439
|
+
|
|
440
|
+
${Q$("OPTIONS")}
|
|
441
|
+
${I.join(`
|
|
442
|
+
`)}`},Hw=($)=>{if($.length===0)return"";let v=$.map((_)=>{let I=_.indexOf("#");if(I===-1)return{command:_,comment:null};return{command:_.substring(0,I).trimEnd(),comment:_.substring(I).trim()}}),U=Math.max(...v.map((_)=>_.command.length)),D=v.map(({command:_,comment:I})=>{if(!I)return` ${_}`;let G=" ".repeat(U-_.length+2);return` ${_}${G}${I}`});return`
|
|
443
|
+
|
|
444
|
+
${Q$("EXAMPLES")}
|
|
445
|
+
${D.join(`
|
|
446
|
+
`)}`},DV=($,v=2)=>{let U=Object.entries($);if(U.length===0)return"";let D=Math.max(...U.map(([G])=>G.length)),_=" ".repeat(v),I="";for(let[G,J]of U)if(I+=`
|
|
447
|
+
${_}${G.padEnd(D)} ${J.description}`,J.subcommands&&Object.keys(J.subcommands).length>0){let X=Object.entries(J.subcommands),Q=Math.max(...X.map(([Y])=>Y.length));for(let[Y,P]of X)I+=`
|
|
448
|
+
${_} ${Y.padEnd(Q)} ${P.description}`}return I},Fw=($,v)=>{let U=v.positionalArgs?` ${v.positionalArgs}`:"",D=`sazabi ${$} ${v.name}${U}`,_=`
|
|
449
|
+
${Q$(`sazabi ${$} ${v.name}`)} - ${v.description}
|
|
450
|
+
`;if(_+=`
|
|
451
|
+
${Q$("USAGE")}
|
|
452
|
+
${D}`,v.options)_+=d4(v.options,!0);else _+=d4({},!0);if(v.examples)_+=Hw(v.examples);return _+=`
|
|
453
|
+
`,_},IV=($,v)=>{let U=`
|
|
454
|
+
${Q$(`sazabi ${$} ${v.name}`)} - ${v.description}
|
|
455
|
+
`;if(U+=`
|
|
456
|
+
${Q$("USAGE")}`,v.subcommands&&!v.handler)U+=`
|
|
457
|
+
sazabi ${$} ${v.name} <subcommand> [options]`;else if(v.subcommands&&v.handler){let D=v.positionalArgs?` ${v.positionalArgs}`:"";U+=`
|
|
458
|
+
sazabi ${$} ${v.name}${D}`,U+=`
|
|
459
|
+
sazabi ${$} ${v.name} <subcommand> [options]`}if(v.subcommands){if(Object.entries(v.subcommands).length>0)U+=`
|
|
460
|
+
|
|
461
|
+
${Q$("SUBCOMMANDS")}`,U+=DV(v.subcommands)}if(v.options)U+=d4(v.options,!0);else U+=d4({},!0);if(v.examples)U+=Hw(v.examples);return U+=`
|
|
462
|
+
`,U},bw=($)=>{let v=$.description.trim(),U=`
|
|
463
|
+
${Q$(`sazabi ${$.name}`)}${v?` - ${v}`:""}
|
|
464
|
+
`;if(U+=`
|
|
465
|
+
${Q$("USAGE")}`,$.subcommands&&!$.handler)U+=`
|
|
466
|
+
sazabi ${$.name} <subcommand> [options]`;else if($.subcommands&&$.handler){let D=$.positionalArgs?` ${$.positionalArgs}`:"";U+=`
|
|
467
|
+
sazabi ${$.name}${D}`,U+=`
|
|
468
|
+
sazabi ${$.name} <subcommand> [options]`}else{let D=$.positionalArgs?` ${$.positionalArgs}`:"";U+=`
|
|
469
|
+
sazabi ${$.name}${D}`}if($.subcommands){if(Object.entries($.subcommands).length>0)U+=`
|
|
470
|
+
|
|
471
|
+
${Q$("SUBCOMMANDS")}`,U+=DV($.subcommands)}if($.options)U+=d4($.options,!0);else U+=d4({},!0);if($.examples)U+=Hw($.examples);return U+=`
|
|
472
|
+
`,U},gw=($)=>{let v=`
|
|
473
|
+
${Q$("Sazabi CLI")} - Command-line interface for the Sazabi public API
|
|
474
|
+
`;v+=`
|
|
475
|
+
${Q$("USAGE")}`,v+=`
|
|
476
|
+
sazabi <command> [subcommand] [options]`,v+=`
|
|
477
|
+
|
|
478
|
+
${Q$("COMMANDS")}`;for(let U of $){let D=U.description.trim();if(v+=`
|
|
479
|
+
${U.name.padEnd(11)}${D?` ${D}`:""}`,U.subcommands){for(let[_,I]of Object.entries(U.subcommands))if(v+=`
|
|
480
|
+
${_.padEnd(9)} ${I.description}`,I.subcommands)for(let[G,J]of Object.entries(I.subcommands))v+=`
|
|
481
|
+
${G.padEnd(7)} ${J.description}`}}return v+=`
|
|
482
|
+
|
|
483
|
+
${Q$("OPTIONS")}`,v+=`
|
|
484
|
+
-h, --help Show help for a command`,v+=`
|
|
485
|
+
-v, --version Show version number`,v+=`
|
|
486
|
+
--json Output errors as JSON`,v+=`
|
|
487
|
+
--profile <name> Use a named profile`,v+=`
|
|
488
|
+
|
|
489
|
+
${Q$("EXAMPLES")}`,v+=`
|
|
490
|
+
sazabi auth login # Authenticate via browser`,v+=`
|
|
491
|
+
sazabi messages send "Hello" # Start a new thread`,v+=`
|
|
492
|
+
sazabi messages send "Hi" -t <id> # Send a message to a thread`,v+=`
|
|
493
|
+
sazabi logs tail --severities ERROR,WARN # Tail logs filtered by severity`,v+=`
|
|
494
|
+
sazabi threads list # List all threads
|
|
495
|
+
`,v};h$();import*as dU from"node:fs";import*as U1 from"node:path";import{fileURLToPath as y3}from"node:url";var GV=()=>{try{let $=U1.dirname(y3(import.meta.url));for(let v=0;v<5;v++){let U=U1.join($,"package.json");if(dU.existsSync(U)){let D=dU.readFileSync(U,"utf-8");return JSON.parse(D).version??"0.0.0"}$=U1.dirname($)}return"0.0.0"}catch{return"0.0.0"}};var p3=GV();for(let $ of vV)_V($);var a3=async()=>{let $=process.argv.slice(2);if($[0]==="--get-completions"&&$[1]==="--"){let{getCompletions:P,parseCompletionContext:V}=await Promise.resolve().then(() => (PV(),YV)),O=V($.slice(2)),S=await P(O);for(let B of S)if(B.description)console.log(`${B.value} ${B.description}`);else console.log(B.value);return}let v=[],U;for(let P=0;P<$.length;P++){let V=$[P];if(V==="--profile"){let O=$[P+1],S=$.includes("--json");if(O===void 0||O.startsWith("-")){let B=O===void 0?"--profile requires a value.":`--profile requires a value, but got '${O}'. Use '--profile <name>'.`;if(S)q(B);N(B)}U=O,P++}else if(V.startsWith("--profile=")){let O=V.slice(10),S=$.includes("--json");if(!O){if(S)q("--profile requires a value.");N("--profile requires a value.")}U=O}else v.push(V)}V7(U);let D=v[0]==="--json",_=D?v.slice(1):v,I=D||_.includes("--json");if(_.includes("--version")||_.includes("-v")){console.log(`sazabi ${p3}`);return}if(_.length===0){console.log(gw(_1()));return}if(_[0]?.startsWith("--")||_[0]==="-h"){if(_[0]==="--help"||_[0]==="-h"){console.log(gw(_1()));return}}let G=_[0];if(G&&!UV(G)){let V=G.startsWith("-")?`Unknown option: ${G}. Run 'sazabi -h' for usage.`:`Unknown command: ${G}. Run 'sazabi -h' for usage.`;if(I)q(V);throw N(V),Error("Unreachable")}if(!G)throw Error("Unexpected: commandName is undefined");let J=nU(G);if(!J)throw N(`Unknown command: ${G}. Run 'sazabi -h' for usage.`),Error("Unreachable");let X=_[1]??"",Q=_.slice(2);if(X==="--help"||X==="-h"){console.log(bw(J));return}if(!X&&J.subcommands&&!J.handler){console.log(bw(J));return}let Y=J.subcommands?.[X];if(!Y){if(J.handler){let P=X?[X,...Q]:Q;await J.handler(P)}else{let V=X.startsWith("-")?`Subcommand required. Run 'sazabi ${G} -h' for usage.`:`Unknown subcommand: ${X}. Run 'sazabi ${G} -h' for usage.`;if(I)q(V);throw N(V),Error("Unreachable")}return}if(Y.subcommands){let P=Q[0]??"",V=Q.slice(1);if(P==="--help"||P==="-h"||!P&&!Y.handler){console.log(IV(G,Y));return}let O=Y.subcommands[P];if(O){if(V.includes("--help")||V.includes("-h")){console.log(Fw(`${G} ${X}`,O));return}if(O.handler)await O.handler(V);return}if(Y.handler){await Y.handler(Q);return}let B=P.startsWith("-")?`Subcommand required. Run 'sazabi ${G} ${X} -h' for usage.`:`Unknown subcommand: ${P}. Run 'sazabi ${G} ${X} -h' for usage.`;if(I)q(B);throw N(B),Error("Unreachable")}if(Q.includes("--help")||Q.includes("-h")){console.log(Fw(G,Y));return}if(Y.handler)await Y.handler(Q)};a3().catch(($)=>{let v=process.argv.includes("--json"),U=`Unexpected error: ${String($)}`;if(v)q(U);N(U)});
|