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
|
@@ -49,29 +49,29 @@ Instructions:
|
|
|
49
49
|
Filtered results for: ${this.inputValue?this.inputValue:It.gray("Enter something to filter")}
|
|
50
50
|
`}renderOption(t,n,i){let r;return n.disabled?r=t===i?It.gray().underline(n.title):It.strikethrough().gray(n.title):r=t===i?It.cyan().underline(n.title):n.title,(n.selected?It.green(kn.radioOn):kn.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let t=[It.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(It.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(A1.hide),super.render();let t=[s$.symbol(this.done,this.aborted),It.bold(this.msg),s$.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=It.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=a$(t,this.out.columns)}};c$.exports=Rh});var g$=I((QG,h$)=>{"use strict";var l$=te(),w1=xt(),p$=Qe(),d$=p$.style,N1=p$.clear,f$=re(),k1=f$.erase,m$=f$.cursor,Oh=class extends w1{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(`
|
|
51
51
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
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(m$.hide):this.out.write(N1(this.outputText,this.out.columns)),super.render(),this.outputText=[d$.symbol(this.done,this.aborted),l$.bold(this.msg),d$.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:l$.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(k1.line+m$.to(0)+this.outputText))}};h$.exports=Oh});var b$=I((
|
|
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 D1(e,t){if(e){if(typeof e=="string")return E$(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 E$(e,t)}}function E$(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 $$(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 I$(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function a(u){$$(o,i,r,a,c,"next",u)}function c(u){$$(o,i,r,a,c,"throw",u)}a(void 0)})}}var Dh=_$(),M1=["suggest","format","onState","validate","onRender","type"],A$=()=>{};function qt(){return Mh.apply(this,arguments)}function Mh(){return Mh=I$(function*(e=[],{onSubmit:t=A$,onCancel:n=A$}={}){let i={},r=qt._override||{};e=[].concat(e);let o,a,c,u,l,m,f=(function(){var D=I$(function*(me,Nt,be=!1){if(!(!be&&me.validate&&me.validate(Nt)!==!0))return me.format?yield me.format(Nt,i):Nt});return function(Nt,be){return D.apply(this,arguments)}})();var h=O1(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,x$({},i),a),a.type=l),!!l){for(let D in a){if(M1.includes(D))continue;let me=a[D];a[D]=typeof me=="function"?yield me(o,x$({},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,Dh[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?z1(qt._injected,a.initial):yield Dh[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}),Mh.apply(this,arguments)}function z1(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function j1(e){qt._injected=(qt._injected||[]).concat(e)}function U1(e){qt._override=Object.assign({},e)}T$.exports=Object.assign(qt,{prompt:qt,prompts:Dh,inject:j1,override:U1})});var k$=I((
|
|
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(m$.hide):this.out.write(N1(this.outputText,this.out.columns)),super.render(),this.outputText=[d$.symbol(this.done,this.aborted),l$.bold(this.msg),d$.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:l$.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(k1.line+m$.to(0)+this.outputText))}};h$.exports=Oh});var b$=I((eW,v$)=>{"use strict";v$.exports={TextPrompt:nE(),SelectPrompt:sE(),TogglePrompt:pE(),DatePrompt:ZE(),NumberPrompt:KE(),MultiselectPrompt:wh(),AutocompletePrompt:o$(),AutocompleteMultiselectPrompt:u$(),ConfirmPrompt:g$()}});var _$=I(y$=>{"use strict";var Oe=y$,C1=b$(),mc=e=>e;function ut(e,t,n={}){return new Promise((i,r)=>{let o=new C1[e](t),a=n.onAbort||mc,c=n.onSubmit||mc,u=n.onExit||mc;o.on("state",t.onState||mc),o.on("submit",l=>i(c(l))),o.on("exit",l=>i(u(l))),o.on("abort",l=>r(a(l)))})}Oe.text=e=>ut("TextPrompt",e);Oe.password=e=>(e.style="password",Oe.text(e));Oe.invisible=e=>(e.style="invisible",Oe.text(e));Oe.number=e=>ut("NumberPrompt",e);Oe.date=e=>ut("DatePrompt",e);Oe.confirm=e=>ut("ConfirmPrompt",e);Oe.list=e=>{let t=e.separator||",";return ut("TextPrompt",e,{onSubmit:n=>n.split(t).map(i=>i.trim())})};Oe.toggle=e=>ut("TogglePrompt",e);Oe.select=e=>ut("SelectPrompt",e);Oe.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=n=>n.filter(i=>i.selected).map(i=>i.value);return ut("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 ut("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};var R1=(e,t)=>Promise.resolve(t.filter(n=>n.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));Oe.autocomplete=e=>(e.suggest=e.suggest||R1,e.choices=[].concat(e.choices||[]),ut("AutocompletePrompt",e))});var w$=I((rW,T$)=>{"use strict";function S$(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 x$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S$(Object(n),!0).forEach(function(i){P1(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S$(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function P1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O1(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=D1(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
|
+
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 D1(e,t){if(e){if(typeof e=="string")return E$(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 E$(e,t)}}function E$(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 $$(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 I$(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function a(u){$$(o,i,r,a,c,"next",u)}function c(u){$$(o,i,r,a,c,"throw",u)}a(void 0)})}}var Dh=_$(),M1=["suggest","format","onState","validate","onRender","type"],A$=()=>{};function qt(){return Mh.apply(this,arguments)}function Mh(){return Mh=I$(function*(e=[],{onSubmit:t=A$,onCancel:n=A$}={}){let i={},r=qt._override||{};e=[].concat(e);let o,a,c,u,l,m,f=(function(){var D=I$(function*(me,Nt,be=!1){if(!(!be&&me.validate&&me.validate(Nt)!==!0))return me.format?yield me.format(Nt,i):Nt});return function(Nt,be){return D.apply(this,arguments)}})();var h=O1(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,x$({},i),a),a.type=l),!!l){for(let D in a){if(M1.includes(D))continue;let me=a[D];a[D]=typeof me=="function"?yield me(o,x$({},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,Dh[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?z1(qt._injected,a.initial):yield Dh[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}),Mh.apply(this,arguments)}function z1(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function j1(e){qt._injected=(qt._injected||[]).concat(e)}function U1(e){qt._override=Object.assign({},e)}T$.exports=Object.assign(qt,{prompt:qt,prompts:Dh,inject:j1,override:U1})});var k$=I((nW,N$)=>{"use strict";N$.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 pc=I((iW,C$)=>{"use strict";C$.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 O$=I((oW,P$)=>{"use strict";var L1=pc(),{erase:R$,cursor:F1}=re(),Z1=e=>[...L1(e)].length;P$.exports=function(e,t){if(!t)return R$.line+F1.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 R$.lines(n)}});var zh=I((aW,D$)=>{"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"},B1={arrowUp:io.arrowUp,arrowDown:io.arrowDown,arrowLeft:io.arrowLeft,arrowRight:io.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},V1=process.platform==="win32"?B1:io;D$.exports=V1});var z$=I((sW,M$)=>{"use strict";var Cn=te(),Sr=zh(),jh=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}`}}),G1=e=>jh[e]||jh.default,oo=Object.freeze({aborted:Cn.red(Sr.cross),done:Cn.green(Sr.tick),exited:Cn.yellow(Sr.cross),default:Cn.cyan("?")}),W1=(e,t,n)=>t?oo.aborted:n?oo.exited:e?oo.done:oo.default,H1=e=>Cn.gray(e?Sr.ellipsis:Sr.pointerSmall),q1=(e,t)=>Cn.gray(e?t?Sr.pointerSmall:"+":Sr.line);M$.exports={styles:jh,render:G1,symbols:oo,symbol:W1,delimiter:H1,item:q1}});var U$=I((cW,j$)=>{"use strict";var K1=pc();j$.exports=function(e,t){let n=String(K1(e)||"").split(/\r?\n/);return t?n.map(i=>Math.ceil(i.length/t)).reduce((i,r)=>i+r):n.length}});var F$=I((uW,L$)=>{"use strict";L$.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 B$=I((
|
|
55
|
+
`)}});var B$=I((lW,Z$)=>{"use strict";Z$.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((dW,V$)=>{"use strict";V$.exports={action:k$(),clear:O$(),style:z$(),strip:pc(),figures:zh(),lines:U$(),wrap:F$(),entriesToDisplay:B$()}});var At=I((mW,W$)=>{"use strict";var G$=co("readline"),{action:X1}=et(),Y1=co("events"),{beep:J1,cursor:Q1}=re(),eO=te(),Uh=class extends Y1{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=G$.createInterface({input:this.in,escapeCodeTimeout:50});G$.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=X1(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(J1)}render(){this.onRender(eO),this.firstRender&&(this.firstRender=!1)}};W$.exports=Uh});var q$=I((pW,H$)=>{var fc=te(),tO=At(),{erase:rO,cursor:ao}=re(),{style:Lh,clear:Fh,lines:nO,figures:iO}=et(),Zh=class extends tO{constructor(t={}){super(t),this.transform=Lh.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=Fh("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=fc.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(nO(this.outputError,this.out.columns)-1)+Fh(this.outputError,this.out.columns)),this.out.write(Fh(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Lh.symbol(this.done,this.aborted),fc.bold(this.msg),Lh.delimiter(this.done),this.red?fc.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
58
58
|
`).reduce((t,n,i)=>t+`
|
|
59
|
-
${i?" ":iO.pointerSmall} ${fc.red().italic(n)}`,"")),this.out.write(rO.line+ao.to(0)+this.outputText+ao.save+this.outputError+ao.restore+ao.move(this.cursorOffset,0)))}};H$.exports=Zh});var J$=I((
|
|
59
|
+
${i?" ":iO.pointerSmall} ${fc.red().italic(n)}`,"")),this.out.write(rO.line+ao.to(0)+this.outputText+ao.save+this.outputError+ao.restore+ao.move(this.cursorOffset,0)))}};H$.exports=Zh});var J$=I((fW,Y$)=>{"use strict";var Tt=te(),oO=At(),{style:K$,clear:X$,figures:hc,wrap:aO,entriesToDisplay:sO}=et(),{cursor:cO}=re(),Bh=class extends oO{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=X$("",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(cO.hide):this.out.write(X$(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:n}=sO(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[K$.symbol(this.done,this.aborted),Tt.bold(this.msg),K$.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Tt.yellow(this.warn):Tt.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=hc.arrowUp:i===n-1&&n<this.choices.length?o=hc.arrowDown:o=" ",c.disabled?(r=this.cursor===i?Tt.gray().underline(c.title):Tt.strikethrough().gray(c.title),o=(this.cursor===i?Tt.bold().gray(hc.pointer)+" ":" ")+o):(r=this.cursor===i?Tt.cyan().underline(c.title):c.title,o=(this.cursor===i?Tt.cyan(hc.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
|
`+aO(c.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${r}${Tt.gray(a)}
|
|
64
|
-
`}}this.out.write(this.outputText)}};Y$.exports=Bh});var rI=I((
|
|
64
|
+
`}}this.out.write(this.outputText)}};Y$.exports=Bh});var rI=I((hW,tI)=>{var gc=te(),uO=At(),{style:Q$,clear:lO}=et(),{cursor:eI,erase:dO}=re(),Vh=class extends uO{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(eI.hide):this.out.write(lO(this.outputText,this.out.columns)),super.render(),this.outputText=[Q$.symbol(this.done,this.aborted),gc.bold(this.msg),Q$.delimiter(this.done),this.value?this.inactive:gc.cyan().underline(this.inactive),gc.gray("/"),this.value?gc.cyan().underline(this.active):this.active].join(" "),this.out.write(dO.line+eI.to(0)+this.outputText))}};tI.exports=Vh});var lt=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(eI.hide):this.out.write(lO(this.outputText,this.out.columns)),super.render(),this.outputText=[Q$.symbol(this.done,this.aborted),gc.bold(this.msg),Q$.delimiter(this.done),this.value?this.inactive:gc.cyan().underline(this.inactive),gc.gray("/"),this.value?gc.cyan().underline(this.active):this.active].join(" "),this.out.write(dO.line+eI.to(0)+this.outputText))}};tI.exports=Vh});var lt=I((gW,nI)=>{"use strict";var Gh=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)}};nI.exports=Gh});var oI=I((vW,iI)=>{"use strict";var mO=lt(),Wh=class extends mO{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}};iI.exports=Wh});var sI=I((bW,aI)=>{"use strict";var pO=lt(),fO=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),Hh=class extends pO{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+fO(t):this.token==="d"?n+1:this.token==="ddd"?this.locales.weekdaysShort[n]:this.token==="dddd"?this.locales.weekdays[n]:t}};aI.exports=Hh});var uI=I((yW,cI)=>{"use strict";var hO=lt(),qh=class extends hO{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}};cI.exports=qh});var dI=I((_W,lI)=>{"use strict";var gO=lt(),Kh=class extends gO{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)}};lI.exports=Kh});var pI=I((SW,mI)=>{"use strict";var vO=lt(),Xh=class extends vO{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}};mI.exports=Xh});var hI=I((xW,fI)=>{"use strict";var bO=lt(),Yh=class extends bO{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)}};fI.exports=Yh});var vI=I((EW,gI)=>{"use strict";var yO=lt(),Jh=class extends yO{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}};gI.exports=Jh});var yI=I(($W,bI)=>{"use strict";var _O=lt(),Qh=class extends _O{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}};bI.exports=Qh});var SI=I((IW,_I)=>{"use strict";_I.exports={DatePart:lt(),Meridiem:oI(),Day:sI(),Hours:uI(),Milliseconds:dI(),Minutes:pI(),Month:hI(),Seconds:vI(),Year:yI()}});var wI=I((AW,TI)=>{"use strict";var eg=te(),SO=At(),{style:xI,clear:EI,figures:xO}=et(),{erase:EO,cursor:$I}=re(),{DatePart:II,Meridiem:$O,Day:IO,Hours:AO,Milliseconds:TO,Minutes:wO,Month:NO,Seconds:kO,Year:CO}=SI(),RO=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,AI={1:({token:e})=>e.replace(/\\(.)/g,"$1"),2:e=>new IO(e),3:e=>new NO(e),4:e=>new CO(e),5:e=>new $O(e),6:e=>new AO(e),7:e=>new wO(e),8:e=>new kO(e),9:e=>new TO(e)},PO={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(",")},tg=class extends SO{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(PO,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=EI("",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=RO.exec(t);){let r=n.shift(),o=n.findIndex(a=>a!=null);this.parts.push(o in AI?AI[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 II)),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 II)),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($I.hide):this.out.write(EI(this.outputText,this.out.columns)),super.render(),this.outputText=[xI.symbol(this.done,this.aborted),eg.bold(this.msg),xI.delimiter(!1),this.parts.reduce((t,n,i)=>t.concat(i===this.cursor&&!this.done?eg.cyan().underline(n.toString()):n),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
69
69
|
`).reduce((t,n,i)=>t+`
|
|
70
|
-
${i?" ":xO.pointerSmall} ${eg.red().italic(n)}`,"")),this.out.write(EO.line+$I.to(0)+this.outputText))}};TI.exports=tg});var RI=I((
|
|
70
|
+
${i?" ":xO.pointerSmall} ${eg.red().italic(n)}`,"")),this.out.write(EO.line+$I.to(0)+this.outputText))}};TI.exports=tg});var RI=I((TW,CI)=>{var vc=te(),OO=At(),{cursor:bc,erase:DO}=re(),{style:rg,figures:MO,clear:NI,lines:zO}=et(),jO=/[0-9]/,ng=e=>e!==void 0,kI=(e,t)=>{let n=Math.pow(10,t);return Math.round(e*n)/n},ig=class extends OO{constructor(t={}){super(t),this.transform=rg.render(t.style),this.msg=t.message,this.initial=ng(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=ng(t.min)?t.min:-1/0,this.max=ng(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=vc.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${kI(t,this.round)}`),this._value=kI(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||jO.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(bc.down(zO(this.outputError,this.out.columns)-1)+NI(this.outputError,this.out.columns)),this.out.write(NI(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[rg.symbol(this.done,this.aborted),vc.bold(this.msg),rg.delimiter(this.done),!this.done||!this.done&&!this.placeholder?vc[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
73
73
|
`).reduce((t,n,i)=>t+`
|
|
74
|
-
${i?" ":MO.pointerSmall} ${vc.red().italic(n)}`,"")),this.out.write(DO.line+bc.to(0)+this.outputText+bc.save+this.outputError+bc.restore))}};CI.exports=ig});var ag=I((
|
|
74
|
+
${i?" ":MO.pointerSmall} ${vc.red().italic(n)}`,"")),this.out.write(DO.line+bc.to(0)+this.outputText+bc.save+this.outputError+bc.restore))}};CI.exports=ig});var ag=I((wW,DI)=>{"use strict";var dt=te(),{cursor:UO}=re(),LO=At(),{clear:PI,figures:Kt,style:OI,wrap:FO,entriesToDisplay:ZO}=et(),og=class extends LO{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=PI("",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?dt.green(Kt.radioOn):Kt.radioOff)+" "+r+" ",a,c;return n.disabled?a=t===i?dt.gray().underline(n.title):dt.strikethrough().gray(n.title):(a=t===i?dt.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
|
`+FO(n.description,{margin:o.length,width:this.out.columns})))),o+a+dt.gray(c||"")}paginateOptions(t){if(t.length===0)return dt.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=[dt.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(dt.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(UO.hide),super.render();let t=[OI.symbol(this.done,this.aborted),dt.bold(this.msg),OI.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=dt.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=PI(t,this.out.columns)}};DI.exports=og});var LI=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=[dt.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(dt.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(UO.hide),super.render();let t=[OI.symbol(this.done,this.aborted),dt.bold(this.msg),OI.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=dt.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=PI(t,this.out.columns)}};DI.exports=og});var LI=I((NW,UI)=>{"use strict";var so=te(),BO=At(),{erase:VO,cursor:MI}=re(),{style:sg,clear:zI,figures:cg,wrap:GO,entriesToDisplay:WO}=et(),jI=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),HO=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),qO=(e,t)=>{let n=e.findIndex(i=>i.value===t||i.title===t);return n>-1?n:void 0},ug=class extends BO{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial=typeof t.initial=="number"?t.initial:qO(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=sg.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=zI("",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=jI(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:HO(c,a),value:jI(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?cg.arrowUp:r?cg.arrowDown:" ",c=n?so.cyan().underline(t.title):t.title;return a=(n?so.cyan(cg.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
|
`+GO(t.description,{margin:3,width:this.out.columns}))),a+" "+c+so.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(MI.hide):this.out.write(zI(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:n}=WO(this.select,this.choices.length,this.limit);if(this.outputText=[sg.symbol(this.done,this.aborted,this.exited),so.bold(this.msg),sg.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(VO.line+MI.to(0)+this.outputText)}};UI.exports=ug});var VI=I((
|
|
90
|
+
`+(i||so.gray(this.fallback.title))}this.out.write(VO.line+MI.to(0)+this.outputText)}};UI.exports=ug});var VI=I((kW,BI)=>{"use strict";var wt=te(),{cursor:KO}=re(),XO=ag(),{clear:FI,style:ZI,figures:Rn}=et(),lg=class extends XO{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=FI("",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
|
${Rn.arrowUp}/${Rn.arrowDown}: Highlight option
|
|
93
93
|
${Rn.arrowLeft}/${Rn.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:wt.gray("Enter something to filter")}
|
|
98
|
-
`}renderOption(t,n,i){let r;return n.disabled?r=t===i?wt.gray().underline(n.title):wt.strikethrough().gray(n.title):r=t===i?wt.cyan().underline(n.title):n.title,(n.selected?wt.green(Rn.radioOn):Rn.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let t=[wt.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(wt.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(KO.hide),super.render();let t=[ZI.symbol(this.done,this.aborted),wt.bold(this.msg),ZI.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=wt.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=FI(t,this.out.columns)}};BI.exports=lg});var KI=I((
|
|
98
|
+
`}renderOption(t,n,i){let r;return n.disabled?r=t===i?wt.gray().underline(n.title):wt.strikethrough().gray(n.title):r=t===i?wt.cyan().underline(n.title):n.title,(n.selected?wt.green(Rn.radioOn):Rn.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let t=[wt.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(wt.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(KO.hide),super.render();let t=[ZI.symbol(this.done,this.aborted),wt.bold(this.msg),ZI.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=wt.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=FI(t,this.out.columns)}};BI.exports=lg});var KI=I((CW,qI)=>{var GI=te(),YO=At(),{style:WI,clear:JO}=et(),{erase:QO,cursor:HI}=re(),dg=class extends YO{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(HI.hide):this.out.write(JO(this.outputText,this.out.columns)),super.render(),this.outputText=[WI.symbol(this.done,this.aborted),GI.bold(this.msg),WI.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:GI.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(QO.line+HI.to(0)+this.outputText))}};qI.exports=dg});var YI=I((R8,XI)=>{"use strict";XI.exports={TextPrompt:q$(),SelectPrompt:J$(),TogglePrompt:rI(),DatePrompt:wI(),NumberPrompt:RI(),MultiselectPrompt:ag(),AutocompletePrompt:LI(),AutocompleteMultiselectPrompt:VI(),ConfirmPrompt:KI()}});var QI=I(JI=>{"use strict";var De=JI,eD=YI(),yc=e=>e;function mt(e,t,n={}){return new Promise((i,r)=>{let o=new eD[e](t),a=n.onAbort||yc,c=n.onSubmit||yc,u=n.onExit||yc;o.on("state",t.onState||yc),o.on("submit",l=>i(c(l))),o.on("exit",l=>i(u(l))),o.on("abort",l=>r(a(l)))})}De.text=e=>mt("TextPrompt",e);De.password=e=>(e.style="password",De.text(e));De.invisible=e=>(e.style="invisible",De.text(e));De.number=e=>mt("NumberPrompt",e);De.date=e=>mt("DatePrompt",e);De.confirm=e=>mt("ConfirmPrompt",e);De.list=e=>{let t=e.separator||",";return mt("TextPrompt",e,{onSubmit:n=>n.split(t).map(i=>i.trim())})};De.toggle=e=>mt("TogglePrompt",e);De.select=e=>mt("SelectPrompt",e);De.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=n=>n.filter(i=>i.selected).map(i=>i.value);return mt("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 mt("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};var tD=(e,t)=>Promise.resolve(t.filter(n=>n.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));De.autocomplete=e=>(e.suggest=e.suggest||tD,e.choices=[].concat(e.choices||[]),mt("AutocompletePrompt",e))});var rA=I((O8,tA)=>{"use strict";var mg=QI(),rD=["suggest","format","onState","validate","onRender","type"],eA=()=>{};async function Xt(e=[],{onSubmit:t=eA,onCancel:n=eA}={}){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(rD.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,mg[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?nD(Xt._injected,a.initial):await mg[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 nD(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function iD(e){Xt._injected=(Xt._injected||[]).concat(e)}function oD(e){Xt._override=Object.assign({},e)}tA.exports=Object.assign(Xt,{prompt:Xt,prompts:mg,inject:iD,override:oD})});var iA=I((D8,nA)=>{function aD(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}nA.exports=aD("8.6.0")?w$():rA()});import{join as hA,dirname as mD,normalize as gA}from"node:path";var vA="fjall";function bA(e,t){let n=gA(e);if(n.includes("..")||n.startsWith("/"))throw new Error(`Invalid ${t}: path traversal is not allowed`)}function Pn(e){return bA(e,"app name"),hA(vA,e,yA)}var yA="infrastructure.ts";function _A(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uo(e,t,n){let i=Pn(t),r=e.read(i)?.toString();return r?new RegExp(`["']${_A(n)}["']`).test(r):!1}function Sc(e,t,n){let i=Pn(t);if(!e.read(i)?.toString())throw new Error(`Infrastructure file not found for ${t}`);if(uo(e,t,n))throw new Error(`Resource name '${n}' already exists in ${t}. Please choose a different name or remove the existing resource first.`)}import*as wn from"fs";import*as Ix from"path";function kt(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 Yt(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 xA=/fjall_ak_[A-Z2-7]{16}\.[A-Z2-7]{40}/g;function xc(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(xA,"fjall_ak_***")}var s={};tt(s,{$brand:()=>$c,$input:()=>Gl,$output:()=>Vl,NEVER:()=>Ec,TimePrecision:()=>Kl,ZodAny:()=>jm,ZodArray:()=>Zm,ZodBase64:()=>za,ZodBase64URL:()=>ja,ZodBigInt:()=>Qr,ZodBigIntFormat:()=>Fa,ZodBoolean:()=>Jr,ZodCIDRv4:()=>Da,ZodCIDRv6:()=>Ma,ZodCUID:()=>wa,ZodCUID2:()=>Na,ZodCatch:()=>lp,ZodCodec:()=>di,ZodCustom:()=>mi,ZodCustomStringFormat:()=>Xr,ZodDate:()=>ai,ZodDefault:()=>ip,ZodDiscriminatedUnion:()=>Vm,ZodE164:()=>Ua,ZodEmail:()=>Ia,ZodEmoji:()=>Aa,ZodEnum:()=>qr,ZodError:()=>Q0,ZodExactOptional:()=>tp,ZodFile:()=>Qm,ZodFirstPartyTypeKind:()=>Ep,ZodFunction:()=>_p,ZodGUID:()=>ti,ZodIPv4:()=>Pa,ZodIPv6:()=>Oa,ZodISODate:()=>ya,ZodISODateTime:()=>ba,ZodISODuration:()=>Sa,ZodISOTime:()=>_a,ZodIntersection:()=>Gm,ZodIssueCode:()=>tw,ZodJWT:()=>La,ZodKSUID:()=>Ra,ZodLazy:()=>vp,ZodLiteral:()=>Jm,ZodMAC:()=>Cm,ZodMap:()=>Xm,ZodNaN:()=>mp,ZodNanoID:()=>Ta,ZodNever:()=>Lm,ZodNonOptional:()=>Ha,ZodNull:()=>Mm,ZodNullable:()=>np,ZodNumber:()=>Yr,ZodNumberFormat:()=>ar,ZodObject:()=>ci,ZodOptional:()=>Wa,ZodPipe:()=>li,ZodPrefault:()=>ap,ZodPreprocess:()=>pp,ZodPromise:()=>yp,ZodReadonly:()=>fp,ZodRealError:()=>Ne,ZodRecord:()=>Hr,ZodSet:()=>Ym,ZodString:()=>Kr,ZodStringFormat:()=>V,ZodSuccess:()=>up,ZodSymbol:()=>Om,ZodTemplateLiteral:()=>gp,ZodTransform:()=>ep,ZodTuple:()=>Hm,ZodType:()=>k,ZodULID:()=>ka,ZodURL:()=>oi,ZodUUID:()=>ot,ZodUndefined:()=>Dm,ZodUnion:()=>ui,ZodUnknown:()=>Um,ZodVoid:()=>Fm,ZodXID:()=>Ca,ZodXor:()=>Bm,_ZodString:()=>$a,_default:()=>op,_function:()=>ry,any:()=>Pb,array:()=>si,base64:()=>gb,base64url:()=>vb,bigint:()=>wb,boolean:()=>Pm,catch:()=>dp,check:()=>ny,cidrv4:()=>fb,cidrv6:()=>hb,clone:()=>ye,codec:()=>Jb,coerce:()=>$p,config:()=>ne,core:()=>ht,cuid:()=>ab,cuid2:()=>sb,custom:()=>iy,date:()=>Db,decode:()=>$m,decodeAsync:()=>Am,describe:()=>oy,discriminatedUnion:()=>Fb,e164:()=>bb,email:()=>Xv,emoji:()=>ib,encode:()=>Em,encodeAsync:()=>Im,endsWith:()=>zr,enum:()=>Va,exactOptional:()=>rp,file:()=>qb,flattenError:()=>Fn,float32:()=>$b,float64:()=>Ib,formatError:()=>Zn,fromJSONSchema:()=>my,function:()=>ry,getErrorMap:()=>nw,globalRegistry:()=>pe,gt:()=>nt,gte:()=>Se,guid:()=>Yv,hash:()=>Eb,hex:()=>xb,hostname:()=>Sb,httpUrl:()=>nb,includes:()=>Dr,instanceof:()=>sy,int:()=>xa,int32:()=>Ab,int64:()=>Nb,intersection:()=>Wm,invertCodec:()=>Qb,ipv4:()=>db,ipv6:()=>pb,iso:()=>Wr,json:()=>uy,jwt:()=>yb,keyof:()=>Mb,ksuid:()=>lb,lazy:()=>bp,length:()=>ir,literal:()=>Hb,locales:()=>Xn,looseObject:()=>Ub,looseRecord:()=>Bb,lowercase:()=>Pr,lt:()=>rt,lte:()=>ze,mac:()=>mb,map:()=>Vb,maxLength:()=>nr,maxSize:()=>jt,meta:()=>ay,mime:()=>jr,minLength:()=>ft,minSize:()=>it,multipleOf:()=>zt,nan:()=>Yb,nanoid:()=>ob,nativeEnum:()=>Wb,negative:()=>ca,never:()=>Za,nonnegative:()=>la,nonoptional:()=>cp,nonpositive:()=>ua,normalize:()=>Ur,null:()=>zm,nullable:()=>ni,nullish:()=>Kb,number:()=>Rm,object:()=>zb,optional:()=>ri,overwrite:()=>He,parse:()=>ym,parseAsync:()=>_m,partialRecord:()=>Zb,pipe:()=>Ea,positive:()=>sa,prefault:()=>sp,preprocess:()=>ly,prettifyError:()=>zc,promise:()=>ty,property:()=>da,readonly:()=>hp,record:()=>Km,refine:()=>Sp,regex:()=>Rr,regexes:()=>Me,registry:()=>Lo,safeDecode:()=>wm,safeDecodeAsync:()=>km,safeEncode:()=>Tm,safeEncodeAsync:()=>Nm,safeParse:()=>Sm,safeParseAsync:()=>xm,set:()=>Gb,setErrorMap:()=>rw,size:()=>rr,slugify:()=>Br,startsWith:()=>Mr,strictObject:()=>jb,string:()=>ei,stringFormat:()=>_b,stringbool:()=>cy,success:()=>Xb,superRefine:()=>xp,symbol:()=>Cb,templateLiteral:()=>ey,toJSONSchema:()=>ha,toLowerCase:()=>Fr,toUpperCase:()=>Zr,transform:()=>Ga,treeifyError:()=>Mc,trim:()=>Lr,tuple:()=>qm,uint32:()=>Tb,uint64:()=>kb,ulid:()=>cb,undefined:()=>Rb,union:()=>Ba,unknown:()=>or,uppercase:()=>Or,url:()=>rb,util:()=>_,uuid:()=>Jv,uuidv4:()=>Qv,uuidv6:()=>eb,uuidv7:()=>tb,void:()=>Ob,xid:()=>ub,xor:()=>Lb});var ht={};tt(ht,{$ZodAny:()=>ml,$ZodArray:()=>vl,$ZodAsyncError:()=>We,$ZodBase64:()=>rl,$ZodBase64URL:()=>nl,$ZodBigInt:()=>Ro,$ZodBigIntFormat:()=>cl,$ZodBoolean:()=>Wn,$ZodCIDRv4:()=>Qu,$ZodCIDRv6:()=>el,$ZodCUID:()=>Fu,$ZodCUID2:()=>Zu,$ZodCatch:()=>Dl,$ZodCheck:()=>q,$ZodCheckBigIntFormat:()=>vu,$ZodCheckEndsWith:()=>Nu,$ZodCheckGreaterThan:()=>Ao,$ZodCheckIncludes:()=>Tu,$ZodCheckLengthEquals:()=>Eu,$ZodCheckLessThan:()=>Io,$ZodCheckLowerCase:()=>Iu,$ZodCheckMaxLength:()=>Su,$ZodCheckMaxSize:()=>bu,$ZodCheckMimeType:()=>Cu,$ZodCheckMinLength:()=>xu,$ZodCheckMinSize:()=>yu,$ZodCheckMultipleOf:()=>hu,$ZodCheckNumberFormat:()=>gu,$ZodCheckOverwrite:()=>Ru,$ZodCheckProperty:()=>ku,$ZodCheckRegex:()=>$u,$ZodCheckSizeEquals:()=>_u,$ZodCheckStartsWith:()=>wu,$ZodCheckStringFormat:()=>kr,$ZodCheckUpperCase:()=>Au,$ZodCodec:()=>qn,$ZodCustom:()=>Bl,$ZodCustomStringFormat:()=>al,$ZodDate:()=>gl,$ZodDefault:()=>Cl,$ZodDiscriminatedUnion:()=>_l,$ZodE164:()=>il,$ZodEmail:()=>zu,$ZodEmoji:()=>Uu,$ZodEncodeError:()=>Rt,$ZodEnum:()=>Il,$ZodError:()=>Ln,$ZodExactOptional:()=>Nl,$ZodFile:()=>Tl,$ZodFunction:()=>Ll,$ZodGUID:()=>Du,$ZodIPv4:()=>Xu,$ZodIPv6:()=>Yu,$ZodISODate:()=>Hu,$ZodISODateTime:()=>Wu,$ZodISODuration:()=>Ku,$ZodISOTime:()=>qu,$ZodIntersection:()=>Sl,$ZodJWT:()=>ol,$ZodKSUID:()=>Gu,$ZodLazy:()=>Zl,$ZodLiteral:()=>Al,$ZodMAC:()=>Ju,$ZodMap:()=>El,$ZodNaN:()=>Ml,$ZodNanoID:()=>Lu,$ZodNever:()=>fl,$ZodNonOptional:()=>Pl,$ZodNull:()=>dl,$ZodNullable:()=>kl,$ZodNumber:()=>Co,$ZodNumberFormat:()=>sl,$ZodObject:()=>Gg,$ZodObjectJIT:()=>bl,$ZodOptional:()=>Oo,$ZodPipe:()=>Do,$ZodPrefault:()=>Rl,$ZodPreprocess:()=>zl,$ZodPromise:()=>Fl,$ZodReadonly:()=>jl,$ZodRealError:()=>we,$ZodRecord:()=>xl,$ZodRegistry:()=>Uo,$ZodSet:()=>$l,$ZodString:()=>tr,$ZodStringFormat:()=>B,$ZodSuccess:()=>Ol,$ZodSymbol:()=>ul,$ZodTemplateLiteral:()=>Ul,$ZodTransform:()=>wl,$ZodTuple:()=>Po,$ZodType:()=>N,$ZodULID:()=>Bu,$ZodURL:()=>ju,$ZodUUID:()=>Mu,$ZodUndefined:()=>ll,$ZodUnion:()=>Hn,$ZodUnknown:()=>pl,$ZodVoid:()=>hl,$ZodXID:()=>Vu,$ZodXor:()=>yl,$brand:()=>$c,$constructor:()=>p,$input:()=>Gl,$output:()=>Vl,Doc:()=>Gn,JSONSchema:()=>Hv,JSONSchemaGenerator:()=>ga,NEVER:()=>Ec,TimePrecision:()=>Kl,_any:()=>gd,_array:()=>Ed,_base64:()=>na,_base64url:()=>ia,_bigint:()=>ud,_boolean:()=>sd,_catch:()=>G0,_check:()=>Wv,_cidrv4:()=>ta,_cidrv6:()=>ra,_coercedBigint:()=>ld,_coercedBoolean:()=>cd,_coercedDate:()=>Sd,_coercedNumber:()=>td,_coercedString:()=>Hl,_cuid:()=>qo,_cuid2:()=>Ko,_custom:()=>Id,_date:()=>_d,_decode:()=>go,_decodeAsync:()=>bo,_default:()=>Z0,_discriminatedUnion:()=>k0,_e164:()=>oa,_email:()=>Fo,_emoji:()=>Wo,_encode:()=>ho,_encodeAsync:()=>vo,_endsWith:()=>zr,_enum:()=>M0,_file:()=>$d,_float32:()=>nd,_float64:()=>id,_gt:()=>nt,_gte:()=>Se,_guid:()=>Yn,_includes:()=>Dr,_int:()=>rd,_int32:()=>od,_int64:()=>dd,_intersection:()=>C0,_ipv4:()=>Qo,_ipv6:()=>ea,_isoDate:()=>Yl,_isoDateTime:()=>Xl,_isoDuration:()=>Ql,_isoTime:()=>Jl,_jwt:()=>aa,_ksuid:()=>Jo,_lazy:()=>K0,_length:()=>ir,_literal:()=>j0,_lowercase:()=>Pr,_lt:()=>rt,_lte:()=>ze,_mac:()=>ql,_map:()=>O0,_max:()=>ze,_maxLength:()=>nr,_maxSize:()=>jt,_mime:()=>jr,_min:()=>Se,_minLength:()=>ft,_minSize:()=>it,_multipleOf:()=>zt,_nan:()=>xd,_nanoid:()=>Ho,_nativeEnum:()=>z0,_negative:()=>ca,_never:()=>bd,_nonnegative:()=>la,_nonoptional:()=>B0,_nonpositive:()=>ua,_normalize:()=>Ur,_null:()=>hd,_nullable:()=>F0,_number:()=>ed,_optional:()=>L0,_overwrite:()=>He,_parse:()=>Ar,_parseAsync:()=>Tr,_pipe:()=>W0,_positive:()=>sa,_promise:()=>X0,_property:()=>da,_readonly:()=>H0,_record:()=>P0,_refine:()=>Ad,_regex:()=>Rr,_safeDecode:()=>_o,_safeDecodeAsync:()=>xo,_safeEncode:()=>yo,_safeEncodeAsync:()=>So,_safeParse:()=>wr,_safeParseAsync:()=>Nr,_set:()=>D0,_size:()=>rr,_slugify:()=>Br,_startsWith:()=>Mr,_string:()=>Wl,_stringFormat:()=>Vr,_stringbool:()=>kd,_success:()=>V0,_superRefine:()=>Td,_symbol:()=>pd,_templateLiteral:()=>q0,_toLowerCase:()=>Fr,_toUpperCase:()=>Zr,_transform:()=>U0,_trim:()=>Lr,_tuple:()=>R0,_uint32:()=>ad,_uint64:()=>md,_ulid:()=>Xo,_undefined:()=>fd,_union:()=>w0,_unknown:()=>vd,_uppercase:()=>Or,_url:()=>Jn,_uuid:()=>Zo,_uuidv4:()=>Bo,_uuidv6:()=>Vo,_uuidv7:()=>Go,_void:()=>yd,_xid:()=>Yo,_xor:()=>N0,clone:()=>ye,config:()=>ne,createStandardJSONSchemaMethod:()=>Gr,createToJSONSchemaMethod:()=>Cd,decode:()=>XA,decodeAsync:()=>JA,describe:()=>wd,encode:()=>KA,encodeAsync:()=>YA,extractDefs:()=>Lt,finalize:()=>Ft,flattenError:()=>Fn,formatError:()=>Zn,globalConfig:()=>Jt,globalRegistry:()=>pe,initializeContext:()=>Ut,isValidBase64:()=>tl,isValidBase64URL:()=>Fg,isValidJWT:()=>Zg,locales:()=>Xn,meta:()=>Nd,parse:()=>po,parseAsync:()=>fo,prettifyError:()=>zc,process:()=>j,regexes:()=>Me,registry:()=>Lo,safeDecode:()=>eT,safeDecodeAsync:()=>rT,safeEncode:()=>QA,safeEncodeAsync:()=>tT,safeParse:()=>jc,safeParseAsync:()=>Uc,toDotPath:()=>_g,toJSONSchema:()=>ha,treeifyError:()=>Mc,util:()=>_,version:()=>Pu});var hg,Ec=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 $c=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"}};(hg=globalThis).__zod_globalConfig??(hg.__zod_globalConfig={});var Jt=globalThis.__zod_globalConfig;function ne(e){return e&&Object.assign(Jt,e),Jt}var _={};tt(_,{BIGINT_FORMAT_RANGES:()=>Oc,Class:()=>Ac,NUMBER_FORMAT_RANGES:()=>Pc,aborted:()=>Mt,allowsEval:()=>Nc,assert:()=>TA,assertEqual:()=>EA,assertIs:()=>IA,assertNever:()=>AA,assertNotEqual:()=>$A,assignProp:()=>Ot,base64ToUint8Array:()=>vg,base64urlToUint8Array:()=>VA,cached:()=>$r,captureStackTrace:()=>mo,cleanEnum:()=>BA,cleanRegex:()=>Mn,clone:()=>ye,cloneDef:()=>NA,createTransparentProxy:()=>DA,defineLazy:()=>O,esc:()=>lo,escapeRegex:()=>Le,explicitlyAborted:()=>Dc,extend:()=>jA,finalizeIssue:()=>_e,floatSafeRemainder:()=>Tc,getElementAtPath:()=>kA,getEnumValues:()=>Dn,getLengthableOrigin:()=>Un,getParsedType:()=>OA,getSizableOrigin:()=>jn,hexToUint8Array:()=>WA,isObject:()=>Qt,isPlainObject:()=>Dt,issue:()=>Ir,joinValues:()=>g,jsonStringifyReplacer:()=>Er,merge:()=>LA,mergeDefs:()=>pt,normalizeParams:()=>S,nullish:()=>Pt,numKeys:()=>PA,objectClone:()=>wA,omit:()=>zA,optionalKeys:()=>Rc,parsedType:()=>y,partial:()=>FA,pick:()=>MA,prefixIssues:()=>Te,primitiveTypes:()=>Cc,promiseAllObject:()=>CA,propertyKeyTypes:()=>zn,randomString:()=>RA,required:()=>ZA,safeExtend:()=>UA,shallowClone:()=>kc,slugify:()=>wc,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>bg,uint8ArrayToBase64url:()=>GA,uint8ArrayToHex:()=>HA,unwrapMessage:()=>On});function EA(e){return e}function $A(e){return e}function IA(e){}function AA(e){throw new Error("Unexpected value in exhaustive check")}function TA(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 Er(e,t){return typeof t=="bigint"?t.toString():t}function $r(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 Tc(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 gg=Symbol("evaluating");function O(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==gg)return i===void 0&&(i=gg,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function wA(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 pt(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function NA(e){return pt(e._zod.def)}function kA(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function CA(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 RA(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function lo(e){return JSON.stringify(e)}function wc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var mo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Nc=$r(()=>{if(Jt.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(Qt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Qt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function kc(e){return Dt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function PA(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var OA=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"]),Cc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Le(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 DA(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 Rc(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Pc={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]},Oc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function MA(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=pt(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 zA(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=pt(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 jA(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=pt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Ot(this,"shape",o),o}});return ye(e,r)}function UA(e,t){if(!Dt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=pt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Ot(this,"shape",i),i}});return ye(e,n)}function LA(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=pt(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 FA(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=pt(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 ZA(e,t,n){let i=pt(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 Dc(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 Un(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 Ir(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function BA(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function vg(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 bg(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function VA(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return vg(t+n)}function GA(e){return bg(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function WA(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 HA(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ac=class{constructor(...t){}};var yg=(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,Er,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ln=p("$ZodError",yg),we=p("$ZodError",yg,{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 Mc(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 _g(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 zc(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 ${_g(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(HI.hide):this.out.write(JO(this.outputText,this.out.columns)),super.render(),this.outputText=[WI.symbol(this.done,this.aborted),GI.bold(this.msg),WI.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:GI.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(QO.line+HI.to(0)+this.outputText))}};qI.exports=dg});var YI=I((RW,XI)=>{"use strict";XI.exports={TextPrompt:q$(),SelectPrompt:J$(),TogglePrompt:rI(),DatePrompt:wI(),NumberPrompt:RI(),MultiselectPrompt:ag(),AutocompletePrompt:LI(),AutocompleteMultiselectPrompt:VI(),ConfirmPrompt:KI()}});var QI=I(JI=>{"use strict";var De=JI,eD=YI(),yc=e=>e;function mt(e,t,n={}){return new Promise((i,r)=>{let o=new eD[e](t),a=n.onAbort||yc,c=n.onSubmit||yc,u=n.onExit||yc;o.on("state",t.onState||yc),o.on("submit",l=>i(c(l))),o.on("exit",l=>i(u(l))),o.on("abort",l=>r(a(l)))})}De.text=e=>mt("TextPrompt",e);De.password=e=>(e.style="password",De.text(e));De.invisible=e=>(e.style="invisible",De.text(e));De.number=e=>mt("NumberPrompt",e);De.date=e=>mt("DatePrompt",e);De.confirm=e=>mt("ConfirmPrompt",e);De.list=e=>{let t=e.separator||",";return mt("TextPrompt",e,{onSubmit:n=>n.split(t).map(i=>i.trim())})};De.toggle=e=>mt("TogglePrompt",e);De.select=e=>mt("SelectPrompt",e);De.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=n=>n.filter(i=>i.selected).map(i=>i.value);return mt("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 mt("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};var tD=(e,t)=>Promise.resolve(t.filter(n=>n.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));De.autocomplete=e=>(e.suggest=e.suggest||tD,e.choices=[].concat(e.choices||[]),mt("AutocompletePrompt",e))});var rA=I((OW,tA)=>{"use strict";var mg=QI(),rD=["suggest","format","onState","validate","onRender","type"],eA=()=>{};async function Xt(e=[],{onSubmit:t=eA,onCancel:n=eA}={}){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(rD.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,mg[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?nD(Xt._injected,a.initial):await mg[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 nD(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function iD(e){Xt._injected=(Xt._injected||[]).concat(e)}function oD(e){Xt._override=Object.assign({},e)}tA.exports=Object.assign(Xt,{prompt:Xt,prompts:mg,inject:iD,override:oD})});var iA=I((DW,nA)=>{function aD(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}nA.exports=aD("8.6.0")?w$():rA()});import{join as hA,dirname as mD,normalize as gA}from"node:path";var vA="fjall";function bA(e,t){let n=gA(e);if(n.includes("..")||n.startsWith("/"))throw new Error(`Invalid ${t}: path traversal is not allowed`)}function Pn(e){return bA(e,"app name"),hA(vA,e,yA)}var yA="infrastructure.ts";function _A(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uo(e,t,n){let i=Pn(t),r=e.read(i)?.toString();return r?new RegExp(`["']${_A(n)}["']`).test(r):!1}function Sc(e,t,n){let i=Pn(t);if(!e.read(i)?.toString())throw new Error(`Infrastructure file not found for ${t}`);if(uo(e,t,n))throw new Error(`Resource name '${n}' already exists in ${t}. Please choose a different name or remove the existing resource first.`)}import*as wn from"fs";import*as Ix from"path";function kt(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 Yt(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 xA=/fjall_ak_[A-Z2-7]{16}\.[A-Z2-7]{40}/g;function xc(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(xA,"fjall_ak_***")}var s={};tt(s,{$brand:()=>$c,$input:()=>Gl,$output:()=>Vl,NEVER:()=>Ec,TimePrecision:()=>Kl,ZodAny:()=>jm,ZodArray:()=>Zm,ZodBase64:()=>za,ZodBase64URL:()=>ja,ZodBigInt:()=>Qr,ZodBigIntFormat:()=>Fa,ZodBoolean:()=>Jr,ZodCIDRv4:()=>Da,ZodCIDRv6:()=>Ma,ZodCUID:()=>wa,ZodCUID2:()=>Na,ZodCatch:()=>lp,ZodCodec:()=>di,ZodCustom:()=>mi,ZodCustomStringFormat:()=>Xr,ZodDate:()=>ai,ZodDefault:()=>ip,ZodDiscriminatedUnion:()=>Vm,ZodE164:()=>Ua,ZodEmail:()=>Ia,ZodEmoji:()=>Aa,ZodEnum:()=>qr,ZodError:()=>Q0,ZodExactOptional:()=>tp,ZodFile:()=>Qm,ZodFirstPartyTypeKind:()=>Ep,ZodFunction:()=>_p,ZodGUID:()=>ti,ZodIPv4:()=>Pa,ZodIPv6:()=>Oa,ZodISODate:()=>ya,ZodISODateTime:()=>ba,ZodISODuration:()=>Sa,ZodISOTime:()=>_a,ZodIntersection:()=>Gm,ZodIssueCode:()=>tw,ZodJWT:()=>La,ZodKSUID:()=>Ra,ZodLazy:()=>vp,ZodLiteral:()=>Jm,ZodMAC:()=>Cm,ZodMap:()=>Xm,ZodNaN:()=>mp,ZodNanoID:()=>Ta,ZodNever:()=>Lm,ZodNonOptional:()=>Ha,ZodNull:()=>Mm,ZodNullable:()=>np,ZodNumber:()=>Yr,ZodNumberFormat:()=>ar,ZodObject:()=>ci,ZodOptional:()=>Wa,ZodPipe:()=>li,ZodPrefault:()=>ap,ZodPreprocess:()=>pp,ZodPromise:()=>yp,ZodReadonly:()=>fp,ZodRealError:()=>Ne,ZodRecord:()=>Hr,ZodSet:()=>Ym,ZodString:()=>Kr,ZodStringFormat:()=>V,ZodSuccess:()=>up,ZodSymbol:()=>Om,ZodTemplateLiteral:()=>gp,ZodTransform:()=>ep,ZodTuple:()=>Hm,ZodType:()=>k,ZodULID:()=>ka,ZodURL:()=>oi,ZodUUID:()=>ot,ZodUndefined:()=>Dm,ZodUnion:()=>ui,ZodUnknown:()=>Um,ZodVoid:()=>Fm,ZodXID:()=>Ca,ZodXor:()=>Bm,_ZodString:()=>$a,_default:()=>op,_function:()=>ry,any:()=>Pb,array:()=>si,base64:()=>gb,base64url:()=>vb,bigint:()=>wb,boolean:()=>Pm,catch:()=>dp,check:()=>ny,cidrv4:()=>fb,cidrv6:()=>hb,clone:()=>ye,codec:()=>Jb,coerce:()=>$p,config:()=>ne,core:()=>ht,cuid:()=>ab,cuid2:()=>sb,custom:()=>iy,date:()=>Db,decode:()=>$m,decodeAsync:()=>Am,describe:()=>oy,discriminatedUnion:()=>Fb,e164:()=>bb,email:()=>Xv,emoji:()=>ib,encode:()=>Em,encodeAsync:()=>Im,endsWith:()=>zr,enum:()=>Va,exactOptional:()=>rp,file:()=>qb,flattenError:()=>Fn,float32:()=>$b,float64:()=>Ib,formatError:()=>Zn,fromJSONSchema:()=>my,function:()=>ry,getErrorMap:()=>nw,globalRegistry:()=>pe,gt:()=>nt,gte:()=>Se,guid:()=>Yv,hash:()=>Eb,hex:()=>xb,hostname:()=>Sb,httpUrl:()=>nb,includes:()=>Dr,instanceof:()=>sy,int:()=>xa,int32:()=>Ab,int64:()=>Nb,intersection:()=>Wm,invertCodec:()=>Qb,ipv4:()=>db,ipv6:()=>pb,iso:()=>Wr,json:()=>uy,jwt:()=>yb,keyof:()=>Mb,ksuid:()=>lb,lazy:()=>bp,length:()=>ir,literal:()=>Hb,locales:()=>Xn,looseObject:()=>Ub,looseRecord:()=>Bb,lowercase:()=>Pr,lt:()=>rt,lte:()=>ze,mac:()=>mb,map:()=>Vb,maxLength:()=>nr,maxSize:()=>jt,meta:()=>ay,mime:()=>jr,minLength:()=>ft,minSize:()=>it,multipleOf:()=>zt,nan:()=>Yb,nanoid:()=>ob,nativeEnum:()=>Wb,negative:()=>ca,never:()=>Za,nonnegative:()=>la,nonoptional:()=>cp,nonpositive:()=>ua,normalize:()=>Ur,null:()=>zm,nullable:()=>ni,nullish:()=>Kb,number:()=>Rm,object:()=>zb,optional:()=>ri,overwrite:()=>He,parse:()=>ym,parseAsync:()=>_m,partialRecord:()=>Zb,pipe:()=>Ea,positive:()=>sa,prefault:()=>sp,preprocess:()=>ly,prettifyError:()=>zc,promise:()=>ty,property:()=>da,readonly:()=>hp,record:()=>Km,refine:()=>Sp,regex:()=>Rr,regexes:()=>Me,registry:()=>Lo,safeDecode:()=>wm,safeDecodeAsync:()=>km,safeEncode:()=>Tm,safeEncodeAsync:()=>Nm,safeParse:()=>Sm,safeParseAsync:()=>xm,set:()=>Gb,setErrorMap:()=>rw,size:()=>rr,slugify:()=>Br,startsWith:()=>Mr,strictObject:()=>jb,string:()=>ei,stringFormat:()=>_b,stringbool:()=>cy,success:()=>Xb,superRefine:()=>xp,symbol:()=>Cb,templateLiteral:()=>ey,toJSONSchema:()=>ha,toLowerCase:()=>Fr,toUpperCase:()=>Zr,transform:()=>Ga,treeifyError:()=>Mc,trim:()=>Lr,tuple:()=>qm,uint32:()=>Tb,uint64:()=>kb,ulid:()=>cb,undefined:()=>Rb,union:()=>Ba,unknown:()=>or,uppercase:()=>Or,url:()=>rb,util:()=>_,uuid:()=>Jv,uuidv4:()=>Qv,uuidv6:()=>eb,uuidv7:()=>tb,void:()=>Ob,xid:()=>ub,xor:()=>Lb});var ht={};tt(ht,{$ZodAny:()=>ml,$ZodArray:()=>vl,$ZodAsyncError:()=>We,$ZodBase64:()=>rl,$ZodBase64URL:()=>nl,$ZodBigInt:()=>Ro,$ZodBigIntFormat:()=>cl,$ZodBoolean:()=>Wn,$ZodCIDRv4:()=>Qu,$ZodCIDRv6:()=>el,$ZodCUID:()=>Fu,$ZodCUID2:()=>Zu,$ZodCatch:()=>Dl,$ZodCheck:()=>q,$ZodCheckBigIntFormat:()=>vu,$ZodCheckEndsWith:()=>Nu,$ZodCheckGreaterThan:()=>Ao,$ZodCheckIncludes:()=>Tu,$ZodCheckLengthEquals:()=>Eu,$ZodCheckLessThan:()=>Io,$ZodCheckLowerCase:()=>Iu,$ZodCheckMaxLength:()=>Su,$ZodCheckMaxSize:()=>bu,$ZodCheckMimeType:()=>Cu,$ZodCheckMinLength:()=>xu,$ZodCheckMinSize:()=>yu,$ZodCheckMultipleOf:()=>hu,$ZodCheckNumberFormat:()=>gu,$ZodCheckOverwrite:()=>Ru,$ZodCheckProperty:()=>ku,$ZodCheckRegex:()=>$u,$ZodCheckSizeEquals:()=>_u,$ZodCheckStartsWith:()=>wu,$ZodCheckStringFormat:()=>kr,$ZodCheckUpperCase:()=>Au,$ZodCodec:()=>qn,$ZodCustom:()=>Bl,$ZodCustomStringFormat:()=>al,$ZodDate:()=>gl,$ZodDefault:()=>Cl,$ZodDiscriminatedUnion:()=>_l,$ZodE164:()=>il,$ZodEmail:()=>zu,$ZodEmoji:()=>Uu,$ZodEncodeError:()=>Rt,$ZodEnum:()=>Il,$ZodError:()=>Ln,$ZodExactOptional:()=>Nl,$ZodFile:()=>Tl,$ZodFunction:()=>Ll,$ZodGUID:()=>Du,$ZodIPv4:()=>Xu,$ZodIPv6:()=>Yu,$ZodISODate:()=>Hu,$ZodISODateTime:()=>Wu,$ZodISODuration:()=>Ku,$ZodISOTime:()=>qu,$ZodIntersection:()=>Sl,$ZodJWT:()=>ol,$ZodKSUID:()=>Gu,$ZodLazy:()=>Zl,$ZodLiteral:()=>Al,$ZodMAC:()=>Ju,$ZodMap:()=>El,$ZodNaN:()=>Ml,$ZodNanoID:()=>Lu,$ZodNever:()=>fl,$ZodNonOptional:()=>Pl,$ZodNull:()=>dl,$ZodNullable:()=>kl,$ZodNumber:()=>Co,$ZodNumberFormat:()=>sl,$ZodObject:()=>Gg,$ZodObjectJIT:()=>bl,$ZodOptional:()=>Oo,$ZodPipe:()=>Do,$ZodPrefault:()=>Rl,$ZodPreprocess:()=>zl,$ZodPromise:()=>Fl,$ZodReadonly:()=>jl,$ZodRealError:()=>we,$ZodRecord:()=>xl,$ZodRegistry:()=>Uo,$ZodSet:()=>$l,$ZodString:()=>tr,$ZodStringFormat:()=>B,$ZodSuccess:()=>Ol,$ZodSymbol:()=>ul,$ZodTemplateLiteral:()=>Ul,$ZodTransform:()=>wl,$ZodTuple:()=>Po,$ZodType:()=>N,$ZodULID:()=>Bu,$ZodURL:()=>ju,$ZodUUID:()=>Mu,$ZodUndefined:()=>ll,$ZodUnion:()=>Hn,$ZodUnknown:()=>pl,$ZodVoid:()=>hl,$ZodXID:()=>Vu,$ZodXor:()=>yl,$brand:()=>$c,$constructor:()=>p,$input:()=>Gl,$output:()=>Vl,Doc:()=>Gn,JSONSchema:()=>Hv,JSONSchemaGenerator:()=>ga,NEVER:()=>Ec,TimePrecision:()=>Kl,_any:()=>gd,_array:()=>Ed,_base64:()=>na,_base64url:()=>ia,_bigint:()=>ud,_boolean:()=>sd,_catch:()=>G0,_check:()=>Wv,_cidrv4:()=>ta,_cidrv6:()=>ra,_coercedBigint:()=>ld,_coercedBoolean:()=>cd,_coercedDate:()=>Sd,_coercedNumber:()=>td,_coercedString:()=>Hl,_cuid:()=>qo,_cuid2:()=>Ko,_custom:()=>Id,_date:()=>_d,_decode:()=>go,_decodeAsync:()=>bo,_default:()=>Z0,_discriminatedUnion:()=>k0,_e164:()=>oa,_email:()=>Fo,_emoji:()=>Wo,_encode:()=>ho,_encodeAsync:()=>vo,_endsWith:()=>zr,_enum:()=>M0,_file:()=>$d,_float32:()=>nd,_float64:()=>id,_gt:()=>nt,_gte:()=>Se,_guid:()=>Yn,_includes:()=>Dr,_int:()=>rd,_int32:()=>od,_int64:()=>dd,_intersection:()=>C0,_ipv4:()=>Qo,_ipv6:()=>ea,_isoDate:()=>Yl,_isoDateTime:()=>Xl,_isoDuration:()=>Ql,_isoTime:()=>Jl,_jwt:()=>aa,_ksuid:()=>Jo,_lazy:()=>K0,_length:()=>ir,_literal:()=>j0,_lowercase:()=>Pr,_lt:()=>rt,_lte:()=>ze,_mac:()=>ql,_map:()=>O0,_max:()=>ze,_maxLength:()=>nr,_maxSize:()=>jt,_mime:()=>jr,_min:()=>Se,_minLength:()=>ft,_minSize:()=>it,_multipleOf:()=>zt,_nan:()=>xd,_nanoid:()=>Ho,_nativeEnum:()=>z0,_negative:()=>ca,_never:()=>bd,_nonnegative:()=>la,_nonoptional:()=>B0,_nonpositive:()=>ua,_normalize:()=>Ur,_null:()=>hd,_nullable:()=>F0,_number:()=>ed,_optional:()=>L0,_overwrite:()=>He,_parse:()=>Ar,_parseAsync:()=>Tr,_pipe:()=>W0,_positive:()=>sa,_promise:()=>X0,_property:()=>da,_readonly:()=>H0,_record:()=>P0,_refine:()=>Ad,_regex:()=>Rr,_safeDecode:()=>_o,_safeDecodeAsync:()=>xo,_safeEncode:()=>yo,_safeEncodeAsync:()=>So,_safeParse:()=>wr,_safeParseAsync:()=>Nr,_set:()=>D0,_size:()=>rr,_slugify:()=>Br,_startsWith:()=>Mr,_string:()=>Wl,_stringFormat:()=>Vr,_stringbool:()=>kd,_success:()=>V0,_superRefine:()=>Td,_symbol:()=>pd,_templateLiteral:()=>q0,_toLowerCase:()=>Fr,_toUpperCase:()=>Zr,_transform:()=>U0,_trim:()=>Lr,_tuple:()=>R0,_uint32:()=>ad,_uint64:()=>md,_ulid:()=>Xo,_undefined:()=>fd,_union:()=>w0,_unknown:()=>vd,_uppercase:()=>Or,_url:()=>Jn,_uuid:()=>Zo,_uuidv4:()=>Bo,_uuidv6:()=>Vo,_uuidv7:()=>Go,_void:()=>yd,_xid:()=>Yo,_xor:()=>N0,clone:()=>ye,config:()=>ne,createStandardJSONSchemaMethod:()=>Gr,createToJSONSchemaMethod:()=>Cd,decode:()=>XA,decodeAsync:()=>JA,describe:()=>wd,encode:()=>KA,encodeAsync:()=>YA,extractDefs:()=>Lt,finalize:()=>Ft,flattenError:()=>Fn,formatError:()=>Zn,globalConfig:()=>Jt,globalRegistry:()=>pe,initializeContext:()=>Ut,isValidBase64:()=>tl,isValidBase64URL:()=>Fg,isValidJWT:()=>Zg,locales:()=>Xn,meta:()=>Nd,parse:()=>po,parseAsync:()=>fo,prettifyError:()=>zc,process:()=>j,regexes:()=>Me,registry:()=>Lo,safeDecode:()=>eT,safeDecodeAsync:()=>rT,safeEncode:()=>QA,safeEncodeAsync:()=>tT,safeParse:()=>jc,safeParseAsync:()=>Uc,toDotPath:()=>_g,toJSONSchema:()=>ha,treeifyError:()=>Mc,util:()=>_,version:()=>Pu});var hg,Ec=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 $c=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"}};(hg=globalThis).__zod_globalConfig??(hg.__zod_globalConfig={});var Jt=globalThis.__zod_globalConfig;function ne(e){return e&&Object.assign(Jt,e),Jt}var _={};tt(_,{BIGINT_FORMAT_RANGES:()=>Oc,Class:()=>Ac,NUMBER_FORMAT_RANGES:()=>Pc,aborted:()=>Mt,allowsEval:()=>Nc,assert:()=>TA,assertEqual:()=>EA,assertIs:()=>IA,assertNever:()=>AA,assertNotEqual:()=>$A,assignProp:()=>Ot,base64ToUint8Array:()=>vg,base64urlToUint8Array:()=>VA,cached:()=>$r,captureStackTrace:()=>mo,cleanEnum:()=>BA,cleanRegex:()=>Mn,clone:()=>ye,cloneDef:()=>NA,createTransparentProxy:()=>DA,defineLazy:()=>O,esc:()=>lo,escapeRegex:()=>Le,explicitlyAborted:()=>Dc,extend:()=>jA,finalizeIssue:()=>_e,floatSafeRemainder:()=>Tc,getElementAtPath:()=>kA,getEnumValues:()=>Dn,getLengthableOrigin:()=>Un,getParsedType:()=>OA,getSizableOrigin:()=>jn,hexToUint8Array:()=>WA,isObject:()=>Qt,isPlainObject:()=>Dt,issue:()=>Ir,joinValues:()=>g,jsonStringifyReplacer:()=>Er,merge:()=>LA,mergeDefs:()=>pt,normalizeParams:()=>S,nullish:()=>Pt,numKeys:()=>PA,objectClone:()=>wA,omit:()=>zA,optionalKeys:()=>Rc,parsedType:()=>y,partial:()=>FA,pick:()=>MA,prefixIssues:()=>Te,primitiveTypes:()=>Cc,promiseAllObject:()=>CA,propertyKeyTypes:()=>zn,randomString:()=>RA,required:()=>ZA,safeExtend:()=>UA,shallowClone:()=>kc,slugify:()=>wc,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>bg,uint8ArrayToBase64url:()=>GA,uint8ArrayToHex:()=>HA,unwrapMessage:()=>On});function EA(e){return e}function $A(e){return e}function IA(e){}function AA(e){throw new Error("Unexpected value in exhaustive check")}function TA(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 Er(e,t){return typeof t=="bigint"?t.toString():t}function $r(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 Tc(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 gg=Symbol("evaluating");function O(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==gg)return i===void 0&&(i=gg,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function wA(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 pt(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function NA(e){return pt(e._zod.def)}function kA(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function CA(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 RA(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function lo(e){return JSON.stringify(e)}function wc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var mo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Nc=$r(()=>{if(Jt.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(Qt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Qt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function kc(e){return Dt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function PA(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var OA=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"]),Cc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Le(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 DA(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 Rc(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Pc={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]},Oc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function MA(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=pt(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 zA(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=pt(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 jA(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=pt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Ot(this,"shape",o),o}});return ye(e,r)}function UA(e,t){if(!Dt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=pt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Ot(this,"shape",i),i}});return ye(e,n)}function LA(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=pt(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 FA(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=pt(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 ZA(e,t,n){let i=pt(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 Dc(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 Un(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 Ir(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function BA(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function vg(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 bg(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function VA(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return vg(t+n)}function GA(e){return bg(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function WA(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 HA(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ac=class{constructor(...t){}};var yg=(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,Er,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ln=p("$ZodError",yg),we=p("$ZodError",yg,{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 Mc(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 _g(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 zc(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 ${_g(i.path)}`);return t.join(`
|
|
101
101
|
`)}var Ar=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 mo(c,r?.callee),c}return a.value},po=Ar(we),Tr=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 mo(c,r?.callee),c}return a.value},fo=Tr(we),wr=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??Ln)(o.issues.map(a=>_e(a,r,ne())))}:{success:!0,data:o.value}},jc=wr(we),Nr=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}},Uc=Nr(we),ho=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Ar(e)(t,n,r)},KA=ho(we),go=e=>(t,n,i)=>Ar(e)(t,n,i),XA=go(we),vo=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Tr(e)(t,n,r)},YA=vo(we),bo=e=>async(t,n,i)=>Tr(e)(t,n,i),JA=bo(we),yo=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return wr(e)(t,n,r)},QA=yo(we),_o=e=>(t,n,i)=>wr(e)(t,n,i),eT=_o(we),So=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Nr(e)(t,n,r)},tT=So(we),xo=e=>async(t,n,i)=>Nr(e)(t,n,i),rT=xo(we);var Me={};tt(Me,{base64:()=>tu,base64url:()=>Eo,bigint:()=>cu,boolean:()=>lu,browserEmail:()=>lT,cidrv4:()=>Qc,cidrv6:()=>eu,cuid:()=>Lc,cuid2:()=>Fc,date:()=>iu,datetime:()=>au,domain:()=>pT,duration:()=>Wc,e164:()=>nu,email:()=>qc,emoji:()=>Kc,extendedDuration:()=>nT,guid:()=>Hc,hex:()=>fT,hostname:()=>mT,html5Email:()=>sT,httpProtocol:()=>ru,idnEmail:()=>uT,integer:()=>uu,ipv4:()=>Xc,ipv6:()=>Yc,ksuid:()=>Vc,lowercase:()=>pu,mac:()=>Jc,md5_base64:()=>gT,md5_base64url:()=>vT,md5_hex:()=>hT,nanoid:()=>Gc,null:()=>du,number:()=>$o,rfc5322Email:()=>cT,sha1_base64:()=>yT,sha1_base64url:()=>_T,sha1_hex:()=>bT,sha256_base64:()=>xT,sha256_base64url:()=>ET,sha256_hex:()=>ST,sha384_base64:()=>IT,sha384_base64url:()=>AT,sha384_hex:()=>$T,sha512_base64:()=>wT,sha512_base64url:()=>NT,sha512_hex:()=>TT,string:()=>su,time:()=>ou,ulid:()=>Zc,undefined:()=>mu,unicodeEmail:()=>Sg,uppercase:()=>fu,uuid:()=>er,uuid4:()=>iT,uuid6:()=>oT,uuid7:()=>aT,xid:()=>Bc});var Lc=/^[cC][0-9a-z]{6,}$/,Fc=/^[0-9a-z]+$/,Zc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Bc=/^[0-9a-vA-V]{20}$/,Vc=/^[A-Za-z0-9]{27}$/,Gc=/^[a-zA-Z0-9_-]{21}$/,Wc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nT=/^[-+]?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)?)??$/,Hc=/^([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})$/,er=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)$/,iT=er(4),oT=er(6),aT=er(7),qc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,sT=/^[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])?)*$/,cT=/^(([^<>()\[\]\\.,;:\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,}))$/,Sg=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,uT=Sg,lT=/^[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])?)*$/,dT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Kc(){return new RegExp(dT,"u")}var Xc=/^(?:(?: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])$/,Yc=/^(([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}|:))$/,Jc=e=>{let t=Le(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},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])\/([0-9]|[1-2][0-9]|3[0-2])$/,eu=/^(([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])$/,tu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Eo=/^[A-Za-z0-9_-]*$/,mT=/^(?=.{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])?)*\.?$/,pT=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ru=/^https?$/,nu=/^\+[1-9]\d{6,14}$/,xg="(?:(?:\\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])))",iu=new RegExp(`^${xg}$`);function Eg(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 ou(e){return new RegExp(`^${Eg(e)}$`)}function au(e){let t=Eg({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(`^${xg}T(?:${i})$`)}var su=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},cu=/^-?\d+n?$/,uu=/^-?\d+$/,$o=/^-?\d+(?:\.\d+)?$/,lu=/^(?:true|false)$/i,du=/^null$/i;var mu=/^undefined$/i;var pu=/^[^A-Z]*$/,fu=/^[^a-z]*$/,fT=/^[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 hT=/^[0-9a-fA-F]{32}$/,gT=Bn(22,"=="),vT=Vn(22),bT=/^[0-9a-fA-F]{40}$/,yT=Bn(27,"="),_T=Vn(27),ST=/^[0-9a-fA-F]{64}$/,xT=Bn(43,"="),ET=Vn(43),$T=/^[0-9a-fA-F]{96}$/,IT=Bn(64,""),AT=Vn(64),TT=/^[0-9a-fA-F]{128}$/,wT=Bn(86,"=="),NT=Vn(86);var q=p("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ig={number:"number",bigint:"bigint",object:"date"},Io=p("$ZodCheckLessThan",(e,t)=>{q.init(e,t);let n=Ig[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})}}),Ao=p("$ZodCheckGreaterThan",(e,t)=>{q.init(e,t);let n=Ig[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})}}),hu=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):Tc(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})}}),gu=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]=Pc[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=uu)}),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})}}),vu=p("$ZodCheckBigIntFormat",(e,t)=>{q.init(e,t);let[n,i]=Oc[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})}}),bu=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})}}),yu=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})}}),_u=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})}}),Su=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=Un(r);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),xu=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=Un(r);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Eu=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=Un(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})}}),kr=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=()=>{})}),$u=p("$ZodCheckRegex",(e,t)=>{kr.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})}}),Iu=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=pu),kr.init(e,t)}),Au=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=fu),kr.init(e,t)}),Tu=p("$ZodCheckIncludes",(e,t)=>{q.init(e,t);let n=Le(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})}}),wu=p("$ZodCheckStartsWith",(e,t)=>{q.init(e,t);let n=new RegExp(`^${Le(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})}}),Nu=p("$ZodCheckEndsWith",(e,t)=>{q.init(e,t);let n=new RegExp(`.*${Le(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 $g(e,t,n){e.issues.length&&t.issues.push(...Te(n,e.issues))}var ku=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=>$g(r,n,t.property));$g(i,n,t.property)}}),Cu=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})}}),Ru=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 Pu={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=Pu;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(Dc(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=jc(e,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Uc(e,r).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),tr=p("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??su(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)=>{kr.init(e,t),tr.init(e,t)}),Du=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Hc),B.init(e,t)}),Mu=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=er(i))}else t.pattern??(t.pattern=er());B.init(e,t)}),zu=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=qc),B.init(e,t)}),ju=p("$ZodURL",(e,t)=>{B.init(e,t),e._zod.check=n=>{try{let i=n.value.trim();if(!t.normalize&&t.protocol?.source===ru.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})}}}),Uu=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Kc()),B.init(e,t)}),Lu=p("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Gc),B.init(e,t)}),Fu=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Lc),B.init(e,t)}),Zu=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Fc),B.init(e,t)}),Bu=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Zc),B.init(e,t)}),Vu=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Bc),B.init(e,t)}),Gu=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Vc),B.init(e,t)}),Wu=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=au(t)),B.init(e,t)}),Hu=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=iu),B.init(e,t)}),qu=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ou(t)),B.init(e,t)}),Ku=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Wc),B.init(e,t)}),Xu=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Xc),B.init(e,t),e._zod.bag.format="ipv4"}),Yu=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Yc),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})}}}),Ju=p("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Jc(t.delimiter)),B.init(e,t),e._zod.bag.format="mac"}),Qu=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Qc),B.init(e,t)}),el=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eu),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 tl(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var rl=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=tu),B.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{tl(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Fg(e){if(!Eo.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return tl(n)}var nl=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Eo),B.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Fg(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),il=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=nu),B.init(e,t)});function Zg(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 ol=p("$ZodJWT",(e,t)=>{B.init(e,t),e._zod.check=n=>{Zg(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),al=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})}}),Co=p("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??$o,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}}),sl=p("$ZodNumberFormat",(e,t)=>{gu.init(e,t),Co.init(e,t)}),Wn=p("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=lu,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}}),Ro=p("$ZodBigInt",(e,t)=>{N.init(e,t),e._zod.pattern=cu,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}}),cl=p("$ZodBigIntFormat",(e,t)=>{vu.init(e,t),Ro.init(e,t)}),ul=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}}),ll=p("$ZodUndefined",(e,t)=>{N.init(e,t),e._zod.pattern=mu,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}}),dl=p("$ZodNull",(e,t)=>{N.init(e,t),e._zod.pattern=du,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}}),ml=p("$ZodAny",(e,t)=>{N.init(e,t),e._zod.parse=n=>n}),pl=p("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=n=>n}),fl=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)}),hl=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}}),gl=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 Tg(e,t,n){e.issues.length&&t.issues.push(...Te(n,e.issues)),t.value[n]=e.value}var vl=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=>Tg(l,n,a))):Tg(u,n,a)}return o.length?Promise.all(o).then(()=>n):n}});function ko(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 Bg(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=Rc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Vg(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($=>ko($,n,h,t,m,f))):ko(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 Gg=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=$r(()=>Bg(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=Qt,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=>ko(me,c,h,l,$,H))):ko(D,c,h,l,$,H)}return o?Vg(m,l,c,u,i.value,e):m.length?Promise.all(m).then(()=>c):c}}),bl=p("$ZodObjectJIT",(e,t)=>{Gg.init(e,t);let n=e._zod.parse,i=$r(()=>Bg(t)),r=h=>{let v=new Gn(["shape","payload","ctx"]),$=i.value,H=be=>{let J=lo(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=lo(be),xr=h[be],fg=xr?._zod?.optin==="optional",sA=xr?._zod?.optout==="optional";v.write(`const ${J} = ${H(be)};`),fg&&sA?v.write(`
|
|
@@ -429,12 +429,12 @@ ${o}`)}throw r}}function Ki(e,t){let n=F.createSourceFile("infrastructure.ts",e,
|
|
|
429
429
|
`;return i.push(`Custom code from line ${t.originalLine} could not be positioned. Added at end of file.`),e+`
|
|
430
430
|
`+r+t.sourceText}function eh(e,t,n){if(!t||t.length===0)return{content:e,success:!0};try{let i=bx(e),r=_t(i),o=[],a=TR(t),c=e;for(let u of a){let l=kR(i,r,u,n,o);c=wR(c,u,l,o)}return{content:c,success:!0,warnings:o.length>0?o:void 0}}catch(i){return Sx(i,e)}}function NR(e,t,n,i){if(!t.afterManagedResource)return null;let r=t.afterManagedResource,o=(r.name&&n?.get(r.name))??r.name,a=e.find(u=>u.type===r.type&&u.resourceName===o);if(a)return a.endPos;let c=e.filter(u=>u.type===r.type&&u.isManaged);return c.length===1?c[0].endPos:(i&&i.push(`Resource ${Jf(t.afterManagedResource.type,t.afterManagedResource.name)} not found. Custom code may be orphaned.`),null)}function kR(e,t,n,i,r){switch(n.position){case"before-imports":return 0;case"after-imports":return vx(t,"import")?.endPos??0;case"after-app-init":return Yf(t,"app-init")?.endPos??null;case"after-tags":return Yf(t,"tags")?.endPos??null;case"after-resource":return NR(t,n,i,r);case"end-of-file":return e.getEnd();default:return null}}function CR(e,t,n){let i=_x(e,t),r=n.sourceText;return r=yx(i,r)+r,r.endsWith(`
|
|
431
431
|
`)||(r+=`
|
|
432
|
-
`),r}import*as Wt from"typescript";var Xi=s.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),RR=s.object({name:s.string(),type:Xi,ttl:s.number().optional(),value:s.string(),priority:s.number().optional(),weight:s.number().optional(),port:s.number().optional()}).strict(),PR=s.object({subdomain:s.string(),targetAccount:s.string(),auto:s.boolean()}).strict(),OR=s.object({domainName:s.string(),subjectAlternativeNames:s.array(s.string())}).strict(),
|
|
433
|
-
`,
|
|
432
|
+
`),r}import*as Wt from"typescript";var Xi=s.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),RR=s.object({name:s.string(),type:Xi,ttl:s.number().optional(),value:s.string(),priority:s.number().optional(),weight:s.number().optional(),port:s.number().optional()}).strict(),PR=s.object({subdomain:s.string(),targetAccount:s.string(),auto:s.boolean()}).strict(),OR=s.object({domainName:s.string(),subjectAlternativeNames:s.array(s.string())}).strict(),d9=s.object({origin:s.string(),ttl:s.number(),records:s.array(RR),delegations:s.array(PR),certificates:s.array(OR)}).strict(),Ex=Object.freeze({ORIGIN:"$ORIGIN",TTL:"$TTL",FJALL_DELEGATE:"$FJALL-DELEGATE",FJALL_CERT:"$FJALL-CERT"});var $x=s.discriminatedUnion("kind",[s.object({kind:s.literal("ecs"),appName:s.string()}).strict(),s.object({kind:s.literal("cdn"),appName:s.string()}).strict(),s.object({kind:s.literal("bucket"),bucketName:s.string()}).strict(),s.object({kind:s.literal("custom"),dnsName:s.string(),hostedZoneId:s.string()}).strict()]),DR=$x.options.map(e=>e.shape.kind.value),th=s.enum(["A","AAAA"]),rh=s.enum(["route53","external-delegated","external-records"]),MR=s.object({kind:s.literal("standard"),type:s.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),name:s.string(),value:s.union([s.string(),s.array(s.string())]),ttl:s.number().int().positive().optional()}).strict(),zR=s.object({kind:s.literal("alias"),type:th,name:s.string(),target:$x}).strict(),jR=s.discriminatedUnion("kind",[MR,zR]),UR=s.object({domainName:s.string(),subjectAlternativeNames:s.array(s.string()).optional(),transparencyLogging:s.boolean().optional()}).strict(),LR=s.object({subdomain:s.string(),toAccount:s.string(),auto:s.boolean().optional()}).strict(),f9=s.object({zoneName:s.string(),registrar:rh,hostedZoneId:s.string().optional(),delegatedSubdomain:s.string().optional(),records:s.array(jR),certificates:s.array(UR),delegations:s.array(LR)}).strict().refine(e=>e.registrar!=="external-delegated"||e.delegatedSubdomain!==void 0,{message:"external-delegated requires delegatedSubdomain"}).refine(e=>e.registrar!=="external-records"||e.delegations.length===0,{message:"external-records forbids delegations"});var _9=rh.options,S9=Xi.options,x9=th.options;function nc(e,t){let n=[Df(e),Of(e),Pf(e)];if(jf(e))n.push(qs(e),Ks(e));else{let r=zf(e);n.push(Ks(e),If(e),Af(e),kf(e),Cf(e),Rf(e),Nf(e,r),Mf(e))}let i=n.join("");if(e.customCodeBlocks&&e.customCodeBlocks.length>0){let r=eh(i,e.customCodeBlocks,t?.resourceMapping);return r.success?ke(r.content):Ce(new Error(`Custom code injection failed: ${r.error??"unknown error"}`))}return ke(i)}var J9=NS("standard");var x3=new Set(Xi.options);var N3=JSON.stringify({compilerOptions:{target:"ES2020",module:"commonjs",lib:["es2020","dom"],declaration:!0,strict:!0,noImplicitAny:!0,strictNullChecks:!0,noImplicitThis:!0,alwaysStrict:!0,noUnusedLocals:!1,noUnusedParameters:!1,noImplicitReturns:!0,noFallthroughCasesInSwitch:!1,inlineSourceMap:!0,inlineSources:!0,experimentalDecorators:!0,strictPropertyInitialization:!1,typeRoots:["./node_modules/@types"]},exclude:["node_modules","cdk.out"]},null,2)+`
|
|
433
|
+
`,k3=JSON.stringify({app:"npx ts-node --prefer-ts-exts --transpile-only infrastructure.ts",assetMetadata:!1,pathMetadata:!1,versionReporting:!1,watch:{include:["**"],exclude:["README.md","cdk*.json","**/*.d.ts","**/*.js","tsconfig.json","package*.json","yarn.lock","node_modules","test"]},context:{"@aws-cdk/aws-lambda:recognizeLayerVersion":!0,"@aws-cdk/core:checkSecretUsage":!0,"@aws-cdk/core:target-partitions":["aws","aws-cn"],"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver":!0,"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName":!0,"@aws-cdk/aws-ecs:arnFormatIncludesClusterName":!0,"@aws-cdk/aws-iam:minimizePolicies":!0,"@aws-cdk/core:validateSnapshotRemovalPolicy":!0,"@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName":!0,"@aws-cdk/aws-s3:createDefaultLoggingPolicy":!0,"@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption":!0,"@aws-cdk/aws-apigateway:disableCloudWatchRole":!0,"@aws-cdk/core:enablePartitionLiterals":!0,"@aws-cdk/aws-events:eventsTargetQueueSameAccount":!0,"@aws-cdk/aws-iam:standardizedServicePrincipals":!0,"@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker":!0,"@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName":!0,"@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy":!0,"@aws-cdk/aws-route53-patters:useCertificate":!0,"@aws-cdk/customresources:installLatestAwsSdkDefault":!1,"@aws-cdk/aws-rds:databaseProxyUniqueResourceName":!0,"@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup":!0,"@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId":!0,"@aws-cdk/aws-ec2:launchTemplateDefaultUserData":!0,"@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments":!0,"@aws-cdk/aws-redshift:columnId":!0,"@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2":!0,"@aws-cdk/aws-ec2:restrictDefaultSecurityGroup":!0,"@aws-cdk/aws-apigateway:requestValidatorUniqueId":!0,"@aws-cdk/aws-kms:aliasNameRef":!0,"@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig":!0,"@aws-cdk/core:includePrefixInUniqueNameGeneration":!0,"@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby":!0}},null,2)+`
|
|
434
434
|
`;function JR(e,t,n){let i=e.root?Ix.join(e.root,t):t;try{if(wn.existsSync(i)){let r=`${i}.bak`,o=`${r}.tmp`;wn.writeFileSync(o,n),wn.renameSync(o,r)}return ke(void 0)}catch(r){let o=Ct(r);return us.warn("Generator",`Failed to create backup of ${t}`,{error:xc(o.message)}),Ce(o)}}function QR(e,t){try{let n=Ki(e,{extractCustomCode:!0}),i=qi(n,t,{skipValidation:!0});return n.customCodeBlocks?.length&&(i.customCodeBlocks=n.customCodeBlocks),ke({parsed:n,plan:i})}catch(n){return Ce(Ct(n))}}function eP(e,t){let n=QR(e,t);if(!n.success)throw new Error(`Failed to parse infrastructure: ${n.error.message}`,{cause:n.error});return n.data}function tP(e,t,n){let i=e.safeParse(t);if(!i.success)throw new Error(`Invalid ${n} generator options:
|
|
435
435
|
${xs(i.error)}`);return i.data}function rP(e,t){let n=Pn(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=tP(t,n,i),{path:a,content:c}=rP(e,o.appName),{plan:u}=eP(c,o.appName),l=await r({tree:e,validated:o,plan:u,infrastructurePath:a,content:c}),m=nP(e,a,c,l);if(!m.success)throw new Error(m.error.message,{cause:m.error})}function nP(e,t,n,i){let r=nc(i);if(!r.success)return Ce(r.error);let o=JR(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 Tx=1e3;function wx(e,t,n){if(!uo(e,t,n))return n;let i=n.match(/^(.+?)(\d*)$/);if(!i)return n;let r=i[1],o=i[2]?parseInt(i[2],10)+1:2;for(let a=o;a<=o+Tx;a++){let c=`${r}${a}`;if(!uo(e,t,c))return c}return`${r}${o+Tx}`}var pg=fA(iA(),1);async function oA(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,pg.default)([{type:"confirm",name:"shouldConnect",message:a,initial:!0}]);return c?c.shouldConnect:!1}async function aA(e,t,n){if(e.length===1)return process.stdout.write(`
|
|
436
436
|
Auto-selected: ${e[0].name}
|
|
437
437
|
`),[e[0].name];let i=[];for(;i.length===0;)i=(await(0,pg.default)([{type:"multiselect",name:"selected",message:t,choices:e.map(r=>({title:r.name,value:r.name,description:n?.(r),selected:!1}))}]))?.selected||[],i.length===0&&process.stdout.write(`
|
|
438
438
|
Please select at least one resource
|
|
439
439
|
|
|
440
|
-
`);return i}function sD(e,t,n){let i=n.length>0;switch(t.type){case"ecs":return{name:e,type:"ecs",needsConnection:i,connectedDatabase:n,cluster:t.cluster,services:t.services,...t.docker!==void 0&&{docker:t.docker}};case"lambda":return{name:e,type:"lambda",needsConnection:i,connectedDatabase:n,timeout:t.timeout,memory:t.memory,handler:t.handler,runtime:t.runtime,environment:t.environment,secrets:t.secrets};case"ec2":return{name:e,type:"ec2",needsConnection:i,connectedDatabase:n,instanceType:t.instanceType,enableSSH:t.enableSSH,keyName:t.keyName,userData:t.userData,securityGroups:t.securityGroups};default:return t}}async function cD(e,t){await Ax(e,lS,t,"compute",async({tree:n,validated:i,plan:r})=>{i.nameProvidedByFlag||Sc(n,i.appName,i.computeName);let o=i.nameProvidedByFlag?wx(n,i.appName,i.computeName):i.computeName,a=await uD(i,r),c=sD(o,i,a);return{...r,compute:[...r.compute,c]}})}async function uD(e,t){return e.connectionConfig?e.connectionConfig.connectToDatabase??[]:t.database.length>0&&!e.nameProvidedByFlag&&await oA(t.database.length,"database","Connect to existing database?","Found {count} databases. Configure connections?")?aA(t.database,"Select databases to connect:",n=>`${n.type} - ${n.databaseName}`):[]}var
|
|
440
|
+
`);return i}function sD(e,t,n){let i=n.length>0;switch(t.type){case"ecs":return{name:e,type:"ecs",needsConnection:i,connectedDatabase:n,cluster:t.cluster,services:t.services,...t.docker!==void 0&&{docker:t.docker}};case"lambda":return{name:e,type:"lambda",needsConnection:i,connectedDatabase:n,timeout:t.timeout,memory:t.memory,handler:t.handler,runtime:t.runtime,environment:t.environment,secrets:t.secrets};case"ec2":return{name:e,type:"ec2",needsConnection:i,connectedDatabase:n,instanceType:t.instanceType,enableSSH:t.enableSSH,keyName:t.keyName,userData:t.userData,securityGroups:t.securityGroups};default:return t}}async function cD(e,t){await Ax(e,lS,t,"compute",async({tree:n,validated:i,plan:r})=>{i.nameProvidedByFlag||Sc(n,i.appName,i.computeName);let o=i.nameProvidedByFlag?wx(n,i.appName,i.computeName):i.computeName,a=await uD(i,r),c=sD(o,i,a);return{...r,compute:[...r.compute,c]}})}async function uD(e,t){return e.connectionConfig?e.connectionConfig.connectToDatabase??[]:t.database.length>0&&!e.nameProvidedByFlag&&await oA(t.database.length,"database","Connect to existing database?","Found {count} databases. Configure connections?")?aA(t.database,"Select databases to connect:",n=>`${n.type} - ${n.databaseName}`):[]}var ZW=cD;export{cD as computeGenerator,ZW as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "<%= packageName %>",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {},
|
|
6
6
|
"devDependencies": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"typescript": "~6.0.3"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@fjall/components-infrastructure": "^2.19.
|
|
12
|
+
"@fjall/components-infrastructure": "^2.19.1",
|
|
13
13
|
"aws-cdk-lib": "^2.251.0",
|
|
14
14
|
"constructs": "^10.6.0"
|
|
15
15
|
}
|