@nnao45/figma-use 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +991 -0
- package/LICENSE +22 -0
- package/README.md +569 -0
- package/SKILL.md +683 -0
- package/bin/figma-use.js +9 -0
- package/dist/cli/index.js +496 -0
- package/package.json +87 -0
- package/packages/cli/src/render/component-set.tsx +157 -0
- package/packages/cli/src/render/components.tsx +115 -0
- package/packages/cli/src/render/icon.ts +166 -0
- package/packages/cli/src/render/index.ts +47 -0
- package/packages/cli/src/render/jsx-dev-runtime.ts +6 -0
- package/packages/cli/src/render/jsx-runtime.ts +90 -0
- package/packages/cli/src/render/mini-react.ts +33 -0
- package/packages/cli/src/render/render-from-string.ts +121 -0
- package/packages/cli/src/render/render-jsx.ts +44 -0
- package/packages/cli/src/render/tree.ts +148 -0
- package/packages/cli/src/render/vars.ts +186 -0
- package/packages/cli/src/render/widget-renderer.ts +163 -0
- package/packages/plugin/src/main.ts +2747 -0
- package/packages/plugin/src/query.ts +253 -0
- package/packages/plugin/src/rpc.ts +5238 -0
- package/packages/plugin/src/ui.html +25 -0
- package/packages/plugin/src/ui.ts +74 -0
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
import{createRequire as i_}from"node:module";var aC=Object.create;var{getPrototypeOf:sC,defineProperty:Ru,getOwnPropertyNames:qv,getOwnPropertyDescriptor:r_}=Object,hv=Object.prototype.hasOwnProperty;var ft=(r,t,u)=>{u=r!=null?aC(sC(r)):{};let D=t||!r||!r.__esModule?Ru(u,"default",{value:r,enumerable:!0}):u;for(let i of qv(r))if(!hv.call(D,i))Ru(D,i,{get:()=>r[i],enumerable:!0});return D},Bv=new WeakMap,t_=(r)=>{var t=Bv.get(r),u;if(t)return t;if(t=Ru({},"__esModule",{value:!0}),r&&typeof r==="object"||typeof r==="function")qv(r).map((D)=>!hv.call(t,D)&&Ru(t,D,{get:()=>r[D],enumerable:!(u=r_(r,D))||u.enumerable}));return Bv.set(r,t),t},s=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var Or=(r,t)=>{for(var u in t)Ru(r,u,{get:t[u],enumerable:!0,configurable:!0,set:(D)=>t[u]=()=>D})};var k=(r,t)=>()=>(r&&(t=r(r=0)),t);var it=i_(import.meta.url);function jf(r){if(r===null||typeof r!=="object")return!1;let t=Object.getPrototypeOf(r);if(t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null)return!1;if(Symbol.iterator in r)return!1;if(Symbol.toStringTag in r)return Object.prototype.toString.call(r)==="[object Module]";return!0}function Tf(r,t,u=".",D){if(!jf(t))return Tf(r,{},u,D);let i=Object.assign({},t);for(let n in r){if(n==="__proto__"||n==="constructor")continue;let o=r[n];if(o===null||o===void 0)continue;if(D&&D(i,n,o,u))continue;if(Array.isArray(o)&&Array.isArray(i[n]))i[n]=[...o,...i[n]];else if(jf(o)&&jf(i[n]))i[n]=Tf(o,i[n],(u?`${u}.`:"")+n.toString(),D);else i[n]=o}return i}function u_(r){return(...t)=>t.reduce((u,D)=>Tf(u,D,"",r),{})}function n_(r){return Object.prototype.toString.call(r)==="[object Object]"}function o_(r){if(!n_(r))return!1;if(!r.message&&!r.args)return!1;if(r.stack)return!1;return!0}class Xr{options;_lastLog;_mockFn;constructor(r={}){let t=r.types||Yf;this.options=D_({...r,defaults:{...r.defaults},level:Wf(r.level,t),reporters:[...r.reporters||[]]},{types:Yf,throttle:1000,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let u in t){let D={type:u,...this.options.defaults,...t[u]};this[u]=this._wrapLogFn(D),this[u].raw=this._wrapLogFn(D,!0)}if(this.options.mockFn)this.mockTypes();this._lastLog={}}get level(){return this.options.level}set level(r){this.options.level=Wf(r,this.options.types,this.options.level)}prompt(r,t){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(r,t)}create(r){let t=new Xr({...this.options,...r});if(this._mockFn)t.mockTypes(this._mockFn);return t}withDefaults(r){return this.create({...this.options,defaults:{...this.options.defaults,...r}})}withTag(r){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+r:r})}addReporter(r){return this.options.reporters.push(r),this}removeReporter(r){if(r){let t=this.options.reporters.indexOf(r);if(t!==-1)return this.options.reporters.splice(t,1)}else this.options.reporters.splice(0);return this}setReporters(r){return this.options.reporters=Array.isArray(r)?r:[r],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let r in this.options.types){if(!console["__"+r])console["__"+r]=console[r];console[r]=this[r].raw}}restoreConsole(){for(let r in this.options.types)if(console["__"+r])console[r]=console["__"+r],delete console["__"+r]}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(r,t){if(!r)return;if(!r.__write)r.__write=r.write;r.write=(u)=>{this[t].raw(String(u).trim())}}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(r){if(!r)return;if(r.__write)r.write=r.__write,delete r.__write}pauseLogs(){Gf=!0}resumeLogs(){Gf=!1;let r=zv.splice(0);for(let t of r)t[0]._logFn(t[1],t[2])}mockTypes(r){let t=r||this.options.mockFn;if(this._mockFn=t,typeof t!=="function")return;for(let u in this.options.types)this[u]=t(u,this.options.types[u])||this[u],this[u].raw=this[u]}_wrapLogFn(r,t){return(...u)=>{if(Gf){zv.push([this,r,u,t]);return}return this._logFn(r,u,t)}}_logFn(r,t,u){if((r.level||0)>this.level)return!1;let D={date:new Date,args:[],...r,level:Wf(r.level,this.options.types)};if(!u&&t.length===1&&o_(t[0]))Object.assign(D,t[0]);else D.args=[...t];if(D.message)D.args.unshift(D.message),delete D.message;if(D.additional){if(!Array.isArray(D.additional))D.additional=D.additional.split(`
|
|
2
|
+
`);D.args.push(`
|
|
3
|
+
`+D.additional.join(`
|
|
4
|
+
`)),delete D.additional}D.type=typeof D.type==="string"?D.type.toLowerCase():"log",D.tag=typeof D.tag==="string"?D.tag:"";let i=(o=!1)=>{let e=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&e>0){let f=[...this._lastLog.object.args];if(e>1)f.push(`(repeated ${e} times)`);this._log({...this._lastLog.object,args:f}),this._lastLog.count=1}if(o)this._lastLog.object=D,this._log(D)};clearTimeout(this._lastLog.timeout);let n=this._lastLog.time&&D.date?D.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=D.date,n<this.options.throttle)try{let o=JSON.stringify([D.type,D.tag,D.args]),e=this._lastLog.serialized===o;if(this._lastLog.serialized=o,e){if(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin){this._lastLog.timeout=setTimeout(i,this.options.throttle);return}}}catch{}i(!0)}_log(r){for(let t of this.options.reporters)t.log(r,{options:this.options})}}function Wf(r,t={},u=3){if(r===void 0)return u;if(typeof r==="number")return r;if(t[r]&&t[r].level!==void 0)return t[r].level;return u}function Jv(r={}){return new Xr(r)}var Wr,Yf,D_,Gf=!1,zv;var Rf=k(()=>{Wr={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},Yf={silent:{level:-1},fatal:{level:Wr.fatal},error:{level:Wr.error},warn:{level:Wr.warn},log:{level:Wr.log},info:{level:Wr.info},success:{level:Wr.success},fail:{level:Wr.fail},ready:{level:Wr.info},start:{level:Wr.info},box:{level:Wr.info},debug:{level:Wr.debug},trace:{level:Wr.trace},verbose:{level:Wr.verbose}};D_=u_();zv=[];Xr.prototype.add=Xr.prototype.addReporter;Xr.prototype.remove=Xr.prototype.removeReporter;Xr.prototype.clear=Xr.prototype.removeReporter;Xr.prototype.withScope=Xr.prototype.withTag;Xr.prototype.mock=Xr.prototype.mockTypes;Xr.prototype.pause=Xr.prototype.pauseLogs;Xr.prototype.resume=Xr.prototype.resumeLogs});import{formatWithOptions as Av}from"node:util";import{sep as e_}from"node:path";function Sf(r,t){let u=process.cwd()+e_;return r.split(`
|
|
5
|
+
`).splice(t.split(`
|
|
6
|
+
`).length).map((i)=>i.trim().replace("file://","").replace(u,""))}function f_(r,t){return(t.__write||t.write).call(t,r)}class ln{formatStack(r,t,u){let D=" ".repeat((u?.errorLevel||0)+1);return D+Sf(r,t).join(`
|
|
7
|
+
${D}`)}formatError(r,t){let u=r.message??Av(t,r),D=r.stack?this.formatStack(r.stack,u,t):"",i=t?.errorLevel||0,n=i>0?`${" ".repeat(i)}[cause]: `:"",o=r.cause?`
|
|
8
|
+
|
|
9
|
+
`+this.formatError(r.cause,{...t,errorLevel:i+1}):"";return n+u+`
|
|
10
|
+
`+D+o}formatArgs(r,t){let u=r.map((D)=>{if(D&&typeof D.stack==="string")return this.formatError(D,t);return D});return Av(t,...u)}formatDate(r,t){return t.date?r.toLocaleTimeString():""}filterAndJoin(r){return r.filter(Boolean).join(" ")}formatLogObj(r,t){let u=this.formatArgs(r.args,t);if(r.type==="box")return`
|
|
11
|
+
`+[Vf(r.tag),r.title&&r.title,...u.split(`
|
|
12
|
+
`)].filter(Boolean).map((D)=>" > "+D).join(`
|
|
13
|
+
`)+`
|
|
14
|
+
`;return this.filterAndJoin([Vf(r.type),Vf(r.tag),u])}log(r,t){let u=this.formatLogObj(r,{columns:t.options.stdout.columns||0,...t.options.formatOptions});return f_(u+`
|
|
15
|
+
`,r.level<2?t.options.stderr||process.stderr:t.options.stdout||process.stdout)}}var Vf=(r)=>r?`[${r}]`:"";var Xv=()=>{};import*as mn from"node:tty";function Tv(r,t,u,D,i=t.slice(0,Math.max(0,r))+D,n=t.slice(Math.max(0,r+u.length)),o=n.indexOf(u)){return i+(o<0?n:Tv(o,n,u,D))}function g_(r,t,u,D,i){return r<0?u+t+D:u+Tv(r,t,D,i)+D}function w_(r,t,u=r,D=r.length+1){return(i)=>i||!(i===""||i===void 0)?g_((""+i).indexOf(t,D),i,r,t,u):""}function tr(r,t,u){return w_(`\x1B[${r}m`,`\x1B[${t}m`,u)}function b_(r=F_){return r?jv:Object.fromEntries(Object.keys(jv).map((t)=>[t,String]))}function Rv(r,t="reset"){return Cr[r]||Cr[t]}function Bt(r){return r.replace(new RegExp(C_,"g"),"")}function Qf(r,t={}){let u={...t,style:{...__,...t.style}},D=r.split(`
|
|
16
|
+
`),i=[],n=Rv(u.style.borderColor),o={...typeof u.style.borderStyle==="string"?Gv[u.style.borderStyle]||Gv.solid:u.style.borderStyle};if(n)for(let g in o)o[g]=n(o[g]);let e=u.style.padding%2===0?u.style.padding:u.style.padding+1,f=D.length+e,$=Math.max(...D.map((g)=>Bt(g).length),u.title?Bt(u.title).length:0)+e,l=$+e,m=u.style.marginLeft>0?" ".repeat(u.style.marginLeft):"";if(u.style.marginTop>0)i.push("".repeat(u.style.marginTop));if(u.title){let g=n?n(u.title):u.title,_=o.h.repeat(Math.floor(($-Bt(u.title).length)/2)),q=o.h.repeat($-Bt(u.title).length-Bt(_).length+e);i.push(`${m}${o.tl}${_}${g}${q}${o.tr}`)}else i.push(`${m}${o.tl}${o.h.repeat(l)}${o.tr}`);let c=u.style.valign==="center"?Math.floor((f-D.length)/2):u.style.valign==="top"?f-D.length-e:f-D.length;for(let g=0;g<f;g++)if(g<c||g>=c+D.length)i.push(`${m}${o.v}${" ".repeat(l)}${o.v}`);else{let _=D[g-c],q=" ".repeat(e),y=" ".repeat($-Bt(_).length);i.push(`${m}${o.v}${q}${_}${y}${o.v}`)}if(i.push(`${m}${o.bl}${o.h.repeat(l)}${o.br}`),u.style.marginBottom>0)i.push("".repeat(u.style.marginBottom));return i.join(`
|
|
17
|
+
`)}var Qt,Wv,$_,l_,m_,c_,Yv,v_,E_,F_,jv,Cr,C_,Gv,__;var cn=k(()=>{({env:Qt={},argv:Wv=[],platform:$_=""}=typeof process==="undefined"?{}:process),l_="NO_COLOR"in Qt||Wv.includes("--no-color"),m_="FORCE_COLOR"in Qt||Wv.includes("--color"),c_=$_==="win32",Yv=Qt.TERM==="dumb",v_=mn&&mn.isatty&&mn.isatty(1)&&Qt.TERM&&!Yv,E_="CI"in Qt&&(("GITHUB_ACTIONS"in Qt)||("GITLAB_CI"in Qt)||("CIRCLECI"in Qt)),F_=!l_&&(m_||c_&&!Yv||v_||E_);jv={reset:tr(0,0),bold:tr(1,22,"\x1B[22m\x1B[1m"),dim:tr(2,22,"\x1B[22m\x1B[2m"),italic:tr(3,23),underline:tr(4,24),inverse:tr(7,27),hidden:tr(8,28),strikethrough:tr(9,29),black:tr(30,39),red:tr(31,39),green:tr(32,39),yellow:tr(33,39),blue:tr(34,39),magenta:tr(35,39),cyan:tr(36,39),white:tr(37,39),gray:tr(90,39),bgBlack:tr(40,49),bgRed:tr(41,49),bgGreen:tr(42,49),bgYellow:tr(43,49),bgBlue:tr(44,49),bgMagenta:tr(45,49),bgCyan:tr(46,49),bgWhite:tr(47,49),blackBright:tr(90,39),redBright:tr(91,39),greenBright:tr(92,39),yellowBright:tr(93,39),blueBright:tr(94,39),magentaBright:tr(95,39),cyanBright:tr(96,39),whiteBright:tr(97,39),bgBlackBright:tr(100,49),bgRedBright:tr(101,49),bgGreenBright:tr(102,49),bgYellowBright:tr(103,49),bgBlueBright:tr(104,49),bgMagentaBright:tr(105,49),bgCyanBright:tr(106,49),bgWhiteBright:tr(107,49)};Cr=b_();C_=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");Gv={solid:{tl:"┌",tr:"┐",bl:"└",br:"┘",h:"─",v:"│"},double:{tl:"╔",tr:"╗",bl:"╚",br:"╝",h:"═",v:"║"},doubleSingle:{tl:"╓",tr:"╖",bl:"╙",br:"╜",h:"─",v:"║"},doubleSingleRounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"─",v:"║"},singleThick:{tl:"┏",tr:"┓",bl:"┗",br:"┛",h:"━",v:"┃"},singleDouble:{tl:"╒",tr:"╕",bl:"╘",br:"╛",h:"═",v:"│"},singleDoubleRounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"═",v:"│"},rounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"─",v:"│"}},__={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1}});var $4={};Or($4,{prompt:()=>f4,kCancel:()=>e4});import $t,{stdin as I_,stdout as U_}from"node:process";import Vv from"node:readline";import{WriteStream as O_}from"node:tty";function y_(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function N_(){if(Sv)return Kf;Sv=1;let r="\x1B",t=`${r}[`,u="\x07",D={to(o,e){if(!e)return`${t}${o+1}G`;return`${t}${e+1};${o+1}H`},move(o,e){let f="";if(o<0)f+=`${t}${-o}D`;else if(o>0)f+=`${t}${o}C`;if(e<0)f+=`${t}${-e}A`;else if(e>0)f+=`${t}${e}B`;return f},up:(o=1)=>`${t}${o}A`,down:(o=1)=>`${t}${o}B`,forward:(o=1)=>`${t}${o}C`,backward:(o=1)=>`${t}${o}D`,nextLine:(o=1)=>`${t}E`.repeat(o),prevLine:(o=1)=>`${t}F`.repeat(o),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${r}7`,restore:`${r}8`},i={up:(o=1)=>`${t}S`.repeat(o),down:(o=1)=>`${t}T`.repeat(o)},n={screen:`${t}2J`,up:(o=1)=>`${t}1J`.repeat(o),down:(o=1)=>`${t}J`.repeat(o),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(o){let e="";for(let f=0;f<o;f++)e+=this.line+(f<o-1?D.up():"");if(o)e+=D.left;return e}};return Kf={cursor:D,scroll:i,erase:n,beep:u},Kf}function B_(){if(Qv)return vn.exports;Qv=1;let r=process||{},t=r.argv||[],u=r.env||{},D=!(!!u.NO_COLOR||t.includes("--no-color"))&&(!!u.FORCE_COLOR||t.includes("--color")||r.platform==="win32"||(r.stdout||{}).isTTY&&u.TERM!=="dumb"||!!u.CI),i=(e,f,$=e)=>(l)=>{let m=""+l,c=m.indexOf(f,e.length);return~c?e+n(m,f,$,c)+f:e+m+f},n=(e,f,$,l)=>{let m="",c=0;do m+=e.substring(c,l)+$,c=l+f.length,l=e.indexOf(f,c);while(~l);return m+e.substring(c)},o=(e=D)=>{let f=e?i:()=>String;return{isColorSupported:e,reset:f("\x1B[0m","\x1B[0m"),bold:f("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:f("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:f("\x1B[3m","\x1B[23m"),underline:f("\x1B[4m","\x1B[24m"),inverse:f("\x1B[7m","\x1B[27m"),hidden:f("\x1B[8m","\x1B[28m"),strikethrough:f("\x1B[9m","\x1B[29m"),black:f("\x1B[30m","\x1B[39m"),red:f("\x1B[31m","\x1B[39m"),green:f("\x1B[32m","\x1B[39m"),yellow:f("\x1B[33m","\x1B[39m"),blue:f("\x1B[34m","\x1B[39m"),magenta:f("\x1B[35m","\x1B[39m"),cyan:f("\x1B[36m","\x1B[39m"),white:f("\x1B[37m","\x1B[39m"),gray:f("\x1B[90m","\x1B[39m"),bgBlack:f("\x1B[40m","\x1B[49m"),bgRed:f("\x1B[41m","\x1B[49m"),bgGreen:f("\x1B[42m","\x1B[49m"),bgYellow:f("\x1B[43m","\x1B[49m"),bgBlue:f("\x1B[44m","\x1B[49m"),bgMagenta:f("\x1B[45m","\x1B[49m"),bgCyan:f("\x1B[46m","\x1B[49m"),bgWhite:f("\x1B[47m","\x1B[49m"),blackBright:f("\x1B[90m","\x1B[39m"),redBright:f("\x1B[91m","\x1B[39m"),greenBright:f("\x1B[92m","\x1B[39m"),yellowBright:f("\x1B[93m","\x1B[39m"),blueBright:f("\x1B[94m","\x1B[39m"),magentaBright:f("\x1B[95m","\x1B[39m"),cyanBright:f("\x1B[96m","\x1B[39m"),whiteBright:f("\x1B[97m","\x1B[39m"),bgBlackBright:f("\x1B[100m","\x1B[49m"),bgRedBright:f("\x1B[101m","\x1B[49m"),bgGreenBright:f("\x1B[102m","\x1B[49m"),bgYellowBright:f("\x1B[103m","\x1B[49m"),bgBlueBright:f("\x1B[104m","\x1B[49m"),bgMagentaBright:f("\x1B[105m","\x1B[49m"),bgCyanBright:f("\x1B[106m","\x1B[49m"),bgWhiteBright:f("\x1B[107m","\x1B[49m")}};return vn.exports=o(),vn.exports.createColors=o,vn.exports}function h_({onlyFirst:r=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,r?void 0:"g")}function av(r){if(typeof r!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(z_,"")}function sv(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Vu(r,t={}){if(typeof r!="string"||r.length===0||(t={ambiguousIsNarrow:!0,...t},r=av(r),r.length===0))return 0;r=r.replace(j_()," ");let u=t.ambiguousIsNarrow?1:2,D=0;for(let i of r){let n=i.codePointAt(0);if(n<=31||n>=127&&n<=159||n>=768&&n<=879)continue;switch(A_.eastAsianWidth(i)){case"F":case"W":D+=2;break;case"A":D+=u;break;default:D+=1}}return D}function Y_(){let r=new Map;for(let[t,u]of Object.entries(yr)){for(let[D,i]of Object.entries(u))yr[D]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},u[D]=yr[D],r.set(i[0],i[1]);Object.defineProperty(yr,t,{value:u,enumerable:!1})}return Object.defineProperty(yr,"codes",{value:r,enumerable:!1}),yr.color.close="\x1B[39m",yr.bgColor.close="\x1B[49m",yr.color.ansi=Kv(),yr.color.ansi256=Hv(),yr.color.ansi16m=Mv(),yr.bgColor.ansi=Kv(Hf),yr.bgColor.ansi256=Hv(Hf),yr.bgColor.ansi16m=Mv(Hf),Object.defineProperties(yr,{rgbToAnsi256:{value:(t,u,D)=>t===u&&u===D?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(u/255*5)+Math.round(D/255*5),enumerable:!1},hexToRgb:{value:(t)=>{let u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!u)return[0,0,0];let[D]=u;D.length===3&&(D=[...D].map((n)=>n+n).join(""));let i=Number.parseInt(D,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:(t)=>yr.rgbToAnsi256(...yr.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:(t)=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let u,D,i;if(t>=232)u=((t-232)*10+8)/255,D=u,i=u;else{t-=16;let e=t%36;u=Math.floor(t/36)/5,D=Math.floor(e/6)/5,i=e%6/5}let n=Math.max(u,D,i)*2;if(n===0)return 30;let o=30+(Math.round(i)<<2|Math.round(D)<<1|Math.round(u));return n===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,u,D)=>yr.ansi256ToAnsi(yr.rgbToAnsi256(t,u,D)),enumerable:!1},hexToAnsi:{value:(t)=>yr.ansi256ToAnsi(yr.hexToAnsi256(t)),enumerable:!1}}),yr}function Pv(r,t,u){return String(r).normalize().replace(/\r\n/g,`
|
|
18
|
+
`).split(`
|
|
19
|
+
`).map((D)=>K_(D,t,u)).join(`
|
|
20
|
+
`)}function u4(r,t){if(typeof r=="string")return Fn.aliases.get(r)===t;for(let u of r)if(u!==void 0&&u4(u,t))return!0;return!1}function M_(r,t){if(r===t)return;let u=r.split(`
|
|
21
|
+
`),D=t.split(`
|
|
22
|
+
`),i=[];for(let n=0;n<Math.max(u.length,D.length);n++)u[n]!==D[n]&&i.push(n);return i}function En(r,t){let u=r;u.isTTY&&u.setRawMode(t)}class Su{constructor(r,t=!0){xr(this,"input"),xr(this,"output"),xr(this,"_abortSignal"),xr(this,"rl"),xr(this,"opts"),xr(this,"_render"),xr(this,"_track",!1),xr(this,"_prevFrame",""),xr(this,"_subscribers",new Map),xr(this,"_cursor",0),xr(this,"state","initial"),xr(this,"error",""),xr(this,"value");let{input:u=I_,output:D=U_,render:i,signal:n,...o}=r;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=n,this.input=u,this.output=D}unsubscribe(){this._subscribers.clear()}setSubscriber(r,t){let u=this._subscribers.get(r)??[];u.push(t),this._subscribers.set(r,u)}on(r,t){this.setSubscriber(r,{cb:t})}once(r,t){this.setSubscriber(r,{cb:t,once:!0})}emit(r,...t){let u=this._subscribers.get(r)??[],D=[];for(let i of u)i.cb(...t),i.once&&D.push(()=>u.splice(u.indexOf(i),1));for(let i of D)i()}prompt(){return new Promise((r,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),r(kv);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let u=new O_(0);u._write=(D,i,n)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),n()},this.input.pipe(u),this.rl=Vv.createInterface({input:this.input,output:u,tabSize:2,prompt:"",escapeCodeTimeout:50}),Vv.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),En(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(lt.cursor.show),this.output.off("resize",this.render),En(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(lt.cursor.show),this.output.off("resize",this.render),En(this.input,!1),r(kv)})})}onKeypress(r,t){if(this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&Fn.aliases.has(t.name)&&this.emit("cursor",Fn.aliases.get(t.name)),Fn.actions.has(t.name)&&this.emit("cursor",t.name)),r&&(r.toLowerCase()==="y"||r.toLowerCase()==="n")&&this.emit("confirm",r.toLowerCase()==="y"),r==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),r&&this.emit("key",r.toLowerCase()),t?.name==="return"){if(this.opts.validate){let u=this.opts.validate(this.value);u&&(this.error=u instanceof Error?u.message:u,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}u4([r,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
23
|
+
`),En(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let r=Pv(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
24
|
+
`).length-1;this.output.write(lt.cursor.move(-999,r*-1))}render(){let r=Pv(this._render(this)??"",process.stdout.columns,{hard:!0});if(r!==this._prevFrame){if(this.state==="initial")this.output.write(lt.cursor.hide);else{let t=M_(this._prevFrame,r);if(this.restoreCursor(),t&&t?.length===1){let u=t[0];this.output.write(lt.cursor.move(0,u)),this.output.write(lt.erase.lines(1));let D=r.split(`
|
|
25
|
+
`);this.output.write(D[u]),this._prevFrame=r,this.output.write(lt.cursor.move(0,D.length-u-1));return}if(t&&t?.length>1){let u=t[0];this.output.write(lt.cursor.move(0,u)),this.output.write(lt.erase.down());let D=r.split(`
|
|
26
|
+
`).slice(u);this.output.write(D.join(`
|
|
27
|
+
`)),this._prevFrame=r;return}this.output.write(lt.erase.down())}this.output.write(r),this.state==="initial"&&(this.state="active"),this._prevFrame=r}}}function a_(){return $t.platform!=="win32"?$t.env.TERM!=="linux":!!$t.env.CI||!!$t.env.WT_SESSION||!!$t.env.TERMINUS_SUBLIME||$t.env.ConEmuTask==="{cmd::Cmder}"||$t.env.TERM_PROGRAM==="Terminus-Sublime"||$t.env.TERM_PROGRAM==="vscode"||$t.env.TERM==="xterm-256color"||$t.env.TERM==="alacritty"||$t.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}async function f4(r,t={}){let u=(D)=>{if(typeof D!=="symbol"||D.toString()!=="Symbol(clack:cancel)")return D;switch(t.cancel){case"reject":{let i=new Error("Prompt cancelled.");if(i.name="ConsolaPromptCancelledError",Error.captureStackTrace)Error.captureStackTrace(i,f4);throw i}case"undefined":return;case"null":return null;case"symbol":return e4;default:case"default":return t.default??t.initial}};if(!t.type||t.type==="text")return await oI({message:r,defaultValue:t.default,placeholder:t.placeholder,initialValue:t.initial}).then(u);if(t.type==="confirm")return await eI({message:r,initialValue:t.initial}).then(u);if(t.type==="select")return await fI({message:r,options:t.options.map((D)=>typeof D==="string"?{value:D,label:D}:D),initialValue:t.initial}).then(u);if(t.type==="multiselect")return await $I({message:r,options:t.options.map((D)=>typeof D==="string"?{value:D,label:D}:D),required:t.required,initialValues:t.initial}).then(u);throw new Error(`Unknown prompt type: ${t.type}`)}var Kf,Sv,lt,vn,Qv,q_,Y,z_,r4,J_,A_,X_=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\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|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\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]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},j_,Hf=10,Kv=(r=0)=>(t)=>`\x1B[${t+r}m`,Hv=(r=0)=>(t)=>`\x1B[${38+r};5;${t}m`,Mv=(r=0)=>(t,u,D)=>`\x1B[${38+r};2;${t};${u};${D}m`,yr,G_,W_,T_,gn,R_=39,kf="\x07",t4="[",V_="]",i4="m",df,Zv=(r)=>`${gn.values().next().value}${t4}${r}${i4}`,Lv=(r)=>`${gn.values().next().value}${df}${r}${kf}`,S_=(r)=>r.split(" ").map((t)=>Vu(t)),Mf=(r,t,u)=>{let D=[...t],i=!1,n=!1,o=Vu(av(r[r.length-1]));for(let[e,f]of D.entries()){let $=Vu(f);if(o+$<=u?r[r.length-1]+=f:(r.push(f),o=0),gn.has(f)&&(i=!0,n=D.slice(e+1).join("").startsWith(df)),i){n?f===kf&&(i=!1,n=!1):f===i4&&(i=!1);continue}o+=$,o===u&&e<D.length-1&&(r.push(""),o=0)}!o&&r[r.length-1].length>0&&r.length>1&&(r[r.length-2]+=r.pop())},Q_=(r)=>{let t=r.split(" "),u=t.length;for(;u>0&&!(Vu(t[u-1])>0);)u--;return u===t.length?r:t.slice(0,u).join(" ")+t.slice(u).join("")},K_=(r,t,u={})=>{if(u.trim!==!1&&r.trim()==="")return"";let D="",i,n,o=S_(r),e=[""];for(let[$,l]of r.split(" ").entries()){u.trim!==!1&&(e[e.length-1]=e[e.length-1].trimStart());let m=Vu(e[e.length-1]);if($!==0&&(m>=t&&(u.wordWrap===!1||u.trim===!1)&&(e.push(""),m=0),(m>0||u.trim===!1)&&(e[e.length-1]+=" ",m++)),u.hard&&o[$]>t){let c=t-m,g=1+Math.floor((o[$]-c-1)/t);Math.floor((o[$]-1)/t)<g&&e.push(""),Mf(e,l,t);continue}if(m+o[$]>t&&m>0&&o[$]>0){if(u.wordWrap===!1&&m<t){Mf(e,l,t);continue}e.push("")}if(m+o[$]>t&&u.wordWrap===!1){Mf(e,l,t);continue}e[e.length-1]+=l}u.trim!==!1&&(e=e.map(($)=>Q_($)));let f=[...e.join(`
|
|
28
|
+
`)];for(let[$,l]of f.entries()){if(D+=l,gn.has(l)){let{groups:c}=new RegExp(`(?:\\${t4}(?<code>\\d+)m|\\${df}(?<uri>.*)${kf})`).exec(f.slice($).join(""))||{groups:{}};if(c.code!==void 0){let g=Number.parseFloat(c.code);i=g===R_?void 0:g}else c.uri!==void 0&&(n=c.uri.length===0?void 0:c.uri)}let m=T_.codes.get(Number(i));f[$+1]===`
|
|
29
|
+
`?(n&&(D+=Lv("")),i&&m&&(D+=Zv(m))):l===`
|
|
30
|
+
`&&(i&&m&&(D+=Zv(i)),n&&(D+=Lv(n)))}return D},H_,Fn,kv,Z_,L_=(r,t,u)=>(t in r)?Z_(r,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[t]=u,xr=(r,t,u)=>(L_(r,typeof t!="symbol"?t+"":t,u),u),D4,P_,k_=(r,t,u)=>(t in r)?P_(r,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[t]=u,dv=(r,t,u)=>(k_(r,typeof t!="symbol"?t+"":t,u),u),d_,x_,p_=(r,t,u)=>(t in r)?x_(r,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[t]=u,xv=(r,t,u)=>(p_(r,typeof t!="symbol"?t+"":t,u),u),n4,o4,s_,mt=(r,t)=>s_?r:t,rI,tI,iI,uI,_r,Ai,Zf,Lf,DI,pv,nI,wn=(r)=>{switch(r){case"initial":case"active":return Y.cyan(rI);case"cancel":return Y.red(tI);case"error":return Y.yellow(iI);case"submit":return Y.green(uI)}},Pf=(r)=>{let{cursor:t,options:u,style:D}=r,i=r.maxItems??Number.POSITIVE_INFINITY,n=Math.max(process.stdout.rows-4,0),o=Math.min(n,Math.max(i,5)),e=0;t>=e+o-3?e=Math.max(Math.min(t-o+3,u.length-o),0):t<e+2&&(e=Math.max(t-2,0));let f=o<u.length&&e>0,$=o<u.length&&e+o<u.length;return u.slice(e,e+o).map((l,m,c)=>{let g=m===0&&f,_=m===c.length-1&&$;return g||_?Y.dim("..."):D(l,m+e===t)})},oI=(r)=>new o4({validate:r.validate,placeholder:r.placeholder,defaultValue:r.defaultValue,initialValue:r.initialValue,render(){let t=`${Y.gray(_r)}
|
|
31
|
+
${wn(this.state)} ${r.message}
|
|
32
|
+
`,u=r.placeholder?Y.inverse(r.placeholder[0])+Y.dim(r.placeholder.slice(1)):Y.inverse(Y.hidden("_")),D=this.value?this.valueWithCursor:u;switch(this.state){case"error":return`${t.trim()}
|
|
33
|
+
${Y.yellow(_r)} ${D}
|
|
34
|
+
${Y.yellow(Ai)} ${Y.yellow(this.error)}
|
|
35
|
+
`;case"submit":return`${t}${Y.gray(_r)} ${Y.dim(this.value||r.placeholder)}`;case"cancel":return`${t}${Y.gray(_r)} ${Y.strikethrough(Y.dim(this.value??""))}${this.value?.trim()?`
|
|
36
|
+
${Y.gray(_r)}`:""}`;default:return`${t}${Y.cyan(_r)} ${D}
|
|
37
|
+
${Y.cyan(Ai)}
|
|
38
|
+
`}}}).prompt(),eI=(r)=>{let t=r.active??"Yes",u=r.inactive??"No";return new D4({active:t,inactive:u,initialValue:r.initialValue??!0,render(){let D=`${Y.gray(_r)}
|
|
39
|
+
${wn(this.state)} ${r.message}
|
|
40
|
+
`,i=this.value?t:u;switch(this.state){case"submit":return`${D}${Y.gray(_r)} ${Y.dim(i)}`;case"cancel":return`${D}${Y.gray(_r)} ${Y.strikethrough(Y.dim(i))}
|
|
41
|
+
${Y.gray(_r)}`;default:return`${D}${Y.cyan(_r)} ${this.value?`${Y.green(Zf)} ${t}`:`${Y.dim(Lf)} ${Y.dim(t)}`} ${Y.dim("/")} ${this.value?`${Y.dim(Lf)} ${Y.dim(u)}`:`${Y.green(Zf)} ${u}`}
|
|
42
|
+
${Y.cyan(Ai)}
|
|
43
|
+
`}}}).prompt()},fI=(r)=>{let t=(u,D)=>{let i=u.label??String(u.value);switch(D){case"selected":return`${Y.dim(i)}`;case"active":return`${Y.green(Zf)} ${i} ${u.hint?Y.dim(`(${u.hint})`):""}`;case"cancelled":return`${Y.strikethrough(Y.dim(i))}`;default:return`${Y.dim(Lf)} ${Y.dim(i)}`}};return new n4({options:r.options,initialValue:r.initialValue,render(){let u=`${Y.gray(_r)}
|
|
44
|
+
${wn(this.state)} ${r.message}
|
|
45
|
+
`;switch(this.state){case"submit":return`${u}${Y.gray(_r)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${u}${Y.gray(_r)} ${t(this.options[this.cursor],"cancelled")}
|
|
46
|
+
${Y.gray(_r)}`;default:return`${u}${Y.cyan(_r)} ${Pf({cursor:this.cursor,options:this.options,maxItems:r.maxItems,style:(D,i)=>t(D,i?"active":"inactive")}).join(`
|
|
47
|
+
${Y.cyan(_r)} `)}
|
|
48
|
+
${Y.cyan(Ai)}
|
|
49
|
+
`}}}).prompt()},$I=(r)=>{let t=(u,D)=>{let i=u.label??String(u.value);return D==="active"?`${Y.cyan(DI)} ${i} ${u.hint?Y.dim(`(${u.hint})`):""}`:D==="selected"?`${Y.green(pv)} ${Y.dim(i)}`:D==="cancelled"?`${Y.strikethrough(Y.dim(i))}`:D==="active-selected"?`${Y.green(pv)} ${i} ${u.hint?Y.dim(`(${u.hint})`):""}`:D==="submitted"?`${Y.dim(i)}`:`${Y.dim(nI)} ${Y.dim(i)}`};return new d_({options:r.options,initialValues:r.initialValues,required:r.required??!0,cursorAt:r.cursorAt,validate(u){if(this.required&&u.length===0)return`Please select at least one option.
|
|
50
|
+
${Y.reset(Y.dim(`Press ${Y.gray(Y.bgWhite(Y.inverse(" space ")))} to select, ${Y.gray(Y.bgWhite(Y.inverse(" enter ")))} to submit`))}`},render(){let u=`${Y.gray(_r)}
|
|
51
|
+
${wn(this.state)} ${r.message}
|
|
52
|
+
`,D=(i,n)=>{let o=this.value.includes(i.value);return n&&o?t(i,"active-selected"):o?t(i,"selected"):t(i,n?"active":"inactive")};switch(this.state){case"submit":return`${u}${Y.gray(_r)} ${this.options.filter(({value:i})=>this.value.includes(i)).map((i)=>t(i,"submitted")).join(Y.dim(", "))||Y.dim("none")}`;case"cancel":{let i=this.options.filter(({value:n})=>this.value.includes(n)).map((n)=>t(n,"cancelled")).join(Y.dim(", "));return`${u}${Y.gray(_r)} ${i.trim()?`${i}
|
|
53
|
+
${Y.gray(_r)}`:""}`}case"error":{let i=this.error.split(`
|
|
54
|
+
`).map((n,o)=>o===0?`${Y.yellow(Ai)} ${Y.yellow(n)}`:` ${n}`).join(`
|
|
55
|
+
`);return`${u+Y.yellow(_r)} ${Pf({options:this.options,cursor:this.cursor,maxItems:r.maxItems,style:D}).join(`
|
|
56
|
+
${Y.yellow(_r)} `)}
|
|
57
|
+
${i}
|
|
58
|
+
`}default:return`${u}${Y.cyan(_r)} ${Pf({options:this.options,cursor:this.cursor,maxItems:r.maxItems,style:D}).join(`
|
|
59
|
+
${Y.cyan(_r)} `)}
|
|
60
|
+
${Y.cyan(Ai)}
|
|
61
|
+
`}}}).prompt()},e4;var l4=k(()=>{lt=N_(),vn={exports:{}};q_=B_(),Y=y_(q_);z_=h_();r4={exports:{}};(function(r){var t={};r.exports=t,t.eastAsianWidth=function(D){var i=D.charCodeAt(0),n=D.length==2?D.charCodeAt(1):0,o=i;return 55296<=i&&i<=56319&&56320<=n&&n<=57343&&(i&=1023,n&=1023,o=i<<10|n,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},t.characterLength=function(D){var i=this.eastAsianWidth(D);return i=="F"||i=="W"||i=="A"?2:1};function u(D){return D.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(D){for(var i=u(D),n=0,o=0;o<i.length;o++)n=n+this.characterLength(i[o]);return n},t.slice=function(D,i,n){textLen=t.length(D),i=i||0,n=n||1,i<0&&(i=textLen+i),n<0&&(n=textLen+n);for(var o="",e=0,f=u(D),$=0;$<f.length;$++){var l=f[$],m=t.length(l);if(e>=i-(m==2?1:0))if(e+m<=n)o+=l;else break;e+=m}return o}})(r4);J_=r4.exports,A_=sv(J_),j_=sv(X_);yr={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]}};Object.keys(yr.modifier);G_=Object.keys(yr.color),W_=Object.keys(yr.bgColor);[...G_];T_=Y_(),gn=new Set(["\x1B",""]),df=`${V_}8;;`;H_=["up","down","left","right","space","enter","cancel"],Fn={actions:new Set(H_),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};globalThis.process.platform.startsWith("win");kv=Symbol("clack:cancel");Z_=Object.defineProperty;D4=class D4 extends Su{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(r){super(r,!1),this.value=!!r.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(t)=>{this.output.write(lt.cursor.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};P_=Object.defineProperty,d_=class extends Su{constructor(r){super(r,!1),dv(this,"options"),dv(this,"cursor",0),this.options=r.options,this.value=[...r.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===r.cursorAt),0),this.on("key",(t)=>{t==="a"&&this.toggleAll()}),this.on("cursor",(t)=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let r=this.value.length===this.options.length;this.value=r?[]:this.options.map((t)=>t.value)}toggleValue(){let r=this.value.includes(this._value);this.value=r?this.value.filter((t)=>t!==this._value):[...this.value,this._value]}},x_=Object.defineProperty;n4=class n4 extends Su{constructor(r){super(r,!1),xv(this,"options"),xv(this,"cursor",0),this.options=r.options,this.cursor=this.options.findIndex(({value:t})=>t===r.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(t)=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};o4=class o4 extends Su{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;let r=this.value.slice(0,this.cursor),[t,...u]=this.value.slice(this.cursor);return`${r}${Y.inverse(t)}${u.join("")}`}get cursor(){return this._cursor}constructor(r){super(r),this.on("finalize",()=>{this.value||(this.value=r.defaultValue)})}};s_=a_(),rI=mt("❯",">"),tI=mt("■","x"),iI=mt("▲","x"),uI=mt("✔","√"),_r=mt(""),Ai=mt(""),Zf=mt("●",">"),Lf=mt("○"," "),DI=mt("◻","[•]"),pv=mt("◼","[+]"),nI=mt("◻","[ ]");`${Y.gray(_r)} `;e4=Symbol.for("cancel")});import m4 from"node:process";function cI(){if(globalThis.process?.env)for(let r of mI){let t=r[1]||r[0];if(globalThis.process?.env[t])return{name:r[0].toLowerCase(),...r[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}function ei(r){return r?r!=="false":!1}function BI(){let r=NI.find((t)=>t[0]);if(r)return{name:r[1]}}function hI({onlyFirst:r=!1}={}){let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(u,r?void 0:"g")}function JI(r){if(typeof r!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(zI,"")}function AI(r){return r===161||r===164||r===167||r===168||r===170||r===173||r===174||r>=176&&r<=180||r>=182&&r<=186||r>=188&&r<=191||r===198||r===208||r===215||r===216||r>=222&&r<=225||r===230||r>=232&&r<=234||r===236||r===237||r===240||r===242||r===243||r>=247&&r<=250||r===252||r===254||r===257||r===273||r===275||r===283||r===294||r===295||r===299||r>=305&&r<=307||r===312||r>=319&&r<=322||r===324||r>=328&&r<=331||r===333||r===338||r===339||r===358||r===359||r===363||r===462||r===464||r===466||r===468||r===470||r===472||r===474||r===476||r===593||r===609||r===708||r===711||r>=713&&r<=715||r===717||r===720||r>=728&&r<=731||r===733||r===735||r>=768&&r<=879||r>=913&&r<=929||r>=931&&r<=937||r>=945&&r<=961||r>=963&&r<=969||r===1025||r>=1040&&r<=1103||r===1105||r===8208||r>=8211&&r<=8214||r===8216||r===8217||r===8220||r===8221||r>=8224&&r<=8226||r>=8228&&r<=8231||r===8240||r===8242||r===8243||r===8245||r===8251||r===8254||r===8308||r===8319||r>=8321&&r<=8324||r===8364||r===8451||r===8453||r===8457||r===8467||r===8470||r===8481||r===8482||r===8486||r===8491||r===8531||r===8532||r>=8539&&r<=8542||r>=8544&&r<=8555||r>=8560&&r<=8569||r===8585||r>=8592&&r<=8601||r===8632||r===8633||r===8658||r===8660||r===8679||r===8704||r===8706||r===8707||r===8711||r===8712||r===8715||r===8719||r===8721||r===8725||r===8730||r>=8733&&r<=8736||r===8739||r===8741||r>=8743&&r<=8748||r===8750||r>=8756&&r<=8759||r===8764||r===8765||r===8776||r===8780||r===8786||r===8800||r===8801||r>=8804&&r<=8807||r===8810||r===8811||r===8814||r===8815||r===8834||r===8835||r===8838||r===8839||r===8853||r===8857||r===8869||r===8895||r===8978||r>=9312&&r<=9449||r>=9451&&r<=9547||r>=9552&&r<=9587||r>=9600&&r<=9615||r>=9618&&r<=9621||r===9632||r===9633||r>=9635&&r<=9641||r===9650||r===9651||r===9654||r===9655||r===9660||r===9661||r===9664||r===9665||r>=9670&&r<=9672||r===9675||r>=9678&&r<=9681||r>=9698&&r<=9701||r===9711||r===9733||r===9734||r===9737||r===9742||r===9743||r===9756||r===9758||r===9792||r===9794||r===9824||r===9825||r>=9827&&r<=9829||r>=9831&&r<=9834||r===9836||r===9837||r===9839||r===9886||r===9887||r===9919||r>=9926&&r<=9933||r>=9935&&r<=9939||r>=9941&&r<=9953||r===9955||r===9960||r===9961||r>=9963&&r<=9969||r===9972||r>=9974&&r<=9977||r===9979||r===9980||r===9982||r===9983||r===10045||r>=10102&&r<=10111||r>=11094&&r<=11097||r>=12872&&r<=12879||r>=57344&&r<=63743||r>=65024&&r<=65039||r===65533||r>=127232&&r<=127242||r>=127248&&r<=127277||r>=127280&&r<=127337||r>=127344&&r<=127373||r===127375||r===127376||r>=127387&&r<=127404||r>=917760&&r<=917999||r>=983040&&r<=1048573||r>=1048576&&r<=1114109}function XI(r){return r===12288||r>=65281&&r<=65376||r>=65504&&r<=65510}function jI(r){return r>=4352&&r<=4447||r===8986||r===8987||r===9001||r===9002||r>=9193&&r<=9196||r===9200||r===9203||r===9725||r===9726||r===9748||r===9749||r>=9776&&r<=9783||r>=9800&&r<=9811||r===9855||r>=9866&&r<=9871||r===9875||r===9889||r===9898||r===9899||r===9917||r===9918||r===9924||r===9925||r===9934||r===9940||r===9962||r===9970||r===9971||r===9973||r===9978||r===9981||r===9989||r===9994||r===9995||r===10024||r===10060||r===10062||r>=10067&&r<=10069||r===10071||r>=10133&&r<=10135||r===10160||r===10175||r===11035||r===11036||r===11088||r===11093||r>=11904&&r<=11929||r>=11931&&r<=12019||r>=12032&&r<=12245||r>=12272&&r<=12287||r>=12289&&r<=12350||r>=12353&&r<=12438||r>=12441&&r<=12543||r>=12549&&r<=12591||r>=12593&&r<=12686||r>=12688&&r<=12773||r>=12783&&r<=12830||r>=12832&&r<=12871||r>=12880&&r<=42124||r>=42128&&r<=42182||r>=43360&&r<=43388||r>=44032&&r<=55203||r>=63744&&r<=64255||r>=65040&&r<=65049||r>=65072&&r<=65106||r>=65108&&r<=65126||r>=65128&&r<=65131||r>=94176&&r<=94180||r===94192||r===94193||r>=94208&&r<=100343||r>=100352&&r<=101589||r>=101631&&r<=101640||r>=110576&&r<=110579||r>=110581&&r<=110587||r===110589||r===110590||r>=110592&&r<=110882||r===110898||r>=110928&&r<=110930||r===110933||r>=110948&&r<=110951||r>=110960&&r<=111355||r>=119552&&r<=119638||r>=119648&&r<=119670||r===126980||r===127183||r===127374||r>=127377&&r<=127386||r>=127488&&r<=127490||r>=127504&&r<=127547||r>=127552&&r<=127560||r===127568||r===127569||r>=127584&&r<=127589||r>=127744&&r<=127776||r>=127789&&r<=127797||r>=127799&&r<=127868||r>=127870&&r<=127891||r>=127904&&r<=127946||r>=127951&&r<=127955||r>=127968&&r<=127984||r===127988||r>=127992&&r<=128062||r===128064||r>=128066&&r<=128252||r>=128255&&r<=128317||r>=128331&&r<=128334||r>=128336&&r<=128359||r===128378||r===128405||r===128406||r===128420||r>=128507&&r<=128591||r>=128640&&r<=128709||r===128716||r>=128720&&r<=128722||r>=128725&&r<=128727||r>=128732&&r<=128735||r===128747||r===128748||r>=128756&&r<=128764||r>=128992&&r<=129003||r===129008||r>=129292&&r<=129338||r>=129340&&r<=129349||r>=129351&&r<=129535||r>=129648&&r<=129660||r>=129664&&r<=129673||r>=129679&&r<=129734||r>=129742&&r<=129756||r>=129759&&r<=129769||r>=129776&&r<=129784||r>=131072&&r<=196605||r>=196608&&r<=262141}function GI(r){if(!Number.isSafeInteger(r))throw new TypeError(`Expected a code point, got \`${typeof r}\`.`)}function WI(r,{ambiguousAsWide:t=!1}={}){if(GI(r),XI(r)||jI(r)||t&&AI(r))return 2;return 1}function VI(r,t={}){if(typeof r!=="string"||r.length===0)return 0;let{ambiguousIsNarrow:u=!0,countAnsiEscapeCodes:D=!1}=t;if(!D)r=JI(r);if(r.length===0)return 0;let i=0,n={ambiguousAsWide:!u};for(let{segment:o}of TI.segment(r)){let e=o.codePointAt(0);if(e<=31||e>=127&&e<=159)continue;if(e>=8203&&e<=8207||e===65279)continue;if(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071)continue;if(e>=55296&&e<=57343)continue;if(e>=65024&&e<=65039)continue;if(RI.test(o))continue;if(YI().test(o)){i+=2;continue}i+=WI(e,n)}return i}function SI(){let{env:r}=m4,{TERM:t,TERM_PROGRAM:u}=r;if(m4.platform!=="win32")return t!=="linux";return Boolean(r.WT_SESSION)||Boolean(r.TERMINUS_SUBLIME)||r.ConEmuTask==="{cmd::Cmder}"||u==="Terminus-Sublime"||u==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||r.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function E4(r){if(typeof Intl!=="object"||!Intl.Segmenter)return Bt(r).length;return VI(r)}function bn(r){return r.replace(/`([^`]+)`/gm,(t,u)=>Cr.cyan(u)).replace(/\s+_([^_]+)_\s+/gm,(t,u)=>` ${Cr.underline(u)} `)}function MI(r="white"){return Cr[r]||Cr.white}function ZI(r="bgWhite"){return Cr[`bg${r[0].toUpperCase()}${r.slice(1)}`]||Cr.bgWhite}function LI(r={}){let t=PI();if(process.env.CONSOLA_LEVEL)t=Number.parseInt(process.env.CONSOLA_LEVEL)??t;return Jv({level:t,defaults:{level:t},stdout:process.stdout,stderr:process.stderr,prompt:(...D)=>Promise.resolve().then(() => (l4(),$4)).then((i)=>i.prompt(...D)),reporters:r.reporters||[r.fancy??!(xf||pf)?new w4:new ln],...r})}function PI(){if(EI)return Wr.debug;if(pf)return Wr.warn;return Wr.info}var Cn,Qu=(r)=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(r?Cn:globalThis),Kt,lI,mI,F4,vI,xf,g4,EI,pf,FI,gI,wI,c4,bI,CI,_I,II,UI,OI,yI,NI,qI,zI,YI=()=>{return/[#*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\uDC70\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-\uDED7\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\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\uDD3D\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-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\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]|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\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},TI,RI,QI,KI,HI,wt=(r,t)=>HI?r:t,v4,w4,Xi;var b4=k(()=>{Rf();Rf();Xv();cn();Cn=Object.create(null),Kt=new Proxy(Cn,{get(r,t){return Qu()[t]??Cn[t]},has(r,t){let u=Qu();return t in u||t in Cn},set(r,t,u){let D=Qu(!0);return D[t]=u,!0},deleteProperty(r,t){if(!t)return!1;let u=Qu(!0);return delete u[t],!0},ownKeys(){let r=Qu(!0);return Object.keys(r)}}),lI=typeof process<"u"&&process.env&&"development"||"",mI=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];F4=cI();F4.name;vI=globalThis.process?.platform||"",xf=ei(Kt.CI)||F4.ci!==!1,g4=ei(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),EI=ei(Kt.DEBUG),pf=lI==="test"||ei(Kt.TEST);ei(Kt.MINIMAL);FI=/^win/i.test(vI);!ei(Kt.NO_COLOR)&&(ei(Kt.FORCE_COLOR)||(g4||FI)&&Kt.TERM);gI=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(gI?.split(".")[0]);wI=globalThis.process||Object.create(null),c4={versions:{}};new Proxy(wI,{get(r,t){if(t==="env")return Kt;if(t in r)return r[t];if(t in c4)return c4[t]}});bI=globalThis.process?.release?.name==="node",CI=!!globalThis.Bun||!!globalThis.process?.versions?.bun,_I=!!globalThis.Deno,II=!!globalThis.fastly,UI=!!globalThis.Netlify,OI=!!globalThis.EdgeRuntime,yI=globalThis.navigator?.userAgent==="Cloudflare-Workers",NI=[[UI,"netlify"],[OI,"edge-light"],[yI,"workerd"],[II,"fastly"],[_I,"deno"],[CI,"bun"],[bI,"node"]];qI=BI();qI?.name;zI=hI();TI=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:(r)=>r.split("")},RI=/^\p{Default_Ignorable_Code_Point}$/u;QI={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},KI={0:"red",1:"yellow"},HI=SI(),v4={error:wt("✖","×"),fatal:wt("✖","×"),ready:wt("✔","√"),warn:wt("⚠","‼"),info:wt("ℹ","i"),success:wt("✔","√"),debug:wt("⚙","D"),trace:wt("→","→"),fail:wt("✖","×"),start:wt("◐","o"),log:""};w4=class w4 extends ln{formatStack(r,t,u){let D=" ".repeat((u?.errorLevel||0)+1);return`
|
|
62
|
+
${D}`+Sf(r,t).map((i)=>" "+i.replace(/^at +/,(n)=>Cr.gray(n)).replace(/\((.+)\)/,(n,o)=>`(${Cr.cyan(o)})`)).join(`
|
|
63
|
+
${D}`)}formatType(r,t,u){let D=QI[r.type]||KI[r.level]||"gray";if(t)return ZI(D)(Cr.black(` ${r.type.toUpperCase()} `));let i=typeof v4[r.type]==="string"?v4[r.type]:r.icon||r.type;return i?MI(D)(i):""}formatLogObj(r,t){let[u,...D]=this.formatArgs(r.args,t).split(`
|
|
64
|
+
`);if(r.type==="box")return Qf(bn(u+(D.length>0?`
|
|
65
|
+
`+D.join(`
|
|
66
|
+
`):"")),{title:r.title?bn(r.title):void 0,style:r.style});let i=this.formatDate(r.date,t),n=i&&Cr.gray(i),o=r.badge??r.level<2,e=this.formatType(r,o,t),f=r.tag?Cr.gray(r.tag):"",$,l=this.filterAndJoin([e,bn(u)]),m=this.filterAndJoin(t.columns?[f,n]:[f]),c=(t.columns||0)-E4(l)-E4(m)-2;if($=c>0&&(t.columns||0)>=80?l+" ".repeat(c)+m:(m?`${Cr.gray(`[${m}]`)} `:"")+l,$+=bn(D.length>0?`
|
|
67
|
+
`+D.join(`
|
|
68
|
+
`):""),r.type==="trace"){let g=new Error("Trace: "+r.message);$+=this.formatStack(g.stack||"",g.message)}return o?`
|
|
69
|
+
`+$+`
|
|
70
|
+
`:$}};Xi=LI()});var C4=k(()=>{cn();cn()});function kI(r){if(Array.isArray(r))return r;return r===void 0?[]:[r]}function af(r,t=""){let u=[];for(let D of r)for(let[i,n]of D.entries())u[i]=Math.max(u[i]||0,n.length);return r.map((D)=>D.map((i,n)=>t+i[n===0?"padStart":"padEnd"](u[n])).join(" ")).join(`
|
|
71
|
+
`)}function ct(r){return typeof r==="function"?r():r}function pI(r=""){if(dI.test(r))return;return r!==r.toLowerCase()}function _4(r,t){let u=t??xI,D=[];if(!r||typeof r!=="string")return D;let i="",n,o;for(let e of r){let f=u.includes(e);if(f===!0){D.push(i),i="",n=void 0;continue}let $=pI(e);if(o===!1){if(n===!1&&$===!0){D.push(i),i=e,n=$;continue}if(n===!0&&$===!1&&i.length>1){let l=i.at(-1);D.push(i.slice(0,Math.max(0,i.length-1))),i=l+e,n=$;continue}}i+=e,n=$,o=f}return D.push(i),D}function aI(r){return r?r[0].toUpperCase()+r.slice(1):""}function sI(r){return r?r[0].toLowerCase()+r.slice(1):""}function r7(r,t){return r?(Array.isArray(r)?r:_4(r)).map((u)=>aI(t?.normalize?u.toLowerCase():u)).join(""):""}function t7(r,t){return sI(r7(r||"",t))}function i7(r,t){return r?(Array.isArray(r)?r:_4(r)).map((u)=>u.toLowerCase()).join(t??"-"):""}function sf(r){return r==null?[]:Array.isArray(r)?r:[r]}function u7(r,t,u,D){let i,n=r[t],o=~D.string.indexOf(t)?u==null||u===!0?"":String(u):typeof u==="boolean"?u:~D.boolean.indexOf(t)?u==="false"?!1:u==="true"||(r._.push((i=+u,i*0===0)?i:u),!!u):(i=+u,i*0===0)?i:u;r[t]=n==null?o:Array.isArray(n)?n.concat(o):[n,o]}function D7(r=[],t={}){let u,D,i,n,o,e={_:[]},f=0,$=0,l=0,m=r.length,c=t.alias!==void 0,g=t.unknown!==void 0,_=t.default!==void 0;if(t.alias=t.alias||{},t.string=sf(t.string),t.boolean=sf(t.boolean),c)for(u in t.alias){D=t.alias[u]=sf(t.alias[u]);for(f=0;f<D.length;f++)(t.alias[D[f]]=D.concat(u)).splice(f,1)}for(f=t.boolean.length;f-- >0;){D=t.alias[t.boolean[f]]||[];for($=D.length;$-- >0;)t.boolean.push(D[$])}for(f=t.string.length;f-- >0;){D=t.alias[t.string[f]]||[];for($=D.length;$-- >0;)t.string.push(D[$])}if(_){for(u in t.default)if(n=typeof t.default[u],D=t.alias[u]=t.alias[u]||[],t[n]!==void 0){t[n].push(u);for(f=0;f<D.length;f++)t[n].push(D[f])}}let q=g?Object.keys(t.alias):[];for(f=0;f<m;f++){if(i=r[f],i==="--"){e._=e._.concat(r.slice(++f));break}for($=0;$<i.length;$++)if(i.charCodeAt($)!==45)break;if($===0)e._.push(i);else if(i.substring($,$+3)==="no-"){if(n=i.slice(Math.max(0,$+3)),g&&!~q.indexOf(n))return t.unknown(i);e[n]=!1}else{for(l=$+1;l<i.length;l++)if(i.charCodeAt(l)===61)break;n=i.substring($,l),o=i.slice(Math.max(0,++l))||f+1===m||(""+r[f+1]).charCodeAt(0)===45||r[++f],D=$===2?[n]:n;for(l=0;l<D.length;l++){if(n=D[l],g&&!~q.indexOf(n))return t.unknown("-".repeat($)+n);u7(e,n,l+1<D.length||o,t)}}}if(_){for(u in t.default)if(e[u]===void 0)e[u]=t.default[u]}if(c)for(u in e){D=t.alias[u]||[];while(D.length>0)e[D.shift()]=e[u]}return e}function n7(r,t){let u={boolean:[],string:[],mixed:[],alias:{},default:{}},D=I4(t);for(let e of D){if(e.type==="positional")continue;if(e.type==="string")u.string.push(e.name);else if(e.type==="boolean")u.boolean.push(e.name);if(e.default!==void 0)u.default[e.name]=e.default;if(e.alias)u.alias[e.name]=e.alias}let i=D7(r,u),[...n]=i._,o=new Proxy(i,{get(e,f){return e[f]??e[t7(f)]??e[i7(f)]}});for(let[,e]of D.entries())if(e.type==="positional"){let f=n.shift();if(f!==void 0)o[e.name]=f;else if(e.default===void 0&&e.required!==!1)throw new fi(`Missing required positional argument: ${e.name.toUpperCase()}`,"EARG");else o[e.name]=e.default}else if(e.required&&o[e.name]===void 0)throw new fi(`Missing required argument: --${e.name}`,"EARG");return o}function I4(r){let t=[];for(let[u,D]of Object.entries(r||{}))t.push({...D,name:u,alias:kI(D.alias)});return t}function E(r){return r}async function U4(r,t){let u=await ct(r.args||{}),D=n7(t.rawArgs,u),i={rawArgs:t.rawArgs,args:D,data:t.data,cmd:r};if(typeof r.setup==="function")await r.setup(i);let n;try{let o=await ct(r.subCommands);if(o&&Object.keys(o).length>0){let e=t.rawArgs.findIndex(($)=>!$.startsWith("-")),f=t.rawArgs[e];if(f){if(!o[f])throw new fi(`Unknown command \`${f}\``,"E_UNKNOWN_COMMAND");let $=await ct(o[f]);if($)await U4($,{rawArgs:t.rawArgs.slice(e+1)})}else if(!r.run)throw new fi("No command specified.","E_NO_COMMAND")}if(typeof r.run==="function")n=await r.run(i)}finally{if(typeof r.cleanup==="function")await r.cleanup(i)}return{result:n}}async function r$(r,t,u){let D=await ct(r.subCommands);if(D&&Object.keys(D).length>0){let i=t.findIndex((e)=>!e.startsWith("-")),n=t[i],o=await ct(D[n]);if(o)return r$(o,t.slice(i+1),r)}return[r,u]}async function o7(r,t){try{Xi.log(await e7(r,t)+`
|
|
72
|
+
`)}catch(u){Xi.error(u)}}async function e7(r,t){let u=await ct(r.meta||{}),D=I4(await ct(r.args||{})),i=await ct(t?.meta||{}),n=`${i.name?`${i.name} `:""}`+(u.name||process.argv[1]),o=[],e=[],f=[],$=[];for(let g of D)if(g.type==="positional"){let _=g.name.toUpperCase(),q=g.required!==!1&&g.default===void 0,y=g.default?`="${g.default}"`:"";e.push(["`"+_+y+"`",g.description||"",g.valueHint?`<${g.valueHint}>`:""]),$.push(q?`<${_}>`:`[${_}]`)}else{let _=g.required===!0&&g.default===void 0,q=(g.type==="boolean"&&g.default===!0?[...(g.alias||[]).map((y)=>`--no-${y}`),`--no-${g.name}`].join(", "):[...(g.alias||[]).map((y)=>`-${y}`),`--${g.name}`].join(", "))+(g.type==="string"&&(g.valueHint||g.default)?`=${g.valueHint?`<${g.valueHint}>`:`"${g.default||""}"`}`:"");if(o.push(["`"+q+(_?" (required)":"")+"`",g.description||""]),_)$.push(q)}if(r.subCommands){let g=[],_=await ct(r.subCommands);for(let[q,y]of Object.entries(_)){let N=await ct(y),R=await ct(N?.meta);f.push([`\`${q}\``,R?.description||""]),g.push(q)}$.push(g.join("|"))}let l=[],m=u.version||i.version;l.push(Cr.gray(`${u.description} (${n+(m?` v${m}`:"")})`),"");let c=o.length>0||e.length>0;if(l.push(`${Cr.underline(Cr.bold("USAGE"))} \`${n}${c?" [OPTIONS]":""} ${$.join(" ")}\``,""),e.length>0)l.push(Cr.underline(Cr.bold("ARGUMENTS")),""),l.push(af(e," ")),l.push("");if(o.length>0)l.push(Cr.underline(Cr.bold("OPTIONS")),""),l.push(af(o," ")),l.push("");if(f.length>0)l.push(Cr.underline(Cr.bold("COMMANDS")),""),l.push(af(f," ")),l.push("",`Use \`${n} <command> --help\` for more information about a command.`);return l.filter((g)=>typeof g==="string").join(`
|
|
73
|
+
`)}async function O4(r,t={}){let u=t.rawArgs||process.argv.slice(2),D=t.showUsage||o7;try{if(u.includes("--help")||u.includes("-h"))await D(...await r$(r,u)),process.exit(0);else if(u.length===1&&u[0]==="--version"){let i=typeof r.meta==="function"?await r.meta():await r.meta;if(!i?.version)throw new fi("No version specified","E_NO_VERSION");Xi.log(i.version)}else await U4(r,{rawArgs:u})}catch(i){let n=i instanceof fi;if(!n)Xi.error(i,`
|
|
74
|
+
`);if(n)await D(...await r$(r,u));Xi.error(i.message),process.exit(1)}}var fi,dI,xI;var O=k(()=>{b4();C4();fi=class fi extends Error{constructor(r,t){super(r);this.code=t,this.name="CLIError"}};dI=/\d/,xI=["-","_","/","."]});async function N4(){if(Ku)return Ku;let t=await(await fetch("http://localhost:9222/json")).json(),u=t.find((D)=>D.type==="page"&&(D.url.includes("figma.com/design")||D.url.includes("figma.com/file/")))||t.find((D)=>D.type==="page"&&D.url.includes("figma.com/board"));if(!u)throw new Error(`No Figma file open in browser.
|
|
75
|
+
Start Figma with: open -a Figma --args --remote-debugging-port=9222`);return Ku=u,u}function m7(r){let t=JSON.parse(r.data);if(typeof t.id!=="number")return;let u=ht.get(t.id);if(!u)return;if(ht.delete(t.id),clearTimeout(u.timer),B4(),t.result?.exceptionDetails){let D=t.result.exceptionDetails;u.reject(new Error(D.exception?.description||D.text||"CDP error"))}else u.resolve(t.result?.result?.value)}async function c7(){if(Ht?.readyState===WebSocket.OPEN)return Ht;let r=await N4();return new Promise((t,u)=>{let D=new WebSocket(r.webSocketDebuggerUrl);D.addEventListener("open",()=>{Ht=D,D.addEventListener("message",m7),t(D)}),D.addEventListener("error",()=>u(new Error("WebSocket connection failed"))),D.addEventListener("close",()=>{for(let[i,n]of ht)clearTimeout(n.timer),n.reject(new Error("WebSocket closed")),ht.delete(i);if(Ht===D)Ht=null,Ku=null})})}function B4(){if(ht.size>0)return;if(qt)clearTimeout(qt);qt=setTimeout(()=>{li()},l7)}async function $i(r,t=30000){if(qt)clearTimeout(qt),qt=null;let u=await c7(),D=++$7;return new Promise((i,n)=>{let o=setTimeout(()=>{ht.delete(D),B4(),n(new Error("CDP timeout"))},t);ht.set(D,{resolve:i,reject:n,timer:o}),u.send(JSON.stringify({id:D,method:"Runtime.evaluate",params:{expression:r,awaitPromise:!0,returnByValue:!0}}))})}function v7(r){let t=r.match(/\/(file|design)\/([a-zA-Z0-9]+)/);if(!t?.[2])throw new Error("Could not extract file key from URL");return t[2]}async function t$(){let r=await N4();return v7(r.url)}function li(){if(qt)clearTimeout(qt),qt=null;for(let[r,t]of ht)clearTimeout(t.timer),t.reject(new Error("CDP connection closed")),ht.delete(r);if(Ht){let r=Ht;Ht=null,r.close()}Ku=null}var Ht=null,Ku=null,$7=0,qt=null,l7=100,ht;var ji=k(()=>{ht=new Map});import{existsSync as zt,unlinkSync as mi,writeFileSync as E7,readFileSync as u$}from"fs";import{createServer as F7}from"net";function g7(r){let t="";r.on("data",async(u)=>{t+=u.toString();let D=t.split(`
|
|
76
|
+
`);t=D.pop()||"";for(let i of D){if(!i.trim())continue;try{let n=JSON.parse(i),o={id:n.id,ok:!0};try{o.result=await In(n.command,n.args)}catch(e){o.ok=!1,o.error=e instanceof Error?e.message:String(e)}r.write(JSON.stringify(o)+`
|
|
77
|
+
`)}catch(n){r.write(JSON.stringify({id:"error",ok:!1,error:"Invalid JSON"})+`
|
|
78
|
+
`)}}}),r.on("error",()=>{})}async function D$(){if(zt(vt))mi(vt);try{let t=await In("get-current-page",{});console.log("Connected to Figma, page:",t?.name||"unknown")}catch(t){console.error("Failed to connect to Figma:",t instanceof Error?t.message:t),process.exit(1)}i$=F7(g7),i$.listen(vt,()=>{E7(ut,String(process.pid)),console.log(`Daemon started (PID ${process.pid})`),console.log(`Socket: ${vt}`)}),i$.on("error",(t)=>{console.error("Daemon error:",t.message),process.exit(1)});let r=async()=>{if(console.log(`
|
|
79
|
+
Shutting down...`),await li(),zt(vt))mi(vt);if(zt(ut))mi(ut);process.exit(0)};process.on("SIGINT",r),process.on("SIGTERM",r)}function _n(){if(!zt(ut))return!1;let r=parseInt(u$(ut,"utf-8"));try{if(process.kill(r,"SIGTERM"),zt(vt))mi(vt);if(zt(ut))mi(ut);return!0}catch{if(zt(vt))mi(vt);if(zt(ut))mi(ut);return!1}}function Gi(){if(!zt(ut))return!1;let r=parseInt(u$(ut,"utf-8"));try{return process.kill(r,0),!0}catch{return!1}}function Wi(){if(!Gi())return null;return{pid:parseInt(u$(ut,"utf-8")),socket:vt}}var vt="/tmp/figma-use.sock",ut="/tmp/figma-use.pid",i$=null;var q4=k(()=>{ji();B()});import{existsSync as w7}from"fs";import{createConnection as b7}from"net";function n$(){return w7(h4)}async function o$(r,t){return new Promise((u,D)=>{let i=Math.random().toString(36).slice(2),n=b7(h4),o="",e=!1,f=setTimeout(()=>{if(!e)n.destroy(),D(new Error("Daemon connection timeout"))},100),$=setTimeout(()=>{n.destroy(),D(new Error("Daemon request timeout"))},30000);n.on("connect",()=>{e=!0,clearTimeout(f),n.write(JSON.stringify({id:i,command:r,args:t})+`
|
|
80
|
+
`)}),n.on("data",(l)=>{o+=l.toString();let m=o.split(`
|
|
81
|
+
`);o=m.pop()||"";for(let c of m){if(!c.trim())continue;try{let g=JSON.parse(c);if(g.id===i)if(clearTimeout($),n.end(),g.ok)u(g.result);else D(new Error(g.error))}catch{}}}),n.on("error",(l)=>{clearTimeout($),D(new Error(`Daemon connection failed: ${l.message}`))})})}var h4="/tmp/figma-use.sock";var z4=()=>{};var e$=k(()=>{q4();z4()});var Hu=s((Az,f$)=>{var On=process||{},J4=On.argv||[],Un=On.env||{},C7=!(!!Un.NO_COLOR||J4.includes("--no-color"))&&(!!Un.FORCE_COLOR||J4.includes("--color")||On.platform==="win32"||(On.stdout||{}).isTTY&&Un.TERM!=="dumb"||!!Un.CI),_7=(r,t,u=r)=>(D)=>{let i=""+D,n=i.indexOf(t,r.length);return~n?r+I7(i,t,u,n)+t:r+i+t},I7=(r,t,u,D)=>{let i="",n=0;do i+=r.substring(n,D)+u,n=D+t.length,D=r.indexOf(t,n);while(~D);return i+r.substring(n)},A4=(r=C7)=>{let t=r?_7:()=>String;return{isColorSupported:r,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};f$.exports=A4();f$.exports.createColors=A4});function X4(r,t,u,D){let i=`${Math.round(r)}×${Math.round(t)}`;if(u!==void 0&&D!==void 0)return`${i} at (${Math.round(u)}, ${Math.round(D)})`;return i}function $$(r,t,u){let D=u?` (${u})`:"";return`[${r}] "${t}"${D}`}function U7(r,t){if(Array.isArray(r))return r.filter(Boolean).map((u)=>`${t}${u}`);return Object.entries(r).filter(([,u])=>u!==null&&u!==void 0&&u!=="").map(([u,D])=>`${t}${u}: ${D}`)}function l$(r,t={}){let{numbered:u=!0,start:D=0,compact:i=!1}=t,n=[],o=D+r.length-1,e=u?`[${o}]`.length:2;for(let f=0;f<r.length;f++){let $=r[f],l=u?`[${D+f}]`.padEnd(e):"•",m=" ".repeat(e+1);if(n.push(`${l} ${$.header}`),$.details){let c=U7($.details,m);n.push(...c)}if(!i&&$.details&&f<r.length-1)n.push("")}return n.join(`
|
|
82
|
+
`)}function bt(r,t={}){let{maxBarLength:u=30,scale:D=10,unit:i="×"}=t;return r.map((n)=>{let o="█".repeat(Math.min(Math.ceil(n.value/D),u)),e=n.tag?` (${n.tag})`:"",f=n.suffix?` ${n.suffix}`:"";return`${n.label} ${o} ${n.value}${i}${e}${f}`}).join(`
|
|
83
|
+
`)}function Yi(r){return Object.entries(r).filter(([,t])=>t>0).map(([t,u])=>`${u} ${t}`).join(", ")}var pr,Dr=(r)=>`${pr.default.green("✓")} ${r}`,d=(r)=>`${pr.default.red("✗")} ${r}`,er,Yr,Mt,yn,Mu,Jt,Xz,jz,Gz,Wz;var At=k(()=>{pr=ft(Hu(),1),er=pr.default.dim,Yr=pr.default.bold,Mt=pr.default.green,yn=pr.default.red,Mu=pr.default.yellow,Jt=pr.default.cyan,Xz=pr.default.gray,jz=pr.default.magenta,Gz=pr.default.blue,Wz=pr.default.white});function Bn(r){return O7[r]||r.toLowerCase()}function j4(r){if(r.type==="SOLID"&&r.color){let t=r.opacity!==void 0&&r.opacity<1?Math.round(r.opacity*255).toString(16).padStart(2,"0").toUpperCase():"";return r.color+t}return r.type.toLowerCase()}function Ti(r){if(!r||r.length===0)return null;let t=r.find((u)=>u.type==="SOLID");return t?j4(t):null}function Ri(r,t){if(!r||r.length===0)return null;let u=r.find((i)=>i.type==="SOLID");if(!u?.color)return null;let D=j4(u);return t?`${D} ${t}px`:D}function qn(r){if(r.width===void 0||r.height===void 0)return null;return X4(r.width,r.height,r.x,r.y)}function G4(r){if(!r.layoutMode||r.layoutMode==="NONE")return null;let t=r.layoutMode==="HORIZONTAL"?"row":"col",u=r.itemSpacing?` gap=${r.itemSpacing}`:"";return`layout: ${t}${u}`}function W4(r,t=40){if(!r)return null;return`"${(r.length>t?r.slice(0,t)+"…":r).replace(/\n/g,"↵")}"`}function Y4(r){if(!r.fontSize)return null;let t=r.fontFamily||"",u=r.fontStyle&&r.fontStyle!=="Regular"?` ${r.fontStyle}`:"";return`font: ${r.fontSize}px${t?` ${t}${u}`:""}`}function Vi(r){let t=process.env.npm_config_user_agent;if(t?.startsWith("bun"))return`bun add -d ${r}`;if(t?.startsWith("pnpm"))return`pnpm add -D ${r}`;if(t?.startsWith("yarn"))return`yarn add -D ${r}`;return`npm install -D ${r}`}var Nn,Zt,O7;var mr=k(()=>{At();Nn=Mt,Zt=Jt,O7={FRAME:"frame",RECTANGLE:"rect",ELLIPSE:"ellipse",TEXT:"text",COMPONENT:"component",INSTANCE:"instance",GROUP:"group",VECTOR:"vector",LINE:"line",POLYGON:"polygon",STAR:"star",BOOLEAN_OPERATION:"boolean",SECTION:"section",SLICE:"slice",PAGE:"page"}});var V4={};Or(V4,{printResult:()=>C,printError:()=>R4,formatResult:()=>m$});function y7(r,t=""){let u=[],D=Bn(r.type),i=r.name||r.characters||"",n=r.id;u.push(`${t}${$$(D,String(i),String(n))}`);let o=[],e=qn(r);if(e)o.push(`box: ${e}`);let f=Ti(r.fills);if(f)o.push(`fill: ${f}`);let $=Ri(r.strokes,r.strokeWeight);if($)o.push(`stroke: ${$}`);if(r.cornerRadius&&r.cornerRadius!==0){let g=`${r.cornerRadius}px`;if(r.cornerSmoothing&&r.cornerSmoothing>0)g+=` (smooth: ${Math.round(r.cornerSmoothing*100)}%)`;o.push(`radius: ${g}`)}if(r.topLeftRadius!==void 0||r.topRightRadius!==void 0){let g=r.topLeftRadius??r.cornerRadius??0,_=r.topRightRadius??r.cornerRadius??0,q=r.bottomLeftRadius??r.cornerRadius??0,y=r.bottomRightRadius??r.cornerRadius??0;if(g!==_||_!==q||q!==y){let N=`↖${g} ↗${_} ↘${y} ↙${q}`;if(r.cornerSmoothing&&r.cornerSmoothing>0)N+=` (smooth: ${Math.round(r.cornerSmoothing*100)}%)`;o.push(`corners: ${N}`)}}if(r.effects&&Array.isArray(r.effects)&&r.effects.length>0){let g=r.effects.map((_)=>{if(_.type==="DROP_SHADOW")return`shadow(${_.radius||0}px)`;if(_.type==="INNER_SHADOW")return`inner-shadow(${_.radius||0}px)`;if(_.type==="LAYER_BLUR")return`blur(${_.radius||0}px)`;if(_.type==="BACKGROUND_BLUR")return`backdrop-blur(${_.radius||0}px)`;return _.type.toLowerCase()});o.push(`effects: ${g.join(", ")}`)}if(r.rotation&&r.rotation!==0)o.push(`rotate: ${Math.round(r.rotation)}°`);if(r.blendMode&&r.blendMode!=="PASS_THROUGH"&&r.blendMode!=="NORMAL")o.push(`blend: ${r.blendMode.toLowerCase().replace(/_/g,"-")}`);if(r.clipsContent)o.push("overflow: hidden");if(r.fontSize){let g=r.fontFamily||"",_=r.fontStyle||"";o.push(`font: ${r.fontSize}px ${g} ${_}`.trim())}if(r.characters&&!i)o.push(`text: "${r.characters}"`);if(r.childCount!==void 0&&typeof r.childCount==="number"&&r.childCount>0)o.push(`children: ${r.childCount}`);if(r.layoutMode){let g=`${r.layoutMode.toLowerCase()}`;if(r.layoutWrap==="WRAP")g+=" wrap";if(r.itemSpacing)g+=` gap=${r.itemSpacing}`;o.push(`flex: ${g}`)}let l=[];if(r.minWidth!==void 0&&r.minWidth!==null)l.push(`min-w: ${r.minWidth}`);if(r.maxWidth!==void 0&&r.maxWidth!==null)l.push(`max-w: ${r.maxWidth}`);if(r.minHeight!==void 0&&r.minHeight!==null)l.push(`min-h: ${r.minHeight}`);if(r.maxHeight!==void 0&&r.maxHeight!==null)l.push(`max-h: ${r.maxHeight}`);if(l.length>0)o.push(l.join(", "));if(r.layoutPositioning==="ABSOLUTE")o.push("position: absolute");if(r.layoutGrow&&r.layoutGrow>0)o.push(`grow: ${r.layoutGrow}`);if(r.opacity!==void 0&&r.opacity!==1)o.push(`opacity: ${r.opacity}`);for(let g of o)u.push(`${t} ${g}`);let m=r.componentPropertyDefinitions;if(m&&Object.keys(m).length>0){u.push(""),u.push(`${t} variants:`);for(let[g,_]of Object.entries(m))if(_.type==="VARIANT"&&_.variantOptions){let q=_.defaultValue?` (default: ${_.defaultValue})`:"";u.push(`${t} ${g}: ${_.variantOptions.join(" | ")}${q}`)}}let c=r.componentProperties;if(c&&Object.keys(c).length>0){u.push(""),u.push(`${t} properties:`);for(let[g,_]of Object.entries(c))u.push(`${t} ${g}: ${_.value}`)}return u.join(`
|
|
84
|
+
`)}function N7(r){let t=r.map((u)=>{let D=Bn(u.type),i=u.name||u.characters||"",n=u.id,o=qn(u),e={};if(o)e.box=o;let f=Ti(u.fills);if(f)e.fill=f;let $=Ri(u.strokes,u.strokeWeight);if($)e.stroke=$;if(u.cornerRadius&&u.cornerRadius!==0)e.radius=`${u.cornerRadius}px`;return{header:`${D} "${i}" (${n})`,details:Object.keys(e).length>0?e:void 0}});return l$(t)}function T4(r,t="Created"){let u=Bn(r.type),D=r.name||r.characters||"",i=[Dr(`${t} ${u} "${D}"`)];i.push(` id: ${r.id}`);let n=qn(r);if(n)i.push(` box: ${n}`);let o=Ti(r.fills);if(o)i.push(` fill: ${o}`);let e=Ri(r.strokes,r.strokeWeight);if(e)i.push(` stroke: ${e}`);if(r.cornerRadius&&r.cornerRadius!==0)i.push(` radius: ${r.cornerRadius}px`);if(r.fontSize)i.push(` font: ${r.fontSize}px`);return i.join(`
|
|
85
|
+
`)}function B7(r){return r.filename?Dr(`Exported to ${r.filename}`):Dr("Exported")}function q7(r){return r.deleted?Dr("Deleted"):d("Delete failed")}function h7(r){let t=[],u=r.type.toLowerCase(),D=r.name,i=r.id;t.push($$(u,D,i));let n=r.valuesByMode;if(n){let o=Object.entries(n);if(o.length===1&&o[0])t.push(` value: ${o[0][1]}`);else for(let[e,f]of o)t.push(` ${e}: ${f}`)}if(r.collectionId)t.push(` collection: ${r.collectionId}`);return t.join(`
|
|
86
|
+
`)}function z7(r){let t=r.map((u)=>({header:`"${u.name}" (${u.id})`}));return l$(t)}function J7(r){return r.pluginConnected?Dr("Plugin connected"):d("Plugin not connected")}function m$(r,t){if(r===null||r===void 0)return"";if(typeof r==="string")return r;if(Array.isArray(r)){if(r.length===0)return"(empty)";if(r[0]?.id&&r[0]?.name!==void 0){if(r[0]?.type)return N7(r);return z7(r)}return JSON.stringify(r,null,2)}if(typeof r==="object"){let u=r;if("deleted"in u&&u.deleted!==void 0)return q7({deleted:Boolean(u.deleted)});if(t==="path"&&"paths"in u){let D=u.paths;return Dr("Path updated")+`
|
|
87
|
+
`+D.map((i)=>er(i.data)).join(`
|
|
88
|
+
`)}if("updated"in u&&u.updated===!0)return Dr("Updated");if(t==="export"||"data"in u)return B7({data:String(u.data??""),filename:u.filename});if("pluginConnected"in u)return J7({pluginConnected:Boolean(u.pluginConnected)});if(u.id&&u.type&&u.valuesByMode)return h7(u);if(u.id&&u.type){if(t==="create")return T4(u,"Created");if(t==="update")return T4(u,"Updated");return y7(u)}if(u.id&&u.name&&!u.type)return`[page] "${u.name}" (${u.id})`;if(u.center&&u.zoom)return Dr(`Zoomed to fit (${(u.zoom*100).toFixed(0)}%)`);if(u.selection!==void 0){let D=u.selection;if(D.length===0)return"(no selection)";return`Selected: ${D.join(", ")}`}if(u.selected!==void 0){let D=u.selected;return Dr(`Selected ${D} node${D!==1?"s":""}`)}return JSON.stringify(u,null,2)}return String(r)}function C(r,t=!1,u){if(t)console.log(JSON.stringify(r,null,2));else console.log(m$(r,u))}function R4(r){let t=r instanceof Error?r.message:String(r);console.error(d(t))}var Dt=k(()=>{At();mr()});import{createHash as A7}from"crypto";import{dirname as X7,join as Zu}from"path";import{fileURLToPath as j7}from"url";import{existsSync as W7,readFileSync as Y7,writeFileSync as T7,statSync as R7}from"fs";import{tmpdir as V7}from"os";function G7(){let r=j7(import.meta.url),t=X7(r);if(t.includes("packages/cli/src"))return Zu(t,"../../plugin/src");if(t.includes("packages/cli"))return Zu(t,"../plugin/src");return Zu(t,"../../packages/plugin/src")}async function S7(){let r=G7(),t=Zu(r,"rpc.ts"),D=R7(t).mtimeMs;if(W7(v$))try{let e=JSON.parse(Y7(v$,"utf-8"));if(e.mtime===D&&e.code&&e.hash)return{code:e.code,hash:e.hash}}catch{}if(!c$)c$=await import("esbuild");let n=(await c$.build({entryPoints:[t],bundle:!0,write:!1,format:"iife",target:"es2020",minify:!0})).outputFiles[0].text,o=A7("sha256").update(n).digest("hex").slice(0,16);try{T7(v$,JSON.stringify({mtime:D,code:n,hash:o}))}catch{}return{code:n,hash:o}}async function K4(){let{code:r,hash:t}=await S7();if(S4&&Q4===t){if(await $i("window.__figmaRpcHash")===t)return}if(await $i(r),await $i(`window.__figmaRpcHash = ${JSON.stringify(t)}`),!await $i('typeof window.__figmaRpc === "function"'))throw new Error("Failed to inject RPC into Figma");S4=!0,Q4=t}async function In(r,t,u){await K4();let D=`window.__figmaRpc(${JSON.stringify(r)}, ${JSON.stringify(t)})`,i=await $i(D,u?.timeout||30000);if(i&&typeof i==="object"&&"__error"in i)throw new Error(i.__error);return i}async function F(r,t,u){if(hn===null)hn=n$();if(hn)try{return await o$(r,t)}catch{hn=!1}return In(r,t,u)}async function H4(){try{return await K4(),{connected:!0,fileName:await $i("figma.root.name")}}catch{return{connected:!1}}}function w(r){let{printError:t}=(Dt(),t_(V4));t(r),process.exit(1)}var S4=!1,Q4=null,hn=null,c$=null,v$;var B=k(()=>{ji();e$();Dt();ji();v$=Zu(V7(),"figma-use-rpc-cache.json")});var E$=s((K7,zn)=>{(function(){function r(v,U){Object.defineProperty(D.prototype,v,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",U[0],U[1])}})}function t(v){if(v===null||typeof v!=="object")return null;return v=cv&&v[cv]||v["@@iterator"],typeof v==="function"?v:null}function u(v,U){v=(v=v.constructor)&&(v.displayName||v.name)||"ReactClass";var G=v+"."+U;vv[G]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",U,v),vv[G]=!0)}function D(v,U,G){this.props=v,this.context=U,this.refs=Af,this.updater=G||Ev}function i(){}function n(v,U,G){this.props=v,this.context=U,this.refs=Af,this.updater=G||Ev}function o(){}function e(v){return""+v}function f(v){try{e(v);var U=!1}catch(P){U=!0}if(U){U=console;var G=U.error,V=typeof Symbol==="function"&&Symbol.toStringTag&&v[Symbol.toStringTag]||v.constructor.name||"Object";return G.call(U,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",V),e(v)}}function $(v){if(v==null)return null;if(typeof v==="function")return v.$$typeof===PC?null:v.displayName||v.name||null;if(typeof v==="string")return v;switch(v){case hf:return"Fragment";case ev:return"Profiler";case ov:return"StrictMode";case lv:return"Suspense";case LC:return"SuspenseList";case mv:return"Activity"}if(typeof v==="object")switch(typeof v.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),v.$$typeof){case nv:return"Portal";case fv:return v.displayName||"Context";case zf:return(v._context.displayName||"Context")+".Consumer";case $v:var U=v.render;return v=v.displayName,v||(v=U.displayName||U.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case Jf:return U=v.displayName||null,U!==null?U:$(v.type)||"Memo";case Yu:U=v._payload,v=v._init;try{return $(v(U))}catch(G){}}return null}function l(v){if(v===hf)return"<>";if(typeof v==="object"&&v!==null&&v.$$typeof===Yu)return"<...>";try{var U=$(v);return U?"<"+U+">":"<...>"}catch(G){return"<...>"}}function m(){var v=or.A;return v===null?null:v.getOwner()}function c(){return Error("react-stack-top-frame")}function g(v){if(on.call(v,"key")){var U=Object.getOwnPropertyDescriptor(v,"key").get;if(U&&U.isReactWarning)return!1}return v.key!==void 0}function _(v,U){function G(){bv||(bv=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",U))}G.isReactWarning=!0,Object.defineProperty(v,"key",{get:G,configurable:!0})}function q(){var v=$(this.type);return _v[v]||(_v[v]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),v=this.props.ref,v!==void 0?v:null}function y(v,U,G,V,P,fr){var ir=G.ref;return v={$$typeof:Wu,type:v,key:U,props:G,_owner:V},(ir!==void 0?ir:null)!==null?Object.defineProperty(v,"ref",{enumerable:!1,get:q}):Object.defineProperty(v,"ref",{enumerable:!1,value:null}),v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(v,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(v,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.defineProperty(v,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:fr}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v}function N(v,U){return U=y(v.type,U,v.props,v._owner,v._debugStack,v._debugTask),v._store&&(U._store.validated=v._store.validated),U}function R(v){z(v)?v._store&&(v._store.validated=1):typeof v==="object"&&v!==null&&v.$$typeof===Yu&&(v._payload.status==="fulfilled"?z(v._payload.value)&&v._payload.value._store&&(v._payload.value._store.validated=1):v._store&&(v._store.validated=1))}function z(v){return typeof v==="object"&&v!==null&&v.$$typeof===Wu}function A(v){var U={"=":"=0",":":"=2"};return"$"+v.replace(/[=:]/g,function(G){return U[G]})}function K(v,U){return typeof v==="object"&&v!==null&&v.key!=null?(f(v.key),A(""+v.key)):U.toString(36)}function L(v){switch(v.status){case"fulfilled":return v.value;case"rejected":throw v.reason;default:switch(typeof v.status==="string"?v.then(o,o):(v.status="pending",v.then(function(U){v.status==="pending"&&(v.status="fulfilled",v.value=U)},function(U){v.status==="pending"&&(v.status="rejected",v.reason=U)})),v.status){case"fulfilled":return v.value;case"rejected":throw v.reason}}throw v}function p(v,U,G,V,P){var fr=typeof v;if(fr==="undefined"||fr==="boolean")v=null;var ir=!1;if(v===null)ir=!0;else switch(fr){case"bigint":case"string":case"number":ir=!0;break;case"object":switch(v.$$typeof){case Wu:case nv:ir=!0;break;case Yu:return ir=v._init,p(ir(v._payload),U,G,V,P)}}if(ir){ir=v,P=P(ir);var wr=V===""?"."+K(ir,0):V;return gv(P)?(G="",wr!=null&&(G=wr.replace(Uv,"$&/")+"/"),p(P,U,G,"",function(St){return St})):P!=null&&(z(P)&&(P.key!=null&&(ir&&ir.key===P.key||f(P.key)),G=N(P,G+(P.key==null||ir&&ir.key===P.key?"":(""+P.key).replace(Uv,"$&/")+"/")+wr),V!==""&&ir!=null&&z(ir)&&ir.key==null&&ir._store&&!ir._store.validated&&(G._store.validated=2),P=G),U.push(P)),1}if(ir=0,wr=V===""?".":V+":",gv(v))for(var $r=0;$r<v.length;$r++)V=v[$r],fr=wr+K(V,$r),ir+=p(V,U,G,fr,P);else if($r=t(v),typeof $r==="function")for($r===v.entries&&(Iv||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Iv=!0),v=$r.call(v),$r=0;!(V=v.next()).done;)V=V.value,fr=wr+K(V,$r++),ir+=p(V,U,G,fr,P);else if(fr==="object"){if(typeof v.then==="function")return p(L(v),U,G,V,P);throw U=String(v),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ir}function a(v,U,G){if(v==null)return v;var V=[],P=0;return p(v,V,"","",function(fr){return U.call(G,fr,P++)}),V}function Q(v){if(v._status===-1){var U=v._ioInfo;U!=null&&(U.start=U.end=performance.now()),U=v._result;var G=U();if(G.then(function(P){if(v._status===0||v._status===-1){v._status=1,v._result=P;var fr=v._ioInfo;fr!=null&&(fr.end=performance.now()),G.status===void 0&&(G.status="fulfilled",G.value=P)}},function(P){if(v._status===0||v._status===-1){v._status=2,v._result=P;var fr=v._ioInfo;fr!=null&&(fr.end=performance.now()),G.status===void 0&&(G.status="rejected",G.reason=P)}}),U=v._ioInfo,U!=null){U.value=G;var V=G.displayName;typeof V==="string"&&(U.name=V)}v._status===-1&&(v._status=0,v._result=G)}if(v._status===1)return U=v._result,U===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
89
|
+
|
|
90
|
+
Your code should look like:
|
|
91
|
+
const MyComponent = lazy(() => import('./MyComponent'))
|
|
92
|
+
|
|
93
|
+
Did you accidentally put curly braces around the import?`,U),"default"in U||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
94
|
+
|
|
95
|
+
Your code should look like:
|
|
96
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,U),U.default;throw v._result}function M(){var v=or.H;return v===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
97
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
98
|
+
2. You might be breaking the Rules of Hooks
|
|
99
|
+
3. You might have more than one copy of React in the same app
|
|
100
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),v}function Jr(){or.asyncTransitions--}function Nr(v){if(en===null)try{var U=("require"+Math.random()).slice(0,7);en=(zn&&zn[U]).call(zn,"timers").setImmediate}catch(G){en=function(V){yv===!1&&(yv=!0,typeof MessageChannel==="undefined"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var P=new MessageChannel;P.port1.onmessage=V,P.port2.postMessage(void 0)}}return en(v)}function Kr(v){return 1<v.length&&typeof AggregateError==="function"?new AggregateError(v):v[0]}function Gr(v,U){U!==fn-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),fn=U}function nn(v,U,G){var V=or.actQueue;if(V!==null)if(V.length!==0)try{zi(V),Nr(function(){return nn(v,U,G)});return}catch(P){or.thrownErrors.push(P)}else or.actQueue=null;0<or.thrownErrors.length?(V=Kr(or.thrownErrors),or.thrownErrors.length=0,G(V)):U(v)}function zi(v){if(!Xf){Xf=!0;var U=0;try{for(;U<v.length;U++){var G=v[U];do{or.didUsePromise=!1;var V=G(!1);if(V!==null){if(or.didUsePromise){v[U]=G,v.splice(0,U);return}G=V}else break}while(1)}v.length=0}catch(P){v.splice(0,U+1),or.thrownErrors.push(P)}finally{Xf=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Wu=Symbol.for("react.transitional.element"),nv=Symbol.for("react.portal"),hf=Symbol.for("react.fragment"),ov=Symbol.for("react.strict_mode"),ev=Symbol.for("react.profiler"),zf=Symbol.for("react.consumer"),fv=Symbol.for("react.context"),$v=Symbol.for("react.forward_ref"),lv=Symbol.for("react.suspense"),LC=Symbol.for("react.suspense_list"),Jf=Symbol.for("react.memo"),Yu=Symbol.for("react.lazy"),mv=Symbol.for("react.activity"),cv=Symbol.iterator,vv={},Ev={isMounted:function(){return!1},enqueueForceUpdate:function(v){u(v,"forceUpdate")},enqueueReplaceState:function(v){u(v,"replaceState")},enqueueSetState:function(v){u(v,"setState")}},Fv=Object.assign,Af={};Object.freeze(Af),D.prototype.isReactComponent={},D.prototype.setState=function(v,U){if(typeof v!=="object"&&typeof v!=="function"&&v!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,v,U,"setState")},D.prototype.forceUpdate=function(v){this.updater.enqueueForceUpdate(this,v,"forceUpdate")};var tt={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(Tu in tt)tt.hasOwnProperty(Tu)&&r(Tu,tt[Tu]);i.prototype=D.prototype,tt=n.prototype=new i,tt.constructor=n,Fv(tt,D.prototype),tt.isPureReactComponent=!0;var gv=Array.isArray,PC=Symbol.for("react.client.reference"),or={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},on=Object.prototype.hasOwnProperty,wv=console.createTask?console.createTask:function(){return null};tt={react_stack_bottom_frame:function(v){return v()}};var bv,Cv,_v={},kC=tt.react_stack_bottom_frame.bind(tt,c)(),dC=wv(l(c)),Iv=!1,Uv=/\/+/g,Ov=typeof reportError==="function"?reportError:function(v){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof v==="object"&&v!==null&&typeof v.message==="string"?String(v.message):String(v),error:v});if(!window.dispatchEvent(U))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",v);return}console.error(v)},yv=!1,en=null,fn=0,$n=!1,Xf=!1,Nv=typeof queueMicrotask==="function"?function(v){queueMicrotask(function(){return queueMicrotask(v)})}:Nr;tt=Object.freeze({__proto__:null,c:function(v){return M().useMemoCache(v)}});var Tu={map:a,forEach:function(v,U,G){a(v,function(){U.apply(this,arguments)},G)},count:function(v){var U=0;return a(v,function(){U++}),U},toArray:function(v){return a(v,function(U){return U})||[]},only:function(v){if(!z(v))throw Error("React.Children.only expected to receive a single React element child.");return v}};K7.Activity=mv,K7.Children=Tu,K7.Component=D,K7.Fragment=hf,K7.Profiler=ev,K7.PureComponent=n,K7.StrictMode=ov,K7.Suspense=lv,K7.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=or,K7.__COMPILER_RUNTIME=tt,K7.act=function(v){var U=or.actQueue,G=fn;fn++;var V=or.actQueue=U!==null?U:[],P=!1;try{var fr=v()}catch($r){or.thrownErrors.push($r)}if(0<or.thrownErrors.length)throw Gr(U,G),v=Kr(or.thrownErrors),or.thrownErrors.length=0,v;if(fr!==null&&typeof fr==="object"&&typeof fr.then==="function"){var ir=fr;return Nv(function(){P||$n||($n=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function($r,St){P=!0,ir.then(function(Ji){if(Gr(U,G),G===0){try{zi(V),Nr(function(){return nn(Ji,$r,St)})}catch(pC){or.thrownErrors.push(pC)}if(0<or.thrownErrors.length){var xC=Kr(or.thrownErrors);or.thrownErrors.length=0,St(xC)}}else $r(Ji)},function(Ji){Gr(U,G),0<or.thrownErrors.length?(Ji=Kr(or.thrownErrors),or.thrownErrors.length=0,St(Ji)):St(Ji)})}}}var wr=fr;if(Gr(U,G),G===0&&(zi(V),V.length!==0&&Nv(function(){P||$n||($n=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),or.actQueue=null),0<or.thrownErrors.length)throw v=Kr(or.thrownErrors),or.thrownErrors.length=0,v;return{then:function($r,St){P=!0,G===0?(or.actQueue=V,Nr(function(){return nn(wr,$r,St)})):$r(wr)}}},K7.cache=function(v){return function(){return v.apply(null,arguments)}},K7.cacheSignal=function(){return null},K7.captureOwnerStack=function(){var v=or.getCurrentStack;return v===null?null:v()},K7.cloneElement=function(v,U,G){if(v===null||v===void 0)throw Error("The argument must be a React element, but you passed "+v+".");var V=Fv({},v.props),P=v.key,fr=v._owner;if(U!=null){var ir;r:{if(on.call(U,"ref")&&(ir=Object.getOwnPropertyDescriptor(U,"ref").get)&&ir.isReactWarning){ir=!1;break r}ir=U.ref!==void 0}ir&&(fr=m()),g(U)&&(f(U.key),P=""+U.key);for(wr in U)!on.call(U,wr)||wr==="key"||wr==="__self"||wr==="__source"||wr==="ref"&&U.ref===void 0||(V[wr]=U[wr])}var wr=arguments.length-2;if(wr===1)V.children=G;else if(1<wr){ir=Array(wr);for(var $r=0;$r<wr;$r++)ir[$r]=arguments[$r+2];V.children=ir}V=y(v.type,P,V,fr,v._debugStack,v._debugTask);for(P=2;P<arguments.length;P++)R(arguments[P]);return V},K7.createContext=function(v){return v={$$typeof:fv,_currentValue:v,_currentValue2:v,_threadCount:0,Provider:null,Consumer:null},v.Provider=v,v.Consumer={$$typeof:zf,_context:v},v._currentRenderer=null,v._currentRenderer2=null,v},K7.createElement=function(v,U,G){for(var V=2;V<arguments.length;V++)R(arguments[V]);V={};var P=null;if(U!=null)for($r in Cv||!("__self"in U)||"key"in U||(Cv=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),g(U)&&(f(U.key),P=""+U.key),U)on.call(U,$r)&&$r!=="key"&&$r!=="__self"&&$r!=="__source"&&(V[$r]=U[$r]);var fr=arguments.length-2;if(fr===1)V.children=G;else if(1<fr){for(var ir=Array(fr),wr=0;wr<fr;wr++)ir[wr]=arguments[wr+2];Object.freeze&&Object.freeze(ir),V.children=ir}if(v&&v.defaultProps)for($r in fr=v.defaultProps,fr)V[$r]===void 0&&(V[$r]=fr[$r]);P&&_(V,typeof v==="function"?v.displayName||v.name||"Unknown":v);var $r=1e4>or.recentlyCreatedOwnerStacks++;return y(v,P,V,m(),$r?Error("react-stack-top-frame"):kC,$r?wv(l(v)):dC)},K7.createRef=function(){var v={current:null};return Object.seal(v),v},K7.forwardRef=function(v){v!=null&&v.$$typeof===Jf?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof v!=="function"?console.error("forwardRef requires a render function but was given %s.",v===null?"null":typeof v):v.length!==0&&v.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",v.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),v!=null&&v.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var U={$$typeof:$v,render:v},G;return Object.defineProperty(U,"displayName",{enumerable:!1,configurable:!0,get:function(){return G},set:function(V){G=V,v.name||v.displayName||(Object.defineProperty(v,"name",{value:V}),v.displayName=V)}}),U},K7.isValidElement=z,K7.lazy=function(v){v={_status:-1,_result:v};var U={$$typeof:Yu,_payload:v,_init:Q},G={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return v._ioInfo=G,U._debugInfo=[{awaited:G}],U},K7.memo=function(v,U){v==null&&console.error("memo: The first argument must be a component. Instead received: %s",v===null?"null":typeof v),U={$$typeof:Jf,type:v,compare:U===void 0?null:U};var G;return Object.defineProperty(U,"displayName",{enumerable:!1,configurable:!0,get:function(){return G},set:function(V){G=V,v.name||v.displayName||(Object.defineProperty(v,"name",{value:V}),v.displayName=V)}}),U},K7.startTransition=function(v){var U=or.T,G={};G._updatedFibers=new Set,or.T=G;try{var V=v(),P=or.S;P!==null&&P(G,V),typeof V==="object"&&V!==null&&typeof V.then==="function"&&(or.asyncTransitions++,V.then(Jr,Jr),V.then(o,Ov))}catch(fr){Ov(fr)}finally{U===null&&G._updatedFibers&&(v=G._updatedFibers.size,G._updatedFibers.clear(),10<v&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),U!==null&&G.types!==null&&(U.types!==null&&U.types!==G.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),U.types=G.types),or.T=U}},K7.unstable_useCacheRefresh=function(){return M().useCacheRefresh()},K7.use=function(v){return M().use(v)},K7.useActionState=function(v,U,G){return M().useActionState(v,U,G)},K7.useCallback=function(v,U){return M().useCallback(v,U)},K7.useContext=function(v){var U=M();return v.$$typeof===zf&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),U.useContext(v)},K7.useDebugValue=function(v,U){return M().useDebugValue(v,U)},K7.useDeferredValue=function(v,U){return M().useDeferredValue(v,U)},K7.useEffect=function(v,U){return v==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),M().useEffect(v,U)},K7.useEffectEvent=function(v){return M().useEffectEvent(v)},K7.useId=function(){return M().useId()},K7.useImperativeHandle=function(v,U,G){return M().useImperativeHandle(v,U,G)},K7.useInsertionEffect=function(v,U){return v==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),M().useInsertionEffect(v,U)},K7.useLayoutEffect=function(v,U){return v==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),M().useLayoutEffect(v,U)},K7.useMemo=function(v,U){return M().useMemo(v,U)},K7.useOptimistic=function(v,U){return M().useOptimistic(v,U)},K7.useReducer=function(v,U,G){return M().useReducer(v,U,G)},K7.useRef=function(v){return M().useRef(v)},K7.useState=function(v){return M().useState(v)},K7.useSyncExternalStore=function(v,U,G){return M().useSyncExternalStore(v,U,G)},K7.useTransition=function(){return M().useTransition()},K7.version="19.2.4",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});function lr(r){return{meta:{severity:"warning",...r.meta},match:r.match,check:r.check}}function Hi(r){let t=Math.round(r.r*255),u=Math.round(r.g*255),D=Math.round(r.b*255);return`#${t.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}${D.toString(16).padStart(2,"0")}`.toUpperCase()}function W$(r,t){return Math.sqrt(Math.pow(r.r-t.r,2)+Math.pow(r.g-t.g,2)+Math.pow(r.b-t.b,2))}function G$(r){let[t,u,D]=[r.r,r.g,r.b].map((i)=>{return i<=0.03928?i/12.92:Math.pow((i+0.055)/1.055,2.4)});return 0.2126*t+0.7152*u+0.0722*D}function Y$(r,t){let u=G$(r),D=G$(t),i=Math.max(u,D),n=Math.min(u,D);return(i+0.05)/(n+0.05)}function T$(r,t,u=0.01){if(t===0)return!1;let D=r%t;return D<u||t-D<u}function R$(r){let t=[],u=r;while(u)t.unshift(u.name),u=u.parent;return t}function V$(r){return/^(Frame|Rectangle|Ellipse|Line|Text|Group|Vector|Polygon|Star|Section|Component|Instance|Slice)\s*\d*$/i.test(r)}var S$;var gi=k(()=>{S$=[0,1,2,4,8,12,16,20,24,32,40,48,56,64,80,96,128]});var Gn;var Q$=k(()=>{gi();Gn=lr({meta:{id:"no-hardcoded-colors",category:"design-tokens",description:"Colors should use variables instead of hardcoded values",fixable:!0},match:["RECTANGLE","ELLIPSE","FRAME","TEXT","VECTOR","LINE","POLYGON","STAR","COMPONENT","INSTANCE"],check(r,t){let u=(D,i)=>{if(!D)return;for(let n of D){if(n.type!=="SOLID")continue;if(n.visible===!1)continue;if(n.boundVariables?.color)continue;if(!n.color)continue;let o=Hi(n.color),e=t.findSimilarVariable(n.color,"COLOR");t.report({node:r,message:`Hardcoded ${i} color ${o}`,suggest:e?`Use variable "${e.name}"`:void 0,fix:e?{action:"bind-variable",params:{variableId:e.id,field:i==="fill"?"fills":"strokes"}}:void 0})}};u(r.fills,"fill"),u(r.strokes,"stroke")}})});var Wn;var K$=k(()=>{gi();Wn=lr({meta:{id:"no-default-names",category:"naming",description:"Layers should have descriptive names, not default Figma names",fixable:!1},check(r,t){if(!V$(r.name))return;if((r.type==="RECTANGLE"||r.type==="ELLIPSE"||r.type==="LINE")&&r.width!==void 0&&r.height!==void 0&&r.width<24&&r.height<24)return;t.report({node:r,message:`Default layer name "${r.name}" is not descriptive`,suggest:`Rename to describe the layer's purpose (e.g., "header-background", "submit-button")`})}})});function BU(r){for(let t=0;t<r.length;t++)for(let u=t+1;u<r.length;u++){let D=r[t],i=r[u];if(D.x===void 0||D.y===void 0||D.width===void 0||D.height===void 0||i.x===void 0||i.y===void 0||i.width===void 0||i.height===void 0)continue;let n=D.x<i.x+i.width&&D.x+D.width>i.x,o=D.y<i.y+i.height&&D.y+D.height>i.y;if(n&&o)return!0}return!1}var Yn;var H$=k(()=>{Yn=lr({meta:{id:"prefer-auto-layout",category:"layout",description:"Frames with multiple children should use Auto Layout for responsive design",fixable:!1},match:["FRAME","COMPONENT"],check(r,t){let D=t.getConfig()?.minChildren??2;if(r.layoutMode&&r.layoutMode!=="NONE")return;if(!r.children||r.children.length<D)return;if(BU(r.children))return;t.report({node:r,message:`Frame with ${r.children.length} children doesn't use Auto Layout`,suggest:"Add Auto Layout (VERTICAL or HORIZONTAL) for better responsiveness"})}})});var Tn;var M$=k(()=>{gi();Tn=lr({meta:{id:"consistent-spacing",category:"layout",description:"Spacing values should follow the spacing scale (multiples of base unit)",fixable:!0},match:["FRAME","COMPONENT"],check(r,t){let u=t.getConfig(),D=u?.base??8,i=u?.allowedValues??S$,n=u?.checkGap??!0,o=u?.checkPadding??!0;if(!r.layoutMode||r.layoutMode==="NONE")return;let e=(l)=>{if(i.includes(l))return!0;return T$(l,D)},f=(l)=>{return i.reduce((m,c)=>Math.abs(c-l)<Math.abs(m-l)?c:m)};if(n&&r.itemSpacing!==void 0&&!e(r.itemSpacing)){let l=f(r.itemSpacing);t.report({node:r,message:`Gap ${r.itemSpacing}px is not in spacing scale`,suggest:`Use ${l}px instead`,fix:{action:"set-layout",params:{gap:l}}})}let $=[{name:"paddingTop",value:r.paddingTop},{name:"paddingRight",value:r.paddingRight},{name:"paddingBottom",value:r.paddingBottom},{name:"paddingLeft",value:r.paddingLeft}];if(o)for(let{name:l,value:m}of $){if(m===void 0||e(m))continue;let c=f(m);t.report({node:r,message:`${l} ${m}px is not in spacing scale`,suggest:`Use ${c}px instead`})}}})});var qU,Rn;var Z$=k(()=>{qU=[0,2,4,6,8,12,16,20,24,32,9999],Rn=lr({meta:{id:"consistent-radius",category:"design-tokens",description:"Corner radius should use values from the design system scale",fixable:!0},match:["RECTANGLE","FRAME","COMPONENT","INSTANCE"],check(r,t){if(r.cornerRadius===void 0||r.cornerRadius===0)return;let D=t.getConfig()?.allowedValues??qU;if(D.includes(r.cornerRadius))return;let i=D.reduce((n,o)=>Math.abs(o-r.cornerRadius)<Math.abs(n-r.cornerRadius)?o:n);t.report({node:r,message:`Corner radius ${r.cornerRadius}px is not in scale`,suggest:`Use ${i}px instead`,fix:{action:"set-layout",params:{radius:i}}})}})});function zU(r){let t=r.fills;if(!t||t.length===0)return null;return t.find((D)=>D.type==="SOLID"&&D.visible!==!1&&!!D.color)?.color??null}function JU(r){let t=r.parent;while(t){if(t.fills){let u=t.fills.find((D)=>D.type==="SOLID"&&D.visible!==!1&&!!D.color);if(u?.color){let D=u.opacity??1;if(D<1)return{r:u.color.r*D+1*(1-D),g:u.color.g*D+1*(1-D),b:u.color.b*D+1*(1-D)};return u.color}}t=t.parent}return{r:1,g:1,b:1}}var hU,Vn;var L$=k(()=>{gi();hU={AA:{normal:4.5,large:3},AAA:{normal:7,large:4.5}},Vn=lr({meta:{id:"color-contrast",category:"accessibility",severity:"error",description:"Text must have sufficient color contrast against its background (WCAG)",fixable:!1},match:["TEXT"],check(r,t){let u=t.getConfig(),D=u?.level??"AA",i=u?.largeTextSize??18,n=zU(r);if(!n)return;let o=JU(r);if(!o)return;let e=Y$(n,o),f=(r.fontSize??16)>=i,$=hU[D][f?"large":"normal"];if(e<$)t.report({node:r,message:`Contrast ratio ${e.toFixed(2)}:1 is below ${D} threshold (${$}:1)`,suggest:`Text color: ${Hi(n)}, Background: ${Hi(o)}. Increase contrast.`})}})});function AU(r,t){if(t==="COMPONENT"||t==="INSTANCE")return zE.some((u)=>u.test(r));return zE.some((u)=>u.test(r))}var zE,Sn;var P$=k(()=>{zE=[/button/i,/btn/i,/link/i,/cta/i,/icon/i,/checkbox/i,/radio/i,/switch/i,/toggle/i,/input/i,/select/i,/dropdown/i,/menu/i,/tab/i,/chip/i,/tag/i,/close/i,/dismiss/i,/action/i,/clickable/i,/tappable/i],Sn=lr({meta:{id:"touch-target-size",category:"accessibility",description:"Interactive elements should be at least 44x44px for touch accessibility",fixable:!0},match:["FRAME","COMPONENT","INSTANCE","RECTANGLE","ELLIPSE"],check(r,t){let D=t.getConfig()?.minSize??44;if(!AU(r.name,r.type))return;let i=r.width??0,n=r.height??0;if(i>=D&&n>=D)return;let o=[];if(i<D)o.push(`width ${i}px`);if(n<D)o.push(`height ${n}px`);t.report({node:r,message:`Touch target too small: ${o.join(", ")} (minimum ${D}px)`,suggest:`Resize to at least ${D}x${D}px or add padding`,fix:{action:"resize",params:{width:Math.max(i,D),height:Math.max(n,D)}}})}})});var Qn;var k$=k(()=>{Qn=lr({meta:{id:"text-style-required",category:"typography",description:"Text layers should use shared text styles for consistency",fixable:!1},match:["TEXT"],check(r,t){let u=t.getConfig();if(r.textStyleId)return;if(!r.characters||r.characters.length<=2)return;if(u?.allowInComponents){let D=r.parent;while(D){if(D.type==="COMPONENT")return;D=D.parent}}t.report({node:r,message:"Text layer without text style",suggest:`Apply a text style to "${r.characters.slice(0,30)}${r.characters.length>30?"...":""}"`})}})});var Kn;var d$=k(()=>{Kn=lr({meta:{id:"min-text-size",category:"accessibility",description:"Text should be large enough to be readable (minimum 12px)",fixable:!0},match:["TEXT"],check(r,t){let D=t.getConfig()?.minSize??12;if(r.fontSize===void 0)return;if(r.fontSize>=D)return;t.report({node:r,message:`Text size ${r.fontSize}px is below minimum ${D}px`,suggest:`Increase to at least ${D}px for readability`,fix:{action:"resize",params:{fontSize:D}}})}})});var Hn;var x$=k(()=>{Hn=lr({meta:{id:"no-hidden-layers",category:"structure",description:"Hidden layers may indicate unused elements that should be deleted",fixable:!0},check(r,t){if(r.visible!==!1)return;if(t.getConfig()?.allowInComponents!==!1){let D=r.parent;while(D){if(D.type==="COMPONENT"||D.type==="COMPONENT_SET")return;D=D.parent}}t.report({node:r,message:"Hidden layer detected",suggest:"Delete if unused, or move to a component if needed for states",fix:{action:"set-visible",params:{visible:!0}}})}})});var Mn;var p$=k(()=>{Mn=lr({meta:{id:"no-deeply-nested",category:"structure",description:"Avoid deeply nested layers that make the design hard to maintain",fixable:!1},check(r,t){let D=t.getConfig()?.maxDepth??6,i=0,n=r.parent;while(n)i++,n=n.parent;if(i>D)t.report({node:r,message:`Layer nested ${i} levels deep (max ${D})`,suggest:"Flatten structure or extract into a component"})}})});var Zn;var a$=k(()=>{Zn=lr({meta:{id:"no-empty-frames",category:"structure",description:"Frames should not be empty unless used as spacers",fixable:!1},match:["FRAME"],check(r,t){if(!r.children||r.children.length>0)return;if(r.name.toLowerCase().includes("spacer")||r.width!==void 0&&r.height!==void 0&&(r.width<=1||r.height<=1))return;if(r.fills?.some((i)=>i.visible!==!1&&i.type==="SOLID"))return;t.report({node:r,message:"Empty frame with no fill",suggest:"Delete if unused, or add content/fill"})}})});var Ln;var s$=k(()=>{Ln=lr({meta:{id:"pixel-perfect",category:"layout",description:"Elements should be aligned to whole pixels (no subpixel values)",fixable:!0},check(r,t){let u=t.getConfig(),D=u?.checkPosition??!0,i=u?.checkSize??!0,n=u?.tolerance??0.01,o=[],e=(f)=>Math.abs(f-Math.round(f))<n;if(D){if(r.x!==void 0&&!e(r.x))o.push(`x: ${r.x}`);if(r.y!==void 0&&!e(r.y))o.push(`y: ${r.y}`)}if(i){if(r.width!==void 0&&!e(r.width))o.push(`width: ${r.width}`);if(r.height!==void 0&&!e(r.height))o.push(`height: ${r.height}`)}if(o.length===0)return;t.report({node:r,message:`Subpixel values: ${o.join(", ")}`,suggest:"Round to whole pixels for crisp rendering",fix:{action:"resize",params:{x:r.x!==void 0?Math.round(r.x):void 0,y:r.y!==void 0?Math.round(r.y):void 0,width:r.width!==void 0?Math.round(r.width):void 0,height:r.height!==void 0?Math.round(r.height):void 0}}})}})});var Pn;var rl=k(()=>{Pn=lr({meta:{id:"no-groups",category:"structure",description:"Use frames instead of groups for better layout control and auto-layout support",fixable:!1},match:["GROUP"],check(r,t){t.report({node:r,message:"Group should be converted to Frame",suggest:"Groups cannot use Auto Layout. Convert to Frame for better control."})}})});function XU(r){switch(r.type){case"DROP_SHADOW":return`Drop shadow ${r.radius??0}px`;case"INNER_SHADOW":return`Inner shadow ${r.radius??0}px`;case"LAYER_BLUR":return`Layer blur ${r.radius??0}px`;case"BACKGROUND_BLUR":return`Background blur ${r.radius??0}px`;default:return r.type}}var kn;var tl=k(()=>{kn=lr({meta:{id:"effect-style-required",category:"design-tokens",description:"Effects (shadows, blurs) should use shared effect styles",fixable:!1},check(r,t){if(!r.effects||r.effects.length===0)return;let u=r.effects.filter((i)=>i.visible!==!1);if(u.length===0)return;if(r.effectStyleId)return;let D=u.map(XU).join(", ");t.report({node:r,message:`Effect without shared style: ${D}`,suggest:"Create an effect style for consistent shadows and blurs"})}})});var dn;var il=k(()=>{dn=lr({meta:{id:"no-mixed-styles",category:"typography",description:"Text layers should not have mixed font styles (different fonts/sizes in one layer)",fixable:!1},match:["TEXT"],check(r,t){if(!r.characters||r.characters.length===0)return;if(r.fontSize===void 0&&r.characters.length>1)t.report({node:r,message:"Text layer has mixed font styles",suggest:"Split into separate text layers or unify the text style"})}})});var jU,xn;var ul=k(()=>{jU=[/^(button|btn)/i,/^(input|field|text-?field)/i,/^(card|modal|dialog)/i,/^(icon|avatar|badge)/i,/^(nav|menu|tab)/i,/^(header|footer|sidebar)/i,/^(list|item|row)/i,/^(chip|tag|label)/i,/^(tooltip|popover|dropdown)/i],xn=lr({meta:{id:"no-detached-instances",category:"components",description:"Frames that look like components should be instances, not detached copies",fixable:!1},match:["FRAME"],check(r,t){let u=t.getConfig();if(r.type==="COMPONENT"||r.type==="INSTANCE")return;if(!(u?.patterns?.map((o)=>new RegExp(o,"i"))??jU).some((o)=>o.test(r.name)))return;if(!(r.children&&r.children.length>0&&r.layoutMode&&r.layoutMode!=="NONE"))return;t.report({node:r,message:`Frame "${r.name}" looks like a component but isn't an instance`,suggest:"Use a component instance instead of a detached frame for consistency"})}})});var JE={};Or(JE,{touchTargetSize:()=>Sn,textStyleRequired:()=>Qn,preferAutoLayout:()=>Yn,pixelPerfect:()=>Ln,noMixedStyles:()=>dn,noHiddenLayers:()=>Hn,noHardcodedColors:()=>Gn,noGroups:()=>Pn,noEmptyFrames:()=>Zn,noDetachedInstances:()=>xn,noDefaultNames:()=>Wn,noDeeplyNested:()=>Mn,minTextSize:()=>Kn,effectStyleRequired:()=>kn,consistentSpacing:()=>Tn,consistentRadius:()=>Rn,colorContrast:()=>Vn,allRules:()=>pn});var pn;var an=k(()=>{Q$();K$();H$();M$();Z$();L$();P$();k$();d$();x$();p$();a$();s$();rl();tl();il();ul();L$();Z$();M$();tl();d$();p$();K$();ul();a$();rl();Q$();x$();il();s$();H$();k$();P$();pn={"no-hardcoded-colors":Gn,"no-default-names":Wn,"prefer-auto-layout":Yn,"consistent-spacing":Tn,"consistent-radius":Rn,"color-contrast":Vn,"touch-target-size":Sn,"text-style-required":Qn,"min-text-size":Kn,"no-hidden-layers":Hn,"no-deeply-nested":Mn,"no-empty-frames":Zn,"pixel-perfect":Ln,"no-groups":Pn,"effect-style-required":kn,"no-mixed-styles":dn,"no-detached-instances":xn}});class jr{diff(r,t,u={}){let D;if(typeof u==="function")D=u,u={};else if("callback"in u)D=u.callback;let i=this.castInput(r,u),n=this.castInput(t,u),o=this.removeEmpty(this.tokenize(i,u)),e=this.removeEmpty(this.tokenize(n,u));return this.diffWithOptionsObj(o,e,u,D)}diffWithOptionsObj(r,t,u,D){var i;let n=(N)=>{if(N=this.postProcess(N,u),D){setTimeout(function(){D(N)},0);return}else return N},o=t.length,e=r.length,f=1,$=o+e;if(u.maxEditLength!=null)$=Math.min($,u.maxEditLength);let l=(i=u.timeout)!==null&&i!==void 0?i:1/0,m=Date.now()+l,c=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(c[0],t,r,0,u);if(c[0].oldPos+1>=e&&g+1>=o)return n(this.buildValues(c[0].lastComponent,t,r));let _=-1/0,q=1/0,y=()=>{for(let N=Math.max(_,-f);N<=Math.min(q,f);N+=2){let R,z=c[N-1],A=c[N+1];if(z)c[N-1]=void 0;let K=!1;if(A){let p=A.oldPos-N;K=A&&0<=p&&p<o}let L=z&&z.oldPos+1<e;if(!K&&!L){c[N]=void 0;continue}if(!L||K&&z.oldPos<A.oldPos)R=this.addToPath(A,!0,!1,0,u);else R=this.addToPath(z,!1,!0,1,u);if(g=this.extractCommon(R,t,r,N,u),R.oldPos+1>=e&&g+1>=o)return n(this.buildValues(R.lastComponent,t,r))||!0;else{if(c[N]=R,R.oldPos+1>=e)q=Math.min(q,N-1);if(g+1>=o)_=Math.max(_,N+1)}}f++};if(D)(function N(){setTimeout(function(){if(f>$||Date.now()>m)return D(void 0);if(!y())N()},0)})();else while(f<=$&&Date.now()<=m){let N=y();if(N)return N}}addToPath(r,t,u,D,i){let n=r.lastComponent;if(n&&!i.oneChangePerToken&&n.added===t&&n.removed===u)return{oldPos:r.oldPos+D,lastComponent:{count:n.count+1,added:t,removed:u,previousComponent:n.previousComponent}};else return{oldPos:r.oldPos+D,lastComponent:{count:1,added:t,removed:u,previousComponent:n}}}extractCommon(r,t,u,D,i){let n=t.length,o=u.length,e=r.oldPos,f=e-D,$=0;while(f+1<n&&e+1<o&&this.equals(u[e+1],t[f+1],i))if(f++,e++,$++,i.oneChangePerToken)r.lastComponent={count:1,previousComponent:r.lastComponent,added:!1,removed:!1};if($&&!i.oneChangePerToken)r.lastComponent={count:$,previousComponent:r.lastComponent,added:!1,removed:!1};return r.oldPos=e,f}equals(r,t,u){if(u.comparator)return u.comparator(r,t);else return r===t||!!u.ignoreCase&&r.toLowerCase()===t.toLowerCase()}removeEmpty(r){let t=[];for(let u=0;u<r.length;u++)if(r[u])t.push(r[u]);return t}castInput(r,t){return r}tokenize(r,t){return Array.from(r)}join(r){return r.join("")}postProcess(r,t){return r}get useLongestToken(){return!1}buildValues(r,t,u){let D=[],i;while(r)D.push(r),i=r.previousComponent,delete r.previousComponent,r=i;D.reverse();let n=D.length,o=0,e=0,f=0;for(;o<n;o++){let $=D[o];if(!$.removed){if(!$.added&&this.useLongestToken){let l=t.slice(e,e+$.count);l=l.map(function(m,c){let g=u[f+c];return g.length>m.length?g:m}),$.value=this.join(l)}else $.value=this.join(t.slice(e,e+$.count));if(e+=$.count,!$.added)f+=$.count}else $.value=this.join(u.slice(f,f+$.count)),f+=$.count}return D}}var r8,TN;var t8=k(()=>{r8=class r8 extends jr{};TN=new r8});function i2(r,t){let u;for(u=0;u<r.length&&u<t.length;u++)if(r[u]!=t[u])return r.slice(0,u);return r.slice(0,u)}function u2(r,t){let u;if(!r||!t||r[r.length-1]!=t[t.length-1])return"";for(u=0;u<r.length&&u<t.length;u++)if(r[r.length-(u+1)]!=t[t.length-(u+1)])return r.slice(-u);return r.slice(-u)}function Ve(r,t,u){if(r.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(r)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return u+r.slice(t.length)}function Se(r,t,u){if(!t)return r+u;if(r.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(r)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return r.slice(0,-t.length)+u}function Ou(r,t){return Ve(r,t,"")}function TD(r,t){return Se(r,t,"")}function D2(r,t){return t.slice(0,RN(r,t))}function RN(r,t){let u=0;if(r.length>t.length)u=r.length-t.length;let D=t.length;if(r.length<t.length)D=r.length;let i=Array(D),n=0;i[0]=0;for(let o=1;o<D;o++){if(t[o]==t[n])i[o]=i[n];else i[o]=n;while(n>0&&t[o]!=t[n])n=i[n];if(t[o]==t[n])n++}n=0;for(let o=u;o<r.length;o++){while(n>0&&r[o]!=t[n])n=i[n];if(r[o]==t[n])n++}return n}function yu(r){let t;for(t=r.length-1;t>=0;t--)if(!r[t].match(/\s/))break;return r.substring(t+1)}function Wt(r){let t=r.match(/^\s*/);return t?t[0]:""}function i8(r,t,u,D){if(t&&u){let i=Wt(t.value),n=yu(t.value),o=Wt(u.value),e=yu(u.value);if(r){let f=i2(i,o);r.value=Se(r.value,o,f),t.value=Ou(t.value,f),u.value=Ou(u.value,f)}if(D){let f=u2(n,e);D.value=Ve(D.value,e,f),t.value=TD(t.value,f),u.value=TD(u.value,f)}}else if(u){if(r){let i=Wt(u.value);u.value=u.value.substring(i.length)}if(D){let i=Wt(D.value);D.value=D.value.substring(i.length)}}else if(r&&D){let i=Wt(D.value),n=Wt(t.value),o=yu(t.value),e=i2(i,n);t.value=Ou(t.value,e);let f=u2(Ou(i,e),o);t.value=TD(t.value,f),D.value=Ve(D.value,i,f),r.value=Se(r.value,i,i.slice(0,i.length-f.length))}else if(D){let i=Wt(D.value),n=yu(t.value),o=D2(n,i);t.value=TD(t.value,o)}else if(r){let i=yu(r.value),n=Wt(t.value),o=D2(i,n);t.value=Ou(t.value,o)}}var Qe="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",VN,u8,SN,D8,QN;var n8=k(()=>{VN=new RegExp(`[${Qe}]+|\\s+|[^${Qe}]`,"ug");u8=class u8 extends jr{equals(r,t,u){if(u.ignoreCase)r=r.toLowerCase(),t=t.toLowerCase();return r.trim()===t.trim()}tokenize(r,t={}){let u;if(t.intlSegmenter){let n=t.intlSegmenter;if(n.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');u=[];for(let o of Array.from(n.segment(r))){let e=o.segment;if(u.length&&/\s/.test(u[u.length-1])&&/\s/.test(e))u[u.length-1]+=e;else u.push(e)}}else u=r.match(VN)||[];let D=[],i=null;return u.forEach((n)=>{if(/\s/.test(n))if(i==null)D.push(n);else D.push(D.pop()+n);else if(i!=null&&/\s/.test(i))if(D[D.length-1]==i)D.push(D.pop()+n);else D.push(i+n);else D.push(n);i=n}),D}join(r){return r.map((t,u)=>{if(u==0)return t;else return t.replace(/^\s+/,"")}).join("")}postProcess(r,t){if(!r||t.oneChangePerToken)return r;let u=null,D=null,i=null;if(r.forEach((n)=>{if(n.added)D=n;else if(n.removed)i=n;else{if(D||i)i8(u,i,D,n);u=n,D=null,i=null}}),D||i)i8(u,i,D,null);return r}};SN=new u8;D8=class D8 extends jr{tokenize(r){let t=new RegExp(`(\\r?\\n)|[${Qe}]+|[^\\S\\n\\r]+|[^${Qe}]`,"ug");return r.match(t)||[]}};QN=new D8});function Ke(r,t,u){return e8.diff(r,t,u)}function n2(r,t){if(t.stripTrailingCr)r=r.replace(/\r\n/g,`
|
|
101
|
+
`);let u=[],D=r.split(/(\n|\r\n)/);if(!D[D.length-1])D.pop();for(let i=0;i<D.length;i++){let n=D[i];if(i%2&&!t.newlineIsToken)u[u.length-1]+=n;else u.push(n)}return u}var o8,e8;var He=k(()=>{o8=class o8 extends jr{constructor(){super(...arguments);this.tokenize=n2}equals(r,t,u){if(u.ignoreWhitespace){if(!u.newlineIsToken||!r.includes(`
|
|
102
|
+
`))r=r.trim();if(!u.newlineIsToken||!t.includes(`
|
|
103
|
+
`))t=t.trim()}else if(u.ignoreNewlineAtEof&&!u.newlineIsToken){if(r.endsWith(`
|
|
104
|
+
`))r=r.slice(0,-1);if(t.endsWith(`
|
|
105
|
+
`))t=t.slice(0,-1)}return super.equals(r,t,u)}};e8=new o8});function KN(r){return r=="."||r=="!"||r=="?"}var f8,HN;var $8=k(()=>{f8=class f8 extends jr{tokenize(r){var t;let u=[],D=0;for(let i=0;i<r.length;i++){if(i==r.length-1){u.push(r.slice(D));break}if(KN(r[i])&&r[i+1].match(/\s/)){u.push(r.slice(D,i+1)),i=D=i+1;while((t=r[i+1])===null||t===void 0?void 0:t.match(/\s/))i++;u.push(r.slice(D,i+1)),D=i+1}}return u}};HN=new f8});var l8,MN;var m8=k(()=>{l8=class l8 extends jr{tokenize(r){return r.split(/([{}:;,]|\s+)/)}};MN=new l8});function Me(r,t,u,D,i){if(t=t||[],u=u||[],D)r=D(i===void 0?"":i,r);let n;for(n=0;n<t.length;n+=1)if(t[n]===r)return u[n];let o;if(Object.prototype.toString.call(r)==="[object Array]"){t.push(r),o=new Array(r.length),u.push(o);for(n=0;n<r.length;n+=1)o[n]=Me(r[n],t,u,D,String(n));return t.pop(),u.pop(),o}if(r&&r.toJSON)r=r.toJSON();if(typeof r==="object"&&r!==null){t.push(r),o={},u.push(o);let e=[],f;for(f in r)if(Object.prototype.hasOwnProperty.call(r,f))e.push(f);e.sort();for(n=0;n<e.length;n+=1)f=e[n],o[f]=Me(r[f],t,u,D,f);t.pop(),u.pop()}else o=r;return o}var c8,ZN;var v8=k(()=>{He();c8=class c8 extends jr{constructor(){super(...arguments);this.tokenize=n2}get useLongestToken(){return!0}castInput(r,t){let{undefinedReplacement:u,stringifyReplacer:D=(i,n)=>typeof n==="undefined"?u:n}=t;return typeof r==="string"?r:JSON.stringify(Me(r,null,null,D),null," ")}equals(r,t,u){return super.equals(r.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),u)}};ZN=new c8});var E8,LN;var F8=k(()=>{E8=class E8 extends jr{tokenize(r){return r.slice()}join(r){return r}removeEmpty(r){return r}};LN=new E8});function Ze(r){let t=r.split(/\n/),u=[],D=0;function i(){let e={};u.push(e);while(D<t.length){let f=t[D];if(/^(---|\+\+\+|@@)\s/.test(f))break;let $=/^(?:Index:|diff(?: -r \w+)+)\s+/.exec(f);if($)e.index=f.substring($[0].length).trim();D++}n(e),n(e),e.hunks=[];while(D<t.length){let f=t[D];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(f))break;else if(/^@@/.test(f))e.hunks.push(o());else if(f)throw new Error("Unknown line "+(D+1)+" "+JSON.stringify(f));else D++}}function n(e){let f=/^(---|\+\+\+)\s+/.exec(t[D]);if(f){let $=f[1],l=t[D].substring(3).trim().split("\t",2),m=(l[1]||"").trim(),c=l[0].replace(/\\\\/g,"\\");if(c.startsWith('"')&&c.endsWith('"'))c=c.substr(1,c.length-2);if($==="---")e.oldFileName=c,e.oldHeader=m;else e.newFileName=c,e.newHeader=m;D++}}function o(){var e;let f=D,$=t[D++],l=$.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),m={oldStart:+l[1],oldLines:typeof l[2]==="undefined"?1:+l[2],newStart:+l[3],newLines:typeof l[4]==="undefined"?1:+l[4],lines:[]};if(m.oldLines===0)m.oldStart+=1;if(m.newLines===0)m.newStart+=1;let c=0,g=0;for(;D<t.length&&(g<m.oldLines||c<m.newLines||((e=t[D])===null||e===void 0?void 0:e.startsWith("\\")));D++){let _=t[D].length==0&&D!=t.length-1?" ":t[D][0];if(_==="+"||_==="-"||_===" "||_==="\\"){if(m.lines.push(t[D]),_==="+")c++;else if(_==="-")g++;else if(_===" ")c++,g++}else throw new Error(`Hunk at line ${f+1} contained invalid line ${t[D]}`)}if(!c&&m.newLines===1)m.newLines=0;if(!g&&m.oldLines===1)m.oldLines=0;if(c!==m.newLines)throw new Error("Added line count did not match for hunk at line "+(f+1));if(g!==m.oldLines)throw new Error("Removed line count did not match for hunk at line "+(f+1));return m}while(D<t.length)i();return u}var g8=()=>{};function o2(r,t,u,D,i,n,o){let e;if(!o)e={};else if(typeof o==="function")e={callback:o};else e=o;if(typeof e.context==="undefined")e.context=4;let f=e.context;if(e.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(!e.callback)return $(Ke(u,D,e));else{let{callback:l}=e;Ke(u,D,Object.assign(Object.assign({},e),{callback:(m)=>{let c=$(m);l(c)}}))}function $(l){if(!l)return;l.push({value:"",lines:[]});function m(R){return R.map(function(z){return" "+z})}let c=[],g=0,_=0,q=[],y=1,N=1;for(let R=0;R<l.length;R++){let z=l[R],A=z.lines||PN(z.value);if(z.lines=A,z.added||z.removed){if(!g){let K=l[R-1];if(g=y,_=N,K)q=f>0?m(K.lines.slice(-f)):[],g-=q.length,_-=q.length}for(let K of A)q.push((z.added?"+":"-")+K);if(z.added)N+=A.length;else y+=A.length}else{if(g)if(A.length<=f*2&&R<l.length-2)for(let K of m(A))q.push(K);else{let K=Math.min(A.length,f);for(let p of m(A.slice(0,K)))q.push(p);let L={oldStart:g,oldLines:y-g+K,newStart:_,newLines:N-_+K,lines:q};c.push(L),g=0,_=0,q=[]}y+=A.length,N+=A.length}}for(let R of c)for(let z=0;z<R.lines.length;z++)if(R.lines[z].endsWith(`
|
|
106
|
+
`))R.lines[z]=R.lines[z].slice(0,-1);else R.lines.splice(z+1,0,"\"),z++;return{oldFileName:r,newFileName:t,oldHeader:i,newHeader:n,hunks:c}}}function Le(r,t){if(!t)t=w8;if(Array.isArray(r)){if(r.length>1&&!t.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return r.map((D)=>Le(D,t)).join(`
|
|
107
|
+
`)}let u=[];if(t.includeIndex&&r.oldFileName==r.newFileName)u.push("Index: "+r.oldFileName);if(t.includeUnderline)u.push("===================================================================");if(t.includeFileHeaders)u.push("--- "+r.oldFileName+(typeof r.oldHeader==="undefined"?"":"\t"+r.oldHeader)),u.push("+++ "+r.newFileName+(typeof r.newHeader==="undefined"?"":"\t"+r.newHeader));for(let D=0;D<r.hunks.length;D++){let i=r.hunks[D];if(i.oldLines===0)i.oldStart-=1;if(i.newLines===0)i.newStart-=1;u.push("@@ -"+i.oldStart+","+i.oldLines+" +"+i.newStart+","+i.newLines+" @@");for(let n of i.lines)u.push(n)}return u.join(`
|
|
108
|
+
`)+`
|
|
109
|
+
`}function Nu(r,t,u,D,i,n,o){if(typeof o==="function")o={callback:o};if(!(o===null||o===void 0?void 0:o.callback)){let e=o2(r,t,u,D,i,n,o);if(!e)return;return Le(e,o===null||o===void 0?void 0:o.headerOptions)}else{let{callback:e}=o;o2(r,t,u,D,i,n,Object.assign(Object.assign({},o),{callback:(f)=>{if(!f)e(void 0);else e(Le(f,o.headerOptions))}}))}}function e2(r,t,u,D,i,n){return Nu(r,r,t,u,D,i,n)}function PN(r){let t=r.endsWith(`
|
|
110
|
+
`),u=r.split(`
|
|
111
|
+
`).map((D)=>D+`
|
|
112
|
+
`);if(t)u.pop();else u.push(u.pop().slice(0,-1));return u}var w8;var b8=k(()=>{He();w8={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0}});var RD=k(()=>{t8();n8();He();$8();m8();v8();F8();g8();b8()});function C8(r){let t=Ze(r),u=[];for(let D of t){let{path:i,nodeId:n}=kN(D.oldFileName||D.newFileName||""),o=D.newFileName==="/dev/null"||D.newFileName==="",e=D.oldFileName==="/dev/null"||D.oldFileName==="",f="",$="";for(let l of D.hunks)for(let m of l.lines)if(m.startsWith("-")&&!m.startsWith("---"))f+=m.slice(1)+`
|
|
113
|
+
`;else if(m.startsWith("+")&&!m.startsWith("+++"))$+=m.slice(1)+`
|
|
114
|
+
`;else if(m.startsWith(" "))f+=m.slice(1)+`
|
|
115
|
+
`,$+=m.slice(1)+`
|
|
116
|
+
`;u.push({path:i,nodeId:n,isDelete:o,isCreate:e,hunks:D.hunks,oldContent:f.trimEnd(),newContent:$.trimEnd()})}return u}function kN(r){let t=r.match(/^(.+?)\s+#(\d+:\d+)$/);if(t&&t[1]&&t[2])return{path:t[1],nodeId:t[2]};return{path:r,nodeId:null}}var _8=k(()=>{RD()});function yt(r){let t=[];if(t.push(`type: ${r.type}`),r.width!==void 0&&r.height!==void 0)t.push(`size: ${r.width} ${r.height}`);if(r.x!==void 0&&r.y!==void 0)t.push(`pos: ${r.x} ${r.y}`);let D=r.fills?.[0];if(D?.type==="SOLID"&&D.color)t.push(`fill: ${D.color}`);let n=r.strokes?.[0];if(n?.type==="SOLID"&&n.color)t.push(`stroke: ${n.color}`);if(r.strokeWeight!==void 0&&r.strokeWeight!==0)t.push(`strokeWeight: ${r.strokeWeight}`);if(r.opacity!==void 0&&r.opacity!==1)t.push(`opacity: ${f2(r.opacity,2)}`);if(r.topLeftRadius!==void 0||r.topRightRadius!==void 0||r.bottomLeftRadius!==void 0||r.bottomRightRadius!==void 0){let $=r.topLeftRadius??0,l=r.topRightRadius??0,m=r.bottomLeftRadius??0,c=r.bottomRightRadius??0;if($!==0||l!==0||m!==0||c!==0)if($===l&&l===m&&m===c)t.push(`radius: ${$}`);else t.push(`radii: ${$} ${l} ${c} ${m}`)}else if(r.cornerRadius!==void 0&&r.cornerRadius!==0)t.push(`radius: ${r.cornerRadius}`);if(r.cornerSmoothing!==void 0&&r.cornerSmoothing!==0)t.push(`cornerSmoothing: ${f2(r.cornerSmoothing,2)}`);if(r.blendMode!==void 0&&r.blendMode!=="PASS_THROUGH"&&r.blendMode!=="NORMAL")t.push(`blendMode: ${r.blendMode}`);if(r.rotation!==void 0&&r.rotation!==0)t.push(`rotation: ${f2(r.rotation,2)}`);if(r.clipsContent===!0)t.push("clipsContent: true");let e=r.effects;if(e&&e.length>0)for(let $ of e){let l=[$.type];if($.radius!==void 0)l.push(`r=${$.radius}`);if($.color)l.push(`c=${$.color}`);if($.opacity!==void 0&&$.opacity!==1)l.push(`o=${$.opacity}`);if($.offset)l.push(`x=${$.offset.x} y=${$.offset.y}`);if($.spread!==void 0)l.push(`s=${$.spread}`);t.push(`effect: ${l.join(" ")}`)}let f=r.vectorPaths;if(f&&f.length>0){for(let $ of f)if($.data)t.push(`path: ${$.data}`)}if(r.type==="TEXT"){if(r.characters!==void 0)t.push(`text: ${JSON.stringify(r.characters)}`);if(r.fontSize!==void 0)t.push(`fontSize: ${r.fontSize}`);if(r.fontName!==void 0){let $=r.fontName;if($.family)t.push(`fontFamily: ${$.family}`)}}if(r.visible===!1)t.push("visible: false");if(r.locked===!0)t.push("locked: true");return t.join(`
|
|
117
|
+
`)}function Pe(r){let t={type:"UNKNOWN"},u=[],D=[];for(let i of r.split(`
|
|
118
|
+
`)){let n=i.indexOf(":");if(n===-1)continue;let o=i.slice(0,n).trim(),e=i.slice(n+1).trim();switch(o){case"type":t.type=e;break;case"name":t.name=e;break;case"size":{let f=e.split(" ").map(Number);t.size=[f[0]??0,f[1]??0];break}case"pos":{let f=e.split(" ").map(Number);t.pos=[f[0]??0,f[1]??0];break}case"fill":t.fill=e;break;case"stroke":t.stroke=e;break;case"strokeWeight":t.strokeWeight=Number(e);break;case"opacity":t.opacity=Number(e);break;case"radius":t.radius=Number(e);break;case"radii":{let f=e.split(" ").map(Number);t.radii=[f[0]??0,f[1]??0,f[2]??0,f[3]??0];break}case"cornerSmoothing":t.cornerSmoothing=Number(e);break;case"blendMode":t.blendMode=e;break;case"rotation":t.rotation=Number(e);break;case"clipsContent":t.clipsContent=e==="true";break;case"effect":{let f={type:""},$=e.split(" ");f.type=$[0]??"";for(let l of $.slice(1))if(l.startsWith("r="))f.radius=Number(l.slice(2));else if(l.startsWith("c="))f.color=l.slice(2);else if(l.startsWith("o="))f.opacity=Number(l.slice(2));else if(l.startsWith("x="))f.offset={x:Number(l.slice(2)),y:f.offset?.y??0};else if(l.startsWith("y="))f.offset={x:f.offset?.x??0,y:Number(l.slice(2))};else if(l.startsWith("s="))f.spread=Number(l.slice(2));u.push(f);break}case"path":D.push(e);break;case"fontSize":t.fontSize=Number(e);break;case"fontFamily":t.fontFamily=e;break;case"fontWeight":t.fontWeight=Number(e);break;case"text":t.text=JSON.parse(e);break;case"visible":t.visible=e==="true";break;case"locked":t.locked=e==="true";break}}if(u.length>0)t.effects=u;if(D.length>0)t.vectorPaths=D;return t}function I8(r,t){let u={};for(let D of Object.keys(t)){let i=r[D],n=t[D];if(Array.isArray(i)&&Array.isArray(n)){if(JSON.stringify(i)!==JSON.stringify(n))u[D]=n}else if(typeof i==="object"&&typeof n==="object"){if(JSON.stringify(i)!==JSON.stringify(n))u[D]=n}else if(i!==n)u[D]=n}return u}function f2(r,t){let u=Math.pow(10,t);return Math.round(r*u)/u}var U8={};Or(U8,{default:()=>pN});import{readFileSync as dN}from"fs";async function xN(){let r=[];for await(let t of process.stdin)r.push(t);return Buffer.concat(r).toString("utf-8")}var pN;var O8=k(()=>{O();B();mr();_8();pN=E({meta:{description:"Apply a diff patch to Figma nodes"},args:{stdin:{type:"boolean",description:"Read patch from stdin"},file:{type:"positional",description:"Patch file path",required:!1},"dry-run":{type:"boolean",description:"Show what would be changed without applying"},force:{type:"boolean",description:"Apply even if old values do not match"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t;if(r.stdin)t=await xN();else if(r.file)t=dN(r.file,"utf-8");else console.error(d("Provide a patch file or use --stdin")),process.exit(1);let u=C8(t);if(u.length===0)console.error(d("No valid patches found")),process.exit(1);let D=[];for(let i of u){let{path:n,nodeId:o,isDelete:e,isCreate:f,oldContent:$,newContent:l}=i;if(e&&o){if(r["dry-run"]){D.push({nodeId:o,path:n,status:"deleted",changes:{action:"DELETE"}});continue}try{await F("delete-node",{id:o}),D.push({nodeId:o,path:n,status:"deleted"})}catch(N){D.push({nodeId:o,path:n,status:"failed",error:String(N)})}continue}if(f){let N=Pe(l);if(r["dry-run"]){D.push({nodeId:"new",path:n,status:"created",changes:N});continue}try{let R=n.split("/").filter(Boolean),z;if(R.length>1){let Jr=R.slice(0,-1),Nr;for(let Kr of Jr){let Gr=await F("find-by-name",{name:Kr,exact:!0,limit:50});if(!Gr||Gr.length===0)break;if(!Nr)Nr=Gr[0].id;else{let zi=(await F("get-children",{id:Nr,depth:1})).find((Wu)=>Wu.name===Kr);if(zi)Nr=zi.id;else Nr=Gr[0].id}}z=Nr}let A=N.pos?.[0]??0,K=N.pos?.[1]??0,L=N.size?.[0]??100,p=N.size?.[1]??100,a=R[R.length-1],Q;switch(N.type){case"FRAME":Q=await F("create-frame",{x:A,y:K,width:L,height:p,name:a,parentId:z,fill:N.fill,stroke:N.stroke,strokeWeight:N.strokeWeight,radius:N.radius,opacity:N.opacity});break;case"RECTANGLE":Q=await F("create-rectangle",{x:A,y:K,width:L,height:p,name:a,parentId:z,fill:N.fill,stroke:N.stroke,strokeWeight:N.strokeWeight,radius:N.radius,opacity:N.opacity});break;case"ELLIPSE":Q=await F("create-ellipse",{x:A,y:K,width:L,height:p,name:a,parentId:z,fill:N.fill,stroke:N.stroke,strokeWeight:N.strokeWeight,opacity:N.opacity});break;case"TEXT":Q=await F("create-text",{x:A,y:K,text:N.text??a??"Text",fontSize:N.fontSize,fontFamily:N.fontFamily,fill:N.fill,opacity:N.opacity,name:a,parentId:z});break;case"LINE":Q=await F("create-line",{x:A,y:K,length:L,rotation:N.rotation,name:a,parentId:z,stroke:N.stroke,strokeWeight:N.strokeWeight});break;case"POLYGON":Q=await F("create-polygon",{x:A,y:K,size:Math.max(L,p),name:a,parentId:z,fill:N.fill,stroke:N.stroke,strokeWeight:N.strokeWeight});break;case"STAR":Q=await F("create-star",{x:A,y:K,size:Math.max(L,p),name:a,parentId:z,fill:N.fill,stroke:N.stroke,strokeWeight:N.strokeWeight});break;case"VECTOR":if(N.vectorPaths&&N.vectorPaths.length>0)Q=await F("create-vector",{x:A,y:K,path:N.vectorPaths[0],name:a,parentId:z,fill:N.fill,stroke:N.stroke,strokeWeight:N.strokeWeight});else Q=await F("create-rectangle",{x:A,y:K,width:L,height:p,name:a,parentId:z,fill:N.fill});break;case"COMPONENT":Q=await F("create-component",{x:A,y:K,width:L,height:p,name:a??"Component",parentId:z,fill:N.fill});break;default:Q=await F("create-frame",{x:A,y:K,width:L,height:p,name:a,parentId:z,fill:N.fill});break}let M=Q?.id??Q?.nodeId??"new";if(M&&M!=="new"){if(N.visible===!1)await F("set-visibility",{id:M,visible:!1});if(N.locked===!0)await F("set-locked",{id:M,locked:!0});if(N.rotation&&N.type!=="LINE")await F("set-rotation",{id:M,rotation:N.rotation});if(N.blendMode)await F("set-blend-mode",{id:M,mode:N.blendMode})}D.push({nodeId:M,path:n,status:"created",changes:N})}catch(R){D.push({nodeId:"new",path:n,status:"failed",error:`CREATE failed: ${String(R)}`})}continue}if(!o){D.push({nodeId:"unknown",path:n,status:"skipped",error:"No node ID in patch"});continue}let m;try{m=await F("get-node-info",{id:o})}catch{D.push({nodeId:o,path:n,status:"failed",error:`Node not found: ${o}`});continue}let c=yt(m),g=$;if(!r.force&&c!==g){let N=c.split(`
|
|
119
|
+
`),R=g.split(`
|
|
120
|
+
`),z=[];for(let A of R)if(!N.includes(A))z.push(A);D.push({nodeId:o,path:n,status:"failed",error:`Old value mismatch. Expected:
|
|
121
|
+
${z.join(`
|
|
122
|
+
`)}
|
|
123
|
+
Actual:
|
|
124
|
+
${c}`});continue}let _=Pe($),q=Pe(l),y=I8(_,q);if(Object.keys(y).length===0){D.push({nodeId:o,path:n,status:"skipped",error:"No changes detected"});continue}if(r["dry-run"]){D.push({nodeId:o,path:n,status:"applied",changes:y});continue}try{if(y.fill)await F("set-fill-color",{id:o,color:y.fill});if(y.stroke)await F("set-stroke-color",{id:o,color:y.stroke,weight:y.strokeWeight});if(y.opacity!==void 0)await F("set-opacity",{id:o,opacity:y.opacity});if(y.radius!==void 0)await F("set-radius",{id:o,radius:y.radius});if(y.size)await F("resize-node",{id:o,width:y.size[0],height:y.size[1]});if(y.pos)await F("move-node",{id:o,x:y.pos[0],y:y.pos[1]});if(y.text!==void 0)await F("set-text-content",{id:o,text:y.text});if(y.visible!==void 0)await F("set-visibility",{id:o,visible:y.visible});if(y.locked!==void 0)await F("set-locked",{id:o,locked:y.locked});D.push({nodeId:o,path:n,status:"applied",changes:y})}catch(N){D.push({nodeId:o,path:n,status:"failed",error:String(N)})}}if(r.json)console.log(JSON.stringify(D,null,2));else{for(let o of D){let e=o.status==="applied"?"✓":o.status==="created"?"+":o.status==="deleted"?"-":o.status==="skipped"?"○":"✗";if(console.log(`${e} ${o.path} #${o.nodeId}`),o.error)console.log(` ${o.error}`);if(o.changes&&r["dry-run"])for(let[f,$]of Object.entries(o.changes))console.log(` ${f}: ${JSON.stringify($)}`)}let i=D.filter((o)=>o.status==="applied"||o.status==="created"||o.status==="deleted").length,n=D.filter((o)=>o.status==="failed").length;if(r["dry-run"])console.log(`
|
|
125
|
+
${i} changes would be applied`);else console.log(`
|
|
126
|
+
${Dr(`${i} applied`)}${n>0?`, ${d(`${n} failed`)}`:""}`)}}catch(t){w(t)}}})});var y8={};Or(y8,{default:()=>aN});var aN;var N8=k(()=>{At();O();RD();B();mr();aN=E({meta:{description:"Show diff between current node state and provided properties"},args:{id:{type:"positional",description:"Node ID",required:!0},props:{type:"string",description:`New properties as JSON (e.g. '{"opacity": 1, "fill": "#FF0000"}')`}},async run({args:r}){try{if(!r.props)console.error(d("Provide --props with new values")),process.exit(1);let t=await F("get-node-info",{id:r.id}),D=`/${t.name||"Node"} #${r.id}`,i=yt(t),n=JSON.parse(r.props),o={...t};if(n.fill)o.fills=[{type:"SOLID",color:n.fill}];if(n.stroke)o.strokes=[{type:"SOLID",color:n.stroke}];if(n.opacity!==void 0)o.opacity=n.opacity;if(n.radius!==void 0)o.cornerRadius=n.radius;if(n.size)o.width=n.size[0],o.height=n.size[1];if(n.width!==void 0)o.width=n.width;if(n.height!==void 0)o.height=n.height;if(n.x!==void 0)o.x=n.x;if(n.y!==void 0)o.y=n.y;let e=yt(o),f=e2(D,i,e,"","");for(let $ of f.split(`
|
|
127
|
+
`))if($.startsWith("---")||$.startsWith("+++"))console.log(Yr($));else if($.startsWith("-"))console.log(yn($));else if($.startsWith("+"))console.log(Mt($));else if($.startsWith("@@"))console.log(Jt($));else console.log($)}catch(t){w(t)}}})});var B8={};Or(B8,{default:()=>sN});function $2(r,t=""){let u=new Map,D=t?`${t}/${r.name}`:`/${r.name}`;if(u.set(D,{path:D,id:r.id,node:r}),r.children)for(let i of r.children){let n=$2(i,D);for(let[o,e]of n)u.set(o,e)}return u}var sN;var q8=k(()=>{O();RD();B();mr();sN=E({meta:{description:"Create a diff patch between two nodes/trees"},args:{from:{type:"string",description:"Source node ID",required:!0},to:{type:"string",description:"Target node ID",required:!0},depth:{type:"string",description:"Tree depth (default: 10)"}},async run({args:r}){try{let t=r.depth?Number(r.depth):10,u=await F("get-node-tree",{id:r.from,depth:t}),D=await F("get-node-tree",{id:r.to,depth:t});if(!u||!D)console.error(d("Could not fetch node trees")),process.exit(1);let i=$2(u),n=$2(D),o=new Set([...i.keys(),...n.keys()]),e=[];for(let f of o){let $=i.get(f),l=n.get(f),m=f.replace(/^\/[^/]+/,`/${D.name}`);if(!$&&l){let c=yt(l.node),g=`${m} #${l.id}`;e.push(`--- /dev/null
|
|
128
|
+
+++ ${g}
|
|
129
|
+
@@ -0,0 +1,${c.split(`
|
|
130
|
+
`).length} @@
|
|
131
|
+
${c.split(`
|
|
132
|
+
`).map((_)=>`+${_}`).join(`
|
|
133
|
+
`)}`)}else if($&&!l){let c=yt($.node),g=`${m} #${$.id}`;e.push(`--- ${g}
|
|
134
|
+
+++ /dev/null
|
|
135
|
+
@@ -1,${c.split(`
|
|
136
|
+
`).length} +0,0 @@
|
|
137
|
+
${c.split(`
|
|
138
|
+
`).map((_)=>`-${_}`).join(`
|
|
139
|
+
`)}`)}else if($&&l){let c=yt($.node),g=yt(l.node);if(c!==g){let _=`${m} #${$.id}`,q=`${m} #${l.id}`,R=Nu(_,q,c,g,"","").split(`
|
|
140
|
+
`).filter((z)=>!z.startsWith("Index:")&&z!=="===================================================================");e.push(R.join(`
|
|
141
|
+
`).trim())}}}if(e.length===0)console.error(d("No differences found")),process.exit(1);console.log(e.join(`
|
|
142
|
+
`))}catch(t){w(t)}}})});var h8={};Or(h8,{default:()=>i5});import{writeFileSync as r5}from"fs";import t5 from"pixelmatch";import{PNG as ke}from"pngjs";var i5;var z8=k(()=>{O();B();mr();i5=E({meta:{description:"Create visual diff between two nodes as PNG"},args:{from:{type:"string",description:"Source node ID",required:!0},to:{type:"string",description:"Target node ID",required:!0},output:{type:"string",description:"Output file path",required:!0},scale:{type:"string",description:"Export scale (default: 1)"},threshold:{type:"string",description:"Color threshold 0-1 (default: 0.1)"}},async run({args:r}){try{let t=r.scale?Number(r.scale):1,u=r.threshold?Number(r.threshold):0.1,D=await F("export-node",{id:r.from,format:"PNG",scale:t}),i=await F("export-node",{id:r.to,format:"PNG",scale:t});if(!D?.data||!i?.data)console.error(d("Could not export nodes")),process.exit(1);let n=ke.sync.read(Buffer.from(D.data,"base64")),o=ke.sync.read(Buffer.from(i.data,"base64"));if(n.width!==o.width||n.height!==o.height)console.error(d(`Size mismatch: ${n.width}×${n.height} vs ${o.width}×${o.height}`)),process.exit(1);let{width:e,height:f}=n,$=new ke({width:e,height:f}),l=t5(n.data,o.data,$.data,e,f,{threshold:u}),m=e*f,c=(l/m*100).toFixed(2);r5(r.output,ke.sync.write($)),console.log(`${l} pixels differ (${c}%)`),console.log(`Saved to ${r.output}`),process.exit(0)}catch(t){w(t)}}})});var X8={};Or(X8,{default:()=>o5});import*as nr from"typescript";function Qr(r,t){return nr.factory.createJsxAttribute(nr.factory.createIdentifier(r),nr.isStringLiteral(t)?t:nr.factory.createJsxExpression(void 0,t))}function Yt(r){return nr.factory.createNumericLiteral(Math.round(r))}function Bi(r){return nr.factory.createStringLiteral(r)}function A8(r){if(r.name&&D5.test(r.name)){let i=[Qr("name",Bi(r.name))];if(r.width)i.push(Qr("size",Yt(r.width)));return nr.factory.createJsxSelfClosingElement(nr.factory.createIdentifier("Icon"),void 0,nr.factory.createJsxAttributes(i))}if(r.type==="TEXT"&&r.characters){let i=[];if(r.fontSize&&r.fontSize!==14)i.push(Qr("size",Yt(r.fontSize)));if(r.fills?.[0]?.color&&r.fills[0].color!=="#000000")i.push(Qr("color",Bi(r.fills[0].color)));return nr.factory.createJsxElement(nr.factory.createJsxOpeningElement(nr.factory.createIdentifier("Text"),void 0,nr.factory.createJsxAttributes(i)),[nr.factory.createJsxText(r.characters,!1)],nr.factory.createJsxClosingElement(nr.factory.createIdentifier("Text")))}let t=u5[r.type];if(!t)return null;let u=[];if(r.name&&!r.name.match(/^(Frame|Rectangle)\s*\d*$/))u.push(Qr("name",Bi(r.name)));if(r.width)u.push(Qr("w",Yt(r.width)));if(r.height)u.push(Qr("h",Yt(r.height)));if(r.fills?.[0]?.color)u.push(Qr("bg",Bi(r.fills[0].color)));if(r.strokes?.[0]?.color)u.push(Qr("stroke",Bi(r.strokes[0].color)));if(r.cornerRadius)u.push(Qr("rounded",Yt(r.cornerRadius)));if(r.layoutMode==="HORIZONTAL")u.push(Qr("flex",Bi("row")));if(r.layoutMode==="VERTICAL")u.push(Qr("flex",Bi("col")));if(r.itemSpacing)u.push(Qr("gap",Yt(r.itemSpacing)));if(r.padding){let{top:i,right:n,bottom:o,left:e}=r.padding;if(i===n&&n===o&&o===e&&i>0)u.push(Qr("p",Yt(i)));else if(i===o&&e===n){if(i>0)u.push(Qr("py",Yt(i)));if(e>0)u.push(Qr("px",Yt(e)))}}let D=[];if(r.children)for(let i of r.children){let n=A8(i);if(n)D.push(n)}if(D.length===0)return nr.factory.createJsxSelfClosingElement(nr.factory.createIdentifier(t),void 0,nr.factory.createJsxAttributes(u));return nr.factory.createJsxElement(nr.factory.createJsxOpeningElement(nr.factory.createIdentifier(t),void 0,nr.factory.createJsxAttributes(u)),D,nr.factory.createJsxClosingElement(nr.factory.createIdentifier(t)))}async function n5(r,t={}){try{return(await(await import("oxfmt")).format("component.tsx",r,{semi:t.semi??!1,singleQuote:t.singleQuote??!0,tabWidth:t.tabWidth??2,useTabs:t.useTabs??!1,trailingComma:t.trailingComma??"es5"})).code}catch(u){if(u.code==="ERR_MODULE_NOT_FOUND")console.error(`oxfmt is required for diff jsx. Install it:
|
|
143
|
+
|
|
144
|
+
${Vi("oxfmt")}
|
|
145
|
+
`),process.exit(1);throw u}}async function J8(r,t={}){let u=await F("get-node-tree",{id:r});if(!u)throw new Error("Node not found");let D=A8(u);if(!D)return"";let i=nr.createPrinter({newLine:nr.NewLineKind.LineFeed}),n=nr.createSourceFile("temp.tsx","",nr.ScriptTarget.Latest,!1,nr.ScriptKind.TSX),o=i.printNode(nr.EmitHint.Unspecified,D,n);return n5(o,t)}var u5,D5,o5;var j8=k(()=>{At();O();RD();B();mr();u5={FRAME:"Frame",RECTANGLE:"Rectangle",ELLIPSE:"Ellipse",TEXT:"Text",COMPONENT:"Frame",COMPONENT_SET:"Frame",INSTANCE:"Frame",GROUP:"Group",SECTION:"Section"},D5=/^[a-z][a-z0-9]*:[a-z][a-z0-9-]*$/i;o5=E({meta:{description:"Show JSX diff between two nodes"},args:{from:{type:"positional",description:"Source node ID",required:!0},to:{type:"positional",description:"Target node ID",required:!0},context:{type:"string",description:"Lines of context (default: 3)",default:"3"},semi:{type:"boolean",description:"Add semicolons (default: false)"},"single-quote":{type:"boolean",description:"Use single quotes (default: true)"},"tab-width":{type:"string",description:"Spaces per indent (default: 2)"},tabs:{type:"boolean",description:"Use tabs instead of spaces"},"trailing-comma":{type:"string",description:"Trailing commas: none, es5, all (default: es5)"}},async run({args:r}){try{let t={semi:r.semi,singleQuote:r["single-quote"]!==!1,tabWidth:r["tab-width"]?Number(r["tab-width"]):void 0,useTabs:r.tabs,trailingComma:r["trailing-comma"]},u=await J8(r.from,t),D=await J8(r.to,t);if(u===D){console.log("No differences");return}let n=Nu(r.from,r.to,u,D,"source","target",{context:Number(r.context)}).split(`
|
|
146
|
+
`);for(let o of n)if(o.startsWith("+++")||o.startsWith("---"))console.log(Yr(o));else if(o.startsWith("+"))console.log(Mt(o));else if(o.startsWith("-"))console.log(yn(o));else if(o.startsWith("@@"))console.log(Jt(o));else console.log(o)}catch(t){w(t)}}})});var m2=s((UZ,kg)=>{var de=/[\t\n\f\r "#'()/;[\\\]{}]/g,xe=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,c5=/.[\r\n"'(/\\]/,Pg=/[\da-f]/i;kg.exports=function r(t,u={}){let D=t.css.valueOf(),i=u.ignoreErrors,n,o,e,f,$,l,m,c,g,_,q=D.length,y=0,N=[],R=[];function z(){return y}function A(a){throw t.error("Unclosed "+a,y)}function K(){return R.length===0&&y>=q}function L(a){if(R.length)return R.pop();if(y>=q)return;let Q=a?a.ignoreUnclosed:!1;switch(n=D.charCodeAt(y),n){case 10:case 32:case 9:case 13:case 12:{f=y;do f+=1,n=D.charCodeAt(f);while(n===32||n===10||n===9||n===13||n===12);l=["space",D.slice(y,f)],y=f-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let M=String.fromCharCode(n);l=[M,M,y];break}case 40:{if(_=N.length?N.pop()[1]:"",g=D.charCodeAt(y+1),_==="url"&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){f=y;do{if(m=!1,f=D.indexOf(")",f+1),f===-1)if(i||Q){f=y;break}else A("bracket");c=f;while(D.charCodeAt(c-1)===92)c-=1,m=!m}while(m);l=["brackets",D.slice(y,f+1),y,f],y=f}else if(f=D.indexOf(")",y+1),o=D.slice(y,f+1),f===-1||c5.test(o))l=["(","(",y];else l=["brackets",o,y,f],y=f;break}case 39:case 34:{$=n===39?"'":'"',f=y;do{if(m=!1,f=D.indexOf($,f+1),f===-1)if(i||Q){f=y+1;break}else A("string");c=f;while(D.charCodeAt(c-1)===92)c-=1,m=!m}while(m);l=["string",D.slice(y,f+1),y,f],y=f;break}case 64:{if(de.lastIndex=y+1,de.test(D),de.lastIndex===0)f=D.length-1;else f=de.lastIndex-2;l=["at-word",D.slice(y,f+1),y,f],y=f;break}case 92:{f=y,e=!0;while(D.charCodeAt(f+1)===92)f+=1,e=!e;if(n=D.charCodeAt(f+1),e&&n!==47&&n!==32&&n!==10&&n!==9&&n!==13&&n!==12){if(f+=1,Pg.test(D.charAt(f))){while(Pg.test(D.charAt(f+1)))f+=1;if(D.charCodeAt(f+1)===32)f+=1}}l=["word",D.slice(y,f+1),y,f],y=f;break}default:{if(n===47&&D.charCodeAt(y+1)===42){if(f=D.indexOf("*/",y+2)+1,f===0)if(i||Q)f=D.length;else A("comment");l=["comment",D.slice(y,f+1),y,f],y=f}else{if(xe.lastIndex=y+1,xe.test(D),xe.lastIndex===0)f=D.length-1;else f=xe.lastIndex-2;l=["word",D.slice(y,f+1),y,f],N.push(l),y=f}break}}return y++,l}function p(a){R.push(a)}return{back:p,endOfFile:K,nextToken:L,position:z}}});var c2=s((OZ,pg)=>{var Lr=Hu(),v5=m2(),dg;function E5(r){dg=r}var F5={";":Lr.yellow,":":Lr.yellow,"(":Lr.cyan,")":Lr.cyan,"[":Lr.yellow,"]":Lr.yellow,"{":Lr.yellow,"}":Lr.yellow,"at-word":Lr.cyan,brackets:Lr.cyan,call:Lr.cyan,class:Lr.yellow,comment:Lr.gray,hash:Lr.magenta,string:Lr.green};function g5([r,t],u){if(r==="word"){if(t[0]===".")return"class";if(t[0]==="#")return"hash"}if(!u.endOfFile()){let D=u.nextToken();if(u.back(D),D[0]==="brackets"||D[0]==="(")return"call"}return r}function xg(r){let t=v5(new dg(r),{ignoreErrors:!0}),u="";while(!t.endOfFile()){let D=t.nextToken(),i=F5[g5(D,t)];if(i)u+=D[1].split(/\r?\n/).map((n)=>i(n)).join(`
|
|
147
|
+
`);else u+=D[1]}return u}xg.registerInput=E5;pg.exports=xg});var pe=s((yZ,rw)=>{var ag=Hu(),sg=c2();class VD extends Error{constructor(r,t,u,D,i,n){super(r);if(this.name="CssSyntaxError",this.reason=r,i)this.file=i;if(D)this.source=D;if(n)this.plugin=n;if(typeof t!=="undefined"&&typeof u!=="undefined")if(typeof t==="number")this.line=t,this.column=u;else this.line=t.line,this.column=t.column,this.endLine=u.line,this.endColumn=u.column;if(this.setMessage(),Error.captureStackTrace)Error.captureStackTrace(this,VD)}setMessage(){if(this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!=="undefined")this.message+=":"+this.line+":"+this.column;this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let t=this.source;if(r==null)r=ag.isColorSupported;let u=($)=>$,D=($)=>$,i=($)=>$;if(r){let{bold:$,gray:l,red:m}=ag.createColors(!0);if(D=(c)=>$(m(c)),u=(c)=>l(c),sg)i=(c)=>sg(c)}let n=t.split(/\r?\n/),o=Math.max(this.line-3,0),e=Math.min(this.line+2,n.length),f=String(e).length;return n.slice(o,e).map(($,l)=>{let m=o+1+l,c=" "+(" "+m).slice(-f)+" | ";if(m===this.line){if($.length>160){let _=20,q=Math.max(0,this.column-_),y=Math.max(this.column+_,this.endColumn+_),N=$.slice(q,y),R=u(c.replace(/\d/g," "))+$.slice(0,Math.min(this.column-1,_-1)).replace(/[^\t]/g," ");return D(">")+u(c)+i(N)+`
|
|
148
|
+
`+R+D("^")}let g=u(c.replace(/\d/g," "))+$.slice(0,this.column-1).replace(/[^\t]/g," ");return D(">")+u(c)+i($)+`
|
|
149
|
+
`+g+D("^")}return" "+u(c)+i($)}).join(`
|
|
150
|
+
`)}toString(){let r=this.showSourceCode();if(r)r=`
|
|
151
|
+
|
|
152
|
+
`+r+`
|
|
153
|
+
`;return this.name+": "+this.message+r}}rw.exports=VD;VD.default=VD});var v2=s((NZ,iw)=>{var tw={after:`
|
|
154
|
+
`,beforeClose:`
|
|
155
|
+
`,beforeComment:`
|
|
156
|
+
`,beforeDecl:`
|
|
157
|
+
`,beforeOpen:" ",beforeRule:`
|
|
158
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function w5(r){return r[0].toUpperCase()+r.slice(1)}class ae{constructor(r){this.builder=r}atrule(r,t){let u="@"+r.name,D=r.params?this.rawValue(r,"params"):"";if(typeof r.raws.afterName!=="undefined")u+=r.raws.afterName;else if(D)u+=" ";if(r.nodes)this.block(r,u+D);else{let i=(r.raws.between||"")+(t?";":"");this.builder(u+D+i,r)}}beforeAfter(r,t){let u;if(r.type==="decl")u=this.raw(r,null,"beforeDecl");else if(r.type==="comment")u=this.raw(r,null,"beforeComment");else if(t==="before")u=this.raw(r,null,"beforeRule");else u=this.raw(r,null,"beforeClose");let D=r.parent,i=0;while(D&&D.type!=="root")i+=1,D=D.parent;if(u.includes(`
|
|
159
|
+
`)){let n=this.raw(r,null,"indent");if(n.length)for(let o=0;o<i;o++)u+=n}return u}block(r,t){let u=this.raw(r,"between","beforeOpen");this.builder(t+u+"{",r,"start");let D;if(r.nodes&&r.nodes.length)this.body(r),D=this.raw(r,"after");else D=this.raw(r,"after","emptyBody");if(D)this.builder(D);this.builder("}",r,"end")}body(r){let t=r.nodes.length-1;while(t>0){if(r.nodes[t].type!=="comment")break;t-=1}let u=this.raw(r,"semicolon");for(let D=0;D<r.nodes.length;D++){let i=r.nodes[D],n=this.raw(i,"before");if(n)this.builder(n);this.stringify(i,t!==D||u)}}comment(r){let t=this.raw(r,"left","commentLeft"),u=this.raw(r,"right","commentRight");this.builder("/*"+t+r.text+u+"*/",r)}decl(r,t){let u=this.raw(r,"between","colon"),D=r.prop+u+this.rawValue(r,"value");if(r.important)D+=r.raws.important||" !important";if(t)D+=";";this.builder(D,r)}document(r){this.body(r)}raw(r,t,u){let D;if(!u)u=t;if(t){if(D=r.raws[t],typeof D!=="undefined")return D}let i=r.parent;if(u==="before"){if(!i||i.type==="root"&&i.first===r)return"";if(i&&i.type==="document")return""}if(!i)return tw[u];let n=r.root();if(!n.rawCache)n.rawCache={};if(typeof n.rawCache[u]!=="undefined")return n.rawCache[u];if(u==="before"||u==="after")return this.beforeAfter(r,u);else{let o="raw"+w5(u);if(this[o])D=this[o](n,r);else n.walk((e)=>{if(D=e.raws[t],typeof D!=="undefined")return!1})}if(typeof D==="undefined")D=tw[u];return n.rawCache[u]=D,D}rawBeforeClose(r){let t;if(r.walk((u)=>{if(u.nodes&&u.nodes.length>0){if(typeof u.raws.after!=="undefined"){if(t=u.raws.after,t.includes(`
|
|
160
|
+
`))t=t.replace(/[^\n]+$/,"");return!1}}}),t)t=t.replace(/\S/g,"");return t}rawBeforeComment(r,t){let u;if(r.walkComments((D)=>{if(typeof D.raws.before!=="undefined"){if(u=D.raws.before,u.includes(`
|
|
161
|
+
`))u=u.replace(/[^\n]+$/,"");return!1}}),typeof u==="undefined")u=this.raw(t,null,"beforeDecl");else if(u)u=u.replace(/\S/g,"");return u}rawBeforeDecl(r,t){let u;if(r.walkDecls((D)=>{if(typeof D.raws.before!=="undefined"){if(u=D.raws.before,u.includes(`
|
|
162
|
+
`))u=u.replace(/[^\n]+$/,"");return!1}}),typeof u==="undefined")u=this.raw(t,null,"beforeRule");else if(u)u=u.replace(/\S/g,"");return u}rawBeforeOpen(r){let t;return r.walk((u)=>{if(u.type!=="decl"){if(t=u.raws.between,typeof t!=="undefined")return!1}}),t}rawBeforeRule(r){let t;if(r.walk((u)=>{if(u.nodes&&(u.parent!==r||r.first!==u)){if(typeof u.raws.before!=="undefined"){if(t=u.raws.before,t.includes(`
|
|
163
|
+
`))t=t.replace(/[^\n]+$/,"");return!1}}}),t)t=t.replace(/\S/g,"");return t}rawColon(r){let t;return r.walkDecls((u)=>{if(typeof u.raws.between!=="undefined")return t=u.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(r){let t;return r.walk((u)=>{if(u.nodes&&u.nodes.length===0){if(t=u.raws.after,typeof t!=="undefined")return!1}}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let t;return r.walk((u)=>{let D=u.parent;if(D&&D!==r&&D.parent&&D.parent===r){if(typeof u.raws.before!=="undefined"){let i=u.raws.before.split(`
|
|
164
|
+
`);return t=i[i.length-1],t=t.replace(/\S/g,""),!1}}}),t}rawSemicolon(r){let t;return r.walk((u)=>{if(u.nodes&&u.nodes.length&&u.last.type==="decl"){if(t=u.raws.semicolon,typeof t!=="undefined")return!1}}),t}rawValue(r,t){let u=r[t],D=r.raws[t];if(D&&D.value===u)return D.raw;return u}root(r){if(this.body(r),r.raws.after)this.builder(r.raws.after)}rule(r){if(this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon)this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,t){if(!this[r.type])throw new Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,t)}}iw.exports=ae;ae.default=ae});var SD=s((BZ,uw)=>{var b5=v2();function E2(r,t){new b5(t).stringify(r)}uw.exports=E2;E2.default=E2});var se=s((C5,F2)=>{C5.isClean=Symbol("isClean");C5.my=Symbol("my")});var KD=s((qZ,Dw)=>{var U5=pe(),O5=v2(),y5=SD(),{isClean:QD,my:N5}=se();function g2(r,t){let u=new r.constructor;for(let D in r){if(!Object.prototype.hasOwnProperty.call(r,D))continue;if(D==="proxyCache")continue;let i=r[D],n=typeof i;if(D==="parent"&&n==="object"){if(t)u[D]=t}else if(D==="source")u[D]=i;else if(Array.isArray(i))u[D]=i.map((o)=>g2(o,u));else{if(n==="object"&&i!==null)i=g2(i);u[D]=i}}return u}function Tt(r,t){if(t&&typeof t.offset!=="undefined")return t.offset;let u=1,D=1,i=0;for(let n=0;n<r.length;n++){if(D===t.line&&u===t.column){i=n;break}if(r[n]===`
|
|
165
|
+
`)u=1,D+=1;else u+=1}return i}class rf{get proxyOf(){return this}constructor(r={}){this.raws={},this[QD]=!1,this[N5]=!0;for(let t in r)if(t==="nodes"){this.nodes=[];for(let u of r[t])if(typeof u.clone==="function")this.append(u.clone());else this.append(u)}else this[t]=r[t]}addToError(r){if(r.postcssNode=this,r.stack&&this.source&&/\n\s{4}at /.test(r.stack)){let t=this.source;r.stack=r.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return r}after(r){return this.parent.insertAfter(this,r),this}assign(r={}){for(let t in r)this[t]=r[t];return this}before(r){return this.parent.insertBefore(this,r),this}cleanRaws(r){if(delete this.raws.before,delete this.raws.after,!r)delete this.raws.between}clone(r={}){let t=g2(this);for(let u in r)t[u]=r[u];return t}cloneAfter(r={}){let t=this.clone(r);return this.parent.insertAfter(this,t),t}cloneBefore(r={}){let t=this.clone(r);return this.parent.insertBefore(this,t),t}error(r,t={}){if(this.source){let{end:u,start:D}=this.rangeBy(t);return this.source.input.error(r,{column:D.column,line:D.line},{column:u.column,line:u.line},t)}return new U5(r)}getProxyProcessor(){return{get(r,t){if(t==="proxyOf")return r;else if(t==="root")return()=>r.root().toProxy();else return r[t]},set(r,t,u){if(r[t]===u)return!0;if(r[t]=u,t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")r.markDirty();return!0}}}markClean(){this[QD]=!0}markDirty(){if(this[QD]){this[QD]=!1;let r=this;while(r=r.parent)r[QD]=!1}}next(){if(!this.parent)return;let r=this.parent.index(this);return this.parent.nodes[r+1]}positionBy(r={}){let t=this.source.start;if(r.index)t=this.positionInside(r.index);else if(r.word){let u="document"in this.source.input?this.source.input.document:this.source.input.css,i=u.slice(Tt(u,this.source.start),Tt(u,this.source.end)).indexOf(r.word);if(i!==-1)t=this.positionInside(i)}return t}positionInside(r){let t=this.source.start.column,u=this.source.start.line,D="document"in this.source.input?this.source.input.document:this.source.input.css,i=Tt(D,this.source.start),n=i+r;for(let o=i;o<n;o++)if(D[o]===`
|
|
166
|
+
`)t=1,u+=1;else t+=1;return{column:t,line:u,offset:n}}prev(){if(!this.parent)return;let r=this.parent.index(this);return this.parent.nodes[r-1]}rangeBy(r={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,u={column:this.source.start.column,line:this.source.start.line,offset:Tt(t,this.source.start)},D=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset==="number"?this.source.end.offset:Tt(t,this.source.end)+1}:{column:u.column+1,line:u.line,offset:u.offset+1};if(r.word){let n=t.slice(Tt(t,this.source.start),Tt(t,this.source.end)).indexOf(r.word);if(n!==-1)u=this.positionInside(n),D=this.positionInside(n+r.word.length)}else{if(r.start)u={column:r.start.column,line:r.start.line,offset:Tt(t,r.start)};else if(r.index)u=this.positionInside(r.index);if(r.end)D={column:r.end.column,line:r.end.line,offset:Tt(t,r.end)};else if(typeof r.endIndex==="number")D=this.positionInside(r.endIndex);else if(r.index)D=this.positionInside(r.index+1)}if(D.line<u.line||D.line===u.line&&D.column<=u.column)D={column:u.column+1,line:u.line,offset:u.offset+1};return{end:D,start:u}}raw(r,t){return new O5().raw(this,r,t)}remove(){if(this.parent)this.parent.removeChild(this);return this.parent=void 0,this}replaceWith(...r){if(this.parent){let t=this,u=!1;for(let D of r)if(D===this)u=!0;else if(u)this.parent.insertAfter(t,D),t=D;else this.parent.insertBefore(t,D);if(!u)this.remove()}return this}root(){let r=this;while(r.parent&&r.parent.type!=="document")r=r.parent;return r}toJSON(r,t){let u={},D=t==null;t=t||new Map;let i=0;for(let n in this){if(!Object.prototype.hasOwnProperty.call(this,n))continue;if(n==="parent"||n==="proxyCache")continue;let o=this[n];if(Array.isArray(o))u[n]=o.map((e)=>{if(typeof e==="object"&&e.toJSON)return e.toJSON(null,t);else return e});else if(typeof o==="object"&&o.toJSON)u[n]=o.toJSON(null,t);else if(n==="source"){if(o==null)continue;let e=t.get(o.input);if(e==null)e=i,t.set(o.input,i),i++;u[n]={end:o.end,inputId:e,start:o.start}}else u[n]=o}if(D)u.inputs=[...t.keys()].map((n)=>n.toJSON());return u}toProxy(){if(!this.proxyCache)this.proxyCache=new Proxy(this,this.getProxyProcessor());return this.proxyCache}toString(r=y5){if(r.stringify)r=r.stringify;let t="";return r(this,(u)=>{t+=u}),t}warn(r,t,u={}){let D={node:this};for(let i in u)D[i]=u[i];return r.warn(t,D)}}Dw.exports=rf;rf.default=rf});var HD=s((hZ,nw)=>{var B5=KD();class tf extends B5{constructor(r){super(r);this.type="comment"}}nw.exports=tf;tf.default=tf});var MD=s((zZ,ow)=>{var q5=KD();class uf extends q5{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(r){if(r&&typeof r.value!=="undefined"&&typeof r.value!=="string")r={...r,value:String(r.value)};super(r);this.type="decl"}}ow.exports=uf;uf.default=uf});var Di=s((JZ,Fw)=>{var ew=HD(),fw=MD(),h5=KD(),{isClean:$w,my:lw}=se(),w2,mw,cw,b2;function vw(r){return r.map((t)=>{if(t.nodes)t.nodes=vw(t.nodes);return delete t.source,t})}function Ew(r){if(r[$w]=!1,r.proxyOf.nodes)for(let t of r.proxyOf.nodes)Ew(t)}class Ft extends h5{get first(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[0]}get last(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...r){for(let t of r){let u=this.normalize(t,this.last);for(let D of u)this.proxyOf.nodes.push(D)}return this.markDirty(),this}cleanRaws(r){if(super.cleanRaws(r),this.nodes)for(let t of this.nodes)t.cleanRaws(r)}each(r){if(!this.proxyOf.nodes)return;let t=this.getIterator(),u,D;while(this.indexes[t]<this.proxyOf.nodes.length){if(u=this.indexes[t],D=r(this.proxyOf.nodes[u],u),D===!1)break;this.indexes[t]+=1}return delete this.indexes[t],D}every(r){return this.nodes.every(r)}getIterator(){if(!this.lastEach)this.lastEach=0;if(!this.indexes)this.indexes={};this.lastEach+=1;let r=this.lastEach;return this.indexes[r]=0,r}getProxyProcessor(){return{get(r,t){if(t==="proxyOf")return r;else if(!r[t])return r[t];else if(t==="each"||typeof t==="string"&&t.startsWith("walk"))return(...u)=>{return r[t](...u.map((D)=>{if(typeof D==="function")return(i,n)=>D(i.toProxy(),n);else return D}))};else if(t==="every"||t==="some")return(u)=>{return r[t]((D,...i)=>u(D.toProxy(),...i))};else if(t==="root")return()=>r.root().toProxy();else if(t==="nodes")return r.nodes.map((u)=>u.toProxy());else if(t==="first"||t==="last")return r[t].toProxy();else return r[t]},set(r,t,u){if(r[t]===u)return!0;if(r[t]=u,t==="name"||t==="params"||t==="selector")r.markDirty();return!0}}}index(r){if(typeof r==="number")return r;if(r.proxyOf)r=r.proxyOf;return this.proxyOf.nodes.indexOf(r)}insertAfter(r,t){let u=this.index(r),D=this.normalize(t,this.proxyOf.nodes[u]).reverse();u=this.index(r);for(let n of D)this.proxyOf.nodes.splice(u+1,0,n);let i;for(let n in this.indexes)if(i=this.indexes[n],u<i)this.indexes[n]=i+D.length;return this.markDirty(),this}insertBefore(r,t){let u=this.index(r),D=u===0?"prepend":!1,i=this.normalize(t,this.proxyOf.nodes[u],D).reverse();u=this.index(r);for(let o of i)this.proxyOf.nodes.splice(u,0,o);let n;for(let o in this.indexes)if(n=this.indexes[o],u<=n)this.indexes[o]=n+i.length;return this.markDirty(),this}normalize(r,t){if(typeof r==="string")r=vw(mw(r).nodes);else if(typeof r==="undefined")r=[];else if(Array.isArray(r)){r=r.slice(0);for(let D of r)if(D.parent)D.parent.removeChild(D,"ignore")}else if(r.type==="root"&&this.type!=="document"){r=r.nodes.slice(0);for(let D of r)if(D.parent)D.parent.removeChild(D,"ignore")}else if(r.type)r=[r];else if(r.prop){if(typeof r.value==="undefined")throw new Error("Value field is missed in node creation");else if(typeof r.value!=="string")r.value=String(r.value);r=[new fw(r)]}else if(r.selector||r.selectors)r=[new b2(r)];else if(r.name)r=[new w2(r)];else if(r.text)r=[new ew(r)];else throw new Error("Unknown node type in node creation");return r.map((D)=>{if(!D[lw])Ft.rebuild(D);if(D=D.proxyOf,D.parent)D.parent.removeChild(D);if(D[$w])Ew(D);if(!D.raws)D.raws={};if(typeof D.raws.before==="undefined"){if(t&&typeof t.raws.before!=="undefined")D.raws.before=t.raws.before.replace(/\S/g,"")}return D.parent=this.proxyOf,D})}prepend(...r){r=r.reverse();for(let t of r){let u=this.normalize(t,this.first,"prepend").reverse();for(let D of u)this.proxyOf.nodes.unshift(D);for(let D in this.indexes)this.indexes[D]=this.indexes[D]+u.length}return this.markDirty(),this}push(r){return r.parent=this,this.proxyOf.nodes.push(r),this}removeAll(){for(let r of this.proxyOf.nodes)r.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(r){r=this.index(r),this.proxyOf.nodes[r].parent=void 0,this.proxyOf.nodes.splice(r,1);let t;for(let u in this.indexes)if(t=this.indexes[u],t>=r)this.indexes[u]=t-1;return this.markDirty(),this}replaceValues(r,t,u){if(!u)u=t,t={};return this.walkDecls((D)=>{if(t.props&&!t.props.includes(D.prop))return;if(t.fast&&!D.value.includes(t.fast))return;D.value=D.value.replace(r,u)}),this.markDirty(),this}some(r){return this.nodes.some(r)}walk(r){return this.each((t,u)=>{let D;try{D=r(t,u)}catch(i){throw t.addToError(i)}if(D!==!1&&t.walk)D=t.walk(r);return D})}walkAtRules(r,t){if(!t)return t=r,this.walk((u,D)=>{if(u.type==="atrule")return t(u,D)});if(r instanceof RegExp)return this.walk((u,D)=>{if(u.type==="atrule"&&r.test(u.name))return t(u,D)});return this.walk((u,D)=>{if(u.type==="atrule"&&u.name===r)return t(u,D)})}walkComments(r){return this.walk((t,u)=>{if(t.type==="comment")return r(t,u)})}walkDecls(r,t){if(!t)return t=r,this.walk((u,D)=>{if(u.type==="decl")return t(u,D)});if(r instanceof RegExp)return this.walk((u,D)=>{if(u.type==="decl"&&r.test(u.prop))return t(u,D)});return this.walk((u,D)=>{if(u.type==="decl"&&u.prop===r)return t(u,D)})}walkRules(r,t){if(!t)return t=r,this.walk((u,D)=>{if(u.type==="rule")return t(u,D)});if(r instanceof RegExp)return this.walk((u,D)=>{if(u.type==="rule"&&r.test(u.selector))return t(u,D)});return this.walk((u,D)=>{if(u.type==="rule"&&u.selector===r)return t(u,D)})}}Ft.registerParse=(r)=>{mw=r};Ft.registerRule=(r)=>{b2=r};Ft.registerAtRule=(r)=>{w2=r};Ft.registerRoot=(r)=>{cw=r};Fw.exports=Ft;Ft.default=Ft;Ft.rebuild=(r)=>{if(r.type==="atrule")Object.setPrototypeOf(r,w2.prototype);else if(r.type==="rule")Object.setPrototypeOf(r,b2.prototype);else if(r.type==="decl")Object.setPrototypeOf(r,fw.prototype);else if(r.type==="comment")Object.setPrototypeOf(r,ew.prototype);else if(r.type==="root")Object.setPrototypeOf(r,cw.prototype);if(r[lw]=!0,r.nodes)r.nodes.forEach((t)=>{Ft.rebuild(t)})}});var Df=s((AZ,ww)=>{var gw=Di();class ZD extends gw{constructor(r){super(r);this.type="atrule"}append(...r){if(!this.proxyOf.nodes)this.nodes=[];return super.append(...r)}prepend(...r){if(!this.proxyOf.nodes)this.nodes=[];return super.prepend(...r)}}ww.exports=ZD;ZD.default=ZD;gw.registerAtRule(ZD)});var nf=s((XZ,_w)=>{var z5=Di(),bw,Cw;class Bu extends z5{constructor(r){super({type:"document",...r});if(!this.nodes)this.nodes=[]}toResult(r={}){return new bw(new Cw,this,r).stringify()}}Bu.registerLazyResult=(r)=>{bw=r};Bu.registerProcessor=(r)=>{Cw=r};_w.exports=Bu;Bu.default=Bu});var Uw=s((jZ,Iw)=>{var J5="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",A5=(r,t=21)=>{return(u=t)=>{let D="",i=u|0;while(i--)D+=r[Math.random()*r.length|0];return D}},X5=(r=21)=>{let t="",u=r|0;while(u--)t+=J5[Math.random()*64|0];return t};Iw.exports={nanoid:X5,customAlphabet:A5}});var yw=s((j5)=>{var Ow="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");j5.encode=function(r){if(0<=r&&r<Ow.length)return Ow[r];throw new TypeError("Must be between 0 and 63: "+r)};j5.decode=function(r){var t=65,u=90,D=97,i=122,n=48,o=57,e=43,f=47,$=26,l=52;if(t<=r&&r<=u)return r-t;if(D<=r&&r<=i)return r-D+$;if(n<=r&&r<=o)return r-n+l;if(r==e)return 62;if(r==f)return 63;return-1}});var _2=s((R5)=>{var Nw=yw(),C2=5,Bw=1<<C2,qw=Bw-1,hw=Bw;function Y5(r){return r<0?(-r<<1)+1:(r<<1)+0}function T5(r){var t=(r&1)===1,u=r>>1;return t?-u:u}R5.encode=function r(t){var u="",D,i=Y5(t);do{if(D=i&qw,i>>>=C2,i>0)D|=hw;u+=Nw.encode(D)}while(i>0);return u};R5.decode=function r(t,u,D){var i=t.length,n=0,o=0,e,f;do{if(u>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(f=Nw.decode(t.charCodeAt(u++)),f===-1)throw new Error("Invalid base64 digit: "+t.charAt(u-1));e=!!(f&hw),f&=qw,n=n+(f<<o),o+=C2}while(e);D.value=T5(n),D.rest=u}});var hu=s((tB)=>{function Q5(r,t,u){if(t in r)return r[t];else if(arguments.length===3)return u;else throw new Error('"'+t+'" is a required argument.')}tB.getArg=Q5;var zw=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,K5=/^data:.+\,.+$/;function LD(r){var t=r.match(zw);if(!t)return null;return{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}}tB.urlParse=LD;function qu(r){var t="";if(r.scheme)t+=r.scheme+":";if(t+="//",r.auth)t+=r.auth+"@";if(r.host)t+=r.host;if(r.port)t+=":"+r.port;if(r.path)t+=r.path;return t}tB.urlGenerate=qu;var H5=32;function M5(r){var t=[];return function(u){for(var D=0;D<t.length;D++)if(t[D].input===u){var i=t[0];return t[0]=t[D],t[D]=i,t[0].result}var n=r(u);if(t.unshift({input:u,result:n}),t.length>H5)t.pop();return n}}var I2=M5(function r(t){var u=t,D=LD(t);if(D){if(!D.path)return t;u=D.path}var i=tB.isAbsolute(u),n=[],o=0,e=0;while(!0)if(o=e,e=u.indexOf("/",o),e===-1){n.push(u.slice(o));break}else{n.push(u.slice(o,e));while(e<u.length&&u[e]==="/")e++}for(var f,$=0,e=n.length-1;e>=0;e--)if(f=n[e],f===".")n.splice(e,1);else if(f==="..")$++;else if($>0)if(f==="")n.splice(e+1,$),$=0;else n.splice(e,2),$--;if(u=n.join("/"),u==="")u=i?"/":".";if(D)return D.path=u,qu(D);return u});tB.normalize=I2;function Jw(r,t){if(r==="")r=".";if(t==="")t=".";var u=LD(t),D=LD(r);if(D)r=D.path||"/";if(u&&!u.scheme){if(D)u.scheme=D.scheme;return qu(u)}if(u||t.match(K5))return t;if(D&&!D.host&&!D.path)return D.host=t,qu(D);var i=t.charAt(0)==="/"?t:I2(r.replace(/\/+$/,"")+"/"+t);if(D)return D.path=i,qu(D);return i}tB.join=Jw;tB.isAbsolute=function(r){return r.charAt(0)==="/"||zw.test(r)};function Z5(r,t){if(r==="")r=".";r=r.replace(/\/$/,"");var u=0;while(t.indexOf(r+"/")!==0){var D=r.lastIndexOf("/");if(D<0)return t;if(r=r.slice(0,D),r.match(/^([^\/]+:\/)?\/*$/))return t;++u}return Array(u+1).join("../")+t.substr(r.length+1)}tB.relative=Z5;var Aw=function(){var r=Object.create(null);return!("__proto__"in r)}();function Xw(r){return r}function L5(r){if(jw(r))return"$"+r;return r}tB.toSetString=Aw?Xw:L5;function P5(r){if(jw(r))return r.slice(1);return r}tB.fromSetString=Aw?Xw:P5;function jw(r){if(!r)return!1;var t=r.length;if(t<9)return!1;if(r.charCodeAt(t-1)!==95||r.charCodeAt(t-2)!==95||r.charCodeAt(t-3)!==111||r.charCodeAt(t-4)!==116||r.charCodeAt(t-5)!==111||r.charCodeAt(t-6)!==114||r.charCodeAt(t-7)!==112||r.charCodeAt(t-8)!==95||r.charCodeAt(t-9)!==95)return!1;for(var u=t-10;u>=0;u--)if(r.charCodeAt(u)!==36)return!1;return!0}function k5(r,t,u){var D=Rt(r.source,t.source);if(D!==0)return D;if(D=r.originalLine-t.originalLine,D!==0)return D;if(D=r.originalColumn-t.originalColumn,D!==0||u)return D;if(D=r.generatedColumn-t.generatedColumn,D!==0)return D;if(D=r.generatedLine-t.generatedLine,D!==0)return D;return Rt(r.name,t.name)}tB.compareByOriginalPositions=k5;function d5(r,t,u){var D=r.originalLine-t.originalLine;if(D!==0)return D;if(D=r.originalColumn-t.originalColumn,D!==0||u)return D;if(D=r.generatedColumn-t.generatedColumn,D!==0)return D;if(D=r.generatedLine-t.generatedLine,D!==0)return D;return Rt(r.name,t.name)}tB.compareByOriginalPositionsNoSource=d5;function x5(r,t,u){var D=r.generatedLine-t.generatedLine;if(D!==0)return D;if(D=r.generatedColumn-t.generatedColumn,D!==0||u)return D;if(D=Rt(r.source,t.source),D!==0)return D;if(D=r.originalLine-t.originalLine,D!==0)return D;if(D=r.originalColumn-t.originalColumn,D!==0)return D;return Rt(r.name,t.name)}tB.compareByGeneratedPositionsDeflated=x5;function p5(r,t,u){var D=r.generatedColumn-t.generatedColumn;if(D!==0||u)return D;if(D=Rt(r.source,t.source),D!==0)return D;if(D=r.originalLine-t.originalLine,D!==0)return D;if(D=r.originalColumn-t.originalColumn,D!==0)return D;return Rt(r.name,t.name)}tB.compareByGeneratedPositionsDeflatedNoLine=p5;function Rt(r,t){if(r===t)return 0;if(r===null)return 1;if(t===null)return-1;if(r>t)return 1;return-1}function a5(r,t){var u=r.generatedLine-t.generatedLine;if(u!==0)return u;if(u=r.generatedColumn-t.generatedColumn,u!==0)return u;if(u=Rt(r.source,t.source),u!==0)return u;if(u=r.originalLine-t.originalLine,u!==0)return u;if(u=r.originalColumn-t.originalColumn,u!==0)return u;return Rt(r.name,t.name)}tB.compareByGeneratedPositionsInflated=a5;function s5(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}tB.parseSourceMapInput=s5;function rB(r,t,u){if(t=t||"",r){if(r[r.length-1]!=="/"&&t[0]!=="/")r+="/";t=r+t}if(u){var D=LD(u);if(!D)throw new Error("sourceMapURL could not be parsed");if(D.path){var i=D.path.lastIndexOf("/");if(i>=0)D.path=D.path.substring(0,i+1)}t=Jw(qu(D),t)}return I2(t)}tB.computeSourceURL=rB});var y2=s((bB)=>{var U2=hu(),O2=Object.prototype.hasOwnProperty,qi=typeof Map!=="undefined";function Vt(){this._array=[],this._set=qi?new Map:Object.create(null)}Vt.fromArray=function r(t,u){var D=new Vt;for(var i=0,n=t.length;i<n;i++)D.add(t[i],u);return D};Vt.prototype.size=function r(){return qi?this._set.size:Object.getOwnPropertyNames(this._set).length};Vt.prototype.add=function r(t,u){var D=qi?t:U2.toSetString(t),i=qi?this.has(t):O2.call(this._set,D),n=this._array.length;if(!i||u)this._array.push(t);if(!i)if(qi)this._set.set(t,n);else this._set[D]=n};Vt.prototype.has=function r(t){if(qi)return this._set.has(t);else{var u=U2.toSetString(t);return O2.call(this._set,u)}};Vt.prototype.indexOf=function r(t){if(qi){var u=this._set.get(t);if(u>=0)return u}else{var D=U2.toSetString(t);if(O2.call(this._set,D))return this._set[D]}throw new Error('"'+t+'" is not in the set.')};Vt.prototype.at=function r(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};Vt.prototype.toArray=function r(){return this._array.slice()};bB.ArraySet=Vt});var Ww=s((IB)=>{var Gw=hu();function _B(r,t){var u=r.generatedLine,D=t.generatedLine,i=r.generatedColumn,n=t.generatedColumn;return D>u||D==u&&n>=i||Gw.compareByGeneratedPositionsInflated(r,t)<=0}function of(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}of.prototype.unsortedForEach=function r(t,u){this._array.forEach(t,u)};of.prototype.add=function r(t){if(_B(this._last,t))this._last=t,this._array.push(t);else this._sorted=!1,this._array.push(t)};of.prototype.toArray=function r(){if(!this._sorted)this._array.sort(Gw.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};IB.MappingList=of});var N2=s((yB)=>{var PD=_2(),zr=hu(),ef=y2().ArraySet,OB=Ww().MappingList;function et(r){if(!r)r={};this._file=zr.getArg(r,"file",null),this._sourceRoot=zr.getArg(r,"sourceRoot",null),this._skipValidation=zr.getArg(r,"skipValidation",!1),this._ignoreInvalidMapping=zr.getArg(r,"ignoreInvalidMapping",!1),this._sources=new ef,this._names=new ef,this._mappings=new OB,this._sourcesContents=null}et.prototype._version=3;et.fromSourceMap=function r(t,u){var D=t.sourceRoot,i=new et(Object.assign(u||{},{file:t.file,sourceRoot:D}));return t.eachMapping(function(n){var o={generated:{line:n.generatedLine,column:n.generatedColumn}};if(n.source!=null){if(o.source=n.source,D!=null)o.source=zr.relative(D,o.source);if(o.original={line:n.originalLine,column:n.originalColumn},n.name!=null)o.name=n.name}i.addMapping(o)}),t.sources.forEach(function(n){var o=n;if(D!==null)o=zr.relative(D,n);if(!i._sources.has(o))i._sources.add(o);var e=t.sourceContentFor(n);if(e!=null)i.setSourceContent(n,e)}),i};et.prototype.addMapping=function r(t){var u=zr.getArg(t,"generated"),D=zr.getArg(t,"original",null),i=zr.getArg(t,"source",null),n=zr.getArg(t,"name",null);if(!this._skipValidation){if(this._validateMapping(u,D,i,n)===!1)return}if(i!=null){if(i=String(i),!this._sources.has(i))this._sources.add(i)}if(n!=null){if(n=String(n),!this._names.has(n))this._names.add(n)}this._mappings.add({generatedLine:u.line,generatedColumn:u.column,originalLine:D!=null&&D.line,originalColumn:D!=null&&D.column,source:i,name:n})};et.prototype.setSourceContent=function r(t,u){var D=t;if(this._sourceRoot!=null)D=zr.relative(this._sourceRoot,D);if(u!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[zr.toSetString(D)]=u}else if(this._sourcesContents){if(delete this._sourcesContents[zr.toSetString(D)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};et.prototype.applySourceMap=function r(t,u,D){var i=u;if(u==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=t.file}var n=this._sourceRoot;if(n!=null)i=zr.relative(n,i);var o=new ef,e=new ef;this._mappings.unsortedForEach(function(f){if(f.source===i&&f.originalLine!=null){var $=t.originalPositionFor({line:f.originalLine,column:f.originalColumn});if($.source!=null){if(f.source=$.source,D!=null)f.source=zr.join(D,f.source);if(n!=null)f.source=zr.relative(n,f.source);if(f.originalLine=$.line,f.originalColumn=$.column,$.name!=null)f.name=$.name}}var l=f.source;if(l!=null&&!o.has(l))o.add(l);var m=f.name;if(m!=null&&!e.has(m))e.add(m)},this),this._sources=o,this._names=e,t.sources.forEach(function(f){var $=t.sourceContentFor(f);if($!=null){if(D!=null)f=zr.join(D,f);if(n!=null)f=zr.relative(n,f);this.setSourceContent(f,$)}},this)};et.prototype._validateMapping=function r(t,u,D,i){if(u&&typeof u.line!=="number"&&typeof u.column!=="number"){var n="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping){if(typeof console!=="undefined"&&console.warn)console.warn(n);return!1}else throw new Error(n)}if(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!u&&!D&&!i)return;else if(t&&"line"in t&&"column"in t&&u&&"line"in u&&"column"in u&&t.line>0&&t.column>=0&&u.line>0&&u.column>=0&&D)return;else{var n="Invalid mapping: "+JSON.stringify({generated:t,source:D,original:u,name:i});if(this._ignoreInvalidMapping){if(typeof console!=="undefined"&&console.warn)console.warn(n);return!1}else throw new Error(n)}};et.prototype._serializeMappings=function r(){var t=0,u=1,D=0,i=0,n=0,o=0,e="",f,$,l,m,c=this._mappings.toArray();for(var g=0,_=c.length;g<_;g++){if($=c[g],f="",$.generatedLine!==u){t=0;while($.generatedLine!==u)f+=";",u++}else if(g>0){if(!zr.compareByGeneratedPositionsInflated($,c[g-1]))continue;f+=","}if(f+=PD.encode($.generatedColumn-t),t=$.generatedColumn,$.source!=null){if(m=this._sources.indexOf($.source),f+=PD.encode(m-o),o=m,f+=PD.encode($.originalLine-1-i),i=$.originalLine-1,f+=PD.encode($.originalColumn-D),D=$.originalColumn,$.name!=null)l=this._names.indexOf($.name),f+=PD.encode(l-n),n=l}e+=f}return e};et.prototype._generateSourcesContent=function r(t,u){return t.map(function(D){if(!this._sourcesContents)return null;if(u!=null)D=zr.relative(u,D);var i=zr.toSetString(D);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};et.prototype.toJSON=function r(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null)t.file=this._file;if(this._sourceRoot!=null)t.sourceRoot=this._sourceRoot;if(this._sourcesContents)t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot);return t};et.prototype.toString=function r(){return JSON.stringify(this.toJSON())};yB.SourceMapGenerator=et});var Tw=s((BB)=>{BB.GREATEST_LOWER_BOUND=1;BB.LEAST_UPPER_BOUND=2;function B2(r,t,u,D,i,n){var o=Math.floor((t-r)/2)+r,e=i(u,D[o],!0);if(e===0)return o;else if(e>0){if(t-o>1)return B2(o,t,u,D,i,n);if(n==BB.LEAST_UPPER_BOUND)return t<D.length?t:-1;else return o}else{if(o-r>1)return B2(r,o,u,D,i,n);if(n==BB.LEAST_UPPER_BOUND)return o;else return r<0?-1:r}}BB.search=function r(t,u,D,i){if(u.length===0)return-1;var n=B2(-1,u.length,t,u,D,i||BB.GREATEST_LOWER_BOUND);if(n<0)return-1;while(n-1>=0){if(D(u[n],u[n-1],!0)!==0)break;--n}return n}});var Vw=s((JB)=>{function hB(r){function t(i,n,o){var e=i[n];i[n]=i[o],i[o]=e}function u(i,n){return Math.round(i+Math.random()*(n-i))}function D(i,n,o,e){if(o<e){var f=u(o,e),$=o-1;t(i,f,e);var l=i[e];for(var m=o;m<e;m++)if(n(i[m],l,!1)<=0)$+=1,t(i,$,m);t(i,$+1,m);var c=$+1;D(i,n,o,c-1),D(i,n,c+1,e)}}return D}function zB(r){let t=hB.toString();return new Function(`return ${t}`)()(r)}var Rw=new WeakMap;JB.quickSort=function(r,t,u=0){let D=Rw.get(t);if(D===void 0)D=zB(t),Rw.set(t,D);D(r,t,u,r.length-1)}});var Kw=s((jB)=>{var H=hu(),z2=Tw(),zu=y2().ArraySet,XB=_2(),kD=Vw().quickSort;function Ur(r,t){var u=r;if(typeof r==="string")u=H.parseSourceMapInput(r);return u.sections!=null?new gt(u,t):new Vr(u,t)}Ur.fromSourceMap=function(r,t){return Vr.fromSourceMap(r,t)};Ur.prototype._version=3;Ur.prototype.__generatedMappings=null;Object.defineProperty(Ur.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__generatedMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__generatedMappings}});Ur.prototype.__originalMappings=null;Object.defineProperty(Ur.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__originalMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__originalMappings}});Ur.prototype._charIsMappingSeparator=function r(t,u){var D=t.charAt(u);return D===";"||D===","};Ur.prototype._parseMappings=function r(t,u){throw new Error("Subclasses must implement _parseMappings")};Ur.GENERATED_ORDER=1;Ur.ORIGINAL_ORDER=2;Ur.GREATEST_LOWER_BOUND=1;Ur.LEAST_UPPER_BOUND=2;Ur.prototype.eachMapping=function r(t,u,D){var i=u||null,n=D||Ur.GENERATED_ORDER,o;switch(n){case Ur.GENERATED_ORDER:o=this._generatedMappings;break;case Ur.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var e=this.sourceRoot,f=t.bind(i),$=this._names,l=this._sources,m=this._sourceMapURL;for(var c=0,g=o.length;c<g;c++){var _=o[c],q=_.source===null?null:l.at(_.source);if(q!==null)q=H.computeSourceURL(e,q,m);f({source:q,generatedLine:_.generatedLine,generatedColumn:_.generatedColumn,originalLine:_.originalLine,originalColumn:_.originalColumn,name:_.name===null?null:$.at(_.name)})}};Ur.prototype.allGeneratedPositionsFor=function r(t){var u=H.getArg(t,"line"),D={source:H.getArg(t,"source"),originalLine:u,originalColumn:H.getArg(t,"column",0)};if(D.source=this._findSourceIndex(D.source),D.source<0)return[];var i=[],n=this._findMapping(D,this._originalMappings,"originalLine","originalColumn",H.compareByOriginalPositions,z2.LEAST_UPPER_BOUND);if(n>=0){var o=this._originalMappings[n];if(t.column===void 0){var e=o.originalLine;while(o&&o.originalLine===e)i.push({line:H.getArg(o,"generatedLine",null),column:H.getArg(o,"generatedColumn",null),lastColumn:H.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++n]}else{var f=o.originalColumn;while(o&&o.originalLine===u&&o.originalColumn==f)i.push({line:H.getArg(o,"generatedLine",null),column:H.getArg(o,"generatedColumn",null),lastColumn:H.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++n]}}return i};jB.SourceMapConsumer=Ur;function Vr(r,t){var u=r;if(typeof r==="string")u=H.parseSourceMapInput(r);var D=H.getArg(u,"version"),i=H.getArg(u,"sources"),n=H.getArg(u,"names",[]),o=H.getArg(u,"sourceRoot",null),e=H.getArg(u,"sourcesContent",null),f=H.getArg(u,"mappings"),$=H.getArg(u,"file",null);if(D!=this._version)throw new Error("Unsupported version: "+D);if(o)o=H.normalize(o);i=i.map(String).map(H.normalize).map(function(l){return o&&H.isAbsolute(o)&&H.isAbsolute(l)?H.relative(o,l):l}),this._names=zu.fromArray(n.map(String),!0),this._sources=zu.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(l){return H.computeSourceURL(o,l,t)}),this.sourceRoot=o,this.sourcesContent=e,this._mappings=f,this._sourceMapURL=t,this.file=$}Vr.prototype=Object.create(Ur.prototype);Vr.prototype.consumer=Ur;Vr.prototype._findSourceIndex=function(r){var t=r;if(this.sourceRoot!=null)t=H.relative(this.sourceRoot,t);if(this._sources.has(t))return this._sources.indexOf(t);var u;for(u=0;u<this._absoluteSources.length;++u)if(this._absoluteSources[u]==r)return u;return-1};Vr.fromSourceMap=function r(t,u){var D=Object.create(Vr.prototype),i=D._names=zu.fromArray(t._names.toArray(),!0),n=D._sources=zu.fromArray(t._sources.toArray(),!0);D.sourceRoot=t._sourceRoot,D.sourcesContent=t._generateSourcesContent(D._sources.toArray(),D.sourceRoot),D.file=t._file,D._sourceMapURL=u,D._absoluteSources=D._sources.toArray().map(function(g){return H.computeSourceURL(D.sourceRoot,g,u)});var o=t._mappings.toArray().slice(),e=D.__generatedMappings=[],f=D.__originalMappings=[];for(var $=0,l=o.length;$<l;$++){var m=o[$],c=new Qw;if(c.generatedLine=m.generatedLine,c.generatedColumn=m.generatedColumn,m.source){if(c.source=n.indexOf(m.source),c.originalLine=m.originalLine,c.originalColumn=m.originalColumn,m.name)c.name=i.indexOf(m.name);f.push(c)}e.push(c)}return kD(D.__originalMappings,H.compareByOriginalPositions),D};Vr.prototype._version=3;Object.defineProperty(Vr.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Qw(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var h2=H.compareByGeneratedPositionsDeflatedNoLine;function Sw(r,t){let u=r.length,D=r.length-t;if(D<=1)return;else if(D==2){let i=r[t],n=r[t+1];if(h2(i,n)>0)r[t]=n,r[t+1]=i}else if(D<20)for(let i=t;i<u;i++)for(let n=i;n>t;n--){let o=r[n-1],e=r[n];if(h2(o,e)<=0)break;r[n-1]=e,r[n]=o}else kD(r,h2,t)}Vr.prototype._parseMappings=function r(t,u){var D=1,i=0,n=0,o=0,e=0,f=0,$=t.length,l=0,m={},c={},g=[],_=[],q,y,N,R,z;let A=0;while(l<$)if(t.charAt(l)===";")D++,l++,i=0,Sw(_,A),A=_.length;else if(t.charAt(l)===",")l++;else{q=new Qw,q.generatedLine=D;for(R=l;R<$;R++)if(this._charIsMappingSeparator(t,R))break;y=t.slice(l,R),N=[];while(l<R)XB.decode(t,l,c),z=c.value,l=c.rest,N.push(z);if(N.length===2)throw new Error("Found a source, but no line and column");if(N.length===3)throw new Error("Found a source and line, but no column");if(q.generatedColumn=i+N[0],i=q.generatedColumn,N.length>1){if(q.source=e+N[1],e+=N[1],q.originalLine=n+N[2],n=q.originalLine,q.originalLine+=1,q.originalColumn=o+N[3],o=q.originalColumn,N.length>4)q.name=f+N[4],f+=N[4]}if(_.push(q),typeof q.originalLine==="number"){let L=q.source;while(g.length<=L)g.push(null);if(g[L]===null)g[L]=[];g[L].push(q)}}Sw(_,A),this.__generatedMappings=_;for(var K=0;K<g.length;K++)if(g[K]!=null)kD(g[K],H.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...g)};Vr.prototype._findMapping=function r(t,u,D,i,n,o){if(t[D]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[D]);if(t[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[i]);return z2.search(t,u,n,o)};Vr.prototype.computeColumnSpans=function r(){for(var t=0;t<this._generatedMappings.length;++t){var u=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var D=this._generatedMappings[t+1];if(u.generatedLine===D.generatedLine){u.lastGeneratedColumn=D.generatedColumn-1;continue}}u.lastGeneratedColumn=1/0}};Vr.prototype.originalPositionFor=function r(t){var u={generatedLine:H.getArg(t,"line"),generatedColumn:H.getArg(t,"column")},D=this._findMapping(u,this._generatedMappings,"generatedLine","generatedColumn",H.compareByGeneratedPositionsDeflated,H.getArg(t,"bias",Ur.GREATEST_LOWER_BOUND));if(D>=0){var i=this._generatedMappings[D];if(i.generatedLine===u.generatedLine){var n=H.getArg(i,"source",null);if(n!==null)n=this._sources.at(n),n=H.computeSourceURL(this.sourceRoot,n,this._sourceMapURL);var o=H.getArg(i,"name",null);if(o!==null)o=this._names.at(o);return{source:n,line:H.getArg(i,"originalLine",null),column:H.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};Vr.prototype.hasContentsOfAllSources=function r(){if(!this.sourcesContent)return!1;return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null})};Vr.prototype.sourceContentFor=function r(t,u){if(!this.sourcesContent)return null;var D=this._findSourceIndex(t);if(D>=0)return this.sourcesContent[D];var i=t;if(this.sourceRoot!=null)i=H.relative(this.sourceRoot,i);var n;if(this.sourceRoot!=null&&(n=H.urlParse(this.sourceRoot))){var o=i.replace(/^file:\/\//,"");if(n.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!n.path||n.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(u)return null;else throw new Error('"'+i+'" is not in the SourceMap.')};Vr.prototype.generatedPositionFor=function r(t){var u=H.getArg(t,"source");if(u=this._findSourceIndex(u),u<0)return{line:null,column:null,lastColumn:null};var D={source:u,originalLine:H.getArg(t,"line"),originalColumn:H.getArg(t,"column")},i=this._findMapping(D,this._originalMappings,"originalLine","originalColumn",H.compareByOriginalPositions,H.getArg(t,"bias",Ur.GREATEST_LOWER_BOUND));if(i>=0){var n=this._originalMappings[i];if(n.source===D.source)return{line:H.getArg(n,"generatedLine",null),column:H.getArg(n,"generatedColumn",null),lastColumn:H.getArg(n,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};jB.BasicSourceMapConsumer=Vr;function gt(r,t){var u=r;if(typeof r==="string")u=H.parseSourceMapInput(r);var D=H.getArg(u,"version"),i=H.getArg(u,"sections");if(D!=this._version)throw new Error("Unsupported version: "+D);this._sources=new zu,this._names=new zu;var n={line:-1,column:0};this._sections=i.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var e=H.getArg(o,"offset"),f=H.getArg(e,"line"),$=H.getArg(e,"column");if(f<n.line||f===n.line&&$<n.column)throw new Error("Section offsets must be ordered and non-overlapping.");return n=e,{generatedOffset:{generatedLine:f+1,generatedColumn:$+1},consumer:new Ur(H.getArg(o,"map"),t)}})}gt.prototype=Object.create(Ur.prototype);gt.prototype.constructor=Ur;gt.prototype._version=3;Object.defineProperty(gt.prototype,"sources",{get:function(){var r=[];for(var t=0;t<this._sections.length;t++)for(var u=0;u<this._sections[t].consumer.sources.length;u++)r.push(this._sections[t].consumer.sources[u]);return r}});gt.prototype.originalPositionFor=function r(t){var u={generatedLine:H.getArg(t,"line"),generatedColumn:H.getArg(t,"column")},D=z2.search(u,this._sections,function(n,o){var e=n.generatedLine-o.generatedOffset.generatedLine;if(e)return e;return n.generatedColumn-o.generatedOffset.generatedColumn}),i=this._sections[D];if(!i)return{source:null,line:null,column:null,name:null};return i.consumer.originalPositionFor({line:u.generatedLine-(i.generatedOffset.generatedLine-1),column:u.generatedColumn-(i.generatedOffset.generatedLine===u.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:t.bias})};gt.prototype.hasContentsOfAllSources=function r(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})};gt.prototype.sourceContentFor=function r(t,u){for(var D=0;D<this._sections.length;D++){var i=this._sections[D],n=i.consumer.sourceContentFor(t,!0);if(n||n==="")return n}if(u)return null;else throw new Error('"'+t+'" is not in the SourceMap.')};gt.prototype.generatedPositionFor=function r(t){for(var u=0;u<this._sections.length;u++){var D=this._sections[u];if(D.consumer._findSourceIndex(H.getArg(t,"source"))===-1)continue;var i=D.consumer.generatedPositionFor(t);if(i){var n={line:i.line+(D.generatedOffset.generatedLine-1),column:i.column+(D.generatedOffset.generatedLine===i.line?D.generatedOffset.generatedColumn-1:0)};return n}}return{line:null,column:null}};gt.prototype._parseMappings=function r(t,u){this.__generatedMappings=[],this.__originalMappings=[];for(var D=0;D<this._sections.length;D++){var i=this._sections[D],n=i.consumer._generatedMappings;for(var o=0;o<n.length;o++){var e=n[o],f=i.consumer._sources.at(e.source);if(f!==null)f=H.computeSourceURL(i.consumer.sourceRoot,f,this._sourceMapURL);this._sources.add(f),f=this._sources.indexOf(f);var $=null;if(e.name)$=i.consumer._names.at(e.name),this._names.add($),$=this._names.indexOf($);var l={source:f,generatedLine:e.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:e.generatedColumn+(i.generatedOffset.generatedLine===e.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:e.originalLine,originalColumn:e.originalColumn,name:$};if(this.__generatedMappings.push(l),typeof l.originalLine==="number")this.__originalMappings.push(l)}}kD(this.__generatedMappings,H.compareByGeneratedPositionsDeflated),kD(this.__originalMappings,H.compareByOriginalPositions)};jB.IndexedSourceMapConsumer=gt});var Hw=s((SB)=>{var TB=N2().SourceMapGenerator,ff=hu(),RB=/(\r?\n)/,VB=10,Ju="$$$isSourceNode$$$";function rt(r,t,u,D,i){if(this.children=[],this.sourceContents={},this.line=r==null?null:r,this.column=t==null?null:t,this.source=u==null?null:u,this.name=i==null?null:i,this[Ju]=!0,D!=null)this.add(D)}rt.fromStringWithSourceMap=function r(t,u,D){var i=new rt,n=t.split(RB),o=0,e=function(){var c=_(),g=_()||"";return c+g;function _(){return o<n.length?n[o++]:void 0}},f=1,$=0,l=null;if(u.eachMapping(function(c){if(l!==null)if(f<c.generatedLine)m(l,e()),f++,$=0;else{var g=n[o]||"",_=g.substr(0,c.generatedColumn-$);n[o]=g.substr(c.generatedColumn-$),$=c.generatedColumn,m(l,_),l=c;return}while(f<c.generatedLine)i.add(e()),f++;if($<c.generatedColumn){var g=n[o]||"";i.add(g.substr(0,c.generatedColumn)),n[o]=g.substr(c.generatedColumn),$=c.generatedColumn}l=c},this),o<n.length){if(l)m(l,e());i.add(n.splice(o).join(""))}return u.sources.forEach(function(c){var g=u.sourceContentFor(c);if(g!=null){if(D!=null)c=ff.join(D,c);i.setSourceContent(c,g)}}),i;function m(c,g){if(c===null||c.source===void 0)i.add(g);else{var _=D?ff.join(D,c.source):c.source;i.add(new rt(c.originalLine,c.originalColumn,_,g,c.name))}}};rt.prototype.add=function r(t){if(Array.isArray(t))t.forEach(function(u){this.add(u)},this);else if(t[Ju]||typeof t==="string"){if(t)this.children.push(t)}else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};rt.prototype.prepend=function r(t){if(Array.isArray(t))for(var u=t.length-1;u>=0;u--)this.prepend(t[u]);else if(t[Ju]||typeof t==="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};rt.prototype.walk=function r(t){var u;for(var D=0,i=this.children.length;D<i;D++)if(u=this.children[D],u[Ju])u.walk(t);else if(u!=="")t(u,{source:this.source,line:this.line,column:this.column,name:this.name})};rt.prototype.join=function r(t){var u,D,i=this.children.length;if(i>0){u=[];for(D=0;D<i-1;D++)u.push(this.children[D]),u.push(t);u.push(this.children[D]),this.children=u}return this};rt.prototype.replaceRight=function r(t,u){var D=this.children[this.children.length-1];if(D[Ju])D.replaceRight(t,u);else if(typeof D==="string")this.children[this.children.length-1]=D.replace(t,u);else this.children.push("".replace(t,u));return this};rt.prototype.setSourceContent=function r(t,u){this.sourceContents[ff.toSetString(t)]=u};rt.prototype.walkSourceContents=function r(t){for(var u=0,D=this.children.length;u<D;u++)if(this.children[u][Ju])this.children[u].walkSourceContents(t);var i=Object.keys(this.sourceContents);for(var u=0,D=i.length;u<D;u++)t(ff.fromSetString(i[u]),this.sourceContents[i[u]])};rt.prototype.toString=function r(){var t="";return this.walk(function(u){t+=u}),t};rt.prototype.toStringWithSourceMap=function r(t){var u={code:"",line:1,column:0},D=new TB(t),i=!1,n=null,o=null,e=null,f=null;return this.walk(function($,l){if(u.code+=$,l.source!==null&&l.line!==null&&l.column!==null){if(n!==l.source||o!==l.line||e!==l.column||f!==l.name)D.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:u.line,column:u.column},name:l.name});n=l.source,o=l.line,e=l.column,f=l.name,i=!0}else if(i)D.addMapping({generated:{line:u.line,column:u.column}}),n=null,i=!1;for(var m=0,c=$.length;m<c;m++)if($.charCodeAt(m)===VB){if(u.line++,u.column=0,m+1===c)n=null,i=!1;else if(i)D.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:u.line,column:u.column},name:l.name})}else u.column++}),this.walkSourceContents(function($,l){D.setSourceContent($,l)}),{code:u.code,map:D}};SB.SourceNode=rt});var $f=s((KB)=>{KB.SourceMapGenerator=N2().SourceMapGenerator;KB.SourceMapConsumer=Kw().SourceMapConsumer;KB.SourceNode=Hw().SourceNode});var A2=s((ZZ,Lw)=>{var{existsSync:LB,readFileSync:PB}=it("fs"),{dirname:J2,join:kB}=it("path"),{SourceMapConsumer:Mw,SourceMapGenerator:Zw}=$f();function dB(r){if(Buffer)return Buffer.from(r,"base64").toString();else return window.atob(r)}class lf{constructor(r,t){if(t.map===!1)return;this.loadAnnotation(r),this.inline=this.startWith(this.annotation,"data:");let u=t.map?t.map.prev:void 0,D=this.loadMap(t.from,u);if(!this.mapFile&&t.from)this.mapFile=t.from;if(this.mapFile)this.root=J2(this.mapFile);if(D)this.text=D}consumer(){if(!this.consumerCache)this.consumerCache=new Mw(this.text);return this.consumerCache}decodeInline(r){let t=/^data:application\/json;charset=utf-?8;base64,/,u=/^data:application\/json;base64,/,D=/^data:application\/json;charset=utf-?8,/,i=/^data:application\/json,/,n=r.match(D)||r.match(i);if(n)return decodeURIComponent(r.substr(n[0].length));let o=r.match(t)||r.match(u);if(o)return dB(r.substr(o[0].length));let e=r.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+e)}getAnnotationURL(r){return r.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(r){if(typeof r!=="object")return!1;return typeof r.mappings==="string"||typeof r._mappings==="string"||Array.isArray(r.sections)}loadAnnotation(r){let t=r.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let u=r.lastIndexOf(t.pop()),D=r.indexOf("*/",u);if(u>-1&&D>-1)this.annotation=this.getAnnotationURL(r.substring(u,D))}loadFile(r){if(this.root=J2(r),LB(r))return this.mapFile=r,PB(r,"utf-8").toString().trim()}loadMap(r,t){if(t===!1)return!1;if(t)if(typeof t==="string")return t;else if(typeof t==="function"){let u=t(r);if(u){let D=this.loadFile(u);if(!D)throw new Error("Unable to load previous source map: "+u.toString());return D}}else if(t instanceof Mw)return Zw.fromSourceMap(t).toString();else if(t instanceof Zw)return t.toString();else if(this.isMap(t))return JSON.stringify(t);else throw new Error("Unsupported previous source map format: "+t.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let u=this.annotation;if(r)u=kB(J2(r),u);return this.loadFile(u)}}startWith(r,t){if(!r)return!1;return r.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}Lw.exports=lf;lf.default=lf});var xD=s((LZ,pw)=>{var{nanoid:xB}=Uw(),{isAbsolute:G2,resolve:W2}=it("path"),{SourceMapConsumer:pB,SourceMapGenerator:aB}=$f(),{fileURLToPath:Pw,pathToFileURL:mf}=it("url"),kw=pe(),sB=A2(),X2=c2(),j2=Symbol("lineToIndexCache"),rq=Boolean(pB&&aB),dw=Boolean(W2&&G2);function xw(r){if(r[j2])return r[j2];let t=r.css.split(`
|
|
167
|
+
`),u=new Array(t.length),D=0;for(let i=0,n=t.length;i<n;i++)u[i]=D,D+=t[i].length+1;return r[j2]=u,u}class dD{get from(){return this.file||this.id}constructor(r,t={}){if(r===null||typeof r==="undefined"||typeof r==="object"&&!r.toString)throw new Error(`PostCSS received ${r} instead of CSS string`);if(this.css=r.toString(),this.css[0]==="\uFEFF"||this.css[0]==="")this.hasBOM=!0,this.css=this.css.slice(1);else this.hasBOM=!1;if(this.document=this.css,t.document)this.document=t.document.toString();if(t.from)if(!dw||/^\w+:\/\//.test(t.from)||G2(t.from))this.file=t.from;else this.file=W2(t.from);if(dw&&rq){let u=new sB(this.css,t);if(u.text){this.map=u;let D=u.consumer().file;if(!this.file&&D)this.file=this.mapResolve(D)}}if(!this.file)this.id="<input css "+xB(6)+">";if(this.map)this.map.file=this.from}error(r,t,u,D={}){let i,n,o,e,f;if(t&&typeof t==="object"){let l=t,m=u;if(typeof l.offset==="number"){e=l.offset;let c=this.fromOffset(e);t=c.line,u=c.col}else t=l.line,u=l.column,e=this.fromLineAndColumn(t,u);if(typeof m.offset==="number"){o=m.offset;let c=this.fromOffset(o);n=c.line,i=c.col}else n=m.line,i=m.column,o=this.fromLineAndColumn(m.line,m.column)}else if(!u){e=t;let l=this.fromOffset(e);t=l.line,u=l.col}else e=this.fromLineAndColumn(t,u);let $=this.origin(t,u,n,i);if($)f=new kw(r,$.endLine===void 0?$.line:{column:$.column,line:$.line},$.endLine===void 0?$.column:{column:$.endColumn,line:$.endLine},$.source,$.file,D.plugin);else f=new kw(r,n===void 0?t:{column:u,line:t},n===void 0?u:{column:i,line:n},this.css,this.file,D.plugin);if(f.input={column:u,endColumn:i,endLine:n,endOffset:o,line:t,offset:e,source:this.css},this.file){if(mf)f.input.url=mf(this.file).toString();f.input.file=this.file}return f}fromLineAndColumn(r,t){return xw(this)[r-1]+t-1}fromOffset(r){let t=xw(this),u=t[t.length-1],D=0;if(r>=u)D=t.length-1;else{let i=t.length-2,n;while(D<i)if(n=D+(i-D>>1),r<t[n])i=n-1;else if(r>=t[n+1])D=n+1;else{D=n;break}}return{col:r-t[D]+1,line:D+1}}mapResolve(r){if(/^\w+:\/\//.test(r))return r;return W2(this.map.consumer().sourceRoot||this.map.root||".",r)}origin(r,t,u,D){if(!this.map)return!1;let i=this.map.consumer(),n=i.originalPositionFor({column:t,line:r});if(!n.source)return!1;let o;if(typeof u==="number")o=i.originalPositionFor({column:D,line:u});let e;if(G2(n.source))e=mf(n.source);else e=new URL(n.source,this.map.consumer().sourceRoot||mf(this.map.mapFile));let f={column:n.column,endColumn:o&&o.column,endLine:o&&o.line,line:n.line,url:e.toString()};if(e.protocol==="file:")if(Pw)f.file=Pw(e);else throw new Error("file: protocol is not available in this PostCSS build");let $=i.sourceContentFor(n.source);if($)f.source=$;return f}toJSON(){let r={};for(let t of["hasBOM","css","file","id"])if(this[t]!=null)r[t]=this[t];if(this.map){if(r.map={...this.map},r.map.consumerCache)r.map.consumerCache=void 0}return r}}pw.exports=dD;dD.default=dD;if(X2&&X2.registerInput)X2.registerInput(dD)});var Au=s((PZ,tb)=>{var aw=Di(),sw,rb;class hi extends aw{constructor(r){super(r);if(this.type="root",!this.nodes)this.nodes=[]}normalize(r,t,u){let D=super.normalize(r);if(t){if(u==="prepend")if(this.nodes.length>1)t.raws.before=this.nodes[1].raws.before;else delete t.raws.before;else if(this.first!==t)for(let i of D)i.raws.before=t.raws.before}return D}removeChild(r,t){let u=this.index(r);if(!t&&u===0&&this.nodes.length>1)this.nodes[1].raws.before=this.nodes[u].raws.before;return super.removeChild(r)}toResult(r={}){return new sw(new rb,this,r).stringify()}}hi.registerLazyResult=(r)=>{sw=r};hi.registerProcessor=(r)=>{rb=r};tb.exports=hi;hi.default=hi;aw.registerRoot(hi)});var Y2=s((kZ,ib)=>{var pD={comma(r){return pD.split(r,[","],!0)},space(r){let t=[" ",`
|
|
168
|
+
`,"\t"];return pD.split(r,t)},split(r,t,u){let D=[],i="",n=!1,o=0,e=!1,f="",$=!1;for(let l of r){if($)$=!1;else if(l==="\\")$=!0;else if(e){if(l===f)e=!1}else if(l==='"'||l==="'")e=!0,f=l;else if(l==="(")o+=1;else if(l===")"){if(o>0)o-=1}else if(o===0){if(t.includes(l))n=!0}if(n){if(i!=="")D.push(i.trim());i="",n=!1}else i+=l}if(u||i!=="")D.push(i.trim());return D}};ib.exports=pD;pD.default=pD});var cf=s((dZ,Db)=>{var ub=Di(),tq=Y2();class aD extends ub{get selectors(){return tq.comma(this.selector)}set selectors(r){let t=this.selector?this.selector.match(/,\s*/):null,u=t?t[0]:","+this.raw("between","beforeOpen");this.selector=r.join(u)}constructor(r){super(r);if(this.type="rule",!this.nodes)this.nodes=[]}}Db.exports=aD;aD.default=aD;ub.registerRule(aD)});var ob=s((xZ,nb)=>{var iq=Df(),uq=HD(),Dq=MD(),nq=xD(),oq=A2(),eq=Au(),fq=cf();function sD(r,t){if(Array.isArray(r))return r.map((i)=>sD(i));let{inputs:u,...D}=r;if(u){t=[];for(let i of u){let n={...i,__proto__:nq.prototype};if(n.map)n.map={...n.map,__proto__:oq.prototype};t.push(n)}}if(D.nodes)D.nodes=r.nodes.map((i)=>sD(i,t));if(D.source){let{inputId:i,...n}=D.source;if(D.source=n,i!=null)D.source.input=t[i]}if(D.type==="root")return new eq(D);else if(D.type==="decl")return new Dq(D);else if(D.type==="rule")return new fq(D);else if(D.type==="comment")return new uq(D);else if(D.type==="atrule")return new iq(D);else throw new Error("Unknown node type: "+r.type)}nb.exports=sD;sD.default=sD});var T2=s((pZ,vb)=>{var{dirname:vf,relative:fb,resolve:$b,sep:lb}=it("path"),{SourceMapConsumer:mb,SourceMapGenerator:Ef}=$f(),{pathToFileURL:eb}=it("url"),$q=xD(),lq=Boolean(mb&&Ef),mq=Boolean(vf&&$b&&fb&&lb);class cb{constructor(r,t,u,D){this.stringify=r,this.mapOpts=u.map||{},this.root=t,this.opts=u,this.css=D,this.originalCSS=D,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let r;if(this.isInline())r="data:application/json;base64,"+this.toBase64(this.map.toString());else if(typeof this.mapOpts.annotation==="string")r=this.mapOpts.annotation;else if(typeof this.mapOpts.annotation==="function")r=this.mapOpts.annotation(this.opts.to,this.root);else r=this.outputFile()+".map";let t=`
|
|
169
|
+
`;if(this.css.includes(`\r
|
|
170
|
+
`))t=`\r
|
|
171
|
+
`;this.css+=t+"/*# sourceMappingURL="+r+" */"}applyPrevMaps(){for(let r of this.previous()){let t=this.toUrl(this.path(r.file)),u=r.root||vf(r.file),D;if(this.mapOpts.sourcesContent===!1){if(D=new mb(r.text),D.sourcesContent)D.sourcesContent=null}else D=r.consumer();this.map.applySourceMap(D,t,this.toUrl(this.path(u)))}}clearAnnotation(){if(this.mapOpts.annotation===!1)return;if(this.root){let r;for(let t=this.root.nodes.length-1;t>=0;t--){if(r=this.root.nodes[t],r.type!=="comment")continue;if(r.text.startsWith("# sourceMappingURL="))this.root.removeChild(t)}}else if(this.css)this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,"")}generate(){if(this.clearAnnotation(),mq&&lq&&this.isMap())return this.generateMap();else{let r="";return this.stringify(this.root,(t)=>{r+=t}),[r]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let r=this.previous()[0].consumer();r.file=this.outputFile(),this.map=Ef.fromSourceMap(r,{ignoreInvalidMapping:!0})}else this.map=new Ef({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});if(this.isSourcesContent())this.setSourcesContent();if(this.root&&this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline())return[this.css];else return[this.css,this.map]}generateString(){this.css="",this.map=new Ef({file:this.outputFile(),ignoreInvalidMapping:!0});let r=1,t=1,u="<no source>",D={generated:{column:0,line:0},original:{column:0,line:0},source:""},i,n;this.stringify(this.root,(o,e,f)=>{if(this.css+=o,e&&f!=="end")if(D.generated.line=r,D.generated.column=t-1,e.source&&e.source.start)D.source=this.sourcePath(e),D.original.line=e.source.start.line,D.original.column=e.source.start.column-1,this.map.addMapping(D);else D.source=u,D.original.line=1,D.original.column=0,this.map.addMapping(D);if(n=o.match(/\n/g),n)r+=n.length,i=o.lastIndexOf(`
|
|
172
|
+
`),t=o.length-i;else t+=o.length;if(e&&f!=="start"){let $=e.parent||{raws:{}};if(!(e.type==="decl"||e.type==="atrule"&&!e.nodes)||e!==$.last||$.raws.semicolon)if(e.source&&e.source.end)D.source=this.sourcePath(e),D.original.line=e.source.end.line,D.original.column=e.source.end.column-1,D.generated.line=r,D.generated.column=t-2,this.map.addMapping(D);else D.source=u,D.original.line=1,D.original.column=0,D.generated.line=r,D.generated.column=t-1,this.map.addMapping(D)}})}isAnnotation(){if(this.isInline())return!0;if(typeof this.mapOpts.annotation!=="undefined")return this.mapOpts.annotation;if(this.previous().length)return this.previous().some((r)=>r.annotation);return!0}isInline(){if(typeof this.mapOpts.inline!=="undefined")return this.mapOpts.inline;let r=this.mapOpts.annotation;if(typeof r!=="undefined"&&r!==!0)return!1;if(this.previous().length)return this.previous().some((t)=>t.inline);return!0}isMap(){if(typeof this.opts.map!=="undefined")return!!this.opts.map;return this.previous().length>0}isSourcesContent(){if(typeof this.mapOpts.sourcesContent!=="undefined")return this.mapOpts.sourcesContent;if(this.previous().length)return this.previous().some((r)=>r.withContent());return!0}outputFile(){if(this.opts.to)return this.path(this.opts.to);else if(this.opts.from)return this.path(this.opts.from);else return"to.css"}path(r){if(this.mapOpts.absolute)return r;if(r.charCodeAt(0)===60)return r;if(/^\w+:\/\//.test(r))return r;let t=this.memoizedPaths.get(r);if(t)return t;let u=this.opts.to?vf(this.opts.to):".";if(typeof this.mapOpts.annotation==="string")u=vf($b(u,this.mapOpts.annotation));let D=fb(u,r);return this.memoizedPaths.set(r,D),D}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((r)=>{if(r.source&&r.source.input.map){let t=r.source.input.map;if(!this.previousMaps.includes(t))this.previousMaps.push(t)}});else{let r=new $q(this.originalCSS,this.opts);if(r.map)this.previousMaps.push(r.map)}return this.previousMaps}setSourcesContent(){let r={};if(this.root)this.root.walk((t)=>{if(t.source){let u=t.source.input.from;if(u&&!r[u]){r[u]=!0;let D=this.usesFileUrls?this.toFileUrl(u):this.toUrl(this.path(u));this.map.setSourceContent(D,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(r){if(this.mapOpts.from)return this.toUrl(this.mapOpts.from);else if(this.usesFileUrls)return this.toFileUrl(r.source.input.from);else return this.toUrl(this.path(r.source.input.from))}toBase64(r){if(Buffer)return Buffer.from(r).toString("base64");else return window.btoa(unescape(encodeURIComponent(r)))}toFileUrl(r){let t=this.memoizedFileURLs.get(r);if(t)return t;if(eb){let u=eb(r).toString();return this.memoizedFileURLs.set(r,u),u}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(r){let t=this.memoizedURLs.get(r);if(t)return t;if(lb==="\\")r=r.replace(/\\/g,"/");let u=encodeURI(r).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(r,u),u}}vb.exports=cb});var bb=s((aZ,wb)=>{var cq=Df(),vq=HD(),Eq=MD(),Fq=Au(),Eb=cf(),gq=m2(),Fb={empty:!0,space:!0};function wq(r){for(let t=r.length-1;t>=0;t--){let u=r[t],D=u[3]||u[2];if(D)return D}}class gb{constructor(r){this.input=r,this.root=new Fq,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:r,start:{column:1,line:1,offset:0}}}atrule(r){let t=new cq;if(t.name=r[1].slice(1),t.name==="")this.unnamedAtrule(t,r);this.init(t,r[2]);let u,D,i,n=!1,o=!1,e=[],f=[];while(!this.tokenizer.endOfFile()){if(r=this.tokenizer.nextToken(),u=r[0],u==="("||u==="[")f.push(u==="("?")":"]");else if(u==="{"&&f.length>0)f.push("}");else if(u===f[f.length-1])f.pop();if(f.length===0)if(u===";"){t.source.end=this.getPosition(r[2]),t.source.end.offset++,this.semicolon=!0;break}else if(u==="{"){o=!0;break}else if(u==="}"){if(e.length>0){i=e.length-1,D=e[i];while(D&&D[0]==="space")D=e[--i];if(D)t.source.end=this.getPosition(D[3]||D[2]),t.source.end.offset++}this.end(r);break}else e.push(r);else e.push(r);if(this.tokenizer.endOfFile()){n=!0;break}}if(t.raws.between=this.spacesAndCommentsFromEnd(e),e.length){if(t.raws.afterName=this.spacesAndCommentsFromStart(e),this.raw(t,"params",e),n)r=e[e.length-1],t.source.end=this.getPosition(r[3]||r[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=""}else t.raws.afterName="",t.params="";if(o)t.nodes=[],this.current=t}checkMissedSemicolon(r){let t=this.colon(r);if(t===!1)return;let u=0,D;for(let i=t-1;i>=0;i--)if(D=r[i],D[0]!=="space"){if(u+=1,u===2)break}throw this.input.error("Missed semicolon",D[0]==="word"?D[3]+1:D[2])}colon(r){let t=0,u,D,i;for(let[n,o]of r.entries()){if(D=o,i=D[0],i==="(")t+=1;if(i===")")t-=1;if(t===0&&i===":")if(!u)this.doubleColon(D);else if(u[0]==="word"&&u[1]==="progid")continue;else return n;u=D}return!1}comment(r){let t=new vq;this.init(t,r[2]),t.source.end=this.getPosition(r[3]||r[2]),t.source.end.offset++;let u=r[1].slice(2,-2);if(/^\s*$/.test(u))t.text="",t.raws.left=u,t.raws.right="";else{let D=u.match(/^(\s*)([^]*\S)(\s*)$/);t.text=D[2],t.raws.left=D[1],t.raws.right=D[3]}}createTokenizer(){this.tokenizer=gq(this.input)}decl(r,t){let u=new Eq;this.init(u,r[0][2]);let D=r[r.length-1];if(D[0]===";")this.semicolon=!0,r.pop();u.source.end=this.getPosition(D[3]||D[2]||wq(r)),u.source.end.offset++;while(r[0][0]!=="word"){if(r.length===1)this.unknownWord(r);u.raws.before+=r.shift()[1]}u.source.start=this.getPosition(r[0][2]),u.prop="";while(r.length){let f=r[0][0];if(f===":"||f==="space"||f==="comment")break;u.prop+=r.shift()[1]}u.raws.between="";let i;while(r.length)if(i=r.shift(),i[0]===":"){u.raws.between+=i[1];break}else{if(i[0]==="word"&&/\w/.test(i[1]))this.unknownWord([i]);u.raws.between+=i[1]}if(u.prop[0]==="_"||u.prop[0]==="*")u.raws.before+=u.prop[0],u.prop=u.prop.slice(1);let n=[],o;while(r.length){if(o=r[0][0],o!=="space"&&o!=="comment")break;n.push(r.shift())}this.precheckMissedSemicolon(r);for(let f=r.length-1;f>=0;f--){if(i=r[f],i[1].toLowerCase()==="!important"){u.important=!0;let $=this.stringFrom(r,f);if($=this.spacesFromEnd(r)+$,$!==" !important")u.raws.important=$;break}else if(i[1].toLowerCase()==="important"){let $=r.slice(0),l="";for(let m=f;m>0;m--){let c=$[m][0];if(l.trim().startsWith("!")&&c!=="space")break;l=$.pop()[1]+l}if(l.trim().startsWith("!"))u.important=!0,u.raws.important=l,r=$}if(i[0]!=="space"&&i[0]!=="comment")break}if(r.some((f)=>f[0]!=="space"&&f[0]!=="comment"))u.raws.between+=n.map((f)=>f[1]).join(""),n=[];if(this.raw(u,"value",n.concat(r),t),u.value.includes(":")&&!t)this.checkMissedSemicolon(r)}doubleColon(r){throw this.input.error("Double colon",{offset:r[2]},{offset:r[2]+r[1].length})}emptyRule(r){let t=new Eb;this.init(t,r[2]),t.selector="",t.raws.between="",this.current=t}end(r){if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;if(this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent)this.current.source.end=this.getPosition(r[2]),this.current.source.end.offset++,this.current=this.current.parent;else this.unexpectedClose(r)}endFile(){if(this.current.parent)this.unclosedBlock();if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(r){if(this.spaces+=r[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];if(t&&t.type==="rule"&&!t.raws.ownSemicolon)t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(r[2]),t.source.end.offset+=t.raws.ownSemicolon.length}}getPosition(r){let t=this.input.fromOffset(r);return{column:t.col,line:t.line,offset:r}}init(r,t){if(this.current.push(r),r.source={input:this.input,start:this.getPosition(t)},r.raws.before=this.spaces,this.spaces="",r.type!=="comment")this.semicolon=!1}other(r){let t=!1,u=null,D=!1,i=null,n=[],o=r[1].startsWith("--"),e=[],f=r;while(f){if(u=f[0],e.push(f),u==="("||u==="["){if(!i)i=f;n.push(u==="("?")":"]")}else if(o&&D&&u==="{"){if(!i)i=f;n.push("}")}else if(n.length===0){if(u===";")if(D){this.decl(e,o);return}else break;else if(u==="{"){this.rule(e);return}else if(u==="}"){this.tokenizer.back(e.pop()),t=!0;break}else if(u===":")D=!0}else if(u===n[n.length-1]){if(n.pop(),n.length===0)i=null}f=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())t=!0;if(n.length>0)this.unclosedBracket(i);if(t&&D){if(!o)while(e.length){if(f=e[e.length-1][0],f!=="space"&&f!=="comment")break;this.tokenizer.back(e.pop())}this.decl(e,o)}else this.unknownWord(e)}parse(){let r;while(!this.tokenizer.endOfFile())switch(r=this.tokenizer.nextToken(),r[0]){case"space":this.spaces+=r[1];break;case";":this.freeSemicolon(r);break;case"}":this.end(r);break;case"comment":this.comment(r);break;case"at-word":this.atrule(r);break;case"{":this.emptyRule(r);break;default:this.other(r);break}this.endFile()}precheckMissedSemicolon(){}raw(r,t,u,D){let i,n,o=u.length,e="",f=!0,$,l;for(let m=0;m<o;m+=1)if(i=u[m],n=i[0],n==="space"&&m===o-1&&!D)f=!1;else if(n==="comment")if(l=u[m-1]?u[m-1][0]:"empty",$=u[m+1]?u[m+1][0]:"empty",!Fb[l]&&!Fb[$])if(e.slice(-1)===",")f=!1;else e+=i[1];else f=!1;else e+=i[1];if(!f){let m=u.reduce((c,g)=>c+g[1],"");r.raws[t]={raw:m,value:e}}r[t]=e}rule(r){r.pop();let t=new Eb;this.init(t,r[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(r),this.raw(t,"selector",r),this.current=t}spacesAndCommentsFromEnd(r){let t,u="";while(r.length){if(t=r[r.length-1][0],t!=="space"&&t!=="comment")break;u=r.pop()[1]+u}return u}spacesAndCommentsFromStart(r){let t,u="";while(r.length){if(t=r[0][0],t!=="space"&&t!=="comment")break;u+=r.shift()[1]}return u}spacesFromEnd(r){let t,u="";while(r.length){if(t=r[r.length-1][0],t!=="space")break;u=r.pop()[1]+u}return u}stringFrom(r,t){let u="";for(let D=t;D<r.length;D++)u+=r[D][1];return r.splice(t,r.length-t),u}unclosedBlock(){let r=this.current.source.start;throw this.input.error("Unclosed block",r.line,r.column)}unclosedBracket(r){throw this.input.error("Unclosed bracket",{offset:r[2]},{offset:r[2]+1})}unexpectedClose(r){throw this.input.error("Unexpected }",{offset:r[2]},{offset:r[2]+1})}unknownWord(r){throw this.input.error("Unknown word "+r[0][1],{offset:r[0][2]},{offset:r[0][2]+r[0][1].length})}unnamedAtrule(r,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}wb.exports=gb});var gf=s((sZ,Cb)=>{var bq=Di(),Cq=xD(),_q=bb();function Ff(r,t){let u=new Cq(r,t),D=new _q(u);try{D.parse()}catch(i){if(i.name==="CssSyntaxError"&&t&&t.from){if(/\.scss$/i.test(t.from))i.message+=`
|
|
173
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`;else if(/\.sass/i.test(t.from))i.message+=`
|
|
174
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`;else if(/\.less$/i.test(t.from))i.message+=`
|
|
175
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`}throw i}return D.root}Cb.exports=Ff;Ff.default=Ff;bq.registerParse(Ff)});var R2=s((rL,_b)=>{class wf{constructor(r,t={}){if(this.type="warning",this.text=r,t.node&&t.node.source){let u=t.node.rangeBy(t);this.line=u.start.line,this.column=u.start.column,this.endLine=u.end.line,this.endColumn=u.end.column}for(let u in t)this[u]=t[u]}toString(){if(this.node)return this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message;if(this.plugin)return this.plugin+": "+this.text;return this.text}}_b.exports=wf;wf.default=wf});var Cf=s((tL,Ib)=>{var Iq=R2();class bf{get content(){return this.css}constructor(r,t,u){this.processor=r,this.messages=[],this.root=t,this.opts=u,this.css="",this.map=void 0}toString(){return this.css}warn(r,t={}){if(!t.plugin){if(this.lastPlugin&&this.lastPlugin.postcssPlugin)t.plugin=this.lastPlugin.postcssPlugin}let u=new Iq(r,t);return this.messages.push(u),u}warnings(){return this.messages.filter((r)=>r.type==="warning")}}Ib.exports=bf;bf.default=bf});var V2=s((iL,Ob)=>{var Ub={};Ob.exports=function r(t){if(Ub[t])return;if(Ub[t]=!0,typeof console!=="undefined"&&console.warn)console.warn(t)}});var K2=s((uL,qb)=>{var Uq=Di(),Oq=nf(),yq=T2(),Nq=gf(),yb=Cf(),Bq=Au(),qq=SD(),{isClean:Nt,my:hq}=se(),zq=V2(),Jq={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Aq={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Xq={Once:!0,postcssPlugin:!0,prepare:!0},Xu=0;function rn(r){return typeof r==="object"&&typeof r.then==="function"}function Bb(r){let t=!1,u=Jq[r.type];if(r.type==="decl")t=r.prop.toLowerCase();else if(r.type==="atrule")t=r.name.toLowerCase();if(t&&r.append)return[u,u+"-"+t,Xu,u+"Exit",u+"Exit-"+t];else if(t)return[u,u+"-"+t,u+"Exit",u+"Exit-"+t];else if(r.append)return[u,Xu,u+"Exit"];else return[u,u+"Exit"]}function Nb(r){let t;if(r.type==="document")t=["Document",Xu,"DocumentExit"];else if(r.type==="root")t=["Root",Xu,"RootExit"];else t=Bb(r);return{eventIndex:0,events:t,iterator:0,node:r,visitorIndex:0,visitors:[]}}function S2(r){if(r[Nt]=!1,r.nodes)r.nodes.forEach((t)=>S2(t));return r}var Q2={};class ni{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(r,t,u){this.stringified=!1,this.processed=!1;let D;if(typeof t==="object"&&t!==null&&(t.type==="root"||t.type==="document"))D=S2(t);else if(t instanceof ni||t instanceof yb){if(D=S2(t.root),t.map){if(typeof u.map==="undefined")u.map={};if(!u.map.inline)u.map.inline=!1;u.map.prev=t.map}}else{let i=Nq;if(u.syntax)i=u.syntax.parse;if(u.parser)i=u.parser;if(i.parse)i=i.parse;try{D=i(t,u)}catch(n){this.processed=!0,this.error=n}if(D&&!D[hq])Uq.rebuild(D)}this.result=new yb(r,D,u),this.helpers={...Q2,postcss:Q2,result:this.result},this.plugins=this.processor.plugins.map((i)=>{if(typeof i==="object"&&i.prepare)return{...i,...i.prepare(this.result)};else return i})}async(){if(this.error)return Promise.reject(this.error);if(this.processed)return Promise.resolve(this.result);if(!this.processing)this.processing=this.runAsync();return this.processing}catch(r){return this.async().catch(r)}finally(r){return this.async().then(r,r)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(r,t){let u=this.result.lastPlugin;try{if(t)t.addToError(r);if(this.error=r,r.name==="CssSyntaxError"&&!r.plugin)r.plugin=u.postcssPlugin,r.setMessage();else if(u.postcssVersion){let{postcssPlugin:D,postcssVersion:i}=u,n=this.result.processor.version,o=i.split("."),e=n.split(".");if(o[0]!==e[0]||parseInt(o[1])>parseInt(e[1]))console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+D+" uses "+i+". Perhaps this is the source of the error below.")}}catch(D){if(console&&console.error)console.error(D)}return r}prepareVisitors(){this.listeners={};let r=(t,u,D)=>{if(!this.listeners[u])this.listeners[u]=[];this.listeners[u].push([t,D])};for(let t of this.plugins)if(typeof t==="object")for(let u in t){if(!Aq[u]&&/^[A-Z]/.test(u))throw new Error(`Unknown event ${u} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Xq[u]){if(typeof t[u]==="object")for(let D in t[u])if(D==="*")r(t,u,t[u][D]);else r(t,u+"-"+D.toLowerCase(),t[u][D]);else if(typeof t[u]==="function")r(t,u,t[u])}}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let r=0;r<this.plugins.length;r++){let t=this.plugins[r],u=this.runOnRoot(t);if(rn(u))try{await u}catch(D){throw this.handleError(D)}}if(this.prepareVisitors(),this.hasListener){let r=this.result.root;while(!r[Nt]){r[Nt]=!0;let t=[Nb(r)];while(t.length>0){let u=this.visitTick(t);if(rn(u))try{await u}catch(D){let i=t[t.length-1].node;throw this.handleError(D,i)}}}if(this.listeners.OnceExit)for(let[t,u]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(r.type==="document"){let D=r.nodes.map((i)=>u(i,this.helpers));await Promise.all(D)}else await u(r,this.helpers)}catch(D){throw this.handleError(D)}}}return this.processed=!0,this.stringify()}runOnRoot(r){this.result.lastPlugin=r;try{if(typeof r==="object"&&r.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map((u)=>r.Once(u,this.helpers));if(rn(t[0]))return Promise.all(t);return t}return r.Once(this.result.root,this.helpers)}else if(typeof r==="function")return r(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let r=this.result.opts,t=qq;if(r.syntax)t=r.syntax.stringify;if(r.stringifier)t=r.stringifier;if(t.stringify)t=t.stringify;let D=new yq(t,this.result.root,this.result.opts).generate();return this.result.css=D[0],this.result.map=D[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let r of this.plugins){let t=this.runOnRoot(r);if(rn(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let r=this.result.root;while(!r[Nt])r[Nt]=!0,this.walkSync(r);if(this.listeners.OnceExit)if(r.type==="document")for(let t of r.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,r)}return this.result}then(r,t){if(!("from"in this.opts))zq("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");return this.async().then(r,t)}toString(){return this.css}visitSync(r,t){for(let[u,D]of r){this.result.lastPlugin=u;let i;try{i=D(t,this.helpers)}catch(n){throw this.handleError(n,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(rn(i))throw this.getAsyncError()}}visitTick(r){let t=r[r.length-1],{node:u,visitors:D}=t;if(u.type!=="root"&&u.type!=="document"&&!u.parent){r.pop();return}if(D.length>0&&t.visitorIndex<D.length){let[n,o]=D[t.visitorIndex];if(t.visitorIndex+=1,t.visitorIndex===D.length)t.visitors=[],t.visitorIndex=0;this.result.lastPlugin=n;try{return o(u.toProxy(),this.helpers)}catch(e){throw this.handleError(e,u)}}if(t.iterator!==0){let n=t.iterator,o;while(o=u.nodes[u.indexes[n]])if(u.indexes[n]+=1,!o[Nt]){o[Nt]=!0,r.push(Nb(o));return}t.iterator=0,delete u.indexes[n]}let i=t.events;while(t.eventIndex<i.length){let n=i[t.eventIndex];if(t.eventIndex+=1,n===Xu){if(u.nodes&&u.nodes.length)u[Nt]=!0,t.iterator=u.getIterator();return}else if(this.listeners[n]){t.visitors=this.listeners[n];return}}r.pop()}walkSync(r){r[Nt]=!0;let t=Bb(r);for(let u of t)if(u===Xu){if(r.nodes)r.each((D)=>{if(!D[Nt])this.walkSync(D)})}else{let D=this.listeners[u];if(D){if(this.visitSync(D,r.toProxy()))return}}}warnings(){return this.sync().warnings()}}ni.registerPostcss=(r)=>{Q2=r};qb.exports=ni;ni.default=ni;Bq.registerLazyResult(ni);Oq.registerLazyResult(ni)});var zb=s((DL,hb)=>{var jq=T2(),Gq=gf(),Wq=Cf(),Yq=SD(),Tq=V2();class _f{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let r,t=Gq;try{r=t(this._css,this._opts)}catch(u){this.error=u}if(this.error)throw this.error;else return this._root=r,r}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(r,t,u){t=t.toString(),this.stringified=!1,this._processor=r,this._css=t,this._opts=u,this._map=void 0;let D,i=Yq;this.result=new Wq(this._processor,D,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get(){return n.root}});let o=new jq(i,D,this._opts,t);if(o.isMap()){let[e,f]=o.generate();if(e)this.result.css=e;if(f)this.result.map=f}else o.clearAnnotation(),this.result.css=o.css}async(){if(this.error)return Promise.reject(this.error);return Promise.resolve(this.result)}catch(r){return this.async().catch(r)}finally(r){return this.async().then(r,r)}sync(){if(this.error)throw this.error;return this.result}then(r,t){if(!("from"in this._opts))Tq("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.");return this.async().then(r,t)}toString(){return this._css}warnings(){return[]}}hb.exports=_f;_f.default=_f});var Ab=s((nL,Jb)=>{var Rq=nf(),Vq=K2(),Sq=zb(),Qq=Au();class ju{constructor(r=[]){this.version="8.5.6",this.plugins=this.normalize(r)}normalize(r){let t=[];for(let u of r){if(u.postcss===!0)u=u();else if(u.postcss)u=u.postcss;if(typeof u==="object"&&Array.isArray(u.plugins))t=t.concat(u.plugins);else if(typeof u==="object"&&u.postcssPlugin)t.push(u);else if(typeof u==="function")t.push(u);else if(typeof u==="object"&&(u.parse||u.stringify))throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.");else throw new Error(u+" is not a PostCSS plugin")}return t}process(r,t={}){if(!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax)return new Sq(this,r,t);else return new Vq(this,r,t)}use(r){return this.plugins=this.plugins.concat(this.normalize([r])),this}}Jb.exports=ju;ju.default=ju;Qq.registerProcessor(ju);Rq.registerProcessor(ju)});var Vb=s((oL,Rb)=>{var Xb=Df(),jb=HD(),Kq=Di(),Hq=pe(),Gb=MD(),Wb=nf(),Mq=ob(),Zq=xD(),Lq=K2(),Pq=Y2(),kq=KD(),dq=gf(),H2=Ab(),xq=Cf(),Yb=Au(),Tb=cf(),pq=SD(),aq=R2();function Er(...r){if(r.length===1&&Array.isArray(r[0]))r=r[0];return new H2(r)}Er.plugin=function r(t,u){let D=!1;function i(...o){if(console&&console.warn&&!D){if(D=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
176
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn"))console.warn(t+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
177
|
+
`+"https://www.w3ctech.com/topic/2226")}let e=u(...o);return e.postcssPlugin=t,e.postcssVersion=new H2().version,e}let n;return Object.defineProperty(i,"postcss",{get(){if(!n)n=i();return n}}),i.process=function(o,e,f){return Er([i(f)]).process(o,e)},i};Er.stringify=pq;Er.parse=dq;Er.fromJSON=Mq;Er.list=Pq;Er.comment=(r)=>new jb(r);Er.atRule=(r)=>new Xb(r);Er.decl=(r)=>new Gb(r);Er.rule=(r)=>new Tb(r);Er.root=(r)=>new Yb(r);Er.document=(r)=>new Wb(r);Er.CssSyntaxError=Hq;Er.Declaration=Gb;Er.Container=Kq;Er.Processor=H2;Er.Document=Wb;Er.Comment=jb;Er.Warning=aq;Er.AtRule=Xb;Er.Result=xq;Er.Input=Zq;Er.Rule=Tb;Er.Root=Yb;Er.Node=kq;Lq.registerPostcss(Er);Rb.exports=Er;Er.default=Er});var jC={};Or(jC,{default:()=>Gh});function Xh(r){if(r.length<2)return 100;let t=r[0],u=0;for(let D of r.slice(1)){let i=Math.abs(D.width-t.width)+Math.abs(D.height-t.height),n=Math.abs(D.childCount-t.childCount);if(i<=4&&n===0)u++;else if(i<=10&&n<=1)u+=0.8;else if(i<=20&&n<=2)u+=0.6;else u+=0.4}return Math.round(u/(r.length-1)*100)}function jh(r){let[t,u]=r.split("|"),D=t?.split(":")[0];if(!D)return r;if(!u)return D.charAt(0)+D.slice(1).toLowerCase();let i=u.split(",").map((n)=>{let[o,e]=n.split(":");if(!o)return"";let f=o.charAt(0)+o.slice(1).toLowerCase();return Number(e)>1?`${f}×${e}`:f});return`${D.charAt(0)+D.slice(1).toLowerCase()} > [${i.join(", ")}]`}var Gh;var GC=k(()=>{O();B();Gh=E({meta:{description:"Find repeated design patterns (potential components)"},args:{limit:{type:"string",description:"Max clusters to show",default:"20"},"min-size":{type:"string",description:"Min node size in px",default:"30"},"min-count":{type:"string",description:"Min instances to form cluster",default:"2"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){let t=Number(r["min-size"]),u=Number(r["min-count"]),D=Number(r.limit),i=await F("analyze-clusters",{minSize:t,minCount:u,limit:D});if(r.json){console.log(JSON.stringify(i,null,2));return}if(i.clusters.length===0){console.log("No repeated patterns found");return}for(let o=0;o<i.clusters.length;o++){let e=i.clusters[o],f=Xh(e.nodes),$=e.nodes[0],l=$.type.toLowerCase(),m=e.widthRange<=4&&e.heightRange<=4?`${Math.round(e.avgWidth)}×${Math.round(e.avgHeight)}`:`${Math.round(e.avgWidth)}×${Math.round(e.avgHeight)} (±${Math.max(e.widthRange,e.heightRange)}px)`;console.log(`[${o}] ${e.nodes.length}× ${l} "${$.name}" pattern (${f}% match)`),console.log(` ${m} | ${jh(e.signature)}`),console.log(` examples: ${e.nodes.slice(0,3).map((c)=>c.id).join(", ")}`),console.log()}let n=i.clusters.reduce((o,e)=>o+e.nodes.length,0);console.log(`${i.clusters.length} clusters from ${i.totalNodes} nodes (${n} clustered)`)}})});var TC={};Or(TC,{default:()=>Yh});function WC(r){let t=r.replace("#","");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function Wh(r,t){let[u,D,i]=WC(r),[n,o,e]=WC(t);return Math.sqrt((u-n)**2+(D-o)**2+(i-e)**2)}function YC(r,t){let u=[],D=new Set,i=[...r].sort((n,o)=>o.count-n.count);for(let n of i){if(D.has(n.hex))continue;let o={colors:[n],suggestedHex:n.hex,totalCount:n.count};D.add(n.hex);for(let e of i){if(D.has(e.hex))continue;if(Wh(n.hex,e.hex)<=t)o.colors.push(e),o.totalCount+=e.count,D.add(e.hex)}if(o.colors.length>1)u.push(o)}return u.sort((n,o)=>o.colors.length-n.colors.length)}var Yh;var RC=k(()=>{At();O();B();Yh=E({meta:{description:"Analyze color palette usage"},args:{limit:{type:"string",description:"Max colors to show",default:"30"},threshold:{type:"string",description:"Distance threshold for clustering (0-50)",default:"15"},"show-similar":{type:"boolean",description:"Show similar color clusters"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){let t=Number(r.limit),u=Number(r.threshold),D=await F("analyze-colors",{});if(r.json){let $=r["show-similar"]?YC(D.colors,u):[];console.log(JSON.stringify({...D,clusters:$},null,2));return}if(D.colors.length===0){console.log("No colors found");return}let i=D.colors.sort(($,l)=>l.count-$.count).slice(0,t);console.log(`Colors by usage:
|
|
178
|
+
`);let n=i.map(($)=>{let l;if($.variableName)l=`$${$.variableName}`;else if($.isStyle)l="style";return{label:$.hex,value:$.count,tag:l}});console.log(bt(n));let o=D.colors.filter(($)=>!$.variableName&&!$.isStyle),e=D.colors.filter(($)=>$.variableName),f=D.colors.filter(($)=>$.isStyle);if(console.log(),console.log(Yi({"unique colors":D.colors.length})+` from ${D.totalNodes} nodes`),console.log(` ${e.length} from variables, ${f.length} from styles, ${o.length} hardcoded`),r["show-similar"]){let $=YC(o,u);if($.length>0){console.log(`
|
|
179
|
+
Similar colors (consider merging):
|
|
180
|
+
`);for(let l of $.slice(0,10)){let m=l.colors.map((c)=>c.hex).join(", ");console.log(` ${m}`),console.log(` → suggest: ${l.suggestedHex} (${l.totalCount}× total)`),console.log()}}}}})});var VC={};Or(VC,{default:()=>Th});var Th;var SC=k(()=>{At();O();B();Th=E({meta:{description:"Analyze typography usage"},args:{limit:{type:"string",description:"Max styles to show",default:"30"},"group-by":{type:"string",description:"Group by: family, size, weight",default:""},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){let t=Number(r.limit),u=r["group-by"],D=await F("analyze-typography",{});if(r.json){console.log(JSON.stringify(D,null,2));return}if(D.styles.length===0){console.log("No text nodes found");return}let i=D.styles.sort((e,f)=>f.count-e.count);if(u==="family"){let e=new Map;for(let $ of i)e.set($.family,(e.get($.family)||0)+$.count);console.log(`Font families:
|
|
181
|
+
`);let f=[...e.entries()].sort(($,l)=>l[1]-$[1]);console.log(bt(f.map(([$,l])=>({label:$.padEnd(20),value:l})),{scale:20}))}else if(u==="size"){let e=new Map;for(let $ of i)e.set($.size,(e.get($.size)||0)+$.count);console.log(`Font sizes:
|
|
182
|
+
`);let f=[...e.entries()].sort(($,l)=>$[0]-l[0]);console.log(bt(f.map(([$,l])=>({label:`${String($).padStart(3)}px`,value:l})),{scale:20}))}else if(u==="weight"){let e=new Map;for(let $ of i)e.set($.weight,(e.get($.weight)||0)+$.count);console.log(`Font weights:
|
|
183
|
+
`);let f=[...e.entries()].sort(($,l)=>l[1]-$[1]);console.log(bt(f.map(([$,l])=>({label:$.padEnd(12),value:l})),{scale:20}))}else{console.log(`Typography styles:
|
|
184
|
+
`);let e=i.slice(0,t).map((f)=>{let $=f.lineHeight!=="auto"?` / ${f.lineHeight}`:"";return{label:`${f.family} ${f.size}px ${f.weight}${$}`,value:f.count,tag:f.styleName||void 0}});console.log(bt(e))}let n=D.styles.filter((e)=>e.styleName),o=D.styles.filter((e)=>!e.styleName);console.log(),console.log(Yi({"unique styles":D.styles.length})+` from ${D.totalTextNodes} text nodes`),console.log(` ${n.length} use text styles, ${o.length} hardcoded`)}})});var QC={};Or(QC,{default:()=>Rh});var Rh;var KC=k(()=>{At();O();B();Rh=E({meta:{description:"Analyze spacing values (gap, padding)"},args:{grid:{type:"string",description:"Base grid size to check against",default:"8"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){let t=Number(r.grid),u=await F("analyze-spacing",{});if(r.json){console.log(JSON.stringify(u,null,2));return}let D=u.gaps.sort((e,f)=>f.count-e.count),i=u.paddings.sort((e,f)=>f.count-e.count);if(D.length>0)console.log(`Gap values:
|
|
185
|
+
`),console.log(bt(D.slice(0,15).map((e)=>({label:`${String(e.value).padStart(4)}px`,value:e.count,suffix:e.value%t!==0?"⚠":void 0})),{scale:5}));if(i.length>0)console.log(`
|
|
186
|
+
Padding values:
|
|
187
|
+
`),console.log(bt(i.slice(0,15).map((e)=>({label:`${String(e.value).padStart(4)}px`,value:e.count,suffix:e.value%t!==0?"⚠":void 0})),{scale:5}));let n=D.filter((e)=>e.value%t!==0&&e.value>0),o=i.filter((e)=>e.value%t!==0&&e.value>0);if(console.log(),console.log(Yi({"gap values":D.length,"padding values":i.length})),n.length>0||o.length>0){if(console.log(`
|
|
188
|
+
⚠ Off-grid values (not divisible by ${t}px):`),n.length>0){let e=n.map((f)=>`${f.value}px`).join(", ");console.log(` gaps: ${e}`)}if(o.length>0){let e=o.map((f)=>`${f.value}px`).join(", ");console.log(` paddings: ${e}`)}}}})});var HC={};Or(HC,{default:()=>Vh});var Vh;var MC=k(()=>{O();B();Vh=E({meta:{description:"Generate accessibility tree snapshot of the design"},args:{id:{type:"string",description:"Node ID (default: selection or page)"},interactive:{type:"boolean",alias:"i",description:"Show only interactive elements"},depth:{type:"string",alias:"d",description:"Max depth to traverse"},"no-compact":{type:"boolean",description:"Disable tree simplification (show all wrappers)"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){let t=await F("snapshot",{id:r.id,interactive:r.interactive,maxDepth:r.depth?Number(r.depth):void 0,compact:!r["no-compact"]});if(r.json){console.log(JSON.stringify(t,null,2));return}if(console.log(t.tree),t.refCount>0)console.log(),console.log(`${t.refCount} interactive elements with refs`)}})});O();var y4="0.1.0";ji();var Dv={};Or(Dv,{viewport:()=>O9,version:()=>JC,variable:()=>A9,style:()=>Q9,status:()=>M4,set:()=>Vg,selection:()=>Lg,render:()=>UE,reconstruct:()=>QE,query:()=>VE,profile:()=>Z4,path:()=>ig,page:()=>C9,node:()=>x8,me:()=>sF,mcp:()=>ZF,lint:()=>jE,instance:()=>eC,init:()=>GE,import:()=>SE,icon:()=>UC,group:()=>x9,get:()=>Hg,font:()=>XC,find:()=>yE,export:()=>E9,eval:()=>OE,diff:()=>G8,daemon:()=>RE,create:()=>bg,connector:()=>EC,component:()=>iC,comment:()=>hC,collection:()=>Y9,boolean:()=>L9,analyze:()=>ZC});O();B();var M4=E({meta:{description:"Check connection status"},args:{json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){let t={connected:!1,fileName:null,fileKey:null};try{let u=await H4();t.connected=u.connected,t.fileName=u.fileName||null,t.fileKey=await t$()}catch{}if(r.json){console.log(JSON.stringify(t,null,2));return}if(t.connected){if(console.log("✓ Connected to Figma"),t.fileName)console.log(` File: ${t.fileName}`);if(t.fileKey)console.log(` Key: ${t.fileKey}`)}else console.log("✗ Not connected to Figma"),console.log(" Start Figma with: open -a Figma --args --remote-debugging-port=9222"),process.exit(1)}});O();mr();import{spawn as Q7}from"child_process";var Z4=E({meta:{description:"Profile any figma-use command via Chrome DevTools Protocol"},args:{command:{type:"positional",description:'Command to profile (e.g., "get components --limit 10")',required:!0},port:{type:"string",description:"Chrome DevTools port",default:"9222"},top:{type:"string",description:"Number of top functions to show",default:"20"}},async run({args:r}){let t=Number(r.port),u=Number(r.top),D=await fetch(`http://localhost:${t}/json`).then((Q)=>Q.json()).catch(()=>null);if(!D)console.error(d(`Cannot connect to DevTools on port ${t}`)),console.error(`Start Figma with: /Applications/Figma.app/Contents/MacOS/Figma --remote-debugging-port=${t}`),process.exit(1);let i=D.find((Q)=>Q.title?.includes("Figma")&&Q.type==="page"&&Q.url?.includes("figma.com/design"));if(!i)console.error(d("No Figma design tab found. Open a Figma file first.")),process.exit(1);if(console.log(`Profiling: figma-use ${r.command}`),console.log(`Target: ${i.title}
|
|
189
|
+
`),!i.webSocketDebuggerUrl)console.error(d("No WebSocket debugger URL found")),process.exit(1);let n=new WebSocket(i.webSocketDebuggerUrl),o=1,e=new Map;n.onmessage=(Q)=>{let M=JSON.parse(Q.data),Jr=e.get(M.id);if(Jr)e.delete(M.id),Jr(M)};let f=(Q,M={})=>{let Jr=o++;return new Promise((Nr)=>{e.set(Jr,Nr),n.send(JSON.stringify({id:Jr,method:Q,params:M}))})};await new Promise((Q)=>{n.onopen=()=>Q()}),await f("Profiler.enable"),await f("Profiler.start");let $=Date.now(),l=await new Promise((Q)=>{let M=`${process.argv[0]} ${process.argv[1]} ${r.command} --json`,Jr=Q7("sh",["-c",M],{stdio:["ignore","pipe","pipe"]}),Nr="",Kr="";Jr.stdout.on("data",(Gr)=>Nr+=Gr),Jr.stderr.on("data",(Gr)=>Kr+=Gr),Jr.on("close",(Gr)=>Q({stdout:Nr,stderr:Kr,code:Gr||0}))}),m=Date.now()-$,c=await f("Profiler.stop");n.close();let g="N/A",_="";try{let Q=JSON.parse(l.stdout);if(Array.isArray(Q))g=String(Q.length);else if(Q.error)_=Q.error}catch{if(l.stderr)_=l.stderr.trim()}if(console.log(`Duration: ${m}ms`),console.log(`Result: ${g} items`),_)console.log(`Error: ${_}`);if(l.code!==0)console.log(`Exit code: ${l.code}`);console.log();let q=c.result.profile.nodes,y=c.result.profile.samples||[],N=c.result.profile.timeDeltas||[],R={};y.forEach((Q,M)=>{R[Q]=(R[Q]||0)+(N[M]||1)});let z=0,A=0,K=0,L=0;for(let[Q,M]of Object.entries(R)){let Jr=q.find((Gr)=>Gr.id===parseInt(Q)),Nr=Jr?.callFrame?.functionName||"",Kr=Jr?.callFrame?.url||"";if(Nr==="(garbage collector)")A+=M;else if(Nr==="(idle)")K+=M;else if(Kr.includes(".wasm"))z+=M;else L+=M}let p=z+A+L;if(p>0)console.log("Time breakdown:"),console.log(` Figma WASM: ${(z/1000).toFixed(0).padStart(5)}ms (${(z/p*100).toFixed(0)}%)`),console.log(` GC: ${(A/1000).toFixed(0).padStart(5)}ms (${(A/p*100).toFixed(0)}%)`),console.log(` JS: ${(L/1000).toFixed(0).padStart(5)}ms (${(L/p*100).toFixed(0)}%)`),console.log(` Idle: ${(K/1000).toFixed(0).padStart(5)}ms`),console.log();let a=Object.entries(R).map(([Q,M])=>{let Nr=q.find((Kr)=>Kr.id===parseInt(Q))?.callFrame||{};return{name:Nr.functionName||"(anonymous)",url:Nr.url||"",line:Nr.lineNumber||0,time:M}}).filter((Q)=>Q.time>500&&Q.name!=="(idle)").sort((Q,M)=>M.time-Q.time).slice(0,u);if(a.length>0){console.log(`Top ${Math.min(u,a.length)} functions by CPU time:`),console.log("─".repeat(75));for(let Q of a){let M=Q.url.split("/").pop()?.slice(0,25)||"",Jr=M?`${M}:${Q.line}`:"";console.log(`${(Q.time/1000).toFixed(1).padStart(7)}ms ${Q.name.slice(0,40).padEnd(40)} ${Jr}`)}console.log()}console.log(Dr("Profile complete"))}});O();var IE=ft(E$(),1);B();mr();import{existsSync as OU}from"fs";import{resolve as yU}from"path";B();function L4(r,t){r.forEach((u)=>{let D=u.loaderCallbacks;if(D)u.loaderCallbacks=D.filter((i)=>i.id!==t)})}function P4(r){if(!r.pendingCallbacksFlag)r.pendingCallbacksFlag=!0,setTimeout(()=>{r.pendingCallbacksFlag=!1;let t=r.loaderCallbacks?r.loaderCallbacks.slice(0):[];if(!t.length)return;let u=!1,D=r.provider,i=r.prefix;t.forEach((n)=>{let o=n.icons,e=o.pending.length;if(o.pending=o.pending.filter((f)=>{if(f.prefix!==i)return!0;let $=f.name;if(r.icons[$])o.loaded.push({provider:D,prefix:i,name:$});else if(r.missing.has($))o.missing.push({provider:D,prefix:i,name:$});else return u=!0,!0;return!1}),o.pending.length!==e){if(!u)L4([r],n.id);n.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),n.abort)}})})}var H7=0;function k4(r,t,u){let D=H7++,i=L4.bind(null,u,D);if(!t.pending.length)return i;let n={id:D,icons:t,callback:r,abort:i};return u.forEach((o)=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(n)}),i}function d4(r,t){let u=r.icons,D=r.aliases||Object.create(null),i=Object.create(null);function n(o){if(u[o])return i[o]=[];if(!(o in i)){i[o]=null;let e=D[o]&&D[o].parent,f=e&&n(e);if(f)i[o]=[e].concat(f)}return i[o]}return(t||Object.keys(u).concat(Object.keys(D))).forEach(n),i}var F$=Object.freeze({left:0,top:0,width:16,height:16}),Si=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Lu=Object.freeze({...F$,...Si}),Pu=Object.freeze({...Lu,body:"",hidden:!1});function x4(r,t){let u={};if(!r.hFlip!==!t.hFlip)u.hFlip=!0;if(!r.vFlip!==!t.vFlip)u.vFlip=!0;let D=((r.rotate||0)+(t.rotate||0))%4;if(D)u.rotate=D;return u}function g$(r,t){let u=x4(r,t);for(let D in Pu)if(D in Si){if(D in r&&!(D in u))u[D]=Si[D]}else if(D in t)u[D]=t[D];else if(D in r)u[D]=r[D];return u}function p4(r,t,u){let D=r.icons,i=r.aliases||Object.create(null),n={};function o(e){n=g$(D[e]||i[e],n)}return o(t),u.forEach(o),g$(r,n)}function a4(r,t){let u=[];if(typeof r!=="object"||typeof r.icons!=="object")return u;if(r.not_found instanceof Array)r.not_found.forEach((i)=>{t(i,null),u.push(i)});let D=d4(r);for(let i in D){let n=D[i];if(n)t(i,p4(r,i,n)),u.push(i)}return u}var M7={provider:"",aliases:{},not_found:{},...F$};function w$(r,t){for(let u in t)if(u in r&&typeof r[u]!==typeof t[u])return!1;return!0}function s4(r){if(typeof r!=="object"||r===null)return null;let t=r;if(typeof t.prefix!=="string"||!r.icons||typeof r.icons!=="object")return null;if(!w$(r,M7))return null;let u=t.icons;for(let i in u){let n=u[i];if(!i||typeof n.body!=="string"||!w$(n,Pu))return null}let D=t.aliases||Object.create(null);for(let i in D){let n=D[i],o=n.parent;if(!i||typeof o!=="string"||!u[o]&&!D[o]||!w$(n,Pu))return null}return t}var rE=Object.create(null);function Z7(r,t){return{provider:r,prefix:t,icons:Object.create(null),missing:new Set}}function ci(r,t){let u=rE[r]||(rE[r]=Object.create(null));return u[t]||(u[t]=Z7(r,t))}function b$(r,t){if(!s4(t))return[];return a4(t,(u,D)=>{if(D)r.icons[u]=D;else r.missing.add(u)})}function tE(r){let t={loaded:[],missing:[],pending:[]},u=Object.create(null);r.sort((i,n)=>{if(i.provider!==n.provider)return i.provider.localeCompare(n.provider);if(i.prefix!==n.prefix)return i.prefix.localeCompare(n.prefix);return i.name.localeCompare(n.name)});let D={provider:"",prefix:"",name:""};return r.forEach((i)=>{if(D.name===i.name&&D.prefix===i.prefix&&D.provider===i.provider)return;D=i;let{provider:n,prefix:o,name:e}=i,f=u[n]||(u[n]=Object.create(null)),$=f[o]||(f[o]=ci(n,o)),l;if(e in $.icons)l=t.loaded;else if(o===""||$.missing.has(e))l=t.missing;else l=t.pending;let m={provider:n,prefix:o,name:e};l.push(m)}),t}var C$=Object.create(null);function iE(r,t){C$[r]=t}function ku(r){return C$[r]||C$[""]}var _$=/^[a-z0-9]+(-[a-z0-9]+)*$/,Qi=(r,t,u,D="")=>{let i=r.split(":");if(r.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;D=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),f=i.pop(),$={provider:i.length>0?i[0]:D,prefix:f,name:e};return t&&!Jn($)?null:$}let n=i[0],o=n.split("-");if(o.length>1){let e={provider:D,prefix:o.shift(),name:o.join("-")};return t&&!Jn(e)?null:e}if(u&&D===""){let e={provider:D,prefix:"",name:n};return t&&!Jn(e,u)?null:e}return null},Jn=(r,t)=>{if(!r)return!1;return!!((t&&r.prefix===""||!!r.prefix)&&!!r.name)};function uE(r,t=!0,u=!1){let D=[];return r.forEach((i)=>{let n=typeof i==="string"?Qi(i,t,u):i;if(n)D.push(n)}),D}var I$=!1;function DE(r){if(typeof r==="boolean")I$=r;return I$}function nE(r){let t=typeof r==="string"?Qi(r,!0,I$):r;if(t){let u=ci(t.provider,t.prefix),D=t.name;return u.icons[D]||(u.missing.has(D)?null:void 0)}}function U$(r){let t;if(typeof r.resources==="string")t=[r.resources];else if(t=r.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:r.path||"/",maxURL:r.maxURL||500,rotate:r.rotate||750,timeout:r.timeout||5000,random:r.random===!0,index:r.index||0,dataAfterTimeout:r.dataAfterTimeout!==!1}}var oE=Object.create(null),du=["https://api.simplesvg.com","https://api.unisvg.com"],An=[];while(du.length>0)if(du.length===1)An.push(du.shift());else if(Math.random()>0.5)An.push(du.shift());else An.push(du.pop());oE[""]=U$({resources:["https://api.iconify.design"].concat(An)});function xu(r){return oE[r]}var L7={resources:[],index:0,timeout:2000,rotate:750,random:!1,dataAfterTimeout:!1};function P7(r,t,u,D){let i=r.resources.length,n=r.random?Math.floor(Math.random()*i):r.index,o;if(r.random){let L=r.resources.slice(0);o=[];while(L.length>1){let p=Math.floor(Math.random()*L.length);o.push(L[p]),L=L.slice(0,p).concat(L.slice(p+1))}o=o.concat(L)}else o=r.resources.slice(n).concat(r.resources.slice(0,n));let e=Date.now(),f="pending",$=0,l,m=null,c=[],g=[];if(typeof D==="function")g.push(D);function _(){if(m)clearTimeout(m),m=null}function q(){if(f==="pending")f="aborted";_(),c.forEach((L)=>{if(L.status==="pending")L.status="aborted"}),c=[]}function y(L,p){if(p)g=[];if(typeof L==="function")g.push(L)}function N(){return{startTime:e,payload:t,status:f,queriesSent:$,queriesPending:c.length,subscribe:y,abort:q}}function R(){f="failed",g.forEach((L)=>{L(void 0,l)})}function z(){c.forEach((L)=>{if(L.status==="pending")L.status="aborted"}),c=[]}function A(L,p,a){let Q=p!=="success";switch(c=c.filter((M)=>M!==L),f){case"pending":break;case"failed":if(Q||!r.dataAfterTimeout)return;break;default:return}if(p==="abort"){l=a,R();return}if(Q){if(l=a,!c.length)if(!o.length)R();else K();return}if(_(),z(),!r.random){let M=r.resources.indexOf(L.resource);if(M!==-1&&M!==r.index)r.index=M}f="completed",g.forEach((M)=>{M(a)})}function K(){if(f!=="pending")return;_();let L=o.shift();if(L===void 0){if(c.length){m=setTimeout(()=>{if(_(),f==="pending")z(),R()},r.timeout);return}R();return}let p={status:"pending",resource:L,callback:(a,Q)=>{A(p,a,Q)}};c.push(p),$++,m=setTimeout(K,r.rotate),u(L,t,p.callback)}return setTimeout(K),N}function O$(r){let t={...L7,...r},u=[];function D(){u=u.filter((e)=>e().status==="pending")}function i(e,f,$){let l=P7(t,e,f,(m,c)=>{if(D(),$)$(m,c)});return u.push(l),l}function n(e){return u.find((f)=>{return e(f)})||null}return{query:i,find:n,setIndex:(e)=>{t.index=e},getIndex:()=>t.index,cleanup:D}}function eE(){}var y$=Object.create(null);function k7(r){if(!y$[r]){let t=xu(r);if(!t)return;let u=O$(t),D={config:t,redundancy:u};y$[r]=D}return y$[r]}function fE(r,t,u){let D,i;if(typeof r==="string"){let n=ku(r);if(!n)return u(void 0,424),eE;i=n.send;let o=k7(r);if(o)D=o.redundancy}else{let n=U$(r);if(n){D=O$(n);let o=r.resources?r.resources[0]:"",e=ku(o);if(e)i=e.send}}if(!D||!i)return u(void 0,424),eE;return D.query(t,i,u)().abort}function $E(){}function d7(r){if(!r.iconsLoaderFlag)r.iconsLoaderFlag=!0,setTimeout(()=>{r.iconsLoaderFlag=!1,P4(r)})}function x7(r){let t=[],u=[];return r.forEach((D)=>{(D.match(_$)?t:u).push(D)}),{valid:t,invalid:u}}function pu(r,t,u){function D(){let i=r.pendingIcons;t.forEach((n)=>{if(i)i.delete(n);if(!r.icons[n])r.missing.add(n)})}if(u&&typeof u==="object")try{if(!b$(r,u).length){D();return}}catch(i){console.error(i)}D(),d7(r)}function lE(r,t){if(r instanceof Promise)r.then((u)=>{t(u)}).catch(()=>{t(null)});else t(r)}function p7(r,t){if(!r.iconsToLoad)r.iconsToLoad=t;else r.iconsToLoad=r.iconsToLoad.concat(t).sort();if(!r.iconsQueueFlag)r.iconsQueueFlag=!0,setTimeout(()=>{r.iconsQueueFlag=!1;let{provider:u,prefix:D}=r,i=r.iconsToLoad;if(delete r.iconsToLoad,!i||!i.length)return;let n=r.loadIcon;if(r.loadIcons&&(i.length>1||!n)){lE(r.loadIcons(i,D,u),(l)=>{pu(r,i,l)});return}if(n){i.forEach((l)=>{let m=n(l,D,u);lE(m,(c)=>{let g=c?{prefix:D,icons:{[l]:c}}:null;pu(r,[l],g)})});return}let{valid:o,invalid:e}=x7(i);if(e.length)pu(r,e,null);if(!o.length)return;let f=D.match(_$)?ku(u):null;if(!f){pu(r,o,null);return}f.prepare(u,D,o).forEach((l)=>{fE(u,l,(m)=>{pu(r,l.icons,m)})})})}var a7=(r,t)=>{let u=uE(r,!0,DE()),D=tE(u);if(!D.pending.length){let f=!0;if(t)setTimeout(()=>{if(f)t(D.loaded,D.missing,D.pending,$E)});return()=>{f=!1}}let i=Object.create(null),n=[],o,e;return D.pending.forEach((f)=>{let{provider:$,prefix:l}=f;if(l===e&&$===o)return;o=$,e=l,n.push(ci($,l));let m=i[$]||(i[$]=Object.create(null));if(!m[l])m[l]=[]}),D.pending.forEach((f)=>{let{provider:$,prefix:l,name:m}=f,c=ci($,l),g=c.pendingIcons||(c.pendingIcons=new Set);if(!g.has(m))g.add(m),i[$][l].push(m)}),n.forEach((f)=>{let $=i[f.provider][f.prefix];if($.length)p7(f,$)}),t?k4(t,D,n):$E},mE=(r)=>{return new Promise((t,u)=>{let D=typeof r==="string"?Qi(r,!0):r;if(!D){u(r);return}a7([D||r],(i)=>{if(i.length&&D){let n=nE(D);if(n){t({...Lu,...n});return}}u(r)})})};var s7=()=>{let r;try{if(r=fetch,typeof r==="function")return r}catch(t){}},cE=s7();function rU(r,t){let u=xu(r);if(!u)return 0;let D;if(!u.maxURL)D=0;else{let i=0;u.resources.forEach((o)=>{i=Math.max(i,o.length)});let n=t+".json?icons=";D=u.maxURL-i-u.path.length-n.length}return D}function tU(r){return r===404}var iU=(r,t,u)=>{let D=[],i=rU(r,t),n="icons",o={type:"icons",provider:r,prefix:t,icons:[]},e=0;return u.forEach((f,$)=>{if(e+=f.length+1,e>=i&&$>0)D.push(o),o={type:"icons",provider:r,prefix:t,icons:[]},e=f.length;o.icons.push(f)}),D.push(o),D};function uU(r){if(typeof r==="string"){let t=xu(r);if(t)return t.path}return"/"}var DU=(r,t,u)=>{if(!cE){u("abort",424);return}let D=uU(t.provider);switch(t.type){case"icons":{let n=t.prefix,e=t.icons.join(","),f=new URLSearchParams({icons:e});D+=n+".json?"+f.toString();break}case"custom":{let n=t.uri;D+=n.slice(0,1)==="/"?n.slice(1):n;break}default:u("abort",400);return}let i=503;cE(r+D).then((n)=>{let o=n.status;if(o!==200){setTimeout(()=>{u(tU(o)?"abort":"next",o)});return}return i=501,n.json()}).then((n)=>{if(typeof n!=="object"||n===null){setTimeout(()=>{if(n===404)u("abort",n);else u("next",i)});return}setTimeout(()=>{u("success",n)})}).catch(()=>{u("next",i)})},vE={prepare:iU,send:DU};var nU=Object.freeze({width:null,height:null}),EE=Object.freeze({...nU,...Si});var oU=/(-?[0-9.]*[0-9]+[0-9.]*)/g,eU=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function N$(r,t,u){if(t===1)return r;if(u=u||100,typeof r==="number")return Math.ceil(r*t*u)/u;if(typeof r!=="string")return r;let D=r.split(oU);if(D===null||!D.length)return r;let i=[],n=D.shift(),o=eU.test(n);while(!0){if(o){let e=parseFloat(n);if(isNaN(e))i.push(n);else i.push(Math.ceil(e*t*u)/u)}else i.push(n);if(n=D.shift(),n===void 0)return i.join("");o=!o}}function fU(r,t="defs"){let u="",D=r.indexOf("<"+t);while(D>=0){let i=r.indexOf(">",D),n=r.indexOf("</"+t);if(i===-1||n===-1)break;let o=r.indexOf(">",n);if(o===-1)break;u+=r.slice(i+1,n).trim(),r=r.slice(0,D).trim()+r.slice(o+1)}return{defs:u,content:r}}function $U(r,t){return r?"<defs>"+r+"</defs>"+t:t}function FE(r,t,u){let D=fU(r);return $U(D.defs,t+D.content+u)}var lU=(r)=>r==="unset"||r==="undefined"||r==="none";function B$(r,t){let u={...Lu,...r},D={...EE,...t},i={left:u.left,top:u.top,width:u.width,height:u.height},n=u.body;[u,D].forEach((q)=>{let y=[],N=q.hFlip,R=q.vFlip,z=q.rotate;if(N)if(R)z+=2;else y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0;else if(R)y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0;let A;if(z<0)z-=Math.floor(z/4)*4;switch(z=z%4,z){case 1:A=i.height/2+i.top,y.unshift("rotate(90 "+A.toString()+" "+A.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:A=i.width/2+i.left,y.unshift("rotate(-90 "+A.toString()+" "+A.toString()+")");break}if(z%2===1){if(i.left!==i.top)A=i.left,i.left=i.top,i.top=A;if(i.width!==i.height)A=i.width,i.width=i.height,i.height=A}if(y.length)n=FE(n,'<g transform="'+y.join(" ")+'">',"</g>")});let{width:o,height:e}=D,f=i.width,$=i.height,l,m;if(o===null)m=e===null?"1em":e==="auto"?$:e,l=N$(m,f/$);else l=o==="auto"?f:o,m=e===null?N$(l,$/f):e==="auto"?$:e;let c={},g=(q,y)=>{if(!lU(y))c[q]=y.toString()};g("width",l),g("height",m);let _=[i.left,i.top,f,$];return c.viewBox=_.join(" "),{attributes:c,viewBox:_,body:n}}iE("",vE);var q$=new Map,h$=new Map;async function mU(r){if(h$.has(r))return h$.get(r);let t=await mE(r);if(!t)return null;return h$.set(r,t),t}async function Lt(r,t=24){let u=`${r}@${t}`;if(q$.has(u))return q$.get(u);let D=await mU(r);if(!D)return null;let i=B$(D,{height:t,width:t}),o={svg:`<svg xmlns="http://www.w3.org/2000/svg" ${Object.entries(i.attributes).map(([e,f])=>`${e}="${f}"`).join(" ")}>${i.body}</svg>`,width:t,height:t,body:i.body,viewBox:{left:i.viewBox[0],top:i.viewBox[1],width:i.viewBox[2],height:i.viewBox[3]}};return q$.set(u,o),o}async function vi(r){await Promise.all(r.map(({name:t,size:u})=>Lt(t,u||24)))}function Ei(r){let t=[];function u(D){if(!D||typeof D!=="object")return;if(Array.isArray(D)){D.forEach(u);return}let i=D;if(!i.type)return;if(i.type==="icon"){let o=i.props;if(o.icon)t.push({name:o.icon,size:o.size})}if(typeof i.type==="function")try{let o=i.type(i.props);if(o)u(o)}catch{}let n=i.props;if(n.children)if(Array.isArray(n.children))n.children.forEach(u);else u(n.children)}return u(r),t}function gE(r){if(r===null||typeof r!=="object")return!1;let t=r;return typeof t.type==="string"&&"props"in t&&Array.isArray(t.children)}function wE(r){return r!==null&&typeof r==="object"&&"type"in r&&"props"in r}function cU(r){let t=[],u=r.props.children;if(u!=null){let n=Array.isArray(u)?u:[u];for(let o of n.flat()){if(o==null)continue;if(typeof o==="string"||typeof o==="number")t.push(String(o));else if(wE(o)){let e=z$(o);if(e)t.push(e)}}}let{children:D,...i}=r.props;return{type:r.type,props:i,children:t}}function vU(r){return r!==null&&typeof r==="object"&&"__icon"in r&&r.__icon===!0}function z$(r,t=0){if(t>100)throw new Error("Component resolution depth exceeded");if(gE(r))return r;if(vU(r))return{type:"__icon__",props:{name:r.name,size:r.size,color:r.color},children:[]};if(wE(r)){if(typeof r.type==="function")return z$(r.type(r.props),t+1);if(typeof r.type==="string")return cU(r)}return null}function EU(r){let{type:t,props:u}=r,D=Object.entries(u).map(([i,n])=>{return`${i.replace(/([A-Z])/g,(e)=>`-${e.toLowerCase()}`)}="${n}"`}).join(" ");return`<${t}${D?" "+D:""}/>`}function FU(r){let{props:t,children:u}=r,{width:D,height:i,viewBox:n,fill:o,w:e,h:f}=t,$=['xmlns="http://www.w3.org/2000/svg"',D||e?`width="${D||e}"`:"",i||f?`height="${i||f}"`:"",n?`viewBox="${n}"`:"",o?`fill="${o}"`:""].filter(Boolean).join(" "),l=u.filter((m)=>typeof m!=="string").map(EU).join("");return`<svg ${$}>${l}</svg>`}async function bE(r){if(r.type==="__icon__"){let{name:u,size:D=24,color:i}=r.props,n=await Lt(u,D);if(!n)throw new Error(`Icon not found: ${u}`);let o=n.svg;if(i)o=o.replace(/currentColor/g,i);return{type:"svg",props:{src:o,w:D,h:D,name:u},children:[]}}if(r.type==="svg"&&r.children.length>0&&!r.props.src){let u=FU(r);return{type:"svg",props:{...r.props,__svgString:u},children:[]}}let t=await Promise.all(r.children.map(async(u)=>{if(typeof u==="string")return u;return bE(u)}));return{...r,children:t}}async function Fi(r,t){let u=typeof r==="function"?r():z$(r);if(!u)throw new Error("Root must be a Figma component (Frame, Text, etc)");return u=await bE(u),F("create-from-jsx",{tree:u,x:t?.x,y:t?.y,parentId:t?.parent})}var J$=new Map;function Pt(r){J$.clear();for(let t of r){let u=t.id.match(/VariableID:(\d+):(\d+)/);if(u)J$.set(t.name,{id:t.id,sessionID:parseInt(u[1],10),localID:parseInt(u[2],10)})}}function kt(){return J$.size>0}B();import{transformSync as _U}from"esbuild";var Xn={};Or(Xn,{default:()=>CU,createElement:()=>au});function au(r,t,...u){let D=u.flat();return{type:r,props:{...t,children:D.length===1?D:D.length>0?D:void 0}}}var CU={createElement:au};function IU(r){let t=`
|
|
190
|
+
const h = React.createElement
|
|
191
|
+
const Frame = 'frame', Text = 'text', Rectangle = 'rectangle', Ellipse = 'ellipse', Line = 'line', Image = 'image', SVG = 'svg'
|
|
192
|
+
return function Component() { return ${r.trim()} }
|
|
193
|
+
`,u=_U(t,{loader:"tsx",jsx:"transform",jsxFactory:"h"});return new Function("React",u.code)(Xn)}async function A$(r,t){let u=IU(r);if(!kt())try{let o=await F("get-variables",{simple:!0});Pt(o)}catch{}let D=au(u,null),i=Ei(D);if(i.length>0)await vi(i);return[await Fi(D,t)]}var CE="__figma_use_component_set_registry__",wX=globalThis[CE]||(globalThis[CE]=new Map);var X$=ft(E$(),1);B();import*as _E from"esbuild";var UU=`
|
|
194
|
+
export const Frame = 'frame'
|
|
195
|
+
export const Text = 'text'
|
|
196
|
+
export const Rectangle = 'rectangle'
|
|
197
|
+
export const Ellipse = 'ellipse'
|
|
198
|
+
export const Line = 'line'
|
|
199
|
+
export const Image = 'image'
|
|
200
|
+
export const SVG = 'svg'
|
|
201
|
+
export const Icon = (props) => ({ __icon: true, name: props.name, size: props.size, color: props.color })
|
|
202
|
+
export const View = 'frame'
|
|
203
|
+
export const Rect = 'rectangle'
|
|
204
|
+
export const Section = 'section'
|
|
205
|
+
export const Group = 'group'
|
|
206
|
+
export const defineComponent = (name, el) => () => el
|
|
207
|
+
export const defineVars = (vars) => Object.fromEntries(Object.entries(vars).map(([k, v]) => [k, v.value]))
|
|
208
|
+
`;async function jn(r){let t=r.trim();if(!t.includes("import ")&&!t.includes("export "))t=`import { Frame, Text, Rectangle, Ellipse, Line, Image, SVG, Icon } from 'figma-use/render'
|
|
209
|
+
export default () => ${t}`;else if(!t.includes("export "))t=`${t}
|
|
210
|
+
export default () => null`;let D=(await _E.build({stdin:{contents:t,loader:"tsx"},bundle:!0,write:!1,format:"iife",globalName:"__mod",jsx:"transform",jsxFactory:"React.createElement",plugins:[{name:"mock-imports",setup(n){n.onResolve({filter:/^figma-use\/render$|^\./},(o)=>({path:o.path,namespace:"mock"})),n.onLoad({filter:/.*/,namespace:"mock"},()=>({contents:UU,loader:"js"}))}}]})).outputFiles[0].text;return new Function("React",`${D}; return __mod.default`)(X$)}async function su(){let r=[];for await(let t of process.stdin)r.push(t);return Buffer.concat(r).toString("utf-8")}async function j$(r,t={}){let u=await jn(r);if(!kt())try{let o=await F("get-variables",{simple:!0});Pt(o)}catch{}let D=t.props??{},i=X$.createElement(u,D),n=Ei(i);if(n.length>0)await vi(n);return await Fi(i,{parent:t.parent,x:t.x,y:t.y})}var NU=`
|
|
211
|
+
Render JSX to Figma.
|
|
212
|
+
|
|
213
|
+
EXAMPLES
|
|
214
|
+
|
|
215
|
+
echo '<Frame w={200} h={100} bg="#3B82F6" rounded={12} p={24}>
|
|
216
|
+
<Text size={18} color="#FFF">Hello</Text>
|
|
217
|
+
</Frame>' | figma-use render --stdin
|
|
218
|
+
|
|
219
|
+
figma-use render ./Card.figma.tsx --props '{"title": "Hello"}'
|
|
220
|
+
|
|
221
|
+
ELEMENTS
|
|
222
|
+
|
|
223
|
+
Frame, Rectangle, Ellipse, Text, Line, Image, SVG, Icon, Instance
|
|
224
|
+
|
|
225
|
+
SIZE & POSITION
|
|
226
|
+
|
|
227
|
+
w, h width, height (number or "fill")
|
|
228
|
+
minW, maxW min/max width constraints
|
|
229
|
+
minH, maxH min/max height constraints
|
|
230
|
+
x, y position
|
|
231
|
+
|
|
232
|
+
LAYOUT (Auto-layout)
|
|
233
|
+
|
|
234
|
+
flex direction ("row" | "col")
|
|
235
|
+
gap spacing between items
|
|
236
|
+
wrap enable flex wrap
|
|
237
|
+
justify main axis: "start" | "center" | "end" | "between"
|
|
238
|
+
items cross axis: "start" | "center" | "end"
|
|
239
|
+
p, px, py padding (all, x-axis, y-axis)
|
|
240
|
+
pt, pr, pb, pl padding (top, right, bottom, left)
|
|
241
|
+
position "absolute" for absolute positioning
|
|
242
|
+
grow flex grow
|
|
243
|
+
stretch stretch to fill cross-axis
|
|
244
|
+
|
|
245
|
+
APPEARANCE
|
|
246
|
+
|
|
247
|
+
bg fill color (#HEX or var:Name)
|
|
248
|
+
stroke stroke color
|
|
249
|
+
strokeWidth stroke thickness
|
|
250
|
+
strokeAlign "inside" | "outside" | "center"
|
|
251
|
+
opacity 0..1 opacity
|
|
252
|
+
blendMode blend mode (multiply, overlay, etc.)
|
|
253
|
+
|
|
254
|
+
CORNERS
|
|
255
|
+
|
|
256
|
+
rounded corner radius (all corners)
|
|
257
|
+
roundedTL/TR/BL/BR individual corner radii
|
|
258
|
+
cornerSmoothing iOS squircle smoothing (0..1)
|
|
259
|
+
|
|
260
|
+
EFFECTS
|
|
261
|
+
|
|
262
|
+
shadow drop shadow ("Xpx Ypx Rpx color")
|
|
263
|
+
blur layer blur radius
|
|
264
|
+
overflow "hidden" to clip content
|
|
265
|
+
rotate rotation in degrees
|
|
266
|
+
|
|
267
|
+
TEXT
|
|
268
|
+
|
|
269
|
+
size font size
|
|
270
|
+
font font family
|
|
271
|
+
weight font weight (400, 500, "bold")
|
|
272
|
+
color text color
|
|
273
|
+
`,UE=E({meta:{description:"Render JSX to Figma"},args:{examples:{type:"boolean",description:"Show examples"},file:{type:"positional",description:"TSX/JSX file",required:!1},stdin:{type:"boolean",description:"Read from stdin"},props:{type:"string",description:"JSON props"},parent:{type:"string",description:"Parent node ID"},x:{type:"string",description:"X position"},y:{type:"string",description:"Y position"},export:{type:"string",description:"Named export"},json:{type:"boolean",description:"JSON output"}},async run({args:r}){if(r.examples){console.log(NU);return}try{let t;if(r.stdin){let o=await su();if(!o.trim())console.error(d("No input from stdin")),process.exit(1);t=await jn(o)}else if(r.file){let o=yU(r.file);if(!OU(o))console.error(d(`File not found: ${o}`)),process.exit(1);if(t=(await import(o))[r.export||"default"],!t)console.error(d(`Export "${r.export||"default"}" not found`)),process.exit(1)}else console.error(d("Provide file or --stdin")),process.exit(1);if(!kt())try{let o=await F("get-variables",{simple:!0});Pt(o)}catch{}let u=r.props?JSON.parse(r.props):{},D=IE.createElement(t,u),i=Ei(D);if(i.length>0){if(!r.json)console.log(`Preloading ${i.length} icon(s)...`);await vi(i)}let n=await Fi(D,{parent:r.parent,x:r.x?Number(r.x):void 0,y:r.y?Number(r.y):void 0});if(r.json)console.log(JSON.stringify(n,null,2));else console.log(Dr(`Rendered: ${n.id}`)),console.log(` name: ${n.name}`)}catch(t){w(t)}}});O();B();var OE=E({meta:{description:"Execute JavaScript in Figma plugin context"},args:{code:{type:"positional",description:"JavaScript code",required:!0},timeout:{type:"string",description:"Timeout in seconds"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){let t=await F("eval",{code:r.code},{timeout:r.timeout?Number(r.timeout)*1000:void 0});C(t,r.json)}});O();B();var yE=E({meta:{description:"Find nodes by name or type"},args:{name:{type:"string",description:"Node name to search (partial match)"},type:{type:"string",description:"Node type: FRAME, TEXT, RECTANGLE, INSTANCE, etc"},limit:{type:"string",description:"Max results (default: 100)",default:"100"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("find-by-name",{name:r.name,type:r.type,limit:Number(r.limit)});C(t,r.json)}catch(t){w(t)}}});O();var NE={rules:{"no-hardcoded-colors":"warning","no-default-names":"info","prefer-auto-layout":"info","consistent-spacing":"warning","consistent-radius":"info","color-contrast":"error","touch-target-size":"warning","text-style-required":"info","min-text-size":"warning","no-hidden-layers":"info","no-deeply-nested":"warning","no-empty-frames":"info","pixel-perfect":"info","no-groups":"info","effect-style-required":"info","no-mixed-styles":"warning","no-detached-instances":"off"}},BE={rules:{"no-hardcoded-colors":"error","no-default-names":"warning","prefer-auto-layout":"warning","consistent-spacing":"error","consistent-radius":"warning","color-contrast":"error","touch-target-size":"error","text-style-required":"warning","min-text-size":"error","no-hidden-layers":"warning","no-deeply-nested":"error","no-empty-frames":"warning","pixel-perfect":"warning","no-groups":"warning","effect-style-required":"warning","no-mixed-styles":"error","no-detached-instances":"warning"}},qE={rules:{"color-contrast":"error","touch-target-size":"error","min-text-size":"error","no-hardcoded-colors":"off","no-default-names":"off","prefer-auto-layout":"off","consistent-spacing":"off","consistent-radius":"off","text-style-required":"off","no-hidden-layers":"off","no-deeply-nested":"off","no-empty-frames":"off","pixel-perfect":"off","no-groups":"off","effect-style-required":"off","no-mixed-styles":"off","no-detached-instances":"off"}},hE={rules:{"no-hardcoded-colors":"error","no-default-names":"error","prefer-auto-layout":"error","consistent-spacing":"error","consistent-radius":"error","color-contrast":"error","touch-target-size":"error","text-style-required":"error","min-text-size":"error","no-hidden-layers":"error","no-deeply-nested":"error","no-empty-frames":"error","pixel-perfect":"error","no-groups":"error","effect-style-required":"error","no-mixed-styles":"error","no-detached-instances":"error"}},Ki={recommended:NE,strict:BE,accessibility:qE,"design-system":hE};an();gi();class Dl{rules=new Map;ruleConfigs=new Map;variables=[];messages=[];constructor(r={}){this.variables=r.variables??[],this.loadRules(r)}loadRules(r){let t={};if(r.preset){let D=Ki[r.preset];if(D)t={...D.rules}}if(r.config?.extends){let D=Array.isArray(r.config.extends)?r.config.extends:[r.config.extends];for(let i of D){let n=Ki[i];if(n)t={...t,...n.rules}}}if(r.config?.rules)t={...t,...r.config.rules};let u=r.rules??Object.keys(t);for(let D of u){let i=pn[D];if(!i)continue;let n=t[D];if(n==="off")continue;if(this.rules.set(D,i),typeof n==="string")this.ruleConfigs.set(D,{severity:n});else if(n)this.ruleConfigs.set(D,n);else this.ruleConfigs.set(D,{severity:i.meta.severity})}}lint(r){this.messages=[];for(let t of r)this.lintNode(t);return{messages:this.messages,errorCount:this.messages.filter((t)=>t.severity==="error").length,warningCount:this.messages.filter((t)=>t.severity==="warning").length,infoCount:this.messages.filter((t)=>t.severity==="info").length,fixableCount:this.messages.filter((t)=>t.fix).length}}lintNode(r){for(let[t,u]of this.rules){if(u.match&&!u.match.includes(r.type))continue;let D=this.ruleConfigs.get(t),i=this.createContext(r,t,D);try{u.check(r,i)}catch(n){console.error(`Error in rule ${t}:`,n)}}if(r.children)for(let t of r.children)t.parent=r,this.lintNode(t)}createContext(r,t,u){return{report:(D)=>{this.messages.push({ruleId:t,severity:u.severity,message:D.message,nodeId:D.node.id,nodeName:D.node.name,nodePath:R$(D.node),suggest:D.suggest,fix:D.fix})},getVariables:()=>this.variables,findSimilarVariable:(D,i)=>{if(i==="COLOR"&&typeof D==="object"){let n=null,o=1/0;for(let e of this.variables){if(e.resolvedType!=="COLOR")continue;for(let f of Object.values(e.valuesByMode)){if(typeof f!=="object"||!f)continue;let $=f;if($.r===void 0)continue;let l=W$(D,$);if(l<o)o=l,n=e}}return o<0.1?n:null}return null},getConfig:()=>u.options}}}function nl(r){return new Dl(r)}gi();an();var Tr=ft(Hu(),1),GU={error:"✖",warning:"⚠",info:"ℹ",off:" "},WU=(r,t)=>{switch(r){case"error":return Tr.default.red(t);case"warning":return Tr.default.yellow(t);case"info":return Tr.default.cyan(t);default:return Tr.default.dim(t)}};function ol(r,t={}){let{verbose:u=!1}=t,D=[],i=new Map;for(let o of r.messages){let e=`${o.nodePath.join("/")} (${o.nodeId})`,f=i.get(e)??[];f.push(o),i.set(e,f)}for(let[o,e]of i){e.sort((l,m)=>{let c={error:0,warning:1,info:2,off:3};return c[l.severity]-c[m.severity]});let $=e.some((l)=>l.severity==="error")?Tr.default.red("✖"):Tr.default.yellow("⚠");D.push(`${$} ${Tr.default.bold(o)}`);for(let l of e){let m=WU(l.severity,GU[l.severity]),c=Tr.default.dim(l.ruleId);if(D.push(` ${m} ${l.message} ${c}`),u&&l.suggest)D.push(` ${Tr.default.dim(`→ ${l.suggest}`)}`)}D.push("")}let n=[];if(r.errorCount>0)n.push(Tr.default.red(`${r.errorCount} error${r.errorCount!==1?"s":""}`));if(r.warningCount>0)n.push(Tr.default.yellow(`${r.warningCount} warning${r.warningCount!==1?"s":""}`));if(r.infoCount>0)n.push(Tr.default.cyan(`${r.infoCount} info`));if(n.length>0){if(D.push("─".repeat(60)),D.push(n.join(" ")),r.fixableCount>0)D.push(Tr.default.dim(`
|
|
274
|
+
Run with --fix to auto-fix ${r.fixableCount} issue${r.fixableCount!==1?"s":""}`))}else D.push(Tr.default.green("✔ No issues found"));return D.join(`
|
|
275
|
+
`)}function el(r){return JSON.stringify(r,null,2)}B();import{existsSync as YU,readFileSync as TU}from"fs";import{join as AE}from"path";var ro=".figma-use.json",sn=null,XE=null;function fl(r=process.cwd()){let t=r;while(t!=="/"){let u=AE(t,ro);if(YU(u))return u;t=AE(t,"..")}return null}function Mi(r){if(sn&&XE===r)return sn;let t=fl(r);if(!t)return{};try{let u=TU(t,"utf-8");return sn=JSON.parse(u),XE=r??process.cwd(),sn}catch{return{}}}function $l(){return{lint:{preset:"recommended"},storybook:{out:"./stories",matchIcons:!1,preferIcons:["lucide","tabler"],iconThreshold:0.85,framework:"react"},format:{pretty:!0,semi:!1,singleQuote:!0,tabWidth:2,trailingComma:"none"}}}function Zi(r){let t=$l();return{lint:{...t.lint,...r.lint},storybook:{...t.storybook,...r.storybook},format:{...t.format,...r.format}}}var jE=E({meta:{name:"lint",description:"Lint Figma designs for consistency and accessibility issues"},args:{root:{type:"string",description:"Node ID to lint (default: current page)"},page:{type:"string",description:"Page name to lint (partial match supported)"},preset:{type:"string",description:"Preset to use: recommended, strict, accessibility, design-system",default:"recommended"},rule:{type:"string",description:"Run specific rule(s) only (can be repeated)"},fix:{type:"boolean",description:"Auto-fix issues where possible",default:!1},verbose:{type:"boolean",alias:"v",description:"Show suggestions for fixing issues",default:!1},json:{type:"boolean",description:"Output as JSON",default:!1},"list-rules":{type:"boolean",description:"List available rules and exit",default:!1}},async run({args:r}){if(r["list-rules"]){let{allRules:c}=await Promise.resolve().then(() => (an(),JE));console.log(`
|
|
276
|
+
Available rules:
|
|
277
|
+
`);for(let[g,_]of Object.entries(c)){let q=_.meta.fixable?" \uD83D\uDD27":"";console.log(` ${g}${q}`),console.log(` ${_.meta.description}`),console.log(` Category: ${_.meta.category}`),console.log()}console.log("Presets:");for(let g of Object.keys(Ki))console.log(` - ${g}`);return}let t=r.root;if(r.page){let c=await F("find-page",{name:r.page});if(!c)console.error(`Page "${r.page}" not found`),process.exit(1);t=c}let u=await F("lint-tree",{rootId:t}),D=JSON.parse(u),i=await F("variable-list",{}),n=JSON.parse(i),o=Mi(),e=Zi(o),f=r.preset!=="recommended"?r.preset:e.lint.preset,$=r.rule?Array.isArray(r.rule)?r.rule:[r.rule]:void 0,m=nl({preset:f,rules:$,variables:n}).lint([D]);if(r.json)console.log(el(m));else console.log(ol(m,{verbose:r.verbose}));if(m.errorCount>0)process.exit(1)}});At();O();import{existsSync as RU,writeFileSync as VU}from"fs";import{join as SU}from"path";var GE=E({meta:{name:"init",description:"Create .figma-use.json config file"},args:{force:{type:"boolean",alias:"f",description:"Overwrite existing config",default:!1},preset:{type:"string",description:"Lint preset: recommended, strict, accessibility, design-system",default:"recommended"}},async run({args:r}){let t=SU(process.cwd(),ro);if(RU(t)&&!r.force){let D=fl();console.log(`${Mu("!")} Config already exists: ${D}`),console.log(` Use ${Jt("--force")} to overwrite`);return}let u=$l();if(r.preset&&r.preset!=="recommended")u.lint.preset=r.preset;VU(t,JSON.stringify(u,null,2)+`
|
|
278
|
+
`),console.log(`${Mt("✓")} Created ${Jt(ro)}`),console.log(),console.log(" Settings:"),console.log(` lint.preset: ${Mu(u.lint.preset)}`),console.log(` storybook.preferIcons: ${Mu(u.storybook.preferIcons.join(", "))}`),console.log(` format.pretty: ${Mu("true")}`)}});O();e$();mr();import{spawn as WE}from"child_process";import{dirname as YE,join as to}from"path";import{fileURLToPath as TE}from"url";var RE=E({meta:{name:"daemon",description:"Manage figma-use daemon for faster command execution"},subCommands:{start:E({meta:{description:"Start daemon in background"},args:{foreground:{type:"boolean",alias:"f",description:"Run in foreground (don't daemonize)"}},async run({args:r}){if(Gi()){let t=Wi();console.log(`Daemon already running (PID ${t?.pid})`);return}if(r.foreground)D$();else{let t=TE(import.meta.url),u=YE(t),D=u.includes("dist/cli")?to(u,"../cli/index.js"):to(u,"../index.ts");if(WE(process.execPath,[D,"daemon","start","-f"],{detached:!0,stdio:"ignore"}).unref(),await new Promise((n)=>setTimeout(n,500)),Gi()){let n=Wi();console.log(Dr(`Daemon started (PID ${n?.pid})`))}else console.error(d("Failed to start daemon")),process.exit(1)}}}),stop:E({meta:{description:"Stop daemon"},async run(){if(_n())console.log(Dr("Daemon stopped"));else console.log("Daemon not running")}}),status:E({meta:{description:"Check daemon status"},async run(){let r=Wi();if(r)console.log(Dr(`Daemon running (PID ${r.pid})`)),console.log(` Socket: ${r.socket}`);else console.log("Daemon not running")}}),restart:E({meta:{description:"Restart daemon"},async run(){_n(),await new Promise((i)=>setTimeout(i,100));let r=TE(import.meta.url),t=YE(r),u=t.includes("dist/cli")?to(t,"../cli/index.js"):to(t,"../index.ts");if(WE(process.execPath,[u,"daemon","start","-f"],{detached:!0,stdio:"ignore"}).unref(),await new Promise((i)=>setTimeout(i,500)),Gi()){let i=Wi();console.log(Dr(`Daemon restarted (PID ${i?.pid})`))}else console.error(d("Failed to restart daemon")),process.exit(1)}})}});O();B();Dt();var VE=E({meta:{name:"query",description:`Query nodes using XPath selectors
|
|
279
|
+
|
|
280
|
+
Examples:
|
|
281
|
+
figma-use query "//FRAME" # All frames
|
|
282
|
+
figma-use query "//FRAME[@width < 300]" # Frames narrower than 300px
|
|
283
|
+
figma-use query "//COMPONENT[starts-with(@name, 'Button')]" # Components starting with Button
|
|
284
|
+
figma-use query "//FRAME[contains(@name, 'Card')]" # Frames with 'Card' in name
|
|
285
|
+
figma-use query "//SECTION/FRAME" # Direct frame children of sections
|
|
286
|
+
figma-use query "//SECTION//TEXT" # All text nodes inside sections
|
|
287
|
+
figma-use query "//*[@cornerRadius > 0]" # Any node with corner radius`},args:{selector:{type:"positional",description:'XPath selector (e.g., //FRAME[@width < 300], //TEXT[contains(@name, "Label")])',required:!0},root:{type:"string",description:"Root node ID (default: current page)"},select:{type:"string",description:"Comma-separated fields to return (default: id,name,type)"},limit:{type:"string",description:"Max results to return (default: 1000)"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){let t=r.select?.split(",").map((i)=>i.trim()),u=r.limit?parseInt(r.limit,10):void 0,D=await F("query",{selector:r.selector,rootId:r.root,select:t,limit:u});if(r.json)C(D,!0);else if(Array.isArray(D))if(D.length===0)console.log("No nodes found");else{for(let i of D){let n=[];if(i.type)n.push(`[${i.type}]`);if(i.name)n.push(`"${i.name}"`);if(i.id)n.push(`(${i.id})`);if(i.width!==void 0&&i.height!==void 0)n.push(`${i.width}×${i.height}`);console.log(n.join(" "))}console.log(`
|
|
288
|
+
${D.length} node(s) found`)}else C(D,!1)}});O();B();var SE=E({meta:{description:"Import SVG"},args:{svg:{type:"string",description:"SVG content",required:!0},x:{type:"string",description:"X coordinate",default:"0"},y:{type:"string",description:"Y coordinate",default:"0"},parent:{type:"string",description:"Parent node ID"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("import-svg",{svg:r.svg,x:Number(r.x),y:Number(r.y),parentId:r.parent});C(t,r.json,"create")}catch(t){w(t)}}});O();B();mr();import{existsSync as QU,readFileSync as KU}from"fs";var QE=E({meta:{description:"Place reference image and create working frame for AI reconstruction"},args:{src:{type:"positional",description:"Image source: URL (https://...) or local file path",required:!0},x:{type:"string",description:"X position",default:"0"},y:{type:"string",description:"Y position",default:"0"},width:{type:"string",description:"Override width (default: image native)"},height:{type:"string",description:"Override height (default: image native)"},name:{type:"string",description:"Working frame name",default:"Reconstruction"},parent:{type:"string",description:"Parent node ID"},"ref-opacity":{type:"string",description:"Reference image opacity (0-1)",default:"0.3"},"no-ref":{type:"boolean",description:"Skip placing reference image (just create working frame)"},"include-data":{type:"boolean",description:"Include base64 image data in output (for AI vision analysis)"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t,u;if(r.src.startsWith("http://")||r.src.startsWith("https://"))t=r.src;else if(r.src.startsWith("data:")){let c=r.src.indexOf(",");if(c===-1)console.error(d("Invalid data URI")),process.exit(1);u=r.src.slice(c+1)}else{if(!QU(r.src))console.error(d(`File not found: ${r.src}`)),process.exit(1);u=KU(r.src).toString("base64")}let D=Number(r.x),i=Number(r.y),n=r.width?Number(r.width):void 0,o=r.height?Number(r.height):void 0,e,f,$;if(!r["no-ref"]){let c=await F("create-image-node",{x:D,y:i,width:n,height:o,name:`${r.name} - Reference`,parentId:r.parent,url:t,data:u,scaleMode:"FIT"});e=c.id,f=n||c.width,$=o||c.height,await F("set-locked",{id:e,locked:!0}),await F("set-opacity",{id:e,opacity:Number(r["ref-opacity"])})}else f=n||1440,$=o||900;let l=await F("create-frame",{x:D,y:i,width:f,height:$,name:r.name,parentId:r.parent});await F("set-fill-color",{id:l.id,color:"transparent"}),await F("set-viewport",{x:D+f/2,y:i+$/2,zoom:Math.min(1,800/Math.max(f,$))});let m={workingFrameId:l.id,workingFrameName:l.name,referenceImageId:e||null,width:f,height:$,position:{x:D,y:i}};if(r["include-data"]&&u)m.imageBase64=u;else if(r["include-data"]&&t)m.imageUrl=t;if(r.json)console.log(JSON.stringify(m,null,2));else{if(console.log(Dr(`Working frame: ${l.id} (${f}×${$})`)),e)console.log(` Reference image: ${e} (opacity: ${r["ref-opacity"]})`);console.log(` Position: (${D}, ${i})`),console.log(),console.log("Next steps for AI agent:"),console.log(" 1. Analyze the original image"),console.log(` 2. Use 'render --parent ${l.id}' to build the design`),console.log(` 3. Or use 'create' commands with --parent ${l.id}`)}}catch(t){w(t)}}});O();O();import{createServer as XN}from"http";var Te={};Or(Te,{xor:()=>EF,xid:()=>T3,void:()=>fF,uuidv7:()=>z3,uuidv6:()=>h3,uuidv4:()=>q3,uuid:()=>B3,util:()=>j,url:()=>J3,uppercase:()=>uu,unknown:()=>yi,union:()=>Je,undefined:()=>oF,ulid:()=>Y3,uint64:()=>DF,uint32:()=>tF,tuple:()=>Bc,trim:()=>$u,treeifyError:()=>Il,transform:()=>Xe,toUpperCase:()=>mu,toLowerCase:()=>lu,toJSONSchema:()=>ue,templateLiteral:()=>qF,symbol:()=>nF,superRefine:()=>sc,success:()=>yF,stringbool:()=>WF,stringFormat:()=>k3,string:()=>$e,strictObject:()=>cF,startsWith:()=>nu,slugify:()=>cu,size:()=>Ii,setErrorMap:()=>CN,set:()=>CF,safeParseAsync:()=>rc,safeParse:()=>s1,safeEncodeAsync:()=>ec,safeEncode:()=>nc,safeDecodeAsync:()=>fc,safeDecode:()=>oc,registry:()=>qo,regexes:()=>ot,regex:()=>tu,refine:()=>ac,record:()=>qc,readonly:()=>Lc,property:()=>so,promise:()=>hF,prettifyError:()=>Ul,preprocess:()=>TF,prefault:()=>Vc,positive:()=>ko,pipe:()=>qD,partialRecord:()=>gF,parseAsync:()=>a1,parse:()=>p1,overwrite:()=>Et,optional:()=>ND,object:()=>mF,number:()=>lc,nullish:()=>OF,nullable:()=>BD,null:()=>Fc,normalize:()=>fu,nonpositive:()=>po,nonoptional:()=>Sc,nonnegative:()=>ao,never:()=>ze,negative:()=>xo,nativeEnum:()=>_F,nanoid:()=>j3,nan:()=>NF,multipleOf:()=>st,minSize:()=>Ut,minLength:()=>jt,mime:()=>eu,meta:()=>jF,maxSize:()=>ri,maxLength:()=>Ui,map:()=>bF,mac:()=>S3,lte:()=>sr,lt:()=>_t,lowercase:()=>iu,looseRecord:()=>wF,looseObject:()=>vF,locales:()=>_D,literal:()=>IF,length:()=>Oi,lazy:()=>dc,ksuid:()=>R3,keyof:()=>lF,jwt:()=>P3,json:()=>YF,iso:()=>Fu,ipv6:()=>Q3,ipv4:()=>V3,intersection:()=>yc,int64:()=>uF,int32:()=>rF,int:()=>le,instanceof:()=>GF,includes:()=>Du,httpUrl:()=>A3,hostname:()=>d3,hex:()=>x3,hash:()=>p3,guid:()=>N3,gte:()=>Mr,gt:()=>It,globalRegistry:()=>Rr,getErrorMap:()=>_N,function:()=>zF,fromJSONSchema:()=>VF,formatError:()=>$D,float64:()=>s3,float32:()=>a3,flattenError:()=>fD,file:()=>UF,exactOptional:()=>Gc,enum:()=>Ae,endsWith:()=>ou,encodeAsync:()=>uc,encode:()=>tc,emoji:()=>X3,email:()=>y3,e164:()=>L3,discriminatedUnion:()=>FF,describe:()=>XF,decodeAsync:()=>Dc,decode:()=>ic,date:()=>$F,custom:()=>AF,cuid2:()=>W3,cuid:()=>G3,core:()=>Gt,config:()=>hr,coerce:()=>t2,codec:()=>BF,clone:()=>Hr,cidrv6:()=>H3,cidrv4:()=>K3,check:()=>JF,catch:()=>Hc,boolean:()=>mc,bigint:()=>iF,base64url:()=>Z3,base64:()=>M3,array:()=>JD,any:()=>eF,_function:()=>zF,_default:()=>Tc,_ZodString:()=>me,ZodXor:()=>Ic,ZodXID:()=>be,ZodVoid:()=>Cc,ZodUnknown:()=>wc,ZodUnion:()=>XD,ZodUndefined:()=>vc,ZodUUID:()=>Ot,ZodURL:()=>hD,ZodULID:()=>we,ZodType:()=>rr,ZodTuple:()=>Nc,ZodTransform:()=>Xc,ZodTemplateLiteral:()=>Pc,ZodSymbol:()=>cc,ZodSuccess:()=>Qc,ZodStringFormat:()=>gr,ZodString:()=>wu,ZodSet:()=>zc,ZodRecord:()=>jD,ZodRealError:()=>dr,ZodReadonly:()=>Zc,ZodPromise:()=>xc,ZodPrefault:()=>Rc,ZodPipe:()=>We,ZodOptional:()=>je,ZodObject:()=>AD,ZodNumberFormat:()=>Ni,ZodNumber:()=>Cu,ZodNullable:()=>Wc,ZodNull:()=>Ec,ZodNonOptional:()=>Ge,ZodNever:()=>bc,ZodNanoID:()=>Ee,ZodNaN:()=>Mc,ZodMap:()=>hc,ZodMAC:()=>$c,ZodLiteral:()=>Jc,ZodLazy:()=>kc,ZodKSUID:()=>Ce,ZodJWT:()=>qe,ZodIssueCode:()=>bN,ZodIntersection:()=>Oc,ZodISOTime:()=>ee,ZodISODuration:()=>fe,ZodISODateTime:()=>ne,ZodISODate:()=>oe,ZodIPv6:()=>Ie,ZodIPv4:()=>_e,ZodGUID:()=>yD,ZodFunction:()=>pc,ZodFirstPartyTypeKind:()=>r2,ZodFile:()=>Ac,ZodExactOptional:()=>jc,ZodError:()=>gN,ZodEnum:()=>gu,ZodEmoji:()=>ve,ZodEmail:()=>ce,ZodE164:()=>Be,ZodDiscriminatedUnion:()=>Uc,ZodDefault:()=>Yc,ZodDate:()=>zD,ZodCustomStringFormat:()=>bu,ZodCustom:()=>GD,ZodCodec:()=>Ye,ZodCatch:()=>Kc,ZodCUID2:()=>ge,ZodCUID:()=>Fe,ZodCIDRv6:()=>Oe,ZodCIDRv4:()=>Ue,ZodBoolean:()=>_u,ZodBigIntFormat:()=>he,ZodBigInt:()=>Iu,ZodBase64URL:()=>Ne,ZodBase64:()=>ye,ZodArray:()=>_c,ZodAny:()=>gc,TimePrecision:()=>B6,NEVER:()=>ll,$output:()=>_6,$input:()=>I6,$brand:()=>ml});var Gt={};Or(Gt,{version:()=>wm,util:()=>j,treeifyError:()=>Il,toJSONSchema:()=>ue,toDotPath:()=>PE,safeParseAsync:()=>yl,safeParse:()=>Ol,safeEncodeAsync:()=>IO,safeEncode:()=>CO,safeDecodeAsync:()=>UO,safeDecode:()=>_O,registry:()=>qo,regexes:()=>ot,process:()=>vr,prettifyError:()=>Ul,parseAsync:()=>no,parse:()=>Do,meta:()=>o1,locales:()=>_D,isValidJWT:()=>c3,isValidBase64URL:()=>m3,isValidBase64:()=>Vm,initializeContext:()=>ti,globalRegistry:()=>Rr,globalConfig:()=>rD,formatError:()=>$D,flattenError:()=>fD,finalize:()=>ui,extractDefs:()=>ii,encodeAsync:()=>wO,encode:()=>FO,describe:()=>n1,decodeAsync:()=>bO,decode:()=>gO,createToJSONSchemaMethod:()=>f1,createStandardJSONSchemaMethod:()=>Eu,config:()=>hr,clone:()=>Hr,_xor:()=>Ly,_xid:()=>Ro,_void:()=>x6,_uuidv7:()=>Xo,_uuidv6:()=>Ao,_uuidv4:()=>Jo,_uuid:()=>zo,_url:()=>UD,_uppercase:()=>uu,_unknown:()=>k6,_union:()=>Zy,_undefined:()=>Z6,_ulid:()=>To,_uint64:()=>H6,_uint32:()=>T6,_tuple:()=>dy,_trim:()=>$u,_transform:()=>iN,_toUpperCase:()=>mu,_toLowerCase:()=>lu,_templateLiteral:()=>mN,_symbol:()=>M6,_superRefine:()=>D1,_success:()=>eN,_stringbool:()=>e1,_stringFormat:()=>vu,_string:()=>O6,_startsWith:()=>nu,_slugify:()=>cu,_size:()=>Ii,_set:()=>ay,_safeParseAsync:()=>ai,_safeParse:()=>pi,_safeEncodeAsync:()=>co,_safeEncode:()=>lo,_safeDecodeAsync:()=>vo,_safeDecode:()=>mo,_regex:()=>tu,_refine:()=>u1,_record:()=>xy,_readonly:()=>lN,_property:()=>so,_promise:()=>vN,_positive:()=>ko,_pipe:()=>$N,_parseAsync:()=>xi,_parse:()=>di,_overwrite:()=>Et,_optional:()=>uN,_number:()=>A6,_nullable:()=>DN,_null:()=>L6,_normalize:()=>fu,_nonpositive:()=>po,_nonoptional:()=>oN,_nonnegative:()=>ao,_never:()=>d6,_negative:()=>xo,_nativeEnum:()=>rN,_nanoid:()=>Go,_nan:()=>s6,_multipleOf:()=>st,_minSize:()=>Ut,_minLength:()=>jt,_min:()=>Mr,_mime:()=>eu,_maxSize:()=>ri,_maxLength:()=>Ui,_max:()=>sr,_map:()=>py,_mac:()=>N6,_lte:()=>sr,_lt:()=>_t,_lowercase:()=>iu,_literal:()=>tN,_length:()=>Oi,_lazy:()=>cN,_ksuid:()=>Vo,_jwt:()=>Po,_isoTime:()=>z6,_isoDuration:()=>J6,_isoDateTime:()=>q6,_isoDate:()=>h6,_ipv6:()=>Qo,_ipv4:()=>So,_intersection:()=>ky,_int64:()=>K6,_int32:()=>Y6,_int:()=>j6,_includes:()=>Du,_guid:()=>ID,_gte:()=>Mr,_gt:()=>It,_float64:()=>W6,_float32:()=>G6,_file:()=>t1,_enum:()=>sy,_endsWith:()=>ou,_encodeAsync:()=>fo,_encode:()=>oo,_emoji:()=>jo,_email:()=>ho,_e164:()=>Lo,_discriminatedUnion:()=>Py,_default:()=>nN,_decodeAsync:()=>$o,_decode:()=>eo,_date:()=>p6,_custom:()=>i1,_cuid2:()=>Yo,_cuid:()=>Wo,_coercedString:()=>y6,_coercedNumber:()=>X6,_coercedDate:()=>a6,_coercedBoolean:()=>V6,_coercedBigint:()=>Q6,_cidrv6:()=>Ho,_cidrv4:()=>Ko,_check:()=>I3,_catch:()=>fN,_boolean:()=>R6,_bigint:()=>S6,_base64url:()=>Zo,_base64:()=>Mo,_array:()=>r1,_any:()=>P6,TimePrecision:()=>B6,NEVER:()=>ll,JSONSchemaGenerator:()=>L1,JSONSchema:()=>U3,Doc:()=>wo,$output:()=>_6,$input:()=>I6,$constructor:()=>I,$brand:()=>ml,$ZodXor:()=>u0,$ZodXID:()=>hm,$ZodVoid:()=>sm,$ZodUnknown:()=>pm,$ZodUnion:()=>ED,$ZodUndefined:()=>km,$ZodUUID:()=>_m,$ZodURL:()=>Um,$ZodULID:()=>qm,$ZodType:()=>x,$ZodTuple:()=>No,$ZodTransform:()=>c0,$ZodTemplateLiteral:()=>O0,$ZodSymbol:()=>Pm,$ZodSuccess:()=>b0,$ZodStringFormat:()=>Fr,$ZodString:()=>_i,$ZodSet:()=>f0,$ZodRegistry:()=>U6,$ZodRecord:()=>o0,$ZodRealError:()=>kr,$ZodReadonly:()=>U0,$ZodPromise:()=>N0,$ZodPrefault:()=>g0,$ZodPipe:()=>I0,$ZodOptional:()=>Bo,$ZodObjectJIT:()=>i0,$ZodObject:()=>F3,$ZodNumberFormat:()=>Zm,$ZodNumber:()=>Oo,$ZodNullable:()=>E0,$ZodNull:()=>dm,$ZodNonOptional:()=>w0,$ZodNever:()=>am,$ZodNanoID:()=>ym,$ZodNaN:()=>_0,$ZodMap:()=>e0,$ZodMAC:()=>Ym,$ZodLiteral:()=>l0,$ZodLazy:()=>B0,$ZodKSUID:()=>zm,$ZodJWT:()=>Hm,$ZodIntersection:()=>n0,$ZodISOTime:()=>Xm,$ZodISODuration:()=>jm,$ZodISODateTime:()=>Jm,$ZodISODate:()=>Am,$ZodIPv6:()=>Wm,$ZodIPv4:()=>Gm,$ZodGUID:()=>Cm,$ZodFunction:()=>y0,$ZodFile:()=>m0,$ZodExactOptional:()=>v0,$ZodError:()=>eD,$ZodEnum:()=>$0,$ZodEncodeError:()=>wi,$ZodEmoji:()=>Om,$ZodEmail:()=>Im,$ZodE164:()=>Km,$ZodDiscriminatedUnion:()=>D0,$ZodDefault:()=>F0,$ZodDate:()=>r0,$ZodCustomStringFormat:()=>Mm,$ZodCustom:()=>q0,$ZodCodec:()=>FD,$ZodCheckUpperCase:()=>lm,$ZodCheckStringFormat:()=>si,$ZodCheckStartsWith:()=>cm,$ZodCheckSizeEquals:()=>Dm,$ZodCheckRegex:()=>fm,$ZodCheckProperty:()=>Em,$ZodCheckOverwrite:()=>gm,$ZodCheckNumberFormat:()=>rm,$ZodCheckMultipleOf:()=>sl,$ZodCheckMinSize:()=>um,$ZodCheckMinLength:()=>om,$ZodCheckMimeType:()=>Fm,$ZodCheckMaxSize:()=>im,$ZodCheckMaxLength:()=>nm,$ZodCheckLowerCase:()=>$m,$ZodCheckLessThan:()=>Fo,$ZodCheckLengthEquals:()=>em,$ZodCheckIncludes:()=>mm,$ZodCheckGreaterThan:()=>go,$ZodCheckEndsWith:()=>vm,$ZodCheckBigIntFormat:()=>tm,$ZodCheck:()=>br,$ZodCatch:()=>C0,$ZodCUID2:()=>Bm,$ZodCUID:()=>Nm,$ZodCIDRv6:()=>Rm,$ZodCIDRv4:()=>Tm,$ZodBoolean:()=>vD,$ZodBigIntFormat:()=>Lm,$ZodBigInt:()=>yo,$ZodBase64URL:()=>Qm,$ZodBase64:()=>Sm,$ZodAsyncError:()=>Ct,$ZodArray:()=>t0,$ZodAny:()=>xm});var ll=Object.freeze({status:"aborted"});function I(r,t,u){function D(e,f){if(!e._zod)Object.defineProperty(e,"_zod",{value:{def:f,constr:o,traits:new Set},enumerable:!1});if(e._zod.traits.has(r))return;e._zod.traits.add(r),t(e,f);let $=o.prototype,l=Object.keys($);for(let m=0;m<l.length;m++){let c=l[m];if(!(c in e))e[c]=$[c].bind(e)}}let i=u?.Parent??Object;class n extends i{}Object.defineProperty(n,"name",{value:r});function o(e){var f;let $=u?.Parent?new n:this;D($,e),(f=$._zod).deferred??(f.deferred=[]);for(let l of $._zod.deferred)l();return $}return Object.defineProperty(o,"init",{value:D}),Object.defineProperty(o,Symbol.hasInstance,{value:(e)=>{if(u?.Parent&&e instanceof u.Parent)return!0;return e?._zod?.traits?.has(r)}}),Object.defineProperty(o,"name",{value:r}),o}var ml=Symbol("zod_brand");class Ct extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class wi extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`);this.name="ZodEncodeError"}}var rD={};function hr(r){if(r)Object.assign(rD,r);return rD}var j={};Or(j,{unwrapMessage:()=>tD,uint8ArrayToHex:()=>vO,uint8ArrayToBase64url:()=>mO,uint8ArrayToBase64:()=>ME,stringifyPrimitive:()=>J,slugify:()=>El,shallowClone:()=>gl,safeExtend:()=>nO,required:()=>fO,randomString:()=>aU,propertyKeyTypes:()=>DD,promiseAllObject:()=>pU,primitiveTypes:()=>wl,prefixIssues:()=>ar,pick:()=>iO,partial:()=>eO,parsedType:()=>X,optionalKeys:()=>bl,omit:()=>uO,objectClone:()=>kU,numKeys:()=>sU,nullish:()=>dt,normalizeParams:()=>W,mergeDefs:()=>Xt,merge:()=>oO,jsonStringifyReplacer:()=>Li,joinValues:()=>h,issue:()=>ki,isPlainObject:()=>pt,isObject:()=>bi,hexToUint8Array:()=>cO,getSizableOrigin:()=>nD,getParsedType:()=>rO,getLengthableOrigin:()=>oD,getEnumValues:()=>iD,getElementAtPath:()=>xU,floatSafeRemainder:()=>vl,finalizeIssue:()=>Pr,extend:()=>DO,escapeRegex:()=>nt,esc:()=>io,defineLazy:()=>ur,createTransparentProxy:()=>tO,cloneDef:()=>dU,clone:()=>Hr,cleanRegex:()=>uD,cleanEnum:()=>$O,captureStackTrace:()=>uo,cached:()=>Pi,base64urlToUint8Array:()=>lO,base64ToUint8Array:()=>HE,assignProp:()=>xt,assertNotEqual:()=>MU,assertNever:()=>LU,assertIs:()=>ZU,assertEqual:()=>HU,assert:()=>PU,allowsEval:()=>Fl,aborted:()=>at,NUMBER_FORMAT_RANGES:()=>Cl,Class:()=>ZE,BIGINT_FORMAT_RANGES:()=>_l});function HU(r){return r}function MU(r){return r}function ZU(r){}function LU(r){throw new Error("Unexpected value in exhaustive check")}function PU(r){}function iD(r){let t=Object.values(r).filter((D)=>typeof D==="number");return Object.entries(r).filter(([D,i])=>t.indexOf(+D)===-1).map(([D,i])=>i)}function h(r,t="|"){return r.map((u)=>J(u)).join(t)}function Li(r,t){if(typeof t==="bigint")return t.toString();return t}function Pi(r){return{get value(){{let u=r();return Object.defineProperty(this,"value",{value:u}),u}throw new Error("cached value already set")}}}function dt(r){return r===null||r===void 0}function uD(r){let t=r.startsWith("^")?1:0,u=r.endsWith("$")?r.length-1:r.length;return r.slice(t,u)}function vl(r,t){let u=(r.toString().split(".")[1]||"").length,D=t.toString(),i=(D.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(D)){let f=D.match(/\d?e-(\d?)/);if(f?.[1])i=Number.parseInt(f[1])}let n=u>i?u:i,o=Number.parseInt(r.toFixed(n).replace(".","")),e=Number.parseInt(t.toFixed(n).replace(".",""));return o%e/10**n}var KE=Symbol("evaluating");function ur(r,t,u){let D=void 0;Object.defineProperty(r,t,{get(){if(D===KE)return;if(D===void 0)D=KE,D=u();return D},set(i){Object.defineProperty(r,t,{value:i})},configurable:!0})}function kU(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function xt(r,t,u){Object.defineProperty(r,t,{value:u,writable:!0,enumerable:!0,configurable:!0})}function Xt(...r){let t={};for(let u of r){let D=Object.getOwnPropertyDescriptors(u);Object.assign(t,D)}return Object.defineProperties({},t)}function dU(r){return Xt(r._zod.def)}function xU(r,t){if(!t)return r;return t.reduce((u,D)=>u?.[D],r)}function pU(r){let t=Object.keys(r),u=t.map((D)=>r[D]);return Promise.all(u).then((D)=>{let i={};for(let n=0;n<t.length;n++)i[t[n]]=D[n];return i})}function aU(r=10){let u="";for(let D=0;D<r;D++)u+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return u}function io(r){return JSON.stringify(r)}function El(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var uo="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function bi(r){return typeof r==="object"&&r!==null&&!Array.isArray(r)}var Fl=Pi(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(r){return!1}});function pt(r){if(bi(r)===!1)return!1;let t=r.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let u=t.prototype;if(bi(u)===!1)return!1;if(Object.prototype.hasOwnProperty.call(u,"isPrototypeOf")===!1)return!1;return!0}function gl(r){if(pt(r))return{...r};if(Array.isArray(r))return[...r];return r}function sU(r){let t=0;for(let u in r)if(Object.prototype.hasOwnProperty.call(r,u))t++;return t}var rO=(r)=>{let t=typeof r;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(r)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(r))return"array";if(r===null)return"null";if(r.then&&typeof r.then==="function"&&r.catch&&typeof r.catch==="function")return"promise";if(typeof Map!=="undefined"&&r instanceof Map)return"map";if(typeof Set!=="undefined"&&r instanceof Set)return"set";if(typeof Date!=="undefined"&&r instanceof Date)return"date";if(typeof File!=="undefined"&&r instanceof File)return"file";return"object";default:throw new Error(`Unknown data type: ${t}`)}},DD=new Set(["string","number","symbol"]),wl=new Set(["string","number","bigint","boolean","symbol","undefined"]);function nt(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hr(r,t,u){let D=new r._zod.constr(t??r._zod.def);if(!t||u?.parent)D._zod.parent=r;return D}function W(r){let t=r;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function tO(r){let t;return new Proxy({},{get(u,D,i){return t??(t=r()),Reflect.get(t,D,i)},set(u,D,i,n){return t??(t=r()),Reflect.set(t,D,i,n)},has(u,D){return t??(t=r()),Reflect.has(t,D)},deleteProperty(u,D){return t??(t=r()),Reflect.deleteProperty(t,D)},ownKeys(u){return t??(t=r()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(u,D){return t??(t=r()),Reflect.getOwnPropertyDescriptor(t,D)},defineProperty(u,D,i){return t??(t=r()),Reflect.defineProperty(t,D,i)}})}function J(r){if(typeof r==="bigint")return r.toString()+"n";if(typeof r==="string")return`"${r}"`;return`${r}`}function bl(r){return Object.keys(r).filter((t)=>{return r[t]._zod.optin==="optional"&&r[t]._zod.optout==="optional"})}var Cl={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},_l={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function iO(r,t){let u=r._zod.def,D=u.checks;if(D&&D.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let n=Xt(r._zod.def,{get shape(){let o={};for(let e in t){if(!(e in u.shape))throw new Error(`Unrecognized key: "${e}"`);if(!t[e])continue;o[e]=u.shape[e]}return xt(this,"shape",o),o},checks:[]});return Hr(r,n)}function uO(r,t){let u=r._zod.def,D=u.checks;if(D&&D.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let n=Xt(r._zod.def,{get shape(){let o={...r._zod.def.shape};for(let e in t){if(!(e in u.shape))throw new Error(`Unrecognized key: "${e}"`);if(!t[e])continue;delete o[e]}return xt(this,"shape",o),o},checks:[]});return Hr(r,n)}function DO(r,t){if(!pt(t))throw new Error("Invalid input to extend: expected a plain object");let u=r._zod.def.checks;if(u&&u.length>0){let n=r._zod.def.shape;for(let o in t)if(Object.getOwnPropertyDescriptor(n,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=Xt(r._zod.def,{get shape(){let n={...r._zod.def.shape,...t};return xt(this,"shape",n),n}});return Hr(r,i)}function nO(r,t){if(!pt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let u=Xt(r._zod.def,{get shape(){let D={...r._zod.def.shape,...t};return xt(this,"shape",D),D}});return Hr(r,u)}function oO(r,t){let u=Xt(r._zod.def,{get shape(){let D={...r._zod.def.shape,...t._zod.def.shape};return xt(this,"shape",D),D},get catchall(){return t._zod.def.catchall},checks:[]});return Hr(r,u)}function eO(r,t,u){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let o=Xt(t._zod.def,{get shape(){let e=t._zod.def.shape,f={...e};if(u)for(let $ in u){if(!($ in e))throw new Error(`Unrecognized key: "${$}"`);if(!u[$])continue;f[$]=r?new r({type:"optional",innerType:e[$]}):e[$]}else for(let $ in e)f[$]=r?new r({type:"optional",innerType:e[$]}):e[$];return xt(this,"shape",f),f},checks:[]});return Hr(t,o)}function fO(r,t,u){let D=Xt(t._zod.def,{get shape(){let i=t._zod.def.shape,n={...i};if(u)for(let o in u){if(!(o in n))throw new Error(`Unrecognized key: "${o}"`);if(!u[o])continue;n[o]=new r({type:"nonoptional",innerType:i[o]})}else for(let o in i)n[o]=new r({type:"nonoptional",innerType:i[o]});return xt(this,"shape",n),n}});return Hr(t,D)}function at(r,t=0){if(r.aborted===!0)return!0;for(let u=t;u<r.issues.length;u++)if(r.issues[u]?.continue!==!0)return!0;return!1}function ar(r,t){return t.map((u)=>{var D;return(D=u).path??(D.path=[]),u.path.unshift(r),u})}function tD(r){return typeof r==="string"?r:r?.message}function Pr(r,t,u){let D={...r,path:r.path??[]};if(!r.message){let i=tD(r.inst?._zod.def?.error?.(r))??tD(t?.error?.(r))??tD(u.customError?.(r))??tD(u.localeError?.(r))??"Invalid input";D.message=i}if(delete D.inst,delete D.continue,!t?.reportInput)delete D.input;return D}function nD(r){if(r instanceof Set)return"set";if(r instanceof Map)return"map";if(r instanceof File)return"file";return"unknown"}function oD(r){if(Array.isArray(r))return"array";if(typeof r==="string")return"string";return"unknown"}function X(r){let t=typeof r;switch(t){case"number":return Number.isNaN(r)?"nan":"number";case"object":{if(r===null)return"null";if(Array.isArray(r))return"array";let u=r;if(u&&Object.getPrototypeOf(u)!==Object.prototype&&"constructor"in u&&u.constructor)return u.constructor.name}}return t}function ki(...r){let[t,u,D]=r;if(typeof t==="string")return{message:t,code:"custom",input:u,inst:D};return{...t}}function $O(r){return Object.entries(r).filter(([t,u])=>{return Number.isNaN(Number.parseInt(t,10))}).map((t)=>t[1])}function HE(r){let t=atob(r),u=new Uint8Array(t.length);for(let D=0;D<t.length;D++)u[D]=t.charCodeAt(D);return u}function ME(r){let t="";for(let u=0;u<r.length;u++)t+=String.fromCharCode(r[u]);return btoa(t)}function lO(r){let t=r.replace(/-/g,"+").replace(/_/g,"/"),u="=".repeat((4-t.length%4)%4);return HE(t+u)}function mO(r){return ME(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function cO(r){let t=r.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let u=new Uint8Array(t.length/2);for(let D=0;D<t.length;D+=2)u[D/2]=Number.parseInt(t.slice(D,D+2),16);return u}function vO(r){return Array.from(r).map((t)=>t.toString(16).padStart(2,"0")).join("")}class ZE{constructor(...r){}}var LE=(r,t)=>{r.name="$ZodError",Object.defineProperty(r,"_zod",{value:r._zod,enumerable:!1}),Object.defineProperty(r,"issues",{value:t,enumerable:!1}),r.message=JSON.stringify(t,Li,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},eD=I("$ZodError",LE),kr=I("$ZodError",LE,{Parent:Error});function fD(r,t=(u)=>u.message){let u={},D=[];for(let i of r.issues)if(i.path.length>0)u[i.path[0]]=u[i.path[0]]||[],u[i.path[0]].push(t(i));else D.push(t(i));return{formErrors:D,fieldErrors:u}}function $D(r,t=(u)=>u.message){let u={_errors:[]},D=(i)=>{for(let n of i.issues)if(n.code==="invalid_union"&&n.errors.length)n.errors.map((o)=>D({issues:o}));else if(n.code==="invalid_key")D({issues:n.issues});else if(n.code==="invalid_element")D({issues:n.issues});else if(n.path.length===0)u._errors.push(t(n));else{let o=u,e=0;while(e<n.path.length){let f=n.path[e];if(e!==n.path.length-1)o[f]=o[f]||{_errors:[]};else o[f]=o[f]||{_errors:[]},o[f]._errors.push(t(n));o=o[f],e++}}};return D(r),u}function Il(r,t=(u)=>u.message){let u={errors:[]},D=(i,n=[])=>{var o,e;for(let f of i.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(($)=>D({issues:$},f.path));else if(f.code==="invalid_key")D({issues:f.issues},f.path);else if(f.code==="invalid_element")D({issues:f.issues},f.path);else{let $=[...n,...f.path];if($.length===0){u.errors.push(t(f));continue}let l=u,m=0;while(m<$.length){let c=$[m],g=m===$.length-1;if(typeof c==="string")l.properties??(l.properties={}),(o=l.properties)[c]??(o[c]={errors:[]}),l=l.properties[c];else l.items??(l.items=[]),(e=l.items)[c]??(e[c]={errors:[]}),l=l.items[c];if(g)l.errors.push(t(f));m++}}};return D(r),u}function PE(r){let t=[],u=r.map((D)=>typeof D==="object"?D.key:D);for(let D of u)if(typeof D==="number")t.push(`[${D}]`);else if(typeof D==="symbol")t.push(`[${JSON.stringify(String(D))}]`);else if(/[^\w$]/.test(D))t.push(`[${JSON.stringify(D)}]`);else{if(t.length)t.push(".");t.push(D)}return t.join("")}function Ul(r){let t=[],u=[...r.issues].sort((D,i)=>(D.path??[]).length-(i.path??[]).length);for(let D of u)if(t.push(`✖ ${D.message}`),D.path?.length)t.push(` → at ${PE(D.path)}`);return t.join(`
|
|
289
|
+
`)}var di=(r)=>(t,u,D,i)=>{let n=D?Object.assign(D,{async:!1}):{async:!1},o=t._zod.run({value:u,issues:[]},n);if(o instanceof Promise)throw new Ct;if(o.issues.length){let e=new(i?.Err??r)(o.issues.map((f)=>Pr(f,n,hr())));throw uo(e,i?.callee),e}return o.value},Do=di(kr),xi=(r)=>async(t,u,D,i)=>{let n=D?Object.assign(D,{async:!0}):{async:!0},o=t._zod.run({value:u,issues:[]},n);if(o instanceof Promise)o=await o;if(o.issues.length){let e=new(i?.Err??r)(o.issues.map((f)=>Pr(f,n,hr())));throw uo(e,i?.callee),e}return o.value},no=xi(kr),pi=(r)=>(t,u,D)=>{let i=D?{...D,async:!1}:{async:!1},n=t._zod.run({value:u,issues:[]},i);if(n instanceof Promise)throw new Ct;return n.issues.length?{success:!1,error:new(r??eD)(n.issues.map((o)=>Pr(o,i,hr())))}:{success:!0,data:n.value}},Ol=pi(kr),ai=(r)=>async(t,u,D)=>{let i=D?Object.assign(D,{async:!0}):{async:!0},n=t._zod.run({value:u,issues:[]},i);if(n instanceof Promise)n=await n;return n.issues.length?{success:!1,error:new r(n.issues.map((o)=>Pr(o,i,hr())))}:{success:!0,data:n.value}},yl=ai(kr),oo=(r)=>(t,u,D)=>{let i=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return di(r)(t,u,i)},FO=oo(kr),eo=(r)=>(t,u,D)=>{return di(r)(t,u,D)},gO=eo(kr),fo=(r)=>async(t,u,D)=>{let i=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return xi(r)(t,u,i)},wO=fo(kr),$o=(r)=>async(t,u,D)=>{return xi(r)(t,u,D)},bO=$o(kr),lo=(r)=>(t,u,D)=>{let i=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return pi(r)(t,u,i)},CO=lo(kr),mo=(r)=>(t,u,D)=>{return pi(r)(t,u,D)},_O=mo(kr),co=(r)=>async(t,u,D)=>{let i=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return ai(r)(t,u,i)},IO=co(kr),vo=(r)=>async(t,u,D)=>{return ai(r)(t,u,D)},UO=vo(kr);var ot={};Or(ot,{xid:()=>hl,uuid7:()=>BO,uuid6:()=>NO,uuid4:()=>yO,uuid:()=>Ci,uppercase:()=>al,unicodeEmail:()=>kE,undefined:()=>xl,ulid:()=>ql,time:()=>Hl,string:()=>Zl,sha512_hex:()=>PO,sha512_base64url:()=>dO,sha512_base64:()=>kO,sha384_hex:()=>MO,sha384_base64url:()=>LO,sha384_base64:()=>ZO,sha256_hex:()=>QO,sha256_base64url:()=>HO,sha256_base64:()=>KO,sha1_hex:()=>RO,sha1_base64url:()=>SO,sha1_base64:()=>VO,rfc5322Email:()=>hO,number:()=>lD,null:()=>dl,nanoid:()=>Jl,md5_hex:()=>WO,md5_base64url:()=>TO,md5_base64:()=>YO,mac:()=>Tl,lowercase:()=>pl,ksuid:()=>zl,ipv6:()=>Yl,ipv4:()=>Wl,integer:()=>Pl,idnEmail:()=>zO,html5Email:()=>qO,hostname:()=>XO,hex:()=>GO,guid:()=>Xl,extendedDuration:()=>OO,emoji:()=>Gl,email:()=>jl,e164:()=>Ql,duration:()=>Al,domain:()=>jO,datetime:()=>Ml,date:()=>Kl,cuid2:()=>Bl,cuid:()=>Nl,cidrv6:()=>Vl,cidrv4:()=>Rl,browserEmail:()=>JO,boolean:()=>kl,bigint:()=>Ll,base64url:()=>Eo,base64:()=>Sl});var Nl=/^[cC][^\s-]{8,}$/,Bl=/^[0-9a-z]+$/,ql=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,hl=/^[0-9a-vA-V]{20}$/,zl=/^[A-Za-z0-9]{27}$/,Jl=/^[a-zA-Z0-9_-]{21}$/,Al=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,OO=/^[-+]?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)?)??$/,Xl=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ci=(r)=>{if(!r)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${r}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},yO=Ci(4),NO=Ci(6),BO=Ci(7),jl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qO=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,hO=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,kE=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,zO=kE,JO=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,AO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Gl(){return new RegExp(AO,"u")}var Wl=/^(?:(?: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])$/,Yl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Tl=(r)=>{let t=nt(r??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Rl=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Vl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Sl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Eo=/^[A-Za-z0-9_-]*$/,XO=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,jO=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ql=/^\+[1-9]\d{6,14}$/,dE="(?:(?:\\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])))",Kl=new RegExp(`^${dE}$`);function xE(r){return typeof r.precision==="number"?r.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":r.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${r.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Hl(r){return new RegExp(`^${xE(r)}$`)}function Ml(r){let t=xE({precision:r.precision}),u=["Z"];if(r.local)u.push("");if(r.offset)u.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let D=`${t}(?:${u.join("|")})`;return new RegExp(`^${dE}T(?:${D})$`)}var Zl=(r)=>{let t=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ll=/^-?\d+n?$/,Pl=/^-?\d+$/,lD=/^-?\d+(?:\.\d+)?$/,kl=/^(?:true|false)$/i,dl=/^null$/i;var xl=/^undefined$/i;var pl=/^[^A-Z]*$/,al=/^[^a-z]*$/,GO=/^[0-9a-fA-F]*$/;function mD(r,t){return new RegExp(`^[A-Za-z0-9+/]{${r}}${t}$`)}function cD(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var WO=/^[0-9a-fA-F]{32}$/,YO=mD(22,"=="),TO=cD(22),RO=/^[0-9a-fA-F]{40}$/,VO=mD(27,"="),SO=cD(27),QO=/^[0-9a-fA-F]{64}$/,KO=mD(43,"="),HO=cD(43),MO=/^[0-9a-fA-F]{96}$/,ZO=mD(64,""),LO=cD(64),PO=/^[0-9a-fA-F]{128}$/,kO=mD(86,"=="),dO=cD(86);var br=I("$ZodCheck",(r,t)=>{var u;r._zod??(r._zod={}),r._zod.def=t,(u=r._zod).onattach??(u.onattach=[])}),aE={number:"number",bigint:"bigint",object:"date"},Fo=I("$ZodCheckLessThan",(r,t)=>{br.init(r,t);let u=aE[typeof t.value];r._zod.onattach.push((D)=>{let i=D._zod.bag,n=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<n)if(t.inclusive)i.maximum=t.value;else i.exclusiveMaximum=t.value}),r._zod.check=(D)=>{if(t.inclusive?D.value<=t.value:D.value<t.value)return;D.issues.push({origin:u,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:D.value,inclusive:t.inclusive,inst:r,continue:!t.abort})}}),go=I("$ZodCheckGreaterThan",(r,t)=>{br.init(r,t);let u=aE[typeof t.value];r._zod.onattach.push((D)=>{let i=D._zod.bag,n=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>n)if(t.inclusive)i.minimum=t.value;else i.exclusiveMinimum=t.value}),r._zod.check=(D)=>{if(t.inclusive?D.value>=t.value:D.value>t.value)return;D.issues.push({origin:u,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:D.value,inclusive:t.inclusive,inst:r,continue:!t.abort})}}),sl=I("$ZodCheckMultipleOf",(r,t)=>{br.init(r,t),r._zod.onattach.push((u)=>{var D;(D=u._zod.bag).multipleOf??(D.multipleOf=t.value)}),r._zod.check=(u)=>{if(typeof u.value!==typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");if(typeof u.value==="bigint"?u.value%t.value===BigInt(0):vl(u.value,t.value)===0)return;u.issues.push({origin:typeof u.value,code:"not_multiple_of",divisor:t.value,input:u.value,inst:r,continue:!t.abort})}}),rm=I("$ZodCheckNumberFormat",(r,t)=>{br.init(r,t),t.format=t.format||"float64";let u=t.format?.includes("int"),D=u?"int":"number",[i,n]=Cl[t.format];r._zod.onattach.push((o)=>{let e=o._zod.bag;if(e.format=t.format,e.minimum=i,e.maximum=n,u)e.pattern=Pl}),r._zod.check=(o)=>{let e=o.value;if(u){if(!Number.isInteger(e)){o.issues.push({expected:D,format:t.format,code:"invalid_type",continue:!1,input:e,inst:r});return}if(!Number.isSafeInteger(e)){if(e>0)o.issues.push({input:e,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:D,inclusive:!0,continue:!t.abort});else o.issues.push({input:e,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:D,inclusive:!0,continue:!t.abort});return}}if(e<i)o.issues.push({origin:"number",input:e,code:"too_small",minimum:i,inclusive:!0,inst:r,continue:!t.abort});if(e>n)o.issues.push({origin:"number",input:e,code:"too_big",maximum:n,inclusive:!0,inst:r,continue:!t.abort})}}),tm=I("$ZodCheckBigIntFormat",(r,t)=>{br.init(r,t);let[u,D]=_l[t.format];r._zod.onattach.push((i)=>{let n=i._zod.bag;n.format=t.format,n.minimum=u,n.maximum=D}),r._zod.check=(i)=>{let n=i.value;if(n<u)i.issues.push({origin:"bigint",input:n,code:"too_small",minimum:u,inclusive:!0,inst:r,continue:!t.abort});if(n>D)i.issues.push({origin:"bigint",input:n,code:"too_big",maximum:D,inclusive:!0,inst:r,continue:!t.abort})}}),im=I("$ZodCheckMaxSize",(r,t)=>{var u;br.init(r,t),(u=r._zod.def).when??(u.when=(D)=>{let i=D.value;return!dt(i)&&i.size!==void 0}),r._zod.onattach.push((D)=>{let i=D._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<i)D._zod.bag.maximum=t.maximum}),r._zod.check=(D)=>{let i=D.value;if(i.size<=t.maximum)return;D.issues.push({origin:nD(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:r,continue:!t.abort})}}),um=I("$ZodCheckMinSize",(r,t)=>{var u;br.init(r,t),(u=r._zod.def).when??(u.when=(D)=>{let i=D.value;return!dt(i)&&i.size!==void 0}),r._zod.onattach.push((D)=>{let i=D._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>i)D._zod.bag.minimum=t.minimum}),r._zod.check=(D)=>{let i=D.value;if(i.size>=t.minimum)return;D.issues.push({origin:nD(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:r,continue:!t.abort})}}),Dm=I("$ZodCheckSizeEquals",(r,t)=>{var u;br.init(r,t),(u=r._zod.def).when??(u.when=(D)=>{let i=D.value;return!dt(i)&&i.size!==void 0}),r._zod.onattach.push((D)=>{let i=D._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),r._zod.check=(D)=>{let i=D.value,n=i.size;if(n===t.size)return;let o=n>t.size;D.issues.push({origin:nD(i),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:D.value,inst:r,continue:!t.abort})}}),nm=I("$ZodCheckMaxLength",(r,t)=>{var u;br.init(r,t),(u=r._zod.def).when??(u.when=(D)=>{let i=D.value;return!dt(i)&&i.length!==void 0}),r._zod.onattach.push((D)=>{let i=D._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<i)D._zod.bag.maximum=t.maximum}),r._zod.check=(D)=>{let i=D.value;if(i.length<=t.maximum)return;let o=oD(i);D.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:r,continue:!t.abort})}}),om=I("$ZodCheckMinLength",(r,t)=>{var u;br.init(r,t),(u=r._zod.def).when??(u.when=(D)=>{let i=D.value;return!dt(i)&&i.length!==void 0}),r._zod.onattach.push((D)=>{let i=D._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>i)D._zod.bag.minimum=t.minimum}),r._zod.check=(D)=>{let i=D.value;if(i.length>=t.minimum)return;let o=oD(i);D.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:r,continue:!t.abort})}}),em=I("$ZodCheckLengthEquals",(r,t)=>{var u;br.init(r,t),(u=r._zod.def).when??(u.when=(D)=>{let i=D.value;return!dt(i)&&i.length!==void 0}),r._zod.onattach.push((D)=>{let i=D._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),r._zod.check=(D)=>{let i=D.value,n=i.length;if(n===t.length)return;let o=oD(i),e=n>t.length;D.issues.push({origin:o,...e?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:D.value,inst:r,continue:!t.abort})}}),si=I("$ZodCheckStringFormat",(r,t)=>{var u,D;if(br.init(r,t),r._zod.onattach.push((i)=>{let n=i._zod.bag;if(n.format=t.format,t.pattern)n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern)}),t.pattern)(u=r._zod).check??(u.check=(i)=>{if(t.pattern.lastIndex=0,t.pattern.test(i.value))return;i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:r,continue:!t.abort})});else(D=r._zod).check??(D.check=()=>{})}),fm=I("$ZodCheckRegex",(r,t)=>{si.init(r,t),r._zod.check=(u)=>{if(t.pattern.lastIndex=0,t.pattern.test(u.value))return;u.issues.push({origin:"string",code:"invalid_format",format:"regex",input:u.value,pattern:t.pattern.toString(),inst:r,continue:!t.abort})}}),$m=I("$ZodCheckLowerCase",(r,t)=>{t.pattern??(t.pattern=pl),si.init(r,t)}),lm=I("$ZodCheckUpperCase",(r,t)=>{t.pattern??(t.pattern=al),si.init(r,t)}),mm=I("$ZodCheckIncludes",(r,t)=>{br.init(r,t);let u=nt(t.includes),D=new RegExp(typeof t.position==="number"?`^.{${t.position}}${u}`:u);t.pattern=D,r._zod.onattach.push((i)=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(D)}),r._zod.check=(i)=>{if(i.value.includes(t.includes,t.position))return;i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:r,continue:!t.abort})}}),cm=I("$ZodCheckStartsWith",(r,t)=>{br.init(r,t);let u=new RegExp(`^${nt(t.prefix)}.*`);t.pattern??(t.pattern=u),r._zod.onattach.push((D)=>{let i=D._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(u)}),r._zod.check=(D)=>{if(D.value.startsWith(t.prefix))return;D.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:D.value,inst:r,continue:!t.abort})}}),vm=I("$ZodCheckEndsWith",(r,t)=>{br.init(r,t);let u=new RegExp(`.*${nt(t.suffix)}$`);t.pattern??(t.pattern=u),r._zod.onattach.push((D)=>{let i=D._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(u)}),r._zod.check=(D)=>{if(D.value.endsWith(t.suffix))return;D.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:D.value,inst:r,continue:!t.abort})}});function pE(r,t,u){if(r.issues.length)t.issues.push(...ar(u,r.issues))}var Em=I("$ZodCheckProperty",(r,t)=>{br.init(r,t),r._zod.check=(u)=>{let D=t.schema._zod.run({value:u.value[t.property],issues:[]},{});if(D instanceof Promise)return D.then((i)=>pE(i,u,t.property));pE(D,u,t.property);return}}),Fm=I("$ZodCheckMimeType",(r,t)=>{br.init(r,t);let u=new Set(t.mime);r._zod.onattach.push((D)=>{D._zod.bag.mime=t.mime}),r._zod.check=(D)=>{if(u.has(D.value.type))return;D.issues.push({code:"invalid_value",values:t.mime,input:D.value.type,inst:r,continue:!t.abort})}}),gm=I("$ZodCheckOverwrite",(r,t)=>{br.init(r,t),r._zod.check=(u)=>{u.value=t.tx(u.value)}});class wo{constructor(r=[]){if(this.content=[],this.indent=0,this)this.args=r}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r==="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}let u=r.split(`
|
|
290
|
+
`).filter((n)=>n),D=Math.min(...u.map((n)=>n.length-n.trimStart().length)),i=u.map((n)=>n.slice(D)).map((n)=>" ".repeat(this.indent*2)+n);for(let n of i)this.content.push(n)}compile(){let r=Function,t=this?.args,D=[...(this?.content??[""]).map((i)=>` ${i}`)];return new r(...t,D.join(`
|
|
291
|
+
`))}}var wm={major:4,minor:3,patch:6};var x=I("$ZodType",(r,t)=>{var u;r??(r={}),r._zod.def=t,r._zod.bag=r._zod.bag||{},r._zod.version=wm;let D=[...r._zod.def.checks??[]];if(r._zod.traits.has("$ZodCheck"))D.unshift(r);for(let i of D)for(let n of i._zod.onattach)n(r);if(D.length===0)(u=r._zod).deferred??(u.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let i=(o,e,f)=>{let $=at(o),l;for(let m of e){if(m._zod.def.when){if(!m._zod.def.when(o))continue}else if($)continue;let c=o.issues.length,g=m._zod.check(o);if(g instanceof Promise&&f?.async===!1)throw new Ct;if(l||g instanceof Promise)l=(l??Promise.resolve()).then(async()=>{if(await g,o.issues.length===c)return;if(!$)$=at(o,c)});else{if(o.issues.length===c)continue;if(!$)$=at(o,c)}}if(l)return l.then(()=>{return o});return o},n=(o,e,f)=>{if(at(o))return o.aborted=!0,o;let $=i(e,D,f);if($ instanceof Promise){if(f.async===!1)throw new Ct;return $.then((l)=>r._zod.parse(l,f))}return r._zod.parse($,f)};r._zod.run=(o,e)=>{if(e.skipChecks)return r._zod.parse(o,e);if(e.direction==="backward"){let $=r._zod.parse({value:o.value,issues:[]},{...e,skipChecks:!0});if($ instanceof Promise)return $.then((l)=>{return n(l,o,e)});return n($,o,e)}let f=r._zod.parse(o,e);if(f instanceof Promise){if(e.async===!1)throw new Ct;return f.then(($)=>i($,D,e))}return i(f,D,e)}}ur(r,"~standard",()=>({validate:(i)=>{try{let n=Ol(r,i);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return yl(r,i).then((o)=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),_i=I("$ZodString",(r,t)=>{x.init(r,t),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??Zl(r._zod.bag),r._zod.parse=(u,D)=>{if(t.coerce)try{u.value=String(u.value)}catch(i){}if(typeof u.value==="string")return u;return u.issues.push({expected:"string",code:"invalid_type",input:u.value,inst:r}),u}}),Fr=I("$ZodStringFormat",(r,t)=>{si.init(r,t),_i.init(r,t)}),Cm=I("$ZodGUID",(r,t)=>{t.pattern??(t.pattern=Xl),Fr.init(r,t)}),_m=I("$ZodUUID",(r,t)=>{if(t.version){let D={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(D===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ci(D))}else t.pattern??(t.pattern=Ci());Fr.init(r,t)}),Im=I("$ZodEmail",(r,t)=>{t.pattern??(t.pattern=jl),Fr.init(r,t)}),Um=I("$ZodURL",(r,t)=>{Fr.init(r,t),r._zod.check=(u)=>{try{let D=u.value.trim(),i=new URL(D);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(i.hostname))u.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:u.value,inst:r,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol))u.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:u.value,inst:r,continue:!t.abort})}if(t.normalize)u.value=i.href;else u.value=D;return}catch(D){u.issues.push({code:"invalid_format",format:"url",input:u.value,inst:r,continue:!t.abort})}}}),Om=I("$ZodEmoji",(r,t)=>{t.pattern??(t.pattern=Gl()),Fr.init(r,t)}),ym=I("$ZodNanoID",(r,t)=>{t.pattern??(t.pattern=Jl),Fr.init(r,t)}),Nm=I("$ZodCUID",(r,t)=>{t.pattern??(t.pattern=Nl),Fr.init(r,t)}),Bm=I("$ZodCUID2",(r,t)=>{t.pattern??(t.pattern=Bl),Fr.init(r,t)}),qm=I("$ZodULID",(r,t)=>{t.pattern??(t.pattern=ql),Fr.init(r,t)}),hm=I("$ZodXID",(r,t)=>{t.pattern??(t.pattern=hl),Fr.init(r,t)}),zm=I("$ZodKSUID",(r,t)=>{t.pattern??(t.pattern=zl),Fr.init(r,t)}),Jm=I("$ZodISODateTime",(r,t)=>{t.pattern??(t.pattern=Ml(t)),Fr.init(r,t)}),Am=I("$ZodISODate",(r,t)=>{t.pattern??(t.pattern=Kl),Fr.init(r,t)}),Xm=I("$ZodISOTime",(r,t)=>{t.pattern??(t.pattern=Hl(t)),Fr.init(r,t)}),jm=I("$ZodISODuration",(r,t)=>{t.pattern??(t.pattern=Al),Fr.init(r,t)}),Gm=I("$ZodIPv4",(r,t)=>{t.pattern??(t.pattern=Wl),Fr.init(r,t),r._zod.bag.format="ipv4"}),Wm=I("$ZodIPv6",(r,t)=>{t.pattern??(t.pattern=Yl),Fr.init(r,t),r._zod.bag.format="ipv6",r._zod.check=(u)=>{try{new URL(`http://[${u.value}]`)}catch{u.issues.push({code:"invalid_format",format:"ipv6",input:u.value,inst:r,continue:!t.abort})}}}),Ym=I("$ZodMAC",(r,t)=>{t.pattern??(t.pattern=Tl(t.delimiter)),Fr.init(r,t),r._zod.bag.format="mac"}),Tm=I("$ZodCIDRv4",(r,t)=>{t.pattern??(t.pattern=Rl),Fr.init(r,t)}),Rm=I("$ZodCIDRv6",(r,t)=>{t.pattern??(t.pattern=Vl),Fr.init(r,t),r._zod.check=(u)=>{let D=u.value.split("/");try{if(D.length!==2)throw new Error;let[i,n]=D;if(!n)throw new Error;let o=Number(n);if(`${o}`!==n)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{u.issues.push({code:"invalid_format",format:"cidrv6",input:u.value,inst:r,continue:!t.abort})}}});function Vm(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}var Sm=I("$ZodBase64",(r,t)=>{t.pattern??(t.pattern=Sl),Fr.init(r,t),r._zod.bag.contentEncoding="base64",r._zod.check=(u)=>{if(Vm(u.value))return;u.issues.push({code:"invalid_format",format:"base64",input:u.value,inst:r,continue:!t.abort})}});function m3(r){if(!Eo.test(r))return!1;let t=r.replace(/[-_]/g,(D)=>D==="-"?"+":"/"),u=t.padEnd(Math.ceil(t.length/4)*4,"=");return Vm(u)}var Qm=I("$ZodBase64URL",(r,t)=>{t.pattern??(t.pattern=Eo),Fr.init(r,t),r._zod.bag.contentEncoding="base64url",r._zod.check=(u)=>{if(m3(u.value))return;u.issues.push({code:"invalid_format",format:"base64url",input:u.value,inst:r,continue:!t.abort})}}),Km=I("$ZodE164",(r,t)=>{t.pattern??(t.pattern=Ql),Fr.init(r,t)});function c3(r,t=null){try{let u=r.split(".");if(u.length!==3)return!1;let[D]=u;if(!D)return!1;let i=JSON.parse(atob(D));if("typ"in i&&i?.typ!=="JWT")return!1;if(!i.alg)return!1;if(t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}var Hm=I("$ZodJWT",(r,t)=>{Fr.init(r,t),r._zod.check=(u)=>{if(c3(u.value,t.alg))return;u.issues.push({code:"invalid_format",format:"jwt",input:u.value,inst:r,continue:!t.abort})}}),Mm=I("$ZodCustomStringFormat",(r,t)=>{Fr.init(r,t),r._zod.check=(u)=>{if(t.fn(u.value))return;u.issues.push({code:"invalid_format",format:t.format,input:u.value,inst:r,continue:!t.abort})}}),Oo=I("$ZodNumber",(r,t)=>{x.init(r,t),r._zod.pattern=r._zod.bag.pattern??lD,r._zod.parse=(u,D)=>{if(t.coerce)try{u.value=Number(u.value)}catch(o){}let i=u.value;if(typeof i==="number"&&!Number.isNaN(i)&&Number.isFinite(i))return u;let n=typeof i==="number"?Number.isNaN(i)?"NaN":!Number.isFinite(i)?"Infinity":void 0:void 0;return u.issues.push({expected:"number",code:"invalid_type",input:i,inst:r,...n?{received:n}:{}}),u}}),Zm=I("$ZodNumberFormat",(r,t)=>{rm.init(r,t),Oo.init(r,t)}),vD=I("$ZodBoolean",(r,t)=>{x.init(r,t),r._zod.pattern=kl,r._zod.parse=(u,D)=>{if(t.coerce)try{u.value=Boolean(u.value)}catch(n){}let i=u.value;if(typeof i==="boolean")return u;return u.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:r}),u}}),yo=I("$ZodBigInt",(r,t)=>{x.init(r,t),r._zod.pattern=Ll,r._zod.parse=(u,D)=>{if(t.coerce)try{u.value=BigInt(u.value)}catch(i){}if(typeof u.value==="bigint")return u;return u.issues.push({expected:"bigint",code:"invalid_type",input:u.value,inst:r}),u}}),Lm=I("$ZodBigIntFormat",(r,t)=>{tm.init(r,t),yo.init(r,t)}),Pm=I("$ZodSymbol",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{let i=u.value;if(typeof i==="symbol")return u;return u.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:r}),u}}),km=I("$ZodUndefined",(r,t)=>{x.init(r,t),r._zod.pattern=xl,r._zod.values=new Set([void 0]),r._zod.optin="optional",r._zod.optout="optional",r._zod.parse=(u,D)=>{let i=u.value;if(typeof i==="undefined")return u;return u.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:r}),u}}),dm=I("$ZodNull",(r,t)=>{x.init(r,t),r._zod.pattern=dl,r._zod.values=new Set([null]),r._zod.parse=(u,D)=>{let i=u.value;if(i===null)return u;return u.issues.push({expected:"null",code:"invalid_type",input:i,inst:r}),u}}),xm=I("$ZodAny",(r,t)=>{x.init(r,t),r._zod.parse=(u)=>u}),pm=I("$ZodUnknown",(r,t)=>{x.init(r,t),r._zod.parse=(u)=>u}),am=I("$ZodNever",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{return u.issues.push({expected:"never",code:"invalid_type",input:u.value,inst:r}),u}}),sm=I("$ZodVoid",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{let i=u.value;if(typeof i==="undefined")return u;return u.issues.push({expected:"void",code:"invalid_type",input:i,inst:r}),u}}),r0=I("$ZodDate",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{if(t.coerce)try{u.value=new Date(u.value)}catch(e){}let i=u.value,n=i instanceof Date;if(n&&!Number.isNaN(i.getTime()))return u;return u.issues.push({expected:"date",code:"invalid_type",input:i,...n?{received:"Invalid Date"}:{},inst:r}),u}});function r3(r,t,u){if(r.issues.length)t.issues.push(...ar(u,r.issues));t.value[u]=r.value}var t0=I("$ZodArray",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{let i=u.value;if(!Array.isArray(i))return u.issues.push({expected:"array",code:"invalid_type",input:i,inst:r}),u;u.value=Array(i.length);let n=[];for(let o=0;o<i.length;o++){let e=i[o],f=t.element._zod.run({value:e,issues:[]},D);if(f instanceof Promise)n.push(f.then(($)=>r3($,u,o)));else r3(f,u,o)}if(n.length)return Promise.all(n).then(()=>u);return u}});function Uo(r,t,u,D,i){if(r.issues.length){if(i&&!(u in D))return;t.issues.push(...ar(u,r.issues))}if(r.value===void 0){if(u in D)t.value[u]=void 0}else t.value[u]=r.value}function v3(r){let t=Object.keys(r.shape);for(let D of t)if(!r.shape?.[D]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${D}": expected a Zod schema`);let u=bl(r.shape);return{...r,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(u)}}function E3(r,t,u,D,i,n){let o=[],e=i.keySet,f=i.catchall._zod,$=f.def.type,l=f.optout==="optional";for(let m in t){if(e.has(m))continue;if($==="never"){o.push(m);continue}let c=f.run({value:t[m],issues:[]},D);if(c instanceof Promise)r.push(c.then((g)=>Uo(g,u,m,t,l)));else Uo(c,u,m,t,l)}if(o.length)u.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:n});if(!r.length)return u;return Promise.all(r).then(()=>{return u})}var F3=I("$ZodObject",(r,t)=>{if(x.init(r,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let f={...e};return Object.defineProperty(t,"shape",{value:f}),f}})}let D=Pi(()=>v3(t));ur(r._zod,"propValues",()=>{let e=t.shape,f={};for(let $ in e){let l=e[$]._zod;if(l.values){f[$]??(f[$]=new Set);for(let m of l.values)f[$].add(m)}}return f});let i=bi,n=t.catchall,o;r._zod.parse=(e,f)=>{o??(o=D.value);let $=e.value;if(!i($))return e.issues.push({expected:"object",code:"invalid_type",input:$,inst:r}),e;e.value={};let l=[],m=o.shape;for(let c of o.keys){let g=m[c],_=g._zod.optout==="optional",q=g._zod.run({value:$[c],issues:[]},f);if(q instanceof Promise)l.push(q.then((y)=>Uo(y,e,c,$,_)));else Uo(q,e,c,$,_)}if(!n)return l.length?Promise.all(l).then(()=>e):e;return E3(l,$,e,f,D.value,r)}}),i0=I("$ZodObjectJIT",(r,t)=>{F3.init(r,t);let u=r._zod.parse,D=Pi(()=>v3(t)),i=(c)=>{let g=new wo(["shape","payload","ctx"]),_=D.value,q=(z)=>{let A=io(z);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};g.write("const input = payload.value;");let y=Object.create(null),N=0;for(let z of _.keys)y[z]=`key_${N++}`;g.write("const newResult = {};");for(let z of _.keys){let A=y[z],K=io(z),p=c[z]?._zod?.optout==="optional";if(g.write(`const ${A} = ${q(z)};`),p)g.write(`
|
|
292
|
+
if (${A}.issues.length) {
|
|
293
|
+
if (${K} in input) {
|
|
294
|
+
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
295
|
+
...iss,
|
|
296
|
+
path: iss.path ? [${K}, ...iss.path] : [${K}]
|
|
297
|
+
})));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (${A}.value === undefined) {
|
|
302
|
+
if (${K} in input) {
|
|
303
|
+
newResult[${K}] = undefined;
|
|
304
|
+
}
|
|
305
|
+
} else {
|
|
306
|
+
newResult[${K}] = ${A}.value;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
`);else g.write(`
|
|
310
|
+
if (${A}.issues.length) {
|
|
311
|
+
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
312
|
+
...iss,
|
|
313
|
+
path: iss.path ? [${K}, ...iss.path] : [${K}]
|
|
314
|
+
})));
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (${A}.value === undefined) {
|
|
318
|
+
if (${K} in input) {
|
|
319
|
+
newResult[${K}] = undefined;
|
|
320
|
+
}
|
|
321
|
+
} else {
|
|
322
|
+
newResult[${K}] = ${A}.value;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
`)}g.write("payload.value = newResult;"),g.write("return payload;");let R=g.compile();return(z,A)=>R(c,z,A)},n,o=bi,e=!rD.jitless,$=e&&Fl.value,l=t.catchall,m;r._zod.parse=(c,g)=>{m??(m=D.value);let _=c.value;if(!o(_))return c.issues.push({expected:"object",code:"invalid_type",input:_,inst:r}),c;if(e&&$&&g?.async===!1&&g.jitless!==!0){if(!n)n=i(t.shape);if(c=n(c,g),!l)return c;return E3([],_,c,g,m,r)}return u(c,g)}});function t3(r,t,u,D){for(let n of r)if(n.issues.length===0)return t.value=n.value,t;let i=r.filter((n)=>!at(n));if(i.length===1)return t.value=i[0].value,i[0];return t.issues.push({code:"invalid_union",input:t.value,inst:u,errors:r.map((n)=>n.issues.map((o)=>Pr(o,D,hr())))}),t}var ED=I("$ZodUnion",(r,t)=>{x.init(r,t),ur(r._zod,"optin",()=>t.options.some((i)=>i._zod.optin==="optional")?"optional":void 0),ur(r._zod,"optout",()=>t.options.some((i)=>i._zod.optout==="optional")?"optional":void 0),ur(r._zod,"values",()=>{if(t.options.every((i)=>i._zod.values))return new Set(t.options.flatMap((i)=>Array.from(i._zod.values)));return}),ur(r._zod,"pattern",()=>{if(t.options.every((i)=>i._zod.pattern)){let i=t.options.map((n)=>n._zod.pattern);return new RegExp(`^(${i.map((n)=>uD(n.source)).join("|")})$`)}return});let u=t.options.length===1,D=t.options[0]._zod.run;r._zod.parse=(i,n)=>{if(u)return D(i,n);let o=!1,e=[];for(let f of t.options){let $=f._zod.run({value:i.value,issues:[]},n);if($ instanceof Promise)e.push($),o=!0;else{if($.issues.length===0)return $;e.push($)}}if(!o)return t3(e,i,r,n);return Promise.all(e).then((f)=>{return t3(f,i,r,n)})}});function i3(r,t,u,D){let i=r.filter((n)=>n.issues.length===0);if(i.length===1)return t.value=i[0].value,t;if(i.length===0)t.issues.push({code:"invalid_union",input:t.value,inst:u,errors:r.map((n)=>n.issues.map((o)=>Pr(o,D,hr())))});else t.issues.push({code:"invalid_union",input:t.value,inst:u,errors:[],inclusive:!1});return t}var u0=I("$ZodXor",(r,t)=>{ED.init(r,t),t.inclusive=!1;let u=t.options.length===1,D=t.options[0]._zod.run;r._zod.parse=(i,n)=>{if(u)return D(i,n);let o=!1,e=[];for(let f of t.options){let $=f._zod.run({value:i.value,issues:[]},n);if($ instanceof Promise)e.push($),o=!0;else e.push($)}if(!o)return i3(e,i,r,n);return Promise.all(e).then((f)=>{return i3(f,i,r,n)})}}),D0=I("$ZodDiscriminatedUnion",(r,t)=>{t.inclusive=!1,ED.init(r,t);let u=r._zod.parse;ur(r._zod,"propValues",()=>{let i={};for(let n of t.options){let o=n._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[e,f]of Object.entries(o)){if(!i[e])i[e]=new Set;for(let $ of f)i[e].add($)}}return i});let D=Pi(()=>{let i=t.options,n=new Map;for(let o of i){let e=o._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let f of e){if(n.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);n.set(f,o)}}return n});r._zod.parse=(i,n)=>{let o=i.value;if(!bi(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:r}),i;let e=D.value.get(o?.[t.discriminator]);if(e)return e._zod.run(i,n);if(t.unionFallback)return u(i,n);return i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:r}),i}}),n0=I("$ZodIntersection",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{let i=u.value,n=t.left._zod.run({value:i,issues:[]},D),o=t.right._zod.run({value:i,issues:[]},D);if(n instanceof Promise||o instanceof Promise)return Promise.all([n,o]).then(([f,$])=>{return u3(u,f,$)});return u3(u,n,o)}});function bm(r,t){if(r===t)return{valid:!0,data:r};if(r instanceof Date&&t instanceof Date&&+r===+t)return{valid:!0,data:r};if(pt(r)&&pt(t)){let u=Object.keys(t),D=Object.keys(r).filter((n)=>u.indexOf(n)!==-1),i={...r,...t};for(let n of D){let o=bm(r[n],t[n]);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};i[n]=o.data}return{valid:!0,data:i}}if(Array.isArray(r)&&Array.isArray(t)){if(r.length!==t.length)return{valid:!1,mergeErrorPath:[]};let u=[];for(let D=0;D<r.length;D++){let i=r[D],n=t[D],o=bm(i,n);if(!o.valid)return{valid:!1,mergeErrorPath:[D,...o.mergeErrorPath]};u.push(o.data)}return{valid:!0,data:u}}return{valid:!1,mergeErrorPath:[]}}function u3(r,t,u){let D=new Map,i;for(let e of t.issues)if(e.code==="unrecognized_keys"){i??(i=e);for(let f of e.keys){if(!D.has(f))D.set(f,{});D.get(f).l=!0}}else r.issues.push(e);for(let e of u.issues)if(e.code==="unrecognized_keys")for(let f of e.keys){if(!D.has(f))D.set(f,{});D.get(f).r=!0}else r.issues.push(e);let n=[...D].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(n.length&&i)r.issues.push({...i,keys:n});if(at(r))return r;let o=bm(t.value,u.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return r.value=o.data,r}var No=I("$ZodTuple",(r,t)=>{x.init(r,t);let u=t.items;r._zod.parse=(D,i)=>{let n=D.value;if(!Array.isArray(n))return D.issues.push({input:n,inst:r,expected:"tuple",code:"invalid_type"}),D;D.value=[];let o=[],e=[...u].reverse().findIndex((l)=>l._zod.optin!=="optional"),f=e===-1?0:u.length-e;if(!t.rest){let l=n.length>u.length,m=n.length<f-1;if(l||m)return D.issues.push({...l?{code:"too_big",maximum:u.length,inclusive:!0}:{code:"too_small",minimum:u.length},input:n,inst:r,origin:"array"}),D}let $=-1;for(let l of u){if($++,$>=n.length){if($>=f)continue}let m=l._zod.run({value:n[$],issues:[]},i);if(m instanceof Promise)o.push(m.then((c)=>bo(c,D,$)));else bo(m,D,$)}if(t.rest){let l=n.slice(u.length);for(let m of l){$++;let c=t.rest._zod.run({value:m,issues:[]},i);if(c instanceof Promise)o.push(c.then((g)=>bo(g,D,$)));else bo(c,D,$)}}if(o.length)return Promise.all(o).then(()=>D);return D}});function bo(r,t,u){if(r.issues.length)t.issues.push(...ar(u,r.issues));t.value[u]=r.value}var o0=I("$ZodRecord",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{let i=u.value;if(!pt(i))return u.issues.push({expected:"record",code:"invalid_type",input:i,inst:r}),u;let n=[],o=t.keyType._zod.values;if(o){u.value={};let e=new Set;for(let $ of o)if(typeof $==="string"||typeof $==="number"||typeof $==="symbol"){e.add(typeof $==="number"?$.toString():$);let l=t.valueType._zod.run({value:i[$],issues:[]},D);if(l instanceof Promise)n.push(l.then((m)=>{if(m.issues.length)u.issues.push(...ar($,m.issues));u.value[$]=m.value}));else{if(l.issues.length)u.issues.push(...ar($,l.issues));u.value[$]=l.value}}let f;for(let $ in i)if(!e.has($))f=f??[],f.push($);if(f&&f.length>0)u.issues.push({code:"unrecognized_keys",input:i,inst:r,keys:f})}else{u.value={};for(let e of Reflect.ownKeys(i)){if(e==="__proto__")continue;let f=t.keyType._zod.run({value:e,issues:[]},D);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof e==="string"&&lD.test(e)&&f.issues.length){let m=t.keyType._zod.run({value:Number(e),issues:[]},D);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(m.issues.length===0)f=m}if(f.issues.length){if(t.mode==="loose")u.value[e]=i[e];else u.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map((m)=>Pr(m,D,hr())),input:e,path:[e],inst:r});continue}let l=t.valueType._zod.run({value:i[e],issues:[]},D);if(l instanceof Promise)n.push(l.then((m)=>{if(m.issues.length)u.issues.push(...ar(e,m.issues));u.value[f.value]=m.value}));else{if(l.issues.length)u.issues.push(...ar(e,l.issues));u.value[f.value]=l.value}}}if(n.length)return Promise.all(n).then(()=>u);return u}}),e0=I("$ZodMap",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{let i=u.value;if(!(i instanceof Map))return u.issues.push({expected:"map",code:"invalid_type",input:i,inst:r}),u;let n=[];u.value=new Map;for(let[o,e]of i){let f=t.keyType._zod.run({value:o,issues:[]},D),$=t.valueType._zod.run({value:e,issues:[]},D);if(f instanceof Promise||$ instanceof Promise)n.push(Promise.all([f,$]).then(([l,m])=>{D3(l,m,u,o,i,r,D)}));else D3(f,$,u,o,i,r,D)}if(n.length)return Promise.all(n).then(()=>u);return u}});function D3(r,t,u,D,i,n,o){if(r.issues.length)if(DD.has(typeof D))u.issues.push(...ar(D,r.issues));else u.issues.push({code:"invalid_key",origin:"map",input:i,inst:n,issues:r.issues.map((e)=>Pr(e,o,hr()))});if(t.issues.length)if(DD.has(typeof D))u.issues.push(...ar(D,t.issues));else u.issues.push({origin:"map",code:"invalid_element",input:i,inst:n,key:D,issues:t.issues.map((e)=>Pr(e,o,hr()))});u.value.set(r.value,t.value)}var f0=I("$ZodSet",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{let i=u.value;if(!(i instanceof Set))return u.issues.push({input:i,inst:r,expected:"set",code:"invalid_type"}),u;let n=[];u.value=new Set;for(let o of i){let e=t.valueType._zod.run({value:o,issues:[]},D);if(e instanceof Promise)n.push(e.then((f)=>n3(f,u)));else n3(e,u)}if(n.length)return Promise.all(n).then(()=>u);return u}});function n3(r,t){if(r.issues.length)t.issues.push(...r.issues);t.value.add(r.value)}var $0=I("$ZodEnum",(r,t)=>{x.init(r,t);let u=iD(t.entries),D=new Set(u);r._zod.values=D,r._zod.pattern=new RegExp(`^(${u.filter((i)=>DD.has(typeof i)).map((i)=>typeof i==="string"?nt(i):i.toString()).join("|")})$`),r._zod.parse=(i,n)=>{let o=i.value;if(D.has(o))return i;return i.issues.push({code:"invalid_value",values:u,input:o,inst:r}),i}}),l0=I("$ZodLiteral",(r,t)=>{if(x.init(r,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let u=new Set(t.values);r._zod.values=u,r._zod.pattern=new RegExp(`^(${t.values.map((D)=>typeof D==="string"?nt(D):D?nt(D.toString()):String(D)).join("|")})$`),r._zod.parse=(D,i)=>{let n=D.value;if(u.has(n))return D;return D.issues.push({code:"invalid_value",values:t.values,input:n,inst:r}),D}}),m0=I("$ZodFile",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{let i=u.value;if(i instanceof File)return u;return u.issues.push({expected:"file",code:"invalid_type",input:i,inst:r}),u}}),c0=I("$ZodTransform",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{if(D.direction==="backward")throw new wi(r.constructor.name);let i=t.transform(u.value,u);if(D.async)return(i instanceof Promise?i:Promise.resolve(i)).then((o)=>{return u.value=o,u});if(i instanceof Promise)throw new Ct;return u.value=i,u}});function o3(r,t){if(r.issues.length&&t===void 0)return{issues:[],value:void 0};return r}var Bo=I("$ZodOptional",(r,t)=>{x.init(r,t),r._zod.optin="optional",r._zod.optout="optional",ur(r._zod,"values",()=>{return t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0}),ur(r._zod,"pattern",()=>{let u=t.innerType._zod.pattern;return u?new RegExp(`^(${uD(u.source)})?$`):void 0}),r._zod.parse=(u,D)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(u,D);if(i instanceof Promise)return i.then((n)=>o3(n,u.value));return o3(i,u.value)}if(u.value===void 0)return u;return t.innerType._zod.run(u,D)}}),v0=I("$ZodExactOptional",(r,t)=>{Bo.init(r,t),ur(r._zod,"values",()=>t.innerType._zod.values),ur(r._zod,"pattern",()=>t.innerType._zod.pattern),r._zod.parse=(u,D)=>{return t.innerType._zod.run(u,D)}}),E0=I("$ZodNullable",(r,t)=>{x.init(r,t),ur(r._zod,"optin",()=>t.innerType._zod.optin),ur(r._zod,"optout",()=>t.innerType._zod.optout),ur(r._zod,"pattern",()=>{let u=t.innerType._zod.pattern;return u?new RegExp(`^(${uD(u.source)}|null)$`):void 0}),ur(r._zod,"values",()=>{return t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0}),r._zod.parse=(u,D)=>{if(u.value===null)return u;return t.innerType._zod.run(u,D)}}),F0=I("$ZodDefault",(r,t)=>{x.init(r,t),r._zod.optin="optional",ur(r._zod,"values",()=>t.innerType._zod.values),r._zod.parse=(u,D)=>{if(D.direction==="backward")return t.innerType._zod.run(u,D);if(u.value===void 0)return u.value=t.defaultValue,u;let i=t.innerType._zod.run(u,D);if(i instanceof Promise)return i.then((n)=>e3(n,t));return e3(i,t)}});function e3(r,t){if(r.value===void 0)r.value=t.defaultValue;return r}var g0=I("$ZodPrefault",(r,t)=>{x.init(r,t),r._zod.optin="optional",ur(r._zod,"values",()=>t.innerType._zod.values),r._zod.parse=(u,D)=>{if(D.direction==="backward")return t.innerType._zod.run(u,D);if(u.value===void 0)u.value=t.defaultValue;return t.innerType._zod.run(u,D)}}),w0=I("$ZodNonOptional",(r,t)=>{x.init(r,t),ur(r._zod,"values",()=>{let u=t.innerType._zod.values;return u?new Set([...u].filter((D)=>D!==void 0)):void 0}),r._zod.parse=(u,D)=>{let i=t.innerType._zod.run(u,D);if(i instanceof Promise)return i.then((n)=>f3(n,r));return f3(i,r)}});function f3(r,t){if(!r.issues.length&&r.value===void 0)r.issues.push({code:"invalid_type",expected:"nonoptional",input:r.value,inst:t});return r}var b0=I("$ZodSuccess",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{if(D.direction==="backward")throw new wi("ZodSuccess");let i=t.innerType._zod.run(u,D);if(i instanceof Promise)return i.then((n)=>{return u.value=n.issues.length===0,u});return u.value=i.issues.length===0,u}}),C0=I("$ZodCatch",(r,t)=>{x.init(r,t),ur(r._zod,"optin",()=>t.innerType._zod.optin),ur(r._zod,"optout",()=>t.innerType._zod.optout),ur(r._zod,"values",()=>t.innerType._zod.values),r._zod.parse=(u,D)=>{if(D.direction==="backward")return t.innerType._zod.run(u,D);let i=t.innerType._zod.run(u,D);if(i instanceof Promise)return i.then((n)=>{if(u.value=n.value,n.issues.length)u.value=t.catchValue({...u,error:{issues:n.issues.map((o)=>Pr(o,D,hr()))},input:u.value}),u.issues=[];return u});if(u.value=i.value,i.issues.length)u.value=t.catchValue({...u,error:{issues:i.issues.map((n)=>Pr(n,D,hr()))},input:u.value}),u.issues=[];return u}}),_0=I("$ZodNaN",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{if(typeof u.value!=="number"||!Number.isNaN(u.value))return u.issues.push({input:u.value,inst:r,expected:"nan",code:"invalid_type"}),u;return u}}),I0=I("$ZodPipe",(r,t)=>{x.init(r,t),ur(r._zod,"values",()=>t.in._zod.values),ur(r._zod,"optin",()=>t.in._zod.optin),ur(r._zod,"optout",()=>t.out._zod.optout),ur(r._zod,"propValues",()=>t.in._zod.propValues),r._zod.parse=(u,D)=>{if(D.direction==="backward"){let n=t.out._zod.run(u,D);if(n instanceof Promise)return n.then((o)=>Co(o,t.in,D));return Co(n,t.in,D)}let i=t.in._zod.run(u,D);if(i instanceof Promise)return i.then((n)=>Co(n,t.out,D));return Co(i,t.out,D)}});function Co(r,t,u){if(r.issues.length)return r.aborted=!0,r;return t._zod.run({value:r.value,issues:r.issues},u)}var FD=I("$ZodCodec",(r,t)=>{x.init(r,t),ur(r._zod,"values",()=>t.in._zod.values),ur(r._zod,"optin",()=>t.in._zod.optin),ur(r._zod,"optout",()=>t.out._zod.optout),ur(r._zod,"propValues",()=>t.in._zod.propValues),r._zod.parse=(u,D)=>{if((D.direction||"forward")==="forward"){let n=t.in._zod.run(u,D);if(n instanceof Promise)return n.then((o)=>_o(o,t,D));return _o(n,t,D)}else{let n=t.out._zod.run(u,D);if(n instanceof Promise)return n.then((o)=>_o(o,t,D));return _o(n,t,D)}}});function _o(r,t,u){if(r.issues.length)return r.aborted=!0,r;if((u.direction||"forward")==="forward"){let i=t.transform(r.value,r);if(i instanceof Promise)return i.then((n)=>Io(r,n,t.out,u));return Io(r,i,t.out,u)}else{let i=t.reverseTransform(r.value,r);if(i instanceof Promise)return i.then((n)=>Io(r,n,t.in,u));return Io(r,i,t.in,u)}}function Io(r,t,u,D){if(r.issues.length)return r.aborted=!0,r;return u._zod.run({value:t,issues:r.issues},D)}var U0=I("$ZodReadonly",(r,t)=>{x.init(r,t),ur(r._zod,"propValues",()=>t.innerType._zod.propValues),ur(r._zod,"values",()=>t.innerType._zod.values),ur(r._zod,"optin",()=>t.innerType?._zod?.optin),ur(r._zod,"optout",()=>t.innerType?._zod?.optout),r._zod.parse=(u,D)=>{if(D.direction==="backward")return t.innerType._zod.run(u,D);let i=t.innerType._zod.run(u,D);if(i instanceof Promise)return i.then($3);return $3(i)}});function $3(r){return r.value=Object.freeze(r.value),r}var O0=I("$ZodTemplateLiteral",(r,t)=>{x.init(r,t);let u=[];for(let D of t.parts)if(typeof D==="object"&&D!==null){if(!D._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...D._zod.traits].shift()}`);let i=D._zod.pattern instanceof RegExp?D._zod.pattern.source:D._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${D._zod.traits}`);let n=i.startsWith("^")?1:0,o=i.endsWith("$")?i.length-1:i.length;u.push(i.slice(n,o))}else if(D===null||wl.has(typeof D))u.push(nt(`${D}`));else throw new Error(`Invalid template literal part: ${D}`);r._zod.pattern=new RegExp(`^${u.join("")}$`),r._zod.parse=(D,i)=>{if(typeof D.value!=="string")return D.issues.push({input:D.value,inst:r,expected:"string",code:"invalid_type"}),D;if(r._zod.pattern.lastIndex=0,!r._zod.pattern.test(D.value))return D.issues.push({input:D.value,inst:r,code:"invalid_format",format:t.format??"template_literal",pattern:r._zod.pattern.source}),D;return D}}),y0=I("$ZodFunction",(r,t)=>{return x.init(r,t),r._def=t,r._zod.def=t,r.implement=(u)=>{if(typeof u!=="function")throw new Error("implement() must be called with a function");return function(...D){let i=r._def.input?Do(r._def.input,D):D,n=Reflect.apply(u,this,i);if(r._def.output)return Do(r._def.output,n);return n}},r.implementAsync=(u)=>{if(typeof u!=="function")throw new Error("implementAsync() must be called with a function");return async function(...D){let i=r._def.input?await no(r._def.input,D):D,n=await Reflect.apply(u,this,i);if(r._def.output)return await no(r._def.output,n);return n}},r._zod.parse=(u,D)=>{if(typeof u.value!=="function")return u.issues.push({code:"invalid_type",expected:"function",input:u.value,inst:r}),u;if(r._def.output&&r._def.output._zod.def.type==="promise")u.value=r.implementAsync(u.value);else u.value=r.implement(u.value);return u},r.input=(...u)=>{let D=r.constructor;if(Array.isArray(u[0]))return new D({type:"function",input:new No({type:"tuple",items:u[0],rest:u[1]}),output:r._def.output});return new D({type:"function",input:u[0],output:r._def.output})},r.output=(u)=>{return new r.constructor({type:"function",input:r._def.input,output:u})},r}),N0=I("$ZodPromise",(r,t)=>{x.init(r,t),r._zod.parse=(u,D)=>{return Promise.resolve(u.value).then((i)=>t.innerType._zod.run({value:i,issues:[]},D))}}),B0=I("$ZodLazy",(r,t)=>{x.init(r,t),ur(r._zod,"innerType",()=>t.getter()),ur(r._zod,"pattern",()=>r._zod.innerType?._zod?.pattern),ur(r._zod,"propValues",()=>r._zod.innerType?._zod?.propValues),ur(r._zod,"optin",()=>r._zod.innerType?._zod?.optin??void 0),ur(r._zod,"optout",()=>r._zod.innerType?._zod?.optout??void 0),r._zod.parse=(u,D)=>{return r._zod.innerType._zod.run(u,D)}}),q0=I("$ZodCustom",(r,t)=>{br.init(r,t),x.init(r,t),r._zod.parse=(u,D)=>{return u},r._zod.check=(u)=>{let D=u.value,i=t.fn(D);if(i instanceof Promise)return i.then((n)=>l3(n,u,D,r));l3(i,u,D,r);return}});function l3(r,t,u,D){if(!r){let i={code:"custom",input:u,inst:D,path:[...D._zod.def.path??[]],continue:!D._zod.def.abort};if(D._zod.def.params)i.params=D._zod.def.params;t.issues.push(ki(i))}}var _D={};Or(_D,{zhTW:()=>b6,zhCN:()=>w6,yo:()=>C6,vi:()=>g6,uz:()=>F6,ur:()=>E6,uk:()=>CD,ua:()=>v6,tr:()=>c6,th:()=>m6,ta:()=>l6,sv:()=>$6,sl:()=>f6,ru:()=>e6,pt:()=>o6,ps:()=>D6,pl:()=>n6,ota:()=>u6,no:()=>i6,nl:()=>t6,ms:()=>r6,mk:()=>s0,lt:()=>a0,ko:()=>p0,km:()=>wD,kh:()=>x0,ka:()=>d0,ja:()=>k0,it:()=>P0,is:()=>L0,id:()=>Z0,hy:()=>M0,hu:()=>H0,he:()=>K0,frCA:()=>Q0,fr:()=>S0,fi:()=>V0,fa:()=>R0,es:()=>T0,eo:()=>Y0,en:()=>gD,de:()=>W0,da:()=>G0,cs:()=>j0,ca:()=>X0,bg:()=>A0,be:()=>J0,az:()=>z0,ar:()=>h0});var pO=()=>{let r={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(i){return r[i]??null}let u={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},D={nan:"NaN"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${i.expected}، ولكن تم إدخال ${e}`;return`مدخلات غير مقبولة: يفترض إدخال ${n}، ولكن تم إدخال ${e}`}case"invalid_value":if(i.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${J(i.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return` أكبر من اللازم: يفترض أن تكون ${i.origin??"القيمة"} ${n} ${i.maximum.toString()} ${o.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${i.origin??"القيمة"} ${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`أصغر من اللازم: يفترض لـ ${i.origin} أن يكون ${n} ${i.minimum.toString()} ${o.unit}`;return`أصغر من اللازم: يفترض لـ ${i.origin} أن يكون ${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${i.prefix}"`;if(n.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${n.suffix}"`;if(n.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${n.includes}"`;if(n.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${n.pattern}`;return`${u[n.format]??i.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${i.divisor}`;case"unrecognized_keys":return`معرف${i.keys.length>1?"ات":""} غريب${i.keys.length>1?"ة":""}: ${h(i.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${i.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${i.origin}`;default:return"مدخل غير مقبول"}}};function h0(){return{localeError:pO()}}var aO=()=>{let r={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(i){return r[i]??null}let u={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},D={nan:"NaN"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Yanlış dəyər: gözlənilən instanceof ${i.expected}, daxil olan ${e}`;return`Yanlış dəyər: gözlənilən ${n}, daxil olan ${e}`}case"invalid_value":if(i.values.length===1)return`Yanlış dəyər: gözlənilən ${J(i.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Çox böyük: gözlənilən ${i.origin??"dəyər"} ${n}${i.maximum.toString()} ${o.unit??"element"}`;return`Çox böyük: gözlənilən ${i.origin??"dəyər"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Çox kiçik: gözlənilən ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`;return`Çox kiçik: gözlənilən ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Yanlış mətn: "${n.prefix}" ilə başlamalıdır`;if(n.format==="ends_with")return`Yanlış mətn: "${n.suffix}" ilə bitməlidir`;if(n.format==="includes")return`Yanlış mətn: "${n.includes}" daxil olmalıdır`;if(n.format==="regex")return`Yanlış mətn: ${n.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${u[n.format]??i.format}`}case"not_multiple_of":return`Yanlış ədəd: ${i.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${i.keys.length>1?"lar":""}: ${h(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${i.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function z0(){return{localeError:aO()}}function g3(r,t,u,D){let i=Math.abs(r),n=i%10,o=i%100;if(o>=11&&o<=19)return D;if(n===1)return t;if(n>=2&&n<=4)return u;return D}var sO=()=>{let r={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(i){return r[i]??null}let u={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},D={nan:"NaN",number:"лік",array:"масіў"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Няправільны ўвод: чакаўся instanceof ${i.expected}, атрымана ${e}`;return`Няправільны ўвод: чакаўся ${n}, атрымана ${e}`}case"invalid_value":if(i.values.length===1)return`Няправільны ўвод: чакалася ${J(i.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o){let e=Number(i.maximum),f=g3(e,o.unit.one,o.unit.few,o.unit.many);return`Занадта вялікі: чакалася, што ${i.origin??"значэнне"} павінна ${o.verb} ${n}${i.maximum.toString()} ${f}`}return`Занадта вялікі: чакалася, што ${i.origin??"значэнне"} павінна быць ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o){let e=Number(i.minimum),f=g3(e,o.unit.one,o.unit.few,o.unit.many);return`Занадта малы: чакалася, што ${i.origin} павінна ${o.verb} ${n}${i.minimum.toString()} ${f}`}return`Занадта малы: чакалася, што ${i.origin} павінна быць ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${n.prefix}"`;if(n.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${n.suffix}"`;if(n.format==="includes")return`Няправільны радок: павінен змяшчаць "${n.includes}"`;if(n.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${n.pattern}`;return`Няправільны ${u[n.format]??i.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${i.keys.length>1?"ключы":"ключ"}: ${h(i.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${i.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${i.origin}`;default:return"Няправільны ўвод"}}};function J0(){return{localeError:sO()}}var ry=()=>{let r={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(i){return r[i]??null}let u={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},D={nan:"NaN",number:"число",array:"масив"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Невалиден вход: очакван instanceof ${i.expected}, получен ${e}`;return`Невалиден вход: очакван ${n}, получен ${e}`}case"invalid_value":if(i.values.length===1)return`Невалиден вход: очакван ${J(i.values[0])}`;return`Невалидна опция: очаквано едно от ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Твърде голямо: очаква се ${i.origin??"стойност"} да съдържа ${n}${i.maximum.toString()} ${o.unit??"елемента"}`;return`Твърде голямо: очаква се ${i.origin??"стойност"} да бъде ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Твърде малко: очаква се ${i.origin} да съдържа ${n}${i.minimum.toString()} ${o.unit}`;return`Твърде малко: очаква се ${i.origin} да бъде ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Невалиден низ: трябва да започва с "${n.prefix}"`;if(n.format==="ends_with")return`Невалиден низ: трябва да завършва с "${n.suffix}"`;if(n.format==="includes")return`Невалиден низ: трябва да включва "${n.includes}"`;if(n.format==="regex")return`Невалиден низ: трябва да съвпада с ${n.pattern}`;let o="Невалиден";if(n.format==="emoji")o="Невалидно";if(n.format==="datetime")o="Невалидно";if(n.format==="date")o="Невалидна";if(n.format==="time")o="Невалидно";if(n.format==="duration")o="Невалидна";return`${o} ${u[n.format]??i.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${i.divisor}`;case"unrecognized_keys":return`Неразпознат${i.keys.length>1?"и":""} ключ${i.keys.length>1?"ове":""}: ${h(i.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${i.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${i.origin}`;default:return"Невалиден вход"}}};function A0(){return{localeError:ry()}}var ty=()=>{let r={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(i){return r[i]??null}let u={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},D={nan:"NaN"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Tipus invàlid: s'esperava instanceof ${i.expected}, s'ha rebut ${e}`;return`Tipus invàlid: s'esperava ${n}, s'ha rebut ${e}`}case"invalid_value":if(i.values.length===1)return`Valor invàlid: s'esperava ${J(i.values[0])}`;return`Opció invàlida: s'esperava una de ${h(i.values," o ")}`;case"too_big":{let n=i.inclusive?"com a màxim":"menys de",o=t(i.origin);if(o)return`Massa gran: s'esperava que ${i.origin??"el valor"} contingués ${n} ${i.maximum.toString()} ${o.unit??"elements"}`;return`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?"com a mínim":"més de",o=t(i.origin);if(o)return`Massa petit: s'esperava que ${i.origin} contingués ${n} ${i.minimum.toString()} ${o.unit}`;return`Massa petit: s'esperava que ${i.origin} fos ${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Format invàlid: ha de començar amb "${n.prefix}"`;if(n.format==="ends_with")return`Format invàlid: ha d'acabar amb "${n.suffix}"`;if(n.format==="includes")return`Format invàlid: ha d'incloure "${n.includes}"`;if(n.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${n.pattern}`;return`Format invàlid per a ${u[n.format]??i.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${h(i.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${i.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${i.origin}`;default:return"Entrada invàlida"}}};function X0(){return{localeError:ty()}}var iy=()=>{let r={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(i){return r[i]??null}let u={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},D={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Neplatný vstup: očekáváno instanceof ${i.expected}, obdrženo ${e}`;return`Neplatný vstup: očekáváno ${n}, obdrženo ${e}`}case"invalid_value":if(i.values.length===1)return`Neplatný vstup: očekáváno ${J(i.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Hodnota je příliš velká: ${i.origin??"hodnota"} musí mít ${n}${i.maximum.toString()} ${o.unit??"prvků"}`;return`Hodnota je příliš velká: ${i.origin??"hodnota"} musí být ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Hodnota je příliš malá: ${i.origin??"hodnota"} musí mít ${n}${i.minimum.toString()} ${o.unit??"prvků"}`;return`Hodnota je příliš malá: ${i.origin??"hodnota"} musí být ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Neplatný řetězec: musí začínat na "${n.prefix}"`;if(n.format==="ends_with")return`Neplatný řetězec: musí končit na "${n.suffix}"`;if(n.format==="includes")return`Neplatný řetězec: musí obsahovat "${n.includes}"`;if(n.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${n.pattern}`;return`Neplatný formát ${u[n.format]??i.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${i.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${h(i.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${i.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${i.origin}`;default:return"Neplatný vstup"}}};function j0(){return{localeError:iy()}}var uy=()=>{let r={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(i){return r[i]??null}let u={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},D={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Ugyldigt input: forventede instanceof ${i.expected}, fik ${e}`;return`Ugyldigt input: forventede ${n}, fik ${e}`}case"invalid_value":if(i.values.length===1)return`Ugyldig værdi: forventede ${J(i.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin),e=D[i.origin]??i.origin;if(o)return`For stor: forventede ${e??"value"} ${o.verb} ${n} ${i.maximum.toString()} ${o.unit??"elementer"}`;return`For stor: forventede ${e??"value"} havde ${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin),e=D[i.origin]??i.origin;if(o)return`For lille: forventede ${e} ${o.verb} ${n} ${i.minimum.toString()} ${o.unit}`;return`For lille: forventede ${e} havde ${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Ugyldig streng: skal starte med "${n.prefix}"`;if(n.format==="ends_with")return`Ugyldig streng: skal ende med "${n.suffix}"`;if(n.format==="includes")return`Ugyldig streng: skal indeholde "${n.includes}"`;if(n.format==="regex")return`Ugyldig streng: skal matche mønsteret ${n.pattern}`;return`Ugyldig ${u[n.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${h(i.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${i.origin}`;default:return"Ugyldigt input"}}};function G0(){return{localeError:uy()}}var Dy=()=>{let r={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(i){return r[i]??null}let u={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},D={nan:"NaN",number:"Zahl",array:"Array"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Ungültige Eingabe: erwartet instanceof ${i.expected}, erhalten ${e}`;return`Ungültige Eingabe: erwartet ${n}, erhalten ${e}`}case"invalid_value":if(i.values.length===1)return`Ungültige Eingabe: erwartet ${J(i.values[0])}`;return`Ungültige Option: erwartet eine von ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Zu groß: erwartet, dass ${i.origin??"Wert"} ${n}${i.maximum.toString()} ${o.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${i.origin??"Wert"} ${n}${i.maximum.toString()} ist`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Zu klein: erwartet, dass ${i.origin} ${n}${i.minimum.toString()} ${o.unit} hat`;return`Zu klein: erwartet, dass ${i.origin} ${n}${i.minimum.toString()} ist`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Ungültiger String: muss mit "${n.prefix}" beginnen`;if(n.format==="ends_with")return`Ungültiger String: muss mit "${n.suffix}" enden`;if(n.format==="includes")return`Ungültiger String: muss "${n.includes}" enthalten`;if(n.format==="regex")return`Ungültiger String: muss dem Muster ${n.pattern} entsprechen`;return`Ungültig: ${u[n.format]??i.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${h(i.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${i.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${i.origin}`;default:return"Ungültige Eingabe"}}};function W0(){return{localeError:Dy()}}var ny=()=>{let r={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return r[i]??null}let u={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},D={nan:"NaN"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;return`Invalid input: expected ${n}, received ${e}`}case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${J(i.values[0])}`;return`Invalid option: expected one of ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${o.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${o.unit}`;return`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Invalid string: must start with "${n.prefix}"`;if(n.format==="ends_with")return`Invalid string: must end with "${n.suffix}"`;if(n.format==="includes")return`Invalid string: must include "${n.includes}"`;if(n.format==="regex")return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${u[n.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${h(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function gD(){return{localeError:ny()}}var oy=()=>{let r={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(i){return r[i]??null}let u={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},D={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Nevalida enigo: atendiĝis instanceof ${i.expected}, riceviĝis ${e}`;return`Nevalida enigo: atendiĝis ${n}, riceviĝis ${e}`}case"invalid_value":if(i.values.length===1)return`Nevalida enigo: atendiĝis ${J(i.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()} ${o.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Tro malgranda: atendiĝis ke ${i.origin} havu ${n}${i.minimum.toString()} ${o.unit}`;return`Tro malgranda: atendiĝis ke ${i.origin} estu ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${n.prefix}"`;if(n.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${n.suffix}"`;if(n.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${n.includes}"`;if(n.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${n.pattern}`;return`Nevalida ${u[n.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} ŝlosilo${i.keys.length>1?"j":""}: ${h(i.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function Y0(){return{localeError:oy()}}var ey=()=>{let r={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(i){return r[i]??null}let u={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},D={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Entrada inválida: se esperaba instanceof ${i.expected}, recibido ${e}`;return`Entrada inválida: se esperaba ${n}, recibido ${e}`}case"invalid_value":if(i.values.length===1)return`Entrada inválida: se esperaba ${J(i.values[0])}`;return`Opción inválida: se esperaba una de ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin),e=D[i.origin]??i.origin;if(o)return`Demasiado grande: se esperaba que ${e??"valor"} tuviera ${n}${i.maximum.toString()} ${o.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${e??"valor"} fuera ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin),e=D[i.origin]??i.origin;if(o)return`Demasiado pequeño: se esperaba que ${e} tuviera ${n}${i.minimum.toString()} ${o.unit}`;return`Demasiado pequeño: se esperaba que ${e} fuera ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Cadena inválida: debe comenzar con "${n.prefix}"`;if(n.format==="ends_with")return`Cadena inválida: debe terminar en "${n.suffix}"`;if(n.format==="includes")return`Cadena inválida: debe incluir "${n.includes}"`;if(n.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${n.pattern}`;return`Inválido ${u[n.format]??i.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${h(i.keys,", ")}`;case"invalid_key":return`Llave inválida en ${D[i.origin]??i.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${D[i.origin]??i.origin}`;default:return"Entrada inválida"}}};function T0(){return{localeError:ey()}}var fy=()=>{let r={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(i){return r[i]??null}let u={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},D={nan:"NaN",number:"عدد",array:"آرایه"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`ورودی نامعتبر: میبایست instanceof ${i.expected} میبود، ${e} دریافت شد`;return`ورودی نامعتبر: میبایست ${n} میبود، ${e} دریافت شد`}case"invalid_value":if(i.values.length===1)return`ورودی نامعتبر: میبایست ${J(i.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${h(i.values,"|")} میبود`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`خیلی بزرگ: ${i.origin??"مقدار"} باید ${n}${i.maximum.toString()} ${o.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${i.origin??"مقدار"} باید ${n}${i.maximum.toString()} باشد`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`خیلی کوچک: ${i.origin} باید ${n}${i.minimum.toString()} ${o.unit} باشد`;return`خیلی کوچک: ${i.origin} باید ${n}${i.minimum.toString()} باشد`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`رشته نامعتبر: باید با "${n.prefix}" شروع شود`;if(n.format==="ends_with")return`رشته نامعتبر: باید با "${n.suffix}" تمام شود`;if(n.format==="includes")return`رشته نامعتبر: باید شامل "${n.includes}" باشد`;if(n.format==="regex")return`رشته نامعتبر: باید با الگوی ${n.pattern} مطابقت داشته باشد`;return`${u[n.format]??i.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${i.divisor} باشد`;case"unrecognized_keys":return`کلید${i.keys.length>1?"های":""} ناشناس: ${h(i.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${i.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${i.origin}`;default:return"ورودی نامعتبر"}}};function R0(){return{localeError:fy()}}var $y=()=>{let r={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(i){return r[i]??null}let u={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},D={nan:"NaN"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${e}`;return`Virheellinen tyyppi: odotettiin ${n}, oli ${e}`}case"invalid_value":if(i.values.length===1)return`Virheellinen syöte: täytyy olla ${J(i.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Liian suuri: ${o.subject} täytyy olla ${n}${i.maximum.toString()} ${o.unit}`.trim();return`Liian suuri: arvon täytyy olla ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Liian pieni: ${o.subject} täytyy olla ${n}${i.minimum.toString()} ${o.unit}`.trim();return`Liian pieni: arvon täytyy olla ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${n.prefix}"`;if(n.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${n.suffix}"`;if(n.format==="includes")return`Virheellinen syöte: täytyy sisältää "${n.includes}"`;if(n.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${n.pattern}`;return`Virheellinen ${u[n.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${h(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function V0(){return{localeError:$y()}}var ly=()=>{let r={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(i){return r[i]??null}let u={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},D={nan:"NaN",number:"nombre",array:"tableau"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Entrée invalide : instanceof ${i.expected} attendu, ${e} reçu`;return`Entrée invalide : ${n} attendu, ${e} reçu`}case"invalid_value":if(i.values.length===1)return`Entrée invalide : ${J(i.values[0])} attendu`;return`Option invalide : une valeur parmi ${h(i.values,"|")} attendue`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Trop grand : ${i.origin??"valeur"} doit ${o.verb} ${n}${i.maximum.toString()} ${o.unit??"élément(s)"}`;return`Trop grand : ${i.origin??"valeur"} doit être ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Trop petit : ${i.origin} doit ${o.verb} ${n}${i.minimum.toString()} ${o.unit}`;return`Trop petit : ${i.origin} doit être ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Chaîne invalide : doit commencer par "${n.prefix}"`;if(n.format==="ends_with")return`Chaîne invalide : doit se terminer par "${n.suffix}"`;if(n.format==="includes")return`Chaîne invalide : doit inclure "${n.includes}"`;if(n.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${n.pattern}`;return`${u[n.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${i.divisor}`;case"unrecognized_keys":return`Clé${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${h(i.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${i.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entrée invalide"}}};function S0(){return{localeError:ly()}}var my=()=>{let r={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(i){return r[i]??null}let u={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},D={nan:"NaN"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Entrée invalide : attendu instanceof ${i.expected}, reçu ${e}`;return`Entrée invalide : attendu ${n}, reçu ${e}`}case"invalid_value":if(i.values.length===1)return`Entrée invalide : attendu ${J(i.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"≤":"<",o=t(i.origin);if(o)return`Trop grand : attendu que ${i.origin??"la valeur"} ait ${n}${i.maximum.toString()} ${o.unit}`;return`Trop grand : attendu que ${i.origin??"la valeur"} soit ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?"≥":">",o=t(i.origin);if(o)return`Trop petit : attendu que ${i.origin} ait ${n}${i.minimum.toString()} ${o.unit}`;return`Trop petit : attendu que ${i.origin} soit ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Chaîne invalide : doit commencer par "${n.prefix}"`;if(n.format==="ends_with")return`Chaîne invalide : doit se terminer par "${n.suffix}"`;if(n.format==="includes")return`Chaîne invalide : doit inclure "${n.includes}"`;if(n.format==="regex")return`Chaîne invalide : doit correspondre au motif ${n.pattern}`;return`${u[n.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${i.divisor}`;case"unrecognized_keys":return`Clé${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${h(i.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${i.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entrée invalide"}}};function Q0(){return{localeError:my()}}var cy=()=>{let r={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},u=($)=>$?r[$]:void 0,D=($)=>{let l=u($);if(l)return l.label;return $??r.unknown.label},i=($)=>`ה${D($)}`,n=($)=>{return(u($)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},o=($)=>{if(!$)return null;return t[$]??null},e={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},f={nan:"NaN"};return($)=>{switch($.code){case"invalid_type":{let l=$.expected,m=f[l??""]??D(l),c=X($.input),g=f[c]??r[c]?.label??c;if(/^[A-Z]/.test($.expected))return`קלט לא תקין: צריך להיות instanceof ${$.expected}, התקבל ${g}`;return`קלט לא תקין: צריך להיות ${m}, התקבל ${g}`}case"invalid_value":{if($.values.length===1)return`ערך לא תקין: הערך חייב להיות ${J($.values[0])}`;let l=$.values.map((g)=>J(g));if($.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${l[0]} או ${l[1]}`;let m=l[l.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${l.slice(0,-1).join(", ")} או ${m}`}case"too_big":{let l=o($.origin),m=i($.origin??"value");if($.origin==="string")return`${l?.longLabel??"ארוך"} מדי: ${m} צריכה להכיל ${$.maximum.toString()} ${l?.unit??""} ${$.inclusive?"או פחות":"לכל היותר"}`.trim();if($.origin==="number"){let _=$.inclusive?`קטן או שווה ל-${$.maximum}`:`קטן מ-${$.maximum}`;return`גדול מדי: ${m} צריך להיות ${_}`}if($.origin==="array"||$.origin==="set"){let _=$.origin==="set"?"צריכה":"צריך",q=$.inclusive?`${$.maximum} ${l?.unit??""} או פחות`:`פחות מ-${$.maximum} ${l?.unit??""}`;return`גדול מדי: ${m} ${_} להכיל ${q}`.trim()}let c=$.inclusive?"<=":"<",g=n($.origin??"value");if(l?.unit)return`${l.longLabel} מדי: ${m} ${g} ${c}${$.maximum.toString()} ${l.unit}`;return`${l?.longLabel??"גדול"} מדי: ${m} ${g} ${c}${$.maximum.toString()}`}case"too_small":{let l=o($.origin),m=i($.origin??"value");if($.origin==="string")return`${l?.shortLabel??"קצר"} מדי: ${m} צריכה להכיל ${$.minimum.toString()} ${l?.unit??""} ${$.inclusive?"או יותר":"לפחות"}`.trim();if($.origin==="number"){let _=$.inclusive?`גדול או שווה ל-${$.minimum}`:`גדול מ-${$.minimum}`;return`קטן מדי: ${m} צריך להיות ${_}`}if($.origin==="array"||$.origin==="set"){let _=$.origin==="set"?"צריכה":"צריך";if($.minimum===1&&$.inclusive){let y=$.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${m} ${_} להכיל ${y}`}let q=$.inclusive?`${$.minimum} ${l?.unit??""} או יותר`:`יותר מ-${$.minimum} ${l?.unit??""}`;return`קטן מדי: ${m} ${_} להכיל ${q}`.trim()}let c=$.inclusive?">=":">",g=n($.origin??"value");if(l?.unit)return`${l.shortLabel} מדי: ${m} ${g} ${c}${$.minimum.toString()} ${l.unit}`;return`${l?.shortLabel??"קטן"} מדי: ${m} ${g} ${c}${$.minimum.toString()}`}case"invalid_format":{let l=$;if(l.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${l.prefix}"`;if(l.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${l.suffix}"`;if(l.format==="includes")return`המחרוזת חייבת לכלול "${l.includes}"`;if(l.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${l.pattern}`;let m=e[l.format],c=m?.label??l.format,_=(m?.gender??"m")==="f"?"תקינה":"תקין";return`${c} לא ${_}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${$.divisor}`;case"unrecognized_keys":return`מפתח${$.keys.length>1?"ות":""} לא מזוה${$.keys.length>1?"ים":"ה"}: ${h($.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${i($.origin??"array")}`;default:return"קלט לא תקין"}}};function K0(){return{localeError:cy()}}var vy=()=>{let r={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(i){return r[i]??null}let u={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},D={nan:"NaN",number:"szám",array:"tömb"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Érvénytelen bemenet: a várt érték instanceof ${i.expected}, a kapott érték ${e}`;return`Érvénytelen bemenet: a várt érték ${n}, a kapott érték ${e}`}case"invalid_value":if(i.values.length===1)return`Érvénytelen bemenet: a várt érték ${J(i.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Túl nagy: ${i.origin??"érték"} mérete túl nagy ${n}${i.maximum.toString()} ${o.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${i.origin??"érték"} túl nagy: ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Túl kicsi: a bemeneti érték ${i.origin} mérete túl kicsi ${n}${i.minimum.toString()} ${o.unit}`;return`Túl kicsi: a bemeneti érték ${i.origin} túl kicsi ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Érvénytelen string: "${n.prefix}" értékkel kell kezdődnie`;if(n.format==="ends_with")return`Érvénytelen string: "${n.suffix}" értékkel kell végződnie`;if(n.format==="includes")return`Érvénytelen string: "${n.includes}" értéket kell tartalmaznia`;if(n.format==="regex")return`Érvénytelen string: ${n.pattern} mintának kell megfelelnie`;return`Érvénytelen ${u[n.format]??i.format}`}case"not_multiple_of":return`Érvénytelen szám: ${i.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${h(i.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${i.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${i.origin}`;default:return"Érvénytelen bemenet"}}};function H0(){return{localeError:vy()}}function w3(r,t,u){return Math.abs(r)===1?t:u}function ru(r){if(!r)return"";let t=["ա","ե","ը","ի","ո","ու","օ"],u=r[r.length-1];return r+(t.includes(u)?"ն":"ը")}var Ey=()=>{let r={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(i){return r[i]??null}let u={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},D={nan:"NaN",number:"թիվ",array:"զանգված"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${i.expected}, ստացվել է ${e}`;return`Սխալ մուտքագրում․ սպասվում էր ${n}, ստացվել է ${e}`}case"invalid_value":if(i.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${J(i.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o){let e=Number(i.maximum),f=w3(e,o.unit.one,o.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${ru(i.origin??"արժեք")} կունենա ${n}${i.maximum.toString()} ${f}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${ru(i.origin??"արժեք")} լինի ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o){let e=Number(i.minimum),f=w3(e,o.unit.one,o.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${ru(i.origin)} կունենա ${n}${i.minimum.toString()} ${f}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${ru(i.origin)} լինի ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${n.prefix}"-ով`;if(n.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${n.suffix}"-ով`;if(n.format==="includes")return`Սխալ տող․ պետք է պարունակի "${n.includes}"`;if(n.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${n.pattern} ձևաչափին`;return`Սխալ ${u[n.format]??i.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${i.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${i.keys.length>1?"ներ":""}. ${h(i.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${ru(i.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${ru(i.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function M0(){return{localeError:Ey()}}var Fy=()=>{let r={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(i){return r[i]??null}let u={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},D={nan:"NaN"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${e}`;return`Input tidak valid: diharapkan ${n}, diterima ${e}`}case"invalid_value":if(i.values.length===1)return`Input tidak valid: diharapkan ${J(i.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${n}${i.maximum.toString()} ${o.unit??"elemen"}`;return`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Terlalu kecil: diharapkan ${i.origin} memiliki ${n}${i.minimum.toString()} ${o.unit}`;return`Terlalu kecil: diharapkan ${i.origin} menjadi ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`String tidak valid: harus dimulai dengan "${n.prefix}"`;if(n.format==="ends_with")return`String tidak valid: harus berakhir dengan "${n.suffix}"`;if(n.format==="includes")return`String tidak valid: harus menyertakan "${n.includes}"`;if(n.format==="regex")return`String tidak valid: harus sesuai pola ${n.pattern}`;return`${u[n.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${h(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};function Z0(){return{localeError:Fy()}}var gy=()=>{let r={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(i){return r[i]??null}let u={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},D={nan:"NaN",number:"númer",array:"fylki"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Rangt gildi: Þú slóst inn ${e} þar sem á að vera instanceof ${i.expected}`;return`Rangt gildi: Þú slóst inn ${e} þar sem á að vera ${n}`}case"invalid_value":if(i.values.length===1)return`Rangt gildi: gert ráð fyrir ${J(i.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Of stórt: gert er ráð fyrir að ${i.origin??"gildi"} hafi ${n}${i.maximum.toString()} ${o.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${i.origin??"gildi"} sé ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Of lítið: gert er ráð fyrir að ${i.origin} hafi ${n}${i.minimum.toString()} ${o.unit}`;return`Of lítið: gert er ráð fyrir að ${i.origin} sé ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Ógildur strengur: verður að byrja á "${n.prefix}"`;if(n.format==="ends_with")return`Ógildur strengur: verður að enda á "${n.suffix}"`;if(n.format==="includes")return`Ógildur strengur: verður að innihalda "${n.includes}"`;if(n.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${n.pattern}`;return`Rangt ${u[n.format]??i.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`Óþekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${h(i.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${i.origin}`;default:return"Rangt gildi"}}};function L0(){return{localeError:gy()}}var wy=()=>{let r={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(i){return r[i]??null}let u={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},D={nan:"NaN",number:"numero",array:"vettore"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Input non valido: atteso instanceof ${i.expected}, ricevuto ${e}`;return`Input non valido: atteso ${n}, ricevuto ${e}`}case"invalid_value":if(i.values.length===1)return`Input non valido: atteso ${J(i.values[0])}`;return`Opzione non valida: atteso uno tra ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Troppo grande: ${i.origin??"valore"} deve avere ${n}${i.maximum.toString()} ${o.unit??"elementi"}`;return`Troppo grande: ${i.origin??"valore"} deve essere ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Troppo piccolo: ${i.origin} deve avere ${n}${i.minimum.toString()} ${o.unit}`;return`Troppo piccolo: ${i.origin} deve essere ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Stringa non valida: deve iniziare con "${n.prefix}"`;if(n.format==="ends_with")return`Stringa non valida: deve terminare con "${n.suffix}"`;if(n.format==="includes")return`Stringa non valida: deve includere "${n.includes}"`;if(n.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${n.pattern}`;return`Invalid ${u[n.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${h(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};function P0(){return{localeError:wy()}}var by=()=>{let r={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(i){return r[i]??null}let u={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},D={nan:"NaN",number:"数値",array:"配列"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`無効な入力: instanceof ${i.expected}が期待されましたが、${e}が入力されました`;return`無効な入力: ${n}が期待されましたが、${e}が入力されました`}case"invalid_value":if(i.values.length===1)return`無効な入力: ${J(i.values[0])}が期待されました`;return`無効な選択: ${h(i.values,"、")}のいずれかである必要があります`;case"too_big":{let n=i.inclusive?"以下である":"より小さい",o=t(i.origin);if(o)return`大きすぎる値: ${i.origin??"値"}は${i.maximum.toString()}${o.unit??"要素"}${n}必要があります`;return`大きすぎる値: ${i.origin??"値"}は${i.maximum.toString()}${n}必要があります`}case"too_small":{let n=i.inclusive?"以上である":"より大きい",o=t(i.origin);if(o)return`小さすぎる値: ${i.origin}は${i.minimum.toString()}${o.unit}${n}必要があります`;return`小さすぎる値: ${i.origin}は${i.minimum.toString()}${n}必要があります`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`無効な文字列: "${n.prefix}"で始まる必要があります`;if(n.format==="ends_with")return`無効な文字列: "${n.suffix}"で終わる必要があります`;if(n.format==="includes")return`無効な文字列: "${n.includes}"を含む必要があります`;if(n.format==="regex")return`無効な文字列: パターン${n.pattern}に一致する必要があります`;return`無効な${u[n.format]??i.format}`}case"not_multiple_of":return`無効な数値: ${i.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${i.keys.length>1?"群":""}: ${h(i.keys,"、")}`;case"invalid_key":return`${i.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${i.origin}内の無効な値`;default:return"無効な入力"}}};function k0(){return{localeError:by()}}var Cy=()=>{let r={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(i){return r[i]??null}let u={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},D={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${i.expected}, მიღებული ${e}`;return`არასწორი შეყვანა: მოსალოდნელი ${n}, მიღებული ${e}`}case"invalid_value":if(i.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${J(i.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${h(i.values,"|")}-დან`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`ზედმეტად დიდი: მოსალოდნელი ${i.origin??"მნიშვნელობა"} ${o.verb} ${n}${i.maximum.toString()} ${o.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${i.origin??"მნიშვნელობა"} იყოს ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`ზედმეტად პატარა: მოსალოდნელი ${i.origin} ${o.verb} ${n}${i.minimum.toString()} ${o.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${i.origin} იყოს ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${n.prefix}"-ით`;if(n.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${n.suffix}"-ით`;if(n.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${n.includes}"-ს`;if(n.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${n.pattern}`;return`არასწორი ${u[n.format]??i.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${i.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${i.keys.length>1?"ები":"ი"}: ${h(i.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${i.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${i.origin}-ში`;default:return"არასწორი შეყვანა"}}};function d0(){return{localeError:Cy()}}var _y=()=>{let r={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(i){return r[i]??null}let u={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},D={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${i.expected} ប៉ុន្តែទទួលបាន ${e}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${n} ប៉ុន្តែទទួលបាន ${e}`}case"invalid_value":if(i.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${J(i.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`ធំពេក៖ ត្រូវការ ${i.origin??"តម្លៃ"} ${n} ${i.maximum.toString()} ${o.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${i.origin??"តម្លៃ"} ${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`តូចពេក៖ ត្រូវការ ${i.origin} ${n} ${i.minimum.toString()} ${o.unit}`;return`តូចពេក៖ ត្រូវការ ${i.origin} ${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${n.prefix}"`;if(n.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${n.suffix}"`;if(n.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${n.includes}"`;if(n.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${n.pattern}`;return`មិនត្រឹមត្រូវ៖ ${u[n.format]??i.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${i.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${h(i.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function wD(){return{localeError:_y()}}function x0(){return wD()}var Iy=()=>{let r={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(i){return r[i]??null}let u={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},D={nan:"NaN"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`잘못된 입력: 예상 타입은 instanceof ${i.expected}, 받은 타입은 ${e}입니다`;return`잘못된 입력: 예상 타입은 ${n}, 받은 타입은 ${e}입니다`}case"invalid_value":if(i.values.length===1)return`잘못된 입력: 값은 ${J(i.values[0])} 이어야 합니다`;return`잘못된 옵션: ${h(i.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let n=i.inclusive?"이하":"미만",o=n==="미만"?"이어야 합니다":"여야 합니다",e=t(i.origin),f=e?.unit??"요소";if(e)return`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()}${f} ${n}${o}`;return`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()} ${n}${o}`}case"too_small":{let n=i.inclusive?"이상":"초과",o=n==="이상"?"이어야 합니다":"여야 합니다",e=t(i.origin),f=e?.unit??"요소";if(e)return`${i.origin??"값"}이 너무 작습니다: ${i.minimum.toString()}${f} ${n}${o}`;return`${i.origin??"값"}이 너무 작습니다: ${i.minimum.toString()} ${n}${o}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`잘못된 문자열: "${n.prefix}"(으)로 시작해야 합니다`;if(n.format==="ends_with")return`잘못된 문자열: "${n.suffix}"(으)로 끝나야 합니다`;if(n.format==="includes")return`잘못된 문자열: "${n.includes}"을(를) 포함해야 합니다`;if(n.format==="regex")return`잘못된 문자열: 정규식 ${n.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${u[n.format]??i.format}`}case"not_multiple_of":return`잘못된 숫자: ${i.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${h(i.keys,", ")}`;case"invalid_key":return`잘못된 키: ${i.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${i.origin}`;default:return"잘못된 입력"}}};function p0(){return{localeError:Iy()}}var bD=(r)=>{return r.charAt(0).toUpperCase()+r.slice(1)};function b3(r){let t=Math.abs(r),u=t%10,D=t%100;if(D>=11&&D<=19||u===0)return"many";if(u===1)return"one";return"few"}var Uy=()=>{let r={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(i,n,o,e){let f=r[i]??null;if(f===null)return f;return{unit:f.unit[n],verb:f.verb[e][o?"inclusive":"notInclusive"]}}let u={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},D={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Gautas tipas ${e}, o tikėtasi - instanceof ${i.expected}`;return`Gautas tipas ${e}, o tikėtasi - ${n}`}case"invalid_value":if(i.values.length===1)return`Privalo būti ${J(i.values[0])}`;return`Privalo būti vienas iš ${h(i.values,"|")} pasirinkimų`;case"too_big":{let n=D[i.origin]??i.origin,o=t(i.origin,b3(Number(i.maximum)),i.inclusive??!1,"smaller");if(o?.verb)return`${bD(n??i.origin??"reikšmė")} ${o.verb} ${i.maximum.toString()} ${o.unit??"elementų"}`;let e=i.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${bD(n??i.origin??"reikšmė")} turi būti ${e} ${i.maximum.toString()} ${o?.unit}`}case"too_small":{let n=D[i.origin]??i.origin,o=t(i.origin,b3(Number(i.minimum)),i.inclusive??!1,"bigger");if(o?.verb)return`${bD(n??i.origin??"reikšmė")} ${o.verb} ${i.minimum.toString()} ${o.unit??"elementų"}`;let e=i.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${bD(n??i.origin??"reikšmė")} turi būti ${e} ${i.minimum.toString()} ${o?.unit}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Eilutė privalo prasidėti "${n.prefix}"`;if(n.format==="ends_with")return`Eilutė privalo pasibaigti "${n.suffix}"`;if(n.format==="includes")return`Eilutė privalo įtraukti "${n.includes}"`;if(n.format==="regex")return`Eilutė privalo atitikti ${n.pattern}`;return`Neteisingas ${u[n.format]??i.format}`}case"not_multiple_of":return`Skaičius privalo būti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${h(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let n=D[i.origin]??i.origin;return`${bD(n??i.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function a0(){return{localeError:Uy()}}var Oy=()=>{let r={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(i){return r[i]??null}let u={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},D={nan:"NaN",number:"број",array:"низа"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Грешен внес: се очекува instanceof ${i.expected}, примено ${e}`;return`Грешен внес: се очекува ${n}, примено ${e}`}case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${J(i.values[0])}`;return`Грешана опција: се очекува една ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Премногу голем: се очекува ${i.origin??"вредноста"} да има ${n}${i.maximum.toString()} ${o.unit??"елементи"}`;return`Премногу голем: се очекува ${i.origin??"вредноста"} да биде ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Премногу мал: се очекува ${i.origin} да има ${n}${i.minimum.toString()} ${o.unit}`;return`Премногу мал: се очекува ${i.origin} да биде ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Неважечка низа: мора да започнува со "${n.prefix}"`;if(n.format==="ends_with")return`Неважечка низа: мора да завршува со "${n.suffix}"`;if(n.format==="includes")return`Неважечка низа: мора да вклучува "${n.includes}"`;if(n.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${n.pattern}`;return`Invalid ${u[n.format]??i.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${h(i.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${i.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${i.origin}`;default:return"Грешен внес"}}};function s0(){return{localeError:Oy()}}var yy=()=>{let r={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(i){return r[i]??null}let u={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},D={nan:"NaN",number:"nombor"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${e}`;return`Input tidak sah: dijangka ${n}, diterima ${e}`}case"invalid_value":if(i.values.length===1)return`Input tidak sah: dijangka ${J(i.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Terlalu besar: dijangka ${i.origin??"nilai"} ${o.verb} ${n}${i.maximum.toString()} ${o.unit??"elemen"}`;return`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Terlalu kecil: dijangka ${i.origin} ${o.verb} ${n}${i.minimum.toString()} ${o.unit}`;return`Terlalu kecil: dijangka ${i.origin} adalah ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`String tidak sah: mesti bermula dengan "${n.prefix}"`;if(n.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${n.suffix}"`;if(n.format==="includes")return`String tidak sah: mesti mengandungi "${n.includes}"`;if(n.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${n.pattern}`;return`${u[n.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${h(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};function r6(){return{localeError:yy()}}var Ny=()=>{let r={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(i){return r[i]??null}let u={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},D={nan:"NaN",number:"getal"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${e}`;return`Ongeldige invoer: verwacht ${n}, ontving ${e}`}case"invalid_value":if(i.values.length===1)return`Ongeldige invoer: verwacht ${J(i.values[0])}`;return`Ongeldige optie: verwacht één van ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin),e=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";if(o)return`Te ${e}: verwacht dat ${i.origin??"waarde"} ${n}${i.maximum.toString()} ${o.unit??"elementen"} ${o.verb}`;return`Te ${e}: verwacht dat ${i.origin??"waarde"} ${n}${i.maximum.toString()} is`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin),e=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";if(o)return`Te ${e}: verwacht dat ${i.origin} ${n}${i.minimum.toString()} ${o.unit} ${o.verb}`;return`Te ${e}: verwacht dat ${i.origin} ${n}${i.minimum.toString()} is`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Ongeldige tekst: moet met "${n.prefix}" beginnen`;if(n.format==="ends_with")return`Ongeldige tekst: moet op "${n.suffix}" eindigen`;if(n.format==="includes")return`Ongeldige tekst: moet "${n.includes}" bevatten`;if(n.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${n.pattern}`;return`Ongeldig: ${u[n.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${h(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function t6(){return{localeError:Ny()}}var By=()=>{let r={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(i){return r[i]??null}let u={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},D={nan:"NaN",number:"tall",array:"liste"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Ugyldig input: forventet instanceof ${i.expected}, fikk ${e}`;return`Ugyldig input: forventet ${n}, fikk ${e}`}case"invalid_value":if(i.values.length===1)return`Ugyldig verdi: forventet ${J(i.values[0])}`;return`Ugyldig valg: forventet en av ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`For stor(t): forventet ${i.origin??"value"} til å ha ${n}${i.maximum.toString()} ${o.unit??"elementer"}`;return`For stor(t): forventet ${i.origin??"value"} til å ha ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`For lite(n): forventet ${i.origin} til å ha ${n}${i.minimum.toString()} ${o.unit}`;return`For lite(n): forventet ${i.origin} til å ha ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Ugyldig streng: må starte med "${n.prefix}"`;if(n.format==="ends_with")return`Ugyldig streng: må ende med "${n.suffix}"`;if(n.format==="includes")return`Ugyldig streng: må inneholde "${n.includes}"`;if(n.format==="regex")return`Ugyldig streng: må matche mønsteret ${n.pattern}`;return`Ugyldig ${u[n.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${h(i.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function i6(){return{localeError:By()}}var qy=()=>{let r={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(i){return r[i]??null}let u={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},D={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Fâsit giren: umulan instanceof ${i.expected}, alınan ${e}`;return`Fâsit giren: umulan ${n}, alınan ${e}`}case"invalid_value":if(i.values.length===1)return`Fâsit giren: umulan ${J(i.values[0])}`;return`Fâsit tercih: mûteberler ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Fazla büyük: ${i.origin??"value"}, ${n}${i.maximum.toString()} ${o.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${i.origin??"value"}, ${n}${i.maximum.toString()} olmalıydı.`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Fazla küçük: ${i.origin}, ${n}${i.minimum.toString()} ${o.unit} sahip olmalıydı.`;return`Fazla küçük: ${i.origin}, ${n}${i.minimum.toString()} olmalıydı.`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Fâsit metin: "${n.prefix}" ile başlamalı.`;if(n.format==="ends_with")return`Fâsit metin: "${n.suffix}" ile bitmeli.`;if(n.format==="includes")return`Fâsit metin: "${n.includes}" ihtivâ etmeli.`;if(n.format==="regex")return`Fâsit metin: ${n.pattern} nakşına uymalı.`;return`Fâsit ${u[n.format]??i.format}`}case"not_multiple_of":return`Fâsit sayı: ${i.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${i.keys.length>1?"s":""}: ${h(i.keys,", ")}`;case"invalid_key":return`${i.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${i.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function u6(){return{localeError:qy()}}var hy=()=>{let r={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(i){return r[i]??null}let u={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},D={nan:"NaN",number:"عدد",array:"ارې"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`ناسم ورودي: باید instanceof ${i.expected} وای, مګر ${e} ترلاسه شو`;return`ناسم ورودي: باید ${n} وای, مګر ${e} ترلاسه شو`}case"invalid_value":if(i.values.length===1)return`ناسم ورودي: باید ${J(i.values[0])} وای`;return`ناسم انتخاب: باید یو له ${h(i.values,"|")} څخه وای`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`ډیر لوی: ${i.origin??"ارزښت"} باید ${n}${i.maximum.toString()} ${o.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${i.origin??"ارزښت"} باید ${n}${i.maximum.toString()} وي`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`ډیر کوچنی: ${i.origin} باید ${n}${i.minimum.toString()} ${o.unit} ولري`;return`ډیر کوچنی: ${i.origin} باید ${n}${i.minimum.toString()} وي`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`ناسم متن: باید د "${n.prefix}" سره پیل شي`;if(n.format==="ends_with")return`ناسم متن: باید د "${n.suffix}" سره پای ته ورسيږي`;if(n.format==="includes")return`ناسم متن: باید "${n.includes}" ولري`;if(n.format==="regex")return`ناسم متن: باید د ${n.pattern} سره مطابقت ولري`;return`${u[n.format]??i.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${i.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${i.keys.length>1?"کلیډونه":"کلیډ"}: ${h(i.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${i.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${i.origin} کې`;default:return"ناسمه ورودي"}}};function D6(){return{localeError:hy()}}var zy=()=>{let r={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(i){return r[i]??null}let u={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},D={nan:"NaN",number:"liczba",array:"tablica"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${i.expected}, otrzymano ${e}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${n}, otrzymano ${e}`}case"invalid_value":if(i.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${J(i.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Za duża wartość: oczekiwano, że ${i.origin??"wartość"} będzie mieć ${n}${i.maximum.toString()} ${o.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${i.origin??"wartość"} będzie wynosić ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Za mała wartość: oczekiwano, że ${i.origin??"wartość"} będzie mieć ${n}${i.minimum.toString()} ${o.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${i.origin??"wartość"} będzie wynosić ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${n.prefix}"`;if(n.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${n.suffix}"`;if(n.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${n.includes}"`;if(n.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${n.pattern}`;return`Nieprawidłow(y/a/e) ${u[n.format]??i.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${h(i.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${i.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${i.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function n6(){return{localeError:zy()}}var Jy=()=>{let r={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(i){return r[i]??null}let u={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},D={nan:"NaN",number:"número",null:"nulo"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Tipo inválido: esperado instanceof ${i.expected}, recebido ${e}`;return`Tipo inválido: esperado ${n}, recebido ${e}`}case"invalid_value":if(i.values.length===1)return`Entrada inválida: esperado ${J(i.values[0])}`;return`Opção inválida: esperada uma das ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Muito grande: esperado que ${i.origin??"valor"} tivesse ${n}${i.maximum.toString()} ${o.unit??"elementos"}`;return`Muito grande: esperado que ${i.origin??"valor"} fosse ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Muito pequeno: esperado que ${i.origin} tivesse ${n}${i.minimum.toString()} ${o.unit}`;return`Muito pequeno: esperado que ${i.origin} fosse ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Texto inválido: deve começar com "${n.prefix}"`;if(n.format==="ends_with")return`Texto inválido: deve terminar com "${n.suffix}"`;if(n.format==="includes")return`Texto inválido: deve incluir "${n.includes}"`;if(n.format==="regex")return`Texto inválido: deve corresponder ao padrão ${n.pattern}`;return`${u[n.format]??i.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${h(i.keys,", ")}`;case"invalid_key":return`Chave inválida em ${i.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${i.origin}`;default:return"Campo inválido"}}};function o6(){return{localeError:Jy()}}function C3(r,t,u,D){let i=Math.abs(r),n=i%10,o=i%100;if(o>=11&&o<=19)return D;if(n===1)return t;if(n>=2&&n<=4)return u;return D}var Ay=()=>{let r={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(i){return r[i]??null}let u={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},D={nan:"NaN",number:"число",array:"массив"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Неверный ввод: ожидалось instanceof ${i.expected}, получено ${e}`;return`Неверный ввод: ожидалось ${n}, получено ${e}`}case"invalid_value":if(i.values.length===1)return`Неверный ввод: ожидалось ${J(i.values[0])}`;return`Неверный вариант: ожидалось одно из ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o){let e=Number(i.maximum),f=C3(e,o.unit.one,o.unit.few,o.unit.many);return`Слишком большое значение: ожидалось, что ${i.origin??"значение"} будет иметь ${n}${i.maximum.toString()} ${f}`}return`Слишком большое значение: ожидалось, что ${i.origin??"значение"} будет ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o){let e=Number(i.minimum),f=C3(e,o.unit.one,o.unit.few,o.unit.many);return`Слишком маленькое значение: ожидалось, что ${i.origin} будет иметь ${n}${i.minimum.toString()} ${f}`}return`Слишком маленькое значение: ожидалось, что ${i.origin} будет ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Неверная строка: должна начинаться с "${n.prefix}"`;if(n.format==="ends_with")return`Неверная строка: должна заканчиваться на "${n.suffix}"`;if(n.format==="includes")return`Неверная строка: должна содержать "${n.includes}"`;if(n.format==="regex")return`Неверная строка: должна соответствовать шаблону ${n.pattern}`;return`Неверный ${u[n.format]??i.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспознанн${i.keys.length>1?"ые":"ый"} ключ${i.keys.length>1?"и":""}: ${h(i.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${i.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${i.origin}`;default:return"Неверные входные данные"}}};function e6(){return{localeError:Ay()}}var Xy=()=>{let r={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(i){return r[i]??null}let u={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},D={nan:"NaN",number:"število",array:"tabela"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Neveljaven vnos: pričakovano instanceof ${i.expected}, prejeto ${e}`;return`Neveljaven vnos: pričakovano ${n}, prejeto ${e}`}case"invalid_value":if(i.values.length===1)return`Neveljaven vnos: pričakovano ${J(i.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Preveliko: pričakovano, da bo ${i.origin??"vrednost"} imelo ${n}${i.maximum.toString()} ${o.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${i.origin??"vrednost"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Premajhno: pričakovano, da bo ${i.origin} imelo ${n}${i.minimum.toString()} ${o.unit}`;return`Premajhno: pričakovano, da bo ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Neveljaven niz: mora se začeti z "${n.prefix}"`;if(n.format==="ends_with")return`Neveljaven niz: mora se končati z "${n.suffix}"`;if(n.format==="includes")return`Neveljaven niz: mora vsebovati "${n.includes}"`;if(n.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${n.pattern}`;return`Neveljaven ${u[n.format]??i.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i ključi":" ključ"}: ${h(i.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};function f6(){return{localeError:Xy()}}var jy=()=>{let r={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(i){return r[i]??null}let u={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},D={nan:"NaN",number:"antal",array:"lista"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Ogiltig inmatning: förväntat instanceof ${i.expected}, fick ${e}`;return`Ogiltig inmatning: förväntat ${n}, fick ${e}`}case"invalid_value":if(i.values.length===1)return`Ogiltig inmatning: förväntat ${J(i.values[0])}`;return`Ogiltigt val: förväntade en av ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`För stor(t): förväntade ${i.origin??"värdet"} att ha ${n}${i.maximum.toString()} ${o.unit??"element"}`;return`För stor(t): förväntat ${i.origin??"värdet"} att ha ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`För lite(t): förväntade ${i.origin??"värdet"} att ha ${n}${i.minimum.toString()} ${o.unit}`;return`För lite(t): förväntade ${i.origin??"värdet"} att ha ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Ogiltig sträng: måste börja med "${n.prefix}"`;if(n.format==="ends_with")return`Ogiltig sträng: måste sluta med "${n.suffix}"`;if(n.format==="includes")return`Ogiltig sträng: måste innehålla "${n.includes}"`;if(n.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${n.pattern}"`;return`Ogiltig(t) ${u[n.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${h(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${i.origin??"värdet"}`;default:return"Ogiltig input"}}};function $6(){return{localeError:jy()}}var Gy=()=>{let r={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(i){return r[i]??null}let u={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},D={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${i.expected}, பெறப்பட்டது ${e}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${n}, பெறப்பட்டது ${e}`}case"invalid_value":if(i.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${J(i.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${h(i.values,"|")} இல் ஒன்று`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${i.origin??"மதிப்பு"} ${n}${i.maximum.toString()} ${o.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${i.origin??"மதிப்பு"} ${n}${i.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${i.origin} ${n}${i.minimum.toString()} ${o.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${i.origin} ${n}${i.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`தவறான சரம்: "${n.prefix}" இல் தொடங்க வேண்டும்`;if(n.format==="ends_with")return`தவறான சரம்: "${n.suffix}" இல் முடிவடைய வேண்டும்`;if(n.format==="includes")return`தவறான சரம்: "${n.includes}" ஐ உள்ளடக்க வேண்டும்`;if(n.format==="regex")return`தவறான சரம்: ${n.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${u[n.format]??i.format}`}case"not_multiple_of":return`தவறான எண்: ${i.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${i.keys.length>1?"கள்":""}: ${h(i.keys,", ")}`;case"invalid_key":return`${i.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${i.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function l6(){return{localeError:Gy()}}var Wy=()=>{let r={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(i){return r[i]??null}let u={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},D={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${i.expected} แต่ได้รับ ${e}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${n} แต่ได้รับ ${e}`}case"invalid_value":if(i.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${J(i.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"ไม่เกิน":"น้อยกว่า",o=t(i.origin);if(o)return`เกินกำหนด: ${i.origin??"ค่า"} ควรมี${n} ${i.maximum.toString()} ${o.unit??"รายการ"}`;return`เกินกำหนด: ${i.origin??"ค่า"} ควรมี${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?"อย่างน้อย":"มากกว่า",o=t(i.origin);if(o)return`น้อยกว่ากำหนด: ${i.origin} ควรมี${n} ${i.minimum.toString()} ${o.unit}`;return`น้อยกว่ากำหนด: ${i.origin} ควรมี${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${n.prefix}"`;if(n.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${n.suffix}"`;if(n.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${n.includes}" อยู่ในข้อความ`;if(n.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${n.pattern}`;return`รูปแบบไม่ถูกต้อง: ${u[n.format]??i.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${i.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${h(i.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${i.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${i.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function m6(){return{localeError:Wy()}}var Yy=()=>{let r={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(i){return r[i]??null}let u={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},D={nan:"NaN"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Geçersiz değer: beklenen instanceof ${i.expected}, alınan ${e}`;return`Geçersiz değer: beklenen ${n}, alınan ${e}`}case"invalid_value":if(i.values.length===1)return`Geçersiz değer: beklenen ${J(i.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()} ${o.unit??"öğe"}`;return`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`;return`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Geçersiz metin: "${n.prefix}" ile başlamalı`;if(n.format==="ends_with")return`Geçersiz metin: "${n.suffix}" ile bitmeli`;if(n.format==="includes")return`Geçersiz metin: "${n.includes}" içermeli`;if(n.format==="regex")return`Geçersiz metin: ${n.pattern} desenine uymalı`;return`Geçersiz ${u[n.format]??i.format}`}case"not_multiple_of":return`Geçersiz sayı: ${i.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${h(i.keys,", ")}`;case"invalid_key":return`${i.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${i.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function c6(){return{localeError:Yy()}}var Ty=()=>{let r={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(i){return r[i]??null}let u={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},D={nan:"NaN",number:"число",array:"масив"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Неправильні вхідні дані: очікується instanceof ${i.expected}, отримано ${e}`;return`Неправильні вхідні дані: очікується ${n}, отримано ${e}`}case"invalid_value":if(i.values.length===1)return`Неправильні вхідні дані: очікується ${J(i.values[0])}`;return`Неправильна опція: очікується одне з ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Занадто велике: очікується, що ${i.origin??"значення"} ${o.verb} ${n}${i.maximum.toString()} ${o.unit??"елементів"}`;return`Занадто велике: очікується, що ${i.origin??"значення"} буде ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Занадто мале: очікується, що ${i.origin} ${o.verb} ${n}${i.minimum.toString()} ${o.unit}`;return`Занадто мале: очікується, що ${i.origin} буде ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Неправильний рядок: повинен починатися з "${n.prefix}"`;if(n.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${n.suffix}"`;if(n.format==="includes")return`Неправильний рядок: повинен містити "${n.includes}"`;if(n.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${n.pattern}`;return`Неправильний ${u[n.format]??i.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${i.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${i.keys.length>1?"і":""}: ${h(i.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${i.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${i.origin}`;default:return"Неправильні вхідні дані"}}};function CD(){return{localeError:Ty()}}function v6(){return CD()}var Ry=()=>{let r={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(i){return r[i]??null}let u={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},D={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`غلط ان پٹ: instanceof ${i.expected} متوقع تھا، ${e} موصول ہوا`;return`غلط ان پٹ: ${n} متوقع تھا، ${e} موصول ہوا`}case"invalid_value":if(i.values.length===1)return`غلط ان پٹ: ${J(i.values[0])} متوقع تھا`;return`غلط آپشن: ${h(i.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`بہت بڑا: ${i.origin??"ویلیو"} کے ${n}${i.maximum.toString()} ${o.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${i.origin??"ویلیو"} کا ${n}${i.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`بہت چھوٹا: ${i.origin} کے ${n}${i.minimum.toString()} ${o.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${i.origin} کا ${n}${i.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`غلط سٹرنگ: "${n.prefix}" سے شروع ہونا چاہیے`;if(n.format==="ends_with")return`غلط سٹرنگ: "${n.suffix}" پر ختم ہونا چاہیے`;if(n.format==="includes")return`غلط سٹرنگ: "${n.includes}" شامل ہونا چاہیے`;if(n.format==="regex")return`غلط سٹرنگ: پیٹرن ${n.pattern} سے میچ ہونا چاہیے`;return`غلط ${u[n.format]??i.format}`}case"not_multiple_of":return`غلط نمبر: ${i.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${i.keys.length>1?"ز":""}: ${h(i.keys,"، ")}`;case"invalid_key":return`${i.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${i.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function E6(){return{localeError:Ry()}}var Vy=()=>{let r={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function t(i){return r[i]??null}let u={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},D={nan:"NaN",number:"raqam",array:"massiv"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${e}`;return`Noto‘g‘ri kirish: kutilgan ${n}, qabul qilingan ${e}`}case"invalid_value":if(i.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${J(i.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Juda katta: kutilgan ${i.origin??"qiymat"} ${n}${i.maximum.toString()} ${o.unit} ${o.verb}`;return`Juda katta: kutilgan ${i.origin??"qiymat"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Juda kichik: kutilgan ${i.origin} ${n}${i.minimum.toString()} ${o.unit} ${o.verb}`;return`Juda kichik: kutilgan ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Noto‘g‘ri satr: "${n.prefix}" bilan boshlanishi kerak`;if(n.format==="ends_with")return`Noto‘g‘ri satr: "${n.suffix}" bilan tugashi kerak`;if(n.format==="includes")return`Noto‘g‘ri satr: "${n.includes}" ni o‘z ichiga olishi kerak`;if(n.format==="regex")return`Noto‘g‘ri satr: ${n.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${u[n.format]??i.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${i.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${i.keys.length>1?"lar":""}: ${h(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${i.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function F6(){return{localeError:Vy()}}var Sy=()=>{let r={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(i){return r[i]??null}let u={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},D={nan:"NaN",number:"số",array:"mảng"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${i.expected}, nhận được ${e}`;return`Đầu vào không hợp lệ: mong đợi ${n}, nhận được ${e}`}case"invalid_value":if(i.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${J(i.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Quá lớn: mong đợi ${i.origin??"giá trị"} ${o.verb} ${n}${i.maximum.toString()} ${o.unit??"phần tử"}`;return`Quá lớn: mong đợi ${i.origin??"giá trị"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Quá nhỏ: mong đợi ${i.origin} ${o.verb} ${n}${i.minimum.toString()} ${o.unit}`;return`Quá nhỏ: mong đợi ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${n.prefix}"`;if(n.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${n.suffix}"`;if(n.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${n.includes}"`;if(n.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${n.pattern}`;return`${u[n.format]??i.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${i.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${h(i.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${i.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${i.origin}`;default:return"Đầu vào không hợp lệ"}}};function g6(){return{localeError:Sy()}}var Qy=()=>{let r={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(i){return r[i]??null}let u={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},D={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`无效输入:期望 instanceof ${i.expected},实际接收 ${e}`;return`无效输入:期望 ${n},实际接收 ${e}`}case"invalid_value":if(i.values.length===1)return`无效输入:期望 ${J(i.values[0])}`;return`无效选项:期望以下之一 ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`数值过大:期望 ${i.origin??"值"} ${n}${i.maximum.toString()} ${o.unit??"个元素"}`;return`数值过大:期望 ${i.origin??"值"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`数值过小:期望 ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`;return`数值过小:期望 ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`无效字符串:必须以 "${n.prefix}" 开头`;if(n.format==="ends_with")return`无效字符串:必须以 "${n.suffix}" 结尾`;if(n.format==="includes")return`无效字符串:必须包含 "${n.includes}"`;if(n.format==="regex")return`无效字符串:必须满足正则表达式 ${n.pattern}`;return`无效${u[n.format]??i.format}`}case"not_multiple_of":return`无效数字:必须是 ${i.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${h(i.keys,", ")}`;case"invalid_key":return`${i.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${i.origin} 中包含无效值(value)`;default:return"无效输入"}}};function w6(){return{localeError:Qy()}}var Ky=()=>{let r={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(i){return r[i]??null}let u={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},D={nan:"NaN"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`無效的輸入值:預期為 instanceof ${i.expected},但收到 ${e}`;return`無效的輸入值:預期為 ${n},但收到 ${e}`}case"invalid_value":if(i.values.length===1)return`無效的輸入值:預期為 ${J(i.values[0])}`;return`無效的選項:預期為以下其中之一 ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`數值過大:預期 ${i.origin??"值"} 應為 ${n}${i.maximum.toString()} ${o.unit??"個元素"}`;return`數值過大:預期 ${i.origin??"值"} 應為 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`數值過小:預期 ${i.origin} 應為 ${n}${i.minimum.toString()} ${o.unit}`;return`數值過小:預期 ${i.origin} 應為 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`無效的字串:必須以 "${n.prefix}" 開頭`;if(n.format==="ends_with")return`無效的字串:必須以 "${n.suffix}" 結尾`;if(n.format==="includes")return`無效的字串:必須包含 "${n.includes}"`;if(n.format==="regex")return`無效的字串:必須符合格式 ${n.pattern}`;return`無效的 ${u[n.format]??i.format}`}case"not_multiple_of":return`無效的數字:必須為 ${i.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${i.keys.length>1?"們":""}:${h(i.keys,"、")}`;case"invalid_key":return`${i.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${i.origin} 中有無效的值`;default:return"無效的輸入值"}}};function b6(){return{localeError:Ky()}}var Hy=()=>{let r={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(i){return r[i]??null}let u={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},D={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(i)=>{switch(i.code){case"invalid_type":{let n=D[i.expected]??i.expected,o=X(i.input),e=D[o]??o;if(/^[A-Z]/.test(i.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${i.expected}, àmọ̀ a rí ${e}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${n}, àmọ̀ a rí ${e}`}case"invalid_value":if(i.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${J(i.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${h(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${i.origin??"iye"} ${o.verb} ${n}${i.maximum} ${o.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${n}${i.maximum}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Kéré ju: a ní láti jẹ́ pé ${i.origin} ${o.verb} ${n}${i.minimum} ${o.unit}`;return`Kéré ju: a ní láti jẹ́ ${n}${i.minimum}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${n.prefix}"`;if(n.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${n.suffix}"`;if(n.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${n.includes}"`;if(n.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${n.pattern}`;return`Aṣìṣe: ${u[n.format]??i.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${i.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${h(i.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${i.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${i.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function C6(){return{localeError:Hy()}}var _3,_6=Symbol("ZodOutput"),I6=Symbol("ZodInput");class U6{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...t){let u=t[0];if(this._map.set(r,u),u&&typeof u==="object"&&"id"in u)this._idmap.set(u.id,r);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){let t=this._map.get(r);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(r),this}get(r){let t=r._zod.parent;if(t){let u={...this.get(t)??{}};delete u.id;let D={...u,...this._map.get(r)};return Object.keys(D).length?D:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function qo(){return new U6}(_3=globalThis).__zod_globalRegistry??(_3.__zod_globalRegistry=qo());var Rr=globalThis.__zod_globalRegistry;function O6(r,t){return new r({type:"string",...W(t)})}function y6(r,t){return new r({type:"string",coerce:!0,...W(t)})}function ho(r,t){return new r({type:"string",format:"email",check:"string_format",abort:!1,...W(t)})}function ID(r,t){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...W(t)})}function zo(r,t){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...W(t)})}function Jo(r,t){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...W(t)})}function Ao(r,t){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...W(t)})}function Xo(r,t){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...W(t)})}function UD(r,t){return new r({type:"string",format:"url",check:"string_format",abort:!1,...W(t)})}function jo(r,t){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...W(t)})}function Go(r,t){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...W(t)})}function Wo(r,t){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...W(t)})}function Yo(r,t){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...W(t)})}function To(r,t){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...W(t)})}function Ro(r,t){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...W(t)})}function Vo(r,t){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...W(t)})}function So(r,t){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...W(t)})}function Qo(r,t){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...W(t)})}function N6(r,t){return new r({type:"string",format:"mac",check:"string_format",abort:!1,...W(t)})}function Ko(r,t){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...W(t)})}function Ho(r,t){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...W(t)})}function Mo(r,t){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...W(t)})}function Zo(r,t){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...W(t)})}function Lo(r,t){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...W(t)})}function Po(r,t){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...W(t)})}var B6={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function q6(r,t){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...W(t)})}function h6(r,t){return new r({type:"string",format:"date",check:"string_format",...W(t)})}function z6(r,t){return new r({type:"string",format:"time",check:"string_format",precision:null,...W(t)})}function J6(r,t){return new r({type:"string",format:"duration",check:"string_format",...W(t)})}function A6(r,t){return new r({type:"number",checks:[],...W(t)})}function X6(r,t){return new r({type:"number",coerce:!0,checks:[],...W(t)})}function j6(r,t){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...W(t)})}function G6(r,t){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...W(t)})}function W6(r,t){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...W(t)})}function Y6(r,t){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...W(t)})}function T6(r,t){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...W(t)})}function R6(r,t){return new r({type:"boolean",...W(t)})}function V6(r,t){return new r({type:"boolean",coerce:!0,...W(t)})}function S6(r,t){return new r({type:"bigint",...W(t)})}function Q6(r,t){return new r({type:"bigint",coerce:!0,...W(t)})}function K6(r,t){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...W(t)})}function H6(r,t){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...W(t)})}function M6(r,t){return new r({type:"symbol",...W(t)})}function Z6(r,t){return new r({type:"undefined",...W(t)})}function L6(r,t){return new r({type:"null",...W(t)})}function P6(r){return new r({type:"any"})}function k6(r){return new r({type:"unknown"})}function d6(r,t){return new r({type:"never",...W(t)})}function x6(r,t){return new r({type:"void",...W(t)})}function p6(r,t){return new r({type:"date",...W(t)})}function a6(r,t){return new r({type:"date",coerce:!0,...W(t)})}function s6(r,t){return new r({type:"nan",...W(t)})}function _t(r,t){return new Fo({check:"less_than",...W(t),value:r,inclusive:!1})}function sr(r,t){return new Fo({check:"less_than",...W(t),value:r,inclusive:!0})}function It(r,t){return new go({check:"greater_than",...W(t),value:r,inclusive:!1})}function Mr(r,t){return new go({check:"greater_than",...W(t),value:r,inclusive:!0})}function ko(r){return It(0,r)}function xo(r){return _t(0,r)}function po(r){return sr(0,r)}function ao(r){return Mr(0,r)}function st(r,t){return new sl({check:"multiple_of",...W(t),value:r})}function ri(r,t){return new im({check:"max_size",...W(t),maximum:r})}function Ut(r,t){return new um({check:"min_size",...W(t),minimum:r})}function Ii(r,t){return new Dm({check:"size_equals",...W(t),size:r})}function Ui(r,t){return new nm({check:"max_length",...W(t),maximum:r})}function jt(r,t){return new om({check:"min_length",...W(t),minimum:r})}function Oi(r,t){return new em({check:"length_equals",...W(t),length:r})}function tu(r,t){return new fm({check:"string_format",format:"regex",...W(t),pattern:r})}function iu(r){return new $m({check:"string_format",format:"lowercase",...W(r)})}function uu(r){return new lm({check:"string_format",format:"uppercase",...W(r)})}function Du(r,t){return new mm({check:"string_format",format:"includes",...W(t),includes:r})}function nu(r,t){return new cm({check:"string_format",format:"starts_with",...W(t),prefix:r})}function ou(r,t){return new vm({check:"string_format",format:"ends_with",...W(t),suffix:r})}function so(r,t,u){return new Em({check:"property",property:r,schema:t,...W(u)})}function eu(r,t){return new Fm({check:"mime_type",mime:r,...W(t)})}function Et(r){return new gm({check:"overwrite",tx:r})}function fu(r){return Et((t)=>t.normalize(r))}function $u(){return Et((r)=>r.trim())}function lu(){return Et((r)=>r.toLowerCase())}function mu(){return Et((r)=>r.toUpperCase())}function cu(){return Et((r)=>El(r))}function r1(r,t,u){return new r({type:"array",element:t,...W(u)})}function Zy(r,t,u){return new r({type:"union",options:t,...W(u)})}function Ly(r,t,u){return new r({type:"union",options:t,inclusive:!1,...W(u)})}function Py(r,t,u,D){return new r({type:"union",options:u,discriminator:t,...W(D)})}function ky(r,t,u){return new r({type:"intersection",left:t,right:u})}function dy(r,t,u,D){let i=u instanceof x;return new r({type:"tuple",items:t,rest:i?u:null,...W(i?D:u)})}function xy(r,t,u,D){return new r({type:"record",keyType:t,valueType:u,...W(D)})}function py(r,t,u,D){return new r({type:"map",keyType:t,valueType:u,...W(D)})}function ay(r,t,u){return new r({type:"set",valueType:t,...W(u)})}function sy(r,t,u){let D=Array.isArray(t)?Object.fromEntries(t.map((i)=>[i,i])):t;return new r({type:"enum",entries:D,...W(u)})}function rN(r,t,u){return new r({type:"enum",entries:t,...W(u)})}function tN(r,t,u){return new r({type:"literal",values:Array.isArray(t)?t:[t],...W(u)})}function t1(r,t){return new r({type:"file",...W(t)})}function iN(r,t){return new r({type:"transform",transform:t})}function uN(r,t){return new r({type:"optional",innerType:t})}function DN(r,t){return new r({type:"nullable",innerType:t})}function nN(r,t,u){return new r({type:"default",innerType:t,get defaultValue(){return typeof u==="function"?u():gl(u)}})}function oN(r,t,u){return new r({type:"nonoptional",innerType:t,...W(u)})}function eN(r,t){return new r({type:"success",innerType:t})}function fN(r,t,u){return new r({type:"catch",innerType:t,catchValue:typeof u==="function"?u:()=>u})}function $N(r,t,u){return new r({type:"pipe",in:t,out:u})}function lN(r,t){return new r({type:"readonly",innerType:t})}function mN(r,t,u){return new r({type:"template_literal",parts:t,...W(u)})}function cN(r,t){return new r({type:"lazy",getter:t})}function vN(r,t){return new r({type:"promise",innerType:t})}function i1(r,t,u){let D=W(u);return D.abort??(D.abort=!0),new r({type:"custom",check:"custom",fn:t,...D})}function u1(r,t,u){return new r({type:"custom",check:"custom",fn:t,...W(u)})}function D1(r){let t=I3((u)=>{return u.addIssue=(D)=>{if(typeof D==="string")u.issues.push(ki(D,u.value,t._zod.def));else{let i=D;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=u.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),u.issues.push(ki(i))}},r(u.value,u)});return t}function I3(r,t){let u=new br({check:"custom",...W(t)});return u._zod.check=r,u}function n1(r){let t=new br({check:"describe"});return t._zod.onattach=[(u)=>{let D=Rr.get(u)??{};Rr.add(u,{...D,description:r})}],t._zod.check=()=>{},t}function o1(r){let t=new br({check:"meta"});return t._zod.onattach=[(u)=>{let D=Rr.get(u)??{};Rr.add(u,{...D,...r})}],t._zod.check=()=>{},t}function e1(r,t){let u=W(t),D=u.truthy??["true","1","yes","on","y","enabled"],i=u.falsy??["false","0","no","off","n","disabled"];if(u.case!=="sensitive")D=D.map((g)=>typeof g==="string"?g.toLowerCase():g),i=i.map((g)=>typeof g==="string"?g.toLowerCase():g);let n=new Set(D),o=new Set(i),e=r.Codec??FD,f=r.Boolean??vD,l=new(r.String??_i)({type:"string",error:u.error}),m=new f({type:"boolean",error:u.error}),c=new e({type:"pipe",in:l,out:m,transform:(g,_)=>{let q=g;if(u.case!=="sensitive")q=q.toLowerCase();if(n.has(q))return!0;else if(o.has(q))return!1;else return _.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...o],input:_.value,inst:c,continue:!1}),{}},reverseTransform:(g,_)=>{if(g===!0)return D[0]||"true";else return i[0]||"false"},error:u.error});return c}function vu(r,t,u,D={}){let i=W(D),n={...W(D),check:"string_format",type:"string",format:t,fn:typeof u==="function"?u:(e)=>u.test(e),...i};if(u instanceof RegExp)n.pattern=u;return new r(n)}function ti(r){let t=r?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:r.processors??{},metadataRegistry:r?.metadata??Rr,target:t,unrepresentable:r?.unrepresentable??"throw",override:r?.override??(()=>{}),io:r?.io??"output",counter:0,seen:new Map,cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0}}function vr(r,t,u={path:[],schemaPath:[]}){var D;let i=r._zod.def,n=t.seen.get(r);if(n){if(n.count++,u.schemaPath.includes(r))n.cycle=u.path;return n.schema}let o={schema:{},count:1,cycle:void 0,path:u.path};t.seen.set(r,o);let e=r._zod.toJSONSchema?.();if(e)o.schema=e;else{let l={...u,schemaPath:[...u.schemaPath,r],path:u.path};if(r._zod.processJSONSchema)r._zod.processJSONSchema(t,o.schema,l);else{let c=o.schema,g=t.processors[i.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);g(r,t,c,l)}let m=r._zod.parent;if(m){if(!o.ref)o.ref=m;vr(m,t,l),t.seen.get(m).isParent=!0}}let f=t.metadataRegistry.get(r);if(f)Object.assign(o.schema,f);if(t.io==="input"&&Zr(r))delete o.schema.examples,delete o.schema.default;if(t.io==="input"&&o.schema._prefault)(D=o.schema).default??(D.default=o.schema._prefault);return delete o.schema._prefault,t.seen.get(r).schema}function ii(r,t){let u=r.seen.get(t);if(!u)throw new Error("Unprocessed schema. This is a bug in Zod.");let D=new Map;for(let o of r.seen.entries()){let e=r.metadataRegistry.get(o[0])?.id;if(e){let f=D.get(e);if(f&&f!==o[0])throw new Error(`Duplicate schema id "${e}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);D.set(e,o[0])}}let i=(o)=>{let e=r.target==="draft-2020-12"?"$defs":"definitions";if(r.external){let m=r.external.registry.get(o[0])?.id,c=r.external.uri??((_)=>_);if(m)return{ref:c(m)};let g=o[1].defId??o[1].schema.id??`schema${r.counter++}`;return o[1].defId=g,{defId:g,ref:`${c("__shared")}#/${e}/${g}`}}if(o[1]===u)return{ref:"#"};let $=`${"#"}/${e}/`,l=o[1].schema.id??`__schema${r.counter++}`;return{defId:l,ref:$+l}},n=(o)=>{if(o[1].schema.$ref)return;let e=o[1],{ref:f,defId:$}=i(o);if(e.def={...e.schema},$)e.defId=$;let l=e.schema;for(let m in l)delete l[m];l.$ref=f};if(r.cycles==="throw")for(let o of r.seen.entries()){let e=o[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
326
|
+
|
|
327
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of r.seen.entries()){let e=o[1];if(t===o[0]){n(o);continue}if(r.external){let $=r.external.registry.get(o[0])?.id;if(t!==o[0]&&$){n(o);continue}}if(r.metadataRegistry.get(o[0])?.id){n(o);continue}if(e.cycle){n(o);continue}if(e.count>1){if(r.reused==="ref"){n(o);continue}}}}function ui(r,t){let u=r.seen.get(t);if(!u)throw new Error("Unprocessed schema. This is a bug in Zod.");let D=(o)=>{let e=r.seen.get(o);if(e.ref===null)return;let f=e.def??e.schema,$={...f},l=e.ref;if(e.ref=null,l){D(l);let c=r.seen.get(l),g=c.schema;if(g.$ref&&(r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"))f.allOf=f.allOf??[],f.allOf.push(g);else Object.assign(f,g);if(Object.assign(f,$),o._zod.parent===l)for(let q in f){if(q==="$ref"||q==="allOf")continue;if(!(q in $))delete f[q]}if(g.$ref&&c.def)for(let q in f){if(q==="$ref"||q==="allOf")continue;if(q in c.def&&JSON.stringify(f[q])===JSON.stringify(c.def[q]))delete f[q]}}let m=o._zod.parent;if(m&&m!==l){D(m);let c=r.seen.get(m);if(c?.schema.$ref){if(f.$ref=c.schema.$ref,c.def)for(let g in f){if(g==="$ref"||g==="allOf")continue;if(g in c.def&&JSON.stringify(f[g])===JSON.stringify(c.def[g]))delete f[g]}}}r.override({zodSchema:o,jsonSchema:f,path:e.path??[]})};for(let o of[...r.seen.entries()].reverse())D(o[0]);let i={};if(r.target==="draft-2020-12")i.$schema="https://json-schema.org/draft/2020-12/schema";else if(r.target==="draft-07")i.$schema="http://json-schema.org/draft-07/schema#";else if(r.target==="draft-04")i.$schema="http://json-schema.org/draft-04/schema#";else if(r.target==="openapi-3.0");if(r.external?.uri){let o=r.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=r.external.uri(o)}Object.assign(i,u.def??u.schema);let n=r.external?.defs??{};for(let o of r.seen.entries()){let e=o[1];if(e.def&&e.defId)n[e.defId]=e.def}if(r.external);else if(Object.keys(n).length>0)if(r.target==="draft-2020-12")i.$defs=n;else i.definitions=n;try{let o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Eu(t,"input",r.processors),output:Eu(t,"output",r.processors)}},enumerable:!1,writable:!1}),o}catch(o){throw new Error("Error converting schema to JSON.")}}function Zr(r,t){let u=t??{seen:new Set};if(u.seen.has(r))return!1;u.seen.add(r);let D=r._zod.def;if(D.type==="transform")return!0;if(D.type==="array")return Zr(D.element,u);if(D.type==="set")return Zr(D.valueType,u);if(D.type==="lazy")return Zr(D.getter(),u);if(D.type==="promise"||D.type==="optional"||D.type==="nonoptional"||D.type==="nullable"||D.type==="readonly"||D.type==="default"||D.type==="prefault")return Zr(D.innerType,u);if(D.type==="intersection")return Zr(D.left,u)||Zr(D.right,u);if(D.type==="record"||D.type==="map")return Zr(D.keyType,u)||Zr(D.valueType,u);if(D.type==="pipe")return Zr(D.in,u)||Zr(D.out,u);if(D.type==="object"){for(let i in D.shape)if(Zr(D.shape[i],u))return!0;return!1}if(D.type==="union"){for(let i of D.options)if(Zr(i,u))return!0;return!1}if(D.type==="tuple"){for(let i of D.items)if(Zr(i,u))return!0;if(D.rest&&Zr(D.rest,u))return!0;return!1}return!1}var f1=(r,t={})=>(u)=>{let D=ti({...u,processors:t});return vr(r,D),ii(D,r),ui(D,r)},Eu=(r,t,u={})=>(D)=>{let{libraryOptions:i,target:n}=D??{},o=ti({...i??{},target:n,io:t,processors:u});return vr(r,o),ii(o,r),ui(o,r)};var EN={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},$1=(r,t,u,D)=>{let i=u;i.type="string";let{minimum:n,maximum:o,format:e,patterns:f,contentEncoding:$}=r._zod.bag;if(typeof n==="number")i.minLength=n;if(typeof o==="number")i.maxLength=o;if(e){if(i.format=EN[e]??e,i.format==="")delete i.format;if(e==="time")delete i.format}if($)i.contentEncoding=$;if(f&&f.size>0){let l=[...f];if(l.length===1)i.pattern=l[0].source;else if(l.length>1)i.allOf=[...l.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},l1=(r,t,u,D)=>{let i=u,{minimum:n,maximum:o,format:e,multipleOf:f,exclusiveMaximum:$,exclusiveMinimum:l}=r._zod.bag;if(typeof e==="string"&&e.includes("int"))i.type="integer";else i.type="number";if(typeof l==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")i.minimum=l,i.exclusiveMinimum=!0;else i.exclusiveMinimum=l;if(typeof n==="number"){if(i.minimum=n,typeof l==="number"&&t.target!=="draft-04")if(l>=n)delete i.minimum;else delete i.exclusiveMinimum}if(typeof $==="number")if(t.target==="draft-04"||t.target==="openapi-3.0")i.maximum=$,i.exclusiveMaximum=!0;else i.exclusiveMaximum=$;if(typeof o==="number"){if(i.maximum=o,typeof $==="number"&&t.target!=="draft-04")if($<=o)delete i.maximum;else delete i.exclusiveMaximum}if(typeof f==="number")i.multipleOf=f},m1=(r,t,u,D)=>{u.type="boolean"},c1=(r,t,u,D)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},v1=(r,t,u,D)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},E1=(r,t,u,D)=>{if(t.target==="openapi-3.0")u.type="string",u.nullable=!0,u.enum=[null];else u.type="null"},F1=(r,t,u,D)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},g1=(r,t,u,D)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},w1=(r,t,u,D)=>{u.not={}},b1=(r,t,u,D)=>{},C1=(r,t,u,D)=>{},_1=(r,t,u,D)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},I1=(r,t,u,D)=>{let i=r._zod.def,n=iD(i.entries);if(n.every((o)=>typeof o==="number"))u.type="number";if(n.every((o)=>typeof o==="string"))u.type="string";u.enum=n},U1=(r,t,u,D)=>{let i=r._zod.def,n=[];for(let o of i.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o==="bigint")if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else n.push(Number(o));else n.push(o);if(n.length===0);else if(n.length===1){let o=n[0];if(u.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0")u.enum=[o];else u.const=o}else{if(n.every((o)=>typeof o==="number"))u.type="number";if(n.every((o)=>typeof o==="string"))u.type="string";if(n.every((o)=>typeof o==="boolean"))u.type="boolean";if(n.every((o)=>o===null))u.type="null";u.enum=n}},O1=(r,t,u,D)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},y1=(r,t,u,D)=>{let i=u,n=r._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=n.source},N1=(r,t,u,D)=>{let i=u,n={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:e,mime:f}=r._zod.bag;if(o!==void 0)n.minLength=o;if(e!==void 0)n.maxLength=e;if(f)if(f.length===1)n.contentMediaType=f[0],Object.assign(i,n);else Object.assign(i,n),i.anyOf=f.map(($)=>({contentMediaType:$}));else Object.assign(i,n)},B1=(r,t,u,D)=>{u.type="boolean"},q1=(r,t,u,D)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},h1=(r,t,u,D)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},z1=(r,t,u,D)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},J1=(r,t,u,D)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},A1=(r,t,u,D)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},X1=(r,t,u,D)=>{let i=u,n=r._zod.def,{minimum:o,maximum:e}=r._zod.bag;if(typeof o==="number")i.minItems=o;if(typeof e==="number")i.maxItems=e;i.type="array",i.items=vr(n.element,t,{...D,path:[...D.path,"items"]})},j1=(r,t,u,D)=>{let i=u,n=r._zod.def;i.type="object",i.properties={};let o=n.shape;for(let $ in o)i.properties[$]=vr(o[$],t,{...D,path:[...D.path,"properties",$]});let e=new Set(Object.keys(o)),f=new Set([...e].filter(($)=>{let l=n.shape[$]._zod;if(t.io==="input")return l.optin===void 0;else return l.optout===void 0}));if(f.size>0)i.required=Array.from(f);if(n.catchall?._zod.def.type==="never")i.additionalProperties=!1;else if(!n.catchall){if(t.io==="output")i.additionalProperties=!1}else if(n.catchall)i.additionalProperties=vr(n.catchall,t,{...D,path:[...D.path,"additionalProperties"]})},te=(r,t,u,D)=>{let i=r._zod.def,n=i.inclusive===!1,o=i.options.map((e,f)=>vr(e,t,{...D,path:[...D.path,n?"oneOf":"anyOf",f]}));if(n)u.oneOf=o;else u.anyOf=o},G1=(r,t,u,D)=>{let i=r._zod.def,n=vr(i.left,t,{...D,path:[...D.path,"allOf",0]}),o=vr(i.right,t,{...D,path:[...D.path,"allOf",1]}),e=($)=>("allOf"in $)&&Object.keys($).length===1,f=[...e(n)?n.allOf:[n],...e(o)?o.allOf:[o]];u.allOf=f},W1=(r,t,u,D)=>{let i=u,n=r._zod.def;i.type="array";let o=t.target==="draft-2020-12"?"prefixItems":"items",e=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",f=n.items.map((c,g)=>vr(c,t,{...D,path:[...D.path,o,g]})),$=n.rest?vr(n.rest,t,{...D,path:[...D.path,e,...t.target==="openapi-3.0"?[n.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(i.prefixItems=f,$)i.items=$}else if(t.target==="openapi-3.0"){if(i.items={anyOf:f},$)i.items.anyOf.push($);if(i.minItems=f.length,!$)i.maxItems=f.length}else if(i.items=f,$)i.additionalItems=$;let{minimum:l,maximum:m}=r._zod.bag;if(typeof l==="number")i.minItems=l;if(typeof m==="number")i.maxItems=m},Y1=(r,t,u,D)=>{let i=u,n=r._zod.def;i.type="object";let o=n.keyType,f=o._zod.bag?.patterns;if(n.mode==="loose"&&f&&f.size>0){let l=vr(n.valueType,t,{...D,path:[...D.path,"patternProperties","*"]});i.patternProperties={};for(let m of f)i.patternProperties[m.source]=l}else{if(t.target==="draft-07"||t.target==="draft-2020-12")i.propertyNames=vr(n.keyType,t,{...D,path:[...D.path,"propertyNames"]});i.additionalProperties=vr(n.valueType,t,{...D,path:[...D.path,"additionalProperties"]})}let $=o._zod.values;if($){let l=[...$].filter((m)=>typeof m==="string"||typeof m==="number");if(l.length>0)i.required=l}},T1=(r,t,u,D)=>{let i=r._zod.def,n=vr(i.innerType,t,D),o=t.seen.get(r);if(t.target==="openapi-3.0")o.ref=i.innerType,u.nullable=!0;else u.anyOf=[n,{type:"null"}]},R1=(r,t,u,D)=>{let i=r._zod.def;vr(i.innerType,t,D);let n=t.seen.get(r);n.ref=i.innerType},V1=(r,t,u,D)=>{let i=r._zod.def;vr(i.innerType,t,D);let n=t.seen.get(r);n.ref=i.innerType,u.default=JSON.parse(JSON.stringify(i.defaultValue))},S1=(r,t,u,D)=>{let i=r._zod.def;vr(i.innerType,t,D);let n=t.seen.get(r);if(n.ref=i.innerType,t.io==="input")u._prefault=JSON.parse(JSON.stringify(i.defaultValue))},Q1=(r,t,u,D)=>{let i=r._zod.def;vr(i.innerType,t,D);let n=t.seen.get(r);n.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}u.default=o},K1=(r,t,u,D)=>{let i=r._zod.def,n=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;vr(n,t,D);let o=t.seen.get(r);o.ref=n},H1=(r,t,u,D)=>{let i=r._zod.def;vr(i.innerType,t,D);let n=t.seen.get(r);n.ref=i.innerType,u.readOnly=!0},M1=(r,t,u,D)=>{let i=r._zod.def;vr(i.innerType,t,D);let n=t.seen.get(r);n.ref=i.innerType},ie=(r,t,u,D)=>{let i=r._zod.def;vr(i.innerType,t,D);let n=t.seen.get(r);n.ref=i.innerType},Z1=(r,t,u,D)=>{let i=r._zod.innerType;vr(i,t,D);let n=t.seen.get(r);n.ref=i},re={string:$1,number:l1,boolean:m1,bigint:c1,symbol:v1,null:E1,undefined:F1,void:g1,never:w1,any:b1,unknown:C1,date:_1,enum:I1,literal:U1,nan:O1,template_literal:y1,file:N1,success:B1,custom:q1,function:h1,transform:z1,map:J1,set:A1,array:X1,object:j1,union:te,intersection:G1,tuple:W1,record:Y1,nullable:T1,nonoptional:R1,default:V1,prefault:S1,catch:Q1,pipe:K1,readonly:H1,promise:M1,optional:ie,lazy:Z1};function ue(r,t){if("_idmap"in r){let D=r,i=ti({...t,processors:re}),n={};for(let f of D._idmap.entries()){let[$,l]=f;vr(l,i)}let o={},e={registry:D,uri:t?.uri,defs:n};i.external=e;for(let f of D._idmap.entries()){let[$,l]=f;ii(i,l),o[$]=ui(i,l)}if(Object.keys(n).length>0){let f=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[f]:n}}return{schemas:o}}let u=ti({...t,processors:re});return vr(r,u),ii(u,r),ui(u,r)}class L1{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(r){this.ctx.counter=r}get seen(){return this.ctx.seen}constructor(r){let t=r?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=ti({processors:re,target:t,...r?.metadata&&{metadata:r.metadata},...r?.unrepresentable&&{unrepresentable:r.unrepresentable},...r?.override&&{override:r.override},...r?.io&&{io:r.io}})}process(r,t={path:[],schemaPath:[]}){return vr(r,this.ctx,t)}emit(r,t){if(t){if(t.cycles)this.ctx.cycles=t.cycles;if(t.reused)this.ctx.reused=t.reused;if(t.external)this.ctx.external=t.external}ii(this.ctx,r);let u=ui(this.ctx,r),{"~standard":D,...i}=u;return i}}var U3={};var OD={};Or(OD,{xor:()=>EF,xid:()=>T3,void:()=>fF,uuidv7:()=>z3,uuidv6:()=>h3,uuidv4:()=>q3,uuid:()=>B3,url:()=>J3,unknown:()=>yi,union:()=>Je,undefined:()=>oF,ulid:()=>Y3,uint64:()=>DF,uint32:()=>tF,tuple:()=>Bc,transform:()=>Xe,templateLiteral:()=>qF,symbol:()=>nF,superRefine:()=>sc,success:()=>yF,stringbool:()=>WF,stringFormat:()=>k3,string:()=>$e,strictObject:()=>cF,set:()=>CF,refine:()=>ac,record:()=>qc,readonly:()=>Lc,promise:()=>hF,preprocess:()=>TF,prefault:()=>Vc,pipe:()=>qD,partialRecord:()=>gF,optional:()=>ND,object:()=>mF,number:()=>lc,nullish:()=>OF,nullable:()=>BD,null:()=>Fc,nonoptional:()=>Sc,never:()=>ze,nativeEnum:()=>_F,nanoid:()=>j3,nan:()=>NF,meta:()=>jF,map:()=>bF,mac:()=>S3,looseRecord:()=>wF,looseObject:()=>vF,literal:()=>IF,lazy:()=>dc,ksuid:()=>R3,keyof:()=>lF,jwt:()=>P3,json:()=>YF,ipv6:()=>Q3,ipv4:()=>V3,intersection:()=>yc,int64:()=>uF,int32:()=>rF,int:()=>le,instanceof:()=>GF,httpUrl:()=>A3,hostname:()=>d3,hex:()=>x3,hash:()=>p3,guid:()=>N3,function:()=>zF,float64:()=>s3,float32:()=>a3,file:()=>UF,exactOptional:()=>Gc,enum:()=>Ae,emoji:()=>X3,email:()=>y3,e164:()=>L3,discriminatedUnion:()=>FF,describe:()=>XF,date:()=>$F,custom:()=>AF,cuid2:()=>W3,cuid:()=>G3,codec:()=>BF,cidrv6:()=>H3,cidrv4:()=>K3,check:()=>JF,catch:()=>Hc,boolean:()=>mc,bigint:()=>iF,base64url:()=>Z3,base64:()=>M3,array:()=>JD,any:()=>eF,_function:()=>zF,_default:()=>Tc,_ZodString:()=>me,ZodXor:()=>Ic,ZodXID:()=>be,ZodVoid:()=>Cc,ZodUnknown:()=>wc,ZodUnion:()=>XD,ZodUndefined:()=>vc,ZodUUID:()=>Ot,ZodURL:()=>hD,ZodULID:()=>we,ZodType:()=>rr,ZodTuple:()=>Nc,ZodTransform:()=>Xc,ZodTemplateLiteral:()=>Pc,ZodSymbol:()=>cc,ZodSuccess:()=>Qc,ZodStringFormat:()=>gr,ZodString:()=>wu,ZodSet:()=>zc,ZodRecord:()=>jD,ZodReadonly:()=>Zc,ZodPromise:()=>xc,ZodPrefault:()=>Rc,ZodPipe:()=>We,ZodOptional:()=>je,ZodObject:()=>AD,ZodNumberFormat:()=>Ni,ZodNumber:()=>Cu,ZodNullable:()=>Wc,ZodNull:()=>Ec,ZodNonOptional:()=>Ge,ZodNever:()=>bc,ZodNanoID:()=>Ee,ZodNaN:()=>Mc,ZodMap:()=>hc,ZodMAC:()=>$c,ZodLiteral:()=>Jc,ZodLazy:()=>kc,ZodKSUID:()=>Ce,ZodJWT:()=>qe,ZodIntersection:()=>Oc,ZodIPv6:()=>Ie,ZodIPv4:()=>_e,ZodGUID:()=>yD,ZodFunction:()=>pc,ZodFile:()=>Ac,ZodExactOptional:()=>jc,ZodEnum:()=>gu,ZodEmoji:()=>ve,ZodEmail:()=>ce,ZodE164:()=>Be,ZodDiscriminatedUnion:()=>Uc,ZodDefault:()=>Yc,ZodDate:()=>zD,ZodCustomStringFormat:()=>bu,ZodCustom:()=>GD,ZodCodec:()=>Ye,ZodCatch:()=>Kc,ZodCUID2:()=>ge,ZodCUID:()=>Fe,ZodCIDRv6:()=>Oe,ZodCIDRv4:()=>Ue,ZodBoolean:()=>_u,ZodBigIntFormat:()=>he,ZodBigInt:()=>Iu,ZodBase64URL:()=>Ne,ZodBase64:()=>ye,ZodArray:()=>_c,ZodAny:()=>gc});var De={};Or(De,{uppercase:()=>uu,trim:()=>$u,toUpperCase:()=>mu,toLowerCase:()=>lu,startsWith:()=>nu,slugify:()=>cu,size:()=>Ii,regex:()=>tu,property:()=>so,positive:()=>ko,overwrite:()=>Et,normalize:()=>fu,nonpositive:()=>po,nonnegative:()=>ao,negative:()=>xo,multipleOf:()=>st,minSize:()=>Ut,minLength:()=>jt,mime:()=>eu,maxSize:()=>ri,maxLength:()=>Ui,lte:()=>sr,lt:()=>_t,lowercase:()=>iu,length:()=>Oi,includes:()=>Du,gte:()=>Mr,gt:()=>It,endsWith:()=>ou});var Fu={};Or(Fu,{time:()=>d1,duration:()=>x1,datetime:()=>P1,date:()=>k1,ZodISOTime:()=>ee,ZodISODuration:()=>fe,ZodISODateTime:()=>ne,ZodISODate:()=>oe});var ne=I("ZodISODateTime",(r,t)=>{Jm.init(r,t),gr.init(r,t)});function P1(r){return q6(ne,r)}var oe=I("ZodISODate",(r,t)=>{Am.init(r,t),gr.init(r,t)});function k1(r){return h6(oe,r)}var ee=I("ZodISOTime",(r,t)=>{Xm.init(r,t),gr.init(r,t)});function d1(r){return z6(ee,r)}var fe=I("ZodISODuration",(r,t)=>{jm.init(r,t),gr.init(r,t)});function x1(r){return J6(fe,r)}var O3=(r,t)=>{eD.init(r,t),r.name="ZodError",Object.defineProperties(r,{format:{value:(u)=>$D(r,u)},flatten:{value:(u)=>fD(r,u)},addIssue:{value:(u)=>{r.issues.push(u),r.message=JSON.stringify(r.issues,Li,2)}},addIssues:{value:(u)=>{r.issues.push(...u),r.message=JSON.stringify(r.issues,Li,2)}},isEmpty:{get(){return r.issues.length===0}}})},gN=I("ZodError",O3),dr=I("ZodError",O3,{Parent:Error});var p1=di(dr),a1=xi(dr),s1=pi(dr),rc=ai(dr),tc=oo(dr),ic=eo(dr),uc=fo(dr),Dc=$o(dr),nc=lo(dr),oc=mo(dr),ec=co(dr),fc=vo(dr);var rr=I("ZodType",(r,t)=>{return x.init(r,t),Object.assign(r["~standard"],{jsonSchema:{input:Eu(r,"input"),output:Eu(r,"output")}}),r.toJSONSchema=f1(r,{}),r.def=t,r.type=t.type,Object.defineProperty(r,"_def",{value:t}),r.check=(...u)=>{return r.clone(j.mergeDefs(t,{checks:[...t.checks??[],...u.map((D)=>typeof D==="function"?{_zod:{check:D,def:{check:"custom"},onattach:[]}}:D)]}),{parent:!0})},r.with=r.check,r.clone=(u,D)=>Hr(r,u,D),r.brand=()=>r,r.register=(u,D)=>{return u.add(r,D),r},r.parse=(u,D)=>p1(r,u,D,{callee:r.parse}),r.safeParse=(u,D)=>s1(r,u,D),r.parseAsync=async(u,D)=>a1(r,u,D,{callee:r.parseAsync}),r.safeParseAsync=async(u,D)=>rc(r,u,D),r.spa=r.safeParseAsync,r.encode=(u,D)=>tc(r,u,D),r.decode=(u,D)=>ic(r,u,D),r.encodeAsync=async(u,D)=>uc(r,u,D),r.decodeAsync=async(u,D)=>Dc(r,u,D),r.safeEncode=(u,D)=>nc(r,u,D),r.safeDecode=(u,D)=>oc(r,u,D),r.safeEncodeAsync=async(u,D)=>ec(r,u,D),r.safeDecodeAsync=async(u,D)=>fc(r,u,D),r.refine=(u,D)=>r.check(ac(u,D)),r.superRefine=(u)=>r.check(sc(u)),r.overwrite=(u)=>r.check(Et(u)),r.optional=()=>ND(r),r.exactOptional=()=>Gc(r),r.nullable=()=>BD(r),r.nullish=()=>ND(BD(r)),r.nonoptional=(u)=>Sc(r,u),r.array=()=>JD(r),r.or=(u)=>Je([r,u]),r.and=(u)=>yc(r,u),r.transform=(u)=>qD(r,Xe(u)),r.default=(u)=>Tc(r,u),r.prefault=(u)=>Vc(r,u),r.catch=(u)=>Hc(r,u),r.pipe=(u)=>qD(r,u),r.readonly=()=>Lc(r),r.describe=(u)=>{let D=r.clone();return Rr.add(D,{description:u}),D},Object.defineProperty(r,"description",{get(){return Rr.get(r)?.description},configurable:!0}),r.meta=(...u)=>{if(u.length===0)return Rr.get(r);let D=r.clone();return Rr.add(D,u[0]),D},r.isOptional=()=>r.safeParse(void 0).success,r.isNullable=()=>r.safeParse(null).success,r.apply=(u)=>u(r),r}),me=I("_ZodString",(r,t)=>{_i.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(D,i,n)=>$1(r,D,i,n);let u=r._zod.bag;r.format=u.format??null,r.minLength=u.minimum??null,r.maxLength=u.maximum??null,r.regex=(...D)=>r.check(tu(...D)),r.includes=(...D)=>r.check(Du(...D)),r.startsWith=(...D)=>r.check(nu(...D)),r.endsWith=(...D)=>r.check(ou(...D)),r.min=(...D)=>r.check(jt(...D)),r.max=(...D)=>r.check(Ui(...D)),r.length=(...D)=>r.check(Oi(...D)),r.nonempty=(...D)=>r.check(jt(1,...D)),r.lowercase=(D)=>r.check(iu(D)),r.uppercase=(D)=>r.check(uu(D)),r.trim=()=>r.check($u()),r.normalize=(...D)=>r.check(fu(...D)),r.toLowerCase=()=>r.check(lu()),r.toUpperCase=()=>r.check(mu()),r.slugify=()=>r.check(cu())}),wu=I("ZodString",(r,t)=>{_i.init(r,t),me.init(r,t),r.email=(u)=>r.check(ho(ce,u)),r.url=(u)=>r.check(UD(hD,u)),r.jwt=(u)=>r.check(Po(qe,u)),r.emoji=(u)=>r.check(jo(ve,u)),r.guid=(u)=>r.check(ID(yD,u)),r.uuid=(u)=>r.check(zo(Ot,u)),r.uuidv4=(u)=>r.check(Jo(Ot,u)),r.uuidv6=(u)=>r.check(Ao(Ot,u)),r.uuidv7=(u)=>r.check(Xo(Ot,u)),r.nanoid=(u)=>r.check(Go(Ee,u)),r.guid=(u)=>r.check(ID(yD,u)),r.cuid=(u)=>r.check(Wo(Fe,u)),r.cuid2=(u)=>r.check(Yo(ge,u)),r.ulid=(u)=>r.check(To(we,u)),r.base64=(u)=>r.check(Mo(ye,u)),r.base64url=(u)=>r.check(Zo(Ne,u)),r.xid=(u)=>r.check(Ro(be,u)),r.ksuid=(u)=>r.check(Vo(Ce,u)),r.ipv4=(u)=>r.check(So(_e,u)),r.ipv6=(u)=>r.check(Qo(Ie,u)),r.cidrv4=(u)=>r.check(Ko(Ue,u)),r.cidrv6=(u)=>r.check(Ho(Oe,u)),r.e164=(u)=>r.check(Lo(Be,u)),r.datetime=(u)=>r.check(P1(u)),r.date=(u)=>r.check(k1(u)),r.time=(u)=>r.check(d1(u)),r.duration=(u)=>r.check(x1(u))});function $e(r){return O6(wu,r)}var gr=I("ZodStringFormat",(r,t)=>{Fr.init(r,t),me.init(r,t)}),ce=I("ZodEmail",(r,t)=>{Im.init(r,t),gr.init(r,t)});function y3(r){return ho(ce,r)}var yD=I("ZodGUID",(r,t)=>{Cm.init(r,t),gr.init(r,t)});function N3(r){return ID(yD,r)}var Ot=I("ZodUUID",(r,t)=>{_m.init(r,t),gr.init(r,t)});function B3(r){return zo(Ot,r)}function q3(r){return Jo(Ot,r)}function h3(r){return Ao(Ot,r)}function z3(r){return Xo(Ot,r)}var hD=I("ZodURL",(r,t)=>{Um.init(r,t),gr.init(r,t)});function J3(r){return UD(hD,r)}function A3(r){return UD(hD,{protocol:/^https?$/,hostname:ot.domain,...j.normalizeParams(r)})}var ve=I("ZodEmoji",(r,t)=>{Om.init(r,t),gr.init(r,t)});function X3(r){return jo(ve,r)}var Ee=I("ZodNanoID",(r,t)=>{ym.init(r,t),gr.init(r,t)});function j3(r){return Go(Ee,r)}var Fe=I("ZodCUID",(r,t)=>{Nm.init(r,t),gr.init(r,t)});function G3(r){return Wo(Fe,r)}var ge=I("ZodCUID2",(r,t)=>{Bm.init(r,t),gr.init(r,t)});function W3(r){return Yo(ge,r)}var we=I("ZodULID",(r,t)=>{qm.init(r,t),gr.init(r,t)});function Y3(r){return To(we,r)}var be=I("ZodXID",(r,t)=>{hm.init(r,t),gr.init(r,t)});function T3(r){return Ro(be,r)}var Ce=I("ZodKSUID",(r,t)=>{zm.init(r,t),gr.init(r,t)});function R3(r){return Vo(Ce,r)}var _e=I("ZodIPv4",(r,t)=>{Gm.init(r,t),gr.init(r,t)});function V3(r){return So(_e,r)}var $c=I("ZodMAC",(r,t)=>{Ym.init(r,t),gr.init(r,t)});function S3(r){return N6($c,r)}var Ie=I("ZodIPv6",(r,t)=>{Wm.init(r,t),gr.init(r,t)});function Q3(r){return Qo(Ie,r)}var Ue=I("ZodCIDRv4",(r,t)=>{Tm.init(r,t),gr.init(r,t)});function K3(r){return Ko(Ue,r)}var Oe=I("ZodCIDRv6",(r,t)=>{Rm.init(r,t),gr.init(r,t)});function H3(r){return Ho(Oe,r)}var ye=I("ZodBase64",(r,t)=>{Sm.init(r,t),gr.init(r,t)});function M3(r){return Mo(ye,r)}var Ne=I("ZodBase64URL",(r,t)=>{Qm.init(r,t),gr.init(r,t)});function Z3(r){return Zo(Ne,r)}var Be=I("ZodE164",(r,t)=>{Km.init(r,t),gr.init(r,t)});function L3(r){return Lo(Be,r)}var qe=I("ZodJWT",(r,t)=>{Hm.init(r,t),gr.init(r,t)});function P3(r){return Po(qe,r)}var bu=I("ZodCustomStringFormat",(r,t)=>{Mm.init(r,t),gr.init(r,t)});function k3(r,t,u={}){return vu(bu,r,t,u)}function d3(r){return vu(bu,"hostname",ot.hostname,r)}function x3(r){return vu(bu,"hex",ot.hex,r)}function p3(r,t){let u=t?.enc??"hex",D=`${r}_${u}`,i=ot[D];if(!i)throw new Error(`Unrecognized hash format: ${D}`);return vu(bu,D,i,t)}var Cu=I("ZodNumber",(r,t)=>{Oo.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(D,i,n)=>l1(r,D,i,n),r.gt=(D,i)=>r.check(It(D,i)),r.gte=(D,i)=>r.check(Mr(D,i)),r.min=(D,i)=>r.check(Mr(D,i)),r.lt=(D,i)=>r.check(_t(D,i)),r.lte=(D,i)=>r.check(sr(D,i)),r.max=(D,i)=>r.check(sr(D,i)),r.int=(D)=>r.check(le(D)),r.safe=(D)=>r.check(le(D)),r.positive=(D)=>r.check(It(0,D)),r.nonnegative=(D)=>r.check(Mr(0,D)),r.negative=(D)=>r.check(_t(0,D)),r.nonpositive=(D)=>r.check(sr(0,D)),r.multipleOf=(D,i)=>r.check(st(D,i)),r.step=(D,i)=>r.check(st(D,i)),r.finite=()=>r;let u=r._zod.bag;r.minValue=Math.max(u.minimum??Number.NEGATIVE_INFINITY,u.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,r.maxValue=Math.min(u.maximum??Number.POSITIVE_INFINITY,u.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,r.isInt=(u.format??"").includes("int")||Number.isSafeInteger(u.multipleOf??0.5),r.isFinite=!0,r.format=u.format??null});function lc(r){return A6(Cu,r)}var Ni=I("ZodNumberFormat",(r,t)=>{Zm.init(r,t),Cu.init(r,t)});function le(r){return j6(Ni,r)}function a3(r){return G6(Ni,r)}function s3(r){return W6(Ni,r)}function rF(r){return Y6(Ni,r)}function tF(r){return T6(Ni,r)}var _u=I("ZodBoolean",(r,t)=>{vD.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>m1(r,u,D,i)});function mc(r){return R6(_u,r)}var Iu=I("ZodBigInt",(r,t)=>{yo.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(D,i,n)=>c1(r,D,i,n),r.gte=(D,i)=>r.check(Mr(D,i)),r.min=(D,i)=>r.check(Mr(D,i)),r.gt=(D,i)=>r.check(It(D,i)),r.gte=(D,i)=>r.check(Mr(D,i)),r.min=(D,i)=>r.check(Mr(D,i)),r.lt=(D,i)=>r.check(_t(D,i)),r.lte=(D,i)=>r.check(sr(D,i)),r.max=(D,i)=>r.check(sr(D,i)),r.positive=(D)=>r.check(It(BigInt(0),D)),r.negative=(D)=>r.check(_t(BigInt(0),D)),r.nonpositive=(D)=>r.check(sr(BigInt(0),D)),r.nonnegative=(D)=>r.check(Mr(BigInt(0),D)),r.multipleOf=(D,i)=>r.check(st(D,i));let u=r._zod.bag;r.minValue=u.minimum??null,r.maxValue=u.maximum??null,r.format=u.format??null});function iF(r){return S6(Iu,r)}var he=I("ZodBigIntFormat",(r,t)=>{Lm.init(r,t),Iu.init(r,t)});function uF(r){return K6(he,r)}function DF(r){return H6(he,r)}var cc=I("ZodSymbol",(r,t)=>{Pm.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>v1(r,u,D,i)});function nF(r){return M6(cc,r)}var vc=I("ZodUndefined",(r,t)=>{km.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>F1(r,u,D,i)});function oF(r){return Z6(vc,r)}var Ec=I("ZodNull",(r,t)=>{dm.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>E1(r,u,D,i)});function Fc(r){return L6(Ec,r)}var gc=I("ZodAny",(r,t)=>{xm.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>b1(r,u,D,i)});function eF(){return P6(gc)}var wc=I("ZodUnknown",(r,t)=>{pm.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>C1(r,u,D,i)});function yi(){return k6(wc)}var bc=I("ZodNever",(r,t)=>{am.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>w1(r,u,D,i)});function ze(r){return d6(bc,r)}var Cc=I("ZodVoid",(r,t)=>{sm.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>g1(r,u,D,i)});function fF(r){return x6(Cc,r)}var zD=I("ZodDate",(r,t)=>{r0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(D,i,n)=>_1(r,D,i,n),r.min=(D,i)=>r.check(Mr(D,i)),r.max=(D,i)=>r.check(sr(D,i));let u=r._zod.bag;r.minDate=u.minimum?new Date(u.minimum):null,r.maxDate=u.maximum?new Date(u.maximum):null});function $F(r){return p6(zD,r)}var _c=I("ZodArray",(r,t)=>{t0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>X1(r,u,D,i),r.element=t.element,r.min=(u,D)=>r.check(jt(u,D)),r.nonempty=(u)=>r.check(jt(1,u)),r.max=(u,D)=>r.check(Ui(u,D)),r.length=(u,D)=>r.check(Oi(u,D)),r.unwrap=()=>r.element});function JD(r,t){return r1(_c,r,t)}function lF(r){let t=r._zod.def.shape;return Ae(Object.keys(t))}var AD=I("ZodObject",(r,t)=>{i0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>j1(r,u,D,i),j.defineLazy(r,"shape",()=>{return t.shape}),r.keyof=()=>Ae(Object.keys(r._zod.def.shape)),r.catchall=(u)=>r.clone({...r._zod.def,catchall:u}),r.passthrough=()=>r.clone({...r._zod.def,catchall:yi()}),r.loose=()=>r.clone({...r._zod.def,catchall:yi()}),r.strict=()=>r.clone({...r._zod.def,catchall:ze()}),r.strip=()=>r.clone({...r._zod.def,catchall:void 0}),r.extend=(u)=>{return j.extend(r,u)},r.safeExtend=(u)=>{return j.safeExtend(r,u)},r.merge=(u)=>j.merge(r,u),r.pick=(u)=>j.pick(r,u),r.omit=(u)=>j.omit(r,u),r.partial=(...u)=>j.partial(je,r,u[0]),r.required=(...u)=>j.required(Ge,r,u[0])});function mF(r,t){let u={type:"object",shape:r??{},...j.normalizeParams(t)};return new AD(u)}function cF(r,t){return new AD({type:"object",shape:r,catchall:ze(),...j.normalizeParams(t)})}function vF(r,t){return new AD({type:"object",shape:r,catchall:yi(),...j.normalizeParams(t)})}var XD=I("ZodUnion",(r,t)=>{ED.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>te(r,u,D,i),r.options=t.options});function Je(r,t){return new XD({type:"union",options:r,...j.normalizeParams(t)})}var Ic=I("ZodXor",(r,t)=>{XD.init(r,t),u0.init(r,t),r._zod.processJSONSchema=(u,D,i)=>te(r,u,D,i),r.options=t.options});function EF(r,t){return new Ic({type:"union",options:r,inclusive:!1,...j.normalizeParams(t)})}var Uc=I("ZodDiscriminatedUnion",(r,t)=>{XD.init(r,t),D0.init(r,t)});function FF(r,t,u){return new Uc({type:"union",options:t,discriminator:r,...j.normalizeParams(u)})}var Oc=I("ZodIntersection",(r,t)=>{n0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>G1(r,u,D,i)});function yc(r,t){return new Oc({type:"intersection",left:r,right:t})}var Nc=I("ZodTuple",(r,t)=>{No.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>W1(r,u,D,i),r.rest=(u)=>r.clone({...r._zod.def,rest:u})});function Bc(r,t,u){let D=t instanceof x,i=D?u:t;return new Nc({type:"tuple",items:r,rest:D?t:null,...j.normalizeParams(i)})}var jD=I("ZodRecord",(r,t)=>{o0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>Y1(r,u,D,i),r.keyType=t.keyType,r.valueType=t.valueType});function qc(r,t,u){return new jD({type:"record",keyType:r,valueType:t,...j.normalizeParams(u)})}function gF(r,t,u){let D=Hr(r);return D._zod.values=void 0,new jD({type:"record",keyType:D,valueType:t,...j.normalizeParams(u)})}function wF(r,t,u){return new jD({type:"record",keyType:r,valueType:t,mode:"loose",...j.normalizeParams(u)})}var hc=I("ZodMap",(r,t)=>{e0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>J1(r,u,D,i),r.keyType=t.keyType,r.valueType=t.valueType,r.min=(...u)=>r.check(Ut(...u)),r.nonempty=(u)=>r.check(Ut(1,u)),r.max=(...u)=>r.check(ri(...u)),r.size=(...u)=>r.check(Ii(...u))});function bF(r,t,u){return new hc({type:"map",keyType:r,valueType:t,...j.normalizeParams(u)})}var zc=I("ZodSet",(r,t)=>{f0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>A1(r,u,D,i),r.min=(...u)=>r.check(Ut(...u)),r.nonempty=(u)=>r.check(Ut(1,u)),r.max=(...u)=>r.check(ri(...u)),r.size=(...u)=>r.check(Ii(...u))});function CF(r,t){return new zc({type:"set",valueType:r,...j.normalizeParams(t)})}var gu=I("ZodEnum",(r,t)=>{$0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(D,i,n)=>I1(r,D,i,n),r.enum=t.entries,r.options=Object.values(t.entries);let u=new Set(Object.keys(t.entries));r.extract=(D,i)=>{let n={};for(let o of D)if(u.has(o))n[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new gu({...t,checks:[],...j.normalizeParams(i),entries:n})},r.exclude=(D,i)=>{let n={...t.entries};for(let o of D)if(u.has(o))delete n[o];else throw new Error(`Key ${o} not found in enum`);return new gu({...t,checks:[],...j.normalizeParams(i),entries:n})}});function Ae(r,t){let u=Array.isArray(r)?Object.fromEntries(r.map((D)=>[D,D])):r;return new gu({type:"enum",entries:u,...j.normalizeParams(t)})}function _F(r,t){return new gu({type:"enum",entries:r,...j.normalizeParams(t)})}var Jc=I("ZodLiteral",(r,t)=>{l0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>U1(r,u,D,i),r.values=new Set(t.values),Object.defineProperty(r,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function IF(r,t){return new Jc({type:"literal",values:Array.isArray(r)?r:[r],...j.normalizeParams(t)})}var Ac=I("ZodFile",(r,t)=>{m0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>N1(r,u,D,i),r.min=(u,D)=>r.check(Ut(u,D)),r.max=(u,D)=>r.check(ri(u,D)),r.mime=(u,D)=>r.check(eu(Array.isArray(u)?u:[u],D))});function UF(r){return t1(Ac,r)}var Xc=I("ZodTransform",(r,t)=>{c0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>z1(r,u,D,i),r._zod.parse=(u,D)=>{if(D.direction==="backward")throw new wi(r.constructor.name);u.addIssue=(n)=>{if(typeof n==="string")u.issues.push(j.issue(n,u.value,t));else{let o=n;if(o.fatal)o.continue=!1;o.code??(o.code="custom"),o.input??(o.input=u.value),o.inst??(o.inst=r),u.issues.push(j.issue(o))}};let i=t.transform(u.value,u);if(i instanceof Promise)return i.then((n)=>{return u.value=n,u});return u.value=i,u}});function Xe(r){return new Xc({type:"transform",transform:r})}var je=I("ZodOptional",(r,t)=>{Bo.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>ie(r,u,D,i),r.unwrap=()=>r._zod.def.innerType});function ND(r){return new je({type:"optional",innerType:r})}var jc=I("ZodExactOptional",(r,t)=>{v0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>ie(r,u,D,i),r.unwrap=()=>r._zod.def.innerType});function Gc(r){return new jc({type:"optional",innerType:r})}var Wc=I("ZodNullable",(r,t)=>{E0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>T1(r,u,D,i),r.unwrap=()=>r._zod.def.innerType});function BD(r){return new Wc({type:"nullable",innerType:r})}function OF(r){return ND(BD(r))}var Yc=I("ZodDefault",(r,t)=>{F0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>V1(r,u,D,i),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});function Tc(r,t){return new Yc({type:"default",innerType:r,get defaultValue(){return typeof t==="function"?t():j.shallowClone(t)}})}var Rc=I("ZodPrefault",(r,t)=>{g0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>S1(r,u,D,i),r.unwrap=()=>r._zod.def.innerType});function Vc(r,t){return new Rc({type:"prefault",innerType:r,get defaultValue(){return typeof t==="function"?t():j.shallowClone(t)}})}var Ge=I("ZodNonOptional",(r,t)=>{w0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>R1(r,u,D,i),r.unwrap=()=>r._zod.def.innerType});function Sc(r,t){return new Ge({type:"nonoptional",innerType:r,...j.normalizeParams(t)})}var Qc=I("ZodSuccess",(r,t)=>{b0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>B1(r,u,D,i),r.unwrap=()=>r._zod.def.innerType});function yF(r){return new Qc({type:"success",innerType:r})}var Kc=I("ZodCatch",(r,t)=>{C0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>Q1(r,u,D,i),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});function Hc(r,t){return new Kc({type:"catch",innerType:r,catchValue:typeof t==="function"?t:()=>t})}var Mc=I("ZodNaN",(r,t)=>{_0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>O1(r,u,D,i)});function NF(r){return s6(Mc,r)}var We=I("ZodPipe",(r,t)=>{I0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>K1(r,u,D,i),r.in=t.in,r.out=t.out});function qD(r,t){return new We({type:"pipe",in:r,out:t})}var Ye=I("ZodCodec",(r,t)=>{We.init(r,t),FD.init(r,t)});function BF(r,t,u){return new Ye({type:"pipe",in:r,out:t,transform:u.decode,reverseTransform:u.encode})}var Zc=I("ZodReadonly",(r,t)=>{U0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>H1(r,u,D,i),r.unwrap=()=>r._zod.def.innerType});function Lc(r){return new Zc({type:"readonly",innerType:r})}var Pc=I("ZodTemplateLiteral",(r,t)=>{O0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>y1(r,u,D,i)});function qF(r,t){return new Pc({type:"template_literal",parts:r,...j.normalizeParams(t)})}var kc=I("ZodLazy",(r,t)=>{B0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>Z1(r,u,D,i),r.unwrap=()=>r._zod.def.getter()});function dc(r){return new kc({type:"lazy",getter:r})}var xc=I("ZodPromise",(r,t)=>{N0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>M1(r,u,D,i),r.unwrap=()=>r._zod.def.innerType});function hF(r){return new xc({type:"promise",innerType:r})}var pc=I("ZodFunction",(r,t)=>{y0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>h1(r,u,D,i)});function zF(r){return new pc({type:"function",input:Array.isArray(r?.input)?Bc(r?.input):r?.input??JD(yi()),output:r?.output??yi()})}var GD=I("ZodCustom",(r,t)=>{q0.init(r,t),rr.init(r,t),r._zod.processJSONSchema=(u,D,i)=>q1(r,u,D,i)});function JF(r){let t=new br({check:"custom"});return t._zod.check=r,t}function AF(r,t){return i1(GD,r??(()=>!0),t)}function ac(r,t={}){return u1(GD,r,t)}function sc(r){return D1(r)}var XF=n1,jF=o1;function GF(r,t={}){let u=new GD({type:"custom",check:"custom",fn:(D)=>D instanceof r,abort:!0,...j.normalizeParams(t)});return u._zod.bag.Class=r,u._zod.check=(D)=>{if(!(D.value instanceof r))D.issues.push({code:"invalid_type",expected:r.name,input:D.value,inst:u,path:[...u._zod.def.path??[]]})},u}var WF=(...r)=>e1({Codec:Ye,Boolean:_u,String:wu},...r);function YF(r){let t=dc(()=>{return Je([$e(r),lc(),mc(),Fc(),JD(t),qc($e(),t)])});return t}function TF(r,t){return qD(Xe(r),t)}var bN={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function CN(r){hr({customError:r})}function _N(){return hr().customError}var r2;(function(r){})(r2||(r2={}));var S={...OD,...De,iso:Fu},IN=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function UN(r,t){let u=r.$schema;if(u==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(u==="http://json-schema.org/draft-07/schema#")return"draft-7";if(u==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function ON(r,t){if(!r.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let u=r.slice(1).split("/").filter(Boolean);if(u.length===0)return t.rootSchema;let D=t.version==="draft-2020-12"?"$defs":"definitions";if(u[0]===D){let i=u[1];if(!i||!t.defs[i])throw new Error(`Reference not found: ${r}`);return t.defs[i]}throw new Error(`Reference not found: ${r}`)}function RF(r,t){if(r.not!==void 0){if(typeof r.not==="object"&&Object.keys(r.not).length===0)return S.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(r.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(r.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(r.if!==void 0||r.then!==void 0||r.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(r.dependentSchemas!==void 0||r.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(r.$ref){let i=r.$ref;if(t.refs.has(i))return t.refs.get(i);if(t.processing.has(i))return S.lazy(()=>{if(!t.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return t.refs.get(i)});t.processing.add(i);let n=ON(i,t),o=Sr(n,t);return t.refs.set(i,o),t.processing.delete(i),o}if(r.enum!==void 0){let i=r.enum;if(t.version==="openapi-3.0"&&r.nullable===!0&&i.length===1&&i[0]===null)return S.null();if(i.length===0)return S.never();if(i.length===1)return S.literal(i[0]);if(i.every((o)=>typeof o==="string"))return S.enum(i);let n=i.map((o)=>S.literal(o));if(n.length<2)return n[0];return S.union([n[0],n[1],...n.slice(2)])}if(r.const!==void 0)return S.literal(r.const);let u=r.type;if(Array.isArray(u)){let i=u.map((n)=>{let o={...r,type:n};return RF(o,t)});if(i.length===0)return S.never();if(i.length===1)return i[0];return S.union(i)}if(!u)return S.any();let D;switch(u){case"string":{let i=S.string();if(r.format){let n=r.format;if(n==="email")i=i.check(S.email());else if(n==="uri"||n==="uri-reference")i=i.check(S.url());else if(n==="uuid"||n==="guid")i=i.check(S.uuid());else if(n==="date-time")i=i.check(S.iso.datetime());else if(n==="date")i=i.check(S.iso.date());else if(n==="time")i=i.check(S.iso.time());else if(n==="duration")i=i.check(S.iso.duration());else if(n==="ipv4")i=i.check(S.ipv4());else if(n==="ipv6")i=i.check(S.ipv6());else if(n==="mac")i=i.check(S.mac());else if(n==="cidr")i=i.check(S.cidrv4());else if(n==="cidr-v6")i=i.check(S.cidrv6());else if(n==="base64")i=i.check(S.base64());else if(n==="base64url")i=i.check(S.base64url());else if(n==="e164")i=i.check(S.e164());else if(n==="jwt")i=i.check(S.jwt());else if(n==="emoji")i=i.check(S.emoji());else if(n==="nanoid")i=i.check(S.nanoid());else if(n==="cuid")i=i.check(S.cuid());else if(n==="cuid2")i=i.check(S.cuid2());else if(n==="ulid")i=i.check(S.ulid());else if(n==="xid")i=i.check(S.xid());else if(n==="ksuid")i=i.check(S.ksuid())}if(typeof r.minLength==="number")i=i.min(r.minLength);if(typeof r.maxLength==="number")i=i.max(r.maxLength);if(r.pattern)i=i.regex(new RegExp(r.pattern));D=i;break}case"number":case"integer":{let i=u==="integer"?S.number().int():S.number();if(typeof r.minimum==="number")i=i.min(r.minimum);if(typeof r.maximum==="number")i=i.max(r.maximum);if(typeof r.exclusiveMinimum==="number")i=i.gt(r.exclusiveMinimum);else if(r.exclusiveMinimum===!0&&typeof r.minimum==="number")i=i.gt(r.minimum);if(typeof r.exclusiveMaximum==="number")i=i.lt(r.exclusiveMaximum);else if(r.exclusiveMaximum===!0&&typeof r.maximum==="number")i=i.lt(r.maximum);if(typeof r.multipleOf==="number")i=i.multipleOf(r.multipleOf);D=i;break}case"boolean":{D=S.boolean();break}case"null":{D=S.null();break}case"object":{let i={},n=r.properties||{},o=new Set(r.required||[]);for(let[f,$]of Object.entries(n)){let l=Sr($,t);i[f]=o.has(f)?l:l.optional()}if(r.propertyNames){let f=Sr(r.propertyNames,t),$=r.additionalProperties&&typeof r.additionalProperties==="object"?Sr(r.additionalProperties,t):S.any();if(Object.keys(i).length===0){D=S.record(f,$);break}let l=S.object(i).passthrough(),m=S.looseRecord(f,$);D=S.intersection(l,m);break}if(r.patternProperties){let f=r.patternProperties,$=Object.keys(f),l=[];for(let c of $){let g=Sr(f[c],t),_=S.string().regex(new RegExp(c));l.push(S.looseRecord(_,g))}let m=[];if(Object.keys(i).length>0)m.push(S.object(i).passthrough());if(m.push(...l),m.length===0)D=S.object({}).passthrough();else if(m.length===1)D=m[0];else{let c=S.intersection(m[0],m[1]);for(let g=2;g<m.length;g++)c=S.intersection(c,m[g]);D=c}break}let e=S.object(i);if(r.additionalProperties===!1)D=e.strict();else if(typeof r.additionalProperties==="object")D=e.catchall(Sr(r.additionalProperties,t));else D=e.passthrough();break}case"array":{let{prefixItems:i,items:n}=r;if(i&&Array.isArray(i)){let o=i.map((f)=>Sr(f,t)),e=n&&typeof n==="object"&&!Array.isArray(n)?Sr(n,t):void 0;if(e)D=S.tuple(o).rest(e);else D=S.tuple(o);if(typeof r.minItems==="number")D=D.check(S.minLength(r.minItems));if(typeof r.maxItems==="number")D=D.check(S.maxLength(r.maxItems))}else if(Array.isArray(n)){let o=n.map((f)=>Sr(f,t)),e=r.additionalItems&&typeof r.additionalItems==="object"?Sr(r.additionalItems,t):void 0;if(e)D=S.tuple(o).rest(e);else D=S.tuple(o);if(typeof r.minItems==="number")D=D.check(S.minLength(r.minItems));if(typeof r.maxItems==="number")D=D.check(S.maxLength(r.maxItems))}else if(n!==void 0){let o=Sr(n,t),e=S.array(o);if(typeof r.minItems==="number")e=e.min(r.minItems);if(typeof r.maxItems==="number")e=e.max(r.maxItems);D=e}else D=S.array(S.any());break}default:throw new Error(`Unsupported type: ${u}`)}if(r.description)D=D.describe(r.description);if(r.default!==void 0)D=D.default(r.default);return D}function Sr(r,t){if(typeof r==="boolean")return r?S.any():S.never();let u=RF(r,t),D=r.type||r.enum!==void 0||r.const!==void 0;if(r.anyOf&&Array.isArray(r.anyOf)){let e=r.anyOf.map(($)=>Sr($,t)),f=S.union(e);u=D?S.intersection(u,f):f}if(r.oneOf&&Array.isArray(r.oneOf)){let e=r.oneOf.map(($)=>Sr($,t)),f=S.xor(e);u=D?S.intersection(u,f):f}if(r.allOf&&Array.isArray(r.allOf))if(r.allOf.length===0)u=D?u:S.any();else{let e=D?u:Sr(r.allOf[0],t),f=D?0:1;for(let $=f;$<r.allOf.length;$++)e=S.intersection(e,Sr(r.allOf[$],t));u=e}if(r.nullable===!0&&t.version==="openapi-3.0")u=S.nullable(u);if(r.readOnly===!0)u=S.readonly(u);let i={},n=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let e of n)if(e in r)i[e]=r[e];let o=["contentEncoding","contentMediaType","contentSchema"];for(let e of o)if(e in r)i[e]=r[e];for(let e of Object.keys(r))if(!IN.has(e))i[e]=r[e];if(Object.keys(i).length>0)t.registry.add(u,i);return u}function VF(r,t){if(typeof r==="boolean")return r?S.any():S.never();let u=UN(r,t?.defaultTarget),D=r.$defs||r.definitions||{},i={version:u,defs:D,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Rr};return Sr(r,i)}var t2={};Or(t2,{string:()=>yN,number:()=>NN,date:()=>hN,boolean:()=>BN,bigint:()=>qN});function yN(r){return y6(wu,r)}function NN(r){return X6(Cu,r)}function BN(r){return V6(_u,r)}function qN(r){return Q6(Iu,r)}function hN(r){return a6(zD,r)}hr(gD());import{readdir as zN,readFile as JN}from"fs/promises";import{join as SF}from"path";import Ar from"typescript";async function QF(r,t=""){let u=[],D=await zN(r,{withFileTypes:!0});for(let i of D){let n=SF(r,i.name);if(i.isDirectory())u.push(...await QF(n,t?`${t}_${i.name}`:i.name));else if(i.name.endsWith(".ts")&&i.name!=="index.ts"){let o=i.name.replace(".ts","");u.push({path:n,name:t?`${t}_${o}`:o})}}return u}function AN(r,t){let u=Ar.createSourceFile("command.ts",r,Ar.ScriptTarget.Latest,!0),D="",i="",n={},o=[];function e(f){if(Ar.isCallExpression(f)&&Ar.isIdentifier(f.expression)&&f.expression.text==="defineCommand"){let $=f.arguments[0];if($&&Ar.isObjectLiteralExpression($))for(let l of $.properties){if(!Ar.isPropertyAssignment(l))continue;let m=l.name.getText(u);if(m==="meta"&&Ar.isObjectLiteralExpression(l.initializer)){for(let c of l.initializer.properties)if(Ar.isPropertyAssignment(c)&&c.name.getText(u)==="description"){if(Ar.isStringLiteral(c.initializer))D=c.initializer.text}}if(m==="args"&&Ar.isObjectLiteralExpression(l.initializer))for(let c of l.initializer.properties){if(!Ar.isPropertyAssignment(c))continue;let g=c.name.getText(u);if(g==="json")continue;if(Ar.isObjectLiteralExpression(c.initializer)){let _="string",q,y=!1;for(let N of c.initializer.properties){if(!Ar.isPropertyAssignment(N))continue;let R=N.name.getText(u);if(R==="type"&&Ar.isStringLiteral(N.initializer))_=N.initializer.text==="boolean"?"boolean":"string";if(R==="description"&&Ar.isStringLiteral(N.initializer))q=N.initializer.text;if(R==="required"&&N.initializer.kind===Ar.SyntaxKind.TrueKeyword)y=!0}if(n[g]={type:_,description:q},y)o.push(g)}}}}if(Ar.isCallExpression(f)&&Ar.isIdentifier(f.expression)&&f.expression.text==="sendCommand"){let $=f.arguments[0];if($&&Ar.isStringLiteral($))i=$.text}Ar.forEachChild(f,e)}if(e(u),!D||!i)return null;return{name:`figma_${t}`,description:D,inputSchema:{type:"object",properties:n,required:o.length>0?o:void 0},pluginCommand:i}}var Re=null;async function KF(){if(Re)return Re;let r=SF(import.meta.dir,"../../cli/src/commands"),t=await QF(r),u=[],D=["proxy","plugin","status","mcp","profile","render"];for(let{path:i,name:n}of t){if(D.some((f)=>n===f||n.startsWith(f+"_")))continue;let o=await JN(i,"utf-8"),e=AN(o,n);if(e)u.push(e)}return u.unshift({name:"figma_status",description:"Check if Figma plugin is connected",inputSchema:{type:"object",properties:{}},pluginCommand:"__status__"}),u.push({name:"figma_render",description:"Render JSX to Figma. Pure JSX only (no variables, no logic). Elements: Frame, Rectangle, Ellipse, Text, Line, Star, Polygon, Vector, Group, Icon. Style shorthands: w, h, bg, rounded, p, px, py, flex, gap, justify, items, size, weight, color.",inputSchema:{type:"object",properties:{jsx:{type:"string",description:'JSX code to render (e.g., <Frame style={{w: 200, h: 100, bg: "#FF0000"}} />)'},x:{type:"string",description:"X position of rendered root"},y:{type:"string",description:"Y position of rendered root"},parent:{type:"string",description:"Parent node ID (sessionID:localID)"}},required:["jsx"]},pluginCommand:"__render__"}),Re=u,u}function HF(r){return Re?.find((t)=>t.name===r)}B();var jN="2024-11-05",GN=new Map;async function WN(r){let{id:t,method:u,params:D}=r;try{switch(u){case"initialize":{let i=crypto.randomUUID();return GN.set(i,{initialized:!0}),{jsonrpc:"2.0",id:t,result:{protocolVersion:jN,serverInfo:{name:"figma-use",version:"0.8.0"},capabilities:{tools:{}},instructions:'Figma MCP Server. Node IDs: "sessionID:localID". Colors: hex #RRGGBB or var:Name.',sessionId:i}}}case"tools/list":{let i=await KF();return{jsonrpc:"2.0",id:t,result:{tools:i.map((n)=>({name:n.name,description:n.description,inputSchema:n.inputSchema}))}}}case"tools/call":{let{name:i,arguments:n}=D,o=HF(i);if(!o)return{jsonrpc:"2.0",id:t,error:{code:-32602,message:`Unknown tool: ${i}`}};let e={},f=o.inputSchema.properties;if(n&&f)for(let[$,l]of Object.entries(n))if(f[$]?.type==="string"&&typeof l==="string"){let c=Te.coerce.number().safeParse(l);e[$]=c.success?c.data:l}else e[$]=l;else if(n)Object.assign(e,n);try{let $;if(o.pluginCommand==="__status__")$=await F("status");else if(o.pluginCommand==="__render__"){let{jsx:l,x:m,y:c,parent:g}=e;$=await A$(l,{x:m?Number(m):void 0,y:c?Number(c):void 0,parent:g})}else $=await F(o.pluginCommand,e);return{jsonrpc:"2.0",id:t,result:{content:[{type:"text",text:JSON.stringify($,null,2)}],isError:!1}}}catch($){return{jsonrpc:"2.0",id:t,result:{content:[{type:"text",text:$ instanceof Error?$.message:String($)}],isError:!0}}}}case"notifications/initialized":case"ping":return{jsonrpc:"2.0",id:t,result:{}};default:return{jsonrpc:"2.0",id:t,error:{code:-32601,message:`Method not found: ${u}`}}}}catch(i){return{jsonrpc:"2.0",id:t,error:{code:-32603,message:i instanceof Error?i.message:"Internal error"}}}}var MF=E({meta:{description:"Start MCP server"},args:{port:{type:"string",description:"Port to listen on",default:"38451"}},async run({args:r}){let t=Number(r.port);XN(async(D,i)=>{if(i.setHeader("Access-Control-Allow-Origin","*"),i.setHeader("Access-Control-Allow-Methods","POST, OPTIONS"),i.setHeader("Access-Control-Allow-Headers","Content-Type"),D.method==="OPTIONS"){i.writeHead(204),i.end();return}if(D.method!=="POST"||D.url!=="/mcp"){i.writeHead(404,{"Content-Type":"application/json"}),i.end(JSON.stringify({error:"Not found. Use POST /mcp"}));return}let n="";for await(let o of D)n+=o;try{let o=JSON.parse(n),e=await WN(o);i.writeHead(200,{"Content-Type":"application/json"}),i.end(JSON.stringify(e))}catch(o){i.writeHead(400,{"Content-Type":"application/json"}),i.end(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}}))}}).listen(t,()=>{console.log(`MCP server listening on http://localhost:${t}/mcp`),console.log(""),console.log("Add to your MCP client config:"),console.log(JSON.stringify({mcpServers:{"figma-use":{url:`http://localhost:${t}/mcp`}}},null,2))}),await new Promise(()=>{})}});var ZF=E({meta:{description:"MCP server commands"},subCommands:{serve:MF}});O();async function LF(){let u=(await(await fetch("http://localhost:9222/json")).json()).find((D)=>D.url.includes("figma.com/design")||D.url.includes("figma.com/file"));if(!u)throw new Error("No Figma file open. Start Figma with --remote-debugging-port=9222");return u}function YN(r){let t=r.match(/\/(file|design)\/([a-zA-Z0-9]+)/);if(!t?.[2])throw new Error("Could not extract file key from URL");return t[2]}async function Uu(r){let t=await LF();return new Promise((u,D)=>{let i=new WebSocket(t.webSocketDebuggerUrl),n=setTimeout(()=>{i.close(),D(new Error("CDP timeout"))},1e4);i.addEventListener("open",()=>{i.send(JSON.stringify({id:1,method:"Runtime.evaluate",params:{expression:r,awaitPromise:!0,returnByValue:!0}}))}),i.addEventListener("message",(o)=>{let e=JSON.parse(o.data);if(e.id===1)if(clearTimeout(n),i.close(),e.result?.exceptionDetails)D(new Error(e.result.exceptionDetails.text));else u(e.result?.result?.value)}),i.addEventListener("close",()=>{clearTimeout(n),D(new Error("WebSocket closed before response"))}),i.addEventListener("error",()=>{clearTimeout(n),i.close(),D(new Error("WebSocket error"))})})}async function WD(){let r=await LF();return YN(r.url)}async function PF(){return Uu("window.INITIAL_OPTIONS?.user_data")}function kF(r){return{id:r.id,file_key:r.key,parent_id:r.parent_id,user:r.user,created_at:r.created_at,resolved_at:r.resolved_at,message:r.message,order_id:r.order_id,reactions:r.reactions||[],client_meta:r.client_meta}}async function YD(r){let t=r||await WD(),u=await Uu(`
|
|
328
|
+
(async () => {
|
|
329
|
+
const resp = await fetch('https://www.figma.com/api/file/${t}/comments', {
|
|
330
|
+
credentials: 'include'
|
|
331
|
+
});
|
|
332
|
+
return await resp.json();
|
|
333
|
+
})()
|
|
334
|
+
`);if(u.error)throw new Error("Failed to fetch comments");return(u.meta||[]).map(kF)}async function dF(r,t){let u=t?.fileKey||await WD(),D=t?.x??100,i=t?.y??100,n=t?.nodeId||"0:1",o={file_key:u,message_meta:[{t:r}],attachments:[],client_meta:{x:D,y:i,node_id:n,node_offset:{x:D,y:i},page_id:n.includes(":")?n:"0:1"},...t?.replyTo&&{parent_id:t.replyTo}},e=await Uu(`
|
|
335
|
+
(async () => {
|
|
336
|
+
const resp = await fetch('https://www.figma.com/api/file/${u}/comments', {
|
|
337
|
+
method: 'POST',
|
|
338
|
+
credentials: 'include',
|
|
339
|
+
headers: { 'Content-Type': 'application/json' },
|
|
340
|
+
body: JSON.stringify(${JSON.stringify(o)})
|
|
341
|
+
});
|
|
342
|
+
return await resp.json();
|
|
343
|
+
})()
|
|
344
|
+
`);if(e.error)throw new Error("Failed to post comment");return kF(e.meta)}async function xF(r,t){let u=t||await WD();if((await Uu(`
|
|
345
|
+
(async () => {
|
|
346
|
+
const resp = await fetch('https://www.figma.com/api/file/${u}/comments/${r}', {
|
|
347
|
+
method: 'DELETE',
|
|
348
|
+
credentials: 'include'
|
|
349
|
+
});
|
|
350
|
+
return await resp.json();
|
|
351
|
+
})()
|
|
352
|
+
`)).error)throw new Error("Failed to delete comment")}async function pF(r,t){let u=t||await WD();if((await Uu(`
|
|
353
|
+
(async () => {
|
|
354
|
+
const resp = await fetch('https://www.figma.com/api/file/${u}/comments/${r}', {
|
|
355
|
+
method: 'PUT',
|
|
356
|
+
credentials: 'include',
|
|
357
|
+
headers: { 'Content-Type': 'application/json' },
|
|
358
|
+
body: JSON.stringify({ resolved_at: new Date().toISOString() })
|
|
359
|
+
});
|
|
360
|
+
return await resp.json();
|
|
361
|
+
})()
|
|
362
|
+
`)).error)throw new Error("Failed to resolve comment")}async function aF(r,t=20){let u=r||await WD(),D=await Uu(`
|
|
363
|
+
(async () => {
|
|
364
|
+
const resp = await fetch('https://www.figma.com/api/versions/${u}?page_size=${t}', {
|
|
365
|
+
credentials: 'include'
|
|
366
|
+
});
|
|
367
|
+
return await resp.json();
|
|
368
|
+
})()
|
|
369
|
+
`);if(D.error)throw new Error("Failed to fetch versions");return D.meta?.versions||[]}B();mr();var sF=E({meta:{description:"Get current user info"},args:{json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await PF();if(r.json){console.log(JSON.stringify(t,null,2));return}if(console.log(`${Zt(t.handle||t.name)}`),console.log(` ID: ${t.id}`),t.email)console.log(` Email: ${t.email}`)}catch(t){w(t)}}});O();var G8=E({meta:{description:"Diff operations"},subCommands:{apply:()=>Promise.resolve().then(() => (O8(),U8)).then((r)=>r.default),show:()=>Promise.resolve().then(() => (N8(),y8)).then((r)=>r.default),create:()=>Promise.resolve().then(() => (q8(),B8)).then((r)=>r.default),visual:()=>Promise.resolve().then(() => (z8(),h8)).then((r)=>r.default),jsx:()=>Promise.resolve().then(() => (j8(),X8)).then((r)=>r.default)}});O();O();B();var W8=E({meta:{description:"Get ancestor chain from node to page root"},args:{id:{type:"positional",description:"Node ID",required:!0},depth:{type:"string",description:"Max ancestors to return (default: 10)"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-ancestors",{id:r.id,depth:r.depth?Number(r.depth):10});C(t,r.json)}catch(t){w(t)}}});O();B();var Y8=E({meta:{description:"Get variable bindings for fills and strokes"},args:{id:{type:"positional",description:"Node ID",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-node-bindings",{id:r.id});if(r.json){console.log(JSON.stringify(t,null,2));return}let u=(t.type||"node").toLowerCase();if(console.log(`[${u}] "${t.name}" (${t.id})`),t.fills?.length){console.log(" fills:");for(let D of t.fills)console.log(` [${D.index}] $${D.variableName}`)}if(t.strokes?.length){console.log(" strokes:");for(let D of t.strokes)console.log(` [${D.index}] $${D.variableName}`)}if(!t.fills?.length&&!t.strokes?.length)console.log(" (no bindings)")}catch(t){w(t)}}});O();B();var T8=E({meta:{description:"Get node bounding box"},args:{id:{type:"positional",description:"Node ID",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("node-bounds",{id:r.id});if(r.json)C(t,!0);else{let u=t;console.log(`x: ${u.x}, y: ${u.y}`),console.log(`width: ${u.width}, height: ${u.height}`),console.log(`center: (${u.centerX}, ${u.centerY})`),console.log(`right: ${u.right}, bottom: ${u.bottom}`)}}catch(t){w(t)}}});O();B();var R8=E({meta:{description:"Get child nodes"},args:{id:{type:"positional",description:"Parent node ID",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-children",{id:r.id});C(t,r.json)}catch(t){w(t)}}});O();B();var V8=E({meta:{description:"Clone node(s)"},args:{ids:{type:"positional",description:"Node ID(s) separated by space",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(/\s+/).filter(Boolean),u=await F("clone-node",{ids:t});C(u,r.json)}catch(t){w(t)}}});O();B();var S8=E({meta:{description:"Delete node(s)"},args:{ids:{type:"positional",description:"Node ID(s) separated by space",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(/\s+/).filter(Boolean),u=await F("delete-node",{ids:t});C(u,r.json)}catch(t){w(t)}}});O();B();var Q8=E({meta:{description:"Get node properties"},args:{id:{type:"positional",description:"Node ID",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-node-info",{id:r.id});C(t,r.json)}catch(t){w(t)}}});O();B();var K8=E({meta:{description:"Move a node"},args:{id:{type:"positional",description:"Node ID",required:!0},x:{type:"string",description:"X position",required:!0},y:{type:"string",description:"Y position",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("move-node",{id:r.id,x:Number(r.x),y:Number(r.y)});C(t,r.json)}catch(t){w(t)}}});O();B();var H8=E({meta:{description:"Rename a node"},args:{id:{type:"positional",description:"Node ID",required:!0},name:{type:"positional",description:"New name",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("rename-node",{id:r.id,name:r.name});C(t,r.json)}catch(t){w(t)}}});O();B();var M8=E({meta:{description:"Replace node with another node or JSX from stdin"},args:{id:{type:"positional",description:"Node ID to replace",required:!0},target:{type:"string",description:"Target node ID (component creates instance, otherwise clones)"},stdin:{type:"boolean",description:"Read JSX from stdin"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t;if(r.stdin){let D=await su();if(!D.trim())throw new Error("No JSX provided on stdin");let i=await F("get-node-info",{id:r.id});t=(await j$(D,{x:i.x,y:i.y})).id}else{if(!r.target)throw new Error("Target node ID required (or use --stdin)");t=r.target}let u=await F("replace-node-with",{targetId:r.id,sourceId:t});if(r.json)console.log(JSON.stringify(u,null,2));else{let D=u;console.log(`✓ Replaced with ${D.type.toLowerCase()} "${D.name}" (${D.id})`)}}catch(t){w(t)}}});O();B();var Z8=E({meta:{description:"Resize a node"},args:{id:{type:"positional",description:"Node ID",required:!0},width:{type:"string",description:"Width",required:!0},height:{type:"string",description:"Height",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("resize-node",{id:r.id,width:Number(r.width),height:Number(r.height)});C(t,r.json)}catch(t){w(t)}}});O();B();var L8=E({meta:{description:"Move node to a different parent"},args:{id:{type:"positional",description:"Node ID",required:!0},parent:{type:"string",description:"Parent node ID",required:!0},index:{type:"string",description:"Index in parent children"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-parent-id",{id:r.id,parentId:r.parent,index:r.index?Number(r.index):void 0});C(t,r.json)}catch(t){w(t)}}});O();B();mr();var P8=E({meta:{description:"Convert frame(s) to component(s)"},args:{ids:{type:"positional",description:"Node IDs to convert",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(/[\s,]+/).filter(Boolean),u=await F("eval",{code:`
|
|
370
|
+
const ids = ${JSON.stringify(t)}
|
|
371
|
+
const result = []
|
|
372
|
+
for (const id of ids) {
|
|
373
|
+
const node = await figma.getNodeByIdAsync(id)
|
|
374
|
+
if (node && 'createComponentFromNode' in figma) {
|
|
375
|
+
const comp = figma.createComponentFromNode(node)
|
|
376
|
+
result.push({ id: comp.id, name: comp.name })
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return result
|
|
380
|
+
`});if(r.json)console.log(JSON.stringify(u,null,2));else for(let D of u)console.log(Dr(`Converted to component "${D.name}" (${D.id})`))}catch(t){w(t)}}});O();B();mr();function l2(r,t,u,D){let i=[];if(!D.showHidden&&r.visible===!1)return i;if(D.maxDepth!==-1&&t>D.maxDepth)return i;let n=" ".repeat(t),o=r.type.toLowerCase(),e=["frame","component","instance","text","rectangle","ellipse","vector","group","boolean_operation"].includes(r.type.toLowerCase().replace("_",""));if(D.interactive&&!e&&t>0){if(r.children)for(let q=0;q<r.children.length;q++){let y=r.children[q];if(y)i.push(...l2(y,t,q,D))}return i}let f=`${n}[${u}] ${o} "${r.name}" (${r.id})`,$=[];if(r.width!==void 0&&r.height!==void 0){let q=r.x!==void 0?Math.round(r.x):0,y=r.y!==void 0?Math.round(r.y):0;$.push(`${Math.round(r.width)}×${Math.round(r.height)} at (${q}, ${y})`)}let l=Ti(r.fills);if(l)$.push(`fill: ${l}`);let m=Ri(r.strokes,r.strokeWeight);if(m)$.push(`stroke: ${m}`);if(r.cornerRadius)$.push(`radius: ${r.cornerRadius}`);let c=G4(r);if(c)$.push(c);let g=W4(r.characters);if(g)$.push(g);let _=Y4(r);if(_)$.push(_);if(r.opacity!==void 0&&r.opacity<1)$.push(`opacity: ${Math.round(r.opacity*100)}%`);if(r.visible===!1)$.push("hidden");if(r.locked)$.push("locked");if($.length)f+=`
|
|
381
|
+
`+n+" "+$.join(" | ");if(i.push(f),r.children&&(D.maxDepth===-1||t<D.maxDepth))for(let q=0;q<r.children.length;q++){let y=r.children[q];if(y)i.push(...l2(y,t+1,q,D))}return i}var k8=500,d8=E({meta:{description:"Get node tree with properties"},args:{id:{type:"positional",description:"Node ID (default: current page)",required:!1},depth:{type:"string",description:"Max depth (-1 for unlimited)",default:"-1"},interactive:{type:"boolean",description:"Only show interactive elements",alias:"i"},hidden:{type:"boolean",description:"Include hidden nodes"},json:{type:"boolean",description:"Output as JSON"},force:{type:"boolean",description:"Skip node count limit",alias:"f"}},async run({args:r}){try{let t=r.id||(await F("get-current-page",{})).id,u=await F("get-node-tree",{id:t}),D=Number(r.depth),i=(f,$)=>{if(D!==-1&&$>D)return 0;return 1+(f.children?.reduce((l,m)=>l+i(m,$+1),0)||0)},n=i(u,0);if(!r.force&&n>k8)console.error(d(`Tree has ${n} nodes (limit: ${k8}). Use --depth to limit or --force to override.`)),process.exit(1);if(r.json){console.log(JSON.stringify(u,null,2));return}let o={showHidden:r.hidden||!1,maxDepth:D,interactive:r.interactive||!1},e=l2(u,0,0,o);console.log(e.join(`
|
|
382
|
+
`)),console.log(`
|
|
383
|
+
${n} nodes`)}catch(t){w(t)}}});var x8=E({meta:{description:"Node operations"},subCommands:{get:Q8,tree:d8,children:R8,ancestors:W8,bindings:Y8,delete:S8,clone:V8,rename:H8,move:K8,resize:Z8,"set-parent":L8,"to-component":P8,"replace-with":M8,bounds:T8}});O();O();B();Dt();var p8=E({meta:{description:"Flip path horizontally or vertically"},args:{id:{type:"positional",description:"Vector node ID",required:!0},axis:{type:"string",description:"Axis to flip (x or y)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{if(r.axis!=="x"&&r.axis!=="y")console.error('Axis must be "x" or "y"'),process.exit(1);let t=await F("path-flip",{id:r.id,axis:r.axis});C(t,r.json,"path")}catch(t){w(t)}}});O();B();var a8=E({meta:{description:"Get vector path data"},args:{id:{type:"positional",description:"Vector node ID",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("path-get",{id:r.id});if(r.json)C(t,!0);else for(let u of t.paths)console.log(u.data)}catch(t){w(t)}}});O();B();Dt();var s8=E({meta:{description:"Move all path points by offset"},args:{id:{type:"positional",description:"Vector node ID",required:!0},dx:{type:"string",description:"X offset",default:"0"},dy:{type:"string",description:"Y offset",default:"0"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("path-move",{id:r.id,dx:Number(r.dx),dy:Number(r.dy)});C(t,r.json,"path")}catch(t){w(t)}}});O();B();Dt();var rg=E({meta:{description:"Scale path from center"},args:{id:{type:"positional",description:"Vector node ID",required:!0},factor:{type:"string",description:"Scale factor (e.g., 1.5 for 150%)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("path-scale",{id:r.id,factor:Number(r.factor)});C(t,r.json,"path")}catch(t){w(t)}}});O();B();Dt();var tg=E({meta:{description:"Set vector path data"},args:{id:{type:"positional",description:"Vector node ID",required:!0},path:{type:"positional",description:"SVG path data",required:!0},windingRule:{type:"string",description:"Winding rule (NONZERO or EVENODD)",default:"NONZERO"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("path-set",{id:r.id,path:r.path,windingRule:r.windingRule});C(t,r.json,"update")}catch(t){w(t)}}});var ig=E({meta:{description:"Vector path operations"},subCommands:{get:a8,set:tg,move:s8,scale:rg,flip:p8}});O();O();B();var ug=E({meta:{description:"Create a component"},args:{x:{type:"string",description:"X coordinate",required:!0},y:{type:"string",description:"Y coordinate",required:!0},width:{type:"string",description:"Width",required:!0},height:{type:"string",description:"Height",required:!0},name:{type:"string",description:"Name"},parent:{type:"string",description:"Parent node ID"},fill:{type:"string",description:"Fill color (hex or var:Name)"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-component",{x:Number(r.x),y:Number(r.y),width:Number(r.width),height:Number(r.height),name:r.name,parentId:r.parent,fill:r.fill});C(t,r.json,"create")}catch(t){w(t)}}});O();B();var Dg=E({meta:{description:"Create an ellipse"},args:{x:{type:"string",description:"X coordinate",required:!0},y:{type:"string",description:"Y coordinate",required:!0},width:{type:"string",description:"Width",required:!0},height:{type:"string",description:"Height",required:!0},name:{type:"string",description:"Name"},parent:{type:"string",description:"Parent node ID"},fill:{type:"string",description:"Fill color (hex or var:Name)"},stroke:{type:"string",description:"Stroke color (hex or var:Name)"},"stroke-weight":{type:"string",description:"Stroke weight"},opacity:{type:"string",description:"Opacity (0-1)"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-ellipse",{x:Number(r.x),y:Number(r.y),width:Number(r.width),height:Number(r.height),name:r.name,parentId:r.parent,fill:r.fill,stroke:r.stroke,strokeWeight:r["stroke-weight"]?Number(r["stroke-weight"]):void 0,opacity:r.opacity?Number(r.opacity):void 0});C(t,r.json,"create")}catch(t){w(t)}}});O();B();var ng=E({meta:{description:"Create a frame"},args:{x:{type:"string",description:"X coordinate",required:!0},y:{type:"string",description:"Y coordinate",required:!0},width:{type:"string",description:"Width",required:!0},height:{type:"string",description:"Height",required:!0},name:{type:"string",description:"Name"},parent:{type:"string",description:"Parent node ID"},fill:{type:"string",description:"Fill color (hex or var:Name)"},stroke:{type:"string",description:"Stroke color (hex or var:Name)"},"stroke-weight":{type:"string",description:"Stroke weight"},radius:{type:"string",description:"Corner radius"},opacity:{type:"string",description:"Opacity (0-1)"},layout:{type:"string",description:"Layout mode: HORIZONTAL, VERTICAL, NONE"},gap:{type:"string",description:"Item spacing (gap)"},padding:{type:"string",description:'Padding (single value or "top,right,bottom,left")'},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t;if(r.padding){let D=r.padding.split(",").map(Number);if(D.length===1){let i=D[0];t={top:i,right:i,bottom:i,left:i}}else if(D.length===4)t={top:D[0],right:D[1],bottom:D[2],left:D[3]}}let u=await F("create-frame",{x:Number(r.x),y:Number(r.y),width:Number(r.width),height:Number(r.height),name:r.name,parentId:r.parent,fill:r.fill,stroke:r.stroke,strokeWeight:r["stroke-weight"]?Number(r["stroke-weight"]):void 0,radius:r.radius?Number(r.radius):void 0,opacity:r.opacity?Number(r.opacity):void 0,layoutMode:r.layout,itemSpacing:r.gap?Number(r.gap):void 0,padding:t});C(u,r.json,"create")}catch(t){w(t)}}});O();B();mr();var e5=/^(?:var:|[$])(.+)$/;async function f5(r,t){return await new HTMLRewriter().on("*",{element(D){if(D.getAttribute("fill")==="currentColor")D.setAttribute("fill",t);if(D.getAttribute("stroke")==="currentColor")D.setAttribute("stroke",t)}}).transform(new Response(r)).text()}var og=E({meta:{description:"Create an icon from Iconify"},args:{name:{type:"positional",description:"Icon name (e.g., mdi:home, lucide:star)",required:!0},x:{type:"string",description:"X coordinate",default:"0"},y:{type:"string",description:"Y coordinate",default:"0"},size:{type:"string",description:"Size in pixels",default:"24"},color:{type:"string",description:"Icon color (hex or var:Name)"},parent:{type:"string",description:"Parent node ID"},component:{type:"boolean",description:"Create as Figma component"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=Number(r.size),u=await Lt(r.name,t);if(!u)console.error(d(`Icon "${r.name}" not found`)),process.exit(1);let D=r.color?.match(e5),i=D?"#000000":r.color||"#000000",n=await f5(u.svg,i),o=await F("import-svg",{svg:n,x:Number(r.x),y:Number(r.y),parentId:r.parent}),e=r.name.replace(":","/");if(await F("rename-node",{id:o.id,name:e}),D)await F("bind-fill-variable-by-name",{id:o.id,variableName:D[1],recursive:!0});let f=o.id;if(r.component)f=(await F("convert-to-component",{id:o.id})).id;let $=await F("get-node-info",{id:f});C($,r.json,"create")}catch(t){w(t)}}});O();B();mr();import{existsSync as $5,readFileSync as l5}from"fs";var eg=E({meta:{description:"Create an image node from URL or file"},args:{src:{type:"positional",description:"Image source: URL (https://...) or local file path",required:!0},x:{type:"string",description:"X coordinate",default:"0"},y:{type:"string",description:"Y coordinate",default:"0"},width:{type:"string",description:"Width (default: image native width)"},height:{type:"string",description:"Height (default: image native height)"},name:{type:"string",description:"Node name"},parent:{type:"string",description:"Parent node ID"},scale:{type:"string",description:"Scale mode: fill, fit, crop, tile",default:"fill"},radius:{type:"string",description:"Corner radius"},opacity:{type:"string",description:"Opacity (0-1)"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t,u;if(r.src.startsWith("http://")||r.src.startsWith("https://"))t=r.src;else if(r.src.startsWith("data:")){let i=r.src.indexOf(",");if(i===-1)console.error(d("Invalid data URI")),process.exit(1);u=r.src.slice(i+1)}else{if(!$5(r.src))console.error(d(`File not found: ${r.src}`)),process.exit(1);u=l5(r.src).toString("base64")}let D=await F("create-image-node",{x:Number(r.x),y:Number(r.y),width:r.width?Number(r.width):void 0,height:r.height?Number(r.height):void 0,name:r.name,parentId:r.parent,url:t,data:u,scaleMode:r.scale?.toUpperCase(),radius:r.radius?Number(r.radius):void 0,opacity:r.opacity?Number(r.opacity):void 0});C(D,r.json,"create")}catch(t){w(t)}}});O();B();var fg=E({meta:{description:"Create a component instance"},args:{component:{type:"string",description:"Component ID",required:!0},x:{type:"string",description:"X coordinate",required:!0},y:{type:"string",description:"Y coordinate",required:!0},name:{type:"string",description:"Name"},parent:{type:"string",description:"Parent node ID"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-instance",{componentId:r.component,x:Number(r.x),y:Number(r.y),name:r.name,parentId:r.parent});C(t,r.json,"create")}catch(t){w(t)}}});O();B();var $g=E({meta:{description:"Create a line"},args:{x:{type:"string",description:"X coordinate",required:!0},y:{type:"string",description:"Y coordinate",required:!0},length:{type:"string",description:"Length",required:!0},name:{type:"string",description:"Name"},parent:{type:"string",description:"Parent node ID"},stroke:{type:"string",description:"Stroke color (hex or var:Name)"},"stroke-weight":{type:"string",description:"Stroke weight"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-line",{x:Number(r.x),y:Number(r.y),length:Number(r.length),name:r.name,parentId:r.parent,stroke:r.stroke,strokeWeight:r["stroke-weight"]?Number(r["stroke-weight"]):void 0});C(t,r.json,"create")}catch(t){w(t)}}});O();B();var lg=E({meta:{description:"Create a page"},args:{name:{type:"positional",description:"Page name",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-page",{name:r.name});C(t,r.json,"create")}catch(t){w(t)}}});O();B();var mg=E({meta:{description:"Create a polygon"},args:{x:{type:"string",description:"X coordinate",required:!0},y:{type:"string",description:"Y coordinate",required:!0},size:{type:"string",description:"Size (width/height)",required:!0},sides:{type:"string",description:"Number of sides",default:"6"},name:{type:"string",description:"Name"},parent:{type:"string",description:"Parent node ID"},fill:{type:"string",description:"Fill color (hex or var:Name)"},stroke:{type:"string",description:"Stroke color (hex or var:Name)"},"stroke-weight":{type:"string",description:"Stroke weight"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-polygon",{x:Number(r.x),y:Number(r.y),size:Number(r.size),sides:Number(r.sides),name:r.name,parentId:r.parent,fill:r.fill,stroke:r.stroke,strokeWeight:r["stroke-weight"]?Number(r["stroke-weight"]):void 0});C(t,r.json,"create")}catch(t){w(t)}}});O();B();var cg=E({meta:{description:"Create a rectangle"},args:{x:{type:"string",description:"X coordinate",required:!0},y:{type:"string",description:"Y coordinate",required:!0},width:{type:"string",description:"Width",required:!0},height:{type:"string",description:"Height",required:!0},name:{type:"string",description:"Name"},parent:{type:"string",description:"Parent node ID"},fill:{type:"string",description:"Fill color (hex or var:Name)"},stroke:{type:"string",description:"Stroke color (hex or var:Name)"},"stroke-weight":{type:"string",description:"Stroke weight"},radius:{type:"string",description:"Corner radius"},opacity:{type:"string",description:"Opacity (0-1)"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-rectangle",{x:Number(r.x),y:Number(r.y),width:Number(r.width),height:Number(r.height),name:r.name,parentId:r.parent,fill:r.fill,stroke:r.stroke,strokeWeight:r["stroke-weight"]?Number(r["stroke-weight"]):void 0,radius:r.radius?Number(r.radius):void 0,opacity:r.opacity?Number(r.opacity):void 0});C(t,r.json,"create")}catch(t){w(t)}}});O();B();var vg=E({meta:{description:"Create a section"},args:{x:{type:"string",description:"X coordinate",required:!0},y:{type:"string",description:"Y coordinate",required:!0},width:{type:"string",description:"Width",required:!0},height:{type:"string",description:"Height",required:!0},name:{type:"string",description:"Name",required:!0},parent:{type:"string",description:"Parent node ID"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-section",{x:Number(r.x),y:Number(r.y),width:Number(r.width),height:Number(r.height),name:r.name,parentId:r.parent});C(t,r.json,"create")}catch(t){w(t)}}});O();B();var Eg=E({meta:{description:"Create a slice"},args:{x:{type:"string",description:"X coordinate",required:!0},y:{type:"string",description:"Y coordinate",required:!0},width:{type:"string",description:"Width",required:!0},height:{type:"string",description:"Height",required:!0},name:{type:"string",description:"Name"},parent:{type:"string",description:"Parent node ID"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-slice",{x:Number(r.x),y:Number(r.y),width:Number(r.width),height:Number(r.height),name:r.name,parentId:r.parent});C(t,r.json,"create")}catch(t){w(t)}}});O();B();var Fg=E({meta:{description:"Create a star"},args:{x:{type:"string",description:"X coordinate",required:!0},y:{type:"string",description:"Y coordinate",required:!0},size:{type:"string",description:"Size (width/height)",required:!0},points:{type:"string",description:"Number of points",default:"5"},"inner-ratio":{type:"string",description:"Inner radius ratio (0-1)",default:"0.5"},name:{type:"string",description:"Name"},parent:{type:"string",description:"Parent node ID"},fill:{type:"string",description:"Fill color (hex or var:Name)"},stroke:{type:"string",description:"Stroke color (hex or var:Name)"},"stroke-weight":{type:"string",description:"Stroke weight"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-star",{x:Number(r.x),y:Number(r.y),size:Number(r.size),points:Number(r.points),innerRadius:Number(r["inner-ratio"]),name:r.name,parentId:r.parent,fill:r.fill,stroke:r.stroke,strokeWeight:r["stroke-weight"]?Number(r["stroke-weight"]):void 0});C(t,r.json,"create")}catch(t){w(t)}}});O();B();var gg=E({meta:{description:"Create a text node"},args:{x:{type:"string",description:"X coordinate",required:!0},y:{type:"string",description:"Y coordinate",required:!0},text:{type:"string",description:"Text content",required:!0},"font-size":{type:"string",description:"Font size"},"font-family":{type:"string",description:"Font family (default: Inter)"},"font-style":{type:"string",description:"Font style (Regular, Bold, Medium, etc)"},fill:{type:"string",description:"Text color (hex or var:Name)"},opacity:{type:"string",description:"Opacity (0-1)"},name:{type:"string",description:"Node name"},parent:{type:"string",description:"Parent node ID"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-text",{x:Number(r.x),y:Number(r.y),text:r.text,fontSize:r["font-size"]?Number(r["font-size"]):void 0,fontFamily:r["font-family"],fontStyle:r["font-style"],fill:r.fill,opacity:r.opacity?Number(r.opacity):void 0,name:r.name,parentId:r.parent});C(t,r.json,"create")}catch(t){w(t)}}});O();B();var wg=E({meta:{description:"Create a vector path"},args:{x:{type:"string",description:"X coordinate",required:!0},y:{type:"string",description:"Y coordinate",required:!0},path:{type:"string",description:"SVG path data",required:!0},name:{type:"string",description:"Name"},parent:{type:"string",description:"Parent node ID"},fill:{type:"string",description:"Fill color (hex or var:Name)"},stroke:{type:"string",description:"Stroke color (hex or var:Name)"},"stroke-weight":{type:"string",description:"Stroke weight"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-vector",{x:Number(r.x),y:Number(r.y),path:r.path,name:r.name,parentId:r.parent,fill:r.fill,stroke:r.stroke,strokeWeight:r["stroke-weight"]?Number(r["stroke-weight"]):void 0});C(t,r.json,"create")}catch(t){w(t)}}});var bg=E({meta:{description:"Create nodes"},subCommands:{rect:cg,ellipse:Dg,line:$g,polygon:mg,star:Fg,vector:wg,frame:ng,text:gg,image:eg,component:ug,instance:fg,section:vg,page:lg,slice:Eg,icon:og}});O();O();B();var Cg=E({meta:{description:"Set blend mode"},args:{id:{type:"positional",description:"Node ID",required:!0},mode:{type:"positional",description:"Blend mode: NORMAL, MULTIPLY, SCREEN, OVERLAY, etc",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-blend-mode",{id:r.id,mode:r.mode});C(t,r.json)}catch(t){w(t)}}});O();B();var _g=E({meta:{description:"Set resize constraints"},args:{id:{type:"positional",description:"Node ID",required:!0},horizontal:{type:"string",description:"Horizontal: MIN, CENTER, MAX, STRETCH, SCALE"},vertical:{type:"string",description:"Vertical: MIN, CENTER, MAX, STRETCH, SCALE"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-constraints",{id:r.id,horizontal:r.horizontal,vertical:r.vertical});C(t,r.json)}catch(t){w(t)}}});O();B();var Ig=E({meta:{description:"Set effect (shadow, blur)"},args:{id:{type:"positional",description:"Node ID",required:!0},type:{type:"string",description:"Effect type: DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR",required:!0},radius:{type:"string",description:"Blur radius"},"offset-x":{type:"string",description:"Shadow offset X"},"offset-y":{type:"string",description:"Shadow offset Y"},color:{type:"string",description:"Shadow color (hex with alpha)"},spread:{type:"string",description:"Shadow spread"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-effect",{id:r.id,type:r.type,radius:r.radius?Number(r.radius):void 0,offsetX:r["offset-x"]?Number(r["offset-x"]):void 0,offsetY:r["offset-y"]?Number(r["offset-y"]):void 0,color:r.color,spread:r.spread?Number(r.spread):void 0});C(t,r.json)}catch(t){w(t)}}});O();B();var Ug=E({meta:{description:"Set fill color"},args:{id:{type:"positional",description:"Node ID",required:!0},color:{type:"positional",description:"Color (hex or var:Name)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-fill-color",{id:r.id,color:r.color});C(t,r.json)}catch(t){w(t)}}});O();B();Dt();var Og=E({meta:{description:"Set font properties for a text range"},args:{id:{type:"positional",description:"Text node ID",required:!0},start:{type:"string",required:!0,description:"Start index (0-based)"},end:{type:"string",required:!0,description:"End index (exclusive)"},family:{type:"string",description:"Font family"},style:{type:"string",description:"Font style (Regular, Bold, Italic, etc)"},size:{type:"string",description:"Font size"},color:{type:"string",description:"Text color (hex or var:Name)"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-font-range",{id:r.id,start:parseInt(r.start),end:parseInt(r.end),family:r.family,style:r.style,size:r.size?parseFloat(r.size):void 0,color:r.color});C(t,r.json)}catch(t){w(t)}}});O();B();var yg=E({meta:{description:"Set font properties"},args:{id:{type:"positional",description:"Node ID",required:!0},family:{type:"string",description:"Font family"},style:{type:"string",description:"Font style (Regular, Bold, etc)"},size:{type:"string",description:"Font size"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-font",{id:r.id,fontFamily:r.family,fontStyle:r.style,fontSize:r.size?Number(r.size):void 0});C(t,r.json)}catch(t){w(t)}}});O();B();import{readFileSync as m5}from"fs";var Ng=E({meta:{description:"Set image fill from file"},args:{id:{type:"positional",description:"Node ID",required:!0},file:{type:"positional",description:"Image file path",required:!0},mode:{type:"string",description:"Scale mode: FILL, FIT, CROP, TILE",default:"FILL"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let u=m5(r.file).toString("base64"),D=await F("set-image-fill",{id:r.id,imageData:u,scaleMode:r.mode});C(D,r.json)}catch(t){w(t)}}});O();B();function Bg(r){return r.split(/\s+/).map((t)=>{if(t==="auto"||t==="hug")return{type:"HUG"};if(t.endsWith("fr"))return{type:"FLEX",value:Number(t.slice(0,-2))||1};if(t.endsWith("px"))return{type:"FIXED",value:Number(t.slice(0,-2))};return{type:"FIXED",value:Number(t)}})}var qg=E({meta:{description:"Set auto-layout properties"},args:{id:{type:"positional",description:"Node ID",required:!0},mode:{type:"string",description:"Layout mode: HORIZONTAL, VERTICAL, GRID, NONE"},gap:{type:"string",description:"Item spacing (gap)"},padding:{type:"string",description:'Padding (single or "top,right,bottom,left")'},align:{type:"string",description:"Primary axis alignment: MIN, CENTER, MAX, SPACE_BETWEEN"},"counter-align":{type:"string",description:"Counter axis alignment: MIN, CENTER, MAX, BASELINE"},wrap:{type:"boolean",description:"Enable wrap"},cols:{type:"string",description:'Grid columns: "160px 1fr" or "auto auto"'},rows:{type:"string",description:'Grid rows: "auto auto" or "100px 1fr"'},"col-gap":{type:"string",description:"Grid column gap"},"row-gap":{type:"string",description:"Grid row gap"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t;if(r.padding){let D=r.padding.split(",").map(Number);if(D.length===1){let i=D[0];t={top:i,right:i,bottom:i,left:i}}else if(D.length===4)t={top:D[0],right:D[1],bottom:D[2],left:D[3]}}let u=await F("set-auto-layout",{id:r.id,mode:r.mode?.toUpperCase(),itemSpacing:r.gap?Number(r.gap):void 0,padding:t,primaryAlign:r.align,counterAlign:r["counter-align"],wrap:r.wrap,gridColumnSizes:r.cols?Bg(r.cols):void 0,gridRowSizes:r.rows?Bg(r.rows):void 0,gridColumnGap:r["col-gap"]?Number(r["col-gap"]):void 0,gridRowGap:r["row-gap"]?Number(r["row-gap"]):void 0});C(u,r.json)}catch(t){w(t)}}});O();B();var hg=E({meta:{description:"Set locked state"},args:{id:{type:"positional",description:"Node ID",required:!0},value:{type:"positional",description:"true or false",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-locked",{id:r.id,locked:r.value==="true"});C(t,r.json)}catch(t){w(t)}}});O();B();var zg=E({meta:{description:"Set min/max width and height constraints"},args:{id:{type:"positional",description:"Node ID",required:!0},"min-width":{type:"string",description:"Minimum width"},"max-width":{type:"string",description:"Maximum width"},"min-height":{type:"string",description:"Minimum height"},"max-height":{type:"string",description:"Maximum height"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-min-max",{id:r.id,minWidth:r["min-width"]?Number(r["min-width"]):void 0,maxWidth:r["max-width"]?Number(r["max-width"]):void 0,minHeight:r["min-height"]?Number(r["min-height"]):void 0,maxHeight:r["max-height"]?Number(r["max-height"]):void 0});C(t,r.json,"update")}catch(t){w(t)}}});O();B();var Jg=E({meta:{description:"Set opacity"},args:{id:{type:"positional",description:"Node ID",required:!0},value:{type:"positional",description:"Opacity (0-1)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-opacity",{id:r.id,opacity:Number(r.value)});C(t,r.json)}catch(t){w(t)}}});O();B();var Ag=E({meta:{description:"Set instance component properties"},args:{id:{type:"positional",description:"Instance ID",required:!0},prop:{type:"string",description:"Property in format name=value (can be repeated)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.prop,u=Array.isArray(t)?t:[t],D={};for(let n of u){let o=n.split("="),e=o[0];if(!e)continue;let f=o.slice(1).join("=");if(f==="true")D[e]=!0;else if(f==="false")D[e]=!1;else D[e]=f}let i=await F("set-instance-properties",{instanceId:r.id,properties:D});C(i,r.json,"update")}catch(t){w(t)}}});O();B();var Xg=E({meta:{description:"Set corner radius"},args:{id:{type:"positional",description:"Node ID",required:!0},radius:{type:"string",description:"Uniform radius"},"top-left":{type:"string",description:"Top left radius"},"top-right":{type:"string",description:"Top right radius"},"bottom-left":{type:"string",description:"Bottom left radius"},"bottom-right":{type:"string",description:"Bottom right radius"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-corner-radius",{id:r.id,cornerRadius:r.radius?Number(r.radius):0,topLeftRadius:r["top-left"]?Number(r["top-left"]):void 0,topRightRadius:r["top-right"]?Number(r["top-right"]):void 0,bottomLeftRadius:r["bottom-left"]?Number(r["bottom-left"]):void 0,bottomRightRadius:r["bottom-right"]?Number(r["bottom-right"]):void 0});C(t,r.json)}catch(t){w(t)}}});O();B();var jg=E({meta:{description:"Set rotation angle"},args:{id:{type:"positional",description:"Node ID",required:!0},angle:{type:"string",description:"Angle in degrees",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-rotation",{id:r.id,angle:Number(r.angle)});C(t,r.json)}catch(t){w(t)}}});O();B();var Gg=E({meta:{description:"Set stroke alignment"},args:{id:{type:"positional",description:"Node ID",required:!0},align:{type:"positional",description:"INSIDE | OUTSIDE | CENTER",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.align.toUpperCase();if(!["INSIDE","OUTSIDE","CENTER"].includes(t))throw new Error("Align must be INSIDE, OUTSIDE, or CENTER");let u=await F("set-stroke-align",{id:r.id,align:t});C(u,r.json,"update")}catch(t){w(t)}}});O();B();var Wg=E({meta:{description:"Set stroke color and weight"},args:{id:{type:"positional",description:"Node ID",required:!0},color:{type:"positional",description:"Color (hex or var:Name)",required:!0},weight:{type:"string",description:"Stroke weight"},align:{type:"string",description:"Stroke align: INSIDE, CENTER, OUTSIDE"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-stroke-color",{id:r.id,color:r.color,weight:r.weight?Number(r.weight):void 0,align:r.align});C(t,r.json)}catch(t){w(t)}}});O();B();var Yg=E({meta:{description:"Set text auto resize mode"},args:{id:{type:"positional",description:"Node ID",required:!0},mode:{type:"positional",description:"Resize mode: none, height, width-and-height, truncate",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let u={none:"NONE",height:"HEIGHT","width-and-height":"WIDTH_AND_HEIGHT",truncate:"TRUNCATE"}[r.mode.toLowerCase()]||r.mode.toUpperCase(),D=await F("set-text-auto-resize",{id:r.id,mode:u});C(D,r.json)}catch(t){w(t)}}});O();B();var Tg=E({meta:{description:"Set text content"},args:{id:{type:"positional",description:"Node ID",required:!0},text:{type:"positional",description:"Text content",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-text",{id:r.id,text:r.text});C(t,r.json)}catch(t){w(t)}}});O();B();var Rg=E({meta:{description:"Set visibility"},args:{id:{type:"positional",description:"Node ID",required:!0},value:{type:"positional",description:"true or false",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-visible",{id:r.id,visible:r.value==="true"});C(t,r.json)}catch(t){w(t)}}});var Vg=E({meta:{description:"Set node properties"},subCommands:{fill:Ug,stroke:Wg,"stroke-align":Gg,radius:Xg,opacity:Jg,rotation:jg,visible:Rg,locked:hg,text:Tg,"text-resize":Yg,font:yg,"font-range":Og,effect:Ig,layout:qg,constraints:_g,blend:Cg,image:Ng,props:Ag,minmax:zg}});O();O();B();var Sg=E({meta:{description:"Get components"},args:{name:{type:"string",description:"Filter by name (case-insensitive)"},page:{type:"string",description:"Filter by page ID or name"},limit:{type:"string",description:"Max results",default:"100"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-all-components",{name:r.name,page:r.page,limit:Number(r.limit)});C(t,r.json)}catch(t){w(t)}}});O();B();var Qg=E({meta:{description:"Get all pages"},args:{json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-pages");C(t,r.json)}catch(t){w(t)}}});O();B();var Kg=E({meta:{description:"Get local styles"},args:{json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-local-styles");C(t,r.json)}catch(t){w(t)}}});var Hg=E({meta:{description:"Get document info"},subCommands:{pages:Qg,components:Sg,styles:Kg}});O();O();B();var Mg=E({meta:{description:"Get selected nodes"},args:{json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-selection");C(t,r.json)}catch(t){w(t)}}});O();B();var Zg=E({meta:{description:"Set selection"},args:{ids:{type:"positional",description:"Node IDs (space separated)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(/[\s,]+/),u=await F("select-nodes",{ids:t});C(u,r.json)}catch(t){w(t)}}});var Lg=E({meta:{description:"Selection operations"},subCommands:{get:Mg,set:Zg}});O();O();B();import{writeFileSync as th}from"fs";var Ir=ft(Vb(),1),If=Ir.default,eL=Ir.default.stringify,fL=Ir.default.fromJSON,$L=Ir.default.plugin,lL=Ir.default.parse,mL=Ir.default.list,cL=Ir.default.document,vL=Ir.default.comment,EL=Ir.default.atRule,FL=Ir.default.rule,gL=Ir.default.decl,wL=Ir.default.root,bL=Ir.default.CssSyntaxError,Gu=Ir.default.Declaration,CL=Ir.default.Container,_L=Ir.default.Processor,IL=Ir.default.Document,UL=Ir.default.Comment,OL=Ir.default.Warning,yL=Ir.default.AtRule,NL=Ir.default.Result,BL=Ir.default.Input,qL=Ir.default.Rule,hL=Ir.default.Root,zL=Ir.default.Node;function Sb(r){let{family:t,weight:u,style:D="normal",src:i,display:n="swap"}=r,o=If.atRule({name:"font-face"});return o.append(new Gu({prop:"font-family",value:`'${t}'`}),new Gu({prop:"font-weight",value:String(u)}),new Gu({prop:"font-style",value:D}),new Gu({prop:"src",value:i}),new Gu({prop:"font-display",value:n})),o}function Qb(r){return r.map((t)=>`url('${t.url}') format('${t.format}')`).join(", ")}function Kb(){return If.root()}function M2(r){return`https://fonts.googleapis.com/css2?${r.map((u)=>{let D=u.weights.sort((i,n)=>i-n);if(u.italic){let i=D.flatMap((n)=>[`0,${n}`,`1,${n}`]).join(";");return`family=${encodeURIComponent(u.family)}:ital,wght@${i}`}return`family=${encodeURIComponent(u.family)}:wght@${D.join(";")}`}).join("&")}&display=swap`}function Hb(r){let t=M2(r);return If.atRule({name:"import",params:`url('${t}')`})}B();import{writeFileSync as sq}from"fs";import{join as rh}from"path";var Uf=null;async function Z2(){if(Uf)return Uf;try{let t=await(await fetch("https://fonts.google.com/metadata/fonts")).json();return Uf=new Set(t.familyMetadataList.map((u)=>u.family)),Uf}catch{return new Set(["Inter","Roboto","Open Sans","Lato","Montserrat","Poppins","Nunito","Raleway","Ubuntu","Noto Sans","PT Sans","Fira Sans"])}}function tn(r){let t={Thin:100,Hairline:100,ExtraLight:200,UltraLight:200,Light:300,Regular:400,Normal:400,Medium:500,SemiBold:600,DemiBold:600,Bold:700,ExtraBold:800,UltraBold:800,Black:900,Heavy:900};for(let[u,D]of Object.entries(t))if(r.includes(u))return D;return 400}async function L2(){return await F("get-fonts")||[]}async function P2(r){if(r.length===0)return"";let t=await Z2(),u=(n)=>t.has(n),D=Kb(),i=r.filter((n)=>u(n.family)).map((n)=>({family:n.family,weights:n.styles.map(tn)}));if(i.length>0)D.append(Hb(i));for(let n of r){if(u(n.family))continue;for(let o of n.styles){let e=tn(o),f=o.toLowerCase().includes("italic")?"italic":"normal",$=`${n.family.replace(/\s+/g,"-")}-${o}`;D.append(Sb({family:n.family,weight:e,style:f,src:Qb([{url:`./fonts/${$}.woff2`,format:"woff2"},{url:`./fonts/${$}.woff`,format:"woff"}])}))}}return D.toString()}async function Mb(r){let t=await L2();if(t.length===0)return null;let u=await P2(t);if(!u)return null;let D=rh(r,"fonts.css");return sq(D,u),D}var Zb=E({meta:{description:"List fonts used in the current page"},args:{page:{type:"string",description:"Page name (default: current page)"},css:{type:"boolean",description:"Output as CSS @font-face template"},google:{type:"boolean",description:"Output as Google Fonts URL (if available)"},out:{type:"string",alias:"o",description:"Write CSS to file"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{if(r.page)await F("set-current-page",{name:r.page});let t=await L2();if(t.length===0){console.log(r.json?"[]":"No fonts found");return}if(r.json){console.log(JSON.stringify(t,null,2));return}let u=await Z2(),D=(i)=>u.has(i);if(r.css||r.out){let i=await P2(t);if(r.out)th(r.out,i),console.log(`Written to ${r.out}`);else console.log(i);return}if(r.google){let i=t.filter((o)=>D(o.family));if(i.length===0){console.log("No Google Fonts found. These fonts need to be loaded manually:");for(let o of t)console.log(` - ${o.family} (${o.styles.join(", ")})`);return}console.log(M2(i.map((o)=>({family:o.family,weights:o.styles.map(tn)}))));let n=t.filter((o)=>!D(o.family));if(n.length>0){console.log(`
|
|
384
|
+
These fonts need to be loaded manually:`);for(let o of n)console.log(` - ${o.family} (${o.styles.join(", ")})`)}return}console.log("Fonts used:");for(let i of t){let n=D(i.family);console.log(` ${i.family}${n?" (Google Fonts)":""}`);for(let o of i.styles)console.log(` - ${o} (${tn(o)})`)}}catch(t){w(t)}}});O();B();B();mr();var ih=new Set(["VECTOR","STAR","POLYGON","LINE"]),uh=/^[a-z][a-z0-9]*:[a-z][a-z0-9-]*$/i,k2=null,Of=null;async function Lb(){if(!k2)try{k2=await import("whaticon")}catch(r){if(r.code==="ERR_MODULE_NOT_FOUND")console.error(`whaticon is required for icon matching. Install it:
|
|
385
|
+
|
|
386
|
+
${Vi("whaticon")}
|
|
387
|
+
`),process.exit(1);throw r}return k2}async function Dh(){if(Of)return Of;let r=await Lb(),{ensureIndex:t,loadIndex:u}=r,D=t;if(!D)D=(await import("whaticon/download")).ensureIndex;let{namesGz:i,hashesGz:n}=await D("popular",(o)=>{if(o.startsWith("Downloading"))console.error(o)});return Of=u(i,n),Of}async function nh(r,t={}){let u=await Lb(),D=await Dh();return(await u.findMatches(r,D,{limit:1,threshold:t.threshold??0.9,prefer:t.prefer}))[0]??null}function oh(r){if(r.name&&uh.test(r.name))return!1;if(!ih.has(r.type))return!1;let t=r.width??0,u=r.height??0;if(t<4||t>128||u<4||u>128)return!1;if(Math.max(t,u)/Math.min(t,u)>2)return!1;return!0}async function yf(r,t={}){let u=0;async function D(i){if(oh(i))try{let n=i.svgData;if(!n)n=(await F("export-node-svg",{id:i.id}))?.svg;if(n){let o=await nh(n,{threshold:t.threshold,prefer:t.prefer});if(o)i.matchedIcon=o.name,i.matchedIconSimilarity=o.similarity,u++,t.onMatch?.(i,o)}}catch{}if(i.children)for(let n of i.children)await D(n)}return await D(r),u}B();mr();import*as T from"typescript";var Pb={FRAME:"Frame",RECTANGLE:"Rectangle",ELLIPSE:"Ellipse",TEXT:"Text",COMPONENT:"Frame",COMPONENT_SET:"Frame",INSTANCE:"Frame",GROUP:"Group",SECTION:"Section"},x2=new Set(["VECTOR","STAR","POLYGON","LINE"]),p2=/^[a-z][a-z0-9]*:[a-z][a-z0-9-]*$/i,eh=new Set(["Frame","Text","Rectangle","Ellipse","Line","Image","SVG","Icon","Group","Section","Component"]);function kb(r){if(r.fills?.[0]?.type==="SOLID"&&r.fills[0].color)return r.fills[0].color;if(r.strokes?.[0]?.type==="SOLID"&&r.strokes[0].color)return r.strokes[0].color;if(r.children)for(let t of r.children){let u=kb(t);if(u)return u}return null}function db(r,t){if(r.name&&p2.test(r.name))return;if(x2.has(r.type))t.push(r.id);if(r.children)for(let u of r.children)db(u,t)}function d2(r,t){if(r.id&&t[r.id])r.svgData=t[r.id];if(r.children)for(let u of r.children)d2(u,t)}async function Nf(r){let t=[];if(db(r,t),t.length===0)return;try{let u=await F("batch-export-svg",{ids:t});if(u)d2(r,u)}catch{for(let u of t)try{let D=await F("export-node-svg",{id:u});if(D?.svg)d2(r,{[u]:D.svg})}catch{}}}function Z(r,t){return T.factory.createJsxAttribute(T.factory.createIdentifier(r),T.isStringLiteral(t)?t:T.factory.createJsxExpression(void 0,t))}function cr(r){let t=Math.round(r);if(t<0)return T.factory.createPrefixUnaryExpression(T.SyntaxKind.MinusToken,T.factory.createNumericLiteral(Math.abs(t)));return T.factory.createNumericLiteral(t)}function Br(r){return T.factory.createStringLiteral(r)}function xb(r){let t=r.match(/<svg([^>]*)>([\s\S]*)<\/svg>/i);if(!t)return null;let[,u,D]=t,i=[],n=/(\w+(?:-\w+)*)="([^"]*)"/g,o;while((o=n.exec(u||""))!==null){let[,l,m]=o;if(!l||!m)continue;let c=l.replace(/-([a-z])/g,(g,_)=>_.toUpperCase());if(c==="xmlns")continue;i.push(Z(c,Br(m)))}let e=[],f=/<(\w+)([^/>]*)(\/?)>/g,$;while(($=f.exec(D||""))!==null){let[,l,m]=$;if(!l)continue;let c=[],g=/(\w+(?:-\w+)*)="([^"]*)"/g,_;while((_=g.exec(m||""))!==null){let[,q,y]=_;if(!q)continue;let N=q.replace(/-([a-z])/g,(R,z)=>z.toUpperCase());c.push(Z(N,Br(y??"")))}e.push(T.factory.createJsxSelfClosingElement(T.factory.createIdentifier(l),void 0,T.factory.createJsxAttributes(c)))}if(e.length===0)return T.factory.createJsxSelfClosingElement(T.factory.createIdentifier("svg"),void 0,T.factory.createJsxAttributes(i));return T.factory.createJsxElement(T.factory.createJsxOpeningElement(T.factory.createIdentifier("svg"),void 0,T.factory.createJsxAttributes(i)),e,T.factory.createJsxClosingElement(T.factory.createIdentifier("svg")))}function fh(r){let t=r.toLowerCase();if(t.startsWith("input/")||t.startsWith("textfield/")||t.startsWith("textinput")||t==="input"||t==="textfield"||t==="text-field"||t==="text-input")return{tag:"input",type:"text",selfClosing:!0};if(t.startsWith("textarea/")||t==="textarea"||t==="text-area")return{tag:"textarea"};if(t.startsWith("select/")||t.startsWith("dropdown/")||t==="select"||t==="dropdown")return{tag:"select"};if(t.startsWith("checkbox/")||t==="checkbox")return{tag:"input",type:"checkbox",selfClosing:!0};if(t.startsWith("radio/")||t==="radio")return{tag:"input",type:"radio",selfClosing:!0};if(t.startsWith("button/")||t==="button")return{tag:"button"};return null}function Bf(r,t={}){if(r.visible===!1)return null;let u=r.matchedIcon||(r.name&&p2.test(r.name)?r.name:null);if(u){let l=[];if(l.push(Z("name",Br(u))),r.width)l.push(Z("size",cr(r.width)));let m=kb(r);if(m)l.push(Z("color",Br(m)));return T.factory.createJsxSelfClosingElement(T.factory.createIdentifier("Icon"),void 0,T.factory.createJsxAttributes(l))}if(x2.has(r.type)&&r.svgData){let l=xb(r.svgData);if(l)return l;let m=[];if(m.push(Z("src",Br(r.svgData.replace(/\n/g," ")))),r.width)m.push(Z("w",cr(r.width)));if(r.height)m.push(Z("h",cr(r.height)));return T.factory.createJsxSelfClosingElement(T.factory.createIdentifier("SVG"),void 0,T.factory.createJsxAttributes(m))}if(r.type==="TEXT"&&r.characters){let l=[];if(r.fontFamily)l.push(Z("font",Br(r.fontFamily)));if(r.fontSize&&r.fontSize!==14)l.push(Z("size",cr(r.fontSize)));if(r.fontWeight&&r.fontWeight!==400)l.push(Z("weight",cr(r.fontWeight)));if(r.fills?.[0]?.color&&r.fills[0].color!=="#000000")l.push(Z("color",Br(r.fills[0].color)));if(r.textAutoResize==="HEIGHT")l.push(Z("wrap",T.factory.createTrue()));let m=r.textPropertyRef&&t.textPropMap?.get(r.textPropertyRef),c=m?T.factory.createJsxExpression(void 0,T.factory.createIdentifier(m)):T.factory.createJsxText(r.characters,!1);return T.factory.createJsxElement(T.factory.createJsxOpeningElement(T.factory.createIdentifier("Text"),void 0,T.factory.createJsxAttributes(l)),[c],T.factory.createJsxClosingElement(T.factory.createIdentifier("Text")))}let D=Pb[r.type];if(!D)return null;let i=t.componentSetName||r.name,n=t.semanticHtml&&i?fh(i):null,o=n?.tag||D,e=!!n,f=[];if(n?.type)f.push(Z("type",Br(n.type)));if(r.name&&!r.name.match(/^(Frame|Rectangle)\s*\d*$/)){if(!e)f.push(Z("name",Br(r.name)))}if(r.layoutSizingHorizontal==="FILL")f.push(Z("w",Br("fill")));else if(r.layoutSizingHorizontal!=="HUG"&&r.width)f.push(Z("w",cr(r.width)));if(r.layoutSizingVertical==="FILL")f.push(Z("h",Br("fill")));else if(r.layoutSizingVertical!=="HUG"&&r.height)f.push(Z("h",cr(r.height)));if(r.fills?.[0]?.type==="SOLID"&&r.fills[0].color)f.push(Z("bg",Br(r.fills[0].color)));if(r.strokes?.[0]?.type==="SOLID"&&r.strokes[0].color){if(f.push(Z("stroke",Br(r.strokes[0].color))),r.strokeWeight&&r.strokeWeight!==1)f.push(Z("strokeWidth",cr(r.strokeWeight)));if(r.strokeAlign&&r.strokeAlign!=="CENTER")f.push(Z("strokeAlign",Br(r.strokeAlign.toLowerCase())))}if(r.strokeTopWeight!==void 0||r.strokeBottomWeight!==void 0||r.strokeLeftWeight!==void 0||r.strokeRightWeight!==void 0){if(r.strokeTopWeight!==r.strokeWeight)f.push(Z("strokeTop",cr(r.strokeTopWeight)));if(r.strokeBottomWeight!==r.strokeWeight)f.push(Z("strokeBottom",cr(r.strokeBottomWeight)));if(r.strokeLeftWeight!==r.strokeWeight)f.push(Z("strokeLeft",cr(r.strokeLeftWeight)));if(r.strokeRightWeight!==r.strokeWeight)f.push(Z("strokeRight",cr(r.strokeRightWeight)))}if(r.topLeftRadius!==void 0&&r.topRightRadius!==void 0&&r.bottomLeftRadius!==void 0&&r.bottomRightRadius!==void 0){let{topLeftRadius:l,topRightRadius:m,bottomLeftRadius:c,bottomRightRadius:g}=r;if(l===m&&m===c&&c===g){if(l>0)f.push(Z("rounded",cr(l)))}else f.push(Z("roundedTL",cr(l))),f.push(Z("roundedTR",cr(m))),f.push(Z("roundedBL",cr(c))),f.push(Z("roundedBR",cr(g)))}else if(r.cornerRadius)f.push(Z("rounded",cr(r.cornerRadius)));if(r.cornerSmoothing&&r.cornerSmoothing>0)f.push(Z("cornerSmoothing",T.factory.createNumericLiteral(r.cornerSmoothing.toFixed(2))));if(r.opacity!==void 0&&r.opacity!==1)f.push(Z("opacity",T.factory.createNumericLiteral(r.opacity.toFixed(2))));if(r.blendMode)f.push(Z("blendMode",Br(r.blendMode.toLowerCase().replace(/_/g,"-"))));if(r.rotation)f.push(Z("rotate",cr(Math.round(r.rotation))));if(r.clipsContent)f.push(Z("overflow",Br("hidden")));if(r.effects?.length){for(let l of r.effects)if(l.type==="DROP_SHADOW"){let m=[`${l.offset?.x||0}px`,`${l.offset?.y||0}px`,`${l.radius||0}px`,l.spread?`${l.spread}px`:"",l.color||"rgba(0,0,0,0.25)"].filter(Boolean).join(" ");f.push(Z("shadow",Br(m)))}else if(l.type==="LAYER_BLUR")f.push(Z("blur",cr(l.radius||0)))}if(r.layoutMode==="HORIZONTAL")f.push(Z("flex",Br("row")));else if(r.layoutMode==="VERTICAL")f.push(Z("flex",Br("col")));if(r.layoutWrap==="WRAP")f.push(Z("wrap",T.factory.createTrue()));if(r.itemSpacing)f.push(Z("gap",cr(r.itemSpacing)));if(r.layoutPositioning==="ABSOLUTE")f.push(Z("position",Br("absolute")));if(r.layoutGrow&&r.layoutGrow>0)f.push(Z("grow",cr(r.layoutGrow)));if(r.layoutAlign==="STRETCH")f.push(Z("stretch",T.factory.createTrue()));if(r.minWidth!==void 0&&r.minWidth!==null)f.push(Z("minW",cr(r.minWidth)));if(r.maxWidth!==void 0&&r.maxWidth!==null)f.push(Z("maxW",cr(r.maxWidth)));if(r.minHeight!==void 0&&r.minHeight!==null)f.push(Z("minH",cr(r.minHeight)));if(r.maxHeight!==void 0&&r.maxHeight!==null)f.push(Z("maxH",cr(r.maxHeight)));if(r.primaryAxisAlignItems){let m={CENTER:"center",MAX:"end",SPACE_BETWEEN:"between"}[r.primaryAxisAlignItems];if(m)f.push(Z("justify",Br(m)))}if(r.counterAxisAlignItems){let m={CENTER:"center",MAX:"end",BASELINE:"baseline"}[r.counterAxisAlignItems];if(m)f.push(Z("items",Br(m)))}if(r.padding){let{top:l,right:m,bottom:c,left:g}=r.padding;if(l===m&&m===c&&c===g&&l>0)f.push(Z("p",cr(l)));else if(l===c&&g===m&&l!==g){if(l>0)f.push(Z("py",cr(l)));if(g>0)f.push(Z("px",cr(g)))}else{if(l>0)f.push(Z("pt",cr(l)));if(m>0)f.push(Z("pr",cr(m)));if(c>0)f.push(Z("pb",cr(c)));if(g>0)f.push(Z("pl",cr(g)))}}let $=[];if(r.children)for(let l of r.children){let m=Bf(l,t);if(m)$.push(m)}if(n?.selfClosing)return T.factory.createJsxSelfClosingElement(T.factory.createIdentifier(o),void 0,T.factory.createJsxAttributes(f));if($.length===0)return T.factory.createJsxSelfClosingElement(T.factory.createIdentifier(o),void 0,T.factory.createJsxAttributes(f));if(e&&o==="button"){let l=pb(r);if(l)return T.factory.createJsxElement(T.factory.createJsxOpeningElement(T.factory.createIdentifier(o),void 0,T.factory.createJsxAttributes(f)),[T.factory.createJsxText(l,!1)],T.factory.createJsxClosingElement(T.factory.createIdentifier(o)))}return T.factory.createJsxElement(T.factory.createJsxOpeningElement(T.factory.createIdentifier(o),void 0,T.factory.createJsxAttributes(f)),$,T.factory.createJsxClosingElement(T.factory.createIdentifier(o)))}function pb(r){if(r.type==="TEXT"&&r.characters)return r.characters;if(r.children)for(let t of r.children){let u=pb(t);if(u)return u}return null}function qf(r,t=new Set){if(r.matchedIcon||(r.name&&p2.test(r.name)?r.name:null))return t.add("Icon"),t;if(x2.has(r.type)){if(!r.svgData||!xb(r.svgData))t.add("SVG")}else{let D=r.type==="TEXT"?"Text":Pb[r.type];if(D)t.add(D)}if(r.children)for(let D of r.children)qf(D,t);return t}function ab(r,t,u={}){let D=Bf(r,u);if(!D)return"";let i=qf(r),n=T.factory.createReturnStatement(D),o=T.factory.createBlock([n],!0),e=T.factory.createFunctionDeclaration([T.factory.createModifier(T.SyntaxKind.ExportKeyword),T.factory.createModifier(T.SyntaxKind.DefaultKeyword)],void 0,T.factory.createIdentifier(t),void 0,[],void 0,o),f=Array.from(i).sort().map((c)=>T.factory.createImportSpecifier(!1,void 0,T.factory.createIdentifier(c))),$=T.factory.createImportDeclaration(void 0,T.factory.createImportClause(!1,void 0,T.factory.createNamedImports(f)),T.factory.createStringLiteral("figma-use/render")),l=T.factory.createSourceFile([$,e],T.factory.createToken(T.SyntaxKind.EndOfFileToken),T.NodeFlags.None);return T.createPrinter({newLine:T.NewLineKind.LineFeed,omitTrailingSemicolon:!1}).printFile(l)}function sb(r){let t=r.replace(/[^a-zA-Z0-9]/g,"").replace(/^[0-9]/,"_$&")||"Component";if(eh.has(t))t=`${t}Component`;return t}async function oi(r,t={}){try{let i=(await(await import("oxfmt")).format("component.tsx",r,{semi:t.semi??!1,singleQuote:t.singleQuote??!0,tabWidth:t.tabWidth??2,useTabs:t.useTabs??!1,trailingComma:t.trailingComma??"es5",printWidth:t.printWidth??100})).code;return i=i.replace(/^(import .+\n)(?!import)/m,`$1
|
|
388
|
+
`),i=i.replace(/^(export default .+)\n(?!\n)/m,`$1
|
|
389
|
+
|
|
390
|
+
`),i=i.replace(/^(}\n)(export const)/gm,`$1
|
|
391
|
+
$2`),i}catch(u){if(u.code==="ERR_MODULE_NOT_FOUND")console.error(`oxfmt is required. Install it:
|
|
392
|
+
|
|
393
|
+
${Vi("oxfmt")}
|
|
394
|
+
`),process.exit(1);throw u}}var r9=E({meta:{description:"Export node as JSX component"},args:{id:{type:"positional",description:"Node ID",required:!0},name:{type:"string",description:"Component name (default: derived from node name)"},"match-icons":{type:"boolean",description:"Match vector shapes to Iconify icons (requires whaticon)"},"icon-threshold":{type:"string",description:"Icon match threshold 0-1 (default: 0.9)"},"prefer-icons":{type:"string",description:"Preferred icon sets (comma-separated, e.g., lucide,tabler)"},verbose:{type:"boolean",alias:"v",description:"Show matched icons"},"no-semantic-html":{type:"boolean",description:"Disable semantic HTML conversion"},pretty:{type:"boolean",description:"Format output"},semi:{type:"boolean",description:"Add semicolons (default: false)"},"single-quote":{type:"boolean",description:"Use single quotes (default: true)"},"tab-width":{type:"string",description:"Spaces per indent (default: 2)"},tabs:{type:"boolean",description:"Use tabs instead of spaces"},"trailing-comma":{type:"string",description:"Trailing commas: none, es5, all (default: es5)"}},async run({args:r}){try{let t=Mi(),u=Zi(t),D=await F("get-node-tree",{id:r.id});if(!D)console.error("Node not found"),process.exit(1);if(await Nf(D),r["match-icons"]??u.storybook.matchIcons){let $=r["icon-threshold"]?parseFloat(r["icon-threshold"]):u.storybook.iconThreshold??0.85,l=r["prefer-icons"]?r["prefer-icons"].split(",").map((c)=>c.trim()):u.storybook.preferIcons,m=await yf(D,{threshold:$,prefer:l,onMatch:r.verbose?(c,g)=>{console.error(`Matched: ${c.name} → ${g.name} (${(g.similarity*100).toFixed(0)}%)`)}:void 0});if(r.verbose&&m>0)console.error(`Matched ${m} icon(s)
|
|
395
|
+
`)}let n=r.name||sb(D.name),o=!r["no-semantic-html"],e=ab(D,n,{semanticHtml:o});if(r.pretty??u.format.pretty)e=await oi(e,{semi:r.semi??u.format.semi,singleQuote:r["single-quote"]??u.format.singleQuote??!0,tabWidth:r["tab-width"]?Number(r["tab-width"]):u.format.tabWidth,useTabs:r.tabs??u.format.tabs,trailingComma:r["trailing-comma"]??u.format.trailingComma});console.log(e)}catch(t){w(t)}}});O();B();import{writeFileSync as $h}from"fs";B();var t9=16777216,a2=4096;function s2(r,t,u){let D=r*t;if(r>a2||t>a2)return{ok:!1,message:`${u} ${r}×${t} exceeds max dimension ${a2}px. Use --force to override.`};if(D>t9){let i=(D/1e6).toFixed(1),n=(t9/1e6).toFixed(0);return{ok:!1,message:`${u} ${r}×${t} (${i}MP) exceeds ${n}MP limit. Use --force to override.`}}return{ok:!0}}async function i9(r,t,u){if(u)return{ok:!0};let D=await F("get-node-info",{id:r});if(!D||!D.width||!D.height)return{ok:!0};let i=Math.round(D.width*t),n=Math.round(D.height*t);return s2(i,n,"Export size")}async function u9(r,t){if(t)return{ok:!0};let u=await F("get-viewport",{}),D=Math.round(u.bounds.width*r),i=Math.round(u.bounds.height*r);return s2(D,i,"Viewport")}async function D9(r,t,u){if(u)return{ok:!0};let D=await F("get-selection",{});if(D.length===0)return{ok:!0};let i=1/0,n=1/0,o=-1/0,e=-1/0;for(let l of D)if(l.width&&l.height){let m=l.x||0,c=l.y||0;i=Math.min(i,m),n=Math.min(n,c),o=Math.max(o,m+l.width),e=Math.max(e,c+l.height)}if(i===1/0)return{ok:!0};let f=Math.round((o-i+t*2)*r),$=Math.round((e-n+t*2)*r);return s2(f,$,"Selection")}mr();var n9=E({meta:{description:"Export node as image"},args:{id:{type:"positional",description:"Node ID",required:!0},format:{type:"string",description:"Format: PNG, JPG, SVG, PDF",default:"PNG"},scale:{type:"string",description:"Export scale",default:"1"},output:{type:"string",description:"Output file path"},timeout:{type:"string",description:"Timeout in seconds"},force:{type:"boolean",description:"Skip size check",alias:"f"}},async run({args:r}){try{let t=Number(r.scale),u=await i9(r.id,t,r.force||!1);if(!u.ok)console.error(d(u.message)),process.exit(1);let D=await F("export-node",{id:r.id,format:r.format.toUpperCase(),scale:t},{timeout:r.timeout?Number(r.timeout)*1000:void 0});if(r.output){let i=Buffer.from(D.data,"base64");$h(r.output,i),console.log(r.output)}else console.log(JSON.stringify(D,null,2))}catch(t){w(t)}}});O();B();import{writeFileSync as lh}from"fs";mr();var o9=E({meta:{description:"Screenshot current viewport"},args:{output:{type:"string",description:"Output file path",default:"/tmp/figma-screenshot.png"},scale:{type:"string",description:"Export scale",default:"1"},timeout:{type:"string",description:"Timeout in seconds"},force:{type:"boolean",description:"Skip size check",alias:"f"}},async run({args:r}){try{let t=Number(r.scale),u=await u9(t,r.force||!1);if(!u.ok)console.error(d(u.message)),process.exit(1);let D=await F("screenshot",{scale:t},{timeout:r.timeout?Number(r.timeout)*1000:void 0}),i=Buffer.from(D.data,"base64");lh(r.output,i),console.log(r.output)}catch(t){w(t)}}});O();B();import{writeFileSync as mh}from"fs";mr();var e9=E({meta:{description:"Export selection as image"},args:{format:{type:"string",description:"Format: PNG, JPG, SVG, PDF",default:"PNG"},scale:{type:"string",description:"Export scale",default:"2"},output:{type:"string",description:"Output file path",default:"/tmp/figma-selection.png"},padding:{type:"string",description:"Padding around selection",default:"0"},timeout:{type:"string",description:"Timeout in seconds"},force:{type:"boolean",description:"Skip size check",alias:"f"}},async run({args:r}){try{let t=Number(r.scale),u=Number(r.padding),D=await D9(t,u,r.force||!1);if(!D.ok)console.error(d(D.message)),process.exit(1);let i=await F("export-selection",{format:r.format.toUpperCase(),scale:t,padding:u},{timeout:r.timeout?Number(r.timeout)*1000:void 0}),n=Buffer.from(i.data,"base64");mh(r.output,n),console.log(r.output)}catch(t){w(t)}}});O();ji();B();import{existsSync as ch,mkdirSync as vh,writeFileSync as un}from"fs";import{join as Dn}from"path";import*as b from"typescript";mr();var f9={react:{module:"@figma-use/react",storybookType:"@storybook/react",fileExt:".stories.tsx"},vue:{module:"@figma-use/vue",storybookType:"@storybook/vue3",fileExt:".stories.tsx"}};function Eh(r){return r.replace(/\s+/g,"").replace(/[^a-zA-Z0-9-_]/g,"")}function tv(r){return r.replace(/[^a-zA-Z0-9]+(.)/g,(t,u)=>u.toUpperCase()).replace(/^./,(t)=>t.toLowerCase())}function l9(r){let t=tv(r);return t.charAt(0).toUpperCase()+t.slice(1)}function rv(r){let t=[];for(let[u,D]of Object.entries(r))if(D.type==="VARIANT"){let i=D.variantOptions||[],n=i.length===2&&i.every((e)=>e.toLowerCase()==="true"||e.toLowerCase()==="false"),o=tv(u.split("#")[0]||u);if(n&&/^property\d*$/i.test(o))o="checked";t.push({name:u,camelName:o,type:n?"boolean":"string",options:n?void 0:i,defaultValue:D.defaultValue})}else if(D.type==="TEXT"){let i=u.split("#")[0]||u;t.push({name:u,camelName:tv(i),type:"text",defaultValue:D.defaultValue})}return t}function m9(r){let t={},u=r.split(", ");for(let D of u){let[i,n]=D.split("=");if(i&&n)t[i.trim()]=n.trim()}return t}function c9(r){return r.split(/[\s=\/]+/).map((t)=>t.charAt(0).toUpperCase()+t.slice(1)).join("").replace(/[^a-zA-Z0-9]/g,"")}function Fh(r){let t=new Map,u=new Map;for(let D of r)if(D.type==="COMPONENT_SET")u.set(D.id,D);for(let D of r){if(D.type==="COMPONENT_SET")continue;let i,n,o=!1,e,f;if(D.componentSetId){i=D.componentSetId;let $=u.get(D.componentSetId);if(n=$?.name||D.name.split(",")[0]?.split("=")[0]||D.name,o=!0,f=D.componentSetId,$?.componentPropertyDefinitions)e=rv($.componentPropertyDefinitions)}else if(D.name.includes("/")){if(n=D.name.split("/")[0]||D.name,i=`name:${n}`,D.componentPropertyDefinitions){let $=rv(D.componentPropertyDefinitions).filter((l)=>l.type==="text");if($.length>0)e=$}}else if(n=D.name,i=`id:${D.id}`,D.componentPropertyDefinitions){let $=rv(D.componentPropertyDefinitions).filter((l)=>l.type==="text");if($.length>0)e=$}if(!t.has(i))t.set(i,{baseName:n,components:[],isComponentSet:o,props:e,componentSetId:f});t.get(i).components.push(D)}return t}function gh(r){if(r.includes("/"))return r.split("/").slice(1).join("/");if(r.includes("="))return r.split(", ").map((t)=>t.split("=")[1]).join("");return"Default"}function wh(r,t,u,D,i){let n=[];n.push(b.factory.createImportDeclaration(void 0,b.factory.createImportClause(!1,b.factory.createIdentifier("React"),void 0),b.factory.createStringLiteral("react")));let o=Array.from(D).sort();if(o.length>0)n.push(b.factory.createImportDeclaration(void 0,b.factory.createImportClause(!1,void 0,b.factory.createNamedImports(o.map((m)=>b.factory.createImportSpecifier(!1,void 0,b.factory.createIdentifier(m))))),b.factory.createStringLiteral(i.module)));let e=t.map((m)=>{let c;if(m.type==="boolean")c=b.factory.createKeywordTypeNode(b.SyntaxKind.BooleanKeyword);else if(m.type==="text")c=b.factory.createKeywordTypeNode(b.SyntaxKind.StringKeyword);else c=b.factory.createUnionTypeNode((m.options||[]).map((g)=>b.factory.createLiteralTypeNode(b.factory.createStringLiteral(g))));return b.factory.createPropertySignature(void 0,m.camelName,b.factory.createToken(b.SyntaxKind.QuestionToken),c)});n.push(b.factory.createInterfaceDeclaration([b.factory.createModifier(b.SyntaxKind.ExportKeyword)],`${r}Props`,void 0,void 0,e));let f=[],$=t.filter((m)=>m.type!=="text");if($.length===1&&$[0]?.type==="boolean"){let m=$[0],c=`${m.name}=true`,g=`${m.name}=false`,_=u.get(c),q=u.get(g);if(_&&q)f.push(b.factory.createIfStatement(b.factory.createIdentifier(m.camelName),b.factory.createReturnStatement(_),b.factory.createReturnStatement(q)))}else if($.length>0){for(let[m,c]of u){let g=m9(m),q=$.map((y)=>{let N=g[y.name]??"";if(y.type==="boolean")return N==="true"?b.factory.createIdentifier(y.camelName):b.factory.createPrefixUnaryExpression(b.SyntaxKind.ExclamationToken,b.factory.createIdentifier(y.camelName));return b.factory.createBinaryExpression(b.factory.createIdentifier(y.camelName),b.SyntaxKind.EqualsEqualsEqualsToken,b.factory.createStringLiteral(N))}).reduce((y,N)=>b.factory.createBinaryExpression(y,b.SyntaxKind.AmpersandAmpersandToken,N));f.push(b.factory.createIfStatement(q,b.factory.createReturnStatement(c)))}f.push(b.factory.createReturnStatement(b.factory.createNull()))}else{let m=u.values().next().value;if(m)f.push(b.factory.createReturnStatement(m))}let l=b.factory.createParameterDeclaration(void 0,void 0,b.factory.createObjectBindingPattern(t.map((m)=>b.factory.createBindingElement(void 0,void 0,b.factory.createIdentifier(m.camelName)))),void 0,b.factory.createTypeReferenceNode(`${r}Props`));return n.push(b.factory.createFunctionDeclaration([b.factory.createModifier(b.SyntaxKind.ExportKeyword)],void 0,r,void 0,[l],void 0,b.factory.createBlock(f,!0))),b.factory.createSourceFile(n,b.factory.createToken(b.SyntaxKind.EndOfFileToken),b.NodeFlags.None)}function bh(r,t,u,D,i){let n=[];n.push(b.factory.createImportDeclaration(void 0,b.factory.createImportClause(!0,void 0,b.factory.createNamedImports([b.factory.createImportSpecifier(!1,void 0,b.factory.createIdentifier("Meta")),b.factory.createImportSpecifier(!1,void 0,b.factory.createIdentifier("StoryObj"))])),b.factory.createStringLiteral(i.storybookType))),n.push(b.factory.createImportDeclaration(void 0,b.factory.createImportClause(!1,void 0,b.factory.createNamedImports([b.factory.createImportSpecifier(!1,void 0,b.factory.createIdentifier(t))])),b.factory.createStringLiteral(`./${t}`))),n.push(b.factory.createExportDefault(b.factory.createSatisfiesExpression(b.factory.createObjectLiteralExpression([b.factory.createPropertyAssignment("title",b.factory.createStringLiteral(r)),b.factory.createPropertyAssignment("component",b.factory.createIdentifier(t))]),b.factory.createTypeReferenceNode("Meta",[b.factory.createTypeQueryNode(b.factory.createIdentifier(t))]))));for(let o of D){let e=u.map((f)=>{let $=f.type==="text"?f.defaultValue:o.propValues[f.name],l=f.type==="boolean"?$==="true"?b.factory.createTrue():b.factory.createFalse():b.factory.createStringLiteral($||"");return b.factory.createPropertyAssignment(f.camelName,l)});n.push(b.factory.createVariableStatement([b.factory.createModifier(b.SyntaxKind.ExportKeyword)],b.factory.createVariableDeclarationList([b.factory.createVariableDeclaration(c9(o.name),void 0,b.factory.createTypeReferenceNode("StoryObj",[b.factory.createTypeQueryNode(b.factory.createIdentifier(t))]),b.factory.createObjectLiteralExpression([b.factory.createPropertyAssignment("args",b.factory.createObjectLiteralExpression(e))]))],b.NodeFlags.Const)))}return b.factory.createSourceFile(n,b.factory.createToken(b.SyntaxKind.EndOfFileToken),b.NodeFlags.None)}function Ch(r,t,u,D){let i=[];i.push(b.factory.createImportDeclaration(void 0,b.factory.createImportClause(!1,b.factory.createIdentifier("React"),void 0),b.factory.createStringLiteral("react"))),i.push(b.factory.createImportDeclaration(void 0,b.factory.createImportClause(!0,void 0,b.factory.createNamedImports([b.factory.createImportSpecifier(!1,void 0,b.factory.createIdentifier("Meta")),b.factory.createImportSpecifier(!1,void 0,b.factory.createIdentifier("StoryObj"))])),b.factory.createStringLiteral(D.storybookType)));let n=Array.from(u).sort();if(n.length>0)i.push(b.factory.createImportDeclaration(void 0,b.factory.createImportClause(!1,void 0,b.factory.createNamedImports(n.map((o)=>b.factory.createImportSpecifier(!1,void 0,b.factory.createIdentifier(o))))),b.factory.createStringLiteral(D.module)));i.push(b.factory.createExportDefault(b.factory.createSatisfiesExpression(b.factory.createObjectLiteralExpression([b.factory.createPropertyAssignment("title",b.factory.createStringLiteral(r))]),b.factory.createTypeReferenceNode("Meta"))));for(let o of t)i.push(b.factory.createVariableStatement([b.factory.createModifier(b.SyntaxKind.ExportKeyword)],b.factory.createVariableDeclarationList([b.factory.createVariableDeclaration(c9(o.name),void 0,b.factory.createTypeReferenceNode("StoryObj"),b.factory.createObjectLiteralExpression([b.factory.createPropertyAssignment("render",b.factory.createArrowFunction(void 0,void 0,[],void 0,b.factory.createToken(b.SyntaxKind.EqualsGreaterThanToken),o.jsx))]))],b.NodeFlags.Const)));return b.factory.createSourceFile(i,b.factory.createToken(b.SyntaxKind.EndOfFileToken),b.NodeFlags.None)}async function iv(r,t,u,D){let i=await F("get-node-tree",{id:r.id});if(!i)return null;if(await Nf(i),t.matchIcons)await yf(i,{threshold:t.iconThreshold,prefer:t.preferIcons,onMatch:t.verbose?(e,f)=>{console.error(`Matched: ${e.name} → ${f.name} (${(f.similarity*100).toFixed(0)}%)`)}:void 0});let n=Bf(i,{textPropMap:u,semanticHtml:t.semanticHtml,componentSetName:D});if(!n)return null;let o=new Set;return qf(i,o),{jsx:n,usedComponents:o}}async function _h(r,t,u,D,i,n){let{baseName:o,components:e,isComponentSet:f,props:$}=r;try{if(f&&$&&$.length>0)return await yh(o,e,$,t,u,D,i,n);let l=$?.filter((y)=>y.type==="text")||[];if(l.length>0&&e.length===1&&e[0])return await Ih(o,e[0],l,t,u,D,i,n);let m=[],c=new Set;for(let y of e){let N=await iv(y,t);if(!N)continue;for(let R of N.usedComponents)c.add(R);m.push({name:gh(y.name),jsx:N.jsx})}if(m.length===0)return{name:o,error:"No variants exported"};let g=Ch(o,m,c,u),_=n.printFile(g);_=await oi(_,D);let q=Dn(i,`${Eh(o)}${u.fileExt}`);return un(q,_),{name:o,file:q,variants:m.length}}catch(l){return{name:o,error:l.message}}}async function Ih(r,t,u,D,i,n,o,e){let f=l9(r.replace(/\//g,"")),$=new Map;for(let N of u)$.set(N.name,N.camelName);let l=await iv(t,D,$);if(!l)return{name:r,error:"Failed to process component"};let m=Uh(f,u,l.jsx,l.usedComponents,i),c=e.printFile(m);c=await oi(c,n);let g=Dn(o,`${f}.tsx`);un(g,c);let _=Oh(r,f,u,i),q=e.printFile(_);q=await oi(q,n);let y=Dn(o,`${f}.stories.tsx`);return un(y,q),{name:r,file:y,variants:1}}function Uh(r,t,u,D,i){let n=[];n.push(b.factory.createImportDeclaration(void 0,b.factory.createImportClause(!1,b.factory.createIdentifier("React"),void 0),b.factory.createStringLiteral("react")));let o=Array.from(D).sort();if(o.length>0)n.push(b.factory.createImportDeclaration(void 0,b.factory.createImportClause(!1,void 0,b.factory.createNamedImports(o.map(($)=>b.factory.createImportSpecifier(!1,void 0,b.factory.createIdentifier($))))),b.factory.createStringLiteral(i.module)));let e=t.map(($)=>b.factory.createPropertySignature(void 0,$.camelName,b.factory.createToken(b.SyntaxKind.QuestionToken),b.factory.createKeywordTypeNode(b.SyntaxKind.StringKeyword)));n.push(b.factory.createInterfaceDeclaration([b.factory.createModifier(b.SyntaxKind.ExportKeyword)],`${r}Props`,void 0,void 0,e));let f=b.factory.createParameterDeclaration(void 0,void 0,b.factory.createObjectBindingPattern(t.map(($)=>b.factory.createBindingElement(void 0,void 0,b.factory.createIdentifier($.camelName),b.factory.createStringLiteral($.defaultValue)))),void 0,b.factory.createTypeReferenceNode(`${r}Props`));return n.push(b.factory.createFunctionDeclaration([b.factory.createModifier(b.SyntaxKind.ExportKeyword)],void 0,r,void 0,[f],void 0,b.factory.createBlock([b.factory.createReturnStatement(u)],!0))),b.factory.createSourceFile(n,b.factory.createToken(b.SyntaxKind.EndOfFileToken),b.NodeFlags.None)}function Oh(r,t,u,D){let i=[];i.push(b.factory.createImportDeclaration(void 0,b.factory.createImportClause(!0,void 0,b.factory.createNamedImports([b.factory.createImportSpecifier(!1,void 0,b.factory.createIdentifier("Meta")),b.factory.createImportSpecifier(!1,void 0,b.factory.createIdentifier("StoryObj"))])),b.factory.createStringLiteral(D.storybookType))),i.push(b.factory.createImportDeclaration(void 0,b.factory.createImportClause(!1,void 0,b.factory.createNamedImports([b.factory.createImportSpecifier(!1,void 0,b.factory.createIdentifier(t))])),b.factory.createStringLiteral(`./${t}`))),i.push(b.factory.createExportDefault(b.factory.createSatisfiesExpression(b.factory.createObjectLiteralExpression([b.factory.createPropertyAssignment("title",b.factory.createStringLiteral(r)),b.factory.createPropertyAssignment("component",b.factory.createIdentifier(t))]),b.factory.createTypeReferenceNode("Meta",[b.factory.createTypeQueryNode(b.factory.createIdentifier(t))]))));let n=u.map((o)=>b.factory.createPropertyAssignment(o.camelName,b.factory.createStringLiteral(o.defaultValue)));return i.push(b.factory.createVariableStatement([b.factory.createModifier(b.SyntaxKind.ExportKeyword)],b.factory.createVariableDeclarationList([b.factory.createVariableDeclaration("Default",void 0,b.factory.createTypeReferenceNode("StoryObj",[b.factory.createTypeQueryNode(b.factory.createIdentifier(t))]),b.factory.createObjectLiteralExpression([b.factory.createPropertyAssignment("args",b.factory.createObjectLiteralExpression(n))]))],b.NodeFlags.Const))),b.factory.createSourceFile(i,b.factory.createToken(b.SyntaxKind.EndOfFileToken),b.NodeFlags.None)}async function yh(r,t,u,D,i,n,o,e){let f=l9(r),$=new Map,l=new Set,m=[],c=new Map;for(let z of u)if(z.type==="text")c.set(z.name,z.camelName);for(let z of t){let A=await iv(z,D,c,r);if(!A)continue;for(let a of A.usedComponents)l.add(a);let K=m9(z.name),L=z.name;$.set(L,A.jsx);let p=u.filter((a)=>a.type!=="text").map((a)=>{let Q=K[a.name];if(!Q)return"";if(a.camelName==="checked"&&a.type==="boolean")return Q==="true"?"Checked":"Unchecked";return Q.charAt(0).toUpperCase()+Q.slice(1)}).filter(Boolean).join("");m.push({name:p||"Default",propValues:K})}if($.size===0)return{name:r,error:"No variants exported"};let g=wh(f,u,$,l,i),_=e.printFile(g);_=await oi(_,n);let q=Dn(o,`${f}.tsx`);un(q,_);let y=bh(r,f,u,m,i),N=e.printFile(y);N=await oi(N,n);let R=Dn(o,`${f}.stories.tsx`);return un(R,N),{name:r,file:R,variants:m.length}}function $9(r){return"error"in r}var v9=E({meta:{description:"Export components as Storybook stories"},args:{out:{type:"string",description:"Output directory",default:"./stories"},page:{type:"string",description:"Page name (default: current page)"},"match-icons":{type:"boolean",description:"Match vectors to Iconify icons"},"icon-threshold":{type:"string",description:"Icon match threshold 0-1 (default: 0.9)"},"prefer-icons":{type:"string",description:"Preferred icon sets (comma-separated)"},verbose:{type:"boolean",alias:"v",description:"Show matched icons"},framework:{type:"string",description:"Framework: react (default), vue"},"no-fonts":{type:"boolean",description:"Skip fonts.css generation"},"no-semantic-html":{type:"boolean",description:"Disable semantic HTML conversion"},semi:{type:"boolean",description:"Add semicolons"},"single-quote":{type:"boolean",description:"Use single quotes (default: true)"},"tab-width":{type:"string",description:"Spaces per indent (default: 2)"},tabs:{type:"boolean",description:"Use tabs instead of spaces"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=Mi(),u=Zi(t),D=r.framework||u.storybook.framework||"react",i=f9[D];if(!i)console.error(`Unknown framework: ${D}. Available: ${Object.keys(f9).join(", ")}`),process.exit(1);let n=r.page||u.storybook.page;if(n)await F("set-current-page",{page:n});let o=await F("get-all-components",{limit:1000});if(!o?.length){console.log(r.json?"[]":"No components found on this page");return}let e=r.out!=="./stories"?r.out:u.storybook.out||"./stories";if(!ch(e))vh(e,{recursive:!0});let f={semi:r.semi??u.format.semi,singleQuote:r["single-quote"]??u.format.singleQuote??!0,tabWidth:r["tab-width"]?Number(r["tab-width"]):u.format.tabWidth,useTabs:r.tabs??u.format.tabs},$=r["match-icons"]??u.storybook.matchIcons,l=r["icon-threshold"]?parseFloat(r["icon-threshold"]):u.storybook.iconThreshold??0.85,m=r["prefer-icons"]?r["prefer-icons"].split(",").map((A)=>A.trim()):u.storybook.preferIcons,c={matchIcons:!!$,iconThreshold:l,preferIcons:m,verbose:!!r.verbose,semanticHtml:!r["no-semantic-html"]},g=Fh(o),_=b.createPrinter({newLine:b.NewLineKind.LineFeed}),q=new Set,y=await Promise.all(Array.from(g.values()).map((A)=>_h(A,c,i,f,e,_))),N=y.filter((A)=>!$9(A)&&!q.has(A.file)),R=y.filter($9),z=null;if(!r["no-fonts"]&&N.length>0)z=await Mb(e);if(r.json)console.log(JSON.stringify({exported:N,errors:R,fonts:z},null,2));else{for(let A of N){let K=A.variants>1?` (${A.variants} variants)`:"";console.log(Dr(`${A.name}${K} → ${A.file}`))}if(z)console.log(Dr(`fonts → ${z}`));for(let A of R)console.log(d(`${A.name}: ${A.error}`));console.log(`
|
|
396
|
+
Exported ${N.length} stories${z?" + fonts.css":""}${R.length?`, ${R.length} errors`:""}`)}li()}catch(t){w(t)}}});var E9=E({meta:{description:"Export images and code"},subCommands:{fonts:Zb,node:n9,selection:e9,screenshot:o9,jsx:r9,storybook:v9}});O();O();B();var F9=E({meta:{description:"Get bounding box of all objects on current page"},args:{json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-page-bounds",{});C(t,r.json)}catch(t){w(t)}}});O();B();var g9=E({meta:{description:"Get current page"},args:{json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("eval",{code:"return { id: figma.currentPage.id, name: figma.currentPage.name }"});if(r.json)console.log(JSON.stringify(t,null,2));else console.log(`${t.name} (${t.id})`)}catch(t){w(t)}}});O();B();var w9=E({meta:{description:"List all pages"},args:{json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-pages");C(t,r.json)}catch(t){w(t)}}});O();B();var b9=E({meta:{description:"Switch to page by ID or name"},args:{page:{type:"positional",description:"Page ID or name",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-current-page",{page:r.page});C(t,r.json)}catch(t){w(t)}}});var C9=E({meta:{description:"Page operations"},subCommands:{current:g9,list:w9,set:b9,bounds:F9}});O();O();B();var _9=E({meta:{description:"Get viewport position and zoom"},args:{json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-viewport");C(t,r.json)}catch(t){w(t)}}});O();B();var I9=E({meta:{description:"Set viewport position and zoom"},args:{x:{type:"string",description:"X position"},y:{type:"string",description:"Y position"},zoom:{type:"string",description:"Zoom level"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-viewport",{x:r.x?Number(r.x):void 0,y:r.y?Number(r.y):void 0,zoom:r.zoom?Number(r.zoom):void 0});C(t,r.json)}catch(t){w(t)}}});O();B();var U9=E({meta:{description:"Zoom viewport to fit nodes"},args:{ids:{type:"positional",description:"Node IDs (space separated, or selection if omitted)"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids?r.ids.split(/[\s,]+/):void 0,u=await F("zoom-to-fit",{ids:t});C(u,r.json)}catch(t){w(t)}}});var O9=E({meta:{description:"Viewport operations"},subCommands:{get:_9,set:I9,"zoom-to-fit":U9}});O();O();B();var y9=E({meta:{description:"Bind variable to node property"},args:{node:{type:"string",description:"Node ID",required:!0},field:{type:"string",description:"Field: fills, strokes, opacity, width, height, etc",required:!0},variable:{type:"string",description:"Variable ID",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("bind-variable",{nodeId:r.node,field:r.field,variableId:r.variable});C(t,r.json)}catch(t){w(t)}}});O();B();var N9=E({meta:{description:"Create a variable"},args:{name:{type:"positional",description:"Variable name",required:!0},collection:{type:"string",description:"Collection ID",required:!0},type:{type:"string",description:"Type: COLOR, FLOAT, STRING, BOOLEAN",required:!0},value:{type:"string",description:"Initial value"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-variable",{name:r.name,collectionId:r.collection,type:r.type,value:r.value});C(t,r.json)}catch(t){w(t)}}});O();B();var B9=E({meta:{description:"Delete a variable"},args:{id:{type:"positional",description:"Variable ID",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("delete-variable",{id:r.id});C(t,r.json)}catch(t){w(t)}}});O();B();var q9=E({meta:{description:"Find variables by name pattern"},args:{query:{type:"positional",description:"Search query (substring match)",required:!0},type:{type:"string",description:"Filter by type: COLOR, FLOAT, STRING, BOOLEAN"},limit:{type:"string",description:"Max results (default: 20)"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("find-variables",{query:r.query,type:r.type,limit:r.limit?Number(r.limit):20});C(t,r.json)}catch(t){w(t)}}});O();B();var h9=E({meta:{description:"Get variable by ID"},args:{id:{type:"positional",description:"Variable ID",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-variable",{id:r.id});C(t,r.json)}catch(t){w(t)}}});O();B();var z9=E({meta:{description:"List all variables"},args:{type:{type:"string",description:"Filter by type: COLOR, FLOAT, STRING, BOOLEAN"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-variables",{type:r.type});C(t,r.json)}catch(t){w(t)}}});O();B();var J9=E({meta:{description:"Set variable value for mode"},args:{id:{type:"positional",description:"Variable ID",required:!0},mode:{type:"string",description:"Mode ID",required:!0},value:{type:"string",description:"Value (color hex, number, string, or true/false)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("set-variable-value",{id:r.id,modeId:r.mode,value:r.value});C(t,r.json)}catch(t){w(t)}}});var A9=E({meta:{description:"Variable operations"},subCommands:{list:z9,find:q9,get:h9,create:N9,set:J9,delete:B9,bind:y9}});O();O();B();var X9=E({meta:{description:"Create a variable collection"},args:{name:{type:"positional",description:"Collection name",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-variable-collection",{name:r.name});C(t,r.json)}catch(t){w(t)}}});O();B();var j9=E({meta:{description:"Delete a variable collection"},args:{id:{type:"positional",description:"Collection ID",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("delete-variable-collection",{id:r.id});C(t,r.json)}catch(t){w(t)}}});O();B();var G9=E({meta:{description:"Get variable collection by ID"},args:{id:{type:"positional",description:"Collection ID",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-variable-collection",{id:r.id});C(t,r.json)}catch(t){w(t)}}});O();B();var W9=E({meta:{description:"List variable collections"},args:{json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-variable-collections");C(t,r.json)}catch(t){w(t)}}});var Y9=E({meta:{description:"Variable collection operations"},subCommands:{list:W9,get:G9,create:X9,delete:j9}});O();O();B();var T9=E({meta:{description:"Create an effect style"},args:{name:{type:"positional",description:"Style name",required:!0},type:{type:"string",description:"Effect type: DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR",required:!0},radius:{type:"string",description:"Blur radius"},"offset-x":{type:"string",description:"Shadow offset X"},"offset-y":{type:"string",description:"Shadow offset Y"},color:{type:"string",description:"Shadow color (hex with alpha)"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-effect-style",{name:r.name,type:r.type,radius:r.radius?Number(r.radius):void 0,offsetX:r["offset-x"]?Number(r["offset-x"]):void 0,offsetY:r["offset-y"]?Number(r["offset-y"]):void 0,color:r.color});C(t,r.json)}catch(t){w(t)}}});O();B();var R9=E({meta:{description:"Create a paint/color style"},args:{name:{type:"positional",description:"Style name",required:!0},color:{type:"string",description:"Color (hex or var:Name)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-paint-style",{name:r.name,color:r.color});C(t,r.json)}catch(t){w(t)}}});O();B();var V9=E({meta:{description:"Create a text style"},args:{name:{type:"positional",description:"Style name",required:!0},family:{type:"string",description:"Font family",default:"Inter"},style:{type:"string",description:"Font style",default:"Regular"},size:{type:"string",description:"Font size",default:"16"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("create-text-style",{name:r.name,fontFamily:r.family,fontStyle:r.style,fontSize:Number(r.size)});C(t,r.json)}catch(t){w(t)}}});O();B();var S9=E({meta:{description:"List local styles"},args:{json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-local-styles");C(t,r.json)}catch(t){w(t)}}});var Q9=E({meta:{description:"Style operations"},subCommands:{list:S9,"create-paint":R9,"create-text":V9,"create-effect":T9}});O();O();B();var K9=E({meta:{description:"Exclude nodes"},args:{ids:{type:"positional",description:"Node IDs (space or comma separated)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(/[\s,]+/),u=await F("boolean-operation",{ids:t,operation:"EXCLUDE"});C(u,r.json)}catch(t){w(t)}}});O();B();var H9=E({meta:{description:"Intersect nodes"},args:{ids:{type:"positional",description:"Node IDs (space or comma separated)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(/[\s,]+/),u=await F("boolean-operation",{ids:t,operation:"INTERSECT"});C(u,r.json)}catch(t){w(t)}}});O();B();var M9=E({meta:{description:"Subtract nodes"},args:{ids:{type:"positional",description:"Node IDs (space or comma separated)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(/[\s,]+/),u=await F("boolean-operation",{ids:t,operation:"SUBTRACT"});C(u,r.json)}catch(t){w(t)}}});O();B();var Z9=E({meta:{description:"Union nodes"},args:{ids:{type:"positional",description:"Node IDs (space or comma separated)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(/[\s,]+/),u=await F("boolean-operation",{ids:t,operation:"UNION"});C(u,r.json)}catch(t){w(t)}}});var L9=E({meta:{description:"Boolean operations"},subCommands:{union:Z9,subtract:M9,intersect:H9,exclude:K9}});O();O();B();var P9=E({meta:{description:"Group nodes"},args:{ids:{type:"positional",description:"Node IDs (space or comma separated)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(/[\s,]+/),u=await F("group-nodes",{ids:t});C(u,r.json)}catch(t){w(t)}}});O();B();var k9=E({meta:{description:"Flatten nodes into single vector"},args:{ids:{type:"positional",description:"Node IDs (space or comma separated)",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(/[\s,]+/),u=await F("flatten-nodes",{ids:t});C(u,r.json)}catch(t){w(t)}}});O();B();var d9=E({meta:{description:"Ungroup nodes"},args:{id:{type:"positional",description:"Group node ID",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("ungroup-node",{id:r.id});C(t,r.json)}catch(t){w(t)}}});var x9=E({meta:{description:"Group operations"},subCommands:{create:P9,ungroup:d9,flatten:k9}});O();O();B();var p9=E({meta:{description:"Add property to component"},args:{id:{type:"positional",description:"Component ID",required:!0},name:{type:"string",description:"Property name",required:!0},type:{type:"string",description:"BOOLEAN | TEXT | INSTANCE_SWAP | VARIANT",required:!0},default:{type:"string",description:"Default value",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.type.toUpperCase();if(!["BOOLEAN","TEXT","INSTANCE_SWAP","VARIANT"].includes(t))throw new Error("Type must be BOOLEAN, TEXT, INSTANCE_SWAP, or VARIANT");let u=await F("add-component-property",{componentId:r.id,name:r.name,type:t,defaultValue:r.default});C(u,r.json,"update")}catch(t){w(t)}}});O();B();var a9=E({meta:{description:"Combine components into a component set (variants)"},args:{ids:{type:"positional",description:"Component IDs to combine",required:!0},name:{type:"string",description:"Name for the component set"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(",").map((D)=>D.trim()),u=await F("combine-as-variants",{ids:t,name:r.name});C(u,r.json)}catch(t){w(t)}}});O();B();var s9=E({meta:{description:"Delete component property"},args:{id:{type:"positional",description:"Component ID",required:!0},name:{type:"string",description:"Property name",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("delete-component-property",{componentId:r.id,propertyName:r.name});C(t,r.json,"update")}catch(t){w(t)}}});O();B();var rC=E({meta:{description:"Edit component property"},args:{id:{type:"positional",description:"Component ID",required:!0},name:{type:"string",description:"Property name",required:!0},"new-name":{type:"string",description:"New name"},default:{type:"string",description:"New default value"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("edit-component-property",{componentId:r.id,propertyName:r.name,newName:r["new-name"],newDefaultValue:r.default});C(t,r.json,"update")}catch(t){w(t)}}});O();B();var tC=E({meta:{description:"List all instances of a component"},args:{id:{type:"positional",description:"Component ID",required:!0},page:{type:"string",description:"Limit search to a specific page ID"},limit:{type:"string",description:"Max results",default:"100"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("eval",{code:`
|
|
397
|
+
const comp = await figma.getNodeByIdAsync(${JSON.stringify(r.id)})
|
|
398
|
+
if (!comp || (comp.type !== 'COMPONENT' && comp.type !== 'COMPONENT_SET')) {
|
|
399
|
+
throw new Error('Node is not a component: ' + ${JSON.stringify(r.id)})
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
const limit = ${Number(r.limit)}
|
|
403
|
+
const pageId = ${r.page?JSON.stringify(r.page):"null"}
|
|
404
|
+
const results = []
|
|
405
|
+
|
|
406
|
+
function walk(node) {
|
|
407
|
+
if (results.length >= limit) return
|
|
408
|
+
if (node.type === 'INSTANCE') {
|
|
409
|
+
const main = node.mainComponent
|
|
410
|
+
if (main && (main.id === comp.id || (main.parent && main.parent.type === 'COMPONENT_SET' && main.parent.id === comp.id))) {
|
|
411
|
+
results.push({ id: node.id, name: node.name, type: node.type })
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
if ('children' in node) {
|
|
415
|
+
for (const child of node.children) {
|
|
416
|
+
if (results.length >= limit) return
|
|
417
|
+
walk(child)
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (pageId) {
|
|
423
|
+
const page = await figma.getNodeByIdAsync(pageId)
|
|
424
|
+
if (page) walk(page)
|
|
425
|
+
} else {
|
|
426
|
+
for (const page of figma.root.children) {
|
|
427
|
+
if (results.length >= limit) break
|
|
428
|
+
walk(page)
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
return results
|
|
433
|
+
`});if(r.json)console.log(JSON.stringify(t,null,2));else C(t)}catch(t){w(t)}}});var iC=E({meta:{description:"Component property operations"},subCommands:{"add-prop":p9,combine:a9,"edit-prop":rC,"delete-prop":s9,"list-instances":tC}});O();O();B();mr();var uC=E({meta:{description:"Detach instance(s) from their component"},args:{ids:{type:"positional",description:"Instance IDs to detach",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(/[\s,]+/).filter(Boolean),u=await F("eval",{code:`
|
|
434
|
+
const ids = ${JSON.stringify(t)}
|
|
435
|
+
const result = []
|
|
436
|
+
for (const id of ids) {
|
|
437
|
+
const node = await figma.getNodeByIdAsync(id)
|
|
438
|
+
if (node && node.type === 'INSTANCE') {
|
|
439
|
+
const frame = node.detachInstance()
|
|
440
|
+
result.push({ id: frame.id, name: frame.name })
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return result
|
|
444
|
+
`});if(r.json)console.log(JSON.stringify(u,null,2));else for(let D of u)console.log(Dr(`Detached "${D.name}" (${D.id})`))}catch(t){w(t)}}});O();B();var DC=E({meta:{description:"Get the main component of an instance"},args:{id:{type:"positional",description:"Instance ID",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("eval",{code:`
|
|
445
|
+
const node = await figma.getNodeByIdAsync(${JSON.stringify(r.id)})
|
|
446
|
+
if (!node || node.type !== 'INSTANCE') {
|
|
447
|
+
throw new Error('Node is not an instance: ' + ${JSON.stringify(r.id)})
|
|
448
|
+
}
|
|
449
|
+
const main = await node.getMainComponentAsync()
|
|
450
|
+
if (!main) {
|
|
451
|
+
throw new Error('Main component not found')
|
|
452
|
+
}
|
|
453
|
+
const result = {
|
|
454
|
+
id: main.id,
|
|
455
|
+
name: main.name,
|
|
456
|
+
type: main.type,
|
|
457
|
+
remote: main.remote,
|
|
458
|
+
description: main.description
|
|
459
|
+
}
|
|
460
|
+
if (main.parent && main.parent.type === 'COMPONENT_SET') {
|
|
461
|
+
result.componentSetName = main.parent.name
|
|
462
|
+
}
|
|
463
|
+
return result
|
|
464
|
+
`});if(r.json)console.log(JSON.stringify(t,null,2));else C(t)}catch(t){w(t)}}});O();B();mr();var nC=E({meta:{description:"Reset all overridden properties of an instance"},args:{ids:{type:"positional",description:"Instance IDs to reset",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.ids.split(/[\s,]+/).filter(Boolean),u=await F("eval",{code:`
|
|
465
|
+
const ids = ${JSON.stringify(t)}
|
|
466
|
+
const result = []
|
|
467
|
+
for (const id of ids) {
|
|
468
|
+
const node = await figma.getNodeByIdAsync(id)
|
|
469
|
+
if (node && node.type === 'INSTANCE') {
|
|
470
|
+
node.resetAllComponentProperties()
|
|
471
|
+
result.push({ id: node.id, name: node.name })
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
return result
|
|
475
|
+
`});if(r.json)console.log(JSON.stringify(u,null,2));else for(let D of u)console.log(Dr(`Reset properties of "${D.name}" (${D.id})`))}catch(t){w(t)}}});O();B();mr();var oC=E({meta:{description:"Swap the component of an instance"},args:{id:{type:"positional",description:"Instance ID",required:!0},component:{type:"string",description:"Target component ID to swap to",required:!0},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("eval",{code:`
|
|
476
|
+
const node = await figma.getNodeByIdAsync(${JSON.stringify(r.id)})
|
|
477
|
+
if (!node || node.type !== 'INSTANCE') {
|
|
478
|
+
throw new Error('Node is not an instance: ' + ${JSON.stringify(r.id)})
|
|
479
|
+
}
|
|
480
|
+
const comp = await figma.getNodeByIdAsync(${JSON.stringify(r.component)})
|
|
481
|
+
if (!comp || comp.type !== 'COMPONENT') {
|
|
482
|
+
throw new Error('Target is not a component: ' + ${JSON.stringify(r.component)})
|
|
483
|
+
}
|
|
484
|
+
node.swapComponent(comp)
|
|
485
|
+
return { id: node.id, name: node.name, componentName: comp.name }
|
|
486
|
+
`});if(r.json)console.log(JSON.stringify(t,null,2));else console.log(Dr(`Swapped "${t.name}" to component "${t.componentName}" (${t.id})`))}catch(t){w(t)}}});var eC=E({meta:{description:"Instance operations"},subCommands:{detach:uC,swap:oC,"reset-props":nC,"get-main":DC}});O();O();B();Dt();function fC(r){let t=["top","right","bottom","left","center","auto"],u=r.toLowerCase();for(let D of t)if(u.endsWith(":"+D))return{id:r.slice(0,-D.length-1),magnet:D.toUpperCase()};return{id:r}}var $C=E({meta:{description:"Create a connector between two nodes"},args:{from:{type:"string",required:!0,description:"Start node ID (optionally :magnet)"},to:{type:"string",required:!0,description:"End node ID (optionally :magnet)"},type:{type:"string",description:"Line type: straight, elbowed, curved",default:"elbowed"},"start-cap":{type:"string",description:"Start cap: none, arrow, triangle, diamond, circle"},"end-cap":{type:"string",description:"End cap: none, arrow, triangle, diamond, circle",default:"arrow"},stroke:{type:"string",description:"Stroke color (hex)"},weight:{type:"string",description:"Stroke weight"},radius:{type:"string",description:"Corner radius for elbowed connectors"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=fC(r.from),u=fC(r.to),D=await F("create-connector",{fromId:t.id,fromMagnet:t.magnet,toId:u.id,toMagnet:u.magnet,lineType:r.type?.toUpperCase(),startCap:r["start-cap"]?.toUpperCase().replace("-","_"),endCap:r["end-cap"]?.toUpperCase().replace("-","_"),stroke:r.stroke,strokeWeight:r.weight?Number(r.weight):void 0,cornerRadius:r.radius?Number(r.radius):void 0});C(D,r.json)}catch(t){w(t)}}});O();B();var lC=E({meta:{description:"Get connector details"},args:{id:{type:"positional",required:!0,description:"Connector ID"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("get-connector",{id:r.id});if(r.json){console.log(JSON.stringify(t,null,2));return}if(console.log(`[connector] "${t.name}" (${t.id})`),console.log(` from: ${t.fromNode.name} (${t.fromNode.id}) @ ${t.fromNode.magnet}`),console.log(` to: ${t.toNode.name} (${t.toNode.id}) @ ${t.toNode.magnet}`),console.log(` type: ${t.lineType.toLowerCase()}`),console.log(` caps: ${t.startCap.toLowerCase()} → ${t.endCap.toLowerCase()}`),t.stroke)console.log(` stroke: ${t.stroke} ${t.strokeWeight}px`);if(t.cornerRadius)console.log(` radius: ${t.cornerRadius}`)}catch(t){w(t)}}});O();B();var mC=E({meta:{description:"List connectors on current page"},args:{from:{type:"string",description:"Filter by start node ID"},to:{type:"string",description:"Filter by end node ID"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("list-connectors",{fromId:r.from,toId:r.to});if(r.json){console.log(JSON.stringify(t,null,2));return}if(t.length===0){console.log("(no connectors)");return}t.forEach((u,D)=>{let i=`${u.fromNode.name} (${u.fromNode.id})`,n=`${u.toNode.name} (${u.toNode.id})`;if(console.log(`[${D}] "${u.name}" (${u.id})`),console.log(` ${i} → ${n}`),u.stroke)console.log(` stroke: ${u.stroke}`)}),console.log(`
|
|
487
|
+
${t.length} connector(s)`)}catch(t){w(t)}}});O();B();Dt();function cC(r){let t=["top","right","bottom","left","center","auto"],u=r.toLowerCase();for(let D of t)if(u.endsWith(":"+D))return{id:r.slice(0,-D.length-1),magnet:D.toUpperCase()};return{id:r}}var vC=E({meta:{description:"Update connector properties"},args:{id:{type:"positional",required:!0,description:"Connector ID"},from:{type:"string",description:"New start node ID (optionally :magnet)"},to:{type:"string",description:"New end node ID (optionally :magnet)"},type:{type:"string",description:"Line type: straight, elbowed, curved"},"start-cap":{type:"string",description:"Start cap: none, arrow, triangle, diamond, circle"},"end-cap":{type:"string",description:"End cap: none, arrow, triangle, diamond, circle"},stroke:{type:"string",description:"Stroke color (hex)"},weight:{type:"string",description:"Stroke weight"},radius:{type:"string",description:"Corner radius"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.from?cC(r.from):void 0,u=r.to?cC(r.to):void 0,D=await F("set-connector",{id:r.id,fromId:t?.id,fromMagnet:t?.magnet,toId:u?.id,toMagnet:u?.magnet,lineType:r.type?.toUpperCase(),startCap:r["start-cap"]?.toUpperCase().replace("-","_"),endCap:r["end-cap"]?.toUpperCase().replace("-","_"),stroke:r.stroke,strokeWeight:r.weight?Number(r.weight):void 0,cornerRadius:r.radius?Number(r.radius):void 0});C(D,r.json)}catch(t){w(t)}}});var EC=E({meta:{description:"Connector operations"},subCommands:{create:$C,get:lC,set:vC,list:mC}});O();O();B();mr();var Nh="https://api.iconify.design";async function uv(r,t){let u=`${Nh}${r}`,D;try{D=await fetch(u)}catch(i){let n=i instanceof Error?i.message:String(i);if(n.includes("ENOTFOUND")||n.includes("getaddrinfo"))throw new Error("Cannot reach Iconify API (DNS resolution failed). Check your internet connection.");if(n.includes("ECONNREFUSED"))throw new Error("Iconify API connection refused. The service may be temporarily unavailable.");if(n.includes("ETIMEDOUT")||n.includes("timeout"))throw new Error("Iconify API request timed out. Check your network connection or try again.");if(n.includes("CERT")||n.includes("SSL")||n.includes("certificate"))throw new Error(`Iconify API TLS/SSL error: ${n}`);throw new Error(`Failed to connect to Iconify API: ${n}`)}if(!D.ok){if(D.status===404)throw new Error(`${t}: not found (404)`);if(D.status===429)throw new Error("Iconify API rate limit exceeded. Wait a moment and try again.");if(D.status>=500)throw new Error(`Iconify API server error (${D.status}). The service may be temporarily unavailable.`);throw new Error(`Iconify API error: HTTP ${D.status} for ${t}`)}return D.json()}async function FC(r,t={}){let u=new URLSearchParams({query:r,limit:String(t.limit??32)});if(t.prefix)u.set("prefix",t.prefix);return uv(`/search?${u}`,`search "${r}"`)}async function gC(){return uv("/collections","list icon sets")}async function wC(r){return uv(`/collection?prefix=${r}&chars=false&aliases=false`,`icon set "${r}"`)}async function bC(r,t,u){let D=new Array(r.length),i=0;async function n(){while(i<r.length){let e=i++;D[e]=await t(r[e],e)}}let o=Array.from({length:Math.min(u,r.length)},()=>n());return await Promise.all(o),D}var CC=E({meta:{description:"Search icons from Iconify (600K+ icons from Lucide, Material Design, etc.)"},args:{query:{type:"positional",description:'Search query (e.g., "arrow", "home", "settings")',required:!0},prefix:{type:"string",description:"Filter by icon set (e.g., lucide, mdi, tabler)"},limit:{type:"string",description:"Max results",default:"32"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await FC(r.query,{prefix:r.prefix,limit:Number(r.limit)});if(r.json){console.log(JSON.stringify(t,null,2));return}if(t.icons.length===0){console.log(`No icons found for "${r.query}"`);return}console.log(Yr(`Found ${t.total} icons`)+er(` (showing ${t.icons.length})`)),console.log();let u=new Map;for(let D of t.icons){let[i,...n]=D.split(":"),o=n.join(":");if(!u.has(i))u.set(i,[]);u.get(i).push(o)}for(let[D,i]of u){let n=t.collections[D],o=n?`${n.name} (${D})`:D;console.log(Yr(o));for(let e of i)console.log(` ${D}:${e}`);console.log()}console.log(er("Use: figma-use create icon <name> to add to Figma")),console.log(er("Use: figma-use icon import <names...> for batch import"))}catch(t){w(t)}}});O();B();mr();var _C=E({meta:{description:"List available icon sets or icons in a set"},args:{prefix:{type:"positional",description:"Icon set prefix to show icons (e.g., lucide, mdi)",required:!1},category:{type:"string",description:"Filter by category when listing icons in a set"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{if(r.prefix){let i=await wC(r.prefix);if(r.json){console.log(JSON.stringify(i,null,2));return}if(console.log(Yr(`${i.title}`)+er(` (${r.prefix}) — ${i.total} icons`)),console.log(),i.categories)for(let[n,o]of Object.entries(i.categories)){if(r.category&&n.toLowerCase()!==r.category.toLowerCase())continue;console.log(Yr(n)+er(` (${o.length})`)),console.log(` ${o.map((e)=>`${r.prefix}:${e}`).join(" ")}`),console.log()}if(i.uncategorized&&i.uncategorized.length>0&&!r.category)console.log(Yr("Uncategorized")+er(` (${i.uncategorized.length})`)),console.log(` ${i.uncategorized.map((n)=>`${r.prefix}:${n}`).join(" ")}`),console.log();console.log(er(`Use: figma-use icon import ${r.prefix}:<name> to add to Figma`));return}let t=await gC();if(r.json){console.log(JSON.stringify(t,null,2));return}let u=["lucide","mdi","tabler","heroicons","ph","ri","carbon","bi","ion"],D=Object.entries(t).sort((i,n)=>{let o=u.indexOf(i[0]),e=u.indexOf(n[0]);if(o!==-1&&e!==-1)return o-e;if(o!==-1)return-1;if(e!==-1)return 1;return n[1].total-i[1].total});console.log(Yr(`${D.length} icon sets available`)),console.log();for(let[i,n]of D){let o=n.author?.name?er(` by ${n.author.name}`):"",e=n.samples?er(` — ${n.samples.join(", ")}`):"";console.log(` ${Yr(i.padEnd(24))} ${String(n.total).padStart(6)} icons ${n.name}${o}${e}`)}console.log(),console.log(er("Use: figma-use icon sets <prefix> to browse icons in a set")),console.log(er("Use: figma-use icon search <query> to search across all sets"))}catch(t){w(t)}}});O();B();mr();var Bh=/^(?:var:|[$])(.+)$/;async function qh(r,t){return await new HTMLRewriter().on("*",{element(D){if(D.getAttribute("fill")==="currentColor")D.setAttribute("fill",t);if(D.getAttribute("stroke")==="currentColor")D.setAttribute("stroke",t)}}).transform(new Response(r)).text()}var hh=5;var IC=E({meta:{description:"Import multiple icons from Iconify into Figma"},args:{names:{type:"positional",description:"Icon names separated by commas (e.g., lucide:arrow-right,lucide:home,mdi:star)",required:!0},size:{type:"string",description:"Size in pixels",default:"24"},color:{type:"string",description:"Icon color (hex or var:Name)"},parent:{type:"string",description:"Parent node ID"},component:{type:"boolean",description:"Create as Figma components"},grid:{type:"boolean",description:"Arrange icons in a grid layout"},gap:{type:"string",description:"Gap between icons in grid mode",default:"16"},cols:{type:"string",description:"Columns in grid mode",default:"8"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=r.names.split(",").map((m)=>m.trim()).filter(Boolean);if(t.length===0)console.error(d("No icon names provided")),process.exit(1);let u=Number(r.size),D=Number(r.gap),i=Number(r.cols),n=r.color?.match(Bh),o=n?"#000000":r.color||"#000000";console.log(Yr(`Importing ${t.length} icons...`)),console.log(er(" Fetching icon data..."));let e=await bC(t,async(m)=>{try{return await Lt(m,u)}catch{return null}},hh),f=r.parent;if(r.grid)f=(await F("create-frame",{x:0,y:0,width:i*(u+D)-D,height:Math.ceil(t.length/i)*(u+D)-D,name:"Icons",parentId:r.parent})).id,await F("set-auto-layout",{id:f,direction:"HORIZONTAL",gap:D,wrap:!0,padding:0});let $=[],l=[];for(let m=0;m<t.length;m++){let c=t[m],g=e[m];if(!g){l.push(c),console.log(er(` [${m+1}/${t.length}] ${c} — not found`));continue}try{let _=await qh(g.svg,o),q=0,y=0;if(!r.grid&&!f){let A=m%i,K=Math.floor(m/i);q=A*(u+D),y=K*(u+D)}let N=await F("import-svg",{svg:_,x:q,y,parentId:f}),R=c.replace(":","/");if(await F("rename-node",{id:N.id,name:R}),n)await F("bind-fill-variable-by-name",{id:N.id,variableName:n[1],recursive:!0});let z=N.id;if(r.component)z=(await F("convert-to-component",{id:N.id})).id;$.push({name:c,id:z}),console.log(Dr(` [${m+1}/${t.length}] ${c}`)+er(` → ${z}`))}catch(_){l.push(c),console.log(er(` [${m+1}/${t.length}] ${c} — ${_ instanceof Error?_.message:"failed"}`))}}if(console.log(),console.log(Yr(`Imported: ${$.length}/${t.length}`)),l.length>0)console.log(d(`Failed: ${l.join(", ")}`));if(r.json)console.log(JSON.stringify({imported:$,errors:l,parentId:r.grid?f:void 0},null,2))}catch(t){w(t)}}});var UC=E({meta:{description:"Search, browse, and import icons from 150+ icon sets (Lucide, Material Design, etc.)"},subCommands:{search:CC,sets:_C,import:IC}});O();O();B();Dt();var OC=E({meta:{description:"Add a comment to the file"},args:{message:{type:"positional",description:"Comment message",required:!0},file:{type:"string",description:"File key (default: current file)"},node:{type:"string",description:"Attach comment to node ID"},x:{type:"string",description:"X position (default: 100)"},y:{type:"string",description:"Y position (default: 100)"},reply:{type:"string",description:"Reply to comment ID"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await dF(r.message,{fileKey:r.file,nodeId:r.node,x:r.x?Number(r.x):void 0,y:r.y?Number(r.y):void 0,replyTo:r.reply});C(t,r.json)}catch(t){w(t)}}});O();B();mr();var yC=E({meta:{description:"Delete a comment"},args:{id:{type:"positional",description:"Comment ID to delete",required:!0},file:{type:"string",description:"File key (default: current file)"}},async run({args:r}){try{await xF(r.id,r.file),console.log(Nn("Comment deleted"))}catch(t){w(t)}}});O();B();mr();function zh(r){let t=r.resolved_at?Nn(" ✓"):"",u=r.client_meta?.node_id?er(` on ${r.client_meta.node_id}`):"",D=r.parent_id?er(" (reply)"):"",i=new Date(r.created_at).toLocaleDateString();return`${Zt(r.user.handle)}${D}${t}${u} ${er(i)}
|
|
488
|
+
${r.message}
|
|
489
|
+
${er(`id: ${r.id}`)}`}var NC=E({meta:{description:"List comments on the current file"},args:{file:{type:"string",description:"File key (default: current file)"},node:{type:"string",description:"Filter by node ID"},unresolved:{type:"boolean",description:"Only show unresolved comments"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await YD(r.file);if(r.node)t=t.filter((u)=>u.client_meta?.node_id===r.node);if(r.unresolved)t=t.filter((u)=>!u.resolved_at);if(r.json){console.log(JSON.stringify(t,null,2));return}if(t.length===0){console.log("No comments found");return}console.log(t.map(zh).join(`
|
|
490
|
+
|
|
491
|
+
`))}catch(t){w(t)}}});O();B();mr();var BC=E({meta:{description:"Resolve a comment"},args:{id:{type:"positional",description:"Comment ID",required:!0},file:{type:"string",description:"File key (default: current file)"}},async run({args:r}){try{await pF(r.id,r.file),console.log(Dr(`Resolved comment ${r.id}`))}catch(t){w(t)}}});O();B();mr();async function Jh(r){let t=r.client_meta;if(!t?.node_id)return null;if(t.x!==void 0&&t.y!==void 0)try{let u=await F("find-node-at-point",{parentId:t.node_id,x:t.x,y:t.y});if(u)return u}catch{}try{let u=await F("get-node-info",{id:t.node_id});if(u)return{id:u.id,name:u.name,type:u.type}}catch{}return null}function Ah(r,t){let u=t?er(` on ${t.name} [${t.id}]`):r.client_meta?.node_id?er(` on ${r.client_meta.node_id}`):"",D=r.parent_id?er(" (reply)"):"",i=new Date(r.created_at).toLocaleDateString();return`${Zt(r.user.handle)}${D}${u} ${er(i)}
|
|
492
|
+
${r.message}
|
|
493
|
+
${er(`id: ${r.id}`)}`}var qC=E({meta:{description:"Wait for a new comment and return its content"},args:{file:{type:"string",description:"File key (default: current file)"},interval:{type:"string",description:"Poll interval in seconds",default:"3"},timeout:{type:"string",description:"Timeout in seconds (0 = no timeout)",default:"0"},"include-resolved":{type:"boolean",description:"Include resolved comments"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=Math.max(1,parseInt(r.interval,10))*1000,u=parseInt(r.timeout,10)*1000,D=Date.now(),i=await YD(r.file),n=new Set(i.map((o)=>o.id));if(!r.json)process.stderr.write(`Watching for comments (poll: ${t/1000}s)...
|
|
494
|
+
`);while(!0){if(u>0&&Date.now()-D>u){if(r.json)console.log(JSON.stringify({timeout:!0}));else console.log("Timeout reached");return}await new Promise((f)=>setTimeout(f,t));let e=(await YD(r.file)).filter((f)=>{if(n.has(f.id))return!1;if(!r["include-resolved"]&&f.resolved_at)return!1;return!0});if(e.length>0){let f=e[0],$=await Jh(f);if(r.json){let l={...f,target_node:$};console.log(JSON.stringify(l,null,2))}else console.log(Ah(f,$));return}}}catch(t){w(t)}}});var hC=E({meta:{description:"Manage file comments "},subCommands:{list:NC,add:OC,delete:yC,resolve:BC,watch:qC}});O();O();B();mr();var zC=E({meta:{description:"List file version history"},args:{file:{type:"string",description:"File key (default: current file)"},limit:{type:"string",description:"Max versions to show",default:"20"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await aF(r.file,Number(r.limit));if(r.json){console.log(JSON.stringify(t,null,2));return}if(t.length===0){console.log("No versions found");return}for(let u of t){let D=new Date(u.created_at).toLocaleString(),i=u.label?Zt(u.label):er("(auto-save)");if(console.log(`${i} ${er(D)} by ${u.user.handle}`),u.description)console.log(` ${u.description}`);console.log(` ${er(`id: ${u.id}`)}
|
|
495
|
+
`)}}catch(t){w(t)}}});var JC=E({meta:{description:"View file version history"},subCommands:{list:zC}});O();O();B();mr();var AC=E({meta:{description:"List available fonts"},args:{family:{type:"string",description:"Filter by family name"},json:{type:"boolean",description:"Output as JSON"}},async run({args:r}){try{let t=await F("list-fonts"),u=t;if(r.family){let i=r.family.toLowerCase();u=t.filter((n)=>n.family.toLowerCase().includes(i))}if(r.json){console.log(JSON.stringify(u,null,2));return}let D=new Map;for(let i of u){let n=D.get(i.family)||[];n.push(i.style),D.set(i.family,n)}for(let[i,n]of D)console.log(`${i} ${er(`(${n.join(", ")})`)}`);console.log(`
|
|
496
|
+
${D.size} families, ${u.length} fonts`)}catch(t){w(t)}}});var XC=E({meta:{description:"Font operations"},subCommands:{list:AC}});O();var ZC=E({meta:{description:"Analyze design patterns"},subCommands:{clusters:()=>Promise.resolve().then(() => (GC(),jC)).then((r)=>r.default),colors:()=>Promise.resolve().then(() => (RC(),TC)).then((r)=>r.default),typography:()=>Promise.resolve().then(() => (SC(),VC)).then((r)=>r.default),spacing:()=>Promise.resolve().then(() => (KC(),QC)).then((r)=>r.default),snapshot:()=>Promise.resolve().then(() => (MC(),HC)).then((r)=>r.default)}});var Sh=E({meta:{name:"figma-use",description:"Control Figma from the command line. Supports JSX rendering with components and variants — see `figma-use render --examples`",version:y4},subCommands:Dv});process.on("beforeExit",()=>li());O4(Sh);
|