fjall 2.19.0 → 2.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/.bundled +2 -2
- package/bin/assets/generators/cdn/generator.js +11 -11
- package/bin/assets/generators/compute/generator.js +15 -15
- package/bin/assets/generators/shared/files/package.json +2 -2
- package/bin/assets/generators/storage/s3/generator.js +12 -12
- package/bin/fjall.bundle.js +2 -2
- package/package.json +3 -3
package/bin/.bundled
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
bundled at 2026-06-
|
|
1
|
+
bundled at 2026-06-20T02:54:10.765Z
|
|
2
2
|
bundle size: 3249253 bytes
|
|
3
|
-
cli version: 2.19.
|
|
3
|
+
cli version: 2.19.1
|
|
@@ -52,26 +52,26 @@ Filtered results for: ${this.inputValue?this.inputValue:At.gray("Enter something
|
|
|
52
52
|
`),this.close()}_(t,n){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(l$.hide):this.out.write($1(this.outputText,this.out.columns)),super.render(),this.outputText=[u$.symbol(this.done,this.aborted),c$.bold(this.msg),u$.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:c$.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(I1.line+l$.to(0)+this.outputText))}};p$.exports=Rh});var g$=I((VG,h$)=>{"use strict";h$.exports={TextPrompt:tE(),SelectPrompt:oE(),TogglePrompt:dE(),DatePrompt:UE(),NumberPrompt:HE(),MultiselectPrompt:Ah(),AutocompletePrompt:n$(),AutocompleteMultiselectPrompt:s$(),ConfirmPrompt:f$()}});var b$=I(v$=>{"use strict";var Oe=v$,A1=g$(),dc=e=>e;function lt(e,t,n={}){return new Promise((i,r)=>{let o=new A1[e](t),a=n.onAbort||dc,c=n.onSubmit||dc,u=n.onExit||dc;o.on("state",t.onState||dc),o.on("submit",l=>i(c(l))),o.on("exit",l=>i(u(l))),o.on("abort",l=>r(a(l)))})}Oe.text=e=>lt("TextPrompt",e);Oe.password=e=>(e.style="password",Oe.text(e));Oe.invisible=e=>(e.style="invisible",Oe.text(e));Oe.number=e=>lt("NumberPrompt",e);Oe.date=e=>lt("DatePrompt",e);Oe.confirm=e=>lt("ConfirmPrompt",e);Oe.list=e=>{let t=e.separator||",";return lt("TextPrompt",e,{onSubmit:n=>n.split(t).map(i=>i.trim())})};Oe.toggle=e=>lt("TogglePrompt",e);Oe.select=e=>lt("SelectPrompt",e);Oe.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=n=>n.filter(i=>i.selected).map(i=>i.value);return lt("MultiselectPrompt",e,{onAbort:t,onSubmit:t})};Oe.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=n=>n.filter(i=>i.selected).map(i=>i.value);return lt("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};var T1=(e,t)=>Promise.resolve(t.filter(n=>n.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));Oe.autocomplete=e=>(e.suggest=e.suggest||T1,e.choices=[].concat(e.choices||[]),lt("AutocompletePrompt",e))});var A$=I((WG,I$)=>{"use strict";function y$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function _$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y$(Object(n),!0).forEach(function(i){w1(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y$(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function w1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N1(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=k1(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(l){throw l},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
53
53
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return o=l.done,l},e:function(l){a=!0,c=l},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(a)throw c}}}}function k1(e,t){if(e){if(typeof e=="string")return S$(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S$(e,t)}}function S$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function x$(e,t,n,i,r,o,a){try{var c=e[o](a),u=c.value}catch(l){n(l);return}c.done?t(u):Promise.resolve(u).then(i,r)}function E$(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function a(u){x$(o,i,r,a,c,"next",u)}function c(u){x$(o,i,r,a,c,"throw",u)}a(void 0)})}}var Ph=b$(),C1=["suggest","format","onState","validate","onRender","type"],$$=()=>{};function qt(){return Oh.apply(this,arguments)}function Oh(){return Oh=E$(function*(e=[],{onSubmit:t=$$,onCancel:n=$$}={}){let i={},r=qt._override||{};e=[].concat(e);let o,a,c,u,l,m,f=(function(){var D=E$(function*(me,kt,be=!1){if(!(!be&&me.validate&&me.validate(kt)!==!0))return me.format?yield me.format(kt,i):kt});return function(kt,be){return D.apply(this,arguments)}})();var h=N1(e),v;try{for(h.s();!(v=h.n()).done;){a=v.value;var $=a;if(u=$.name,l=$.type,typeof l=="function"&&(l=yield l(o,_$({},i),a),a.type=l),!!l){for(let D in a){if(C1.includes(D))continue;let me=a[D];a[D]=typeof me=="function"?yield me(o,_$({},i),m):me}if(m=a,typeof a.message!="string")throw new Error("prompt message is required");var H=a;if(u=H.name,l=H.type,Ph[l]===void 0)throw new Error(`prompt type (${l}) is not defined`);if(r[a.name]!==void 0&&(o=yield f(a,r[a.name]),o!==void 0)){i[u]=o;continue}try{o=qt._injected?R1(qt._injected,a.initial):yield Ph[l](a),i[u]=o=yield f(a,o,!0),c=yield t(a,o,i)}catch{c=!(yield n(a,i))}if(c)return i}}}catch(D){h.e(D)}finally{h.f()}return i}),Oh.apply(this,arguments)}function R1(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function P1(e){qt._injected=(qt._injected||[]).concat(e)}function O1(e){qt._override=Object.assign({},e)}I$.exports=Object.assign(qt,{prompt:qt,prompts:Ph,inject:P1,override:O1})});var w$=I((HG,T$)=>{"use strict";T$.exports=(e,t)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(t){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}});var mc=I((qG,N$)=>{"use strict";N$.exports=e=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),n=new RegExp(t,"g");return typeof e=="string"?e.replace(n,""):e}});var R$=I((KG,C$)=>{"use strict";var D1=mc(),{erase:k$,cursor:M1}=re(),z1=e=>[...D1(e)].length;C$.exports=function(e,t){if(!t)return k$.line+M1.to(0);let n=0,i=e.split(/\r?\n/);for(let r of i)n+=1+Math.floor(Math.max(z1(r)-1,0)/t);return k$.lines(n)}});var Dh=I((XG,P$)=>{"use strict";var io={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},j1={arrowUp:io.arrowUp,arrowDown:io.arrowDown,arrowLeft:io.arrowLeft,arrowRight:io.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},L1=process.platform==="win32"?j1:io;P$.exports=L1});var D$=I((YG,O$)=>{"use strict";var Rn=te(),xr=Dh(),Mh=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"\u{1F603}".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}}),U1=e=>Mh[e]||Mh.default,oo=Object.freeze({aborted:Rn.red(xr.cross),done:Rn.green(xr.tick),exited:Rn.yellow(xr.cross),default:Rn.cyan("?")}),F1=(e,t,n)=>t?oo.aborted:n?oo.exited:e?oo.done:oo.default,Z1=e=>Rn.gray(e?xr.ellipsis:xr.pointerSmall),B1=(e,t)=>Rn.gray(e?t?xr.pointerSmall:"+":xr.line);O$.exports={styles:Mh,render:U1,symbols:oo,symbol:F1,delimiter:Z1,item:B1}});var z$=I((JG,M$)=>{"use strict";var V1=mc();M$.exports=function(e,t){let n=String(V1(e)||"").split(/\r?\n/);return t?n.map(i=>Math.ceil(i.length/t)).reduce((i,r)=>i+r):n.length}});var L$=I((QG,j$)=>{"use strict";j$.exports=(e,t={})=>{let n=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",i=t.width;return(e||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((o,a)=>(a.length+n.length>=i||o[o.length-1].length+a.length+1<i?o[o.length-1]+=` ${a}`:o.push(`${n}${a}`),o),[n]).join(`
|
|
54
54
|
`)).join(`
|
|
55
|
-
`)}});var F$=I((
|
|
55
|
+
`)}});var F$=I((eW,U$)=>{"use strict";U$.exports=(e,t,n)=>{n=n||t;let i=Math.min(t-n,e-Math.floor(n/2));i<0&&(i=0);let r=Math.min(i+n,t);return{startIndex:i,endIndex:r}}});var et=I((tW,Z$)=>{"use strict";Z$.exports={action:w$(),clear:R$(),style:D$(),strip:mc(),figures:Dh(),lines:z$(),wrap:L$(),entriesToDisplay:F$()}});var Tt=I((rW,V$)=>{"use strict";var B$=co("readline"),{action:G1}=et(),W1=co("events"),{beep:H1,cursor:q1}=re(),K1=te(),zh=class extends W1{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);let n=B$.createInterface({input:this.in,escapeCodeTimeout:50});B$.emitKeypressEvents(this.in,n),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(o,a)=>{let c=G1(a,i);c===!1?this._&&this._(o,a):typeof this[c]=="function"?this[c](a):this.bell()};this.close=()=>{this.out.write(q1.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),n.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(H1)}render(){this.onRender(K1),this.firstRender&&(this.firstRender=!1)}};V$.exports=zh});var W$=I((nW,G$)=>{var pc=te(),X1=Tt(),{erase:Y1,cursor:ao}=re(),{style:jh,clear:Lh,lines:J1,figures:Q1}=et(),Uh=class extends X1{constructor(t={}){super(t),this.transform=jh.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=Lh("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=pc.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
56
56
|
`),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
57
57
|
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,n){let i=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${i}${t}${r}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),n=this.value.slice(this.cursor);this.value=`${t}${n}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor+1);this.value=`${t}${n}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ao.down(J1(this.outputError,this.out.columns)-1)+Lh(this.outputError,this.out.columns)),this.out.write(Lh(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[jh.symbol(this.done,this.aborted),pc.bold(this.msg),jh.delimiter(this.done),this.red?pc.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
58
58
|
`).reduce((t,n,i)=>t+`
|
|
59
|
-
${i?" ":Q1.pointerSmall} ${pc.red().italic(n)}`,"")),this.out.write(Y1.line+ao.to(0)+this.outputText+ao.save+this.outputError+ao.restore+ao.move(this.cursorOffset,0)))}};G$.exports=Uh});var X$=I((
|
|
59
|
+
${i?" ":Q1.pointerSmall} ${pc.red().italic(n)}`,"")),this.out.write(Y1.line+ao.to(0)+this.outputText+ao.save+this.outputError+ao.restore+ao.move(this.cursorOffset,0)))}};G$.exports=Uh});var X$=I((iW,K$)=>{"use strict";var wt=te(),eO=Tt(),{style:H$,clear:q$,figures:fc,wrap:tO,entriesToDisplay:rO}=et(),{cursor:nO}=re(),Fh=class extends eO{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((n,i)=>(typeof n=="string"&&(n={title:n,value:i}),{title:n&&(n.title||n.value||n),value:n&&(n.value===void 0?i:n.value),description:n&&n.description,selected:n&&n.selected,disabled:n&&n.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=q$("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
60
60
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
61
61
|
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,n){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(nO.hide):this.out.write(q$(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:n}=rO(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[H$.symbol(this.done,this.aborted),wt.bold(this.msg),H$.delimiter(!1),this.done?this.selection.title:this.selection.disabled?wt.yellow(this.warn):wt.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
62
62
|
`;for(let i=t;i<n;i++){let r,o,a="",c=this.choices[i];i===t&&t>0?o=fc.arrowUp:i===n-1&&n<this.choices.length?o=fc.arrowDown:o=" ",c.disabled?(r=this.cursor===i?wt.gray().underline(c.title):wt.strikethrough().gray(c.title),o=(this.cursor===i?wt.bold().gray(fc.pointer)+" ":" ")+o):(r=this.cursor===i?wt.cyan().underline(c.title):c.title,o=(this.cursor===i?wt.cyan(fc.pointer)+" ":" ")+o,c.description&&this.cursor===i&&(a=` - ${c.description}`,(o.length+r.length+a.length>=this.out.columns||c.description.split(/\r?\n/).length>1)&&(a=`
|
|
63
63
|
`+tO(c.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${r}${wt.gray(a)}
|
|
64
|
-
`}}this.out.write(this.outputText)}};K$.exports=Fh});var eI=I((
|
|
64
|
+
`}}this.out.write(this.outputText)}};K$.exports=Fh});var eI=I((oW,Q$)=>{var hc=te(),iO=Tt(),{style:Y$,clear:oO}=et(),{cursor:J$,erase:aO}=re(),Zh=class extends iO{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
65
65
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
66
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,n){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(J$.hide):this.out.write(oO(this.outputText,this.out.columns)),super.render(),this.outputText=[Y$.symbol(this.done,this.aborted),hc.bold(this.msg),Y$.delimiter(this.done),this.value?this.inactive:hc.cyan().underline(this.inactive),hc.gray("/"),this.value?hc.cyan().underline(this.active):this.active].join(" "),this.out.write(aO.line+J$.to(0)+this.outputText))}};Q$.exports=Zh});var dt=I((
|
|
66
|
+
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,n){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(J$.hide):this.out.write(oO(this.outputText,this.out.columns)),super.render(),this.outputText=[Y$.symbol(this.done,this.aborted),hc.bold(this.msg),Y$.delimiter(this.done),this.value?this.inactive:hc.cyan().underline(this.inactive),hc.gray("/"),this.value?hc.cyan().underline(this.active):this.active].join(" "),this.out.write(aO.line+J$.to(0)+this.outputText))}};Q$.exports=Zh});var dt=I((aW,tI)=>{"use strict";var Bh=class e{constructor({token:t,date:n,parts:i,locales:r}){this.token=t,this.date=n||new Date,this.parts=i||[this],this.locales=r||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((n,i)=>i>t&&n instanceof e)}setTo(t){}prev(){let t=[].concat(this.parts).reverse(),n=t.indexOf(this);return t.find((i,r)=>r>n&&i instanceof e)}toString(){return String(this.date)}};tI.exports=Bh});var nI=I((sW,rI)=>{"use strict";var sO=dt(),Vh=class extends sO{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}};rI.exports=Vh});var oI=I((cW,iI)=>{"use strict";var cO=dt(),uO=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),Gh=class extends cO{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),n=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+uO(t):this.token==="d"?n+1:this.token==="ddd"?this.locales.weekdaysShort[n]:this.token==="dddd"?this.locales.weekdays[n]:t}};iI.exports=Gh});var sI=I((uW,aI)=>{"use strict";var lO=dt(),Wh=class extends lO{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}};aI.exports=Wh});var uI=I((lW,cI)=>{"use strict";var dO=dt(),Hh=class extends dO{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};cI.exports=Hh});var dI=I((dW,lI)=>{"use strict";var mO=dt(),qh=class extends mO{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}};lI.exports=qh});var pI=I((mW,mI)=>{"use strict";var pO=dt(),Kh=class extends pO{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),n=this.token.length;return n===2?String(t+1).padStart(2,"0"):n===3?this.locales.monthsShort[t]:n===4?this.locales.months[t]:String(t+1)}};mI.exports=Kh});var hI=I((pW,fI)=>{"use strict";var fO=dt(),Xh=class extends fO{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}};fI.exports=Xh});var vI=I((fW,gI)=>{"use strict";var hO=dt(),Yh=class extends hO{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}};gI.exports=Yh});var yI=I((hW,bI)=>{"use strict";bI.exports={DatePart:dt(),Meridiem:nI(),Day:oI(),Hours:sI(),Milliseconds:uI(),Minutes:dI(),Month:pI(),Seconds:hI(),Year:vI()}});var AI=I((gW,II)=>{"use strict";var Jh=te(),gO=Tt(),{style:_I,clear:SI,figures:vO}=et(),{erase:bO,cursor:xI}=re(),{DatePart:EI,Meridiem:yO,Day:_O,Hours:SO,Milliseconds:xO,Minutes:EO,Month:$O,Seconds:IO,Year:AO}=yI(),TO=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,$I={1:({token:e})=>e.replace(/\\(.)/g,"$1"),2:e=>new _O(e),3:e=>new $O(e),4:e=>new AO(e),5:e=>new yO(e),6:e=>new SO(e),7:e=>new EO(e),8:e=>new IO(e),9:e=>new xO(e)},wO={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},Qh=class extends gO{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(wO,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=SI("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let n;for(this.parts=[];n=TO.exec(t);){let r=n.shift(),o=n.findIndex(a=>a!=null);this.parts.push(o in $I?$I[o]({token:n[o]||r,date:this.date,parts:this.parts,locales:this.locales}):n[o]||r)}let i=this.parts.reduce((r,o)=>(typeof o=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=o:r.push(o),r),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex(t=>t instanceof EI)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
67
67
|
`),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
68
68
|
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex(n=>n instanceof EI)),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(xI.hide):this.out.write(SI(this.outputText,this.out.columns)),super.render(),this.outputText=[_I.symbol(this.done,this.aborted),Jh.bold(this.msg),_I.delimiter(!1),this.parts.reduce((t,n,i)=>t.concat(i===this.cursor&&!this.done?Jh.cyan().underline(n.toString()):n),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
69
69
|
`).reduce((t,n,i)=>t+`
|
|
70
|
-
${i?" ":vO.pointerSmall} ${Jh.red().italic(n)}`,"")),this.out.write(bO.line+xI.to(0)+this.outputText))}};II.exports=Qh});var kI=I((
|
|
70
|
+
${i?" ":vO.pointerSmall} ${Jh.red().italic(n)}`,"")),this.out.write(bO.line+xI.to(0)+this.outputText))}};II.exports=Qh});var kI=I((vW,NI)=>{var gc=te(),NO=Tt(),{cursor:vc,erase:kO}=re(),{style:eg,figures:CO,clear:TI,lines:RO}=et(),PO=/[0-9]/,tg=e=>e!==void 0,wI=(e,t)=>{let n=Math.pow(10,t);return Math.round(e*n)/n},rg=class extends NO{constructor(t={}){super(t),this.transform=eg.render(t.style),this.msg=t.message,this.initial=tg(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=tg(t.min)?t.min:-1/0,this.max=tg(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){!t&&t!==0?(this.placeholder=!0,this.rendered=gc.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${wI(t,this.round)}`),this._value=wI(t,this.round)),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t==="-"||t==="."&&this.float||PO.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==""?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
71
71
|
`),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let t=this.value;this.value=t!==""?t:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
72
72
|
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(t,n){if(!this.valid(t))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=i,this.color="cyan",t===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(vc.down(RO(this.outputError,this.out.columns)-1)+TI(this.outputError,this.out.columns)),this.out.write(TI(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[eg.symbol(this.done,this.aborted),gc.bold(this.msg),eg.delimiter(this.done),!this.done||!this.done&&!this.placeholder?gc[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
73
73
|
`).reduce((t,n,i)=>t+`
|
|
74
|
-
${i?" ":CO.pointerSmall} ${gc.red().italic(n)}`,"")),this.out.write(kO.line+vc.to(0)+this.outputText+vc.save+this.outputError+vc.restore))}};NI.exports=rg});var ig=I((
|
|
74
|
+
${i?" ":CO.pointerSmall} ${gc.red().italic(n)}`,"")),this.out.write(kO.line+vc.to(0)+this.outputText+vc.save+this.outputError+vc.restore))}};NI.exports=rg});var ig=I((bW,PI)=>{"use strict";var mt=te(),{cursor:OO}=re(),DO=Tt(),{clear:CI,figures:Kt,style:RI,wrap:MO,entriesToDisplay:zO}=et(),ng=class extends DO{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map((n,i)=>(typeof n=="string"&&(n={title:n,value:i}),{title:n&&(n.title||n.value||n),description:n&&n.description,value:n&&(n.value===void 0?i:n.value),selected:n&&n.selected,disabled:n&&n.disabled})),this.clear=CI("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map(t=>!t.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(t=>t.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
75
75
|
`),this.close()}submit(){let t=this.value.filter(n=>n.selected);this.minSelected&&t.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
76
76
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let t=!this.value[this.cursor].selected;this.value.filter(n=>!n.disabled).forEach(n=>n.selected=t),this.render()}_(t,n){if(t===" ")this.handleSpaceToggle();else if(t==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
77
77
|
Instructions:
|
|
@@ -81,13 +81,13 @@ Instructions:
|
|
|
81
81
|
`:"")+" enter/return: Complete answer":""}renderOption(t,n,i,r){let o=(n.selected?mt.green(Kt.radioOn):Kt.radioOff)+" "+r+" ",a,c;return n.disabled?a=t===i?mt.gray().underline(n.title):mt.strikethrough().gray(n.title):(a=t===i?mt.cyan().underline(n.title):n.title,t===i&&n.description&&(c=` - ${n.description}`,(o.length+a.length+c.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(c=`
|
|
82
82
|
`+MO(n.description,{margin:o.length,width:this.out.columns})))),o+a+mt.gray(c||"")}paginateOptions(t){if(t.length===0)return mt.red("No matches for this query.");let{startIndex:n,endIndex:i}=zO(this.cursor,t.length,this.optionsPerPage),r,o=[];for(let a=n;a<i;a++)a===n&&n>0?r=Kt.arrowUp:a===i-1&&i<t.length?r=Kt.arrowDown:r=" ",o.push(this.renderOption(this.cursor,t[a],a,r));return`
|
|
83
83
|
`+o.join(`
|
|
84
|
-
`)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let t=[mt.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(mt.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(OO.hide),super.render();let t=[RI.symbol(this.done,this.aborted),mt.bold(this.msg),RI.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=mt.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=CI(t,this.out.columns)}};PI.exports=ng});var jI=I((
|
|
84
|
+
`)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let t=[mt.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(mt.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(OO.hide),super.render();let t=[RI.symbol(this.done,this.aborted),mt.bold(this.msg),RI.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=mt.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=CI(t,this.out.columns)}};PI.exports=ng});var jI=I((yW,zI)=>{"use strict";var so=te(),jO=Tt(),{erase:LO,cursor:OI}=re(),{style:og,clear:DI,figures:ag,wrap:UO,entriesToDisplay:FO}=et(),MI=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),ZO=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),BO=(e,t)=>{let n=e.findIndex(i=>i.value===t||i.title===t);return n>-1?n:void 0},sg=class extends jO{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial=typeof t.initial=="number"?t.initial:BO(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=og.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=DI("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return typeof this._fb=="number"?t=this.choices[this._fb]:typeof this._fb=="string"&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=MI(this.suggestions,t):this.value=this.fallback.value,this.fire()}async complete(t){let n=this.completing=this.suggest(this.input,this.choices),i=await n;if(this.completing!==n)return;this.suggestions=i.map((o,a,c)=>({title:ZO(c,a),value:MI(c,a),description:o.description})),this.completing=!1;let r=Math.max(i.length-1,0);this.moveSelect(Math.min(r,this.select)),t&&t()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
85
85
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
86
86
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
87
87
|
`),this.close()}_(t,n){let i=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${i}${t}${r}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),n=this.input.slice(this.cursor);this.input=`${t}${n}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor+1);this.input=`${t}${n}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,n,i,r){let o,a=i?ag.arrowUp:r?ag.arrowDown:" ",c=n?so.cyan().underline(t.title):t.title;return a=(n?so.cyan(ag.pointer)+" ":" ")+a,t.description&&(o=` - ${t.description}`,(a.length+c.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o=`
|
|
88
88
|
`+UO(t.description,{margin:3,width:this.out.columns}))),a+" "+c+so.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(OI.hide):this.out.write(DI(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:n}=FO(this.select,this.choices.length,this.limit);if(this.outputText=[og.symbol(this.done,this.aborted,this.exited),so.bold(this.msg),og.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(t,n).map((r,o)=>this.renderOption(r,this.select===o+t,o===0&&t>0,o+t===n-1&&n<this.choices.length)).join(`
|
|
89
89
|
`);this.outputText+=`
|
|
90
|
-
`+(i||so.gray(this.fallback.title))}this.out.write(LO.line+OI.to(0)+this.outputText)}};zI.exports=sg});var ZI=I((
|
|
90
|
+
`+(i||so.gray(this.fallback.title))}this.out.write(LO.line+OI.to(0)+this.outputText)}};zI.exports=sg});var ZI=I((_W,FI)=>{"use strict";var Nt=te(),{cursor:VO}=re(),GO=ig(),{clear:LI,style:UI,figures:Pn}=et(),cg=class extends GO{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=LI("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let n=this.filteredOptions.findIndex(i=>i===t);this.cursor=n<0?0:n,this.render()}handleSpaceToggle(){let t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,n){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
91
91
|
Instructions:
|
|
92
92
|
${Pn.arrowUp}/${Pn.arrowDown}: Highlight option
|
|
93
93
|
${Pn.arrowLeft}/${Pn.arrowRight}/[space]: Toggle selection
|
|
@@ -95,9 +95,9 @@ Instructions:
|
|
|
95
95
|
enter/return: Complete answer
|
|
96
96
|
`:""}renderCurrentInput(){return`
|
|
97
97
|
Filtered results for: ${this.inputValue?this.inputValue:Nt.gray("Enter something to filter")}
|
|
98
|
-
`}renderOption(t,n,i){let r;return n.disabled?r=t===i?Nt.gray().underline(n.title):Nt.strikethrough().gray(n.title):r=t===i?Nt.cyan().underline(n.title):n.title,(n.selected?Nt.green(Pn.radioOn):Pn.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let t=[Nt.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(Nt.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(VO.hide),super.render();let t=[UI.symbol(this.done,this.aborted),Nt.bold(this.msg),UI.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=Nt.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=LI(t,this.out.columns)}};FI.exports=cg});var HI=I((
|
|
98
|
+
`}renderOption(t,n,i){let r;return n.disabled?r=t===i?Nt.gray().underline(n.title):Nt.strikethrough().gray(n.title):r=t===i?Nt.cyan().underline(n.title):n.title,(n.selected?Nt.green(Pn.radioOn):Pn.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let t=[Nt.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(Nt.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(VO.hide),super.render();let t=[UI.symbol(this.done,this.aborted),Nt.bold(this.msg),UI.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=Nt.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=LI(t,this.out.columns)}};FI.exports=cg});var HI=I((SW,WI)=>{var BI=te(),WO=Tt(),{style:VI,clear:HO}=et(),{erase:qO,cursor:GI}=re(),ug=class extends WO{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
99
99
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
100
|
-
`),this.close()}_(t,n){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(GI.hide):this.out.write(HO(this.outputText,this.out.columns)),super.render(),this.outputText=[VI.symbol(this.done,this.aborted),BI.bold(this.msg),VI.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:BI.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(qO.line+GI.to(0)+this.outputText))}};WI.exports=ug});var KI=I((x8,qI)=>{"use strict";qI.exports={TextPrompt:W$(),SelectPrompt:X$(),TogglePrompt:eI(),DatePrompt:AI(),NumberPrompt:kI(),MultiselectPrompt:ig(),AutocompletePrompt:jI(),AutocompleteMultiselectPrompt:ZI(),ConfirmPrompt:HI()}});var YI=I(XI=>{"use strict";var De=XI,KO=KI(),bc=e=>e;function pt(e,t,n={}){return new Promise((i,r)=>{let o=new KO[e](t),a=n.onAbort||bc,c=n.onSubmit||bc,u=n.onExit||bc;o.on("state",t.onState||bc),o.on("submit",l=>i(c(l))),o.on("exit",l=>i(u(l))),o.on("abort",l=>r(a(l)))})}De.text=e=>pt("TextPrompt",e);De.password=e=>(e.style="password",De.text(e));De.invisible=e=>(e.style="invisible",De.text(e));De.number=e=>pt("NumberPrompt",e);De.date=e=>pt("DatePrompt",e);De.confirm=e=>pt("ConfirmPrompt",e);De.list=e=>{let t=e.separator||",";return pt("TextPrompt",e,{onSubmit:n=>n.split(t).map(i=>i.trim())})};De.toggle=e=>pt("TogglePrompt",e);De.select=e=>pt("SelectPrompt",e);De.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=n=>n.filter(i=>i.selected).map(i=>i.value);return pt("MultiselectPrompt",e,{onAbort:t,onSubmit:t})};De.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=n=>n.filter(i=>i.selected).map(i=>i.value);return pt("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};var XO=(e,t)=>Promise.resolve(t.filter(n=>n.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));De.autocomplete=e=>(e.suggest=e.suggest||XO,e.choices=[].concat(e.choices||[]),pt("AutocompletePrompt",e))});var eA=I(($8,QI)=>{"use strict";var lg=YI(),YO=["suggest","format","onState","validate","onRender","type"],JI=()=>{};async function Xt(e=[],{onSubmit:t=JI,onCancel:n=JI}={}){let i={},r=Xt._override||{};e=[].concat(e);let o,a,c,u,l,m,f=async(h,v,$=!1)=>{if(!(!$&&h.validate&&h.validate(v)!==!0))return h.format?await h.format(v,i):v};for(a of e)if({name:u,type:l}=a,typeof l=="function"&&(l=await l(o,{...i},a),a.type=l),!!l){for(let h in a){if(YO.includes(h))continue;let v=a[h];a[h]=typeof v=="function"?await v(o,{...i},m):v}if(m=a,typeof a.message!="string")throw new Error("prompt message is required");if({name:u,type:l}=a,lg[l]===void 0)throw new Error(`prompt type (${l}) is not defined`);if(r[a.name]!==void 0&&(o=await f(a,r[a.name]),o!==void 0)){i[u]=o;continue}try{o=Xt._injected?JO(Xt._injected,a.initial):await lg[l](a),i[u]=o=await f(a,o,!0),c=await t(a,o,i)}catch{c=!await n(a,i)}if(c)return i}return i}function JO(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function QO(e){Xt._injected=(Xt._injected||[]).concat(e)}function eD(e){Xt._override=Object.assign({},e)}QI.exports=Object.assign(Xt,{prompt:Xt,prompts:lg,inject:QO,override:eD})});var dg=I((I8,tA)=>{function tD(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let t=0,n=process.versions.node.split(".").map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}tA.exports=tD("8.6.0")?A$():eA()});import*as Nn from"fs";import*as Ix from"path";function rt(e){return e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase()).replace(/^./,t=>t.toUpperCase())}function Ct(e){return e instanceof Error?e:new Error(String(e))}function Jt(e){return e instanceof Error?e.message:typeof e=="string"?e:e&&typeof e=="object"&&"message"in e?String(e.message):"An unknown error occurred"}var pA=/fjall_ak_[A-Z2-7]{16}\.[A-Z2-7]{40}/g;function _c(e){return e.replace(/-----BEGIN [A-Z ]*PRIVATE KEY-----(?:[^"\\]|\\[\\nrt"])*?-----END [A-Z ]*PRIVATE KEY-----/g,"-----BEGIN [REDACTED] PRIVATE KEY-----...-----END [REDACTED] PRIVATE KEY-----").replace(/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,"-----BEGIN [REDACTED] PRIVATE KEY-----...-----END [REDACTED] PRIVATE KEY-----").replace(/(\w+:\/\/[^:]+:)[^@]+(@)/gi,"$1***$2").replace(/(?<![a-zA-Z])(password|passwd|secret|api[_-]?key|token|auth|credential)([=:])["']?[^\s"']+/gi,"$1$2***").replace(/\b(ghu_|ghs_|ghp_|gho_|github_pat_)[A-Za-z0-9_]+/g,"$1***").replace(/\b(sk|rk)_(live|test)_[A-Za-z0-9]{8,}/g,"$1_$2_***").replace(/\bwhsec_[A-Za-z0-9]{8,}/g,"whsec_***").replace(/(?<=Authorization:\s*Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"***").replace(/\b(AKIA|ASIA)[A-Z0-9]{12,}\b/g,"$1***").replace(/(?<=aws_secret_access_key\s*=\s*["']?|SecretAccessKey[=:]\s*|"(aws)?secretAccessKey":\s*"|"aws_secret_access_key":\s*")[A-Za-z0-9/+=]{40,}/gi,"***").replace(/(arn:aws[^:]*:[^:]*:[^:]*:)(\d{12})(:[^\s]*)/g,"$1***$3").replace(/(?<="(aws)?sessionToken":\s*"|"aws_session_token":\s*")[^"]+/gi,"***").replace(/(?<=aws_session_token\s*[=:]\s*["']?|SessionToken[=:]\s*["']?)[^\s"']+/gi,"***").replace(/(?<="(internal[Aa]piKey|fjallCallbackToken)":\s*")[^"]+/g,"***").replace(pA,"fjall_ak_***")}var s={};tt(s,{$brand:()=>xc,$input:()=>Bl,$output:()=>Zl,NEVER:()=>Sc,TimePrecision:()=>Hl,ZodAny:()=>Mm,ZodArray:()=>Um,ZodBase64:()=>Ma,ZodBase64URL:()=>za,ZodBigInt:()=>en,ZodBigIntFormat:()=>Ua,ZodBoolean:()=>Qr,ZodCIDRv4:()=>Oa,ZodCIDRv6:()=>Da,ZodCUID:()=>Ta,ZodCUID2:()=>wa,ZodCatch:()=>cp,ZodCodec:()=>di,ZodCustom:()=>mi,ZodCustomStringFormat:()=>Yr,ZodDate:()=>ai,ZodDefault:()=>rp,ZodDiscriminatedUnion:()=>Zm,ZodE164:()=>ja,ZodEmail:()=>$a,ZodEmoji:()=>Ia,ZodEnum:()=>Kr,ZodError:()=>V0,ZodExactOptional:()=>Qm,ZodFile:()=>Ym,ZodFirstPartyTypeKind:()=>Sp,ZodFunction:()=>bp,ZodGUID:()=>ti,ZodIPv4:()=>Ra,ZodIPv6:()=>Pa,ZodISODate:()=>ba,ZodISODateTime:()=>va,ZodISODuration:()=>_a,ZodISOTime:()=>ya,ZodIntersection:()=>Bm,ZodIssueCode:()=>W0,ZodJWT:()=>La,ZodKSUID:()=>Ca,ZodLazy:()=>hp,ZodLiteral:()=>Xm,ZodMAC:()=>Nm,ZodMap:()=>qm,ZodNaN:()=>lp,ZodNanoID:()=>Aa,ZodNever:()=>jm,ZodNonOptional:()=>Wa,ZodNull:()=>Om,ZodNullable:()=>tp,ZodNumber:()=>Jr,ZodNumberFormat:()=>sr,ZodObject:()=>ci,ZodOptional:()=>Ga,ZodPipe:()=>li,ZodPrefault:()=>ip,ZodPreprocess:()=>dp,ZodPromise:()=>vp,ZodReadonly:()=>mp,ZodRealError:()=>Ne,ZodRecord:()=>qr,ZodSet:()=>Km,ZodString:()=>Xr,ZodStringFormat:()=>V,ZodSuccess:()=>sp,ZodSymbol:()=>Rm,ZodTemplateLiteral:()=>fp,ZodTransform:()=>Jm,ZodTuple:()=>Gm,ZodType:()=>k,ZodULID:()=>Na,ZodURL:()=>oi,ZodUUID:()=>at,ZodUndefined:()=>Pm,ZodUnion:()=>ui,ZodUnknown:()=>zm,ZodVoid:()=>Lm,ZodXID:()=>ka,ZodXor:()=>Fm,_ZodString:()=>Ea,_default:()=>np,_function:()=>ty,any:()=>Rb,array:()=>si,base64:()=>hb,base64url:()=>gb,bigint:()=>Tb,boolean:()=>Cm,catch:()=>up,check:()=>ry,cidrv4:()=>pb,cidrv6:()=>fb,clone:()=>ye,codec:()=>Yb,coerce:()=>xp,config:()=>ne,core:()=>gt,cuid:()=>ob,cuid2:()=>ab,custom:()=>ny,date:()=>Ob,decode:()=>xm,decodeAsync:()=>$m,describe:()=>iy,discriminatedUnion:()=>Ub,e164:()=>vb,email:()=>Kv,emoji:()=>nb,encode:()=>Sm,encodeAsync:()=>Em,endsWith:()=>jr,enum:()=>Ba,exactOptional:()=>ep,file:()=>Hb,flattenError:()=>Fn,float32:()=>Eb,float64:()=>$b,formatError:()=>Zn,fromJSONSchema:()=>dy,function:()=>ty,getErrorMap:()=>q0,globalRegistry:()=>pe,gt:()=>it,gte:()=>Se,guid:()=>Xv,hash:()=>xb,hex:()=>Sb,hostname:()=>_b,httpUrl:()=>rb,includes:()=>Mr,instanceof:()=>ay,int:()=>Sa,int32:()=>Ib,int64:()=>wb,intersection:()=>Vm,invertCodec:()=>Jb,ipv4:()=>lb,ipv6:()=>mb,iso:()=>Hr,json:()=>cy,jwt:()=>bb,keyof:()=>Db,ksuid:()=>ub,lazy:()=>gp,length:()=>or,literal:()=>Wb,locales:()=>Xn,looseObject:()=>jb,looseRecord:()=>Zb,lowercase:()=>Or,lt:()=>nt,lte:()=>ze,mac:()=>db,map:()=>Bb,maxLength:()=>ir,maxSize:()=>jt,meta:()=>oy,mime:()=>Lr,minLength:()=>ht,minSize:()=>ot,multipleOf:()=>zt,nan:()=>Xb,nanoid:()=>ib,nativeEnum:()=>Gb,negative:()=>sa,never:()=>Fa,nonnegative:()=>ua,nonoptional:()=>ap,nonpositive:()=>ca,normalize:()=>Ur,null:()=>Dm,nullable:()=>ni,nullish:()=>qb,number:()=>km,object:()=>Mb,optional:()=>ri,overwrite:()=>He,parse:()=>vm,parseAsync:()=>bm,partialRecord:()=>Fb,pipe:()=>xa,positive:()=>aa,prefault:()=>op,preprocess:()=>uy,prettifyError:()=>Dc,promise:()=>ey,property:()=>la,readonly:()=>pp,record:()=>Hm,refine:()=>yp,regex:()=>Pr,regexes:()=>Me,registry:()=>Lo,safeDecode:()=>Am,safeDecodeAsync:()=>wm,safeEncode:()=>Im,safeEncodeAsync:()=>Tm,safeParse:()=>ym,safeParseAsync:()=>_m,set:()=>Vb,setErrorMap:()=>H0,size:()=>nr,slugify:()=>Vr,startsWith:()=>zr,strictObject:()=>zb,string:()=>ei,stringFormat:()=>yb,stringbool:()=>sy,success:()=>Kb,superRefine:()=>_p,symbol:()=>kb,templateLiteral:()=>Qb,toJSONSchema:()=>fa,toLowerCase:()=>Zr,toUpperCase:()=>Br,transform:()=>Va,treeifyError:()=>Oc,trim:()=>Fr,tuple:()=>Wm,uint32:()=>Ab,uint64:()=>Nb,ulid:()=>sb,undefined:()=>Cb,union:()=>Za,unknown:()=>ar,uppercase:()=>Dr,url:()=>tb,util:()=>_,uuid:()=>Yv,uuidv4:()=>Jv,uuidv6:()=>Qv,uuidv7:()=>eb,void:()=>Pb,xid:()=>cb,xor:()=>Lb});var gt={};tt(gt,{$ZodAny:()=>ll,$ZodArray:()=>hl,$ZodAsyncError:()=>We,$ZodBase64:()=>el,$ZodBase64URL:()=>tl,$ZodBigInt:()=>Co,$ZodBigIntFormat:()=>al,$ZodBoolean:()=>Wn,$ZodCIDRv4:()=>Yu,$ZodCIDRv6:()=>Ju,$ZodCUID:()=>Lu,$ZodCUID2:()=>Uu,$ZodCatch:()=>Pl,$ZodCheck:()=>q,$ZodCheckBigIntFormat:()=>hu,$ZodCheckEndsWith:()=>Tu,$ZodCheckGreaterThan:()=>Io,$ZodCheckIncludes:()=>Iu,$ZodCheckLengthEquals:()=>Su,$ZodCheckLessThan:()=>$o,$ZodCheckLowerCase:()=>Eu,$ZodCheckMaxLength:()=>yu,$ZodCheckMaxSize:()=>gu,$ZodCheckMimeType:()=>Nu,$ZodCheckMinLength:()=>_u,$ZodCheckMinSize:()=>vu,$ZodCheckMultipleOf:()=>pu,$ZodCheckNumberFormat:()=>fu,$ZodCheckOverwrite:()=>ku,$ZodCheckProperty:()=>wu,$ZodCheckRegex:()=>xu,$ZodCheckSizeEquals:()=>bu,$ZodCheckStartsWith:()=>Au,$ZodCheckStringFormat:()=>Cr,$ZodCheckUpperCase:()=>$u,$ZodCodec:()=>qn,$ZodCustom:()=>Fl,$ZodCustomStringFormat:()=>il,$ZodDate:()=>fl,$ZodDefault:()=>Nl,$ZodDiscriminatedUnion:()=>bl,$ZodE164:()=>rl,$ZodEmail:()=>Du,$ZodEmoji:()=>zu,$ZodEncodeError:()=>Rt,$ZodEnum:()=>El,$ZodError:()=>Un,$ZodExactOptional:()=>Tl,$ZodFile:()=>Il,$ZodFunction:()=>jl,$ZodGUID:()=>Pu,$ZodIPv4:()=>qu,$ZodIPv6:()=>Ku,$ZodISODate:()=>Gu,$ZodISODateTime:()=>Vu,$ZodISODuration:()=>Hu,$ZodISOTime:()=>Wu,$ZodIntersection:()=>yl,$ZodJWT:()=>nl,$ZodKSUID:()=>Bu,$ZodLazy:()=>Ul,$ZodLiteral:()=>$l,$ZodMAC:()=>Xu,$ZodMap:()=>Sl,$ZodNaN:()=>Ol,$ZodNanoID:()=>ju,$ZodNever:()=>ml,$ZodNonOptional:()=>Cl,$ZodNull:()=>ul,$ZodNullable:()=>wl,$ZodNumber:()=>ko,$ZodNumberFormat:()=>ol,$ZodObject:()=>Vg,$ZodObjectJIT:()=>gl,$ZodOptional:()=>Po,$ZodPipe:()=>Oo,$ZodPrefault:()=>kl,$ZodPreprocess:()=>Dl,$ZodPromise:()=>Ll,$ZodReadonly:()=>Ml,$ZodRealError:()=>we,$ZodRecord:()=>_l,$ZodRegistry:()=>jo,$ZodSet:()=>xl,$ZodString:()=>rr,$ZodStringFormat:()=>B,$ZodSuccess:()=>Rl,$ZodSymbol:()=>sl,$ZodTemplateLiteral:()=>zl,$ZodTransform:()=>Al,$ZodTuple:()=>Ro,$ZodType:()=>N,$ZodULID:()=>Fu,$ZodURL:()=>Mu,$ZodUUID:()=>Ou,$ZodUndefined:()=>cl,$ZodUnion:()=>Hn,$ZodUnknown:()=>dl,$ZodVoid:()=>pl,$ZodXID:()=>Zu,$ZodXor:()=>vl,$brand:()=>xc,$constructor:()=>p,$input:()=>Bl,$output:()=>Zl,Doc:()=>Gn,JSONSchema:()=>Wv,JSONSchemaGenerator:()=>ha,NEVER:()=>Sc,TimePrecision:()=>Hl,_any:()=>fd,_array:()=>Sd,_base64:()=>ra,_base64url:()=>na,_bigint:()=>sd,_boolean:()=>od,_catch:()=>M0,_check:()=>Gv,_cidrv4:()=>ea,_cidrv6:()=>ta,_coercedBigint:()=>cd,_coercedBoolean:()=>ad,_coercedDate:()=>yd,_coercedNumber:()=>Ql,_coercedString:()=>Gl,_cuid:()=>Ho,_cuid2:()=>qo,_custom:()=>Ed,_date:()=>bd,_decode:()=>ho,_decodeAsync:()=>vo,_default:()=>P0,_discriminatedUnion:()=>S0,_e164:()=>ia,_email:()=>Uo,_emoji:()=>Go,_encode:()=>fo,_encodeAsync:()=>go,_endsWith:()=>jr,_enum:()=>T0,_file:()=>xd,_float32:()=>td,_float64:()=>rd,_gt:()=>it,_gte:()=>Se,_guid:()=>Yn,_includes:()=>Mr,_int:()=>ed,_int32:()=>nd,_int64:()=>ud,_intersection:()=>x0,_ipv4:()=>Jo,_ipv6:()=>Qo,_isoDate:()=>Kl,_isoDateTime:()=>ql,_isoDuration:()=>Yl,_isoTime:()=>Xl,_jwt:()=>oa,_ksuid:()=>Yo,_lazy:()=>U0,_length:()=>or,_literal:()=>N0,_lowercase:()=>Or,_lt:()=>nt,_lte:()=>ze,_mac:()=>Wl,_map:()=>I0,_max:()=>ze,_maxLength:()=>ir,_maxSize:()=>jt,_mime:()=>Lr,_min:()=>Se,_minLength:()=>ht,_minSize:()=>ot,_multipleOf:()=>zt,_nan:()=>_d,_nanoid:()=>Wo,_nativeEnum:()=>w0,_negative:()=>sa,_never:()=>gd,_nonnegative:()=>ua,_nonoptional:()=>O0,_nonpositive:()=>ca,_normalize:()=>Ur,_null:()=>pd,_nullable:()=>R0,_number:()=>Jl,_optional:()=>C0,_overwrite:()=>He,_parse:()=>Tr,_parseAsync:()=>wr,_pipe:()=>z0,_positive:()=>aa,_promise:()=>F0,_property:()=>la,_readonly:()=>j0,_record:()=>$0,_refine:()=>$d,_regex:()=>Pr,_safeDecode:()=>yo,_safeDecodeAsync:()=>So,_safeEncode:()=>bo,_safeEncodeAsync:()=>_o,_safeParse:()=>Nr,_safeParseAsync:()=>kr,_set:()=>A0,_size:()=>nr,_slugify:()=>Vr,_startsWith:()=>zr,_string:()=>Vl,_stringFormat:()=>Gr,_stringbool:()=>wd,_success:()=>D0,_superRefine:()=>Id,_symbol:()=>dd,_templateLiteral:()=>L0,_toLowerCase:()=>Zr,_toUpperCase:()=>Br,_transform:()=>k0,_trim:()=>Fr,_tuple:()=>E0,_uint32:()=>id,_uint64:()=>ld,_ulid:()=>Ko,_undefined:()=>md,_union:()=>y0,_unknown:()=>hd,_uppercase:()=>Dr,_url:()=>Jn,_uuid:()=>Fo,_uuidv4:()=>Zo,_uuidv6:()=>Bo,_uuidv7:()=>Vo,_void:()=>vd,_xid:()=>Xo,_xor:()=>_0,clone:()=>ye,config:()=>ne,createStandardJSONSchemaMethod:()=>Wr,createToJSONSchemaMethod:()=>Nd,decode:()=>FA,decodeAsync:()=>BA,describe:()=>Ad,encode:()=>UA,encodeAsync:()=>ZA,extractDefs:()=>Ut,finalize:()=>Ft,flattenError:()=>Fn,formatError:()=>Zn,globalConfig:()=>Qt,globalRegistry:()=>pe,initializeContext:()=>Lt,isValidBase64:()=>Qu,isValidBase64URL:()=>Ug,isValidJWT:()=>Fg,locales:()=>Xn,meta:()=>Td,parse:()=>mo,parseAsync:()=>po,prettifyError:()=>Dc,process:()=>j,regexes:()=>Me,registry:()=>Lo,safeDecode:()=>GA,safeDecodeAsync:()=>HA,safeEncode:()=>VA,safeEncodeAsync:()=>WA,safeParse:()=>Mc,safeParseAsync:()=>zc,toDotPath:()=>yg,toJSONSchema:()=>fa,treeifyError:()=>Oc,util:()=>_,version:()=>Cu});var fg,Sc=Object.freeze({status:"aborted"});function p(e,t,n){function i(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);let l=a.prototype,m=Object.keys(l);for(let f=0;f<m.length;f++){let h=m[f];h in c||(c[h]=l[h].bind(c))}}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:e});function a(c){var u;let l=n?.Parent?new o:this;i(l,c),(u=l._zod).deferred??(u.deferred=[]);for(let m of l._zod.deferred)m();return l}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var xc=Symbol("zod_brand"),We=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Rt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(fg=globalThis).__zod_globalConfig??(fg.__zod_globalConfig={});var Qt=globalThis.__zod_globalConfig;function ne(e){return e&&Object.assign(Qt,e),Qt}var _={};tt(_,{BIGINT_FORMAT_RANGES:()=>Rc,Class:()=>$c,NUMBER_FORMAT_RANGES:()=>Cc,aborted:()=>Mt,allowsEval:()=>Tc,assert:()=>bA,assertEqual:()=>fA,assertIs:()=>gA,assertNever:()=>vA,assertNotEqual:()=>hA,assignProp:()=>Ot,base64ToUint8Array:()=>gg,base64urlToUint8Array:()=>DA,cached:()=>Ir,captureStackTrace:()=>lo,cleanEnum:()=>OA,cleanRegex:()=>Mn,clone:()=>ye,cloneDef:()=>_A,createTransparentProxy:()=>AA,defineLazy:()=>O,esc:()=>uo,escapeRegex:()=>Ue,explicitlyAborted:()=>Pc,extend:()=>NA,finalizeIssue:()=>_e,floatSafeRemainder:()=>Ic,getElementAtPath:()=>SA,getEnumValues:()=>Dn,getLengthableOrigin:()=>Ln,getParsedType:()=>IA,getSizableOrigin:()=>jn,hexToUint8Array:()=>zA,isObject:()=>er,isPlainObject:()=>Dt,issue:()=>Ar,joinValues:()=>g,jsonStringifyReplacer:()=>$r,merge:()=>CA,mergeDefs:()=>ft,normalizeParams:()=>S,nullish:()=>Pt,numKeys:()=>$A,objectClone:()=>yA,omit:()=>wA,optionalKeys:()=>kc,parsedType:()=>y,partial:()=>RA,pick:()=>TA,prefixIssues:()=>Te,primitiveTypes:()=>Nc,promiseAllObject:()=>xA,propertyKeyTypes:()=>zn,randomString:()=>EA,required:()=>PA,safeExtend:()=>kA,shallowClone:()=>wc,slugify:()=>Ac,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>vg,uint8ArrayToBase64url:()=>MA,uint8ArrayToHex:()=>jA,unwrapMessage:()=>On});function fA(e){return e}function hA(e){return e}function gA(e){}function vA(e){throw new Error("Unexpected value in exhaustive check")}function bA(e){}function Dn(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function g(e,t="|"){return e.map(n=>b(n)).join(t)}function $r(e,t){return typeof t=="bigint"?t.toString():t}function Ir(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Pt(e){return e==null}function Mn(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Ic(e,t){let n=e/t,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var hg=Symbol("evaluating");function O(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==hg)return i===void 0&&(i=hg,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function yA(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ot(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ft(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function _A(e){return ft(e._zod.def)}function SA(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function xA(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function EA(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function uo(e){return JSON.stringify(e)}function Ac(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var lo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function er(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Tc=Ir(()=>{if(Qt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Dt(e){if(er(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(er(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function wc(e){return Dt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function $A(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var IA=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},zn=new Set(["string","number","symbol"]),Nc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function S(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function AA(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function b(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function kc(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Cc={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Rc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function TA(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=ft(e._zod.def,{get shape(){let a={};for(let c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(a[c]=n.shape[c])}return Ot(this,"shape",a),a},checks:[]});return ye(e,o)}function wA(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=ft(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete a[c]}return Ot(this,"shape",a),a},checks:[]});return ye(e,o)}function NA(e,t){if(!Dt(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let o=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=ft(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Ot(this,"shape",o),o}});return ye(e,r)}function kA(e,t){if(!Dt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=ft(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Ot(this,"shape",i),i}});return ye(e,n)}function CA(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ft(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return Ot(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ye(e,n)}function RA(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=ft(t._zod.def,{get shape(){let c=t._zod.def.shape,u={...c};if(n)for(let l in n){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=e?new e({type:"optional",innerType:c[l]}):c[l])}else for(let l in c)u[l]=e?new e({type:"optional",innerType:c[l]}):c[l];return Ot(this,"shape",u),u},checks:[]});return ye(t,a)}function PA(e,t,n){let i=ft(t._zod.def,{get shape(){let r=t._zod.def.shape,o={...r};if(n)for(let a in n){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(o[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(let a in r)o[a]=new e({type:"nonoptional",innerType:r[a]});return Ot(this,"shape",o),o}});return ye(t,i)}function Mt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Pc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Te(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function On(e){return typeof e=="string"?e:e?.message}function _e(e,t,n){let i=e.message?e.message:On(e.inst?._zod.def?.error?.(e))??On(t?.error?.(e))??On(n.customError?.(e))??On(n.localeError?.(e))??"Invalid input",{inst:r,continue:o,input:a,...c}=e;return c.path??(c.path=[]),c.message=i,t?.reportInput&&(c.input=a),c}function jn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Ln(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function y(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Ar(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function OA(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function gg(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function vg(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function DA(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return gg(t+n)}function MA(e){return vg(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function zA(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function jA(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var $c=class{constructor(...t){}};var bg=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,$r,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Un=p("$ZodError",bg),we=p("$ZodError",bg,{Parent:Error});function Fn(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):i.push(t(r));return{formErrors:i,fieldErrors:n}}function Zn(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let c=[...o,...a.path];if(c.length===0)n._errors.push(t(a));else{let u=n,l=0;for(;l<c.length;){let m=c[l];l===c.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(a))):u[m]=u[m]||{_errors:[]},u=u[m],l++}}}};return i(e),n}function Oc(e,t=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var a,c;for(let u of r.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>i({issues:l},[...o,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...o,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...o,...u.path]);else{let l=[...o,...u.path];if(l.length===0){n.errors.push(t(u));continue}let m=n,f=0;for(;f<l.length;){let h=l[f],v=f===l.length-1;typeof h=="string"?(m.properties??(m.properties={}),(a=m.properties)[h]??(a[h]={errors:[]}),m=m.properties[h]):(m.items??(m.items=[]),(c=m.items)[h]??(c[h]={errors:[]}),m=m.items[h]),v&&m.errors.push(t(u)),f++}}};return i(e),n}function yg(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function Dc(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${yg(i.path)}`);return t.join(`
|
|
100
|
+
`),this.close()}_(t,n){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(GI.hide):this.out.write(HO(this.outputText,this.out.columns)),super.render(),this.outputText=[VI.symbol(this.done,this.aborted),BI.bold(this.msg),VI.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:BI.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(qO.line+GI.to(0)+this.outputText))}};WI.exports=ug});var KI=I((xW,qI)=>{"use strict";qI.exports={TextPrompt:W$(),SelectPrompt:X$(),TogglePrompt:eI(),DatePrompt:AI(),NumberPrompt:kI(),MultiselectPrompt:ig(),AutocompletePrompt:jI(),AutocompleteMultiselectPrompt:ZI(),ConfirmPrompt:HI()}});var YI=I(XI=>{"use strict";var De=XI,KO=KI(),bc=e=>e;function pt(e,t,n={}){return new Promise((i,r)=>{let o=new KO[e](t),a=n.onAbort||bc,c=n.onSubmit||bc,u=n.onExit||bc;o.on("state",t.onState||bc),o.on("submit",l=>i(c(l))),o.on("exit",l=>i(u(l))),o.on("abort",l=>r(a(l)))})}De.text=e=>pt("TextPrompt",e);De.password=e=>(e.style="password",De.text(e));De.invisible=e=>(e.style="invisible",De.text(e));De.number=e=>pt("NumberPrompt",e);De.date=e=>pt("DatePrompt",e);De.confirm=e=>pt("ConfirmPrompt",e);De.list=e=>{let t=e.separator||",";return pt("TextPrompt",e,{onSubmit:n=>n.split(t).map(i=>i.trim())})};De.toggle=e=>pt("TogglePrompt",e);De.select=e=>pt("SelectPrompt",e);De.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=n=>n.filter(i=>i.selected).map(i=>i.value);return pt("MultiselectPrompt",e,{onAbort:t,onSubmit:t})};De.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=n=>n.filter(i=>i.selected).map(i=>i.value);return pt("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};var XO=(e,t)=>Promise.resolve(t.filter(n=>n.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));De.autocomplete=e=>(e.suggest=e.suggest||XO,e.choices=[].concat(e.choices||[]),pt("AutocompletePrompt",e))});var eA=I(($W,QI)=>{"use strict";var lg=YI(),YO=["suggest","format","onState","validate","onRender","type"],JI=()=>{};async function Xt(e=[],{onSubmit:t=JI,onCancel:n=JI}={}){let i={},r=Xt._override||{};e=[].concat(e);let o,a,c,u,l,m,f=async(h,v,$=!1)=>{if(!(!$&&h.validate&&h.validate(v)!==!0))return h.format?await h.format(v,i):v};for(a of e)if({name:u,type:l}=a,typeof l=="function"&&(l=await l(o,{...i},a),a.type=l),!!l){for(let h in a){if(YO.includes(h))continue;let v=a[h];a[h]=typeof v=="function"?await v(o,{...i},m):v}if(m=a,typeof a.message!="string")throw new Error("prompt message is required");if({name:u,type:l}=a,lg[l]===void 0)throw new Error(`prompt type (${l}) is not defined`);if(r[a.name]!==void 0&&(o=await f(a,r[a.name]),o!==void 0)){i[u]=o;continue}try{o=Xt._injected?JO(Xt._injected,a.initial):await lg[l](a),i[u]=o=await f(a,o,!0),c=await t(a,o,i)}catch{c=!await n(a,i)}if(c)return i}return i}function JO(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function QO(e){Xt._injected=(Xt._injected||[]).concat(e)}function eD(e){Xt._override=Object.assign({},e)}QI.exports=Object.assign(Xt,{prompt:Xt,prompts:lg,inject:QO,override:eD})});var dg=I((IW,tA)=>{function tD(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let t=0,n=process.versions.node.split(".").map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}tA.exports=tD("8.6.0")?A$():eA()});import*as Nn from"fs";import*as Ix from"path";function rt(e){return e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase()).replace(/^./,t=>t.toUpperCase())}function Ct(e){return e instanceof Error?e:new Error(String(e))}function Jt(e){return e instanceof Error?e.message:typeof e=="string"?e:e&&typeof e=="object"&&"message"in e?String(e.message):"An unknown error occurred"}var pA=/fjall_ak_[A-Z2-7]{16}\.[A-Z2-7]{40}/g;function _c(e){return e.replace(/-----BEGIN [A-Z ]*PRIVATE KEY-----(?:[^"\\]|\\[\\nrt"])*?-----END [A-Z ]*PRIVATE KEY-----/g,"-----BEGIN [REDACTED] PRIVATE KEY-----...-----END [REDACTED] PRIVATE KEY-----").replace(/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,"-----BEGIN [REDACTED] PRIVATE KEY-----...-----END [REDACTED] PRIVATE KEY-----").replace(/(\w+:\/\/[^:]+:)[^@]+(@)/gi,"$1***$2").replace(/(?<![a-zA-Z])(password|passwd|secret|api[_-]?key|token|auth|credential)([=:])["']?[^\s"']+/gi,"$1$2***").replace(/\b(ghu_|ghs_|ghp_|gho_|github_pat_)[A-Za-z0-9_]+/g,"$1***").replace(/\b(sk|rk)_(live|test)_[A-Za-z0-9]{8,}/g,"$1_$2_***").replace(/\bwhsec_[A-Za-z0-9]{8,}/g,"whsec_***").replace(/(?<=Authorization:\s*Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"***").replace(/\b(AKIA|ASIA)[A-Z0-9]{12,}\b/g,"$1***").replace(/(?<=aws_secret_access_key\s*=\s*["']?|SecretAccessKey[=:]\s*|"(aws)?secretAccessKey":\s*"|"aws_secret_access_key":\s*")[A-Za-z0-9/+=]{40,}/gi,"***").replace(/(arn:aws[^:]*:[^:]*:[^:]*:)(\d{12})(:[^\s]*)/g,"$1***$3").replace(/(?<="(aws)?sessionToken":\s*"|"aws_session_token":\s*")[^"]+/gi,"***").replace(/(?<=aws_session_token\s*[=:]\s*["']?|SessionToken[=:]\s*["']?)[^\s"']+/gi,"***").replace(/(?<="(internal[Aa]piKey|fjallCallbackToken)":\s*")[^"]+/g,"***").replace(pA,"fjall_ak_***")}var s={};tt(s,{$brand:()=>xc,$input:()=>Bl,$output:()=>Zl,NEVER:()=>Sc,TimePrecision:()=>Hl,ZodAny:()=>Mm,ZodArray:()=>Um,ZodBase64:()=>Ma,ZodBase64URL:()=>za,ZodBigInt:()=>en,ZodBigIntFormat:()=>Ua,ZodBoolean:()=>Qr,ZodCIDRv4:()=>Oa,ZodCIDRv6:()=>Da,ZodCUID:()=>Ta,ZodCUID2:()=>wa,ZodCatch:()=>cp,ZodCodec:()=>di,ZodCustom:()=>mi,ZodCustomStringFormat:()=>Yr,ZodDate:()=>ai,ZodDefault:()=>rp,ZodDiscriminatedUnion:()=>Zm,ZodE164:()=>ja,ZodEmail:()=>$a,ZodEmoji:()=>Ia,ZodEnum:()=>Kr,ZodError:()=>V0,ZodExactOptional:()=>Qm,ZodFile:()=>Ym,ZodFirstPartyTypeKind:()=>Sp,ZodFunction:()=>bp,ZodGUID:()=>ti,ZodIPv4:()=>Ra,ZodIPv6:()=>Pa,ZodISODate:()=>ba,ZodISODateTime:()=>va,ZodISODuration:()=>_a,ZodISOTime:()=>ya,ZodIntersection:()=>Bm,ZodIssueCode:()=>W0,ZodJWT:()=>La,ZodKSUID:()=>Ca,ZodLazy:()=>hp,ZodLiteral:()=>Xm,ZodMAC:()=>Nm,ZodMap:()=>qm,ZodNaN:()=>lp,ZodNanoID:()=>Aa,ZodNever:()=>jm,ZodNonOptional:()=>Wa,ZodNull:()=>Om,ZodNullable:()=>tp,ZodNumber:()=>Jr,ZodNumberFormat:()=>sr,ZodObject:()=>ci,ZodOptional:()=>Ga,ZodPipe:()=>li,ZodPrefault:()=>ip,ZodPreprocess:()=>dp,ZodPromise:()=>vp,ZodReadonly:()=>mp,ZodRealError:()=>Ne,ZodRecord:()=>qr,ZodSet:()=>Km,ZodString:()=>Xr,ZodStringFormat:()=>V,ZodSuccess:()=>sp,ZodSymbol:()=>Rm,ZodTemplateLiteral:()=>fp,ZodTransform:()=>Jm,ZodTuple:()=>Gm,ZodType:()=>k,ZodULID:()=>Na,ZodURL:()=>oi,ZodUUID:()=>at,ZodUndefined:()=>Pm,ZodUnion:()=>ui,ZodUnknown:()=>zm,ZodVoid:()=>Lm,ZodXID:()=>ka,ZodXor:()=>Fm,_ZodString:()=>Ea,_default:()=>np,_function:()=>ty,any:()=>Rb,array:()=>si,base64:()=>hb,base64url:()=>gb,bigint:()=>Tb,boolean:()=>Cm,catch:()=>up,check:()=>ry,cidrv4:()=>pb,cidrv6:()=>fb,clone:()=>ye,codec:()=>Yb,coerce:()=>xp,config:()=>ne,core:()=>gt,cuid:()=>ob,cuid2:()=>ab,custom:()=>ny,date:()=>Ob,decode:()=>xm,decodeAsync:()=>$m,describe:()=>iy,discriminatedUnion:()=>Ub,e164:()=>vb,email:()=>Kv,emoji:()=>nb,encode:()=>Sm,encodeAsync:()=>Em,endsWith:()=>jr,enum:()=>Ba,exactOptional:()=>ep,file:()=>Hb,flattenError:()=>Fn,float32:()=>Eb,float64:()=>$b,formatError:()=>Zn,fromJSONSchema:()=>dy,function:()=>ty,getErrorMap:()=>q0,globalRegistry:()=>pe,gt:()=>it,gte:()=>Se,guid:()=>Xv,hash:()=>xb,hex:()=>Sb,hostname:()=>_b,httpUrl:()=>rb,includes:()=>Mr,instanceof:()=>ay,int:()=>Sa,int32:()=>Ib,int64:()=>wb,intersection:()=>Vm,invertCodec:()=>Jb,ipv4:()=>lb,ipv6:()=>mb,iso:()=>Hr,json:()=>cy,jwt:()=>bb,keyof:()=>Db,ksuid:()=>ub,lazy:()=>gp,length:()=>or,literal:()=>Wb,locales:()=>Xn,looseObject:()=>jb,looseRecord:()=>Zb,lowercase:()=>Or,lt:()=>nt,lte:()=>ze,mac:()=>db,map:()=>Bb,maxLength:()=>ir,maxSize:()=>jt,meta:()=>oy,mime:()=>Lr,minLength:()=>ht,minSize:()=>ot,multipleOf:()=>zt,nan:()=>Xb,nanoid:()=>ib,nativeEnum:()=>Gb,negative:()=>sa,never:()=>Fa,nonnegative:()=>ua,nonoptional:()=>ap,nonpositive:()=>ca,normalize:()=>Ur,null:()=>Dm,nullable:()=>ni,nullish:()=>qb,number:()=>km,object:()=>Mb,optional:()=>ri,overwrite:()=>He,parse:()=>vm,parseAsync:()=>bm,partialRecord:()=>Fb,pipe:()=>xa,positive:()=>aa,prefault:()=>op,preprocess:()=>uy,prettifyError:()=>Dc,promise:()=>ey,property:()=>la,readonly:()=>pp,record:()=>Hm,refine:()=>yp,regex:()=>Pr,regexes:()=>Me,registry:()=>Lo,safeDecode:()=>Am,safeDecodeAsync:()=>wm,safeEncode:()=>Im,safeEncodeAsync:()=>Tm,safeParse:()=>ym,safeParseAsync:()=>_m,set:()=>Vb,setErrorMap:()=>H0,size:()=>nr,slugify:()=>Vr,startsWith:()=>zr,strictObject:()=>zb,string:()=>ei,stringFormat:()=>yb,stringbool:()=>sy,success:()=>Kb,superRefine:()=>_p,symbol:()=>kb,templateLiteral:()=>Qb,toJSONSchema:()=>fa,toLowerCase:()=>Zr,toUpperCase:()=>Br,transform:()=>Va,treeifyError:()=>Oc,trim:()=>Fr,tuple:()=>Wm,uint32:()=>Ab,uint64:()=>Nb,ulid:()=>sb,undefined:()=>Cb,union:()=>Za,unknown:()=>ar,uppercase:()=>Dr,url:()=>tb,util:()=>_,uuid:()=>Yv,uuidv4:()=>Jv,uuidv6:()=>Qv,uuidv7:()=>eb,void:()=>Pb,xid:()=>cb,xor:()=>Lb});var gt={};tt(gt,{$ZodAny:()=>ll,$ZodArray:()=>hl,$ZodAsyncError:()=>We,$ZodBase64:()=>el,$ZodBase64URL:()=>tl,$ZodBigInt:()=>Co,$ZodBigIntFormat:()=>al,$ZodBoolean:()=>Wn,$ZodCIDRv4:()=>Yu,$ZodCIDRv6:()=>Ju,$ZodCUID:()=>Lu,$ZodCUID2:()=>Uu,$ZodCatch:()=>Pl,$ZodCheck:()=>q,$ZodCheckBigIntFormat:()=>hu,$ZodCheckEndsWith:()=>Tu,$ZodCheckGreaterThan:()=>Io,$ZodCheckIncludes:()=>Iu,$ZodCheckLengthEquals:()=>Su,$ZodCheckLessThan:()=>$o,$ZodCheckLowerCase:()=>Eu,$ZodCheckMaxLength:()=>yu,$ZodCheckMaxSize:()=>gu,$ZodCheckMimeType:()=>Nu,$ZodCheckMinLength:()=>_u,$ZodCheckMinSize:()=>vu,$ZodCheckMultipleOf:()=>pu,$ZodCheckNumberFormat:()=>fu,$ZodCheckOverwrite:()=>ku,$ZodCheckProperty:()=>wu,$ZodCheckRegex:()=>xu,$ZodCheckSizeEquals:()=>bu,$ZodCheckStartsWith:()=>Au,$ZodCheckStringFormat:()=>Cr,$ZodCheckUpperCase:()=>$u,$ZodCodec:()=>qn,$ZodCustom:()=>Fl,$ZodCustomStringFormat:()=>il,$ZodDate:()=>fl,$ZodDefault:()=>Nl,$ZodDiscriminatedUnion:()=>bl,$ZodE164:()=>rl,$ZodEmail:()=>Du,$ZodEmoji:()=>zu,$ZodEncodeError:()=>Rt,$ZodEnum:()=>El,$ZodError:()=>Un,$ZodExactOptional:()=>Tl,$ZodFile:()=>Il,$ZodFunction:()=>jl,$ZodGUID:()=>Pu,$ZodIPv4:()=>qu,$ZodIPv6:()=>Ku,$ZodISODate:()=>Gu,$ZodISODateTime:()=>Vu,$ZodISODuration:()=>Hu,$ZodISOTime:()=>Wu,$ZodIntersection:()=>yl,$ZodJWT:()=>nl,$ZodKSUID:()=>Bu,$ZodLazy:()=>Ul,$ZodLiteral:()=>$l,$ZodMAC:()=>Xu,$ZodMap:()=>Sl,$ZodNaN:()=>Ol,$ZodNanoID:()=>ju,$ZodNever:()=>ml,$ZodNonOptional:()=>Cl,$ZodNull:()=>ul,$ZodNullable:()=>wl,$ZodNumber:()=>ko,$ZodNumberFormat:()=>ol,$ZodObject:()=>Vg,$ZodObjectJIT:()=>gl,$ZodOptional:()=>Po,$ZodPipe:()=>Oo,$ZodPrefault:()=>kl,$ZodPreprocess:()=>Dl,$ZodPromise:()=>Ll,$ZodReadonly:()=>Ml,$ZodRealError:()=>we,$ZodRecord:()=>_l,$ZodRegistry:()=>jo,$ZodSet:()=>xl,$ZodString:()=>rr,$ZodStringFormat:()=>B,$ZodSuccess:()=>Rl,$ZodSymbol:()=>sl,$ZodTemplateLiteral:()=>zl,$ZodTransform:()=>Al,$ZodTuple:()=>Ro,$ZodType:()=>N,$ZodULID:()=>Fu,$ZodURL:()=>Mu,$ZodUUID:()=>Ou,$ZodUndefined:()=>cl,$ZodUnion:()=>Hn,$ZodUnknown:()=>dl,$ZodVoid:()=>pl,$ZodXID:()=>Zu,$ZodXor:()=>vl,$brand:()=>xc,$constructor:()=>p,$input:()=>Bl,$output:()=>Zl,Doc:()=>Gn,JSONSchema:()=>Wv,JSONSchemaGenerator:()=>ha,NEVER:()=>Sc,TimePrecision:()=>Hl,_any:()=>fd,_array:()=>Sd,_base64:()=>ra,_base64url:()=>na,_bigint:()=>sd,_boolean:()=>od,_catch:()=>M0,_check:()=>Gv,_cidrv4:()=>ea,_cidrv6:()=>ta,_coercedBigint:()=>cd,_coercedBoolean:()=>ad,_coercedDate:()=>yd,_coercedNumber:()=>Ql,_coercedString:()=>Gl,_cuid:()=>Ho,_cuid2:()=>qo,_custom:()=>Ed,_date:()=>bd,_decode:()=>ho,_decodeAsync:()=>vo,_default:()=>P0,_discriminatedUnion:()=>S0,_e164:()=>ia,_email:()=>Uo,_emoji:()=>Go,_encode:()=>fo,_encodeAsync:()=>go,_endsWith:()=>jr,_enum:()=>T0,_file:()=>xd,_float32:()=>td,_float64:()=>rd,_gt:()=>it,_gte:()=>Se,_guid:()=>Yn,_includes:()=>Mr,_int:()=>ed,_int32:()=>nd,_int64:()=>ud,_intersection:()=>x0,_ipv4:()=>Jo,_ipv6:()=>Qo,_isoDate:()=>Kl,_isoDateTime:()=>ql,_isoDuration:()=>Yl,_isoTime:()=>Xl,_jwt:()=>oa,_ksuid:()=>Yo,_lazy:()=>U0,_length:()=>or,_literal:()=>N0,_lowercase:()=>Or,_lt:()=>nt,_lte:()=>ze,_mac:()=>Wl,_map:()=>I0,_max:()=>ze,_maxLength:()=>ir,_maxSize:()=>jt,_mime:()=>Lr,_min:()=>Se,_minLength:()=>ht,_minSize:()=>ot,_multipleOf:()=>zt,_nan:()=>_d,_nanoid:()=>Wo,_nativeEnum:()=>w0,_negative:()=>sa,_never:()=>gd,_nonnegative:()=>ua,_nonoptional:()=>O0,_nonpositive:()=>ca,_normalize:()=>Ur,_null:()=>pd,_nullable:()=>R0,_number:()=>Jl,_optional:()=>C0,_overwrite:()=>He,_parse:()=>Tr,_parseAsync:()=>wr,_pipe:()=>z0,_positive:()=>aa,_promise:()=>F0,_property:()=>la,_readonly:()=>j0,_record:()=>$0,_refine:()=>$d,_regex:()=>Pr,_safeDecode:()=>yo,_safeDecodeAsync:()=>So,_safeEncode:()=>bo,_safeEncodeAsync:()=>_o,_safeParse:()=>Nr,_safeParseAsync:()=>kr,_set:()=>A0,_size:()=>nr,_slugify:()=>Vr,_startsWith:()=>zr,_string:()=>Vl,_stringFormat:()=>Gr,_stringbool:()=>wd,_success:()=>D0,_superRefine:()=>Id,_symbol:()=>dd,_templateLiteral:()=>L0,_toLowerCase:()=>Zr,_toUpperCase:()=>Br,_transform:()=>k0,_trim:()=>Fr,_tuple:()=>E0,_uint32:()=>id,_uint64:()=>ld,_ulid:()=>Ko,_undefined:()=>md,_union:()=>y0,_unknown:()=>hd,_uppercase:()=>Dr,_url:()=>Jn,_uuid:()=>Fo,_uuidv4:()=>Zo,_uuidv6:()=>Bo,_uuidv7:()=>Vo,_void:()=>vd,_xid:()=>Xo,_xor:()=>_0,clone:()=>ye,config:()=>ne,createStandardJSONSchemaMethod:()=>Wr,createToJSONSchemaMethod:()=>Nd,decode:()=>FA,decodeAsync:()=>BA,describe:()=>Ad,encode:()=>UA,encodeAsync:()=>ZA,extractDefs:()=>Ut,finalize:()=>Ft,flattenError:()=>Fn,formatError:()=>Zn,globalConfig:()=>Qt,globalRegistry:()=>pe,initializeContext:()=>Lt,isValidBase64:()=>Qu,isValidBase64URL:()=>Ug,isValidJWT:()=>Fg,locales:()=>Xn,meta:()=>Td,parse:()=>mo,parseAsync:()=>po,prettifyError:()=>Dc,process:()=>j,regexes:()=>Me,registry:()=>Lo,safeDecode:()=>GA,safeDecodeAsync:()=>HA,safeEncode:()=>VA,safeEncodeAsync:()=>WA,safeParse:()=>Mc,safeParseAsync:()=>zc,toDotPath:()=>yg,toJSONSchema:()=>fa,treeifyError:()=>Oc,util:()=>_,version:()=>Cu});var fg,Sc=Object.freeze({status:"aborted"});function p(e,t,n){function i(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);let l=a.prototype,m=Object.keys(l);for(let f=0;f<m.length;f++){let h=m[f];h in c||(c[h]=l[h].bind(c))}}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:e});function a(c){var u;let l=n?.Parent?new o:this;i(l,c),(u=l._zod).deferred??(u.deferred=[]);for(let m of l._zod.deferred)m();return l}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var xc=Symbol("zod_brand"),We=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Rt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(fg=globalThis).__zod_globalConfig??(fg.__zod_globalConfig={});var Qt=globalThis.__zod_globalConfig;function ne(e){return e&&Object.assign(Qt,e),Qt}var _={};tt(_,{BIGINT_FORMAT_RANGES:()=>Rc,Class:()=>$c,NUMBER_FORMAT_RANGES:()=>Cc,aborted:()=>Mt,allowsEval:()=>Tc,assert:()=>bA,assertEqual:()=>fA,assertIs:()=>gA,assertNever:()=>vA,assertNotEqual:()=>hA,assignProp:()=>Ot,base64ToUint8Array:()=>gg,base64urlToUint8Array:()=>DA,cached:()=>Ir,captureStackTrace:()=>lo,cleanEnum:()=>OA,cleanRegex:()=>Mn,clone:()=>ye,cloneDef:()=>_A,createTransparentProxy:()=>AA,defineLazy:()=>O,esc:()=>uo,escapeRegex:()=>Ue,explicitlyAborted:()=>Pc,extend:()=>NA,finalizeIssue:()=>_e,floatSafeRemainder:()=>Ic,getElementAtPath:()=>SA,getEnumValues:()=>Dn,getLengthableOrigin:()=>Ln,getParsedType:()=>IA,getSizableOrigin:()=>jn,hexToUint8Array:()=>zA,isObject:()=>er,isPlainObject:()=>Dt,issue:()=>Ar,joinValues:()=>g,jsonStringifyReplacer:()=>$r,merge:()=>CA,mergeDefs:()=>ft,normalizeParams:()=>S,nullish:()=>Pt,numKeys:()=>$A,objectClone:()=>yA,omit:()=>wA,optionalKeys:()=>kc,parsedType:()=>y,partial:()=>RA,pick:()=>TA,prefixIssues:()=>Te,primitiveTypes:()=>Nc,promiseAllObject:()=>xA,propertyKeyTypes:()=>zn,randomString:()=>EA,required:()=>PA,safeExtend:()=>kA,shallowClone:()=>wc,slugify:()=>Ac,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>vg,uint8ArrayToBase64url:()=>MA,uint8ArrayToHex:()=>jA,unwrapMessage:()=>On});function fA(e){return e}function hA(e){return e}function gA(e){}function vA(e){throw new Error("Unexpected value in exhaustive check")}function bA(e){}function Dn(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function g(e,t="|"){return e.map(n=>b(n)).join(t)}function $r(e,t){return typeof t=="bigint"?t.toString():t}function Ir(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Pt(e){return e==null}function Mn(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Ic(e,t){let n=e/t,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var hg=Symbol("evaluating");function O(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==hg)return i===void 0&&(i=hg,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function yA(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ot(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ft(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function _A(e){return ft(e._zod.def)}function SA(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function xA(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function EA(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function uo(e){return JSON.stringify(e)}function Ac(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var lo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function er(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Tc=Ir(()=>{if(Qt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Dt(e){if(er(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(er(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function wc(e){return Dt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function $A(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var IA=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},zn=new Set(["string","number","symbol"]),Nc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function S(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function AA(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function b(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function kc(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Cc={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Rc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function TA(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=ft(e._zod.def,{get shape(){let a={};for(let c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(a[c]=n.shape[c])}return Ot(this,"shape",a),a},checks:[]});return ye(e,o)}function wA(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=ft(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete a[c]}return Ot(this,"shape",a),a},checks:[]});return ye(e,o)}function NA(e,t){if(!Dt(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let o=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=ft(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Ot(this,"shape",o),o}});return ye(e,r)}function kA(e,t){if(!Dt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=ft(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Ot(this,"shape",i),i}});return ye(e,n)}function CA(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ft(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return Ot(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ye(e,n)}function RA(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=ft(t._zod.def,{get shape(){let c=t._zod.def.shape,u={...c};if(n)for(let l in n){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=e?new e({type:"optional",innerType:c[l]}):c[l])}else for(let l in c)u[l]=e?new e({type:"optional",innerType:c[l]}):c[l];return Ot(this,"shape",u),u},checks:[]});return ye(t,a)}function PA(e,t,n){let i=ft(t._zod.def,{get shape(){let r=t._zod.def.shape,o={...r};if(n)for(let a in n){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(o[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(let a in r)o[a]=new e({type:"nonoptional",innerType:r[a]});return Ot(this,"shape",o),o}});return ye(t,i)}function Mt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Pc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Te(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function On(e){return typeof e=="string"?e:e?.message}function _e(e,t,n){let i=e.message?e.message:On(e.inst?._zod.def?.error?.(e))??On(t?.error?.(e))??On(n.customError?.(e))??On(n.localeError?.(e))??"Invalid input",{inst:r,continue:o,input:a,...c}=e;return c.path??(c.path=[]),c.message=i,t?.reportInput&&(c.input=a),c}function jn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Ln(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function y(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Ar(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function OA(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function gg(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function vg(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function DA(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return gg(t+n)}function MA(e){return vg(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function zA(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function jA(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var $c=class{constructor(...t){}};var bg=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,$r,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Un=p("$ZodError",bg),we=p("$ZodError",bg,{Parent:Error});function Fn(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):i.push(t(r));return{formErrors:i,fieldErrors:n}}function Zn(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let c=[...o,...a.path];if(c.length===0)n._errors.push(t(a));else{let u=n,l=0;for(;l<c.length;){let m=c[l];l===c.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(a))):u[m]=u[m]||{_errors:[]},u=u[m],l++}}}};return i(e),n}function Oc(e,t=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var a,c;for(let u of r.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>i({issues:l},[...o,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...o,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...o,...u.path]);else{let l=[...o,...u.path];if(l.length===0){n.errors.push(t(u));continue}let m=n,f=0;for(;f<l.length;){let h=l[f],v=f===l.length-1;typeof h=="string"?(m.properties??(m.properties={}),(a=m.properties)[h]??(a[h]={errors:[]}),m=m.properties[h]):(m.items??(m.items=[]),(c=m.items)[h]??(c[h]={errors:[]}),m=m.items[h]),v&&m.errors.push(t(u)),f++}}};return i(e),n}function yg(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function Dc(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${yg(i.path)}`);return t.join(`
|
|
101
101
|
`)}var Tr=e=>(t,n,i,r)=>{let o=i?{...i,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new We;if(a.issues.length){let c=new(r?.Err??e)(a.issues.map(u=>_e(u,o,ne())));throw lo(c,r?.callee),c}return a.value},mo=Tr(we),wr=e=>async(t,n,i,r)=>{let o=i?{...i,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(r?.Err??e)(a.issues.map(u=>_e(u,o,ne())));throw lo(c,r?.callee),c}return a.value},po=wr(we),Nr=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new We;return o.issues.length?{success:!1,error:new(e??Un)(o.issues.map(a=>_e(a,r,ne())))}:{success:!0,data:o.value}},Mc=Nr(we),kr=e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>_e(a,r,ne())))}:{success:!0,data:o.value}},zc=kr(we),fo=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Tr(e)(t,n,r)},UA=fo(we),ho=e=>(t,n,i)=>Tr(e)(t,n,i),FA=ho(we),go=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return wr(e)(t,n,r)},ZA=go(we),vo=e=>async(t,n,i)=>wr(e)(t,n,i),BA=vo(we),bo=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Nr(e)(t,n,r)},VA=bo(we),yo=e=>(t,n,i)=>Nr(e)(t,n,i),GA=yo(we),_o=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return kr(e)(t,n,r)},WA=_o(we),So=e=>async(t,n,i)=>kr(e)(t,n,i),HA=So(we);var Me={};tt(Me,{base64:()=>Qc,base64url:()=>xo,bigint:()=>au,boolean:()=>cu,browserEmail:()=>tT,cidrv4:()=>Yc,cidrv6:()=>Jc,cuid:()=>jc,cuid2:()=>Lc,date:()=>ru,datetime:()=>iu,domain:()=>iT,duration:()=>Vc,e164:()=>tu,email:()=>Wc,emoji:()=>Hc,extendedDuration:()=>qA,guid:()=>Gc,hex:()=>oT,hostname:()=>nT,html5Email:()=>JA,httpProtocol:()=>eu,idnEmail:()=>eT,integer:()=>su,ipv4:()=>qc,ipv6:()=>Kc,ksuid:()=>Zc,lowercase:()=>du,mac:()=>Xc,md5_base64:()=>sT,md5_base64url:()=>cT,md5_hex:()=>aT,nanoid:()=>Bc,null:()=>uu,number:()=>Eo,rfc5322Email:()=>QA,sha1_base64:()=>lT,sha1_base64url:()=>dT,sha1_hex:()=>uT,sha256_base64:()=>pT,sha256_base64url:()=>fT,sha256_hex:()=>mT,sha384_base64:()=>gT,sha384_base64url:()=>vT,sha384_hex:()=>hT,sha512_base64:()=>yT,sha512_base64url:()=>_T,sha512_hex:()=>bT,string:()=>ou,time:()=>nu,ulid:()=>Uc,undefined:()=>lu,unicodeEmail:()=>_g,uppercase:()=>mu,uuid:()=>tr,uuid4:()=>KA,uuid6:()=>XA,uuid7:()=>YA,xid:()=>Fc});var jc=/^[cC][0-9a-z]{6,}$/,Lc=/^[0-9a-z]+$/,Uc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fc=/^[0-9a-vA-V]{20}$/,Zc=/^[A-Za-z0-9]{27}$/,Bc=/^[a-zA-Z0-9_-]{21}$/,Vc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qA=/^[-+]?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)?)??$/,Gc=/^([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})$/,tr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,KA=tr(4),XA=tr(6),YA=tr(7),Wc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,JA=/^[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])?)*$/,QA=/^(([^<>()\[\]\\.,;:\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,}))$/,_g=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,eT=_g,tT=/^[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])?)*$/,rT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Hc(){return new RegExp(rT,"u")}var qc=/^(?:(?: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])$/,Kc=/^(([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}|:))$/,Xc=e=>{let t=Ue(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Yc=/^((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])$/,Jc=/^(([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])$/,Qc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xo=/^[A-Za-z0-9_-]*$/,nT=/^(?=.{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])?)*\.?$/,iT=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,eu=/^https?$/,tu=/^\+[1-9]\d{6,14}$/,Sg="(?:(?:\\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])))",ru=new RegExp(`^${Sg}$`);function xg(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function nu(e){return new RegExp(`^${xg(e)}$`)}function iu(e){let t=xg({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${n.join("|")})`;return new RegExp(`^${Sg}T(?:${i})$`)}var ou=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},au=/^-?\d+n?$/,su=/^-?\d+$/,Eo=/^-?\d+(?:\.\d+)?$/,cu=/^(?:true|false)$/i,uu=/^null$/i;var lu=/^undefined$/i;var du=/^[^A-Z]*$/,mu=/^[^a-z]*$/,oT=/^[0-9a-fA-F]*$/;function Bn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Vn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var aT=/^[0-9a-fA-F]{32}$/,sT=Bn(22,"=="),cT=Vn(22),uT=/^[0-9a-fA-F]{40}$/,lT=Bn(27,"="),dT=Vn(27),mT=/^[0-9a-fA-F]{64}$/,pT=Bn(43,"="),fT=Vn(43),hT=/^[0-9a-fA-F]{96}$/,gT=Bn(64,""),vT=Vn(64),bT=/^[0-9a-fA-F]{128}$/,yT=Bn(86,"=="),_T=Vn(86);var q=p("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),$g={number:"number",bigint:"bigint",object:"date"},$o=p("$ZodCheckLessThan",(e,t)=>{q.init(e,t);let n=$g[typeof t.value];e._zod.onattach.push(i=>{let r=i._zod.bag,o=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Io=p("$ZodCheckGreaterThan",(e,t)=>{q.init(e,t);let n=$g[typeof t.value];e._zod.onattach.push(i=>{let r=i._zod.bag,o=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pu=p("$ZodCheckMultipleOf",(e,t)=>{q.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Ic(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),fu=p("$ZodCheckNumberFormat",(e,t)=>{q.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=Cc[t.format];e._zod.onattach.push(a=>{let c=a._zod.bag;c.format=t.format,c.minimum=r,c.maximum=o,n&&(c.pattern=su)}),e._zod.check=a=>{let c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}c<r&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),c>o&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),hu=p("$ZodCheckBigIntFormat",(e,t)=>{q.init(e,t);let[n,i]=Rc[t.format];e._zod.onattach.push(r=>{let o=r._zod.bag;o.format=t.format,o.minimum=n,o.maximum=i}),e._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),gu=p("$ZodCheckMaxSize",(e,t)=>{var n;q.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Pt(r)&&r.size!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:jn(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),vu=p("$ZodCheckMinSize",(e,t)=>{var n;q.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Pt(r)&&r.size!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:jn(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bu=p("$ZodCheckSizeEquals",(e,t)=>{var n;q.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Pt(r)&&r.size!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=i=>{let r=i.value,o=r.size;if(o===t.size)return;let a=o>t.size;i.issues.push({origin:jn(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),yu=p("$ZodCheckMaxLength",(e,t)=>{var n;q.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Pt(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let r=i.value;if(r.length<=t.maximum)return;let a=Ln(r);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),_u=p("$ZodCheckMinLength",(e,t)=>{var n;q.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Pt(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let r=i.value;if(r.length>=t.minimum)return;let a=Ln(r);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Su=p("$ZodCheckLengthEquals",(e,t)=>{var n;q.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Pt(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=i=>{let r=i.value,o=r.length;if(o===t.length)return;let a=Ln(r),c=o>t.length;i.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Cr=p("$ZodCheckStringFormat",(e,t)=>{var n,i;q.init(e,t),e._zod.onattach.push(r=>{let o=r._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),xu=p("$ZodCheckRegex",(e,t)=>{Cr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Eu=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=du),Cr.init(e,t)}),$u=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=mu),Cr.init(e,t)}),Iu=p("$ZodCheckIncludes",(e,t)=>{q.init(e,t);let n=Ue(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Au=p("$ZodCheckStartsWith",(e,t)=>{q.init(e,t);let n=new RegExp(`^${Ue(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Tu=p("$ZodCheckEndsWith",(e,t)=>{q.init(e,t);let n=new RegExp(`.*${Ue(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Eg(e,t,n){e.issues.length&&t.issues.push(...Te(n,e.issues))}var wu=p("$ZodCheckProperty",(e,t)=>{q.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>Eg(r,n,t.property));Eg(i,n,t.property)}}),Nu=p("$ZodCheckMimeType",(e,t)=>{q.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),ku=p("$ZodCheckOverwrite",(e,t)=>{q.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var Gn=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
|
|
102
102
|
`).filter(a=>a),r=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(r)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let t=Function,n=this?.args,r=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...n,r.join(`
|
|
103
103
|
`))}};var Cu={major:4,minor:4,patch:3};var N=p("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Cu;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let r of i)for(let o of r._zod.onattach)o(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(a,c,u)=>{let l=Mt(a),m;for(let f of c){if(f._zod.def.when){if(Pc(a)||!f._zod.def.when(a))continue}else if(l)continue;let h=a.issues.length,v=f._zod.check(a);if(v instanceof Promise&&u?.async===!1)throw new We;if(m||v instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await v,a.issues.length!==h&&(l||(l=Mt(a,h)))});else{if(a.issues.length===h)continue;l||(l=Mt(a,h))}}return m?m.then(()=>a):a},o=(a,c,u)=>{if(Mt(a))return a.aborted=!0,a;let l=r(c,i,u);if(l instanceof Promise){if(u.async===!1)throw new We;return l.then(m=>e._zod.parse(m,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return l instanceof Promise?l.then(m=>o(m,a,c)):o(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new We;return u.then(l=>r(l,i,c))}return r(u,i,c)}}O(e,"~standard",()=>({validate:r=>{try{let o=Mc(e,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return zc(e,r).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),rr=p("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ou(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),B=p("$ZodStringFormat",(e,t)=>{Cr.init(e,t),rr.init(e,t)}),Pu=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Gc),B.init(e,t)}),Ou=p("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tr(i))}else t.pattern??(t.pattern=tr());B.init(e,t)}),Du=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Wc),B.init(e,t)}),Mu=p("$ZodURL",(e,t)=>{B.init(e,t),e._zod.check=n=>{try{let i=n.value.trim();if(!t.normalize&&t.protocol?.source===eu.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}let r=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),zu=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Hc()),B.init(e,t)}),ju=p("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Bc),B.init(e,t)}),Lu=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=jc),B.init(e,t)}),Uu=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Lc),B.init(e,t)}),Fu=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Uc),B.init(e,t)}),Zu=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Fc),B.init(e,t)}),Bu=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Zc),B.init(e,t)}),Vu=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=iu(t)),B.init(e,t)}),Gu=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ru),B.init(e,t)}),Wu=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=nu(t)),B.init(e,t)}),Hu=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Vc),B.init(e,t)}),qu=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=qc),B.init(e,t),e._zod.bag.format="ipv4"}),Ku=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Kc),B.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Xu=p("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Xc(t.delimiter)),B.init(e,t),e._zod.bag.format="mac"}),Yu=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Yc),B.init(e,t)}),Ju=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Jc),B.init(e,t),e._zod.check=n=>{let i=n.value.split("/");try{if(i.length!==2)throw new Error;let[r,o]=i;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Qu(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var el=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Qc),B.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Qu(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Ug(e){if(!xo.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Qu(n)}var tl=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=xo),B.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Ug(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),rl=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tu),B.init(e,t)});function Fg(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var nl=p("$ZodJWT",(e,t)=>{B.init(e,t),e._zod.check=n=>{Fg(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),il=p("$ZodCustomStringFormat",(e,t)=>{B.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),ko=p("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??Eo,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...o?{received:o}:{}}),n}}),ol=p("$ZodNumberFormat",(e,t)=>{fu.init(e,t),ko.init(e,t)}),Wn=p("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=cu,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),Co=p("$ZodBigInt",(e,t)=>{N.init(e,t),e._zod.pattern=au,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),al=p("$ZodBigIntFormat",(e,t)=>{hu.init(e,t),Co.init(e,t)}),sl=p("$ZodSymbol",(e,t)=>{N.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),cl=p("$ZodUndefined",(e,t)=>{N.init(e,t),e._zod.pattern=lu,e._zod.values=new Set([void 0]),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),ul=p("$ZodNull",(e,t)=>{N.init(e,t),e._zod.pattern=uu,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),ll=p("$ZodAny",(e,t)=>{N.init(e,t),e._zod.parse=n=>n}),dl=p("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=n=>n}),ml=p("$ZodNever",(e,t)=>{N.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),pl=p("$ZodVoid",(e,t)=>{N.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),fl=p("$ZodDate",(e,t)=>{N.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:e}),n}});function Ag(e,t,n){e.issues.length&&t.issues.push(...Te(n,e.issues)),t.value[n]=e.value}var hl=p("$ZodArray",(e,t)=>{N.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let o=[];for(let a=0;a<r.length;a++){let c=r[a],u=t.element._zod.run({value:c,issues:[]},i);u instanceof Promise?o.push(u.then(l=>Ag(l,n,a))):Ag(u,n,a)}return o.length?Promise.all(o).then(()=>n):n}});function No(e,t,n,i,r,o){let a=n in i;if(e.issues.length){if(r&&o&&!a)return;t.issues.push(...Te(n,e.issues))}if(!a&&!r){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?a&&(t.value[n]=void 0):t.value[n]=e.value}function Zg(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let n=kc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Bg(e,t,n,i,r,o){let a=[],c=r.keySet,u=r.catchall._zod,l=u.def.type,m=u.optin==="optional",f=u.optout==="optional";for(let h in t){if(h==="__proto__"||c.has(h))continue;if(l==="never"){a.push(h);continue}let v=u.run({value:t[h],issues:[]},i);v instanceof Promise?e.push(v.then($=>No($,n,h,t,m,f))):No(v,n,h,t,m,f)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}var Vg=p("$ZodObject",(e,t)=>{if(N.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...c};return Object.defineProperty(t,"shape",{value:u}),u}})}let i=Ir(()=>Zg(t));O(e._zod,"propValues",()=>{let c=t.shape,u={};for(let l in c){let m=c[l]._zod;if(m.values){u[l]??(u[l]=new Set);for(let f of m.values)u[l].add(f)}}return u});let r=er,o=t.catchall,a;e._zod.parse=(c,u)=>{a??(a=i.value);let l=c.value;if(!r(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),c;c.value={};let m=[],f=a.shape;for(let h of a.keys){let v=f[h],$=v._zod.optin==="optional",H=v._zod.optout==="optional",D=v._zod.run({value:l[h],issues:[]},u);D instanceof Promise?m.push(D.then(me=>No(me,c,h,l,$,H))):No(D,c,h,l,$,H)}return o?Bg(m,l,c,u,i.value,e):m.length?Promise.all(m).then(()=>c):c}}),gl=p("$ZodObjectJIT",(e,t)=>{Vg.init(e,t);let n=e._zod.parse,i=Ir(()=>Zg(t)),r=h=>{let v=new Gn(["shape","payload","ctx"]),$=i.value,H=be=>{let J=uo(be);return`shape[${J}]._zod.run({ value: input[${J}], issues: [] }, ctx)`};v.write("const input = payload.value;");let D=Object.create(null),me=0;for(let be of $.keys)D[be]=`key_${me++}`;v.write("const newResult = {};");for(let be of $.keys){let J=D[be],ce=uo(be),Er=h[be],mg=Er?._zod?.optin==="optional",oA=Er?._zod?.optout==="optional";v.write(`const ${J} = ${H(be)};`),mg&&oA?v.write(`
|
|
@@ -435,4 +435,4 @@ ${o}`)}throw r}}function Ki(e,t){let n=F.createSourceFile("infrastructure.ts",e,
|
|
|
435
435
|
${Ss(i.error)}`);return i.data}function YR(e,t){let n=$x(t),i=e.read(n)?.toString();if(!i)throw new Error(`App '${t}' not found. Expected infrastructure.ts at: ${n}`);return{path:n,content:i}}async function Ax(e,t,n,i,r){let o=XR(t,n,i),{path:a,content:c}=YR(e,o.appName),{plan:u}=KR(c,o.appName),l=await r({tree:e,validated:o,plan:u,infrastructurePath:a,content:c}),m=JR(e,a,c,l);if(!m.success)throw new Error(m.error.message,{cause:m.error})}function JR(e,t,n,i){let r=rc(i);if(!r.success)return Ce(r.error);let o=HR(e,t,n);return o.success?(e.write(t,r.data),ke(void 0)):Ce(new Error(`Failed to create backup: ${o.error.message}`))}var rA=pg(dg(),1);async function nA(e,t,n,i){let r=`Connect to existing ${t}?`,o=`Found ${e} ${t}s. Configure connections?`,a=e===1?n??r:i?.replace("{count}",String(e))??o,c=await(0,rA.default)([{type:"confirm",name:"shouldConnect",message:a,initial:!0}]);return c?c.shouldConnect:!1}var Yt=pg(dg(),1);function rD(e){let t=[];for(let n of e.s3)t.push({name:n.name,description:"S3 Storage"});for(let n of e.compute)n.type==="lambda"?n.functionUrl&&t.push({name:n.name,description:"Lambda"}):n.type==="ecs"&&t.push({name:n.name,description:"ECS with ALB"});return t}function iA(e,t){if(!t.some(n=>n.name===e)){let n=t.map(i=>i.name).join(", ");throw new Error(`Origin "${e}" not found in infrastructure. Available origins: ${n}`)}}async function nD(e,t){let n=rD(e);if(n.length===0)throw new Error("No available CDN origins found. Add an S3 bucket or compute resource with ALB/function URL first.");if(t.defaultOriginRef){if(iA(t.defaultOriginRef,n),t.behaviours)for(let c of t.behaviours)iA(c.originRef,n);return{defaultOriginRef:t.defaultOriginRef,behaviours:t.behaviours,...t.customDomain&&{customDomain:t.customDomain}}}if(t.nameProvidedByFlag)throw new Error("Default origin must be specified in non-interactive mode");let i;if(n.length===1)i=n[0].name,process.stdout.write(`
|
|
436
436
|
Auto-selected origin: ${i}
|
|
437
437
|
`);else if(i=(await(0,Yt.default)([{type:"select",name:"origin",message:"Select the default origin:",choices:n.map(c=>({title:`${c.name} (${c.description})`,value:c.name}))}])).origin,!i)throw new Error("Origin selection cancelled");let r,o=n.filter(c=>c.name!==i);if(o.length>0&&await nA(o.length,"origin","Add path-based routing to another origin?","Add path-based routing to other origins?")){r=[];let c=!0;for(;c&&o.length>0;){let u=(await(0,Yt.default)([{type:"text",name:"pathPattern",message:"Path pattern (e.g., /static/*):"}])).pathPattern;if(!u)break;let l;if(o.length===1)l=o[0].name,process.stdout.write(` Auto-selected origin: ${l}
|
|
438
|
-
`);else if(l=(await(0,Yt.default)([{type:"select",name:"origin",message:"Origin for this path:",choices:o.map(f=>({title:`${f.name} (${f.description})`,value:f.name}))}])).origin,!l)break;let m=(await(0,Yt.default)([{type:"select",name:"cachePolicy",message:"Cache policy:",choices:[{title:"Caching Optimised",value:"CACHING_OPTIMIZED",description:"Best for static assets"},{title:"Caching Disabled",value:"CACHING_DISABLED",description:"Best for dynamic APIs"}]}])).cachePolicy;r.push({pathPattern:u,originRef:l,...m!==void 0&&{cachePolicy:m}}),c=(await(0,Yt.default)([{type:"confirm",name:"addMore",message:"Add another path route?",initial:!1}])).addMore}r.length===0&&(r=void 0)}let a;return(await(0,Yt.default)([{type:"confirm",name:"wantDomain",message:"Add a custom domain?",initial:!1}])).wantDomain&&(a=(await(0,Yt.default)([{type:"text",name:"domain",message:"Enter custom domain:"}])).domain||void 0),{defaultOriginRef:i,behaviours:r,...a!==void 0&&{customDomain:a}}}async function iD(e,t){await Ax(e,eS,t,"CDN",async({validated:n,plan:i})=>{if(i.cdn)throw new Error("A CDN is already configured for this application. Remove the existing CDN first.");let r=await nD(i,n),o=n.name??`${rt(n.appName)}Cdn`;return{...i,cdn:{name:o,defaultOriginRef:r.defaultOriginRef,...r.behaviours&&r.behaviours.length>0&&{behaviours:r.behaviours},...r.customDomain!==void 0&&{customDomain:r.customDomain},...n.certificateArn!==void 0&&{certificateArn:n.certificateArn},...n.accessGate!==void 0&&{accessGate:n.accessGate}}}})}var
|
|
438
|
+
`);else if(l=(await(0,Yt.default)([{type:"select",name:"origin",message:"Origin for this path:",choices:o.map(f=>({title:`${f.name} (${f.description})`,value:f.name}))}])).origin,!l)break;let m=(await(0,Yt.default)([{type:"select",name:"cachePolicy",message:"Cache policy:",choices:[{title:"Caching Optimised",value:"CACHING_OPTIMIZED",description:"Best for static assets"},{title:"Caching Disabled",value:"CACHING_DISABLED",description:"Best for dynamic APIs"}]}])).cachePolicy;r.push({pathPattern:u,originRef:l,...m!==void 0&&{cachePolicy:m}}),c=(await(0,Yt.default)([{type:"confirm",name:"addMore",message:"Add another path route?",initial:!1}])).addMore}r.length===0&&(r=void 0)}let a;return(await(0,Yt.default)([{type:"confirm",name:"wantDomain",message:"Add a custom domain?",initial:!1}])).wantDomain&&(a=(await(0,Yt.default)([{type:"text",name:"domain",message:"Enter custom domain:"}])).domain||void 0),{defaultOriginRef:i,behaviours:r,...a!==void 0&&{customDomain:a}}}async function iD(e,t){await Ax(e,eS,t,"CDN",async({validated:n,plan:i})=>{if(i.cdn)throw new Error("A CDN is already configured for this application. Remove the existing CDN first.");let r=await nD(i,n),o=n.name??`${rt(n.appName)}Cdn`;return{...i,cdn:{name:o,defaultOriginRef:r.defaultOriginRef,...r.behaviours&&r.behaviours.length>0&&{behaviours:r.behaviours},...r.customDomain!==void 0&&{customDomain:r.customDomain},...n.certificateArn!==void 0&&{certificateArn:n.certificateArn},...n.accessGate!==void 0&&{accessGate:n.accessGate}}}})}var kW=iD;export{iD as cdnGenerator,kW as default};
|