@webflow/webflow-cli 2.1.0 → 2.1.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/dist/index.js CHANGED
@@ -1,45 +1,45 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var _h=Object.create;var xs=Object.defineProperty;var kh=Object.getOwnPropertyDescriptor;var Sh=Object.getOwnPropertyNames;var Th=Object.getPrototypeOf,Ah=Object.prototype.hasOwnProperty;var v=(e,t)=>()=>(e&&(t=e(e=0)),t);var Fs=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),zu=(e,t)=>{for(var r in t)xs(e,r,{get:t[r],enumerable:!0})},Oh=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Sh(t))!Ah.call(e,o)&&o!==r&&xs(e,o,{get:()=>t[o],enumerable:!(n=kh(t,o))||n.enumerable});return e};var h=(e,t,r)=>(r=e!=null?_h(Th(e)):{},Oh(t||!e||!e.__esModule?xs(r,"default",{value:e,enumerable:!0}):r,e));var Ku,ce,Cs,vt,ne,Me,R,Y,S,ie=v(()=>{"use strict";Ku=e=>`\x1B[1;48;2;20;110;245;97m ${e} \x1B[0m`,ce=e=>`\x1B[38;2;167;209;255m${e}\x1B[0m`,Cs=e=>`\x1B[38;2;196;175;255m${e}\x1B[0m`,vt=e=>`\x1B[38;2;255;156;156m${e}\x1B[0m`,ne=e=>`\x1B[38;2;255;209;102m${e}\x1B[0m`,Me=e=>`\x1B[97m${e}\x1B[0m`,R=e=>`\x1B[38;2;121;224;156m${e}\x1B[0m`,Y=e=>`\x1B[1m${e}\x1B[0m`,S=e=>`\x1B[38;2;185;185;185m${e}\x1B[0m`});function jh(){let e=new Map;for(let[t,r]of Object.entries(ae)){for(let[n,o]of Object.entries(r))ae[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=ae[n],e.set(o[0],o[1]);Object.defineProperty(ae,t,{value:r,enumerable:!1})}return Object.defineProperty(ae,"codes",{value:e,enumerable:!1}),ae.color.close="\x1B[39m",ae.bgColor.close="\x1B[49m",ae.color.ansi=Zu(),ae.color.ansi256=Yu(),ae.color.ansi16m=Xu(),ae.bgColor.ansi=Zu(10),ae.bgColor.ansi256=Yu(10),ae.bgColor.ansi16m=Xu(10),Object.defineProperties(ae,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(i=>i+i).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>ae.rgbToAnsi256(...ae.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let s=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>ae.ansi256ToAnsi(ae.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>ae.ansi256ToAnsi(ae.hexToAnsi256(t)),enumerable:!1}}),ae}var Zu,Yu,Xu,ae,Gv,Rh,Ph,zv,Nh,nt,Qu=v(()=>{"use strict";Zu=(e=0)=>t=>`\x1B[${t+e}m`,Yu=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Xu=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,ae={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Gv=Object.keys(ae.modifier),Rh=Object.keys(ae.color),Ph=Object.keys(ae.bgColor),zv=[...Rh,...Ph];Nh=jh(),nt=Nh});function He(e,t=globalThis.Deno?globalThis.Deno.args:jo.default.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}function Bh(){if("FORCE_COLOR"in fe)return fe.FORCE_COLOR==="true"?1:fe.FORCE_COLOR==="false"?0:fe.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(fe.FORCE_COLOR,10),3)}function Mh(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Lh(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Bh();n!==void 0&&(Po=n);let o=r?Po:n;if(o===0)return 0;if(r){if(He("color=16m")||He("color=full")||He("color=truecolor"))return 3;if(He("color=256"))return 2}if("TF_BUILD"in fe&&"AGENT_NAME"in fe)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(fe.TERM==="dumb")return i;if(jo.default.platform==="win32"){let s=tc.default.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in fe)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in fe)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in fe)||fe.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in fe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(fe.TEAMCITY_VERSION)?1:0;if(fe.COLORTERM==="truecolor"||fe.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in fe){let s=Number.parseInt((fe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(fe.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(fe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(fe.TERM)||"COLORTERM"in fe?1:i}function ec(e,t={}){let r=Lh(e,{streamIsTTY:e&&e.isTTY,...t});return Mh(r)}var jo,tc,_s,fe,Po,Wh,rc,nc=v(()=>{"use strict";jo=h(require("process"),1),tc=h(require("os"),1),_s=h(require("tty"),1);({env:fe}=jo.default);He("no-color")||He("no-colors")||He("color=false")||He("color=never")?Po=0:(He("color")||He("colors")||He("color=true")||He("color=always"))&&(Po=1);Wh={stdout:ec({isTTY:_s.default.isatty(1)}),stderr:ec({isTTY:_s.default.isatty(2)})},rc=Wh});function oc(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let o=t.length,i=0,s="";do s+=e.slice(i,n)+t+r,i=n+o,n=e.indexOf(t,i);while(n!==-1);return s+=e.slice(i),s}function ic(e,t,r,n){let o=0,i="";do{let s=e[n-1]==="\r";i+=e.slice(o,s?n-1:n)+t+(s?`\r
2
+ "use strict";var kh=Object.create;var xs=Object.defineProperty;var Sh=Object.getOwnPropertyDescriptor;var Th=Object.getOwnPropertyNames;var Ah=Object.getPrototypeOf,Oh=Object.prototype.hasOwnProperty;var v=(e,t)=>()=>(e&&(t=e(e=0)),t);var Fs=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),zu=(e,t)=>{for(var r in t)xs(e,r,{get:t[r],enumerable:!0})},Ih=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Th(t))!Oh.call(e,o)&&o!==r&&xs(e,o,{get:()=>t[o],enumerable:!(n=Sh(t,o))||n.enumerable});return e};var h=(e,t,r)=>(r=e!=null?kh(Ah(e)):{},Ih(t||!e||!e.__esModule?xs(r,"default",{value:e,enumerable:!0}):r,e));var Ku,ce,Cs,vt,ne,Me,R,Y,S,ie=v(()=>{"use strict";Ku=e=>`\x1B[1;48;2;20;110;245;97m ${e} \x1B[0m`,ce=e=>`\x1B[38;2;167;209;255m${e}\x1B[0m`,Cs=e=>`\x1B[38;2;196;175;255m${e}\x1B[0m`,vt=e=>`\x1B[38;2;255;156;156m${e}\x1B[0m`,ne=e=>`\x1B[38;2;255;209;102m${e}\x1B[0m`,Me=e=>`\x1B[97m${e}\x1B[0m`,R=e=>`\x1B[38;2;121;224;156m${e}\x1B[0m`,Y=e=>`\x1B[1m${e}\x1B[0m`,S=e=>`\x1B[38;2;185;185;185m${e}\x1B[0m`});function Nh(){let e=new Map;for(let[t,r]of Object.entries(ae)){for(let[n,o]of Object.entries(r))ae[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=ae[n],e.set(o[0],o[1]);Object.defineProperty(ae,t,{value:r,enumerable:!1})}return Object.defineProperty(ae,"codes",{value:e,enumerable:!1}),ae.color.close="\x1B[39m",ae.bgColor.close="\x1B[49m",ae.color.ansi=Zu(),ae.color.ansi256=Yu(),ae.color.ansi16m=Xu(),ae.bgColor.ansi=Zu(10),ae.bgColor.ansi256=Yu(10),ae.bgColor.ansi16m=Xu(10),Object.defineProperties(ae,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(i=>i+i).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>ae.rgbToAnsi256(...ae.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let s=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>ae.ansi256ToAnsi(ae.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>ae.ansi256ToAnsi(ae.hexToAnsi256(t)),enumerable:!1}}),ae}var Zu,Yu,Xu,ae,qv,Ph,jh,Kv,Bh,nt,Qu=v(()=>{"use strict";Zu=(e=0)=>t=>`\x1B[${t+e}m`,Yu=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Xu=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,ae={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},qv=Object.keys(ae.modifier),Ph=Object.keys(ae.color),jh=Object.keys(ae.bgColor),Kv=[...Ph,...jh];Bh=Nh(),nt=Bh});function He(e,t=globalThis.Deno?globalThis.Deno.args:jo.default.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}function Mh(){if("FORCE_COLOR"in fe)return fe.FORCE_COLOR==="true"?1:fe.FORCE_COLOR==="false"?0:fe.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(fe.FORCE_COLOR,10),3)}function Lh(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Wh(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Mh();n!==void 0&&(Po=n);let o=r?Po:n;if(o===0)return 0;if(r){if(He("color=16m")||He("color=full")||He("color=truecolor"))return 3;if(He("color=256"))return 2}if("TF_BUILD"in fe&&"AGENT_NAME"in fe)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(fe.TERM==="dumb")return i;if(jo.default.platform==="win32"){let s=tc.default.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in fe)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in fe)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in fe)||fe.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in fe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(fe.TEAMCITY_VERSION)?1:0;if(fe.COLORTERM==="truecolor"||fe.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in fe){let s=Number.parseInt((fe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(fe.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(fe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(fe.TERM)||"COLORTERM"in fe?1:i}function ec(e,t={}){let r=Wh(e,{streamIsTTY:e&&e.isTTY,...t});return Lh(r)}var jo,tc,_s,fe,Po,Uh,rc,nc=v(()=>{"use strict";jo=h(require("process"),1),tc=h(require("os"),1),_s=h(require("tty"),1);({env:fe}=jo.default);He("no-color")||He("no-colors")||He("color=false")||He("color=never")?Po=0:(He("color")||He("colors")||He("color=true")||He("color=always"))&&(Po=1);Uh={stdout:ec({isTTY:_s.default.isatty(1)}),stderr:ec({isTTY:_s.default.isatty(2)})},rc=Uh});function oc(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let o=t.length,i=0,s="";do s+=e.slice(i,n)+t+r,i=n+o,n=e.indexOf(t,i);while(n!==-1);return s+=e.slice(i),s}function ic(e,t,r,n){let o=0,i="";do{let s=e[n-1]==="\r";i+=e.slice(o,s?n-1:n)+t+(s?`\r
3
3
  `:`
4
4
  `)+r,o=n+1,n=e.indexOf(`
5
- `,o)}while(n!==-1);return i+=e.slice(o),i}var sc=v(()=>{"use strict"});function $n(e){return Vh(e)}var ac,lc,ks,Jr,In,uc,Gr,Uh,Vh,Ss,Hh,Jh,Ts,No,Gh,zh,eE,ot,As=v(()=>{"use strict";Qu();nc();sc();({stdout:ac,stderr:lc}=rc),ks=Symbol("GENERATOR"),Jr=Symbol("STYLER"),In=Symbol("IS_EMPTY"),uc=["ansi","ansi","ansi256","ansi16m"],Gr=Object.create(null),Uh=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=ac?ac.level:0;e.level=t.level===void 0?r:t.level},Vh=e=>{let t=(...r)=>r.join(" ");return Uh(t,e),Object.setPrototypeOf(t,$n.prototype),t};Object.setPrototypeOf($n.prototype,Function.prototype);for(let[e,t]of Object.entries(nt))Gr[e]={get(){let r=No(this,Ts(t.open,t.close,this[Jr]),this[In]);return Object.defineProperty(this,e,{value:r}),r}};Gr.visible={get(){let e=No(this,this[Jr],!0);return Object.defineProperty(this,"visible",{value:e}),e}};Ss=(e,t,r,...n)=>e==="rgb"?t==="ansi16m"?nt[r].ansi16m(...n):t==="ansi256"?nt[r].ansi256(nt.rgbToAnsi256(...n)):nt[r].ansi(nt.rgbToAnsi(...n)):e==="hex"?Ss("rgb",t,r,...nt.hexToRgb(...n)):nt[r][e](...n),Hh=["rgb","hex","ansi256"];for(let e of Hh){Gr[e]={get(){let{level:r}=this;return function(...n){let o=Ts(Ss(e,uc[r],"color",...n),nt.color.close,this[Jr]);return No(this,o,this[In])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);Gr[t]={get(){let{level:r}=this;return function(...n){let o=Ts(Ss(e,uc[r],"bgColor",...n),nt.bgColor.close,this[Jr]);return No(this,o,this[In])}}}}Jh=Object.defineProperties(()=>{},{...Gr,level:{enumerable:!0,get(){return this[ks].level},set(e){this[ks].level=e}}}),Ts=(e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},No=(e,t,r)=>{let n=(...o)=>Gh(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,Jh),n[ks]=e,n[Jr]=t,n[In]=r,n},Gh=(e,t)=>{if(e.level<=0||!t)return e[In]?"":t;let r=e[Jr];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=oc(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
6
- `);return i!==-1&&(t=ic(t,o,n,i)),n+t+o};Object.defineProperties($n.prototype,Gr);zh=$n(),eE=$n({level:lc?lc.level:0}),ot=zh});function Os(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let o of Reflect.ownKeys(t))qh(e,t,o,r);return Zh(e,t),ew(e,t,n),e}var qh,Kh,Zh,Yh,Xh,Qh,ew,cc=v(()=>{"use strict";qh=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let o=Object.getOwnPropertyDescriptor(e,r),i=Object.getOwnPropertyDescriptor(t,r);!Kh(o,i)&&n||Object.defineProperty(e,r,i)},Kh=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Zh=(e,t)=>{let r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},Yh=(e,t)=>`/* Wrapped ${e}*/
7
- ${t}`,Xh=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Qh=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ew=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=Yh.bind(null,n,t.toString());Object.defineProperty(o,"name",Qh);let{writable:i,enumerable:s,configurable:a}=Xh;Object.defineProperty(e,"toString",{value:o,writable:i,enumerable:s,configurable:a})}});var Bo,dc,fc,pc=v(()=>{"use strict";cc();Bo=new WeakMap,dc=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(Bo.set(i,++n),n===1)r=e.apply(this,s),e=void 0;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return r};return Os(i,e),Bo.set(i,n),i};dc.callCount=e=>{if(!Bo.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Bo.get(e)};fc=dc});var lr,mc=v(()=>{"use strict";lr=[];lr.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&lr.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&lr.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var Mo,Is,$s,tw,Rs,Lo,rw,Ps,js,Ns,gc,aE,lE,hc=v(()=>{"use strict";mc();Mo=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Is=Symbol.for("signal-exit emitter"),$s=globalThis,tw=Object.defineProperty.bind(Object),Rs=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if($s[Is])return $s[Is];tw($s,Is,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(r,n)===!0||o;return t==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},Lo=class{},rw=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Ps=class extends Lo{onExit(){return()=>{}}load(){}unload(){}},js=class extends Lo{#s=Ns.platform==="win32"?"SIGINT":"SIGHUP";#r=new Rs;#e;#o;#f;#t={};#i=!1;constructor(t){super(),this.#e=t,this.#t={};for(let r of lr)this.#t[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),n.length===o){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#s:r;s||t.kill(t.pid,a)}};this.#f=t.reallyExit,this.#o=t.emit}onExit(t,r){if(!Mo(this.#e))return()=>{};this.#i===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,t),()=>{this.#r.removeListener(n,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#r.count+=1;for(let t of lr)try{let r=this.#t[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#p(t,...r),this.#e.reallyExit=t=>this.#n(t)}}unload(){this.#i&&(this.#i=!1,lr.forEach(t=>{let r=this.#t[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#o,this.#e.reallyExit=this.#f,this.#r.count-=1)}#n(t){return Mo(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#f.call(this.#e,this.#e.exitCode)):0}#p(t,...r){let n=this.#o;if(t==="exit"&&Mo(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,t,...r)}},Ns=globalThis.process,{onExit:gc,load:aE,unload:lE}=rw(Mo(Ns)?new js(Ns):new Ps)});var Rn,wc,nw,yc,Dc=v(()=>{"use strict";Rn=h(require("process"),1);pc();hc();wc=Rn.default.stderr.isTTY?Rn.default.stderr:Rn.default.stdout.isTTY?Rn.default.stdout:void 0,nw=wc?fc(()=>{gc(()=>{wc.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},yc=nw});var Bs,Wo,zr,Ms,bc=v(()=>{"use strict";Bs=h(require("process"),1);Dc();Wo=!1,zr={};zr.show=(e=Bs.default.stderr)=>{e.isTTY&&(Wo=!1,e.write("\x1B[?25h"))};zr.hide=(e=Bs.default.stderr)=>{e.isTTY&&(yc(),Wo=!0,e.write("\x1B[?25l"))};zr.toggle=(e,t)=>{e!==void 0&&(Wo=e),Wo?zr.show(t):zr.hide(t)};Ms=zr});var vc=Fs((gE,ow)=>{ow.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}}});var Ls=Fs((hE,xc)=>{"use strict";var Uo=Object.assign({},vc()),Ec=Object.keys(Uo);Object.defineProperty(Uo,"random",{get(){let e=Math.floor(Math.random()*Ec.length),t=Ec[e];return Uo[t]}});xc.exports=Uo});function Ws(){return Je.default.platform!=="win32"?Je.default.env.TERM!=="linux":!!Je.default.env.CI||!!Je.default.env.WT_SESSION||!!Je.default.env.TERMINUS_SUBLIME||Je.default.env.ConEmuTask==="{cmd::Cmder}"||Je.default.env.TERM_PROGRAM==="Terminus-Sublime"||Je.default.env.TERM_PROGRAM==="vscode"||Je.default.env.TERM==="xterm-256color"||Je.default.env.TERM==="alacritty"||Je.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Je,Fc=v(()=>{"use strict";Je=h(require("process"),1)});var iw,sw,aw,Pn,Cc=v(()=>{"use strict";As();Fc();iw={info:ot.blue("\u2139"),success:ot.green("\u2714"),warning:ot.yellow("\u26A0"),error:ot.red("\u2716")},sw={info:ot.blue("i"),success:ot.green("\u221A"),warning:ot.yellow("\u203C"),error:ot.red("\xD7")},aw=Ws()?iw:sw,Pn=aw});function Us({onlyFirst:e=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,e?void 0:"g")}var _c=v(()=>{"use strict"});function Vs(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(lw,"")}var lw,kc=v(()=>{"use strict";_c();lw=Us()});function Hs({onlyFirst:e=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,e?void 0:"g")}var Sc=v(()=>{"use strict"});function Js(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(uw,"")}var uw,Tc=v(()=>{"use strict";Sc();uw=Hs()});var Vo,Ho,Gs,zs,jn,Ac=v(()=>{"use strict";Vo=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Ho=[12288,12288,65281,65376,65504,65510],Gs=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],zs=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],jn=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141]});var Jo,Oc=v(()=>{"use strict";Jo=(e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){let o=Math.floor((r+n)/2),i=o*2;if(t<e[i])n=o-1;else if(t>e[i+1])r=o+1;else return!0}return!1}});function yw(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){let o=e[n],i=e[n+1];if(Ic>=o&&Ic<=i)return[o,i];i-o>r-t&&(t=o,r=i)}return[t,r]}var cw,dw,fw,pw,OE,IE,$E,RE,mw,gw,Ic,hw,ww,$c,Rc,Pc,jc=v(()=>{"use strict";Ac();Oc();cw=Vo[0],dw=Vo.at(-1),fw=Ho[0],pw=Ho.at(-1),OE=Gs[0],IE=Gs.at(-1),$E=zs[0],RE=zs.at(-1),mw=jn[0],gw=jn.at(-1),Ic=19968,[hw,ww]=yw(jn);$c=e=>e<cw||e>dw?!1:Jo(Vo,e),Rc=e=>e<fw||e>pw?!1:Jo(Ho,e),Pc=e=>e>=hw&&e<=ww?!0:e<mw||e>gw?!1:Jo(jn,e)});function Dw(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Nc(e,{ambiguousAsWide:t=!1}={}){return Dw(e),Rc(e)||Pc(e)||t&&$c(e)?2:1}var Bc=v(()=>{"use strict";jc()});var Mc,Lc=v(()=>{"use strict";Mc=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});function qs(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=Js(e)),e.length===0)return 0;let o=0,i={ambiguousAsWide:!r};for(let{segment:s}of bw.segment(e)){let a=s.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!vw.test(s)){if(Mc().test(s)){o+=2;continue}o+=Nc(a,i)}}return o}var bw,vw,Wc=v(()=>{"use strict";Tc();Bc();Lc();bw=new Intl.Segmenter,vw=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u")});function Ks({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var Uc=v(()=>{"use strict"});function Ys(){let{env:e}=Zs.default,{TERM:t,TERM_PROGRAM:r}=e;return Zs.default.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Zs,Vc=v(()=>{"use strict";Zs=h(require("process"),1)});var it,Ew,Xs,xw,Qs,Hc=v(()=>{"use strict";it=h(require("process"),1),Ew=3,Xs=class{#s=0;start(){this.#s++,this.#s===1&&this.#r()}stop(){if(this.#s<=0)throw new Error("`stop` called more times than `start`");this.#s--,this.#s===0&&this.#e()}#r(){it.default.platform==="win32"||!it.default.stdin.isTTY||(it.default.stdin.setRawMode(!0),it.default.stdin.on("data",this.#o),it.default.stdin.resume())}#e(){it.default.stdin.isTTY&&(it.default.stdin.off("data",this.#o),it.default.stdin.pause(),it.default.stdin.setRawMode(!1))}#o(t){t[0]===Ew&&it.default.emit("SIGINT")}},xw=new Xs,Qs=xw});function ta(e){return new ea(e)}var Nn,Bn,Fw,ea,Jc=v(()=>{"use strict";Nn=h(require("process"),1);As();bc();Bn=h(Ls(),1);Cc();kc();Wc();Uc();Vc();Hc();Fw=h(Ls(),1),ea=class{#s=0;#r=!1;#e=0;#o=-1;#f=0;#t;#i;#n;#p;#g;#u;#c;#d;#h;#a;#l;color;constructor(t){typeof t=="string"&&(t={text:t}),this.#t={color:"cyan",stream:Nn.default.stderr,discardStdin:!0,hideCursor:!0,...t},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#g=this.#t.interval,this.#n=this.#t.stream,this.#u=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:Ks({stream:this.#n}),this.#c=typeof this.#t.isSilent=="boolean"?this.#t.isSilent:!1,this.text=this.#t.text,this.prefixText=this.#t.prefixText,this.suffixText=this.#t.suffixText,this.indent=this.#t.indent,Nn.default.env.NODE_ENV==="test"&&(this._stream=this.#n,this._isEnabled=this.#u,Object.defineProperty(this,"_linesToClear",{get(){return this.#s},set(r){this.#s=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#o}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#d}set indent(t=0){if(!(t>=0&&Number.isInteger(t)))throw new Error("The `indent` option must be an integer from 0 and up");this.#d=t,this.#m()}get interval(){return this.#g??this.#i.interval??100}get spinner(){return this.#i}set spinner(t){if(this.#o=-1,this.#g=void 0,typeof t=="object"){if(t.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#i=t}else if(!Ys())this.#i=Bn.default.line;else if(t===void 0)this.#i=Bn.default.dots;else if(t!=="default"&&Bn.default[t])this.#i=Bn.default[t];else throw new Error(`There is no built-in spinner named '${t}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#h}set text(t=""){this.#h=t,this.#m()}get prefixText(){return this.#a}set prefixText(t=""){this.#a=t,this.#m()}get suffixText(){return this.#l}set suffixText(t=""){this.#l=t,this.#m()}get isSpinning(){return this.#p!==void 0}#w(t=this.#a,r=" "){return typeof t=="string"&&t!==""?t+r:typeof t=="function"?t()+r:""}#y(t=this.#l,r=" "){return typeof t=="string"&&t!==""?r+t:typeof t=="function"?r+t():""}#m(){let t=this.#n.columns??80,r=this.#w(this.#a,"-"),n=this.#y(this.#l,"-"),o=" ".repeat(this.#d)+r+"--"+this.#h+"--"+n;this.#e=0;for(let i of Vs(o).split(`
5
+ `,o)}while(n!==-1);return i+=e.slice(o),i}var sc=v(()=>{"use strict"});function $n(e){return Hh(e)}var ac,lc,ks,Jr,In,uc,Gr,Vh,Hh,Ss,Jh,Gh,Ts,No,zh,qh,rE,ot,As=v(()=>{"use strict";Qu();nc();sc();({stdout:ac,stderr:lc}=rc),ks=Symbol("GENERATOR"),Jr=Symbol("STYLER"),In=Symbol("IS_EMPTY"),uc=["ansi","ansi","ansi256","ansi16m"],Gr=Object.create(null),Vh=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=ac?ac.level:0;e.level=t.level===void 0?r:t.level},Hh=e=>{let t=(...r)=>r.join(" ");return Vh(t,e),Object.setPrototypeOf(t,$n.prototype),t};Object.setPrototypeOf($n.prototype,Function.prototype);for(let[e,t]of Object.entries(nt))Gr[e]={get(){let r=No(this,Ts(t.open,t.close,this[Jr]),this[In]);return Object.defineProperty(this,e,{value:r}),r}};Gr.visible={get(){let e=No(this,this[Jr],!0);return Object.defineProperty(this,"visible",{value:e}),e}};Ss=(e,t,r,...n)=>e==="rgb"?t==="ansi16m"?nt[r].ansi16m(...n):t==="ansi256"?nt[r].ansi256(nt.rgbToAnsi256(...n)):nt[r].ansi(nt.rgbToAnsi(...n)):e==="hex"?Ss("rgb",t,r,...nt.hexToRgb(...n)):nt[r][e](...n),Jh=["rgb","hex","ansi256"];for(let e of Jh){Gr[e]={get(){let{level:r}=this;return function(...n){let o=Ts(Ss(e,uc[r],"color",...n),nt.color.close,this[Jr]);return No(this,o,this[In])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);Gr[t]={get(){let{level:r}=this;return function(...n){let o=Ts(Ss(e,uc[r],"bgColor",...n),nt.bgColor.close,this[Jr]);return No(this,o,this[In])}}}}Gh=Object.defineProperties(()=>{},{...Gr,level:{enumerable:!0,get(){return this[ks].level},set(e){this[ks].level=e}}}),Ts=(e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},No=(e,t,r)=>{let n=(...o)=>zh(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,Gh),n[ks]=e,n[Jr]=t,n[In]=r,n},zh=(e,t)=>{if(e.level<=0||!t)return e[In]?"":t;let r=e[Jr];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=oc(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
6
+ `);return i!==-1&&(t=ic(t,o,n,i)),n+t+o};Object.defineProperties($n.prototype,Gr);qh=$n(),rE=$n({level:lc?lc.level:0}),ot=qh});function Os(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let o of Reflect.ownKeys(t))Kh(e,t,o,r);return Yh(e,t),tw(e,t,n),e}var Kh,Zh,Yh,Xh,Qh,ew,tw,cc=v(()=>{"use strict";Kh=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let o=Object.getOwnPropertyDescriptor(e,r),i=Object.getOwnPropertyDescriptor(t,r);!Zh(o,i)&&n||Object.defineProperty(e,r,i)},Zh=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Yh=(e,t)=>{let r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},Xh=(e,t)=>`/* Wrapped ${e}*/
7
+ ${t}`,Qh=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ew=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),tw=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=Xh.bind(null,n,t.toString());Object.defineProperty(o,"name",ew);let{writable:i,enumerable:s,configurable:a}=Qh;Object.defineProperty(e,"toString",{value:o,writable:i,enumerable:s,configurable:a})}});var Bo,dc,fc,pc=v(()=>{"use strict";cc();Bo=new WeakMap,dc=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(Bo.set(i,++n),n===1)r=e.apply(this,s),e=void 0;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return r};return Os(i,e),Bo.set(i,n),i};dc.callCount=e=>{if(!Bo.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Bo.get(e)};fc=dc});var lr,mc=v(()=>{"use strict";lr=[];lr.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&lr.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&lr.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var Mo,Is,$s,rw,Rs,Lo,nw,Ps,js,Ns,gc,uE,cE,hc=v(()=>{"use strict";mc();Mo=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Is=Symbol.for("signal-exit emitter"),$s=globalThis,rw=Object.defineProperty.bind(Object),Rs=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if($s[Is])return $s[Is];rw($s,Is,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(r,n)===!0||o;return t==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},Lo=class{},nw=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Ps=class extends Lo{onExit(){return()=>{}}load(){}unload(){}},js=class extends Lo{#s=Ns.platform==="win32"?"SIGINT":"SIGHUP";#r=new Rs;#e;#o;#f;#t={};#i=!1;constructor(t){super(),this.#e=t,this.#t={};for(let r of lr)this.#t[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),n.length===o){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#s:r;s||t.kill(t.pid,a)}};this.#f=t.reallyExit,this.#o=t.emit}onExit(t,r){if(!Mo(this.#e))return()=>{};this.#i===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,t),()=>{this.#r.removeListener(n,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#r.count+=1;for(let t of lr)try{let r=this.#t[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#p(t,...r),this.#e.reallyExit=t=>this.#n(t)}}unload(){this.#i&&(this.#i=!1,lr.forEach(t=>{let r=this.#t[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#o,this.#e.reallyExit=this.#f,this.#r.count-=1)}#n(t){return Mo(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#f.call(this.#e,this.#e.exitCode)):0}#p(t,...r){let n=this.#o;if(t==="exit"&&Mo(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,t,...r)}},Ns=globalThis.process,{onExit:gc,load:uE,unload:cE}=nw(Mo(Ns)?new js(Ns):new Ps)});var Rn,wc,ow,yc,Dc=v(()=>{"use strict";Rn=h(require("process"),1);pc();hc();wc=Rn.default.stderr.isTTY?Rn.default.stderr:Rn.default.stdout.isTTY?Rn.default.stdout:void 0,ow=wc?fc(()=>{gc(()=>{wc.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},yc=ow});var Bs,Wo,zr,Ms,bc=v(()=>{"use strict";Bs=h(require("process"),1);Dc();Wo=!1,zr={};zr.show=(e=Bs.default.stderr)=>{e.isTTY&&(Wo=!1,e.write("\x1B[?25h"))};zr.hide=(e=Bs.default.stderr)=>{e.isTTY&&(yc(),Wo=!0,e.write("\x1B[?25l"))};zr.toggle=(e,t)=>{e!==void 0&&(Wo=e),Wo?zr.show(t):zr.hide(t)};Ms=zr});var vc=Fs((wE,iw)=>{iw.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}}});var Ls=Fs((yE,xc)=>{"use strict";var Uo=Object.assign({},vc()),Ec=Object.keys(Uo);Object.defineProperty(Uo,"random",{get(){let e=Math.floor(Math.random()*Ec.length),t=Ec[e];return Uo[t]}});xc.exports=Uo});function Ws(){return Je.default.platform!=="win32"?Je.default.env.TERM!=="linux":!!Je.default.env.CI||!!Je.default.env.WT_SESSION||!!Je.default.env.TERMINUS_SUBLIME||Je.default.env.ConEmuTask==="{cmd::Cmder}"||Je.default.env.TERM_PROGRAM==="Terminus-Sublime"||Je.default.env.TERM_PROGRAM==="vscode"||Je.default.env.TERM==="xterm-256color"||Je.default.env.TERM==="alacritty"||Je.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Je,Fc=v(()=>{"use strict";Je=h(require("process"),1)});var sw,aw,lw,Pn,Cc=v(()=>{"use strict";As();Fc();sw={info:ot.blue("\u2139"),success:ot.green("\u2714"),warning:ot.yellow("\u26A0"),error:ot.red("\u2716")},aw={info:ot.blue("i"),success:ot.green("\u221A"),warning:ot.yellow("\u203C"),error:ot.red("\xD7")},lw=Ws()?sw:aw,Pn=lw});function Us({onlyFirst:e=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,e?void 0:"g")}var _c=v(()=>{"use strict"});function Vs(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(uw,"")}var uw,kc=v(()=>{"use strict";_c();uw=Us()});function Hs({onlyFirst:e=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,e?void 0:"g")}var Sc=v(()=>{"use strict"});function Js(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(cw,"")}var cw,Tc=v(()=>{"use strict";Sc();cw=Hs()});var Vo,Ho,Gs,zs,jn,Ac=v(()=>{"use strict";Vo=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Ho=[12288,12288,65281,65376,65504,65510],Gs=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],zs=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],jn=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141]});var Jo,Oc=v(()=>{"use strict";Jo=(e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){let o=Math.floor((r+n)/2),i=o*2;if(t<e[i])n=o-1;else if(t>e[i+1])r=o+1;else return!0}return!1}});function Dw(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){let o=e[n],i=e[n+1];if(Ic>=o&&Ic<=i)return[o,i];i-o>r-t&&(t=o,r=i)}return[t,r]}var dw,fw,pw,mw,$E,RE,PE,jE,gw,hw,Ic,ww,yw,$c,Rc,Pc,jc=v(()=>{"use strict";Ac();Oc();dw=Vo[0],fw=Vo.at(-1),pw=Ho[0],mw=Ho.at(-1),$E=Gs[0],RE=Gs.at(-1),PE=zs[0],jE=zs.at(-1),gw=jn[0],hw=jn.at(-1),Ic=19968,[ww,yw]=Dw(jn);$c=e=>e<dw||e>fw?!1:Jo(Vo,e),Rc=e=>e<pw||e>mw?!1:Jo(Ho,e),Pc=e=>e>=ww&&e<=yw?!0:e<gw||e>hw?!1:Jo(jn,e)});function bw(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Nc(e,{ambiguousAsWide:t=!1}={}){return bw(e),Rc(e)||Pc(e)||t&&$c(e)?2:1}var Bc=v(()=>{"use strict";jc()});var Mc,Lc=v(()=>{"use strict";Mc=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});function qs(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=Js(e)),e.length===0)return 0;let o=0,i={ambiguousAsWide:!r};for(let{segment:s}of vw.segment(e)){let a=s.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!Ew.test(s)){if(Mc().test(s)){o+=2;continue}o+=Nc(a,i)}}return o}var vw,Ew,Wc=v(()=>{"use strict";Tc();Bc();Lc();vw=new Intl.Segmenter,Ew=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u")});function Ks({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var Uc=v(()=>{"use strict"});function Ys(){let{env:e}=Zs.default,{TERM:t,TERM_PROGRAM:r}=e;return Zs.default.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Zs,Vc=v(()=>{"use strict";Zs=h(require("process"),1)});var it,xw,Xs,Fw,Qs,Hc=v(()=>{"use strict";it=h(require("process"),1),xw=3,Xs=class{#s=0;start(){this.#s++,this.#s===1&&this.#r()}stop(){if(this.#s<=0)throw new Error("`stop` called more times than `start`");this.#s--,this.#s===0&&this.#e()}#r(){it.default.platform==="win32"||!it.default.stdin.isTTY||(it.default.stdin.setRawMode(!0),it.default.stdin.on("data",this.#o),it.default.stdin.resume())}#e(){it.default.stdin.isTTY&&(it.default.stdin.off("data",this.#o),it.default.stdin.pause(),it.default.stdin.setRawMode(!1))}#o(t){t[0]===xw&&it.default.emit("SIGINT")}},Fw=new Xs,Qs=Fw});function ta(e){return new ea(e)}var Nn,Bn,Cw,ea,Jc=v(()=>{"use strict";Nn=h(require("process"),1);As();bc();Bn=h(Ls(),1);Cc();kc();Wc();Uc();Vc();Hc();Cw=h(Ls(),1),ea=class{#s=0;#r=!1;#e=0;#o=-1;#f=0;#t;#i;#n;#p;#g;#u;#c;#d;#h;#a;#l;color;constructor(t){typeof t=="string"&&(t={text:t}),this.#t={color:"cyan",stream:Nn.default.stderr,discardStdin:!0,hideCursor:!0,...t},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#g=this.#t.interval,this.#n=this.#t.stream,this.#u=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:Ks({stream:this.#n}),this.#c=typeof this.#t.isSilent=="boolean"?this.#t.isSilent:!1,this.text=this.#t.text,this.prefixText=this.#t.prefixText,this.suffixText=this.#t.suffixText,this.indent=this.#t.indent,Nn.default.env.NODE_ENV==="test"&&(this._stream=this.#n,this._isEnabled=this.#u,Object.defineProperty(this,"_linesToClear",{get(){return this.#s},set(r){this.#s=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#o}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#d}set indent(t=0){if(!(t>=0&&Number.isInteger(t)))throw new Error("The `indent` option must be an integer from 0 and up");this.#d=t,this.#m()}get interval(){return this.#g??this.#i.interval??100}get spinner(){return this.#i}set spinner(t){if(this.#o=-1,this.#g=void 0,typeof t=="object"){if(t.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#i=t}else if(!Ys())this.#i=Bn.default.line;else if(t===void 0)this.#i=Bn.default.dots;else if(t!=="default"&&Bn.default[t])this.#i=Bn.default[t];else throw new Error(`There is no built-in spinner named '${t}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#h}set text(t=""){this.#h=t,this.#m()}get prefixText(){return this.#a}set prefixText(t=""){this.#a=t,this.#m()}get suffixText(){return this.#l}set suffixText(t=""){this.#l=t,this.#m()}get isSpinning(){return this.#p!==void 0}#w(t=this.#a,r=" "){return typeof t=="string"&&t!==""?t+r:typeof t=="function"?t()+r:""}#y(t=this.#l,r=" "){return typeof t=="string"&&t!==""?r+t:typeof t=="function"?r+t():""}#m(){let t=this.#n.columns??80,r=this.#w(this.#a,"-"),n=this.#y(this.#l,"-"),o=" ".repeat(this.#d)+r+"--"+this.#h+"--"+n;this.#e=0;for(let i of Vs(o).split(`
8
8
  `))this.#e+=Math.max(1,Math.ceil(qs(i,{countAnsiEscapeCodes:!0})/t))}get isEnabled(){return this.#u&&!this.#c}set isEnabled(t){if(typeof t!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#u=t}get isSilent(){return this.#c}set isSilent(t){if(typeof t!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#c=t}frame(){let t=Date.now();(this.#o===-1||t-this.#f>=this.interval)&&(this.#o=++this.#o%this.#i.frames.length,this.#f=t);let{frames:r}=this.#i,n=r[this.#o];this.color&&(n=ot[this.color](n));let o=typeof this.#a=="string"&&this.#a!==""?this.#a+" ":"",i=typeof this.text=="string"?" "+this.text:"",s=typeof this.#l=="string"&&this.#l!==""?" "+this.#l:"";return o+n+i+s}clear(){if(!this.#u||!this.#n.isTTY)return this;this.#n.cursorTo(0);for(let t=0;t<this.#s;t++)t>0&&this.#n.moveCursor(0,-1),this.#n.clearLine(1);return(this.#d||this.lastIndent!==this.#d)&&this.#n.cursorTo(this.#d),this.lastIndent=this.#d,this.#s=0,this}render(){return this.#c?this:(this.clear(),this.#n.write(this.frame()),this.#s=this.#e,this)}start(t){return t&&(this.text=t),this.#c?this:this.#u?this.isSpinning?this:(this.#t.hideCursor&&Ms.hide(this.#n),this.#t.discardStdin&&Nn.default.stdin.isTTY&&(this.#r=!0,Qs.start()),this.render(),this.#p=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#n.write(`- ${this.text}
9
9
  `),this)}stop(){return this.#u?(clearInterval(this.#p),this.#p=void 0,this.#o=0,this.clear(),this.#t.hideCursor&&Ms.show(this.#n),this.#t.discardStdin&&Nn.default.stdin.isTTY&&this.#r&&(Qs.stop(),this.#r=!1),this):this}succeed(t){return this.stopAndPersist({symbol:Pn.success,text:t})}fail(t){return this.stopAndPersist({symbol:Pn.error,text:t})}warn(t){return this.stopAndPersist({symbol:Pn.warning,text:t})}info(t){return this.stopAndPersist({symbol:Pn.info,text:t})}stopAndPersist(t={}){if(this.#c)return this;let r=t.prefixText??this.#a,n=this.#w(r," "),o=t.symbol??" ",i=t.text??this.text,a=typeof i=="string"?(o?" ":"")+i:"",l=t.suffixText??this.#l,c=this.#y(l," "),d=n+o+a+c+`
10
- `;return this.stop(),this.#n.write(d),this}}});function oa(e,{suffix:t="nodejs"}={}){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return t&&(e+=`-${t}`),Go.default.platform==="darwin"?Cw(e):Go.default.platform==="win32"?_w(e):kw(e)}var le,ra,Go,Nt,na,qr,Cw,_w,kw,Gc=v(()=>{"use strict";le=h(require("path"),1),ra=h(require("os"),1),Go=h(require("process"),1),Nt=ra.default.homedir(),na=ra.default.tmpdir(),{env:qr}=Go.default,Cw=e=>{let t=le.default.join(Nt,"Library");return{data:le.default.join(t,"Application Support",e),config:le.default.join(t,"Preferences",e),cache:le.default.join(t,"Caches",e),log:le.default.join(t,"Logs",e),temp:le.default.join(na,e)}},_w=e=>{let t=qr.APPDATA||le.default.join(Nt,"AppData","Roaming"),r=qr.LOCALAPPDATA||le.default.join(Nt,"AppData","Local");return{data:le.default.join(r,e,"Data"),config:le.default.join(t,e,"Config"),cache:le.default.join(r,e,"Cache"),log:le.default.join(r,e,"Log"),temp:le.default.join(na,e)}},kw=e=>{let t=le.default.basename(Nt);return{data:le.default.join(qr.XDG_DATA_HOME||le.default.join(Nt,".local","share"),e),config:le.default.join(qr.XDG_CONFIG_HOME||le.default.join(Nt,".config"),e),cache:le.default.join(qr.XDG_CACHE_HOME||le.default.join(Nt,".cache"),e),log:le.default.join(qr.XDG_STATE_HOME||le.default.join(Nt,".local","state"),e),temp:le.default.join(na,t,e)}}});function zo(){return/[<>:"/\\|?*\u0000-\u001F]/g}function zc(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}var qc=v(()=>{"use strict"});function Mn(e,t={}){let r=/[\u0000-\u001F\u0080-\u009F]/g,n=/([<>:"/\\|?*\u0000-\u001F]){2,}/g;if(typeof e!="string")throw new TypeError("Expected a string");let o=t.replacement===void 0?"!":t.replacement;if(zo().test(o)&&r.test(o))throw new Error("Replacement string cannot contain reserved filename characters");o.length>0&&(e=e.replace(n,"$1")),e=e.normalize("NFD"),e=e.replace(Tw,o),e=e.replace(zo(),o),e=e.replace(r,o),e=e.replace(Aw,""),o.length>0&&(!(e[0]===".")&&e[0]==="."&&(e=o+e),e[e.length-1]==="."&&(e+=o)),e=zc().test(e)?e+o:e;let i=typeof t.maxLength=="number"?t.maxLength:Sw;if(e.length>i){let s=e.lastIndexOf(".");if(s===-1)e=e.slice(0,i);else{let a=e.slice(0,s),l=e.slice(s);e=a.slice(0,Math.max(1,i-l.length))+l}}return e}var Sw,Tw,Aw,ia=v(()=>{"use strict";qc();Sw=100,Tw=/^\.+(\\|\/)|^\.+$/,Aw=/\.+$/});var Ow,Kc=v(()=>{"use strict";Ow=h(require("path"),1);ia()});var Zc=v(()=>{"use strict";ia();Kc()});var qo,sa=v(()=>{"use strict";qo="webflow.json"});var ur,aa=v(()=>{"use strict";ur=class extends Error{constructor(t){super(`Manifest config for key "${t}" not found`),this.name="ManifestConfigKeyNotFoundError"}}});function Xc(e){la=e}function ee(){return la}function st(){return!la}function Qc(e){Yc=e}function ed(){return Yc}var la,Yc,Se=v(()=>{"use strict";la=!1});function cr(){let e=ed();if(e){if(e.endsWith(".json"))return{path:e,isUserDefined:!0};try{if((0,td.statSync)(e)?.isDirectory())return{path:(0,rd.join)(e,qo),isUserDefined:!0}}catch{if(e.endsWith(".json"))return{path:e,isUserDefined:!0}}throw new Error(`Manifest path must be either a directory or a .json file. Got: ${e}`)}return{path:`./${qo}`,isUserDefined:!1}}var td,rd,ua=v(()=>{"use strict";td=require("fs"),rd=require("path");sa();Se()});var nd,Iw,$w,ca,od=v(()=>{"use strict";nd=h(require("ajv")),Iw=new nd.default,$w={type:"object",properties:{library:{type:"object",properties:{name:{type:"string",minLength:1},id:{type:"string",minLength:1},components:{type:"array",items:{type:"string"},minItems:1},renderer:{anyOf:[{type:"object",properties:{client:{type:"string",minLength:1},server:{type:"string",minLength:1}}},{type:"string",minLength:1}]},globals:{type:"string",minLength:1}},required:[]},devlink:{type:"object",properties:{rootDir:{type:"string",minLength:1},cssModules:{type:"boolean"},allowTelemetry:{type:"boolean"},overwriteModule:{type:"boolean"},skipTagSelectors:{type:"boolean"},envVariables:{type:"object",additionalProperties:{type:"string"}},components:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},fileExtensions:{type:"object",properties:{js:{type:"string"},css:{type:"string"}}},relativeHrefRoot:{oneOf:[{type:"boolean"},{type:"string"}]}},required:["rootDir"]},"devlink-export":{type:"object",properties:{rootDir:{type:"string",minLength:1},components:{type:"string"},componentGroups:{type:"string"},ts:{type:"boolean"},cssScopes:{type:"boolean"},relativeHrefRoot:{oneOf:[{type:"boolean",const:!1},{type:"string"}]},treeShake:{type:"boolean"}},required:[]}}},ca=Iw.compile($w)});function id(e){return e instanceof Error?e:new Error("Unknown error")}function J(){let{path:e}=cr();if(!(0,Ko.existsSync)(e))return{manifest:{},manifestPath:e};let t;try{t=(0,Ko.readFileSync)(e,"utf8")}catch(o){throw new Error(`Failed to read manifest file: ${id(o).message}`)}if(t.trim()==="")return{manifest:{},manifestPath:e};let n;try{n=JSON.parse(t)}catch(o){throw new Error(`Invalid JSON in manifest file: ${id(o).message}`)}if(!ca(n)){let o=ca.errors?.map(i=>`${i.instancePath} ${i.message}`).join(", ")||"Unknown error";throw new Error(`Invalid manifest: ${o}.`)}return{manifest:n,manifestPath:e}}var Ko,Ln=v(()=>{"use strict";Ko=require("fs");ua();od()});function Wn(e,t){let r=e[t];if(!r)throw new ur(t);return r}var sd=v(()=>{"use strict";aa()});function ue(e){let t=J(),r=t.manifest,n=t.manifestPath,o={...r};for(let i in e){let s=i,a=e[s];if(a!==void 0)if(typeof a=="string"||typeof a=="number"||typeof a=="boolean"||a===null)o[s]=a;else{let l=o[s];o[s]={...typeof l=="object"&&l!==null?l:{},...a}}}return(0,ad.writeFileSync)(n,JSON.stringify(o,null,2),"utf-8"),o}var ad,da=v(()=>{"use strict";ad=require("fs");Ln()});var De=v(()=>{"use strict";sa();aa();Ln();ua();sd();da()});var Zo=Fs(($x,Rw)=>{Rw.exports={name:"@webflow/webflow-cli",version:"2.1.0",license:"MIT",bin:{webflow:"./dist/index.js"},scripts:{build:"tsup",dev:"tsup",lint:"eslint .",test:"jest --ci","test:unit":"jest --ci --ignoreProjects e2e","test:local":"jest","test:e2e:deploy":"bash regression/run-local.sh","test:regression":"jest --config regression/jest.config.js --testTimeout=420000","test:e2e-cache-clear":"bash scripts/clear-e2e-cache.sh"},files:["CHANGELOG.md","dist/**/*"],publishConfig:{access:"public"},dependencies:{"@babel/preset-env":"^7.26.9","@babel/preset-react":"^7.26.3","@babel/preset-typescript":"^7.27.0","@dotenvx/dotenvx":"^1.44.1","@inquirer/prompts":"^7.9.0","@module-federation/enhanced":"0.20.0","@rspack/core":"^1.7.8","@webflow/cosmic-deploy-contract":"^1.0.2","@webflow/data-types":"*",ajv:"^8.17.1",archiver:"^5.3.1","babel-loader":"^10.0.0",commander:"^10.0.0",cosmiconfig:"^8.2.0","css-loader":"^7.1.2",dotenv:"^16.0.3","env-paths":"^3.0.0","fast-glob":"^3.3.3",filenamify:"^6.0.0","fork-ts-checker-webpack-plugin":"9.1.0","form-data":"4.0.4","fs-extra":"^11.3.0",jsdom:"^26.0.0","jsonc-parser":"^3.2.0",md5:"^2.2.1",memfs:"4.17.0","mime-types":"^2.1.35","mini-css-extract-plugin":"^2.9.2","node-fetch":"^2.6.7",open:"^8.4.2",ora:"^8.2.0",postcss:"^8.5.6","postcss-loader":"^8.1.1","postcss-selector-parser":"^7.1.0",semver:"^7.7.2","serve-handler":"^6.1.5","source-map-support":"^0.5.21",tar:"^7.4.3","ts-checker-rspack-plugin":"^1.0.0","tsconfig-paths":"^4.2.0","tsconfig-paths-webpack-plugin":"^4.2.0",unionfs:"^4.5.4","webflow-api":"3.3.4",webpack:">=5.99.7 <5.106.0","webpack-merge":"^6.0.1","webpack-node-externals":"^3.0.0",zod:"^3.22.4"},devDependencies:{"@types/archiver":"^5.3.2","@types/express":"^4.17.13","@types/fs-extra":"^11.0.4","@types/jest":"^29.2.3","@types/md5":"^2.3.2","@types/mime-types":"^2.1.4","@types/nock":"^8.0.33","@types/node":"^22.13.0","@types/node-fetch":"2.6.13","@types/serve-handler":"^6.1.1","@types/source-map":"^0.5.2","@types/webpack-node-externals":"^3.0.4",astro:"^5.17.2","eslint-config-custom":"*",express:"^4.18.1",jest:"^29.3.1",nock:"13.3.1",tar:"^7.4.3","ts-jest":"^29.4.9","ts-node":"^10.9.1",tsconfig:"*",tsup:"^8.4.0",typescript:"^5.9.3"},engines:{node:">=22.13.0"}}});function Et(){try{return Zo().version}catch{return"unknown"}}function dt(e=""){if(!e)return"";let t=e;t=t.replace(/\/.*?\/webflow-cli/gi,"/REDACTED_PII/webflow-cli"),t=t.replace(/\/.*?\/node_modules/gi,"/REDACTED_PII/node_modules");let r=Un.default.homedir();if(r){let o=new RegExp(r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");t=t.replace(o,"~/REDACTED_PII")}let n=Un.default.userInfo().username;if(n){let o=new RegExp(`/Users/${n}`,"gi");t=t.replace(o,"/Users/REDACTED_PII")}return t=t.replace(/\/Users\/[^\/\s]+/gi,"/Users/REDACTED_PII"),t=t.replace(/C:\\Users\\[^\\]+/gi,"C:\\Users\\REDACTED_PII"),t=t.replace(/[a-zA-Z0-9]{32,}/g,"[REDACTED_TOKEN]"),t=t.replace(/Bearer\s+[^\s]+/gi,"Bearer [REDACTED_TOKEN]"),t=t.replace(/token[=:]\s*[^\s]+/gi,"token=[REDACTED_TOKEN]"),t=t.replace(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,"[REDACTED_EMAIL]"),t=t.replace(/\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/g,"[REDACTED_IP]"),t}function fa(e){if(e.stack)return dt(e.stack)}function Bt(e){let t=["password","token","secret","key","auth","bearer","authorization","apikey","api_key","access_token","refresh_token","client_secret","private_key"],r={};for(let[n,o]of Object.entries(e)){let i=n.toLowerCase();t.some(s=>i.includes(s))?r[n]="[REDACTED]":typeof o=="string"?r[n]=dt(o):typeof o=="object"&&o!==null&&!Array.isArray(o)?r[n]=Bt(o):Array.isArray(o)?r[n]=o.map(s=>typeof s=="object"&&s!==null?Bt(s):typeof s=="string"?dt(s):s):r[n]=o}return r}function ld(){return{platform:process.platform,nodeVersion:process.version,arch:process.arch,os:`${Un.default.type()} ${Un.default.release()}`}}function pa(){let e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`${e}-${t}`}var Un,Vn=v(()=>{"use strict";Un=h(require("os"))});var O,F,Ee,Kr,ma,Fe,be,Yo,ga,W=v(()=>{"use strict";ie();O=R("\u2713"),F=vt("\u2716"),Ee=ce("\u2139"),Kr=R("\u279C"),ma=vt("\u279C"),Fe="\u279C",be=ne("\u26A0"),Yo=S("\u2732"),ga=R("\u2732")});var Mt,ha=v(()=>{"use strict";De();Vn();C();ie();W();Mt=class e{static instance;cache=void 0;static isDoNotTrackEnabled(){let t=process.env.DO_NOT_TRACK;return t==="1"||t?.toLowerCase()==="true"}static getInstance(){return e.instance||(e.instance=new e),e.instance}async getPreference(){if(e.isDoNotTrackEnabled())return!1;if(this.cache!==void 0)return this.cache;try{let{manifest:t}=await J(),r=t?.telemetry?.global?.allowTelemetry;return this.cache=r,r}catch{return}}async setPreference(t){this.cache=t,await this.setGlobalPreference(t)}async promptForConsent(t){return e.isDoNotTrackEnabled()?(u.info(`${Ee} Telemetry is disabled because the DO_NOT_TRACK environment variable is set.`),!1):(u.info(`${ga} ${S("Telemetry is enabled. We collect usage data and error reports to improve the Webflow CLI.")}`),u.info(`${ga} ${S("To opt out, run")} ${R("webflow auth telemetry --disable")}`),await this.setPreference(!0),!0)}clearCache(){this.cache=void 0}async getGlobalPreference(){return this.getPreference()}async setGlobalPreference(t){let r={telemetry:{global:{allowTelemetry:t,lastPrompted:Date.now(),version:Et()}}};await ue(r),u.info(`${O} Telemetry configuration updated in webflow.json`),this.cache=t}async hasGlobalPreference(){return await this.getPreference()!==void 0}async getTelemetryStatus(){let t=await this.getPreference();return t!==void 0?{enabled:t,source:"global",hasPreference:!0}:{enabled:!1,source:"none",hasPreference:!1}}setCacheValue(t,r){this.cache=r}}});async function K(e,t){let n={"User-Agent":`webflow-cli@${Et()}`};return(0,ud.default)(e,{...t,headers:{...t?.headers,...n}})}var ud,ft=v(()=>{"use strict";ud=h(require("node-fetch"));te()});var cd,dd=v(()=>{"use strict";cd=e=>{try{let t=new URL(e);return!(!["http:","https:"].includes(t.protocol)||e.includes("?")||e.includes("#")||t.search||t.hash)}catch{return!1}}});var wa,_,Xo,Zr,Hn,ya,Jn,Gn,Yr,se=v(()=>{"use strict";dd();wa=(e,t)=>(cd(t)||(console.error(`Error: Invalid ${e} environment variable. Only valid plain HTTP/HTTPS URLs without query parameters and anchors is allowed.`),process.exit(1)),t),_=process.env.WEBFLOW_API_HOST?wa("WEBFLOW_API_HOST",process.env.WEBFLOW_API_HOST):"https://api.webflow.com",Xo=process.env.WEBFLOW_CDN_API_HOST?wa("WEBFLOW_CDN_API_HOST",process.env.WEBFLOW_CDN_API_HOST):"https://api-cdn.webflow.com",Zr=process.env.WEBFLOW_HOST?wa("WEBFLOW_HOST",process.env.WEBFLOW_HOST):"https://webflow.com",Hn="wf-manifest.json",ya="mf-manifest.json",Jn="@webflow_renderer",Gn="ssr-bundle.tar",Yr="index.js"});var A,Da=v(()=>{"use strict";ha();Vn();C();ft();se();A=class e{config;consentManager;sessionId;platformInfo;constructor(t){this.config=t,this.consentManager=Mt.getInstance(),this.sessionId=pa(),this.platformInfo=ld()}async sendEvent(t){try{if(!await this.isEnabled())return;let r=this.enrichEvent(t),n=this.sanitizeEvent(r);await this.transmitEvent(n)}catch(r){u.debug(`Failed to send telemetry event: ${r}`)}}async sendError(t,r,n){await this.sendEvent({eventType:"error",success:!1,name:t.name,message:t.message,cause:t.cause,stack:fa(t),context:r,metadata:n?Bt(n):void 0})}async sendUsage(t,r){let{duration:n,...o}=r??{};await this.sendEvent({eventType:"usage",success:!0,feature:t,duration:typeof n=="number"?n:void 0,data:Object.keys(o).length>0?Bt(o):void 0})}async sendPerformance(t,r,n){await this.sendEvent({eventType:"performance",operation:t,duration:r,metrics:n})}async isEnabled(){return await this.consentManager.getPreference()!==!1}async isGloballyEnabled(){return await this.consentManager.getGlobalPreference()!==!1}async updatePreferences(t){await this.consentManager.setPreference(t)}static async promptForConsentIfNeeded(t){let r=Mt.getInstance(),n=await r.getPreference();return n!==void 0?n:await r.promptForConsent(t)}enrichEvent(t){return{...{eventType:t.eventType||"usage",timestamp:Date.now(),sessionId:this.sessionId,platform:this.platformInfo.platform,nodeVersion:this.platformInfo.nodeVersion,cliVersion:Et(),command:process.argv.slice(2).join(" ")||void 0,metadata:{...t.metadata,commandType:this.config.commandType,siteId:this.config.siteId,projectId:this.config.projectId,os:this.platformInfo.os,arch:this.platformInfo.arch}},...t}}sanitizeEvent(t){let r=JSON.parse(JSON.stringify(t));return r.message&&(r.message=dt(r.message)),r.stack&&(r.stack=dt(r.stack)),r.context&&(r.context=dt(r.context)),r.metadata&&(r.metadata=Bt(r.metadata)),r.data&&(r.data=Bt(r.data)),r}async transmitEvent(t){let r=this.getEndpoint(),n=process.env.WEBFLOW_TELEMETRY_DEBUG==="true";if(n){console.log(`\u{1F4CA} [Telemetry] Sending to: ${r}`);let i={...t};i.metadata&&(delete i.metadata.authToken,delete i.metadata.apiToken),console.log("\u{1F4CA} [Telemetry] Payload:",JSON.stringify(i,null,2))}let o=await K(r,{method:"POST",headers:{Authorization:`Bearer ${this.config.authToken}`,"Content-Type":"application/json"},body:JSON.stringify(t),timeout:5e3});if(o.ok)n&&console.log(`\u{1F4CA} [Telemetry] Request successful: ${o.status}`);else throw n&&console.error(`\u{1F4CA} [Telemetry] Request failed: ${o.status} ${o.statusText}`),new Error(`Telemetry request failed: ${o.status} ${o.statusText}`)}getEndpoint(){let{host:t,commandType:r}=this.config;return`${t}/webflow-cli/${r}/telemetry`}static forDevlinkSync(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"devlink"})}static forExport(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"export"})}static forCloud(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,projectId:t.projectId,commandType:"cloud"})}static forExtension(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"extension"})}static forCodeLibraries(t){return new e({host:t.host||_,authToken:t.authToken,commandType:"library"})}static forCms(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"cms"})}static forAssets(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"assets"})}static forSites(t){return new e({host:t.host||_,authToken:t.authToken,commandType:"sites"})}static forForms(t){return new e({host:t.host||_,authToken:t.authToken,commandType:"forms"})}}});var fd=v(()=>{"use strict"});function pd(e){return async(t,r,n)=>{let o=Date.now(),i=process.memoryUsage().heapUsed;try{let s=await r(),a=Date.now()-o,l=process.memoryUsage().heapUsed;return await e.sendPerformance(t,a,{memoryDelta:l-i,...n}),s}catch(s){let a=Date.now()-o;throw await e.sendPerformance(t,a,{failed:1,...n}),s}}}var te=v(()=>{"use strict";Da();ha();fd();Vn();Vn()});var va,ba,Pw,xt,Ea=v(()=>{"use strict";va=Symbol("webflow-cli-warn"),ba=class{warnings=[];originalConsoleWarn=null;isActive=!1;parseSource(t){let r=t.split(`
10
+ `;return this.stop(),this.#n.write(d),this}}});function oa(e,{suffix:t="nodejs"}={}){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return t&&(e+=`-${t}`),Go.default.platform==="darwin"?_w(e):Go.default.platform==="win32"?kw(e):Sw(e)}var le,ra,Go,Nt,na,qr,_w,kw,Sw,Gc=v(()=>{"use strict";le=h(require("path"),1),ra=h(require("os"),1),Go=h(require("process"),1),Nt=ra.default.homedir(),na=ra.default.tmpdir(),{env:qr}=Go.default,_w=e=>{let t=le.default.join(Nt,"Library");return{data:le.default.join(t,"Application Support",e),config:le.default.join(t,"Preferences",e),cache:le.default.join(t,"Caches",e),log:le.default.join(t,"Logs",e),temp:le.default.join(na,e)}},kw=e=>{let t=qr.APPDATA||le.default.join(Nt,"AppData","Roaming"),r=qr.LOCALAPPDATA||le.default.join(Nt,"AppData","Local");return{data:le.default.join(r,e,"Data"),config:le.default.join(t,e,"Config"),cache:le.default.join(r,e,"Cache"),log:le.default.join(r,e,"Log"),temp:le.default.join(na,e)}},Sw=e=>{let t=le.default.basename(Nt);return{data:le.default.join(qr.XDG_DATA_HOME||le.default.join(Nt,".local","share"),e),config:le.default.join(qr.XDG_CONFIG_HOME||le.default.join(Nt,".config"),e),cache:le.default.join(qr.XDG_CACHE_HOME||le.default.join(Nt,".cache"),e),log:le.default.join(qr.XDG_STATE_HOME||le.default.join(Nt,".local","state"),e),temp:le.default.join(na,t,e)}}});function zo(){return/[<>:"/\\|?*\u0000-\u001F]/g}function zc(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}var qc=v(()=>{"use strict"});function Mn(e,t={}){let r=/[\u0000-\u001F\u0080-\u009F]/g,n=/([<>:"/\\|?*\u0000-\u001F]){2,}/g;if(typeof e!="string")throw new TypeError("Expected a string");let o=t.replacement===void 0?"!":t.replacement;if(zo().test(o)&&r.test(o))throw new Error("Replacement string cannot contain reserved filename characters");o.length>0&&(e=e.replace(n,"$1")),e=e.normalize("NFD"),e=e.replace(Aw,o),e=e.replace(zo(),o),e=e.replace(r,o),e=e.replace(Ow,""),o.length>0&&(!(e[0]===".")&&e[0]==="."&&(e=o+e),e[e.length-1]==="."&&(e+=o)),e=zc().test(e)?e+o:e;let i=typeof t.maxLength=="number"?t.maxLength:Tw;if(e.length>i){let s=e.lastIndexOf(".");if(s===-1)e=e.slice(0,i);else{let a=e.slice(0,s),l=e.slice(s);e=a.slice(0,Math.max(1,i-l.length))+l}}return e}var Tw,Aw,Ow,ia=v(()=>{"use strict";qc();Tw=100,Aw=/^\.+(\\|\/)|^\.+$/,Ow=/\.+$/});var Iw,Kc=v(()=>{"use strict";Iw=h(require("path"),1);ia()});var Zc=v(()=>{"use strict";ia();Kc()});var qo,sa=v(()=>{"use strict";qo="webflow.json"});var ur,aa=v(()=>{"use strict";ur=class extends Error{constructor(t){super(`Manifest config for key "${t}" not found`),this.name="ManifestConfigKeyNotFoundError"}}});function Xc(e){la=e}function ee(){return la}function st(){return!la}function Qc(e){Yc=e}function ed(){return Yc}var la,Yc,Se=v(()=>{"use strict";la=!1});function cr(){let e=ed();if(e){if(e.endsWith(".json"))return{path:e,isUserDefined:!0};try{if((0,td.statSync)(e)?.isDirectory())return{path:(0,rd.join)(e,qo),isUserDefined:!0}}catch{if(e.endsWith(".json"))return{path:e,isUserDefined:!0}}throw new Error(`Manifest path must be either a directory or a .json file. Got: ${e}`)}return{path:`./${qo}`,isUserDefined:!1}}var td,rd,ua=v(()=>{"use strict";td=require("fs"),rd=require("path");sa();Se()});var nd,$w,Rw,ca,od=v(()=>{"use strict";nd=h(require("ajv")),$w=new nd.default,Rw={type:"object",properties:{library:{type:"object",properties:{name:{type:"string",minLength:1},id:{type:"string",minLength:1},components:{type:"array",items:{type:"string"},minItems:1},renderer:{anyOf:[{type:"object",properties:{client:{type:"string",minLength:1},server:{type:"string",minLength:1}}},{type:"string",minLength:1}]},globals:{type:"string",minLength:1}},required:[]},devlink:{type:"object",properties:{rootDir:{type:"string",minLength:1},cssModules:{type:"boolean"},allowTelemetry:{type:"boolean"},overwriteModule:{type:"boolean"},skipTagSelectors:{type:"boolean"},envVariables:{type:"object",additionalProperties:{type:"string"}},components:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},fileExtensions:{type:"object",properties:{js:{type:"string"},css:{type:"string"}}},relativeHrefRoot:{oneOf:[{type:"boolean"},{type:"string"}]}},required:["rootDir"]},"devlink-export":{type:"object",properties:{rootDir:{type:"string",minLength:1},components:{type:"string"},componentGroups:{type:"string"},ts:{type:"boolean"},cssScopes:{type:"boolean"},relativeHrefRoot:{oneOf:[{type:"boolean",const:!1},{type:"string"}]},treeShake:{type:"boolean"}},required:[]}}},ca=$w.compile(Rw)});function id(e){return e instanceof Error?e:new Error("Unknown error")}function J(){let{path:e}=cr();if(!(0,Ko.existsSync)(e))return{manifest:{},manifestPath:e};let t;try{t=(0,Ko.readFileSync)(e,"utf8")}catch(o){throw new Error(`Failed to read manifest file: ${id(o).message}`)}if(t.trim()==="")return{manifest:{},manifestPath:e};let n;try{n=JSON.parse(t)}catch(o){throw new Error(`Invalid JSON in manifest file: ${id(o).message}`)}if(!ca(n)){let o=ca.errors?.map(i=>`${i.instancePath} ${i.message}`).join(", ")||"Unknown error";throw new Error(`Invalid manifest: ${o}.`)}return{manifest:n,manifestPath:e}}var Ko,Ln=v(()=>{"use strict";Ko=require("fs");ua();od()});function Wn(e,t){let r=e[t];if(!r)throw new ur(t);return r}var sd=v(()=>{"use strict";aa()});function ue(e){let t=J(),r=t.manifest,n=t.manifestPath,o={...r};for(let i in e){let s=i,a=e[s];if(a!==void 0)if(typeof a=="string"||typeof a=="number"||typeof a=="boolean"||a===null)o[s]=a;else{let l=o[s];o[s]={...typeof l=="object"&&l!==null?l:{},...a}}}return(0,ad.writeFileSync)(n,JSON.stringify(o,null,2),"utf-8"),o}var ad,da=v(()=>{"use strict";ad=require("fs");Ln()});var De=v(()=>{"use strict";sa();aa();Ln();ua();sd();da()});var Zo=Fs((Px,Pw)=>{Pw.exports={name:"@webflow/webflow-cli",version:"2.1.1",license:"MIT",bin:{webflow:"./dist/index.js"},scripts:{build:"tsup",dev:"tsup",lint:"eslint .",test:"jest --ci","test:unit":"jest --ci --ignoreProjects e2e","test:local":"jest","test:e2e:deploy":"bash regression/run-local.sh","test:regression":"jest --config regression/jest.config.js --testTimeout=420000","test:e2e-cache-clear":"bash scripts/clear-e2e-cache.sh"},files:["CHANGELOG.md","dist/**/*"],publishConfig:{access:"public"},dependencies:{"@babel/preset-env":"^7.26.9","@babel/preset-react":"^7.26.3","@babel/preset-typescript":"^7.27.0","@dotenvx/dotenvx":"^1.44.1","@inquirer/prompts":"^7.9.0","@module-federation/enhanced":"0.20.0","@rspack/core":"^1.7.8","@webflow/cosmic-deploy-contract":"^1.0.2","@webflow/data-types":"*",ajv:"^8.17.1",archiver:"^5.3.1","babel-loader":"^10.0.0",commander:"^10.0.0",cosmiconfig:"^8.2.0","css-loader":"^7.1.2",dotenv:"^16.0.3","env-paths":"^3.0.0","fast-glob":"^3.3.3",filenamify:"^6.0.0","fork-ts-checker-webpack-plugin":"9.1.0","form-data":"4.0.4","fs-extra":"^11.3.0",jsdom:"^26.0.0","jsonc-parser":"^3.2.0",md5:"^2.2.1",memfs:"4.17.0","mime-types":"^2.1.35","mini-css-extract-plugin":"^2.9.2","node-fetch":"^2.6.7",open:"^8.4.2",ora:"^8.2.0",postcss:"^8.5.6","postcss-loader":"^8.1.1","postcss-selector-parser":"^7.1.0",semver:"^7.7.2","serve-handler":"^6.1.5","source-map-support":"^0.5.21",tar:"^7.5.16","ts-checker-rspack-plugin":"^1.0.0","tsconfig-paths":"^4.2.0","tsconfig-paths-webpack-plugin":"^4.2.0",unionfs:"^4.5.4","webflow-api":"3.3.4",webpack:">=5.99.7 <5.106.0","webpack-merge":"^6.0.1","webpack-node-externals":"^3.0.0",zod:"^3.22.4"},devDependencies:{"@types/archiver":"^5.3.2","@types/express":"^4.17.13","@types/fs-extra":"^11.0.4","@types/jest":"^29.2.3","@types/md5":"^2.3.2","@types/mime-types":"^2.1.4","@types/nock":"^8.0.33","@types/node":"^22.13.0","@types/node-fetch":"2.6.13","@types/serve-handler":"^6.1.1","@types/source-map":"^0.5.2","@types/webpack-node-externals":"^3.0.4",astro:"^5.17.2","eslint-config-custom":"*",express:"^4.18.1",jest:"^29.3.1",nock:"13.3.1",tar:"^7.5.16","ts-jest":"^29.4.9","ts-node":"^10.9.1",tsconfig:"*",tsup:"^8.4.0",typescript:"^5.9.3"},engines:{node:">=22.13.0"}}});function Et(){try{return Zo().version}catch{return"unknown"}}function dt(e=""){if(!e)return"";let t=e;t=t.replace(/\/.*?\/webflow-cli/gi,"/REDACTED_PII/webflow-cli"),t=t.replace(/\/.*?\/node_modules/gi,"/REDACTED_PII/node_modules");let r=Un.default.homedir();if(r){let o=new RegExp(r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");t=t.replace(o,"~/REDACTED_PII")}let n=Un.default.userInfo().username;if(n){let o=new RegExp(`/Users/${n}`,"gi");t=t.replace(o,"/Users/REDACTED_PII")}return t=t.replace(/\/Users\/[^\/\s]+/gi,"/Users/REDACTED_PII"),t=t.replace(/C:\\Users\\[^\\]+/gi,"C:\\Users\\REDACTED_PII"),t=t.replace(/[a-zA-Z0-9]{32,}/g,"[REDACTED_TOKEN]"),t=t.replace(/Bearer\s+[^\s]+/gi,"Bearer [REDACTED_TOKEN]"),t=t.replace(/token[=:]\s*[^\s]+/gi,"token=[REDACTED_TOKEN]"),t=t.replace(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,"[REDACTED_EMAIL]"),t=t.replace(/\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/g,"[REDACTED_IP]"),t}function fa(e){if(e.stack)return dt(e.stack)}function Bt(e){let t=["password","token","secret","key","auth","bearer","authorization","apikey","api_key","access_token","refresh_token","client_secret","private_key"],r={};for(let[n,o]of Object.entries(e)){let i=n.toLowerCase();t.some(s=>i.includes(s))?r[n]="[REDACTED]":typeof o=="string"?r[n]=dt(o):typeof o=="object"&&o!==null&&!Array.isArray(o)?r[n]=Bt(o):Array.isArray(o)?r[n]=o.map(s=>typeof s=="object"&&s!==null?Bt(s):typeof s=="string"?dt(s):s):r[n]=o}return r}function ld(){return{platform:process.platform,nodeVersion:process.version,arch:process.arch,os:`${Un.default.type()} ${Un.default.release()}`}}function pa(){let e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`${e}-${t}`}var Un,Vn=v(()=>{"use strict";Un=h(require("os"))});var O,F,Ee,Kr,ma,Fe,be,Yo,ga,W=v(()=>{"use strict";ie();O=R("\u2713"),F=vt("\u2716"),Ee=ce("\u2139"),Kr=R("\u279C"),ma=vt("\u279C"),Fe="\u279C",be=ne("\u26A0"),Yo=S("\u2732"),ga=R("\u2732")});var Mt,ha=v(()=>{"use strict";De();Vn();C();ie();W();Mt=class e{static instance;cache=void 0;static isDoNotTrackEnabled(){let t=process.env.DO_NOT_TRACK;return t==="1"||t?.toLowerCase()==="true"}static getInstance(){return e.instance||(e.instance=new e),e.instance}async getPreference(){if(e.isDoNotTrackEnabled())return!1;if(this.cache!==void 0)return this.cache;try{let{manifest:t}=await J(),r=t?.telemetry?.global?.allowTelemetry;return this.cache=r,r}catch{return}}async setPreference(t){this.cache=t,await this.setGlobalPreference(t)}async promptForConsent(t){return e.isDoNotTrackEnabled()?(u.info(`${Ee} Telemetry is disabled because the DO_NOT_TRACK environment variable is set.`),!1):(u.info(`${ga} ${S("Telemetry is enabled. We collect usage data and error reports to improve the Webflow CLI.")}`),u.info(`${ga} ${S("To opt out, run")} ${R("webflow auth telemetry --disable")}`),await this.setPreference(!0),!0)}clearCache(){this.cache=void 0}async getGlobalPreference(){return this.getPreference()}async setGlobalPreference(t){let r={telemetry:{global:{allowTelemetry:t,lastPrompted:Date.now(),version:Et()}}};await ue(r),u.info(`${O} Telemetry configuration updated in webflow.json`),this.cache=t}async hasGlobalPreference(){return await this.getPreference()!==void 0}async getTelemetryStatus(){let t=await this.getPreference();return t!==void 0?{enabled:t,source:"global",hasPreference:!0}:{enabled:!1,source:"none",hasPreference:!1}}setCacheValue(t,r){this.cache=r}}});async function K(e,t){let n={"User-Agent":`webflow-cli@${Et()}`};return(0,ud.default)(e,{...t,headers:{...t?.headers,...n}})}var ud,ft=v(()=>{"use strict";ud=h(require("node-fetch"));te()});var cd,dd=v(()=>{"use strict";cd=e=>{try{let t=new URL(e);return!(!["http:","https:"].includes(t.protocol)||e.includes("?")||e.includes("#")||t.search||t.hash)}catch{return!1}}});var wa,_,Xo,Zr,Hn,ya,Jn,Gn,Yr,se=v(()=>{"use strict";dd();wa=(e,t)=>(cd(t)||(console.error(`Error: Invalid ${e} environment variable. Only valid plain HTTP/HTTPS URLs without query parameters and anchors is allowed.`),process.exit(1)),t),_=process.env.WEBFLOW_API_HOST?wa("WEBFLOW_API_HOST",process.env.WEBFLOW_API_HOST):"https://api.webflow.com",Xo=process.env.WEBFLOW_CDN_API_HOST?wa("WEBFLOW_CDN_API_HOST",process.env.WEBFLOW_CDN_API_HOST):"https://api-cdn.webflow.com",Zr=process.env.WEBFLOW_HOST?wa("WEBFLOW_HOST",process.env.WEBFLOW_HOST):"https://webflow.com",Hn="wf-manifest.json",ya="mf-manifest.json",Jn="@webflow_renderer",Gn="ssr-bundle.tar",Yr="index.js"});var A,Da=v(()=>{"use strict";ha();Vn();C();ft();se();A=class e{config;consentManager;sessionId;platformInfo;constructor(t){this.config=t,this.consentManager=Mt.getInstance(),this.sessionId=pa(),this.platformInfo=ld()}async sendEvent(t){try{if(!await this.isEnabled())return;let r=this.enrichEvent(t),n=this.sanitizeEvent(r);await this.transmitEvent(n)}catch(r){u.debug(`Failed to send telemetry event: ${r}`)}}async sendError(t,r,n){await this.sendEvent({eventType:"error",success:!1,name:t.name,message:t.message,cause:t.cause,stack:fa(t),context:r,metadata:n?Bt(n):void 0})}async sendUsage(t,r){let{duration:n,...o}=r??{};await this.sendEvent({eventType:"usage",success:!0,feature:t,duration:typeof n=="number"?n:void 0,data:Object.keys(o).length>0?Bt(o):void 0})}async sendPerformance(t,r,n){await this.sendEvent({eventType:"performance",operation:t,duration:r,metrics:n})}async isEnabled(){return await this.consentManager.getPreference()!==!1}async isGloballyEnabled(){return await this.consentManager.getGlobalPreference()!==!1}async updatePreferences(t){await this.consentManager.setPreference(t)}static async promptForConsentIfNeeded(t){let r=Mt.getInstance(),n=await r.getPreference();return n!==void 0?n:await r.promptForConsent(t)}enrichEvent(t){return{...{eventType:t.eventType||"usage",timestamp:Date.now(),sessionId:this.sessionId,platform:this.platformInfo.platform,nodeVersion:this.platformInfo.nodeVersion,cliVersion:Et(),command:process.argv.slice(2).join(" ")||void 0,metadata:{...t.metadata,commandType:this.config.commandType,siteId:this.config.siteId,projectId:this.config.projectId,os:this.platformInfo.os,arch:this.platformInfo.arch}},...t}}sanitizeEvent(t){let r=JSON.parse(JSON.stringify(t));return r.message&&(r.message=dt(r.message)),r.stack&&(r.stack=dt(r.stack)),r.context&&(r.context=dt(r.context)),r.metadata&&(r.metadata=Bt(r.metadata)),r.data&&(r.data=Bt(r.data)),r}async transmitEvent(t){let r=this.getEndpoint(),n=process.env.WEBFLOW_TELEMETRY_DEBUG==="true";if(n){console.log(`\u{1F4CA} [Telemetry] Sending to: ${r}`);let i={...t};i.metadata&&(delete i.metadata.authToken,delete i.metadata.apiToken),console.log("\u{1F4CA} [Telemetry] Payload:",JSON.stringify(i,null,2))}let o=await K(r,{method:"POST",headers:{Authorization:`Bearer ${this.config.authToken}`,"Content-Type":"application/json"},body:JSON.stringify(t),timeout:5e3});if(o.ok)n&&console.log(`\u{1F4CA} [Telemetry] Request successful: ${o.status}`);else throw n&&console.error(`\u{1F4CA} [Telemetry] Request failed: ${o.status} ${o.statusText}`),new Error(`Telemetry request failed: ${o.status} ${o.statusText}`)}getEndpoint(){let{host:t,commandType:r}=this.config;return`${t}/webflow-cli/${r}/telemetry`}static forDevlinkSync(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"devlink"})}static forExport(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"export"})}static forCloud(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,projectId:t.projectId,commandType:"cloud"})}static forExtension(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"extension"})}static forCodeLibraries(t){return new e({host:t.host||_,authToken:t.authToken,commandType:"library"})}static forCms(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"cms"})}static forAssets(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"assets"})}static forSites(t){return new e({host:t.host||_,authToken:t.authToken,commandType:"sites"})}static forForms(t){return new e({host:t.host||_,authToken:t.authToken,commandType:"forms"})}}});var fd=v(()=>{"use strict"});function pd(e){return async(t,r,n)=>{let o=Date.now(),i=process.memoryUsage().heapUsed;try{let s=await r(),a=Date.now()-o,l=process.memoryUsage().heapUsed;return await e.sendPerformance(t,a,{memoryDelta:l-i,...n}),s}catch(s){let a=Date.now()-o;throw await e.sendPerformance(t,a,{failed:1,...n}),s}}}var te=v(()=>{"use strict";Da();ha();fd();Vn();Vn()});var va,ba,jw,xt,Ea=v(()=>{"use strict";va=Symbol("webflow-cli-warn"),ba=class{warnings=[];originalConsoleWarn=null;isActive=!1;parseSource(t){let r=t.split(`
11
11
  `);for(let n=2;n<r.length;n++){let o=r[n],i=o.match(/at .+? \((.+?):\d+:\d+\)/)||o.match(/at (.+?):\d+:\d+/);if(i){let s=i[1];if(s.includes("node_modules")){let a=s.match(/node_modules\/(@?[^/]+(?:\/[^/]+)?)/);return a?`External: ${a[1]}`:"External Dependencies"}else if(s.includes("webflow-cli"))return s.includes("/metadata/")?"Metadata Collection":s.includes("/bundler/")?"Bundling":s.includes("/commands/")?"CLI Commands":"Webflow CLI"}}return"General"}start(){this.isActive||(this.warnings=[],this.originalConsoleWarn=console.warn,this.isActive=!0,console.warn=(...t)=>{if(t.length>1&&t[t.length-1]===va){let i=t.slice(0,-1);this.originalConsoleWarn&&this.originalConsoleWarn(...i);return}let r=t.map(i=>{if(typeof i=="string")return i;if(i instanceof Error)return i.message;try{return String(i)}catch{return"[Object]"}}).join(" "),n=new Error().stack||"",o=this.parseSource(n);this.warnings.push({message:r,timestamp:Date.now(),source:o,stackTrace:n})})}stop(){this.isActive&&(this.originalConsoleWarn&&(console.warn=this.originalConsoleWarn,this.originalConsoleWarn=null),this.isActive=!1)}displayGrouped(){if(this.warnings.length===0)return;console.log(`
12
12
  \u26A0\uFE0F Warnings:
13
13
  `);let t=this.warnings.reduce((r,n)=>{let o=n.source||"General";return r[o]||(r[o]=[]),r[o].push(n),r},{});Object.entries(t).forEach(([r,n])=>{r!=="General"&&console.log(` ${r}:`),n.forEach((o,i)=>{let s=r!=="General"?" ":" ",a=o.message||"[Empty warning message]";console.log(`${s}${i+1}. ${a}`)}),r!=="General"&&console.log("")}),t.General&&console.log("")}debug(){console.log(`
14
14
  \u{1F41B} Debug: Captured Warnings
15
15
  `),this.warnings.forEach((t,r)=>{console.log(`Warning ${r+1}:`),console.log(` Source: ${t.source}`),console.log(` Message: ${t.message}`),console.log(` Message length: ${t.message.length}`),console.log(` Timestamp: ${new Date(t.timestamp).toISOString()}`),t.stackTrace&&(console.log(" Stack (first 3 lines):"),t.stackTrace.split(`
16
- `).slice(0,3).forEach(n=>{console.log(` ${n}`)})),console.log("")})}},Pw=new ba,xt=Pw});function Ge(e){return e.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"")}function hd(e,t){if(!e)return t;let r=parseInt(e,10);return isNaN(r)||r<=0?t:r}function Lt(e){qn.push(dt(e)),qn.length>Bw&&qn.shift()}function wd(e){Fa=e}function md(e){return Lt(`DEBUG: ${e}`),e}function Lw(e){return Lt(`INFO: ${e}`),e}function Ww(e){return Lt(`WARN: ${e}`),e}function Uw(e,t){let r=e instanceof Error?e.stack||e.message:e,n=t?.prefix?`${t.prefix} `:"";Lt(`ERROR: ${n}${r}`),Ca=!0;let o=e instanceof Error?e.message:String(e);return vt(`${n}${o}`)}function Vw(e){return Lt(`SUCCESS: ${e}`),R(e)}function Gw(e){let t=ta({text:`${e}...`,indent:1}).start(),r=!1,n=o=>i=>{if(Lt(`${Hw[o]||"INFO"}: ${i||e}`),o==="fail"&&(Ca=!0),o==="update"){t.text=i||e;return}r||(r=!0,t.stopAndPersist({symbol:Jw[o],text:S(i||e)}))};return{succeed:n("succeed"),fail:n("fail"),warn:n("warn"),info:n("info"),neutral:n("neutral"),update:n("update"),stop:()=>{r||(r=!0,t.stop())}}}function zw(){let e=Xr.default.readdirSync(Le).filter(t=>t.endsWith(".log")).map(t=>({name:t,time:Xr.default.statSync(Qo.default.join(Le,t)).mtime.getTime()})).sort((t,r)=>r.time-t.time);for(;e.length>=Nw;)try{let t=e.pop();if(!t)break;Xr.default.removeSync(Qo.default.join(Le,t.name))}catch{}}function _a(e){try{let t=process.argv.slice(2).join(" ");if(/^(log|library\s+log)(\s|$)/.test(t))return;Xr.default.ensureDirSync(Le),zw(),qn.unshift(`CLI Version: ${Et()}`,`Node Version: ${process.version}`,`Platform: ${process.platform}`,`Architecture: ${process.arch}`,`Command: ${t||"N/A"}`,`Exit Code: ${e??0}`,`Memory Usage: ${Math.round(process.memoryUsage().heapUsed/1024/1024)}MB`,`Timestamp: ${new Date().toISOString()}`,...Fa?[`Sync ID: ${Fa}`]:[],"");let r=qn.map(Ge);Xr.default.writeFileSync(xa,r.join(`
16
+ `).slice(0,3).forEach(n=>{console.log(` ${n}`)})),console.log("")})}},jw=new ba,xt=jw});function Ge(e){return e.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"")}function hd(e,t){if(!e)return t;let r=parseInt(e,10);return isNaN(r)||r<=0?t:r}function Lt(e){qn.push(dt(e)),qn.length>Mw&&qn.shift()}function wd(e){Fa=e}function md(e){return Lt(`DEBUG: ${e}`),e}function Ww(e){return Lt(`INFO: ${e}`),e}function Uw(e){return Lt(`WARN: ${e}`),e}function Vw(e,t){let r=e instanceof Error?e.stack||e.message:e,n=t?.prefix?`${t.prefix} `:"";Lt(`ERROR: ${n}${r}`),Ca=!0;let o=e instanceof Error?e.message:String(e);return vt(`${n}${o}`)}function Hw(e){return Lt(`SUCCESS: ${e}`),R(e)}function zw(e){let t=ta({text:`${e}...`,indent:1}).start(),r=!1,n=o=>i=>{if(Lt(`${Jw[o]||"INFO"}: ${i||e}`),o==="fail"&&(Ca=!0),o==="update"){t.text=i||e;return}r||(r=!0,t.stopAndPersist({symbol:Gw[o],text:S(i||e)}))};return{succeed:n("succeed"),fail:n("fail"),warn:n("warn"),info:n("info"),neutral:n("neutral"),update:n("update"),stop:()=>{r||(r=!0,t.stop())}}}function qw(){let e=Xr.default.readdirSync(Le).filter(t=>t.endsWith(".log")).map(t=>({name:t,time:Xr.default.statSync(Qo.default.join(Le,t)).mtime.getTime()})).sort((t,r)=>r.time-t.time);for(;e.length>=Bw;)try{let t=e.pop();if(!t)break;Xr.default.removeSync(Qo.default.join(Le,t.name))}catch{}}function _a(e){try{let t=process.argv.slice(2).join(" ");if(/^(log|library\s+log)(\s|$)/.test(t))return;Xr.default.ensureDirSync(Le),qw(),qn.unshift(`CLI Version: ${Et()}`,`Node Version: ${process.version}`,`Platform: ${process.platform}`,`Architecture: ${process.arch}`,`Command: ${t||"N/A"}`,`Exit Code: ${e??0}`,`Memory Usage: ${Math.round(process.memoryUsage().heapUsed/1024/1024)}MB`,`Timestamp: ${new Date().toISOString()}`,...Fa?[`Sync ID: ${Fa}`]:[],"");let r=qn.map(Ge);Xr.default.writeFileSync(xa,r.join(`
17
17
  `)),Ca&&(console.info(`
18
18
  ${F} ${S("An error occurred. See logs for more information:")}`),console.info(` ${ma} Latest log: ${xa}`),console.info(` ${ma} All logs: ${Le}`)),(process.env.DEBUG||process.argv.includes("--verbose"))&&(console.info(`
19
- ${O} Command completed successfully. Logs written to:`),console.info(` ${Kr} Latest log: ${xa}`),console.info(` ${Kr} All logs: ${Le}`))}catch(t){console.error("Failed to write logs:",t)}}var Xr,Qo,uF,jw,Le,Nw,Bw,Mw,xa,qn,Ca,Fa,Hw,Jw,Qr,gd,zn,qw,u,C=v(()=>{"use strict";Xr=h(require("fs-extra")),Qo=h(require("path")),uF=require("source-map-support/register");Jc();Gc();Zc();te();ie();Ea();W();jw=oa("webflow-cli"),Le=jw.log;Nw=hd(process.env.MAX_PERSISTED_LOGS,50),Bw=hd(process.env.MAX_IN_MEMORY_LOGS,1e3),Mw=`${Mn(new Date().toISOString(),{replacement:"_"}).replace(/\./g,"_")}-debug.log`,xa=Qo.default.join(Le,Mw);qn=[],Ca=!1;Hw={succeed:"INFO",fail:"ERROR",warn:"WARN",info:"INFO",neutral:"INFO",update:"INFO"},Jw={succeed:O,fail:F,warn:be,info:Ee,neutral:" ",update:void 0};Qr=!1;process.on("uncaughtException",e=>{Qr||(Qr=!0,Lt(`UNCAUGHT EXCEPTION: ${e?.stack}`),_a(1)),xt.displayGrouped(),xt.stop(),process.exit(1)});process.on("unhandledRejection",e=>{Qr||(Qr=!0,Lt(`UNHANDLED REJECTION: ${e instanceof Error?e.stack:String(e)}`),_a(1)),xt.displayGrouped(),xt.stop(),process.exit(1)});process.on("exit",e=>{Qr||(Qr=!0,_a(e))});gd=!0,zn=e=>{let t=e.split(`
19
+ ${O} Command completed successfully. Logs written to:`),console.info(` ${Kr} Latest log: ${xa}`),console.info(` ${Kr} All logs: ${Le}`))}catch(t){console.error("Failed to write logs:",t)}}var Xr,Qo,dF,Nw,Le,Bw,Mw,Lw,xa,qn,Ca,Fa,Jw,Gw,Qr,gd,zn,Kw,u,C=v(()=>{"use strict";Xr=h(require("fs-extra")),Qo=h(require("path")),dF=require("source-map-support/register");Jc();Gc();Zc();te();ie();Ea();W();Nw=oa("webflow-cli"),Le=Nw.log;Bw=hd(process.env.MAX_PERSISTED_LOGS,50),Mw=hd(process.env.MAX_IN_MEMORY_LOGS,1e3),Lw=`${Mn(new Date().toISOString(),{replacement:"_"}).replace(/\./g,"_")}-debug.log`,xa=Qo.default.join(Le,Lw);qn=[],Ca=!1;Jw={succeed:"INFO",fail:"ERROR",warn:"WARN",info:"INFO",neutral:"INFO",update:"INFO"},Gw={succeed:O,fail:F,warn:be,info:Ee,neutral:" ",update:void 0};Qr=!1;process.on("uncaughtException",e=>{Qr||(Qr=!0,Lt(`UNCAUGHT EXCEPTION: ${e?.stack}`),_a(1)),xt.displayGrouped(),xt.stop(),process.exit(1)});process.on("unhandledRejection",e=>{Qr||(Qr=!0,Lt(`UNHANDLED REJECTION: ${e instanceof Error?e.stack:String(e)}`),_a(1)),xt.displayGrouped(),xt.stop(),process.exit(1)});process.on("exit",e=>{Qr||(Qr=!0,_a(e))});gd=!0,zn=e=>{let t=e.split(`
20
20
  `).map(r=>r.length?` ${r}`:r).join(`
21
21
  `);return gd?(gd=!1,`
22
- `+t):t},qw={debug:e=>{let t=md(e);process.env.DEBUG&&console.debug(zn(t))},trace:e=>{let t=md(e);process.env.DEBUG&&console.debug(t)},dir:e=>console.dir(e,{depth:100}),info:e=>console.info(zn(Lw(e))),warn:e=>console.warn(zn(Ww(e)),va),error:(e,t)=>{console.error(zn(Uw(e,t)))},success:e=>console.log(zn(Vw(e))),spinner:Gw},u=qw});async function Zn(e){process.stdout.write(`
23
- `);try{return await e()}catch(t){throw t instanceof Error&&ry.test(t.message)&&(u.debug(t.message),process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&process.stdin.setRawMode(!1),process.exit(130)),t}}async function Ae(e){return ee()?e.default??!1:Zn(()=>Te.confirm({...e,theme:Zw}))}async function Oe(e){if(ee())return"default"in e?e.default:null;let t=e.choices.map(r=>{if(!r||typeof r!="object"||Te.Separator.isSeparator(r)||r.type==="separator")return r;let n=r.name??String(r.value??"");return{...r,name:` ${S(n)}`}});return Zn(()=>Te.select({...e,choices:t,theme:Qw}))}async function Ce(e){return ee()?e.default!==void 0?await e.validate?.(e.default)!==!0?null:e.default:null:Zn(()=>Te.input({...e,theme:Yw}))}async function ti(e){if(ee()){let r=[];return await e.validate?.(r)!==!0?null:r}let t=e.choices.map(r=>{if(!r||typeof r!="object"||r.type==="separator"||Te.Separator.isSeparator(r))return r;let n=r.name??String(r.value??"");return{...r,name:` ${S(n)}`}});return Zn(()=>Te.checkbox({...e,choices:t,theme:ey}))}async function ri(e){if(ee())return"default"in e?e.default:null;let t=(async(r,n)=>(await e.source(r,n)).map(i=>!i||typeof i!="object"||Te.Separator.isSeparator(i)?i:{...i,name:` ${S(i.name??"")}`}));return Zn(()=>Te.search({...e,source:t,theme:ty}))}var Te,Zw,Yw,Kn,bd,Ta,Aa,vd,Xw,Qw,ey,ty,ry,Ie=v(()=>{"use strict";Te=h(require("@inquirer/prompts"));Se();C();ie();Zw={prefix:` ${ce("?")}`,style:{message:(e,t)=>t==="done"?`${Y(e)}
22
+ `+t):t},Kw={debug:e=>{let t=md(e);process.env.DEBUG&&console.debug(zn(t))},trace:e=>{let t=md(e);process.env.DEBUG&&console.debug(t)},dir:e=>console.dir(e,{depth:100}),info:e=>console.info(zn(Ww(e))),warn:e=>console.warn(zn(Uw(e)),va),error:(e,t)=>{console.error(zn(Vw(e,t)))},success:e=>console.log(zn(Hw(e))),spinner:zw},u=Kw});async function Zn(e){process.stdout.write(`
23
+ `);try{return await e()}catch(t){throw t instanceof Error&&ny.test(t.message)&&(u.debug(t.message),process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&process.stdin.setRawMode(!1),process.exit(130)),t}}async function Ae(e){return ee()?e.default??!1:Zn(()=>Te.confirm({...e,theme:Yw}))}async function Oe(e){if(ee())return"default"in e?e.default:null;let t=e.choices.map(r=>{if(!r||typeof r!="object"||Te.Separator.isSeparator(r)||r.type==="separator")return r;let n=r.name??String(r.value??"");return{...r,name:` ${S(n)}`}});return Zn(()=>Te.select({...e,choices:t,theme:ey}))}async function Ce(e){return ee()?e.default!==void 0?await e.validate?.(e.default)!==!0?null:e.default:null:Zn(()=>Te.input({...e,theme:Xw}))}async function ti(e){if(ee()){let r=[];return await e.validate?.(r)!==!0?null:r}let t=e.choices.map(r=>{if(!r||typeof r!="object"||r.type==="separator"||Te.Separator.isSeparator(r))return r;let n=r.name??String(r.value??"");return{...r,name:` ${S(n)}`}});return Zn(()=>Te.checkbox({...e,choices:t,theme:ty}))}async function ri(e){if(ee())return"default"in e?e.default:null;let t=(async(r,n)=>(await e.source(r,n)).map(i=>!i||typeof i!="object"||Te.Separator.isSeparator(i)?i:{...i,name:` ${S(i.name??"")}`}));return Zn(()=>Te.search({...e,source:t,theme:ry}))}var Te,Yw,Xw,Kn,bd,Ta,Aa,vd,Qw,ey,ty,ry,ny,Ie=v(()=>{"use strict";Te=h(require("@inquirer/prompts"));Se();C();ie();Yw={prefix:` ${ce("?")}`,style:{message:(e,t)=>t==="done"?`${Y(e)}
24
24
  `:`${Y(e)}
25
- `,answer:e=>` ${S(e)}`}},Yw={prefix:` ${ce("?")}`,style:{message:e=>`${Y(e)}
25
+ `,answer:e=>` ${S(e)}`}},Xw={prefix:` ${ce("?")}`,style:{message:e=>`${Y(e)}
26
26
  `,answer:e=>S(e)}},Kn=2,bd=1,Ta=(e,t)=>t==="done"?`${Y(e)}
27
- `:Y(e),Aa=e=>` ${S(Ge(e).trim())}`,vd=e=>{let t=Ge(e),r=t.slice(0,Kn),n=t.slice(Kn+1+bd);return ce(`${r} ${n}`)},Xw=e=>{let t=Ge(e),r=t.slice(0,Kn),n=t[Kn+2],o=t.slice(Kn+3+bd);return ce(`${r} ${n} ${o}`)},Qw={prefix:` ${ce("?")}`,style:{message:Ta,answer:Aa,highlight:vd,keysHelpTip:e=>` ${e.map(([t,r])=>`${S(t)} ${S(r)}`).join(" ")}`},icon:{cursor:` ${ce("\u23F5")}`}},ey={prefix:` ${ce("?")}`,style:{message:Ta,answer:Aa,highlight:Xw,keysHelpTip:e=>` ${e.map(([t,r])=>`${S(t)} ${S(r)}`).join(" ")}`},icon:{cursor:` ${ce("\u23F5")}`,checked:` ${R("\u25C9")}`,unchecked:` ${S("\u25EF")}`}},ty={prefix:` ${ce("?")}`,style:{message:Ta,answer:Aa,highlight:vd,searchTerm:e=>ce(e)},icon:{cursor:` ${ce("\u23F5")}`}},ry=/SIGINT/i});function Ft({apiToken:e,siteId:t,directory:r}){let n=Xn.resolve(r?Xn.join(r,".env"):Xn.join(process.cwd(),".env"));r&&!mr.existsSync(r)&&mr.mkdirSync(r,{recursive:!0}),mr.existsSync(n)||mr.writeFileSync(n,`# automatically generated at ${new Date().toISOString()}`,{encoding:"utf8"}),ni.default.config({path:n,quiet:!0}),e&&ni.default.set("WEBFLOW_API_TOKEN",e,{path:n,encrypt:!1}),t&&ni.default.set("WEBFLOW_SITE_ID",t,{path:n,encrypt:!1})}var mr,Xn,ni,kd=v(()=>{"use strict";mr=h(require("fs")),Xn=h(require("path")),ni=h(require("@dotenvx/dotenvx"))});var f,I=v(()=>{"use strict";f=class e extends Error{prefix;skipLogging;isUserError;constructor(t,r){let n=t instanceof Error?t.message:String(t);super(n),this.name="CLIError",this.prefix=r?.prefix,this.skipLogging=r?.skipLogging??!1,this.isUserError=r?.isUserError??(t instanceof e?t.isUserError:!1),t instanceof Error?(this.cause=t,this.stack=t.stack):Error.captureStackTrace&&Error.captureStackTrace(this,e)}}});function Vt(){let e=sy();return gr.default.join(e,iy)}function sy(){if(process.platform==="win32"){let r=process.env.APPDATA??gr.default.join(Ia.default.homedir(),"AppData","Roaming");return gr.default.join(r,"webflow")}let t=process.env.XDG_CONFIG_HOME??gr.default.join(Ia.default.homedir(),".config");return gr.default.join(t,"webflow")}function Qn(){let e=Vt();try{if(!Ut.default.existsSync(e))return null;let t=Ut.default.readFileSync(e,"utf8");return JSON.parse(t)}catch{return null}}function $a(e){let t=Vt(),r=gr.default.dirname(t);Ut.default.existsSync(r)||Ut.default.mkdirSync(r,{recursive:!0,mode:448}),Ut.default.writeFileSync(t,JSON.stringify(e,null,2),{encoding:"utf8",mode:384})}function Ra(){let e=Vt();try{Ut.default.existsSync(e)&&Ut.default.unlinkSync(e)}catch{}}var Ut,Ia,gr,iy,Pa=v(()=>{"use strict";Ut=h(require("fs")),Ia=h(require("os")),gr=h(require("path")),iy="auth.json"});var eo,ja=v(()=>{"use strict";se();eo={serverUrl:Zr,timeoutMs:300*1e3}});var Sd,Td,Ad,Od,ay,Id,ly,$d,Rd=v(()=>{"use strict";Sd=require("crypto"),Td=h(require("open"));ja();C();ft();Ad=e=>{let t=new Uint8Array(e);return Sd.webcrypto.getRandomValues(t),Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")},Od=({pollId:e,clientId:t,scope:r})=>`${eo.serverUrl}/oauth/webflow/initiate?pollId=${e}&clientId=${t}&scope=${encodeURIComponent(r.join(" "))}`,ay=e=>`${eo.serverUrl}/oauth/webflow/poll?pollId=${e}`,Id=async e=>{let t=u.spinner("Browser opened for authentication");try{await new Promise(r=>setTimeout(r,3e3)),await(0,Td.default)(e),t.succeed()}catch{t.fail(),u.warn(`Could not automatically open browser. Please open this URL manually: ${e}`)}},ly=async e=>{let t=ay(e),r=await K(t);if(!r.ok){let n=`Failed to poll for authentication status (${r.status})`;try{let o=await r.json();o&&o.error&&(n+=`: ${o.error}`)}catch{}throw new Error(n)}return r.json()},$d=(e,t)=>{let r=u.spinner("Waiting");return new Promise((n,o)=>{let i=setTimeout(()=>{clearTimeout(i),clearInterval(s),o(new Error("Authentication timed out. Please try again."))},t),s=setInterval(async()=>{try{let a=await ly(e);a.status==="success"&&a.accessToken?(clearTimeout(i),clearInterval(s),r.succeed("Authentication successful! You can close the browser window."),n(a.accessToken)):a.status==="error"&&(clearTimeout(i),clearInterval(s),r.fail("Authentication failed"),o(new Error(a.error||"Authentication failed")))}catch(a){clearTimeout(i),clearInterval(s),r.fail("Authentication failed"),o(a instanceof Error?a:new Error(String(a)))}},2e3)})}});function to(){if(process.env.WEBFLOW_API_TOKEN)return process.env.WEBFLOW_API_TOKEN;let e=Qn();if(e?.accessToken)return e.accessToken;let t=process.env.WEBFLOW_WORKSPACE_API_TOKEN??process.env.WEBFLOW_SITE_API_TOKEN??null;return t&&!Pd&&(Pd=!0,u.warn(`${be} WEBFLOW_SITE_API_TOKEN / WEBFLOW_WORKSPACE_API_TOKEN are deprecated. Please use WEBFLOW_API_TOKEN instead. Run ${R("webflow auth login --force")} to update your .env file.`)),t}async function $(e){if(e?.apiToken&&!e.force)return e.apiToken;if(!e?.force){let n=to();if(n)return n}if(ee())throw new f(`No API token found. To authenticate in CI/CD environments:
27
+ `:Y(e),Aa=e=>` ${S(Ge(e).trim())}`,vd=e=>{let t=Ge(e),r=t.slice(0,Kn),n=t.slice(Kn+1+bd);return ce(`${r} ${n}`)},Qw=e=>{let t=Ge(e),r=t.slice(0,Kn),n=t[Kn+2],o=t.slice(Kn+3+bd);return ce(`${r} ${n} ${o}`)},ey={prefix:` ${ce("?")}`,style:{message:Ta,answer:Aa,highlight:vd,keysHelpTip:e=>` ${e.map(([t,r])=>`${S(t)} ${S(r)}`).join(" ")}`},icon:{cursor:` ${ce("\u23F5")}`}},ty={prefix:` ${ce("?")}`,style:{message:Ta,answer:Aa,highlight:Qw,keysHelpTip:e=>` ${e.map(([t,r])=>`${S(t)} ${S(r)}`).join(" ")}`},icon:{cursor:` ${ce("\u23F5")}`,checked:` ${R("\u25C9")}`,unchecked:` ${S("\u25EF")}`}},ry={prefix:` ${ce("?")}`,style:{message:Ta,answer:Aa,highlight:vd,searchTerm:e=>ce(e)},icon:{cursor:` ${ce("\u23F5")}`}},ny=/SIGINT/i});function Ft({apiToken:e,siteId:t,directory:r}){let n=Xn.resolve(r?Xn.join(r,".env"):Xn.join(process.cwd(),".env"));r&&!mr.existsSync(r)&&mr.mkdirSync(r,{recursive:!0}),mr.existsSync(n)||mr.writeFileSync(n,`# automatically generated at ${new Date().toISOString()}`,{encoding:"utf8"}),ni.default.config({path:n,quiet:!0}),e&&ni.default.set("WEBFLOW_API_TOKEN",e,{path:n,encrypt:!1}),t&&ni.default.set("WEBFLOW_SITE_ID",t,{path:n,encrypt:!1})}var mr,Xn,ni,kd=v(()=>{"use strict";mr=h(require("fs")),Xn=h(require("path")),ni=h(require("@dotenvx/dotenvx"))});var f,I=v(()=>{"use strict";f=class e extends Error{prefix;skipLogging;isUserError;constructor(t,r){let n=t instanceof Error?t.message:String(t);super(n),this.name="CLIError",this.prefix=r?.prefix,this.skipLogging=r?.skipLogging??!1,this.isUserError=r?.isUserError??(t instanceof e?t.isUserError:!1),t instanceof Error?(this.cause=t,this.stack=t.stack):Error.captureStackTrace&&Error.captureStackTrace(this,e)}}});function Vt(){let e=ay();return gr.default.join(e,sy)}function ay(){if(process.platform==="win32"){let r=process.env.APPDATA??gr.default.join(Ia.default.homedir(),"AppData","Roaming");return gr.default.join(r,"webflow")}let t=process.env.XDG_CONFIG_HOME??gr.default.join(Ia.default.homedir(),".config");return gr.default.join(t,"webflow")}function Qn(){let e=Vt();try{if(!Ut.default.existsSync(e))return null;let t=Ut.default.readFileSync(e,"utf8");return JSON.parse(t)}catch{return null}}function $a(e){let t=Vt(),r=gr.default.dirname(t);Ut.default.existsSync(r)||Ut.default.mkdirSync(r,{recursive:!0,mode:448}),Ut.default.writeFileSync(t,JSON.stringify(e,null,2),{encoding:"utf8",mode:384})}function Ra(){let e=Vt();try{Ut.default.existsSync(e)&&Ut.default.unlinkSync(e)}catch{}}var Ut,Ia,gr,sy,Pa=v(()=>{"use strict";Ut=h(require("fs")),Ia=h(require("os")),gr=h(require("path")),sy="auth.json"});var eo,ja=v(()=>{"use strict";se();eo={serverUrl:Zr,timeoutMs:300*1e3}});var Sd,Td,Ad,Od,ly,Id,uy,$d,Rd=v(()=>{"use strict";Sd=require("crypto"),Td=h(require("open"));ja();C();ft();Ad=e=>{let t=new Uint8Array(e);return Sd.webcrypto.getRandomValues(t),Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")},Od=({pollId:e,clientId:t,scope:r})=>`${eo.serverUrl}/oauth/webflow/initiate?pollId=${e}&clientId=${t}&scope=${encodeURIComponent(r.join(" "))}`,ly=e=>`${eo.serverUrl}/oauth/webflow/poll?pollId=${e}`,Id=async e=>{let t=u.spinner("Browser opened for authentication");try{await new Promise(r=>setTimeout(r,3e3)),await(0,Td.default)(e),t.succeed()}catch{t.fail(),u.warn(`Could not automatically open browser. Please open this URL manually: ${e}`)}},uy=async e=>{let t=ly(e),r=await K(t);if(!r.ok){let n=`Failed to poll for authentication status (${r.status})`;try{let o=await r.json();o&&o.error&&(n+=`: ${o.error}`)}catch{}throw new Error(n)}return r.json()},$d=(e,t)=>{let r=u.spinner("Waiting");return new Promise((n,o)=>{let i=setTimeout(()=>{clearTimeout(i),clearInterval(s),o(new Error("Authentication timed out. Please try again."))},t),s=setInterval(async()=>{try{let a=await uy(e);a.status==="success"&&a.accessToken?(clearTimeout(i),clearInterval(s),r.succeed("Authentication successful! You can close the browser window."),n(a.accessToken)):a.status==="error"&&(clearTimeout(i),clearInterval(s),r.fail("Authentication failed"),o(new Error(a.error||"Authentication failed")))}catch(a){clearTimeout(i),clearInterval(s),r.fail("Authentication failed"),o(a instanceof Error?a:new Error(String(a)))}},2e3)})}});function to(){if(process.env.WEBFLOW_API_TOKEN)return process.env.WEBFLOW_API_TOKEN;let e=Qn();if(e?.accessToken)return e.accessToken;let t=process.env.WEBFLOW_WORKSPACE_API_TOKEN??process.env.WEBFLOW_SITE_API_TOKEN??null;return t&&!Pd&&(Pd=!0,u.warn(`${be} WEBFLOW_SITE_API_TOKEN / WEBFLOW_WORKSPACE_API_TOKEN are deprecated. Please use WEBFLOW_API_TOKEN instead. Run ${R("webflow auth login --force")} to update your .env file.`)),t}async function $(e){if(e?.apiToken&&!e.force)return e.apiToken;if(!e?.force){let n=to();if(n)return n}if(ee())throw new f(`No API token found. To authenticate in CI/CD environments:
28
28
  1. Generate a Workspace API token in your Webflow Dashboard > Apps & Integrations > Manage > Workspace API Token
29
- 2. Set it as the WEBFLOW_API_TOKEN environment variable in your CI/CD pipeline`);let t=Ad(16),r=uy();try{let n=Od({pollId:t,clientId:r,scope:Na});await Id(n);let o=await $d(t,eo.timeoutMs);return $a({accessToken:o,scopes:Na,createdAt:new Date().toISOString()}),u.info(`${O} Credentials saved: ${Vt()}`),o}catch(n){throw new f(n)}}function uy(){return"fbab9abdbeeb35bb2554a1b83b8bd060d719f22eca26ff9119b87608c87c0074"}var Na,Pd,Ba=v(()=>{"use strict";Se();C();W();I();Pa();ja();Rd();ie();Na=["assets:read","assets:write","authorized_user:read","cloud_apps:write","cms:read","cms:write","code_components:read","code_components:write","devlink_export:read","forms:read","sites:read","sites:write","workspace:read"],Pd=!1});function ro(e){return e.siteId?e.siteId:process.env.WEBFLOW_SITE_ID??null}async function no(e){try{let r=await new jd.WebflowClient({accessToken:e,environment:{base:`${_}/v2`,dataApi:`${_}/v2`,contentDeliveryApi:`${Xo}/v2`}}).sites.list();if(!r||typeof r!="object"||!r.sites||!Array.isArray(r.sites))throw new f("Invalid response from Webflow API");let n=r.sites.map(o=>({id:o.id,displayName:o.displayName??"",shortName:o.shortName||(o.displayName??"").toLowerCase().replace(/\s+/g,"-"),lastUpdated:o.lastUpdated??null}));return n.sort((o,i)=>o.displayName.localeCompare(i.displayName)),n}catch(t){throw new f(t,{prefix:`Failed to fetch Webflow sites. Please check your authorization.
29
+ 2. Set it as the WEBFLOW_API_TOKEN environment variable in your CI/CD pipeline`);let t=Ad(16),r=cy();try{let n=Od({pollId:t,clientId:r,scope:Na});await Id(n);let o=await $d(t,eo.timeoutMs);return $a({accessToken:o,scopes:Na,createdAt:new Date().toISOString()}),u.info(`${O} Credentials saved: ${Vt()}`),o}catch(n){throw new f(n)}}function cy(){return"fbab9abdbeeb35bb2554a1b83b8bd060d719f22eca26ff9119b87608c87c0074"}var Na,Pd,Ba=v(()=>{"use strict";Se();C();W();I();Pa();ja();Rd();ie();Na=["assets:read","assets:write","authorized_user:read","cloud_apps:write","cms:read","cms:write","code_components:read","code_components:write","devlink_export:read","forms:read","sites:read","sites:write","workspace:read"],Pd=!1});function ro(e){return e.siteId?e.siteId:process.env.WEBFLOW_SITE_ID??null}async function no(e){try{let r=await new jd.WebflowClient({accessToken:e,environment:{base:`${_}/v2`,dataApi:`${_}/v2`,contentDeliveryApi:`${Xo}/v2`}}).sites.list();if(!r||typeof r!="object"||!r.sites||!Array.isArray(r.sites))throw new f("Invalid response from Webflow API");let n=r.sites.map(o=>({id:o.id,displayName:o.displayName??"",shortName:o.shortName||(o.displayName??"").toLowerCase().replace(/\s+/g,"-"),lastUpdated:o.lastUpdated??null}));return n.sort((o,i)=>o.displayName.localeCompare(i.displayName)),n}catch(t){throw new f(t,{prefix:`Failed to fetch Webflow sites. Please check your authorization.
30
30
  `})}}async function Ma(e){let t=e.map(n=>({name:`${n.displayName} (${n.shortName})`,value:n})),r=await ri({message:"Search for a Webflow site:",source:n=>{if(!n)return t;let o=n.toLowerCase();return t.filter(i=>i.value.displayName.toLowerCase().includes(o)||i.value.shortName.toLowerCase().includes(o))},pageSize:15});if(!r){if(e.length===0)throw new f("No sites available for selection");return u.warn(`Auto fallback to first site: ${e[0].displayName}`),e[0]}return r}var jd,oi=v(()=>{"use strict";jd=require("webflow-api");Ie();C();se();se();I()});var hr,Ht,La=v(()=>{"use strict";I();hr=class extends f{constructor(t){super(t),this.name="NoWebflowSitesError"}},Ht=class extends f{constructor(t){super(t),this.name="NoWebflowWorkspacesError"}}});async function he(e,t){let r=t?.site??ro(e);if(ee()&&!r)throw new f(`No site ID configured for this project.
31
31
  Run ${R("webflow auth login")} locally to authenticate and associate this project with a Webflow site,
32
- or provide --site and --api-token when running a CLI command`);let n=await $({apiToken:t?.apiToken,force:t?.force});if(!r||t?.force){let o=await no(n);if(o.length===0)throw new hr("No Webflow sites found in your account. Please make sure you have at least one authorized site in your Webflow account");let i=o.length>1?await Ma(o):o[0];r=i.id;let s=ue({siteId:r});return e.siteId=s.siteId,u.info(`${O} Site ID updated in webflow.json`),{siteId:r,siteName:i.displayName,accessToken:n}}return{siteId:r,accessToken:n}}var Nd=v(()=>{"use strict";De();Se();Ba();oi();I();La();W();ie();C()});async function Wa(e){let t=new Bd.WebflowClient({accessToken:e,environment:{base:`${_}/v2`,dataApi:`${_}/v2`}});try{return await t.token.authorizedBy()}catch{return null}}var Bd,Md=v(()=>{"use strict";Bd=require("webflow-api");se()});var re=v(()=>{"use strict";kd();Ba();Nd();oi();oi();Pa();Md();La()});function Ey(e,t){if(e.includes("..")||at.isAbsolute(e))throw new Error(`Invalid file path: "${e}" - path traversal not allowed`);let r=at.resolve(t,e),n=at.resolve(t);if(!r.startsWith(n+at.sep)&&r!==n)throw new Error(`Invalid file path: "${e}" - resolves outside root directory`)}async function hi(e,t,r){let n=at.join(process.cwd(),t);r&&(0,Gt.existsSync)(n)&&await(0,gi.rm)(n,{recursive:!0,force:!0}),(0,Gt.existsSync)(n)||await(0,gi.mkdir)(n);for(let o of e){Ey(o.path,n);let i=xy(n,o.path);if(o.path.includes("/")){let s=o.path.substring(0,o.path.lastIndexOf("/"));Fy(n,s)}(0,Gt.writeFileSync)(i,o.content,{flag:"w+"})}}function xy(e,t){return at.join(e,...t.split("/"))}function Fy(e,t){let r=t.split("/"),n=e;for(let o of r)n=at.join(n,o),(0,Gt.existsSync)(n)||(0,Gt.mkdirSync)(n)}var Gt,gi,at,Xa=v(()=>{"use strict";Gt=require("fs"),gi=require("fs/promises"),at=h(require("path"))});function yi(e){for(let t of e??[]){let r=u[t.status]??u.info,n=Sy[t.status]??Ee;r(`
33
- ${n} ${t.content}`)}}var Sy,tl=v(()=>{"use strict";C();W();Sy={info:Ee,warn:be,success:O}});function nl(e){let{manifestPath:t}=J();return(0,xf.writeFileSync)(t,JSON.stringify(e,null,2),"utf-8"),e}var xf,Ff=v(()=>{"use strict";xf=require("fs");Ln()});function Di(e,t){try{let r=ol(),n=il(Object.values(e)),o=t?.force;return n&&r&&!o}catch{return!1}}var Cf,_f,ol,il,bi=v(()=>{"use strict";Cf=require("path"),_f=require("fs-extra");ol=()=>{try{return(0,_f.existsSync)((0,Cf.join)(process.cwd(),"tsconfig.json"))}catch{return!1}},il=e=>e.some(t=>t.endsWith(".ts")||t.endsWith(".tsx"))});function Ty(e){let{export:t,...r}=e;return t?r["devlink-export"]!=null?(nl(r),r):(u.warn(`${be} The 'export' key in webflow.json is deprecated. Use 'devlink-export' instead. Your configuration will be migrated automatically.`),r["devlink-export"]={...t},nl(r),r):r}function Tf(e,t){try{new RegExp(e)}catch{throw new f(`Invalid '${t}' regex '${e}' in webflow.json. Fix the value and re-run the export.`,{isUserError:!0})}}async function Of(e){e=Ty(e);let t=e["devlink-export"]||{},r=!1,n=t.rootDir;n||(ee()?n=kf:(r=!0,n=await Ce({message:"Enter the root directory for exported components:",default:kf,validate:d=>!d||d.trim()===""?"Root directory is required":!0})));let o=t.ts;o===void 0&&(Iy()?o=!0:ee()?o=!1:(r=!0,o=await Ae({message:"Use TypeScript?",default:!0})));let i=t.cssScopes;i===void 0&&(ee()?i=Sf:(r=!0,i=await Ae({message:"Use DevLink style isolation (scoped wrapper + @scope)?",default:Sf}))),t.components&&Tf(t.components,"components"),t.componentGroups&&Tf(t.componentGroups,"componentGroups");let s=t.components,a=t.componentGroups;!s&&!a&&(ee()?(s=vi,a=Ei):(r=!0,await Ae({message:"Do you want to export all components?",default:!0})?(s=vi,a=Ei):(s=await Ce({message:"Enter regex pattern to filter components (e.g., 'Button|Card' for specific):",default:vi,validate:p=>{try{return new RegExp(p),!0}catch{return"Invalid regex pattern. Please enter a valid regular expression."}}}),a=await Ce({message:"Enter regex pattern to filter component groups (e.g., 'mygroup'):",default:Ei,validate:p=>{try{return new RegExp(p),!0}catch{return"Invalid regex pattern. Please enter a valid regular expression."}}})))),s=s||vi,a=a||Ei;let l=t.relativeHrefRoot;l===void 0&&(l=Ay);let c={...t,rootDir:n,components:s,componentGroups:a,ts:o,cssScopes:i,relativeHrefRoot:l};return(!t.rootDir||t.ts===void 0||t.cssScopes===void 0||!t.components||!t.componentGroups||t.relativeHrefRoot===void 0)&&Oy(c),{config:c,wasPrompted:r}}function Oy(e){ue({"devlink-export":{...e}}),u.info(`${O} Devlink Export configuration updated in webflow.json`)}function Iy(){try{let e=process.cwd();if(ol())return!0;let t=["src","app","pages","components"];for(let r of t){let n=Af.join(e,r);if(xi.existsSync(n)&&il(xi.readdirSync(n)))return!0}}catch{}return!1}var xi,Af,kf,vi,Ei,Sf,Ay,If=v(()=>{"use strict";xi=h(require("fs")),Af=h(require("path"));Ie();Se();C();W();I();da();Ff();bi();kf="./webflow",vi=".*",Ei=".*",Sf=!0,Ay="/"});function yr(e){let t=e;for(let r=0;r<8&&t instanceof Error;r+=1){if(t.code===al)return!0;t=t.cause}return!1}async function Pf(e){if(e.ok)return;let t=await e.text().catch(()=>"");u.debug(`Server error response (HTTP ${e.status}): ${t||"<empty>"}`);let r,n;try{let o=JSON.parse(t);r=o.message,n=o.code}catch{}throw new so(r||`Request failed (HTTP ${e.status}).`,{code:n})}async function ll(e,t,r,n){let o=await $y(r,n,t,e);if(!o.files||!Array.isArray(o.files))throw new f("Invalid response format from V2 API: expected 'files' array");return{files:o.files,messages:o.messages,metadata:o.metadata}}async function $y(e,t,r,n){let{taskId:o,polling:i}=await Ry(e,t,r,n);return Py(e,t,r,o,i)}async function Ry(e,t,r,n){let o=await(0,sl.default)(`${_}/v2/devlink/${e}/export`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json",[Rf]:t},body:JSON.stringify(n),timeout:6e4});return o.ok||await Pf(o),await o.json()}async function Py(e,t,r,n,o){let{initialDelayMs:i,maxBackoffMs:s,backoffMultiplier:a,timeoutMs:l}=o,c=Date.now()+l,d=i;do{let p=await(0,sl.default)(`${_}/v2/devlink/${e}/export/${n}`,{headers:{Authorization:`Bearer ${r}`,[Rf]:t},timeout:6e4});p.ok||await Pf(p);let m=await p.json();if(m.status==="finished")return m.result;if(m.status==="failed")throw new so("The export task failed. Please try again or report a bug.");await(0,$f.setTimeout)(d),d=Math.min(d*a,s)}while(Date.now()<c);throw new so(`Export task timed out after ${l}ms. Please try again.`)}var sl,$f,Rf,al,so,ul=v(()=>{"use strict";sl=h(require("node-fetch")),$f=require("timers/promises");C();se();I();Rf="X-WF-Sync-Id",al="devlink_export_not_entitled",so=class extends Error{code;constructor(t,r){super(t),this.code=r?.code}}});var jf,Nf=v(()=>{"use strict";Ie();C();jf=async(e,t)=>{if(!t)return;await Ae({message:`Ready to export components to ${e.rootDir}?`,default:!0})||(u.info("Export cancelled."),process.exit(0))}});function Bf(e,t,r){let i=new Intl.PluralRules("en-US").select(e)==="one"&&e===1?t:r||`${t}s`;return`${e} ${i}`}var Mf=v(()=>{"use strict"});async function Fi(e){let t=Date.now(),r;try{let{manifest:n}=J(),{siteId:o,accessToken:i}=await he(n,e),s=(0,Lf.randomUUID)();wd(s);let{config:a,wasPrompted:l}=await Of(n);u.info(`${O} Export configuration loaded!`),await jf(a,l);let c=A.forExport({authToken:i,siteId:o});r=u.spinner("Exporting components"),await c.sendUsage("devlink_export_start",{cssScopes:a.cssScopes,ts:a.ts,relativeHrefRoot:a.relativeHrefRoot});try{let{files:d,messages:p,metadata:m}=await ll(a,i,o,s),g=m.exportCoverage==="full";await hi(d,a.rootDir,g),r.succeed(`${Bf(m.componentCount,"component")} exported to ${a.rootDir}`),yi(p);let y=Date.now()-t;await c.sendUsage("devlink_export_success",{duration:y,cssScopes:a.cssScopes,ts:a.ts,relativeHrefRoot:a.relativeHrefRoot})}catch(d){let p=d instanceof Error?d.message:String(d);throw e?.silentNotEntitled&&yr(d)?r.stop():r.fail(`Components export failed: ${p}`),await c.sendError(d instanceof Error?d:new Error(String(d)),"devlink_export_failure",{cssScopes:a.cssScopes,ts:a.ts}),d}}catch(n){if(!(e?.silentNotEntitled&&yr(n))){let i="Export failed: "+(n instanceof Error?n.message:n);r?r.fail(i):u.error(i,{prefix:`
34
- `+F})}throw new f(n,{skipLogging:!0})}}var Lf,Wf=v(()=>{"use strict";Lf=require("crypto");If();ul();Nf();te();re();De();Mf();C();I();Xa();W();tl()});var Uf={};zu(Uf,{DEVLINK_EXPORT_NOT_ENTITLED_CODE:()=>al,exportComponents:()=>Fi,isDevlinkNotEntitledError:()=>yr});var Ci=v(()=>{"use strict";Wf();ul()});var qu=Symbol.for("@webflow/webflow-cli/suppress-deprecation");function Ih(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.code==="DEP0040"&&typeof t.message=="string"&&t.message.includes("punycode")}function $h(e=process){if(e[qu])return;e[qu]=!0;let t=e.emit;e.emit=function(n,...o){return n==="warning"&&Ih(o[0])?!1:t.call(this,n,...o)}}$h();var Eh=require("commander");var Dh=require("commander");ie();C();var yd=require("child_process"),Dd=require("fs"),ka=h(require("semver"));C();var Sa="@webflow/webflow-cli",dr="@webflow/data-types",ei="@webflow/react",Kw=[Sa,dr,ei],fr=class{getInstalledDependencies(){try{let t=(0,yd.execSync)(`npm ls ${Kw.join(" ")} --depth=0 --json --silent`,{encoding:"utf-8"}),r=JSON.parse(t);return r.dependencies?Object.entries(r.dependencies).reduce((n,[o,{version:i}])=>(n[o]=i,n),{}):{}}catch(t){return u.debug(`Failed to get installed dependencies: ${t}`),{}}}getRequiredDependencies(t){let r=JSON.parse((0,Dd.readFileSync)(require.resolve(`${t}/package.json`),"utf8"));return{...r.dependencies,...r.devDependencies}}checkCLIAndDataTypes(t){let r=t[dr];if(!r)return;let o=this.getRequiredDependencies(Sa)[dr];if(!ka.default.satisfies(r,o))throw new Error(`Version mismatch: ${Sa} requires ${dr} v${o} but found v${r}`)}checkReactAndDataTypes(t){let r=t[dr],n=t[ei];if(!(!r||!n)&&!ka.default.eq(r,n))throw new Error(`Version mismatch: ${ei} and ${dr} must be on the same version. Found ${ei}@${n} and ${dr}@${r}`)}run(){let t=this.getInstalledDependencies();this.checkCLIAndDataTypes(t),this.checkReactAndDataTypes(t)}};var Cd=require("fs-extra");Ie();var _d=require("@dotenvx/dotenvx"),pr=h(require("semver"));C();var Ed=require("child_process"),xd=require("util"),ny=(0,xd.promisify)(Ed.exec);async function Wt(e,t){try{let{stdout:r,stderr:n}=await ny(e,t);return{stdout:r.toString().trim(),stderr:n.toString().trim(),code:0}}catch(r){let n=r;return{stdout:n.stdout??"",stderr:n.stderr??String(n.message??""),code:n.code??1}}}Se();var Oa=h(Zo());W();ie();(0,_d.config)({quiet:!0,ignore:["MISSING_ENV_FILE"]});var Fd={npm:{updateCommand:"npm install",update:async e=>await Wt(`npm install ${e}`),getOutdated:async e=>{let{stdout:t}=await Wt(`npm outdated --json ${e}`);return JSON.parse(t)},lockFile:"package-lock.json",globalFlag:"--global",supported:!0},pnpm:{updateCommand:"pnpm add",update:async e=>await Wt(`pnpm add ${e}`),getOutdated:async e=>{let{stdout:t}=await Wt(`pnpm outdated --json ${e}`);return JSON.parse(t)},lockFile:"pnpm-lock.yaml",globalFlag:"--global",supported:!0},yarn:{lockFile:"yarn.lock",globalFlag:"",updateCommand:"",getOutdated:async()=>({}),update:async()=>({stdout:"",stderr:"",code:0}),supported:!1}},oy=["@webflow/webflow-cli","@webflow/data-types","@webflow/react","@webflow/emotion-utils","@webflow/styled-components-utils"],Yn=class{packageManager;constructor(){this.packageManager=this.getPackagerManagerInfo()}getPackagerManagerInfo(){for(let[,t]of Object.entries(Fd))if((0,Cd.existsSync)(t.lockFile))return t;return Fd.npm}async listOutdatedPackages(t="local",r=oy){let{getOutdated:n,globalFlag:o}=this.packageManager,i=await n(`${t==="global"?o:""} ${r?.join(" ")}`);return Object.fromEntries(Object.entries(i).map(([s,a])=>Array.isArray(a)?[s,{current:a[0].current,latest:a[0].latest,installationType:t}]:[s,{current:a.current,latest:a.latest,installationType:t}]))}async getOutdatedPackages(){let t=await this.listOutdatedPackages();if(t["@webflow/webflow-cli"])return t;let r=await this.listOutdatedPackages("global",["@webflow/webflow-cli"]);return{...t,...r}}async showUpdatePrompt(t){let r={name:"Update all packages",value:"update-all"},n=Object.entries(t).map(([i,{current:s,latest:a}])=>({name:`${i} (${s} ${Fe} ${a})`,value:i})),o=await ti({message:`New versions of the following ${ce("@webflow")} packages are available. Would you like to update them?`,choices:[r,...n]});return o==null?[]:o.includes("update-all")?Object.keys(t):o}showUpdateSuggestions(t){let{updateCommand:r,globalFlag:n}=this.packageManager;u.info(`${Ee} New versions of the following ${ce("@webflow")} packages are available:`),Object.entries(t).forEach(([s,{current:a,latest:l}])=>{u.info(S(` ${Yo} ${s} (${a} ${Fe} ${l})`))});let o=Object.entries(t).filter(([,{installationType:s}])=>s==="local").map(([s])=>`${s}@latest`),i=Object.entries(t).filter(([,{installationType:s}])=>s==="global").map(([s])=>`${s}@latest`);u.info(`
32
+ or provide --site and --api-token when running a CLI command`);let n=await $({apiToken:t?.apiToken,force:t?.force});if(!r||t?.force){let o=await no(n);if(o.length===0)throw new hr("No Webflow sites found in your account. Please make sure you have at least one authorized site in your Webflow account");let i=o.length>1?await Ma(o):o[0];r=i.id;let s=ue({siteId:r});return e.siteId=s.siteId,u.info(`${O} Site ID updated in webflow.json`),{siteId:r,siteName:i.displayName,accessToken:n}}return{siteId:r,accessToken:n}}var Nd=v(()=>{"use strict";De();Se();Ba();oi();I();La();W();ie();C()});async function Wa(e){let t=new Bd.WebflowClient({accessToken:e,environment:{base:`${_}/v2`,dataApi:`${_}/v2`}});try{return await t.token.authorizedBy()}catch{return null}}var Bd,Md=v(()=>{"use strict";Bd=require("webflow-api");se()});var re=v(()=>{"use strict";kd();Ba();Nd();oi();oi();Pa();Md();La()});function xy(e,t){if(e.includes("..")||at.isAbsolute(e))throw new Error(`Invalid file path: "${e}" - path traversal not allowed`);let r=at.resolve(t,e),n=at.resolve(t);if(!r.startsWith(n+at.sep)&&r!==n)throw new Error(`Invalid file path: "${e}" - resolves outside root directory`)}async function hi(e,t,r){let n=at.join(process.cwd(),t);r&&(0,Gt.existsSync)(n)&&await(0,gi.rm)(n,{recursive:!0,force:!0}),(0,Gt.existsSync)(n)||await(0,gi.mkdir)(n);for(let o of e){xy(o.path,n);let i=Fy(n,o.path);if(o.path.includes("/")){let s=o.path.substring(0,o.path.lastIndexOf("/"));Cy(n,s)}(0,Gt.writeFileSync)(i,o.content,{flag:"w+"})}}function Fy(e,t){return at.join(e,...t.split("/"))}function Cy(e,t){let r=t.split("/"),n=e;for(let o of r)n=at.join(n,o),(0,Gt.existsSync)(n)||(0,Gt.mkdirSync)(n)}var Gt,gi,at,Xa=v(()=>{"use strict";Gt=require("fs"),gi=require("fs/promises"),at=h(require("path"))});function yi(e){for(let t of e??[]){let r=u[t.status]??u.info,n=Ty[t.status]??Ee;r(`
33
+ ${n} ${t.content}`)}}var Ty,tl=v(()=>{"use strict";C();W();Ty={info:Ee,warn:be,success:O}});function nl(e){let{manifestPath:t}=J();return(0,xf.writeFileSync)(t,JSON.stringify(e,null,2),"utf-8"),e}var xf,Ff=v(()=>{"use strict";xf=require("fs");Ln()});function Di(e,t){try{let r=ol(),n=il(Object.values(e)),o=t?.force;return n&&r&&!o}catch{return!1}}var Cf,_f,ol,il,bi=v(()=>{"use strict";Cf=require("path"),_f=require("fs-extra");ol=()=>{try{return(0,_f.existsSync)((0,Cf.join)(process.cwd(),"tsconfig.json"))}catch{return!1}},il=e=>e.some(t=>t.endsWith(".ts")||t.endsWith(".tsx"))});function Ay(e){let{export:t,...r}=e;return t?r["devlink-export"]!=null?(nl(r),r):(u.warn(`${be} The 'export' key in webflow.json is deprecated. Use 'devlink-export' instead. Your configuration will be migrated automatically.`),r["devlink-export"]={...t},nl(r),r):r}function Tf(e,t){try{new RegExp(e)}catch{throw new f(`Invalid '${t}' regex '${e}' in webflow.json. Fix the value and re-run the export.`,{isUserError:!0})}}async function Of(e){e=Ay(e);let t=e["devlink-export"]||{},r=!1,n=t.rootDir;n||(ee()?n=kf:(r=!0,n=await Ce({message:"Enter the root directory for exported components:",default:kf,validate:d=>!d||d.trim()===""?"Root directory is required":!0})));let o=t.ts;o===void 0&&($y()?o=!0:ee()?o=!1:(r=!0,o=await Ae({message:"Use TypeScript?",default:!0})));let i=t.cssScopes;i===void 0&&(ee()?i=Sf:(r=!0,i=await Ae({message:"Use DevLink style isolation (scoped wrapper + @scope)?",default:Sf}))),t.components&&Tf(t.components,"components"),t.componentGroups&&Tf(t.componentGroups,"componentGroups");let s=t.components,a=t.componentGroups;!s&&!a&&(ee()?(s=vi,a=Ei):(r=!0,await Ae({message:"Do you want to export all components?",default:!0})?(s=vi,a=Ei):(s=await Ce({message:"Enter regex pattern to filter components (e.g., 'Button|Card' for specific):",default:vi,validate:p=>{try{return new RegExp(p),!0}catch{return"Invalid regex pattern. Please enter a valid regular expression."}}}),a=await Ce({message:"Enter regex pattern to filter component groups (e.g., 'mygroup'):",default:Ei,validate:p=>{try{return new RegExp(p),!0}catch{return"Invalid regex pattern. Please enter a valid regular expression."}}})))),s=s||vi,a=a||Ei;let l=t.relativeHrefRoot;l===void 0&&(l=Oy);let c={...t,rootDir:n,components:s,componentGroups:a,ts:o,cssScopes:i,relativeHrefRoot:l};return(!t.rootDir||t.ts===void 0||t.cssScopes===void 0||!t.components||!t.componentGroups||t.relativeHrefRoot===void 0)&&Iy(c),{config:c,wasPrompted:r}}function Iy(e){ue({"devlink-export":{...e}}),u.info(`${O} Devlink Export configuration updated in webflow.json`)}function $y(){try{let e=process.cwd();if(ol())return!0;let t=["src","app","pages","components"];for(let r of t){let n=Af.join(e,r);if(xi.existsSync(n)&&il(xi.readdirSync(n)))return!0}}catch{}return!1}var xi,Af,kf,vi,Ei,Sf,Oy,If=v(()=>{"use strict";xi=h(require("fs")),Af=h(require("path"));Ie();Se();C();W();I();da();Ff();bi();kf="./webflow",vi=".*",Ei=".*",Sf=!0,Oy="/"});function yr(e){let t=e;for(let r=0;r<8&&t instanceof Error;r+=1){if(t.code===al)return!0;t=t.cause}return!1}async function Pf(e){if(e.ok)return;let t=await e.text().catch(()=>"");u.debug(`Server error response (HTTP ${e.status}): ${t||"<empty>"}`);let r,n;try{let o=JSON.parse(t);r=o.message,n=o.code}catch{}throw new so(r||`Request failed (HTTP ${e.status}).`,{code:n})}async function ll(e,t,r,n){let o=await Ry(r,n,t,e);if(!o.files||!Array.isArray(o.files))throw new f("Invalid response format from V2 API: expected 'files' array");return{files:o.files,messages:o.messages,metadata:o.metadata}}async function Ry(e,t,r,n){let{taskId:o,polling:i}=await Py(e,t,r,n);return jy(e,t,r,o,i)}async function Py(e,t,r,n){let o=await(0,sl.default)(`${_}/v2/devlink/${e}/export`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json",[Rf]:t},body:JSON.stringify(n),timeout:6e4});return o.ok||await Pf(o),await o.json()}async function jy(e,t,r,n,o){let{initialDelayMs:i,maxBackoffMs:s,backoffMultiplier:a,timeoutMs:l}=o,c=Date.now()+l,d=i;do{let p=await(0,sl.default)(`${_}/v2/devlink/${e}/export/${n}`,{headers:{Authorization:`Bearer ${r}`,[Rf]:t},timeout:6e4});p.ok||await Pf(p);let m=await p.json();if(m.status==="finished")return m.result;if(m.status==="failed")throw new so("The export task failed. Please try again or report a bug.");await(0,$f.setTimeout)(d),d=Math.min(d*a,s)}while(Date.now()<c);throw new so(`Export task timed out after ${l}ms. Please try again.`)}var sl,$f,Rf,al,so,ul=v(()=>{"use strict";sl=h(require("node-fetch")),$f=require("timers/promises");C();se();I();Rf="X-WF-Sync-Id",al="devlink_export_not_entitled",so=class extends Error{code;constructor(t,r){super(t),this.code=r?.code}}});var jf,Nf=v(()=>{"use strict";Ie();C();jf=async(e,t)=>{if(!t)return;await Ae({message:`Ready to export components to ${e.rootDir}?`,default:!0})||(u.info("Export cancelled."),process.exit(0))}});function Bf(e,t,r){let i=new Intl.PluralRules("en-US").select(e)==="one"&&e===1?t:r||`${t}s`;return`${e} ${i}`}var Mf=v(()=>{"use strict"});async function Fi(e){let t=Date.now(),r;try{let{manifest:n}=J(),{siteId:o,accessToken:i}=await he(n,e),s=(0,Lf.randomUUID)();wd(s);let{config:a,wasPrompted:l}=await Of(n);u.info(`${O} Export configuration loaded!`),await jf(a,l);let c=A.forExport({authToken:i,siteId:o});r=u.spinner("Exporting components"),await c.sendUsage("devlink_export_start",{cssScopes:a.cssScopes,ts:a.ts,relativeHrefRoot:a.relativeHrefRoot});try{let{files:d,messages:p,metadata:m}=await ll(a,i,o,s),g=m.exportCoverage==="full";await hi(d,a.rootDir,g),r.succeed(`${Bf(m.componentCount,"component")} exported to ${a.rootDir}`),yi(p);let y=Date.now()-t;await c.sendUsage("devlink_export_success",{duration:y,cssScopes:a.cssScopes,ts:a.ts,relativeHrefRoot:a.relativeHrefRoot})}catch(d){let p=d instanceof Error?d.message:String(d);throw e?.silentNotEntitled&&yr(d)?r.stop():r.fail(`Components export failed: ${p}`),await c.sendError(d instanceof Error?d:new Error(String(d)),"devlink_export_failure",{cssScopes:a.cssScopes,ts:a.ts}),d}}catch(n){if(!(e?.silentNotEntitled&&yr(n))){let i="Export failed: "+(n instanceof Error?n.message:n);r?r.fail(i):u.error(i,{prefix:`
34
+ `+F})}throw new f(n,{skipLogging:!0})}}var Lf,Wf=v(()=>{"use strict";Lf=require("crypto");If();ul();Nf();te();re();De();Mf();C();I();Xa();W();tl()});var Uf={};zu(Uf,{DEVLINK_EXPORT_NOT_ENTITLED_CODE:()=>al,exportComponents:()=>Fi,isDevlinkNotEntitledError:()=>yr});var Ci=v(()=>{"use strict";Wf();ul()});var qu=Symbol.for("@webflow/webflow-cli/suppress-deprecation");function $h(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.code==="DEP0040"&&typeof t.message=="string"&&t.message.includes("punycode")}function Rh(e=process){if(e[qu])return;e[qu]=!0;let t=e.emit;e.emit=function(n,...o){return n==="warning"&&$h(o[0])?!1:t.call(this,n,...o)}}Rh();var xh=require("commander");var bh=require("commander");ie();C();var yd=require("child_process"),Dd=require("fs"),ka=h(require("semver"));C();var Sa="@webflow/webflow-cli",dr="@webflow/data-types",ei="@webflow/react",Zw=[Sa,dr,ei],fr=class{getInstalledDependencies(){try{let t=(0,yd.execSync)(`npm ls ${Zw.join(" ")} --depth=0 --json --silent`,{encoding:"utf-8"}),r=JSON.parse(t);return r.dependencies?Object.entries(r.dependencies).reduce((n,[o,{version:i}])=>(n[o]=i,n),{}):{}}catch(t){return u.debug(`Failed to get installed dependencies: ${t}`),{}}}getRequiredDependencies(t){let r=JSON.parse((0,Dd.readFileSync)(require.resolve(`${t}/package.json`),"utf8"));return{...r.dependencies,...r.devDependencies}}checkCLIAndDataTypes(t){let r=t[dr];if(!r)return;let o=this.getRequiredDependencies(Sa)[dr];if(!ka.default.satisfies(r,o))throw new Error(`Version mismatch: ${Sa} requires ${dr} v${o} but found v${r}`)}checkReactAndDataTypes(t){let r=t[dr],n=t[ei];if(!(!r||!n)&&!ka.default.eq(r,n))throw new Error(`Version mismatch: ${ei} and ${dr} must be on the same version. Found ${ei}@${n} and ${dr}@${r}`)}run(){let t=this.getInstalledDependencies();this.checkCLIAndDataTypes(t),this.checkReactAndDataTypes(t)}};var Cd=require("fs-extra");Ie();var _d=require("@dotenvx/dotenvx"),pr=h(require("semver"));C();var Ed=require("child_process"),xd=require("util"),oy=(0,xd.promisify)(Ed.exec);async function Wt(e,t){try{let{stdout:r,stderr:n}=await oy(e,t);return{stdout:r.toString().trim(),stderr:n.toString().trim(),code:0}}catch(r){let n=r;return{stdout:n.stdout??"",stderr:n.stderr??String(n.message??""),code:n.code??1}}}Se();var Oa=h(Zo());W();ie();(0,_d.config)({quiet:!0,ignore:["MISSING_ENV_FILE"]});var Fd={npm:{updateCommand:"npm install",update:async e=>await Wt(`npm install ${e}`),getOutdated:async e=>{let{stdout:t}=await Wt(`npm outdated --json ${e}`);return JSON.parse(t)},lockFile:"package-lock.json",globalFlag:"--global",supported:!0},pnpm:{updateCommand:"pnpm add",update:async e=>await Wt(`pnpm add ${e}`),getOutdated:async e=>{let{stdout:t}=await Wt(`pnpm outdated --json ${e}`);return JSON.parse(t)},lockFile:"pnpm-lock.yaml",globalFlag:"--global",supported:!0},yarn:{lockFile:"yarn.lock",globalFlag:"",updateCommand:"",getOutdated:async()=>({}),update:async()=>({stdout:"",stderr:"",code:0}),supported:!1}},iy=["@webflow/webflow-cli","@webflow/data-types","@webflow/react","@webflow/emotion-utils","@webflow/styled-components-utils"],Yn=class{packageManager;constructor(){this.packageManager=this.getPackagerManagerInfo()}getPackagerManagerInfo(){for(let[,t]of Object.entries(Fd))if((0,Cd.existsSync)(t.lockFile))return t;return Fd.npm}async listOutdatedPackages(t="local",r=iy){let{getOutdated:n,globalFlag:o}=this.packageManager,i=await n(`${t==="global"?o:""} ${r?.join(" ")}`);return Object.fromEntries(Object.entries(i).map(([s,a])=>Array.isArray(a)?[s,{current:a[0].current,latest:a[0].latest,installationType:t}]:[s,{current:a.current,latest:a.latest,installationType:t}]))}async getOutdatedPackages(){let t=await this.listOutdatedPackages();if(t["@webflow/webflow-cli"])return t;let r=await this.listOutdatedPackages("global",["@webflow/webflow-cli"]);return{...t,...r}}async showUpdatePrompt(t){let r={name:"Update all packages",value:"update-all"},n=Object.entries(t).map(([i,{current:s,latest:a}])=>({name:`${i} (${s} ${Fe} ${a})`,value:i})),o=await ti({message:`New versions of the following ${ce("@webflow")} packages are available. Would you like to update them?`,choices:[r,...n]});return o==null?[]:o.includes("update-all")?Object.keys(t):o}showUpdateSuggestions(t){let{updateCommand:r,globalFlag:n}=this.packageManager;u.info(`${Ee} New versions of the following ${ce("@webflow")} packages are available:`),Object.entries(t).forEach(([s,{current:a,latest:l}])=>{u.info(S(` ${Yo} ${s} (${a} ${Fe} ${l})`))});let o=Object.entries(t).filter(([,{installationType:s}])=>s==="local").map(([s])=>`${s}@latest`),i=Object.entries(t).filter(([,{installationType:s}])=>s==="global").map(([s])=>`${s}@latest`);u.info(`
35
35
  ${Fe} To update, run:`),o.length>0&&u.info(R(` ${r} ${o.join(" ")}`)),i.length>0&&u.info(R(` ${r} ${n} ${i.join(" ")}`)),u.info("")}shouldSkipUpdateChecks(){return!this.packageManager.supported||process.env.WEBFLOW_SKIP_UPDATE_CHECKS==="true"}getDistTag(){let t=pr.prerelease(Oa.default.version);return t&&t.length>0&&typeof t[0]=="string"?t[0]:"latest"}async promptPrerelease(t){let r;try{r=u.spinner("Checking for updates (to disable, use --skip-update-check)");let{stdout:n,code:o}=await Wt(`npm view @webflow/webflow-cli@${t} version`);if(o!==0||!n.trim()){r.succeed("Up to date");return}let i=n.trim(),s=Oa.default.version;if(!pr.valid(i)||!pr.valid(s)){r.succeed("Up to date");return}if(!pr.gt(i,s)){r.succeed("All @webflow packages are up to date");return}if(r.succeed(),!process.stdin.isTTY||ee()){u.info(`${Ee} A new version of @webflow/webflow-cli@${t} is available.`);let{code:p}=await Wt("npm ls @webflow/webflow-cli --json"),g=(p===0?"local":"global")==="global"?" --global":"";u.info(`${Fe} To update, run: `+R(`${this.packageManager.updateCommand}${g} @webflow/webflow-cli@${t}`)+`
36
36
  `);return}let{code:l}=await Wt("npm ls @webflow/webflow-cli --json"),c=l===0?"local":"global";if(await Ae({message:`A new version of @webflow/webflow-cli@${t} is available.
37
37
  Would you like to update it?`,default:!1})){r=u.spinner("Updating");let p=c==="global"?` ${this.packageManager.globalFlag}`:"";try{await this.packageManager.update(`${p} @webflow/webflow-cli@${t}`),r.succeed("Updated successfully")}catch{let g=c==="global"?` ${this.packageManager.globalFlag}`:"";r.fail("Update failed. Manually run: "+R(`${this.packageManager.updateCommand}${g} @webflow/webflow-cli@${t}`))}}}catch(n){r?.fail("Failed to check for updates"),u.debug(String(n))}}async prompt(){if(this.shouldSkipUpdateChecks())return;let t=this.getDistTag();if(t!=="latest")return this.promptPrerelease(t);let r;try{r=u.spinner("Checking for updates (to disable, use --skip-update-check)");let n=await this.getOutdatedPackages();if(!(Object.keys(n).length>0)){r.succeed("All @webflow packages are up to date");return}if(r.succeed(),!process.stdin.isTTY||ee()){this.showUpdateSuggestions(n);return}let s=await this.showUpdatePrompt(n);if(s.length>0){r=u.spinner("Updating");let{local:a,global:l}=s.reduce((m,g)=>(m[n[g].installationType==="global"?"global":"local"].push(g),m),{local:[],global:[]}),{update:c,globalFlag:d,updateCommand:p}=this.packageManager;try{a.length>0&&await c(`${a.map(m=>`${m}@latest`).join(" ")}`),l.length>0&&await c(`${d} ${l.map(m=>`${m}@latest`).join(" ")}`),r.succeed("Updated successfully")}catch{r.fail("Update failed. Manually run: "+R(`${p} ${s.map(g=>`${g}@latest`).join(" ")}`))}}}catch(n){r?.fail("Failed to check for updates"),u.debug(String(n))}}};Se();Ea();Da();Ie();te();re();Se();De();C();I();W();ie();var Wd=e=>{let t=e.command("auth").description("Authentication and configuration commands");t.command("login").description("Authenticate with Webflow and save credentials to .env file").option("-f, --force","Force reauthentication even if credentials exist").action(async r=>{if(ee()){u.info(`${F} No-input mode enabled. Aborting OAuth authentication`);return}let{manifest:n}=J();if(!r.force&&to()){let i=ro(n);u.info(`${O} Webflow credentials already exist:`),i&&u.info(` Site ID: ${i}`),u.info(" API Token: [hidden]"),u.info(`
38
38
  Use --force flag to reauthenticate anyway`);return}try{let o=await $({force:r.force});Ft({apiToken:o}),u.info(`
39
- You can now use other Webflow CLI commands that require authentication`)}catch(o){throw new f(o,{prefix:`${F} Authentication failed:`})}}),t.command("status").description("Show current authentication status").action(async()=>{let r=Qn(),n=r?.accessToken??to();if(!n){u.info(`${F} Not logged in. Run ${R("webflow auth login")} to authenticate.`),process.exitCode=1;return}try{let o=await Wa(n);if(!o){u.info(`${F} Token is invalid or expired. Run ${R("webflow auth login --force")} to reauthenticate.`),process.exitCode=1;return}u.info(`${O} Logged in as ${o.firstName} ${o.lastName} (${o.email})`),r?.scopes?.length&&u.info(` Scopes: ${r.scopes.join(", ")}`),u.info(` Session: ${Vt()}`)}catch(o){throw new f(o,{prefix:`${F} Failed to fetch auth status:`})}}),t.command("logout").description("Log out and remove stored credentials").action(async()=>{Ra(),u.info(`${O} Logged out. Session file removed.`),u.info(`${Fe} Run ${R("webflow auth login")} to authenticate again.`)}),t.command("telemetry").description("Manage telemetry settings for all Webflow CLI commands").option("--enable","Enable telemetry for all commands").option("--disable","Disable telemetry for all commands").option("--status","Show current telemetry status").action(async r=>{let n=Mt.getInstance();if(r.status){let s=await n.getTelemetryStatus();u.info(Ld(s.enabled));return}if(r.enable){await n.setGlobalPreference(!0),u.info(Ua(!0));return}if(r.disable){await n.setGlobalPreference(!1),u.info(Ua(!1));return}let o=await n.getTelemetryStatus();if(u.info(Ld(o.enabled)),ee()){u.info("\u{1F4A1} When --no-input mode is enabled please provide --enable or --disable option");return}let i=await Oe({message:"What would you like to do?",choices:[{name:"Enable telemetry for all commands",value:"enable"},{name:"Disable telemetry for all commands",value:"disable"},{name:"Cancel",value:"cancel"}]});if(i==="enable"||i==="disable"){let s=i==="enable";await n.setGlobalPreference(s),u.info(Ua(s))}})},Ua=e=>`${O} Telemetry ${e?"enabled":"disabled"} for all Webflow CLI commands`,Ld=e=>`${Ee} Telemetry status: ${e?`enabled ${O}`:`disabled ${F}`}`;var lf=h(require("http")),uf=h(require("node-fetch")),cf=h(require("serve-handler")),df=require("fs"),ff=h(require("path")),pf=require("commander");var Vd=h(require("archiver")),Ha=require("commander"),ai=require("fs");var Ud=require("cosmiconfig"),Va=require("commander"),ii=async(e,t)=>{let r=await cy(t),n=r.config.apiVersion;return n&&typeof n!="string"&&Va.program.error('Error: The apiVersion field in webflow.json must be a string (i.e. "apiVersion": "2").'),{filepath:r.filepath,config:{publicDir:e,...r.config}}},cy=async e=>{let r=await(0,Ud.cosmiconfig)("webflow",{searchPlaces:[e]}).search();return r||Va.program.error(`No ${e} file was found. Run this command within your extension folder.`),r};var Hd=h(require("mime-types")),si=h(require("path")),dy=5*1024*1024,fy=new Set(["application/javascript","application/json","application/xml","image/png","image/jpeg","image/gif","image/svg+xml","image/webp","image/vnd.microsoft.icon","image/x-icon","video/webm","font/ttf","font/otf","font/woff","font/woff2","text/plain","text/markdown","text/html","text/css"]),Jd=async(e,t,r)=>{let{config:n,filepath:o}=await ii(e,t),i=si.join(o,".."),s=!0,a=!1,l=d=>{let p=d.name,m=Hd.default.lookup(p);return p==="index.html"&&(a=!0),p&&p.endsWith(".DS_Store")||!m?!1:fy.has(m)?d:(console.log(`Invalid file type: ${m} for file: ${p}`),s=!1,!1)},c=d=>{(0,ai.unlink)(r,p=>{p&&console.error(`Failed to delete file: ${p}`),Ha.program.error(d)})};return console.log(`Packaging the contents of the ${n.publicDir} folder into ${r}...`),new Promise(d=>{let p=(0,Vd.default)("zip",{zlib:{level:9}}),m=(0,ai.createWriteStream)(si.join(i,r));m.on("close",()=>{d(void 0)}),p.directory(si.join(i,n.publicDir),!1,l),p.file(o,{name:t}),p.pipe(m),p.finalize(),p.on("warning",g=>{console.log(g)}),p.on("error",g=>{Ha.program.error(g.message)}),p.on("finish",()=>{if(!a){c("Could not find index.html in your `publicDir`, all Designer Extension code needs to be inside of `publicDir`");return}if(!s){c("Bundling failed due to invalid file types");return}if(!p.pointer()||p.pointer()===0){c("Bundling failed with no output");return}if(p.pointer()>=dy){c("Bundling failed due to the bundle exceeding 5MB");return}console.log(`${p.pointer()} total bytes written`),console.log(`Done! ${r} is ready for you to upload to your Webflow app.`)})})};var oo=h(require("path")),pt=h(require("fs/promises")),ci=h(require("fs")),zd=require("url"),U0=require("dotenv/config"),qd=["js","cjs","json"],za=process.cwd(),Kd=".webflowrc",_t=oo.extname(ci.readdirSync(za).find(e=>e.includes(Kd))??"").replace(/\./g,""),Ct=oo.join(za,`${Kd}${_t&&`.${_t}`}`),Zd=ci.existsSync(Ct),Ja=class extends Error{constructor(){super(`Missing extension for .webflowrc file. The supported extensions are: ${qd.join(", ")}`)}},li=class extends Error{constructor(){super(`Unsupported extension for .webflowrc: ${_t}. The supported extensions are: ${qd.join(", ")}`)}},ui=class extends Error{constructor(t){let r=t.includes(".webflowrc"),n=t.includes("webflow.json"),o;r?o=`It seems like you don't have a .webflowrc file in your project (${t}). Make sure there is a .webflowrc file in your project root.`:n?o=`It seems like you don't have a webflow.json file in your project (${t}). Make sure there is a webflow.json file in your project root.`:o=`It seems like you don't have a config file in your project (${t}). Make sure there is a config file in your project root.`,super(o)}},Ga=class extends Error{constructor(t){super(`The following required fields are missing or undefined in your .webflowrc file: ${t}. If you're using process.env variables, make sure they're set up correctly.`)}};async function py(e){return(await import(process.platform==="win32"&&e?.match(/[a-zA-Z]:[\\\/]/)?(0,zd.pathToFileURL)(e).href:e)).default}function Gd(e,t){let r=t.filter(n=>!e[n]);if(r.length)throw new Ga(r.join(", "))}async function en(e=[],t=!1){if(!Zd){if(t)return{};throw new ui(Ct)}if(!_t)throw new Ja;switch(_t){case"js":case"cjs":{await pt.access(Ct);let r=await py(Ct);return Gd(r,e),r}case"json":{let r=JSON.parse(await pt.readFile(Ct,"utf8"));return Gd(r,e),r}default:throw new li}}function my(e,t){if(_t==="js"||_t==="cjs"){let n=new RegExp(`${t}: process.env.([\\w]+),`,"gi").exec(e);if(n)return n[1]}}function gy(e,t,r){let n=my(t,r);if(n){let o=new RegExp(`${r}: ".*?",`,"g");return e.replace(o,`${r}: process.env.${n},`)}return e}async function hy(e){let t=["authToken","host","siteId"],r=await pt.readFile(Ct,"utf-8");for(let n of t)e=gy(e,r,n);return e}async function wy(){try{let e=oo.join(za,"package.json");return await pt.access(e),JSON.parse(await pt.readFile(e,"utf-8"))?.type==="module"}catch{return!1}}async function Yd(e){if(!Zd)throw new ui(Ct);let t=JSON.stringify(e,null,2);switch(_t){case"js":case"cjs":{let r=await hy(t.replace(/"([^"]+)":/g,"$1:")),n=await wy()&&_t==="js"?"export default ":"module.exports = ";return pt.writeFile(Ct,n+r)}case"json":return pt.writeFile(Ct,t);default:throw new li}}var Jt=h(require("fs")),ze=h(require("path"));var io="webflow.json",Xd="index.html",Qd="bundle.zip",qa="public",Ka="extension-scaffolds",di="default";var ef="package.json",tf="wf-placeholder-name",Za=e=>JSON.stringify(e,null,2),rf=e=>{let t="\u2500".repeat(e.length+2);return"\u256D"+t+`\u256E
39
+ You can now use other Webflow CLI commands that require authentication`)}catch(o){throw new f(o,{prefix:`${F} Authentication failed:`})}}),t.command("status").description("Show current authentication status").action(async()=>{let r=Qn(),n=r?.accessToken??to();if(!n){u.info(`${F} Not logged in. Run ${R("webflow auth login")} to authenticate.`),process.exitCode=1;return}try{let o=await Wa(n);if(!o){u.info(`${F} Token is invalid or expired. Run ${R("webflow auth login --force")} to reauthenticate.`),process.exitCode=1;return}u.info(`${O} Logged in as ${o.firstName} ${o.lastName} (${o.email})`),r?.scopes?.length&&u.info(` Scopes: ${r.scopes.join(", ")}`),u.info(` Session: ${Vt()}`)}catch(o){throw new f(o,{prefix:`${F} Failed to fetch auth status:`})}}),t.command("logout").description("Log out and remove stored credentials").action(async()=>{Ra(),u.info(`${O} Logged out. Session file removed.`),u.info(`${Fe} Run ${R("webflow auth login")} to authenticate again.`)}),t.command("telemetry").description("Manage telemetry settings for all Webflow CLI commands").option("--enable","Enable telemetry for all commands").option("--disable","Disable telemetry for all commands").option("--status","Show current telemetry status").action(async r=>{let n=Mt.getInstance();if(r.status){let s=await n.getTelemetryStatus();u.info(Ld(s.enabled));return}if(r.enable){await n.setGlobalPreference(!0),u.info(Ua(!0));return}if(r.disable){await n.setGlobalPreference(!1),u.info(Ua(!1));return}let o=await n.getTelemetryStatus();if(u.info(Ld(o.enabled)),ee()){u.info("\u{1F4A1} When --no-input mode is enabled please provide --enable or --disable option");return}let i=await Oe({message:"What would you like to do?",choices:[{name:"Enable telemetry for all commands",value:"enable"},{name:"Disable telemetry for all commands",value:"disable"},{name:"Cancel",value:"cancel"}]});if(i==="enable"||i==="disable"){let s=i==="enable";await n.setGlobalPreference(s),u.info(Ua(s))}})},Ua=e=>`${O} Telemetry ${e?"enabled":"disabled"} for all Webflow CLI commands`,Ld=e=>`${Ee} Telemetry status: ${e?`enabled ${O}`:`disabled ${F}`}`;var lf=h(require("http")),uf=h(require("node-fetch")),cf=h(require("serve-handler")),df=require("fs"),ff=h(require("path")),pf=require("commander");var Vd=h(require("archiver")),Ha=require("commander"),ai=require("fs");var Ud=require("cosmiconfig"),Va=require("commander"),ii=async(e,t)=>{let r=await dy(t),n=r.config.apiVersion;return n&&typeof n!="string"&&Va.program.error('Error: The apiVersion field in webflow.json must be a string (i.e. "apiVersion": "2").'),{filepath:r.filepath,config:{publicDir:e,...r.config}}},dy=async e=>{let r=await(0,Ud.cosmiconfig)("webflow",{searchPlaces:[e]}).search();return r||Va.program.error(`No ${e} file was found. Run this command within your extension folder.`),r};var Hd=h(require("mime-types")),si=h(require("path")),fy=5*1024*1024,py=new Set(["application/javascript","application/json","application/xml","image/png","image/jpeg","image/gif","image/svg+xml","image/webp","image/vnd.microsoft.icon","image/x-icon","video/webm","font/ttf","font/otf","font/woff","font/woff2","text/plain","text/markdown","text/html","text/css"]),Jd=async(e,t,r)=>{let{config:n,filepath:o}=await ii(e,t),i=si.join(o,".."),s=!0,a=!1,l=d=>{let p=d.name,m=Hd.default.lookup(p);return p==="index.html"&&(a=!0),p&&p.endsWith(".DS_Store")||!m?!1:py.has(m)?d:(console.log(`Invalid file type: ${m} for file: ${p}`),s=!1,!1)},c=d=>{(0,ai.unlink)(r,p=>{p&&console.error(`Failed to delete file: ${p}`),Ha.program.error(d)})};return console.log(`Packaging the contents of the ${n.publicDir} folder into ${r}...`),new Promise(d=>{let p=(0,Vd.default)("zip",{zlib:{level:9}}),m=(0,ai.createWriteStream)(si.join(i,r));m.on("close",()=>{d(void 0)}),p.directory(si.join(i,n.publicDir),!1,l),p.file(o,{name:t}),p.pipe(m),p.finalize(),p.on("warning",g=>{console.log(g)}),p.on("error",g=>{Ha.program.error(g.message)}),p.on("finish",()=>{if(!a){c("Could not find index.html in your `publicDir`, all Designer Extension code needs to be inside of `publicDir`");return}if(!s){c("Bundling failed due to invalid file types");return}if(!p.pointer()||p.pointer()===0){c("Bundling failed with no output");return}if(p.pointer()>=fy){c("Bundling failed due to the bundle exceeding 5MB");return}console.log(`${p.pointer()} total bytes written`),console.log(`Done! ${r} is ready for you to upload to your Webflow app.`)})})};var oo=h(require("path")),pt=h(require("fs/promises")),ci=h(require("fs")),zd=require("url"),H0=require("dotenv/config"),qd=["js","cjs","json"],za=process.cwd(),Kd=".webflowrc",_t=oo.extname(ci.readdirSync(za).find(e=>e.includes(Kd))??"").replace(/\./g,""),Ct=oo.join(za,`${Kd}${_t&&`.${_t}`}`),Zd=ci.existsSync(Ct),Ja=class extends Error{constructor(){super(`Missing extension for .webflowrc file. The supported extensions are: ${qd.join(", ")}`)}},li=class extends Error{constructor(){super(`Unsupported extension for .webflowrc: ${_t}. The supported extensions are: ${qd.join(", ")}`)}},ui=class extends Error{constructor(t){let r=t.includes(".webflowrc"),n=t.includes("webflow.json"),o;r?o=`It seems like you don't have a .webflowrc file in your project (${t}). Make sure there is a .webflowrc file in your project root.`:n?o=`It seems like you don't have a webflow.json file in your project (${t}). Make sure there is a webflow.json file in your project root.`:o=`It seems like you don't have a config file in your project (${t}). Make sure there is a config file in your project root.`,super(o)}},Ga=class extends Error{constructor(t){super(`The following required fields are missing or undefined in your .webflowrc file: ${t}. If you're using process.env variables, make sure they're set up correctly.`)}};async function my(e){return(await import(process.platform==="win32"&&e?.match(/[a-zA-Z]:[\\\/]/)?(0,zd.pathToFileURL)(e).href:e)).default}function Gd(e,t){let r=t.filter(n=>!e[n]);if(r.length)throw new Ga(r.join(", "))}async function en(e=[],t=!1){if(!Zd){if(t)return{};throw new ui(Ct)}if(!_t)throw new Ja;switch(_t){case"js":case"cjs":{await pt.access(Ct);let r=await my(Ct);return Gd(r,e),r}case"json":{let r=JSON.parse(await pt.readFile(Ct,"utf8"));return Gd(r,e),r}default:throw new li}}function gy(e,t){if(_t==="js"||_t==="cjs"){let n=new RegExp(`${t}: process.env.([\\w]+),`,"gi").exec(e);if(n)return n[1]}}function hy(e,t,r){let n=gy(t,r);if(n){let o=new RegExp(`${r}: ".*?",`,"g");return e.replace(o,`${r}: process.env.${n},`)}return e}async function wy(e){let t=["authToken","host","siteId"],r=await pt.readFile(Ct,"utf-8");for(let n of t)e=hy(e,r,n);return e}async function yy(){try{let e=oo.join(za,"package.json");return await pt.access(e),JSON.parse(await pt.readFile(e,"utf-8"))?.type==="module"}catch{return!1}}async function Yd(e){if(!Zd)throw new ui(Ct);let t=JSON.stringify(e,null,2);switch(_t){case"js":case"cjs":{let r=await wy(t.replace(/"([^"]+)":/g,"$1:")),n=await yy()&&_t==="js"?"export default ":"module.exports = ";return pt.writeFile(Ct,n+r)}case"json":return pt.writeFile(Ct,t);default:throw new li}}var Jt=h(require("fs")),ze=h(require("path"));var io="webflow.json",Xd="index.html",Qd="bundle.zip",qa="public",Ka="extension-scaffolds",di="default";var ef="package.json",tf="wf-placeholder-name",Za=e=>JSON.stringify(e,null,2),rf=e=>{let t="\u2500".repeat(e.length+2);return"\u256D"+t+`\u256E
40
40
  \u2502 `+e+` \u2502
41
- \u2570`+t+"\u256F"};var nf=async(e,t="./",r=di,n)=>{let o=n[r];try{for(let i of o){let s=ze.join(t,i),a=by(s,r,e);if(i.includes(ef)||i.includes(io))await Dy(i,a,e);else{let l=await Jt.promises.readFile(i);await af(a,l)}}}catch(i){console.error("Error writing file, ",i)}},of=async()=>{let e={},t=ze.resolve(__dirname),r=ze.join(t,Ka),n=await Jt.promises.readdir(r);for(let o of n){let i=ze.join(r,o),s=await sf(i);e[o]=s}return e},sf=async e=>{let t=[];try{let r=await Jt.promises.readdir(e);for(let n of r){let o=ze.join(e,n);if((await Jt.promises.stat(o)).isDirectory()){let s=await sf(o);t.push(...s)}else t.push(o)}}catch(r){console.error(`Error reading ${ze}, `,r)}return t},af=async(e,t)=>{try{await Jt.promises.mkdir(ze.dirname(e),{recursive:!0}),await Jt.promises.writeFile(e,t)}catch(r){console.error("Error writing file ",r)}},Dy=async(e,t,r)=>Jt.promises.readFile(e,"utf8").then(async n=>{let o=n.replace(tf,r);await af(t,o)}),by=(e,t,r)=>{let n=ze.join(Ka,t),o=e.indexOf(n);if(o!==-1){let i=e.substring(o+n.length+1);return ze.join(r,i)}return""};var fi=async()=>await of(),mf=async()=>{let e=await fi(),t=Object.keys(e).join(", ");console.log(`Your available templates are: ${t}`),console.log('\u{1F4A1} Syntax: "webflow extension init projectName templateName"'),console.log('\u{1F31F} Example: "webflow extension init my-first-extension react"')},gf=async(e,t=di)=>{let r=`./${e}`;console.log(`Scaffolding your new extension named: ${e}...`);let n=await fi();await nf(e,r,t,n),console.log(`Done! Check out ${r}/README.md for steps on how to develop your extension.`)},hf=()=>Jd(qa,io,Qd),wf=async e=>{let{config:t,filepath:r}=await ii(qa,io),n=ff.join(r,"..",t.publicDir,Xd),i=(await en([],!0)).extensionTemplateDomain||"webflow-ext.com",s=t.apiVersion==="2"?"template/v2":"template",a=Object.keys(t.featureFlags||{}).map(g=>t.featureFlags?.[g]===!0?`ff_on=${g}`:`ff_off=${g}`).join("&"),l=a?`&${a}`:"",d=await(await(0,uf.default)(`https://${i}/${s}?name=${t.name}${l}`)).text(),p=new lf.Server((g,y)=>{if(g.url==="/"){df.promises.readFile(n,{encoding:"utf-8"}).catch(x=>{pf.program.error(x.message)}).then(x=>{let T=d.replace("{{ui}}",x);return y.writeHead(200,{"Content-Length":Buffer.byteLength(T),"Content-Type":"text/html"}),y.end(T)});return}if(g.url==="/__webflow")return y.writeHead(200,{"Content-Length":Buffer.byteLength(Za(t)),"Content-Type":"application/json","Access-Control-Allow-Origin":"*","Access-Control-Allow-Headers":"*"}),y.end(Za(t));(0,cf.default)(g,y,{public:t.publicDir,cleanUrls:!1,directoryListing:!1})}),m=vy(e);p.listen(m),console.log(rf(`Serving your extension at http://localhost:${m}`)+`
42
- `)},vy=e=>{if(e){let t=parseInt(e,10);return isNaN(t)?(console.log("Invalid port number provided. Using the default port "+1337),1337):t}return 1337};Ie();I();var yf=e=>{let t=e.command("extension").description("CLI for developing Designer Extensions.");t.command("list").description("Get list of project templates that can be used for `init`").action(mf),t.command("init").description("Bootstrap a Designer Extension.").argument("[projectName]","What is your Designer Extension's name?").argument("[scaffoldName]","Which project template do you want to use?").action(async(r,n)=>{let o=await fi(),i=Object.keys(o),s=await Ce({message:"What would you like to name your Designer Extension?",default:r,validate:l=>l.trim()===""?"The Designer Extension name cannot be empty.":!0});if(s===null)throw new f("When --no-input mode is enabled please provide the [projectName] argument.");let a=await Oe({message:"Which project template would you like to use?",choices:i.map(l=>({name:l,value:l})),default:n||"default"});await gf(s,a)}),t.command("bundle").description("Prepare package that can be uploaded to Webflow.").action(hf),t.command("serve").description("Serve your extension locally.").argument("[port]","The port to serve your extension on").action(wf)};var rl=h(require("process"));C();se();De();var bf=h(require("fs"));I();async function mi(e){let{authToken:t,siteId:r}=e||{},{path:n,isUserDefined:o}=cr(),i=bf.existsSync(n),s=!1;try{let{manifest:a}=J();s=!0,o&&u.info(`Using manifest file: ${n}`);try{let l=Wn(a,"devlink");if(!t||!r)throw new Error(`Missing Site ID or API token. Make sure you have WEBFLOW_API_TOKEN and WEBFLOW_SITE_ID set in your environment variables, or pass them as arguments --site and --api-token.
41
+ \u2570`+t+"\u256F"};var nf=async(e,t="./",r=di,n)=>{let o=n[r];try{for(let i of o){let s=ze.join(t,i),a=vy(s,r,e);if(i.includes(ef)||i.includes(io))await by(i,a,e);else{let l=await Jt.promises.readFile(i);await af(a,l)}}}catch(i){console.error("Error writing file, ",i)}},of=async()=>{let e={},t=ze.resolve(__dirname),r=ze.join(t,Ka),n=await Jt.promises.readdir(r);for(let o of n){let i=ze.join(r,o),s=await sf(i);e[o]=s}return e},sf=async e=>{let t=[];try{let r=await Jt.promises.readdir(e);for(let n of r){let o=ze.join(e,n);if((await Jt.promises.stat(o)).isDirectory()){let s=await sf(o);t.push(...s)}else t.push(o)}}catch(r){console.error(`Error reading ${ze}, `,r)}return t},af=async(e,t)=>{try{await Jt.promises.mkdir(ze.dirname(e),{recursive:!0}),await Jt.promises.writeFile(e,t)}catch(r){console.error("Error writing file ",r)}},by=async(e,t,r)=>Jt.promises.readFile(e,"utf8").then(async n=>{let o=n.replace(tf,r);await af(t,o)}),vy=(e,t,r)=>{let n=ze.join(Ka,t),o=e.indexOf(n);if(o!==-1){let i=e.substring(o+n.length+1);return ze.join(r,i)}return""};var fi=async()=>await of(),mf=async()=>{let e=await fi(),t=Object.keys(e).join(", ");console.log(`Your available templates are: ${t}`),console.log('\u{1F4A1} Syntax: "webflow extension init projectName templateName"'),console.log('\u{1F31F} Example: "webflow extension init my-first-extension react"')},gf=async(e,t=di)=>{let r=`./${e}`;console.log(`Scaffolding your new extension named: ${e}...`);let n=await fi();await nf(e,r,t,n),console.log(`Done! Check out ${r}/README.md for steps on how to develop your extension.`)},hf=()=>Jd(qa,io,Qd),wf=async e=>{let{config:t,filepath:r}=await ii(qa,io),n=ff.join(r,"..",t.publicDir,Xd),i=(await en([],!0)).extensionTemplateDomain||"webflow-ext.com",s=t.apiVersion==="2"?"template/v2":"template",a=Object.keys(t.featureFlags||{}).map(g=>t.featureFlags?.[g]===!0?`ff_on=${g}`:`ff_off=${g}`).join("&"),l=a?`&${a}`:"",d=await(await(0,uf.default)(`https://${i}/${s}?name=${t.name}${l}`)).text(),p=new lf.Server((g,y)=>{if(g.url==="/"){df.promises.readFile(n,{encoding:"utf-8"}).catch(x=>{pf.program.error(x.message)}).then(x=>{let T=d.replace("{{ui}}",x);return y.writeHead(200,{"Content-Length":Buffer.byteLength(T),"Content-Type":"text/html"}),y.end(T)});return}if(g.url==="/__webflow")return y.writeHead(200,{"Content-Length":Buffer.byteLength(Za(t)),"Content-Type":"application/json","Access-Control-Allow-Origin":"*","Access-Control-Allow-Headers":"*"}),y.end(Za(t));(0,cf.default)(g,y,{public:t.publicDir,cleanUrls:!1,directoryListing:!1})}),m=Ey(e);p.listen(m),console.log(rf(`Serving your extension at http://localhost:${m}`)+`
42
+ `)},Ey=e=>{if(e){let t=parseInt(e,10);return isNaN(t)?(console.log("Invalid port number provided. Using the default port "+1337),1337):t}return 1337};Ie();I();var yf=e=>{let t=e.command("extension").description("CLI for developing Designer Extensions.");t.command("list").description("Get list of project templates that can be used for `init`").action(mf),t.command("init").description("Bootstrap a Designer Extension.").argument("[projectName]","What is your Designer Extension's name?").argument("[scaffoldName]","Which project template do you want to use?").action(async(r,n)=>{let o=await fi(),i=Object.keys(o),s=await Ce({message:"What would you like to name your Designer Extension?",default:r,validate:l=>l.trim()===""?"The Designer Extension name cannot be empty.":!0});if(s===null)throw new f("When --no-input mode is enabled please provide the [projectName] argument.");let a=await Oe({message:"Which project template would you like to use?",choices:i.map(l=>({name:l,value:l})),default:n||"default"});await gf(s,a)}),t.command("bundle").description("Prepare package that can be uploaded to Webflow.").action(hf),t.command("serve").description("Serve your extension locally.").argument("[port]","The port to serve your extension on").action(wf)};var rl=h(require("process"));C();se();De();var bf=h(require("fs"));I();async function mi(e){let{authToken:t,siteId:r}=e||{},{path:n,isUserDefined:o}=cr(),i=bf.existsSync(n),s=!1;try{let{manifest:a}=J();s=!0,o&&u.info(`Using manifest file: ${n}`);try{let l=Wn(a,"devlink");if(!t||!r)throw new Error(`Missing Site ID or API token. Make sure you have WEBFLOW_API_TOKEN and WEBFLOW_SITE_ID set in your environment variables, or pass them as arguments --site and --api-token.
43
43
 
44
44
  To set up your credentials, run:
45
45
  webflow auth login`);return Df(l?.relativeHrefRoot),{...l,host:_,authToken:t,siteId:r,cssModules:!!l?.cssModules,components:pi(l?.components),fileExtensions:l?.fileExtensions,...e}}catch(l){throw new f(l,{prefix:`Failed to read devlink config from manifest file: ${n}
@@ -48,19 +48,19 @@ To set up your credentials, run:
48
48
  `;throw new f(a,{prefix:l})}}try{let a=[];t||a.push("authToken"),r||a.push("siteId");let l=await en(a);return Df(l?.relativeHrefRoot),{...l,host:l.host||_,cssModules:!!l?.cssModules,components:pi(l?.components),fileExtensions:l?.fileExtensions,...e}}catch(a){throw a instanceof Error&&a.message.includes(".webflowrc")&&(a.message=`No configuration file found. Please create either:
49
49
  - webflow.json with a "devlink" section, or
50
50
  - .webflowrc file
51
- in your project root.`),new f(a)}}function Df(e){if(!(e===void 0||e===!1)){if(typeof e=="string"){if(e==="/"||e.startsWith("http://")||e.startsWith("https://"))return;throw new Error(`Invalid relativeHrefRoot value "${e}". Must be false, "/" or an absolute URL starting with http:// or https://`)}throw new Error(`Invalid relativeHrefRoot type. Must be false, "/" or an absolute URL string, got: ${typeof e}`)}}function pi(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>`^${t}$`).join("|")}Xa();ft();I();var tn=class extends Error{};function Cy(e){try{let t=JSON.parse(e);if(t.msg&&typeof t.msg=="string")return t.msg}catch{}return null}async function _y(e){switch(e.status){case 400:{let t=await e.text(),r=Cy(t);throw new tn(r||"Bad request: The server rejected the request due to invalid input. Please check your configuration and try again.")}case 401:throw new tn("Your access token is invalid for the provided siteId. Double check your configs in your .webflowrc configuration file.");case 404:throw new tn("You're not currently enrolled in the DevLink beta. You can apply for access here: https://webflow.com/devlink");default:throw new tn(`Something went wrong (HTTP ${e.status}).`)}}async function ky(e){try{let{siteId:t,host:r,authToken:n,...o}=e,i=await K(`${r}/devlink/${t}`,{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify(o),timeout:6e4});return i.ok?await i.json():_y(i)}catch(t){throw new f(t,{skipLogging:!0})}}async function Qa(e){try{let t=await ky(e);if(!t.files||!Array.isArray(t.files))throw new f("Invalid response format from V1 API: expected 'files' array");let r=t.metadata?.exportCoverage==="full";return await hi(t.files,e.rootDir,r),{messages:t.messages}}catch(t){throw t instanceof f?t:new f(t,{skipLogging:!0})}}var wr=h(require("process"));C();De();ft();var el=class{config;error;constructor(t,r){this.config=t,this.error=r}stripPII(t=""){return t.replace(/\/(.*)webflow-cli/gi,"/REDACTED_PII/webflow-cli/").replace(/\/(.*)node_modules/gi,"/REDACTED_PII/node_modules")}sendTelemetry(){let t=this.config,r=this.error;K(`${t.host}/devlink/${t.siteId}/telemetry`,{headers:{Authorization:`Bearer ${t.authToken}`,"Content-Type":"application/json"},method:"post",body:JSON.stringify({cause:r.cause,message:r.message,name:r.name,stack:this.stripPII(r.stack),platform:wr.default.platform,node:wr.default.version})})}async storeChoice(t){try{return ue({devlink:{allowTelemetry:t}})}catch{let n=await en();await Yd({...n,allowTelemetry:t})}}async prompt(){let t=this.config;u.error(this.error),t.allowTelemetry===!0?this.sendTelemetry():t.allowTelemetry===void 0&&(await this.storeChoice(!0),this.sendTelemetry())}};function wi(e){return async function(r){wr.default.removeListener("uncaughtException",wi),wr.default.removeListener("unhandledRejection",wi);let n=await mi(e);if(!n)return;await new el(n,r).prompt()}}function vf(e){wr.default.on("uncaughtException",wi(e)),wr.default.on("unhandledRejection",wi(e))}te();C();re();De();tl();async function Ef(e,t){let r=Date.now(),{manifest:n}=J(),{accessToken:o,siteId:i}=await he(n,{site:t?.site,apiToken:t?.apiToken}),s={...o?{authToken:o}:{},...i?{siteId:i}:{},...e&&e.length>0?{components:pi(e),overwriteModule:!1}:{overwriteModule:!0}};vf(s);let a=await mi(s);if(!a)return rl.default.exit();let l;try{l=A.forDevlinkSync(a)}catch(d){u.debug(`Failed to initialize telemetry: ${d}`)}await l?.sendUsage("devlink_sync_start",{specificComponents:e&&e.length>0,componentCount:e?.length||0,cssModules:a.cssModules,overwriteModule:a.overwriteModule,relativeHrefRoot:a.relativeHrefRoot});let c=u.spinner(`Exporting components into ${a.rootDir}`);try{let{messages:d}=await Qa(a);c.succeed(`Successfully exported components into ${a.rootDir} folder`),yi(d);let p=Date.now()-r;await l?.sendUsage("devlink_sync_success",{duration:p,specificComponents:e&&e.length>0,componentCount:e?.length||0,cssModules:a.cssModules,overwriteModule:a.overwriteModule,relativeHrefRoot:a.relativeHrefRoot})}catch(d){let p=d instanceof Error?d.message:String(d);c.fail(`Failed to export components: ${p}`);let m=Date.now()-r;throw await l?.sendError(d instanceof Error?d:new Error(String(d)),"devlink_sync_failure",{duration:m,specificComponents:e&&e.length>0,componentCount:e?.length||0,cssModules:a.cssModules,overwriteModule:a.overwriteModule,relativeHrefRoot:a.relativeHrefRoot,configOverrides:Object.keys(s),argv:rl.default.argv.slice(2)}),d}}Ci();var Zt=require("commander");var Vi=require("path"),cn=require("@webflow/data-types");se();var _i=require("fs"),cl=h(require("md5"));function ao(e,t){try{let r=(0,_i.statSync)(e),n=(0,_i.readFileSync)(e);return{value:n,meta:{title:e.replace(/^.*[\\\/]/,""),fileHash:(0,cl.default)(n),size:r.size,...t||{}}}}catch{throw new Error(`File '${e}' not found`)}}function lo(e,t,r){try{let n=new Blob([e]).size,o=Buffer.from(e,"utf-8");return{value:o,meta:{title:t.replace(/^.*[\\\/]/,""),fileHash:(0,cl.default)(o),size:n,...r}}}catch{throw new Error(`Error parsing '${t}' inline file`)}}var Vf=h(require("node-fetch")),Hf=h(require("form-data"));async function uo(e,t){let r={...t.fields,file:e.value},n=new Hf.default;Object.entries(r).forEach(([i,s])=>{n.append(i,s)});let o=await(0,Vf.default)("https://"+t.fields.bucket+".s3.amazonaws.com",{method:"POST",body:n});jy(o)}function jy(e){switch(e.status){case 200:case 201:return;case 403:throw new Error("Unauthorized. Please check your AWS access key");default:throw new Error(`Something went wrong when uploading the file: ${e.statusText}`)}}C();De();te();se();ft();ie();function Ny({apiToken:e=process.env.WEBFLOW_API_TOKEN??process.env.WEBFLOW_WORKSPACE_API_TOKEN??process.env.WEBFLOW_SITE_API_TOKEN,siteId:t=process.env.WEBFLOW_SITE_ID,libraryTarget:r=process.env.WEBFLOW_LIBRARY_TARGET}){if(!e)throw new Error("No API token provided");if(r==="site"){if(!t)throw new Error("No site provided");return{baseUrl:`${_}/v2/sites/${t}`,authToken:e}}return{baseUrl:`${_}/v2/workspaces`,authToken:e}}function By(e){if(e)return JSON.stringify(Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)))}async function My(e){if(e.ok)return;if(e.status===401||e.status===403)throw new Error(`Your API token is invalid or not authorized to perform this action. Run ${R("webflow auth login --force")} to generate a new token.`);if(e.status===404)throw new Error("Code components are rolling out in phases. Check back soon for access.");let t=await e.json();throw new Error(t.message||e.statusText)}async function zt({endpoint:e,method:t="GET",body:r,options:n}){let{baseUrl:o,authToken:i}=Ny(n),s=`${o.replace(/\/+$/,"")}/${e.replace(/^\/+/,"")}`,a=await K(s,{method:t,headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:By(r)});return await My(a),a.json()}async function dl({options:e}){return(await zt({endpoint:"/code_libraries",options:e})).payload.workspaces[0]}async function fl({name:e,description:t,slug:r,options:n}){return(await zt({method:"POST",endpoint:"/code_library/init",body:{name:e,description:t,slug:r},options:n})).payload}async function pl({resourceId:e,files:t,options:r}){return(await zt({method:"POST",endpoint:`/code_library/${e}/files`,body:{files:t},options:r})).payload}async function ml({resourceId:e,codeModule:t,components:r,options:n}){return(await zt({method:"POST",endpoint:`/code_library/${e}/share`,body:{codeModule:t,components:r},options:n})).payload}var Pp=require("path"),jp=h(require("webpack-merge")),Dr=require("@webflow/data-types");se();C();var zf=require("memfs/lib/volume"),co=require("@webflow/data-types");var mt="./tmp_entry",Jf="components";function ki(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+|[^\p{L}\p{N}]/gu," ").toLowerCase().replace(new RegExp("(?:^|\\s)(\\p{L})","gu"),(t,r)=>r.toUpperCase()).replace(/\s+/g,"")}function Ly(e){let t=ki(e);return/^[a-zA-Z]/.test(t.charAt(0))?t:"_"+t}function Gf(e,t){let r=e.map(({name:l,path:c,isDefaultExport:d})=>d?`import ${l} from "${c}";`:`import { ${l} } from "${c}";`).join(`
51
+ in your project root.`),new f(a)}}function Df(e){if(!(e===void 0||e===!1)){if(typeof e=="string"){if(e==="/"||e.startsWith("http://")||e.startsWith("https://"))return;throw new Error(`Invalid relativeHrefRoot value "${e}". Must be false, "/" or an absolute URL starting with http:// or https://`)}throw new Error(`Invalid relativeHrefRoot type. Must be false, "/" or an absolute URL string, got: ${typeof e}`)}}function pi(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>`^${t}$`).join("|")}Xa();ft();I();var tn=class extends Error{};function _y(e){try{let t=JSON.parse(e);if(t.msg&&typeof t.msg=="string")return t.msg}catch{}return null}async function ky(e){switch(e.status){case 400:{let t=await e.text(),r=_y(t);throw new tn(r||"Bad request: The server rejected the request due to invalid input. Please check your configuration and try again.")}case 401:throw new tn("Your access token is invalid for the provided siteId. Double check your configs in your .webflowrc configuration file.");case 404:throw new tn("You're not currently enrolled in the DevLink beta. You can apply for access here: https://webflow.com/devlink");default:throw new tn(`Something went wrong (HTTP ${e.status}).`)}}async function Sy(e){try{let{siteId:t,host:r,authToken:n,...o}=e,i=await K(`${r}/devlink/${t}`,{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify(o),timeout:6e4});return i.ok?await i.json():ky(i)}catch(t){throw new f(t,{skipLogging:!0})}}async function Qa(e){try{let t=await Sy(e);if(!t.files||!Array.isArray(t.files))throw new f("Invalid response format from V1 API: expected 'files' array");let r=t.metadata?.exportCoverage==="full";return await hi(t.files,e.rootDir,r),{messages:t.messages}}catch(t){throw t instanceof f?t:new f(t,{skipLogging:!0})}}var wr=h(require("process"));C();De();ft();var el=class{config;error;constructor(t,r){this.config=t,this.error=r}stripPII(t=""){return t.replace(/\/(.*)webflow-cli/gi,"/REDACTED_PII/webflow-cli/").replace(/\/(.*)node_modules/gi,"/REDACTED_PII/node_modules")}sendTelemetry(){let t=this.config,r=this.error;K(`${t.host}/devlink/${t.siteId}/telemetry`,{headers:{Authorization:`Bearer ${t.authToken}`,"Content-Type":"application/json"},method:"post",body:JSON.stringify({cause:r.cause,message:r.message,name:r.name,stack:this.stripPII(r.stack),platform:wr.default.platform,node:wr.default.version})})}async storeChoice(t){try{return ue({devlink:{allowTelemetry:t}})}catch{let n=await en();await Yd({...n,allowTelemetry:t})}}async prompt(){let t=this.config;u.error(this.error),t.allowTelemetry===!0?this.sendTelemetry():t.allowTelemetry===void 0&&(await this.storeChoice(!0),this.sendTelemetry())}};function wi(e){return async function(r){wr.default.removeListener("uncaughtException",wi),wr.default.removeListener("unhandledRejection",wi);let n=await mi(e);if(!n)return;await new el(n,r).prompt()}}function vf(e){wr.default.on("uncaughtException",wi(e)),wr.default.on("unhandledRejection",wi(e))}te();C();re();De();tl();async function Ef(e,t){let r=Date.now(),{manifest:n}=J(),{accessToken:o,siteId:i}=await he(n,{site:t?.site,apiToken:t?.apiToken}),s={...o?{authToken:o}:{},...i?{siteId:i}:{},...e&&e.length>0?{components:pi(e),overwriteModule:!1}:{overwriteModule:!0}};vf(s);let a=await mi(s);if(!a)return rl.default.exit();let l;try{l=A.forDevlinkSync(a)}catch(d){u.debug(`Failed to initialize telemetry: ${d}`)}await l?.sendUsage("devlink_sync_start",{specificComponents:e&&e.length>0,componentCount:e?.length||0,cssModules:a.cssModules,overwriteModule:a.overwriteModule,relativeHrefRoot:a.relativeHrefRoot});let c=u.spinner(`Exporting components into ${a.rootDir}`);try{let{messages:d}=await Qa(a);c.succeed(`Successfully exported components into ${a.rootDir} folder`),yi(d);let p=Date.now()-r;await l?.sendUsage("devlink_sync_success",{duration:p,specificComponents:e&&e.length>0,componentCount:e?.length||0,cssModules:a.cssModules,overwriteModule:a.overwriteModule,relativeHrefRoot:a.relativeHrefRoot})}catch(d){let p=d instanceof Error?d.message:String(d);c.fail(`Failed to export components: ${p}`);let m=Date.now()-r;throw await l?.sendError(d instanceof Error?d:new Error(String(d)),"devlink_sync_failure",{duration:m,specificComponents:e&&e.length>0,componentCount:e?.length||0,cssModules:a.cssModules,overwriteModule:a.overwriteModule,relativeHrefRoot:a.relativeHrefRoot,configOverrides:Object.keys(s),argv:rl.default.argv.slice(2)}),d}}Ci();var Zt=require("commander");var Vi=require("path"),cn=require("@webflow/data-types");se();var _i=require("fs"),cl=h(require("md5"));function ao(e,t){try{let r=(0,_i.statSync)(e),n=(0,_i.readFileSync)(e);return{value:n,meta:{title:e.replace(/^.*[\\\/]/,""),fileHash:(0,cl.default)(n),size:r.size,...t||{}}}}catch{throw new Error(`File '${e}' not found`)}}function lo(e,t,r){try{let n=new Blob([e]).size,o=Buffer.from(e,"utf-8");return{value:o,meta:{title:t.replace(/^.*[\\\/]/,""),fileHash:(0,cl.default)(o),size:n,...r}}}catch{throw new Error(`Error parsing '${t}' inline file`)}}var Vf=h(require("node-fetch")),Hf=h(require("form-data"));async function uo(e,t){let r={...t.fields,file:e.value},n=new Hf.default;Object.entries(r).forEach(([i,s])=>{n.append(i,s)});let o=await(0,Vf.default)("https://"+t.fields.bucket+".s3.amazonaws.com",{method:"POST",body:n});Ny(o)}function Ny(e){switch(e.status){case 200:case 201:return;case 403:throw new Error("Unauthorized. Please check your AWS access key");default:throw new Error(`Something went wrong when uploading the file: ${e.statusText}`)}}C();De();te();se();ft();ie();function By({apiToken:e=process.env.WEBFLOW_API_TOKEN??process.env.WEBFLOW_WORKSPACE_API_TOKEN??process.env.WEBFLOW_SITE_API_TOKEN,siteId:t=process.env.WEBFLOW_SITE_ID,libraryTarget:r=process.env.WEBFLOW_LIBRARY_TARGET}){if(!e)throw new Error("No API token provided");if(r==="site"){if(!t)throw new Error("No site provided");return{baseUrl:`${_}/v2/sites/${t}`,authToken:e}}return{baseUrl:`${_}/v2/workspaces`,authToken:e}}function My(e){if(e)return JSON.stringify(Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)))}async function Ly(e){if(e.ok)return;if(e.status===401||e.status===403)throw new Error(`Your API token is invalid or not authorized to perform this action. Run ${R("webflow auth login --force")} to generate a new token.`);if(e.status===404)throw new Error("Code components are rolling out in phases. Check back soon for access.");let t=await e.json();throw new Error(t.message||e.statusText)}async function zt({endpoint:e,method:t="GET",body:r,options:n}){let{baseUrl:o,authToken:i}=By(n),s=`${o.replace(/\/+$/,"")}/${e.replace(/^\/+/,"")}`,a=await K(s,{method:t,headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:My(r)});return await Ly(a),a.json()}async function dl({options:e}){return(await zt({endpoint:"/code_libraries",options:e})).payload.workspaces[0]}async function fl({name:e,description:t,slug:r,options:n}){return(await zt({method:"POST",endpoint:"/code_library/init",body:{name:e,description:t,slug:r},options:n})).payload}async function pl({resourceId:e,files:t,options:r}){return(await zt({method:"POST",endpoint:`/code_library/${e}/files`,body:{files:t},options:r})).payload}async function ml({resourceId:e,codeModule:t,components:r,options:n}){return(await zt({method:"POST",endpoint:`/code_library/${e}/share`,body:{codeModule:t,components:r},options:n})).payload}var Pp=require("path"),jp=h(require("webpack-merge")),Dr=require("@webflow/data-types");se();C();var zf=require("memfs/lib/volume"),co=require("@webflow/data-types");var mt="./tmp_entry",Jf="components";function ki(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+|[^\p{L}\p{N}]/gu," ").toLowerCase().replace(new RegExp("(?:^|\\s)(\\p{L})","gu"),(t,r)=>r.toUpperCase()).replace(/\s+/g,"")}function Wy(e){let t=ki(e);return/^[a-zA-Z]/.test(t.charAt(0))?t:"_"+t}function Gf(e,t){let r=e.map(({name:l,path:c,isDefaultExport:d})=>d?`import ${l} from "${c}";`:`import { ${l} } from "${c}";`).join(`
52
52
  `),n=e.filter(l=>l.type==="internal").map(({name:l,exportKey:c})=>`${c}: ${l}`).join(", "),o=e.filter(l=>l.type==="component").map(({name:l,exportKey:c})=>`"${c}": ${l}`).join(", "),i=`env: "${t}"`,s=n,a=o?`components: { ${o} }`:void 0;return`${r}
53
53
 
54
- export default { ${[i,s,a].filter(Boolean).join(", ")} };`}function qf(e,t,r){let n={},o=`${mt}/Client.js`,i=`${mt}/Server.js`;n[o]=Gf([{name:"ClientRenderer",path:e.client,exportKey:"Renderer",type:"internal"}],co.Environment.Client);let s={},a=c=>{let d=Ly(c);return s[d]?(s[d]+=1,`${d}${s[d]}`):(s[d]=1,d)};n[i]=Gf([{name:"ServerRenderer",path:e.server,exportKey:"Renderer",type:"internal"},...Object.entries(t).filter(([c])=>r[c]?.ssr??!0).map(([c,d])=>{let p=a(c),m=d.startsWith(mt)?d.replace(`${mt}/`,"./"):d;return{name:p,path:m,exportKey:c,isDefaultExport:!0,type:"component"}})],co.Environment.Server);let l={[co.Environment.Client]:o,[co.Environment.Server]:i};return{entryPointsVolume:zf.Volume.fromJSON(n),paths:l}}var Np=require("memfs/lib/volume");var Qf=h(require("archiver")),rn=require("path");se();var fo=require("@webflow/data-types");se();C();var qt=e=>e.endsWith("/")||/%2F$/i.test(e)?e:`${e}/`;var Kf=2;function Zf(e){let t={type:fo.ModuleLoader.FEDERATION,version:Kf,entry:ya,renderer:Jn,components:e};return{title:Hn,content:JSON.stringify(t)}}function Yf(e){let t={type:fo.ModuleLoader.SSR,version:Kf,entry:Yr,components:e};return{title:Hn,content:JSON.stringify(t)}}function Xf(e){let t=`/${fo.Environment.Client}/${ya}`;try{if(e.existsSync(t)){let r=e.readFileSync(t,"utf8"),n=JSON.parse(r.toString()),o="publicPath"in n.metaData?n.metaData.publicPath:null;if(!o)throw new Error("Public path not found in module federation manifest");return n.exposes.reduce((i,s)=>{let a=s.name;return a===Jn||(i[a]={css:[]},s.assets.css.sync.forEach(l=>{i[a].css.push(`${qt(o)}${l}`)})),i},{})}}catch(r){u.error(r,{prefix:"Failed to extract components metadata from MF manifest:"})}return{}}var Si=require("@webflow/data-types"),Wy=/\.css$/i;async function ep(e,t,r){let n=!1;return new Promise(async(o,i)=>{e.length===0&&i(new Error("No assets to bundle"));let s=`/${Si.Environment.Server}/${Gn}`,a=(0,Qf.default)("tar",{gzip:!1}),l=t.createWriteStream(s);a.on("error",p=>(n=!0,i(p))),l.on("close",()=>{if(!n)try{let p={type:"asset",name:Gn,info:{},size:a.pointer(),emitted:!0,comparedForEmit:!1,cached:!1};return e.forEach(m=>{let g=(0,rn.resolve)((0,rn.join)(`/${Si.Environment.Server}`,m.name));t.existsSync(g)&&t.rmSync(g)}),o([p])}catch(p){return i(p)}finally{n=!0}}),a.pipe(l);let{title:c,content:d}=Yf(r);a.append(d,{name:c}),e.forEach(p=>{if(!Wy.test(p.name))try{let m=(0,rn.resolve)((0,rn.join)(`/${Si.Environment.Server}`,p.name)),g=t.readFileSync(m,"utf8");a.append(g,{name:p.name})}catch(m){return n=!0,i(m)}}),await a.finalize()})}var tp=require("@webflow/data-types");async function rp(e,t,r){let{title:n,content:o}=Zf(r);await t.promises.writeFile(`/${tp.Environment.Client}/${n}`,o);let i={type:"asset",name:n,info:{},size:o.length,emitted:!0,comparedForEmit:!1,cached:!1};return e.filter(s=>s.name!=="mf-stats.json").concat([i])}var Sp=require("@rspack/core"),Tp=h(require("fork-ts-checker-webpack-plugin")),Ap=require("ts-checker-rspack-plugin"),Op=h(require("mini-css-extract-plugin")),Ip=require("@webflow/data-types");var op=require("webpack"),hl=h(require("mini-css-extract-plugin")),ip=h(require("tsconfig-paths-webpack-plugin")),sp=require("tsconfig-paths"),wl=require("@webflow/data-types"),ap=require("path");se();var np=h(require("postcss-selector-parser")),gl=()=>({postcssPlugin:"CSSinShadowDOM",Once(e){e.walkRules(t=>{t.selector=(0,np.default)(r=>{r.walkPseudos(n=>{n.value===":root"&&(n.value=":host")})}).processSync(t.selector)})}});gl.postcss=!0;gl.postcssPlugin="CSSinShadowDOM";var Ti=gl;function Uy(){return(0,sp.loadConfig)(process.cwd()).resultType==="success"}function lp({entry:e,env:t,mode:r="production",publicPath:n,libraryName:o,outputPath:i}){let s={mode:r,module:{rules:[{test:/\.css$/i,use:[{ident:"mini-css-extract-loader",loader:hl.default.loader},{ident:"css-loader",loader:require.resolve("css-loader"),options:{importLoaders:1}},{ident:"postcss-loader",loader:require.resolve("postcss-loader"),options:{postcssOptions:{plugins:[Ti]}}}]},{test:/\.(png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",generator:{filename:"[hash]-[name][ext]"}}]},plugins:[new hl.default({filename:"[contenthash].css",chunkFilename:"[contenthash].css",runtime:!1})],resolve:{plugins:[Uy()?new ip.default:null].filter(Boolean)},performance:{hints:!1}};if(t===wl.Environment.Client)return{...s,entry:()=>({}),output:{path:i?(0,ap.join)(process.cwd(),i,t):"/",publicPath:n,clean:!0,uniqueName:o},target:"web"};if(t===wl.Environment.Server)return{...s,plugins:[...s.plugins||[],new op.optimize.LimitChunkCountPlugin({maxChunks:1})],entry:e,output:{filename:Yr,library:{type:"commonjs2"}},optimization:{splitChunks:!1},target:"async-node"};throw new Error(`Unknown environment ${t}`)}var up=require("@module-federation/enhanced"),yl=require("@webflow/data-types");function cp({libraryName:e,env:t,exposes:r}){if(t===yl.Environment.Client)return{plugins:[new up.ModuleFederationPlugin({name:e,filename:"remoteEntry.js",exposes:r,dts:!1,experiments:{optimization:{disableSnapshot:!0}}})]};if(t===yl.Environment.Server)return{};throw new Error(`Unknown environment ${t}`)}function dp(){return{module:{rules:[{test:/\.(js|ts)x?$/,exclude:/node_modules/,use:[{ident:"babel-loader",loader:require.resolve("babel-loader"),options:{presets:[require.resolve("@babel/preset-env"),[require.resolve("@babel/preset-react"),{runtime:"automatic"}],require.resolve("@babel/preset-typescript")]}}]}]},resolve:{extensions:[".tsx",".ts",".jsx",".js",".json"]}}}function Ai(){return{module:{rules:[{test:/\.(js|ts)x?$/,exclude:/node_modules/,loader:"builtin:swc-loader",options:{jsc:{parser:{syntax:"typescript",tsx:!0},transform:{react:{runtime:"automatic",development:!1,refresh:!1}}}}}]},resolve:{extensions:[".tsx",".ts",".jsx",".js",".json"]}}}var Oi=require("@rspack/core"),fp=require("tsconfig-paths"),Dl=require("@webflow/data-types"),pp=require("path");se();function Vy(){let e=(0,fp.loadConfig)(process.cwd());if(e.resultType==="success")return e.configFileAbsolutePath}function mp({entry:e,env:t,mode:r="production",publicPath:n,libraryName:o,outputPath:i}){let s={mode:r,module:{rules:[{test:/\.css$/i,use:[{ident:"mini-css-extract-loader",loader:Oi.rspack.CssExtractRspackPlugin.loader},{ident:"css-loader",loader:require.resolve("css-loader"),options:{importLoaders:1}},{ident:"postcss-loader",loader:require.resolve("postcss-loader"),options:{postcssOptions:{plugins:[Ti]}}}],type:"javascript/auto"},{test:/\.(png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",generator:{filename:"[hash]-[name][ext]"}}]},plugins:[new Oi.rspack.CssExtractRspackPlugin({filename:"[contenthash].css",chunkFilename:"[contenthash].css",runtime:!1})],resolve:(()=>{let a=Vy();return a?{tsConfig:{configFile:a}}:{}})(),performance:{hints:!1}};if(t===Dl.Environment.Client)return{...s,entry:()=>({}),output:{path:i?(0,pp.join)(process.cwd(),i,t):"/",publicPath:n,clean:!0,uniqueName:o},target:"web"};if(t===Dl.Environment.Server)return{...s,plugins:[...Array.isArray(s.plugins)?s.plugins:[],new Oi.rspack.optimize.LimitChunkCountPlugin({maxChunks:1})],entry:e,output:{filename:Yr,library:{type:"commonjs2"}},optimization:{splitChunks:!1},target:"async-node"};throw new Error(`Unknown environment ${t}`)}var gp=require("@module-federation/enhanced/rspack"),bl=require("@webflow/data-types");function hp({libraryName:e,env:t,exposes:r}){if(t===bl.Environment.Client)return{plugins:[new gp.ModuleFederationPlugin({name:e,filename:"remoteEntry.js",exposes:r,dts:!1,experiments:{optimization:{disableSnapshot:!0}}})]};if(t===bl.Environment.Server)return{};throw new Error(`Unknown environment ${t}`)}var Jy=h(require("fs")),wp=require("unionfs"),yp=require("webpack");function Hy(e){return{name:e.name,size:e.size,emitted:e.emitted,info:e.info}}function Ii(e){let t=e.toJson();return{hasErrors:()=>e.hasErrors(),hasWarnings:()=>e.hasWarnings(),toString:r=>e.toString(r),toJson:()=>({...t,assets:(t.assets??[]).map(Hy)})}}async function Dp({config:e,sourceVolumes:t=[],outputVolume:r,outputPath:n,failOnWarnings:o=!0}){let i=t.reduce((s,a)=>(s.use(a),s),new wp.Union().use(Jy));return new Promise((s,a)=>{let l=(0,yp.webpack)(e);l.inputFileSystem=i,r&&(l.outputFileSystem=r),n&&(l.outputPath=n),l.run((c,d)=>{l.close(p=>{c||p?a(c||p):d?d.hasErrors()||o&&d.hasWarnings()?a(new Error(d.toString("errors-warnings"))):s(Ii(d)):a(new Error("Webpack stats are undefined"))})})})}var Gy=h(require("fs")),vl=h(require("webpack-merge")),bp=require("memfs"),vp=require("unionfs"),Ep=require("@rspack/core");async function $i({config:e,sourceVolumes:t=[],outputVolume:r,outputPath:n,failOnWarnings:o=!0}){let i=t.reduce((a,l)=>(a.use(l),a),new vp.Union().use(Gy)),s=e;return t.length>0&&(s=(0,vl.default)(s,{experiments:{...e.experiments,useInputFileSystem:[/./]}})),r&&(s=(0,vl.default)(s,{output:{clean:!1,...n&&{path:n}}})),new Promise((a,l)=>{let c=(0,Ep.rspack)(s);c.inputFileSystem=i,r&&(c.outputFileSystem=(0,bp.createFsFromVolume)(r)),n&&(c.outputPath=n),c.run((d,p)=>{c.close(m=>{d||m?l(d||m):p?p.hasErrors()||o&&p.hasWarnings()?l(new Error(p.toString("errors-warnings"))):a(Ii(p)):l(new Error("Rspack stats are undefined"))})})})}var Fp=require("@module-federation/enhanced");var nn=h(require("webpack-merge"));C();function Kt(e){return e!==null&&typeof e=="object"&&"constructor"in e?e.constructor.name??"":""}function xp(e,t){let r=Object.entries(e).filter(([n])=>!t.includes(n));return Object.fromEntries(r)}function Pi(e){let{deduplicatePluginNames:t,ModuleFederationPluginClass:r,getPluginOptions:n,filterOverridePlugins:o}=e;return function(s,a,l){let c=["entry","output","target"],d=zy(s),p=Array.isArray(l)?Ri(...l.map(d)):Ri(d(l));Object.keys(p).some(z=>c.includes(z))&&u.warn(`Cannot override blocked properties: ${c.join(", ")}`);let g={...xp(p,[...c,"ModuleFederationPlugin","module","plugins"]),module:xp(p.module??{},["rules"])},y=(0,nn.default)(a,g),x=p.plugins??[];o&&(x=x.filter(o));let T=a.plugins??[],Z=(0,nn.mergeWithCustomize)({customizeArray:(0,nn.unique)("plugins",t,z=>Kt(z))})({plugins:x},{plugins:T}).plugins,b=p?.ModuleFederationPlugin?.shared,G=Z?.map(z=>{if(Kt(z)==="ModuleFederationPlugin"){let M=n(z);return new r({...M,...b?{shared:b}:{}})}return z});y.plugins=G;let me=p.module?.rules;if(me&&typeof me=="function"){let z=a.module?.rules??[];y.module={...y.module??{},rules:me(z)}}return y}}function Ri(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={};for(let r of e){let{module:n,ModuleFederationPlugin:o,plugins:i,...s}=r;if(t={...t,...s},n){let{rules:a,...l}=n;if(t.module={...t.module,...l},a){let c=t.module?.rules;c?t.module.rules=d=>{let p=c(d);return a(p)}:t.module.rules=a}}o?.shared&&(t.ModuleFederationPlugin={shared:{...t.ModuleFederationPlugin?.shared,...o.shared}}),i&&(t.plugins=[...t.plugins??[],...i])}return t}function zy(e){return t=>typeof t=="function"?t(e):t}var qy=Pi({deduplicatePluginNames:["ModuleFederationPlugin","MiniCssExtractPlugin"],ModuleFederationPluginClass:Fp.ModuleFederationPlugin,getPluginOptions:e=>e._options??{}});function Cp(e,t,r){return qy(e,t,r)}var _p=require("@module-federation/enhanced/rspack");var Ky=Pi({deduplicatePluginNames:["ModuleFederationPlugin","CssExtractRspackPlugin"],ModuleFederationPluginClass:_p.ModuleFederationPlugin,getPluginOptions:e=>e._options??{},filterOverridePlugins:e=>Kt(e)!=="MiniCssExtractPlugin"});function kp(e,t,r){return Ky(e,t,r)}var El={[Ip.Framework.React]:{generateWebpackBundlerConfig:dp,generateRspackBundlerConfig:Ai}},Zy={webpack:{generateBaseConfig:lp,getFrameworkConfig:(e,t)=>El[e].generateWebpackBundlerConfig(t),generateFederationConfig:cp,mergeConfigs:(e,t,r)=>Cp(e,t,r),bundle:e=>Dp({...e,config:e.config}),typeCheckerPlugin:Tp.default,hashFunction:"md5",replaceCssPlugin:e=>({...e,plugins:e.plugins?.map(t=>Kt(t)==="MiniCssExtractPlugin"?new Op.default({filename:"[name].[contenthash].css"}):t)})},rspack:{generateBaseConfig:mp,getFrameworkConfig:(e,t)=>El[e].generateRspackBundlerConfig(t),generateFederationConfig:hp,mergeConfigs:(e,t,r)=>kp(e,t,r),bundle:e=>$i({...e,config:e.config}),typeCheckerPlugin:Ap.TsCheckerRspackPlugin,hashFunction:"md4",replaceCssPlugin:e=>({...e,plugins:e.plugins?.map(t=>Kt(t)==="CssExtractRspackPlugin"?new Sp.CssExtractRspackPlugin({filename:"[name].[contenthash].css"}):t)})}},on=e=>Zy[e],$p=e=>!!El[e];var Rp={colors:!0,chunks:!1,modules:!1,chunkModules:!1,reasons:!1,errorDetails:!1,assetsSpace:1/0,warnings:!1,assets:!0,entrypoints:!0,performance:!0};async function ji(e){let t=e.bundler??"webpack";u.debug("Generating entry points...");let{entryPointsVolume:r,paths:n}=qf(e.renderer,e.componentsFiles,e.componentsOptions),o=Np.Volume.fromJSON({"/Server":null,"/Client":null});u.debug("Generating bundling config...");let i=e.overrideConfig??{};Object.keys(i).length&&u.debug("Found bundle config overrides. Merging...");let s=on(t),a=T=>{let P=Yy({env:T,mode:e.dev?"development":"production",framework:e.framework,publicPath:e.publicPath,components:e.componentsFiles,entryPaths:n,libraryName:e.libraryIdentifier,bundler:t}),Z=s.mergeConfigs(T,P,i);return e?.debugBundler&&(u.info(`${t} config for env ${T}:`),u.dir(Z)),Z},l={sourceVolumes:[...e.sourceVolumes,r],outputVolume:o,failOnWarnings:e.failOnWarnings},[c,d]=await Promise.all([s.bundle({...l,config:a(Dr.Environment.Server),outputPath:`/${Dr.Environment.Server}`}),s.bundle({...l,config:a(Dr.Environment.Client),outputPath:`/${Dr.Environment.Client}`})]);e?.debugBundler&&(u.debug(o.toTree()),u.debug(`Server Bundler Stats: ${c.toString(Rp)}`),u.debug(`Client Bundler Stats: ${d.toString(Rp)}`));let p=Xf(o);u.debug("Packaging server bundle...");let m=await ep(c.toJson().assets||[],o,p);u.debug("Packaging client bundle...");let g=await rp(d.toJson().assets||[],o,p),y=T=>P=>[P,T];return{outputFiles:[...m.map(y(Dr.Environment.Server)),...g.map(y(Dr.Environment.Client))],outputVolume:o}}function Yy({env:e,mode:t="production",framework:r,publicPath:n,components:o,entryPaths:i,libraryName:s,outputPath:a,bundler:l="webpack"}){if(!$p(r))throw new Error(`Unknown framework: ${r}`);let c=Object.entries({[Jn]:i[e],...o}).reduce((y,[x,T])=>({...y,[`./${x}`]:`./${(0,Pp.relative)(process.cwd(),T)}`}),{}),d=on(l),p=d.generateBaseConfig({entry:i[e],env:e,mode:t,libraryName:s,publicPath:n,outputPath:a}),m=d.getFrameworkConfig(r,e),g=d.generateFederationConfig({exposes:c,env:e,libraryName:s});return(0,jp.default)(p,m,g)}var Lp=h(require("path")),Fl=require("memfs/lib/volume"),Cl=h(require("webpack-merge")),Wp=h(require("webpack-node-externals")),qe=require("@webflow/data-types");var Xy=h(require("fs")),sn=require("path"),an=require("webpack");function Qy(e,t=Xy){let r=(0,sn.join)(process.cwd(),"node_modules",e);for(;r!==(0,sn.dirname)(r)&&r!=="node_modules";){let n=(0,sn.join)(r,"package.json");if(t.existsSync(n))try{let{name:o,version:i}=JSON.parse(t.readFileSync(n,"utf8"));return`${o}@${i}`}catch{return null}r=(0,sn.dirname)(r)}return null}var Ni=class{apply(t){t.hooks.compilation.tap("ProcessSourceMapsPlugin",function(r){r.hooks.processAssets.tap({name:"ProcessSourceMapsPlugin",stage:an.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE},function(){try{let n=r.getAssets(),o={};Object.values(n).forEach(({name:i,source:s})=>{if(!i.endsWith(".map"))return;let[a,l,c]=i.split("."),d=o[a]?.sources??{},p=o[a]?.dependencies??new Set;JSON.parse(s.source().toString()).sources.forEach(g=>{if(g.startsWith("external")){let y=g.match(/^external \S+ "(.+)"$/)?.[1];if(!y)throw new Error(`Could not extract package name from ${g}`);let x=Qy(y,r.inputFileSystem);if(!x)throw new Error(`Could not find package information for ${y}`);x&&p.add(x)}}),o[a]={sources:{...d,[`./${a}.${c}`]:l},dependencies:p},r.deleteAsset(i)}),Object.entries(o).forEach(([i,{sources:s,dependencies:a}])=>{r.emitAsset(`${i}.js.map`,new an.sources.RawSource(JSON.stringify({sources:s,dependencies:[...a]})))})}catch(n){r.errors.push(new an.WebpackError(`[ProcessSourceMapsPlugin] Could not process source maps: ${n instanceof Error?n.stack:String(n)}`))}})})}};var Bp=h(require("module")),Mp=require("jsdom"),xl="__webflowCliImportModuleWindow__";function eD(e){let r=/^(?:\ufeff?\s*)(?:'use strict'|"use strict");?\s*(?:\r?\n|\r)?/.exec(e),n=!!r,o=`module[${JSON.stringify(xl)}]`,i=[];n||i.push('"use strict";'),i.push(`var __wfW = ${o};`,'if (__wfW == null) { throw new ReferenceError("Webflow CLI internal: missing JSDOM window on module"); }',"var window = __wfW;","var document = __wfW.document;","var navigator = __wfW.navigator;","var HTMLElement = __wfW.HTMLElement;","var localStorage = __wfW.localStorage;","var sessionStorage = __wfW.sessionStorage;","var requestAnimationFrame = __wfW.requestAnimationFrame.bind(__wfW);","var cancelAnimationFrame = __wfW.cancelAnimationFrame.bind(__wfW);","var getComputedStyle = __wfW.getComputedStyle.bind(__wfW);","var performance = __wfW.performance;","");let s=i.join(`
54
+ export default { ${[i,s,a].filter(Boolean).join(", ")} };`}function qf(e,t,r){let n={},o=`${mt}/Client.js`,i=`${mt}/Server.js`;n[o]=Gf([{name:"ClientRenderer",path:e.client,exportKey:"Renderer",type:"internal"}],co.Environment.Client);let s={},a=c=>{let d=Wy(c);return s[d]?(s[d]+=1,`${d}${s[d]}`):(s[d]=1,d)};n[i]=Gf([{name:"ServerRenderer",path:e.server,exportKey:"Renderer",type:"internal"},...Object.entries(t).filter(([c])=>r[c]?.ssr??!0).map(([c,d])=>{let p=a(c),m=d.startsWith(mt)?d.replace(`${mt}/`,"./"):d;return{name:p,path:m,exportKey:c,isDefaultExport:!0,type:"component"}})],co.Environment.Server);let l={[co.Environment.Client]:o,[co.Environment.Server]:i};return{entryPointsVolume:zf.Volume.fromJSON(n),paths:l}}var Np=require("memfs/lib/volume");var Qf=h(require("archiver")),rn=require("path");se();var fo=require("@webflow/data-types");se();C();var qt=e=>e.endsWith("/")||/%2F$/i.test(e)?e:`${e}/`;var Kf=2;function Zf(e){let t={type:fo.ModuleLoader.FEDERATION,version:Kf,entry:ya,renderer:Jn,components:e};return{title:Hn,content:JSON.stringify(t)}}function Yf(e){let t={type:fo.ModuleLoader.SSR,version:Kf,entry:Yr,components:e};return{title:Hn,content:JSON.stringify(t)}}function Xf(e){let t=`/${fo.Environment.Client}/${ya}`;try{if(e.existsSync(t)){let r=e.readFileSync(t,"utf8"),n=JSON.parse(r.toString()),o="publicPath"in n.metaData?n.metaData.publicPath:null;if(!o)throw new Error("Public path not found in module federation manifest");return n.exposes.reduce((i,s)=>{let a=s.name;return a===Jn||(i[a]={css:[]},s.assets.css.sync.forEach(l=>{i[a].css.push(`${qt(o)}${l}`)})),i},{})}}catch(r){u.error(r,{prefix:"Failed to extract components metadata from MF manifest:"})}return{}}var Si=require("@webflow/data-types"),Uy=/\.css$/i;async function ep(e,t,r){let n=!1;return new Promise(async(o,i)=>{e.length===0&&i(new Error("No assets to bundle"));let s=`/${Si.Environment.Server}/${Gn}`,a=(0,Qf.default)("tar",{gzip:!1}),l=t.createWriteStream(s);a.on("error",p=>(n=!0,i(p))),l.on("close",()=>{if(!n)try{let p={type:"asset",name:Gn,info:{},size:a.pointer(),emitted:!0,comparedForEmit:!1,cached:!1};return e.forEach(m=>{let g=(0,rn.resolve)((0,rn.join)(`/${Si.Environment.Server}`,m.name));t.existsSync(g)&&t.rmSync(g)}),o([p])}catch(p){return i(p)}finally{n=!0}}),a.pipe(l);let{title:c,content:d}=Yf(r);a.append(d,{name:c}),e.forEach(p=>{if(!Uy.test(p.name))try{let m=(0,rn.resolve)((0,rn.join)(`/${Si.Environment.Server}`,p.name)),g=t.readFileSync(m,"utf8");a.append(g,{name:p.name})}catch(m){return n=!0,i(m)}}),await a.finalize()})}var tp=require("@webflow/data-types");async function rp(e,t,r){let{title:n,content:o}=Zf(r);await t.promises.writeFile(`/${tp.Environment.Client}/${n}`,o);let i={type:"asset",name:n,info:{},size:o.length,emitted:!0,comparedForEmit:!1,cached:!1};return e.filter(s=>s.name!=="mf-stats.json").concat([i])}var Sp=require("@rspack/core"),Tp=h(require("fork-ts-checker-webpack-plugin")),Ap=require("ts-checker-rspack-plugin"),Op=h(require("mini-css-extract-plugin")),Ip=require("@webflow/data-types");var op=require("webpack"),hl=h(require("mini-css-extract-plugin")),ip=h(require("tsconfig-paths-webpack-plugin")),sp=require("tsconfig-paths"),wl=require("@webflow/data-types"),ap=require("path");se();var np=h(require("postcss-selector-parser")),gl=()=>({postcssPlugin:"CSSinShadowDOM",Once(e){e.walkRules(t=>{t.selector=(0,np.default)(r=>{r.walkPseudos(n=>{n.value===":root"&&(n.value=":host")})}).processSync(t.selector)})}});gl.postcss=!0;gl.postcssPlugin="CSSinShadowDOM";var Ti=gl;function Vy(){return(0,sp.loadConfig)(process.cwd()).resultType==="success"}function lp({entry:e,env:t,mode:r="production",publicPath:n,libraryName:o,outputPath:i}){let s={mode:r,module:{rules:[{test:/\.css$/i,use:[{ident:"mini-css-extract-loader",loader:hl.default.loader},{ident:"css-loader",loader:require.resolve("css-loader"),options:{importLoaders:1}},{ident:"postcss-loader",loader:require.resolve("postcss-loader"),options:{postcssOptions:{plugins:[Ti]}}}]},{test:/\.(png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",generator:{filename:"[hash]-[name][ext]"}}]},plugins:[new hl.default({filename:"[contenthash].css",chunkFilename:"[contenthash].css",runtime:!1})],resolve:{plugins:[Vy()?new ip.default:null].filter(Boolean)},performance:{hints:!1}};if(t===wl.Environment.Client)return{...s,entry:()=>({}),output:{path:i?(0,ap.join)(process.cwd(),i,t):"/",publicPath:n,clean:!0,uniqueName:o},target:"web"};if(t===wl.Environment.Server)return{...s,plugins:[...s.plugins||[],new op.optimize.LimitChunkCountPlugin({maxChunks:1})],entry:e,output:{filename:Yr,library:{type:"commonjs2"}},optimization:{splitChunks:!1},target:"async-node"};throw new Error(`Unknown environment ${t}`)}var up=require("@module-federation/enhanced"),yl=require("@webflow/data-types");function cp({libraryName:e,env:t,exposes:r}){if(t===yl.Environment.Client)return{plugins:[new up.ModuleFederationPlugin({name:e,filename:"remoteEntry.js",exposes:r,dts:!1,experiments:{optimization:{disableSnapshot:!0}}})]};if(t===yl.Environment.Server)return{};throw new Error(`Unknown environment ${t}`)}function dp(){return{module:{rules:[{test:/\.(js|ts)x?$/,exclude:/node_modules/,use:[{ident:"babel-loader",loader:require.resolve("babel-loader"),options:{presets:[require.resolve("@babel/preset-env"),[require.resolve("@babel/preset-react"),{runtime:"automatic"}],require.resolve("@babel/preset-typescript")]}}]}]},resolve:{extensions:[".tsx",".ts",".jsx",".js",".json"]}}}function Ai(){return{module:{rules:[{test:/\.(js|ts)x?$/,exclude:/node_modules/,loader:"builtin:swc-loader",options:{jsc:{parser:{syntax:"typescript",tsx:!0},transform:{react:{runtime:"automatic",development:!1,refresh:!1}}}}}]},resolve:{extensions:[".tsx",".ts",".jsx",".js",".json"]}}}var Oi=require("@rspack/core"),fp=require("tsconfig-paths"),Dl=require("@webflow/data-types"),pp=require("path");se();function Hy(){let e=(0,fp.loadConfig)(process.cwd());if(e.resultType==="success")return e.configFileAbsolutePath}function mp({entry:e,env:t,mode:r="production",publicPath:n,libraryName:o,outputPath:i}){let s={mode:r,module:{rules:[{test:/\.css$/i,use:[{ident:"mini-css-extract-loader",loader:Oi.rspack.CssExtractRspackPlugin.loader},{ident:"css-loader",loader:require.resolve("css-loader"),options:{importLoaders:1}},{ident:"postcss-loader",loader:require.resolve("postcss-loader"),options:{postcssOptions:{plugins:[Ti]}}}],type:"javascript/auto"},{test:/\.(png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",generator:{filename:"[hash]-[name][ext]"}}]},plugins:[new Oi.rspack.CssExtractRspackPlugin({filename:"[contenthash].css",chunkFilename:"[contenthash].css",runtime:!1})],resolve:(()=>{let a=Hy();return a?{tsConfig:{configFile:a}}:{}})(),performance:{hints:!1}};if(t===Dl.Environment.Client)return{...s,entry:()=>({}),output:{path:i?(0,pp.join)(process.cwd(),i,t):"/",publicPath:n,clean:!0,uniqueName:o},target:"web"};if(t===Dl.Environment.Server)return{...s,plugins:[...Array.isArray(s.plugins)?s.plugins:[],new Oi.rspack.optimize.LimitChunkCountPlugin({maxChunks:1})],entry:e,output:{filename:Yr,library:{type:"commonjs2"}},optimization:{splitChunks:!1},target:"async-node"};throw new Error(`Unknown environment ${t}`)}var gp=require("@module-federation/enhanced/rspack"),bl=require("@webflow/data-types");function hp({libraryName:e,env:t,exposes:r}){if(t===bl.Environment.Client)return{plugins:[new gp.ModuleFederationPlugin({name:e,filename:"remoteEntry.js",exposes:r,dts:!1,experiments:{optimization:{disableSnapshot:!0}}})]};if(t===bl.Environment.Server)return{};throw new Error(`Unknown environment ${t}`)}var Gy=h(require("fs")),wp=require("unionfs"),yp=require("webpack");function Jy(e){return{name:e.name,size:e.size,emitted:e.emitted,info:e.info}}function Ii(e){let t=e.toJson();return{hasErrors:()=>e.hasErrors(),hasWarnings:()=>e.hasWarnings(),toString:r=>e.toString(r),toJson:()=>({...t,assets:(t.assets??[]).map(Jy)})}}async function Dp({config:e,sourceVolumes:t=[],outputVolume:r,outputPath:n,failOnWarnings:o=!0}){let i=t.reduce((s,a)=>(s.use(a),s),new wp.Union().use(Gy));return new Promise((s,a)=>{let l=(0,yp.webpack)(e);l.inputFileSystem=i,r&&(l.outputFileSystem=r),n&&(l.outputPath=n),l.run((c,d)=>{l.close(p=>{c||p?a(c||p):d?d.hasErrors()||o&&d.hasWarnings()?a(new Error(d.toString("errors-warnings"))):s(Ii(d)):a(new Error("Webpack stats are undefined"))})})})}var zy=h(require("fs")),vl=h(require("webpack-merge")),bp=require("memfs"),vp=require("unionfs"),Ep=require("@rspack/core");async function $i({config:e,sourceVolumes:t=[],outputVolume:r,outputPath:n,failOnWarnings:o=!0}){let i=t.reduce((a,l)=>(a.use(l),a),new vp.Union().use(zy)),s=e;return t.length>0&&(s=(0,vl.default)(s,{experiments:{...e.experiments,useInputFileSystem:[/./]}})),r&&(s=(0,vl.default)(s,{output:{clean:!1,...n&&{path:n}}})),new Promise((a,l)=>{let c=(0,Ep.rspack)(s);c.inputFileSystem=i,r&&(c.outputFileSystem=(0,bp.createFsFromVolume)(r)),n&&(c.outputPath=n),c.run((d,p)=>{c.close(m=>{d||m?l(d||m):p?p.hasErrors()||o&&p.hasWarnings()?l(new Error(p.toString("errors-warnings"))):a(Ii(p)):l(new Error("Rspack stats are undefined"))})})})}var Fp=require("@module-federation/enhanced");var nn=h(require("webpack-merge"));C();function Kt(e){return e!==null&&typeof e=="object"&&"constructor"in e?e.constructor.name??"":""}function xp(e,t){let r=Object.entries(e).filter(([n])=>!t.includes(n));return Object.fromEntries(r)}function Pi(e){let{deduplicatePluginNames:t,ModuleFederationPluginClass:r,getPluginOptions:n,filterOverridePlugins:o}=e;return function(s,a,l){let c=["entry","output","target"],d=qy(s),p=Array.isArray(l)?Ri(...l.map(d)):Ri(d(l));Object.keys(p).some(z=>c.includes(z))&&u.warn(`Cannot override blocked properties: ${c.join(", ")}`);let g={...xp(p,[...c,"ModuleFederationPlugin","module","plugins"]),module:xp(p.module??{},["rules"])},y=(0,nn.default)(a,g),x=p.plugins??[];o&&(x=x.filter(o));let T=a.plugins??[],Z=(0,nn.mergeWithCustomize)({customizeArray:(0,nn.unique)("plugins",t,z=>Kt(z))})({plugins:x},{plugins:T}).plugins,b=p?.ModuleFederationPlugin?.shared,G=Z?.map(z=>{if(Kt(z)==="ModuleFederationPlugin"){let M=n(z);return new r({...M,...b?{shared:b}:{}})}return z});y.plugins=G;let me=p.module?.rules;if(me&&typeof me=="function"){let z=a.module?.rules??[];y.module={...y.module??{},rules:me(z)}}return y}}function Ri(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={};for(let r of e){let{module:n,ModuleFederationPlugin:o,plugins:i,...s}=r;if(t={...t,...s},n){let{rules:a,...l}=n;if(t.module={...t.module,...l},a){let c=t.module?.rules;c?t.module.rules=d=>{let p=c(d);return a(p)}:t.module.rules=a}}o?.shared&&(t.ModuleFederationPlugin={shared:{...t.ModuleFederationPlugin?.shared,...o.shared}}),i&&(t.plugins=[...t.plugins??[],...i])}return t}function qy(e){return t=>typeof t=="function"?t(e):t}var Ky=Pi({deduplicatePluginNames:["ModuleFederationPlugin","MiniCssExtractPlugin"],ModuleFederationPluginClass:Fp.ModuleFederationPlugin,getPluginOptions:e=>e._options??{}});function Cp(e,t,r){return Ky(e,t,r)}var _p=require("@module-federation/enhanced/rspack");var Zy=Pi({deduplicatePluginNames:["ModuleFederationPlugin","CssExtractRspackPlugin"],ModuleFederationPluginClass:_p.ModuleFederationPlugin,getPluginOptions:e=>e._options??{},filterOverridePlugins:e=>Kt(e)!=="MiniCssExtractPlugin"});function kp(e,t,r){return Zy(e,t,r)}var El={[Ip.Framework.React]:{generateWebpackBundlerConfig:dp,generateRspackBundlerConfig:Ai}},Yy={webpack:{generateBaseConfig:lp,getFrameworkConfig:(e,t)=>El[e].generateWebpackBundlerConfig(t),generateFederationConfig:cp,mergeConfigs:(e,t,r)=>Cp(e,t,r),bundle:e=>Dp({...e,config:e.config}),typeCheckerPlugin:Tp.default,hashFunction:"md5",replaceCssPlugin:e=>({...e,plugins:e.plugins?.map(t=>Kt(t)==="MiniCssExtractPlugin"?new Op.default({filename:"[name].[contenthash].css"}):t)})},rspack:{generateBaseConfig:mp,getFrameworkConfig:(e,t)=>El[e].generateRspackBundlerConfig(t),generateFederationConfig:hp,mergeConfigs:(e,t,r)=>kp(e,t,r),bundle:e=>$i({...e,config:e.config}),typeCheckerPlugin:Ap.TsCheckerRspackPlugin,hashFunction:"md4",replaceCssPlugin:e=>({...e,plugins:e.plugins?.map(t=>Kt(t)==="CssExtractRspackPlugin"?new Sp.CssExtractRspackPlugin({filename:"[name].[contenthash].css"}):t)})}},on=e=>Yy[e],$p=e=>!!El[e];var Rp={colors:!0,chunks:!1,modules:!1,chunkModules:!1,reasons:!1,errorDetails:!1,assetsSpace:1/0,warnings:!1,assets:!0,entrypoints:!0,performance:!0};async function ji(e){let t=e.bundler??"webpack";u.debug("Generating entry points...");let{entryPointsVolume:r,paths:n}=qf(e.renderer,e.componentsFiles,e.componentsOptions),o=Np.Volume.fromJSON({"/Server":null,"/Client":null});u.debug("Generating bundling config...");let i=e.overrideConfig??{};Object.keys(i).length&&u.debug("Found bundle config overrides. Merging...");let s=on(t),a=T=>{let P=Xy({env:T,mode:e.dev?"development":"production",framework:e.framework,publicPath:e.publicPath,components:e.componentsFiles,entryPaths:n,libraryName:e.libraryIdentifier,bundler:t}),Z=s.mergeConfigs(T,P,i);return e?.debugBundler&&(u.info(`${t} config for env ${T}:`),u.dir(Z)),Z},l={sourceVolumes:[...e.sourceVolumes,r],outputVolume:o,failOnWarnings:e.failOnWarnings},[c,d]=await Promise.all([s.bundle({...l,config:a(Dr.Environment.Server),outputPath:`/${Dr.Environment.Server}`}),s.bundle({...l,config:a(Dr.Environment.Client),outputPath:`/${Dr.Environment.Client}`})]);e?.debugBundler&&(u.debug(o.toTree()),u.debug(`Server Bundler Stats: ${c.toString(Rp)}`),u.debug(`Client Bundler Stats: ${d.toString(Rp)}`));let p=Xf(o);u.debug("Packaging server bundle...");let m=await ep(c.toJson().assets||[],o,p);u.debug("Packaging client bundle...");let g=await rp(d.toJson().assets||[],o,p),y=T=>P=>[P,T];return{outputFiles:[...m.map(y(Dr.Environment.Server)),...g.map(y(Dr.Environment.Client))],outputVolume:o}}function Xy({env:e,mode:t="production",framework:r,publicPath:n,components:o,entryPaths:i,libraryName:s,outputPath:a,bundler:l="webpack"}){if(!$p(r))throw new Error(`Unknown framework: ${r}`);let c=Object.entries({[Jn]:i[e],...o}).reduce((y,[x,T])=>({...y,[`./${x}`]:`./${(0,Pp.relative)(process.cwd(),T)}`}),{}),d=on(l),p=d.generateBaseConfig({entry:i[e],env:e,mode:t,libraryName:s,publicPath:n,outputPath:a}),m=d.getFrameworkConfig(r,e),g=d.generateFederationConfig({exposes:c,env:e,libraryName:s});return(0,jp.default)(p,m,g)}var Lp=h(require("path")),Fl=require("memfs/lib/volume"),Cl=h(require("webpack-merge")),Wp=h(require("webpack-node-externals")),qe=require("@webflow/data-types");var Qy=h(require("fs")),sn=require("path"),an=require("webpack");function eD(e,t=Qy){let r=(0,sn.join)(process.cwd(),"node_modules",e);for(;r!==(0,sn.dirname)(r)&&r!=="node_modules";){let n=(0,sn.join)(r,"package.json");if(t.existsSync(n))try{let{name:o,version:i}=JSON.parse(t.readFileSync(n,"utf8"));return`${o}@${i}`}catch{return null}r=(0,sn.dirname)(r)}return null}var Ni=class{apply(t){t.hooks.compilation.tap("ProcessSourceMapsPlugin",function(r){r.hooks.processAssets.tap({name:"ProcessSourceMapsPlugin",stage:an.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE},function(){try{let n=r.getAssets(),o={};Object.values(n).forEach(({name:i,source:s})=>{if(!i.endsWith(".map"))return;let[a,l,c]=i.split("."),d=o[a]?.sources??{},p=o[a]?.dependencies??new Set;JSON.parse(s.source().toString()).sources.forEach(g=>{if(g.startsWith("external")){let y=g.match(/^external \S+ "(.+)"$/)?.[1];if(!y)throw new Error(`Could not extract package name from ${g}`);let x=eD(y,r.inputFileSystem);if(!x)throw new Error(`Could not find package information for ${y}`);x&&p.add(x)}}),o[a]={sources:{...d,[`./${a}.${c}`]:l},dependencies:p},r.deleteAsset(i)}),Object.entries(o).forEach(([i,{sources:s,dependencies:a}])=>{r.emitAsset(`${i}.js.map`,new an.sources.RawSource(JSON.stringify({sources:s,dependencies:[...a]})))})}catch(n){r.errors.push(new an.WebpackError(`[ProcessSourceMapsPlugin] Could not process source maps: ${n instanceof Error?n.stack:String(n)}`))}})})}};var Bp=h(require("module")),Mp=require("jsdom"),xl="__webflowCliImportModuleWindow__";function tD(e){let r=/^(?:\ufeff?\s*)(?:'use strict'|"use strict");?\s*(?:\r?\n|\r)?/.exec(e),n=!!r,o=`module[${JSON.stringify(xl)}]`,i=[];n||i.push('"use strict";'),i.push(`var __wfW = ${o};`,'if (__wfW == null) { throw new ReferenceError("Webflow CLI internal: missing JSDOM window on module"); }',"var window = __wfW;","var document = __wfW.document;","var navigator = __wfW.navigator;","var HTMLElement = __wfW.HTMLElement;","var localStorage = __wfW.localStorage;","var sessionStorage = __wfW.sessionStorage;","var requestAnimationFrame = __wfW.requestAnimationFrame.bind(__wfW);","var cancelAnimationFrame = __wfW.cancelAnimationFrame.bind(__wfW);","var getComputedStyle = __wfW.getComputedStyle.bind(__wfW);","var performance = __wfW.performance;","");let s=i.join(`
55
55
  `)+`
56
- `;return r?e.slice(0,r[0].length)+s+e.slice(r[0].length):s+e}function po(e,t){let r=e.readFileSync(t,"utf-8"),o=new Mp.JSDOM("<!DOCTYPE html><html><body></body></html>",{url:"http://localhost/",pretendToBeVisual:!0}).window,i=eD(r),s=new Bp.default(t,module);Object.defineProperty(s,xl,{value:o,enumerable:!1,configurable:!0,writable:!1});try{return s._compile(i,t),s}finally{Reflect.deleteProperty(s,xl),o.close()}}function tD(e,t){let r=`/${t}.js`,n=po(e,r),o=n.exports.default||n.exports;if(o&&typeof o=="object")try{return(0,qe.parseComponentMetadata)(o)}catch(i){let s=i instanceof Error?i.stack:String(i);throw new Error(`Error parsing component data for '${t}': ${s}`)}throw new Error(`Could not get declaration for '${t}'`)}async function rD({declarations:e,sources:t,overrideConfig:r={},performTypeCheck:n,bundler:o="webpack"}){let i=new Fl.Volume,s=on(o),a=(0,Cl.default)(s.generateBaseConfig({entry:e,env:qe.Environment.Client,publicPath:"/",libraryName:"metadata"}),s.getFrameworkConfig(qe.Framework.React,qe.Environment.Client),{entry:e,mode:"development",output:{path:"/",library:{type:"commonjs2"}},target:"node",plugins:n?[new s.typeCheckerPlugin]:[]}),l=s.mergeConfigs(qe.Environment.Client,a,r);return await s.bundle({outputPath:"/",config:l,sourceVolumes:t?[t]:[],outputVolume:i,failOnWarnings:!1}),i}async function nD({declarations:e,sources:t,overrideConfig:r={},bundler:n}){let o=new Fl.Volume,i=on(n),s=(0,Cl.default)(i.generateBaseConfig({entry:e,env:qe.Environment.Client,publicPath:"/",libraryName:"source-maps"}),i.getFrameworkConfig(qe.Framework.React,qe.Environment.Client),{entry:e,mode:"production",optimization:{mangleExports:"deterministic",moduleIds:"deterministic",chunkIds:"deterministic"},output:{filename:"[name].[contenthash].js",path:"/",library:{type:"commonjs2"},devtoolModuleFilenameTemplate:"[resource-path]",hashFunction:i.hashFunction},externalsPresets:{node:!0},devtool:"source-map",plugins:[new Ni],externals:[(0,Wp.default)()]}),a=i.mergeConfigs(qe.Environment.Client,s,r);return a=i.replaceCssPlugin(a),await i.bundle({outputPath:"/",config:a,sourceVolumes:t?[t]:[],outputVolume:o,failOnWarnings:!1}),o}function oD(e){return Object.entries(e.toJSON()).reduce((t,[r,n])=>{if(r.endsWith(".map")&&n?.length){let o=Lp.default.basename(r).split(".")[0];t[o]=n}return t},{})}async function Bi({declarations:e,sources:t,overrideConfig:r,performTypeCheck:n=!1,skipSourceMaps:o=!1,bundler:i="webpack"}){let[s,a]=await Promise.all([rD({declarations:e,sources:t,overrideConfig:r,performTypeCheck:n,bundler:i}),o||i==="rspack"?Promise.resolve(null):nD({declarations:e,sources:t,overrideConfig:r,bundler:i})]),{metadata:l,options:c}=Object.keys(e).reduce((p,m)=>{let g=tD(s,m);return p.metadata[m]=g,p.options[m]=g.options||{},p},{metadata:{},options:{}});return{sourceMaps:a?oD(a):{},metadata:l,options:c}}function Up(e,{framework:t,sourceMaps:r}){return Object.fromEntries(Object.keys(e).map(n=>[n,{...e[n],id:n,framework:t,exportPath:"default",hash:r[n]}]))}Ie();var Hp=h(require("md5"));Se();ie();W();var _l=" ",Jp=`${_l}${Yo} `;function iD(e){return e==="added"?` ${R("(Added)")}`:e==="removed"?` ${ne("(Removed)")}`:e==="changed"?` ${ce("(Changed)")}`:""}function Vp(e){if(!e)return"";let t=JSON.parse(e);return(0,Hp.default)(JSON.stringify([...Object.values(t.sources),...t.dependencies.filter(r=>!r.includes("@webflow/data-types")&&!r.includes("@webflow/react"))].sort()))}function sD({componentsMetadata:e,latestVersion:t,sourceMaps:r}){let n=t.resource.codeLibraryResource.manifest.components.reduce((s,a)=>(s[a.id]=a,s),{}),o={};return Object.entries(n).forEach(([s,a])=>{if(!e[s])o[s]={component:a,status:"removed"};else{let l=e[s],c=Vp(r[s]),d=a.displayName&&l.displayName!==a.displayName,p=c&&a.hash&&c!==Vp(a.hash),m=d||p;o[s]={component:l,status:m?"changed":"unchanged",previousName:d?a.displayName:void 0}}}),Object.entries(e).forEach(([s,a])=>{n[s]||(o[s]={component:a,status:"added"})}),Object.values(o).map(({component:s,status:a,previousName:l})=>{let c=s.displayName??"Unknown Component",d=l?`${l} ${Fe} ${c}`:c;return`${S(`${Jp}${d}`)}${iD(a)}`}).sort().join(`
57
- `)}function aD({componentsMetadata:e}){return Object.values(e).map(r=>`${S(Jp+(r.displayName??"Unknown Component"))}`).sort().join(`
58
- `)}async function Gp({libraryConfig:e,componentsMetadata:t,existingCodeLibraries:r,sourceMaps:n,workspaceInfo:o}){if(ee())return Promise.resolve(!0);let i=e.id?r.find(({profile:d})=>d.slug===e.id):null,s=i&&i.profile.status==="ACTIVE",a=s?sD({componentsMetadata:t,latestVersion:i,sourceMaps:n}):aD({componentsMetadata:t}),l=s?`Ready to update ${ce(e.name)} on ${Cs(o.name)}?`:`Ready to share ${ce(e.name)} with ${Cs(o.name)}?`;return await Ae({message:`${l}
56
+ `;return r?e.slice(0,r[0].length)+s+e.slice(r[0].length):s+e}function po(e,t){let r=e.readFileSync(t,"utf-8"),o=new Mp.JSDOM("<!DOCTYPE html><html><body></body></html>",{url:"http://localhost/",pretendToBeVisual:!0}).window,i=tD(r),s=new Bp.default(t,module);Object.defineProperty(s,xl,{value:o,enumerable:!1,configurable:!0,writable:!1});try{return s._compile(i,t),s}finally{Reflect.deleteProperty(s,xl),o.close()}}function rD(e,t){let r=`/${t}.js`,n=po(e,r),o=n.exports.default||n.exports;if(o&&typeof o=="object")try{return(0,qe.parseComponentMetadata)(o)}catch(i){let s=i instanceof Error?i.stack:String(i);throw new Error(`Error parsing component data for '${t}': ${s}`)}throw new Error(`Could not get declaration for '${t}'`)}async function nD({declarations:e,sources:t,overrideConfig:r={},performTypeCheck:n,bundler:o="webpack"}){let i=new Fl.Volume,s=on(o),a=(0,Cl.default)(s.generateBaseConfig({entry:e,env:qe.Environment.Client,publicPath:"/",libraryName:"metadata"}),s.getFrameworkConfig(qe.Framework.React,qe.Environment.Client),{entry:e,mode:"development",output:{path:"/",library:{type:"commonjs2"}},target:"node",plugins:n?[new s.typeCheckerPlugin]:[]}),l=s.mergeConfigs(qe.Environment.Client,a,r);return await s.bundle({outputPath:"/",config:l,sourceVolumes:t?[t]:[],outputVolume:i,failOnWarnings:!1}),i}async function oD({declarations:e,sources:t,overrideConfig:r={},bundler:n}){let o=new Fl.Volume,i=on(n),s=(0,Cl.default)(i.generateBaseConfig({entry:e,env:qe.Environment.Client,publicPath:"/",libraryName:"source-maps"}),i.getFrameworkConfig(qe.Framework.React,qe.Environment.Client),{entry:e,mode:"production",optimization:{mangleExports:"deterministic",moduleIds:"deterministic",chunkIds:"deterministic"},output:{filename:"[name].[contenthash].js",path:"/",library:{type:"commonjs2"},devtoolModuleFilenameTemplate:"[resource-path]",hashFunction:i.hashFunction},externalsPresets:{node:!0},devtool:"source-map",plugins:[new Ni],externals:[(0,Wp.default)()]}),a=i.mergeConfigs(qe.Environment.Client,s,r);return a=i.replaceCssPlugin(a),await i.bundle({outputPath:"/",config:a,sourceVolumes:t?[t]:[],outputVolume:o,failOnWarnings:!1}),o}function iD(e){return Object.entries(e.toJSON()).reduce((t,[r,n])=>{if(r.endsWith(".map")&&n?.length){let o=Lp.default.basename(r).split(".")[0];t[o]=n}return t},{})}async function Bi({declarations:e,sources:t,overrideConfig:r,performTypeCheck:n=!1,skipSourceMaps:o=!1,bundler:i="webpack"}){let[s,a]=await Promise.all([nD({declarations:e,sources:t,overrideConfig:r,performTypeCheck:n,bundler:i}),o||i==="rspack"?Promise.resolve(null):oD({declarations:e,sources:t,overrideConfig:r,bundler:i})]),{metadata:l,options:c}=Object.keys(e).reduce((p,m)=>{let g=rD(s,m);return p.metadata[m]=g,p.options[m]=g.options||{},p},{metadata:{},options:{}});return{sourceMaps:a?iD(a):{},metadata:l,options:c}}function Up(e,{framework:t,sourceMaps:r}){return Object.fromEntries(Object.keys(e).map(n=>[n,{...e[n],id:n,framework:t,exportPath:"default",hash:r[n]}]))}Ie();var Hp=h(require("md5"));Se();ie();W();var _l=" ",Jp=`${_l}${Yo} `;function sD(e){return e==="added"?` ${R("(Added)")}`:e==="removed"?` ${ne("(Removed)")}`:e==="changed"?` ${ce("(Changed)")}`:""}function Vp(e){if(!e)return"";let t=JSON.parse(e);return(0,Hp.default)(JSON.stringify([...Object.values(t.sources),...t.dependencies.filter(r=>!r.includes("@webflow/data-types")&&!r.includes("@webflow/react"))].sort()))}function aD({componentsMetadata:e,latestVersion:t,sourceMaps:r}){let n=t.resource.codeLibraryResource.manifest.components.reduce((s,a)=>(s[a.id]=a,s),{}),o={};return Object.entries(n).forEach(([s,a])=>{if(!e[s])o[s]={component:a,status:"removed"};else{let l=e[s],c=Vp(r[s]),d=a.displayName&&l.displayName!==a.displayName,p=c&&a.hash&&c!==Vp(a.hash),m=d||p;o[s]={component:l,status:m?"changed":"unchanged",previousName:d?a.displayName:void 0}}}),Object.entries(e).forEach(([s,a])=>{n[s]||(o[s]={component:a,status:"added"})}),Object.values(o).map(({component:s,status:a,previousName:l})=>{let c=s.displayName??"Unknown Component",d=l?`${l} ${Fe} ${c}`:c;return`${S(`${Jp}${d}`)}${sD(a)}`}).sort().join(`
57
+ `)}function lD({componentsMetadata:e}){return Object.values(e).map(r=>`${S(Jp+(r.displayName??"Unknown Component"))}`).sort().join(`
58
+ `)}async function Gp({libraryConfig:e,componentsMetadata:t,existingCodeLibraries:r,sourceMaps:n,workspaceInfo:o}){if(ee())return Promise.resolve(!0);let i=e.id?r.find(({profile:d})=>d.slug===e.id):null,s=i&&i.profile.status==="ACTIVE",a=s?aD({componentsMetadata:t,latestVersion:i,sourceMaps:n}):lD({componentsMetadata:t}),l=s?`Ready to update ${ce(e.name)} on ${Cs(o.name)}?`:`Ready to share ${ce(e.name)} with ${Cs(o.name)}?`;return await Ae({message:`${l}
59
59
 
60
60
  ${_l}${S("Code components:")}
61
61
  ${a}
62
62
 
63
- ${_l}Confirm to proceed`})}var Mi=require("path"),Kp=require("memfs/lib/volume");var zp=h(require("fast-glob")),lD=e=>{let t=e.split("/");return t[t.length-1]},uD=e=>lD(e).split(".")[0];async function qp(e,t){return(await zp.default.glob(e,{absolute:!0,...t||{}})).reduce((n,o)=>{let i=uD(o);if(n[i])throw new Error(`Duplicate component '${i}' found. Already declared at ${n[i]}, but also found at ${o}.`);return{...n,[i]:o}},{})}async function Li(e){let t=await qp(e.components,{cwd:(0,Mi.dirname)(e.manifestPath),ignore:["**/dist/**","**/node_modules/**",e.globals,e.bundleConfig].filter(o=>o!=null)});if(!Object.keys(t).length)throw new Error("No declaration files found");let{componentsFiles:r,componentsVolume:n}=cD(t,e.renderer.client,e.globals);return{componentsFiles:r,componentsVolume:n}}function cD(e,t,r){let n={},o={};return Object.entries(e).forEach(([i,s])=>{let a=(0,Mi.extname)(s),l=`${mt}/${Jf}/${i}${a}`;n[i]=l,o[l]=dD(t,s,r)}),{componentsFiles:n,componentsVolume:Kp.Volume.fromJSON(o)}}function dD(e,t,r){return r?`
63
+ ${_l}Confirm to proceed`})}var Mi=require("path"),Kp=require("memfs/lib/volume");var zp=h(require("fast-glob")),uD=e=>{let t=e.split("/");return t[t.length-1]},cD=e=>uD(e).split(".")[0];async function qp(e,t){return(await zp.default.glob(e,{absolute:!0,...t||{}})).reduce((n,o)=>{let i=cD(o);if(n[i])throw new Error(`Duplicate component '${i}' found. Already declared at ${n[i]}, but also found at ${o}.`);return{...n,[i]:o}},{})}async function Li(e){let t=await qp(e.components,{cwd:(0,Mi.dirname)(e.manifestPath),ignore:["**/dist/**","**/node_modules/**",e.globals,e.bundleConfig].filter(o=>o!=null)});if(!Object.keys(t).length)throw new Error("No declaration files found");let{componentsFiles:r,componentsVolume:n}=dD(t,e.renderer.client,e.globals);return{componentsFiles:r,componentsVolume:n}}function dD(e,t,r){let n={},o={};return Object.entries(e).forEach(([i,s])=>{let a=(0,Mi.extname)(s),l=`${mt}/${Jf}/${i}${a}`;n[i]=l,o[l]=fD(t,s,r)}),{componentsFiles:n,componentsVolume:Kp.Volume.fromJSON(o)}}function fD(e,t,r){return r?`
64
64
  import { applyDecorators } from "${e}";
65
65
  import componentDefinition from "${t}";
66
66
  const globals = require("${r}") || {};
@@ -86,37 +86,37 @@ export default {...componentDefinition};
86
86
  Resolved path: ${r}
87
87
  Please ensure the file exists or remove the 'globals' field from your manifest.`);t.globals=kt(r)}if(e.bundleConfig){let r=(0,ln.resolve)(process.cwd(),e.bundleConfig);if(!(0,un.existsSync)(r))throw new Error(`Bundle config file not found: ${e.bundleConfig}
88
88
  Resolved path: ${r}
89
- Please ensure the file exists or remove the 'bundleConfig' field from your manifest.`);t.bundleConfig=kt(r)}if(typeof e.renderer=="string"){let r=(0,ln.resolve)(process.cwd(),e.renderer);(0,un.existsSync)(r)&&(t.renderer=kt(r))}else if(typeof e.renderer=="object"&&typeof t.renderer=="object"){if(typeof e.renderer.client=="string"){let r=(0,ln.resolve)(process.cwd(),e.renderer.client);(0,un.existsSync)(r)&&(t.renderer={...t.renderer,client:kt(r)})}if(typeof e.renderer.server=="string"){let r=(0,ln.resolve)(process.cwd(),e.renderer.server);(0,un.existsSync)(r)&&(t.renderer={...t.renderer,server:kt(r)})}}return t}async function fD({initialData:e}){let t=await Ce({message:"Enter a name for your code library",validate:o=>o.trim()===""?"The library name cannot be empty.":!0,default:e?.name});if(t==null)throw new f("When --no-input mode is enabled please provide a name in your library manifest");let r=await Ce({message:"Enter a description for your code library",default:e?.description??""});if(!await Ae({message:"Is the code (including 3rd party packages) you are uploading to Webflow trusted and secure?"}))throw new Error("Code library is not trusted and secure");return{name:t,description:r}}async function pD({existingCodeLibraries:e}){let t={name:"[Create new code library]",value:null},n=[...e].sort((i,s)=>{let a=i.resource.codeLibraryResource.manifest.name??"",l=s.resource.codeLibraryResource.manifest.name??"",c=a.localeCompare(l,void 0,{sensitivity:"base"});return c!==0?c:i.profile.slug.localeCompare(s.profile.slug,void 0,{sensitivity:"base"})}).map(({resource:i,profile:s})=>{let a=`${i.codeLibraryResource.manifest.name} (${s.slug})`;s.status==="ARCHIVED"&&(a+=` ${ne("(Unshared)")}`);let l={id:s.slug,name:i.codeLibraryResource.manifest.name,description:i.codeLibraryResource.manifest.description};return{name:a,value:l}});return await ri({message:"Select an existing code library (or create new):",source:i=>{if(!i)return[t,...n];let s=i.toLowerCase(),a=n.filter(l=>{let c=l.value?.id??"",d=l.value?.name??"",p=l.value?.description??"";return c.toLowerCase().includes(s)||d.toLowerCase().includes(s)||p.toLowerCase().includes(s)});return[t,...a]},pageSize:15})}async function kl({initialData:e,existingCodeLibraries:t}){let r,n={components:Wi.components},o=t.length>0?await pD({existingCodeLibraries:t}):null;if(o)r={...n,...o,...e,id:o.id};else{let a=await fD({initialData:e});r={...n,...e,...a}}let i=Yp(r);ue({library:i}),u.info(`${O} Library configuration updated in webflow.json`);let{path:s}=cr();return{libraryManifest:i,manifestPath:s}}async function Xp({existingCodeLibraries:e}){let t=u.spinner("Looking for webflow.json manifest");try{let{manifest:r,manifestPath:n}=J(),o=Wn(r,"library");if(!o.id){if(st())return t.succeed(),kl({initialData:o,existingCodeLibraries:e});throw new Error("Library manifest does not have an id")}let i=o.name??e.find(({profile:a})=>a.slug===o.id)?.resource.codeLibraryResource.manifest.name;if(!i&&st())return t.succeed(),kl({initialData:o,existingCodeLibraries:e});i||(i=o.id),t.succeed();let s=Yp({...o,name:i});return Promise.resolve({libraryManifest:s,manifestPath:n})}catch(r){if(r instanceof ur&&st())return t.info(r.message),kl({existingCodeLibraries:e});throw t.fail(),r}}var Sl=require("memfs/lib/volume"),tm=h(require("webpack-merge"));var rm="/client-renderer.js",nm="/server-renderer.js",Qp=`${mt}/test-renderers${rm}`,em=`${mt}/test-renderers${nm}`,mD=new Set(["@webflow/react"]),gD=new Set(["@webflow/react/server","@webflow/emotion-utils/server","@webflow/styled-components-utils/server"]);async function om(e){if(!e.client||!e.server)throw new Error("Invalid renderer configuration. Both client and server renderers must be specified.");if(mD.has(e.client)&&gD.has(e.server))return;let t=await yD(e);hD(e.client,t),wD(e.server,t)}function hD(e,t){let r=po(t,rm);if(typeof r.exports.ClientRenderer!="function")throw new Error(`Invalid client renderer: ${e} does not have a valid 'ClientRenderer' export.`);if(typeof r.exports.applyDecorators!="function")throw new Error(`Invalid client renderer: ${e} does not have a valid 'applyDecorators' export.`);let n=()=>null,o=r.exports.ClientRenderer(n),i=["mount","hydrate","render","createSlot"];for(let s of i)if(typeof o[s]!="function")throw new Error(`Invalid client renderer: ${e} ClientRenderer must return an object with a '${s}' function.`)}function wD(e,t){let r=po(t,nm);if(typeof r.exports.ServerRenderer!="function")throw new Error(`Invalid server renderer: ${e} does not have a valid 'ServerRenderer' export.`);let n=()=>null,o=r.exports.ServerRenderer(n),i=["renderToStream","renderToString","prerenderToString","createSlot"];for(let s of i)if(typeof o[s]!="function")throw new Error(`Invalid server renderer: ${e} ServerRenderer must return an object with a '${s}' function.`)}async function yD(e){let t=new Sl.Volume,r=kt(e.client),n=kt(e.server),o={[Qp]:`
89
+ Please ensure the file exists or remove the 'bundleConfig' field from your manifest.`);t.bundleConfig=kt(r)}if(typeof e.renderer=="string"){let r=(0,ln.resolve)(process.cwd(),e.renderer);(0,un.existsSync)(r)&&(t.renderer=kt(r))}else if(typeof e.renderer=="object"&&typeof t.renderer=="object"){if(typeof e.renderer.client=="string"){let r=(0,ln.resolve)(process.cwd(),e.renderer.client);(0,un.existsSync)(r)&&(t.renderer={...t.renderer,client:kt(r)})}if(typeof e.renderer.server=="string"){let r=(0,ln.resolve)(process.cwd(),e.renderer.server);(0,un.existsSync)(r)&&(t.renderer={...t.renderer,server:kt(r)})}}return t}async function pD({initialData:e}){let t=await Ce({message:"Enter a name for your code library",validate:o=>o.trim()===""?"The library name cannot be empty.":!0,default:e?.name});if(t==null)throw new f("When --no-input mode is enabled please provide a name in your library manifest");let r=await Ce({message:"Enter a description for your code library",default:e?.description??""});if(!await Ae({message:"Is the code (including 3rd party packages) you are uploading to Webflow trusted and secure?"}))throw new Error("Code library is not trusted and secure");return{name:t,description:r}}async function mD({existingCodeLibraries:e}){let t={name:"[Create new code library]",value:null},n=[...e].sort((i,s)=>{let a=i.resource.codeLibraryResource.manifest.name??"",l=s.resource.codeLibraryResource.manifest.name??"",c=a.localeCompare(l,void 0,{sensitivity:"base"});return c!==0?c:i.profile.slug.localeCompare(s.profile.slug,void 0,{sensitivity:"base"})}).map(({resource:i,profile:s})=>{let a=`${i.codeLibraryResource.manifest.name} (${s.slug})`;s.status==="ARCHIVED"&&(a+=` ${ne("(Unshared)")}`);let l={id:s.slug,name:i.codeLibraryResource.manifest.name,description:i.codeLibraryResource.manifest.description};return{name:a,value:l}});return await ri({message:"Select an existing code library (or create new):",source:i=>{if(!i)return[t,...n];let s=i.toLowerCase(),a=n.filter(l=>{let c=l.value?.id??"",d=l.value?.name??"",p=l.value?.description??"";return c.toLowerCase().includes(s)||d.toLowerCase().includes(s)||p.toLowerCase().includes(s)});return[t,...a]},pageSize:15})}async function kl({initialData:e,existingCodeLibraries:t}){let r,n={components:Wi.components},o=t.length>0?await mD({existingCodeLibraries:t}):null;if(o)r={...n,...o,...e,id:o.id};else{let a=await pD({initialData:e});r={...n,...e,...a}}let i=Yp(r);ue({library:i}),u.info(`${O} Library configuration updated in webflow.json`);let{path:s}=cr();return{libraryManifest:i,manifestPath:s}}async function Xp({existingCodeLibraries:e}){let t=u.spinner("Looking for webflow.json manifest");try{let{manifest:r,manifestPath:n}=J(),o=Wn(r,"library");if(!o.id){if(st())return t.succeed(),kl({initialData:o,existingCodeLibraries:e});throw new Error("Library manifest does not have an id")}let i=o.name??e.find(({profile:a})=>a.slug===o.id)?.resource.codeLibraryResource.manifest.name;if(!i&&st())return t.succeed(),kl({initialData:o,existingCodeLibraries:e});i||(i=o.id),t.succeed();let s=Yp({...o,name:i});return Promise.resolve({libraryManifest:s,manifestPath:n})}catch(r){if(r instanceof ur&&st())return t.info(r.message),kl({existingCodeLibraries:e});throw t.fail(),r}}var Sl=require("memfs/lib/volume"),tm=h(require("webpack-merge"));var rm="/client-renderer.js",nm="/server-renderer.js",Qp=`${mt}/test-renderers${rm}`,em=`${mt}/test-renderers${nm}`,gD=new Set(["@webflow/react"]),hD=new Set(["@webflow/react/server","@webflow/emotion-utils/server","@webflow/styled-components-utils/server"]);async function om(e){if(!e.client||!e.server)throw new Error("Invalid renderer configuration. Both client and server renderers must be specified.");if(gD.has(e.client)&&hD.has(e.server))return;let t=await DD(e);wD(e.client,t),yD(e.server,t)}function wD(e,t){let r=po(t,rm);if(typeof r.exports.ClientRenderer!="function")throw new Error(`Invalid client renderer: ${e} does not have a valid 'ClientRenderer' export.`);if(typeof r.exports.applyDecorators!="function")throw new Error(`Invalid client renderer: ${e} does not have a valid 'applyDecorators' export.`);let n=()=>null,o=r.exports.ClientRenderer(n),i=["mount","hydrate","render","createSlot"];for(let s of i)if(typeof o[s]!="function")throw new Error(`Invalid client renderer: ${e} ClientRenderer must return an object with a '${s}' function.`)}function yD(e,t){let r=po(t,nm);if(typeof r.exports.ServerRenderer!="function")throw new Error(`Invalid server renderer: ${e} does not have a valid 'ServerRenderer' export.`);let n=()=>null,o=r.exports.ServerRenderer(n),i=["renderToStream","renderToString","prerenderToString","createSlot"];for(let s of i)if(typeof o[s]!="function")throw new Error(`Invalid server renderer: ${e} ServerRenderer must return an object with a '${s}' function.`)}async function DD(e){let t=new Sl.Volume,r=kt(e.client),n=kt(e.server),o={[Qp]:`
90
90
  export * from "${r}";
91
91
  `,[em]:`
92
92
  export * from "${n}";
93
- `},i=(0,tm.default)(Ai(),{entry:{"client-renderer":Qp,"server-renderer":em},mode:"development",output:{path:"/",filename:"[name].js",library:{type:"commonjs2"}},target:"node"});return await $i({config:i,sourceVolumes:[Sl.Volume.fromJSON(o)],outputVolume:t,failOnWarnings:!1}),t}async function Ui({existingCodeLibraries:e}){let{libraryManifest:t,manifestPath:r}=await Xp({existingCodeLibraries:e}),{renderer:n,...o}=Wi,i=typeof t.renderer=="string"?{client:t.renderer,server:t.renderer}:{client:t.renderer?.client??n.client,server:t.renderer?.server??n.server};return i.server==="@webflow/react"&&(i.server="@webflow/react/server"),await om(i),{...o,...t,renderer:i,manifestPath:r}}I();W();async function DD(e,t){let{trackPerformance:r,libraryConfig:n}=e;return await r("collect_metadata",async()=>{let{componentsFiles:o,componentsVolume:i}=await Li(n);u.debug(`Components: ${JSON.stringify(o,null,2)}`);let{sourceMaps:s,metadata:a,options:l}=await Bi({declarations:o,sources:i,overrideConfig:e.overrideConfig,performTypeCheck:Di(o,t),bundler:t?.bundler});return u.debug(`Metadata: ${JSON.stringify(a,null,2)}`),u.debug(`Source Maps:
93
+ `},i=(0,tm.default)(Ai(),{entry:{"client-renderer":Qp,"server-renderer":em},mode:"development",output:{path:"/",filename:"[name].js",library:{type:"commonjs2"}},target:"node"});return await $i({config:i,sourceVolumes:[Sl.Volume.fromJSON(o)],outputVolume:t,failOnWarnings:!1}),t}async function Ui({existingCodeLibraries:e}){let{libraryManifest:t,manifestPath:r}=await Xp({existingCodeLibraries:e}),{renderer:n,...o}=Wi,i=typeof t.renderer=="string"?{client:t.renderer,server:t.renderer}:{client:t.renderer?.client??n.client,server:t.renderer?.server??n.server};return i.server==="@webflow/react"&&(i.server="@webflow/react/server"),await om(i),{...o,...t,renderer:i,manifestPath:r}}I();W();async function bD(e,t){let{trackPerformance:r,libraryConfig:n}=e;return await r("collect_metadata",async()=>{let{componentsFiles:o,componentsVolume:i}=await Li(n);u.debug(`Components: ${JSON.stringify(o,null,2)}`);let{sourceMaps:s,metadata:a,options:l}=await Bi({declarations:o,sources:i,overrideConfig:e.overrideConfig,performTypeCheck:Di(o,t),bundler:t?.bundler});return u.debug(`Metadata: ${JSON.stringify(a,null,2)}`),u.debug(`Source Maps:
94
94
 
95
95
  ${Object.entries(s).reduce((c,[d,p])=>(c+=`${d}: ${JSON.stringify(JSON.parse(p),null,2)}
96
96
 
97
- `,c),"")}`),{componentsFiles:o,componentsVolume:i,componentsMetadata:a,componentsOptions:l,sourceMaps:s}})}async function bD(e,t,r,n,o,i,s){let{trackPerformance:a,libraryConfig:l}=e;return await a("generate_library_bundle",async()=>await ji({libraryIdentifier:`_${o}`,renderer:l.renderer,framework:l.framework,publicPath:qt(i[cn.Environment.Client]),sourceVolumes:[r],componentsFiles:t,componentsOptions:n,debugBundler:s?.debugBundler,dev:s?.dev,overrideConfig:e.overrideConfig,failOnWarnings:!s?.force,bundler:s?.bundler}))}async function vD(e,t,r,n){let{trackPerformance:o,apiOptions:i}=e;return await o("upload_files",async()=>{let s=t.map(([l,c])=>{let d=(0,Vi.resolve)((0,Vi.join)(`/${c}`,`${l.name}`));return lo(r.readFileSync(d,"utf8").toString(),d,{bundleEnvironment:c})}),{signatures:a}=await pl({resourceId:n,files:s.map(({meta:l})=>l),options:i});await Promise.all(a.map(async l=>{let c=s.find(d=>d.meta.fileHash===l.hash);if(!c)throw new Error(`File not found: ${l.hash}`);await uo(c,l.value)}))})}async function ED(e,t,r,n,o){let{trackPerformance:i,libraryConfig:s,apiOptions:a}=e;return await i("share_library",async()=>{let l={clientModule:{bundleUrl:qt(o[cn.Environment.Client])+Hn,loaderType:cn.ModuleLoader.FEDERATION},serverModule:{bundleUrl:qt(o[cn.Environment.Server])+Gn}},c=Up(t,{framework:s.framework,sourceMaps:r}),{taskId:d}=await ml({resourceId:n,codeModule:l,components:Object.values(c),options:a});u.debug(JSON.stringify({taskId:d},null,2))})}async function Tl(e){e?.verbose&&(process.env.DEBUG="true");let t,r=Date.now(),n=await $({apiToken:e?.apiToken});u.debug("Initializing telemetry service...");let o=A.forCodeLibraries({authToken:n}),i=pd(o);try{u.debug("Checking dependencies versions..."),new fr().run();let s={apiToken:n};t=u.spinner("Initializing");let a=await i("get_code_libraries",async()=>await dl({options:s})),{workspace:l,libraries:c}=a;t.succeed(),u.debug("Parsing library config...");let d=await Ui({existingCodeLibraries:c}),p=d.bundleConfig?require(d.bundleConfig):{},m={trackPerformance:i,apiOptions:s,libraryConfig:d,overrideConfig:p};t=u.spinner("Collecting metadata");let{componentsFiles:g,componentsVolume:y,componentsMetadata:x,componentsOptions:T,sourceMaps:P}=await DD(m,e);if(t.succeed(),!await Gp({libraryConfig:d,componentsMetadata:x,existingCodeLibraries:c,sourceMaps:P,workspaceInfo:l}))return;t=u.spinner("Creating code library");let{resourceId:b,profileSlug:G,workspace:me,s3Urls:z,cdnUrls:M}=await i("init_code_library",async()=>await fl({name:d.name,slug:d.id,description:d.description,options:s}));t.succeed(),u.debug(JSON.stringify({resourceId:b,profileSlug:G,s3Urls:z,cdnUrls:M},null,2)),await o.sendUsage("library_initialized",{libraryName:d.name,framework:d.framework,resourceId:b,profileSlug:G}),d.id||(ue({library:{id:G}}),u.info(`${O} Library ID updated in webflow.json`)),t=u.spinner("Compiling code components");let{outputFiles:On,outputVolume:bs}=await bD(m,g,y,T,b,M,e);t.succeed(),await o.sendUsage("bundle_generated",{libraryName:d.name,componentCount:Object.keys(g).length,resourceId:b,profileSlug:G}),t=u.spinner("Uploading files"),await vD(m,On,bs,b),t.succeed(),await o.sendUsage("files_uploaded",{libraryName:d.name,fileCount:On.length,resourceId:b,profileSlug:G}),t=u.spinner("Sharing library"),await ED(m,x,P,b,M),t.succeed(),u.success(`Code library shared successfully${me?.slug?`: ${Zr}/dashboard/workspace/${me?.slug}/shared-libraries-and-templates`:"!"}`);let vs=Date.now()-r;await o.sendUsage("share_library",{duration:vs,componentCount:Object.keys(g).length,libraryName:d.name,framework:d.framework,resourceId:b,profileSlug:G})}catch(s){t?.fail();let a=Date.now()-r;throw await o.sendError(s instanceof Error?s:new Error(String(s)),"share_library",{duration:a}),new f(s)}}var Hi=h(require("fs")),dn=require("path");C();bi();I();var xD="CodeLibrary",FD="dist",CD="http://localhost/";async function Al(e){e.verbose&&(process.env.DEBUG="true");let t;try{u.debug("Checking dependencies versions..."),new fr().run(),u.debug("Looking for manifest...");let r=await Ui({existingCodeLibraries:[]}),n=ki(r.name)||xD,o=`_${e.libraryId||n}`;e?.debugBundler&&u.debug(`Library Config: ${JSON.stringify(r,null,2)}`),t=u.spinner("Collecting metadata");let{componentsFiles:i,componentsVolume:s}=await Li(r);e?.debugBundler&&u.debug(`Components: ${JSON.stringify(i,null,2)}`);let a=r.bundleConfig?require(r.bundleConfig):{},{sourceMaps:l,metadata:c,options:d}=await Bi({declarations:i,sources:s,overrideConfig:a,performTypeCheck:Di(i,e),skipSourceMaps:!e?.debugBundler,bundler:e.bundler});e?.debugBundler&&(u.debug(`Metadata: ${JSON.stringify(c,null,2)}`),u.debug(`Source Maps:
97
+ `,c),"")}`),{componentsFiles:o,componentsVolume:i,componentsMetadata:a,componentsOptions:l,sourceMaps:s}})}async function vD(e,t,r,n,o,i,s){let{trackPerformance:a,libraryConfig:l}=e;return await a("generate_library_bundle",async()=>await ji({libraryIdentifier:`_${o}`,renderer:l.renderer,framework:l.framework,publicPath:qt(i[cn.Environment.Client]),sourceVolumes:[r],componentsFiles:t,componentsOptions:n,debugBundler:s?.debugBundler,dev:s?.dev,overrideConfig:e.overrideConfig,failOnWarnings:!s?.force,bundler:s?.bundler}))}async function ED(e,t,r,n){let{trackPerformance:o,apiOptions:i}=e;return await o("upload_files",async()=>{let s=t.map(([l,c])=>{let d=(0,Vi.resolve)((0,Vi.join)(`/${c}`,`${l.name}`));return lo(r.readFileSync(d,"utf8").toString(),d,{bundleEnvironment:c})}),{signatures:a}=await pl({resourceId:n,files:s.map(({meta:l})=>l),options:i});await Promise.all(a.map(async l=>{let c=s.find(d=>d.meta.fileHash===l.hash);if(!c)throw new Error(`File not found: ${l.hash}`);await uo(c,l.value)}))})}async function xD(e,t,r,n,o){let{trackPerformance:i,libraryConfig:s,apiOptions:a}=e;return await i("share_library",async()=>{let l={clientModule:{bundleUrl:qt(o[cn.Environment.Client])+Hn,loaderType:cn.ModuleLoader.FEDERATION},serverModule:{bundleUrl:qt(o[cn.Environment.Server])+Gn}},c=Up(t,{framework:s.framework,sourceMaps:r}),{taskId:d}=await ml({resourceId:n,codeModule:l,components:Object.values(c),options:a});u.debug(JSON.stringify({taskId:d},null,2))})}async function Tl(e){e?.verbose&&(process.env.DEBUG="true");let t,r=Date.now(),n=await $({apiToken:e?.apiToken});u.debug("Initializing telemetry service...");let o=A.forCodeLibraries({authToken:n}),i=pd(o);try{u.debug("Checking dependencies versions..."),new fr().run();let s={apiToken:n};t=u.spinner("Initializing");let a=await i("get_code_libraries",async()=>await dl({options:s})),{workspace:l,libraries:c}=a;t.succeed(),u.debug("Parsing library config...");let d=await Ui({existingCodeLibraries:c}),p=d.bundleConfig?require(d.bundleConfig):{},m={trackPerformance:i,apiOptions:s,libraryConfig:d,overrideConfig:p};t=u.spinner("Collecting metadata");let{componentsFiles:g,componentsVolume:y,componentsMetadata:x,componentsOptions:T,sourceMaps:P}=await bD(m,e);if(t.succeed(),!await Gp({libraryConfig:d,componentsMetadata:x,existingCodeLibraries:c,sourceMaps:P,workspaceInfo:l}))return;t=u.spinner("Creating code library");let{resourceId:b,profileSlug:G,workspace:me,s3Urls:z,cdnUrls:M}=await i("init_code_library",async()=>await fl({name:d.name,slug:d.id,description:d.description,options:s}));t.succeed(),u.debug(JSON.stringify({resourceId:b,profileSlug:G,s3Urls:z,cdnUrls:M},null,2)),await o.sendUsage("library_initialized",{libraryName:d.name,framework:d.framework,resourceId:b,profileSlug:G}),d.id||(ue({library:{id:G}}),u.info(`${O} Library ID updated in webflow.json`)),t=u.spinner("Compiling code components");let{outputFiles:On,outputVolume:bs}=await vD(m,g,y,T,b,M,e);t.succeed(),await o.sendUsage("bundle_generated",{libraryName:d.name,componentCount:Object.keys(g).length,resourceId:b,profileSlug:G}),t=u.spinner("Uploading files"),await ED(m,On,bs,b),t.succeed(),await o.sendUsage("files_uploaded",{libraryName:d.name,fileCount:On.length,resourceId:b,profileSlug:G}),t=u.spinner("Sharing library"),await xD(m,x,P,b,M),t.succeed(),u.success(`Code library shared successfully${me?.slug?`: ${Zr}/dashboard/workspace/${me?.slug}/shared-libraries-and-templates`:"!"}`);let vs=Date.now()-r;await o.sendUsage("share_library",{duration:vs,componentCount:Object.keys(g).length,libraryName:d.name,framework:d.framework,resourceId:b,profileSlug:G})}catch(s){t?.fail();let a=Date.now()-r;throw await o.sendError(s instanceof Error?s:new Error(String(s)),"share_library",{duration:a}),new f(s)}}var Hi=h(require("fs")),dn=require("path");C();bi();I();var FD="CodeLibrary",CD="dist",_D="http://localhost/";async function Al(e){e.verbose&&(process.env.DEBUG="true");let t;try{u.debug("Checking dependencies versions..."),new fr().run(),u.debug("Looking for manifest...");let r=await Ui({existingCodeLibraries:[]}),n=ki(r.name)||FD,o=`_${e.libraryId||n}`;e?.debugBundler&&u.debug(`Library Config: ${JSON.stringify(r,null,2)}`),t=u.spinner("Collecting metadata");let{componentsFiles:i,componentsVolume:s}=await Li(r);e?.debugBundler&&u.debug(`Components: ${JSON.stringify(i,null,2)}`);let a=r.bundleConfig?require(r.bundleConfig):{},{sourceMaps:l,metadata:c,options:d}=await Bi({declarations:i,sources:s,overrideConfig:a,performTypeCheck:Di(i,e),skipSourceMaps:!e?.debugBundler,bundler:e.bundler});e?.debugBundler&&(u.debug(`Metadata: ${JSON.stringify(c,null,2)}`),u.debug(`Source Maps:
98
98
 
99
99
  ${Object.entries(l).reduce((g,[y,x])=>(g+=`${y}: ${JSON.stringify(JSON.parse(x),null,2)}
100
100
 
101
- `,g),"")}`)),t.succeed(),t=u.spinner("Generating library bundle");let{outputFiles:p,outputVolume:m}=await ji({libraryIdentifier:o,renderer:r.renderer,framework:r.framework,publicPath:qt(e.publicPath||CD),sourceVolumes:[s],componentsFiles:i,componentsOptions:d,debugBundler:e?.debugBundler,dev:e?.dev,overrideConfig:a,failOnWarnings:!e.force,bundler:e.bundler});t.succeed(),t=u.spinner("Writing to disk"),p.forEach(([g,y])=>{let x=(0,dn.join)(`/${y}`,`${g.name}`),T=lo(m.readFileSync(x,"utf8").toString(),x,{bundleEnvironment:y}),P=(0,dn.join)(process.cwd(),e.outputPath||FD);Hi.default.existsSync((0,dn.join)(P,`${y}`))||Hi.default.mkdirSync((0,dn.join)(P,`${y}`),{recursive:!0}),Hi.default.writeFileSync((0,dn.join)(P,y,g.name),T.value.toString())}),t.succeed(),u.success("Code Library bundled successfully!")}catch(r){throw t?.fail(),new f(r)}}C();W();var mo=h(require("fs-extra")),Ol=h(require("path"));C();W();function _D(){try{if(!mo.default.existsSync(Le))return null;let e=mo.default.readdirSync(Le).filter(t=>t.endsWith(".log")).map(t=>({name:t,path:Ol.default.join(Le,t),time:mo.default.statSync(Ol.default.join(Le,t)).mtime.getTime()})).sort((t,r)=>r.time-t.time);if(e.length===0)return null;for(let t of e)try{let n=mo.default.readFileSync(t.path,"utf8").match(/Command: (.+)/);if(n){let o=n[1];if(!/^(log|library\s+log)(\s|$)/.test(o))return t.path}}catch{continue}return null}catch{return null}}async function Il(){let e=_D();e&&u.info(`${Kr} Latest log: ${e}`),u.info(`${Kr} All logs: ${Le}`)}async function im(e){e.command("log").description("Display the logs directory and path to the latest log file, if available.").action(Il)}var $e=require("commander"),$l=()=>new $e.Option("--no-input","Avoid prompting or doing anything interactive. Use this for CI/CD pipelines."),Rl=()=>new $e.Option("--manifest <path>","Path to a manifest.json file or directory containing webflow.json. Default: ./webflow.json"),Pl=()=>new $e.Option("--skip-update-check","Skip checking for @webflow packages updates"),jl=()=>new $e.Option("--verbose","Display more information for debugging purposes."),go=()=>new $e.Option("--api-token <token>","API token. Default: value set in WEBFLOW_API_TOKEN env variable."),We=()=>new $e.Option("-s, --site <site-id>","Site ID. Default: value set in webflow.json config."),de=()=>new $e.Option("--json","Output as JSON"),Ke=()=>new $e.Option("--dry-run","Preview without executing"),Ji=()=>new $e.Option("--order <dir>","Sort direction: asc or desc").default("asc"),St=e=>new $e.Option("--fields <fields>",`Comma-separated fields to display (${e.join(", ")})`),Gi=e=>new $e.Option("--sort-by <field>",`Sort by: ${e.join(", ")}`),zi=()=>new $e.Option("--limit <n>","Maximum number of items to return (default 100)").default("100").argParser(parseInt),qi=()=>new $e.Option("--offset <n>","Number of items to skip (default 0)").default("0").argParser(parseInt),ho=e=>async(t,r)=>{let o={...r.parent?.opts()||{},...t};await e(o)};ie();var kD=`${ne("[Deprecated]")} The 'library' commands will be removed in the next major release.`,SD=()=>{u.warn(`${be} ${ne("webflow library share")} is deprecated and will be removed in the next major release.
101
+ `,g),"")}`)),t.succeed(),t=u.spinner("Generating library bundle");let{outputFiles:p,outputVolume:m}=await ji({libraryIdentifier:o,renderer:r.renderer,framework:r.framework,publicPath:qt(e.publicPath||_D),sourceVolumes:[s],componentsFiles:i,componentsOptions:d,debugBundler:e?.debugBundler,dev:e?.dev,overrideConfig:a,failOnWarnings:!e.force,bundler:e.bundler});t.succeed(),t=u.spinner("Writing to disk"),p.forEach(([g,y])=>{let x=(0,dn.join)(`/${y}`,`${g.name}`),T=lo(m.readFileSync(x,"utf8").toString(),x,{bundleEnvironment:y}),P=(0,dn.join)(process.cwd(),e.outputPath||CD);Hi.default.existsSync((0,dn.join)(P,`${y}`))||Hi.default.mkdirSync((0,dn.join)(P,`${y}`),{recursive:!0}),Hi.default.writeFileSync((0,dn.join)(P,y,g.name),T.value.toString())}),t.succeed(),u.success("Code Library bundled successfully!")}catch(r){throw t?.fail(),new f(r)}}C();W();var mo=h(require("fs-extra")),Ol=h(require("path"));C();W();function kD(){try{if(!mo.default.existsSync(Le))return null;let e=mo.default.readdirSync(Le).filter(t=>t.endsWith(".log")).map(t=>({name:t,path:Ol.default.join(Le,t),time:mo.default.statSync(Ol.default.join(Le,t)).mtime.getTime()})).sort((t,r)=>r.time-t.time);if(e.length===0)return null;for(let t of e)try{let n=mo.default.readFileSync(t.path,"utf8").match(/Command: (.+)/);if(n){let o=n[1];if(!/^(log|library\s+log)(\s|$)/.test(o))return t.path}}catch{continue}return null}catch{return null}}async function Il(){let e=kD();e&&u.info(`${Kr} Latest log: ${e}`),u.info(`${Kr} All logs: ${Le}`)}async function im(e){e.command("log").description("Display the logs directory and path to the latest log file, if available.").action(Il)}var $e=require("commander"),$l=()=>new $e.Option("--no-input","Avoid prompting or doing anything interactive. Use this for CI/CD pipelines."),Rl=()=>new $e.Option("--manifest <path>","Path to a manifest.json file or directory containing webflow.json. Default: ./webflow.json"),Pl=()=>new $e.Option("--skip-update-check","Skip checking for @webflow packages updates"),jl=()=>new $e.Option("--verbose","Display more information for debugging purposes."),go=()=>new $e.Option("--api-token <token>","API token. Default: value set in WEBFLOW_API_TOKEN env variable."),We=()=>new $e.Option("-s, --site <site-id>","Site ID. Default: value set in webflow.json config."),de=()=>new $e.Option("--json","Output as JSON"),Ke=()=>new $e.Option("--dry-run","Preview without executing"),Ji=()=>new $e.Option("--order <dir>","Sort direction: asc or desc").default("asc"),St=e=>new $e.Option("--fields <fields>",`Comma-separated fields to display (${e.join(", ")})`),Gi=e=>new $e.Option("--sort-by <field>",`Sort by: ${e.join(", ")}`),zi=()=>new $e.Option("--limit <n>","Maximum number of items to return (default 100)").default("100").argParser(parseInt),qi=()=>new $e.Option("--offset <n>","Number of items to skip (default 0)").default("0").argParser(parseInt),ho=e=>async(t,r)=>{let o={...r.parent?.opts()||{},...t};await e(o)};ie();var SD=`${ne("[Deprecated]")} The 'library' commands will be removed in the next major release.`,TD=()=>{u.warn(`${be} ${ne("webflow library share")} is deprecated and will be removed in the next major release.
102
102
  Use ${R("webflow devlink import")} instead.
103
- `)},TD=()=>{u.warn(`${be} ${ne("webflow library bundle")} is deprecated and will be removed in the next major release.
103
+ `)},AD=()=>{u.warn(`${be} ${ne("webflow library bundle")} is deprecated and will be removed in the next major release.
104
104
  Use ${R("webflow devlink bundle")} instead.
105
- `)},AD=()=>{u.warn(`${be} ${ne("webflow library log")} is deprecated and will be removed in the next major release.
105
+ `)},OD=()=>{u.warn(`${be} ${ne("webflow library log")} is deprecated and will be removed in the next major release.
106
106
  Use ${R("webflow log")} instead.
107
- `)},OD="Import a library of Code Components into your Webflow Workspace.",ID="Bundle a library of Code Components for local development.",sm=()=>new Zt.Option("-f, --force","Force the bundler to finish compiling, even if there are warnings or type errors."),am=()=>new Zt.Option("--debug-bundler","Display final bundler configurations for debugging purposes."),lm=()=>new Zt.Option("--dev","Bundle in development mode for debugging purposes."),um=()=>new Zt.Option("--bundler <engine>","Bundler to use: webpack or rspack (experimental). Default: webpack").choices(["webpack","rspack"]).default("webpack").hideHelp(),$D=()=>new Zt.Option("--library-id <id>","Set the library identifier to use for the bundle.").hideHelp(),RD=()=>new Zt.Option("--public-path <path>","Set the public path for the bundle."),PD=()=>new Zt.Option("--output-path <path>","Override the output path for the bundle. Default is './dist'");function Nl(e,t){return e.command(t).description(OD).addOption(go()).addOption(sm()).addOption(am()).addOption(lm()).addOption(um()).action(ho(Tl))}function Bl(e,t){return e.command(t).description(ID).addOption($D()).addOption(RD()).addOption(PD()).addOption(sm()).addOption(am()).addOption(lm()).addOption(um()).action(ho(Al))}var cm=e=>{let t=e.command("library").description(kD);Nl(t,"share").description(`${ne("[Deprecated]")} Use 'webflow devlink import' instead.`).hook("preAction",SD),Bl(t,"bundle").description(`${ne("[Deprecated]")} Use 'webflow devlink bundle' instead.`).hook("preAction",TD),t.command("log").description(`${ne("[Deprecated]")} Use 'webflow log' instead.`).hook("preAction",AD).action(Il)};ie();var dm=e=>{let t=e.command("devlink").description("CLI for managing your Webflow Components.");t.command("sync").description(`${ne("[Deprecated]")} Use 'webflow devlink export' instead. Sync your Webflow components to your filesystem.`).argument("[components...]","A list of components to sync. If none is provided, all components will be synced.").addOption(go()).addOption(We()).action(Ef),Nl(t,"import"),Bl(t,"bundle"),t.command("export").description("Export Webflow Components from your Webflow Site.").addOption(go()).addOption(We()).action(ho(Fi))};var Hr=require("commander");var Ot=h(require("fs")),Ze=h(require("path"));C();re();var oe={New:"new",Existing:"existing"},fm="cli",Tt=3,At=39,Ki="astro",pm="cloud-scaffolds";var mm="package.json",br="webflow.json",Zi="wf-placeholder-name",gm="CLOUD_MOUNT_PATH",hm="gitignore";function Ml(e){return!e.siteId}var wo=async(e,t,r=Ki,n,o,i)=>{try{let s,a;if("content"in n){let l=n.content;s=l.files,a=c=>Ze.relative(l.extractionRoot,c).replace(/\\/g,"/")}else{let c=n[r];if(!c)throw new Error(`Scaffold "${r}" not found`);s=c;let d=Ze.join(pm,r);a=p=>p.split(d)[1]?.substring(1).replace(/\\/g,"/")??""}for(let l of s)try{let c=Ze.join(e,a(l)),d=l.includes("next.config.ts"),p=l.includes("astro.config.mjs"),m=d||p;if(l.includes(br)&&Ot.existsSync(c))continue;if(l.includes(mm)||l.includes(br)){let y=(await Ot.promises.readFile(l,"utf8")).replace(Zi,e);await Yi(c,y)}else if(m){let g=await Ot.promises.readFile(l,"utf8");await Yi(c,g.replace(gm,t))}else if(Ze.basename(c).toLowerCase()===hm){let g=await Ot.promises.readFile(l,"utf8"),y=Ze.join(Ze.dirname(c),".gitignore");await Yi(y,g)}else{let g=await Ot.promises.readFile(l);await Yi(c,g)}}catch(c){u.error(`Error processing file ${l}: ${c}`)}if(o&&i)try{Ft({siteId:o,apiToken:i,directory:e})}catch(l){u.error(`Error creating .env file: ${l}`)}}catch(s){throw u.error(`Error applying scaffold: ${s}`),s}};var Yi=async(e,t)=>{try{await Ot.promises.mkdir(Ze.dirname(e),{recursive:!0}),await Ot.promises.writeFile(e,t)}catch(r){throw u.error(`Error writing file ${e}: ${r}`),r}};var Yt=h(require("fs")),wm=h(require("fs-extra")),Xt=h(require("path")),Hl=h(require("os")),ym=h(require("tar"));var ve=class extends Error{constructor(r,n,o){super(r);this.scaffoldId=n;this.supportedIds=o;this.name="ScaffoldError"}};var yo={"astro-minimal":{id:"astro-minimal",name:"Astro",source:{type:"github",repo:"Webflow-Examples/hello-world-astro",ref:"v2"}},"nextjs-minimal":{id:"nextjs-minimal",name:"Next.js",source:{type:"github",repo:"Webflow-Examples/hello-world-nextjs",ref:"v1"}},astro:{id:"astro",name:"Astro (site-attached)",source:{type:"github",repo:"Webflow-Examples/hello-world-astro-devlink",ref:"v2"}},nextjs:{id:"nextjs",name:"Next.js (site-attached)",source:{type:"github",repo:"Webflow-Examples/hello-world-nextjs-devlink",ref:"v1"}}};function Do(e){let t=yo[e];if(!t){let r=Object.keys(yo);throw new ve(`Unsupported framework: "${e}". Supported: ${r.join(", ")}`,e,r)}return t}function Ll(){return Object.keys(yo)}function Wl(){return[...new Set(Ll().map(e=>e.replace(/-minimal$/,"")))]}function Ul(){return["astro","nextjs"]}function Vl(e){let r=`${e.replace(/-minimal$/,"")}-minimal`;if(!yo[r]){let n=Ll();throw new ve(`No minimal scaffold for "${e}". Supported: ${n.join(", ")}`,r,n)}return r}C();var jD="https://github.com";async function Jl(e){let t=e.endsWith("-minimal")?e:Vl(e);return Xi(t)}async function Xi(e){return Do(e).source.type==="github"?ND(e):Dm(e)}async function Dm(e){let t=Do(e);if(t.source.type!=="local")throw new ve(`Scaffold "${e}" does not have a local source`,e);let r=Xt.isAbsolute(t.source.path)?t.source.path:Xt.join(__dirname,t.source.path);if(!Yt.existsSync(r))throw new ve(`Scaffold directory not found: ${r}`,e);let n=await Gl(r);return{scaffoldId:e,files:n,extractionRoot:r}}async function ND(e){let t=Do(e);if(t.source.type!=="github")throw new ve(`Scaffold "${e}" does not have a GitHub source`,e);let r=t.source.ref??"main",n=`${jD}/${t.source.repo}/archive/${r}.tar.gz`,o=await Yt.promises.mkdtemp(Xt.join(Hl.tmpdir(),`webflow-scaffold-${e}-`)),i=u.spinner(`Downloading scaffold (${t.source.repo}@${r})`);try{let s;try{s=await fetch(n,{redirect:"follow",headers:{"User-Agent":"webflow-cli"}})}catch(g){throw i.fail("Download failed"),new ve(`Failed to fetch scaffold from GitHub: ${g instanceof Error?g.message:String(g)}. Repo: ${t.source.repo}, ref: ${r}`,e)}if(!s.ok)throw i.fail(`GitHub returned ${s.status} ${s.statusText}`),new ve(`Failed to fetch scaffold from GitHub: ${s.status} ${s.statusText}. Repo: ${t.source.repo}, ref: ${r}`,e);let a=Buffer.from(await s.arrayBuffer());i.succeed("Downloaded scaffold");let l=u.spinner("Unpacking scaffold");try{await BD(a,o),l.succeed("Scaffold ready")}catch(g){throw l.fail("Unpack failed"),g}let c=await Yt.promises.readdir(o),d=c[0];if(!d||c.length!==1)throw new ve(`Unexpected tarball structure for ${t.source.repo}`,e);let p=Xt.join(o,d),m=await Gl(p);return{scaffoldId:e,files:m,extractionRoot:p}}catch(s){try{wm.default.removeSync(o)}catch{}throw s instanceof ve?s:new ve(`Failed to fetch scaffold "${e}": ${s instanceof Error?s.message:String(s)}`,e)}}async function BD(e,t){let r=Xt.join(Hl.tmpdir(),`webflow-scaffold-${Date.now()}.tar.gz`);await Yt.promises.writeFile(r,new Uint8Array(e.buffer,e.byteOffset,e.byteLength));try{await ym.extract({file:r,cwd:t})}finally{await Yt.promises.unlink(r).catch(()=>{})}}async function Gl(e){let t=[],r=await Yt.promises.readdir(e,{withFileTypes:!0});for(let n of r){let o=Xt.join(e,n.name);n.isDirectory()?t.push(...await Gl(o)):t.push(o)}return t}var gu=h(require("fs-extra"));re();te();var L=h(require("fs")),X=h(require("path")),So=require("child_process"),tg=h(require("tar"));var ke=h(require("fs")),ct=h(require("path"));var B={};zu(B,{BRAND:()=>cb,DIRTY:()=>vr,EMPTY_PATH:()=>UD,INVALID:()=>j,NEVER:()=>qb,OK:()=>_e,ParseStatus:()=>xe,Schema:()=>H,ZodAny:()=>tr,ZodArray:()=>Pt,ZodBigInt:()=>xr,ZodBoolean:()=>Fr,ZodBranded:()=>vo,ZodCatch:()=>Pr,ZodDate:()=>Cr,ZodDefault:()=>Rr,ZodDiscriminatedUnion:()=>ts,ZodEffects:()=>Qe,ZodEnum:()=>Ir,ZodError:()=>Re,ZodFirstPartyTypeKind:()=>N,ZodFunction:()=>ns,ZodIntersection:()=>Tr,ZodIssueCode:()=>w,ZodLazy:()=>Ar,ZodLiteral:()=>Or,ZodMap:()=>wn,ZodNaN:()=>Dn,ZodNativeEnum:()=>$r,ZodNever:()=>lt,ZodNull:()=>kr,ZodNullable:()=>wt,ZodNumber:()=>Er,ZodObject:()=>Pe,ZodOptional:()=>Ye,ZodParsedType:()=>E,ZodPipeline:()=>Eo,ZodPromise:()=>rr,ZodReadonly:()=>jr,ZodRecord:()=>rs,ZodSchema:()=>H,ZodSet:()=>yn,ZodString:()=>er,ZodSymbol:()=>gn,ZodTransformer:()=>Qe,ZodTuple:()=>ht,ZodType:()=>H,ZodUndefined:()=>_r,ZodUnion:()=>Sr,ZodUnknown:()=>Rt,ZodVoid:()=>hn,addIssueToContext:()=>D,any:()=>Db,array:()=>xb,bigint:()=>mb,boolean:()=>Am,coerce:()=>zb,custom:()=>km,date:()=>gb,datetimeRegex:()=>Cm,defaultErrorMap:()=>It,discriminatedUnion:()=>kb,effect:()=>Mb,enum:()=>jb,function:()=>$b,getErrorMap:()=>fn,getParsedType:()=>gt,instanceof:()=>fb,intersection:()=>Sb,isAborted:()=>Qi,isAsync:()=>pn,isDirty:()=>es,isValid:()=>Qt,late:()=>db,lazy:()=>Rb,literal:()=>Pb,makeIssue:()=>bo,map:()=>Ob,nan:()=>pb,nativeEnum:()=>Nb,never:()=>vb,null:()=>yb,nullable:()=>Wb,number:()=>Tm,object:()=>Fb,objectUtil:()=>zl,oboolean:()=>Gb,onumber:()=>Jb,optional:()=>Lb,ostring:()=>Hb,pipeline:()=>Vb,preprocess:()=>Ub,promise:()=>Bb,quotelessJson:()=>MD,record:()=>Ab,set:()=>Ib,setErrorMap:()=>WD,strictObject:()=>Cb,string:()=>Sm,symbol:()=>hb,transformer:()=>Mb,tuple:()=>Tb,undefined:()=>wb,union:()=>_b,unknown:()=>bb,util:()=>q,void:()=>Eb});var q;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(q||(q={}));var zl;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(zl||(zl={}));var E=q.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),gt=e=>{switch(typeof e){case"undefined":return E.undefined;case"string":return E.string;case"number":return Number.isNaN(e)?E.nan:E.number;case"boolean":return E.boolean;case"function":return E.function;case"bigint":return E.bigint;case"symbol":return E.symbol;case"object":return Array.isArray(e)?E.array:e===null?E.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?E.promise:typeof Map<"u"&&e instanceof Map?E.map:typeof Set<"u"&&e instanceof Set?E.set:typeof Date<"u"&&e instanceof Date?E.date:E.object;default:return E.unknown}};var w=q.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),MD=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Re=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,l=0;for(;l<s.path.length;){let c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,q.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Re.create=e=>new Re(e);var LD=(e,t)=>{let r;switch(e.code){case w.invalid_type:e.received===E.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case w.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,q.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:r=`Unrecognized key(s) in object: ${q.joinValues(e.keys,", ")}`;break;case w.invalid_union:r="Invalid input";break;case w.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${q.joinValues(e.options)}`;break;case w.invalid_enum_value:r=`Invalid enum value. Expected ${q.joinValues(e.options)}, received '${e.received}'`;break;case w.invalid_arguments:r="Invalid function arguments";break;case w.invalid_return_type:r="Invalid function return type";break;case w.invalid_date:r="Invalid date";break;case w.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:q.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case w.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case w.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case w.custom:r="Invalid input";break;case w.invalid_intersection_types:r="Intersection results could not be merged";break;case w.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case w.not_finite:r="Number must be finite";break;default:r=t.defaultError,q.assertNever(e)}return{message:r}},It=LD;var bm=It;function WD(e){bm=e}function fn(){return bm}var bo=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",l=n.filter(c=>!!c).slice().reverse();for(let c of l)a=c(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},UD=[];function D(e,t){let r=fn(),n=bo({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===It?void 0:It].filter(o=>!!o)});e.common.issues.push(n)}var xe=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return j;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return j;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},j=Object.freeze({status:"aborted"}),vr=e=>({status:"dirty",value:e}),_e=e=>({status:"valid",value:e}),Qi=e=>e.status==="aborted",es=e=>e.status==="dirty",Qt=e=>e.status==="valid",pn=e=>typeof Promise<"u"&&e instanceof Promise;var k;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(k||(k={}));var Xe=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},vm=(e,t)=>{if(Qt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Re(e.common.issues);return this._error=r,this._error}}};function U(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,a)=>{let{message:l}=e;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??r??a.defaultError}},description:o}}var H=class{get description(){return this._def.description}_getType(t){return gt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:gt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new xe,ctx:{common:t.parent.common,data:t.data,parsedType:gt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(pn(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gt(t)},o=this._parseSync({data:t,path:n.path,parent:n});return vm(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Qt(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Qt(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gt(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(pn(o)?o:Promise.resolve(o));return vm(n,i)}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=t(o),a=()=>i.addIssue({code:w.custom,...n(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Qe({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ye.create(this,this._def)}nullable(){return wt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pt.create(this)}promise(){return rr.create(this,this._def)}or(t){return Sr.create([this,t],this._def)}and(t){return Tr.create(this,t,this._def)}transform(t){return new Qe({...U(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Rr({...U(this._def),innerType:this,defaultValue:r,typeName:N.ZodDefault})}brand(){return new vo({typeName:N.ZodBranded,type:this,...U(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Pr({...U(this._def),innerType:this,catchValue:r,typeName:N.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Eo.create(this,t)}readonly(){return jr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},VD=/^c[^\s-]{8,}$/i,HD=/^[0-9a-z]+$/,JD=/^[0-9A-HJKMNP-TV-Z]{26}$/i,GD=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,zD=/^[a-z0-9_-]{21}$/i,qD=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,KD=/^[-+]?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)?)??$/,ZD=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,YD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ql,XD=/^(?:(?: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])$/,QD=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,eb=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,tb=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nb=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,xm="((\\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])))",ob=new RegExp(`^${xm}$`);function Fm(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function ib(e){return new RegExp(`^${Fm(e)}$`)}function Cm(e){let t=`${xm}T${Fm(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function sb(e,t){return!!((t==="v4"||!t)&&XD.test(e)||(t==="v6"||!t)&&eb.test(e))}function ab(e,t){if(!qD.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function lb(e,t){return!!((t==="v4"||!t)&&QD.test(e)||(t==="v6"||!t)&&tb.test(e))}var er=class e extends H{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==E.string){let i=this._getOrReturnCtx(t);return D(i,{code:w.invalid_type,expected:E.string,received:i.parsedType}),j}let n=new xe,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),D(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),D(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,a=t.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(t,o),s?D(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&D(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")ZD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"email",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")ql||(ql=new RegExp(YD,"u")),ql.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"emoji",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")GD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"uuid",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")zD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"nanoid",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")VD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"cuid",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")HD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"cuid2",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")JD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"ulid",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),D(o,{validation:"url",code:w.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"regex",code:w.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),D(o,{code:w.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),D(o,{code:w.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),D(o,{code:w.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Cm(i).test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{code:w.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?ob.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{code:w.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?ib(i).test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{code:w.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?KD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"duration",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?sb(t.data,i.version)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"ip",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?ab(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"jwt",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?lb(t.data,i.version)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"cidr",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?rb.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"base64",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?nb.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"base64url",code:w.invalid_string,message:i.message}),n.dirty()):q.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:w.invalid_string,...k.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...k.errToObj(t)})}url(t){return this._addCheck({kind:"url",...k.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...k.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...k.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...k.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...k.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...k.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...k.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...k.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...k.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...k.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...k.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...k.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...k.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...k.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...k.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...k.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...k.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...k.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...k.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...k.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...k.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...k.errToObj(r)})}nonempty(t){return this.min(1,k.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};er.create=e=>new er({checks:[],typeName:N.ZodString,coerce:e?.coerce??!1,...U(e)});function ub(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}var Er=class e extends H{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==E.number){let i=this._getOrReturnCtx(t);return D(i,{code:w.invalid_type,expected:E.number,received:i.parsedType}),j}let n,o=new xe;for(let i of this._def.checks)i.kind==="int"?q.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),D(n,{code:w.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:w.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:w.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?ub(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),D(n,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),D(n,{code:w.not_finite,message:i.message}),o.dirty()):q.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,k.toString(r))}gt(t,r){return this.setLimit("min",t,!1,k.toString(r))}lte(t,r){return this.setLimit("max",t,!0,k.toString(r))}lt(t,r){return this.setLimit("max",t,!1,k.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:k.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:k.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:k.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:k.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&q.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Er.create=e=>new Er({checks:[],typeName:N.ZodNumber,coerce:e?.coerce||!1,...U(e)});var xr=class e extends H{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==E.bigint)return this._getInvalidInput(t);let n,o=new xe;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:w.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:w.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),D(n,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):q.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return D(r,{code:w.invalid_type,expected:E.bigint,received:r.parsedType}),j}gte(t,r){return this.setLimit("min",t,!0,k.toString(r))}gt(t,r){return this.setLimit("min",t,!1,k.toString(r))}lte(t,r){return this.setLimit("max",t,!0,k.toString(r))}lt(t,r){return this.setLimit("max",t,!1,k.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:k.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:k.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};xr.create=e=>new xr({checks:[],typeName:N.ZodBigInt,coerce:e?.coerce??!1,...U(e)});var Fr=class extends H{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==E.boolean){let n=this._getOrReturnCtx(t);return D(n,{code:w.invalid_type,expected:E.boolean,received:n.parsedType}),j}return _e(t.data)}};Fr.create=e=>new Fr({typeName:N.ZodBoolean,coerce:e?.coerce||!1,...U(e)});var Cr=class e extends H{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==E.date){let i=this._getOrReturnCtx(t);return D(i,{code:w.invalid_type,expected:E.date,received:i.parsedType}),j}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return D(i,{code:w.invalid_date}),j}let n=new xe,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),D(o,{code:w.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),D(o,{code:w.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):q.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:k.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:k.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Cr.create=e=>new Cr({checks:[],coerce:e?.coerce||!1,typeName:N.ZodDate,...U(e)});var gn=class extends H{_parse(t){if(this._getType(t)!==E.symbol){let n=this._getOrReturnCtx(t);return D(n,{code:w.invalid_type,expected:E.symbol,received:n.parsedType}),j}return _e(t.data)}};gn.create=e=>new gn({typeName:N.ZodSymbol,...U(e)});var _r=class extends H{_parse(t){if(this._getType(t)!==E.undefined){let n=this._getOrReturnCtx(t);return D(n,{code:w.invalid_type,expected:E.undefined,received:n.parsedType}),j}return _e(t.data)}};_r.create=e=>new _r({typeName:N.ZodUndefined,...U(e)});var kr=class extends H{_parse(t){if(this._getType(t)!==E.null){let n=this._getOrReturnCtx(t);return D(n,{code:w.invalid_type,expected:E.null,received:n.parsedType}),j}return _e(t.data)}};kr.create=e=>new kr({typeName:N.ZodNull,...U(e)});var tr=class extends H{constructor(){super(...arguments),this._any=!0}_parse(t){return _e(t.data)}};tr.create=e=>new tr({typeName:N.ZodAny,...U(e)});var Rt=class extends H{constructor(){super(...arguments),this._unknown=!0}_parse(t){return _e(t.data)}};Rt.create=e=>new Rt({typeName:N.ZodUnknown,...U(e)});var lt=class extends H{_parse(t){let r=this._getOrReturnCtx(t);return D(r,{code:w.invalid_type,expected:E.never,received:r.parsedType}),j}};lt.create=e=>new lt({typeName:N.ZodNever,...U(e)});var hn=class extends H{_parse(t){if(this._getType(t)!==E.undefined){let n=this._getOrReturnCtx(t);return D(n,{code:w.invalid_type,expected:E.void,received:n.parsedType}),j}return _e(t.data)}};hn.create=e=>new hn({typeName:N.ZodVoid,...U(e)});var Pt=class e extends H{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==E.array)return D(r,{code:w.invalid_type,expected:E.array,received:r.parsedType}),j;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(D(r,{code:s?w.too_big:w.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(D(r,{code:w.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(D(r,{code:w.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new Xe(r,s,r.path,a)))).then(s=>xe.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new Xe(r,s,r.path,a)));return xe.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:k.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:k.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:k.toString(r)}})}nonempty(t){return this.min(1,t)}};Pt.create=(e,t)=>new Pt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...U(t)});function mn(e){if(e instanceof Pe){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Ye.create(mn(n))}return new Pe({...e._def,shape:()=>t})}else return e instanceof Pt?new Pt({...e._def,type:mn(e.element)}):e instanceof Ye?Ye.create(mn(e.unwrap())):e instanceof wt?wt.create(mn(e.unwrap())):e instanceof ht?ht.create(e.items.map(t=>mn(t))):e}var Pe=class e extends H{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=q.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==E.object){let c=this._getOrReturnCtx(t);return D(c,{code:w.invalid_type,expected:E.object,received:c.parsedType}),j}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof lt&&this._def.unknownKeys==="strip"))for(let c in o.data)s.includes(c)||a.push(c);let l=[];for(let c of s){let d=i[c],p=o.data[c];l.push({key:{status:"valid",value:c},value:d._parse(new Xe(o,p,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof lt){let c=this._def.unknownKeys;if(c==="passthrough")for(let d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(c==="strict")a.length>0&&(D(o,{code:w.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let d of a){let p=o.data[d];l.push({key:{status:"valid",value:d},value:c._parse(new Xe(o,p,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let d of l){let p=await d.key,m=await d.value;c.push({key:p,value:m,alwaysSet:d.alwaysSet})}return c}).then(c=>xe.mergeObjectSync(n,c)):xe.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return k.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:k.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:N.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of q.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of q.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return mn(this)}partial(t){let r={};for(let n of q.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of q.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Ye;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return _m(q.objectKeys(this.shape))}};Pe.create=(e,t)=>new Pe({shape:()=>e,unknownKeys:"strip",catchall:lt.create(),typeName:N.ZodObject,...U(t)});Pe.strictCreate=(e,t)=>new Pe({shape:()=>e,unknownKeys:"strict",catchall:lt.create(),typeName:N.ZodObject,...U(t)});Pe.lazycreate=(e,t)=>new Pe({shape:e,unknownKeys:"strip",catchall:lt.create(),typeName:N.ZodObject,...U(t)});var Sr=class extends H{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new Re(a.ctx.common.issues));return D(r,{code:w.invalid_union,unionErrors:s}),j}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let l of n){let c={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(l=>new Re(l));return D(r,{code:w.invalid_union,unionErrors:a}),j}}get options(){return this._def.options}};Sr.create=(e,t)=>new Sr({options:e,typeName:N.ZodUnion,...U(t)});var $t=e=>e instanceof Ar?$t(e.schema):e instanceof Qe?$t(e.innerType()):e instanceof Or?[e.value]:e instanceof Ir?e.options:e instanceof $r?q.objectValues(e.enum):e instanceof Rr?$t(e._def.innerType):e instanceof _r?[void 0]:e instanceof kr?[null]:e instanceof Ye?[void 0,...$t(e.unwrap())]:e instanceof wt?[null,...$t(e.unwrap())]:e instanceof vo||e instanceof jr?$t(e.unwrap()):e instanceof Pr?$t(e._def.innerType):[],ts=class e extends H{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==E.object)return D(r,{code:w.invalid_type,expected:E.object,received:r.parsedType}),j;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(D(r,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),j)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let s=$t(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new e({typeName:N.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...U(n)})}};function Kl(e,t){let r=gt(e),n=gt(t);if(e===t)return{valid:!0,data:e};if(r===E.object&&n===E.object){let o=q.objectKeys(t),i=q.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let l=Kl(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(r===E.array&&n===E.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],l=Kl(s,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return r===E.date&&n===E.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Tr=class extends H{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(Qi(i)||Qi(s))return j;let a=Kl(i.value,s.value);return a.valid?((es(i)||es(s))&&r.dirty(),{status:r.value,value:a.data}):(D(n,{code:w.invalid_intersection_types}),j)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Tr.create=(e,t,r)=>new Tr({left:e,right:t,typeName:N.ZodIntersection,...U(r)});var ht=class e extends H{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==E.array)return D(n,{code:w.invalid_type,expected:E.array,received:n.parsedType}),j;if(n.data.length<this._def.items.length)return D(n,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&n.data.length>this._def.items.length&&(D(n,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new Xe(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>xe.mergeArray(r,s)):xe.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ht.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ht({items:e,typeName:N.ZodTuple,rest:null,...U(t)})};var rs=class e extends H{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==E.object)return D(n,{code:w.invalid_type,expected:E.object,received:n.parsedType}),j;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new Xe(n,a,n.path,a)),value:s._parse(new Xe(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?xe.mergeObjectAsync(r,o):xe.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof H?new e({keyType:t,valueType:r,typeName:N.ZodRecord,...U(n)}):new e({keyType:er.create(),valueType:t,typeName:N.ZodRecord,...U(r)})}},wn=class extends H{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==E.map)return D(n,{code:w.invalid_type,expected:E.map,received:n.parsedType}),j;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,l],c)=>({key:o._parse(new Xe(n,a,n.path,[c,"key"])),value:i._parse(new Xe(n,l,n.path,[c,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let c=await l.key,d=await l.value;if(c.status==="aborted"||d.status==="aborted")return j;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(c.value,d.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let l of s){let c=l.key,d=l.value;if(c.status==="aborted"||d.status==="aborted")return j;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(c.value,d.value)}return{status:r.value,value:a}}}};wn.create=(e,t,r)=>new wn({valueType:t,keyType:e,typeName:N.ZodMap,...U(r)});var yn=class e extends H{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==E.set)return D(n,{code:w.invalid_type,expected:E.set,received:n.parsedType}),j;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(D(n,{code:w.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(D(n,{code:w.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(l){let c=new Set;for(let d of l){if(d.status==="aborted")return j;d.status==="dirty"&&r.dirty(),c.add(d.value)}return{status:r.value,value:c}}let a=[...n.data.values()].map((l,c)=>i._parse(new Xe(n,l,n.path,c)));return n.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:k.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:k.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};yn.create=(e,t)=>new yn({valueType:e,minSize:null,maxSize:null,typeName:N.ZodSet,...U(t)});var ns=class e extends H{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==E.function)return D(r,{code:w.invalid_type,expected:E.function,received:r.parsedType}),j;function n(a,l){return bo({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,fn(),It].filter(c=>!!c),issueData:{code:w.invalid_arguments,argumentsError:l}})}function o(a,l){return bo({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,fn(),It].filter(c=>!!c),issueData:{code:w.invalid_return_type,returnTypeError:l}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof rr){let a=this;return _e(async function(...l){let c=new Re([]),d=await a._def.args.parseAsync(l,i).catch(g=>{throw c.addIssue(n(l,g)),c}),p=await Reflect.apply(s,this,d);return await a._def.returns._def.type.parseAsync(p,i).catch(g=>{throw c.addIssue(o(p,g)),c})})}else{let a=this;return _e(function(...l){let c=a._def.args.safeParse(l,i);if(!c.success)throw new Re([n(l,c.error)]);let d=Reflect.apply(s,this,c.data),p=a._def.returns.safeParse(d,i);if(!p.success)throw new Re([o(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ht.create(t).rest(Rt.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ht.create([]).rest(Rt.create()),returns:r||Rt.create(),typeName:N.ZodFunction,...U(n)})}},Ar=class extends H{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ar.create=(e,t)=>new Ar({getter:e,typeName:N.ZodLazy,...U(t)});var Or=class extends H{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return D(r,{received:r.data,code:w.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:t.data}}get value(){return this._def.value}};Or.create=(e,t)=>new Or({value:e,typeName:N.ZodLiteral,...U(t)});function _m(e,t){return new Ir({values:e,typeName:N.ZodEnum,...U(t)})}var Ir=class e extends H{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return D(r,{expected:q.joinValues(n),received:r.parsedType,code:w.invalid_type}),j}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return D(r,{received:r.data,code:w.invalid_enum_value,options:n}),j}return _e(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ir.create=_m;var $r=class extends H{_parse(t){let r=q.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==E.string&&n.parsedType!==E.number){let o=q.objectValues(r);return D(n,{expected:q.joinValues(o),received:n.parsedType,code:w.invalid_type}),j}if(this._cache||(this._cache=new Set(q.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=q.objectValues(r);return D(n,{received:n.data,code:w.invalid_enum_value,options:o}),j}return _e(t.data)}get enum(){return this._def.values}};$r.create=(e,t)=>new $r({values:e,typeName:N.ZodNativeEnum,...U(t)});var rr=class extends H{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==E.promise&&r.common.async===!1)return D(r,{code:w.invalid_type,expected:E.promise,received:r.parsedType}),j;let n=r.parsedType===E.promise?r.data:Promise.resolve(r.data);return _e(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};rr.create=(e,t)=>new rr({type:e,typeName:N.ZodPromise,...U(t)});var Qe=class extends H{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{D(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return j;let l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?j:l.status==="dirty"?vr(l.value):r.value==="dirty"?vr(l.value):l});{if(r.value==="aborted")return j;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?j:a.status==="dirty"?vr(a.value):r.value==="dirty"?vr(a.value):a}}if(o.type==="refinement"){let s=a=>{let l=o.refinement(a,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?j:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?j:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Qt(s))return j;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Qt(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):j);q.assertNever(o)}};Qe.create=(e,t,r)=>new Qe({schema:e,typeName:N.ZodEffects,effect:t,...U(r)});Qe.createWithPreprocess=(e,t,r)=>new Qe({schema:t,effect:{type:"preprocess",transform:e},typeName:N.ZodEffects,...U(r)});var Ye=class extends H{_parse(t){return this._getType(t)===E.undefined?_e(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ye.create=(e,t)=>new Ye({innerType:e,typeName:N.ZodOptional,...U(t)});var wt=class extends H{_parse(t){return this._getType(t)===E.null?_e(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};wt.create=(e,t)=>new wt({innerType:e,typeName:N.ZodNullable,...U(t)});var Rr=class extends H{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===E.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Rr.create=(e,t)=>new Rr({innerType:e,typeName:N.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...U(t)});var Pr=class extends H{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return pn(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Re(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Re(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Pr.create=(e,t)=>new Pr({innerType:e,typeName:N.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...U(t)});var Dn=class extends H{_parse(t){if(this._getType(t)!==E.nan){let n=this._getOrReturnCtx(t);return D(n,{code:w.invalid_type,expected:E.nan,received:n.parsedType}),j}return{status:"valid",value:t.data}}};Dn.create=e=>new Dn({typeName:N.ZodNaN,...U(e)});var cb=Symbol("zod_brand"),vo=class extends H{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Eo=class e extends H{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?j:i.status==="dirty"?(r.dirty(),vr(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?j:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:N.ZodPipeline})}},jr=class extends H{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Qt(o)&&(o.value=Object.freeze(o.value)),o);return pn(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};jr.create=(e,t)=>new jr({innerType:e,typeName:N.ZodReadonly,...U(t)});function Em(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function km(e,t={},r){return e?tr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=Em(t,n),l=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:l})}});if(!i){let s=Em(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):tr.create()}var db={object:Pe.lazycreate},N;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(N||(N={}));var fb=(e,t={message:`Input not instance of ${e.name}`})=>km(r=>r instanceof e,t),Sm=er.create,Tm=Er.create,pb=Dn.create,mb=xr.create,Am=Fr.create,gb=Cr.create,hb=gn.create,wb=_r.create,yb=kr.create,Db=tr.create,bb=Rt.create,vb=lt.create,Eb=hn.create,xb=Pt.create,Fb=Pe.create,Cb=Pe.strictCreate,_b=Sr.create,kb=ts.create,Sb=Tr.create,Tb=ht.create,Ab=rs.create,Ob=wn.create,Ib=yn.create,$b=ns.create,Rb=Ar.create,Pb=Or.create,jb=Ir.create,Nb=$r.create,Bb=rr.create,Mb=Qe.create,Lb=Ye.create,Wb=wt.create,Ub=Qe.createWithPreprocess,Vb=Eo.create,Hb=()=>Sm().optional(),Jb=()=>Tm().optional(),Gb=()=>Am().optional(),zb={string:(e=>er.create({...e,coerce:!0})),number:(e=>Er.create({...e,coerce:!0})),boolean:(e=>Fr.create({...e,coerce:!0})),bigint:(e=>xr.create({...e,coerce:!0})),date:(e=>Cr.create({...e,coerce:!0}))};var qb=j;function os(e,t=!1){let r=e.length,n=0,o="",i=0,s=16,a=0,l=0,c=0,d=0,p=0;function m(b,G){let me=0,z=0;for(;me<b||!G;){let M=e.charCodeAt(n);if(M>=48&&M<=57)z=z*16+M-48;else if(M>=65&&M<=70)z=z*16+M-65+10;else if(M>=97&&M<=102)z=z*16+M-97+10;else break;n++,me++}return me<b&&(z=-1),z}function g(b){n=b,o="",i=0,s=16,p=0}function y(){let b=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&bn(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&bn(e.charCodeAt(n)))for(n++;n<e.length&&bn(e.charCodeAt(n));)n++;else return p=3,e.substring(b,n);let G=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&bn(e.charCodeAt(n))){for(n++;n<e.length&&bn(e.charCodeAt(n));)n++;G=n}else p=3;return e.substring(b,G)}function x(){let b="",G=n;for(;;){if(n>=r){b+=e.substring(G,n),p=2;break}let me=e.charCodeAt(n);if(me===34){b+=e.substring(G,n),n++;break}if(me===92){if(b+=e.substring(G,n),n++,n>=r){p=2;break}switch(e.charCodeAt(n++)){case 34:b+='"';break;case 92:b+="\\";break;case 47:b+="/";break;case 98:b+="\b";break;case 102:b+="\f";break;case 110:b+=`
107
+ `)},ID="Import a library of Code Components into your Webflow Workspace.",$D="Bundle a library of Code Components for local development.",sm=()=>new Zt.Option("-f, --force","Force the bundler to finish compiling, even if there are warnings or type errors."),am=()=>new Zt.Option("--debug-bundler","Display final bundler configurations for debugging purposes."),lm=()=>new Zt.Option("--dev","Bundle in development mode for debugging purposes."),um=()=>new Zt.Option("--bundler <engine>","Bundler to use: webpack or rspack (experimental). Default: webpack").choices(["webpack","rspack"]).default("webpack").hideHelp(),RD=()=>new Zt.Option("--library-id <id>","Set the library identifier to use for the bundle.").hideHelp(),PD=()=>new Zt.Option("--public-path <path>","Set the public path for the bundle."),jD=()=>new Zt.Option("--output-path <path>","Override the output path for the bundle. Default is './dist'");function Nl(e,t){return e.command(t).description(ID).addOption(go()).addOption(sm()).addOption(am()).addOption(lm()).addOption(um()).action(ho(Tl))}function Bl(e,t){return e.command(t).description($D).addOption(RD()).addOption(PD()).addOption(jD()).addOption(sm()).addOption(am()).addOption(lm()).addOption(um()).action(ho(Al))}var cm=e=>{let t=e.command("library").description(SD);Nl(t,"share").description(`${ne("[Deprecated]")} Use 'webflow devlink import' instead.`).hook("preAction",TD),Bl(t,"bundle").description(`${ne("[Deprecated]")} Use 'webflow devlink bundle' instead.`).hook("preAction",AD),t.command("log").description(`${ne("[Deprecated]")} Use 'webflow log' instead.`).hook("preAction",OD).action(Il)};ie();var dm=e=>{let t=e.command("devlink").description("CLI for managing your Webflow Components.");t.command("sync").description(`${ne("[Deprecated]")} Use 'webflow devlink export' instead. Sync your Webflow components to your filesystem.`).argument("[components...]","A list of components to sync. If none is provided, all components will be synced.").addOption(go()).addOption(We()).action(Ef),Nl(t,"import"),Bl(t,"bundle"),t.command("export").description("Export Webflow Components from your Webflow Site.").addOption(go()).addOption(We()).action(ho(Fi))};var Hr=require("commander");var Ot=h(require("fs")),Ze=h(require("path"));C();re();var oe={New:"new",Existing:"existing"},fm="cli",Tt=3,At=39,Ki="astro",pm="cloud-scaffolds";var mm="package.json",br="webflow.json",Zi="wf-placeholder-name",gm="CLOUD_MOUNT_PATH",hm="gitignore";function Ml(e){return!e.siteId}var wo=async(e,t,r=Ki,n,o,i)=>{try{let s,a;if("content"in n){let l=n.content;s=l.files,a=c=>Ze.relative(l.extractionRoot,c).replace(/\\/g,"/")}else{let c=n[r];if(!c)throw new Error(`Scaffold "${r}" not found`);s=c;let d=Ze.join(pm,r);a=p=>p.split(d)[1]?.substring(1).replace(/\\/g,"/")??""}for(let l of s)try{let c=Ze.join(e,a(l)),d=l.includes("next.config.ts"),p=l.includes("astro.config.mjs"),m=d||p;if(l.includes(br)&&Ot.existsSync(c))continue;if(l.includes(mm)||l.includes(br)){let y=(await Ot.promises.readFile(l,"utf8")).replace(Zi,e);await Yi(c,y)}else if(m){let g=await Ot.promises.readFile(l,"utf8");await Yi(c,g.replace(gm,t))}else if(Ze.basename(c).toLowerCase()===hm){let g=await Ot.promises.readFile(l,"utf8"),y=Ze.join(Ze.dirname(c),".gitignore");await Yi(y,g)}else{let g=await Ot.promises.readFile(l);await Yi(c,g)}}catch(c){u.error(`Error processing file ${l}: ${c}`)}if(o&&i)try{Ft({siteId:o,apiToken:i,directory:e})}catch(l){u.error(`Error creating .env file: ${l}`)}}catch(s){throw u.error(`Error applying scaffold: ${s}`),s}};var Yi=async(e,t)=>{try{await Ot.promises.mkdir(Ze.dirname(e),{recursive:!0}),await Ot.promises.writeFile(e,t)}catch(r){throw u.error(`Error writing file ${e}: ${r}`),r}};var Yt=h(require("fs")),wm=h(require("fs-extra")),Xt=h(require("path")),Hl=h(require("os")),ym=h(require("tar"));var ve=class extends Error{constructor(r,n,o){super(r);this.scaffoldId=n;this.supportedIds=o;this.name="ScaffoldError"}};var yo={"astro-minimal":{id:"astro-minimal",name:"Astro",source:{type:"github",repo:"Webflow-Examples/hello-world-astro",ref:"v2"}},"nextjs-minimal":{id:"nextjs-minimal",name:"Next.js",source:{type:"github",repo:"Webflow-Examples/hello-world-nextjs",ref:"v1"}},astro:{id:"astro",name:"Astro (site-attached)",source:{type:"github",repo:"Webflow-Examples/hello-world-astro-devlink",ref:"v2"}},nextjs:{id:"nextjs",name:"Next.js (site-attached)",source:{type:"github",repo:"Webflow-Examples/hello-world-nextjs-devlink",ref:"v1"}}};function Do(e){let t=yo[e];if(!t){let r=Object.keys(yo);throw new ve(`Unsupported framework: "${e}". Supported: ${r.join(", ")}`,e,r)}return t}function Ll(){return Object.keys(yo)}function Wl(){return[...new Set(Ll().map(e=>e.replace(/-minimal$/,"")))]}function Ul(){return["astro","nextjs"]}function Vl(e){let r=`${e.replace(/-minimal$/,"")}-minimal`;if(!yo[r]){let n=Ll();throw new ve(`No minimal scaffold for "${e}". Supported: ${n.join(", ")}`,r,n)}return r}C();var ND="https://github.com";async function Jl(e){let t=e.endsWith("-minimal")?e:Vl(e);return Xi(t)}async function Xi(e){return Do(e).source.type==="github"?BD(e):Dm(e)}async function Dm(e){let t=Do(e);if(t.source.type!=="local")throw new ve(`Scaffold "${e}" does not have a local source`,e);let r=Xt.isAbsolute(t.source.path)?t.source.path:Xt.join(__dirname,t.source.path);if(!Yt.existsSync(r))throw new ve(`Scaffold directory not found: ${r}`,e);let n=await Gl(r);return{scaffoldId:e,files:n,extractionRoot:r}}async function BD(e){let t=Do(e);if(t.source.type!=="github")throw new ve(`Scaffold "${e}" does not have a GitHub source`,e);let r=t.source.ref??"main",n=`${ND}/${t.source.repo}/archive/${r}.tar.gz`,o=await Yt.promises.mkdtemp(Xt.join(Hl.tmpdir(),`webflow-scaffold-${e}-`)),i=u.spinner(`Downloading scaffold (${t.source.repo}@${r})`);try{let s;try{s=await fetch(n,{redirect:"follow",headers:{"User-Agent":"webflow-cli"}})}catch(g){throw i.fail("Download failed"),new ve(`Failed to fetch scaffold from GitHub: ${g instanceof Error?g.message:String(g)}. Repo: ${t.source.repo}, ref: ${r}`,e)}if(!s.ok)throw i.fail(`GitHub returned ${s.status} ${s.statusText}`),new ve(`Failed to fetch scaffold from GitHub: ${s.status} ${s.statusText}. Repo: ${t.source.repo}, ref: ${r}`,e);let a=Buffer.from(await s.arrayBuffer());i.succeed("Downloaded scaffold");let l=u.spinner("Unpacking scaffold");try{await MD(a,o),l.succeed("Scaffold ready")}catch(g){throw l.fail("Unpack failed"),g}let c=await Yt.promises.readdir(o),d=c[0];if(!d||c.length!==1)throw new ve(`Unexpected tarball structure for ${t.source.repo}`,e);let p=Xt.join(o,d),m=await Gl(p);return{scaffoldId:e,files:m,extractionRoot:p}}catch(s){try{wm.default.removeSync(o)}catch{}throw s instanceof ve?s:new ve(`Failed to fetch scaffold "${e}": ${s instanceof Error?s.message:String(s)}`,e)}}async function MD(e,t){let r=Xt.join(Hl.tmpdir(),`webflow-scaffold-${Date.now()}.tar.gz`);await Yt.promises.writeFile(r,new Uint8Array(e.buffer,e.byteOffset,e.byteLength));try{await ym.extract({file:r,cwd:t})}finally{await Yt.promises.unlink(r).catch(()=>{})}}async function Gl(e){let t=[],r=await Yt.promises.readdir(e,{withFileTypes:!0});for(let n of r){let o=Xt.join(e,n.name);n.isDirectory()?t.push(...await Gl(o)):t.push(o)}return t}var gu=h(require("fs-extra"));re();te();var L=h(require("fs")),X=h(require("path")),So=require("child_process"),tg=h(require("tar"));var ke=h(require("fs")),ct=h(require("path"));var B={};zu(B,{BRAND:()=>db,DIRTY:()=>vr,EMPTY_PATH:()=>VD,INVALID:()=>j,NEVER:()=>Kb,OK:()=>_e,ParseStatus:()=>xe,Schema:()=>H,ZodAny:()=>tr,ZodArray:()=>Pt,ZodBigInt:()=>xr,ZodBoolean:()=>Fr,ZodBranded:()=>vo,ZodCatch:()=>Pr,ZodDate:()=>Cr,ZodDefault:()=>Rr,ZodDiscriminatedUnion:()=>ts,ZodEffects:()=>Qe,ZodEnum:()=>Ir,ZodError:()=>Re,ZodFirstPartyTypeKind:()=>N,ZodFunction:()=>ns,ZodIntersection:()=>Tr,ZodIssueCode:()=>w,ZodLazy:()=>Ar,ZodLiteral:()=>Or,ZodMap:()=>wn,ZodNaN:()=>Dn,ZodNativeEnum:()=>$r,ZodNever:()=>lt,ZodNull:()=>kr,ZodNullable:()=>wt,ZodNumber:()=>Er,ZodObject:()=>Pe,ZodOptional:()=>Ye,ZodParsedType:()=>E,ZodPipeline:()=>Eo,ZodPromise:()=>rr,ZodReadonly:()=>jr,ZodRecord:()=>rs,ZodSchema:()=>H,ZodSet:()=>yn,ZodString:()=>er,ZodSymbol:()=>gn,ZodTransformer:()=>Qe,ZodTuple:()=>ht,ZodType:()=>H,ZodUndefined:()=>_r,ZodUnion:()=>Sr,ZodUnknown:()=>Rt,ZodVoid:()=>hn,addIssueToContext:()=>D,any:()=>bb,array:()=>Fb,bigint:()=>gb,boolean:()=>Am,coerce:()=>qb,custom:()=>km,date:()=>hb,datetimeRegex:()=>Cm,defaultErrorMap:()=>It,discriminatedUnion:()=>Sb,effect:()=>Lb,enum:()=>Nb,function:()=>Rb,getErrorMap:()=>fn,getParsedType:()=>gt,instanceof:()=>pb,intersection:()=>Tb,isAborted:()=>Qi,isAsync:()=>pn,isDirty:()=>es,isValid:()=>Qt,late:()=>fb,lazy:()=>Pb,literal:()=>jb,makeIssue:()=>bo,map:()=>Ib,nan:()=>mb,nativeEnum:()=>Bb,never:()=>Eb,null:()=>Db,nullable:()=>Ub,number:()=>Tm,object:()=>Cb,objectUtil:()=>zl,oboolean:()=>zb,onumber:()=>Gb,optional:()=>Wb,ostring:()=>Jb,pipeline:()=>Hb,preprocess:()=>Vb,promise:()=>Mb,quotelessJson:()=>LD,record:()=>Ob,set:()=>$b,setErrorMap:()=>UD,strictObject:()=>_b,string:()=>Sm,symbol:()=>wb,transformer:()=>Lb,tuple:()=>Ab,undefined:()=>yb,union:()=>kb,unknown:()=>vb,util:()=>q,void:()=>xb});var q;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(q||(q={}));var zl;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(zl||(zl={}));var E=q.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),gt=e=>{switch(typeof e){case"undefined":return E.undefined;case"string":return E.string;case"number":return Number.isNaN(e)?E.nan:E.number;case"boolean":return E.boolean;case"function":return E.function;case"bigint":return E.bigint;case"symbol":return E.symbol;case"object":return Array.isArray(e)?E.array:e===null?E.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?E.promise:typeof Map<"u"&&e instanceof Map?E.map:typeof Set<"u"&&e instanceof Set?E.set:typeof Date<"u"&&e instanceof Date?E.date:E.object;default:return E.unknown}};var w=q.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),LD=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Re=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,l=0;for(;l<s.path.length;){let c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,q.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Re.create=e=>new Re(e);var WD=(e,t)=>{let r;switch(e.code){case w.invalid_type:e.received===E.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case w.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,q.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:r=`Unrecognized key(s) in object: ${q.joinValues(e.keys,", ")}`;break;case w.invalid_union:r="Invalid input";break;case w.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${q.joinValues(e.options)}`;break;case w.invalid_enum_value:r=`Invalid enum value. Expected ${q.joinValues(e.options)}, received '${e.received}'`;break;case w.invalid_arguments:r="Invalid function arguments";break;case w.invalid_return_type:r="Invalid function return type";break;case w.invalid_date:r="Invalid date";break;case w.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:q.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case w.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case w.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case w.custom:r="Invalid input";break;case w.invalid_intersection_types:r="Intersection results could not be merged";break;case w.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case w.not_finite:r="Number must be finite";break;default:r=t.defaultError,q.assertNever(e)}return{message:r}},It=WD;var bm=It;function UD(e){bm=e}function fn(){return bm}var bo=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",l=n.filter(c=>!!c).slice().reverse();for(let c of l)a=c(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},VD=[];function D(e,t){let r=fn(),n=bo({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===It?void 0:It].filter(o=>!!o)});e.common.issues.push(n)}var xe=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return j;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return j;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},j=Object.freeze({status:"aborted"}),vr=e=>({status:"dirty",value:e}),_e=e=>({status:"valid",value:e}),Qi=e=>e.status==="aborted",es=e=>e.status==="dirty",Qt=e=>e.status==="valid",pn=e=>typeof Promise<"u"&&e instanceof Promise;var k;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(k||(k={}));var Xe=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},vm=(e,t)=>{if(Qt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Re(e.common.issues);return this._error=r,this._error}}};function U(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,a)=>{let{message:l}=e;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??r??a.defaultError}},description:o}}var H=class{get description(){return this._def.description}_getType(t){return gt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:gt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new xe,ctx:{common:t.parent.common,data:t.data,parsedType:gt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(pn(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gt(t)},o=this._parseSync({data:t,path:n.path,parent:n});return vm(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Qt(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Qt(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:gt(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(pn(o)?o:Promise.resolve(o));return vm(n,i)}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=t(o),a=()=>i.addIssue({code:w.custom,...n(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Qe({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ye.create(this,this._def)}nullable(){return wt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pt.create(this)}promise(){return rr.create(this,this._def)}or(t){return Sr.create([this,t],this._def)}and(t){return Tr.create(this,t,this._def)}transform(t){return new Qe({...U(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Rr({...U(this._def),innerType:this,defaultValue:r,typeName:N.ZodDefault})}brand(){return new vo({typeName:N.ZodBranded,type:this,...U(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Pr({...U(this._def),innerType:this,catchValue:r,typeName:N.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Eo.create(this,t)}readonly(){return jr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},HD=/^c[^\s-]{8,}$/i,JD=/^[0-9a-z]+$/,GD=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zD=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qD=/^[a-z0-9_-]{21}$/i,KD=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ZD=/^[-+]?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)?)??$/,YD=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,XD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ql,QD=/^(?:(?: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])$/,eb=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,tb=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,rb=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ob=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,xm="((\\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])))",ib=new RegExp(`^${xm}$`);function Fm(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function sb(e){return new RegExp(`^${Fm(e)}$`)}function Cm(e){let t=`${xm}T${Fm(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function ab(e,t){return!!((t==="v4"||!t)&&QD.test(e)||(t==="v6"||!t)&&tb.test(e))}function lb(e,t){if(!KD.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function ub(e,t){return!!((t==="v4"||!t)&&eb.test(e)||(t==="v6"||!t)&&rb.test(e))}var er=class e extends H{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==E.string){let i=this._getOrReturnCtx(t);return D(i,{code:w.invalid_type,expected:E.string,received:i.parsedType}),j}let n=new xe,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),D(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),D(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,a=t.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(t,o),s?D(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&D(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")YD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"email",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")ql||(ql=new RegExp(XD,"u")),ql.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"emoji",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")zD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"uuid",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")qD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"nanoid",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")HD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"cuid",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")JD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"cuid2",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")GD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"ulid",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),D(o,{validation:"url",code:w.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"regex",code:w.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),D(o,{code:w.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),D(o,{code:w.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),D(o,{code:w.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Cm(i).test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{code:w.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?ib.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{code:w.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?sb(i).test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{code:w.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?ZD.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"duration",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?ab(t.data,i.version)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"ip",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?lb(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"jwt",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?ub(t.data,i.version)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"cidr",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?nb.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"base64",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?ob.test(t.data)||(o=this._getOrReturnCtx(t,o),D(o,{validation:"base64url",code:w.invalid_string,message:i.message}),n.dirty()):q.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:w.invalid_string,...k.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...k.errToObj(t)})}url(t){return this._addCheck({kind:"url",...k.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...k.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...k.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...k.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...k.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...k.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...k.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...k.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...k.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...k.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...k.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...k.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...k.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...k.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...k.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...k.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...k.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...k.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...k.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...k.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...k.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...k.errToObj(r)})}nonempty(t){return this.min(1,k.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};er.create=e=>new er({checks:[],typeName:N.ZodString,coerce:e?.coerce??!1,...U(e)});function cb(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}var Er=class e extends H{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==E.number){let i=this._getOrReturnCtx(t);return D(i,{code:w.invalid_type,expected:E.number,received:i.parsedType}),j}let n,o=new xe;for(let i of this._def.checks)i.kind==="int"?q.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),D(n,{code:w.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:w.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:w.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?cb(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),D(n,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),D(n,{code:w.not_finite,message:i.message}),o.dirty()):q.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,k.toString(r))}gt(t,r){return this.setLimit("min",t,!1,k.toString(r))}lte(t,r){return this.setLimit("max",t,!0,k.toString(r))}lt(t,r){return this.setLimit("max",t,!1,k.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:k.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:k.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:k.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:k.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&q.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Er.create=e=>new Er({checks:[],typeName:N.ZodNumber,coerce:e?.coerce||!1,...U(e)});var xr=class e extends H{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==E.bigint)return this._getInvalidInput(t);let n,o=new xe;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:w.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),D(n,{code:w.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),D(n,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):q.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return D(r,{code:w.invalid_type,expected:E.bigint,received:r.parsedType}),j}gte(t,r){return this.setLimit("min",t,!0,k.toString(r))}gt(t,r){return this.setLimit("min",t,!1,k.toString(r))}lte(t,r){return this.setLimit("max",t,!0,k.toString(r))}lt(t,r){return this.setLimit("max",t,!1,k.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:k.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:k.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};xr.create=e=>new xr({checks:[],typeName:N.ZodBigInt,coerce:e?.coerce??!1,...U(e)});var Fr=class extends H{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==E.boolean){let n=this._getOrReturnCtx(t);return D(n,{code:w.invalid_type,expected:E.boolean,received:n.parsedType}),j}return _e(t.data)}};Fr.create=e=>new Fr({typeName:N.ZodBoolean,coerce:e?.coerce||!1,...U(e)});var Cr=class e extends H{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==E.date){let i=this._getOrReturnCtx(t);return D(i,{code:w.invalid_type,expected:E.date,received:i.parsedType}),j}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return D(i,{code:w.invalid_date}),j}let n=new xe,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),D(o,{code:w.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),D(o,{code:w.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):q.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:k.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:k.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Cr.create=e=>new Cr({checks:[],coerce:e?.coerce||!1,typeName:N.ZodDate,...U(e)});var gn=class extends H{_parse(t){if(this._getType(t)!==E.symbol){let n=this._getOrReturnCtx(t);return D(n,{code:w.invalid_type,expected:E.symbol,received:n.parsedType}),j}return _e(t.data)}};gn.create=e=>new gn({typeName:N.ZodSymbol,...U(e)});var _r=class extends H{_parse(t){if(this._getType(t)!==E.undefined){let n=this._getOrReturnCtx(t);return D(n,{code:w.invalid_type,expected:E.undefined,received:n.parsedType}),j}return _e(t.data)}};_r.create=e=>new _r({typeName:N.ZodUndefined,...U(e)});var kr=class extends H{_parse(t){if(this._getType(t)!==E.null){let n=this._getOrReturnCtx(t);return D(n,{code:w.invalid_type,expected:E.null,received:n.parsedType}),j}return _e(t.data)}};kr.create=e=>new kr({typeName:N.ZodNull,...U(e)});var tr=class extends H{constructor(){super(...arguments),this._any=!0}_parse(t){return _e(t.data)}};tr.create=e=>new tr({typeName:N.ZodAny,...U(e)});var Rt=class extends H{constructor(){super(...arguments),this._unknown=!0}_parse(t){return _e(t.data)}};Rt.create=e=>new Rt({typeName:N.ZodUnknown,...U(e)});var lt=class extends H{_parse(t){let r=this._getOrReturnCtx(t);return D(r,{code:w.invalid_type,expected:E.never,received:r.parsedType}),j}};lt.create=e=>new lt({typeName:N.ZodNever,...U(e)});var hn=class extends H{_parse(t){if(this._getType(t)!==E.undefined){let n=this._getOrReturnCtx(t);return D(n,{code:w.invalid_type,expected:E.void,received:n.parsedType}),j}return _e(t.data)}};hn.create=e=>new hn({typeName:N.ZodVoid,...U(e)});var Pt=class e extends H{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==E.array)return D(r,{code:w.invalid_type,expected:E.array,received:r.parsedType}),j;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(D(r,{code:s?w.too_big:w.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(D(r,{code:w.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(D(r,{code:w.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new Xe(r,s,r.path,a)))).then(s=>xe.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new Xe(r,s,r.path,a)));return xe.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:k.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:k.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:k.toString(r)}})}nonempty(t){return this.min(1,t)}};Pt.create=(e,t)=>new Pt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...U(t)});function mn(e){if(e instanceof Pe){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Ye.create(mn(n))}return new Pe({...e._def,shape:()=>t})}else return e instanceof Pt?new Pt({...e._def,type:mn(e.element)}):e instanceof Ye?Ye.create(mn(e.unwrap())):e instanceof wt?wt.create(mn(e.unwrap())):e instanceof ht?ht.create(e.items.map(t=>mn(t))):e}var Pe=class e extends H{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=q.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==E.object){let c=this._getOrReturnCtx(t);return D(c,{code:w.invalid_type,expected:E.object,received:c.parsedType}),j}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof lt&&this._def.unknownKeys==="strip"))for(let c in o.data)s.includes(c)||a.push(c);let l=[];for(let c of s){let d=i[c],p=o.data[c];l.push({key:{status:"valid",value:c},value:d._parse(new Xe(o,p,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof lt){let c=this._def.unknownKeys;if(c==="passthrough")for(let d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(c==="strict")a.length>0&&(D(o,{code:w.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let d of a){let p=o.data[d];l.push({key:{status:"valid",value:d},value:c._parse(new Xe(o,p,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let d of l){let p=await d.key,m=await d.value;c.push({key:p,value:m,alwaysSet:d.alwaysSet})}return c}).then(c=>xe.mergeObjectSync(n,c)):xe.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return k.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:k.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:N.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of q.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of q.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return mn(this)}partial(t){let r={};for(let n of q.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of q.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Ye;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return _m(q.objectKeys(this.shape))}};Pe.create=(e,t)=>new Pe({shape:()=>e,unknownKeys:"strip",catchall:lt.create(),typeName:N.ZodObject,...U(t)});Pe.strictCreate=(e,t)=>new Pe({shape:()=>e,unknownKeys:"strict",catchall:lt.create(),typeName:N.ZodObject,...U(t)});Pe.lazycreate=(e,t)=>new Pe({shape:e,unknownKeys:"strip",catchall:lt.create(),typeName:N.ZodObject,...U(t)});var Sr=class extends H{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new Re(a.ctx.common.issues));return D(r,{code:w.invalid_union,unionErrors:s}),j}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let l of n){let c={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(l=>new Re(l));return D(r,{code:w.invalid_union,unionErrors:a}),j}}get options(){return this._def.options}};Sr.create=(e,t)=>new Sr({options:e,typeName:N.ZodUnion,...U(t)});var $t=e=>e instanceof Ar?$t(e.schema):e instanceof Qe?$t(e.innerType()):e instanceof Or?[e.value]:e instanceof Ir?e.options:e instanceof $r?q.objectValues(e.enum):e instanceof Rr?$t(e._def.innerType):e instanceof _r?[void 0]:e instanceof kr?[null]:e instanceof Ye?[void 0,...$t(e.unwrap())]:e instanceof wt?[null,...$t(e.unwrap())]:e instanceof vo||e instanceof jr?$t(e.unwrap()):e instanceof Pr?$t(e._def.innerType):[],ts=class e extends H{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==E.object)return D(r,{code:w.invalid_type,expected:E.object,received:r.parsedType}),j;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(D(r,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),j)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let s=$t(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new e({typeName:N.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...U(n)})}};function Kl(e,t){let r=gt(e),n=gt(t);if(e===t)return{valid:!0,data:e};if(r===E.object&&n===E.object){let o=q.objectKeys(t),i=q.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let l=Kl(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(r===E.array&&n===E.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],l=Kl(s,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return r===E.date&&n===E.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Tr=class extends H{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(Qi(i)||Qi(s))return j;let a=Kl(i.value,s.value);return a.valid?((es(i)||es(s))&&r.dirty(),{status:r.value,value:a.data}):(D(n,{code:w.invalid_intersection_types}),j)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Tr.create=(e,t,r)=>new Tr({left:e,right:t,typeName:N.ZodIntersection,...U(r)});var ht=class e extends H{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==E.array)return D(n,{code:w.invalid_type,expected:E.array,received:n.parsedType}),j;if(n.data.length<this._def.items.length)return D(n,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&n.data.length>this._def.items.length&&(D(n,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new Xe(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>xe.mergeArray(r,s)):xe.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ht.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ht({items:e,typeName:N.ZodTuple,rest:null,...U(t)})};var rs=class e extends H{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==E.object)return D(n,{code:w.invalid_type,expected:E.object,received:n.parsedType}),j;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new Xe(n,a,n.path,a)),value:s._parse(new Xe(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?xe.mergeObjectAsync(r,o):xe.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof H?new e({keyType:t,valueType:r,typeName:N.ZodRecord,...U(n)}):new e({keyType:er.create(),valueType:t,typeName:N.ZodRecord,...U(r)})}},wn=class extends H{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==E.map)return D(n,{code:w.invalid_type,expected:E.map,received:n.parsedType}),j;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,l],c)=>({key:o._parse(new Xe(n,a,n.path,[c,"key"])),value:i._parse(new Xe(n,l,n.path,[c,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let c=await l.key,d=await l.value;if(c.status==="aborted"||d.status==="aborted")return j;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(c.value,d.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let l of s){let c=l.key,d=l.value;if(c.status==="aborted"||d.status==="aborted")return j;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(c.value,d.value)}return{status:r.value,value:a}}}};wn.create=(e,t,r)=>new wn({valueType:t,keyType:e,typeName:N.ZodMap,...U(r)});var yn=class e extends H{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==E.set)return D(n,{code:w.invalid_type,expected:E.set,received:n.parsedType}),j;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(D(n,{code:w.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(D(n,{code:w.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(l){let c=new Set;for(let d of l){if(d.status==="aborted")return j;d.status==="dirty"&&r.dirty(),c.add(d.value)}return{status:r.value,value:c}}let a=[...n.data.values()].map((l,c)=>i._parse(new Xe(n,l,n.path,c)));return n.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:k.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:k.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};yn.create=(e,t)=>new yn({valueType:e,minSize:null,maxSize:null,typeName:N.ZodSet,...U(t)});var ns=class e extends H{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==E.function)return D(r,{code:w.invalid_type,expected:E.function,received:r.parsedType}),j;function n(a,l){return bo({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,fn(),It].filter(c=>!!c),issueData:{code:w.invalid_arguments,argumentsError:l}})}function o(a,l){return bo({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,fn(),It].filter(c=>!!c),issueData:{code:w.invalid_return_type,returnTypeError:l}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof rr){let a=this;return _e(async function(...l){let c=new Re([]),d=await a._def.args.parseAsync(l,i).catch(g=>{throw c.addIssue(n(l,g)),c}),p=await Reflect.apply(s,this,d);return await a._def.returns._def.type.parseAsync(p,i).catch(g=>{throw c.addIssue(o(p,g)),c})})}else{let a=this;return _e(function(...l){let c=a._def.args.safeParse(l,i);if(!c.success)throw new Re([n(l,c.error)]);let d=Reflect.apply(s,this,c.data),p=a._def.returns.safeParse(d,i);if(!p.success)throw new Re([o(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ht.create(t).rest(Rt.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ht.create([]).rest(Rt.create()),returns:r||Rt.create(),typeName:N.ZodFunction,...U(n)})}},Ar=class extends H{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ar.create=(e,t)=>new Ar({getter:e,typeName:N.ZodLazy,...U(t)});var Or=class extends H{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return D(r,{received:r.data,code:w.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:t.data}}get value(){return this._def.value}};Or.create=(e,t)=>new Or({value:e,typeName:N.ZodLiteral,...U(t)});function _m(e,t){return new Ir({values:e,typeName:N.ZodEnum,...U(t)})}var Ir=class e extends H{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return D(r,{expected:q.joinValues(n),received:r.parsedType,code:w.invalid_type}),j}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return D(r,{received:r.data,code:w.invalid_enum_value,options:n}),j}return _e(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ir.create=_m;var $r=class extends H{_parse(t){let r=q.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==E.string&&n.parsedType!==E.number){let o=q.objectValues(r);return D(n,{expected:q.joinValues(o),received:n.parsedType,code:w.invalid_type}),j}if(this._cache||(this._cache=new Set(q.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=q.objectValues(r);return D(n,{received:n.data,code:w.invalid_enum_value,options:o}),j}return _e(t.data)}get enum(){return this._def.values}};$r.create=(e,t)=>new $r({values:e,typeName:N.ZodNativeEnum,...U(t)});var rr=class extends H{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==E.promise&&r.common.async===!1)return D(r,{code:w.invalid_type,expected:E.promise,received:r.parsedType}),j;let n=r.parsedType===E.promise?r.data:Promise.resolve(r.data);return _e(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};rr.create=(e,t)=>new rr({type:e,typeName:N.ZodPromise,...U(t)});var Qe=class extends H{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{D(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return j;let l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?j:l.status==="dirty"?vr(l.value):r.value==="dirty"?vr(l.value):l});{if(r.value==="aborted")return j;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?j:a.status==="dirty"?vr(a.value):r.value==="dirty"?vr(a.value):a}}if(o.type==="refinement"){let s=a=>{let l=o.refinement(a,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?j:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?j:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Qt(s))return j;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Qt(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):j);q.assertNever(o)}};Qe.create=(e,t,r)=>new Qe({schema:e,typeName:N.ZodEffects,effect:t,...U(r)});Qe.createWithPreprocess=(e,t,r)=>new Qe({schema:t,effect:{type:"preprocess",transform:e},typeName:N.ZodEffects,...U(r)});var Ye=class extends H{_parse(t){return this._getType(t)===E.undefined?_e(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ye.create=(e,t)=>new Ye({innerType:e,typeName:N.ZodOptional,...U(t)});var wt=class extends H{_parse(t){return this._getType(t)===E.null?_e(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};wt.create=(e,t)=>new wt({innerType:e,typeName:N.ZodNullable,...U(t)});var Rr=class extends H{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===E.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Rr.create=(e,t)=>new Rr({innerType:e,typeName:N.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...U(t)});var Pr=class extends H{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return pn(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Re(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Re(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Pr.create=(e,t)=>new Pr({innerType:e,typeName:N.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...U(t)});var Dn=class extends H{_parse(t){if(this._getType(t)!==E.nan){let n=this._getOrReturnCtx(t);return D(n,{code:w.invalid_type,expected:E.nan,received:n.parsedType}),j}return{status:"valid",value:t.data}}};Dn.create=e=>new Dn({typeName:N.ZodNaN,...U(e)});var db=Symbol("zod_brand"),vo=class extends H{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Eo=class e extends H{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?j:i.status==="dirty"?(r.dirty(),vr(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?j:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:N.ZodPipeline})}},jr=class extends H{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Qt(o)&&(o.value=Object.freeze(o.value)),o);return pn(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};jr.create=(e,t)=>new jr({innerType:e,typeName:N.ZodReadonly,...U(t)});function Em(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function km(e,t={},r){return e?tr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=Em(t,n),l=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:l})}});if(!i){let s=Em(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):tr.create()}var fb={object:Pe.lazycreate},N;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(N||(N={}));var pb=(e,t={message:`Input not instance of ${e.name}`})=>km(r=>r instanceof e,t),Sm=er.create,Tm=Er.create,mb=Dn.create,gb=xr.create,Am=Fr.create,hb=Cr.create,wb=gn.create,yb=_r.create,Db=kr.create,bb=tr.create,vb=Rt.create,Eb=lt.create,xb=hn.create,Fb=Pt.create,Cb=Pe.create,_b=Pe.strictCreate,kb=Sr.create,Sb=ts.create,Tb=Tr.create,Ab=ht.create,Ob=rs.create,Ib=wn.create,$b=yn.create,Rb=ns.create,Pb=Ar.create,jb=Or.create,Nb=Ir.create,Bb=$r.create,Mb=rr.create,Lb=Qe.create,Wb=Ye.create,Ub=wt.create,Vb=Qe.createWithPreprocess,Hb=Eo.create,Jb=()=>Sm().optional(),Gb=()=>Tm().optional(),zb=()=>Am().optional(),qb={string:(e=>er.create({...e,coerce:!0})),number:(e=>Er.create({...e,coerce:!0})),boolean:(e=>Fr.create({...e,coerce:!0})),bigint:(e=>xr.create({...e,coerce:!0})),date:(e=>Cr.create({...e,coerce:!0}))};var Kb=j;function os(e,t=!1){let r=e.length,n=0,o="",i=0,s=16,a=0,l=0,c=0,d=0,p=0;function m(b,G){let me=0,z=0;for(;me<b||!G;){let M=e.charCodeAt(n);if(M>=48&&M<=57)z=z*16+M-48;else if(M>=65&&M<=70)z=z*16+M-65+10;else if(M>=97&&M<=102)z=z*16+M-97+10;else break;n++,me++}return me<b&&(z=-1),z}function g(b){n=b,o="",i=0,s=16,p=0}function y(){let b=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&bn(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&bn(e.charCodeAt(n)))for(n++;n<e.length&&bn(e.charCodeAt(n));)n++;else return p=3,e.substring(b,n);let G=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&bn(e.charCodeAt(n))){for(n++;n<e.length&&bn(e.charCodeAt(n));)n++;G=n}else p=3;return e.substring(b,G)}function x(){let b="",G=n;for(;;){if(n>=r){b+=e.substring(G,n),p=2;break}let me=e.charCodeAt(n);if(me===34){b+=e.substring(G,n),n++;break}if(me===92){if(b+=e.substring(G,n),n++,n>=r){p=2;break}switch(e.charCodeAt(n++)){case 34:b+='"';break;case 92:b+="\\";break;case 47:b+="/";break;case 98:b+="\b";break;case 102:b+="\f";break;case 110:b+=`
108
108
  `;break;case 114:b+="\r";break;case 116:b+=" ";break;case 117:let M=m(4,!0);M>=0?b+=String.fromCharCode(M):p=4;break;default:p=5}G=n;continue}if(me>=0&&me<=31)if(xo(me)){b+=e.substring(G,n),p=2;break}else p=6;n++}return b}function T(){if(o="",p=0,i=n,l=a,d=c,n>=r)return i=r,s=17;let b=e.charCodeAt(n);if(Zl(b)){do n++,o+=String.fromCharCode(b),b=e.charCodeAt(n);while(Zl(b));return s=15}if(xo(b))return n++,o+=String.fromCharCode(b),b===13&&e.charCodeAt(n)===10&&(n++,o+=`
109
- `),a++,c=n,s=14;switch(b){case 123:return n++,s=1;case 125:return n++,s=2;case 91:return n++,s=3;case 93:return n++,s=4;case 58:return n++,s=6;case 44:return n++,s=5;case 34:return n++,o=x(),s=10;case 47:let G=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<r&&!xo(e.charCodeAt(n));)n++;return o=e.substring(G,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;let me=r-1,z=!1;for(;n<me;){let M=e.charCodeAt(n);if(M===42&&e.charCodeAt(n+1)===47){n+=2,z=!0;break}n++,xo(M)&&(M===13&&e.charCodeAt(n)===10&&n++,a++,c=n)}return z||(n++,p=1),o=e.substring(G,n),s=13}return o+=String.fromCharCode(b),n++,s=16;case 45:if(o+=String.fromCharCode(b),n++,n===r||!bn(e.charCodeAt(n)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return o+=y(),s=11;default:for(;n<r&&P(b);)n++,b=e.charCodeAt(n);if(i!==n){switch(o=e.substring(i,n),o){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return o+=String.fromCharCode(b),n++,s=16}}function P(b){if(Zl(b)||xo(b))return!1;switch(b){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function Z(){let b;do b=T();while(b>=12&&b<=15);return b}return{setPosition:g,getPosition:()=>n,scan:t?Z:T,getToken:()=>s,getTokenValue:()=>o,getTokenOffset:()=>i,getTokenLength:()=>n-i,getTokenStartLine:()=>l,getTokenStartCharacter:()=>i-d,getTokenError:()=>p}}function Zl(e){return e===32||e===9}function xo(e){return e===10||e===13}function bn(e){return e>=48&&e<=57}var Om;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(Om||(Om={}));var Zb=new Array(20).fill(0).map((e,t)=>" ".repeat(t)),vn=200,Yb={" ":{"\n":new Array(vn).fill(0).map((e,t)=>`
109
+ `),a++,c=n,s=14;switch(b){case 123:return n++,s=1;case 125:return n++,s=2;case 91:return n++,s=3;case 93:return n++,s=4;case 58:return n++,s=6;case 44:return n++,s=5;case 34:return n++,o=x(),s=10;case 47:let G=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<r&&!xo(e.charCodeAt(n));)n++;return o=e.substring(G,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;let me=r-1,z=!1;for(;n<me;){let M=e.charCodeAt(n);if(M===42&&e.charCodeAt(n+1)===47){n+=2,z=!0;break}n++,xo(M)&&(M===13&&e.charCodeAt(n)===10&&n++,a++,c=n)}return z||(n++,p=1),o=e.substring(G,n),s=13}return o+=String.fromCharCode(b),n++,s=16;case 45:if(o+=String.fromCharCode(b),n++,n===r||!bn(e.charCodeAt(n)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return o+=y(),s=11;default:for(;n<r&&P(b);)n++,b=e.charCodeAt(n);if(i!==n){switch(o=e.substring(i,n),o){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return o+=String.fromCharCode(b),n++,s=16}}function P(b){if(Zl(b)||xo(b))return!1;switch(b){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function Z(){let b;do b=T();while(b>=12&&b<=15);return b}return{setPosition:g,getPosition:()=>n,scan:t?Z:T,getToken:()=>s,getTokenValue:()=>o,getTokenOffset:()=>i,getTokenLength:()=>n-i,getTokenStartLine:()=>l,getTokenStartCharacter:()=>i-d,getTokenError:()=>p}}function Zl(e){return e===32||e===9}function xo(e){return e===10||e===13}function bn(e){return e>=48&&e<=57}var Om;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(Om||(Om={}));var Yb=new Array(20).fill(0).map((e,t)=>" ".repeat(t)),vn=200,Xb={" ":{"\n":new Array(vn).fill(0).map((e,t)=>`
110
110
  `+" ".repeat(t)),"\r":new Array(vn).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":new Array(vn).fill(0).map((e,t)=>`\r
111
111
  `+" ".repeat(t))}," ":{"\n":new Array(vn).fill(0).map((e,t)=>`
112
112
  `+" ".repeat(t)),"\r":new Array(vn).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":new Array(vn).fill(0).map((e,t)=>`\r
113
- `+" ".repeat(t))}};var is;(function(e){e.DEFAULT={allowTrailingComma:!1}})(is||(is={}));function Im(e,t=[],r=is.DEFAULT){let n=null,o=[],i=[];function s(l){Array.isArray(o)?o.push(l):n!==null&&(o[n]=l)}return $m(e,{onObjectBegin:()=>{let l={};s(l),i.push(o),o=l,n=null},onObjectProperty:l=>{n=l},onObjectEnd:()=>{o=i.pop()},onArrayBegin:()=>{let l=[];s(l),i.push(o),o=l,n=null},onArrayEnd:()=>{o=i.pop()},onLiteralValue:s,onError:(l,c,d)=>{t.push({error:l,offset:c,length:d})}},r),o[0]}function $m(e,t,r=is.DEFAULT){let n=os(e,!1),o=[],i=0;function s(Q){return Q?()=>i===0&&Q(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function a(Q){return Q?ye=>i===0&&Q(ye,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function l(Q){return Q?ye=>i===0&&Q(ye,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}function c(Q){return Q?()=>{i>0?i++:Q(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice())===!1&&(i=1)}:()=>!0}function d(Q){return Q?()=>{i>0&&i--,i===0&&Q(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}let p=c(t.onObjectBegin),m=l(t.onObjectProperty),g=d(t.onObjectEnd),y=c(t.onArrayBegin),x=d(t.onArrayEnd),T=l(t.onLiteralValue),P=a(t.onSeparator),Z=s(t.onComment),b=a(t.onError),G=r&&r.disallowComments,me=r&&r.allowTrailingComma;function z(){for(;;){let Q=n.scan();switch(n.getTokenError()){case 4:M(14);break;case 5:M(15);break;case 3:M(13);break;case 1:G||M(11);break;case 2:M(12);break;case 6:M(16);break}switch(Q){case 12:case 13:G?M(10):Z();break;case 16:M(1);break;case 15:case 14:break;default:return Q}}}function M(Q,ye=[],Gu=[]){if(b(Q),ye.length+Gu.length>0){let Ro=n.getToken();for(;Ro!==17;){if(ye.indexOf(Ro)!==-1){z();break}else if(Gu.indexOf(Ro)!==-1)break;Ro=z()}}}function On(Q){let ye=n.getTokenValue();return Q?T(ye):(m(ye),o.push(ye)),z(),!0}function bs(){switch(n.getToken()){case 11:let Q=n.getTokenValue(),ye=Number(Q);isNaN(ye)&&(M(2),ye=0),T(ye);break;case 7:T(null);break;case 8:T(!0);break;case 9:T(!1);break;default:return!1}return z(),!0}function vs(){return n.getToken()!==10?(M(3,[],[2,5]),!1):(On(!1),n.getToken()===6?(P(":"),z(),Es()||M(4,[],[2,5])):M(5,[],[2,5]),o.pop(),!0)}function Fh(){p(),z();let Q=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(Q||M(4,[],[]),P(","),z(),n.getToken()===2&&me)break}else Q&&M(6,[],[]);vs()||M(4,[],[2,5]),Q=!0}return g(),n.getToken()!==2?M(7,[2],[]):z(),!0}function Ch(){y(),z();let Q=!0,ye=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(ye||M(4,[],[]),P(","),z(),n.getToken()===4&&me)break}else ye&&M(6,[],[]);Q?(o.push(0),Q=!1):o[o.length-1]++,Es()||M(4,[],[4,5]),ye=!0}return x(),Q||o.pop(),n.getToken()!==4?M(8,[4],[]):z(),!0}function Es(){switch(n.getToken()){case 3:return Ch();case 1:return Fh();case 10:return On(!0);default:return bs()}}return z(),n.getToken()===17?r.allowEmptyContent?!0:(M(4,[],[]),!1):Es()?(n.getToken()!==17&&M(9,[],[]),!0):(M(4,[],[]),!1)}var Rm;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(Rm||(Rm={}));var Pm;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Pm||(Pm={}));var Nr=Im;var jm;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(jm||(jm={}));var Sn=h(require("fs")),zm=h(require("path")),qm=require("@webflow/cosmic-deploy-contract");var En=class extends Error{remediation;documentationUrl;cause;constructor(t,r){super(t),this.name="FrameworkError",this.cause=r?.cause,this.remediation=r?.remediation,this.documentationUrl=r?.documentationUrl,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toDisplayString(){let t=this.message;return this.remediation&&(t+=`
113
+ `+" ".repeat(t))}};var is;(function(e){e.DEFAULT={allowTrailingComma:!1}})(is||(is={}));function Im(e,t=[],r=is.DEFAULT){let n=null,o=[],i=[];function s(l){Array.isArray(o)?o.push(l):n!==null&&(o[n]=l)}return $m(e,{onObjectBegin:()=>{let l={};s(l),i.push(o),o=l,n=null},onObjectProperty:l=>{n=l},onObjectEnd:()=>{o=i.pop()},onArrayBegin:()=>{let l=[];s(l),i.push(o),o=l,n=null},onArrayEnd:()=>{o=i.pop()},onLiteralValue:s,onError:(l,c,d)=>{t.push({error:l,offset:c,length:d})}},r),o[0]}function $m(e,t,r=is.DEFAULT){let n=os(e,!1),o=[],i=0;function s(Q){return Q?()=>i===0&&Q(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function a(Q){return Q?ye=>i===0&&Q(ye,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function l(Q){return Q?ye=>i===0&&Q(ye,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}function c(Q){return Q?()=>{i>0?i++:Q(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice())===!1&&(i=1)}:()=>!0}function d(Q){return Q?()=>{i>0&&i--,i===0&&Q(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}let p=c(t.onObjectBegin),m=l(t.onObjectProperty),g=d(t.onObjectEnd),y=c(t.onArrayBegin),x=d(t.onArrayEnd),T=l(t.onLiteralValue),P=a(t.onSeparator),Z=s(t.onComment),b=a(t.onError),G=r&&r.disallowComments,me=r&&r.allowTrailingComma;function z(){for(;;){let Q=n.scan();switch(n.getTokenError()){case 4:M(14);break;case 5:M(15);break;case 3:M(13);break;case 1:G||M(11);break;case 2:M(12);break;case 6:M(16);break}switch(Q){case 12:case 13:G?M(10):Z();break;case 16:M(1);break;case 15:case 14:break;default:return Q}}}function M(Q,ye=[],Gu=[]){if(b(Q),ye.length+Gu.length>0){let Ro=n.getToken();for(;Ro!==17;){if(ye.indexOf(Ro)!==-1){z();break}else if(Gu.indexOf(Ro)!==-1)break;Ro=z()}}}function On(Q){let ye=n.getTokenValue();return Q?T(ye):(m(ye),o.push(ye)),z(),!0}function bs(){switch(n.getToken()){case 11:let Q=n.getTokenValue(),ye=Number(Q);isNaN(ye)&&(M(2),ye=0),T(ye);break;case 7:T(null);break;case 8:T(!0);break;case 9:T(!1);break;default:return!1}return z(),!0}function vs(){return n.getToken()!==10?(M(3,[],[2,5]),!1):(On(!1),n.getToken()===6?(P(":"),z(),Es()||M(4,[],[2,5])):M(5,[],[2,5]),o.pop(),!0)}function Ch(){p(),z();let Q=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(Q||M(4,[],[]),P(","),z(),n.getToken()===2&&me)break}else Q&&M(6,[],[]);vs()||M(4,[],[2,5]),Q=!0}return g(),n.getToken()!==2?M(7,[2],[]):z(),!0}function _h(){y(),z();let Q=!0,ye=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(ye||M(4,[],[]),P(","),z(),n.getToken()===4&&me)break}else ye&&M(6,[],[]);Q?(o.push(0),Q=!1):o[o.length-1]++,Es()||M(4,[],[4,5]),ye=!0}return x(),Q||o.pop(),n.getToken()!==4?M(8,[4],[]):z(),!0}function Es(){switch(n.getToken()){case 3:return _h();case 1:return Ch();case 10:return On(!0);default:return bs()}}return z(),n.getToken()===17?r.allowEmptyContent?!0:(M(4,[],[]),!1):Es()?(n.getToken()!==17&&M(9,[],[]),!0):(M(4,[],[]),!1)}var Rm;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(Rm||(Rm={}));var Pm;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Pm||(Pm={}));var Nr=Im;var jm;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(jm||(jm={}));var Sn=h(require("fs")),zm=h(require("path")),qm=require("@webflow/cosmic-deploy-contract");var En=class extends Error{remediation;documentationUrl;cause;constructor(t,r){super(t),this.name="FrameworkError",this.cause=r?.cause,this.remediation=r?.remediation,this.documentationUrl=r?.documentationUrl,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toDisplayString(){let t=this.message;return this.remediation&&(t+=`
114
114
 
115
115
  How to fix: ${this.remediation}`),this.documentationUrl&&(t+=`
116
116
 
117
117
  Documentation: ${this.documentationUrl}`),t}},we=class extends En{constructor(t,r){super(t,r),this.name="FrameworkValidationError"}};var Br=class extends En{configFile;constructor(t,r){super(t,r),this.name="FrameworkConfigError",this.configFile=r?.configFile}toDisplayString(){let t=super.toDisplayString();return this.configFile&&(t+=`
118
118
 
119
- Config file: ${this.configFile}`),t}},nr=class extends En{constructor(t,r){super(t,r),this.name="FrameworkDetectionError"}};var Ne=h(require("path")),Co=h(require("fs"));var Nm=h(require("semver")),et=class{static frameworkName="";ctx;constructor(t){this.ctx=t}static detect(t,r){return{detected:!1}}static detectFromBuiltOutput(t){return!1}static getOutputDeployMetadata(){throw new Error("getOutputDeployMetadata must be implemented by the framework subclass")}getOutputDeployMetadata(){return this.constructor.getOutputDeployMetadata()}getFrameworkVersion(){}async postBuild(){}getAdditionalConfigFiles(){return[]}getUserConfigPatterns(){return[]}hasDependency(t){let{packageJson:r}=this.ctx;return t in(r.dependencies||{})||t in(r.devDependencies||{})}getDependencyVersion(t){let{packageJson:r}=this.ctx;return r.dependencies?.[t]||r.devDependencies?.[t]}resolveFrameworkVersion(t){let r=this.getDependencyVersion(t);if(r)return Nm.default.coerce(r)?.version}get log(){return this.ctx.log}get cwd(){return this.ctx.cwd}};var Vm=h(require("semver")),pe=h(require("fs")),yt=h(require("path"));var Mr=h(require("semver"));function ov(){return process.version.slice(1)}function iv(e){let t=Mr.coerce(e);return t?t.major:null}function sv(e,t){let r=Mr.coerce(e),n=Mr.coerce(t);return!r||!n?!1:Mr.gte(r,n)}function xn(e,t,r){let n=ov(),o=t.minimum;if(sv(n,o))e.debug(`Node.js version ${n} meets requirement ${o}`);else{let i=iv(o),s=`${r} requires Node.js ${o} or higher. Current version: ${n}`;if(t.severity==="error")throw new we(s,{remediation:`Please upgrade Node.js to ${o} or higher. You can use nvm, fnm, or similar tools to manage Node.js versions.
119
+ Config file: ${this.configFile}`),t}},nr=class extends En{constructor(t,r){super(t,r),this.name="FrameworkDetectionError"}};var Ne=h(require("path")),Co=h(require("fs"));var Nm=h(require("semver")),et=class{static frameworkName="";ctx;constructor(t){this.ctx=t}static detect(t,r){return{detected:!1}}static detectFromBuiltOutput(t){return!1}static getOutputDeployMetadata(){throw new Error("getOutputDeployMetadata must be implemented by the framework subclass")}getOutputDeployMetadata(){return this.constructor.getOutputDeployMetadata()}getFrameworkVersion(){}async postBuild(){}getAdditionalConfigFiles(){return[]}getUserConfigPatterns(){return[]}hasDependency(t){let{packageJson:r}=this.ctx;return t in(r.dependencies||{})||t in(r.devDependencies||{})}getDependencyVersion(t){let{packageJson:r}=this.ctx;return r.dependencies?.[t]||r.devDependencies?.[t]}resolveFrameworkVersion(t){let r=this.getDependencyVersion(t);if(r)return Nm.default.coerce(r)?.version}get log(){return this.ctx.log}get cwd(){return this.ctx.cwd}};var Vm=h(require("semver")),pe=h(require("fs")),yt=h(require("path"));var Mr=h(require("semver"));function iv(){return process.version.slice(1)}function sv(e){let t=Mr.coerce(e);return t?t.major:null}function av(e,t){let r=Mr.coerce(e),n=Mr.coerce(t);return!r||!n?!1:Mr.gte(r,n)}function xn(e,t,r){let n=iv(),o=t.minimum;if(av(n,o))e.debug(`Node.js version ${n} meets requirement ${o}`);else{let i=sv(o),s=`${r} requires Node.js ${o} or higher. Current version: ${n}`;if(t.severity==="error")throw new we(s,{remediation:`Please upgrade Node.js to ${o} or higher. You can use nvm, fnm, or similar tools to manage Node.js versions.
120
120
 
121
121
  nvm install ${i}
122
122
  nvm use ${i}`,documentationUrl:"https://nodejs.org/en/download/"});e.warn(`${s}. Build may fail or behave unexpectedly.`)}}var ss=h(require("fs")),Bm=h(require("path"));var Mm=B.object({name:B.string().optional(),version:B.string().optional(),dependencies:B.record(B.string()).optional(),devDependencies:B.record(B.string()).optional()});function Fo(e){let t=Bm.default.join(e,"package.json");if(!ss.statSync(t,{throwIfNoEntry:!1}))return;let r=ss.readFileSync(t).toString("utf8"),n;try{n=JSON.parse(r)}catch(o){throw new we("package.json was not valid JSON",{cause:o})}try{return Mm.parse(n)}catch(o){throw new we("package.json schema validation failed",{cause:o})}}var as=h(require("fs")),Lm=h(require("path"));var ls=B.object({cloud:B.object({contract_version:B.string().optional(),framework:B.string().optional(),framework_version:B.string().optional(),entrypoint_path:B.string().optional(),deployment_type:B.enum(["spa","ssg","ssr","ssr-spa-combo"]).optional(),skip_no_bundle:B.boolean().optional(),assets_path_prefix:B.string().optional(),assets_source_skip_mount_path:B.boolean().optional()}).passthrough().optional()}).passthrough();function Fn(e,t,r="webflow.json"){let n=Lm.default.join(t,r);if(!as.statSync(n,{throwIfNoEntry:!1}))return r.endsWith(".json")?Fn(e,t,r+"c"):void 0;let o=as.readFileSync(n).toString("utf8"),i;try{i=Nr(o)}catch(s){e?.error(`loaded but could not parse as JSONC ${n} ${JSON.stringify(o)}: ${s}`);return}try{let s=ls.parse(i);return e.debug(`loaded ${n}: ${JSON.stringify(s)}`),s}catch(s){e?.error(`${n} was valid JSON but schema validation failed: ${s}`);return}}var Wm=require("child_process"),Um=["--no-update-notifier","--no-progress","--no-audit","--no-fund"];async function je(e){let{log:t,cwd:r,args:n}=e,o={...process.env,...e.env||{},WRANGLER_SEND_METRICS:"false",NEXT_TELEMETRY_DISABLED:"1"},i=[...Um,...n];t.debug(`npm ${i.join(" ")} (in ${r})`),(0,Wm.execSync)(`npm ${i.map(s=>JSON.stringify(s)).join(" ")}`,{cwd:r,env:o,stdio:"inherit"})}function or(e){if(!e)return null;let t=Vm.coerce(e);return t?t.major:null}function Lr(e,t,r,n){let o=n?.exclude?Array.isArray(n.exclude)?n.exclude:[n.exclude]:[],i=yt.basename(t);if(o.some(l=>i===l))return e.trace(`Skipping excluded: ${t}`),0;let s=pe.statSync(t,{throwIfNoEntry:!1});if(!s)return e.trace(`Source does not exist: ${t}`),0;if(s.isDirectory()){e.trace(`Copying directory: ${t} -> ${r}`);let l=pe.readdirSync(t),c=0;for(let d of l)c+=Lr(e,yt.join(t,d),yt.join(r,d),n);return c}let a=yt.dirname(r);return pe.existsSync(a)||pe.mkdirSync(a,{recursive:!0}),e.trace(`Copying file: ${t} -> ${r}`),pe.copyFileSync(t,r),1}function ut(e){return pe.existsSync(e)}function Dt(...e){for(let t of e)if(pe.existsSync(t))return t;return e[0]??""}async function ir(e,t,r,n){if(!pe.existsSync(t))throw new Br(`Template not found: ${t}`,{configFile:t});let o=pe.readFileSync(t,"utf8");e.debug(`envsubst: ${t} -> ${r}`);let i=n||process.env,s=o.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(l,c)=>i[c]??"").replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g,(l,c)=>i[c]??""),a=yt.dirname(r);pe.existsSync(a)||pe.mkdirSync(a,{recursive:!0}),pe.writeFileSync(r,s)}function sr(e,t,r,n){for(let o of n){let i=yt.join(t,`${r}.${o}`);if(pe.existsSync(i)){let s=yt.join(t,`clouduser.${r}.${o}`);return e.info(`Renaming user config: ${r}.${o} -> clouduser.${r}.${o}`),pe.renameSync(i,s),s}}return null}var Xl=Dt(Ne.join(__dirname,"templates","astro","v5"),Ne.join(__dirname,"templates","v5")),Hm=Dt(Ne.join(__dirname,"templates","astro"),Ne.join(__dirname,"templates")),Wr=class extends et{static frameworkName="astro";get info(){return{name:"astro",version:"5.x",displayName:"Astro 5"}}static detect(t,r){let n=r?.cloud?.framework;if(n&&n!=="astro")return{detected:!1};let o=t.dependencies?.astro||t.devDependencies?.astro;if(!o)return n==="astro"?{detected:!0,reason:"Specified as astro in webflow.json"}:{detected:!1};let i=or(o);return i!==null&&i>=6?{detected:!1}:{detected:!0,reason:`Found astro@${o}`}}async validate(){let{log:t,packageJson:r}=this.ctx,n=this.getNodeVersionRequirement();n&&xn(t,n,this.info.displayName);let o=r.dependencies?.astro||r.devDependencies?.astro;if(!o)throw new we("Astro is not installed in this project.",{remediation:"Install Astro by running: npm install astro@^5.0.0",documentationUrl:"https://docs.astro.build/en/install/"});if(o==="latest")throw new we('Astro version "latest" is not supported by Webflow Cloud.',{remediation:"Please specify a version, e.g.: npm install astro@^5.0.0"});let i=or(o);if(i!==null&&i>=6)throw new we(`Astro ${i}.x detected but was routed to the Astro 5 builder. This is an internal error.`,{remediation:"Ensure your package.json has astro@^6.0.0 - the Astro 6 builder will be used automatically. If this persists, please report the issue."});t.info(`Validated Astro project: astro@${o}`)}getCloudflareAdapter(){return{name:"@astrojs/cloudflare",version:"^12.0.0"}}getRequiredIntegrations(){return[{name:"@astrojs/react",version:"^4.0.0",reason:"Required for Webflow React components"}]}async installDependencies(){let{log:t,cwd:r}=this.ctx,n=this.getCloudflareAdapter();this.hasDependency(n.name)||(t.warn(`Installing ${n.name}@${n.version} (required for Cloudflare deployment)...`),await je({log:t,cwd:r,args:["install","--save",`${n.name}@${n.version}`]}));for(let o of this.getRequiredIntegrations())this.hasDependency(o.name)||(t.warn(`Installing ${o.name}@${o.version} (${o.reason})...`),await je({log:t,cwd:r,args:["install","--save",`${o.name}@${o.version}`]}))}getWebflowLoader(){return{templatePath:Ne.join(Xl,"webflow-loader.ts"),destinationName:"webflow-loader.ts",configPath:"./webflow-loader.ts"}}getUserConfigPatterns(){return["astro.config.mjs","astro.config.cjs","astro.config.js","astro.config.ts"]}getWranglerTemplatePath(){return Ne.join(Xl,"wrangler.json")}getAdditionalConfigFiles(){return[this.getWebflowLoader().templatePath,Ne.join(Hm,"astro.config.webflow.ts")]}async prepareConfig(){let{log:t,cwd:r,userEnv:n}=this.ctx;sr(t,r,"astro.config",["mjs","cjs","js","ts"])===null&&(t.info("no user astro.config.{mjs,cjs,js,ts} found \u2014 writing empty clouduser.astro.config.mjs stub"),Co.writeFileSync(Ne.join(r,"clouduser.astro.config.mjs"),`export default {};
@@ -139,55 +139,55 @@ export default {
139
139
  `)}async prepareConfig(){let{log:t,cwd:r,userEnv:n}=this.ctx,o=this.hasCustomWorkerEntry();sr(t,r,"vite.config",["mjs","cjs","js","ts"])===null&&(t.info("no user vite.config.{mjs,cjs,js,ts} found \u2014 writing empty clouduser.vite.config.ts stub"),rt.writeFileSync(Ue.join(r,"clouduser.vite.config.ts"),`export default {};
140
140
  `));let s=Ue.join(us,"vite.config.webflow.ts");ut(s)&&(t.info("Copying vite.config.webflow.ts..."),rt.copyFileSync(s,Ue.join(r,"vite.config.webflow.ts")));let a=Ue.join(us,"vite.config.ts.template"),l=Ue.join(r,"vite.config.ts");t.info("Generating vite.config.ts from template..."),await ir(t,a,l,{...process.env,...n}),o||this.ensureWorkerEntry()}getBuildCommand(){return"vite build"}getNodeVersionRequirement(){return{minimum:"18.0.0",severity:"error"}}getFrameworkVersion(){return this.resolveFrameworkVersion("vite")}static getOutputDeployMetadata(){return{staticAssetsPath:"dist/client",workerEntryPath:"./src/worker.ts",deploymentType:"ssr-spa-combo",usesAssetsBinding:!0}}};var Gm=[Ur,Wr,_n,kn],ko=["astro","nextjs","vite"];function cs(e,t){for(let r of Gm){let n=r.detect(e,t);if(n.detected)return{Builder:r,result:n}}return null}function eu(e,t){let r=cs(e.packageJson,t);if(!r)throw new nr("Could not detect framework from package.json or webflow.json",{remediation:`Create a webflow.json file with: { "cloud": { "framework": "astro" } } (or one of: ${ko.join(", ")})`});return e.log.info(`Detected framework: ${r.result.reason}`),new r.Builder(e)}function tu(e,t,r,n){let o=zm.join(t,"webflow.json"),i={cloud:{}};if(Sn.existsSync(o))try{let a=Sn.readFileSync(o,"utf8"),l=JSON.parse(a),c=ls.safeParse(l);if(c.success)i=c.data;else{let d=c.error.issues.map(p=>`${p.path.join(".")}: ${p.message}`).join(", ");e.warn(`webflow.json has schema issues (will be corrected): ${d}`),i=l}i.cloud||(e.warn('webflow.json is missing "cloud" property, adding it'),i.cloud={})}catch(a){e.warn(`Failed to parse existing webflow.json, overwriting: ${a}`)}let s=i.cloud;if(s.framework=r,n){let a=n.getOutputDeployMetadata();s.contract_version="1",s.deployment_type=a.deploymentType,s.entrypoint_path=a.dryRunEntryPath??"./index.js",s.skip_no_bundle=a.skipNoBundle===!0;let l=n.getFrameworkVersion();l&&(s.framework_version=l),a.assetsSourceSkipMountPath&&(s.assets_source_skip_mount_path=!0),(0,qm.validateForDeploy)(i)}e.info(`Creating webflow.json with framework: ${r}`),Sn.writeFileSync(o,JSON.stringify(i,null,2))}function Km(e,t){let r=Fn(e,t);if(r?.cloud?.framework)return r.cloud.framework;let n=Fo(t);if(!n)throw new nr("Cannot detect framework: no package.json found",{remediation:'Run this command from your project root, or add a webflow.json with: { "cloud": { "framework": "<name>" } }'});e.info("webflow.json has no framework \u2014 detecting from package.json...");let o=cs(n,r);if(!o)throw new nr("Could not detect framework from package.json or webflow.json",{remediation:'Add a webflow.json with: { "cloud": { "framework": "<name>" } } (supported: astro, nextjs, vite)'});let i=o.Builder.frameworkName;return e.info(`Detected framework: ${o.result.reason}`),tu(e,t,i),i}C();var Zm=B.object({name:B.string(),main:B.string().optional(),compatibility_date:B.string(),compatibility_flags:B.array(B.string()).optional(),placement:B.object({mode:B.string()}).passthrough().optional(),assets:B.object({directory:B.string(),binding:B.string().optional()}).passthrough().optional(),d1_databases:B.array(B.object({database_name:B.string(),database_id:B.string(),binding:B.string(),migrations_dir:B.string().optional()}).passthrough()).default([]),kv_namespaces:B.array(B.object({binding:B.string(),id:B.string()}).passthrough()).default([]),r2_buckets:B.array(B.object({binding:B.string(),bucket_name:B.string()}).passthrough()).default([])}).passthrough();function Ym(e){return e.issues.map(t=>` - ${t.path.length>0?t.path.join("."):"<root>"}: ${t.message}`).join(`
141
141
  `)}function Xm(e,t="wrangler.json"){let r=ct.join(e,t);if(!ke.existsSync(r)){if(t.endsWith(".json"))return u.warn(`/${t} not found, checking for /${t}c`),Xm(e,t+"c");u.warn(`/${t} not found`);return}let n=ke.readFileSync(r,"utf8");u.info(`reading /${t}...`);let o;try{o=Nr(n)}catch(s){u.error(`/${t} loaded but could not parse as JSONC: ${s}`);return}let i=Zm.safeParse(o);if(!i.success){u.error(`/${t} loaded but schema validation failed:
142
- ${Ym(i.error)}`);return}return u.info(`successfully loaded /${t}`),i.data}async function Qm(e,t){let r=null,n=null,o=ct.join(t,"wrangler.json"),i=ct.join(t,"wrangler.jsonc");ke.existsSync(o)?(r=o,n=".json"):ke.existsSync(i)&&(r=i,n=".jsonc"),r&&n&&(u.info(`saving user-provided wrangler JSON as /clouduser.wrangler${n}...`),ke.copyFileSync(r,ct.join(t,`clouduser.wrangler${n}`)));let s=r?Xm(t,ct.basename(r)):null,a=e.getWranglerTemplatePath(),l=ct.join(t,"wrangler.json");if(!ke.existsSync(a))throw new Error(`Wrangler template not found at ${a}. Make sure the template is properly copied during build.`);if(u.info(`copying wrangler template for ${e.info.name} to /wrangler.json`),ke.copyFileSync(a,l),!s)return;let c=JSON.parse(ke.readFileSync(l,"utf8"));if(s.kv_namespaces&&s.kv_namespaces.length>0&&(c.kv_namespaces=s.kv_namespaces,u.info(`merged ${s.kv_namespaces.length} KV namespace(s) into template`)),s.r2_buckets&&s.r2_buckets.length>0&&(c.r2_buckets=s.r2_buckets,u.info(`merged ${s.r2_buckets.length} R2 bucket(s) into template`)),s.d1_databases&&s.d1_databases.length>0&&(c.d1_databases=s.d1_databases,u.info(`merged ${s.d1_databases.length} D1 database(s) into template`)),ke.writeFileSync(l,JSON.stringify(c,null,2)),s.d1_databases.length!==0)for(let d in s.d1_databases){let p=s.d1_databases[d];if(!p.migrations_dir){u.info(`skipping migrations for database ${d} in wrangler.json; migrations dir is not defined`);continue}let m=p.migrations_dir,g=ct.join(t,m);if(!ke.existsSync(g)){u.info(`skipping migrations for database ${d} in wrangler.json; migrations dir (/${m}) does not exist`);continue}let y=ct.join(t,"clouduser","migrations",m),x=Lr(u,g,y);x>0?u.info(`copied ${x} migrations to /clouduser/migrations/${m}`):u.info(`skipping migrations for database ${d} in wrangler.json; migrations dir (/${m}) is empty`)}}function av(e){if(!/^[a-z0-9-]+$/.test(e))throw new Error(`Invalid object storage bucket name ${JSON.stringify(e)}: Only lowercase letters, numbers, and hyphens are allowed.`);if(e.startsWith("-")||e.endsWith("-"))throw new Error(`Invalid object storage bucket name "${e}": Cannot begin or end with a hyphen.`);if(e.length>27)throw new Error(`Invalid object storage bucket name "${e}": Must be 27 characters or fewer (currently ${e.length} characters).`)}function eg(e){let t=null;for(let s of[".json",".jsonc"]){let a=ct.join(e,`clouduser.wrangler${s}`);if(ke.existsSync(a)){t=a;break}}if(!t)return;let r=ke.readFileSync(t,"utf8"),n;try{n=Nr(r)}catch(s){throw new Error(`Failed to parse wrangler config at ${t} as JSONC: ${s}`)}let o=Zm.safeParse(n);if(!o.success)throw new Error(`Invalid wrangler config at ${t}:
143
- ${Ym(o.error)}`);let i=o.data;if(i.d1_databases&&i.d1_databases.length>0&&i.d1_databases.length>5)throw new Error(`Too many D1 databases configured: ${i.d1_databases.length}. Maximum allowed is 5.`);if(i.kv_namespaces&&i.kv_namespaces.length>0&&i.kv_namespaces.length>5)throw new Error(`Too many KV namespaces configured: ${i.kv_namespaces.length}. Maximum allowed is 5.`);if(i.r2_buckets&&i.r2_buckets.length>0){if(i.r2_buckets.length>5)throw new Error(`Too many R2 buckets configured: ${i.r2_buckets.length}. Maximum allowed is 5.`);u.info(`validating ${i.r2_buckets.length} object storage bucket name(s)...`);for(let s of i.r2_buckets)av(s.bucket_name)}}C();I();W();ie();var lv="4.82.1",ds=60;function jt(e,t){let r=Math.min(ds,process.stdout.columns??ds),n=`\u2500\u2500\u2500 ${e} ${t} `,o="\u2500".repeat(Math.max(0,r-n.length));u.info(`
142
+ ${Ym(i.error)}`);return}return u.info(`successfully loaded /${t}`),i.data}async function Qm(e,t){let r=null,n=null,o=ct.join(t,"wrangler.json"),i=ct.join(t,"wrangler.jsonc");ke.existsSync(o)?(r=o,n=".json"):ke.existsSync(i)&&(r=i,n=".jsonc"),r&&n&&(u.info(`saving user-provided wrangler JSON as /clouduser.wrangler${n}...`),ke.copyFileSync(r,ct.join(t,`clouduser.wrangler${n}`)));let s=r?Xm(t,ct.basename(r)):null,a=e.getWranglerTemplatePath(),l=ct.join(t,"wrangler.json");if(!ke.existsSync(a))throw new Error(`Wrangler template not found at ${a}. Make sure the template is properly copied during build.`);if(u.info(`copying wrangler template for ${e.info.name} to /wrangler.json`),ke.copyFileSync(a,l),!s)return;let c=JSON.parse(ke.readFileSync(l,"utf8"));if(s.kv_namespaces&&s.kv_namespaces.length>0&&(c.kv_namespaces=s.kv_namespaces,u.info(`merged ${s.kv_namespaces.length} KV namespace(s) into template`)),s.r2_buckets&&s.r2_buckets.length>0&&(c.r2_buckets=s.r2_buckets,u.info(`merged ${s.r2_buckets.length} R2 bucket(s) into template`)),s.d1_databases&&s.d1_databases.length>0&&(c.d1_databases=s.d1_databases,u.info(`merged ${s.d1_databases.length} D1 database(s) into template`)),ke.writeFileSync(l,JSON.stringify(c,null,2)),s.d1_databases.length!==0)for(let d in s.d1_databases){let p=s.d1_databases[d];if(!p.migrations_dir){u.info(`skipping migrations for database ${d} in wrangler.json; migrations dir is not defined`);continue}let m=p.migrations_dir,g=ct.join(t,m);if(!ke.existsSync(g)){u.info(`skipping migrations for database ${d} in wrangler.json; migrations dir (/${m}) does not exist`);continue}let y=ct.join(t,"clouduser","migrations",m),x=Lr(u,g,y);x>0?u.info(`copied ${x} migrations to /clouduser/migrations/${m}`):u.info(`skipping migrations for database ${d} in wrangler.json; migrations dir (/${m}) is empty`)}}function lv(e){if(!/^[a-z0-9-]+$/.test(e))throw new Error(`Invalid object storage bucket name ${JSON.stringify(e)}: Only lowercase letters, numbers, and hyphens are allowed.`);if(e.startsWith("-")||e.endsWith("-"))throw new Error(`Invalid object storage bucket name "${e}": Cannot begin or end with a hyphen.`);if(e.length>27)throw new Error(`Invalid object storage bucket name "${e}": Must be 27 characters or fewer (currently ${e.length} characters).`)}function eg(e){let t=null;for(let s of[".json",".jsonc"]){let a=ct.join(e,`clouduser.wrangler${s}`);if(ke.existsSync(a)){t=a;break}}if(!t)return;let r=ke.readFileSync(t,"utf8"),n;try{n=Nr(r)}catch(s){throw new Error(`Failed to parse wrangler config at ${t} as JSONC: ${s}`)}let o=Zm.safeParse(n);if(!o.success)throw new Error(`Invalid wrangler config at ${t}:
143
+ ${Ym(o.error)}`);let i=o.data;if(i.d1_databases&&i.d1_databases.length>0&&i.d1_databases.length>5)throw new Error(`Too many D1 databases configured: ${i.d1_databases.length}. Maximum allowed is 5.`);if(i.kv_namespaces&&i.kv_namespaces.length>0&&i.kv_namespaces.length>5)throw new Error(`Too many KV namespaces configured: ${i.kv_namespaces.length}. Maximum allowed is 5.`);if(i.r2_buckets&&i.r2_buckets.length>0){if(i.r2_buckets.length>5)throw new Error(`Too many R2 buckets configured: ${i.r2_buckets.length}. Maximum allowed is 5.`);u.info(`validating ${i.r2_buckets.length} object storage bucket name(s)...`);for(let s of i.r2_buckets)lv(s.bucket_name)}}C();I();W();ie();var uv="4.82.1",ds=60;function jt(e,t){let r=Math.min(ds,process.stdout.columns??ds),n=`\u2500\u2500\u2500 ${e} ${t} `,o="\u2500".repeat(Math.max(0,r-n.length));u.info(`
144
144
  ${Y(`${n}${o}`)}`)}function ru(e,t){let r=Math.min(ds,process.stdout.columns??ds),n=`\u2550\u2550\u2550 ${e} ${t} `,o="\u2550".repeat(Math.max(0,r-n.length));u.info(`
145
- ${Y(Me(`${n}${o}`))}`)}async function rg(e=process.cwd(),t,r,n){let o=Fo(e);if(!o)throw new Error("No package.json file found");let i=Fn(u,e),s={...n?{COSMIC_MOUNT_PATH:n}:{},...t?{COSMIC_DEPLOY_URL:t}:{},...r&&!t?{COSMIC_DEPLOY_URL:cv(r)}:{}};return eu({cwd:e,log:u,packageJson:o,userEnv:s},i)}async function ng(e,t={}){let r=t.projectPath||process.cwd(),n=Date.now(),o=X.join(r,".tmp",`webflow-build-${n}`),i=t.outputDir||X.join(o,"output"),s=t.mountPath||"/app",a=Date.now(),l=nu(r),c=t.telemetry,d=e.getBuildCommand(),p=e.getOutputDeployMetadata();await c?.sendUsage("cloud_build_start",{framework:e.info.name,buildCommand:d,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:l}),L.mkdirSync(o,{recursive:!0});try{jt("\u{1F527}","Configure framework"),u.info(`Framework: ${e.info.displayName}`),u.info(`Mount path: ${s}`),u.info(`Deployment type: ${p.deploymentType}`);let m=e.getNodeVersionRequirement();m&&xn(u,m,e.info.displayName),u.info("Validating framework requirements..."),await e.validate(),u.info("Installing framework dependencies..."),await e.installDependencies(),jt("\u2699\uFE0F ","Configure wrangler"),await Qm(e,r),u.info("Preparing framework configuration..."),await e.prepareConfig(),tu(u,r,e.info.name,e),jt("\u{1F4E6}","Install dependencies"),await uv(r,e.info.name,t.telemetry),eg(r),jt("\u{1F3D7}\uFE0F ","Build app"),u.info(`running ${d}...`),await dv(r,d,t.telemetry),await e.postBuild(),jt("\u{1F9EA}","Wrangler dry-run"),await fv(r,i),jt("\u{1F4C1}","Copy assets"),await pv(r,i,e,s),jt("\u{1F381}","Create tarball");let g=await mv(i),y=Date.now()-a;return u.info(`${O} Build completed in ${(y/1e3).toFixed(1)}s`),await c?.sendUsage("cloud_build_success",{duration:y,framework:e.info.name,buildCommand:d,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:l}),g}catch(m){let g=Date.now()-a;throw await c?.sendError(m instanceof Error?m:new Error(String(m)),"cloud_build_failure",{duration:g,framework:e.info.name,buildCommand:d,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:l}),m}}function nu(e){let t=X.join(e,"wrangler.json");if(!L.existsSync(t))return{hasKV:!1,hasD1:!1,hasR2:!1,hasVars:!1,kvCount:0,d1Count:0,r2Count:0,varCount:0};try{let r=JSON.parse(L.readFileSync(t,"utf8")),n=r.kv_namespaces||[],o=r.d1_databases||[],i=r.r2_buckets||[],s=r.vars||{};return{hasKV:n.length>0,hasD1:o.length>0,hasR2:i.length>0,hasVars:Object.keys(s).length>0,kvCount:n.length,d1Count:o.length,r2Count:i.length,varCount:Object.keys(s).length}}catch(r){return console.debug("Failed to parse wrangler.json for bindings detection:",r),{hasKV:!1,hasD1:!1,hasR2:!1,hasVars:!1,kvCount:0,d1Count:0,r2Count:0,varCount:0}}}function og(e){try{let t=X.dirname(e);t.includes(".tmp/webflow-build-")&&(jt("\u{1F9F9}","Clean up build artifacts"),L.rmSync(t,{recursive:!0,force:!0}))}catch(t){u.warn(`Warning: Failed to clean up build artifacts: ${t}`)}}function ig(e,t){try{jt("\u{1F9F9}","Revert framework configuration");let r=t.getUserConfigPatterns(),n=new Set;for(let s of r){let a=X.extname(s).slice(1),l=X.basename(s,`.${a}`);if(!n.has(l)){n.add(l);for(let c of["mjs","cjs","js","ts"]){let d=X.join(e,`clouduser.${l}.${c}`),p=X.join(e,`${l}.${c}`);if(L.existsSync(d)){u.info(`restoring /${l}.${c} from /clouduser.${l}.${c}...`),L.existsSync(p)&&L.unlinkSync(p),L.renameSync(d,p);break}}}}for(let s of[".jsonc",".json"]){let a=X.join(e,`clouduser.wrangler${s}`);if(L.existsSync(a)){u.info(`restoring user wrangler${s} from backup...`);let l=X.join(e,"wrangler.json");L.existsSync(l)&&L.unlinkSync(l);let c=X.join(e,`wrangler${s}`);L.renameSync(a,c);break}}let o=X.join(e,"clouduser");L.existsSync(o)&&(u.info("cleaning up clouduser directory..."),L.rmSync(o,{recursive:!0,force:!0}));for(let s of t.getAdditionalConfigFiles()){let a=X.join(e,X.basename(s));L.existsSync(a)&&(u.info(`cleaning up additional config file ${a}...`),L.unlinkSync(a))}let i=t.getWebflowLoader();if(i){let s=X.join(e,i.destinationName);L.existsSync(s)&&(u.info(`cleaning up ${i.destinationName}...`),L.unlinkSync(s))}}catch(r){u.warn(`Warning: Failed to cleanup framework configuration: ${r}`)}}async function uv(e,t,r){let n=Date.now(),o=["--no-update-notifier","--no-progress"],i=X.join(e,"package-lock.json");try{L.existsSync(i)?(u.info("Running npm ci --include=dev..."),(0,So.execSync)(`npm ci --include=dev ${o.join(" ")}`,{cwd:e,stdio:"inherit"})):(u.info("Warning: No package-lock.json found, installing dependencies with npm install --include=dev"),(0,So.execSync)(`npm install --include=dev ${o.join(" ")}`,{cwd:e,stdio:"inherit"}));let s=Date.now()-n;await r?.sendUsage("cloud_install_dependencies_success",{duration:s,framework:t,hasPackageLock:L.existsSync(i)})}catch(s){let a=Date.now()-n;throw await r?.sendError(s instanceof Error?s:new Error(String(s)),"cloud_install_dependencies_failure",{duration:a,framework:t,hasPackageLock:L.existsSync(i)}),s}}function cv(e){let t="production",r;switch(t){case"development":r="wf-app-dev";break;case"acceptance":r="wf-app-acceptance";break;default:r="wf-app-prod"}return`https://${e}.${r}.cosmic.webflow.services`}async function dv(e,t,r){let n=Date.now();try{(0,So.execSync)(`npm exec -- ${t}`,{cwd:e,stdio:"inherit"});let o=Date.now()-n;await r?.sendUsage("cloud_build_command_success",{duration:o,buildCommand:t})}catch(o){let i=Date.now()-n;throw await r?.sendError(o instanceof Error?o:new Error(String(o)),"cloud_build_command_failure",{duration:i,buildCommand:t}),new Error(`Build command failed: ${t}`)}}async function fv(e,t){L.mkdirSync(t,{recursive:!0});let r=X.join(e,"wrangler.json"),n=X.join(e,"wrangler.jsonc");if(!L.existsSync(r)&&!L.existsSync(n))throw new Error("Missing wrangler configuration: wrangler.json or wrangler.jsonc file is required");(0,So.execSync)(`npx wrangler@${lv} deploy --dry-run --outdir="${t}"`,{cwd:e,stdio:"inherit"})}async function pv(e,t,r,n){let o=r.getOutputDeployMetadata(),i=o.staticAssetsPath,s=o.staticAssetsExclude?.[0],a=o.assetsSourceSkipMountPath===!0,l=n.replace(/\/+$/,"").replace(/^\/+/,"");if(!a&&l&&(r.info.name==="nextjs"||r.info.name==="astro")){let g=X.join(e,i);if(L.existsSync(g)&&L.statSync(g).isDirectory()){let x=L.readdirSync(g,{withFileTypes:!0}).find(T=>!(!T.isDirectory()||s&&T.name===s||r.info.name==="astro"&&(T.name==="_routes.json"||T.name==="_worker.js")));x&&(i=`${i}/${x.name}`)}}let c=X.join(t,"assets",l||"");L.mkdirSync(c,{recursive:!0});let d=X.join(e,i);if(L.existsSync(d)&&L.statSync(d).isDirectory()){u.info(`copying assets from /${i} to output/assets...`);try{s?(u.info(`excluding ${s}`),Lr(u,d,c,{exclude:s})):Lr(u,d,c)}catch(g){u.error(g,{prefix:"Failed to copy assets:"})}}else u.info("No assets to copy or assets directory not found");let p=X.join(e,"webflow.json");L.existsSync(p)?(u.info("including webflow.json in output..."),L.copyFileSync(p,X.join(t,"webflow.json"))):u.warn("webflow.json not found at project root; deploy may fail framework detection");let m=null;for(let g of[".json",".jsonc"]){let y=X.join(e,`clouduser.wrangler${g}`);if(L.existsSync(y)){m=y;break}}if(m){u.info("including user wrangler config in output..."),L.copyFileSync(m,X.join(t,"clouduser.wrangler.json"));let g=X.join(e,"clouduser","migrations");if(L.existsSync(g)){u.info("copying migrations from clouduser/migrations to output/migrations...");let y=X.join(t,"migrations");Lr(u,g,y)}}}async function mv(e){let t=`${e}.tar.gz`;try{return await tg.create({gzip:!0,file:t,cwd:X.dirname(e)},[X.basename(e)]),u.info(`Tarball created: ${t}`),t}catch(r){throw new f(r,{prefix:"Failed to create tarball:"})}}De();se();C();var gv="DUPLICATE_ENVIRONMENT_MOUNT",hv="ENVIRONMENT_MOUNT_MISMATCH",wv="DUPLICATE_ENVIRONMENT_BRANCH",yv="INVALID_MOUNT_PATH_FORMAT",Dv="INVALID_PROJECT_ID",sg={[gv]:"An environment with this mount path already exists for this site. Please choose a different mount path.",[hv]:"This environment already exists with a different mount path. Please create a new environment or use the existing environment's mount path.",[wv]:"An environment with this branch already exists for this app.",[yv]:"Mount path format is invalid. It must start with a / and be followed by at least one character (e.g., /app).",[Dv]:"Invalid app ID. This app may have been deleted or belongs to a different site. Please remove the 'app_id' field (or the legacy 'project_id' field) from your webflow.json and redeploy to create a new app."};function ag(e){let t={timestamp:new Date().toISOString()};if(e instanceof Error)t.code=e.name,t.msg=e.message,t.stack=e.stack;else if(typeof e=="object"&&e!==null){let i=e;t.code=typeof i.code=="string"?i.code:void 0,t.msg=typeof i.msg=="string"?i.msg:void 0,t.status=typeof i.status=="number"?i.status:void 0}let r=t.msg||"",n=t.status??t.code,o=typeof n=="number"?n:typeof n=="string"&&/^\d+$/.test(n)?Number(n):void 0;if(u.error(`Error Details: ${JSON.stringify({timestamp:t.timestamp,code:t.code,message:t.msg,status:t.status,stack:t.stack},null,2)}`),o===401)return"Your access token is expired or invalid. Run 'webflow auth login' to re-authenticate.";if(o===403)return"Your access token is missing required permissions. Run 'webflow auth login' to re-authenticate with the necessary scopes.";for(let i in sg)if(r.includes(i))return sg[i];return`An unknown error occurred. Error code: ${t.code||"N/A"}, Message: ${t.msg||"No message provided"}`}var Tn=h(require("fs")),ou=require("child_process");C();I();W();var lg=104857600;function ug(e){if(e===0)return"0 B";let t=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,n)).toFixed(1))} ${r[n]}`}function bv(){try{let e=(0,ou.execSync)("git rev-parse HEAD",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(!/^[0-9a-f]{40}$/.test(e))throw new Error("Invalid commit hash format");try{return(0,ou.execSync)("git status --porcelain --untracked-files=no",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().length>0?`git@${e}+dirty`:`git@${e}`}catch{return`git@${e}`}}catch{return`noversion@${new Date().toISOString()}`}}async function iu(e,t,r){let n=await fetch(`${_}${t}`,{method:r.method,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:r.body?JSON.stringify(r.body):void 0});if(!n.ok){let o=await n.text(),i;try{i=JSON.parse(o)}catch{i={msg:o}}let s=ag(i);throw new Error(s)}return n.json()}async function cg(e,t,r,n){let{manifest:o}=J(),i=o.cloud||{},s=i.app_id??i.project_id,a=i.framework;if(!a)throw new f("No framework specified in webflow.json. Please ensure your webflow.json has a cloud.framework property");let l=await vv({siteId:e.siteId,apiToken:e.accessToken,framework:a,mountPath:r,environment:t,projectId:s,projectName:n?.projectName,description:n?.description,directory:n?.directory,version:bv()});return!s&&l.project_id&&(ue({cloud:{...i,app_id:l.project_id}}),u.info(`${O} App ID updated in webflow.json`)),l}async function vv(e){let{siteId:t,framework:r,mountPath:n,environment:o,version:i,projectId:s,projectName:a,description:l,directory:c}=e,d={framework:r,mount_path:n,environment:o,version:i};s&&(d.project_id=s),a&&(d.project_name=a),l&&(d.description=l),c&&(d.app_path=c);let p=t?`/cosmic/${t}/cli-deploy-init`:"/cosmic/cli-deploy-init";return iu(e.apiToken,p,{method:"POST",body:d})}async function dg(e,t){let{siteId:r,accessToken:n}=e,o=r?`/cosmic/${r}/cli-project-environments/${t}`:`/cosmic/cli-project-environments/${t}`;return iu(n,o,{method:"GET"})}async function fg(e){let{siteId:t,accessToken:r}=e,n=t?`/cosmic/${t}/cli-projects`:"/cosmic/cli-projects";return iu(r,n,{method:"GET"})}async function pg(e,t){if(!Tn.existsSync(e))throw new Error(`Tarball not found at ${e}`);let r=Tn.statSync(e);if(r.size>lg)throw new Error(`Build output is too large (${ug(r.size)}). Maximum allowed size is ${ug(lg)}.`);let n=Tn.readFileSync(e),o=JSON.parse(t);if(!o.fields)throw new Error("Upload URL is missing fields property");let i=new FormData;Object.entries(o.fields).forEach(([l,c])=>{i.append(l,c)});let s=new Blob([n],{type:"application/gzip"});i.append("file",s,"output.tar.gz");let a=await fetch(o.url,{method:"POST",body:i});if(!a.ok){let l=await a.text();throw new f(l,{prefix:`${F} Upload failed with response:`})}}async function mg(e,t){if(!e||e==="undefined")throw new f("Completion URL is undefined or invalid");let r=new URL(e);t&&r.searchParams.set("failed","true");let n=await fetch(r.toString(),{method:"GET"});if(!n.ok)throw new f(`Failed to trigger deployment: ${n.status} ${n.statusText}`)}var gg=require("webflow-api");se();se();I();function su(e){return new gg.WebflowClient({accessToken:e,environment:{base:`${_}/v2`,dataApi:`${_}/v2`,contentDeliveryApi:`${Xo}/v2`}})}async function To(e,t){try{let n=await su(e).sites.get(t);return{id:n.id||t,displayName:n.displayName||"Unknown Site",shortName:n.shortName||"unknown-site",customDomains:n.customDomains?.map(o=>({id:o.id||"",url:o.url||""}))||[]}}catch(r){throw new f(r,{prefix:"Error fetching site details:"})}}async function au(e,t){try{return{customDomains:(await su(e).sites.getCustomDomain(t)).customDomains?.map(o=>({id:o.id||"",url:o.url||""}))||[]}}catch(r){throw new f(r,{prefix:"Error fetching custom domains:"})}}async function lu(e){try{let t=await fetch(`https://${e}/manifest.json`);if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);return await t.json()}catch(t){throw new f(t,{prefix:`Failed to fetch manifest from ${e}:`})}}function uu(e,t,r){return e.cosmic&&Array.isArray(e.cosmic)?e.cosmic.some(n=>{if(n.mountPath!==t)return!1;if(!r)return!0;if(n.workerUrl)try{return new URL(n.workerUrl).hostname.split(".")[0]===r}catch{return!1}return!1}):!1}async function hg(e,t,r){try{let n=su(e),o=await To(e,t),i=[];if(r?.domains&&r.domains.length>0)for(let s of r.domains){let a=o.customDomains?.find(l=>l.url===s);a?.id&&i.push(a.id)}await n.sites.publish(t,{customDomains:i,publishToWebflowSubdomain:r?.publishToWebflowSubdomain??!0})}catch(n){throw new f(n,{prefix:"Error publishing site:"})}}Ie();C();async function wg(e,t,r){let{siteId:n,accessToken:o}=e;if(!n)throw new Error("Site ID is required for mount path validation. Apps without a connected site skip this step.");let i=u.spinner("Validating mount path configuration");try{let s=await To(o,n),a=await au(o,n),l=[`${s.shortName}.webflow.io`,...a.customDomains?.map(y=>y.url)||[]],c=0;i.update(`Validating ${l.length} domain(s) for mount path: ${t}... (0/${l.length})`);let d=l.map(async y=>{try{let x=await lu(y),T=Array.isArray(x.cosmic)?x.cosmic.map(Z=>Z.mountPath).filter(Z=>typeof Z=="string"):[],P=uu(x,t,r);return{domain:y,mountPaths:T,isValid:P===!0}}catch(x){return{domain:y,mountPaths:[],isValid:!1,error:x instanceof Error?x.message:String(x)}}finally{c++,i.update(`Validating ${l.length} domain(s) for mount path: ${t}... (${c}/${l.length})`)}}),p=await Promise.all(d),m=p.some(y=>!y.isValid),g=p.every(y=>y.isValid);return i.succeed("Mount path validation completed"),{isValid:g,domains:p,needsPublishing:m}}catch(s){throw i.fail("Mount path validation failed"),s}}async function yg(e,t,r){let{siteId:n,accessToken:o}=e;if(!n)return[];try{let i=await To(o,n),s=await au(o,n),l=[`${i.shortName}.webflow.io`,...s.customDomains?.map(d=>d.url)||[]].map(async d=>{try{let p=await lu(d),m=uu(p,t,r);return{domain:d,isValid:m}}catch(p){return u.debug(`Could not verify mount path for ${d}: ${p}`),{domain:d,isValid:!1}}});return(await Promise.all(l)).filter(d=>d.isValid).map(d=>d.domain)}catch(i){return u.debug(`Error getting valid domains: ${i}`),[]}}function Dg(e,t){return e.map(r=>`${r.startsWith("localhost")||r.startsWith("127.0.0.1")?"http":"https"}://${r}${t}`)}async function bg(e){let t=e.map(n=>({name:n,value:n,checked:!0})),r=await ti({message:"Select which domains you want to publish to update the mount path configuration:",choices:t,validate:n=>n.length===0?"Please select at least one domain to publish to.":!0});return r??[]}async function vg(){return await Ae({message:"The mount path doesn't match on some domains. Would you like to publish the site to update the configuration?",default:!0})}async function cu(e,t){let{siteId:r,accessToken:n}=e;if(!r)throw new Error("Site ID is required to publish. Apps without a connected site do not use this.");let o=u.spinner(`Publishing site to ${t.length} domain(s)`);try{let s=`${(await To(n,r)).shortName}.webflow.io`,a=t.includes(s),l=t.filter(c=>c!==s);await hg(n,r,{domains:l,publishToWebflowSubdomain:a}),o.succeed(`Site published successfully to selected domains: ${t.join(", ")}`)}catch{throw o.fail("Failed to publish site"),new Error("Failed to publish site")}}C();ie();var Vr=h(require("path"));De();se();Se();var gs=h(require("fs"));I();se();Ie();I();C();async function fs(e){let t=await fetch(`${_}/v2/workspaces`,{method:"GET",headers:{Authorization:`Bearer ${e}`}});if(!t.ok){let n=await t.text(),o={};try{o=JSON.parse(n)}catch{}throw t.status===403&&o.code==="missing_scopes"?new f(`Missing required scopes for workspace access.
145
+ ${Y(Me(`${n}${o}`))}`)}async function rg(e=process.cwd(),t,r,n){let o=Fo(e);if(!o)throw new Error("No package.json file found");let i=Fn(u,e),s={...n?{COSMIC_MOUNT_PATH:n}:{},...t?{COSMIC_DEPLOY_URL:t}:{},...r&&!t?{COSMIC_DEPLOY_URL:dv(r)}:{}};return eu({cwd:e,log:u,packageJson:o,userEnv:s},i)}async function ng(e,t={}){let r=t.projectPath||process.cwd(),n=Date.now(),o=X.join(r,".tmp",`webflow-build-${n}`),i=t.outputDir||X.join(o,"output"),s=t.mountPath||"/app",a=Date.now(),l=nu(r),c=t.telemetry,d=e.getBuildCommand(),p=e.getOutputDeployMetadata();await c?.sendUsage("cloud_build_start",{framework:e.info.name,buildCommand:d,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:l}),L.mkdirSync(o,{recursive:!0});try{jt("\u{1F527}","Configure framework"),u.info(`Framework: ${e.info.displayName}`),u.info(`Mount path: ${s}`),u.info(`Deployment type: ${p.deploymentType}`);let m=e.getNodeVersionRequirement();m&&xn(u,m,e.info.displayName),u.info("Validating framework requirements..."),await e.validate(),u.info("Installing framework dependencies..."),await e.installDependencies(),jt("\u2699\uFE0F ","Configure wrangler"),await Qm(e,r),u.info("Preparing framework configuration..."),await e.prepareConfig(),tu(u,r,e.info.name,e),jt("\u{1F4E6}","Install dependencies"),await cv(r,e.info.name,t.telemetry),eg(r),jt("\u{1F3D7}\uFE0F ","Build app"),u.info(`running ${d}...`),await fv(r,d,t.telemetry),await e.postBuild(),jt("\u{1F9EA}","Wrangler dry-run"),await pv(r,i),jt("\u{1F4C1}","Copy assets"),await mv(r,i,e,s),jt("\u{1F381}","Create tarball");let g=await gv(i),y=Date.now()-a;return u.info(`${O} Build completed in ${(y/1e3).toFixed(1)}s`),await c?.sendUsage("cloud_build_success",{duration:y,framework:e.info.name,buildCommand:d,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:l}),g}catch(m){let g=Date.now()-a;throw await c?.sendError(m instanceof Error?m:new Error(String(m)),"cloud_build_failure",{duration:g,framework:e.info.name,buildCommand:d,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:l}),m}}function nu(e){let t=X.join(e,"wrangler.json");if(!L.existsSync(t))return{hasKV:!1,hasD1:!1,hasR2:!1,hasVars:!1,kvCount:0,d1Count:0,r2Count:0,varCount:0};try{let r=JSON.parse(L.readFileSync(t,"utf8")),n=r.kv_namespaces||[],o=r.d1_databases||[],i=r.r2_buckets||[],s=r.vars||{};return{hasKV:n.length>0,hasD1:o.length>0,hasR2:i.length>0,hasVars:Object.keys(s).length>0,kvCount:n.length,d1Count:o.length,r2Count:i.length,varCount:Object.keys(s).length}}catch(r){return console.debug("Failed to parse wrangler.json for bindings detection:",r),{hasKV:!1,hasD1:!1,hasR2:!1,hasVars:!1,kvCount:0,d1Count:0,r2Count:0,varCount:0}}}function og(e){try{let t=X.dirname(e);t.includes(".tmp/webflow-build-")&&(jt("\u{1F9F9}","Clean up build artifacts"),L.rmSync(t,{recursive:!0,force:!0}))}catch(t){u.warn(`Warning: Failed to clean up build artifacts: ${t}`)}}function ig(e,t){try{jt("\u{1F9F9}","Revert framework configuration");let r=t.getUserConfigPatterns(),n=new Set;for(let s of r){let a=X.extname(s).slice(1),l=X.basename(s,`.${a}`);if(!n.has(l)){n.add(l);for(let c of["mjs","cjs","js","ts"]){let d=X.join(e,`clouduser.${l}.${c}`),p=X.join(e,`${l}.${c}`);if(L.existsSync(d)){u.info(`restoring /${l}.${c} from /clouduser.${l}.${c}...`),L.existsSync(p)&&L.unlinkSync(p),L.renameSync(d,p);break}}}}for(let s of[".jsonc",".json"]){let a=X.join(e,`clouduser.wrangler${s}`);if(L.existsSync(a)){u.info(`restoring user wrangler${s} from backup...`);let l=X.join(e,"wrangler.json");L.existsSync(l)&&L.unlinkSync(l);let c=X.join(e,`wrangler${s}`);L.renameSync(a,c);break}}let o=X.join(e,"clouduser");L.existsSync(o)&&(u.info("cleaning up clouduser directory..."),L.rmSync(o,{recursive:!0,force:!0}));for(let s of t.getAdditionalConfigFiles()){let a=X.join(e,X.basename(s));L.existsSync(a)&&(u.info(`cleaning up additional config file ${a}...`),L.unlinkSync(a))}let i=t.getWebflowLoader();if(i){let s=X.join(e,i.destinationName);L.existsSync(s)&&(u.info(`cleaning up ${i.destinationName}...`),L.unlinkSync(s))}}catch(r){u.warn(`Warning: Failed to cleanup framework configuration: ${r}`)}}async function cv(e,t,r){let n=Date.now(),o=["--no-update-notifier","--no-progress"],i=X.join(e,"package-lock.json");try{L.existsSync(i)?(u.info("Running npm ci --include=dev..."),(0,So.execSync)(`npm ci --include=dev ${o.join(" ")}`,{cwd:e,stdio:"inherit"})):(u.info("Warning: No package-lock.json found, installing dependencies with npm install --include=dev"),(0,So.execSync)(`npm install --include=dev ${o.join(" ")}`,{cwd:e,stdio:"inherit"}));let s=Date.now()-n;await r?.sendUsage("cloud_install_dependencies_success",{duration:s,framework:t,hasPackageLock:L.existsSync(i)})}catch(s){let a=Date.now()-n;throw await r?.sendError(s instanceof Error?s:new Error(String(s)),"cloud_install_dependencies_failure",{duration:a,framework:t,hasPackageLock:L.existsSync(i)}),s}}function dv(e){let t="production",r;switch(t){case"development":r="wf-app-dev";break;case"acceptance":r="wf-app-acceptance";break;default:r="wf-app-prod"}return`https://${e}.${r}.cosmic.webflow.services`}async function fv(e,t,r){let n=Date.now();try{(0,So.execSync)(`npm exec -- ${t}`,{cwd:e,stdio:"inherit"});let o=Date.now()-n;await r?.sendUsage("cloud_build_command_success",{duration:o,buildCommand:t})}catch(o){let i=Date.now()-n;throw await r?.sendError(o instanceof Error?o:new Error(String(o)),"cloud_build_command_failure",{duration:i,buildCommand:t}),new Error(`Build command failed: ${t}`)}}async function pv(e,t){L.mkdirSync(t,{recursive:!0});let r=X.join(e,"wrangler.json"),n=X.join(e,"wrangler.jsonc");if(!L.existsSync(r)&&!L.existsSync(n))throw new Error("Missing wrangler configuration: wrangler.json or wrangler.jsonc file is required");(0,So.execSync)(`npx wrangler@${uv} deploy --dry-run --outdir="${t}"`,{cwd:e,stdio:"inherit"})}async function mv(e,t,r,n){let o=r.getOutputDeployMetadata(),i=o.staticAssetsPath,s=o.staticAssetsExclude?.[0],a=o.assetsSourceSkipMountPath===!0,l=n.replace(/\/+$/,"").replace(/^\/+/,"");if(!a&&l&&(r.info.name==="nextjs"||r.info.name==="astro")){let g=X.join(e,i);if(L.existsSync(g)&&L.statSync(g).isDirectory()){let x=L.readdirSync(g,{withFileTypes:!0}).find(T=>!(!T.isDirectory()||s&&T.name===s||r.info.name==="astro"&&(T.name==="_routes.json"||T.name==="_worker.js")));x&&(i=`${i}/${x.name}`)}}let c=X.join(t,"assets",l||"");L.mkdirSync(c,{recursive:!0});let d=X.join(e,i);if(L.existsSync(d)&&L.statSync(d).isDirectory()){u.info(`copying assets from /${i} to output/assets...`);try{s?(u.info(`excluding ${s}`),Lr(u,d,c,{exclude:s})):Lr(u,d,c)}catch(g){u.error(g,{prefix:"Failed to copy assets:"})}}else u.info("No assets to copy or assets directory not found");let p=X.join(e,"webflow.json");L.existsSync(p)?(u.info("including webflow.json in output..."),L.copyFileSync(p,X.join(t,"webflow.json"))):u.warn("webflow.json not found at project root; deploy may fail framework detection");let m=null;for(let g of[".json",".jsonc"]){let y=X.join(e,`clouduser.wrangler${g}`);if(L.existsSync(y)){m=y;break}}if(m){u.info("including user wrangler config in output..."),L.copyFileSync(m,X.join(t,"clouduser.wrangler.json"));let g=X.join(e,"clouduser","migrations");if(L.existsSync(g)){u.info("copying migrations from clouduser/migrations to output/migrations...");let y=X.join(t,"migrations");Lr(u,g,y)}}}async function gv(e){let t=`${e}.tar.gz`;try{return await tg.create({gzip:!0,file:t,cwd:X.dirname(e)},[X.basename(e)]),u.info(`Tarball created: ${t}`),t}catch(r){throw new f(r,{prefix:"Failed to create tarball:"})}}De();se();C();var hv="DUPLICATE_ENVIRONMENT_MOUNT",wv="ENVIRONMENT_MOUNT_MISMATCH",yv="DUPLICATE_ENVIRONMENT_BRANCH",Dv="INVALID_MOUNT_PATH_FORMAT",bv="INVALID_PROJECT_ID",sg={[hv]:"An environment with this mount path already exists for this site. Please choose a different mount path.",[wv]:"This environment already exists with a different mount path. Please create a new environment or use the existing environment's mount path.",[yv]:"An environment with this branch already exists for this app.",[Dv]:"Mount path format is invalid. It must start with a / and be followed by at least one character (e.g., /app).",[bv]:"Invalid app ID. This app may have been deleted or belongs to a different site. Please remove the 'app_id' field (or the legacy 'project_id' field) from your webflow.json and redeploy to create a new app."};function ag(e){let t={timestamp:new Date().toISOString()};if(e instanceof Error)t.code=e.name,t.msg=e.message,t.stack=e.stack;else if(typeof e=="object"&&e!==null){let i=e;t.code=typeof i.code=="string"?i.code:void 0,t.msg=typeof i.msg=="string"?i.msg:void 0,t.status=typeof i.status=="number"?i.status:void 0}let r=t.msg||"",n=t.status??t.code,o=typeof n=="number"?n:typeof n=="string"&&/^\d+$/.test(n)?Number(n):void 0;if(u.error(`Error Details: ${JSON.stringify({timestamp:t.timestamp,code:t.code,message:t.msg,status:t.status,stack:t.stack},null,2)}`),o===401)return"Your access token is expired or invalid. Run 'webflow auth login' to re-authenticate.";if(o===403)return"Your access token is missing required permissions. Run 'webflow auth login' to re-authenticate with the necessary scopes.";for(let i in sg)if(r.includes(i))return sg[i];return`An unknown error occurred. Error code: ${t.code||"N/A"}, Message: ${t.msg||"No message provided"}`}var Tn=h(require("fs")),ou=require("child_process"),cg=h(require("semver"));C();I();W();function vv(e){if(!e)return"unknown";let t=cg.default.coerce(e)?.major;return t!==void 0?String(t):"unknown"}var lg=104857600;function ug(e){if(e===0)return"0 B";let t=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,n)).toFixed(1))} ${r[n]}`}function Ev(){try{let e=(0,ou.execSync)("git rev-parse HEAD",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(!/^[0-9a-f]{40}$/.test(e))throw new Error("Invalid commit hash format");try{return(0,ou.execSync)("git status --porcelain --untracked-files=no",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().length>0?`git@${e}+dirty`:`git@${e}`}catch{return`git@${e}`}}catch{return`noversion@${new Date().toISOString()}`}}async function iu(e,t,r){let n=await fetch(`${_}${t}`,{method:r.method,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:r.body?JSON.stringify(r.body):void 0});if(!n.ok){let o=await n.text(),i;try{i=JSON.parse(o)}catch{i={msg:o}}let s=ag(i);throw new Error(s)}return n.json()}async function dg(e,t,r,n){let{manifest:o}=J(),i=o.cloud||{},s=i.app_id??i.project_id,a=i.framework;if(!a)throw new f("No framework specified in webflow.json. Please ensure your webflow.json has a cloud.framework property");let l=vv(i.framework_version),c=await xv({siteId:e.siteId,apiToken:e.accessToken,framework:a,frameworkVersion:l,mountPath:r,environment:t,projectId:s,projectName:n?.projectName,description:n?.description,directory:n?.directory,version:Ev()});return!s&&c.project_id&&(ue({cloud:{...i,app_id:c.project_id}}),u.info(`${O} App ID updated in webflow.json`)),c}async function xv(e){let{siteId:t,framework:r,frameworkVersion:n,mountPath:o,environment:i,version:s,projectId:a,projectName:l,description:c,directory:d}=e,p={framework:r,framework_version:n,mount_path:o,environment:i,version:s};a&&(p.project_id=a),l&&(p.project_name=l),c&&(p.description=c),d&&(p.app_path=d);let m=t?`/cosmic/${t}/cli-deploy-init`:"/cosmic/cli-deploy-init";return iu(e.apiToken,m,{method:"POST",body:p})}async function fg(e,t){let{siteId:r,accessToken:n}=e,o=r?`/cosmic/${r}/cli-project-environments/${t}`:`/cosmic/cli-project-environments/${t}`;return iu(n,o,{method:"GET"})}async function pg(e){let{siteId:t,accessToken:r}=e,n=t?`/cosmic/${t}/cli-projects`:"/cosmic/cli-projects";return iu(r,n,{method:"GET"})}async function mg(e,t){if(!Tn.existsSync(e))throw new Error(`Tarball not found at ${e}`);let r=Tn.statSync(e);if(r.size>lg)throw new Error(`Build output is too large (${ug(r.size)}). Maximum allowed size is ${ug(lg)}.`);let n=Tn.readFileSync(e),o=JSON.parse(t);if(!o.fields)throw new Error("Upload URL is missing fields property");let i=new FormData;Object.entries(o.fields).forEach(([l,c])=>{i.append(l,c)});let s=new Blob([n],{type:"application/gzip"});i.append("file",s,"output.tar.gz");let a=await fetch(o.url,{method:"POST",body:i});if(!a.ok){let l=await a.text();throw new f(l,{prefix:`${F} Upload failed with response:`})}}async function gg(e,t){if(!e||e==="undefined")throw new f("Completion URL is undefined or invalid");let r=new URL(e);t&&r.searchParams.set("failed","true");let n=await fetch(r.toString(),{method:"GET"});if(!n.ok)throw new f(`Failed to trigger deployment: ${n.status} ${n.statusText}`)}var hg=require("webflow-api");se();se();I();function su(e){return new hg.WebflowClient({accessToken:e,environment:{base:`${_}/v2`,dataApi:`${_}/v2`,contentDeliveryApi:`${Xo}/v2`}})}async function To(e,t){try{let n=await su(e).sites.get(t);return{id:n.id||t,displayName:n.displayName||"Unknown Site",shortName:n.shortName||"unknown-site",customDomains:n.customDomains?.map(o=>({id:o.id||"",url:o.url||""}))||[]}}catch(r){throw new f(r,{prefix:"Error fetching site details:"})}}async function au(e,t){try{return{customDomains:(await su(e).sites.getCustomDomain(t)).customDomains?.map(o=>({id:o.id||"",url:o.url||""}))||[]}}catch(r){throw new f(r,{prefix:"Error fetching custom domains:"})}}async function lu(e){try{let t=await fetch(`https://${e}/manifest.json`);if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);return await t.json()}catch(t){throw new f(t,{prefix:`Failed to fetch manifest from ${e}:`})}}function uu(e,t,r){return e.cosmic&&Array.isArray(e.cosmic)?e.cosmic.some(n=>{if(n.mountPath!==t)return!1;if(!r)return!0;if(n.workerUrl)try{return new URL(n.workerUrl).hostname.split(".")[0]===r}catch{return!1}return!1}):!1}async function wg(e,t,r){try{let n=su(e),o=await To(e,t),i=[];if(r?.domains&&r.domains.length>0)for(let s of r.domains){let a=o.customDomains?.find(l=>l.url===s);a?.id&&i.push(a.id)}await n.sites.publish(t,{customDomains:i,publishToWebflowSubdomain:r?.publishToWebflowSubdomain??!0})}catch(n){throw new f(n,{prefix:"Error publishing site:"})}}Ie();C();async function yg(e,t,r){let{siteId:n,accessToken:o}=e;if(!n)throw new Error("Site ID is required for mount path validation. Apps without a connected site skip this step.");let i=u.spinner("Validating mount path configuration");try{let s=await To(o,n),a=await au(o,n),l=[`${s.shortName}.webflow.io`,...a.customDomains?.map(y=>y.url)||[]],c=0;i.update(`Validating ${l.length} domain(s) for mount path: ${t}... (0/${l.length})`);let d=l.map(async y=>{try{let x=await lu(y),T=Array.isArray(x.cosmic)?x.cosmic.map(Z=>Z.mountPath).filter(Z=>typeof Z=="string"):[],P=uu(x,t,r);return{domain:y,mountPaths:T,isValid:P===!0}}catch(x){return{domain:y,mountPaths:[],isValid:!1,error:x instanceof Error?x.message:String(x)}}finally{c++,i.update(`Validating ${l.length} domain(s) for mount path: ${t}... (${c}/${l.length})`)}}),p=await Promise.all(d),m=p.some(y=>!y.isValid),g=p.every(y=>y.isValid);return i.succeed("Mount path validation completed"),{isValid:g,domains:p,needsPublishing:m}}catch(s){throw i.fail("Mount path validation failed"),s}}async function Dg(e,t,r){let{siteId:n,accessToken:o}=e;if(!n)return[];try{let i=await To(o,n),s=await au(o,n),l=[`${i.shortName}.webflow.io`,...s.customDomains?.map(d=>d.url)||[]].map(async d=>{try{let p=await lu(d),m=uu(p,t,r);return{domain:d,isValid:m}}catch(p){return u.debug(`Could not verify mount path for ${d}: ${p}`),{domain:d,isValid:!1}}});return(await Promise.all(l)).filter(d=>d.isValid).map(d=>d.domain)}catch(i){return u.debug(`Error getting valid domains: ${i}`),[]}}function bg(e,t){return e.map(r=>`${r.startsWith("localhost")||r.startsWith("127.0.0.1")?"http":"https"}://${r}${t}`)}async function vg(e){let t=e.map(n=>({name:n,value:n,checked:!0})),r=await ti({message:"Select which domains you want to publish to update the mount path configuration:",choices:t,validate:n=>n.length===0?"Please select at least one domain to publish to.":!0});return r??[]}async function Eg(){return await Ae({message:"The mount path doesn't match on some domains. Would you like to publish the site to update the configuration?",default:!0})}async function cu(e,t){let{siteId:r,accessToken:n}=e;if(!r)throw new Error("Site ID is required to publish. Apps without a connected site do not use this.");let o=u.spinner(`Publishing site to ${t.length} domain(s)`);try{let s=`${(await To(n,r)).shortName}.webflow.io`,a=t.includes(s),l=t.filter(c=>c!==s);await wg(n,r,{domains:l,publishToWebflowSubdomain:a}),o.succeed(`Site published successfully to selected domains: ${t.join(", ")}`)}catch{throw o.fail("Failed to publish site"),new Error("Failed to publish site")}}C();ie();var Vr=h(require("path"));De();se();Se();var gs=h(require("fs"));I();se();Ie();I();C();async function fs(e){let t=await fetch(`${_}/v2/workspaces`,{method:"GET",headers:{Authorization:`Bearer ${e}`}});if(!t.ok){let n=await t.text(),o={};try{o=JSON.parse(n)}catch{}throw t.status===403&&o.code==="missing_scopes"?new f(`Missing required scopes for workspace access.
146
146
  ${o.message??""}
147
147
  Re-run 'webflow auth login' to grant the necessary permissions.`):new f(`Failed to fetch workspaces: ${t.status} ${t.statusText}`+(o.message?`
148
148
  ${o.message}`:""))}return(await t.json()).workspaces}async function ps(e){if(e.length===1)return e[0];let t=await Oe({message:"Select the workspace for this app:",choices:e.map(r=>({name:r.name,value:r}))});return t||(u.warn(`Auto fallback to first workspace: ${e[0].name}`),e[0])}Ci();W();C();W();ie();async function du(e,t){u.warn(`${be} ${ne("webflow cloud create")} is deprecated and will be removed in the next major release.
149
149
  Use ${R("webflow cloud init")} instead.
150
- `);let{framework:r}=t;if(!(await An()).find(i=>i===r)){u.error(`Framework ${r} not found`);return}await ms(e,"/app",r,void 0,oe.Existing,void 0)}C();async function fu(){let e=await An();u.info("Available app templates:"),e.length>0?e.forEach(t=>u.info(`- ${t}`)):u.info("No templates found.")}re();I();Se();Ie();C();W();var Eg=h(require("path"));function ar(e){if(!e||e.trim()==="")return"/";let t=Eg.posix.normalize(e);return t.startsWith("/")||(t="/"+t),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t=t.split("/").map((n,o)=>o===0?n:encodeURIComponent(n)).join("/"),t}function Ao(e){return!(!e||e.trim()===""||!e.startsWith("/")||e.includes(".."))}ie();C();W();function Oo(e,t){u.warn(`${be} ${ne(e)} is deprecated; use ${R(t)} instead.`)}async function pu(e){if(e.appName!==void 0&&e.projectName!==void 0)throw new f("--app-name and --project-name are aliases of the same option. Pass exactly one (--app-name is preferred; --project-name is deprecated).");e.projectName!==void 0&&Oo("--project-name","--app-name");let t=e.appName??e.projectName;if(e.workspaceId&&e.siteId)throw new f("--workspace-id and --site-id are mutually exclusive. Pass exactly one.");if(e.new&&e.siteId)throw new f("--new and --site-id are mutually exclusive. Use --site-id to connect to an existing site, or --new to create a standalone app.");let r=process.stdin.isTTY,n;r&&st()&&(n=await $());let o=!1;if(n&&!e.new&&!e.siteId)try{(await no(n)).length===0&&(u.info(`${Ee} No existing Webflow sites in your workspace \u2014 starting a new app.`),o=!0)}catch(g){u.debug(`Skipped sites lookup in cloud init preflight: ${g}`)}let i=await An(),s={};if(r&&st()){if(!e.new&&!o&&(s.initMode=await Oe({message:"Where do you want to deploy this app?",choices:[{name:"New domain",value:oe.New},{name:"Existing site",value:oe.Existing}],default:oe.New})),e?.framework||(s.scaffoldName=await Oe({message:"Which framework would you like to use?",choices:i.map(y=>({name:y,value:y})),default:"astro"})),!t){let y=await Ce({message:"What would you like to name your app?",validate:x=>{let T=x.trim();return T===""?"App name cannot be empty":T.length<Tt||T.length>At?`App name must be between ${Tt} and ${At} characters`:!0}});if(y==null)throw new f("When --no-input mode is enabled please provide the --app-name option or the cloud.app_id manifest field.");s.appName=y}let g=e.new||o||s.initMode===oe.New;if(!e.mount&&!g){let y=await Ce({message:"What path do you want to use locally? (e.g., /app)",default:"/app"});s.mountPath=ar(y)}}let a=t||s.appName,l=e.framework||s.scaffoldName,c=e.new||o?oe.New:s.initMode??(e.siteId?oe.Existing:ee()?oe.New:oe.Existing),d=c===oe.New?e.mount||s.mountPath||"/":e.mount||s.mountPath||"/app",p=e.siteId,m=ar(d);if(!a||typeof a!="string"||a.trim()==="")throw new f("--app-name cannot be empty");if(a.length<Tt||a.length>At)throw new f(`--app-name must be between ${Tt} and ${At} characters`);if(!l)throw new f("--framework is required");if(!i.includes(l)){let g=i.join(`
150
+ `);let{framework:r}=t;if(!(await An()).find(i=>i===r)){u.error(`Framework ${r} not found`);return}await ms(e,"/app",r,void 0,oe.Existing,void 0)}C();async function fu(){let e=await An();u.info("Available app templates:"),e.length>0?e.forEach(t=>u.info(`- ${t}`)):u.info("No templates found.")}re();I();Se();Ie();C();W();var xg=h(require("path"));function ar(e){if(!e||e.trim()==="")return"/";let t=xg.posix.normalize(e);return t.startsWith("/")||(t="/"+t),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t=t.split("/").map((n,o)=>o===0?n:encodeURIComponent(n)).join("/"),t}function Ao(e){return!(!e||e.trim()===""||!e.startsWith("/")||e.includes(".."))}ie();C();W();function Oo(e,t){u.warn(`${be} ${ne(e)} is deprecated; use ${R(t)} instead.`)}async function pu(e){if(e.appName!==void 0&&e.projectName!==void 0)throw new f("--app-name and --project-name are aliases of the same option. Pass exactly one (--app-name is preferred; --project-name is deprecated).");e.projectName!==void 0&&Oo("--project-name","--app-name");let t=e.appName??e.projectName;if(e.workspaceId&&e.siteId)throw new f("--workspace-id and --site-id are mutually exclusive. Pass exactly one.");if(e.new&&e.siteId)throw new f("--new and --site-id are mutually exclusive. Use --site-id to connect to an existing site, or --new to create a standalone app.");let r=process.stdin.isTTY,n;r&&st()&&(n=await $());let o=!1;if(n&&!e.new&&!e.siteId)try{(await no(n)).length===0&&(u.info(`${Ee} No existing Webflow sites in your workspace \u2014 starting a new app.`),o=!0)}catch(g){u.debug(`Skipped sites lookup in cloud init preflight: ${g}`)}let i=await An(),s={};if(r&&st()){if(!e.new&&!o&&(s.initMode=await Oe({message:"Where do you want to deploy this app?",choices:[{name:"New domain",value:oe.New},{name:"Existing site",value:oe.Existing}],default:oe.New})),e?.framework||(s.scaffoldName=await Oe({message:"Which framework would you like to use?",choices:i.map(y=>({name:y,value:y})),default:"astro"})),!t){let y=await Ce({message:"What would you like to name your app?",validate:x=>{let T=x.trim();return T===""?"App name cannot be empty":T.length<Tt||T.length>At?`App name must be between ${Tt} and ${At} characters`:!0}});if(y==null)throw new f("When --no-input mode is enabled please provide the --app-name option or the cloud.app_id manifest field.");s.appName=y}let g=e.new||o||s.initMode===oe.New;if(!e.mount&&!g){let y=await Ce({message:"What path do you want to use locally? (e.g., /app)",default:"/app"});s.mountPath=ar(y)}}let a=t||s.appName,l=e.framework||s.scaffoldName,c=e.new||o?oe.New:s.initMode??(e.siteId?oe.Existing:ee()?oe.New:oe.Existing),d=c===oe.New?e.mount||s.mountPath||"/":e.mount||s.mountPath||"/app",p=e.siteId,m=ar(d);if(!a||typeof a!="string"||a.trim()==="")throw new f("--app-name cannot be empty");if(a.length<Tt||a.length>At)throw new f(`--app-name must be between ${Tt} and ${At} characters`);if(!l)throw new f("--framework is required");if(!i.includes(l)){let g=i.join(`
151
151
  - `);throw new f(`--framework "${l}" not found
152
152
 
153
153
  Available frameworks:
154
- - ${g}`)}if(typeof m!="string"||!Ao(m))throw new f("Invalid mount path: "+m);if(c===oe.Existing&&!p&&(!r||ee()))throw new f("--site-id is required when connecting to an existing site in non-interactive mode.");await ms(a,m,l,p,c,e.workspaceId)}var Tg=h(require("path"));re();I();Se();Ie();C();W();De();te();var xg=require("crypto");se();I();async function Fg(e){let{accessToken:t,workspaceId:r,displayName:n,description:o,appPath:i}=e,a={requestId:(0,xg.randomUUID)(),cloudApp:{displayName:n,description:o,appPath:i,source:{type:"CLI",cli:{sourceUrl:fm}}}},l=`${_}/cosmic/workspaces/${r}/cloudApps`,c=await fetch(l,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","Accept-Version":"1.0.0"},body:JSON.stringify(a)});if(!c.ok){let d=await c.text();throw Ev(c.status,c.statusText,d)}return c.json()}function Ev(e,t,r){let n={};try{n=JSON.parse(r)}catch{}return e===403?n.publicErrorCode==="missing_scopes"?new f(`Missing required scopes to create a Cloud app.
154
+ - ${g}`)}if(typeof m!="string"||!Ao(m))throw new f("Invalid mount path: "+m);if(c===oe.Existing&&!p&&(!r||ee()))throw new f("--site-id is required when connecting to an existing site in non-interactive mode.");await ms(a,m,l,p,c,e.workspaceId)}var Ag=h(require("path"));re();I();Se();Ie();C();W();De();te();var Fg=require("crypto");se();I();async function Cg(e){let{accessToken:t,workspaceId:r,displayName:n,description:o,appPath:i}=e,a={requestId:(0,Fg.randomUUID)(),cloudApp:{displayName:n,description:o,appPath:i,source:{type:"CLI",cli:{sourceUrl:fm}}}},l=`${_}/cosmic/workspaces/${r}/cloudApps`,c=await fetch(l,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","Accept-Version":"1.0.0"},body:JSON.stringify(a)});if(!c.ok){let d=await c.text();throw Fv(c.status,c.statusText,d)}return c.json()}function Fv(e,t,r){let n={};try{n=JSON.parse(r)}catch{}return e===403?n.publicErrorCode==="missing_scopes"?new f(`Missing required scopes to create a Cloud app.
155
155
  ${n.msg??""}
156
- Re-run 'webflow auth login' to grant the necessary permissions.`):new f(n.msg??"You don't have permission to create apps in this workspace."):e===404?new f("Cloud app creation is not available. The workspace may not exist or the feature is not enabled for your account."):e===409?n.publicErrorCode==="workspace_unhosted_project_limit"?new f(xv(n.planName,n.limit)):n.msg?.includes("No new sites can be created")?new f(`Failed to create app: your workspace has reached its app limit.
156
+ Re-run 'webflow auth login' to grant the necessary permissions.`):new f(n.msg??"You don't have permission to create apps in this workspace."):e===404?new f("Cloud app creation is not available. The workspace may not exist or the feature is not enabled for your account."):e===409?n.publicErrorCode==="workspace_unhosted_project_limit"?new f(Cv(n.planName,n.limit)):n.msg?.includes("No new sites can be created")?new f(`Failed to create app: your workspace has reached its app limit.
157
157
  Upgrade your plan or remove unused apps to create a new one.`):new f(n.msg??"A Cloud app creation request is already being processed. Please wait and try again."):new f(`Failed to create app: ${e} ${t}`+(n.msg?`
158
- ${n.msg}`:""))}function xv(e,t){let r="Upgrade your plan or remove unused apps to create a new one.",n=t===1?"Cloud app":"Cloud apps";return e&&typeof t=="number"&&t>0?`Your "${e}" workspace is limited to ${t} ${n}.
158
+ ${n.msg}`:""))}function Cv(e,t){let r="Upgrade your plan or remove unused apps to create a new one.",n=t===1?"Cloud app":"Cloud apps";return e&&typeof t=="number"&&t>0?`Your "${e}" workspace is limited to ${t} ${n}.
159
159
  ${r}`:typeof t=="number"&&t>0?`Your workspace is limited to ${t} ${n}.
160
160
  ${r}`:e?`Your "${e}" workspace has reached its Cloud app limit.
161
161
  ${r}`:`Failed to create app: your workspace has reached its app limit.
162
- `+r}De();I();Se();Ie();C();re();async function kg(e={}){Fv(e);let t=await Cv(e,J().manifest);return{credentials:t.credentials,workspaceId:t.workspaceId,manifest:J().manifest}}function Fv(e){if(e.siteId&&e.workspaceId)throw new f("--site-id and --workspace-id are mutually exclusive. Pass exactly one.")}async function Cv(e,t){if(e.siteId)return Cg(t,e.siteId);if(e.workspaceId)return _g(e.workspaceId);if(t.siteId)return Cg(t,t.siteId);if(t.cloud?.workspace_id)return _g(t.cloud.workspace_id);if(process.env.WEBFLOW_SITE_ID)return u.info("Using site from WEBFLOW_SITE_ID env var. Pass --site-id explicitly or unset to see the deploy mode picker."),Sg(t);if(ee()||!st())throw new f(`No identity configured for this app.
162
+ `+r}De();I();Se();Ie();C();re();async function Sg(e={}){_v(e);let t=await kv(e,J().manifest);return{credentials:t.credentials,workspaceId:t.workspaceId,manifest:J().manifest}}function _v(e){if(e.siteId&&e.workspaceId)throw new f("--site-id and --workspace-id are mutually exclusive. Pass exactly one.")}async function kv(e,t){if(e.siteId)return _g(t,e.siteId);if(e.workspaceId)return kg(e.workspaceId);if(t.siteId)return _g(t,t.siteId);if(t.cloud?.workspace_id)return kg(t.cloud.workspace_id);if(process.env.WEBFLOW_SITE_ID)return u.info("Using site from WEBFLOW_SITE_ID env var. Pass --site-id explicitly or unset to see the deploy mode picker."),Tg(t);if(ee()||!st())throw new f(`No identity configured for this app.
163
163
  Pass one of:
164
164
  --site-id <id> (deploy to an existing Webflow site)
165
165
  --workspace-id <id> (create a new Cloud app)
166
- Or run 'webflow cloud init' to scaffold a new app.`);return kv(t)}async function Cg(e,t){return{credentials:await he(e,{site:t})}}async function Sg(e){return{credentials:await he(e,{})}}async function _g(e){let t=await $();return{workspaceId:e,credentials:{accessToken:t,siteId:""}}}async function _v(){let e=await $(),t=await fs(e);if(t.length===0)throw new Ht("No workspaces found in your account. Please make sure you have at least one workspace.");let r=await ps(t);return ue({cloud:{workspace_id:r.id}}),{workspaceId:r.id,credentials:{accessToken:e,siteId:""}}}async function kv(e){let t=await Oe({message:"This app isn't initialized for Webflow Cloud. How would you like to deploy?",choices:[{name:"Create a new app",value:"standalone"},{name:"Attach to an existing Webflow site",value:"site-attached"},{name:"Cancel",value:"cancel"}]});if(t==="cancel"||!t)throw new f("Deploy cancelled.",{skipLogging:!0});return t==="standalone"?_v():Sg(e)}async function mu(e){try{if(e.appName!==void 0&&e.projectName!==void 0)throw new f("--app-name and --project-name are aliases of the same option. Pass exactly one (--app-name is preferred; --project-name is deprecated).");if(e.appId!==void 0&&e.projectId!==void 0)throw new f("--app-id and --project-id are aliases of the same option. Pass exactly one (--app-id is preferred; --project-id is deprecated).");e.projectName!==void 0&&Oo("--project-name","--app-name"),e.projectId!==void 0&&Oo("--project-id","--app-id");let t=e.appName??e.projectName,r=e.appId??e.projectId;if(e.directory)try{process.chdir(e.directory),u.info(`Changed directory to: ${e.directory}`)}catch(x){throw u.error(`Error: Could not change to directory ${e.directory}`),new f(x)}if(e.framework){if(!ko.includes(e.framework))throw new f(`Framework "${e.framework}" is not supported. Allowed: ${ko.join(", ")}.`);ue({cloud:{framework:e.framework}})}let n=await kg({siteId:e.siteId,workspaceId:e.workspaceId}),{workspaceId:o}=n,{credentials:i,manifest:s}=n,a=!!o;if(o){let x=Tg.default.basename(process.cwd()).trim(),T=x.length>=Tt&&x.length<=At,P=t??(T?x:"Cloud App");if(P.length<Tt||P.length>At)throw new f(`App name must be between ${Tt} and ${At} characters (got ${P.length}).
167
- Use --app-name to provide a valid name.`);let Z=u.spinner("Creating Cloud app...");try{let G=await Fg({accessToken:i.accessToken,workspaceId:o,displayName:P});Z.succeed(`Cloud app created: ${G.cloudApp.displayName}`),ue({siteId:G.cloudApp.siteId,cloud:{...s.cloud,app_id:G.cloudApp.project.id,environment_id:G.cloudApp.environment.id}}),Ft({siteId:G.cloudApp.siteId,directory:"."}),process.env.WEBFLOW_SITE_ID=G.cloudApp.siteId,{manifest:s}=J()}catch(G){throw Z.fail("Failed to create app"),new f(G,{prefix:"Could not create app:"})}let b=s.siteId;if(!b)throw new f("Expected siteId in manifest after Cloud app creation.");i={accessToken:i.accessToken,siteId:b}}let l;try{l=A.forCloud({authToken:i.accessToken,siteId:i.siteId})}catch(x){u.debug(`Failed to initialize telemetry: ${x}`)}let c=s.cloud||{},d=r??c.app_id??c.project_id,p,m,g=t,y=e.description;if(e.environment&&e.mount){if(p=e.environment,m=ar(e.mount),!Ao(m))throw new f("Invalid mount path: "+m)}else{let x=[];if(!d){if(!g&&ee())throw new f("When --no-input mode is enabled please provide the --app-name option or the cloud.app_id manifest field.");try{let P=await fg(i);if(P.projects.length>0){let Z=await Oe({message:"Select an app to deploy to:",choices:[...P.projects.map(b=>({name:`${b.name} (${b.description||"No description"})`,value:b.id})),{name:"Create new app",value:null}]});Z?(d=Z,ue({cloud:{app_id:Z}}),u.info(`${O} App ID updated in webflow.json`)):u.info("Creating a new app will be handled during deployment.")}else u.info(`
168
- No existing apps found. A new app will be created during deployment.`)}catch(P){u.warn("Could not fetch existing apps. A new app will be created during deployment."),u.warn(P instanceof Error?P.message:String(P))}}if(!d&&!g&&(g=await Ce({message:"What would you like to name your new app?",default:"New Webflow Cloud App",validate:P=>P.trim()===""?"App name cannot be empty":!0})),d)try{let Z=(await dg(i,d)).environments.map(b=>({name:`${b.branch} (${b.mount})`,value:{branch:b.branch,mount:b.mount}}));x.push(...Z)}catch(P){throw new f(P,{prefix:"Error fetching app environments:"})}x.push({name:"Create new environment",value:null});let T=await Oe({message:"Select an environment to deploy to:",choices:x});if(T)p=T.branch,m=ar(T.mount);else if(e.environment?p=e.environment:p=await Ce({message:"What environment would you like to deploy to?",default:"main",validate:P=>P.trim()===""?"Environment cannot be empty":!0}),e.mount)m=ar(e.mount);else{let P=await Ce({message:"What path should this environment be mounted at? (e.g., /app)",default:"/app"});m=ar(P)}}if(!Ao(m))throw new f("Invalid mount path: "+m);await Ag(i,p,m,{projectName:g,description:y,directory:e.directory,skipMountPathCheck:a||e.skipMountPathCheck,autoPublish:e.autoPublish,telemetry:l})}catch(t){throw new f(t,{prefix:"Error during deployment setup:"})}}var Io=null;process.once("exit",()=>Io?.());var Og=(e,t,r)=>t instanceof hr?"no-sites":t instanceof Ht?"no-workspaces":e==="auth"?"auth":e==="workspaces"&&r===oe.New?"no-workspaces":"unknown",An=async()=>{try{let e=Wl(),t=Ul();return[...new Set([...e,...t])]}catch(e){return u.error(e,{prefix:"Failed to get available scaffolds:"}),[]}},Sv=async(e,t,r)=>{let n;if("content"in r)n=r.content.files;else{let l=r[t];if(!l)throw new Error(`Scaffold "${t}" not found`);n=l}let o=n.find(l=>l.includes(br));if(!o)throw new Error(`No ${br} found in scaffold "${t}"`);await gs.promises.mkdir(e,{recursive:!0});let s=(await gs.promises.readFile(o,"utf8")).replace(Zi,e),a=Vr.join(e,br);await gs.promises.writeFile(a,s,"utf8")},ms=async(e,t,r=Ki,n,o=oe.Existing,i)=>{if(o===oe.New){try{let s=await Jl(r);await Tv(e,t,s.scaffoldId,{content:s},r,i)}catch(s){if(s instanceof ve){let a=s.message;throw s.supportedIds?.length&&(a+=`
169
- Available frameworks: ${s.supportedIds.join(", ")}`),new f(a)}throw s}return}try{let s=await Xi(r);await Av(e,t,r,{content:s},n)}catch(s){if(s instanceof ve){let a=s.message;throw s.supportedIds?.length&&(a+=`
170
- Available frameworks: ${s.supportedIds.join(", ")}`),new f(a)}throw s}},Tv=async(e,t,r,n,o,i)=>{let s=`./${e}`,a="content"in n&&typeof n.content=="object"&&"extractionRoot"in n.content?n.content:null,l=a?Vr.dirname(a.extractionRoot):null,c="auth",d=!1,p=!1,m=null;try{let g=Date.now(),y=await $();c="workspaces";let x;if(i)x={id:i};else{let Z=await fs(y);if(Z.length===0)throw new Ht("No workspaces found in your account. Please make sure you have at least one workspace.");x=await ps(Z)}c="scaffold",await wo(e,t,r,n,void 0,void 0),p=!0,process.chdir(s);let T=o??r;ue({cloud:{framework:T,workspace_id:x.id}}),Ft({apiToken:y,directory:"."}),process.env.WEBFLOW_API_TOKEN=y;let P=Date.now()-g;try{await A.forCloud({authToken:y}).sendUsage("project_init",{scaffold:T,scaffoldName:T,initMode:oe.New,workspaceId:x.id,totalDuration:P,mountPath:t})}catch{}d=!0}catch(g){if(m=g,g instanceof f||g instanceof Error&&g.message.includes("OAuth")){try{await wo(e,t,r,n),process.chdir(s),ue({cloud:{framework:o??r}}),Ft({directory:"."}),p=!0}catch{}throw u.error(g),new f(g,{skipLogging:!0})}throw g}finally{if(l)try{gu.default.removeSync(l)}catch{}if(d){let g=$g(e,oe.New);Io=()=>u.info(g)}else{let g=Og(c,m,oe.New),y=Rg(e,oe.New,g,p);Io=()=>u.info(y)}}},Av=async(e,t,r,n,o)=>{let i=`./${e}`,s=null,a=!1,l="content"in n&&typeof n.content=="object"&&"extractionRoot"in n.content?n.content:null,c=l?Vr.dirname(l.extractionRoot):null,d="auth",p=!1,m=!1,g=null;try{let y=Date.now();await Sv(e,r,n),process.chdir(i);let{manifest:x}=J(),T=await he(x,{site:o}),P=T.accessToken,Z=T.siteId;if(s=A.forCloud({authToken:P,siteId:Z}),d="scaffold",await wo(".",t,r,n,Z,P),m=!0,d="devlink",Z){u.info(`${Ee} Running devlink export to fetch your Webflow components`);try{await Ov({site:Z,apiToken:P}),a=!0}catch(G){yr(G)?u.info(`${Ee} Skipped component export \u2014 requires a paid Site or Workspace plan. Upgrade at https://webflow.com/pricing.`):u.error(G,{prefix:"Failed to run devlink export:"})}}let b=Date.now()-y;await s?.sendUsage("project_init",{scaffold:r,scaffoldName:r,devlinkSyncStatus:a,totalDuration:b,mountPath:t}),p=!0}catch(y){g=y,u.error(y);try{await wo(".",t,r,n),m=!0}catch{}throw new f(y,{skipLogging:!0})}finally{if(c)try{gu.default.removeSync(c)}catch{}if(p){let y=$g(e,oe.Existing);Io=()=>u.info(y)}else{let y=Og(d,g,oe.Existing),x=Rg(e,oe.Existing,y,m);Io=()=>u.info(x)}}},Ov=async e=>{let{exportComponents:t}=await Promise.resolve().then(()=>(Ci(),Uf));await t({site:e.site,apiToken:e.apiToken,silentNotEntitled:!0})},Iv=e=>{if(e?.skipMountPathCheck!==void 0)return e.skipMountPathCheck;try{let{manifest:t}=J();return Ml(t)?!0:t.cloud?.skipMountPathCheck===!0}catch{return!1}},$v=async(e,t,r,n)=>{u.info(ce("Validating mount path configuration..."));let o=await wg(e,t,r);if(o.isValid)u.info(R("Mount path validation passed"));else if(u.info(S(`
171
- Mount path validation results:`)),o.domains.forEach(i=>{let s=i.isValid?O:be,a=i.isValid?R(`${i.domain} (mountPath: ${i.mountPaths[0]})`):ne(`${i.domain} (no matching mountPath)`);u.info(`${s} ${a}`),i.error&&u.debug(` Error: ${i.error}`)}),o.needsPublishing)if(n){u.info("\u{1F680} Auto-publishing site to update mount path configuration...");let i=o.domains.filter(s=>!s.isValid).map(s=>s.domain);await cu(e,i)}else if(await vg()&&st()){let s=o.domains.filter(l=>!l.isValid).map(l=>l.domain),a=await bg(s);await cu(e,a)}else u.warn("\u26A0\uFE0F Continuing with deployment without publishing...")},Rv=async(e,t,r,n)=>{ru("\u{1F3D7}\uFE0F ","Building app");let o=await ng(e,{mountPath:r,telemetry:n?.telemetry,deployUrl:t.deploy_url,environmentId:t.environment_id});ru("\u{1F4E4}","Uploading build artifacts");let i=Date.now();await pg(o,t.upload_url);let s=Date.now()-i;return u.info(`${O} Upload completed in ${(s/1e3).toFixed(1)}s`),o},Pv=async(e,t,r,n)=>{u.success(`
172
- \u{1F310} Your cloud app will soon be available at:`);try{let o=n?.domainsOverride??await yg(e,t,r),i=Dg(o??[],t);i?.length>0?i.forEach(s=>{u.info(` ${s}`)}):u.warn(" No domains found with the correct mount path configuration yet.")}catch(o){u.warn(` Could not determine deployment links: ${o instanceof Error?o.message:o}`)}},jv=e=>{e.site_slug?u.success(`Visit your deployment:
166
+ Or run 'webflow cloud init' to scaffold a new app.`);return Tv(t)}async function _g(e,t){return{credentials:await he(e,{site:t})}}async function Tg(e){return{credentials:await he(e,{})}}async function kg(e){let t=await $();return{workspaceId:e,credentials:{accessToken:t,siteId:""}}}async function Sv(){let e=await $(),t=await fs(e);if(t.length===0)throw new Ht("No workspaces found in your account. Please make sure you have at least one workspace.");let r=await ps(t);return ue({cloud:{workspace_id:r.id}}),{workspaceId:r.id,credentials:{accessToken:e,siteId:""}}}async function Tv(e){let t=await Oe({message:"This app isn't initialized for Webflow Cloud. How would you like to deploy?",choices:[{name:"Create a new app",value:"standalone"},{name:"Attach to an existing Webflow site",value:"site-attached"},{name:"Cancel",value:"cancel"}]});if(t==="cancel"||!t)throw new f("Deploy cancelled.",{skipLogging:!0});return t==="standalone"?Sv():Tg(e)}async function mu(e){try{if(e.appName!==void 0&&e.projectName!==void 0)throw new f("--app-name and --project-name are aliases of the same option. Pass exactly one (--app-name is preferred; --project-name is deprecated).");if(e.appId!==void 0&&e.projectId!==void 0)throw new f("--app-id and --project-id are aliases of the same option. Pass exactly one (--app-id is preferred; --project-id is deprecated).");e.projectName!==void 0&&Oo("--project-name","--app-name"),e.projectId!==void 0&&Oo("--project-id","--app-id");let t=e.appName??e.projectName,r=e.appId??e.projectId;if(e.directory)try{process.chdir(e.directory),u.info(`Changed directory to: ${e.directory}`)}catch(x){throw u.error(`Error: Could not change to directory ${e.directory}`),new f(x)}if(e.framework){if(!ko.includes(e.framework))throw new f(`Framework "${e.framework}" is not supported. Allowed: ${ko.join(", ")}.`);ue({cloud:{framework:e.framework}})}let n=await Sg({siteId:e.siteId,workspaceId:e.workspaceId}),{workspaceId:o}=n,{credentials:i,manifest:s}=n,a=!!o;if(o){let x=Ag.default.basename(process.cwd()).trim(),T=x.length>=Tt&&x.length<=At,P=t??(T?x:"Cloud App");if(P.length<Tt||P.length>At)throw new f(`App name must be between ${Tt} and ${At} characters (got ${P.length}).
167
+ Use --app-name to provide a valid name.`);let Z=u.spinner("Creating Cloud app...");try{let G=await Cg({accessToken:i.accessToken,workspaceId:o,displayName:P});Z.succeed(`Cloud app created: ${G.cloudApp.displayName}`),ue({siteId:G.cloudApp.siteId,cloud:{...s.cloud,app_id:G.cloudApp.project.id,environment_id:G.cloudApp.environment.id}}),Ft({siteId:G.cloudApp.siteId,directory:"."}),process.env.WEBFLOW_SITE_ID=G.cloudApp.siteId,{manifest:s}=J()}catch(G){throw Z.fail("Failed to create app"),new f(G,{prefix:"Could not create app:"})}let b=s.siteId;if(!b)throw new f("Expected siteId in manifest after Cloud app creation.");i={accessToken:i.accessToken,siteId:b}}let l;try{l=A.forCloud({authToken:i.accessToken,siteId:i.siteId})}catch(x){u.debug(`Failed to initialize telemetry: ${x}`)}let c=s.cloud||{},d=r??c.app_id??c.project_id,p,m,g=t,y=e.description;if(e.environment&&e.mount){if(p=e.environment,m=ar(e.mount),!Ao(m))throw new f("Invalid mount path: "+m)}else{let x=[];if(!d){if(!g&&ee())throw new f("When --no-input mode is enabled please provide the --app-name option or the cloud.app_id manifest field.");try{let P=await pg(i);if(P.projects.length>0){let Z=await Oe({message:"Select an app to deploy to:",choices:[...P.projects.map(b=>({name:`${b.name} (${b.description||"No description"})`,value:b.id})),{name:"Create new app",value:null}]});Z?(d=Z,ue({cloud:{app_id:Z}}),u.info(`${O} App ID updated in webflow.json`)):u.info("Creating a new app will be handled during deployment.")}else u.info(`
168
+ No existing apps found. A new app will be created during deployment.`)}catch(P){u.warn("Could not fetch existing apps. A new app will be created during deployment."),u.warn(P instanceof Error?P.message:String(P))}}if(!d&&!g&&(g=await Ce({message:"What would you like to name your new app?",default:"New Webflow Cloud App",validate:P=>P.trim()===""?"App name cannot be empty":!0})),d)try{let Z=(await fg(i,d)).environments.map(b=>({name:`${b.branch} (${b.mount})`,value:{branch:b.branch,mount:b.mount}}));x.push(...Z)}catch(P){throw new f(P,{prefix:"Error fetching app environments:"})}x.push({name:"Create new environment",value:null});let T=await Oe({message:"Select an environment to deploy to:",choices:x});if(T)p=T.branch,m=ar(T.mount);else if(e.environment?p=e.environment:p=await Ce({message:"What environment would you like to deploy to?",default:"main",validate:P=>P.trim()===""?"Environment cannot be empty":!0}),e.mount)m=ar(e.mount);else{let P=await Ce({message:"What path should this environment be mounted at? (e.g., /app)",default:"/app"});m=ar(P)}}if(!Ao(m))throw new f("Invalid mount path: "+m);await Og(i,p,m,{projectName:g,description:y,directory:e.directory,skipMountPathCheck:a||e.skipMountPathCheck,autoPublish:e.autoPublish,telemetry:l})}catch(t){throw new f(t,{prefix:"Error during deployment setup:"})}}var Io=null;process.once("exit",()=>Io?.());var Ig=(e,t,r)=>t instanceof hr?"no-sites":t instanceof Ht?"no-workspaces":e==="auth"?"auth":e==="workspaces"&&r===oe.New?"no-workspaces":"unknown",An=async()=>{try{let e=Wl(),t=Ul();return[...new Set([...e,...t])]}catch(e){return u.error(e,{prefix:"Failed to get available scaffolds:"}),[]}},Av=async(e,t,r)=>{let n;if("content"in r)n=r.content.files;else{let l=r[t];if(!l)throw new Error(`Scaffold "${t}" not found`);n=l}let o=n.find(l=>l.includes(br));if(!o)throw new Error(`No ${br} found in scaffold "${t}"`);await gs.promises.mkdir(e,{recursive:!0});let s=(await gs.promises.readFile(o,"utf8")).replace(Zi,e),a=Vr.join(e,br);await gs.promises.writeFile(a,s,"utf8")},ms=async(e,t,r=Ki,n,o=oe.Existing,i)=>{if(o===oe.New){try{let s=await Jl(r);await Ov(e,t,s.scaffoldId,{content:s},r,i)}catch(s){if(s instanceof ve){let a=s.message;throw s.supportedIds?.length&&(a+=`
169
+ Available frameworks: ${s.supportedIds.join(", ")}`),new f(a)}throw s}return}try{let s=await Xi(r);await Iv(e,t,r,{content:s},n)}catch(s){if(s instanceof ve){let a=s.message;throw s.supportedIds?.length&&(a+=`
170
+ Available frameworks: ${s.supportedIds.join(", ")}`),new f(a)}throw s}},Ov=async(e,t,r,n,o,i)=>{let s=`./${e}`,a="content"in n&&typeof n.content=="object"&&"extractionRoot"in n.content?n.content:null,l=a?Vr.dirname(a.extractionRoot):null,c="auth",d=!1,p=!1,m=null;try{let g=Date.now(),y=await $();c="workspaces";let x;if(i)x={id:i};else{let Z=await fs(y);if(Z.length===0)throw new Ht("No workspaces found in your account. Please make sure you have at least one workspace.");x=await ps(Z)}c="scaffold",await wo(e,t,r,n,void 0,void 0),p=!0,process.chdir(s);let T=o??r;ue({cloud:{framework:T,workspace_id:x.id}}),Ft({apiToken:y,directory:"."}),process.env.WEBFLOW_API_TOKEN=y;let P=Date.now()-g;try{await A.forCloud({authToken:y}).sendUsage("project_init",{scaffold:T,scaffoldName:T,initMode:oe.New,workspaceId:x.id,totalDuration:P,mountPath:t})}catch{}d=!0}catch(g){if(m=g,g instanceof f||g instanceof Error&&g.message.includes("OAuth")){try{await wo(e,t,r,n),process.chdir(s),ue({cloud:{framework:o??r}}),Ft({directory:"."}),p=!0}catch{}throw u.error(g),new f(g,{skipLogging:!0})}throw g}finally{if(l)try{gu.default.removeSync(l)}catch{}if(d){let g=Rg(e,oe.New);Io=()=>u.info(g)}else{let g=Ig(c,m,oe.New),y=Pg(e,oe.New,g,p);Io=()=>u.info(y)}}},Iv=async(e,t,r,n,o)=>{let i=`./${e}`,s=null,a=!1,l="content"in n&&typeof n.content=="object"&&"extractionRoot"in n.content?n.content:null,c=l?Vr.dirname(l.extractionRoot):null,d="auth",p=!1,m=!1,g=null;try{let y=Date.now();await Av(e,r,n),process.chdir(i);let{manifest:x}=J(),T=await he(x,{site:o}),P=T.accessToken,Z=T.siteId;if(s=A.forCloud({authToken:P,siteId:Z}),d="scaffold",await wo(".",t,r,n,Z,P),m=!0,d="devlink",Z){u.info(`${Ee} Running devlink export to fetch your Webflow components`);try{await $v({site:Z,apiToken:P}),a=!0}catch(G){yr(G)?u.info(`${Ee} Skipped component export \u2014 requires a paid Site or Workspace plan. Upgrade at https://webflow.com/pricing.`):u.error(G,{prefix:"Failed to run devlink export:"})}}let b=Date.now()-y;await s?.sendUsage("project_init",{scaffold:r,scaffoldName:r,devlinkSyncStatus:a,totalDuration:b,mountPath:t}),p=!0}catch(y){g=y,u.error(y);try{await wo(".",t,r,n),m=!0}catch{}throw new f(y,{skipLogging:!0})}finally{if(c)try{gu.default.removeSync(c)}catch{}if(p){let y=Rg(e,oe.Existing);Io=()=>u.info(y)}else{let y=Ig(d,g,oe.Existing),x=Pg(e,oe.Existing,y,m);Io=()=>u.info(x)}}},$v=async e=>{let{exportComponents:t}=await Promise.resolve().then(()=>(Ci(),Uf));await t({site:e.site,apiToken:e.apiToken,silentNotEntitled:!0})},Rv=e=>{if(e?.skipMountPathCheck!==void 0)return e.skipMountPathCheck;try{let{manifest:t}=J();return Ml(t)?!0:t.cloud?.skipMountPathCheck===!0}catch{return!1}},Pv=async(e,t,r,n)=>{u.info(ce("Validating mount path configuration..."));let o=await yg(e,t,r);if(o.isValid)u.info(R("Mount path validation passed"));else if(u.info(S(`
171
+ Mount path validation results:`)),o.domains.forEach(i=>{let s=i.isValid?O:be,a=i.isValid?R(`${i.domain} (mountPath: ${i.mountPaths[0]})`):ne(`${i.domain} (no matching mountPath)`);u.info(`${s} ${a}`),i.error&&u.debug(` Error: ${i.error}`)}),o.needsPublishing)if(n){u.info("\u{1F680} Auto-publishing site to update mount path configuration...");let i=o.domains.filter(s=>!s.isValid).map(s=>s.domain);await cu(e,i)}else if(await Eg()&&st()){let s=o.domains.filter(l=>!l.isValid).map(l=>l.domain),a=await vg(s);await cu(e,a)}else u.warn("\u26A0\uFE0F Continuing with deployment without publishing...")},jv=async(e,t,r,n)=>{ru("\u{1F3D7}\uFE0F ","Building app");let o=await ng(e,{mountPath:r,telemetry:n?.telemetry,deployUrl:t.deploy_url,environmentId:t.environment_id});ru("\u{1F4E4}","Uploading build artifacts");let i=Date.now();await mg(o,t.upload_url);let s=Date.now()-i;return u.info(`${O} Upload completed in ${(s/1e3).toFixed(1)}s`),o},Nv=async(e,t,r,n)=>{u.success(`
172
+ \u{1F310} Your cloud app will soon be available at:`);try{let o=n?.domainsOverride??await Dg(e,t,r),i=bg(o??[],t);i?.length>0?i.forEach(s=>{u.info(` ${s}`)}):u.warn(" No domains found with the correct mount path configuration yet.")}catch(o){u.warn(` Could not determine deployment links: ${o instanceof Error?o.message:o}`)}},Bv=e=>{e.site_slug?u.success(`Visit your deployment:
173
173
 
174
174
  ${Zr}/dashboard/sites/${e.site_slug}/webflow-cloud/projects/${e.project_id}/environments/${e.environment_id}/deployments/${e.deployment_id}`):u.info(`
175
- Visit the webflow Cloud dashboard to view your deployment: https://webflow.com/dashboard/sites`)},Nv=async(e,t,r,n,o)=>{try{if(await mg(t.completion_url,!!n),n)u.error(`
175
+ Visit the webflow Cloud dashboard to view your deployment: https://webflow.com/dashboard/sites`)},Mv=async(e,t,r,n,o)=>{try{if(await gg(t.completion_url,!!n),n)u.error(`
176
176
  ${F} Deployment failed due to build error.`);else{u.success(`
177
- ${O} Deployment triggered successfully!`);let i;try{let{manifest:s}=J();Ml(s)&&(i=[`${o?.projectName??Vr.basename(process.cwd())}.webflow.io`])}catch(s){u.debug(`Could not read manifest for standalone deploy link hint: ${s instanceof Error?s.message:String(s)}`)}await Pv(e,r,t.environment_id,i!==void 0?{domainsOverride:i}:void 0),jv(t)}}catch(i){throw new f(i,{prefix:"Failed to trigger deployment:"})}},Bv=(e,t)=>{e&&ig(process.cwd(),e),t&&og(t)},Ag=async(e,t,r,n)=>{let o=null,i=null,s=Date.now(),a=null,l=null,c=nu(process.cwd()),d=n?.telemetry;await d?.sendUsage("cloud_deploy_start",{environment:t,mountPath:r,projectName:n?.projectName,hasDescription:!!n?.description,hasDirectory:!!n?.directory,cloudflareBindings:c});try{Km(u,process.cwd()),o=await cg(e,t,r,n),u.info("\u{1F527} Detecting framework..."),a=await rg(process.cwd(),o.deploy_url,o.environment_id,r),u.info(`Framework: ${a.info.displayName}`),u.info(`Build command: ${a.getBuildCommand()}`),Iv(n)?u.info("\u23ED\uFE0F Skipping mount path validation..."):await $v(e,r,o.environment_id,n?.autoPublish),i=await Rv(a,o,r,n),u.info(`Starting deployment process for environment: ${t} at mount path: ${r}`);let p=Date.now()-s;await d?.sendUsage("cloud_deploy_success",{duration:p,environment:t,mountPath:r,projectName:n?.projectName,hasDescription:!!n?.description,hasDirectory:!!n?.directory,framework:a.info.name,buildCommand:a.getBuildCommand(),cloudflareBindings:c})}catch(p){l=p instanceof Error?p:new Error(String(p)),u.error(l,{prefix:"Error during deployment initialization:"});let m=Date.now()-s;await d?.sendError(l,"cloud_deploy_failure",{duration:m,environment:t,mountPath:r,projectName:n?.projectName,cloudflareBindings:c,argv:process.argv.slice(2)})}finally{if(Bv(a,i),o&&await Nv(e,o,r,l,{projectName:n?.projectName}),l)throw new f(l,{skipLogging:!0})}},Ig=e=>{let t=Math.max(...e.map(i=>Ge(i).length)),r=S(`\u250C${"\u2500".repeat(t+2)}\u2510`),n=S(`\u2514${"\u2500".repeat(t+2)}\u2518`),o=e.map(i=>{let s=" ".repeat(t-Ge(i).length);return`${S("\u2502")} ${i}${s} ${S("\u2502")}`});return[r,...o,n].join(`
178
- `)},$g=(e,t)=>{let r=[Me(`${Fe} Get started with the following commands:`),R(`cd ${e}`),R("npm install"),R("npm run dev"),R("webflow cloud deploy")];return t!==oe.New&&(r.push(""),r.push(Me(`${Fe} Run the following command to export Webflow components when they update:`)),r.push(R("webflow devlink export"))),Ig(r)},Rg=(e,t,r,n=!0)=>{let o=[],i=t===oe.New?"webflow cloud init --new":"webflow cloud init",s=l=>n?`App scaffold created at ${e}/ but ${l}`:l.charAt(0).toUpperCase()+l.slice(1),a=n?[R(`cd ${e}`)]:[];switch(r){case"auth":o.push(Me(`${Fe} ${s("Webflow authentication did not complete.")}`),"",Me(n?"To finish setup:":"To retry:"),...a,R("webflow auth login"),R(i));break;case"no-sites":o.push(Me(`${Fe} ${s("no Webflow sites were found in your account.")}`),"",Me(n?"Create a site in the Webflow Designer, then:":"Create a site in the Webflow Designer, then rerun:"),...a,R("webflow cloud init"));break;case"no-workspaces":o.push(Me(`${Fe} ${s("no Webflow workspaces were found in your account.")}`),"",Me(n?"Create a workspace, then:":"Create a workspace, then rerun:"),...a,R("webflow cloud init --new"));break;default:o.push(Me(`${Fe} ${s("setup did not complete.")}`),"",Me(n?"To retry setup:":"To retry:"),...a,R(i));break}return Ig(o)};ie();var hs=ne("[Deprecated]"),Pg=e=>{let t=e.command("cloud").description("Create and manage Webflow Cloud apps");t.command("create").description(`${hs} Use 'webflow cloud init' instead. Quick non-interactive scaffold for site-attached apps (hardcoded to /app).`).argument("<name>","App name").option("-f, --framework <framework>","Framework to use","nextjs").action(du),t.command("list").description("Get list of app templates that can be used for `init`").action(fu),t.command("init").description("Bootstrap a new Webflow Cloud app").addOption(new Hr.Option("-n, --app-name <name>","App name")).addOption(new Hr.Option("--project-name <name>",`${hs} Use --app-name instead.`)).option("-f, --framework <framework>","Framework to use (e.g., astro, nextjs)").option("-m, --mount <mount>","Mount path (default: '/' for new domain, '/app' for existing site)").option("-s, --site-id <siteId>","Webflow site ID to connect to").option("--new","Create an app without connecting to an existing site").option("-w, --workspace-id <workspaceId>","Workspace ID where the app should be deployed (skips workspace picker)").action(pu),t.command("deploy").description("Deploy your Webflow Cloud app").option("-e, --environment <environment>","Environment name").option("-m, --mount <mount>","Mount path (e.g., /app)").addOption(new Hr.Option("-n, --app-name <name>","App name (for new apps)")).addOption(new Hr.Option("--project-name <name>",`${hs} Use --app-name instead.`)).option("-d, --directory <path>","App directory path (for new apps)").option("--description <description>","App description (for new apps)").option("--skip-mount-path-check","Skip mount path checking").option("--auto-publish","Automatically publish site for mount path updates").option("-s, --site-id <siteId>","Webflow site ID for site-attached deploys (skips site picker)").addOption(new Hr.Option("-a, --app-id <appId>","App ID (skips app picker)")).addOption(new Hr.Option("--project-id <appId>",`${hs} Use --app-id instead.`)).option("-f, --framework <framework>","Override framework detection (e.g., nextjs, astro)").option("-w, --workspace-id <workspaceId>","Workspace ID where the app will be deployed (skips workspace picker)").action(mu)};se();I();ft();I();function V(e,t){if(!/^[a-f0-9]{24}$/.test(e))throw new f(`Invalid ${t}: "${e}" is not a valid resource ID.`,{isUserError:!0})}async function bt(e){try{let t=await e.json();return t.message??t.error??`${e.status} ${e.statusText}`}catch{return`${e.status} ${e.statusText}`}}async function jg(e,t){V(t,"siteId");let r=await K(`${_}/v2/sites/${t}/collections`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok){let o=await bt(r);throw r.status>=400&&r.status<500?new f(o,{isUserError:!0}):new f(`Failed to list collections: ${o}`)}return(await r.json()).collections??[]}async function Ng(e,t){V(t,"collectionId");let r=await K(`${_}/v2/collections/${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(r.status===404)throw new f(`Collection "${t}" not found`,{isUserError:!0});if(!r.ok)throw new f(`Failed to get collection: ${await bt(r)}`);let n=await r.json();return{...n,fields:n.fields??[]}}async function Bg(e,t,r){V(t,"siteId");let n={displayName:r.displayName,singularName:r.singularName};r.slug&&(n.slug=r.slug);let o=await K(`${_}/v2/sites/${t}/collections`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)});if(!o.ok){let i=await bt(o);throw o.status>=400&&o.status<500?new f(i,{isUserError:!0}):new f(`Failed to create collection: ${i}`)}return await o.json()}async function Mg(e,t,r){V(t,"collectionId");let n=await K(`${_}/v2/collections/${t}/fields`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({displayName:r.displayName,type:r.type,isRequired:r.isRequired??!1})});if(!n.ok){let o=await bt(n);throw n.status===404?new f(`Collection "${t}" not found`,{isUserError:!0}):n.status>=400&&n.status<500?new f(o,{isUserError:!0}):new f(`Failed to create field: ${o}`)}return await n.json()}async function hu(e,t,r={}){V(t,"collectionId");let n=new URLSearchParams;r.limit!=null&&n.set("limit",String(r.limit)),r.offset!=null&&n.set("offset",String(r.offset)),r.cmsLocaleId&&n.set("cmsLocaleId",r.cmsLocaleId);let o=n.toString()?`?${n.toString()}`:"",i=await K(`${_}/v2/collections/${t}/items${o}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(i.status===404)throw new f(`Collection "${t}" not found`,{isUserError:!0});if(!i.ok)throw new f(`Failed to list items: ${await bt(i)}`);let s=await i.json();return{items:s.items??[],total:s.total??0,count:s.count??s.items?.length??0,limit:s.limit??r.limit??100,offset:s.offset??r.offset??0}}async function Lg(e,t,r,n){V(t,"collectionId"),V(r,"itemId");let o=n?`?cmsLocaleId=${encodeURIComponent(n)}`:"",i=await K(`${_}/v2/collections/${t}/items/${r}${o}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(i.status===404)throw new f(`Item "${r}" not found`,{isUserError:!0});if(!i.ok)throw new f(`Failed to get item: ${await bt(i)}`);return await i.json()}async function wu(e,t,r,n=!1){V(t,"collectionId");let o=await K(`${_}/v2/collections/${t}/items`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({fieldData:r,isDraft:n})});if(!o.ok){let i=await bt(o);throw o.status>=400&&o.status<500?new f(i,{isUserError:!0}):new f(`Failed to create item: ${i}`)}return await o.json()}async function yu(e,t,r,n){V(t,"collectionId"),V(r,"itemId");let o=await K(`${_}/v2/collections/${t}/items/${r}`,{method:"PATCH",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({fieldData:n})});if(o.status===404)throw new f(`Item "${r}" not found`,{isUserError:!0});if(!o.ok)throw new f(`Failed to update item: ${await bt(o)}`);return await o.json()}async function Wg(e,t,r){V(t,"collectionId"),V(r,"itemId");let n=await K(`${_}/v2/collections/${t}/items/${r}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(n.status===404)throw new f(`Item "${r}" not found`,{isUserError:!0});if(!n.ok)throw new f(`Failed to delete item: ${await bt(n)}`)}async function Ug(e,t,r){V(t,"collectionId"),r.forEach(o=>V(o,"itemId"));let n=await K(`${_}/v2/collections/${t}/items/publish`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({itemIds:r})});if(!n.ok){let o=await bt(n);throw n.status>=400&&n.status<500?new f(o,{isUserError:!0}):new f(`Failed to publish items: ${o}`)}return await n.json()}ie();C();var Vg=(e,t)=>e+" ".repeat(Math.max(0,t-Ge(e).length));function Ve(e,t){let r=e.map((s,a)=>Math.max(Ge(s).length,...t.map(l=>Ge(String(l[a])).length))),n=r.map(s=>"\u2500".repeat(s+2)).join("\u2500"),o=e.map((s,a)=>Vg(s,r[a]+2)).join(""),i=t.map(s=>s.map((a,l)=>Vg(String(a),r[l]+2)).join("")).join(`
177
+ ${O} Deployment triggered successfully!`);let i;try{let{manifest:s}=J();Ml(s)&&(i=[`${o?.projectName??Vr.basename(process.cwd())}.webflow.io`])}catch(s){u.debug(`Could not read manifest for standalone deploy link hint: ${s instanceof Error?s.message:String(s)}`)}await Nv(e,r,t.environment_id,i!==void 0?{domainsOverride:i}:void 0),Bv(t)}}catch(i){throw new f(i,{prefix:"Failed to trigger deployment:"})}},Lv=(e,t)=>{e&&ig(process.cwd(),e),t&&og(t)},Og=async(e,t,r,n)=>{let o=null,i=null,s=Date.now(),a=null,l=null,c=nu(process.cwd()),d=n?.telemetry;await d?.sendUsage("cloud_deploy_start",{environment:t,mountPath:r,projectName:n?.projectName,hasDescription:!!n?.description,hasDirectory:!!n?.directory,cloudflareBindings:c});try{Km(u,process.cwd()),o=await dg(e,t,r,n),u.info("\u{1F527} Detecting framework..."),a=await rg(process.cwd(),o.deploy_url,o.environment_id,r),u.info(`Framework: ${a.info.displayName}`),u.info(`Build command: ${a.getBuildCommand()}`),Rv(n)?u.info("\u23ED\uFE0F Skipping mount path validation..."):await Pv(e,r,o.environment_id,n?.autoPublish),i=await jv(a,o,r,n),u.info(`Starting deployment process for environment: ${t} at mount path: ${r}`);let p=Date.now()-s;await d?.sendUsage("cloud_deploy_success",{duration:p,environment:t,mountPath:r,projectName:n?.projectName,hasDescription:!!n?.description,hasDirectory:!!n?.directory,framework:a.info.name,buildCommand:a.getBuildCommand(),cloudflareBindings:c})}catch(p){l=p instanceof Error?p:new Error(String(p)),u.error(l,{prefix:"Error during deployment initialization:"});let m=Date.now()-s;await d?.sendError(l,"cloud_deploy_failure",{duration:m,environment:t,mountPath:r,projectName:n?.projectName,cloudflareBindings:c,argv:process.argv.slice(2)})}finally{if(Lv(a,i),o&&await Mv(e,o,r,l,{projectName:n?.projectName}),l)throw new f(l,{skipLogging:!0})}},$g=e=>{let t=Math.max(...e.map(i=>Ge(i).length)),r=S(`\u250C${"\u2500".repeat(t+2)}\u2510`),n=S(`\u2514${"\u2500".repeat(t+2)}\u2518`),o=e.map(i=>{let s=" ".repeat(t-Ge(i).length);return`${S("\u2502")} ${i}${s} ${S("\u2502")}`});return[r,...o,n].join(`
178
+ `)},Rg=(e,t)=>{let r=[Me(`${Fe} Get started with the following commands:`),R(`cd ${e}`),R("npm install"),R("npm run dev"),R("webflow cloud deploy")];return t!==oe.New&&(r.push(""),r.push(Me(`${Fe} Run the following command to export Webflow components when they update:`)),r.push(R("webflow devlink export"))),$g(r)},Pg=(e,t,r,n=!0)=>{let o=[],i=t===oe.New?"webflow cloud init --new":"webflow cloud init",s=l=>n?`App scaffold created at ${e}/ but ${l}`:l.charAt(0).toUpperCase()+l.slice(1),a=n?[R(`cd ${e}`)]:[];switch(r){case"auth":o.push(Me(`${Fe} ${s("Webflow authentication did not complete.")}`),"",Me(n?"To finish setup:":"To retry:"),...a,R("webflow auth login"),R(i));break;case"no-sites":o.push(Me(`${Fe} ${s("no Webflow sites were found in your account.")}`),"",Me(n?"Create a site in the Webflow Designer, then:":"Create a site in the Webflow Designer, then rerun:"),...a,R("webflow cloud init"));break;case"no-workspaces":o.push(Me(`${Fe} ${s("no Webflow workspaces were found in your account.")}`),"",Me(n?"Create a workspace, then:":"Create a workspace, then rerun:"),...a,R("webflow cloud init --new"));break;default:o.push(Me(`${Fe} ${s("setup did not complete.")}`),"",Me(n?"To retry setup:":"To retry:"),...a,R(i));break}return $g(o)};ie();var hs=ne("[Deprecated]"),jg=e=>{let t=e.command("cloud").description("Create and manage Webflow Cloud apps");t.command("create").description(`${hs} Use 'webflow cloud init' instead. Quick non-interactive scaffold for site-attached apps (hardcoded to /app).`).argument("<name>","App name").option("-f, --framework <framework>","Framework to use","nextjs").action(du),t.command("list").description("Get list of app templates that can be used for `init`").action(fu),t.command("init").description("Bootstrap a new Webflow Cloud app").addOption(new Hr.Option("-n, --app-name <name>","App name")).addOption(new Hr.Option("--project-name <name>",`${hs} Use --app-name instead.`)).option("-f, --framework <framework>","Framework to use (e.g., astro, nextjs)").option("-m, --mount <mount>","Mount path (default: '/' for new domain, '/app' for existing site)").option("-s, --site-id <siteId>","Webflow site ID to connect to").option("--new","Create an app without connecting to an existing site").option("-w, --workspace-id <workspaceId>","Workspace ID where the app should be deployed (skips workspace picker)").action(pu),t.command("deploy").description("Deploy your Webflow Cloud app").option("-e, --environment <environment>","Environment name").option("-m, --mount <mount>","Mount path (e.g., /app)").addOption(new Hr.Option("-n, --app-name <name>","App name (for new apps)")).addOption(new Hr.Option("--project-name <name>",`${hs} Use --app-name instead.`)).option("-d, --directory <path>","App directory path (for new apps)").option("--description <description>","App description (for new apps)").option("--skip-mount-path-check","Skip mount path checking").option("--auto-publish","Automatically publish site for mount path updates").option("-s, --site-id <siteId>","Webflow site ID for site-attached deploys (skips site picker)").addOption(new Hr.Option("-a, --app-id <appId>","App ID (skips app picker)")).addOption(new Hr.Option("--project-id <appId>",`${hs} Use --app-id instead.`)).option("-f, --framework <framework>","Override framework detection (e.g., nextjs, astro)").option("-w, --workspace-id <workspaceId>","Workspace ID where the app will be deployed (skips workspace picker)").action(mu)};se();I();ft();I();function V(e,t){if(!/^[a-f0-9]{24}$/.test(e))throw new f(`Invalid ${t}: "${e}" is not a valid resource ID.`,{isUserError:!0})}async function bt(e){try{let t=await e.json();return t.message??t.error??`${e.status} ${e.statusText}`}catch{return`${e.status} ${e.statusText}`}}async function Ng(e,t){V(t,"siteId");let r=await K(`${_}/v2/sites/${t}/collections`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok){let o=await bt(r);throw r.status>=400&&r.status<500?new f(o,{isUserError:!0}):new f(`Failed to list collections: ${o}`)}return(await r.json()).collections??[]}async function Bg(e,t){V(t,"collectionId");let r=await K(`${_}/v2/collections/${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(r.status===404)throw new f(`Collection "${t}" not found`,{isUserError:!0});if(!r.ok)throw new f(`Failed to get collection: ${await bt(r)}`);let n=await r.json();return{...n,fields:n.fields??[]}}async function Mg(e,t,r){V(t,"siteId");let n={displayName:r.displayName,singularName:r.singularName};r.slug&&(n.slug=r.slug);let o=await K(`${_}/v2/sites/${t}/collections`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)});if(!o.ok){let i=await bt(o);throw o.status>=400&&o.status<500?new f(i,{isUserError:!0}):new f(`Failed to create collection: ${i}`)}return await o.json()}async function Lg(e,t,r){V(t,"collectionId");let n=await K(`${_}/v2/collections/${t}/fields`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({displayName:r.displayName,type:r.type,isRequired:r.isRequired??!1})});if(!n.ok){let o=await bt(n);throw n.status===404?new f(`Collection "${t}" not found`,{isUserError:!0}):n.status>=400&&n.status<500?new f(o,{isUserError:!0}):new f(`Failed to create field: ${o}`)}return await n.json()}async function hu(e,t,r={}){V(t,"collectionId");let n=new URLSearchParams;r.limit!=null&&n.set("limit",String(r.limit)),r.offset!=null&&n.set("offset",String(r.offset)),r.cmsLocaleId&&n.set("cmsLocaleId",r.cmsLocaleId);let o=n.toString()?`?${n.toString()}`:"",i=await K(`${_}/v2/collections/${t}/items${o}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(i.status===404)throw new f(`Collection "${t}" not found`,{isUserError:!0});if(!i.ok)throw new f(`Failed to list items: ${await bt(i)}`);let s=await i.json();return{items:s.items??[],total:s.total??0,count:s.count??s.items?.length??0,limit:s.limit??r.limit??100,offset:s.offset??r.offset??0}}async function Wg(e,t,r,n){V(t,"collectionId"),V(r,"itemId");let o=n?`?cmsLocaleId=${encodeURIComponent(n)}`:"",i=await K(`${_}/v2/collections/${t}/items/${r}${o}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(i.status===404)throw new f(`Item "${r}" not found`,{isUserError:!0});if(!i.ok)throw new f(`Failed to get item: ${await bt(i)}`);return await i.json()}async function wu(e,t,r,n=!1){V(t,"collectionId");let o=await K(`${_}/v2/collections/${t}/items`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({fieldData:r,isDraft:n})});if(!o.ok){let i=await bt(o);throw o.status>=400&&o.status<500?new f(i,{isUserError:!0}):new f(`Failed to create item: ${i}`)}return await o.json()}async function yu(e,t,r,n){V(t,"collectionId"),V(r,"itemId");let o=await K(`${_}/v2/collections/${t}/items/${r}`,{method:"PATCH",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({fieldData:n})});if(o.status===404)throw new f(`Item "${r}" not found`,{isUserError:!0});if(!o.ok)throw new f(`Failed to update item: ${await bt(o)}`);return await o.json()}async function Ug(e,t,r){V(t,"collectionId"),V(r,"itemId");let n=await K(`${_}/v2/collections/${t}/items/${r}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(n.status===404)throw new f(`Item "${r}" not found`,{isUserError:!0});if(!n.ok)throw new f(`Failed to delete item: ${await bt(n)}`)}async function Vg(e,t,r){V(t,"collectionId"),r.forEach(o=>V(o,"itemId"));let n=await K(`${_}/v2/collections/${t}/items/publish`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({itemIds:r})});if(!n.ok){let o=await bt(n);throw n.status>=400&&n.status<500?new f(o,{isUserError:!0}):new f(`Failed to publish items: ${o}`)}return await n.json()}ie();C();var Hg=(e,t)=>e+" ".repeat(Math.max(0,t-Ge(e).length));function Ve(e,t){let r=e.map((s,a)=>Math.max(Ge(s).length,...t.map(l=>Ge(String(l[a])).length))),n=r.map(s=>"\u2500".repeat(s+2)).join("\u2500"),o=e.map((s,a)=>Hg(s,r[a]+2)).join(""),i=t.map(s=>s.map((a,l)=>Hg(String(a),r[l]+2)).join("")).join(`
179
179
  `);return`${o}
180
180
  ${n}
181
- ${i}`}re();De();async function ws(e){if(e.site)return{token:await $(),siteId:e.site};let{manifest:t}=J(),r=await he(t);return{token:r.accessToken,siteId:r.siteId}}function Hg(e,t=["id","displayName","slug"]){if(e.length===0)return S("No collections found.");let r=["id","displayName","singularName","slug","lastUpdated"],n=Object.fromEntries(r.map(a=>[a.toLowerCase(),a])),o=t.map(a=>n[a.toLowerCase()]).filter(a=>a!=null);if(o.length===0)return vt(`Invalid fields. Available: ${r.join(", ")}`);let i=o.map(a=>Y(a)),s=e.map(a=>o.map(l=>{let c=a[l];return c?l==="lastUpdated"?new Date(c).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):c:S("\u2014")}));return Ve(i,s)}function Jg(e){let t=[`${Y("Collection:")} ${e.displayName}`,`${Y("ID:")} ${e.id}`,`${Y("Slug:")} ${e.slug}`,`${Y("Singular:")} ${e.singularName}`,`${Y("Updated:")} ${new Date(e.lastUpdated).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,"",Y("Fields:")];if(e.fields.length===0)return t.push(S(" No fields defined.")),t.join(`
181
+ ${i}`}re();De();async function ws(e){if(e.site)return{token:await $(),siteId:e.site};let{manifest:t}=J(),r=await he(t);return{token:r.accessToken,siteId:r.siteId}}function Jg(e,t=["id","displayName","slug"]){if(e.length===0)return S("No collections found.");let r=["id","displayName","singularName","slug","lastUpdated"],n=Object.fromEntries(r.map(a=>[a.toLowerCase(),a])),o=t.map(a=>n[a.toLowerCase()]).filter(a=>a!=null);if(o.length===0)return vt(`Invalid fields. Available: ${r.join(", ")}`);let i=o.map(a=>Y(a)),s=e.map(a=>o.map(l=>{let c=a[l];return c?l==="lastUpdated"?new Date(c).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):c:S("\u2014")}));return Ve(i,s)}function Gg(e){let t=[`${Y("Collection:")} ${e.displayName}`,`${Y("ID:")} ${e.id}`,`${Y("Slug:")} ${e.slug}`,`${Y("Singular:")} ${e.singularName}`,`${Y("Updated:")} ${new Date(e.lastUpdated).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,"",Y("Fields:")];if(e.fields.length===0)return t.push(S(" No fields defined.")),t.join(`
182
182
  `);let r=["NAME","SLUG","TYPE","REQUIRED"].map(o=>Y(o)),n=e.fields.map(o=>[o.displayName,o.slug,o.type,o.isRequired?"yes":"no"]);return t.push(Ve(r,n)),t.join(`
183
- `)}function Gg(e,t=["id","isDraft","lastUpdated"]){if(e.length===0)return S("No items found.");let r=t.map(o=>Y(o)),n=e.map(o=>t.map(i=>{if(i==="fieldData")return JSON.stringify(o.fieldData);if(i==="isDraft")return o.isDraft?ne("draft"):R("live");if(i==="isArchived")return o.isArchived?S("archived"):"";if(i==="lastUpdated"||i==="lastPublished"||i==="createdOn"){let a=o[i];return a?new Date(a).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):S("\u2014")}let s=o[i];return s==null?S("\u2014"):String(s)}));return Ve(r,n)}I();C();W();function ys(e,t,r="asc"){return[...e].sort((n,o)=>{let i=n[t],s=o[t];if(i==null&&s==null)return 0;if(i==null)return 1;if(s==null)return-1;let a=0;return typeof i=="string"&&typeof s=="string"?a=i.localeCompare(s):typeof i=="number"&&typeof s=="number"?a=i-s:a=String(i).localeCompare(String(s)),r==="desc"?-a:a})}te();async function Du(e){let{token:t,siteId:r}=await ws(e),n=A.forCms({authToken:t,siteId:r}),o=Date.now();try{let i=await jg(t,r);if(await n.sendUsage("cms_collections_list",{duration:Date.now()-o,count:i.length}),i.length===0){u.info("No collections found.");return}let s=["displayName","slug","lastUpdated"];if(s.includes(e.sortBy)||(u.warn(`Unknown --sort-by "${e.sortBy}". Valid fields: ${s.join(", ")}. Defaulting to displayName.`),e.sortBy="displayName"),!["asc","desc"].includes(e.order))throw new f(`Invalid --order "${e.order}". Valid values: asc, desc`,{isUserError:!0});let a=ys(i,e.sortBy,e.order);if(e.json){u.info(JSON.stringify(a,null,2));return}let l=e.fields.split(",").map(c=>c.trim());u.info(Hg(a,l))}catch(i){if(i instanceof f&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_collections_list",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to list collections:`})}}re();I();C();W();te();async function bu(e,t){let r=await $(),n=A.forCms({authToken:r}),o=Date.now();try{let i=await Ng(r,e);if(await n.sendUsage("cms_collections_get",{duration:Date.now()-o}),t.json){u.info(JSON.stringify(i,null,2));return}u.info(Jg(i))}catch(i){if(i instanceof f&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_collections_get",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to get collection:`})}}I();C();W();te();async function vu(e){let t=e.singularName??e.name,r=e.slug??e.name.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");if(e.dryRun){u.info("Dry run \u2014 would create collection:"),u.info(JSON.stringify({displayName:e.name,singularName:t,slug:r},null,2)),u.info("Dry run complete \u2014 no changes made.");return}let{token:n,siteId:o}=await ws(e),i=A.forCms({authToken:n,siteId:o}),s=Date.now();try{let a=await Bg(n,o,{displayName:e.name,singularName:t,slug:r});if(await i.sendUsage("cms_collections_create",{duration:Date.now()-s}),e.json){u.info(JSON.stringify(a,null,2));return}u.info(`${O} Collection created: ${a.id}`),u.info(` Name: ${a.displayName}`),u.info(` Slug: ${a.slug}`),u.info(`
184
- Next: add fields with "webflow cms fields create --collection ${a.id} --name <name> --type <type>"`)}catch(a){if(a instanceof f&&a.isUserError){u.info(`${F} ${a.message}`),process.exitCode=1;return}throw await i.sendError(a instanceof Error?a:new Error(String(a)),"cms_collections_create",{duration:Date.now()-s}),new f(a,{prefix:`${F} Failed to create collection:`})}}re();I();C();W();te();async function Eu(e){if(e.dryRun){u.info("Dry run \u2014 would create field:"),u.info(JSON.stringify({collectionId:e.collection,displayName:e.name,type:e.type,isRequired:e.required??!1},null,2)),u.info("Dry run complete \u2014 no changes made.");return}let t=await $(),r=A.forCms({authToken:t}),n=Date.now();try{let o=await Mg(t,e.collection,{displayName:e.name,type:e.type,isRequired:e.required??!1});if(await r.sendUsage("cms_fields_create",{duration:Date.now()-n}),e.json){u.info(JSON.stringify(o,null,2));return}u.info(`${O} Field created: ${o.id}`),u.info(` Name: ${o.displayName}`),u.info(` Type: ${o.type}`),u.info(` Slug: ${o.slug}`)}catch(o){if(o instanceof f&&o.isUserError){u.info(`${F} ${o.message}`),process.exitCode=1;return}throw await r.sendError(o instanceof Error?o:new Error(String(o)),"cms_fields_create",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to create field:`})}}re();I();C();W();te();async function xu(e){let t=await $(),r=A.forCms({authToken:t}),n=Date.now(),o=e.limit??100,i=e.offset??0;try{let s=await hu(t,e.collection,{limit:o,offset:i,cmsLocaleId:e.locale});if(await r.sendUsage("cms_items_list",{duration:Date.now()-n,count:s.items.length}),s.items.length===0){u.info("No items found.");return}if(e.json){u.info(JSON.stringify(s,null,2));return}let a=e.fields.split(",").map(p=>p.trim());u.info(Gg(s.items,a));let l=i+1,c=i+s.items.length;if(s.items.length>=o||i>0){let p=s.total>0?` of ${s.total}`:"";u.info(`
185
- Showing ${l}\u2013${c}${p} items. Use --offset ${c} to load next page.`)}}catch(s){if(s instanceof f&&s.isUserError){u.info(`${F} ${s.message}`),process.exitCode=1;return}throw await r.sendError(s instanceof Error?s:new Error(String(s)),"cms_items_list",{duration:Date.now()-n}),new f(s,{prefix:`${F} Failed to list items:`})}}re();I();C();W();te();async function Fu(e){let t=await $(),r=A.forCms({authToken:t}),n=Date.now();try{let o=await Lg(t,e.collection,e.item,e.locale);if(await r.sendUsage("cms_items_get",{duration:Date.now()-n}),e.json){u.info(JSON.stringify(o,null,2));return}let i=o.isArchived?"archived":o.isDraft?"draft":"live";u.info(`${o.id} [${i}]`),u.info(` Last updated: ${new Date(o.lastUpdated).toLocaleString()}`),o.lastPublished&&u.info(` Last published: ${new Date(o.lastPublished).toLocaleString()}`),u.info(" Fields:"),u.info(JSON.stringify(o.fieldData,null,4).replace(/^/gm," "))}catch(o){if(o instanceof f&&o.isUserError){u.info(`${F} ${o.message}`),process.exitCode=1;return}throw await r.sendError(o instanceof Error?o:new Error(String(o)),"cms_items_get",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to get item:`})}}re();I();C();W();te();async function Cu(e){let t;try{t=JSON.parse(e.data)}catch{throw new f(`Invalid JSON for --data: ${e.data}`)}if(e.dryRun){u.info("Dry run \u2014 would create item:"),u.info(JSON.stringify({fieldData:t,isDraft:e.draft??!1},null,2)),u.info("Dry run complete \u2014 no changes made.");return}let r=await $(),n=A.forCms({authToken:r}),o=Date.now();try{let i=await wu(r,e.collection,t,e.draft??!1);if(await n.sendUsage("cms_items_create",{duration:Date.now()-o,dryRun:!1}),e.json){u.info(JSON.stringify(i,null,2));return}u.info(`${O} Item created: ${i.id}`)}catch(i){if(i instanceof f&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_items_create",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to create item:`})}}re();I();C();W();te();async function _u(e){let t;try{t=JSON.parse(e.data)}catch{throw new f(`Invalid JSON for --data: ${e.data}`)}if(e.dryRun){u.info("Dry run \u2014 would update item:"),u.info(JSON.stringify({collectionId:e.collection,itemId:e.item,fieldData:t},null,2)),u.info("Dry run complete \u2014 no changes made.");return}let r=await $(),n=A.forCms({authToken:r}),o=Date.now();try{let i=await yu(r,e.collection,e.item,t);if(await n.sendUsage("cms_items_update",{duration:Date.now()-o,dryRun:!1}),e.json){u.info(JSON.stringify(i,null,2));return}u.info(`${O} Item updated: ${i.id}`)}catch(i){if(i instanceof f&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_items_update",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to update item:`})}}re();I();C();W();te();async function ku(e){if(e.dryRun){u.info(`Dry run \u2014 would delete item ${e.item} from collection ${e.collection}`),u.info("Dry run complete \u2014 no changes made.");return}let t=await $(),r=A.forCms({authToken:t}),n=Date.now();try{await Wg(t,e.collection,e.item),await r.sendUsage("cms_items_delete",{duration:Date.now()-n,dryRun:!1}),u.info(`${O} Item deleted: ${e.item}`)}catch(o){if(o instanceof f&&o.isUserError){u.info(`${F} ${o.message}`),process.exitCode=1;return}throw await r.sendError(o instanceof Error?o:new Error(String(o)),"cms_items_delete",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to delete item:`})}}re();I();C();W();te();async function Su(e){let t=e.items.split(",").map(i=>i.trim());if(e.dryRun){u.info(`Dry run \u2014 would publish ${t.length} item(s) in collection ${e.collection}:`),t.forEach(i=>u.info(` ${i}`)),u.info("Dry run complete \u2014 no changes made.");return}let r=await $(),n=A.forCms({authToken:r}),o=Date.now();try{let i=await Ug(r,e.collection,t);if(await n.sendUsage("cms_items_publish",{duration:Date.now()-o,itemCount:t.length,dryRun:!1}),e.json){u.info(JSON.stringify(i,null,2));return}let s=i.publishedItemIds?.length??0;u.info(`${O} Published ${s} item(s)`),i.errors?.length&&i.errors.forEach(a=>u.warn(` ${a.itemId}: ${a.message}`))}catch(i){if(i instanceof f&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_items_publish",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to publish items:`})}}var zg=e=>{let t=e.command("cms").description("Manage Webflow CMS content"),r=t.command("collections").description("Manage CMS collections");r.command("list").description("List all CMS collections for a site").addOption(We()).addOption(de()).addOption(St(["id","displayName","singularName","slug","lastUpdated"]).default("id,displayName,slug")).addOption(Gi(["displayName","slug","lastUpdated"]).default("displayName")).addOption(Ji()).action(Du),r.command("get").description("Get details and field schema for a CMS collection").argument("<collectionId>","Collection ID").addOption(de()).action(bu),r.command("create").description("Create a new CMS collection on a site. Use --dry-run to preview.").addOption(We()).requiredOption("--name <displayName>","Collection display name").option("--singular-name <singularName>","Singular name (defaults to --name)").option("--slug <slug>","URL slug for the collection (auto-derived from --name if omitted)").addOption(Ke()).addOption(de()).action(vu),t.command("fields").description("Manage CMS collection fields").command("create").description("Add a field to a CMS collection. Use --dry-run to preview.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--name <displayName>","Field display name").requiredOption("--type <type>","Field type (e.g. PlainText, RichText, Number, DateTime, Link, Image, Video, Color, Bool, Option, ItemRef, ItemRefSet)").option("--required","Mark field as required").addOption(Ke()).addOption(de()).action(Eu);let o=t.command("items").description("Manage CMS items");o.command("list").description("List items in a CMS collection").requiredOption("--collection <collectionId>","Collection ID").option("--locale <cmsLocaleId>","CMS locale ID to filter by").addOption(zi()).addOption(qi()).addOption(de()).addOption(St(["id","isDraft","isArchived","lastUpdated","fieldData"]).default("id,isDraft,lastUpdated")).action(xu),o.command("get").description("Get a single CMS item by ID").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--item <itemId>","Item ID").option("--locale <cmsLocaleId>","CMS locale ID to retrieve content for").addOption(de()).action(Fu),o.command("create").description("Create a new CMS item. Use --dry-run to preview before executing.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--data <json>","Item field data as a JSON string").option("--draft","Create as draft (not published)").addOption(Ke()).addOption(de()).action(Cu),o.command("update").description("Update an existing CMS item. Use --dry-run to preview before executing.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--item <itemId>","Item ID").requiredOption("--data <json>","Updated field data as a JSON string").addOption(Ke()).addOption(de()).action(_u),o.command("delete").description("Delete a CMS item. Use --dry-run to preview before executing.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--item <itemId>","Item ID").addOption(Ke()).action(ku),o.command("publish").description("Publish one or more CMS items. Use --dry-run to preview before executing.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--items <itemIds>","Comma-separated item IDs to publish").addOption(Ke()).addOption(de()).action(Su)};re();ie();I();C();W();De();te();se();ft();I();I();ie();var qg={png:{category:"image",maxBytes:4*1024*1024},jpeg:{category:"image",maxBytes:4*1024*1024},jpg:{category:"image",maxBytes:4*1024*1024},gif:{category:"image",maxBytes:4*1024*1024},svg:{category:"image",maxBytes:4*1024*1024},webp:{category:"image",maxBytes:4*1024*1024},avif:{category:"image",maxBytes:4*1024*1024},pdf:{category:"document",maxBytes:10*1024*1024},doc:{category:"document",maxBytes:10*1024*1024},docx:{category:"document",maxBytes:10*1024*1024},xls:{category:"document",maxBytes:10*1024*1024},xlsx:{category:"document",maxBytes:10*1024*1024},ppt:{category:"document",maxBytes:10*1024*1024},pptx:{category:"document",maxBytes:10*1024*1024},txt:{category:"document",maxBytes:10*1024*1024},csv:{category:"document",maxBytes:10*1024*1024},odt:{category:"document",maxBytes:10*1024*1024},ods:{category:"document",maxBytes:10*1024*1024},odp:{category:"document",maxBytes:10*1024*1024},json:{category:"lottie",maxBytes:10*1024*1024},lottie:{category:"lottie",maxBytes:10*1024*1024}};function Ds(e,t){let r=e.split(".").pop()?.toLowerCase()??"",n=qg[r];if(!n){let o=Object.keys(qg).join(", ");throw new f(`Unsupported file type ".${r}". Allowed types: ${o}`,{isUserError:!0})}if(t>n.maxBytes){let o=n.maxBytes/1048576,i=(t/(1024*1024)).toFixed(1);throw new f(`File too large: ${i} MB exceeds the ${o} MB limit for ${n.category} files.`,{isUserError:!0})}}var Tu=["id","displayName","originalFileName","contentType","size","lastUpdated"];function Kg(e,t=["id","displayName","lastUpdated","size"]){if(e.length===0)return S("No assets found.");let r=Object.fromEntries(Tu.map(l=>[l.toLowerCase(),l])),n=t.map(l=>r[l.toLowerCase()]).filter(l=>l!=null);if(n.length===0)return vt(`Invalid fields. Available: ${Tu.join(", ")}`);let o=t.filter(l=>r[l.toLowerCase()]==null),i=o.length>0?ne(`Warning: unknown field(s) ignored: ${o.join(", ")}. Available: ${Tu.join(", ")}
186
- `):"",s=n.map(l=>Y(l)),a=e.map(l=>n.map(c=>{let d=l[c];if(d==null||c==="size"&&d===0)return S("\u2014");if(c==="size")return Mv(Number(d));if(c==="lastUpdated"){let m=new Date(String(d)),g=String(m.getMonth()+1).padStart(2,"0"),y=String(m.getDate()).padStart(2,"0"),x=String(m.getFullYear()).slice(-2),T=String(m.getHours()).padStart(2,"0"),P=String(m.getMinutes()).padStart(2,"0");return`${g}/${y}/${x} ${T}:${P}`}let p=String(d);return c==="displayName"&&p.length>40?S("\u2026")+p.slice(-39):p}));return i+Ve(s,a)}function Mv(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Zg(e){if(e.length===0)return S("No folders found.");let t=[...e].sort((o,i)=>o.displayName.localeCompare(i.displayName)),r=["id","displayName","assets","lastUpdated"].map(o=>Y(o)),n=t.map(o=>[o.id,o.displayName,String(o.assets.length),new Date(o.lastUpdated).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})]);return Ve(r,n)}async function Yg(e,t,r={}){if(V(t,"siteId"),r.folderId){V(r.folderId,"folderId");let a=await Lv(e,r.folderId),l=new Set(a.assets);if(l.size===0)return{assets:[],pagination:{total:0,limit:0,offset:0}};let c=[],d=0,p=100;for(;;){let T=await K(`${_}/v2/sites/${t}/assets?limit=${p}&offset=${d}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!T.ok)throw new f(`Failed to list assets: ${T.status} ${T.statusText}`);let P=await T.json(),Z=P.assets??[];c.push(...Z);let b=P.pagination?.total??0;if(d+=Z.length,d>=b||Z.length===0)break}let m=c.filter(T=>l.has(T.id)),g=r.offset??0,y=r.limit??m.length,x=m.slice(g,g+y);return{assets:x,pagination:{total:m.length,limit:x.length,offset:g}}}let n=new URLSearchParams;r.limit!=null&&n.set("limit",String(r.limit)),r.offset!=null&&n.set("offset",String(r.offset));let o=n.toString(),i=await K(`${_}/v2/sites/${t}/assets${o?`?${o}`:""}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!i.ok)throw new f(`Failed to list assets: ${i.status} ${i.statusText}`);let s=await i.json();return{assets:s.assets??[],pagination:s.pagination??{total:0,limit:100,offset:0}}}async function Xg(e,t,r,n,o){V(t,"siteId"),o&&V(o,"folderId");let i=ao(r);Ds(i.meta.title,i.meta.size);let s=n??i.meta.title,a={fileName:i.meta.title,fileHash:i.meta.fileHash,displayName:s};o&&(a.parentFolder=o);let l=await K(`${_}/v2/sites/${t}/assets`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(a)});if(!l.ok)throw new f(`Failed to initiate asset upload: ${l.status} ${l.statusText}`);let c=await l.json(),d={fields:c.uploadDetails,_id:c.id,s3Url:c.hostedUrl??"",url:c.uploadUrl??"",contentType:c.contentType??"",origFileName:c.originalFileName??i.meta.title,success_action_redirect:"",createdOn:"",updatedOn:""};try{await uo(i,d)}catch(p){throw await K(`${_}/v2/assets/${d._id}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}}).catch(()=>{}),p}return{id:d._id,hostedUrl:d.s3Url,displayName:s,originalFileName:i.meta.title}}async function Qg(e,t,r){V(t,"assetId");let n=await K(`${_}/v2/assets/${t}`,{method:"PATCH",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(r)});if(!n.ok)throw new f(`Failed to update asset: ${n.status} ${n.statusText}`);return await n.json()}async function Lv(e,t){V(t,"folderId");let r=await K(`${_}/v2/asset_folders/${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok)throw new f(`Failed to get folder: ${r.status} ${r.statusText}`);return await r.json()}async function eh(e,t){V(t,"siteId");let r=await K(`${_}/v2/sites/${t}/asset_folders`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok)throw new f(`Failed to list folders: ${r.status} ${r.statusText}`);return(await r.json()).assetFolders??[]}async function th(e,t,r,n){V(t,"siteId"),n&&V(n,"parentFolderId");let o={displayName:r};n&&(o.parentFolder=n);let i=await K(`${_}/v2/sites/${t}/asset_folders`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(o)});if(!i.ok)throw new f(`Failed to create folder: ${i.status} ${i.statusText}`);return await i.json()}async function Au(e){let t,r;if(e.site)t=await $(),r=e.site;else{let{manifest:i}=J(),s=await he(i);t=s.accessToken,r=s.siteId}let n=A.forAssets({authToken:t,siteId:r}),o=Date.now();try{let{assets:i,pagination:s}=await Yg(t,r,{limit:e.limit,offset:e.offset,folderId:e.folder});if(await n.sendUsage("assets_list",{duration:Date.now()-o,count:i.length}),i.length===0){u.info("No assets found.");return}let a=["displayName","originalFileName","contentType","size","lastUpdated"],l=e.sortBy;a.includes(l)||(u.warn(`Unknown --sort-by "${e.sortBy}". Valid fields: ${a.join(", ")}. Defaulting to displayName.`),l="displayName");let c=e.order;["asc","desc"].includes(e.order)||(u.warn(`Unknown --order "${e.order}". Valid values: asc, desc. Defaulting to asc.`),c="asc");let d=ys(i,l,c);if(e.json){u.info(JSON.stringify({assets:d,pagination:s},null,2));return}let p=e.fields.split(",").map(g=>g.trim());u.info(Kg(d,p));let m=(e.offset??0)+i.length;m<s.total&&u.info(S(`Showing ${m} of ${s.total} assets. Use --offset ${m} to see more.`))}catch(i){throw await n.sendError(i instanceof Error?i:new Error(String(i)),"assets_list",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to list assets:`})}}re();I();C();W();De();te();async function Ou(e,t){let r=ao(e);if(Ds(r.meta.title,r.meta.size),t.dryRun){u.info(`Dry run \u2014 would upload: ${e} (validated)`),t.name&&u.info(` Display name: ${t.name}`),t.folder&&u.info(` Folder: ${t.folder}`),u.info("Dry run complete \u2014 no changes made.");return}let n,o;if(t.site)n=await $(),o=t.site;else{let{manifest:a}=J(),l=await he(a);n=l.accessToken,o=l.siteId}let i=A.forAssets({authToken:n,siteId:o}),s=Date.now();try{let a=await Xg(n,o,e,t.name,t.folder);if(await i.sendUsage("assets_upload",{duration:Date.now()-s,dryRun:!1}),t.json){u.info(JSON.stringify(a,null,2));return}u.info(`${O} Asset uploaded: ${a.id}`),a.hostedUrl&&u.info(` URL: ${a.hostedUrl}`)}catch(a){throw await i.sendError(a instanceof Error?a:new Error(String(a)),"assets_upload",{duration:Date.now()-s}),new f(a,{prefix:`${F} Failed to upload asset:`})}}re();I();C();W();te();async function Iu(e,t){if(!t.altText&&!t.displayName)throw new f("Provide at least one of --alt-text or --display-name.",{isUserError:!0});if(t.dryRun){u.info(`Dry run \u2014 would update asset: ${e}`),t.altText&&u.info(` Alt text: ${t.altText}`),t.displayName&&u.info(` Display name: ${t.displayName}`),u.info("Dry run complete \u2014 no changes made.");return}let r=await $(),n=A.forAssets({authToken:r}),o=Date.now();try{let i=await Qg(r,e,{altText:t.altText,displayName:t.displayName});if(await n.sendUsage("assets_update",{duration:Date.now()-o,dryRun:!1}),t.json){u.info(JSON.stringify(i,null,2));return}u.info(`${O} Asset updated: ${i.id}`),i.displayName&&u.info(` Display name: ${i.displayName}`),i.altText&&u.info(` Alt text: ${i.altText}`)}catch(i){throw await n.sendError(i instanceof Error?i:new Error(String(i)),"assets_update",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to update asset:`})}}re();I();C();W();De();te();async function $u(e){let t,r;if(e.site)t=await $(),r=e.site;else{let{manifest:i}=J(),s=await he(i);t=s.accessToken,r=s.siteId}let n=A.forAssets({authToken:t,siteId:r}),o=Date.now();try{let i=await eh(t,r);if(await n.sendUsage("assets_folders_list",{duration:Date.now()-o,count:i.length}),e.json){u.info(JSON.stringify(i,null,2));return}u.info(Zg(i))}catch(i){throw await n.sendError(i instanceof Error?i:new Error(String(i)),"assets_folders_list",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to list folders:`})}}re();I();C();W();Ln();te();async function Ru(e,t){let r,n;if(t.site)r=await $(),n=t.site;else{let{manifest:s}=J(),a=await he(s);r=a.accessToken,n=a.siteId}let o=A.forAssets({authToken:r,siteId:n}),i=Date.now();try{let s=await th(r,n,e,t.parent);if(await o.sendUsage("assets_folders_create",{duration:Date.now()-i}),t.json){u.info(JSON.stringify(s,null,2));return}u.info(`${O} Folder created: ${s.id}`),u.info(` Name: ${s.displayName}`),s.parentFolder&&u.info(` Parent: ${s.parentFolder}`)}catch(s){throw await o.sendError(s instanceof Error?s:new Error(String(s)),"assets_folders_create",{duration:Date.now()-i}),new f(s,{prefix:`${F} Failed to create folder:`})}}var rh=e=>{let t=e.command("assets").description("Manage Webflow site assets");t.command("list").description("List all assets for a site").addOption(We()).option("--folder <folderId>","Filter by folder ID").addOption(de()).addOption(St(["id","displayName","originalFileName","contentType","size","lastUpdated"]).default("id,displayName,lastUpdated,size")).addOption(zi()).addOption(qi()).addOption(Gi(["displayName","originalFileName","contentType","size","lastUpdated"]).default("displayName")).addOption(Ji()).action(Au),t.command("upload").description(`Upload a file as an asset. Use --dry-run to preview before uploading.
187
- Supported types: png, jpg, jpeg, gif, svg, webp, avif (\u22644 MB); pdf, doc, docx, xls, xlsx, ppt, pptx, txt, csv, odt, ods, odp, json, lottie (\u226410 MB)`).argument("<file>","Path to the file to upload (see supported types above)").addOption(We()).option("--name <displayName>","Display name for the asset (defaults to filename)").option("--folder <folderId>","Upload into a folder").addOption(Ke()).addOption(de()).action(Ou),t.command("update").description("Update an asset's metadata. Use --dry-run to preview.").argument("<assetId>","Asset ID to update").option("--alt-text <text>","Alt text for the asset").option("--display-name <name>","New display name for the asset").addOption(Ke()).addOption(de()).action(Iu);let r=t.command("folders").description("Manage asset folders");r.command("list").description("List all asset folders for a site").addOption(We()).addOption(de()).action($u),r.command("create").description("Create a new asset folder").argument("<name>","Display name for the folder").addOption(We()).option("--parent <folderId>","Parent folder ID (creates a nested folder)").addOption(de()).action(Ru)};re();I();C();W();te();se();I();ft();ft();I();async function $o(e,t,r,n){let o=[],i=0,s=100;for(;;){let a=new URL(e);a.searchParams.set("limit",String(s)),a.searchParams.set("offset",String(i));let l=await K(a.toString(),{headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(!l.ok)throw new f(`${n}: ${l.status} ${l.statusText}`);let c=await l.json(),d=c[r]??[];o.push(...d);let p=c.pagination?.total??d.length;if(i+=d.length,i>=p||d.length<s)break}return o}async function nh(e,t){V(t,"siteId");let r=await K(`${_}/v2/sites/${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok)throw new f(`Failed to get site: ${r.status} ${r.statusText}`);return await r.json()}async function oh(e){return $o(`${_}/v2/sites`,e,"sites","Failed to list sites")}async function ih(e,t){V(t,"siteId");let r=await K(`${_}/v2/sites/${t}/custom_domains`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok)throw new f(`Failed to get custom domains: ${r.status} ${r.statusText}`);return(await r.json()).customDomains??[]}async function sh(e,t,r=[],n){V(t,"siteId"),n&&V(n,"pageId");let o=r.length>0?{customDomains:r}:{publishToWebflowSubdomain:!0};n&&(o.pageId=n);let i=await K(`${_}/v2/sites/${t}/publish`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(o)});if(!i.ok)throw new f(`Failed to publish site: ${i.status} ${i.statusText}`);return await i.json()}I();ie();var Pu=["id","displayName","shortName","lastPublished","lastUpdated","timeZone"],Wv=Object.fromEntries(Pu.map(e=>[e.toLowerCase(),e]));function ah(e){let t=[],r=[];for(let n of e){let o=Wv[n.toLowerCase()];o?t.push(o):r.push(n)}return{valid:t,invalid:r}}function ju(){return Pu}function lh(e,t=["id","displayName","lastPublished"]){if(e.length===0)return S("No sites found.");if(t.length===0)throw new f(`No valid fields specified. Available: ${Pu.join(", ")}`,{isUserError:!0});let r=t.map(o=>Y(o)),n=e.map(o=>t.map(i=>{let s=o[i];return s?i==="lastPublished"||i==="lastUpdated"?new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):s:S("\u2014")}));return Ve(r,n)}function uh(e){if(e.length===0)return S("No custom domains configured.");let t=[Y("id"),Y("url"),Y("lastPublished")],r=e.map(n=>[n.id,n.url,n.lastPublished?new Date(n.lastPublished).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):S("\u2014")]);return Ve(t,r)}async function Nu(e){let t=await $(),r=A.forSites({authToken:t}),n=Date.now();try{let o=await oh(t);if(await r.sendUsage("sites_list",{duration:Date.now()-n,count:o.length}),e.json){u.info(JSON.stringify(o,null,2));return}if(o.length===0){u.info("No sites found.");return}let i=e.fields.split(",").map(l=>l.trim()),{valid:s,invalid:a}=ah(i);if(s.length===0)throw new f(`No valid fields specified. Available: ${ju().join(", ")}`,{isUserError:!0});a.length>0&&u.warn(`Unknown field(s): ${a.join(", ")}. Available: ${ju().join(", ")}`),u.info(lh(o,s))}catch(o){throw o instanceof f&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"sites_list",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to list sites:`}))}}re();I();C();W();te();async function Bu(e,t){let r=await $(),n=A.forSites({authToken:r}),o=Date.now();try{let i=await nh(r,e);if(await n.sendUsage("sites_get",{duration:Date.now()-o}),t.json){u.info(JSON.stringify(i,null,2));return}u.info(`${i.displayName} (${i.id})`),u.info(` Short name: ${i.shortName}`),u.info(` Time zone: ${i.timeZone}`),i.lastPublished&&u.info(` Published: ${new Date(i.lastPublished).toLocaleString()}`),i.previewUrl&&u.info(` Preview: ${i.previewUrl}`)}catch(i){throw i instanceof f&&i.isUserError?i:(await n.sendError(i instanceof Error?i:new Error(String(i)),"sites_get",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to get site:`}))}}re();I();C();W();te();async function Mu(e){let t=await $(),r=A.forSites({authToken:t}),n=Date.now();try{let o=await ih(t,e.site);if(await r.sendUsage("sites_domains",{duration:Date.now()-n,count:o.length}),e.json){u.info(JSON.stringify(o,null,2));return}u.info(uh(o))}catch(o){throw o instanceof f&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"sites_domains",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to get custom domains:`}))}}re();I();C();W();te();async function Lu(e){if(V(e.site,"siteId"),e.dryRun){u.info(`Would publish ${e.page?`page ${e.page} on`:"site"} ${e.site}`),e.domains?u.info(` Custom domains: ${e.domains}`):u.info(" Domains: Webflow subdomain");return}let t=await $(),r=A.forSites({authToken:t}),n=Date.now();try{let o=e.domains?e.domains.split(",").map(l=>l.trim()):[],i=await sh(t,e.site,o,e.page);if(await r.sendUsage("sites_publish",{duration:Date.now()-n,dryRun:!1,publishScope:i.publishScope}),e.json){u.info(JSON.stringify(i,null,2));return}let s=i.publishScope==="page"?"Page":"Site";u.info(`${O} ${s} published successfully`);let a=i.customDomains??[];a.length>0?a.forEach(l=>{let c=l.lastPublished?` (${new Date(l.lastPublished).toLocaleString()})`:"";u.info(` Live at: https://${l.url}${c}`)}):i.publishToWebflowSubdomain&&u.info(" Published to Webflow subdomain")}catch(o){throw o instanceof f&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"sites_publish",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to publish site:`}))}}var ch=e=>{let t=e.command("sites").description("Manage Webflow sites");t.command("list").description("List all sites in your Webflow workspace").addOption(de()).addOption(St(["id","displayName","shortName","lastPublished","lastUpdated","timeZone"]).default("id,displayName,lastPublished")).action(Nu),t.command("get").description("Get details for a specific site").argument("<siteId>","Site ID").addOption(de()).action(Bu),t.command("domains").description("List custom domains configured for a site").requiredOption("--site <siteId>","Site ID").addOption(de()).action(Mu),t.command("publish").description("Publish a Webflow site (defaults to Webflow subdomain)").requiredOption("--site <siteId>","Site ID to publish").option("--domains <domains>","Comma-separated custom domain IDs to publish to").option("--page <pageId>","Publish a single page instead of the whole site").addOption(Ke()).addOption(de()).action(Lu)};re();I();C();W();te();se();async function dh(e,t){return V(t,"siteId"),$o(`${_}/v2/sites/${t}/forms`,e,"forms","Failed to list forms")}async function fh(e,t,r){return V(t,"siteId"),V(r,"formId"),$o(`${_}/v2/sites/${t}/forms/${r}/submissions`,e,"formSubmissions","Failed to list submissions")}I();ie();var Wu=["id","displayName","name","slug","createdOn","lastUpdated"],Uv=Object.fromEntries(Wu.map(e=>[e.toLowerCase(),e]));function ph(e){let t=[],r=[];for(let n of e){let o=Uv[n.toLowerCase()];o?t.push(o):r.push(n)}return{valid:t,invalid:r}}function Uu(){return Wu}function mh(e,t=["id","displayName","slug"]){if(e.length===0)return S("No forms found.");if(t.length===0)throw new f(`No valid fields specified. Available: ${Wu.join(", ")}`,{isUserError:!0});let r=t.map(o=>Y(o)),n=e.map(o=>t.map(i=>{let s=o[i];return s?i==="createdOn"||i==="lastUpdated"?new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):s:S("\u2014")}));return Ve(r,n)}function gh(e){if(e.length===0)return S("No submissions found.");let t=Array.from(new Set(e.flatMap(o=>Object.keys(o.formResponse)))),r=["id","dateSubmitted",...t].map(o=>Y(o)),n=e.map(o=>[o.id,new Date(o.dateSubmitted).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),...t.map(i=>{let s=o.formResponse[i];return s==null?S("\u2014"):typeof s=="object"?JSON.stringify(s):String(s)})]);return Ve(r,n)}function hh(e){if(e.length===0)return"";let r=["id","formId","displayName","dateSubmitted",...Array.from(new Set(e.flatMap(i=>Object.keys(i.formResponse))))],n=i=>{let s=i==null?"":typeof i=="object"?JSON.stringify(i):String(i);return s.includes(",")||s.includes('"')||s.includes(`
183
+ `)}function zg(e,t=["id","isDraft","lastUpdated"]){if(e.length===0)return S("No items found.");let r=t.map(o=>Y(o)),n=e.map(o=>t.map(i=>{if(i==="fieldData")return JSON.stringify(o.fieldData);if(i==="isDraft")return o.isDraft?ne("draft"):R("live");if(i==="isArchived")return o.isArchived?S("archived"):"";if(i==="lastUpdated"||i==="lastPublished"||i==="createdOn"){let a=o[i];return a?new Date(a).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):S("\u2014")}let s=o[i];return s==null?S("\u2014"):String(s)}));return Ve(r,n)}I();C();W();function ys(e,t,r="asc"){return[...e].sort((n,o)=>{let i=n[t],s=o[t];if(i==null&&s==null)return 0;if(i==null)return 1;if(s==null)return-1;let a=0;return typeof i=="string"&&typeof s=="string"?a=i.localeCompare(s):typeof i=="number"&&typeof s=="number"?a=i-s:a=String(i).localeCompare(String(s)),r==="desc"?-a:a})}te();async function Du(e){let{token:t,siteId:r}=await ws(e),n=A.forCms({authToken:t,siteId:r}),o=Date.now();try{let i=await Ng(t,r);if(await n.sendUsage("cms_collections_list",{duration:Date.now()-o,count:i.length}),i.length===0){u.info("No collections found.");return}let s=["displayName","slug","lastUpdated"];if(s.includes(e.sortBy)||(u.warn(`Unknown --sort-by "${e.sortBy}". Valid fields: ${s.join(", ")}. Defaulting to displayName.`),e.sortBy="displayName"),!["asc","desc"].includes(e.order))throw new f(`Invalid --order "${e.order}". Valid values: asc, desc`,{isUserError:!0});let a=ys(i,e.sortBy,e.order);if(e.json){u.info(JSON.stringify(a,null,2));return}let l=e.fields.split(",").map(c=>c.trim());u.info(Jg(a,l))}catch(i){if(i instanceof f&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_collections_list",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to list collections:`})}}re();I();C();W();te();async function bu(e,t){let r=await $(),n=A.forCms({authToken:r}),o=Date.now();try{let i=await Bg(r,e);if(await n.sendUsage("cms_collections_get",{duration:Date.now()-o}),t.json){u.info(JSON.stringify(i,null,2));return}u.info(Gg(i))}catch(i){if(i instanceof f&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_collections_get",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to get collection:`})}}I();C();W();te();async function vu(e){let t=e.singularName??e.name,r=e.slug??e.name.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");if(e.dryRun){u.info("Dry run \u2014 would create collection:"),u.info(JSON.stringify({displayName:e.name,singularName:t,slug:r},null,2)),u.info("Dry run complete \u2014 no changes made.");return}let{token:n,siteId:o}=await ws(e),i=A.forCms({authToken:n,siteId:o}),s=Date.now();try{let a=await Mg(n,o,{displayName:e.name,singularName:t,slug:r});if(await i.sendUsage("cms_collections_create",{duration:Date.now()-s}),e.json){u.info(JSON.stringify(a,null,2));return}u.info(`${O} Collection created: ${a.id}`),u.info(` Name: ${a.displayName}`),u.info(` Slug: ${a.slug}`),u.info(`
184
+ Next: add fields with "webflow cms fields create --collection ${a.id} --name <name> --type <type>"`)}catch(a){if(a instanceof f&&a.isUserError){u.info(`${F} ${a.message}`),process.exitCode=1;return}throw await i.sendError(a instanceof Error?a:new Error(String(a)),"cms_collections_create",{duration:Date.now()-s}),new f(a,{prefix:`${F} Failed to create collection:`})}}re();I();C();W();te();async function Eu(e){if(e.dryRun){u.info("Dry run \u2014 would create field:"),u.info(JSON.stringify({collectionId:e.collection,displayName:e.name,type:e.type,isRequired:e.required??!1},null,2)),u.info("Dry run complete \u2014 no changes made.");return}let t=await $(),r=A.forCms({authToken:t}),n=Date.now();try{let o=await Lg(t,e.collection,{displayName:e.name,type:e.type,isRequired:e.required??!1});if(await r.sendUsage("cms_fields_create",{duration:Date.now()-n}),e.json){u.info(JSON.stringify(o,null,2));return}u.info(`${O} Field created: ${o.id}`),u.info(` Name: ${o.displayName}`),u.info(` Type: ${o.type}`),u.info(` Slug: ${o.slug}`)}catch(o){if(o instanceof f&&o.isUserError){u.info(`${F} ${o.message}`),process.exitCode=1;return}throw await r.sendError(o instanceof Error?o:new Error(String(o)),"cms_fields_create",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to create field:`})}}re();I();C();W();te();async function xu(e){let t=await $(),r=A.forCms({authToken:t}),n=Date.now(),o=e.limit??100,i=e.offset??0;try{let s=await hu(t,e.collection,{limit:o,offset:i,cmsLocaleId:e.locale});if(await r.sendUsage("cms_items_list",{duration:Date.now()-n,count:s.items.length}),s.items.length===0){u.info("No items found.");return}if(e.json){u.info(JSON.stringify(s,null,2));return}let a=e.fields.split(",").map(p=>p.trim());u.info(zg(s.items,a));let l=i+1,c=i+s.items.length;if(s.items.length>=o||i>0){let p=s.total>0?` of ${s.total}`:"";u.info(`
185
+ Showing ${l}\u2013${c}${p} items. Use --offset ${c} to load next page.`)}}catch(s){if(s instanceof f&&s.isUserError){u.info(`${F} ${s.message}`),process.exitCode=1;return}throw await r.sendError(s instanceof Error?s:new Error(String(s)),"cms_items_list",{duration:Date.now()-n}),new f(s,{prefix:`${F} Failed to list items:`})}}re();I();C();W();te();async function Fu(e){let t=await $(),r=A.forCms({authToken:t}),n=Date.now();try{let o=await Wg(t,e.collection,e.item,e.locale);if(await r.sendUsage("cms_items_get",{duration:Date.now()-n}),e.json){u.info(JSON.stringify(o,null,2));return}let i=o.isArchived?"archived":o.isDraft?"draft":"live";u.info(`${o.id} [${i}]`),u.info(` Last updated: ${new Date(o.lastUpdated).toLocaleString()}`),o.lastPublished&&u.info(` Last published: ${new Date(o.lastPublished).toLocaleString()}`),u.info(" Fields:"),u.info(JSON.stringify(o.fieldData,null,4).replace(/^/gm," "))}catch(o){if(o instanceof f&&o.isUserError){u.info(`${F} ${o.message}`),process.exitCode=1;return}throw await r.sendError(o instanceof Error?o:new Error(String(o)),"cms_items_get",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to get item:`})}}re();I();C();W();te();async function Cu(e){let t;try{t=JSON.parse(e.data)}catch{throw new f(`Invalid JSON for --data: ${e.data}`)}if(e.dryRun){u.info("Dry run \u2014 would create item:"),u.info(JSON.stringify({fieldData:t,isDraft:e.draft??!1},null,2)),u.info("Dry run complete \u2014 no changes made.");return}let r=await $(),n=A.forCms({authToken:r}),o=Date.now();try{let i=await wu(r,e.collection,t,e.draft??!1);if(await n.sendUsage("cms_items_create",{duration:Date.now()-o,dryRun:!1}),e.json){u.info(JSON.stringify(i,null,2));return}u.info(`${O} Item created: ${i.id}`)}catch(i){if(i instanceof f&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_items_create",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to create item:`})}}re();I();C();W();te();async function _u(e){let t;try{t=JSON.parse(e.data)}catch{throw new f(`Invalid JSON for --data: ${e.data}`)}if(e.dryRun){u.info("Dry run \u2014 would update item:"),u.info(JSON.stringify({collectionId:e.collection,itemId:e.item,fieldData:t},null,2)),u.info("Dry run complete \u2014 no changes made.");return}let r=await $(),n=A.forCms({authToken:r}),o=Date.now();try{let i=await yu(r,e.collection,e.item,t);if(await n.sendUsage("cms_items_update",{duration:Date.now()-o,dryRun:!1}),e.json){u.info(JSON.stringify(i,null,2));return}u.info(`${O} Item updated: ${i.id}`)}catch(i){if(i instanceof f&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_items_update",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to update item:`})}}re();I();C();W();te();async function ku(e){if(e.dryRun){u.info(`Dry run \u2014 would delete item ${e.item} from collection ${e.collection}`),u.info("Dry run complete \u2014 no changes made.");return}let t=await $(),r=A.forCms({authToken:t}),n=Date.now();try{await Ug(t,e.collection,e.item),await r.sendUsage("cms_items_delete",{duration:Date.now()-n,dryRun:!1}),u.info(`${O} Item deleted: ${e.item}`)}catch(o){if(o instanceof f&&o.isUserError){u.info(`${F} ${o.message}`),process.exitCode=1;return}throw await r.sendError(o instanceof Error?o:new Error(String(o)),"cms_items_delete",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to delete item:`})}}re();I();C();W();te();async function Su(e){let t=e.items.split(",").map(i=>i.trim());if(e.dryRun){u.info(`Dry run \u2014 would publish ${t.length} item(s) in collection ${e.collection}:`),t.forEach(i=>u.info(` ${i}`)),u.info("Dry run complete \u2014 no changes made.");return}let r=await $(),n=A.forCms({authToken:r}),o=Date.now();try{let i=await Vg(r,e.collection,t);if(await n.sendUsage("cms_items_publish",{duration:Date.now()-o,itemCount:t.length,dryRun:!1}),e.json){u.info(JSON.stringify(i,null,2));return}let s=i.publishedItemIds?.length??0;u.info(`${O} Published ${s} item(s)`),i.errors?.length&&i.errors.forEach(a=>u.warn(` ${a.itemId}: ${a.message}`))}catch(i){if(i instanceof f&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_items_publish",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to publish items:`})}}var qg=e=>{let t=e.command("cms").description("Manage Webflow CMS content"),r=t.command("collections").description("Manage CMS collections");r.command("list").description("List all CMS collections for a site").addOption(We()).addOption(de()).addOption(St(["id","displayName","singularName","slug","lastUpdated"]).default("id,displayName,slug")).addOption(Gi(["displayName","slug","lastUpdated"]).default("displayName")).addOption(Ji()).action(Du),r.command("get").description("Get details and field schema for a CMS collection").argument("<collectionId>","Collection ID").addOption(de()).action(bu),r.command("create").description("Create a new CMS collection on a site. Use --dry-run to preview.").addOption(We()).requiredOption("--name <displayName>","Collection display name").option("--singular-name <singularName>","Singular name (defaults to --name)").option("--slug <slug>","URL slug for the collection (auto-derived from --name if omitted)").addOption(Ke()).addOption(de()).action(vu),t.command("fields").description("Manage CMS collection fields").command("create").description("Add a field to a CMS collection. Use --dry-run to preview.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--name <displayName>","Field display name").requiredOption("--type <type>","Field type (e.g. PlainText, RichText, Number, DateTime, Link, Image, Video, Color, Bool, Option, ItemRef, ItemRefSet)").option("--required","Mark field as required").addOption(Ke()).addOption(de()).action(Eu);let o=t.command("items").description("Manage CMS items");o.command("list").description("List items in a CMS collection").requiredOption("--collection <collectionId>","Collection ID").option("--locale <cmsLocaleId>","CMS locale ID to filter by").addOption(zi()).addOption(qi()).addOption(de()).addOption(St(["id","isDraft","isArchived","lastUpdated","fieldData"]).default("id,isDraft,lastUpdated")).action(xu),o.command("get").description("Get a single CMS item by ID").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--item <itemId>","Item ID").option("--locale <cmsLocaleId>","CMS locale ID to retrieve content for").addOption(de()).action(Fu),o.command("create").description("Create a new CMS item. Use --dry-run to preview before executing.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--data <json>","Item field data as a JSON string").option("--draft","Create as draft (not published)").addOption(Ke()).addOption(de()).action(Cu),o.command("update").description("Update an existing CMS item. Use --dry-run to preview before executing.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--item <itemId>","Item ID").requiredOption("--data <json>","Updated field data as a JSON string").addOption(Ke()).addOption(de()).action(_u),o.command("delete").description("Delete a CMS item. Use --dry-run to preview before executing.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--item <itemId>","Item ID").addOption(Ke()).action(ku),o.command("publish").description("Publish one or more CMS items. Use --dry-run to preview before executing.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--items <itemIds>","Comma-separated item IDs to publish").addOption(Ke()).addOption(de()).action(Su)};re();ie();I();C();W();De();te();se();ft();I();I();ie();var Kg={png:{category:"image",maxBytes:4*1024*1024},jpeg:{category:"image",maxBytes:4*1024*1024},jpg:{category:"image",maxBytes:4*1024*1024},gif:{category:"image",maxBytes:4*1024*1024},svg:{category:"image",maxBytes:4*1024*1024},webp:{category:"image",maxBytes:4*1024*1024},avif:{category:"image",maxBytes:4*1024*1024},pdf:{category:"document",maxBytes:10*1024*1024},doc:{category:"document",maxBytes:10*1024*1024},docx:{category:"document",maxBytes:10*1024*1024},xls:{category:"document",maxBytes:10*1024*1024},xlsx:{category:"document",maxBytes:10*1024*1024},ppt:{category:"document",maxBytes:10*1024*1024},pptx:{category:"document",maxBytes:10*1024*1024},txt:{category:"document",maxBytes:10*1024*1024},csv:{category:"document",maxBytes:10*1024*1024},odt:{category:"document",maxBytes:10*1024*1024},ods:{category:"document",maxBytes:10*1024*1024},odp:{category:"document",maxBytes:10*1024*1024},json:{category:"lottie",maxBytes:10*1024*1024},lottie:{category:"lottie",maxBytes:10*1024*1024}};function Ds(e,t){let r=e.split(".").pop()?.toLowerCase()??"",n=Kg[r];if(!n){let o=Object.keys(Kg).join(", ");throw new f(`Unsupported file type ".${r}". Allowed types: ${o}`,{isUserError:!0})}if(t>n.maxBytes){let o=n.maxBytes/1048576,i=(t/(1024*1024)).toFixed(1);throw new f(`File too large: ${i} MB exceeds the ${o} MB limit for ${n.category} files.`,{isUserError:!0})}}var Tu=["id","displayName","originalFileName","contentType","size","lastUpdated"];function Zg(e,t=["id","displayName","lastUpdated","size"]){if(e.length===0)return S("No assets found.");let r=Object.fromEntries(Tu.map(l=>[l.toLowerCase(),l])),n=t.map(l=>r[l.toLowerCase()]).filter(l=>l!=null);if(n.length===0)return vt(`Invalid fields. Available: ${Tu.join(", ")}`);let o=t.filter(l=>r[l.toLowerCase()]==null),i=o.length>0?ne(`Warning: unknown field(s) ignored: ${o.join(", ")}. Available: ${Tu.join(", ")}
186
+ `):"",s=n.map(l=>Y(l)),a=e.map(l=>n.map(c=>{let d=l[c];if(d==null||c==="size"&&d===0)return S("\u2014");if(c==="size")return Wv(Number(d));if(c==="lastUpdated"){let m=new Date(String(d)),g=String(m.getMonth()+1).padStart(2,"0"),y=String(m.getDate()).padStart(2,"0"),x=String(m.getFullYear()).slice(-2),T=String(m.getHours()).padStart(2,"0"),P=String(m.getMinutes()).padStart(2,"0");return`${g}/${y}/${x} ${T}:${P}`}let p=String(d);return c==="displayName"&&p.length>40?S("\u2026")+p.slice(-39):p}));return i+Ve(s,a)}function Wv(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Yg(e){if(e.length===0)return S("No folders found.");let t=[...e].sort((o,i)=>o.displayName.localeCompare(i.displayName)),r=["id","displayName","assets","lastUpdated"].map(o=>Y(o)),n=t.map(o=>[o.id,o.displayName,String(o.assets.length),new Date(o.lastUpdated).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})]);return Ve(r,n)}async function Xg(e,t,r={}){if(V(t,"siteId"),r.folderId){V(r.folderId,"folderId");let a=await Uv(e,r.folderId),l=new Set(a.assets);if(l.size===0)return{assets:[],pagination:{total:0,limit:0,offset:0}};let c=[],d=0,p=100;for(;;){let T=await K(`${_}/v2/sites/${t}/assets?limit=${p}&offset=${d}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!T.ok)throw new f(`Failed to list assets: ${T.status} ${T.statusText}`);let P=await T.json(),Z=P.assets??[];c.push(...Z);let b=P.pagination?.total??0;if(d+=Z.length,d>=b||Z.length===0)break}let m=c.filter(T=>l.has(T.id)),g=r.offset??0,y=r.limit??m.length,x=m.slice(g,g+y);return{assets:x,pagination:{total:m.length,limit:x.length,offset:g}}}let n=new URLSearchParams;r.limit!=null&&n.set("limit",String(r.limit)),r.offset!=null&&n.set("offset",String(r.offset));let o=n.toString(),i=await K(`${_}/v2/sites/${t}/assets${o?`?${o}`:""}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!i.ok)throw new f(`Failed to list assets: ${i.status} ${i.statusText}`);let s=await i.json();return{assets:s.assets??[],pagination:s.pagination??{total:0,limit:100,offset:0}}}async function Qg(e,t,r,n,o){V(t,"siteId"),o&&V(o,"folderId");let i=ao(r);Ds(i.meta.title,i.meta.size);let s=n??i.meta.title,a={fileName:i.meta.title,fileHash:i.meta.fileHash,displayName:s};o&&(a.parentFolder=o);let l=await K(`${_}/v2/sites/${t}/assets`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(a)});if(!l.ok)throw new f(`Failed to initiate asset upload: ${l.status} ${l.statusText}`);let c=await l.json(),d={fields:c.uploadDetails,_id:c.id,s3Url:c.hostedUrl??"",url:c.uploadUrl??"",contentType:c.contentType??"",origFileName:c.originalFileName??i.meta.title,success_action_redirect:"",createdOn:"",updatedOn:""};try{await uo(i,d)}catch(p){throw await K(`${_}/v2/assets/${d._id}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}}).catch(()=>{}),p}return{id:d._id,hostedUrl:d.s3Url,displayName:s,originalFileName:i.meta.title}}async function eh(e,t,r){V(t,"assetId");let n=await K(`${_}/v2/assets/${t}`,{method:"PATCH",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(r)});if(!n.ok)throw new f(`Failed to update asset: ${n.status} ${n.statusText}`);return await n.json()}async function Uv(e,t){V(t,"folderId");let r=await K(`${_}/v2/asset_folders/${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok)throw new f(`Failed to get folder: ${r.status} ${r.statusText}`);return await r.json()}async function th(e,t){V(t,"siteId");let r=await K(`${_}/v2/sites/${t}/asset_folders`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok)throw new f(`Failed to list folders: ${r.status} ${r.statusText}`);return(await r.json()).assetFolders??[]}async function rh(e,t,r,n){V(t,"siteId"),n&&V(n,"parentFolderId");let o={displayName:r};n&&(o.parentFolder=n);let i=await K(`${_}/v2/sites/${t}/asset_folders`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(o)});if(!i.ok)throw new f(`Failed to create folder: ${i.status} ${i.statusText}`);return await i.json()}async function Au(e){let t,r;if(e.site)t=await $(),r=e.site;else{let{manifest:i}=J(),s=await he(i);t=s.accessToken,r=s.siteId}let n=A.forAssets({authToken:t,siteId:r}),o=Date.now();try{let{assets:i,pagination:s}=await Xg(t,r,{limit:e.limit,offset:e.offset,folderId:e.folder});if(await n.sendUsage("assets_list",{duration:Date.now()-o,count:i.length}),i.length===0){u.info("No assets found.");return}let a=["displayName","originalFileName","contentType","size","lastUpdated"],l=e.sortBy;a.includes(l)||(u.warn(`Unknown --sort-by "${e.sortBy}". Valid fields: ${a.join(", ")}. Defaulting to displayName.`),l="displayName");let c=e.order;["asc","desc"].includes(e.order)||(u.warn(`Unknown --order "${e.order}". Valid values: asc, desc. Defaulting to asc.`),c="asc");let d=ys(i,l,c);if(e.json){u.info(JSON.stringify({assets:d,pagination:s},null,2));return}let p=e.fields.split(",").map(g=>g.trim());u.info(Zg(d,p));let m=(e.offset??0)+i.length;m<s.total&&u.info(S(`Showing ${m} of ${s.total} assets. Use --offset ${m} to see more.`))}catch(i){throw await n.sendError(i instanceof Error?i:new Error(String(i)),"assets_list",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to list assets:`})}}re();I();C();W();De();te();async function Ou(e,t){let r=ao(e);if(Ds(r.meta.title,r.meta.size),t.dryRun){u.info(`Dry run \u2014 would upload: ${e} (validated)`),t.name&&u.info(` Display name: ${t.name}`),t.folder&&u.info(` Folder: ${t.folder}`),u.info("Dry run complete \u2014 no changes made.");return}let n,o;if(t.site)n=await $(),o=t.site;else{let{manifest:a}=J(),l=await he(a);n=l.accessToken,o=l.siteId}let i=A.forAssets({authToken:n,siteId:o}),s=Date.now();try{let a=await Qg(n,o,e,t.name,t.folder);if(await i.sendUsage("assets_upload",{duration:Date.now()-s,dryRun:!1}),t.json){u.info(JSON.stringify(a,null,2));return}u.info(`${O} Asset uploaded: ${a.id}`),a.hostedUrl&&u.info(` URL: ${a.hostedUrl}`)}catch(a){throw await i.sendError(a instanceof Error?a:new Error(String(a)),"assets_upload",{duration:Date.now()-s}),new f(a,{prefix:`${F} Failed to upload asset:`})}}re();I();C();W();te();async function Iu(e,t){if(!t.altText&&!t.displayName)throw new f("Provide at least one of --alt-text or --display-name.",{isUserError:!0});if(t.dryRun){u.info(`Dry run \u2014 would update asset: ${e}`),t.altText&&u.info(` Alt text: ${t.altText}`),t.displayName&&u.info(` Display name: ${t.displayName}`),u.info("Dry run complete \u2014 no changes made.");return}let r=await $(),n=A.forAssets({authToken:r}),o=Date.now();try{let i=await eh(r,e,{altText:t.altText,displayName:t.displayName});if(await n.sendUsage("assets_update",{duration:Date.now()-o,dryRun:!1}),t.json){u.info(JSON.stringify(i,null,2));return}u.info(`${O} Asset updated: ${i.id}`),i.displayName&&u.info(` Display name: ${i.displayName}`),i.altText&&u.info(` Alt text: ${i.altText}`)}catch(i){throw await n.sendError(i instanceof Error?i:new Error(String(i)),"assets_update",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to update asset:`})}}re();I();C();W();De();te();async function $u(e){let t,r;if(e.site)t=await $(),r=e.site;else{let{manifest:i}=J(),s=await he(i);t=s.accessToken,r=s.siteId}let n=A.forAssets({authToken:t,siteId:r}),o=Date.now();try{let i=await th(t,r);if(await n.sendUsage("assets_folders_list",{duration:Date.now()-o,count:i.length}),e.json){u.info(JSON.stringify(i,null,2));return}u.info(Yg(i))}catch(i){throw await n.sendError(i instanceof Error?i:new Error(String(i)),"assets_folders_list",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to list folders:`})}}re();I();C();W();Ln();te();async function Ru(e,t){let r,n;if(t.site)r=await $(),n=t.site;else{let{manifest:s}=J(),a=await he(s);r=a.accessToken,n=a.siteId}let o=A.forAssets({authToken:r,siteId:n}),i=Date.now();try{let s=await rh(r,n,e,t.parent);if(await o.sendUsage("assets_folders_create",{duration:Date.now()-i}),t.json){u.info(JSON.stringify(s,null,2));return}u.info(`${O} Folder created: ${s.id}`),u.info(` Name: ${s.displayName}`),s.parentFolder&&u.info(` Parent: ${s.parentFolder}`)}catch(s){throw await o.sendError(s instanceof Error?s:new Error(String(s)),"assets_folders_create",{duration:Date.now()-i}),new f(s,{prefix:`${F} Failed to create folder:`})}}var nh=e=>{let t=e.command("assets").description("Manage Webflow site assets");t.command("list").description("List all assets for a site").addOption(We()).option("--folder <folderId>","Filter by folder ID").addOption(de()).addOption(St(["id","displayName","originalFileName","contentType","size","lastUpdated"]).default("id,displayName,lastUpdated,size")).addOption(zi()).addOption(qi()).addOption(Gi(["displayName","originalFileName","contentType","size","lastUpdated"]).default("displayName")).addOption(Ji()).action(Au),t.command("upload").description(`Upload a file as an asset. Use --dry-run to preview before uploading.
187
+ Supported types: png, jpg, jpeg, gif, svg, webp, avif (\u22644 MB); pdf, doc, docx, xls, xlsx, ppt, pptx, txt, csv, odt, ods, odp, json, lottie (\u226410 MB)`).argument("<file>","Path to the file to upload (see supported types above)").addOption(We()).option("--name <displayName>","Display name for the asset (defaults to filename)").option("--folder <folderId>","Upload into a folder").addOption(Ke()).addOption(de()).action(Ou),t.command("update").description("Update an asset's metadata. Use --dry-run to preview.").argument("<assetId>","Asset ID to update").option("--alt-text <text>","Alt text for the asset").option("--display-name <name>","New display name for the asset").addOption(Ke()).addOption(de()).action(Iu);let r=t.command("folders").description("Manage asset folders");r.command("list").description("List all asset folders for a site").addOption(We()).addOption(de()).action($u),r.command("create").description("Create a new asset folder").argument("<name>","Display name for the folder").addOption(We()).option("--parent <folderId>","Parent folder ID (creates a nested folder)").addOption(de()).action(Ru)};re();I();C();W();te();se();I();ft();ft();I();async function $o(e,t,r,n){let o=[],i=0,s=100;for(;;){let a=new URL(e);a.searchParams.set("limit",String(s)),a.searchParams.set("offset",String(i));let l=await K(a.toString(),{headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(!l.ok)throw new f(`${n}: ${l.status} ${l.statusText}`);let c=await l.json(),d=c[r]??[];o.push(...d);let p=c.pagination?.total??d.length;if(i+=d.length,i>=p||d.length<s)break}return o}async function oh(e,t){V(t,"siteId");let r=await K(`${_}/v2/sites/${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok)throw new f(`Failed to get site: ${r.status} ${r.statusText}`);return await r.json()}async function ih(e){return $o(`${_}/v2/sites`,e,"sites","Failed to list sites")}async function sh(e,t){V(t,"siteId");let r=await K(`${_}/v2/sites/${t}/custom_domains`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok)throw new f(`Failed to get custom domains: ${r.status} ${r.statusText}`);return(await r.json()).customDomains??[]}async function ah(e,t,r=[],n){V(t,"siteId"),n&&V(n,"pageId");let o=r.length>0?{customDomains:r}:{publishToWebflowSubdomain:!0};n&&(o.pageId=n);let i=await K(`${_}/v2/sites/${t}/publish`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(o)});if(!i.ok)throw new f(`Failed to publish site: ${i.status} ${i.statusText}`);return await i.json()}I();ie();var Pu=["id","displayName","shortName","lastPublished","lastUpdated","timeZone"],Vv=Object.fromEntries(Pu.map(e=>[e.toLowerCase(),e]));function lh(e){let t=[],r=[];for(let n of e){let o=Vv[n.toLowerCase()];o?t.push(o):r.push(n)}return{valid:t,invalid:r}}function ju(){return Pu}function uh(e,t=["id","displayName","lastPublished"]){if(e.length===0)return S("No sites found.");if(t.length===0)throw new f(`No valid fields specified. Available: ${Pu.join(", ")}`,{isUserError:!0});let r=t.map(o=>Y(o)),n=e.map(o=>t.map(i=>{let s=o[i];return s?i==="lastPublished"||i==="lastUpdated"?new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):s:S("\u2014")}));return Ve(r,n)}function ch(e){if(e.length===0)return S("No custom domains configured.");let t=[Y("id"),Y("url"),Y("lastPublished")],r=e.map(n=>[n.id,n.url,n.lastPublished?new Date(n.lastPublished).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):S("\u2014")]);return Ve(t,r)}async function Nu(e){let t=await $(),r=A.forSites({authToken:t}),n=Date.now();try{let o=await ih(t);if(await r.sendUsage("sites_list",{duration:Date.now()-n,count:o.length}),e.json){u.info(JSON.stringify(o,null,2));return}if(o.length===0){u.info("No sites found.");return}let i=e.fields.split(",").map(l=>l.trim()),{valid:s,invalid:a}=lh(i);if(s.length===0)throw new f(`No valid fields specified. Available: ${ju().join(", ")}`,{isUserError:!0});a.length>0&&u.warn(`Unknown field(s): ${a.join(", ")}. Available: ${ju().join(", ")}`),u.info(uh(o,s))}catch(o){throw o instanceof f&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"sites_list",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to list sites:`}))}}re();I();C();W();te();async function Bu(e,t){let r=await $(),n=A.forSites({authToken:r}),o=Date.now();try{let i=await oh(r,e);if(await n.sendUsage("sites_get",{duration:Date.now()-o}),t.json){u.info(JSON.stringify(i,null,2));return}u.info(`${i.displayName} (${i.id})`),u.info(` Short name: ${i.shortName}`),u.info(` Time zone: ${i.timeZone}`),i.lastPublished&&u.info(` Published: ${new Date(i.lastPublished).toLocaleString()}`),i.previewUrl&&u.info(` Preview: ${i.previewUrl}`)}catch(i){throw i instanceof f&&i.isUserError?i:(await n.sendError(i instanceof Error?i:new Error(String(i)),"sites_get",{duration:Date.now()-o}),new f(i,{prefix:`${F} Failed to get site:`}))}}re();I();C();W();te();async function Mu(e){let t=await $(),r=A.forSites({authToken:t}),n=Date.now();try{let o=await sh(t,e.site);if(await r.sendUsage("sites_domains",{duration:Date.now()-n,count:o.length}),e.json){u.info(JSON.stringify(o,null,2));return}u.info(ch(o))}catch(o){throw o instanceof f&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"sites_domains",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to get custom domains:`}))}}re();I();C();W();te();async function Lu(e){if(V(e.site,"siteId"),e.dryRun){u.info(`Would publish ${e.page?`page ${e.page} on`:"site"} ${e.site}`),e.domains?u.info(` Custom domains: ${e.domains}`):u.info(" Domains: Webflow subdomain");return}let t=await $(),r=A.forSites({authToken:t}),n=Date.now();try{let o=e.domains?e.domains.split(",").map(l=>l.trim()):[],i=await ah(t,e.site,o,e.page);if(await r.sendUsage("sites_publish",{duration:Date.now()-n,dryRun:!1,publishScope:i.publishScope}),e.json){u.info(JSON.stringify(i,null,2));return}let s=i.publishScope==="page"?"Page":"Site";u.info(`${O} ${s} published successfully`);let a=i.customDomains??[];a.length>0?a.forEach(l=>{let c=l.lastPublished?` (${new Date(l.lastPublished).toLocaleString()})`:"";u.info(` Live at: https://${l.url}${c}`)}):i.publishToWebflowSubdomain&&u.info(" Published to Webflow subdomain")}catch(o){throw o instanceof f&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"sites_publish",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to publish site:`}))}}var dh=e=>{let t=e.command("sites").description("Manage Webflow sites");t.command("list").description("List all sites in your Webflow workspace").addOption(de()).addOption(St(["id","displayName","shortName","lastPublished","lastUpdated","timeZone"]).default("id,displayName,lastPublished")).action(Nu),t.command("get").description("Get details for a specific site").argument("<siteId>","Site ID").addOption(de()).action(Bu),t.command("domains").description("List custom domains configured for a site").requiredOption("--site <siteId>","Site ID").addOption(de()).action(Mu),t.command("publish").description("Publish a Webflow site (defaults to Webflow subdomain)").requiredOption("--site <siteId>","Site ID to publish").option("--domains <domains>","Comma-separated custom domain IDs to publish to").option("--page <pageId>","Publish a single page instead of the whole site").addOption(Ke()).addOption(de()).action(Lu)};re();I();C();W();te();se();async function fh(e,t){return V(t,"siteId"),$o(`${_}/v2/sites/${t}/forms`,e,"forms","Failed to list forms")}async function ph(e,t,r){return V(t,"siteId"),V(r,"formId"),$o(`${_}/v2/sites/${t}/forms/${r}/submissions`,e,"formSubmissions","Failed to list submissions")}I();ie();var Wu=["id","displayName","name","slug","createdOn","lastUpdated"],Hv=Object.fromEntries(Wu.map(e=>[e.toLowerCase(),e]));function mh(e){let t=[],r=[];for(let n of e){let o=Hv[n.toLowerCase()];o?t.push(o):r.push(n)}return{valid:t,invalid:r}}function Uu(){return Wu}function gh(e,t=["id","displayName","slug"]){if(e.length===0)return S("No forms found.");if(t.length===0)throw new f(`No valid fields specified. Available: ${Wu.join(", ")}`,{isUserError:!0});let r=t.map(o=>Y(o)),n=e.map(o=>t.map(i=>{let s=o[i];return s?i==="createdOn"||i==="lastUpdated"?new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):s:S("\u2014")}));return Ve(r,n)}function hh(e){if(e.length===0)return S("No submissions found.");let t=Array.from(new Set(e.flatMap(o=>Object.keys(o.formResponse)))),r=["id","dateSubmitted",...t].map(o=>Y(o)),n=e.map(o=>[o.id,new Date(o.dateSubmitted).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),...t.map(i=>{let s=o.formResponse[i];return s==null?S("\u2014"):typeof s=="object"?JSON.stringify(s):String(s)})]);return Ve(r,n)}function wh(e){if(e.length===0)return"";let r=["id","formId","displayName","dateSubmitted",...Array.from(new Set(e.flatMap(i=>Object.keys(i.formResponse))))],n=i=>{let s=i==null?"":typeof i=="object"?JSON.stringify(i):String(i);return s.includes(",")||s.includes('"')||s.includes(`
188
188
  `)?`"${s.replace(/"/g,'""')}"`:s};return[r.join(","),...e.map(i=>r.map(s=>n(s==="id"?i.id:s==="formId"?i.formId:s==="displayName"?i.displayName:s==="dateSubmitted"?i.dateSubmitted:i.formResponse[s])).join(","))].join(`
189
- `)}async function Vu(e){V(e.site,"siteId");let t=await $(),r=A.forForms({authToken:t}),n=Date.now();try{let o=await dh(t,e.site);if(await r.sendUsage("forms_list",{duration:Date.now()-n,count:o.length}),e.json){u.info(JSON.stringify(o,null,2));return}if(o.length===0){u.info("No forms found.");return}let i=e.fields.split(",").map(l=>l.trim()),{valid:s,invalid:a}=ph(i);if(s.length===0)throw new f(`No valid fields specified. Available: ${Uu().join(", ")}`,{isUserError:!0});a.length>0&&u.warn(`Unknown field(s): ${a.join(", ")}. Available: ${Uu().join(", ")}`),u.info(mh(o,s))}catch(o){throw o instanceof f&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"forms_list",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to list forms:`}))}}var wh=h(require("fs"));re();I();C();W();te();async function Hu(e){V(e.site,"siteId"),V(e.form,"formId"),e.output&&e.json&&u.warn("--json is ignored when --output is set.");let t=await $(),r=A.forForms({authToken:t}),n=Date.now();try{let o=await fh(t,e.site,e.form);if(await r.sendUsage("forms_submissions",{duration:Date.now()-n,count:o.length}),o.length===0){u.info("No submissions found.");return}if(e.output){let i=hh(o);wh.default.writeFileSync(e.output,i,"utf8"),u.info(`${O} ${o.length} submission${o.length===1?"":"s"} written to ${e.output}`);return}if(e.json){u.info(JSON.stringify(o,null,2));return}u.info(gh(o))}catch(o){throw await r.sendError(o instanceof Error?o:new Error(String(o)),"forms_submissions",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to fetch submissions:`})}}var yh=e=>{let t=e.command("forms").description("Manage Webflow forms");t.command("list").description("List all forms for a site").addOption(We()).addOption(de()).addOption(St(["id","displayName","name","slug","createdOn","lastUpdated"]).default("id,displayName,slug")).action(Vu),t.command("submissions").description("List or export form submissions").requiredOption("--site <siteId>","Site ID").requiredOption("--form <formId>","Form ID").option("--json","Output as JSON").option("--output <file>","Save submissions as CSV to a file").action(Hu)};var bh=h(Zo());function Ju(e,t){t.forEach(r=>{e.addOption(r())}),e.commands.forEach(r=>Ju(r,t))}function vh(e){let t=bh.default.version;e.name("webflow").description("Webflow CLI").version(t,"-v, --version").configureHelp({formatHelp(r,n){return Dh.Help.prototype.formatHelp.call(this,r,n).split(`
189
+ `)}async function Vu(e){V(e.site,"siteId");let t=await $(),r=A.forForms({authToken:t}),n=Date.now();try{let o=await fh(t,e.site);if(await r.sendUsage("forms_list",{duration:Date.now()-n,count:o.length}),e.json){u.info(JSON.stringify(o,null,2));return}if(o.length===0){u.info("No forms found.");return}let i=e.fields.split(",").map(l=>l.trim()),{valid:s,invalid:a}=mh(i);if(s.length===0)throw new f(`No valid fields specified. Available: ${Uu().join(", ")}`,{isUserError:!0});a.length>0&&u.warn(`Unknown field(s): ${a.join(", ")}. Available: ${Uu().join(", ")}`),u.info(gh(o,s))}catch(o){throw o instanceof f&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"forms_list",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to list forms:`}))}}var yh=h(require("fs"));re();I();C();W();te();async function Hu(e){V(e.site,"siteId"),V(e.form,"formId"),e.output&&e.json&&u.warn("--json is ignored when --output is set.");let t=await $(),r=A.forForms({authToken:t}),n=Date.now();try{let o=await ph(t,e.site,e.form);if(await r.sendUsage("forms_submissions",{duration:Date.now()-n,count:o.length}),o.length===0){u.info("No submissions found.");return}if(e.output){let i=wh(o);yh.default.writeFileSync(e.output,i,"utf8"),u.info(`${O} ${o.length} submission${o.length===1?"":"s"} written to ${e.output}`);return}if(e.json){u.info(JSON.stringify(o,null,2));return}u.info(hh(o))}catch(o){throw await r.sendError(o instanceof Error?o:new Error(String(o)),"forms_submissions",{duration:Date.now()-n}),new f(o,{prefix:`${F} Failed to fetch submissions:`})}}var Dh=e=>{let t=e.command("forms").description("Manage Webflow forms");t.command("list").description("List all forms for a site").addOption(We()).addOption(de()).addOption(St(["id","displayName","name","slug","createdOn","lastUpdated"]).default("id,displayName,slug")).action(Vu),t.command("submissions").description("List or export form submissions").requiredOption("--site <siteId>","Site ID").requiredOption("--form <formId>","Form ID").option("--json","Output as JSON").option("--output <file>","Save submissions as CSV to a file").action(Hu)};var vh=h(Zo());function Ju(e,t){t.forEach(r=>{e.addOption(r())}),e.commands.forEach(r=>Ju(r,t))}function Eh(e){let t=vh.default.version;e.name("webflow").description("Webflow CLI").version(t,"-v, --version").configureHelp({formatHelp(r,n){return bh.Help.prototype.formatHelp.call(this,r,n).split(`
190
190
  `).flatMap(o=>o.startsWith("Usage:")?["",Y(o)]:/^(Options:|Commands:|Arguments:)/.test(o)?[Y(o)]:/^Webflow CLI$/.test(o)?[Ku(o)]:o.trim()===""?[o]:[S(o)]).map(o=>o.trim()===""?o:` ${o}`).join(`
191
191
  `)+`
192
- `}}).addOption($l()).addOption(Rl()).addOption(Pl()).addOption(jl()).showHelpAfterError(),e.hook("preAction",async r=>{let n=r.opts();n.input||Xc(!0),xt.start(),n.manifest&&Qc(n.manifest);try{await A.promptForConsentIfNeeded()}catch(o){u.debug(`Failed to check telemetry preference: ${o}`)}try{n.skipUpdateCheck||await new Yn().prompt()}catch(o){u.debug(`Failed to check for package updates: ${o}`)}}),e.hook("postAction",async()=>{xt.displayGrouped(),xt.stop()}),Wd(e),zg(e),yf(e),dm(e),Pg(e),cm(e),rh(e),ch(e),yh(e),im(e),e.commands.forEach(r=>{Ju(r,[$l,Rl,Pl,jl])})}C();I();var xh=new Eh.Command;vh(xh);xh.parseAsync().catch(e=>{if(e instanceof f){if(!e.skipLogging)if(e.isUserError){let t=e.prefix?`${e.prefix} `:"";console.error(`${t}${e.message}`)}else u.error(e,{prefix:e.prefix})}else u.error(e);process.exit(1)});
192
+ `}}).addOption($l()).addOption(Rl()).addOption(Pl()).addOption(jl()).showHelpAfterError(),e.hook("preAction",async r=>{let n=r.opts();n.input||Xc(!0),xt.start(),n.manifest&&Qc(n.manifest);try{await A.promptForConsentIfNeeded()}catch(o){u.debug(`Failed to check telemetry preference: ${o}`)}try{n.skipUpdateCheck||await new Yn().prompt()}catch(o){u.debug(`Failed to check for package updates: ${o}`)}}),e.hook("postAction",async()=>{xt.displayGrouped(),xt.stop()}),Wd(e),qg(e),yf(e),dm(e),jg(e),cm(e),nh(e),dh(e),Dh(e),im(e),e.commands.forEach(r=>{Ju(r,[$l,Rl,Pl,jl])})}C();I();var Fh=new xh.Command;Eh(Fh);Fh.parseAsync().catch(e=>{if(e instanceof f){if(!e.skipLogging)if(e.isUserError){let t=e.prefix?`${e.prefix} `:"";console.error(`${t}${e.message}`)}else u.error(e,{prefix:e.prefix})}else u.error(e);process.exit(1)});
193
193
  //# sourceMappingURL=index.js.map