@builder.io/dev-tools 1.19.6 → 1.19.7

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/server/index.mjs CHANGED
@@ -1,49 +1,49 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- var YP=Object.create;var Ys=Object.defineProperty;var QP=Object.getOwnPropertyDescriptor;var XP=Object.getOwnPropertyNames;var e_=Object.getPrototypeOf,t_=Object.prototype.hasOwnProperty;var r_=(e,t,r)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var G=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Lm=(e,t)=>{for(var r in t)Ys(e,r,{get:t[r],enumerable:!0})},n_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of XP(t))!t_.call(e,o)&&o!==r&&Ys(e,o,{get:()=>t[o],enumerable:!(n=QP(t,o))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?YP(e_(e)):{},n_(t||!e||!e.__esModule?Ys(r,"default",{value:e,enumerable:!0}):r,e));var Je=(e,t,r)=>r_(e,typeof t!="symbol"?t+"":t,r);var Vm=x((K8,Um)=>{"use strict";Um.exports=function(){if(process.env.npm_config_user_agent)return i_(process.env.npm_config_user_agent)};function i_(e){let t=e.split(" ")[0],r=t.lastIndexOf("/"),n=t.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:t.substring(r+1)}}});var oa=x((G9,hg)=>{"use strict";var dc={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let r="";return e<0?r+=`\x1B[${-e}D`:e>0&&(r+=`\x1B[${e}C`),t<0?r+=`\x1B[${-t}A`:t>0&&(r+=`\x1B[${t}B`),r},up:(e=1)=>`\x1B[${e}A`,down:(e=1)=>`\x1B[${e}B`,forward:(e=1)=>`\x1B[${e}C`,backward:(e=1)=>`\x1B[${e}D`,nextLine:(e=1)=>"\x1B[E".repeat(e),prevLine:(e=1)=>"\x1B[F".repeat(e),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},P_={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},__={screen:"\x1B[2J",up:(e=1)=>"\x1B[1J".repeat(e),down:(e=1)=>"\x1B[J".repeat(e),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?dc.up():"");return e&&(t+=dc.left),t}};hg.exports={cursor:dc,scroll:P_,erase:__,beep:"\x07"}});var Vn=x((W9,fc)=>{var sa=process||{},yg=sa.argv||[],ia=sa.env||{},A_=!(ia.NO_COLOR||yg.includes("--no-color"))&&(!!ia.FORCE_COLOR||yg.includes("--color")||sa.platform==="win32"||(sa.stdout||{}).isTTY&&ia.TERM!=="dumb"||!!ia.CI),F_=(e,t,r=e)=>n=>{let o=""+n,s=o.indexOf(t,e.length);return~s?e+T_(o,t,r,s)+t:e+o+t},T_=(e,t,r,n)=>{let o="",s=0;do o+=e.substring(s,n)+r,s=n+t.length,n=e.indexOf(t,s);while(~n);return o+e.substring(s)},Dg=(e=A_)=>{let t=e?F_:()=>String;return{isColorSupported:e,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")}};fc.exports=Dg();fc.exports.createColors=Dg});var Qh=x((H7,va)=>{va.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/;va.exports.ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;va.exports.ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/});var zc=x((q7,Xh)=>{var Lc=Qh();Xh.exports={isSpaceSeparator(e){return typeof e=="string"&&Lc.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||Lc.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="\u200C"||e==="\u200D"||Lc.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}}});var oy=x((K7,ny)=>{var Qe=zc(),Uc,wt,rn,ba,wn,vr,Xe,qc,Ri;ny.exports=function(t,r){Uc=String(t),wt="start",rn=[],ba=0,wn=1,vr=0,Xe=void 0,qc=void 0,Ri=void 0;do Xe=FT(),kT[wt]();while(Xe.type!=="eof");return typeof r=="function"?Vc({"":Ri},"",r):Ri};function Vc(e,t,r){let n=e[t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let o=0;o<n.length;o++){let s=String(o),i=Vc(n,s,r);i===void 0?delete n[s]:Object.defineProperty(n,s,{value:i,writable:!0,enumerable:!0,configurable:!0})}else for(let o in n){let s=Vc(n,o,r);s===void 0?delete n[o]:Object.defineProperty(n,o,{value:s,writable:!0,enumerable:!0,configurable:!0})}return r.call(e,t,n)}var J,K,ki,tn,ne;function FT(){for(J="default",K="",ki=!1,tn=1;;){ne=nn();let e=ty[J]();if(e)return e}}function nn(){if(Uc[ba])return String.fromCodePoint(Uc.codePointAt(ba))}function F(){let e=nn();return e===`
3
- `?(wn++,vr=0):e?vr+=e.length:vr++,e&&(ba+=e.length),e}var ty={default(){switch(ne){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
4
- `:case"\r":case"\u2028":case"\u2029":F();return;case"/":F(),J="comment";return;case void 0:return F(),_e("eof")}if(Qe.isSpaceSeparator(ne)){F();return}return ty[wt]()},comment(){switch(ne){case"*":F(),J="multiLineComment";return;case"/":F(),J="singleLineComment";return}throw Ae(F())},multiLineComment(){switch(ne){case"*":F(),J="multiLineCommentAsterisk";return;case void 0:throw Ae(F())}F()},multiLineCommentAsterisk(){switch(ne){case"*":F();return;case"/":F(),J="default";return;case void 0:throw Ae(F())}F(),J="multiLineComment"},singleLineComment(){switch(ne){case`
5
- `:case"\r":case"\u2028":case"\u2029":F(),J="default";return;case void 0:return F(),_e("eof")}F()},value(){switch(ne){case"{":case"[":return _e("punctuator",F());case"n":return F(),Wn("ull"),_e("null",null);case"t":return F(),Wn("rue"),_e("boolean",!0);case"f":return F(),Wn("alse"),_e("boolean",!1);case"-":case"+":F()==="-"&&(tn=-1),J="sign";return;case".":K=F(),J="decimalPointLeading";return;case"0":K=F(),J="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":K=F(),J="decimalInteger";return;case"I":return F(),Wn("nfinity"),_e("numeric",1/0);case"N":return F(),Wn("aN"),_e("numeric",NaN);case'"':case"'":ki=F()==='"',K="",J="string";return}throw Ae(F())},identifierNameStartEscape(){if(ne!=="u")throw Ae(F());F();let e=Hc();switch(e){case"$":case"_":break;default:if(!Qe.isIdStartChar(e))throw ey();break}K+=e,J="identifierName"},identifierName(){switch(ne){case"$":case"_":case"\u200C":case"\u200D":K+=F();return;case"\\":F(),J="identifierNameEscape";return}if(Qe.isIdContinueChar(ne)){K+=F();return}return _e("identifier",K)},identifierNameEscape(){if(ne!=="u")throw Ae(F());F();let e=Hc();switch(e){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!Qe.isIdContinueChar(e))throw ey();break}K+=e,J="identifierName"},sign(){switch(ne){case".":K=F(),J="decimalPointLeading";return;case"0":K=F(),J="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":K=F(),J="decimalInteger";return;case"I":return F(),Wn("nfinity"),_e("numeric",tn*(1/0));case"N":return F(),Wn("aN"),_e("numeric",NaN)}throw Ae(F())},zero(){switch(ne){case".":K+=F(),J="decimalPoint";return;case"e":case"E":K+=F(),J="decimalExponent";return;case"x":case"X":K+=F(),J="hexadecimal";return}return _e("numeric",tn*0)},decimalInteger(){switch(ne){case".":K+=F(),J="decimalPoint";return;case"e":case"E":K+=F(),J="decimalExponent";return}if(Qe.isDigit(ne)){K+=F();return}return _e("numeric",tn*Number(K))},decimalPointLeading(){if(Qe.isDigit(ne)){K+=F(),J="decimalFraction";return}throw Ae(F())},decimalPoint(){switch(ne){case"e":case"E":K+=F(),J="decimalExponent";return}if(Qe.isDigit(ne)){K+=F(),J="decimalFraction";return}return _e("numeric",tn*Number(K))},decimalFraction(){switch(ne){case"e":case"E":K+=F(),J="decimalExponent";return}if(Qe.isDigit(ne)){K+=F();return}return _e("numeric",tn*Number(K))},decimalExponent(){switch(ne){case"+":case"-":K+=F(),J="decimalExponentSign";return}if(Qe.isDigit(ne)){K+=F(),J="decimalExponentInteger";return}throw Ae(F())},decimalExponentSign(){if(Qe.isDigit(ne)){K+=F(),J="decimalExponentInteger";return}throw Ae(F())},decimalExponentInteger(){if(Qe.isDigit(ne)){K+=F();return}return _e("numeric",tn*Number(K))},hexadecimal(){if(Qe.isHexDigit(ne)){K+=F(),J="hexadecimalInteger";return}throw Ae(F())},hexadecimalInteger(){if(Qe.isHexDigit(ne)){K+=F();return}return _e("numeric",tn*Number(K))},string(){switch(ne){case"\\":F(),K+=TT();return;case'"':if(ki)return F(),_e("string",K);K+=F();return;case"'":if(!ki)return F(),_e("string",K);K+=F();return;case`
6
- `:case"\r":throw Ae(F());case"\u2028":case"\u2029":RT(ne);break;case void 0:throw Ae(F())}K+=F()},start(){switch(ne){case"{":case"[":return _e("punctuator",F())}J="value"},beforePropertyName(){switch(ne){case"$":case"_":K=F(),J="identifierName";return;case"\\":F(),J="identifierNameStartEscape";return;case"}":return _e("punctuator",F());case'"':case"'":ki=F()==='"',J="string";return}if(Qe.isIdStartChar(ne)){K+=F(),J="identifierName";return}throw Ae(F())},afterPropertyName(){if(ne===":")return _e("punctuator",F());throw Ae(F())},beforePropertyValue(){J="value"},afterPropertyValue(){switch(ne){case",":case"}":return _e("punctuator",F())}throw Ae(F())},beforeArrayValue(){if(ne==="]")return _e("punctuator",F());J="value"},afterArrayValue(){switch(ne){case",":case"]":return _e("punctuator",F())}throw Ae(F())},end(){throw Ae(F())}};function _e(e,t){return{type:e,value:t,line:wn,column:vr}}function Wn(e){for(let t of e){if(nn()!==t)throw Ae(F());F()}}function TT(){switch(nn()){case"b":return F(),"\b";case"f":return F(),"\f";case"n":return F(),`
7
- `;case"r":return F(),"\r";case"t":return F()," ";case"v":return F(),"\v";case"0":if(F(),Qe.isDigit(nn()))throw Ae(F());return"\0";case"x":return F(),$T();case"u":return F(),Hc();case`
8
- `:case"\u2028":case"\u2029":return F(),"";case"\r":return F(),nn()===`
9
- `&&F(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Ae(F());case void 0:throw Ae(F())}return F()}function $T(){let e="",t=nn();if(!Qe.isHexDigit(t)||(e+=F(),t=nn(),!Qe.isHexDigit(t)))throw Ae(F());return e+=F(),String.fromCodePoint(parseInt(e,16))}function Hc(){let e="",t=4;for(;t-- >0;){let r=nn();if(!Qe.isHexDigit(r))throw Ae(F());e+=F()}return String.fromCodePoint(parseInt(e,16))}var kT={start(){if(Xe.type==="eof")throw Zn();jc()},beforePropertyName(){switch(Xe.type){case"identifier":case"string":qc=Xe.value,wt="afterPropertyName";return;case"punctuator":Ca();return;case"eof":throw Zn()}},afterPropertyName(){if(Xe.type==="eof")throw Zn();wt="beforePropertyValue"},beforePropertyValue(){if(Xe.type==="eof")throw Zn();jc()},beforeArrayValue(){if(Xe.type==="eof")throw Zn();if(Xe.type==="punctuator"&&Xe.value==="]"){Ca();return}jc()},afterPropertyValue(){if(Xe.type==="eof")throw Zn();switch(Xe.value){case",":wt="beforePropertyName";return;case"}":Ca()}},afterArrayValue(){if(Xe.type==="eof")throw Zn();switch(Xe.value){case",":wt="beforeArrayValue";return;case"]":Ca()}},end(){}};function jc(){let e;switch(Xe.type){case"punctuator":switch(Xe.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=Xe.value;break}if(Ri===void 0)Ri=e;else{let t=rn[rn.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,qc,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")rn.push(e),Array.isArray(e)?wt="beforeArrayValue":wt="beforePropertyName";else{let t=rn[rn.length-1];t==null?wt="end":Array.isArray(t)?wt="afterArrayValue":wt="afterPropertyValue"}}function Ca(){rn.pop();let e=rn[rn.length-1];e==null?wt="end":Array.isArray(e)?wt="afterArrayValue":wt="afterPropertyValue"}function Ae(e){return wa(e===void 0?`JSON5: invalid end of input at ${wn}:${vr}`:`JSON5: invalid character '${ry(e)}' at ${wn}:${vr}`)}function Zn(){return wa(`JSON5: invalid end of input at ${wn}:${vr}`)}function ey(){return vr-=5,wa(`JSON5: invalid identifier character at ${wn}:${vr}`)}function RT(e){console.warn(`JSON5: '${ry(e)}' in strings is not valid ECMAScript; consider escaping`)}function ry(e){let t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){let r=e.charCodeAt(0).toString(16);return"\\x"+("00"+r).substring(r.length)}return e}function wa(e){let t=new SyntaxError(e);return t.lineNumber=wn,t.columnNumber=vr,t}});var sy=x((G7,iy)=>{var Kc=zc();iy.exports=function(t,r,n){let o=[],s="",i,a,u="",c;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(n=r.space,c=r.quote,r=r.replacer),typeof r=="function")a=r;else if(Array.isArray(r)){i=[];for(let f of r){let h;typeof f=="string"?h=f:(typeof f=="number"||f instanceof String||f instanceof Number)&&(h=String(f)),h!==void 0&&i.indexOf(h)<0&&i.push(h)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>0&&(n=Math.min(10,Math.floor(n)),u=" ".substr(0,n)):typeof n=="string"&&(u=n.substr(0,10)),l("",{"":t});function l(f,h){let y=h[f];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(f):typeof y.toJSON=="function"&&(y=y.toJSON(f))),a&&(y=a.call(h,f,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return p(y,!1);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?m(y):d(y)}function p(f){let h={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},b="";for(let _=0;_<f.length;_++){let S=f[_];switch(S){case"'":case'"':h[S]++,b+=S;continue;case"\0":if(Kc.isDigit(f[_+1])){b+="\\x00";continue}}if(y[S]){b+=y[S];continue}if(S<" "){let T=S.charCodeAt(0).toString(16);b+="\\x"+("00"+T).substring(T.length);continue}b+=S}let C=c||Object.keys(h).reduce((_,S)=>h[_]<h[S]?_:S);return b=b.replace(new RegExp(C,"g"),y[C]),C+b+C}function d(f){if(o.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");o.push(f);let h=s;s=s+u;let y=i||Object.keys(f),b=[];for(let _ of y){let S=l(_,f);if(S!==void 0){let T=g(_)+":";u!==""&&(T+=" "),T+=S,b.push(T)}}let C;if(b.length===0)C="{}";else{let _;if(u==="")_=b.join(","),C="{"+_+"}";else{let S=`,
2
+ var QP=Object.create;var Ys=Object.defineProperty;var XP=Object.getOwnPropertyDescriptor;var e_=Object.getOwnPropertyNames;var t_=Object.getPrototypeOf,r_=Object.prototype.hasOwnProperty;var n_=(e,t,r)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var G=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),zm=(e,t)=>{for(var r in t)Ys(e,r,{get:t[r],enumerable:!0})},o_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of e_(t))!r_.call(e,o)&&o!==r&&Ys(e,o,{get:()=>t[o],enumerable:!(n=XP(t,o))||n.enumerable});return e};var Ve=(e,t,r)=>(r=e!=null?QP(t_(e)):{},o_(t||!e||!e.__esModule?Ys(r,"default",{value:e,enumerable:!0}):r,e));var Ye=(e,t,r)=>n_(e,typeof t!="symbol"?t+"":t,r);var Hm=x((p9,Vm)=>{"use strict";Vm.exports=function(){if(process.env.npm_config_user_agent)return s_(process.env.npm_config_user_agent)};function s_(e){let t=e.split(" ")[0],r=t.lastIndexOf("/"),n=t.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:t.substring(r+1)}}});var oa=x((d4,yg)=>{"use strict";var fc={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let r="";return e<0?r+=`\x1B[${-e}D`:e>0&&(r+=`\x1B[${e}C`),t<0?r+=`\x1B[${-t}A`:t>0&&(r+=`\x1B[${t}B`),r},up:(e=1)=>`\x1B[${e}A`,down:(e=1)=>`\x1B[${e}B`,forward:(e=1)=>`\x1B[${e}C`,backward:(e=1)=>`\x1B[${e}D`,nextLine:(e=1)=>"\x1B[E".repeat(e),prevLine:(e=1)=>"\x1B[F".repeat(e),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},__={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},A_={screen:"\x1B[2J",up:(e=1)=>"\x1B[1J".repeat(e),down:(e=1)=>"\x1B[J".repeat(e),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?fc.up():"");return e&&(t+=fc.left),t}};yg.exports={cursor:fc,scroll:__,erase:A_,beep:"\x07"}});var Vn=x((f4,mc)=>{var sa=process||{},Dg=sa.argv||[],ia=sa.env||{},T_=!(ia.NO_COLOR||Dg.includes("--no-color"))&&(!!ia.FORCE_COLOR||Dg.includes("--color")||sa.platform==="win32"||(sa.stdout||{}).isTTY&&ia.TERM!=="dumb"||!!ia.CI),F_=(e,t,r=e)=>n=>{let o=""+n,s=o.indexOf(t,e.length);return~s?e+R_(o,t,r,s)+t:e+o+t},R_=(e,t,r,n)=>{let o="",s=0;do o+=e.substring(s,n)+r,s=n+t.length,n=e.indexOf(t,s);while(~n);return o+e.substring(s)},vg=(e=T_)=>{let t=e?F_:()=>String;return{isColorSupported:e,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")}};mc.exports=vg();mc.exports.createColors=vg});var Xh=x((c7,va)=>{va.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/;va.exports.ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;va.exports.ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/});var jc=x((l7,ey)=>{var zc=Xh();ey.exports={isSpaceSeparator(e){return typeof e=="string"&&zc.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||zc.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="\u200C"||e==="\u200D"||zc.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}}});var iy=x((p7,oy)=>{var Xe=jc(),Vc,xt,rn,ba,wn,vr,et,Kc,ki;oy.exports=function(t,r){Vc=String(t),xt="start",rn=[],ba=0,wn=1,vr=0,et=void 0,Kc=void 0,ki=void 0;do et=FF(),kF[xt]();while(et.type!=="eof");return typeof r=="function"?Hc({"":ki},"",r):ki};function Hc(e,t,r){let n=e[t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let o=0;o<n.length;o++){let s=String(o),i=Hc(n,s,r);i===void 0?delete n[s]:Object.defineProperty(n,s,{value:i,writable:!0,enumerable:!0,configurable:!0})}else for(let o in n){let s=Hc(n,o,r);s===void 0?delete n[o]:Object.defineProperty(n,o,{value:s,writable:!0,enumerable:!0,configurable:!0})}return r.call(e,t,n)}var J,K,$i,tn,ne;function FF(){for(J="default",K="",$i=!1,tn=1;;){ne=nn();let e=ry[J]();if(e)return e}}function nn(){if(Vc[ba])return String.fromCodePoint(Vc.codePointAt(ba))}function T(){let e=nn();return e===`
3
+ `?(wn++,vr=0):e?vr+=e.length:vr++,e&&(ba+=e.length),e}var ry={default(){switch(ne){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
4
+ `:case"\r":case"\u2028":case"\u2029":T();return;case"/":T(),J="comment";return;case void 0:return T(),Ae("eof")}if(Xe.isSpaceSeparator(ne)){T();return}return ry[xt]()},comment(){switch(ne){case"*":T(),J="multiLineComment";return;case"/":T(),J="singleLineComment";return}throw Te(T())},multiLineComment(){switch(ne){case"*":T(),J="multiLineCommentAsterisk";return;case void 0:throw Te(T())}T()},multiLineCommentAsterisk(){switch(ne){case"*":T();return;case"/":T(),J="default";return;case void 0:throw Te(T())}T(),J="multiLineComment"},singleLineComment(){switch(ne){case`
5
+ `:case"\r":case"\u2028":case"\u2029":T(),J="default";return;case void 0:return T(),Ae("eof")}T()},value(){switch(ne){case"{":case"[":return Ae("punctuator",T());case"n":return T(),Wn("ull"),Ae("null",null);case"t":return T(),Wn("rue"),Ae("boolean",!0);case"f":return T(),Wn("alse"),Ae("boolean",!1);case"-":case"+":T()==="-"&&(tn=-1),J="sign";return;case".":K=T(),J="decimalPointLeading";return;case"0":K=T(),J="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":K=T(),J="decimalInteger";return;case"I":return T(),Wn("nfinity"),Ae("numeric",1/0);case"N":return T(),Wn("aN"),Ae("numeric",NaN);case'"':case"'":$i=T()==='"',K="",J="string";return}throw Te(T())},identifierNameStartEscape(){if(ne!=="u")throw Te(T());T();let e=qc();switch(e){case"$":case"_":break;default:if(!Xe.isIdStartChar(e))throw ty();break}K+=e,J="identifierName"},identifierName(){switch(ne){case"$":case"_":case"\u200C":case"\u200D":K+=T();return;case"\\":T(),J="identifierNameEscape";return}if(Xe.isIdContinueChar(ne)){K+=T();return}return Ae("identifier",K)},identifierNameEscape(){if(ne!=="u")throw Te(T());T();let e=qc();switch(e){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!Xe.isIdContinueChar(e))throw ty();break}K+=e,J="identifierName"},sign(){switch(ne){case".":K=T(),J="decimalPointLeading";return;case"0":K=T(),J="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":K=T(),J="decimalInteger";return;case"I":return T(),Wn("nfinity"),Ae("numeric",tn*(1/0));case"N":return T(),Wn("aN"),Ae("numeric",NaN)}throw Te(T())},zero(){switch(ne){case".":K+=T(),J="decimalPoint";return;case"e":case"E":K+=T(),J="decimalExponent";return;case"x":case"X":K+=T(),J="hexadecimal";return}return Ae("numeric",tn*0)},decimalInteger(){switch(ne){case".":K+=T(),J="decimalPoint";return;case"e":case"E":K+=T(),J="decimalExponent";return}if(Xe.isDigit(ne)){K+=T();return}return Ae("numeric",tn*Number(K))},decimalPointLeading(){if(Xe.isDigit(ne)){K+=T(),J="decimalFraction";return}throw Te(T())},decimalPoint(){switch(ne){case"e":case"E":K+=T(),J="decimalExponent";return}if(Xe.isDigit(ne)){K+=T(),J="decimalFraction";return}return Ae("numeric",tn*Number(K))},decimalFraction(){switch(ne){case"e":case"E":K+=T(),J="decimalExponent";return}if(Xe.isDigit(ne)){K+=T();return}return Ae("numeric",tn*Number(K))},decimalExponent(){switch(ne){case"+":case"-":K+=T(),J="decimalExponentSign";return}if(Xe.isDigit(ne)){K+=T(),J="decimalExponentInteger";return}throw Te(T())},decimalExponentSign(){if(Xe.isDigit(ne)){K+=T(),J="decimalExponentInteger";return}throw Te(T())},decimalExponentInteger(){if(Xe.isDigit(ne)){K+=T();return}return Ae("numeric",tn*Number(K))},hexadecimal(){if(Xe.isHexDigit(ne)){K+=T(),J="hexadecimalInteger";return}throw Te(T())},hexadecimalInteger(){if(Xe.isHexDigit(ne)){K+=T();return}return Ae("numeric",tn*Number(K))},string(){switch(ne){case"\\":T(),K+=RF();return;case'"':if($i)return T(),Ae("string",K);K+=T();return;case"'":if(!$i)return T(),Ae("string",K);K+=T();return;case`
6
+ `:case"\r":throw Te(T());case"\u2028":case"\u2029":IF(ne);break;case void 0:throw Te(T())}K+=T()},start(){switch(ne){case"{":case"[":return Ae("punctuator",T())}J="value"},beforePropertyName(){switch(ne){case"$":case"_":K=T(),J="identifierName";return;case"\\":T(),J="identifierNameStartEscape";return;case"}":return Ae("punctuator",T());case'"':case"'":$i=T()==='"',J="string";return}if(Xe.isIdStartChar(ne)){K+=T(),J="identifierName";return}throw Te(T())},afterPropertyName(){if(ne===":")return Ae("punctuator",T());throw Te(T())},beforePropertyValue(){J="value"},afterPropertyValue(){switch(ne){case",":case"}":return Ae("punctuator",T())}throw Te(T())},beforeArrayValue(){if(ne==="]")return Ae("punctuator",T());J="value"},afterArrayValue(){switch(ne){case",":case"]":return Ae("punctuator",T())}throw Te(T())},end(){throw Te(T())}};function Ae(e,t){return{type:e,value:t,line:wn,column:vr}}function Wn(e){for(let t of e){if(nn()!==t)throw Te(T());T()}}function RF(){switch(nn()){case"b":return T(),"\b";case"f":return T(),"\f";case"n":return T(),`
7
+ `;case"r":return T(),"\r";case"t":return T()," ";case"v":return T(),"\v";case"0":if(T(),Xe.isDigit(nn()))throw Te(T());return"\0";case"x":return T(),$F();case"u":return T(),qc();case`
8
+ `:case"\u2028":case"\u2029":return T(),"";case"\r":return T(),nn()===`
9
+ `&&T(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Te(T());case void 0:throw Te(T())}return T()}function $F(){let e="",t=nn();if(!Xe.isHexDigit(t)||(e+=T(),t=nn(),!Xe.isHexDigit(t)))throw Te(T());return e+=T(),String.fromCodePoint(parseInt(e,16))}function qc(){let e="",t=4;for(;t-- >0;){let r=nn();if(!Xe.isHexDigit(r))throw Te(T());e+=T()}return String.fromCodePoint(parseInt(e,16))}var kF={start(){if(et.type==="eof")throw Zn();Uc()},beforePropertyName(){switch(et.type){case"identifier":case"string":Kc=et.value,xt="afterPropertyName";return;case"punctuator":Ca();return;case"eof":throw Zn()}},afterPropertyName(){if(et.type==="eof")throw Zn();xt="beforePropertyValue"},beforePropertyValue(){if(et.type==="eof")throw Zn();Uc()},beforeArrayValue(){if(et.type==="eof")throw Zn();if(et.type==="punctuator"&&et.value==="]"){Ca();return}Uc()},afterPropertyValue(){if(et.type==="eof")throw Zn();switch(et.value){case",":xt="beforePropertyName";return;case"}":Ca()}},afterArrayValue(){if(et.type==="eof")throw Zn();switch(et.value){case",":xt="beforeArrayValue";return;case"]":Ca()}},end(){}};function Uc(){let e;switch(et.type){case"punctuator":switch(et.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=et.value;break}if(ki===void 0)ki=e;else{let t=rn[rn.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,Kc,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")rn.push(e),Array.isArray(e)?xt="beforeArrayValue":xt="beforePropertyName";else{let t=rn[rn.length-1];t==null?xt="end":Array.isArray(t)?xt="afterArrayValue":xt="afterPropertyValue"}}function Ca(){rn.pop();let e=rn[rn.length-1];e==null?xt="end":Array.isArray(e)?xt="afterArrayValue":xt="afterPropertyValue"}function Te(e){return wa(e===void 0?`JSON5: invalid end of input at ${wn}:${vr}`:`JSON5: invalid character '${ny(e)}' at ${wn}:${vr}`)}function Zn(){return wa(`JSON5: invalid end of input at ${wn}:${vr}`)}function ty(){return vr-=5,wa(`JSON5: invalid identifier character at ${wn}:${vr}`)}function IF(e){console.warn(`JSON5: '${ny(e)}' in strings is not valid ECMAScript; consider escaping`)}function ny(e){let t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){let r=e.charCodeAt(0).toString(16);return"\\x"+("00"+r).substring(r.length)}return e}function wa(e){let t=new SyntaxError(e);return t.lineNumber=wn,t.columnNumber=vr,t}});var ay=x((d7,sy)=>{var Gc=jc();sy.exports=function(t,r,n){let o=[],s="",i,a,u="",c;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(n=r.space,c=r.quote,r=r.replacer),typeof r=="function")a=r;else if(Array.isArray(r)){i=[];for(let f of r){let h;typeof f=="string"?h=f:(typeof f=="number"||f instanceof String||f instanceof Number)&&(h=String(f)),h!==void 0&&i.indexOf(h)<0&&i.push(h)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>0&&(n=Math.min(10,Math.floor(n)),u=" ".substr(0,n)):typeof n=="string"&&(u=n.substr(0,10)),l("",{"":t});function l(f,h){let y=h[f];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(f):typeof y.toJSON=="function"&&(y=y.toJSON(f))),a&&(y=a.call(h,f,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return p(y,!1);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?m(y):d(y)}function p(f){let h={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},b="";for(let _=0;_<f.length;_++){let S=f[_];switch(S){case"'":case'"':h[S]++,b+=S;continue;case"\0":if(Gc.isDigit(f[_+1])){b+="\\x00";continue}}if(y[S]){b+=y[S];continue}if(S<" "){let F=S.charCodeAt(0).toString(16);b+="\\x"+("00"+F).substring(F.length);continue}b+=S}let C=c||Object.keys(h).reduce((_,S)=>h[_]<h[S]?_:S);return b=b.replace(new RegExp(C,"g"),y[C]),C+b+C}function d(f){if(o.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");o.push(f);let h=s;s=s+u;let y=i||Object.keys(f),b=[];for(let _ of y){let S=l(_,f);if(S!==void 0){let F=g(_)+":";u!==""&&(F+=" "),F+=S,b.push(F)}}let C;if(b.length===0)C="{}";else{let _;if(u==="")_=b.join(","),C="{"+_+"}";else{let S=`,
10
10
  `+s;_=b.join(S),C=`{
11
11
  `+s+_+`,
12
- `+h+"}"}}return o.pop(),s=h,C}function g(f){if(f.length===0)return p(f,!0);let h=String.fromCodePoint(f.codePointAt(0));if(!Kc.isIdStartChar(h))return p(f,!0);for(let y=h.length;y<f.length;y++)if(!Kc.isIdContinueChar(String.fromCodePoint(f.codePointAt(y))))return p(f,!0);return f}function m(f){if(o.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");o.push(f);let h=s;s=s+u;let y=[];for(let C=0;C<f.length;C++){let _=l(String(C),f);y.push(_!==void 0?_:"null")}let b;if(y.length===0)b="[]";else if(u==="")b="["+y.join(",")+"]";else{let C=`,
12
+ `+h+"}"}}return o.pop(),s=h,C}function g(f){if(f.length===0)return p(f,!0);let h=String.fromCodePoint(f.codePointAt(0));if(!Gc.isIdStartChar(h))return p(f,!0);for(let y=h.length;y<f.length;y++)if(!Gc.isIdContinueChar(String.fromCodePoint(f.codePointAt(y))))return p(f,!0);return f}function m(f){if(o.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");o.push(f);let h=s;s=s+u;let y=[];for(let C=0;C<f.length;C++){let _=l(String(C),f);y.push(_!==void 0?_:"null")}let b;if(y.length===0)b="[]";else if(u==="")b="["+y.join(",")+"]";else{let C=`,
13
13
  `+s,_=y.join(C);b=`[
14
14
  `+s+_+`,
15
- `+h+"]"}return o.pop(),s=h,b}}});var uy=x((W7,ay)=>{var IT=oy(),NT=sy(),OT={parse:IT,stringify:NT};ay.exports=OT});var Jc=x(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.throwUnsupportedData=xn.throwUnknownDataType=xn.getType=void 0;function Sy(e){return Object.prototype.toString.call(e)}xn.getType=Sy;function u$(e){throw new TypeError("unsupported data type: "+Sy(e))}xn.throwUnknownDataType=u$;function c$(e){throw new TypeError("unsupported data type: "+e)}xn.throwUnsupportedData=c$});var tl=x(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.s_to_num=pt.int_str_to_s=pt.num_to_s=pt.big_int_to_s=pt.int_to_s=pt.s_to_big_int=pt.s_to_int=void 0;var on="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);on+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);on+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);on+=t}var Ro=on.length,Qc={};for(let e=0;e<Ro;e++){let t=on[e];Qc[t]=e}function Xc(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],s=Qc[o];s*=r,t+=s,r*=Ro}return t}pt.s_to_int=Xc;function Ey(e){let t=BigInt(0),r=BigInt(1),n=BigInt(Ro);for(let o=e.length-1;o>=0;o--){let s=e[o],i=BigInt(Qc[s]);i*=r,t+=i,r*=n}return t}pt.s_to_big_int=Ey;function el(e){if(e===0)return on[0];let t=[];for(;e!==0;){let r=e%Ro,n=on[r];t.push(n),e-=r,e/=Ro}return t.reverse().join("")}pt.int_to_s=el;function Py(e){let t=BigInt(0),r=BigInt(Ro);if(e===t)return on[0];let n=[];for(;e!==t;){let o=e%r,s=on[Number(o)];n.push(s),e/=r}return n.reverse().join("")}pt.big_int_to_s=Py;function _y(e){return e.split("").reverse().join("")}function Ay(e){if(e<0)return"-"+Ay(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[s,i]=t.split("e");t=s,r="0e"+i}else return el(e);let n;r&&([r,n]=r.split("e")),t=Sa(t),r=_y(r),r=Sa(r);let o=t+"."+r;if(n){switch(o+=".",n[0]){case"+":n=n.slice(1);break;case"-":o+="-",n=n.slice(1);break}n=Sa(n),o+=n}return o}pt.num_to_s=Ay;function Sa(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?el(t):":"+Py(BigInt(e))}pt.int_str_to_s=Sa;function Yc(e){return e[0]===":"?Ey(e.substring(1)).toString():Xc(e).toString()}function Fy(e){if(e[0]==="-")return-Fy(e.substr(1));let[t,r,n]=e.split(".");if(!r)return Xc(t);t=Yc(t),r=Yc(r),r=_y(r);let o=t+"."+r;if(n){o+="e";let s=!1;n[0]==="-"&&(s=!0,n=n.slice(1)),n=Yc(n),o+=s?-n:+n}return+o}pt.s_to_num=Fy});var nl=x(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.decodeStr=dt.encodeStr=dt.decodeBool=dt.encodeBool=dt.decodeKey=dt.decodeNum=dt.encodeNum=void 0;var rl=tl();function l$(e){return"n|"+(0,rl.num_to_s)(e)}dt.encodeNum=l$;function p$(e){return e=e.replace("n|",""),(0,rl.s_to_num)(e)}dt.decodeNum=p$;function d$(e){return typeof e=="number"?e:(0,rl.s_to_int)(e)}dt.decodeKey=d$;function f$(e){return e?"b|T":"b|F"}dt.encodeBool=f$;function m$(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}dt.decodeBool=m$;function g$(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}dt.encodeStr=g$;function h$(e){return e[0]+e[1]==="s|"?e.substr(2):e}dt.decodeStr=h$});var ol=x(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.config=void 0;Ea.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var ul=x(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.addValue=rr.makeInMemoryMemory=rr.makeInMemoryCache=rr.makeInMemoryStore=rr.memToValues=void 0;var al=ol(),il=Jc(),sl=nl(),y$=tl();function D$(e){return e.store.toArray()}rr.memToValues=D$;function Ty(){let e=[];return{forEach(t){for(let r=0;r<e.length;r++)if(t(e[r])==="break")return},add(t){e.push(t)},toArray(){return e}}}rr.makeInMemoryStore=Ty;function $y(){let e=Object.create(null),t=Object.create(null);return{getValue(r){return e[r]},getSchema(r){return t[r]},forEachValue(r){for(let[n,o]of Object.entries(e))if(r(n,o)==="break")return},forEachSchema(r){for(let[n,o]of Object.entries(t))if(r(n,o)==="break")return},setValue(r,n){e[r]=n},setSchema(r,n){t[r]=n},hasValue(r){return r in e},hasSchema(r){return r in t}}}rr.makeInMemoryCache=$y;function v$(){return{store:Ty(),cache:$y(),keyCount:0}}rr.makeInMemoryMemory=v$;function Yn(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,y$.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function C$(e,t){al.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=Ni(e,t,void 0);return e.cache.setSchema(r,n),n}function Ni(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return Ni(e,null,r);break;case"object":if(t===null)return Yn(e,null);if(Array.isArray(t)){let n="a";for(let o=0;o<t.length;o++){let s=t[o],i=s===null?"_":Ni(e,s,t);n+="|"+i}return n==="a"&&(n="a|"),Yn(e,n)}else{let n=Object.keys(t);if(n.length===0)return Yn(e,"o|");let o="o",s=C$(e,n);o+="|"+s;for(let i of n){let a=t[i],u=Ni(e,a,t);o+="|"+u}return Yn(e,o)}case"boolean":return Yn(e,(0,sl.encodeBool)(t));case"number":return Number.isNaN(t)?(al.config.error_on_nan&&(0,il.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(al.config.error_on_infinite&&(0,il.throwUnsupportedData)("[number Infinity]"),""):Yn(e,(0,sl.encodeNum)(t));case"string":return Yn(e,(0,sl.encodeStr)(t))}return(0,il.throwUnknownDataType)(t)}rr.addValue=Ni});var ll=x(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.decompress=Sn.decode=Sn.compress=void 0;var b$=Jc(),Pa=nl(),cl=ul();function w$(e){let t=(0,cl.makeInMemoryMemory)(),r=(0,cl.addValue)(t,e,void 0);return[(0,cl.memToValues)(t),r]}Sn.compress=w$;function x$(e,t){if(t==="o|")return{};let r={},n=t.split("|"),o=n[1],s=Oi(e,o),i=n.length;i-2===1&&!Array.isArray(s)&&(s=[s]);for(let a=2;a<i;a++){let u=s[a-2],c=n[a];c=Oi(e,c),r[u]=c}return r}function S$(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,o=new Array(n);for(let s=0;s<n;s++){let i=r[s+1];i=Oi(e,i),o[s]=i}return o}function Oi(e,t){if(t===""||t==="_")return null;let r=(0,Pa.decodeKey)(t),n=e[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return(0,Pa.decodeBool)(n);case"o|":return x$(e,n);case"n|":return(0,Pa.decodeNum)(n);case"a|":return S$(e,n);default:return(0,Pa.decodeStr)(n)}}return(0,b$.throwUnknownDataType)(n)}Sn.decode=Oi;function E$(e){let[t,r]=e;return Oi(t,r)}Sn.decompress=E$});var Ry=x(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.trimUndefinedRecursively=Io.trimUndefined=void 0;function P$(e){for(let t in e)e[t]===void 0&&delete e[t]}Io.trimUndefined=P$;function _$(e){ky(e,new Set)}Io.trimUndefinedRecursively=_$;function ky(e,t){t.add(e);for(let r in e)if(e[r]===void 0)delete e[r];else{let n=e[r];n&&typeof n=="object"&&!t.has(n)&&ky(n,t)}}});var Oy=x(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.config=ft.trimUndefinedRecursively=ft.trimUndefined=ft.addValue=ft.decode=ft.decompress=ft.compress=void 0;var Iy=ll();Object.defineProperty(ft,"compress",{enumerable:!0,get:function(){return Iy.compress}});Object.defineProperty(ft,"decompress",{enumerable:!0,get:function(){return Iy.decompress}});var A$=ll();Object.defineProperty(ft,"decode",{enumerable:!0,get:function(){return A$.decode}});var F$=ul();Object.defineProperty(ft,"addValue",{enumerable:!0,get:function(){return F$.addValue}});var Ny=Ry();Object.defineProperty(ft,"trimUndefined",{enumerable:!0,get:function(){return Ny.trimUndefined}});Object.defineProperty(ft,"trimUndefinedRecursively",{enumerable:!0,get:function(){return Ny.trimUndefinedRecursively}});var T$=ol();Object.defineProperty(ft,"config",{enumerable:!0,get:function(){return T$.config}})});var oD=x(($G,nD)=>{"use strict";var eD=G("child_process"),ok=eD.spawn,ik=eD.exec;nD.exports=function(e,t,r){if(typeof t=="function"&&r===void 0&&(r=t,t=void 0),e=parseInt(e),Number.isNaN(e)){if(r)return r(new Error("pid must be a number"));throw new Error("pid must be a number")}var n={},o={};switch(n[e]=[],o[e]=1,process.platform){case"win32":ik("taskkill /pid "+e+" /T /F",r);break;case"darwin":rD(e,n,o,function(){Qy(n,t,r)});break;default:tD(e,n,o,function(s){return ok("ps",["-o","pid","--no-headers","--ppid",s])},function(){Qy(n,t,r)});break}};function Qy(e,t,r){var n={};try{Object.keys(e).forEach(function(o){e[o].forEach(function(s){n[s]||(Xy(s,t),n[s]=1)}),n[o]||(Xy(o,t),n[o]=1)})}catch(o){if(r)return r(o);throw o}if(r)return r()}function Xy(e,t){try{process.kill(parseInt(e,10),t)}catch(r){if(r.code!=="ESRCH")throw r}}function tD(e,t,r,n,o){var s=n(e),i="";s.stdout.on("data",function(c){var c=c.toString("ascii");i+=c});var a=function(u){if(delete r[e],u!=0){Object.keys(r).length==0&&o();return}i.match(/\d+/g).forEach(function(c){c=parseInt(c,10),t[e].push(c),t[c]=[],r[c]=1,tD(c,t,r,n,o)})};s.on("close",a)}function rD(e,t,r,n){try{let o="";try{o=execSync("pgrep -P "+e,{encoding:"utf8",timeout:2e3,maxBuffer:1024*1024})}catch(i){if(i.status!==1)throw i}delete r[e];let s=o.trim().split(`
16
- `).filter(Boolean);if(s.length===0){Object.keys(r).length===0&&n();return}s.forEach(function(i){let a=parseInt(i,10);isNaN(a)||(t[e].push(a),t[a]=[],r[a]=1,rD(a,t,r,n))})}catch{delete r[e],Object.keys(r).length===0&&n()}}});var Na=x(nr=>{"use strict";nr.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;nr.find=(e,t)=>e.nodes.find(r=>r.type===t);nr.exceedsLimit=(e,t,r=1,n)=>n===!1||!nr.isInteger(e)||!nr.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;nr.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};nr.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;nr.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;nr.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;nr.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);nr.flatten=(...e)=>{let t=[],r=n=>{for(let o=0;o<n.length;o++){let s=n[o];if(Array.isArray(s)){r(s);continue}s!==void 0&&t.push(s)}return t};return r(e),t}});var Oa=x((fW,lD)=>{"use strict";var cD=Na();lD.exports=(e,t={})=>{let r=(n,o={})=>{let s=t.escapeInvalid&&cD.isInvalidBrace(o),i=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(s||i)&&cD.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let u of n.nodes)a+=r(u);return a};return r(e)}});var dD=x((mW,pD)=>{"use strict";pD.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var bD=x((gW,CD)=>{"use strict";var fD=dD(),Qn=(e,t,r)=>{if(fD(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(fD(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let o=String(n.relaxZeros),s=String(n.shorthand),i=String(n.capture),a=String(n.wrap),u=e+":"+t+"="+o+s+i+a;if(Qn.cache.hasOwnProperty(u))return Qn.cache[u].result;let c=Math.min(e,t),l=Math.max(e,t);if(Math.abs(c-l)===1){let f=e+"|"+t;return n.capture?`(${f})`:n.wrap===!1?f:`(?:${f})`}let p=vD(e)||vD(t),d={min:e,max:t,a:c,b:l},g=[],m=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),c<0){let f=l<0?Math.abs(l):1;m=mD(f,Math.abs(c),d,n),c=d.a=0}return l>=0&&(g=mD(c,l,d,n)),d.negatives=m,d.positives=g,d.result=pk(m,g,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&g.length+m.length>1&&(d.result=`(?:${d.result})`),Qn.cache[u]=d,d.result};function pk(e,t,r){let n=Al(e,t,"-",!1,r)||[],o=Al(t,e,"",!1,r)||[],s=Al(e,t,"-?",!0,r)||[];return n.concat(s).concat(o).join("|")}function dk(e,t){let r=1,n=1,o=hD(e,r),s=new Set([t]);for(;e<=o&&o<=t;)s.add(o),r+=1,o=hD(e,r);for(o=yD(t+1,n)-1;e<o&&o<=t;)s.add(o),n+=1,o=yD(t+1,n)-1;return s=[...s],s.sort(gk),s}function fk(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=mk(e,t),o=n.length,s="",i=0;for(let a=0;a<o;a++){let[u,c]=n[a];u===c?s+=u:u!=="0"||c!=="9"?s+=hk(u,c,r):i++}return i&&(s+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[i],digits:o}}function mD(e,t,r,n){let o=dk(e,t),s=[],i=e,a;for(let u=0;u<o.length;u++){let c=o[u],l=fk(String(i),String(c),n),p="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+DD(a.count),i=c+1;continue}r.isPadded&&(p=yk(c,r,n)),l.string=p+l.pattern+DD(l.count),s.push(l),i=c+1,a=l}return s}function Al(e,t,r,n,o){let s=[];for(let i of e){let{string:a}=i;!n&&!gD(t,"string",a)&&s.push(r+a),n&&gD(t,"string",a)&&s.push(r+a)}return s}function mk(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function gk(e,t){return e>t?1:t>e?-1:0}function gD(e,t,r){return e.some(n=>n[t]===r)}function hD(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function yD(e,t){return e-e%Math.pow(10,t)}function DD(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function hk(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function vD(e){return/^-?(0+)\d/.test(e)}function yk(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),o=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${n}}`:`0{${n}}`}}Qn.cache={};Qn.clearCache=()=>Qn.cache={};CD.exports=Qn});var $l=x((hW,AD)=>{"use strict";var Dk=G("util"),xD=bD(),wD=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),vk=e=>t=>e===!0?Number(t):String(t),Fl=e=>typeof e=="number"||typeof e=="string"&&e!=="",Ui=e=>Number.isInteger(+e),Tl=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Ck=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,bk=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},Ba=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},wk=(e,t,r)=>{e.negatives.sort((a,u)=>a<u?-1:a>u?1:0),e.positives.sort((a,u)=>a<u?-1:a>u?1:0);let n=t.capture?"":"?:",o="",s="",i;return e.positives.length&&(o=e.positives.map(a=>Ba(String(a),r)).join("|")),e.negatives.length&&(s=`-(${n}${e.negatives.map(a=>Ba(String(a),r)).join("|")})`),o&&s?i=`${o}|${s}`:i=o||s,t.wrap?`(${n}${i})`:i},SD=(e,t,r,n)=>{if(r)return xD(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let s=String.fromCharCode(t);return`[${o}-${s}]`},ED=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return xD(e,t,r)},PD=(...e)=>new RangeError("Invalid range arguments: "+Dk.inspect(...e)),_D=(e,t,r)=>{if(r.strictRanges===!0)throw PD([e,t]);return[]},xk=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},Sk=(e,t,r=1,n={})=>{let o=Number(e),s=Number(t);if(!Number.isInteger(o)||!Number.isInteger(s)){if(n.strictRanges===!0)throw PD([e,t]);return[]}o===0&&(o=0),s===0&&(s=0);let i=o>s,a=String(e),u=String(t),c=String(r);r=Math.max(Math.abs(r),1);let l=Tl(a)||Tl(u)||Tl(c),p=l?Math.max(a.length,u.length,c.length):0,d=l===!1&&Ck(e,t,n)===!1,g=n.transform||vk(d);if(n.toRegex&&r===1)return SD(Ba(e,p),Ba(t,p),!0,n);let m={negatives:[],positives:[]},f=b=>m[b<0?"negatives":"positives"].push(Math.abs(b)),h=[],y=0;for(;i?o>=s:o<=s;)n.toRegex===!0&&r>1?f(o):h.push(bk(g(o,y),p,d)),o=i?o-r:o+r,y++;return n.toRegex===!0?r>1?wk(m,n,p):ED(h,null,{wrap:!1,...n}):h},Ek=(e,t,r=1,n={})=>{if(!Ui(e)&&e.length>1||!Ui(t)&&t.length>1)return _D(e,t,n);let o=n.transform||(d=>String.fromCharCode(d)),s=`${e}`.charCodeAt(0),i=`${t}`.charCodeAt(0),a=s>i,u=Math.min(s,i),c=Math.max(s,i);if(n.toRegex&&r===1)return SD(u,c,!1,n);let l=[],p=0;for(;a?s>=i:s<=i;)l.push(o(s,p)),s=a?s-r:s+r,p++;return n.toRegex===!0?ED(l,null,{wrap:!1,options:n}):l},Ma=(e,t,r,n={})=>{if(t==null&&Fl(e))return[e];if(!Fl(e)||!Fl(t))return _D(e,t,n);if(typeof r=="function")return Ma(e,t,1,{transform:r});if(wD(r))return Ma(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,Ui(r)?Ui(e)&&Ui(t)?Sk(e,t,r,o):Ek(e,t,Math.max(Math.abs(r),1),o):r!=null&&!wD(r)?xk(r,o):Ma(e,t,1,r)};AD.exports=Ma});var $D=x((yW,TD)=>{"use strict";var Pk=$l(),FD=Na(),_k=(e,t={})=>{let r=(n,o={})=>{let s=FD.isInvalidBrace(o),i=n.invalid===!0&&t.escapeInvalid===!0,a=s===!0||i===!0,u=t.escapeInvalid===!0?"\\":"",c="";if(n.isOpen===!0)return u+n.value;if(n.isClose===!0)return console.log("node.isClose",u,n.value),u+n.value;if(n.type==="open")return a?u+n.value:"(";if(n.type==="close")return a?u+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=FD.reduce(n.nodes),p=Pk(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return l.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let l of n.nodes)c+=r(l,n);return c};return r(e)};TD.exports=_k});var ID=x((DW,RD)=>{"use strict";var Ak=$l(),kD=Oa(),Oo=Na(),Xn=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Oo.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let s of o)n.push(Xn(s,t,r));else for(let s of t)r===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?Xn(o,s,r):o+s);return Oo.flatten(n)},Fk=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(o,s={})=>{o.queue=[];let i=s,a=s.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,a=i.queue;if(o.invalid||o.dollar){a.push(Xn(a.pop(),kD(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(Xn(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let p=Oo.reduce(o.nodes);if(Oo.exceedsLimit(...p,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=Ak(...p,t);d.length===0&&(d=kD(o,t)),a.push(Xn(a.pop(),d)),o.nodes=[];return}let u=Oo.encloseBrace(o),c=o.queue,l=o;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,c=l.queue;for(let p=0;p<o.nodes.length;p++){let d=o.nodes[p];if(d.type==="comma"&&o.type==="brace"){p===1&&c.push(""),c.push("");continue}if(d.type==="close"){a.push(Xn(a.pop(),c,u));continue}if(d.value&&d.type!=="open"){c.push(Xn(c.pop(),d.value));continue}d.nodes&&n(d,o)}return c};return Oo.flatten(n(e))};RD.exports=Fk});var OD=x((vW,ND)=>{"use strict";ND.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
17
- `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var jD=x((CW,zD)=>{"use strict";var Tk=Oa(),{MAX_LENGTH:MD,CHAR_BACKSLASH:kl,CHAR_BACKTICK:$k,CHAR_COMMA:kk,CHAR_DOT:Rk,CHAR_LEFT_PARENTHESES:Ik,CHAR_RIGHT_PARENTHESES:Nk,CHAR_LEFT_CURLY_BRACE:Ok,CHAR_RIGHT_CURLY_BRACE:Mk,CHAR_LEFT_SQUARE_BRACKET:BD,CHAR_RIGHT_SQUARE_BRACKET:LD,CHAR_DOUBLE_QUOTE:Bk,CHAR_SINGLE_QUOTE:Lk,CHAR_NO_BREAK_SPACE:zk,CHAR_ZERO_WIDTH_NOBREAK_SPACE:jk}=OD(),Uk=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(MD,r.maxLength):MD;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let o={type:"root",input:e,nodes:[]},s=[o],i=o,a=o,u=0,c=e.length,l=0,p=0,d,g=()=>e[l++],m=f=>{if(f.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&f.type==="text"){a.value+=f.value;return}return i.nodes.push(f),f.parent=i,f.prev=a,a=f,f};for(m({type:"bos"});l<c;)if(i=s[s.length-1],d=g(),!(d===jk||d===zk)){if(d===kl){m({type:"text",value:(t.keepEscaping?d:"")+g()});continue}if(d===LD){m({type:"text",value:"\\"+d});continue}if(d===BD){u++;let f;for(;l<c&&(f=g());){if(d+=f,f===BD){u++;continue}if(f===kl){d+=g();continue}if(f===LD&&(u--,u===0))break}m({type:"text",value:d});continue}if(d===Ik){i=m({type:"paren",nodes:[]}),s.push(i),m({type:"text",value:d});continue}if(d===Nk){if(i.type!=="paren"){m({type:"text",value:d});continue}i=s.pop(),m({type:"text",value:d}),i=s[s.length-1];continue}if(d===Bk||d===Lk||d===$k){let f=d,h;for(t.keepQuotes!==!0&&(d="");l<c&&(h=g());){if(h===kl){d+=h+g();continue}if(h===f){t.keepQuotes===!0&&(d+=h);break}d+=h}m({type:"text",value:d});continue}if(d===Ok){p++;let h={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||i.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};i=m(h),s.push(i),m({type:"open",value:d});continue}if(d===Mk){if(i.type!=="brace"){m({type:"text",value:d});continue}let f="close";i=s.pop(),i.close=!0,m({type:f,value:d}),p--,i=s[s.length-1];continue}if(d===kk&&p>0){if(i.ranges>0){i.ranges=0;let f=i.nodes.shift();i.nodes=[f,{type:"text",value:Tk(i)}]}m({type:"comma",value:d}),i.commas++;continue}if(d===Rk&&p>0&&i.commas===0){let f=i.nodes;if(p===0||f.length===0){m({type:"text",value:d});continue}if(a.type==="dot"){if(i.range=[],a.value+=d,a.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,a.type="text";continue}i.ranges++,i.args=[];continue}if(a.type==="range"){f.pop();let h=f[f.length-1];h.value+=a.value+d,a=h,i.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d})}do if(i=s.pop(),i.type!=="root"){i.nodes.forEach(y=>{y.nodes||(y.type==="open"&&(y.isOpen=!0),y.type==="close"&&(y.isClose=!0),y.nodes||(y.type="text"),y.invalid=!0)});let f=s[s.length-1],h=f.nodes.indexOf(i);f.nodes.splice(h,1,...i.nodes)}while(s.length>0);return m({type:"eos"}),o};zD.exports=Uk});var HD=x((bW,VD)=>{"use strict";var UD=Oa(),Vk=$D(),Hk=ID(),qk=jD(),qt=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=qt.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(qt.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};qt.parse=(e,t={})=>qk(e,t);qt.stringify=(e,t={})=>UD(typeof e=="string"?qt.parse(e,t):e,t);qt.compile=(e,t={})=>(typeof e=="string"&&(e=qt.parse(e,t)),Vk(e,t));qt.expand=(e,t={})=>{typeof e=="string"&&(e=qt.parse(e,t));let r=Hk(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};qt.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?qt.compile(e,t):qt.expand(e,t);VD.exports=qt});var Vi=x((wW,ZD)=>{"use strict";var Kk=G("path"),Ur="\\\\/",qD=`[^${Ur}]`,un="\\.",Gk="\\+",Wk="\\?",La="\\/",Zk="(?=.)",KD="[^/]",Rl=`(?:${La}|$)`,GD=`(?:^|${La})`,Il=`${un}{1,2}${Rl}`,Jk=`(?!${un})`,Yk=`(?!${GD}${Il})`,Qk=`(?!${un}{0,1}${Rl})`,Xk=`(?!${Il})`,eR=`[^.${La}]`,tR=`${KD}*?`,WD={DOT_LITERAL:un,PLUS_LITERAL:Gk,QMARK_LITERAL:Wk,SLASH_LITERAL:La,ONE_CHAR:Zk,QMARK:KD,END_ANCHOR:Rl,DOTS_SLASH:Il,NO_DOT:Jk,NO_DOTS:Yk,NO_DOT_SLASH:Qk,NO_DOTS_SLASH:Xk,QMARK_NO_DOT:eR,STAR:tR,START_ANCHOR:GD},rR={...WD,SLASH_LITERAL:`[${Ur}]`,QMARK:qD,STAR:`${qD}*?`,DOTS_SLASH:`${un}{1,2}(?:[${Ur}]|$)`,NO_DOT:`(?!${un})`,NO_DOTS:`(?!(?:^|[${Ur}])${un}{1,2}(?:[${Ur}]|$))`,NO_DOT_SLASH:`(?!${un}{0,1}(?:[${Ur}]|$))`,NO_DOTS_SLASH:`(?!${un}{1,2}(?:[${Ur}]|$))`,QMARK_NO_DOT:`[^.${Ur}]`,START_ANCHOR:`(?:^|[${Ur}])`,END_ANCHOR:`(?:[${Ur}]|$)`},nR={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};ZD.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:nR,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Kk.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?rR:WD}}});var Hi=x($t=>{"use strict";var oR=G("path"),iR=process.platform==="win32",{REGEX_BACKSLASH:sR,REGEX_REMOVE_BACKSLASH:aR,REGEX_SPECIAL_CHARS:uR,REGEX_SPECIAL_CHARS_GLOBAL:cR}=Vi();$t.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);$t.hasRegexChars=e=>uR.test(e);$t.isRegexChar=e=>e.length===1&&$t.hasRegexChars(e);$t.escapeRegex=e=>e.replace(cR,"\\$1");$t.toPosixSlashes=e=>e.replace(sR,"/");$t.removeBackslashes=e=>e.replace(aR,t=>t==="\\"?"":t);$t.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};$t.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:iR===!0||oR.sep==="\\";$t.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?$t.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};$t.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};$t.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${e})${o}`;return t.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var nv=x((SW,rv)=>{"use strict";var JD=Hi(),{CHAR_ASTERISK:Nl,CHAR_AT:lR,CHAR_BACKWARD_SLASH:qi,CHAR_COMMA:pR,CHAR_DOT:Ol,CHAR_EXCLAMATION_MARK:Ml,CHAR_FORWARD_SLASH:tv,CHAR_LEFT_CURLY_BRACE:Bl,CHAR_LEFT_PARENTHESES:Ll,CHAR_LEFT_SQUARE_BRACKET:dR,CHAR_PLUS:fR,CHAR_QUESTION_MARK:YD,CHAR_RIGHT_CURLY_BRACE:mR,CHAR_RIGHT_PARENTHESES:QD,CHAR_RIGHT_SQUARE_BRACKET:gR}=Vi(),XD=e=>e===tv||e===qi,ev=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},hR=(e,t)=>{let r=t||{},n=e.length-1,o=r.parts===!0||r.scanToEnd===!0,s=[],i=[],a=[],u=e,c=-1,l=0,p=0,d=!1,g=!1,m=!1,f=!1,h=!1,y=!1,b=!1,C=!1,_=!1,S=!1,T=0,k,I,R={value:"",depth:0,isGlob:!1},$=()=>c>=n,D=()=>u.charCodeAt(c+1),B=()=>(k=I,u.charCodeAt(++c));for(;c<n;){I=B();let Be;if(I===qi){b=R.backslashes=!0,I=B(),I===Bl&&(y=!0);continue}if(y===!0||I===Bl){for(T++;$()!==!0&&(I=B());){if(I===qi){b=R.backslashes=!0,B();continue}if(I===Bl){T++;continue}if(y!==!0&&I===Ol&&(I=B())===Ol){if(d=R.isBrace=!0,m=R.isGlob=!0,S=!0,o===!0)continue;break}if(y!==!0&&I===pR){if(d=R.isBrace=!0,m=R.isGlob=!0,S=!0,o===!0)continue;break}if(I===mR&&(T--,T===0)){y=!1,d=R.isBrace=!0,S=!0;break}}if(o===!0)continue;break}if(I===tv){if(s.push(c),i.push(R),R={value:"",depth:0,isGlob:!1},S===!0)continue;if(k===Ol&&c===l+1){l+=2;continue}p=c+1;continue}if(r.noext!==!0&&(I===fR||I===lR||I===Nl||I===YD||I===Ml)===!0&&D()===Ll){if(m=R.isGlob=!0,f=R.isExtglob=!0,S=!0,I===Ml&&c===l&&(_=!0),o===!0){for(;$()!==!0&&(I=B());){if(I===qi){b=R.backslashes=!0,I=B();continue}if(I===QD){m=R.isGlob=!0,S=!0;break}}continue}break}if(I===Nl){if(k===Nl&&(h=R.isGlobstar=!0),m=R.isGlob=!0,S=!0,o===!0)continue;break}if(I===YD){if(m=R.isGlob=!0,S=!0,o===!0)continue;break}if(I===dR){for(;$()!==!0&&(Be=B());){if(Be===qi){b=R.backslashes=!0,B();continue}if(Be===gR){g=R.isBracket=!0,m=R.isGlob=!0,S=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&I===Ml&&c===l){C=R.negated=!0,l++;continue}if(r.noparen!==!0&&I===Ll){if(m=R.isGlob=!0,o===!0){for(;$()!==!0&&(I=B());){if(I===Ll){b=R.backslashes=!0,I=B();continue}if(I===QD){S=!0;break}}continue}break}if(m===!0){if(S=!0,o===!0)continue;break}}r.noext===!0&&(f=!1,m=!1);let U=u,H="",w="";l>0&&(H=u.slice(0,l),u=u.slice(l),p-=l),U&&m===!0&&p>0?(U=u.slice(0,p),w=u.slice(p)):m===!0?(U="",w=u):U=u,U&&U!==""&&U!=="/"&&U!==u&&XD(U.charCodeAt(U.length-1))&&(U=U.slice(0,-1)),r.unescape===!0&&(w&&(w=JD.removeBackslashes(w)),U&&b===!0&&(U=JD.removeBackslashes(U)));let E={prefix:H,input:e,start:l,base:U,glob:w,isBrace:d,isBracket:g,isGlob:m,isExtglob:f,isGlobstar:h,negated:C,negatedExtglob:_};if(r.tokens===!0&&(E.maxDepth=0,XD(I)||i.push(R),E.tokens=i),r.parts===!0||r.tokens===!0){let Be;for(let de=0;de<s.length;de++){let Pr=Be?Be+1:l,_r=s[de],zt=e.slice(Pr,_r);r.tokens&&(de===0&&l!==0?(i[de].isPrefix=!0,i[de].value=H):i[de].value=zt,ev(i[de]),E.maxDepth+=i[de].depth),(de!==0||zt!=="")&&a.push(zt),Be=_r}if(Be&&Be+1<e.length){let de=e.slice(Be+1);a.push(de),r.tokens&&(i[i.length-1].value=de,ev(i[i.length-1]),E.maxDepth+=i[i.length-1].depth)}E.slashes=s,E.parts=a}return E};rv.exports=hR});var sv=x((EW,iv)=>{"use strict";var za=Vi(),Kt=Hi(),{MAX_LENGTH:ja,POSIX_REGEX_SOURCE:yR,REGEX_NON_SPECIAL_CHARS:DR,REGEX_SPECIAL_CHARS_BACKREF:vR,REPLACEMENTS:ov}=za,CR=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch{return e.map(o=>Kt.escapeRegex(o)).join("..")}return r},Mo=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,zl=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=ov[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(ja,r.maxLength):ja,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},i=[s],a=r.capture?"":"?:",u=Kt.isWindows(t),c=za.globChars(u),l=za.extglobChars(c),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:f,NO_DOT:h,NO_DOT_SLASH:y,NO_DOTS_SLASH:b,QMARK:C,QMARK_NO_DOT:_,STAR:S,START_ANCHOR:T}=c,k=M=>`(${a}(?:(?!${T}${M.dot?f:p}).)*?)`,I=r.dot?"":h,R=r.dot?C:_,$=r.bash===!0?k(r):S;r.capture&&($=`(${$})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let D={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};e=Kt.removePrefix(e,D),o=e.length;let B=[],U=[],H=[],w=s,E,Be=()=>D.index===o-1,de=D.peek=(M=1)=>e[D.index+M],Pr=D.advance=()=>e[++D.index]||"",_r=()=>e.slice(D.index+1),zt=(M="",Pe=0)=>{D.consumed+=M,D.index+=Pe},Gs=M=>{D.output+=M.output!=null?M.output:M.value,zt(M.value)},ZP=()=>{let M=1;for(;de()==="!"&&(de(2)!=="("||de(3)==="?");)Pr(),D.start++,M++;return M%2===0?!1:(D.negated=!0,D.start++,!0)},Ws=M=>{D[M]++,H.push(M)},Ln=M=>{D[M]--,H.pop()},re=M=>{if(w.type==="globstar"){let Pe=D.braces>0&&(M.type==="comma"||M.type==="brace"),N=M.extglob===!0||B.length&&(M.type==="pipe"||M.type==="paren");M.type!=="slash"&&M.type!=="paren"&&!Pe&&!N&&(D.output=D.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=$,D.output+=w.output)}if(B.length&&M.type!=="paren"&&(B[B.length-1].inner+=M.value),(M.value||M.output)&&Gs(M),w&&w.type==="text"&&M.type==="text"){w.value+=M.value,w.output=(w.output||"")+M.value;return}M.prev=w,i.push(M),w=M},Zs=(M,Pe)=>{let N={...l[Pe],conditions:1,inner:""};N.prev=w,N.parens=D.parens,N.output=D.output;let X=(r.capture?"(":"")+N.open;Ws("parens"),re({type:M,value:Pe,output:D.output?"":m}),re({type:"paren",extglob:!0,value:Pr(),output:X}),B.push(N)},JP=M=>{let Pe=M.close+(r.capture?")":""),N;if(M.type==="negate"){let X=$;if(M.inner&&M.inner.length>1&&M.inner.includes("/")&&(X=k(r)),(X!==$||Be()||/^\)+$/.test(_r()))&&(Pe=M.close=`)$))${X}`),M.inner.includes("*")&&(N=_r())&&/^\.[^\\/.]+$/.test(N)){let Le=zl(N,{...t,fastpaths:!1}).output;Pe=M.close=`)${Le})${X})`}M.prev.type==="bos"&&(D.negatedExtglob=!0)}re({type:"paren",extglob:!0,value:E,output:Pe}),Ln("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let M=!1,Pe=e.replace(vR,(N,X,Le,vt,Ge,nc)=>vt==="\\"?(M=!0,N):vt==="?"?X?X+vt+(Ge?C.repeat(Ge.length):""):nc===0?R+(Ge?C.repeat(Ge.length):""):C.repeat(Le.length):vt==="."?p.repeat(Le.length):vt==="*"?X?X+vt+(Ge?$:""):$:X?N:`\\${N}`);return M===!0&&(r.unescape===!0?Pe=Pe.replace(/\\/g,""):Pe=Pe.replace(/\\+/g,N=>N.length%2===0?"\\\\":N?"\\":"")),Pe===e&&r.contains===!0?(D.output=e,D):(D.output=Kt.wrapOutput(Pe,D,t),D)}for(;!Be();){if(E=Pr(),E==="\0")continue;if(E==="\\"){let N=de();if(N==="/"&&r.bash!==!0||N==="."||N===";")continue;if(!N){E+="\\",re({type:"text",value:E});continue}let X=/^\\+/.exec(_r()),Le=0;if(X&&X[0].length>2&&(Le=X[0].length,D.index+=Le,Le%2!==0&&(E+="\\")),r.unescape===!0?E=Pr():E+=Pr(),D.brackets===0){re({type:"text",value:E});continue}}if(D.brackets>0&&(E!=="]"||w.value==="["||w.value==="[^")){if(r.posix!==!1&&E===":"){let N=w.value.slice(1);if(N.includes("[")&&(w.posix=!0,N.includes(":"))){let X=w.value.lastIndexOf("["),Le=w.value.slice(0,X),vt=w.value.slice(X+2),Ge=yR[vt];if(Ge){w.value=Le+Ge,D.backtrack=!0,Pr(),!s.output&&i.indexOf(w)===1&&(s.output=m);continue}}}(E==="["&&de()!==":"||E==="-"&&de()==="]")&&(E=`\\${E}`),E==="]"&&(w.value==="["||w.value==="[^")&&(E=`\\${E}`),r.posix===!0&&E==="!"&&w.value==="["&&(E="^"),w.value+=E,Gs({value:E});continue}if(D.quotes===1&&E!=='"'){E=Kt.escapeRegex(E),w.value+=E,Gs({value:E});continue}if(E==='"'){D.quotes=D.quotes===1?0:1,r.keepQuotes===!0&&re({type:"text",value:E});continue}if(E==="("){Ws("parens"),re({type:"paren",value:E});continue}if(E===")"){if(D.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Mo("opening","("));let N=B[B.length-1];if(N&&D.parens===N.parens+1){JP(B.pop());continue}re({type:"paren",value:E,output:D.parens?")":"\\)"}),Ln("parens");continue}if(E==="["){if(r.nobracket===!0||!_r().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Mo("closing","]"));E=`\\${E}`}else Ws("brackets");re({type:"bracket",value:E});continue}if(E==="]"){if(r.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){re({type:"text",value:E,output:`\\${E}`});continue}if(D.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Mo("opening","["));re({type:"text",value:E,output:`\\${E}`});continue}Ln("brackets");let N=w.value.slice(1);if(w.posix!==!0&&N[0]==="^"&&!N.includes("/")&&(E=`/${E}`),w.value+=E,Gs({value:E}),r.literalBrackets===!1||Kt.hasRegexChars(N))continue;let X=Kt.escapeRegex(w.value);if(D.output=D.output.slice(0,-w.value.length),r.literalBrackets===!0){D.output+=X,w.value=X;continue}w.value=`(${a}${X}|${w.value})`,D.output+=w.value;continue}if(E==="{"&&r.nobrace!==!0){Ws("braces");let N={type:"brace",value:E,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};U.push(N),re(N);continue}if(E==="}"){let N=U[U.length-1];if(r.nobrace===!0||!N){re({type:"text",value:E,output:E});continue}let X=")";if(N.dots===!0){let Le=i.slice(),vt=[];for(let Ge=Le.length-1;Ge>=0&&(i.pop(),Le[Ge].type!=="brace");Ge--)Le[Ge].type!=="dots"&&vt.unshift(Le[Ge].value);X=CR(vt,r),D.backtrack=!0}if(N.comma!==!0&&N.dots!==!0){let Le=D.output.slice(0,N.outputIndex),vt=D.tokens.slice(N.tokensIndex);N.value=N.output="\\{",E=X="\\}",D.output=Le;for(let Ge of vt)D.output+=Ge.output||Ge.value}re({type:"brace",value:E,output:X}),Ln("braces"),U.pop();continue}if(E==="|"){B.length>0&&B[B.length-1].conditions++,re({type:"text",value:E});continue}if(E===","){let N=E,X=U[U.length-1];X&&H[H.length-1]==="braces"&&(X.comma=!0,N="|"),re({type:"comma",value:E,output:N});continue}if(E==="/"){if(w.type==="dot"&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",i.pop(),w=s;continue}re({type:"slash",value:E,output:g});continue}if(E==="."){if(D.braces>0&&w.type==="dot"){w.value==="."&&(w.output=p);let N=U[U.length-1];w.type="dots",w.output+=E,w.value+=E,N.dots=!0;continue}if(D.braces+D.parens===0&&w.type!=="bos"&&w.type!=="slash"){re({type:"text",value:E,output:p});continue}re({type:"dot",value:E,output:p});continue}if(E==="?"){if(!(w&&w.value==="(")&&r.noextglob!==!0&&de()==="("&&de(2)!=="?"){Zs("qmark",E);continue}if(w&&w.type==="paren"){let X=de(),Le=E;if(X==="<"&&!Kt.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(w.value==="("&&!/[!=<:]/.test(X)||X==="<"&&!/<([!=]|\w+>)/.test(_r()))&&(Le=`\\${E}`),re({type:"text",value:E,output:Le});continue}if(r.dot!==!0&&(w.type==="slash"||w.type==="bos")){re({type:"qmark",value:E,output:_});continue}re({type:"qmark",value:E,output:C});continue}if(E==="!"){if(r.noextglob!==!0&&de()==="("&&(de(2)!=="?"||!/[!=<:]/.test(de(3)))){Zs("negate",E);continue}if(r.nonegate!==!0&&D.index===0){ZP();continue}}if(E==="+"){if(r.noextglob!==!0&&de()==="("&&de(2)!=="?"){Zs("plus",E);continue}if(w&&w.value==="("||r.regex===!1){re({type:"plus",value:E,output:d});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||D.parens>0){re({type:"plus",value:E});continue}re({type:"plus",value:d});continue}if(E==="@"){if(r.noextglob!==!0&&de()==="("&&de(2)!=="?"){re({type:"at",extglob:!0,value:E,output:""});continue}re({type:"text",value:E});continue}if(E!=="*"){(E==="$"||E==="^")&&(E=`\\${E}`);let N=DR.exec(_r());N&&(E+=N[0],D.index+=N[0].length),re({type:"text",value:E});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=E,w.output=$,D.backtrack=!0,D.globstar=!0,zt(E);continue}let M=_r();if(r.noextglob!==!0&&/^\([^?]/.test(M)){Zs("star",E);continue}if(w.type==="star"){if(r.noglobstar===!0){zt(E);continue}let N=w.prev,X=N.prev,Le=N.type==="slash"||N.type==="bos",vt=X&&(X.type==="star"||X.type==="globstar");if(r.bash===!0&&(!Le||M[0]&&M[0]!=="/")){re({type:"star",value:E,output:""});continue}let Ge=D.braces>0&&(N.type==="comma"||N.type==="brace"),nc=B.length&&(N.type==="pipe"||N.type==="paren");if(!Le&&N.type!=="paren"&&!Ge&&!nc){re({type:"star",value:E,output:""});continue}for(;M.slice(0,3)==="/**";){let Js=e[D.index+4];if(Js&&Js!=="/")break;M=M.slice(3),zt("/**",3)}if(N.type==="bos"&&Be()){w.type="globstar",w.value+=E,w.output=k(r),D.output=w.output,D.globstar=!0,zt(E);continue}if(N.type==="slash"&&N.prev.type!=="bos"&&!vt&&Be()){D.output=D.output.slice(0,-(N.output+w.output).length),N.output=`(?:${N.output}`,w.type="globstar",w.output=k(r)+(r.strictSlashes?")":"|$)"),w.value+=E,D.globstar=!0,D.output+=N.output+w.output,zt(E);continue}if(N.type==="slash"&&N.prev.type!=="bos"&&M[0]==="/"){let Js=M[1]!==void 0?"|$":"";D.output=D.output.slice(0,-(N.output+w.output).length),N.output=`(?:${N.output}`,w.type="globstar",w.output=`${k(r)}${g}|${g}${Js})`,w.value+=E,D.output+=N.output+w.output,D.globstar=!0,zt(E+Pr()),re({type:"slash",value:"/",output:""});continue}if(N.type==="bos"&&M[0]==="/"){w.type="globstar",w.value+=E,w.output=`(?:^|${g}|${k(r)}${g})`,D.output=w.output,D.globstar=!0,zt(E+Pr()),re({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-w.output.length),w.type="globstar",w.output=k(r),w.value+=E,D.output+=w.output,D.globstar=!0,zt(E);continue}let Pe={type:"star",value:E,output:$};if(r.bash===!0){Pe.output=".*?",(w.type==="bos"||w.type==="slash")&&(Pe.output=I+Pe.output),re(Pe);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&r.regex===!0){Pe.output=E,re(Pe);continue}(D.index===D.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?(D.output+=y,w.output+=y):r.dot===!0?(D.output+=b,w.output+=b):(D.output+=I,w.output+=I),de()!=="*"&&(D.output+=m,w.output+=m)),re(Pe)}for(;D.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Mo("closing","]"));D.output=Kt.escapeLast(D.output,"["),Ln("brackets")}for(;D.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Mo("closing",")"));D.output=Kt.escapeLast(D.output,"("),Ln("parens")}for(;D.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Mo("closing","}"));D.output=Kt.escapeLast(D.output,"{"),Ln("braces")}if(r.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&re({type:"maybe_slash",value:"",output:`${g}?`}),D.backtrack===!0){D.output="";for(let M of D.tokens)D.output+=M.output!=null?M.output:M.value,M.suffix&&(D.output+=M.suffix)}return D};zl.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(ja,r.maxLength):ja,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=ov[e]||e;let s=Kt.isWindows(t),{DOT_LITERAL:i,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:g,START_ANCHOR:m}=za.globChars(s),f=r.dot?p:l,h=r.dot?d:l,y=r.capture?"":"?:",b={negated:!1,prefix:""},C=r.bash===!0?".*?":g;r.capture&&(C=`(${C})`);let _=I=>I.noglobstar===!0?C:`(${y}(?:(?!${m}${I.dot?c:i}).)*?)`,S=I=>{switch(I){case"*":return`${f}${u}${C}`;case".*":return`${i}${u}${C}`;case"*.*":return`${f}${C}${i}${u}${C}`;case"*/*":return`${f}${C}${a}${u}${h}${C}`;case"**":return f+_(r);case"**/*":return`(?:${f}${_(r)}${a})?${h}${u}${C}`;case"**/*.*":return`(?:${f}${_(r)}${a})?${h}${C}${i}${u}${C}`;case"**/.*":return`(?:${f}${_(r)}${a})?${i}${u}${C}`;default:{let R=/^(.*?)\.(\w+)$/.exec(I);if(!R)return;let $=S(R[1]);return $?$+i+R[2]:void 0}}},T=Kt.removePrefix(e,b),k=S(T);return k&&r.strictSlashes!==!0&&(k+=`${a}?`),k};iv.exports=zl});var uv=x((PW,av)=>{"use strict";var bR=G("path"),wR=nv(),jl=sv(),Ul=Hi(),xR=Vi(),SR=e=>e&&typeof e=="object"&&!Array.isArray(e),He=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map(d=>He(d,t,r));return d=>{for(let g of l){let m=g(d);if(m)return m}return!1}}let n=SR(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=t||{},s=Ul.isWindows(t),i=n?He.compileRe(e,t):He.makeRe(e,t,!1,!0),a=i.state;delete i.state;let u=()=>!1;if(o.ignore){let l={...t,ignore:null,onMatch:null,onResult:null};u=He(o.ignore,l,r)}let c=(l,p=!1)=>{let{isMatch:d,match:g,output:m}=He.test(l,i,t,{glob:e,posix:s}),f={glob:e,state:a,regex:i,posix:s,input:l,output:m,match:g,isMatch:d};return typeof o.onResult=="function"&&o.onResult(f),d===!1?(f.isMatch=!1,p?f:!1):u(l)?(typeof o.onIgnore=="function"&&o.onIgnore(f),f.isMatch=!1,p?f:!1):(typeof o.onMatch=="function"&&o.onMatch(f),p?f:!0)};return r&&(c.state=a),c};He.test=(e,t,r,{glob:n,posix:o}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let s=r||{},i=s.format||(o?Ul.toPosixSlashes:null),a=e===n,u=a&&i?i(e):e;return a===!1&&(u=i?i(e):e,a=u===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=He.matchBase(e,t,r,o):a=t.exec(u)),{isMatch:!!a,match:a,output:u}};He.matchBase=(e,t,r,n=Ul.isWindows(r))=>(t instanceof RegExp?t:He.makeRe(t,r)).test(bR.basename(e));He.isMatch=(e,t,r)=>He(t,r)(e);He.parse=(e,t)=>Array.isArray(e)?e.map(r=>He.parse(r,t)):jl(e,{...t,fastpaths:!1});He.scan=(e,t)=>wR(e,t);He.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let o=t||{},s=o.contains?"":"^",i=o.contains?"":"$",a=`${s}(?:${e.output})${i}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);let u=He.toRegex(a,t);return n===!0&&(u.state=e),u};He.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(o.output=jl.fastpaths(e,t)),o.output||(o=jl(e,t)),He.compileRe(o,t,r,n)};He.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};He.constants=xR;av.exports=He});var lv=x((_W,cv)=>{"use strict";cv.exports=uv()});var Hl=x((AW,gv)=>{"use strict";var dv=G("util"),fv=HD(),Vr=lv(),Vl=Hi(),pv=e=>e===""||e==="./",mv=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},Fe=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,o=new Set,s=new Set,i=0,a=l=>{s.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<t.length;l++){let p=Vr(String(t[l]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&i++;for(let g of e){let m=p(g,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),o.add(m.output)))}}let c=(i===t.length?[...s]:[...o]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(l=>l.replace(/\\/g,"")):t}return c};Fe.match=Fe;Fe.matcher=(e,t)=>Vr(e,t);Fe.isMatch=(e,t,r)=>Vr(t,r)(e);Fe.any=Fe.isMatch;Fe.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,o=[],s=a=>{r.onResult&&r.onResult(a),o.push(a.output)},i=new Set(Fe(e,t,{...r,onResult:s}));for(let a of o)i.has(a)||n.add(a);return[...n]};Fe.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${dv.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>Fe.contains(e,n,r));if(typeof t=="string"){if(pv(e)||pv(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return Fe.isMatch(e,t,{...r,contains:!0})};Fe.matchKeys=(e,t,r)=>{if(!Vl.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=Fe(Object.keys(e),t,r),o={};for(let s of n)o[s]=e[s];return o};Fe.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let s=Vr(String(o),r);if(n.some(i=>s(i)))return!0}return!1};Fe.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let s=Vr(String(o),r);if(!n.every(i=>s(i)))return!1}return!0};Fe.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${dv.inspect(e)}"`);return[].concat(t).every(n=>Vr(n,r)(e))};Fe.capture=(e,t,r)=>{let n=Vl.isWindows(r),s=Vr.makeRe(String(e),{...r,capture:!0}).exec(n?Vl.toPosixSlashes(t):t);if(s)return s.slice(1).map(i=>i===void 0?"":i)};Fe.makeRe=(...e)=>Vr.makeRe(...e);Fe.scan=(...e)=>Vr.scan(...e);Fe.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of fv(String(n),t))r.push(Vr.parse(o,t));return r};Fe.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!mv(e)?[e]:fv(e,t)};Fe.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return Fe.braces(e,{...t,expand:!0})};Fe.hasBraces=mv;gv.exports=Fe});var yv=x((VW,hv)=>{var Bo=1e3,Lo=Bo*60,zo=Lo*60,eo=zo*24,AR=eo*7,FR=eo*365.25;hv.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return TR(e);if(r==="number"&&isFinite(e))return t.long?kR(e):$R(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function TR(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*FR;case"weeks":case"week":case"w":return r*AR;case"days":case"day":case"d":return r*eo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*zo;case"minutes":case"minute":case"mins":case"min":case"m":return r*Lo;case"seconds":case"second":case"secs":case"sec":case"s":return r*Bo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function $R(e){var t=Math.abs(e);return t>=eo?Math.round(e/eo)+"d":t>=zo?Math.round(e/zo)+"h":t>=Lo?Math.round(e/Lo)+"m":t>=Bo?Math.round(e/Bo)+"s":e+"ms"}function kR(e){var t=Math.abs(e);return t>=eo?Ua(e,t,eo,"day"):t>=zo?Ua(e,t,zo,"hour"):t>=Lo?Ua(e,t,Lo,"minute"):t>=Bo?Ua(e,t,Bo,"second"):e+" ms"}function Ua(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}});var ql=x((HW,Dv)=>{function RR(e){r.debug=r,r.default=r,r.coerce=u,r.disable=i,r.enable=o,r.enabled=a,r.humanize=yv(),r.destroy=c,Object.keys(e).forEach(l=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let p=0;for(let d=0;d<l.length;d++)p=(p<<5)-p+l.charCodeAt(d),p|=0;return r.colors[Math.abs(p)%r.colors.length]}r.selectColor=t;function r(l){let p,d=null,g,m;function f(...h){if(!f.enabled)return;let y=f,b=Number(new Date),C=b-(p||b);y.diff=C,y.prev=p,y.curr=b,p=b,h[0]=r.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let _=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(T,k)=>{if(T==="%%")return"%";_++;let I=r.formatters[k];if(typeof I=="function"){let R=h[_];T=I.call(y,R),h.splice(_,1),_--}return T}),r.formatArgs.call(y,h),(y.log||r.log).apply(y,h)}return f.namespace=l,f.useColors=r.useColors(),f.color=r.selectColor(l),f.extend=n,f.destroy=r.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(g!==r.namespaces&&(g=r.namespaces,m=r.enabled(l)),m),set:h=>{d=h}}),typeof r.init=="function"&&r.init(f),f}function n(l,p){let d=r(this.namespace+(typeof p>"u"?":":p)+l);return d.log=this.log,d}function o(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let p=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of p)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function s(l,p){let d=0,g=0,m=-1,f=0;for(;d<l.length;)if(g<p.length&&(p[g]===l[d]||p[g]==="*"))p[g]==="*"?(m=g,f=d,g++):(d++,g++);else if(m!==-1)g=m+1,f++,d=f;else return!1;for(;g<p.length&&p[g]==="*";)g++;return g===p.length}function i(){let l=[...r.names,...r.skips.map(p=>"-"+p)].join(",");return r.enable(""),l}function a(l){for(let p of r.skips)if(s(l,p))return!1;for(let p of r.names)if(s(l,p))return!0;return!1}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Dv.exports=RR});var vv=x((kt,Va)=>{kt.formatArgs=NR;kt.save=OR;kt.load=MR;kt.useColors=IR;kt.storage=BR();kt.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();kt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function IR(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function NR(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Va.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),e.splice(n,0,t)}kt.log=console.debug||console.log||(()=>{});function OR(e){try{e?kt.storage.setItem("debug",e):kt.storage.removeItem("debug")}catch{}}function MR(){let e;try{e=kt.storage.getItem("debug")||kt.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function BR(){try{return localStorage}catch{}}Va.exports=ql()(kt);var{formatters:LR}=Va.exports;LR.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var bv=x((qW,Cv)=>{"use strict";Cv.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}});var Sv=x((KW,xv)=>{"use strict";var zR=G("os"),wv=G("tty"),or=bv(),{env:et}=process,An;or("no-color")||or("no-colors")||or("color=false")||or("color=never")?An=0:(or("color")||or("colors")||or("color=true")||or("color=always"))&&(An=1);"FORCE_COLOR"in et&&(et.FORCE_COLOR==="true"?An=1:et.FORCE_COLOR==="false"?An=0:An=et.FORCE_COLOR.length===0?1:Math.min(parseInt(et.FORCE_COLOR,10),3));function Kl(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Gl(e,t){if(An===0)return 0;if(or("color=16m")||or("color=full")||or("color=truecolor"))return 3;if(or("color=256"))return 2;if(e&&!t&&An===void 0)return 0;let r=An||0;if(et.TERM==="dumb")return r;if(process.platform==="win32"){let n=zR.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in et)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in et)||et.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in et)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(et.TEAMCITY_VERSION)?1:0;if(et.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in et){let n=parseInt((et.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(et.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(et.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(et.TERM)||"COLORTERM"in et?1:r}function jR(e){let t=Gl(e,e&&e.isTTY);return Kl(t)}xv.exports={supportsColor:jR,stdout:Kl(Gl(!0,wv.isatty(1))),stderr:Kl(Gl(!0,wv.isatty(2)))}});var Pv=x((tt,qa)=>{var UR=G("tty"),Ha=G("util");tt.init=ZR;tt.log=KR;tt.formatArgs=HR;tt.save=GR;tt.load=WR;tt.useColors=VR;tt.destroy=Ha.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");tt.colors=[6,2,3,4,5,1];try{let e=Sv();e&&(e.stderr||e).level>=2&&(tt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}tt.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function VR(){return"colors"in tt.inspectOpts?!!tt.inspectOpts.colors:UR.isatty(process.stderr.fd)}function HR(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
15
+ `+h+"]"}return o.pop(),s=h,b}}});var cy=x((f7,uy)=>{var NF=iy(),OF=ay(),MF={parse:NF,stringify:OF};uy.exports=MF});var Yc=x(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.throwUnsupportedData=xn.throwUnknownDataType=xn.getType=void 0;function Ey(e){return Object.prototype.toString.call(e)}xn.getType=Ey;function cR(e){throw new TypeError("unsupported data type: "+Ey(e))}xn.throwUnknownDataType=cR;function lR(e){throw new TypeError("unsupported data type: "+e)}xn.throwUnsupportedData=lR});var rl=x(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.s_to_num=dt.int_str_to_s=dt.num_to_s=dt.big_int_to_s=dt.int_to_s=dt.s_to_big_int=dt.s_to_int=void 0;var on="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);on+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);on+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);on+=t}var ko=on.length,Xc={};for(let e=0;e<ko;e++){let t=on[e];Xc[t]=e}function el(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],s=Xc[o];s*=r,t+=s,r*=ko}return t}dt.s_to_int=el;function Py(e){let t=BigInt(0),r=BigInt(1),n=BigInt(ko);for(let o=e.length-1;o>=0;o--){let s=e[o],i=BigInt(Xc[s]);i*=r,t+=i,r*=n}return t}dt.s_to_big_int=Py;function tl(e){if(e===0)return on[0];let t=[];for(;e!==0;){let r=e%ko,n=on[r];t.push(n),e-=r,e/=ko}return t.reverse().join("")}dt.int_to_s=tl;function _y(e){let t=BigInt(0),r=BigInt(ko);if(e===t)return on[0];let n=[];for(;e!==t;){let o=e%r,s=on[Number(o)];n.push(s),e/=r}return n.reverse().join("")}dt.big_int_to_s=_y;function Ay(e){return e.split("").reverse().join("")}function Ty(e){if(e<0)return"-"+Ty(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[s,i]=t.split("e");t=s,r="0e"+i}else return tl(e);let n;r&&([r,n]=r.split("e")),t=Sa(t),r=Ay(r),r=Sa(r);let o=t+"."+r;if(n){switch(o+=".",n[0]){case"+":n=n.slice(1);break;case"-":o+="-",n=n.slice(1);break}n=Sa(n),o+=n}return o}dt.num_to_s=Ty;function Sa(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?tl(t):":"+_y(BigInt(e))}dt.int_str_to_s=Sa;function Qc(e){return e[0]===":"?Py(e.substring(1)).toString():el(e).toString()}function Fy(e){if(e[0]==="-")return-Fy(e.substr(1));let[t,r,n]=e.split(".");if(!r)return el(t);t=Qc(t),r=Qc(r),r=Ay(r);let o=t+"."+r;if(n){o+="e";let s=!1;n[0]==="-"&&(s=!0,n=n.slice(1)),n=Qc(n),o+=s?-n:+n}return+o}dt.s_to_num=Fy});var ol=x(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.decodeStr=ft.encodeStr=ft.decodeBool=ft.encodeBool=ft.decodeKey=ft.decodeNum=ft.encodeNum=void 0;var nl=rl();function pR(e){return"n|"+(0,nl.num_to_s)(e)}ft.encodeNum=pR;function dR(e){return e=e.replace("n|",""),(0,nl.s_to_num)(e)}ft.decodeNum=dR;function fR(e){return typeof e=="number"?e:(0,nl.s_to_int)(e)}ft.decodeKey=fR;function mR(e){return e?"b|T":"b|F"}ft.encodeBool=mR;function gR(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}ft.decodeBool=gR;function hR(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}ft.encodeStr=hR;function yR(e){return e[0]+e[1]==="s|"?e.substr(2):e}ft.decodeStr=yR});var il=x(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.config=void 0;Ea.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var cl=x(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.addValue=rr.makeInMemoryMemory=rr.makeInMemoryCache=rr.makeInMemoryStore=rr.memToValues=void 0;var ul=il(),sl=Yc(),al=ol(),DR=rl();function vR(e){return e.store.toArray()}rr.memToValues=vR;function Ry(){let e=[];return{forEach(t){for(let r=0;r<e.length;r++)if(t(e[r])==="break")return},add(t){e.push(t)},toArray(){return e}}}rr.makeInMemoryStore=Ry;function $y(){let e=Object.create(null),t=Object.create(null);return{getValue(r){return e[r]},getSchema(r){return t[r]},forEachValue(r){for(let[n,o]of Object.entries(e))if(r(n,o)==="break")return},forEachSchema(r){for(let[n,o]of Object.entries(t))if(r(n,o)==="break")return},setValue(r,n){e[r]=n},setSchema(r,n){t[r]=n},hasValue(r){return r in e},hasSchema(r){return r in t}}}rr.makeInMemoryCache=$y;function CR(){return{store:Ry(),cache:$y(),keyCount:0}}rr.makeInMemoryMemory=CR;function Yn(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,DR.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function bR(e,t){ul.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=Ni(e,t,void 0);return e.cache.setSchema(r,n),n}function Ni(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return Ni(e,null,r);break;case"object":if(t===null)return Yn(e,null);if(Array.isArray(t)){let n="a";for(let o=0;o<t.length;o++){let s=t[o],i=s===null?"_":Ni(e,s,t);n+="|"+i}return n==="a"&&(n="a|"),Yn(e,n)}else{let n=Object.keys(t);if(n.length===0)return Yn(e,"o|");let o="o",s=bR(e,n);o+="|"+s;for(let i of n){let a=t[i],u=Ni(e,a,t);o+="|"+u}return Yn(e,o)}case"boolean":return Yn(e,(0,al.encodeBool)(t));case"number":return Number.isNaN(t)?(ul.config.error_on_nan&&(0,sl.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(ul.config.error_on_infinite&&(0,sl.throwUnsupportedData)("[number Infinity]"),""):Yn(e,(0,al.encodeNum)(t));case"string":return Yn(e,(0,al.encodeStr)(t))}return(0,sl.throwUnknownDataType)(t)}rr.addValue=Ni});var pl=x(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.decompress=Sn.decode=Sn.compress=void 0;var wR=Yc(),Pa=ol(),ll=cl();function xR(e){let t=(0,ll.makeInMemoryMemory)(),r=(0,ll.addValue)(t,e,void 0);return[(0,ll.memToValues)(t),r]}Sn.compress=xR;function SR(e,t){if(t==="o|")return{};let r={},n=t.split("|"),o=n[1],s=Oi(e,o),i=n.length;i-2===1&&!Array.isArray(s)&&(s=[s]);for(let a=2;a<i;a++){let u=s[a-2],c=n[a];c=Oi(e,c),r[u]=c}return r}function ER(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,o=new Array(n);for(let s=0;s<n;s++){let i=r[s+1];i=Oi(e,i),o[s]=i}return o}function Oi(e,t){if(t===""||t==="_")return null;let r=(0,Pa.decodeKey)(t),n=e[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return(0,Pa.decodeBool)(n);case"o|":return SR(e,n);case"n|":return(0,Pa.decodeNum)(n);case"a|":return ER(e,n);default:return(0,Pa.decodeStr)(n)}}return(0,wR.throwUnknownDataType)(n)}Sn.decode=Oi;function PR(e){let[t,r]=e;return Oi(t,r)}Sn.decompress=PR});var Iy=x(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.trimUndefinedRecursively=Io.trimUndefined=void 0;function _R(e){for(let t in e)e[t]===void 0&&delete e[t]}Io.trimUndefined=_R;function AR(e){ky(e,new Set)}Io.trimUndefinedRecursively=AR;function ky(e,t){t.add(e);for(let r in e)if(e[r]===void 0)delete e[r];else{let n=e[r];n&&typeof n=="object"&&!t.has(n)&&ky(n,t)}}});var My=x(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.config=mt.trimUndefinedRecursively=mt.trimUndefined=mt.addValue=mt.decode=mt.decompress=mt.compress=void 0;var Ny=pl();Object.defineProperty(mt,"compress",{enumerable:!0,get:function(){return Ny.compress}});Object.defineProperty(mt,"decompress",{enumerable:!0,get:function(){return Ny.decompress}});var TR=pl();Object.defineProperty(mt,"decode",{enumerable:!0,get:function(){return TR.decode}});var FR=cl();Object.defineProperty(mt,"addValue",{enumerable:!0,get:function(){return FR.addValue}});var Oy=Iy();Object.defineProperty(mt,"trimUndefined",{enumerable:!0,get:function(){return Oy.trimUndefined}});Object.defineProperty(mt,"trimUndefinedRecursively",{enumerable:!0,get:function(){return Oy.trimUndefinedRecursively}});var RR=il();Object.defineProperty(mt,"config",{enumerable:!0,get:function(){return RR.config}})});var iD=x((JG,oD)=>{"use strict";var tD=G("child_process"),x$=tD.spawn,S$=tD.exec;oD.exports=function(e,t,r){if(typeof t=="function"&&r===void 0&&(r=t,t=void 0),e=parseInt(e),Number.isNaN(e)){if(r)return r(new Error("pid must be a number"));throw new Error("pid must be a number")}var n={},o={};switch(n[e]=[],o[e]=1,process.platform){case"win32":S$("taskkill /pid "+e+" /T /F",r);break;case"darwin":nD(e,n,o,function(){Xy(n,t,r)});break;default:rD(e,n,o,function(s){return x$("ps",["-o","pid","--no-headers","--ppid",s])},function(){Xy(n,t,r)});break}};function Xy(e,t,r){var n={};try{Object.keys(e).forEach(function(o){e[o].forEach(function(s){n[s]||(eD(s,t),n[s]=1)}),n[o]||(eD(o,t),n[o]=1)})}catch(o){if(r)return r(o);throw o}if(r)return r()}function eD(e,t){try{process.kill(parseInt(e,10),t)}catch(r){if(r.code!=="ESRCH")throw r}}function rD(e,t,r,n,o){var s=n(e),i="";s.stdout.on("data",function(c){var c=c.toString("ascii");i+=c});var a=function(u){if(delete r[e],u!=0){Object.keys(r).length==0&&o();return}i.match(/\d+/g).forEach(function(c){c=parseInt(c,10),t[e].push(c),t[c]=[],r[c]=1,rD(c,t,r,n,o)})};s.on("close",a)}function nD(e,t,r,n){try{let o="";try{o=execSync("pgrep -P "+e,{encoding:"utf8",timeout:2e3,maxBuffer:1024*1024})}catch(i){if(i.status!==1)throw i}delete r[e];let s=o.trim().split(`
16
+ `).filter(Boolean);if(s.length===0){Object.keys(r).length===0&&n();return}s.forEach(function(i){let a=parseInt(i,10);isNaN(a)||(t[e].push(a),t[a]=[],r[a]=1,nD(a,t,r,n))})}catch{delete r[e],Object.keys(r).length===0&&n()}}});var Oa=x(nr=>{"use strict";nr.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;nr.find=(e,t)=>e.nodes.find(r=>r.type===t);nr.exceedsLimit=(e,t,r=1,n)=>n===!1||!nr.isInteger(e)||!nr.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;nr.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};nr.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;nr.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;nr.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;nr.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);nr.flatten=(...e)=>{let t=[],r=n=>{for(let o=0;o<n.length;o++){let s=n[o];if(Array.isArray(s)){r(s);continue}s!==void 0&&t.push(s)}return t};return r(e),t}});var Ma=x(($W,pD)=>{"use strict";var lD=Oa();pD.exports=(e,t={})=>{let r=(n,o={})=>{let s=t.escapeInvalid&&lD.isInvalidBrace(o),i=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(s||i)&&lD.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let u of n.nodes)a+=r(u);return a};return r(e)}});var fD=x((kW,dD)=>{"use strict";dD.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var wD=x((IW,bD)=>{"use strict";var mD=fD(),Qn=(e,t,r)=>{if(mD(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(mD(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let o=String(n.relaxZeros),s=String(n.shorthand),i=String(n.capture),a=String(n.wrap),u=e+":"+t+"="+o+s+i+a;if(Qn.cache.hasOwnProperty(u))return Qn.cache[u].result;let c=Math.min(e,t),l=Math.max(e,t);if(Math.abs(c-l)===1){let f=e+"|"+t;return n.capture?`(${f})`:n.wrap===!1?f:`(?:${f})`}let p=CD(e)||CD(t),d={min:e,max:t,a:c,b:l},g=[],m=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),c<0){let f=l<0?Math.abs(l):1;m=gD(f,Math.abs(c),d,n),c=d.a=0}return l>=0&&(g=gD(c,l,d,n)),d.negatives=m,d.positives=g,d.result=F$(m,g,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&g.length+m.length>1&&(d.result=`(?:${d.result})`),Qn.cache[u]=d,d.result};function F$(e,t,r){let n=Tl(e,t,"-",!1,r)||[],o=Tl(t,e,"",!1,r)||[],s=Tl(e,t,"-?",!0,r)||[];return n.concat(s).concat(o).join("|")}function R$(e,t){let r=1,n=1,o=yD(e,r),s=new Set([t]);for(;e<=o&&o<=t;)s.add(o),r+=1,o=yD(e,r);for(o=DD(t+1,n)-1;e<o&&o<=t;)s.add(o),n+=1,o=DD(t+1,n)-1;return s=[...s],s.sort(I$),s}function $$(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=k$(e,t),o=n.length,s="",i=0;for(let a=0;a<o;a++){let[u,c]=n[a];u===c?s+=u:u!=="0"||c!=="9"?s+=N$(u,c,r):i++}return i&&(s+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[i],digits:o}}function gD(e,t,r,n){let o=R$(e,t),s=[],i=e,a;for(let u=0;u<o.length;u++){let c=o[u],l=$$(String(i),String(c),n),p="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+vD(a.count),i=c+1;continue}r.isPadded&&(p=O$(c,r,n)),l.string=p+l.pattern+vD(l.count),s.push(l),i=c+1,a=l}return s}function Tl(e,t,r,n,o){let s=[];for(let i of e){let{string:a}=i;!n&&!hD(t,"string",a)&&s.push(r+a),n&&hD(t,"string",a)&&s.push(r+a)}return s}function k$(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function I$(e,t){return e>t?1:t>e?-1:0}function hD(e,t,r){return e.some(n=>n[t]===r)}function yD(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function DD(e,t){return e-e%Math.pow(10,t)}function vD(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function N$(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function CD(e){return/^-?(0+)\d/.test(e)}function O$(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),o=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${n}}`:`0{${n}}`}}Qn.cache={};Qn.clearCache=()=>Qn.cache={};bD.exports=Qn});var $l=x((NW,TD)=>{"use strict";var M$=G("util"),SD=wD(),xD=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),L$=e=>t=>e===!0?Number(t):String(t),Fl=e=>typeof e=="number"||typeof e=="string"&&e!=="",Ui=e=>Number.isInteger(+e),Rl=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},B$=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,z$=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},Ba=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},j$=(e,t,r)=>{e.negatives.sort((a,u)=>a<u?-1:a>u?1:0),e.positives.sort((a,u)=>a<u?-1:a>u?1:0);let n=t.capture?"":"?:",o="",s="",i;return e.positives.length&&(o=e.positives.map(a=>Ba(String(a),r)).join("|")),e.negatives.length&&(s=`-(${n}${e.negatives.map(a=>Ba(String(a),r)).join("|")})`),o&&s?i=`${o}|${s}`:i=o||s,t.wrap?`(${n}${i})`:i},ED=(e,t,r,n)=>{if(r)return SD(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let s=String.fromCharCode(t);return`[${o}-${s}]`},PD=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return SD(e,t,r)},_D=(...e)=>new RangeError("Invalid range arguments: "+M$.inspect(...e)),AD=(e,t,r)=>{if(r.strictRanges===!0)throw _D([e,t]);return[]},U$=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},V$=(e,t,r=1,n={})=>{let o=Number(e),s=Number(t);if(!Number.isInteger(o)||!Number.isInteger(s)){if(n.strictRanges===!0)throw _D([e,t]);return[]}o===0&&(o=0),s===0&&(s=0);let i=o>s,a=String(e),u=String(t),c=String(r);r=Math.max(Math.abs(r),1);let l=Rl(a)||Rl(u)||Rl(c),p=l?Math.max(a.length,u.length,c.length):0,d=l===!1&&B$(e,t,n)===!1,g=n.transform||L$(d);if(n.toRegex&&r===1)return ED(Ba(e,p),Ba(t,p),!0,n);let m={negatives:[],positives:[]},f=b=>m[b<0?"negatives":"positives"].push(Math.abs(b)),h=[],y=0;for(;i?o>=s:o<=s;)n.toRegex===!0&&r>1?f(o):h.push(z$(g(o,y),p,d)),o=i?o-r:o+r,y++;return n.toRegex===!0?r>1?j$(m,n,p):PD(h,null,{wrap:!1,...n}):h},H$=(e,t,r=1,n={})=>{if(!Ui(e)&&e.length>1||!Ui(t)&&t.length>1)return AD(e,t,n);let o=n.transform||(d=>String.fromCharCode(d)),s=`${e}`.charCodeAt(0),i=`${t}`.charCodeAt(0),a=s>i,u=Math.min(s,i),c=Math.max(s,i);if(n.toRegex&&r===1)return ED(u,c,!1,n);let l=[],p=0;for(;a?s>=i:s<=i;)l.push(o(s,p)),s=a?s-r:s+r,p++;return n.toRegex===!0?PD(l,null,{wrap:!1,options:n}):l},La=(e,t,r,n={})=>{if(t==null&&Fl(e))return[e];if(!Fl(e)||!Fl(t))return AD(e,t,n);if(typeof r=="function")return La(e,t,1,{transform:r});if(xD(r))return La(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,Ui(r)?Ui(e)&&Ui(t)?V$(e,t,r,o):H$(e,t,Math.max(Math.abs(r),1),o):r!=null&&!xD(r)?U$(r,o):La(e,t,1,r)};TD.exports=La});var $D=x((OW,RD)=>{"use strict";var q$=$l(),FD=Oa(),K$=(e,t={})=>{let r=(n,o={})=>{let s=FD.isInvalidBrace(o),i=n.invalid===!0&&t.escapeInvalid===!0,a=s===!0||i===!0,u=t.escapeInvalid===!0?"\\":"",c="";if(n.isOpen===!0)return u+n.value;if(n.isClose===!0)return console.log("node.isClose",u,n.value),u+n.value;if(n.type==="open")return a?u+n.value:"(";if(n.type==="close")return a?u+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=FD.reduce(n.nodes),p=q$(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return l.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let l of n.nodes)c+=r(l,n);return c};return r(e)};RD.exports=K$});var ND=x((MW,ID)=>{"use strict";var G$=$l(),kD=Ma(),Oo=Oa(),Xn=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Oo.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let s of o)n.push(Xn(s,t,r));else for(let s of t)r===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?Xn(o,s,r):o+s);return Oo.flatten(n)},W$=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(o,s={})=>{o.queue=[];let i=s,a=s.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,a=i.queue;if(o.invalid||o.dollar){a.push(Xn(a.pop(),kD(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(Xn(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let p=Oo.reduce(o.nodes);if(Oo.exceedsLimit(...p,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=G$(...p,t);d.length===0&&(d=kD(o,t)),a.push(Xn(a.pop(),d)),o.nodes=[];return}let u=Oo.encloseBrace(o),c=o.queue,l=o;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,c=l.queue;for(let p=0;p<o.nodes.length;p++){let d=o.nodes[p];if(d.type==="comma"&&o.type==="brace"){p===1&&c.push(""),c.push("");continue}if(d.type==="close"){a.push(Xn(a.pop(),c,u));continue}if(d.value&&d.type!=="open"){c.push(Xn(c.pop(),d.value));continue}d.nodes&&n(d,o)}return c};return Oo.flatten(n(e))};ID.exports=W$});var MD=x((LW,OD)=>{"use strict";OD.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
17
+ `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var UD=x((BW,jD)=>{"use strict";var Z$=Ma(),{MAX_LENGTH:LD,CHAR_BACKSLASH:kl,CHAR_BACKTICK:J$,CHAR_COMMA:Y$,CHAR_DOT:Q$,CHAR_LEFT_PARENTHESES:X$,CHAR_RIGHT_PARENTHESES:ek,CHAR_LEFT_CURLY_BRACE:tk,CHAR_RIGHT_CURLY_BRACE:rk,CHAR_LEFT_SQUARE_BRACKET:BD,CHAR_RIGHT_SQUARE_BRACKET:zD,CHAR_DOUBLE_QUOTE:nk,CHAR_SINGLE_QUOTE:ok,CHAR_NO_BREAK_SPACE:ik,CHAR_ZERO_WIDTH_NOBREAK_SPACE:sk}=MD(),ak=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(LD,r.maxLength):LD;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let o={type:"root",input:e,nodes:[]},s=[o],i=o,a=o,u=0,c=e.length,l=0,p=0,d,g=()=>e[l++],m=f=>{if(f.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&f.type==="text"){a.value+=f.value;return}return i.nodes.push(f),f.parent=i,f.prev=a,a=f,f};for(m({type:"bos"});l<c;)if(i=s[s.length-1],d=g(),!(d===sk||d===ik)){if(d===kl){m({type:"text",value:(t.keepEscaping?d:"")+g()});continue}if(d===zD){m({type:"text",value:"\\"+d});continue}if(d===BD){u++;let f;for(;l<c&&(f=g());){if(d+=f,f===BD){u++;continue}if(f===kl){d+=g();continue}if(f===zD&&(u--,u===0))break}m({type:"text",value:d});continue}if(d===X$){i=m({type:"paren",nodes:[]}),s.push(i),m({type:"text",value:d});continue}if(d===ek){if(i.type!=="paren"){m({type:"text",value:d});continue}i=s.pop(),m({type:"text",value:d}),i=s[s.length-1];continue}if(d===nk||d===ok||d===J$){let f=d,h;for(t.keepQuotes!==!0&&(d="");l<c&&(h=g());){if(h===kl){d+=h+g();continue}if(h===f){t.keepQuotes===!0&&(d+=h);break}d+=h}m({type:"text",value:d});continue}if(d===tk){p++;let h={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||i.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};i=m(h),s.push(i),m({type:"open",value:d});continue}if(d===rk){if(i.type!=="brace"){m({type:"text",value:d});continue}let f="close";i=s.pop(),i.close=!0,m({type:f,value:d}),p--,i=s[s.length-1];continue}if(d===Y$&&p>0){if(i.ranges>0){i.ranges=0;let f=i.nodes.shift();i.nodes=[f,{type:"text",value:Z$(i)}]}m({type:"comma",value:d}),i.commas++;continue}if(d===Q$&&p>0&&i.commas===0){let f=i.nodes;if(p===0||f.length===0){m({type:"text",value:d});continue}if(a.type==="dot"){if(i.range=[],a.value+=d,a.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,a.type="text";continue}i.ranges++,i.args=[];continue}if(a.type==="range"){f.pop();let h=f[f.length-1];h.value+=a.value+d,a=h,i.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d})}do if(i=s.pop(),i.type!=="root"){i.nodes.forEach(y=>{y.nodes||(y.type==="open"&&(y.isOpen=!0),y.type==="close"&&(y.isClose=!0),y.nodes||(y.type="text"),y.invalid=!0)});let f=s[s.length-1],h=f.nodes.indexOf(i);f.nodes.splice(h,1,...i.nodes)}while(s.length>0);return m({type:"eos"}),o};jD.exports=ak});var qD=x((zW,HD)=>{"use strict";var VD=Ma(),uk=$D(),ck=ND(),lk=UD(),qt=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=qt.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(qt.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};qt.parse=(e,t={})=>lk(e,t);qt.stringify=(e,t={})=>VD(typeof e=="string"?qt.parse(e,t):e,t);qt.compile=(e,t={})=>(typeof e=="string"&&(e=qt.parse(e,t)),uk(e,t));qt.expand=(e,t={})=>{typeof e=="string"&&(e=qt.parse(e,t));let r=ck(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};qt.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?qt.compile(e,t):qt.expand(e,t);HD.exports=qt});var Vi=x((jW,JD)=>{"use strict";var pk=G("path"),Ur="\\\\/",KD=`[^${Ur}]`,un="\\.",dk="\\+",fk="\\?",za="\\/",mk="(?=.)",GD="[^/]",Il=`(?:${za}|$)`,WD=`(?:^|${za})`,Nl=`${un}{1,2}${Il}`,gk=`(?!${un})`,hk=`(?!${WD}${Nl})`,yk=`(?!${un}{0,1}${Il})`,Dk=`(?!${Nl})`,vk=`[^.${za}]`,Ck=`${GD}*?`,ZD={DOT_LITERAL:un,PLUS_LITERAL:dk,QMARK_LITERAL:fk,SLASH_LITERAL:za,ONE_CHAR:mk,QMARK:GD,END_ANCHOR:Il,DOTS_SLASH:Nl,NO_DOT:gk,NO_DOTS:hk,NO_DOT_SLASH:yk,NO_DOTS_SLASH:Dk,QMARK_NO_DOT:vk,STAR:Ck,START_ANCHOR:WD},bk={...ZD,SLASH_LITERAL:`[${Ur}]`,QMARK:KD,STAR:`${KD}*?`,DOTS_SLASH:`${un}{1,2}(?:[${Ur}]|$)`,NO_DOT:`(?!${un})`,NO_DOTS:`(?!(?:^|[${Ur}])${un}{1,2}(?:[${Ur}]|$))`,NO_DOT_SLASH:`(?!${un}{0,1}(?:[${Ur}]|$))`,NO_DOTS_SLASH:`(?!${un}{1,2}(?:[${Ur}]|$))`,QMARK_NO_DOT:`[^.${Ur}]`,START_ANCHOR:`(?:^|[${Ur}])`,END_ANCHOR:`(?:[${Ur}]|$)`},wk={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};JD.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:wk,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:pk.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?bk:ZD}}});var Hi=x($t=>{"use strict";var xk=G("path"),Sk=process.platform==="win32",{REGEX_BACKSLASH:Ek,REGEX_REMOVE_BACKSLASH:Pk,REGEX_SPECIAL_CHARS:_k,REGEX_SPECIAL_CHARS_GLOBAL:Ak}=Vi();$t.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);$t.hasRegexChars=e=>_k.test(e);$t.isRegexChar=e=>e.length===1&&$t.hasRegexChars(e);$t.escapeRegex=e=>e.replace(Ak,"\\$1");$t.toPosixSlashes=e=>e.replace(Ek,"/");$t.removeBackslashes=e=>e.replace(Pk,t=>t==="\\"?"":t);$t.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};$t.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Sk===!0||xk.sep==="\\";$t.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?$t.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};$t.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};$t.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${e})${o}`;return t.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var ov=x((VW,nv)=>{"use strict";var YD=Hi(),{CHAR_ASTERISK:Ol,CHAR_AT:Tk,CHAR_BACKWARD_SLASH:qi,CHAR_COMMA:Fk,CHAR_DOT:Ml,CHAR_EXCLAMATION_MARK:Ll,CHAR_FORWARD_SLASH:rv,CHAR_LEFT_CURLY_BRACE:Bl,CHAR_LEFT_PARENTHESES:zl,CHAR_LEFT_SQUARE_BRACKET:Rk,CHAR_PLUS:$k,CHAR_QUESTION_MARK:QD,CHAR_RIGHT_CURLY_BRACE:kk,CHAR_RIGHT_PARENTHESES:XD,CHAR_RIGHT_SQUARE_BRACKET:Ik}=Vi(),ev=e=>e===rv||e===qi,tv=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},Nk=(e,t)=>{let r=t||{},n=e.length-1,o=r.parts===!0||r.scanToEnd===!0,s=[],i=[],a=[],u=e,c=-1,l=0,p=0,d=!1,g=!1,m=!1,f=!1,h=!1,y=!1,b=!1,C=!1,_=!1,S=!1,F=0,$,I,k={value:"",depth:0,isGlob:!1},R=()=>c>=n,D=()=>u.charCodeAt(c+1),L=()=>($=I,u.charCodeAt(++c));for(;c<n;){I=L();let Be;if(I===qi){b=k.backslashes=!0,I=L(),I===Bl&&(y=!0);continue}if(y===!0||I===Bl){for(F++;R()!==!0&&(I=L());){if(I===qi){b=k.backslashes=!0,L();continue}if(I===Bl){F++;continue}if(y!==!0&&I===Ml&&(I=L())===Ml){if(d=k.isBrace=!0,m=k.isGlob=!0,S=!0,o===!0)continue;break}if(y!==!0&&I===Fk){if(d=k.isBrace=!0,m=k.isGlob=!0,S=!0,o===!0)continue;break}if(I===kk&&(F--,F===0)){y=!1,d=k.isBrace=!0,S=!0;break}}if(o===!0)continue;break}if(I===rv){if(s.push(c),i.push(k),k={value:"",depth:0,isGlob:!1},S===!0)continue;if($===Ml&&c===l+1){l+=2;continue}p=c+1;continue}if(r.noext!==!0&&(I===$k||I===Tk||I===Ol||I===QD||I===Ll)===!0&&D()===zl){if(m=k.isGlob=!0,f=k.isExtglob=!0,S=!0,I===Ll&&c===l&&(_=!0),o===!0){for(;R()!==!0&&(I=L());){if(I===qi){b=k.backslashes=!0,I=L();continue}if(I===XD){m=k.isGlob=!0,S=!0;break}}continue}break}if(I===Ol){if($===Ol&&(h=k.isGlobstar=!0),m=k.isGlob=!0,S=!0,o===!0)continue;break}if(I===QD){if(m=k.isGlob=!0,S=!0,o===!0)continue;break}if(I===Rk){for(;R()!==!0&&(Be=L());){if(Be===qi){b=k.backslashes=!0,L();continue}if(Be===Ik){g=k.isBracket=!0,m=k.isGlob=!0,S=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&I===Ll&&c===l){C=k.negated=!0,l++;continue}if(r.noparen!==!0&&I===zl){if(m=k.isGlob=!0,o===!0){for(;R()!==!0&&(I=L());){if(I===zl){b=k.backslashes=!0,I=L();continue}if(I===XD){S=!0;break}}continue}break}if(m===!0){if(S=!0,o===!0)continue;break}}r.noext===!0&&(f=!1,m=!1);let U=u,H="",w="";l>0&&(H=u.slice(0,l),u=u.slice(l),p-=l),U&&m===!0&&p>0?(U=u.slice(0,p),w=u.slice(p)):m===!0?(U="",w=u):U=u,U&&U!==""&&U!=="/"&&U!==u&&ev(U.charCodeAt(U.length-1))&&(U=U.slice(0,-1)),r.unescape===!0&&(w&&(w=YD.removeBackslashes(w)),U&&b===!0&&(U=YD.removeBackslashes(U)));let E={prefix:H,input:e,start:l,base:U,glob:w,isBrace:d,isBracket:g,isGlob:m,isExtglob:f,isGlobstar:h,negated:C,negatedExtglob:_};if(r.tokens===!0&&(E.maxDepth=0,ev(I)||i.push(k),E.tokens=i),r.parts===!0||r.tokens===!0){let Be;for(let de=0;de<s.length;de++){let Pr=Be?Be+1:l,_r=s[de],jt=e.slice(Pr,_r);r.tokens&&(de===0&&l!==0?(i[de].isPrefix=!0,i[de].value=H):i[de].value=jt,tv(i[de]),E.maxDepth+=i[de].depth),(de!==0||jt!=="")&&a.push(jt),Be=_r}if(Be&&Be+1<e.length){let de=e.slice(Be+1);a.push(de),r.tokens&&(i[i.length-1].value=de,tv(i[i.length-1]),E.maxDepth+=i[i.length-1].depth)}E.slashes=s,E.parts=a}return E};nv.exports=Nk});var av=x((HW,sv)=>{"use strict";var ja=Vi(),Kt=Hi(),{MAX_LENGTH:Ua,POSIX_REGEX_SOURCE:Ok,REGEX_NON_SPECIAL_CHARS:Mk,REGEX_SPECIAL_CHARS_BACKREF:Lk,REPLACEMENTS:iv}=ja,Bk=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch{return e.map(o=>Kt.escapeRegex(o)).join("..")}return r},Mo=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,jl=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=iv[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(Ua,r.maxLength):Ua,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},i=[s],a=r.capture?"":"?:",u=Kt.isWindows(t),c=ja.globChars(u),l=ja.extglobChars(c),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:f,NO_DOT:h,NO_DOT_SLASH:y,NO_DOTS_SLASH:b,QMARK:C,QMARK_NO_DOT:_,STAR:S,START_ANCHOR:F}=c,$=M=>`(${a}(?:(?!${F}${M.dot?f:p}).)*?)`,I=r.dot?"":h,k=r.dot?C:_,R=r.bash===!0?$(r):S;r.capture&&(R=`(${R})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let D={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};e=Kt.removePrefix(e,D),o=e.length;let L=[],U=[],H=[],w=s,E,Be=()=>D.index===o-1,de=D.peek=(M=1)=>e[D.index+M],Pr=D.advance=()=>e[++D.index]||"",_r=()=>e.slice(D.index+1),jt=(M="",_e=0)=>{D.consumed+=M,D.index+=_e},Gs=M=>{D.output+=M.output!=null?M.output:M.value,jt(M.value)},JP=()=>{let M=1;for(;de()==="!"&&(de(2)!=="("||de(3)==="?");)Pr(),D.start++,M++;return M%2===0?!1:(D.negated=!0,D.start++,!0)},Ws=M=>{D[M]++,H.push(M)},Bn=M=>{D[M]--,H.pop()},re=M=>{if(w.type==="globstar"){let _e=D.braces>0&&(M.type==="comma"||M.type==="brace"),N=M.extglob===!0||L.length&&(M.type==="pipe"||M.type==="paren");M.type!=="slash"&&M.type!=="paren"&&!_e&&!N&&(D.output=D.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=R,D.output+=w.output)}if(L.length&&M.type!=="paren"&&(L[L.length-1].inner+=M.value),(M.value||M.output)&&Gs(M),w&&w.type==="text"&&M.type==="text"){w.value+=M.value,w.output=(w.output||"")+M.value;return}M.prev=w,i.push(M),w=M},Zs=(M,_e)=>{let N={...l[_e],conditions:1,inner:""};N.prev=w,N.parens=D.parens,N.output=D.output;let X=(r.capture?"(":"")+N.open;Ws("parens"),re({type:M,value:_e,output:D.output?"":m}),re({type:"paren",extglob:!0,value:Pr(),output:X}),L.push(N)},YP=M=>{let _e=M.close+(r.capture?")":""),N;if(M.type==="negate"){let X=R;if(M.inner&&M.inner.length>1&&M.inner.includes("/")&&(X=$(r)),(X!==R||Be()||/^\)+$/.test(_r()))&&(_e=M.close=`)$))${X}`),M.inner.includes("*")&&(N=_r())&&/^\.[^\\/.]+$/.test(N)){let ze=jl(N,{...t,fastpaths:!1}).output;_e=M.close=`)${ze})${X})`}M.prev.type==="bos"&&(D.negatedExtglob=!0)}re({type:"paren",extglob:!0,value:E,output:_e}),Bn("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let M=!1,_e=e.replace(Lk,(N,X,ze,Ct,We,oc)=>Ct==="\\"?(M=!0,N):Ct==="?"?X?X+Ct+(We?C.repeat(We.length):""):oc===0?k+(We?C.repeat(We.length):""):C.repeat(ze.length):Ct==="."?p.repeat(ze.length):Ct==="*"?X?X+Ct+(We?R:""):R:X?N:`\\${N}`);return M===!0&&(r.unescape===!0?_e=_e.replace(/\\/g,""):_e=_e.replace(/\\+/g,N=>N.length%2===0?"\\\\":N?"\\":"")),_e===e&&r.contains===!0?(D.output=e,D):(D.output=Kt.wrapOutput(_e,D,t),D)}for(;!Be();){if(E=Pr(),E==="\0")continue;if(E==="\\"){let N=de();if(N==="/"&&r.bash!==!0||N==="."||N===";")continue;if(!N){E+="\\",re({type:"text",value:E});continue}let X=/^\\+/.exec(_r()),ze=0;if(X&&X[0].length>2&&(ze=X[0].length,D.index+=ze,ze%2!==0&&(E+="\\")),r.unescape===!0?E=Pr():E+=Pr(),D.brackets===0){re({type:"text",value:E});continue}}if(D.brackets>0&&(E!=="]"||w.value==="["||w.value==="[^")){if(r.posix!==!1&&E===":"){let N=w.value.slice(1);if(N.includes("[")&&(w.posix=!0,N.includes(":"))){let X=w.value.lastIndexOf("["),ze=w.value.slice(0,X),Ct=w.value.slice(X+2),We=Ok[Ct];if(We){w.value=ze+We,D.backtrack=!0,Pr(),!s.output&&i.indexOf(w)===1&&(s.output=m);continue}}}(E==="["&&de()!==":"||E==="-"&&de()==="]")&&(E=`\\${E}`),E==="]"&&(w.value==="["||w.value==="[^")&&(E=`\\${E}`),r.posix===!0&&E==="!"&&w.value==="["&&(E="^"),w.value+=E,Gs({value:E});continue}if(D.quotes===1&&E!=='"'){E=Kt.escapeRegex(E),w.value+=E,Gs({value:E});continue}if(E==='"'){D.quotes=D.quotes===1?0:1,r.keepQuotes===!0&&re({type:"text",value:E});continue}if(E==="("){Ws("parens"),re({type:"paren",value:E});continue}if(E===")"){if(D.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Mo("opening","("));let N=L[L.length-1];if(N&&D.parens===N.parens+1){YP(L.pop());continue}re({type:"paren",value:E,output:D.parens?")":"\\)"}),Bn("parens");continue}if(E==="["){if(r.nobracket===!0||!_r().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Mo("closing","]"));E=`\\${E}`}else Ws("brackets");re({type:"bracket",value:E});continue}if(E==="]"){if(r.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){re({type:"text",value:E,output:`\\${E}`});continue}if(D.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Mo("opening","["));re({type:"text",value:E,output:`\\${E}`});continue}Bn("brackets");let N=w.value.slice(1);if(w.posix!==!0&&N[0]==="^"&&!N.includes("/")&&(E=`/${E}`),w.value+=E,Gs({value:E}),r.literalBrackets===!1||Kt.hasRegexChars(N))continue;let X=Kt.escapeRegex(w.value);if(D.output=D.output.slice(0,-w.value.length),r.literalBrackets===!0){D.output+=X,w.value=X;continue}w.value=`(${a}${X}|${w.value})`,D.output+=w.value;continue}if(E==="{"&&r.nobrace!==!0){Ws("braces");let N={type:"brace",value:E,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};U.push(N),re(N);continue}if(E==="}"){let N=U[U.length-1];if(r.nobrace===!0||!N){re({type:"text",value:E,output:E});continue}let X=")";if(N.dots===!0){let ze=i.slice(),Ct=[];for(let We=ze.length-1;We>=0&&(i.pop(),ze[We].type!=="brace");We--)ze[We].type!=="dots"&&Ct.unshift(ze[We].value);X=Bk(Ct,r),D.backtrack=!0}if(N.comma!==!0&&N.dots!==!0){let ze=D.output.slice(0,N.outputIndex),Ct=D.tokens.slice(N.tokensIndex);N.value=N.output="\\{",E=X="\\}",D.output=ze;for(let We of Ct)D.output+=We.output||We.value}re({type:"brace",value:E,output:X}),Bn("braces"),U.pop();continue}if(E==="|"){L.length>0&&L[L.length-1].conditions++,re({type:"text",value:E});continue}if(E===","){let N=E,X=U[U.length-1];X&&H[H.length-1]==="braces"&&(X.comma=!0,N="|"),re({type:"comma",value:E,output:N});continue}if(E==="/"){if(w.type==="dot"&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",i.pop(),w=s;continue}re({type:"slash",value:E,output:g});continue}if(E==="."){if(D.braces>0&&w.type==="dot"){w.value==="."&&(w.output=p);let N=U[U.length-1];w.type="dots",w.output+=E,w.value+=E,N.dots=!0;continue}if(D.braces+D.parens===0&&w.type!=="bos"&&w.type!=="slash"){re({type:"text",value:E,output:p});continue}re({type:"dot",value:E,output:p});continue}if(E==="?"){if(!(w&&w.value==="(")&&r.noextglob!==!0&&de()==="("&&de(2)!=="?"){Zs("qmark",E);continue}if(w&&w.type==="paren"){let X=de(),ze=E;if(X==="<"&&!Kt.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(w.value==="("&&!/[!=<:]/.test(X)||X==="<"&&!/<([!=]|\w+>)/.test(_r()))&&(ze=`\\${E}`),re({type:"text",value:E,output:ze});continue}if(r.dot!==!0&&(w.type==="slash"||w.type==="bos")){re({type:"qmark",value:E,output:_});continue}re({type:"qmark",value:E,output:C});continue}if(E==="!"){if(r.noextglob!==!0&&de()==="("&&(de(2)!=="?"||!/[!=<:]/.test(de(3)))){Zs("negate",E);continue}if(r.nonegate!==!0&&D.index===0){JP();continue}}if(E==="+"){if(r.noextglob!==!0&&de()==="("&&de(2)!=="?"){Zs("plus",E);continue}if(w&&w.value==="("||r.regex===!1){re({type:"plus",value:E,output:d});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||D.parens>0){re({type:"plus",value:E});continue}re({type:"plus",value:d});continue}if(E==="@"){if(r.noextglob!==!0&&de()==="("&&de(2)!=="?"){re({type:"at",extglob:!0,value:E,output:""});continue}re({type:"text",value:E});continue}if(E!=="*"){(E==="$"||E==="^")&&(E=`\\${E}`);let N=Mk.exec(_r());N&&(E+=N[0],D.index+=N[0].length),re({type:"text",value:E});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=E,w.output=R,D.backtrack=!0,D.globstar=!0,jt(E);continue}let M=_r();if(r.noextglob!==!0&&/^\([^?]/.test(M)){Zs("star",E);continue}if(w.type==="star"){if(r.noglobstar===!0){jt(E);continue}let N=w.prev,X=N.prev,ze=N.type==="slash"||N.type==="bos",Ct=X&&(X.type==="star"||X.type==="globstar");if(r.bash===!0&&(!ze||M[0]&&M[0]!=="/")){re({type:"star",value:E,output:""});continue}let We=D.braces>0&&(N.type==="comma"||N.type==="brace"),oc=L.length&&(N.type==="pipe"||N.type==="paren");if(!ze&&N.type!=="paren"&&!We&&!oc){re({type:"star",value:E,output:""});continue}for(;M.slice(0,3)==="/**";){let Js=e[D.index+4];if(Js&&Js!=="/")break;M=M.slice(3),jt("/**",3)}if(N.type==="bos"&&Be()){w.type="globstar",w.value+=E,w.output=$(r),D.output=w.output,D.globstar=!0,jt(E);continue}if(N.type==="slash"&&N.prev.type!=="bos"&&!Ct&&Be()){D.output=D.output.slice(0,-(N.output+w.output).length),N.output=`(?:${N.output}`,w.type="globstar",w.output=$(r)+(r.strictSlashes?")":"|$)"),w.value+=E,D.globstar=!0,D.output+=N.output+w.output,jt(E);continue}if(N.type==="slash"&&N.prev.type!=="bos"&&M[0]==="/"){let Js=M[1]!==void 0?"|$":"";D.output=D.output.slice(0,-(N.output+w.output).length),N.output=`(?:${N.output}`,w.type="globstar",w.output=`${$(r)}${g}|${g}${Js})`,w.value+=E,D.output+=N.output+w.output,D.globstar=!0,jt(E+Pr()),re({type:"slash",value:"/",output:""});continue}if(N.type==="bos"&&M[0]==="/"){w.type="globstar",w.value+=E,w.output=`(?:^|${g}|${$(r)}${g})`,D.output=w.output,D.globstar=!0,jt(E+Pr()),re({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-w.output.length),w.type="globstar",w.output=$(r),w.value+=E,D.output+=w.output,D.globstar=!0,jt(E);continue}let _e={type:"star",value:E,output:R};if(r.bash===!0){_e.output=".*?",(w.type==="bos"||w.type==="slash")&&(_e.output=I+_e.output),re(_e);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&r.regex===!0){_e.output=E,re(_e);continue}(D.index===D.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?(D.output+=y,w.output+=y):r.dot===!0?(D.output+=b,w.output+=b):(D.output+=I,w.output+=I),de()!=="*"&&(D.output+=m,w.output+=m)),re(_e)}for(;D.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Mo("closing","]"));D.output=Kt.escapeLast(D.output,"["),Bn("brackets")}for(;D.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Mo("closing",")"));D.output=Kt.escapeLast(D.output,"("),Bn("parens")}for(;D.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Mo("closing","}"));D.output=Kt.escapeLast(D.output,"{"),Bn("braces")}if(r.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&re({type:"maybe_slash",value:"",output:`${g}?`}),D.backtrack===!0){D.output="";for(let M of D.tokens)D.output+=M.output!=null?M.output:M.value,M.suffix&&(D.output+=M.suffix)}return D};jl.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(Ua,r.maxLength):Ua,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=iv[e]||e;let s=Kt.isWindows(t),{DOT_LITERAL:i,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:g,START_ANCHOR:m}=ja.globChars(s),f=r.dot?p:l,h=r.dot?d:l,y=r.capture?"":"?:",b={negated:!1,prefix:""},C=r.bash===!0?".*?":g;r.capture&&(C=`(${C})`);let _=I=>I.noglobstar===!0?C:`(${y}(?:(?!${m}${I.dot?c:i}).)*?)`,S=I=>{switch(I){case"*":return`${f}${u}${C}`;case".*":return`${i}${u}${C}`;case"*.*":return`${f}${C}${i}${u}${C}`;case"*/*":return`${f}${C}${a}${u}${h}${C}`;case"**":return f+_(r);case"**/*":return`(?:${f}${_(r)}${a})?${h}${u}${C}`;case"**/*.*":return`(?:${f}${_(r)}${a})?${h}${C}${i}${u}${C}`;case"**/.*":return`(?:${f}${_(r)}${a})?${i}${u}${C}`;default:{let k=/^(.*?)\.(\w+)$/.exec(I);if(!k)return;let R=S(k[1]);return R?R+i+k[2]:void 0}}},F=Kt.removePrefix(e,b),$=S(F);return $&&r.strictSlashes!==!0&&($+=`${a}?`),$};sv.exports=jl});var cv=x((qW,uv)=>{"use strict";var zk=G("path"),jk=ov(),Ul=av(),Vl=Hi(),Uk=Vi(),Vk=e=>e&&typeof e=="object"&&!Array.isArray(e),qe=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map(d=>qe(d,t,r));return d=>{for(let g of l){let m=g(d);if(m)return m}return!1}}let n=Vk(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=t||{},s=Vl.isWindows(t),i=n?qe.compileRe(e,t):qe.makeRe(e,t,!1,!0),a=i.state;delete i.state;let u=()=>!1;if(o.ignore){let l={...t,ignore:null,onMatch:null,onResult:null};u=qe(o.ignore,l,r)}let c=(l,p=!1)=>{let{isMatch:d,match:g,output:m}=qe.test(l,i,t,{glob:e,posix:s}),f={glob:e,state:a,regex:i,posix:s,input:l,output:m,match:g,isMatch:d};return typeof o.onResult=="function"&&o.onResult(f),d===!1?(f.isMatch=!1,p?f:!1):u(l)?(typeof o.onIgnore=="function"&&o.onIgnore(f),f.isMatch=!1,p?f:!1):(typeof o.onMatch=="function"&&o.onMatch(f),p?f:!0)};return r&&(c.state=a),c};qe.test=(e,t,r,{glob:n,posix:o}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let s=r||{},i=s.format||(o?Vl.toPosixSlashes:null),a=e===n,u=a&&i?i(e):e;return a===!1&&(u=i?i(e):e,a=u===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=qe.matchBase(e,t,r,o):a=t.exec(u)),{isMatch:!!a,match:a,output:u}};qe.matchBase=(e,t,r,n=Vl.isWindows(r))=>(t instanceof RegExp?t:qe.makeRe(t,r)).test(zk.basename(e));qe.isMatch=(e,t,r)=>qe(t,r)(e);qe.parse=(e,t)=>Array.isArray(e)?e.map(r=>qe.parse(r,t)):Ul(e,{...t,fastpaths:!1});qe.scan=(e,t)=>jk(e,t);qe.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let o=t||{},s=o.contains?"":"^",i=o.contains?"":"$",a=`${s}(?:${e.output})${i}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);let u=qe.toRegex(a,t);return n===!0&&(u.state=e),u};qe.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(o.output=Ul.fastpaths(e,t)),o.output||(o=Ul(e,t)),qe.compileRe(o,t,r,n)};qe.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};qe.constants=Uk;uv.exports=qe});var pv=x((KW,lv)=>{"use strict";lv.exports=cv()});var ql=x((GW,hv)=>{"use strict";var fv=G("util"),mv=qD(),Vr=pv(),Hl=Hi(),dv=e=>e===""||e==="./",gv=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},Fe=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,o=new Set,s=new Set,i=0,a=l=>{s.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<t.length;l++){let p=Vr(String(t[l]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&i++;for(let g of e){let m=p(g,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),o.add(m.output)))}}let c=(i===t.length?[...s]:[...o]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(l=>l.replace(/\\/g,"")):t}return c};Fe.match=Fe;Fe.matcher=(e,t)=>Vr(e,t);Fe.isMatch=(e,t,r)=>Vr(t,r)(e);Fe.any=Fe.isMatch;Fe.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,o=[],s=a=>{r.onResult&&r.onResult(a),o.push(a.output)},i=new Set(Fe(e,t,{...r,onResult:s}));for(let a of o)i.has(a)||n.add(a);return[...n]};Fe.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${fv.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>Fe.contains(e,n,r));if(typeof t=="string"){if(dv(e)||dv(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return Fe.isMatch(e,t,{...r,contains:!0})};Fe.matchKeys=(e,t,r)=>{if(!Hl.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=Fe(Object.keys(e),t,r),o={};for(let s of n)o[s]=e[s];return o};Fe.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let s=Vr(String(o),r);if(n.some(i=>s(i)))return!0}return!1};Fe.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let s=Vr(String(o),r);if(!n.every(i=>s(i)))return!1}return!0};Fe.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${fv.inspect(e)}"`);return[].concat(t).every(n=>Vr(n,r)(e))};Fe.capture=(e,t,r)=>{let n=Hl.isWindows(r),s=Vr.makeRe(String(e),{...r,capture:!0}).exec(n?Hl.toPosixSlashes(t):t);if(s)return s.slice(1).map(i=>i===void 0?"":i)};Fe.makeRe=(...e)=>Vr.makeRe(...e);Fe.scan=(...e)=>Vr.scan(...e);Fe.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of mv(String(n),t))r.push(Vr.parse(o,t));return r};Fe.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!gv(e)?[e]:mv(e,t)};Fe.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return Fe.braces(e,{...t,expand:!0})};Fe.hasBraces=gv;hv.exports=Fe});var Dv=x((uZ,yv)=>{var Lo=1e3,Bo=Lo*60,zo=Bo*60,eo=zo*24,Gk=eo*7,Wk=eo*365.25;yv.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Zk(e);if(r==="number"&&isFinite(e))return t.long?Yk(e):Jk(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Zk(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Wk;case"weeks":case"week":case"w":return r*Gk;case"days":case"day":case"d":return r*eo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*zo;case"minutes":case"minute":case"mins":case"min":case"m":return r*Bo;case"seconds":case"second":case"secs":case"sec":case"s":return r*Lo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Jk(e){var t=Math.abs(e);return t>=eo?Math.round(e/eo)+"d":t>=zo?Math.round(e/zo)+"h":t>=Bo?Math.round(e/Bo)+"m":t>=Lo?Math.round(e/Lo)+"s":e+"ms"}function Yk(e){var t=Math.abs(e);return t>=eo?Va(e,t,eo,"day"):t>=zo?Va(e,t,zo,"hour"):t>=Bo?Va(e,t,Bo,"minute"):t>=Lo?Va(e,t,Lo,"second"):e+" ms"}function Va(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}});var Kl=x((cZ,vv)=>{function Qk(e){r.debug=r,r.default=r,r.coerce=u,r.disable=i,r.enable=o,r.enabled=a,r.humanize=Dv(),r.destroy=c,Object.keys(e).forEach(l=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let p=0;for(let d=0;d<l.length;d++)p=(p<<5)-p+l.charCodeAt(d),p|=0;return r.colors[Math.abs(p)%r.colors.length]}r.selectColor=t;function r(l){let p,d=null,g,m;function f(...h){if(!f.enabled)return;let y=f,b=Number(new Date),C=b-(p||b);y.diff=C,y.prev=p,y.curr=b,p=b,h[0]=r.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let _=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(F,$)=>{if(F==="%%")return"%";_++;let I=r.formatters[$];if(typeof I=="function"){let k=h[_];F=I.call(y,k),h.splice(_,1),_--}return F}),r.formatArgs.call(y,h),(y.log||r.log).apply(y,h)}return f.namespace=l,f.useColors=r.useColors(),f.color=r.selectColor(l),f.extend=n,f.destroy=r.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(g!==r.namespaces&&(g=r.namespaces,m=r.enabled(l)),m),set:h=>{d=h}}),typeof r.init=="function"&&r.init(f),f}function n(l,p){let d=r(this.namespace+(typeof p>"u"?":":p)+l);return d.log=this.log,d}function o(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let p=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of p)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function s(l,p){let d=0,g=0,m=-1,f=0;for(;d<l.length;)if(g<p.length&&(p[g]===l[d]||p[g]==="*"))p[g]==="*"?(m=g,f=d,g++):(d++,g++);else if(m!==-1)g=m+1,f++,d=f;else return!1;for(;g<p.length&&p[g]==="*";)g++;return g===p.length}function i(){let l=[...r.names,...r.skips.map(p=>"-"+p)].join(",");return r.enable(""),l}function a(l){for(let p of r.skips)if(s(l,p))return!1;for(let p of r.names)if(s(l,p))return!0;return!1}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}vv.exports=Qk});var Cv=x((kt,Ha)=>{kt.formatArgs=eI;kt.save=tI;kt.load=rI;kt.useColors=Xk;kt.storage=nI();kt.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();kt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Xk(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function eI(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Ha.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),e.splice(n,0,t)}kt.log=console.debug||console.log||(()=>{});function tI(e){try{e?kt.storage.setItem("debug",e):kt.storage.removeItem("debug")}catch{}}function rI(){let e;try{e=kt.storage.getItem("debug")||kt.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function nI(){try{return localStorage}catch{}}Ha.exports=Kl()(kt);var{formatters:oI}=Ha.exports;oI.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var wv=x((lZ,bv)=>{"use strict";bv.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}});var Ev=x((pZ,Sv)=>{"use strict";var iI=G("os"),xv=G("tty"),or=wv(),{env:tt}=process,An;or("no-color")||or("no-colors")||or("color=false")||or("color=never")?An=0:(or("color")||or("colors")||or("color=true")||or("color=always"))&&(An=1);"FORCE_COLOR"in tt&&(tt.FORCE_COLOR==="true"?An=1:tt.FORCE_COLOR==="false"?An=0:An=tt.FORCE_COLOR.length===0?1:Math.min(parseInt(tt.FORCE_COLOR,10),3));function Gl(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Wl(e,t){if(An===0)return 0;if(or("color=16m")||or("color=full")||or("color=truecolor"))return 3;if(or("color=256"))return 2;if(e&&!t&&An===void 0)return 0;let r=An||0;if(tt.TERM==="dumb")return r;if(process.platform==="win32"){let n=iI.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in tt)||tt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(tt.TEAMCITY_VERSION)?1:0;if(tt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in tt){let n=parseInt((tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(tt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(tt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(tt.TERM)||"COLORTERM"in tt?1:r}function sI(e){let t=Wl(e,e&&e.isTTY);return Gl(t)}Sv.exports={supportsColor:sI,stdout:Gl(Wl(!0,xv.isatty(1))),stderr:Gl(Wl(!0,xv.isatty(2)))}});var _v=x((rt,Ka)=>{var aI=G("tty"),qa=G("util");rt.init=mI;rt.log=pI;rt.formatArgs=cI;rt.save=dI;rt.load=fI;rt.useColors=uI;rt.destroy=qa.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");rt.colors=[6,2,3,4,5,1];try{let e=Ev();e&&(e.stderr||e).level>=2&&(rt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}rt.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function uI(){return"colors"in rt.inspectOpts?!!rt.inspectOpts.colors:aI.isatty(process.stderr.fd)}function cI(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
18
18
  `).join(`
19
- `+s),e.push(o+"m+"+qa.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=qR()+t+" "+e[0]}function qR(){return tt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function KR(...e){return process.stderr.write(Ha.formatWithOptions(tt.inspectOpts,...e)+`
20
- `)}function GR(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function WR(){return process.env.DEBUG}function ZR(e){e.inspectOpts={};let t=Object.keys(tt.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=tt.inspectOpts[t[r]]}qa.exports=ql()(tt);var{formatters:Ev}=qa.exports;Ev.o=function(e){return this.inspectOpts.colors=this.useColors,Ha.inspect(e,this.inspectOpts).split(`
21
- `).map(t=>t.trim()).join(" ")};Ev.O=function(e){return this.inspectOpts.colors=this.useColors,Ha.inspect(e,this.inspectOpts)}});var Ka=x((GW,Wl)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Wl.exports=vv():Wl.exports=Pv()});var Av=x((WW,_v)=>{var Ki;_v.exports=function(){if(!Ki){try{Ki=Ka()("follow-redirects")}catch{}typeof Ki!="function"&&(Ki=function(){})}Ki.apply(null,arguments)}});var Rv=x((ZW,sp)=>{var Wi=G("url"),Gi=Wi.URL,JR=G("http"),YR=G("https"),Xl=G("stream").Writable,ep=G("assert"),Fv=Av();(function(){var t=typeof process<"u",r=typeof window<"u"&&typeof document<"u",n=ro(Error.captureStackTrace);!t&&(r||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var tp=!1;try{ep(new Gi(""))}catch(e){tp=e.code==="ERR_INVALID_URL"}var QR=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],rp=["abort","aborted","connect","error","socket","timeout"],np=Object.create(null);rp.forEach(function(e){np[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}});var Jl=Zi("ERR_INVALID_URL","Invalid URL",TypeError),Yl=Zi("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),XR=Zi("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Yl),eI=Zi("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),tI=Zi("ERR_STREAM_WRITE_AFTER_END","write after end"),rI=Xl.prototype.destroy||$v;function Rt(e,t){Xl.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(n){try{r._processResponse(n)}catch(o){r.emit("error",o instanceof Yl?o:new Yl({cause:o}))}},this._performRequest()}Rt.prototype=Object.create(Xl.prototype);Rt.prototype.abort=function(){ip(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Rt.prototype.destroy=function(e){return ip(this._currentRequest,e),rI.call(this,e),this};Rt.prototype.write=function(e,t,r){if(this._ending)throw new tI;if(!to(e)&&!iI(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(ro(t)&&(r=t,t=null),e.length===0){r&&r();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new eI),this.abort())};Rt.prototype.end=function(e,t,r){if(ro(e)?(r=e,e=t=null):ro(t)&&(r=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var n=this,o=this._currentRequest;this.write(e,t,function(){n._ended=!0,o.end(null,null,r)}),this._ending=!0}};Rt.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};Rt.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};Rt.prototype.setTimeout=function(e,t){var r=this;function n(i){i.setTimeout(e),i.removeListener("timeout",i.destroy),i.addListener("timeout",i.destroy)}function o(i){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),s()},e),n(i)}function s(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",s),r.removeListener("error",s),r.removeListener("response",s),r.removeListener("close",s),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",o)}return t&&this.on("timeout",t),this.socket?o(this.socket):this._currentRequest.once("socket",o),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){Rt.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Rt.prototype,e,{get:function(){return this._currentRequest[e]}})});Rt.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};Rt.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);n._redirectable=this;for(var o of rp)n.on(o,np[o]);if(this._currentUrl=/^\//.test(this._options.path)?Wi.format(this._options):this._options.path,this._isRedirect){var s=0,i=this,a=this._requestBodyBuffers;(function u(c){if(n===i._currentRequest)if(c)i.emit("error",c);else if(s<a.length){var l=a[s++];n.finished||n.write(l.data,l.encoding,u)}else i._ended&&n.end()})()}};Rt.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r=e.headers.location;if(!r||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(ip(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new XR;var n,o=this._options.beforeRedirect;o&&(n=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var s=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Zl(/^content-/i,this._options.headers));var i=Zl(/^host$/i,this._options.headers),a=op(this._currentUrl),u=i||a.host,c=/^\w+:/.test(r)?this._currentUrl:Wi.format(Object.assign(a,{host:u})),l=nI(r,c);if(Fv("redirecting to",l.href),this._isRedirect=!0,Ql(l,this._options),(l.protocol!==a.protocol&&l.protocol!=="https:"||l.host!==u&&!oI(l.host,u))&&Zl(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),ro(o)){var p={headers:e.headers,statusCode:t},d={url:c,method:s,headers:n};o(this._options,p,d),this._sanitizeOptions(this._options)}this._performRequest()};function Tv(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach(function(n){var o=n+":",s=r[o]=e[n],i=t[n]=Object.create(s);function a(c,l,p){return sI(c)?c=Ql(c):to(c)?c=Ql(op(c)):(p=l,l=kv(c),c={protocol:o}),ro(l)&&(p=l,l=null),l=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},c,l),l.nativeProtocols=r,!to(l.host)&&!to(l.hostname)&&(l.hostname="::1"),ep.equal(l.protocol,o,"protocol mismatch"),Fv("options",l),new Rt(l,p)}function u(c,l,p){var d=i.request(c,l,p);return d.end(),d}Object.defineProperties(i,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:u,configurable:!0,enumerable:!0,writable:!0}})}),t}function $v(){}function op(e){var t;if(tp)t=new Gi(e);else if(t=kv(Wi.parse(e)),!to(t.protocol))throw new Jl({input:e});return t}function nI(e,t){return tp?new Gi(e,t):op(Wi.resolve(t,e))}function kv(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new Jl({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new Jl({input:e.href||e});return e}function Ql(e,t){var r=t||{};for(var n of QR)r[n]=e[n];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),r.port!==""&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function Zl(e,t){var r;for(var n in t)e.test(n)&&(r=t[n],delete t[n]);return r===null||typeof r>"u"?void 0:String(r).trim()}function Zi(e,t,r){function n(o){ro(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,o||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return n.prototype=new(r||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),n}function ip(e,t){for(var r of rp)e.removeListener(r,np[r]);e.on("error",$v),e.destroy(t)}function oI(e,t){ep(to(e)&&to(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}function to(e){return typeof e=="string"||e instanceof String}function ro(e){return typeof e=="function"}function iI(e){return typeof e=="object"&&"length"in e}function sI(e){return Gi&&e instanceof Gi}sp.exports=Tv({http:JR,https:YR});sp.exports.wrap=Tv});var Ji=x(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.isSSL=void 0;Gt.setupOutgoing=lI;Gt.setupSocket=pI;Gt.getPort=dI;Gt.hasEncryptedConnection=Ov;Gt.urlJoin=Mv;Gt.rewriteCookieProperty=Bv;Gt.toURL=Lv;var aI=G("node:tls"),uI=/(^|,)\s*upgrade\s*($|,)/i;Gt.isSSL=/^https|wss/;var cI="trailer",Iv=[":method",":path",":scheme",":authority","connection","keep-alive"];function lI(e,t,r,n){let o=t[n||"target"];e.port=+(o.port??(o.protocol!==void 0&&Gt.isSSL.test(o.protocol)?443:80));for(let a of["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"])e[a]=o[a];e.method=t.method||r.method,e.headers={...r.headers},r.headers?.[":authority"]&&(e.headers.host=r.headers[":authority"]),t.headers&&(e.headers={...e.headers,...t.headers});for(let a in e.headers)if(cI==a.toLowerCase()){delete e.headers[a];break}if(r.httpVersionMajor>1)for(let a of Iv)delete e.headers[a];t.auth&&(delete e.headers.authorization,e.auth=t.auth),t.ca&&(e.ca=t.ca),o.protocol!==void 0&&Gt.isSSL.test(o.protocol)&&(e.rejectUnauthorized=typeof t.secure>"u"?!0:t.secure),e.agent=t.agent||!1,e.localAddress=t.localAddress,e.agent||(e.headers=e.headers||{},(typeof e.headers.connection!="string"||!uI.test(e.headers.connection))&&(e.headers.connection="close"));let s=o&&t.prependPath!==!1&&"pathname"in o?Nv(`${o.pathname}${o.search??""}`):"/",i=t.toProxy?r.url:Nv(r.url);if(i=t.ignorePath?"":i,e.path=Mv(s,i??""),t.changeOrigin&&(e.headers.host=o.protocol!==void 0&&mI(e.port,o.protocol)&&!fI(e.host)?e.host+":"+e.port:e.host),e.url="href"in o&&o.href||(o.protocol==="https"?"https":"http")+"://"+e.host+(e.port?":"+e.port:""),r.httpVersionMajor>1)for(let a of Iv)delete e.headers[a];return e}function pI(e){return e.setTimeout(0),e.setNoDelay(!0),e.setKeepAlive(!0,0),e}function dI(e){let t=e.headers[":authority"]||e.headers.host,r=t?t.match(/:(\d+)/):"";return r?r[1]:Ov(e)?"443":"80"}function Ov(e){let t=e.connection;return t instanceof aI.TLSSocket&&t.encrypted||!!t.pair}function Mv(...e){let t=[],r="";e.forEach((o,s)=>{let i=o.indexOf("?");i!==-1&&(t.push(o.substring(i+1)),e[s]=o.substring(0,i))}),r=t.filter(Boolean).join("&");let n="";for(let o of e)o&&(n.endsWith("/")?o.startsWith("/")?n+=o.slice(1):n+=o:o.startsWith("/")?n+=o:n+="/"+o);return r?n+"?"+r:n}function Bv(e,t,r){return Array.isArray(e)?e.map(n=>Bv(n,t,r)):e.replace(new RegExp("(;\\s*"+r+"=)([^;]+)","i"),(n,o,s)=>{let i;if(s in t)i=t[s];else if("*"in t)i=t["*"];else return n;return i?o+i:""})}function fI(e){return!!~e.indexOf(":")}function Nv(e){if(e===""||e?.startsWith("?"))return e;let t=Lv(e);return`${t.pathname??""}${t.search??""}`}function Lv(e){return e instanceof URL?e:(typeof e=="object"&&"href"in e&&typeof e.href=="string"&&(e=e.href),e||(e=""),typeof e!="string"&&(e=`${e}`),e.startsWith("//")&&(e=`http://base.invalid${e}`),new URL(e,"http://base.invalid"))}function mI(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443}return e!==0}});var ap=x(xt=>{"use strict";var gI=xt&&xt.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),hI=xt&&xt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),yI=xt&&xt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&gI(r,t,n[o]);return hI(r,t),r}})();Object.defineProperty(xt,"__esModule",{value:!0});xt.OUTGOING_PASSES=void 0;xt.removeChunked=zv;xt.setConnection=jv;xt.setRedirectHostRewrite=Uv;xt.writeHeaders=Vv;xt.writeStatusCode=Hv;var Ga=yI(Ji()),DI=/^201|30(1|2|7|8)$/;function zv(e,t,r){delete r.headers["transfer-encoding"]}function jv(e,t,r){e.httpVersion==="1.0"?r.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!r.headers.connection&&(r.headers.connection=e.headers.connection||"keep-alive")}function Uv(e,t,r,n){if((n.hostRewrite||n.autoRewrite||n.protocolRewrite)&&r.headers.location&&DI.test(`${r.statusCode}`)){let o=Ga.toURL(n.target),s=r.headers.location;if(typeof s!="string")return;let i=Ga.toURL(s);if(o.host!=i.host)return;n.hostRewrite?i.host=n.hostRewrite:n.autoRewrite&&(i.host=e.headers[":authority"]??e.headers.host??""),n.protocolRewrite&&(i.protocol=n.protocolRewrite),r.headers.location=i.toString()}}function Vv(e,t,r,n){let o=typeof n.cookieDomainRewrite=="string"?{"*":n.cookieDomainRewrite}:n.cookieDomainRewrite,s=typeof n.cookiePathRewrite=="string"?{"*":n.cookiePathRewrite}:n.cookiePathRewrite,i=n.preserveHeaderKeyCase,a=(c,l)=>{l!=null&&(o&&c.toLowerCase()==="set-cookie"&&(l=Ga.rewriteCookieProperty(l,o,"domain")),s&&c.toLowerCase()==="set-cookie"&&(l=Ga.rewriteCookieProperty(l,s,"path")),t.setHeader(String(c).trim(),l))},u;if(i&&r.rawHeaders!=null){u={};for(let c=0;c<r.rawHeaders.length;c+=2){let l=r.rawHeaders[c];u[l.toLowerCase()]=l}}for(let c in r.headers){let l=c;if(e.httpVersionMajor>1&&(l==="connection"||l==="keep-alive"))continue;let p=r.headers[l];i&&u&&(l=u[l]??l),a(l,p)}}function Hv(e,t,r){t.statusCode=r.statusCode,r.statusMessage&&e.httpVersionMajor===1&&(t.statusMessage=r.statusMessage)}xt.OUTGOING_PASSES={removeChunked:zv,setConnection:jv,setRedirectHostRewrite:Uv,writeHeaders:Vv,writeStatusCode:Hv}});var Jv=x(It=>{"use strict";var vI=It&&It.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),CI=It&&It.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Wa=It&&It.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&vI(r,t,n[o]);return CI(r,t),r}})();Object.defineProperty(It,"__esModule",{value:!0});It.WEB_PASSES=void 0;It.deleteLength=Kv;It.timeout=Gv;It.XHeaders=Wv;It.stream=Zv;var bI=Wa(G("node:http")),wI=Wa(G("node:https")),xI=Wa(Rv()),jo=Wa(Ji()),SI=ap(),EI=G("node:stream"),qv=Object.values(SI.OUTGOING_PASSES),PI={http:bI,https:wI};function Kv(e){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])}function Gv(e,t,r){r.timeout&&e.socket.setTimeout(r.timeout)}function Wv(e,t,r){if(!r.xfwd)return;let n=jo.hasEncryptedConnection(e),o={for:e.connection.remoteAddress||e.socket.remoteAddress,port:jo.getPort(e),proto:n?"https":"http"};for(let s of["for","port","proto"])e.headers["x-forwarded-"+s]=(e.headers["x-forwarded-"+s]||"")+(e.headers["x-forwarded-"+s]?",":"")+o[s];e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers[":authority"]||e.headers.host||""}function Zv(e,t,r,n,o,s){if(o.emit("start",e,t,r.target||r.forward),r.fetch||r.fetchOptions||process.env.FORCE_FETCH_PATH==="true")return _I(e,t,r,n,o,s);let i=r.followRedirects?xI:PI,a=i.http,u=i.https;if(r.forward){let m=r.forward.protocol==="https:"?u:a,f=jo.setupOutgoing(r.ssl||{},r,e,"forward"),h=m.request(f),y=g(h,r.forward);if(e.on("error",y),h.on("error",y),(r.buffer||e).pipe(h),!r.target)return t.end()}let c=r.target.protocol==="https:"?u:a,l=jo.setupOutgoing(r.ssl||{},r,e),p=c.request(l);p.on("socket",m=>{o&&!p.getHeader("expect")&&o.emit("proxyReq",p,e,t,r,m)}),r.proxyTimeout&&p.setTimeout(r.proxyTimeout,()=>{p.destroy()}),t.on("close",()=>{!t.writableFinished&&p.destroy()});let d=g(p,r.target);e.on("error",d),p.on("error",d);function g(m,f){return h=>{if(e.socket.destroyed&&h.code==="ECONNRESET"){o.emit("econnreset",h,e,t,f),m.destroy();return}s?s(h,e,t,f):o.emit("error",h,e,t,f)}}(r.buffer||e).pipe(p),p.on("response",m=>{if(o?.emit("proxyRes",m,e,t),!t.headersSent&&!r.selfHandleResponse)for(let f of qv)f(e,t,m,r);t.finished?o?.emit("end",e,t,m):(m.on("end",()=>{o?.emit("end",e,t,m)}),r.selfHandleResponse||m.pipe(t))})}async function _I(e,t,r,n,o,s){let i=(g,m)=>{let f=g;f.code===void 0&&f.cause?.code&&(f.code=f.cause.code),s?s(g,e,t,m):o.emit("error",g,e,t,m)};e.on("error",g=>{if(e.socket.destroyed&&g.code==="ECONNRESET"){let m=r.target||r.forward;m&&o.emit("econnreset",g,e,t,m);return}i(g)});let a=r.fetch||fetch,u=r.fetchOptions??{},c=g=>{let m={method:g.method,...u.requestOptions},f=new Headers(u.requestOptions?.headers);if(!u.requestOptions?.headers&&g.headers){for(let[h,y]of Object.entries(g.headers))if(typeof h=="string")if(Array.isArray(y))for(let b of y)f.append(h,b);else y!=null&&f.append(h,y)}return r.auth&&f.set("authorization",`Basic ${Buffer.from(r.auth).toString("base64")}`),r.proxyTimeout&&(m.signal=AbortSignal.timeout(r.proxyTimeout)),m.headers=f,r.buffer?m.body=r.buffer:e.method!=="GET"&&e.method!=="HEAD"&&(m.body=e,m.duplex="half"),m};if(r.forward){let g=jo.setupOutgoing(r.ssl||{},r,e,"forward"),m=c(g),f=new URL(g.url).origin+g.path;if(f.startsWith("ws")&&(f=f.replace("ws","http")),u.onBeforeRequest)try{await u.onBeforeRequest(m,e,t,r)}catch(h){i(h,r.forward);return}try{let h=await a(f,m);if(u.onAfterResponse)try{await u.onAfterResponse(h,e,t,r)}catch(y){i(y,r.forward);return}}catch(h){i(h,r.forward)}if(!r.target)return t.end()}let l=jo.setupOutgoing(r.ssl||{},r,e),p=c(l),d=new URL(l.url).origin+l.path;if(d.startsWith("ws")&&(d=d.replace("ws","http")),u.onBeforeRequest)try{await u.onBeforeRequest(p,e,t,r)}catch(g){i(g,r.target);return}try{let g=await a(d,p);if(u.onAfterResponse)try{await u.onAfterResponse(g,e,t,r)}catch(f){i(f,r.target);return}let m={statusCode:g.status,statusMessage:g.statusText,headers:Object.fromEntries(g.headers.entries()),rawHeaders:Object.entries(g.headers).flatMap(([f,h])=>Array.isArray(h)?h.flatMap(y=>y!=null?[f,y]:[]):h!=null?[f,h]:[])};if(o?.emit("proxyRes",m,e,t),!t.headersSent&&!r.selfHandleResponse)for(let f of qv)f(e,t,m,r);if(t.writableEnded)o?.emit("end",e,t,m);else{let f=g.body?EI.Readable.from(g.body):null;f?(f.on("error",h=>{i(h,r.target)}),f.on("end",()=>{o?.emit("end",e,t,m)}),r.selfHandleResponse?f.resume():f.pipe(t,{end:!0})):o?.emit("end",e,t,m)}}catch(g){i(g,r.target)}}It.WEB_PASSES={deleteLength:Kv,timeout:Gv,XHeaders:Wv,stream:Zv}});var dp=x(mt=>{"use strict";var AI=mt&&mt.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),FI=mt&&mt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),pp=mt&&mt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&AI(r,t,n[o]);return FI(r,t),r}})(),TI=mt&&mt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mt,"__esModule",{value:!0});mt.WS_PASSES=void 0;mt.numOpenSockets=OI;mt.checkMethodAndHeader=Qv;mt.XHeaders=Xv;mt.stream=eC;var $I=pp(G("node:http")),kI=pp(G("node:https")),Uo=pp(Ji()),RI=ap(),II=TI(Ka()),Vo=(0,II.default)("http-proxy-3:ws-incoming"),NI=Object.values(RI.OUTGOING_PASSES);function Yv(e){let t=new Set;return({add:r,rm:n}={})=>(r&&(r.id||(r.id=Math.random()),t.has(r.id)||t.add(r.id)),n&&(n.id||(n.id=Math.random()),t.has(n.id)&&t.delete(n.id)),Vo("socket counter:",{[e]:t.size},r?"add":n?"rm":""),t.size)}var up=Yv("socket"),cp=Yv("proxySocket"),lp=class{constructor(){this.headers={},this.statusCode=200,this.statusMessage=""}setHeader(t,r){return this.headers[t]=r,this}};function OI(){return up()+cp()}function Qv(e,t){if(Vo("websocket: checkMethodAndHeader"),e.method!=="GET"||!e.headers.upgrade||e.headers.upgrade.toLowerCase()!=="websocket")return t.destroy(),!0}function Xv(e,t,r){if(!r.xfwd)return;Vo("websocket: XHeaders");let n={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Uo.getPort(e),proto:Uo.hasEncryptedConnection(e)?"wss":"ws"};for(let o of["for","port","proto"])e.headers["x-forwarded-"+o]=(e.headers["x-forwarded-"+o]||"")+(e.headers["x-forwarded-"+o]?",":"")+n[o]}function eC(e,t,r,n,o,s){Vo("websocket: new stream");let i=[];up({add:t});let a=()=>{for(let g of i)g.end()};t.on("close",()=>{up({rm:t}),a()}),t.on("error",a);let u=(g,m)=>Object.keys(m).reduce((f,h)=>{let y=m[h];if(!Array.isArray(y))return f.push(h+": "+y),f;for(let b=0;b<y.length;b++)f.push(h+": "+y[b]);return f},[g]).join(`\r
19
+ `+s),e.push(o+"m+"+Ka.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=lI()+t+" "+e[0]}function lI(){return rt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function pI(...e){return process.stderr.write(qa.formatWithOptions(rt.inspectOpts,...e)+`
20
+ `)}function dI(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function fI(){return process.env.DEBUG}function mI(e){e.inspectOpts={};let t=Object.keys(rt.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=rt.inspectOpts[t[r]]}Ka.exports=Kl()(rt);var{formatters:Pv}=Ka.exports;Pv.o=function(e){return this.inspectOpts.colors=this.useColors,qa.inspect(e,this.inspectOpts).split(`
21
+ `).map(t=>t.trim()).join(" ")};Pv.O=function(e){return this.inspectOpts.colors=this.useColors,qa.inspect(e,this.inspectOpts)}});var Ga=x((dZ,Zl)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Zl.exports=Cv():Zl.exports=_v()});var Tv=x((fZ,Av)=>{var Ki;Av.exports=function(){if(!Ki){try{Ki=Ga()("follow-redirects")}catch{}typeof Ki!="function"&&(Ki=function(){})}Ki.apply(null,arguments)}});var Iv=x((mZ,ap)=>{var Wi=G("url"),Gi=Wi.URL,gI=G("http"),hI=G("https"),ep=G("stream").Writable,tp=G("assert"),Fv=Tv();(function(){var t=typeof process<"u",r=typeof window<"u"&&typeof document<"u",n=ro(Error.captureStackTrace);!t&&(r||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var rp=!1;try{tp(new Gi(""))}catch(e){rp=e.code==="ERR_INVALID_URL"}var yI=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],np=["abort","aborted","connect","error","socket","timeout"],op=Object.create(null);np.forEach(function(e){op[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}});var Yl=Zi("ERR_INVALID_URL","Invalid URL",TypeError),Ql=Zi("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),DI=Zi("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Ql),vI=Zi("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),CI=Zi("ERR_STREAM_WRITE_AFTER_END","write after end"),bI=ep.prototype.destroy||$v;function It(e,t){ep.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(n){try{r._processResponse(n)}catch(o){r.emit("error",o instanceof Ql?o:new Ql({cause:o}))}},this._performRequest()}It.prototype=Object.create(ep.prototype);It.prototype.abort=function(){sp(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};It.prototype.destroy=function(e){return sp(this._currentRequest,e),bI.call(this,e),this};It.prototype.write=function(e,t,r){if(this._ending)throw new CI;if(!to(e)&&!SI(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(ro(t)&&(r=t,t=null),e.length===0){r&&r();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new vI),this.abort())};It.prototype.end=function(e,t,r){if(ro(e)?(r=e,e=t=null):ro(t)&&(r=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var n=this,o=this._currentRequest;this.write(e,t,function(){n._ended=!0,o.end(null,null,r)}),this._ending=!0}};It.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};It.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};It.prototype.setTimeout=function(e,t){var r=this;function n(i){i.setTimeout(e),i.removeListener("timeout",i.destroy),i.addListener("timeout",i.destroy)}function o(i){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),s()},e),n(i)}function s(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",s),r.removeListener("error",s),r.removeListener("response",s),r.removeListener("close",s),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",o)}return t&&this.on("timeout",t),this.socket?o(this.socket):this._currentRequest.once("socket",o),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){It.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(It.prototype,e,{get:function(){return this._currentRequest[e]}})});It.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};It.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);n._redirectable=this;for(var o of np)n.on(o,op[o]);if(this._currentUrl=/^\//.test(this._options.path)?Wi.format(this._options):this._options.path,this._isRedirect){var s=0,i=this,a=this._requestBodyBuffers;(function u(c){if(n===i._currentRequest)if(c)i.emit("error",c);else if(s<a.length){var l=a[s++];n.finished||n.write(l.data,l.encoding,u)}else i._ended&&n.end()})()}};It.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r=e.headers.location;if(!r||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(sp(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new DI;var n,o=this._options.beforeRedirect;o&&(n=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var s=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Jl(/^content-/i,this._options.headers));var i=Jl(/^host$/i,this._options.headers),a=ip(this._currentUrl),u=i||a.host,c=/^\w+:/.test(r)?this._currentUrl:Wi.format(Object.assign(a,{host:u})),l=wI(r,c);if(Fv("redirecting to",l.href),this._isRedirect=!0,Xl(l,this._options),(l.protocol!==a.protocol&&l.protocol!=="https:"||l.host!==u&&!xI(l.host,u))&&Jl(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),ro(o)){var p={headers:e.headers,statusCode:t},d={url:c,method:s,headers:n};o(this._options,p,d),this._sanitizeOptions(this._options)}this._performRequest()};function Rv(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach(function(n){var o=n+":",s=r[o]=e[n],i=t[n]=Object.create(s);function a(c,l,p){return EI(c)?c=Xl(c):to(c)?c=Xl(ip(c)):(p=l,l=kv(c),c={protocol:o}),ro(l)&&(p=l,l=null),l=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},c,l),l.nativeProtocols=r,!to(l.host)&&!to(l.hostname)&&(l.hostname="::1"),tp.equal(l.protocol,o,"protocol mismatch"),Fv("options",l),new It(l,p)}function u(c,l,p){var d=i.request(c,l,p);return d.end(),d}Object.defineProperties(i,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:u,configurable:!0,enumerable:!0,writable:!0}})}),t}function $v(){}function ip(e){var t;if(rp)t=new Gi(e);else if(t=kv(Wi.parse(e)),!to(t.protocol))throw new Yl({input:e});return t}function wI(e,t){return rp?new Gi(e,t):ip(Wi.resolve(t,e))}function kv(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new Yl({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new Yl({input:e.href||e});return e}function Xl(e,t){var r=t||{};for(var n of yI)r[n]=e[n];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),r.port!==""&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function Jl(e,t){var r;for(var n in t)e.test(n)&&(r=t[n],delete t[n]);return r===null||typeof r>"u"?void 0:String(r).trim()}function Zi(e,t,r){function n(o){ro(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,o||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return n.prototype=new(r||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),n}function sp(e,t){for(var r of np)e.removeListener(r,op[r]);e.on("error",$v),e.destroy(t)}function xI(e,t){tp(to(e)&&to(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}function to(e){return typeof e=="string"||e instanceof String}function ro(e){return typeof e=="function"}function SI(e){return typeof e=="object"&&"length"in e}function EI(e){return Gi&&e instanceof Gi}ap.exports=Rv({http:gI,https:hI});ap.exports.wrap=Rv});var Ji=x(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.isSSL=void 0;Gt.setupOutgoing=TI;Gt.setupSocket=FI;Gt.getPort=RI;Gt.hasEncryptedConnection=Mv;Gt.urlJoin=Lv;Gt.rewriteCookieProperty=Bv;Gt.toURL=zv;var PI=G("node:tls"),_I=/(^|,)\s*upgrade\s*($|,)/i;Gt.isSSL=/^https|wss/;var AI="trailer",Nv=[":method",":path",":scheme",":authority","connection","keep-alive"];function TI(e,t,r,n){let o=t[n||"target"];e.port=+(o.port??(o.protocol!==void 0&&Gt.isSSL.test(o.protocol)?443:80));for(let a of["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"])e[a]=o[a];e.method=t.method||r.method,e.headers={...r.headers},r.headers?.[":authority"]&&(e.headers.host=r.headers[":authority"]),t.headers&&(e.headers={...e.headers,...t.headers});for(let a in e.headers)if(AI==a.toLowerCase()){delete e.headers[a];break}if(r.httpVersionMajor>1)for(let a of Nv)delete e.headers[a];t.auth&&(delete e.headers.authorization,e.auth=t.auth),t.ca&&(e.ca=t.ca),o.protocol!==void 0&&Gt.isSSL.test(o.protocol)&&(e.rejectUnauthorized=typeof t.secure>"u"?!0:t.secure),e.agent=t.agent||!1,e.localAddress=t.localAddress,e.agent||(e.headers=e.headers||{},(typeof e.headers.connection!="string"||!_I.test(e.headers.connection))&&(e.headers.connection="close"));let s=o&&t.prependPath!==!1&&"pathname"in o?Ov(`${o.pathname}${o.search??""}`):"/",i=t.toProxy?r.url:Ov(r.url);if(i=t.ignorePath?"":i,e.path=Lv(s,i??""),t.changeOrigin&&(e.headers.host=o.protocol!==void 0&&kI(e.port,o.protocol)&&!$I(e.host)?e.host+":"+e.port:e.host),e.url="href"in o&&o.href||(o.protocol==="https"?"https":"http")+"://"+e.host+(e.port?":"+e.port:""),r.httpVersionMajor>1)for(let a of Nv)delete e.headers[a];return e}function FI(e){return e.setTimeout(0),e.setNoDelay(!0),e.setKeepAlive(!0,0),e}function RI(e){let t=e.headers[":authority"]||e.headers.host,r=t?t.match(/:(\d+)/):"";return r?r[1]:Mv(e)?"443":"80"}function Mv(e){let t=e.connection;return t instanceof PI.TLSSocket&&t.encrypted||!!t.pair}function Lv(...e){let t=[],r="";e.forEach((o,s)=>{let i=o.indexOf("?");i!==-1&&(t.push(o.substring(i+1)),e[s]=o.substring(0,i))}),r=t.filter(Boolean).join("&");let n="";for(let o of e)o&&(n.endsWith("/")?o.startsWith("/")?n+=o.slice(1):n+=o:o.startsWith("/")?n+=o:n+="/"+o);return r?n+"?"+r:n}function Bv(e,t,r){return Array.isArray(e)?e.map(n=>Bv(n,t,r)):e.replace(new RegExp("(;\\s*"+r+"=)([^;]+)","i"),(n,o,s)=>{let i;if(s in t)i=t[s];else if("*"in t)i=t["*"];else return n;return i?o+i:""})}function $I(e){return!!~e.indexOf(":")}function Ov(e){if(e===""||e?.startsWith("?"))return e;let t=zv(e);return`${t.pathname??""}${t.search??""}`}function zv(e){return e instanceof URL?e:(typeof e=="object"&&"href"in e&&typeof e.href=="string"&&(e=e.href),e||(e=""),typeof e!="string"&&(e=`${e}`),e.startsWith("//")&&(e=`http://base.invalid${e}`),new URL(e,"http://base.invalid"))}function kI(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443}return e!==0}});var up=x(St=>{"use strict";var II=St&&St.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),NI=St&&St.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),OI=St&&St.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&II(r,t,n[o]);return NI(r,t),r}})();Object.defineProperty(St,"__esModule",{value:!0});St.OUTGOING_PASSES=void 0;St.removeChunked=jv;St.setConnection=Uv;St.setRedirectHostRewrite=Vv;St.writeHeaders=Hv;St.writeStatusCode=qv;var Wa=OI(Ji()),MI=/^201|30(1|2|7|8)$/;function jv(e,t,r){delete r.headers["transfer-encoding"]}function Uv(e,t,r){e.httpVersion==="1.0"?r.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!r.headers.connection&&(r.headers.connection=e.headers.connection||"keep-alive")}function Vv(e,t,r,n){if((n.hostRewrite||n.autoRewrite||n.protocolRewrite)&&r.headers.location&&MI.test(`${r.statusCode}`)){let o=Wa.toURL(n.target),s=r.headers.location;if(typeof s!="string")return;let i=Wa.toURL(s);if(o.host!=i.host)return;n.hostRewrite?i.host=n.hostRewrite:n.autoRewrite&&(i.host=e.headers[":authority"]??e.headers.host??""),n.protocolRewrite&&(i.protocol=n.protocolRewrite),r.headers.location=i.toString()}}function Hv(e,t,r,n){let o=typeof n.cookieDomainRewrite=="string"?{"*":n.cookieDomainRewrite}:n.cookieDomainRewrite,s=typeof n.cookiePathRewrite=="string"?{"*":n.cookiePathRewrite}:n.cookiePathRewrite,i=n.preserveHeaderKeyCase,a=(c,l)=>{l!=null&&(o&&c.toLowerCase()==="set-cookie"&&(l=Wa.rewriteCookieProperty(l,o,"domain")),s&&c.toLowerCase()==="set-cookie"&&(l=Wa.rewriteCookieProperty(l,s,"path")),t.setHeader(String(c).trim(),l))},u;if(i&&r.rawHeaders!=null){u={};for(let c=0;c<r.rawHeaders.length;c+=2){let l=r.rawHeaders[c];u[l.toLowerCase()]=l}}for(let c in r.headers){let l=c;if(e.httpVersionMajor>1&&(l==="connection"||l==="keep-alive"))continue;let p=r.headers[l];i&&u&&(l=u[l]??l),a(l,p)}}function qv(e,t,r){t.statusCode=r.statusCode,r.statusMessage&&e.httpVersionMajor===1&&(t.statusMessage=r.statusMessage)}St.OUTGOING_PASSES={removeChunked:jv,setConnection:Uv,setRedirectHostRewrite:Vv,writeHeaders:Hv,writeStatusCode:qv}});var Yv=x(Nt=>{"use strict";var LI=Nt&&Nt.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),BI=Nt&&Nt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Za=Nt&&Nt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&LI(r,t,n[o]);return BI(r,t),r}})();Object.defineProperty(Nt,"__esModule",{value:!0});Nt.WEB_PASSES=void 0;Nt.deleteLength=Gv;Nt.timeout=Wv;Nt.XHeaders=Zv;Nt.stream=Jv;var zI=Za(G("node:http")),jI=Za(G("node:https")),UI=Za(Iv()),jo=Za(Ji()),VI=up(),HI=G("node:stream"),Kv=Object.values(VI.OUTGOING_PASSES),qI={http:zI,https:jI};function Gv(e){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])}function Wv(e,t,r){r.timeout&&e.socket.setTimeout(r.timeout)}function Zv(e,t,r){if(!r.xfwd)return;let n=jo.hasEncryptedConnection(e),o={for:e.connection.remoteAddress||e.socket.remoteAddress,port:jo.getPort(e),proto:n?"https":"http"};for(let s of["for","port","proto"])e.headers["x-forwarded-"+s]=(e.headers["x-forwarded-"+s]||"")+(e.headers["x-forwarded-"+s]?",":"")+o[s];e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers[":authority"]||e.headers.host||""}function Jv(e,t,r,n,o,s){if(o.emit("start",e,t,r.target||r.forward),r.fetch||r.fetchOptions||process.env.FORCE_FETCH_PATH==="true")return KI(e,t,r,n,o,s);let i=r.followRedirects?UI:qI,a=i.http,u=i.https;if(r.forward){let m=r.forward.protocol==="https:"?u:a,f=jo.setupOutgoing(r.ssl||{},r,e,"forward"),h=m.request(f),y=g(h,r.forward);if(e.on("error",y),h.on("error",y),(r.buffer||e).pipe(h),!r.target)return t.end()}let c=r.target.protocol==="https:"?u:a,l=jo.setupOutgoing(r.ssl||{},r,e),p=c.request(l);p.on("socket",m=>{o&&!p.getHeader("expect")&&o.emit("proxyReq",p,e,t,r,m)}),r.proxyTimeout&&p.setTimeout(r.proxyTimeout,()=>{p.destroy()}),t.on("close",()=>{!t.writableFinished&&p.destroy()});let d=g(p,r.target);e.on("error",d),p.on("error",d);function g(m,f){return h=>{if(e.socket.destroyed&&h.code==="ECONNRESET"){o.emit("econnreset",h,e,t,f),m.destroy();return}s?s(h,e,t,f):o.emit("error",h,e,t,f)}}(r.buffer||e).pipe(p),p.on("response",m=>{if(o?.emit("proxyRes",m,e,t),!t.headersSent&&!r.selfHandleResponse)for(let f of Kv)f(e,t,m,r);t.finished?o?.emit("end",e,t,m):(m.on("end",()=>{o?.emit("end",e,t,m)}),r.selfHandleResponse||m.pipe(t))})}async function KI(e,t,r,n,o,s){let i=(g,m)=>{let f=g;f.code===void 0&&f.cause?.code&&(f.code=f.cause.code),s?s(g,e,t,m):o.emit("error",g,e,t,m)};e.on("error",g=>{if(e.socket.destroyed&&g.code==="ECONNRESET"){let m=r.target||r.forward;m&&o.emit("econnreset",g,e,t,m);return}i(g)});let a=r.fetch||fetch,u=r.fetchOptions??{},c=g=>{let m={method:g.method,...u.requestOptions},f=new Headers(u.requestOptions?.headers);if(!u.requestOptions?.headers&&g.headers){for(let[h,y]of Object.entries(g.headers))if(typeof h=="string")if(Array.isArray(y))for(let b of y)f.append(h,b);else y!=null&&f.append(h,y)}return r.auth&&f.set("authorization",`Basic ${Buffer.from(r.auth).toString("base64")}`),r.proxyTimeout&&(m.signal=AbortSignal.timeout(r.proxyTimeout)),m.headers=f,r.buffer?m.body=r.buffer:e.method!=="GET"&&e.method!=="HEAD"&&(m.body=e,m.duplex="half"),m};if(r.forward){let g=jo.setupOutgoing(r.ssl||{},r,e,"forward"),m=c(g),f=new URL(g.url).origin+g.path;if(f.startsWith("ws")&&(f=f.replace("ws","http")),u.onBeforeRequest)try{await u.onBeforeRequest(m,e,t,r)}catch(h){i(h,r.forward);return}try{let h=await a(f,m);if(u.onAfterResponse)try{await u.onAfterResponse(h,e,t,r)}catch(y){i(y,r.forward);return}}catch(h){i(h,r.forward)}if(!r.target)return t.end()}let l=jo.setupOutgoing(r.ssl||{},r,e),p=c(l),d=new URL(l.url).origin+l.path;if(d.startsWith("ws")&&(d=d.replace("ws","http")),u.onBeforeRequest)try{await u.onBeforeRequest(p,e,t,r)}catch(g){i(g,r.target);return}try{let g=await a(d,p);if(u.onAfterResponse)try{await u.onAfterResponse(g,e,t,r)}catch(f){i(f,r.target);return}let m={statusCode:g.status,statusMessage:g.statusText,headers:Object.fromEntries(g.headers.entries()),rawHeaders:Object.entries(g.headers).flatMap(([f,h])=>Array.isArray(h)?h.flatMap(y=>y!=null?[f,y]:[]):h!=null?[f,h]:[])};if(o?.emit("proxyRes",m,e,t),!t.headersSent&&!r.selfHandleResponse)for(let f of Kv)f(e,t,m,r);if(t.writableEnded)o?.emit("end",e,t,m);else{let f=g.body?HI.Readable.from(g.body):null;f?(f.on("error",h=>{i(h,r.target)}),f.on("end",()=>{o?.emit("end",e,t,m)}),r.selfHandleResponse?f.resume():f.pipe(t,{end:!0})):o?.emit("end",e,t,m)}}catch(g){i(g,r.target)}}Nt.WEB_PASSES={deleteLength:Gv,timeout:Wv,XHeaders:Zv,stream:Jv}});var fp=x(gt=>{"use strict";var GI=gt&&gt.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),WI=gt&&gt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),dp=gt&&gt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&GI(r,t,n[o]);return WI(r,t),r}})(),ZI=gt&&gt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gt,"__esModule",{value:!0});gt.WS_PASSES=void 0;gt.numOpenSockets=t1;gt.checkMethodAndHeader=Xv;gt.XHeaders=eC;gt.stream=tC;var JI=dp(G("node:http")),YI=dp(G("node:https")),Uo=dp(Ji()),QI=up(),XI=ZI(Ga()),Vo=(0,XI.default)("http-proxy-3:ws-incoming"),e1=Object.values(QI.OUTGOING_PASSES);function Qv(e){let t=new Set;return({add:r,rm:n}={})=>(r&&(r.id||(r.id=Math.random()),t.has(r.id)||t.add(r.id)),n&&(n.id||(n.id=Math.random()),t.has(n.id)&&t.delete(n.id)),Vo("socket counter:",{[e]:t.size},r?"add":n?"rm":""),t.size)}var cp=Qv("socket"),lp=Qv("proxySocket"),pp=class{constructor(){this.headers={},this.statusCode=200,this.statusMessage=""}setHeader(t,r){return this.headers[t]=r,this}};function t1(){return cp()+lp()}function Xv(e,t){if(Vo("websocket: checkMethodAndHeader"),e.method!=="GET"||!e.headers.upgrade||e.headers.upgrade.toLowerCase()!=="websocket")return t.destroy(),!0}function eC(e,t,r){if(!r.xfwd)return;Vo("websocket: XHeaders");let n={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Uo.getPort(e),proto:Uo.hasEncryptedConnection(e)?"wss":"ws"};for(let o of["for","port","proto"])e.headers["x-forwarded-"+o]=(e.headers["x-forwarded-"+o]||"")+(e.headers["x-forwarded-"+o]?",":"")+n[o]}function tC(e,t,r,n,o,s){Vo("websocket: new stream");let i=[];cp({add:t});let a=()=>{for(let g of i)g.end()};t.on("close",()=>{cp({rm:t}),a()}),t.on("error",a);let u=(g,m)=>Object.keys(m).reduce((f,h)=>{let y=m[h];if(!Array.isArray(y))return f.push(h+": "+y),f;for(let b=0;b<y.length;b++)f.push(h+": "+y[b]);return f},[g]).join(`\r
22
22
  `)+`\r
23
23
  \r
24
- `;Uo.setupSocket(t),n&&n.length&&t.unshift(n);let c=Uo.isSSL.test(r.target.protocol)?kI:$I,l=Uo.setupOutgoing(r.ssl||{},r,e),p=c.request(l);o&&o.emit("proxyReqWs",p,e,t,r,n),p.on("error",d),p.on("upgrade",(g,m,f)=>{Vo("upgrade"),cp({add:m}),i.push(m),m.on("close",()=>{cp({rm:m})}),m.on("error",d),m.on("end",()=>{o.emit("close",g,m,f)}),m.on("close",()=>{t.end()}),Uo.setupSocket(m),f&&f.length&&m.unshift(f),t.write(u("HTTP/1.1 101 Switching Protocols",g.headers)),m.pipe(t).pipe(m),o.emit("open",m)});function d(g){s?s(g,e,t):o.emit("error",g,e,t),t.destroySoon()}p.on("response",g=>{Vo("got non-ws HTTP response",{statusCode:g.statusCode,statusMessage:g.statusMessage});let m=new lp;for(let y of NI)y(e,m,g,r);let f=y=>{t.write(y)};e.httpVersion==="1.1"&&g.headers["content-length"]===void 0&&(m.headers["transfer-encoding"]="chunked",f=y=>{t.write(y.length.toString(16)),t.write(`\r
24
+ `;Uo.setupSocket(t),n&&n.length&&t.unshift(n);let c=Uo.isSSL.test(r.target.protocol)?YI:JI,l=Uo.setupOutgoing(r.ssl||{},r,e),p=c.request(l);o&&o.emit("proxyReqWs",p,e,t,r,n),p.on("error",d),p.on("upgrade",(g,m,f)=>{Vo("upgrade"),lp({add:m}),i.push(m),m.on("close",()=>{lp({rm:m})}),m.on("error",d),m.on("end",()=>{o.emit("close",g,m,f)}),m.on("close",()=>{t.end()}),Uo.setupSocket(m),f&&f.length&&m.unshift(f),t.write(u("HTTP/1.1 101 Switching Protocols",g.headers)),m.pipe(t).pipe(m),o.emit("open",m)});function d(g){s?s(g,e,t):o.emit("error",g,e,t),t.destroySoon()}p.on("response",g=>{Vo("got non-ws HTTP response",{statusCode:g.statusCode,statusMessage:g.statusMessage});let m=new pp;for(let y of e1)y(e,m,g,r);let f=y=>{t.write(y)};e.httpVersion==="1.1"&&g.headers["content-length"]===void 0&&(m.headers["transfer-encoding"]="chunked",f=y=>{t.write(y.length.toString(16)),t.write(`\r
25
25
  `),t.write(y),t.write(`\r
26
- `)});let h=u(`HTTP/${e.httpVersion} ${g.statusCode} ${g.statusMessage}`,m.headers);t.destroyed?g.resume():(t.write(h),g.on("data",y=>{f(y)}),g.on("end",()=>{f(""),t.destroySoon()}))}),p.end()}mt.WS_PASSES={checkMethodAndHeader:Qv,XHeaders:Xv,stream:eC}});var rC=x(ir=>{"use strict";var MI=ir&&ir.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),BI=ir&&ir.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),tC=ir&&ir.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&MI(r,t,n[o]);return BI(r,t),r}})(),LI=ir&&ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ir,"__esModule",{value:!0});ir.ProxyServer=void 0;var zI=tC(G("node:http")),jI=tC(G("node:http2")),UI=Jv(),VI=dp(),HI=G("node:events"),qI=LI(Ka()),KI=Ji(),Za=(0,qI.default)("http-proxy-3"),fp=class e extends HI.EventEmitter{constructor(t={}){super(),this.createRightProxy=r=>(Za("createRightProxy",{type:r}),n=>(...o)=>{let s=o[0];Za("proxy: ",{type:r,path:s.url});let i=o[1],a=r==="ws"?this.wsPasses:this.webPasses;r=="ws"&&i.on("error",d=>{this.emit("error",d,s,i)});let u=o.length-1,c,l;typeof o[u]=="function"&&(l=o[u],u--);let p;!(o[u]instanceof Buffer)&&o[u]!==i?(p={...n,...o[u]},u--):p={...n},o[u]instanceof Buffer&&(c=o[u]);for(let d of["target","forward"])typeof p[d]=="string"&&(p[d]=(0,KI.toURL)(p[d]));if(!p.target&&!p.forward){this.emit("error",new Error("Must set target or forward"),s,i);return}for(let d of a)if(d(s,i,p,c,this,l))break}),this.onError=r=>{if(this.listeners("error").length===1)throw r},this.listen=(r,n)=>{Za("listen",{port:r,hostname:n});let o=(s,i)=>{this.web(s,i)};return this._server=this.options.ssl?jI.createSecureServer({...this.options.ssl,allowHTTP1:!0},o):zI.createServer(o),this.options.ws&&this._server.on("upgrade",(s,i,a)=>{this.ws(s,i,a)}),this._server.listen(r,n),this},this.address=()=>this._server?.address(),this.close=r=>{if(this._server==null){r?.();return}this._server.close(n=>{this._server=null,r?.(n)})},this.before=(r,n,o)=>{if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");let s=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(s.forEach((a,u)=>{a.name===n&&(i=u)}),i===!1)throw new Error("No such pass");s.splice(i,0,o)},this.after=(r,n,o)=>{if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");let s=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(s.forEach((a,u)=>{a.name===n&&(i=u)}),i===!1)throw new Error("No such pass");s.splice(i++,0,o)},Za("creating a ProxyServer",t),t.prependPath=t.prependPath!==!1,this.options=t,this.web=this.createRightProxy("web")(t),this.ws=this.createRightProxy("ws")(t),this.webPasses=Object.values(UI.WEB_PASSES),this.wsPasses=Object.values(VI.WS_PASSES),this.on("error",this.onError)}static createProxyServer(t){return new e(t)}static createServer(t){return new e(t)}static createProxy(t){return new e(t)}};ir.ProxyServer=fp});var nC=x(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.numOpenSockets=Hr.ProxyServer=void 0;Hr.createProxyServer=gp;Hr.createServer=gp;Hr.createProxy=gp;var mp=rC();Object.defineProperty(Hr,"ProxyServer",{enumerable:!0,get:function(){return mp.ProxyServer}});var GI=dp();Object.defineProperty(Hr,"numOpenSockets",{enumerable:!0,get:function(){return GI.numOpenSockets}});function gp(e={}){return new mp.ProxyServer(e)}Hr.default=mp.ProxyServer});var sC=x(hp=>{"use strict";hp.parse=e1;hp.serialize=t1;var WI=Object.prototype.toString,ZI=Object.prototype.hasOwnProperty,JI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,YI=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,QI=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,XI=/^[\u0020-\u003A\u003D-\u007E]*$/;function e1(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");var r={},n=e.length;if(n<2)return r;var o=t&&t.decode||r1,s=0,i=0,a=0;do{if(i=e.indexOf("=",s),i===-1)break;if(a=e.indexOf(";",s),a===-1)a=n;else if(i>a){s=e.lastIndexOf(";",i-1)+1;continue}var u=oC(e,s,i),c=iC(e,i,u),l=e.slice(u,c);if(!ZI.call(r,l)){var p=oC(e,i+1,a),d=iC(e,a,p);e.charCodeAt(p)===34&&e.charCodeAt(d-1)===34&&(p++,d--);var g=e.slice(p,d);r[l]=o1(g,o)}s=a+1}while(s<n);return r}function oC(e,t,r){do{var n=e.charCodeAt(t);if(n!==32&&n!==9)return t}while(++t<r);return r}function iC(e,t,r){for(;t>r;){var n=e.charCodeAt(--t);if(n!==32&&n!==9)return t+1}return r}function t1(e,t,r){var n=r&&r.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!JI.test(e))throw new TypeError("argument name is invalid");var o=n(t);if(!YI.test(o))throw new TypeError("argument val is invalid");var s=e+"="+o;if(!r)return s;if(r.maxAge!=null){var i=Math.floor(r.maxAge);if(!isFinite(i))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+i}if(r.domain){if(!QI.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!XI.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){var a=r.expires;if(!n1(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.partitioned&&(s+="; Partitioned"),r.priority){var u=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(u){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var c=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(c){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function r1(e){return e.indexOf("%")!==-1?decodeURIComponent(e):e}function n1(e){return WI.call(e)==="[object Date]"}function o1(e,t){try{return t(e)}catch{return e}}});var cC=x(Ja=>{var uC=G("crypto");Ja.sign=function(e,t){if(typeof e!="string")throw new TypeError("Cookie value must be provided as a string.");if(typeof t!="string")throw new TypeError("Secret string must be provided.");return e+"."+uC.createHmac("sha256",t).update(e).digest("base64").replace(/\=+$/,"")};Ja.unsign=function(e,t){if(typeof e!="string")throw new TypeError("Signed cookie string must be provided.");if(typeof t!="string")throw new TypeError("Secret string must be provided.");var r=e.slice(0,e.lastIndexOf(".")),n=Ja.sign(r,t);return aC(n)==aC(e)?r:!1};function aC(e){return uC.createHash("sha1").update(e).digest("hex")}});var fC=x((oZ,Ho)=>{"use strict";var i1=sC(),s1=cC();Ho.exports=a1;Ho.exports.JSONCookie=lC;Ho.exports.JSONCookies=yp;Ho.exports.signedCookie=pC;Ho.exports.signedCookies=dC;function a1(e,t){var r=!e||Array.isArray(e)?e||[]:[e];return function(o,s,i){if(o.cookies)return i();var a=o.headers.cookie;if(o.secret=r[0],o.cookies=Object.create(null),o.signedCookies=Object.create(null),!a)return i();o.cookies=i1.parse(a,t),r.length!==0&&(o.signedCookies=dC(o.cookies,r),o.signedCookies=yp(o.signedCookies)),o.cookies=yp(o.cookies),i()}}function lC(e){if(!(typeof e!="string"||e.substr(0,2)!=="j:"))try{return JSON.parse(e.slice(2))}catch{return}}function yp(e){for(var t=Object.keys(e),r,n,o=0;o<t.length;o++)r=t[o],n=lC(e[r]),n&&(e[r]=n);return e}function pC(e,t){if(typeof e=="string"){if(e.substr(0,2)!=="s:")return e;for(var r=!t||Array.isArray(t)?t||[]:[t],n=0;n<r.length;n++){var o=s1.unsign(e.slice(2),r[n]);if(o!==!1)return o}return!1}}function dC(e,t){for(var r=Object.keys(e),n,o,s=Object.create(null),i,a=0;a<r.length;a++)o=r[a],i=e[o],n=pC(i,t),i!==n&&(s[o]=n,delete e[o]);return s}});var Ds=x(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.regexpCode=le.getEsmExportName=le.getProperty=le.safeStringify=le.stringify=le.strConcat=le.addCodeArg=le.str=le._=le.nil=le._Code=le.Name=le.IDENTIFIER=le._CodeOrName=void 0;var hs=class{};le._CodeOrName=hs;le.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var so=class extends hs{constructor(t){if(super(),!le.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};le.Name=so;var cr=class extends hs{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof so&&(r[n.str]=(r[n.str]||0)+1),r),{})}};le._Code=cr;le.nil=new cr("");function Jx(e,...t){let r=[e[0]],n=0;for(;n<t.length;)Pd(r,t[n]),r.push(e[++n]);return new cr(r)}le._=Jx;var Ed=new cr("+");function Yx(e,...t){let r=[ys(e[0])],n=0;for(;n<t.length;)r.push(Ed),Pd(r,t[n]),r.push(Ed,ys(e[++n]));return xO(r),new cr(r)}le.str=Yx;function Pd(e,t){t instanceof cr?e.push(...t._items):t instanceof so?e.push(t):e.push(PO(t))}le.addCodeArg=Pd;function xO(e){let t=1;for(;t<e.length-1;){if(e[t]===Ed){let r=SO(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function SO(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof so||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof so))return`"${e}${t.slice(1)}`}function EO(e,t){return t.emptyStr()?e:e.emptyStr()?t:Yx`${e}${t}`}le.strConcat=EO;function PO(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ys(Array.isArray(e)?e.join(","):e)}function _O(e){return new cr(ys(e))}le.stringify=_O;function ys(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}le.safeStringify=ys;function AO(e){return typeof e=="string"&&le.IDENTIFIER.test(e)?new cr(`.${e}`):Jx`[${e}]`}le.getProperty=AO;function FO(e){if(typeof e=="string"&&le.IDENTIFIER.test(e))return new cr(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}le.getEsmExportName=FO;function TO(e){return new cr(e.toString())}le.regexpCode=TO});var Fd=x(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.ValueScope=Mt.ValueScopeName=Mt.Scope=Mt.varKinds=Mt.UsedValueState=void 0;var Ot=Ds(),_d=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Du;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Du||(Mt.UsedValueState=Du={}));Mt.varKinds={const:new Ot.Name("const"),let:new Ot.Name("let"),var:new Ot.Name("var")};var vu=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Ot.Name?t:this.name(t)}name(t){return new Ot.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};Mt.Scope=vu;var Cu=class extends Ot.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Ot._)`.${new Ot.Name(r)}[${n}]`}};Mt.ValueScopeName=Cu;var $O=(0,Ot._)`\n`,Ad=class extends vu{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?$O:Ot.nil}}get(){return this._scope}name(t){return new Cu(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:s}=o,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let l=a.get(i);if(l)return l}else a=this._values[s]=new Map;a.set(i,o);let u=this._scope[s]||(this._scope[s]=[]),c=u.length;return u[c]=r.ref,o.setValue(r,{property:s,itemIndex:c}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ot._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let s=Ot.nil;for(let i in t){let a=t[i];if(!a)continue;let u=n[i]=n[i]||new Map;a.forEach(c=>{if(u.has(c))return;u.set(c,Du.Started);let l=r(c);if(l){let p=this.opts.es5?Mt.varKinds.var:Mt.varKinds.const;s=(0,Ot._)`${s}${p} ${c} = ${l};${this.opts._n}`}else if(l=o?.(c))s=(0,Ot._)`${s}${l}${this.opts._n}`;else throw new _d(c);u.set(c,Du.Completed)})}return s}};Mt.ValueScope=Ad});var Y=x(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.or=Q.and=Q.not=Q.CodeGen=Q.operators=Q.varKinds=Q.ValueScopeName=Q.ValueScope=Q.Scope=Q.Name=Q.regexpCode=Q.stringify=Q.getProperty=Q.nil=Q.strConcat=Q.str=Q._=void 0;var ie=Ds(),br=Fd(),Tn=Ds();Object.defineProperty(Q,"_",{enumerable:!0,get:function(){return Tn._}});Object.defineProperty(Q,"str",{enumerable:!0,get:function(){return Tn.str}});Object.defineProperty(Q,"strConcat",{enumerable:!0,get:function(){return Tn.strConcat}});Object.defineProperty(Q,"nil",{enumerable:!0,get:function(){return Tn.nil}});Object.defineProperty(Q,"getProperty",{enumerable:!0,get:function(){return Tn.getProperty}});Object.defineProperty(Q,"stringify",{enumerable:!0,get:function(){return Tn.stringify}});Object.defineProperty(Q,"regexpCode",{enumerable:!0,get:function(){return Tn.regexpCode}});Object.defineProperty(Q,"Name",{enumerable:!0,get:function(){return Tn.Name}});var Su=Fd();Object.defineProperty(Q,"Scope",{enumerable:!0,get:function(){return Su.Scope}});Object.defineProperty(Q,"ValueScope",{enumerable:!0,get:function(){return Su.ValueScope}});Object.defineProperty(Q,"ValueScopeName",{enumerable:!0,get:function(){return Su.ValueScopeName}});Object.defineProperty(Q,"varKinds",{enumerable:!0,get:function(){return Su.varKinds}});Q.operators={GT:new ie._Code(">"),GTE:new ie._Code(">="),LT:new ie._Code("<"),LTE:new ie._Code("<="),EQ:new ie._Code("==="),NEQ:new ie._Code("!=="),NOT:new ie._Code("!"),OR:new ie._Code("||"),AND:new ie._Code("&&"),ADD:new ie._Code("+")};var pn=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},Td=class extends pn{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?br.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Yo(this.rhs,t,r)),this}get names(){return this.rhs instanceof ie._CodeOrName?this.rhs.names:{}}},bu=class extends pn{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof ie.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Yo(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ie.Name?{}:{...this.lhs.names};return xu(t,this.rhs)}},$d=class extends bu{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},kd=class extends pn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Rd=class extends pn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Id=class extends pn{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Nd=class extends pn{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Yo(this.code,t,r),this}get names(){return this.code instanceof ie._CodeOrName?this.code.names:{}}},vs=class extends pn{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(t,r)||(kO(t,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>co(t,r.names),{})}},dn=class extends vs{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Od=class extends vs{},Jo=class extends dn{};Jo.kind="else";var ao=class e extends dn{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Jo(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Qx(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Yo(this.condition,t,r),this}get names(){let t=super.names;return xu(t,this.condition),this.else&&co(t,this.else.names),t}};ao.kind="if";var uo=class extends dn{};uo.kind="for";var Md=class extends uo{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Yo(this.iteration,t,r),this}get names(){return co(super.names,this.iteration.names)}},Bd=class extends uo{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?br.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(t)}get names(){let t=xu(super.names,this.from);return xu(t,this.to)}},wu=class extends uo{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Yo(this.iterable,t,r),this}get names(){return co(super.names,this.iterable.names)}},Cs=class extends dn{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Cs.kind="func";var bs=class extends vs{render(t){return"return "+super.render(t)}};bs.kind="return";var Ld=class extends dn{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&co(t,this.catch.names),this.finally&&co(t,this.finally.names),t}},ws=class extends dn{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};ws.kind="catch";var xs=class extends dn{render(t){return"finally"+super.render(t)}};xs.kind="finally";var zd=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
27
- `:""},this._extScope=t,this._scope=new br.Scope({parent:t}),this._nodes=[new Od]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new Td(t,s,n)),s}const(t,r,n){return this._def(br.varKinds.const,t,r,n)}let(t,r,n){return this._def(br.varKinds.let,t,r,n)}var(t,r,n){return this._def(br.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new bu(t,r,n))}add(t,r){return this._leafNode(new $d(t,Q.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ie.nil&&this._leafNode(new Nd(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,ie.addCodeArg)(r,o));return r.push("}"),new ie._Code(r)}if(t,r,n){if(this._blockNode(new ao(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new ao(t))}else(){return this._elseNode(new Jo)}endIf(){return this._endBlockNode(ao,Jo)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Md(t),r)}forRange(t,r,n,o,s=this.opts.es5?br.varKinds.var:br.varKinds.let){let i=this._scope.toName(t);return this._for(new Bd(s,i,r,n),()=>o(i))}forOf(t,r,n,o=br.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let i=r instanceof ie.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ie._)`${i}.length`,a=>{this.var(s,(0,ie._)`${i}[${a}]`),n(s)})}return this._for(new wu("of",o,s,r),()=>n(s))}forIn(t,r,n,o=this.opts.es5?br.varKinds.var:br.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ie._)`Object.keys(${r})`,n);let s=this._scope.toName(t);return this._for(new wu("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(uo)}label(t){return this._leafNode(new kd(t))}break(t){return this._leafNode(new Rd(t))}return(t){let r=new bs;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(bs)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Ld;if(this._blockNode(o),this.code(t),r){let s=this.name("e");this._currNode=o.catch=new ws(s),r(s)}return n&&(this._currNode=o.finally=new xs,this.code(n)),this._endBlockNode(ws,xs)}throw(t){return this._leafNode(new Id(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=ie.nil,n,o){return this._blockNode(new Cs(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Cs)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof ao))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};Q.CodeGen=zd;function co(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function xu(e,t){return t instanceof ie._CodeOrName?co(e,t.names):e}function Yo(e,t,r){if(e instanceof ie.Name)return n(e);if(!o(e))return e;return new ie._Code(e._items.reduce((s,i)=>(i instanceof ie.Name&&(i=n(i)),i instanceof ie._Code?s.push(...i._items):s.push(i),s),[]));function n(s){let i=r[s.str];return i===void 0||t[s.str]!==1?s:(delete t[s.str],i)}function o(s){return s instanceof ie._Code&&s._items.some(i=>i instanceof ie.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function kO(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Qx(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ie._)`!${jd(e)}`}Q.not=Qx;var RO=Xx(Q.operators.AND);function IO(...e){return e.reduce(RO)}Q.and=IO;var NO=Xx(Q.operators.OR);function OO(...e){return e.reduce(NO)}Q.or=OO;function Xx(e){return(t,r)=>t===ie.nil?r:r===ie.nil?t:(0,ie._)`${jd(t)} ${e} ${jd(r)}`}function jd(e){return e instanceof ie.Name?e:(0,ie._)`(${e})`}});var pe=x(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.checkStrictMode=ee.getErrorPath=ee.Type=ee.useFunc=ee.setEvaluated=ee.evaluatedPropsToName=ee.mergeEvaluated=ee.eachItem=ee.unescapeJsonPointer=ee.escapeJsonPointer=ee.escapeFragment=ee.unescapeFragment=ee.schemaRefOrVal=ee.schemaHasRulesButRef=ee.schemaHasRules=ee.checkUnknownRules=ee.alwaysValidSchema=ee.toHash=void 0;var Ce=Y(),MO=Ds();function BO(e){let t={};for(let r of e)t[r]=!0;return t}ee.toHash=BO;function LO(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(r0(e,t),!n0(t,e.self.RULES.all))}ee.alwaysValidSchema=LO;function r0(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let s in t)o[s]||s0(e,`unknown keyword: "${s}"`)}ee.checkUnknownRules=r0;function n0(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}ee.schemaHasRules=n0;function zO(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}ee.schemaHasRulesButRef=zO;function jO({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Ce._)`${r}`}return(0,Ce._)`${e}${t}${(0,Ce.getProperty)(n)}`}ee.schemaRefOrVal=jO;function UO(e){return o0(decodeURIComponent(e))}ee.unescapeFragment=UO;function VO(e){return encodeURIComponent(Vd(e))}ee.escapeFragment=VO;function Vd(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ee.escapeJsonPointer=Vd;function o0(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ee.unescapeJsonPointer=o0;function HO(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}ee.eachItem=HO;function e0({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,s,i,a)=>{let u=i===void 0?s:i instanceof Ce.Name?(s instanceof Ce.Name?e(o,s,i):t(o,s,i),i):s instanceof Ce.Name?(t(o,i,s),s):r(s,i);return a===Ce.Name&&!(u instanceof Ce.Name)?n(o,u):u}}ee.mergeEvaluated={props:e0({mergeNames:(e,t,r)=>e.if((0,Ce._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Ce._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Ce._)`${r} || {}`).code((0,Ce._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Ce._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Ce._)`${r} || {}`),Hd(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:i0}),items:e0({mergeNames:(e,t,r)=>e.if((0,Ce._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Ce._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Ce._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Ce._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function i0(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Ce._)`{}`);return t!==void 0&&Hd(e,r,t),r}ee.evaluatedPropsToName=i0;function Hd(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Ce._)`${t}${(0,Ce.getProperty)(n)}`,!0))}ee.setEvaluated=Hd;var t0={};function qO(e,t){return e.scopeValue("func",{ref:t,code:t0[t.code]||(t0[t.code]=new MO._Code(t.code))})}ee.useFunc=qO;var Ud;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Ud||(ee.Type=Ud={}));function KO(e,t,r){if(e instanceof Ce.Name){let n=t===Ud.Num;return r?n?(0,Ce._)`"[" + ${e} + "]"`:(0,Ce._)`"['" + ${e} + "']"`:n?(0,Ce._)`"/" + ${e}`:(0,Ce._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Ce.getProperty)(e).toString():"/"+Vd(e)}ee.getErrorPath=KO;function s0(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}ee.checkStrictMode=s0});var fn=x(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var ht=Y(),GO={data:new ht.Name("data"),valCxt:new ht.Name("valCxt"),instancePath:new ht.Name("instancePath"),parentData:new ht.Name("parentData"),parentDataProperty:new ht.Name("parentDataProperty"),rootData:new ht.Name("rootData"),dynamicAnchors:new ht.Name("dynamicAnchors"),vErrors:new ht.Name("vErrors"),errors:new ht.Name("errors"),this:new ht.Name("this"),self:new ht.Name("self"),scope:new ht.Name("scope"),json:new ht.Name("json"),jsonPos:new ht.Name("jsonPos"),jsonLen:new ht.Name("jsonLen"),jsonPart:new ht.Name("jsonPart")};qd.default=GO});var Ss=x(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.extendErrors=yt.resetErrorsCount=yt.reportExtraError=yt.reportError=yt.keyword$DataError=yt.keywordError=void 0;var ue=Y(),Eu=pe(),Et=fn();yt.keywordError={message:({keyword:e})=>(0,ue.str)`must pass "${e}" keyword validation`};yt.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ue.str)`"${e}" keyword must be ${t} ($data)`:(0,ue.str)`"${e}" keyword is invalid ($data)`};function WO(e,t=yt.keywordError,r,n){let{it:o}=e,{gen:s,compositeRule:i,allErrors:a}=o,u=c0(e,t,r);n??(i||a)?a0(s,u):u0(o,(0,ue._)`[${u}]`)}yt.reportError=WO;function ZO(e,t=yt.keywordError,r){let{it:n}=e,{gen:o,compositeRule:s,allErrors:i}=n,a=c0(e,t,r);a0(o,a),s||i||u0(n,Et.default.vErrors)}yt.reportExtraError=ZO;function JO(e,t){e.assign(Et.default.errors,t),e.if((0,ue._)`${Et.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ue._)`${Et.default.vErrors}.length`,t),()=>e.assign(Et.default.vErrors,null)))}yt.resetErrorsCount=JO;function YO({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let i=e.name("err");e.forRange("i",o,Et.default.errors,a=>{e.const(i,(0,ue._)`${Et.default.vErrors}[${a}]`),e.if((0,ue._)`${i}.instancePath === undefined`,()=>e.assign((0,ue._)`${i}.instancePath`,(0,ue.strConcat)(Et.default.instancePath,s.errorPath))),e.assign((0,ue._)`${i}.schemaPath`,(0,ue.str)`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign((0,ue._)`${i}.schema`,r),e.assign((0,ue._)`${i}.data`,n))})}yt.extendErrors=YO;function a0(e,t){let r=e.const("err",t);e.if((0,ue._)`${Et.default.vErrors} === null`,()=>e.assign(Et.default.vErrors,(0,ue._)`[${r}]`),(0,ue._)`${Et.default.vErrors}.push(${r})`),e.code((0,ue._)`${Et.default.errors}++`)}function u0(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,ue._)`new ${e.ValidationError}(${t})`):(r.assign((0,ue._)`${n}.errors`,t),r.return(!1))}var lo={keyword:new ue.Name("keyword"),schemaPath:new ue.Name("schemaPath"),params:new ue.Name("params"),propertyName:new ue.Name("propertyName"),message:new ue.Name("message"),schema:new ue.Name("schema"),parentSchema:new ue.Name("parentSchema")};function c0(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ue._)`{}`:QO(e,t,r)}function QO(e,t,r={}){let{gen:n,it:o}=e,s=[XO(o,r),eM(e,r)];return tM(e,t,s),n.object(...s)}function XO({errorPath:e},{instancePath:t}){let r=t?(0,ue.str)`${e}${(0,Eu.getErrorPath)(t,Eu.Type.Str)}`:e;return[Et.default.instancePath,(0,ue.strConcat)(Et.default.instancePath,r)]}function eM({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,ue.str)`${t}/${e}`;return r&&(o=(0,ue.str)`${o}${(0,Eu.getErrorPath)(r,Eu.Type.Str)}`),[lo.schemaPath,o]}function tM(e,{params:t,message:r},n){let{keyword:o,data:s,schemaValue:i,it:a}=e,{opts:u,propertyName:c,topSchemaRef:l,schemaPath:p}=a;n.push([lo.keyword,o],[lo.params,typeof t=="function"?t(e):t||(0,ue._)`{}`]),u.messages&&n.push([lo.message,typeof r=="function"?r(e):r]),u.verbose&&n.push([lo.schema,i],[lo.parentSchema,(0,ue._)`${l}${p}`],[Et.default.data,s]),c&&n.push([lo.propertyName,c])}});var p0=x(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.boolOrEmptySchema=Qo.topBoolOrEmptySchema=void 0;var rM=Ss(),nM=Y(),oM=fn(),iM={message:"boolean schema is false"};function sM(e){let{gen:t,schema:r,validateName:n}=e;r===!1?l0(e,!1):typeof r=="object"&&r.$async===!0?t.return(oM.default.data):(t.assign((0,nM._)`${n}.errors`,null),t.return(!0))}Qo.topBoolOrEmptySchema=sM;function aM(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),l0(e)):r.var(t,!0)}Qo.boolOrEmptySchema=aM;function l0(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,rM.reportError)(o,iM,void 0,t)}});var Kd=x(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.getRules=Xo.isJSONType=void 0;var uM=["string","number","integer","boolean","null","object","array"],cM=new Set(uM);function lM(e){return typeof e=="string"&&cM.has(e)}Xo.isJSONType=lM;function pM(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Xo.getRules=pM});var Gd=x($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.shouldUseRule=$n.shouldUseGroup=$n.schemaHasRulesForType=void 0;function dM({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&d0(e,n)}$n.schemaHasRulesForType=dM;function d0(e,t){return t.rules.some(r=>f0(e,r))}$n.shouldUseGroup=d0;function f0(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}$n.shouldUseRule=f0});var Es=x(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.reportTypeError=Dt.checkDataTypes=Dt.checkDataType=Dt.coerceAndCheckDataType=Dt.getJSONTypes=Dt.getSchemaTypes=Dt.DataType=void 0;var fM=Kd(),mM=Gd(),gM=Ss(),W=Y(),m0=pe(),ei;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ei||(Dt.DataType=ei={}));function hM(e){let t=g0(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Dt.getSchemaTypes=hM;function g0(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(fM.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Dt.getJSONTypes=g0;function yM(e,t){let{gen:r,data:n,opts:o}=e,s=DM(t,o.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&(0,mM.schemaHasRulesForType)(e,t[0]));if(i){let a=Zd(t,n,o.strictNumbers,ei.Wrong);r.if(a,()=>{s.length?vM(e,t,s):Jd(e)})}return i}Dt.coerceAndCheckDataType=yM;var h0=new Set(["string","number","integer","boolean","null"]);function DM(e,t){return t?e.filter(r=>h0.has(r)||t==="array"&&r==="array"):[]}function vM(e,t,r){let{gen:n,data:o,opts:s}=e,i=n.let("dataType",(0,W._)`typeof ${o}`),a=n.let("coerced",(0,W._)`undefined`);s.coerceTypes==="array"&&n.if((0,W._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,W._)`${o}[0]`).assign(i,(0,W._)`typeof ${o}`).if(Zd(t,o,s.strictNumbers),()=>n.assign(a,o))),n.if((0,W._)`${a} !== undefined`);for(let c of r)(h0.has(c)||c==="array"&&s.coerceTypes==="array")&&u(c);n.else(),Jd(e),n.endIf(),n.if((0,W._)`${a} !== undefined`,()=>{n.assign(o,a),CM(e,a)});function u(c){switch(c){case"string":n.elseIf((0,W._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,W._)`"" + ${o}`).elseIf((0,W._)`${o} === null`).assign(a,(0,W._)`""`);return;case"number":n.elseIf((0,W._)`${i} == "boolean" || ${o} === null
26
+ `)});let h=u(`HTTP/${e.httpVersion} ${g.statusCode} ${g.statusMessage}`,m.headers);t.destroyed?g.resume():(t.write(h),g.on("data",y=>{f(y)}),g.on("end",()=>{f(""),t.destroySoon()}))}),p.end()}gt.WS_PASSES={checkMethodAndHeader:Xv,XHeaders:eC,stream:tC}});var nC=x(ir=>{"use strict";var r1=ir&&ir.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),n1=ir&&ir.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),rC=ir&&ir.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&r1(r,t,n[o]);return n1(r,t),r}})(),o1=ir&&ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ir,"__esModule",{value:!0});ir.ProxyServer=void 0;var i1=rC(G("node:http")),s1=rC(G("node:http2")),a1=Yv(),u1=fp(),c1=G("node:events"),l1=o1(Ga()),p1=Ji(),Ja=(0,l1.default)("http-proxy-3"),mp=class e extends c1.EventEmitter{constructor(t={}){super(),this.createRightProxy=r=>(Ja("createRightProxy",{type:r}),n=>(...o)=>{let s=o[0];Ja("proxy: ",{type:r,path:s.url});let i=o[1],a=r==="ws"?this.wsPasses:this.webPasses;r=="ws"&&i.on("error",d=>{this.emit("error",d,s,i)});let u=o.length-1,c,l;typeof o[u]=="function"&&(l=o[u],u--);let p;!(o[u]instanceof Buffer)&&o[u]!==i?(p={...n,...o[u]},u--):p={...n},o[u]instanceof Buffer&&(c=o[u]);for(let d of["target","forward"])typeof p[d]=="string"&&(p[d]=(0,p1.toURL)(p[d]));if(!p.target&&!p.forward){this.emit("error",new Error("Must set target or forward"),s,i);return}for(let d of a)if(d(s,i,p,c,this,l))break}),this.onError=r=>{if(this.listeners("error").length===1)throw r},this.listen=(r,n)=>{Ja("listen",{port:r,hostname:n});let o=(s,i)=>{this.web(s,i)};return this._server=this.options.ssl?s1.createSecureServer({...this.options.ssl,allowHTTP1:!0},o):i1.createServer(o),this.options.ws&&this._server.on("upgrade",(s,i,a)=>{this.ws(s,i,a)}),this._server.listen(r,n),this},this.address=()=>this._server?.address(),this.close=r=>{if(this._server==null){r?.();return}this._server.close(n=>{this._server=null,r?.(n)})},this.before=(r,n,o)=>{if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");let s=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(s.forEach((a,u)=>{a.name===n&&(i=u)}),i===!1)throw new Error("No such pass");s.splice(i,0,o)},this.after=(r,n,o)=>{if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");let s=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(s.forEach((a,u)=>{a.name===n&&(i=u)}),i===!1)throw new Error("No such pass");s.splice(i++,0,o)},Ja("creating a ProxyServer",t),t.prependPath=t.prependPath!==!1,this.options=t,this.web=this.createRightProxy("web")(t),this.ws=this.createRightProxy("ws")(t),this.webPasses=Object.values(a1.WEB_PASSES),this.wsPasses=Object.values(u1.WS_PASSES),this.on("error",this.onError)}static createProxyServer(t){return new e(t)}static createServer(t){return new e(t)}static createProxy(t){return new e(t)}};ir.ProxyServer=mp});var oC=x(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.numOpenSockets=Hr.ProxyServer=void 0;Hr.createProxyServer=hp;Hr.createServer=hp;Hr.createProxy=hp;var gp=nC();Object.defineProperty(Hr,"ProxyServer",{enumerable:!0,get:function(){return gp.ProxyServer}});var d1=fp();Object.defineProperty(Hr,"numOpenSockets",{enumerable:!0,get:function(){return d1.numOpenSockets}});function hp(e={}){return new gp.ProxyServer(e)}Hr.default=gp.ProxyServer});var aC=x(yp=>{"use strict";yp.parse=v1;yp.serialize=C1;var f1=Object.prototype.toString,m1=Object.prototype.hasOwnProperty,g1=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,h1=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,y1=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,D1=/^[\u0020-\u003A\u003D-\u007E]*$/;function v1(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");var r={},n=e.length;if(n<2)return r;var o=t&&t.decode||b1,s=0,i=0,a=0;do{if(i=e.indexOf("=",s),i===-1)break;if(a=e.indexOf(";",s),a===-1)a=n;else if(i>a){s=e.lastIndexOf(";",i-1)+1;continue}var u=iC(e,s,i),c=sC(e,i,u),l=e.slice(u,c);if(!m1.call(r,l)){var p=iC(e,i+1,a),d=sC(e,a,p);e.charCodeAt(p)===34&&e.charCodeAt(d-1)===34&&(p++,d--);var g=e.slice(p,d);r[l]=x1(g,o)}s=a+1}while(s<n);return r}function iC(e,t,r){do{var n=e.charCodeAt(t);if(n!==32&&n!==9)return t}while(++t<r);return r}function sC(e,t,r){for(;t>r;){var n=e.charCodeAt(--t);if(n!==32&&n!==9)return t+1}return r}function C1(e,t,r){var n=r&&r.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!g1.test(e))throw new TypeError("argument name is invalid");var o=n(t);if(!h1.test(o))throw new TypeError("argument val is invalid");var s=e+"="+o;if(!r)return s;if(r.maxAge!=null){var i=Math.floor(r.maxAge);if(!isFinite(i))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+i}if(r.domain){if(!y1.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!D1.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){var a=r.expires;if(!w1(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.partitioned&&(s+="; Partitioned"),r.priority){var u=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(u){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var c=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(c){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function b1(e){return e.indexOf("%")!==-1?decodeURIComponent(e):e}function w1(e){return f1.call(e)==="[object Date]"}function x1(e,t){try{return t(e)}catch{return e}}});var lC=x(Ya=>{var cC=G("crypto");Ya.sign=function(e,t){if(typeof e!="string")throw new TypeError("Cookie value must be provided as a string.");if(typeof t!="string")throw new TypeError("Secret string must be provided.");return e+"."+cC.createHmac("sha256",t).update(e).digest("base64").replace(/\=+$/,"")};Ya.unsign=function(e,t){if(typeof e!="string")throw new TypeError("Signed cookie string must be provided.");if(typeof t!="string")throw new TypeError("Secret string must be provided.");var r=e.slice(0,e.lastIndexOf(".")),n=Ya.sign(r,t);return uC(n)==uC(e)?r:!1};function uC(e){return cC.createHash("sha1").update(e).digest("hex")}});var mC=x((xZ,Ho)=>{"use strict";var S1=aC(),E1=lC();Ho.exports=P1;Ho.exports.JSONCookie=pC;Ho.exports.JSONCookies=Dp;Ho.exports.signedCookie=dC;Ho.exports.signedCookies=fC;function P1(e,t){var r=!e||Array.isArray(e)?e||[]:[e];return function(o,s,i){if(o.cookies)return i();var a=o.headers.cookie;if(o.secret=r[0],o.cookies=Object.create(null),o.signedCookies=Object.create(null),!a)return i();o.cookies=S1.parse(a,t),r.length!==0&&(o.signedCookies=fC(o.cookies,r),o.signedCookies=Dp(o.signedCookies)),o.cookies=Dp(o.cookies),i()}}function pC(e){if(!(typeof e!="string"||e.substr(0,2)!=="j:"))try{return JSON.parse(e.slice(2))}catch{return}}function Dp(e){for(var t=Object.keys(e),r,n,o=0;o<t.length;o++)r=t[o],n=pC(e[r]),n&&(e[r]=n);return e}function dC(e,t){if(typeof e=="string"){if(e.substr(0,2)!=="s:")return e;for(var r=!t||Array.isArray(t)?t||[]:[t],n=0;n<r.length;n++){var o=E1.unsign(e.slice(2),r[n]);if(o!==!1)return o}return!1}}function fC(e,t){for(var r=Object.keys(e),n,o,s=Object.create(null),i,a=0;a<r.length;a++)o=r[a],i=e[o],n=dC(i,t),i!==n&&(s[o]=n,delete e[o]);return s}});var Ds=x(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.regexpCode=le.getEsmExportName=le.getProperty=le.safeStringify=le.stringify=le.strConcat=le.addCodeArg=le.str=le._=le.nil=le._Code=le.Name=le.IDENTIFIER=le._CodeOrName=void 0;var hs=class{};le._CodeOrName=hs;le.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var so=class extends hs{constructor(t){if(super(),!le.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};le.Name=so;var cr=class extends hs{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof so&&(r[n.str]=(r[n.str]||0)+1),r),{})}};le._Code=cr;le.nil=new cr("");function Yx(e,...t){let r=[e[0]],n=0;for(;n<t.length;)_d(r,t[n]),r.push(e[++n]);return new cr(r)}le._=Yx;var Pd=new cr("+");function Qx(e,...t){let r=[ys(e[0])],n=0;for(;n<t.length;)r.push(Pd),_d(r,t[n]),r.push(Pd,ys(e[++n]));return U2(r),new cr(r)}le.str=Qx;function _d(e,t){t instanceof cr?e.push(...t._items):t instanceof so?e.push(t):e.push(q2(t))}le.addCodeArg=_d;function U2(e){let t=1;for(;t<e.length-1;){if(e[t]===Pd){let r=V2(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function V2(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof so||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof so))return`"${e}${t.slice(1)}`}function H2(e,t){return t.emptyStr()?e:e.emptyStr()?t:Qx`${e}${t}`}le.strConcat=H2;function q2(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ys(Array.isArray(e)?e.join(","):e)}function K2(e){return new cr(ys(e))}le.stringify=K2;function ys(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}le.safeStringify=ys;function G2(e){return typeof e=="string"&&le.IDENTIFIER.test(e)?new cr(`.${e}`):Yx`[${e}]`}le.getProperty=G2;function W2(e){if(typeof e=="string"&&le.IDENTIFIER.test(e))return new cr(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}le.getEsmExportName=W2;function Z2(e){return new cr(e.toString())}le.regexpCode=Z2});var Fd=x(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.ValueScope=Lt.ValueScopeName=Lt.Scope=Lt.varKinds=Lt.UsedValueState=void 0;var Mt=Ds(),Ad=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},vu;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(vu||(Lt.UsedValueState=vu={}));Lt.varKinds={const:new Mt.Name("const"),let:new Mt.Name("let"),var:new Mt.Name("var")};var Cu=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Mt.Name?t:this.name(t)}name(t){return new Mt.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};Lt.Scope=Cu;var bu=class extends Mt.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Mt._)`.${new Mt.Name(r)}[${n}]`}};Lt.ValueScopeName=bu;var J2=(0,Mt._)`\n`,Td=class extends Cu{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?J2:Mt.nil}}get(){return this._scope}name(t){return new bu(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:s}=o,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let l=a.get(i);if(l)return l}else a=this._values[s]=new Map;a.set(i,o);let u=this._scope[s]||(this._scope[s]=[]),c=u.length;return u[c]=r.ref,o.setValue(r,{property:s,itemIndex:c}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Mt._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let s=Mt.nil;for(let i in t){let a=t[i];if(!a)continue;let u=n[i]=n[i]||new Map;a.forEach(c=>{if(u.has(c))return;u.set(c,vu.Started);let l=r(c);if(l){let p=this.opts.es5?Lt.varKinds.var:Lt.varKinds.const;s=(0,Mt._)`${s}${p} ${c} = ${l};${this.opts._n}`}else if(l=o?.(c))s=(0,Mt._)`${s}${l}${this.opts._n}`;else throw new Ad(c);u.set(c,vu.Completed)})}return s}};Lt.ValueScope=Td});var Y=x(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.or=Q.and=Q.not=Q.CodeGen=Q.operators=Q.varKinds=Q.ValueScopeName=Q.ValueScope=Q.Scope=Q.Name=Q.regexpCode=Q.stringify=Q.getProperty=Q.nil=Q.strConcat=Q.str=Q._=void 0;var ie=Ds(),br=Fd(),Fn=Ds();Object.defineProperty(Q,"_",{enumerable:!0,get:function(){return Fn._}});Object.defineProperty(Q,"str",{enumerable:!0,get:function(){return Fn.str}});Object.defineProperty(Q,"strConcat",{enumerable:!0,get:function(){return Fn.strConcat}});Object.defineProperty(Q,"nil",{enumerable:!0,get:function(){return Fn.nil}});Object.defineProperty(Q,"getProperty",{enumerable:!0,get:function(){return Fn.getProperty}});Object.defineProperty(Q,"stringify",{enumerable:!0,get:function(){return Fn.stringify}});Object.defineProperty(Q,"regexpCode",{enumerable:!0,get:function(){return Fn.regexpCode}});Object.defineProperty(Q,"Name",{enumerable:!0,get:function(){return Fn.Name}});var Eu=Fd();Object.defineProperty(Q,"Scope",{enumerable:!0,get:function(){return Eu.Scope}});Object.defineProperty(Q,"ValueScope",{enumerable:!0,get:function(){return Eu.ValueScope}});Object.defineProperty(Q,"ValueScopeName",{enumerable:!0,get:function(){return Eu.ValueScopeName}});Object.defineProperty(Q,"varKinds",{enumerable:!0,get:function(){return Eu.varKinds}});Q.operators={GT:new ie._Code(">"),GTE:new ie._Code(">="),LT:new ie._Code("<"),LTE:new ie._Code("<="),EQ:new ie._Code("==="),NEQ:new ie._Code("!=="),NOT:new ie._Code("!"),OR:new ie._Code("||"),AND:new ie._Code("&&"),ADD:new ie._Code("+")};var pn=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},Rd=class extends pn{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?br.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Yo(this.rhs,t,r)),this}get names(){return this.rhs instanceof ie._CodeOrName?this.rhs.names:{}}},wu=class extends pn{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof ie.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Yo(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ie.Name?{}:{...this.lhs.names};return Su(t,this.rhs)}},$d=class extends wu{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},kd=class extends pn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Id=class extends pn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Nd=class extends pn{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Od=class extends pn{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Yo(this.code,t,r),this}get names(){return this.code instanceof ie._CodeOrName?this.code.names:{}}},vs=class extends pn{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(t,r)||(Y2(t,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>co(t,r.names),{})}},dn=class extends vs{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Md=class extends vs{},Jo=class extends dn{};Jo.kind="else";var ao=class e extends dn{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Jo(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Xx(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Yo(this.condition,t,r),this}get names(){let t=super.names;return Su(t,this.condition),this.else&&co(t,this.else.names),t}};ao.kind="if";var uo=class extends dn{};uo.kind="for";var Ld=class extends uo{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Yo(this.iteration,t,r),this}get names(){return co(super.names,this.iteration.names)}},Bd=class extends uo{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?br.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(t)}get names(){let t=Su(super.names,this.from);return Su(t,this.to)}},xu=class extends uo{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Yo(this.iterable,t,r),this}get names(){return co(super.names,this.iterable.names)}},Cs=class extends dn{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Cs.kind="func";var bs=class extends vs{render(t){return"return "+super.render(t)}};bs.kind="return";var zd=class extends dn{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&co(t,this.catch.names),this.finally&&co(t,this.finally.names),t}},ws=class extends dn{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};ws.kind="catch";var xs=class extends dn{render(t){return"finally"+super.render(t)}};xs.kind="finally";var jd=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
27
+ `:""},this._extScope=t,this._scope=new br.Scope({parent:t}),this._nodes=[new Md]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new Rd(t,s,n)),s}const(t,r,n){return this._def(br.varKinds.const,t,r,n)}let(t,r,n){return this._def(br.varKinds.let,t,r,n)}var(t,r,n){return this._def(br.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new wu(t,r,n))}add(t,r){return this._leafNode(new $d(t,Q.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ie.nil&&this._leafNode(new Od(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,ie.addCodeArg)(r,o));return r.push("}"),new ie._Code(r)}if(t,r,n){if(this._blockNode(new ao(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new ao(t))}else(){return this._elseNode(new Jo)}endIf(){return this._endBlockNode(ao,Jo)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Ld(t),r)}forRange(t,r,n,o,s=this.opts.es5?br.varKinds.var:br.varKinds.let){let i=this._scope.toName(t);return this._for(new Bd(s,i,r,n),()=>o(i))}forOf(t,r,n,o=br.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let i=r instanceof ie.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ie._)`${i}.length`,a=>{this.var(s,(0,ie._)`${i}[${a}]`),n(s)})}return this._for(new xu("of",o,s,r),()=>n(s))}forIn(t,r,n,o=this.opts.es5?br.varKinds.var:br.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ie._)`Object.keys(${r})`,n);let s=this._scope.toName(t);return this._for(new xu("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(uo)}label(t){return this._leafNode(new kd(t))}break(t){return this._leafNode(new Id(t))}return(t){let r=new bs;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(bs)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new zd;if(this._blockNode(o),this.code(t),r){let s=this.name("e");this._currNode=o.catch=new ws(s),r(s)}return n&&(this._currNode=o.finally=new xs,this.code(n)),this._endBlockNode(ws,xs)}throw(t){return this._leafNode(new Nd(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=ie.nil,n,o){return this._blockNode(new Cs(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Cs)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof ao))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};Q.CodeGen=jd;function co(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Su(e,t){return t instanceof ie._CodeOrName?co(e,t.names):e}function Yo(e,t,r){if(e instanceof ie.Name)return n(e);if(!o(e))return e;return new ie._Code(e._items.reduce((s,i)=>(i instanceof ie.Name&&(i=n(i)),i instanceof ie._Code?s.push(...i._items):s.push(i),s),[]));function n(s){let i=r[s.str];return i===void 0||t[s.str]!==1?s:(delete t[s.str],i)}function o(s){return s instanceof ie._Code&&s._items.some(i=>i instanceof ie.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function Y2(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Xx(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ie._)`!${Ud(e)}`}Q.not=Xx;var Q2=e0(Q.operators.AND);function X2(...e){return e.reduce(Q2)}Q.and=X2;var eM=e0(Q.operators.OR);function tM(...e){return e.reduce(eM)}Q.or=tM;function e0(e){return(t,r)=>t===ie.nil?r:r===ie.nil?t:(0,ie._)`${Ud(t)} ${e} ${Ud(r)}`}function Ud(e){return e instanceof ie.Name?e:(0,ie._)`(${e})`}});var pe=x(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.checkStrictMode=ee.getErrorPath=ee.Type=ee.useFunc=ee.setEvaluated=ee.evaluatedPropsToName=ee.mergeEvaluated=ee.eachItem=ee.unescapeJsonPointer=ee.escapeJsonPointer=ee.escapeFragment=ee.unescapeFragment=ee.schemaRefOrVal=ee.schemaHasRulesButRef=ee.schemaHasRules=ee.checkUnknownRules=ee.alwaysValidSchema=ee.toHash=void 0;var be=Y(),rM=Ds();function nM(e){let t={};for(let r of e)t[r]=!0;return t}ee.toHash=nM;function oM(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(n0(e,t),!o0(t,e.self.RULES.all))}ee.alwaysValidSchema=oM;function n0(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let s in t)o[s]||a0(e,`unknown keyword: "${s}"`)}ee.checkUnknownRules=n0;function o0(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}ee.schemaHasRules=o0;function iM(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}ee.schemaHasRulesButRef=iM;function sM({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,be._)`${r}`}return(0,be._)`${e}${t}${(0,be.getProperty)(n)}`}ee.schemaRefOrVal=sM;function aM(e){return i0(decodeURIComponent(e))}ee.unescapeFragment=aM;function uM(e){return encodeURIComponent(Hd(e))}ee.escapeFragment=uM;function Hd(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ee.escapeJsonPointer=Hd;function i0(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ee.unescapeJsonPointer=i0;function cM(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}ee.eachItem=cM;function t0({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,s,i,a)=>{let u=i===void 0?s:i instanceof be.Name?(s instanceof be.Name?e(o,s,i):t(o,s,i),i):s instanceof be.Name?(t(o,i,s),s):r(s,i);return a===be.Name&&!(u instanceof be.Name)?n(o,u):u}}ee.mergeEvaluated={props:t0({mergeNames:(e,t,r)=>e.if((0,be._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,be._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,be._)`${r} || {}`).code((0,be._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,be._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,be._)`${r} || {}`),qd(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:s0}),items:t0({mergeNames:(e,t,r)=>e.if((0,be._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,be._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,be._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,be._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function s0(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,be._)`{}`);return t!==void 0&&qd(e,r,t),r}ee.evaluatedPropsToName=s0;function qd(e,t,r){Object.keys(r).forEach(n=>e.assign((0,be._)`${t}${(0,be.getProperty)(n)}`,!0))}ee.setEvaluated=qd;var r0={};function lM(e,t){return e.scopeValue("func",{ref:t,code:r0[t.code]||(r0[t.code]=new rM._Code(t.code))})}ee.useFunc=lM;var Vd;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Vd||(ee.Type=Vd={}));function pM(e,t,r){if(e instanceof be.Name){let n=t===Vd.Num;return r?n?(0,be._)`"[" + ${e} + "]"`:(0,be._)`"['" + ${e} + "']"`:n?(0,be._)`"/" + ${e}`:(0,be._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,be.getProperty)(e).toString():"/"+Hd(e)}ee.getErrorPath=pM;function a0(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}ee.checkStrictMode=a0});var fn=x(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});var yt=Y(),dM={data:new yt.Name("data"),valCxt:new yt.Name("valCxt"),instancePath:new yt.Name("instancePath"),parentData:new yt.Name("parentData"),parentDataProperty:new yt.Name("parentDataProperty"),rootData:new yt.Name("rootData"),dynamicAnchors:new yt.Name("dynamicAnchors"),vErrors:new yt.Name("vErrors"),errors:new yt.Name("errors"),this:new yt.Name("this"),self:new yt.Name("self"),scope:new yt.Name("scope"),json:new yt.Name("json"),jsonPos:new yt.Name("jsonPos"),jsonLen:new yt.Name("jsonLen"),jsonPart:new yt.Name("jsonPart")};Kd.default=dM});var Ss=x(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.extendErrors=Dt.resetErrorsCount=Dt.reportExtraError=Dt.reportError=Dt.keyword$DataError=Dt.keywordError=void 0;var ue=Y(),Pu=pe(),Pt=fn();Dt.keywordError={message:({keyword:e})=>(0,ue.str)`must pass "${e}" keyword validation`};Dt.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ue.str)`"${e}" keyword must be ${t} ($data)`:(0,ue.str)`"${e}" keyword is invalid ($data)`};function fM(e,t=Dt.keywordError,r,n){let{it:o}=e,{gen:s,compositeRule:i,allErrors:a}=o,u=l0(e,t,r);n??(i||a)?u0(s,u):c0(o,(0,ue._)`[${u}]`)}Dt.reportError=fM;function mM(e,t=Dt.keywordError,r){let{it:n}=e,{gen:o,compositeRule:s,allErrors:i}=n,a=l0(e,t,r);u0(o,a),s||i||c0(n,Pt.default.vErrors)}Dt.reportExtraError=mM;function gM(e,t){e.assign(Pt.default.errors,t),e.if((0,ue._)`${Pt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ue._)`${Pt.default.vErrors}.length`,t),()=>e.assign(Pt.default.vErrors,null)))}Dt.resetErrorsCount=gM;function hM({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let i=e.name("err");e.forRange("i",o,Pt.default.errors,a=>{e.const(i,(0,ue._)`${Pt.default.vErrors}[${a}]`),e.if((0,ue._)`${i}.instancePath === undefined`,()=>e.assign((0,ue._)`${i}.instancePath`,(0,ue.strConcat)(Pt.default.instancePath,s.errorPath))),e.assign((0,ue._)`${i}.schemaPath`,(0,ue.str)`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign((0,ue._)`${i}.schema`,r),e.assign((0,ue._)`${i}.data`,n))})}Dt.extendErrors=hM;function u0(e,t){let r=e.const("err",t);e.if((0,ue._)`${Pt.default.vErrors} === null`,()=>e.assign(Pt.default.vErrors,(0,ue._)`[${r}]`),(0,ue._)`${Pt.default.vErrors}.push(${r})`),e.code((0,ue._)`${Pt.default.errors}++`)}function c0(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,ue._)`new ${e.ValidationError}(${t})`):(r.assign((0,ue._)`${n}.errors`,t),r.return(!1))}var lo={keyword:new ue.Name("keyword"),schemaPath:new ue.Name("schemaPath"),params:new ue.Name("params"),propertyName:new ue.Name("propertyName"),message:new ue.Name("message"),schema:new ue.Name("schema"),parentSchema:new ue.Name("parentSchema")};function l0(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ue._)`{}`:yM(e,t,r)}function yM(e,t,r={}){let{gen:n,it:o}=e,s=[DM(o,r),vM(e,r)];return CM(e,t,s),n.object(...s)}function DM({errorPath:e},{instancePath:t}){let r=t?(0,ue.str)`${e}${(0,Pu.getErrorPath)(t,Pu.Type.Str)}`:e;return[Pt.default.instancePath,(0,ue.strConcat)(Pt.default.instancePath,r)]}function vM({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,ue.str)`${t}/${e}`;return r&&(o=(0,ue.str)`${o}${(0,Pu.getErrorPath)(r,Pu.Type.Str)}`),[lo.schemaPath,o]}function CM(e,{params:t,message:r},n){let{keyword:o,data:s,schemaValue:i,it:a}=e,{opts:u,propertyName:c,topSchemaRef:l,schemaPath:p}=a;n.push([lo.keyword,o],[lo.params,typeof t=="function"?t(e):t||(0,ue._)`{}`]),u.messages&&n.push([lo.message,typeof r=="function"?r(e):r]),u.verbose&&n.push([lo.schema,i],[lo.parentSchema,(0,ue._)`${l}${p}`],[Pt.default.data,s]),c&&n.push([lo.propertyName,c])}});var d0=x(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.boolOrEmptySchema=Qo.topBoolOrEmptySchema=void 0;var bM=Ss(),wM=Y(),xM=fn(),SM={message:"boolean schema is false"};function EM(e){let{gen:t,schema:r,validateName:n}=e;r===!1?p0(e,!1):typeof r=="object"&&r.$async===!0?t.return(xM.default.data):(t.assign((0,wM._)`${n}.errors`,null),t.return(!0))}Qo.topBoolOrEmptySchema=EM;function PM(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),p0(e)):r.var(t,!0)}Qo.boolOrEmptySchema=PM;function p0(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,bM.reportError)(o,SM,void 0,t)}});var Gd=x(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.getRules=Xo.isJSONType=void 0;var _M=["string","number","integer","boolean","null","object","array"],AM=new Set(_M);function TM(e){return typeof e=="string"&&AM.has(e)}Xo.isJSONType=TM;function FM(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Xo.getRules=FM});var Wd=x(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.shouldUseRule=Rn.shouldUseGroup=Rn.schemaHasRulesForType=void 0;function RM({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&f0(e,n)}Rn.schemaHasRulesForType=RM;function f0(e,t){return t.rules.some(r=>m0(e,r))}Rn.shouldUseGroup=f0;function m0(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Rn.shouldUseRule=m0});var Es=x(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.reportTypeError=vt.checkDataTypes=vt.checkDataType=vt.coerceAndCheckDataType=vt.getJSONTypes=vt.getSchemaTypes=vt.DataType=void 0;var $M=Gd(),kM=Wd(),IM=Ss(),W=Y(),g0=pe(),ei;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ei||(vt.DataType=ei={}));function NM(e){let t=h0(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}vt.getSchemaTypes=NM;function h0(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every($M.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}vt.getJSONTypes=h0;function OM(e,t){let{gen:r,data:n,opts:o}=e,s=MM(t,o.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&(0,kM.schemaHasRulesForType)(e,t[0]));if(i){let a=Jd(t,n,o.strictNumbers,ei.Wrong);r.if(a,()=>{s.length?LM(e,t,s):Yd(e)})}return i}vt.coerceAndCheckDataType=OM;var y0=new Set(["string","number","integer","boolean","null"]);function MM(e,t){return t?e.filter(r=>y0.has(r)||t==="array"&&r==="array"):[]}function LM(e,t,r){let{gen:n,data:o,opts:s}=e,i=n.let("dataType",(0,W._)`typeof ${o}`),a=n.let("coerced",(0,W._)`undefined`);s.coerceTypes==="array"&&n.if((0,W._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,W._)`${o}[0]`).assign(i,(0,W._)`typeof ${o}`).if(Jd(t,o,s.strictNumbers),()=>n.assign(a,o))),n.if((0,W._)`${a} !== undefined`);for(let c of r)(y0.has(c)||c==="array"&&s.coerceTypes==="array")&&u(c);n.else(),Yd(e),n.endIf(),n.if((0,W._)`${a} !== undefined`,()=>{n.assign(o,a),BM(e,a)});function u(c){switch(c){case"string":n.elseIf((0,W._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,W._)`"" + ${o}`).elseIf((0,W._)`${o} === null`).assign(a,(0,W._)`""`);return;case"number":n.elseIf((0,W._)`${i} == "boolean" || ${o} === null
28
28
  || (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,W._)`+${o}`);return;case"integer":n.elseIf((0,W._)`${i} === "boolean" || ${o} === null
29
29
  || (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,W._)`+${o}`);return;case"boolean":n.elseIf((0,W._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,W._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf((0,W._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf((0,W._)`${i} === "string" || ${i} === "number"
30
- || ${i} === "boolean" || ${o} === null`).assign(a,(0,W._)`[${o}]`)}}}function CM({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,W._)`${t} !== undefined`,()=>e.assign((0,W._)`${t}[${r}]`,n))}function Wd(e,t,r,n=ei.Correct){let o=n===ei.Correct?W.operators.EQ:W.operators.NEQ,s;switch(e){case"null":return(0,W._)`${t} ${o} null`;case"array":s=(0,W._)`Array.isArray(${t})`;break;case"object":s=(0,W._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=i((0,W._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=i();break;default:return(0,W._)`typeof ${t} ${o} ${e}`}return n===ei.Correct?s:(0,W.not)(s);function i(a=W.nil){return(0,W.and)((0,W._)`typeof ${t} == "number"`,a,r?(0,W._)`isFinite(${t})`:W.nil)}}Dt.checkDataType=Wd;function Zd(e,t,r,n){if(e.length===1)return Wd(e[0],t,r,n);let o,s=(0,m0.toHash)(e);if(s.array&&s.object){let i=(0,W._)`typeof ${t} != "object"`;o=s.null?i:(0,W._)`!${t} || ${i}`,delete s.null,delete s.array,delete s.object}else o=W.nil;s.number&&delete s.integer;for(let i in s)o=(0,W.and)(o,Wd(i,t,r,n));return o}Dt.checkDataTypes=Zd;var bM={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,W._)`{type: ${e}}`:(0,W._)`{type: ${t}}`};function Jd(e){let t=wM(e);(0,gM.reportError)(t,bM)}Dt.reportTypeError=Jd;function wM(e){let{gen:t,data:r,schema:n}=e,o=(0,m0.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var D0=x(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.assignDefaults=void 0;var ti=Y(),xM=pe();function SM(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)y0(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,s)=>y0(e,s,o.default))}Pu.assignDefaults=SM;function y0(e,t,r){let{gen:n,compositeRule:o,data:s,opts:i}=e;if(r===void 0)return;let a=(0,ti._)`${s}${(0,ti.getProperty)(t)}`;if(o){(0,xM.checkStrictMode)(e,`default is ignored for: ${a}`);return}let u=(0,ti._)`${a} === undefined`;i.useDefaults==="empty"&&(u=(0,ti._)`${u} || ${a} === null || ${a} === ""`),n.if(u,(0,ti._)`${a} = ${(0,ti.stringify)(r)}`)}});var lr=x(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.validateUnion=De.validateArray=De.usePattern=De.callValidateCode=De.schemaProperties=De.allSchemaProperties=De.noPropertyInData=De.propertyInData=De.isOwnProperty=De.hasPropFunc=De.reportMissingProp=De.checkMissingProp=De.checkReportMissingProp=void 0;var $e=Y(),Yd=pe(),kn=fn(),EM=pe();function PM(e,t){let{gen:r,data:n,it:o}=e;r.if(Xd(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,$e._)`${t}`},!0),e.error()})}De.checkReportMissingProp=PM;function _M({gen:e,data:t,it:{opts:r}},n,o){return(0,$e.or)(...n.map(s=>(0,$e.and)(Xd(e,t,s,r.ownProperties),(0,$e._)`${o} = ${s}`)))}De.checkMissingProp=_M;function AM(e,t){e.setParams({missingProperty:t},!0),e.error()}De.reportMissingProp=AM;function v0(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,$e._)`Object.prototype.hasOwnProperty`})}De.hasPropFunc=v0;function Qd(e,t,r){return(0,$e._)`${v0(e)}.call(${t}, ${r})`}De.isOwnProperty=Qd;function FM(e,t,r,n){let o=(0,$e._)`${t}${(0,$e.getProperty)(r)} !== undefined`;return n?(0,$e._)`${o} && ${Qd(e,t,r)}`:o}De.propertyInData=FM;function Xd(e,t,r,n){let o=(0,$e._)`${t}${(0,$e.getProperty)(r)} === undefined`;return n?(0,$e.or)(o,(0,$e.not)(Qd(e,t,r))):o}De.noPropertyInData=Xd;function C0(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}De.allSchemaProperties=C0;function TM(e,t){return C0(t).filter(r=>!(0,Yd.alwaysValidSchema)(e,t[r]))}De.schemaProperties=TM;function $M({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:i},a,u,c){let l=c?(0,$e._)`${e}, ${t}, ${n}${o}`:t,p=[[kn.default.instancePath,(0,$e.strConcat)(kn.default.instancePath,s)],[kn.default.parentData,i.parentData],[kn.default.parentDataProperty,i.parentDataProperty],[kn.default.rootData,kn.default.rootData]];i.opts.dynamicRef&&p.push([kn.default.dynamicAnchors,kn.default.dynamicAnchors]);let d=(0,$e._)`${l}, ${r.object(...p)}`;return u!==$e.nil?(0,$e._)`${a}.call(${u}, ${d})`:(0,$e._)`${a}(${d})`}De.callValidateCode=$M;var kM=(0,$e._)`new RegExp`;function RM({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,s=o(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,$e._)`${o.code==="new RegExp"?kM:(0,EM.useFunc)(e,o)}(${r}, ${n})`})}De.usePattern=RM;function IM(e){let{gen:t,data:r,keyword:n,it:o}=e,s=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(s,!0),i(()=>t.break()),s;function i(a){let u=t.const("len",(0,$e._)`${r}.length`);t.forRange("i",0,u,c=>{e.subschema({keyword:n,dataProp:c,dataPropType:Yd.Type.Num},s),t.if((0,$e.not)(s),a)})}}De.validateArray=IM;function NM(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Yd.alwaysValidSchema)(o,u))&&!o.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((u,c)=>{let l=e.subschema({keyword:n,schemaProp:c,compositeRule:!0},a);t.assign(i,(0,$e._)`${i} || ${a}`),e.mergeValidEvaluated(l,a)||t.if((0,$e.not)(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}De.validateUnion=NM});var x0=x(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.validateKeywordUsage=Gr.validSchemaType=Gr.funcKeywordCode=Gr.macroKeywordCode=void 0;var Pt=Y(),po=fn(),OM=lr(),MM=Ss();function BM(e,t){let{gen:r,keyword:n,schema:o,parentSchema:s,it:i}=e,a=t.macro.call(i.self,o,s,i),u=w0(r,n,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let c=r.name("valid");e.subschema({schema:a,schemaPath:Pt.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},c),e.pass(c,()=>e.error(!0))}Gr.macroKeywordCode=BM;function LM(e,t){var r;let{gen:n,keyword:o,schema:s,parentSchema:i,$data:a,it:u}=e;jM(u,t);let c=!a&&t.compile?t.compile.call(u.self,s,i,u):t.validate,l=w0(n,o,c),p=n.let("valid");e.block$data(p,d),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function d(){if(t.errors===!1)f(),t.modifying&&b0(e),h(()=>e.error());else{let y=t.async?g():m();t.modifying&&b0(e),h(()=>zM(e,y))}}function g(){let y=n.let("ruleErrs",null);return n.try(()=>f((0,Pt._)`await `),b=>n.assign(p,!1).if((0,Pt._)`${b} instanceof ${u.ValidationError}`,()=>n.assign(y,(0,Pt._)`${b}.errors`),()=>n.throw(b))),y}function m(){let y=(0,Pt._)`${l}.errors`;return n.assign(y,null),f(Pt.nil),y}function f(y=t.async?(0,Pt._)`await `:Pt.nil){let b=u.opts.passContext?po.default.this:po.default.self,C=!("compile"in t&&!a||t.schema===!1);n.assign(p,(0,Pt._)`${y}${(0,OM.callValidateCode)(e,l,b,C)}`,t.modifying)}function h(y){var b;n.if((0,Pt.not)((b=t.valid)!==null&&b!==void 0?b:p),y)}}Gr.funcKeywordCode=LM;function b0(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Pt._)`${n.parentData}[${n.parentDataProperty}]`))}function zM(e,t){let{gen:r}=e;r.if((0,Pt._)`Array.isArray(${t})`,()=>{r.assign(po.default.vErrors,(0,Pt._)`${po.default.vErrors} === null ? ${t} : ${po.default.vErrors}.concat(${t})`).assign(po.default.errors,(0,Pt._)`${po.default.vErrors}.length`),(0,MM.extendErrors)(e)},()=>e.error())}function jM({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function w0(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Pt.stringify)(r)})}function UM(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Gr.validSchemaType=UM;function VM({schema:e,opts:t,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let i=o.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}Gr.validateKeywordUsage=VM});var E0=x(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.extendSubschemaMode=Rn.extendSubschemaData=Rn.getSubschema=void 0;var Wr=Y(),S0=pe();function HM(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:i}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,Wr._)`${e.schemaPath}${(0,Wr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,Wr._)`${e.schemaPath}${(0,Wr.getProperty)(t)}${(0,Wr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,S0.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Rn.getSubschema=HM;function qM(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:i}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:c,dataPathArr:l,opts:p}=t,d=a.let("data",(0,Wr._)`${t.data}${(0,Wr.getProperty)(r)}`,!0);u(d),e.errorPath=(0,Wr.str)`${c}${(0,S0.getErrorPath)(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=(0,Wr._)`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(o!==void 0){let c=o instanceof Wr.Name?o:a.let("data",o,!0);u(c),i!==void 0&&(e.propertyName=i)}s&&(e.dataTypes=s);function u(c){e.data=c,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,c]}}Rn.extendSubschemaData=qM;function KM(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}Rn.extendSubschemaMode=KM});var ef=x((ere,P0)=>{"use strict";P0.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}});var A0=x((tre,_0)=>{"use strict";var In=_0.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};_u(t,n,o,e,"",e)};In.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};In.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};In.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};In.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function _u(e,t,r,n,o,s,i,a,u,c){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,s,i,a,u,c);for(var l in n){var p=n[l];if(Array.isArray(p)){if(l in In.arrayKeywords)for(var d=0;d<p.length;d++)_u(e,t,r,p[d],o+"/"+l+"/"+d,s,o,l,n,d)}else if(l in In.propsKeywords){if(p&&typeof p=="object")for(var g in p)_u(e,t,r,p[g],o+"/"+l+"/"+GM(g),s,o,l,n,g)}else(l in In.keywords||e.allKeys&&!(l in In.skipKeywords))&&_u(e,t,r,p,o+"/"+l,s,o,l,n)}r(n,o,s,i,a,u,c)}}function GM(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Ps=x(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.getSchemaRefs=Bt.resolveUrl=Bt.normalizeId=Bt._getFullPath=Bt.getFullPath=Bt.inlineRef=void 0;var WM=pe(),ZM=ef(),JM=A0(),YM=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function QM(e,t=!0){return typeof e=="boolean"?!0:t===!0?!tf(e):t?F0(e)<=t:!1}Bt.inlineRef=QM;var XM=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function tf(e){for(let t in e){if(XM.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(tf)||typeof r=="object"&&tf(r))return!0}return!1}function F0(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!YM.has(r)&&(typeof e[r]=="object"&&(0,WM.eachItem)(e[r],n=>t+=F0(n)),t===1/0))return 1/0}return t}function T0(e,t="",r){r!==!1&&(t=ri(t));let n=e.parse(t);return $0(e,n)}Bt.getFullPath=T0;function $0(e,t){return e.serialize(t).split("#")[0]+"#"}Bt._getFullPath=$0;var eB=/#\/?$/;function ri(e){return e?e.replace(eB,""):""}Bt.normalizeId=ri;function tB(e,t,r){return r=ri(r),e.resolve(t,r)}Bt.resolveUrl=tB;var rB=/^[a-z_][-a-z0-9._]*$/i;function nB(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=ri(e[r]||t),s={"":o},i=T0(n,o,!1),a={},u=new Set;return JM(e,{allKeys:!0},(p,d,g,m)=>{if(m===void 0)return;let f=i+d,h=s[m];typeof p[r]=="string"&&(h=y.call(this,p[r])),b.call(this,p.$anchor),b.call(this,p.$dynamicAnchor),s[d]=h;function y(C){let _=this.opts.uriResolver.resolve;if(C=ri(h?_(h,C):C),u.has(C))throw l(C);u.add(C);let S=this.refs[C];return typeof S=="string"&&(S=this.refs[S]),typeof S=="object"?c(p,S.schema,C):C!==ri(f)&&(C[0]==="#"?(c(p,a[C],C),a[C]=p):this.refs[C]=f),C}function b(C){if(typeof C=="string"){if(!rB.test(C))throw new Error(`invalid anchor "${C}"`);y.call(this,`#${C}`)}}}),a;function c(p,d,g){if(d!==void 0&&!ZM(p,d))throw l(g)}function l(p){return new Error(`reference "${p}" resolves to more than one schema`)}}Bt.getSchemaRefs=nB});var Fs=x(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.getData=Nn.KeywordCxt=Nn.validateFunctionCode=void 0;var O0=p0(),k0=Es(),nf=Gd(),Au=Es(),oB=D0(),As=x0(),rf=E0(),z=Y(),q=fn(),iB=Ps(),mn=pe(),_s=Ss();function sB(e){if(L0(e)&&(z0(e),B0(e))){cB(e);return}M0(e,()=>(0,O0.topBoolOrEmptySchema)(e))}Nn.validateFunctionCode=sB;function M0({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},s){o.code.es5?e.func(t,(0,z._)`${q.default.data}, ${q.default.valCxt}`,n.$async,()=>{e.code((0,z._)`"use strict"; ${R0(r,o)}`),uB(e,o),e.code(s)}):e.func(t,(0,z._)`${q.default.data}, ${aB(o)}`,n.$async,()=>e.code(R0(r,o)).code(s))}function aB(e){return(0,z._)`{${q.default.instancePath}="", ${q.default.parentData}, ${q.default.parentDataProperty}, ${q.default.rootData}=${q.default.data}${e.dynamicRef?(0,z._)`, ${q.default.dynamicAnchors}={}`:z.nil}}={}`}function uB(e,t){e.if(q.default.valCxt,()=>{e.var(q.default.instancePath,(0,z._)`${q.default.valCxt}.${q.default.instancePath}`),e.var(q.default.parentData,(0,z._)`${q.default.valCxt}.${q.default.parentData}`),e.var(q.default.parentDataProperty,(0,z._)`${q.default.valCxt}.${q.default.parentDataProperty}`),e.var(q.default.rootData,(0,z._)`${q.default.valCxt}.${q.default.rootData}`),t.dynamicRef&&e.var(q.default.dynamicAnchors,(0,z._)`${q.default.valCxt}.${q.default.dynamicAnchors}`)},()=>{e.var(q.default.instancePath,(0,z._)`""`),e.var(q.default.parentData,(0,z._)`undefined`),e.var(q.default.parentDataProperty,(0,z._)`undefined`),e.var(q.default.rootData,q.default.data),t.dynamicRef&&e.var(q.default.dynamicAnchors,(0,z._)`{}`)})}function cB(e){let{schema:t,opts:r,gen:n}=e;M0(e,()=>{r.$comment&&t.$comment&&U0(e),mB(e),n.let(q.default.vErrors,null),n.let(q.default.errors,0),r.unevaluated&&lB(e),j0(e),yB(e)})}function lB(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,z._)`${r}.evaluated`),t.if((0,z._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,z._)`${e.evaluated}.props`,(0,z._)`undefined`)),t.if((0,z._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,z._)`${e.evaluated}.items`,(0,z._)`undefined`))}function R0(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,z._)`/*# sourceURL=${r} */`:z.nil}function pB(e,t){if(L0(e)&&(z0(e),B0(e))){dB(e,t);return}(0,O0.boolOrEmptySchema)(e,t)}function B0({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function L0(e){return typeof e.schema!="boolean"}function dB(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&U0(e),gB(e),hB(e);let s=n.const("_errs",q.default.errors);j0(e,s),n.var(t,(0,z._)`${s} === ${q.default.errors}`)}function z0(e){(0,mn.checkUnknownRules)(e),fB(e)}function j0(e,t){if(e.opts.jtd)return I0(e,[],!1,t);let r=(0,k0.getSchemaTypes)(e.schema),n=(0,k0.coerceAndCheckDataType)(e,r);I0(e,r,!n,t)}function fB(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,mn.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function mB(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,mn.checkStrictMode)(e,"default is ignored in the schema root")}function gB(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,iB.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function hB(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function U0({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)e.code((0,z._)`${q.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let i=(0,z.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,z._)`${q.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function yB(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=e;r.$async?t.if((0,z._)`${q.default.errors} === 0`,()=>t.return(q.default.data),()=>t.throw((0,z._)`new ${o}(${q.default.vErrors})`)):(t.assign((0,z._)`${n}.errors`,q.default.vErrors),s.unevaluated&&DB(e),t.return((0,z._)`${q.default.errors} === 0`))}function DB({gen:e,evaluated:t,props:r,items:n}){r instanceof z.Name&&e.assign((0,z._)`${t}.props`,r),n instanceof z.Name&&e.assign((0,z._)`${t}.items`,n)}function I0(e,t,r,n){let{gen:o,schema:s,data:i,allErrors:a,opts:u,self:c}=e,{RULES:l}=c;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,mn.schemaHasRulesButRef)(s,l))){o.block(()=>H0(e,"$ref",l.all.$ref.definition));return}u.jtd||vB(e,t),o.block(()=>{for(let d of l.rules)p(d);p(l.post)});function p(d){(0,nf.shouldUseGroup)(s,d)&&(d.type?(o.if((0,Au.checkDataType)(d.type,i,u.strictNumbers)),N0(e,d),t.length===1&&t[0]===d.type&&r&&(o.else(),(0,Au.reportTypeError)(e)),o.endIf()):N0(e,d),a||o.if((0,z._)`${q.default.errors} === ${n||0}`))}}function N0(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,oB.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,nf.shouldUseRule)(n,s)&&H0(e,s.keyword,s.definition,t.type)})}function vB(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(CB(e,t),e.opts.allowUnionTypes||bB(e,t),wB(e,e.dataTypes))}function CB(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{V0(e.dataTypes,r)||of(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),SB(e,t)}}function bB(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&of(e,"use allowUnionTypes to allow union type keyword")}function wB(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,nf.shouldUseRule)(e.schema,o)){let{type:s}=o.definition;s.length&&!s.some(i=>xB(t,i))&&of(e,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function xB(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function V0(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function SB(e,t){let r=[];for(let n of e.dataTypes)V0(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function of(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,mn.checkStrictMode)(e,t,e.opts.strictTypes)}var Fu=class{constructor(t,r,n){if((0,As.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,mn.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",q0(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,As.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",q.default.errors))}result(t,r,n){this.failResult((0,z.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,z.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,z._)`${r} !== undefined && (${(0,z.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?_s.reportExtraError:_s.reportError)(this,this.def.error,r)}$dataError(){(0,_s.reportError)(this,this.def.$dataError||_s.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,_s.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=z.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=z.nil,r=z.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:i}=this;n.if((0,z.or)((0,z._)`${o} === undefined`,r)),t!==z.nil&&n.assign(t,!0),(s.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==z.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,z.or)(i(),a());function i(){if(n.length){if(!(r instanceof z.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,z._)`${(0,Au.checkDataTypes)(u,r,s.opts.strictNumbers,Au.DataType.Wrong)}`}return z.nil}function a(){if(o.validateSchema){let u=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,z._)`!${u}(${r})`}return z.nil}}subschema(t,r){let n=(0,rf.getSubschema)(this.it,t);(0,rf.extendSubschemaData)(n,this.it,t),(0,rf.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return pB(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=mn.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=mn.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,z.Name)),!0}};Nn.KeywordCxt=Fu;function H0(e,t,r,n){let o=new Fu(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,As.funcKeywordCode)(o,r):"macro"in r?(0,As.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,As.funcKeywordCode)(o,r)}var EB=/^\/(?:[^~]|~0|~1)*$/,PB=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function q0(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,s;if(e==="")return q.default.rootData;if(e[0]==="/"){if(!EB.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,s=q.default.rootData}else{let c=PB.exec(e);if(!c)throw new Error(`Invalid JSON-pointer: ${e}`);let l=+c[1];if(o=c[2],o==="#"){if(l>=t)throw new Error(u("property/index",l));return n[t-l]}if(l>t)throw new Error(u("data",l));if(s=r[t-l],!o)return s}let i=s,a=o.split("/");for(let c of a)c&&(s=(0,z._)`${s}${(0,z.getProperty)((0,mn.unescapeJsonPointer)(c))}`,i=(0,z._)`${i} && ${s}`);return i;function u(c,l){return`Cannot access ${c} ${l} levels up, current level is ${t}`}}Nn.getData=q0});var Tu=x(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});var sf=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};af.default=sf});var Ts=x(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});var uf=Ps(),cf=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,uf.resolveUrl)(t,r,n),this.missingSchema=(0,uf.normalizeId)((0,uf.getFullPath)(t,this.missingRef))}};lf.default=cf});var ku=x(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.resolveSchema=pr.getCompilingSchema=pr.resolveRef=pr.compileSchema=pr.SchemaEnv=void 0;var wr=Y(),_B=Tu(),fo=fn(),xr=Ps(),K0=pe(),AB=Fs(),ni=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,xr.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};pr.SchemaEnv=ni;function df(e){let t=G0.call(this,e);if(t)return t;let r=(0,xr.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new wr.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),a;e.$async&&(a=i.scopeValue("Error",{ref:_B.default,code:(0,wr._)`require("ajv/dist/runtime/validation_error").default`}));let u=i.scopeName("validate");e.validateName=u;let c={gen:i,allErrors:this.opts.allErrors,data:fo.default.data,parentData:fo.default.parentData,parentDataProperty:fo.default.parentDataProperty,dataNames:[fo.default.data],dataPathArr:[wr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,wr.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:wr.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,wr._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),(0,AB.validateFunctionCode)(c),i.optimize(this.opts.code.optimize);let p=i.toString();l=`${i.scopeRefs(fo.default.scope)}return ${p}`,this.opts.code.process&&(l=this.opts.code.process(l,e));let g=new Function(`${fo.default.self}`,`${fo.default.scope}`,l)(this,this.scope.get());if(this.scope.value(u,{ref:g}),g.errors=null,g.schema=e.schema,g.schemaEnv=e,e.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:u,validateCode:p,scopeValues:i._values}),this.opts.unevaluated){let{props:m,items:f}=c;g.evaluated={props:m instanceof wr.Name?void 0:m,items:f instanceof wr.Name?void 0:f,dynamicProps:m instanceof wr.Name,dynamicItems:f instanceof wr.Name},g.source&&(g.source.evaluated=(0,wr.stringify)(g.evaluated))}return e.validate=g,e}catch(p){throw delete e.validate,delete e.validateName,l&&this.logger.error("Error compiling schema, function code:",l),p}finally{this._compilations.delete(e)}}pr.compileSchema=df;function FB(e,t,r){var n;r=(0,xr.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let s=kB.call(this,e,r);if(s===void 0){let i=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;i&&(s=new ni({schema:i,schemaId:a,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=TB.call(this,s)}pr.resolveRef=FB;function TB(e){return(0,xr.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:df.call(this,e)}function G0(e){for(let t of this._compilations)if($B(t,e))return t}pr.getCompilingSchema=G0;function $B(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function kB(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||$u.call(this,e,t)}function $u(e,t){let r=this.opts.uriResolver.parse(t),n=(0,xr._getFullPath)(this.opts.uriResolver,r),o=(0,xr.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return pf.call(this,r,e);let s=(0,xr.normalizeId)(n),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=$u.call(this,e,i);return typeof a?.schema!="object"?void 0:pf.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||df.call(this,i),s===(0,xr.normalizeId)(t)){let{schema:a}=i,{schemaId:u}=this.opts,c=a[u];return c&&(o=(0,xr.resolveUrl)(this.opts.uriResolver,o,c)),new ni({schema:a,schemaId:u,root:e,baseId:o})}return pf.call(this,r,i)}}pr.resolveSchema=$u;var RB=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function pf(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,K0.unescapeFragment)(a)];if(u===void 0)return;r=u;let c=typeof r=="object"&&r[this.opts.schemaId];!RB.has(a)&&c&&(t=(0,xr.resolveUrl)(this.opts.uriResolver,t,c))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,K0.schemaHasRulesButRef)(r,this.RULES)){let a=(0,xr.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=$u.call(this,n,a)}let{schemaId:i}=this.opts;if(s=s||new ni({schema:r,schemaId:i,root:n,baseId:t}),s.schema!==s.root.schema)return s}});var W0=x((are,IB)=>{IB.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var J0=x((ure,Z0)=>{"use strict";var NB={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Z0.exports={HEX:NB}});var oS=x((cre,nS)=>{"use strict";var{HEX:OB}=J0(),MB=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function eS(e){if(rS(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(MB)||[],[r]=t;return r?{host:LB(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function ff(e,t=!1){let r="",n=!0;for(let o of e){if(OB[o]===void 0)return;o!=="0"&&n===!0&&(n=!1),n||(r+=o)}return t&&r.length===0&&(r="0"),r}function BB(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,i=!1,a=!1;function u(){if(o.length){if(s===!1){let c=ff(o);if(c!==void 0)n.push(c);else return r.error=!0,!1}o.length=0}return!0}for(let c=0;c<e.length;c++){let l=e[c];if(!(l==="["||l==="]"))if(l===":"){if(i===!0&&(a=!0),!u())break;if(t++,n.push(":"),t>7){r.error=!0;break}c-1>=0&&e[c-1]===":"&&(i=!0);continue}else if(l==="%"){if(!u())break;s=!0}else{o.push(l);continue}}return o.length&&(s?r.zone=o.join(""):a?n.push(o.join("")):n.push(ff(o))),r.address=n.join(""),r}function tS(e){if(rS(e,":")<2)return{host:e,isIPV6:!1};let t=BB(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,escapedHost:n,isIPV6:!0}}}function LB(e,t){let r="",n=!0,o=e.length;for(let s=0;s<o;s++){let i=e[s];i==="0"&&n?(s+1<=o&&e[s+1]===t||s+1===o)&&(r+=i,n=!1):(i===t?n=!0:n=!1,r+=i)}return r}function rS(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}var Y0=/^\.\.?\//u,Q0=/^\/\.(?:\/|$)/u,X0=/^\/\.\.(?:\/|$)/u,zB=/^\/?(?:.|\n)*?(?=\/|$)/u;function jB(e){let t=[];for(;e.length;)if(e.match(Y0))e=e.replace(Y0,"");else if(e.match(Q0))e=e.replace(Q0,"/");else if(e.match(X0))e=e.replace(X0,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(zB);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}function UB(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function VB(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host),n=eS(r);if(n.isIPV4)r=n.host;else{let o=tS(n.host);o.isIPV6===!0?r=`[${o.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}nS.exports={recomposeAuthority:VB,normalizeComponentEncoding:UB,removeDotSegments:jB,normalizeIPv4:eS,normalizeIPv6:tS,stringArrayToHexStripped:ff}});var lS=x((lre,cS)=>{"use strict";var HB=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,qB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function iS(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}function sS(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function aS(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function KB(e){return e.secure=iS(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function GB(e){if((e.port===(iS(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function WB(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(qB);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,s=mf[o];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function ZB(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,s=mf[o];s&&(e=s.serialize(e,t));let i=e,a=e.nss;return i.path=`${n||t.nid}:${a}`,t.skipEscape=!0,i}function JB(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!HB.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function YB(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var uS={scheme:"http",domainHost:!0,parse:sS,serialize:aS},QB={scheme:"https",domainHost:uS.domainHost,parse:sS,serialize:aS},Ru={scheme:"ws",domainHost:!0,parse:KB,serialize:GB},XB={scheme:"wss",domainHost:Ru.domainHost,parse:Ru.parse,serialize:Ru.serialize},eL={scheme:"urn",parse:WB,serialize:ZB,skipNormalize:!0},tL={scheme:"urn:uuid",parse:JB,serialize:YB,skipNormalize:!0},mf={http:uS,https:QB,ws:Ru,wss:XB,urn:eL,"urn:uuid":tL};cS.exports=mf});var dS=x((pre,Nu)=>{"use strict";var{normalizeIPv6:rL,normalizeIPv4:nL,removeDotSegments:$s,recomposeAuthority:oL,normalizeComponentEncoding:Iu}=oS(),gf=lS();function iL(e,t){return typeof e=="string"?e=Zr(gn(e,t),t):typeof e=="object"&&(e=gn(Zr(e,t),t)),e}function sL(e,t,r){let n=Object.assign({scheme:"null"},r),o=pS(gn(e,n),gn(t,n),n,!0);return Zr(o,{...n,skipEscape:!0})}function pS(e,t,r,n){let o={};return n||(e=gn(Zr(e,r),r),t=gn(Zr(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=$s(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=$s(t.path||""),o.query=t.query):(t.path?(t.path.charAt(0)==="/"?o.path=$s(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=$s(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function aL(e,t,r){return typeof e=="string"?(e=unescape(e),e=Zr(Iu(gn(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Zr(Iu(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Zr(Iu(gn(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Zr(Iu(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Zr(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],s=gf[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let i=oL(r);if(i!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(i),r.path&&r.path.charAt(0)!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=$s(a)),i===void 0&&(a=a.replace(/^\/\//u,"/%2F")),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var uL=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function cL(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||uL[t])return!0;return!1}var lL=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function gn(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=e.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let i=e.match(lL);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host){let u=nL(n.host);if(u.isIPV4===!1){let c=rL(u.host);n.host=c.host.toLowerCase(),s=c.isIPV6}else n.host=u.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=gf[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&cL(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}(!a||a&&!a.skipNormalize)&&(o&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),o&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var hf={SCHEMES:gf,normalize:iL,resolve:sL,resolveComponents:pS,equal:aL,serialize:Zr,parse:gn};Nu.exports=hf;Nu.exports.default=hf;Nu.exports.fastUri=hf});var mS=x(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});var fS=dS();fS.code='require("ajv/dist/runtime/uri").default';yf.default=fS});var wS=x(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.CodeGen=ct.Name=ct.nil=ct.stringify=ct.str=ct._=ct.KeywordCxt=void 0;var pL=Fs();Object.defineProperty(ct,"KeywordCxt",{enumerable:!0,get:function(){return pL.KeywordCxt}});var oi=Y();Object.defineProperty(ct,"_",{enumerable:!0,get:function(){return oi._}});Object.defineProperty(ct,"str",{enumerable:!0,get:function(){return oi.str}});Object.defineProperty(ct,"stringify",{enumerable:!0,get:function(){return oi.stringify}});Object.defineProperty(ct,"nil",{enumerable:!0,get:function(){return oi.nil}});Object.defineProperty(ct,"Name",{enumerable:!0,get:function(){return oi.Name}});Object.defineProperty(ct,"CodeGen",{enumerable:!0,get:function(){return oi.CodeGen}});var dL=Tu(),vS=Ts(),fL=Kd(),ks=ku(),mL=Y(),Rs=Ps(),Ou=Es(),vf=pe(),gS=W0(),gL=mS(),CS=(e,t)=>new RegExp(e,t);CS.code="new RegExp";var hL=["removeAdditional","useDefaults","coerceTypes"],yL=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),DL={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},vL={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},hS=200;function CL(e){var t,r,n,o,s,i,a,u,c,l,p,d,g,m,f,h,y,b,C,_,S,T,k,I,R;let $=e.strict,D=(t=e.code)===null||t===void 0?void 0:t.optimize,B=D===!0||D===void 0?1:D||0,U=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:CS,H=(o=e.uriResolver)!==null&&o!==void 0?o:gL.default;return{strictSchema:(i=(s=e.strictSchema)!==null&&s!==void 0?s:$)!==null&&i!==void 0?i:!0,strictNumbers:(u=(a=e.strictNumbers)!==null&&a!==void 0?a:$)!==null&&u!==void 0?u:!0,strictTypes:(l=(c=e.strictTypes)!==null&&c!==void 0?c:$)!==null&&l!==void 0?l:"log",strictTuples:(d=(p=e.strictTuples)!==null&&p!==void 0?p:$)!==null&&d!==void 0?d:"log",strictRequired:(m=(g=e.strictRequired)!==null&&g!==void 0?g:$)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:B,regExp:U}:{optimize:B,regExp:U},loopRequired:(f=e.loopRequired)!==null&&f!==void 0?f:hS,loopEnum:(h=e.loopEnum)!==null&&h!==void 0?h:hS,meta:(y=e.meta)!==null&&y!==void 0?y:!0,messages:(b=e.messages)!==null&&b!==void 0?b:!0,inlineRefs:(C=e.inlineRefs)!==null&&C!==void 0?C:!0,schemaId:(_=e.schemaId)!==null&&_!==void 0?_:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(T=e.validateSchema)!==null&&T!==void 0?T:!0,validateFormats:(k=e.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(I=e.unicodeRegExp)!==null&&I!==void 0?I:!0,int32range:(R=e.int32range)!==null&&R!==void 0?R:!0,uriResolver:H}}var Is=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...CL(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new mL.ValueScope({scope:{},prefixes:yL,es5:r,lines:n}),this.logger=PL(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,fL.getRules)(),yS.call(this,DL,t,"NOT SUPPORTED"),yS.call(this,vL,t,"DEPRECATED","warn"),this._metaOpts=SL.call(this),t.formats&&wL.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&xL.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),bL.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=gS;n==="id"&&(o={...gS},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(l,p){await s.call(this,l.$schema);let d=this._addSchema(l,p);return d.validate||i.call(this,d)}async function s(l){l&&!this.getSchema(l)&&await o.call(this,{$ref:l},!0)}async function i(l){try{return this._compileSchemaEnv(l)}catch(p){if(!(p instanceof vS.default))throw p;return a.call(this,p),await u.call(this,p.missingSchema),i.call(this,l)}}function a({missingSchema:l,missingRef:p}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${p} cannot be resolved`)}async function u(l){let p=await c.call(this,l);this.refs[l]||await s.call(this,p.$schema),this.refs[l]||this.addSchema(p,l,r)}async function c(l){let p=this._loading[l];if(p)return p;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let i of t)this.addSchema(i,void 0,n,o);return this}let s;if(typeof t=="object"){let{schemaId:i}=this.opts;if(s=t[i],s!==void 0&&typeof s!="string")throw new Error(`schema ${i} must be string`)}return r=(0,Rs.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(t){let r;for(;typeof(r=DS.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new ks.SchemaEnv({schema:{},schemaId:n});if(r=ks.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=DS.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,Rs.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(AL.call(this,n,r),!r)return(0,vf.eachItem)(n,s=>Df.call(this,s)),this;TL.call(this,r);let o={...r,type:(0,Ou.getJSONTypes)(r.type),schemaType:(0,Ou.getJSONTypes)(r.schemaType)};return(0,vf.eachItem)(n,o.type.length===0?s=>Df.call(this,s,o):s=>o.type.forEach(i=>Df.call(this,s,o,i))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let s=o.split("/").slice(1),i=t;for(let a of s)i=i[a];for(let a in n){let u=n[a];if(typeof u!="object")continue;let{$data:c}=u.definition,l=i[a];c&&l&&(i[a]=bS(l))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof t=="object")i=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(t);if(u!==void 0)return u;n=(0,Rs.normalizeId)(i||n);let c=Rs.getSchemaRefs.call(this,t,n);return u=new ks.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:c}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),o&&this.validateSchema(t,!0),u}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):ks.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{ks.compileSchema.call(this,t)}finally{this.opts=r}}};Is.ValidationError=dL.default;Is.MissingRefError=vS.default;ct.default=Is;function yS(e,t,r,n="error"){for(let o in e){let s=o;s in t&&this.logger[n](`${r}: option ${o}. ${e[s]}`)}}function DS(e){return e=(0,Rs.normalizeId)(e),this.schemas[e]||this.refs[e]}function bL(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function wL(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function xL(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function SL(){let e={...this.opts};for(let t of hL)delete e[t];return e}var EL={log(){},warn(){},error(){}};function PL(e){if(e===!1)return EL;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var _L=/^[a-z_$][a-z0-9_$:-]*$/i;function AL(e,t){let{RULES:r}=this;if((0,vf.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!_L.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function Df(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=o?s.post:s.rules.find(({type:u})=>u===r);if(i||(i={type:r,rules:[]},s.rules.push(i)),s.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,Ou.getJSONTypes)(t.type),schemaType:(0,Ou.getJSONTypes)(t.schemaType)}};t.before?FL.call(this,i,a,t.before):i.rules.push(a),s.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}function FL(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function TL(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=bS(t)),e.validateSchema=this.compile(t,!0))}var $L={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function bS(e){return{anyOf:[e,$L]}}});var xS=x(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});var kL={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Cf.default=kL});var _S=x(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.callRef=mo.getValidate=void 0;var RL=Ts(),SS=lr(),Lt=Y(),ii=fn(),ES=ku(),Mu=pe(),IL={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:s,validateName:i,opts:a,self:u}=n,{root:c}=s;if((r==="#"||r==="#/")&&o===c.baseId)return p();let l=ES.resolveRef.call(u,c,o,r);if(l===void 0)throw new RL.default(n.opts.uriResolver,o,r);if(l instanceof ES.SchemaEnv)return d(l);return g(l);function p(){if(s===c)return Bu(e,i,s,s.$async);let m=t.scopeValue("root",{ref:c});return Bu(e,(0,Lt._)`${m}.validate`,c,c.$async)}function d(m){let f=PS(e,m);Bu(e,f,m,m.$async)}function g(m){let f=t.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,Lt.stringify)(m)}:{ref:m}),h=t.name("valid"),y=e.subschema({schema:m,dataTypes:[],schemaPath:Lt.nil,topSchemaRef:f,errSchemaPath:r},h);e.mergeEvaluated(y),e.ok(h)}}};function PS(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Lt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}mo.getValidate=PS;function Bu(e,t,r,n){let{gen:o,it:s}=e,{allErrors:i,schemaEnv:a,opts:u}=s,c=u.passContext?ii.default.this:Lt.nil;n?l():p();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=o.let("valid");o.try(()=>{o.code((0,Lt._)`await ${(0,SS.callValidateCode)(e,t,c)}`),g(t),i||o.assign(m,!0)},f=>{o.if((0,Lt._)`!(${f} instanceof ${s.ValidationError})`,()=>o.throw(f)),d(f),i||o.assign(m,!1)}),e.ok(m)}function p(){e.result((0,SS.callValidateCode)(e,t,c),()=>g(t),()=>d(t))}function d(m){let f=(0,Lt._)`${m}.errors`;o.assign(ii.default.vErrors,(0,Lt._)`${ii.default.vErrors} === null ? ${f} : ${ii.default.vErrors}.concat(${f})`),o.assign(ii.default.errors,(0,Lt._)`${ii.default.vErrors}.length`)}function g(m){var f;if(!s.opts.unevaluated)return;let h=(f=r?.validate)===null||f===void 0?void 0:f.evaluated;if(s.props!==!0)if(h&&!h.dynamicProps)h.props!==void 0&&(s.props=Mu.mergeEvaluated.props(o,h.props,s.props));else{let y=o.var("props",(0,Lt._)`${m}.evaluated.props`);s.props=Mu.mergeEvaluated.props(o,y,s.props,Lt.Name)}if(s.items!==!0)if(h&&!h.dynamicItems)h.items!==void 0&&(s.items=Mu.mergeEvaluated.items(o,h.items,s.items));else{let y=o.var("items",(0,Lt._)`${m}.evaluated.items`);s.items=Mu.mergeEvaluated.items(o,y,s.items,Lt.Name)}}}mo.callRef=Bu;mo.default=IL});var AS=x(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});var NL=xS(),OL=_S(),ML=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",NL.default,OL.default];bf.default=ML});var FS=x(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});var Lu=Y(),On=Lu.operators,zu={maximum:{okStr:"<=",ok:On.LTE,fail:On.GT},minimum:{okStr:">=",ok:On.GTE,fail:On.LT},exclusiveMaximum:{okStr:"<",ok:On.LT,fail:On.GTE},exclusiveMinimum:{okStr:">",ok:On.GT,fail:On.LTE}},BL={message:({keyword:e,schemaCode:t})=>(0,Lu.str)`must be ${zu[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Lu._)`{comparison: ${zu[e].okStr}, limit: ${t}}`},LL={keyword:Object.keys(zu),type:"number",schemaType:"number",$data:!0,error:BL,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Lu._)`${r} ${zu[t].fail} ${n} || isNaN(${r})`)}};wf.default=LL});var TS=x(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});var Ns=Y(),zL={message:({schemaCode:e})=>(0,Ns.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Ns._)`{multipleOf: ${e}}`},jL={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:zL,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,s=o.opts.multipleOfPrecision,i=t.let("res"),a=s?(0,Ns._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,Ns._)`${i} !== parseInt(${i})`;e.fail$data((0,Ns._)`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};xf.default=jL});var kS=x(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});function $S(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}Sf.default=$S;$S.code='require("ajv/dist/runtime/ucs2length").default'});var RS=x(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});var go=Y(),UL=pe(),VL=kS(),HL={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,go.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,go._)`{limit: ${e}}`},qL={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:HL,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,s=t==="maxLength"?go.operators.GT:go.operators.LT,i=o.opts.unicode===!1?(0,go._)`${r}.length`:(0,go._)`${(0,UL.useFunc)(e.gen,VL.default)}(${r})`;e.fail$data((0,go._)`${i} ${s} ${n}`)}};Ef.default=qL});var IS=x(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});var KL=lr(),ju=Y(),GL={message:({schemaCode:e})=>(0,ju.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,ju._)`{pattern: ${e}}`},WL={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:GL,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:s}=e,i=s.opts.unicodeRegExp?"u":"",a=r?(0,ju._)`(new RegExp(${o}, ${i}))`:(0,KL.usePattern)(e,n);e.fail$data((0,ju._)`!${a}.test(${t})`)}};Pf.default=WL});var NS=x(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});var Os=Y(),ZL={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Os.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Os._)`{limit: ${e}}`},JL={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:ZL,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?Os.operators.GT:Os.operators.LT;e.fail$data((0,Os._)`Object.keys(${r}).length ${o} ${n}`)}};_f.default=JL});var OS=x(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});var Ms=lr(),Bs=Y(),YL=pe(),QL={message:({params:{missingProperty:e}})=>(0,Bs.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Bs._)`{missingProperty: ${e}}`},XL={keyword:"required",type:"object",schemaType:"array",$data:!0,error:QL,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:s,it:i}=e,{opts:a}=i;if(!s&&r.length===0)return;let u=r.length>=a.loopRequired;if(i.allErrors?c():l(),a.strictRequired){let g=e.parentSchema.properties,{definedProperties:m}=e.it;for(let f of r)if(g?.[f]===void 0&&!m.has(f)){let h=i.schemaEnv.baseId+i.errSchemaPath,y=`required property "${f}" is not defined at "${h}" (strictRequired)`;(0,YL.checkStrictMode)(i,y,i.opts.strictRequired)}}function c(){if(u||s)e.block$data(Bs.nil,p);else for(let g of r)(0,Ms.checkReportMissingProp)(e,g)}function l(){let g=t.let("missing");if(u||s){let m=t.let("valid",!0);e.block$data(m,()=>d(g,m)),e.ok(m)}else t.if((0,Ms.checkMissingProp)(e,r,g)),(0,Ms.reportMissingProp)(e,g),t.else()}function p(){t.forOf("prop",n,g=>{e.setParams({missingProperty:g}),t.if((0,Ms.noPropertyInData)(t,o,g,a.ownProperties),()=>e.error())})}function d(g,m){e.setParams({missingProperty:g}),t.forOf(g,n,()=>{t.assign(m,(0,Ms.propertyInData)(t,o,g,a.ownProperties)),t.if((0,Bs.not)(m),()=>{e.error(),t.break()})},Bs.nil)}}};Af.default=XL});var MS=x(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});var Ls=Y(),ez={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Ls.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Ls._)`{limit: ${e}}`},tz={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ez,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?Ls.operators.GT:Ls.operators.LT;e.fail$data((0,Ls._)`${r}.length ${o} ${n}`)}};Ff.default=tz});var Uu=x(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});var BS=ef();BS.code='require("ajv/dist/runtime/equal").default';Tf.default=BS});var LS=x(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});var $f=Es(),lt=Y(),rz=pe(),nz=Uu(),oz={message:({params:{i:e,j:t}})=>(0,lt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,lt._)`{i: ${e}, j: ${t}}`},iz={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:oz,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:s,schemaCode:i,it:a}=e;if(!n&&!o)return;let u=t.let("valid"),c=s.items?(0,$f.getSchemaTypes)(s.items):[];e.block$data(u,l,(0,lt._)`${i} === false`),e.ok(u);function l(){let m=t.let("i",(0,lt._)`${r}.length`),f=t.let("j");e.setParams({i:m,j:f}),t.assign(u,!0),t.if((0,lt._)`${m} > 1`,()=>(p()?d:g)(m,f))}function p(){return c.length>0&&!c.some(m=>m==="object"||m==="array")}function d(m,f){let h=t.name("item"),y=(0,$f.checkDataTypes)(c,h,a.opts.strictNumbers,$f.DataType.Wrong),b=t.const("indices",(0,lt._)`{}`);t.for((0,lt._)`;${m}--;`,()=>{t.let(h,(0,lt._)`${r}[${m}]`),t.if(y,(0,lt._)`continue`),c.length>1&&t.if((0,lt._)`typeof ${h} == "string"`,(0,lt._)`${h} += "_"`),t.if((0,lt._)`typeof ${b}[${h}] == "number"`,()=>{t.assign(f,(0,lt._)`${b}[${h}]`),e.error(),t.assign(u,!1).break()}).code((0,lt._)`${b}[${h}] = ${m}`)})}function g(m,f){let h=(0,rz.useFunc)(t,nz.default),y=t.name("outer");t.label(y).for((0,lt._)`;${m}--;`,()=>t.for((0,lt._)`${f} = ${m}; ${f}--;`,()=>t.if((0,lt._)`${h}(${r}[${m}], ${r}[${f}])`,()=>{e.error(),t.assign(u,!1).break(y)})))}}};kf.default=iz});var zS=x(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});var Rf=Y(),sz=pe(),az=Uu(),uz={message:"must be equal to constant",params:({schemaCode:e})=>(0,Rf._)`{allowedValue: ${e}}`},cz={keyword:"const",$data:!0,error:uz,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:s}=e;n||s&&typeof s=="object"?e.fail$data((0,Rf._)`!${(0,sz.useFunc)(t,az.default)}(${r}, ${o})`):e.fail((0,Rf._)`${s} !== ${r}`)}};If.default=cz});var jS=x(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});var zs=Y(),lz=pe(),pz=Uu(),dz={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,zs._)`{allowedValues: ${e}}`},fz={keyword:"enum",schemaType:"array",$data:!0,error:dz,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:s,it:i}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=i.opts.loopEnum,u,c=()=>u??(u=(0,lz.useFunc)(t,pz.default)),l;if(a||n)l=t.let("valid"),e.block$data(l,p);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let g=t.const("vSchema",s);l=(0,zs.or)(...o.map((m,f)=>d(g,f)))}e.pass(l);function p(){t.assign(l,!1),t.forOf("v",s,g=>t.if((0,zs._)`${c()}(${r}, ${g})`,()=>t.assign(l,!0).break()))}function d(g,m){let f=o[m];return typeof f=="object"&&f!==null?(0,zs._)`${c()}(${r}, ${g}[${m}])`:(0,zs._)`${r} === ${f}`}}};Nf.default=fz});var US=x(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});var mz=FS(),gz=TS(),hz=RS(),yz=IS(),Dz=NS(),vz=OS(),Cz=MS(),bz=LS(),wz=zS(),xz=jS(),Sz=[mz.default,gz.default,hz.default,yz.default,Dz.default,vz.default,Cz.default,bz.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},wz.default,xz.default];Of.default=Sz});var Bf=x(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.validateAdditionalItems=void 0;var ho=Y(),Mf=pe(),Ez={message:({params:{len:e}})=>(0,ho.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ho._)`{limit: ${e}}`},Pz={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Ez,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Mf.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}VS(e,n)}};function VS(e,t){let{gen:r,schema:n,data:o,keyword:s,it:i}=e;i.items=!0;let a=r.const("len",(0,ho._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,ho._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,Mf.alwaysValidSchema)(i,n)){let c=r.var("valid",(0,ho._)`${a} <= ${t.length}`);r.if((0,ho.not)(c),()=>u(c)),e.ok(c)}function u(c){r.forRange("i",t.length,a,l=>{e.subschema({keyword:s,dataProp:l,dataPropType:Mf.Type.Num},c),i.allErrors||r.if((0,ho.not)(c),()=>r.break())})}}js.validateAdditionalItems=VS;js.default=Pz});var Lf=x(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.validateTuple=void 0;var HS=Y(),Vu=pe(),_z=lr(),Az={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return qS(e,"additionalItems",t);r.items=!0,!(0,Vu.alwaysValidSchema)(r,t)&&e.ok((0,_z.validateArray)(e))}};function qS(e,t,r=e.schema){let{gen:n,parentSchema:o,data:s,keyword:i,it:a}=e;l(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Vu.mergeEvaluated.items(n,r.length,a.items));let u=n.name("valid"),c=n.const("len",(0,HS._)`${s}.length`);r.forEach((p,d)=>{(0,Vu.alwaysValidSchema)(a,p)||(n.if((0,HS._)`${c} > ${d}`,()=>e.subschema({keyword:i,schemaProp:d,dataProp:d},u)),e.ok(u))});function l(p){let{opts:d,errSchemaPath:g}=a,m=r.length,f=m===p.minItems&&(m===p.maxItems||p[t]===!1);if(d.strictTuples&&!f){let h=`"${i}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${g}"`;(0,Vu.checkStrictMode)(a,h,d.strictTuples)}}}Us.validateTuple=qS;Us.default=Az});var KS=x(zf=>{"use strict";Object.defineProperty(zf,"__esModule",{value:!0});var Fz=Lf(),Tz={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Fz.validateTuple)(e,"items")};zf.default=Tz});var WS=x(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});var GS=Y(),$z=pe(),kz=lr(),Rz=Bf(),Iz={message:({params:{len:e}})=>(0,GS.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,GS._)`{limit: ${e}}`},Nz={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Iz,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,$z.alwaysValidSchema)(n,t)&&(o?(0,Rz.validateAdditionalItems)(e,o):e.ok((0,kz.validateArray)(e)))}};jf.default=Nz});var ZS=x(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});var dr=Y(),Hu=pe(),Oz={message:({params:{min:e,max:t}})=>t===void 0?(0,dr.str)`must contain at least ${e} valid item(s)`:(0,dr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,dr._)`{minContains: ${e}}`:(0,dr._)`{minContains: ${e}, maxContains: ${t}}`},Mz={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Oz,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:s}=e,i,a,{minContains:u,maxContains:c}=n;s.opts.next?(i=u===void 0?1:u,a=c):i=1;let l=t.const("len",(0,dr._)`${o}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){(0,Hu.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,Hu.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Hu.alwaysValidSchema)(s,r)){let f=(0,dr._)`${l} >= ${i}`;a!==void 0&&(f=(0,dr._)`${f} && ${l} <= ${a}`),e.pass(f);return}s.items=!0;let p=t.name("valid");a===void 0&&i===1?g(p,()=>t.if(p,()=>t.break())):i===0?(t.let(p,!0),a!==void 0&&t.if((0,dr._)`${o}.length > 0`,d)):(t.let(p,!1),d()),e.result(p,()=>e.reset());function d(){let f=t.name("_valid"),h=t.let("count",0);g(f,()=>t.if(f,()=>m(h)))}function g(f,h){t.forRange("i",0,l,y=>{e.subschema({keyword:"contains",dataProp:y,dataPropType:Hu.Type.Num,compositeRule:!0},f),h()})}function m(f){t.code((0,dr._)`${f}++`),a===void 0?t.if((0,dr._)`${f} >= ${i}`,()=>t.assign(p,!0).break()):(t.if((0,dr._)`${f} > ${a}`,()=>t.assign(p,!1).break()),i===1?t.assign(p,!0):t.if((0,dr._)`${f} >= ${i}`,()=>t.assign(p,!0)))}}};Uf.default=Mz});var QS=x(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.validateSchemaDeps=Jr.validatePropertyDeps=Jr.error=void 0;var Vf=Y(),Bz=pe(),Vs=lr();Jr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Vf.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Vf._)`{property: ${e},
30
+ || ${i} === "boolean" || ${o} === null`).assign(a,(0,W._)`[${o}]`)}}}function BM({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,W._)`${t} !== undefined`,()=>e.assign((0,W._)`${t}[${r}]`,n))}function Zd(e,t,r,n=ei.Correct){let o=n===ei.Correct?W.operators.EQ:W.operators.NEQ,s;switch(e){case"null":return(0,W._)`${t} ${o} null`;case"array":s=(0,W._)`Array.isArray(${t})`;break;case"object":s=(0,W._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=i((0,W._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=i();break;default:return(0,W._)`typeof ${t} ${o} ${e}`}return n===ei.Correct?s:(0,W.not)(s);function i(a=W.nil){return(0,W.and)((0,W._)`typeof ${t} == "number"`,a,r?(0,W._)`isFinite(${t})`:W.nil)}}vt.checkDataType=Zd;function Jd(e,t,r,n){if(e.length===1)return Zd(e[0],t,r,n);let o,s=(0,g0.toHash)(e);if(s.array&&s.object){let i=(0,W._)`typeof ${t} != "object"`;o=s.null?i:(0,W._)`!${t} || ${i}`,delete s.null,delete s.array,delete s.object}else o=W.nil;s.number&&delete s.integer;for(let i in s)o=(0,W.and)(o,Zd(i,t,r,n));return o}vt.checkDataTypes=Jd;var zM={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,W._)`{type: ${e}}`:(0,W._)`{type: ${t}}`};function Yd(e){let t=jM(e);(0,IM.reportError)(t,zM)}vt.reportTypeError=Yd;function jM(e){let{gen:t,data:r,schema:n}=e,o=(0,g0.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var v0=x(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.assignDefaults=void 0;var ti=Y(),UM=pe();function VM(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)D0(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,s)=>D0(e,s,o.default))}_u.assignDefaults=VM;function D0(e,t,r){let{gen:n,compositeRule:o,data:s,opts:i}=e;if(r===void 0)return;let a=(0,ti._)`${s}${(0,ti.getProperty)(t)}`;if(o){(0,UM.checkStrictMode)(e,`default is ignored for: ${a}`);return}let u=(0,ti._)`${a} === undefined`;i.useDefaults==="empty"&&(u=(0,ti._)`${u} || ${a} === null || ${a} === ""`),n.if(u,(0,ti._)`${a} = ${(0,ti.stringify)(r)}`)}});var lr=x(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.validateUnion=ve.validateArray=ve.usePattern=ve.callValidateCode=ve.schemaProperties=ve.allSchemaProperties=ve.noPropertyInData=ve.propertyInData=ve.isOwnProperty=ve.hasPropFunc=ve.reportMissingProp=ve.checkMissingProp=ve.checkReportMissingProp=void 0;var $e=Y(),Qd=pe(),$n=fn(),HM=pe();function qM(e,t){let{gen:r,data:n,it:o}=e;r.if(ef(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,$e._)`${t}`},!0),e.error()})}ve.checkReportMissingProp=qM;function KM({gen:e,data:t,it:{opts:r}},n,o){return(0,$e.or)(...n.map(s=>(0,$e.and)(ef(e,t,s,r.ownProperties),(0,$e._)`${o} = ${s}`)))}ve.checkMissingProp=KM;function GM(e,t){e.setParams({missingProperty:t},!0),e.error()}ve.reportMissingProp=GM;function C0(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,$e._)`Object.prototype.hasOwnProperty`})}ve.hasPropFunc=C0;function Xd(e,t,r){return(0,$e._)`${C0(e)}.call(${t}, ${r})`}ve.isOwnProperty=Xd;function WM(e,t,r,n){let o=(0,$e._)`${t}${(0,$e.getProperty)(r)} !== undefined`;return n?(0,$e._)`${o} && ${Xd(e,t,r)}`:o}ve.propertyInData=WM;function ef(e,t,r,n){let o=(0,$e._)`${t}${(0,$e.getProperty)(r)} === undefined`;return n?(0,$e.or)(o,(0,$e.not)(Xd(e,t,r))):o}ve.noPropertyInData=ef;function b0(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ve.allSchemaProperties=b0;function ZM(e,t){return b0(t).filter(r=>!(0,Qd.alwaysValidSchema)(e,t[r]))}ve.schemaProperties=ZM;function JM({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:i},a,u,c){let l=c?(0,$e._)`${e}, ${t}, ${n}${o}`:t,p=[[$n.default.instancePath,(0,$e.strConcat)($n.default.instancePath,s)],[$n.default.parentData,i.parentData],[$n.default.parentDataProperty,i.parentDataProperty],[$n.default.rootData,$n.default.rootData]];i.opts.dynamicRef&&p.push([$n.default.dynamicAnchors,$n.default.dynamicAnchors]);let d=(0,$e._)`${l}, ${r.object(...p)}`;return u!==$e.nil?(0,$e._)`${a}.call(${u}, ${d})`:(0,$e._)`${a}(${d})`}ve.callValidateCode=JM;var YM=(0,$e._)`new RegExp`;function QM({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,s=o(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,$e._)`${o.code==="new RegExp"?YM:(0,HM.useFunc)(e,o)}(${r}, ${n})`})}ve.usePattern=QM;function XM(e){let{gen:t,data:r,keyword:n,it:o}=e,s=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(s,!0),i(()=>t.break()),s;function i(a){let u=t.const("len",(0,$e._)`${r}.length`);t.forRange("i",0,u,c=>{e.subschema({keyword:n,dataProp:c,dataPropType:Qd.Type.Num},s),t.if((0,$e.not)(s),a)})}}ve.validateArray=XM;function eL(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Qd.alwaysValidSchema)(o,u))&&!o.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((u,c)=>{let l=e.subschema({keyword:n,schemaProp:c,compositeRule:!0},a);t.assign(i,(0,$e._)`${i} || ${a}`),e.mergeValidEvaluated(l,a)||t.if((0,$e.not)(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}ve.validateUnion=eL});var S0=x(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.validateKeywordUsage=Gr.validSchemaType=Gr.funcKeywordCode=Gr.macroKeywordCode=void 0;var _t=Y(),po=fn(),tL=lr(),rL=Ss();function nL(e,t){let{gen:r,keyword:n,schema:o,parentSchema:s,it:i}=e,a=t.macro.call(i.self,o,s,i),u=x0(r,n,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let c=r.name("valid");e.subschema({schema:a,schemaPath:_t.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},c),e.pass(c,()=>e.error(!0))}Gr.macroKeywordCode=nL;function oL(e,t){var r;let{gen:n,keyword:o,schema:s,parentSchema:i,$data:a,it:u}=e;sL(u,t);let c=!a&&t.compile?t.compile.call(u.self,s,i,u):t.validate,l=x0(n,o,c),p=n.let("valid");e.block$data(p,d),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function d(){if(t.errors===!1)f(),t.modifying&&w0(e),h(()=>e.error());else{let y=t.async?g():m();t.modifying&&w0(e),h(()=>iL(e,y))}}function g(){let y=n.let("ruleErrs",null);return n.try(()=>f((0,_t._)`await `),b=>n.assign(p,!1).if((0,_t._)`${b} instanceof ${u.ValidationError}`,()=>n.assign(y,(0,_t._)`${b}.errors`),()=>n.throw(b))),y}function m(){let y=(0,_t._)`${l}.errors`;return n.assign(y,null),f(_t.nil),y}function f(y=t.async?(0,_t._)`await `:_t.nil){let b=u.opts.passContext?po.default.this:po.default.self,C=!("compile"in t&&!a||t.schema===!1);n.assign(p,(0,_t._)`${y}${(0,tL.callValidateCode)(e,l,b,C)}`,t.modifying)}function h(y){var b;n.if((0,_t.not)((b=t.valid)!==null&&b!==void 0?b:p),y)}}Gr.funcKeywordCode=oL;function w0(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,_t._)`${n.parentData}[${n.parentDataProperty}]`))}function iL(e,t){let{gen:r}=e;r.if((0,_t._)`Array.isArray(${t})`,()=>{r.assign(po.default.vErrors,(0,_t._)`${po.default.vErrors} === null ? ${t} : ${po.default.vErrors}.concat(${t})`).assign(po.default.errors,(0,_t._)`${po.default.vErrors}.length`),(0,rL.extendErrors)(e)},()=>e.error())}function sL({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function x0(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,_t.stringify)(r)})}function aL(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Gr.validSchemaType=aL;function uL({schema:e,opts:t,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let i=o.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}Gr.validateKeywordUsage=uL});var P0=x(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.extendSubschemaMode=kn.extendSubschemaData=kn.getSubschema=void 0;var Wr=Y(),E0=pe();function cL(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:i}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,Wr._)`${e.schemaPath}${(0,Wr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,Wr._)`${e.schemaPath}${(0,Wr.getProperty)(t)}${(0,Wr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,E0.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}kn.getSubschema=cL;function lL(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:i}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:c,dataPathArr:l,opts:p}=t,d=a.let("data",(0,Wr._)`${t.data}${(0,Wr.getProperty)(r)}`,!0);u(d),e.errorPath=(0,Wr.str)`${c}${(0,E0.getErrorPath)(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=(0,Wr._)`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(o!==void 0){let c=o instanceof Wr.Name?o:a.let("data",o,!0);u(c),i!==void 0&&(e.propertyName=i)}s&&(e.dataTypes=s);function u(c){e.data=c,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,c]}}kn.extendSubschemaData=lL;function pL(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}kn.extendSubschemaMode=pL});var tf=x((vre,_0)=>{"use strict";_0.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}});var T0=x((Cre,A0)=>{"use strict";var In=A0.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};Au(t,n,o,e,"",e)};In.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};In.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};In.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};In.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Au(e,t,r,n,o,s,i,a,u,c){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,s,i,a,u,c);for(var l in n){var p=n[l];if(Array.isArray(p)){if(l in In.arrayKeywords)for(var d=0;d<p.length;d++)Au(e,t,r,p[d],o+"/"+l+"/"+d,s,o,l,n,d)}else if(l in In.propsKeywords){if(p&&typeof p=="object")for(var g in p)Au(e,t,r,p[g],o+"/"+l+"/"+dL(g),s,o,l,n,g)}else(l in In.keywords||e.allKeys&&!(l in In.skipKeywords))&&Au(e,t,r,p,o+"/"+l,s,o,l,n)}r(n,o,s,i,a,u,c)}}function dL(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Ps=x(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.getSchemaRefs=Bt.resolveUrl=Bt.normalizeId=Bt._getFullPath=Bt.getFullPath=Bt.inlineRef=void 0;var fL=pe(),mL=tf(),gL=T0(),hL=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function yL(e,t=!0){return typeof e=="boolean"?!0:t===!0?!rf(e):t?F0(e)<=t:!1}Bt.inlineRef=yL;var DL=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function rf(e){for(let t in e){if(DL.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(rf)||typeof r=="object"&&rf(r))return!0}return!1}function F0(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!hL.has(r)&&(typeof e[r]=="object"&&(0,fL.eachItem)(e[r],n=>t+=F0(n)),t===1/0))return 1/0}return t}function R0(e,t="",r){r!==!1&&(t=ri(t));let n=e.parse(t);return $0(e,n)}Bt.getFullPath=R0;function $0(e,t){return e.serialize(t).split("#")[0]+"#"}Bt._getFullPath=$0;var vL=/#\/?$/;function ri(e){return e?e.replace(vL,""):""}Bt.normalizeId=ri;function CL(e,t,r){return r=ri(r),e.resolve(t,r)}Bt.resolveUrl=CL;var bL=/^[a-z_][-a-z0-9._]*$/i;function wL(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=ri(e[r]||t),s={"":o},i=R0(n,o,!1),a={},u=new Set;return gL(e,{allKeys:!0},(p,d,g,m)=>{if(m===void 0)return;let f=i+d,h=s[m];typeof p[r]=="string"&&(h=y.call(this,p[r])),b.call(this,p.$anchor),b.call(this,p.$dynamicAnchor),s[d]=h;function y(C){let _=this.opts.uriResolver.resolve;if(C=ri(h?_(h,C):C),u.has(C))throw l(C);u.add(C);let S=this.refs[C];return typeof S=="string"&&(S=this.refs[S]),typeof S=="object"?c(p,S.schema,C):C!==ri(f)&&(C[0]==="#"?(c(p,a[C],C),a[C]=p):this.refs[C]=f),C}function b(C){if(typeof C=="string"){if(!bL.test(C))throw new Error(`invalid anchor "${C}"`);y.call(this,`#${C}`)}}}),a;function c(p,d,g){if(d!==void 0&&!mL(p,d))throw l(g)}function l(p){return new Error(`reference "${p}" resolves to more than one schema`)}}Bt.getSchemaRefs=wL});var Ts=x(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.getData=Nn.KeywordCxt=Nn.validateFunctionCode=void 0;var M0=d0(),k0=Es(),of=Wd(),Tu=Es(),xL=v0(),As=S0(),nf=P0(),z=Y(),q=fn(),SL=Ps(),mn=pe(),_s=Ss();function EL(e){if(z0(e)&&(j0(e),B0(e))){AL(e);return}L0(e,()=>(0,M0.topBoolOrEmptySchema)(e))}Nn.validateFunctionCode=EL;function L0({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},s){o.code.es5?e.func(t,(0,z._)`${q.default.data}, ${q.default.valCxt}`,n.$async,()=>{e.code((0,z._)`"use strict"; ${I0(r,o)}`),_L(e,o),e.code(s)}):e.func(t,(0,z._)`${q.default.data}, ${PL(o)}`,n.$async,()=>e.code(I0(r,o)).code(s))}function PL(e){return(0,z._)`{${q.default.instancePath}="", ${q.default.parentData}, ${q.default.parentDataProperty}, ${q.default.rootData}=${q.default.data}${e.dynamicRef?(0,z._)`, ${q.default.dynamicAnchors}={}`:z.nil}}={}`}function _L(e,t){e.if(q.default.valCxt,()=>{e.var(q.default.instancePath,(0,z._)`${q.default.valCxt}.${q.default.instancePath}`),e.var(q.default.parentData,(0,z._)`${q.default.valCxt}.${q.default.parentData}`),e.var(q.default.parentDataProperty,(0,z._)`${q.default.valCxt}.${q.default.parentDataProperty}`),e.var(q.default.rootData,(0,z._)`${q.default.valCxt}.${q.default.rootData}`),t.dynamicRef&&e.var(q.default.dynamicAnchors,(0,z._)`${q.default.valCxt}.${q.default.dynamicAnchors}`)},()=>{e.var(q.default.instancePath,(0,z._)`""`),e.var(q.default.parentData,(0,z._)`undefined`),e.var(q.default.parentDataProperty,(0,z._)`undefined`),e.var(q.default.rootData,q.default.data),t.dynamicRef&&e.var(q.default.dynamicAnchors,(0,z._)`{}`)})}function AL(e){let{schema:t,opts:r,gen:n}=e;L0(e,()=>{r.$comment&&t.$comment&&V0(e),kL(e),n.let(q.default.vErrors,null),n.let(q.default.errors,0),r.unevaluated&&TL(e),U0(e),OL(e)})}function TL(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,z._)`${r}.evaluated`),t.if((0,z._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,z._)`${e.evaluated}.props`,(0,z._)`undefined`)),t.if((0,z._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,z._)`${e.evaluated}.items`,(0,z._)`undefined`))}function I0(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,z._)`/*# sourceURL=${r} */`:z.nil}function FL(e,t){if(z0(e)&&(j0(e),B0(e))){RL(e,t);return}(0,M0.boolOrEmptySchema)(e,t)}function B0({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function z0(e){return typeof e.schema!="boolean"}function RL(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&V0(e),IL(e),NL(e);let s=n.const("_errs",q.default.errors);U0(e,s),n.var(t,(0,z._)`${s} === ${q.default.errors}`)}function j0(e){(0,mn.checkUnknownRules)(e),$L(e)}function U0(e,t){if(e.opts.jtd)return N0(e,[],!1,t);let r=(0,k0.getSchemaTypes)(e.schema),n=(0,k0.coerceAndCheckDataType)(e,r);N0(e,r,!n,t)}function $L(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,mn.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function kL(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,mn.checkStrictMode)(e,"default is ignored in the schema root")}function IL(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,SL.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function NL(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function V0({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)e.code((0,z._)`${q.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let i=(0,z.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,z._)`${q.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function OL(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=e;r.$async?t.if((0,z._)`${q.default.errors} === 0`,()=>t.return(q.default.data),()=>t.throw((0,z._)`new ${o}(${q.default.vErrors})`)):(t.assign((0,z._)`${n}.errors`,q.default.vErrors),s.unevaluated&&ML(e),t.return((0,z._)`${q.default.errors} === 0`))}function ML({gen:e,evaluated:t,props:r,items:n}){r instanceof z.Name&&e.assign((0,z._)`${t}.props`,r),n instanceof z.Name&&e.assign((0,z._)`${t}.items`,n)}function N0(e,t,r,n){let{gen:o,schema:s,data:i,allErrors:a,opts:u,self:c}=e,{RULES:l}=c;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,mn.schemaHasRulesButRef)(s,l))){o.block(()=>q0(e,"$ref",l.all.$ref.definition));return}u.jtd||LL(e,t),o.block(()=>{for(let d of l.rules)p(d);p(l.post)});function p(d){(0,of.shouldUseGroup)(s,d)&&(d.type?(o.if((0,Tu.checkDataType)(d.type,i,u.strictNumbers)),O0(e,d),t.length===1&&t[0]===d.type&&r&&(o.else(),(0,Tu.reportTypeError)(e)),o.endIf()):O0(e,d),a||o.if((0,z._)`${q.default.errors} === ${n||0}`))}}function O0(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,xL.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,of.shouldUseRule)(n,s)&&q0(e,s.keyword,s.definition,t.type)})}function LL(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(BL(e,t),e.opts.allowUnionTypes||zL(e,t),jL(e,e.dataTypes))}function BL(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{H0(e.dataTypes,r)||sf(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),VL(e,t)}}function zL(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&sf(e,"use allowUnionTypes to allow union type keyword")}function jL(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,of.shouldUseRule)(e.schema,o)){let{type:s}=o.definition;s.length&&!s.some(i=>UL(t,i))&&sf(e,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function UL(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function H0(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function VL(e,t){let r=[];for(let n of e.dataTypes)H0(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function sf(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,mn.checkStrictMode)(e,t,e.opts.strictTypes)}var Fu=class{constructor(t,r,n){if((0,As.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,mn.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",K0(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,As.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",q.default.errors))}result(t,r,n){this.failResult((0,z.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,z.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,z._)`${r} !== undefined && (${(0,z.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?_s.reportExtraError:_s.reportError)(this,this.def.error,r)}$dataError(){(0,_s.reportError)(this,this.def.$dataError||_s.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,_s.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=z.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=z.nil,r=z.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:i}=this;n.if((0,z.or)((0,z._)`${o} === undefined`,r)),t!==z.nil&&n.assign(t,!0),(s.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==z.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,z.or)(i(),a());function i(){if(n.length){if(!(r instanceof z.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,z._)`${(0,Tu.checkDataTypes)(u,r,s.opts.strictNumbers,Tu.DataType.Wrong)}`}return z.nil}function a(){if(o.validateSchema){let u=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,z._)`!${u}(${r})`}return z.nil}}subschema(t,r){let n=(0,nf.getSubschema)(this.it,t);(0,nf.extendSubschemaData)(n,this.it,t),(0,nf.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return FL(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=mn.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=mn.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,z.Name)),!0}};Nn.KeywordCxt=Fu;function q0(e,t,r,n){let o=new Fu(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,As.funcKeywordCode)(o,r):"macro"in r?(0,As.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,As.funcKeywordCode)(o,r)}var HL=/^\/(?:[^~]|~0|~1)*$/,qL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function K0(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,s;if(e==="")return q.default.rootData;if(e[0]==="/"){if(!HL.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,s=q.default.rootData}else{let c=qL.exec(e);if(!c)throw new Error(`Invalid JSON-pointer: ${e}`);let l=+c[1];if(o=c[2],o==="#"){if(l>=t)throw new Error(u("property/index",l));return n[t-l]}if(l>t)throw new Error(u("data",l));if(s=r[t-l],!o)return s}let i=s,a=o.split("/");for(let c of a)c&&(s=(0,z._)`${s}${(0,z.getProperty)((0,mn.unescapeJsonPointer)(c))}`,i=(0,z._)`${i} && ${s}`);return i;function u(c,l){return`Cannot access ${c} ${l} levels up, current level is ${t}`}}Nn.getData=K0});var Ru=x(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});var af=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};uf.default=af});var Fs=x(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});var cf=Ps(),lf=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,cf.resolveUrl)(t,r,n),this.missingSchema=(0,cf.normalizeId)((0,cf.getFullPath)(t,this.missingRef))}};pf.default=lf});var ku=x(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.resolveSchema=pr.getCompilingSchema=pr.resolveRef=pr.compileSchema=pr.SchemaEnv=void 0;var wr=Y(),KL=Ru(),fo=fn(),xr=Ps(),G0=pe(),GL=Ts(),ni=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,xr.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};pr.SchemaEnv=ni;function ff(e){let t=W0.call(this,e);if(t)return t;let r=(0,xr.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new wr.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),a;e.$async&&(a=i.scopeValue("Error",{ref:KL.default,code:(0,wr._)`require("ajv/dist/runtime/validation_error").default`}));let u=i.scopeName("validate");e.validateName=u;let c={gen:i,allErrors:this.opts.allErrors,data:fo.default.data,parentData:fo.default.parentData,parentDataProperty:fo.default.parentDataProperty,dataNames:[fo.default.data],dataPathArr:[wr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,wr.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:wr.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,wr._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),(0,GL.validateFunctionCode)(c),i.optimize(this.opts.code.optimize);let p=i.toString();l=`${i.scopeRefs(fo.default.scope)}return ${p}`,this.opts.code.process&&(l=this.opts.code.process(l,e));let g=new Function(`${fo.default.self}`,`${fo.default.scope}`,l)(this,this.scope.get());if(this.scope.value(u,{ref:g}),g.errors=null,g.schema=e.schema,g.schemaEnv=e,e.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:u,validateCode:p,scopeValues:i._values}),this.opts.unevaluated){let{props:m,items:f}=c;g.evaluated={props:m instanceof wr.Name?void 0:m,items:f instanceof wr.Name?void 0:f,dynamicProps:m instanceof wr.Name,dynamicItems:f instanceof wr.Name},g.source&&(g.source.evaluated=(0,wr.stringify)(g.evaluated))}return e.validate=g,e}catch(p){throw delete e.validate,delete e.validateName,l&&this.logger.error("Error compiling schema, function code:",l),p}finally{this._compilations.delete(e)}}pr.compileSchema=ff;function WL(e,t,r){var n;r=(0,xr.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let s=YL.call(this,e,r);if(s===void 0){let i=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;i&&(s=new ni({schema:i,schemaId:a,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=ZL.call(this,s)}pr.resolveRef=WL;function ZL(e){return(0,xr.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:ff.call(this,e)}function W0(e){for(let t of this._compilations)if(JL(t,e))return t}pr.getCompilingSchema=W0;function JL(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function YL(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||$u.call(this,e,t)}function $u(e,t){let r=this.opts.uriResolver.parse(t),n=(0,xr._getFullPath)(this.opts.uriResolver,r),o=(0,xr.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return df.call(this,r,e);let s=(0,xr.normalizeId)(n),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=$u.call(this,e,i);return typeof a?.schema!="object"?void 0:df.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||ff.call(this,i),s===(0,xr.normalizeId)(t)){let{schema:a}=i,{schemaId:u}=this.opts,c=a[u];return c&&(o=(0,xr.resolveUrl)(this.opts.uriResolver,o,c)),new ni({schema:a,schemaId:u,root:e,baseId:o})}return df.call(this,r,i)}}pr.resolveSchema=$u;var QL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function df(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,G0.unescapeFragment)(a)];if(u===void 0)return;r=u;let c=typeof r=="object"&&r[this.opts.schemaId];!QL.has(a)&&c&&(t=(0,xr.resolveUrl)(this.opts.uriResolver,t,c))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,G0.schemaHasRulesButRef)(r,this.RULES)){let a=(0,xr.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=$u.call(this,n,a)}let{schemaId:i}=this.opts;if(s=s||new ni({schema:r,schemaId:i,root:n,baseId:t}),s.schema!==s.root.schema)return s}});var Z0=x((Pre,XL)=>{XL.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Y0=x((_re,J0)=>{"use strict";var eB={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};J0.exports={HEX:eB}});var iS=x((Are,oS)=>{"use strict";var{HEX:tB}=Y0(),rB=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function tS(e){if(nS(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(rB)||[],[r]=t;return r?{host:oB(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function mf(e,t=!1){let r="",n=!0;for(let o of e){if(tB[o]===void 0)return;o!=="0"&&n===!0&&(n=!1),n||(r+=o)}return t&&r.length===0&&(r="0"),r}function nB(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,i=!1,a=!1;function u(){if(o.length){if(s===!1){let c=mf(o);if(c!==void 0)n.push(c);else return r.error=!0,!1}o.length=0}return!0}for(let c=0;c<e.length;c++){let l=e[c];if(!(l==="["||l==="]"))if(l===":"){if(i===!0&&(a=!0),!u())break;if(t++,n.push(":"),t>7){r.error=!0;break}c-1>=0&&e[c-1]===":"&&(i=!0);continue}else if(l==="%"){if(!u())break;s=!0}else{o.push(l);continue}}return o.length&&(s?r.zone=o.join(""):a?n.push(o.join("")):n.push(mf(o))),r.address=n.join(""),r}function rS(e){if(nS(e,":")<2)return{host:e,isIPV6:!1};let t=nB(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,escapedHost:n,isIPV6:!0}}}function oB(e,t){let r="",n=!0,o=e.length;for(let s=0;s<o;s++){let i=e[s];i==="0"&&n?(s+1<=o&&e[s+1]===t||s+1===o)&&(r+=i,n=!1):(i===t?n=!0:n=!1,r+=i)}return r}function nS(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}var Q0=/^\.\.?\//u,X0=/^\/\.(?:\/|$)/u,eS=/^\/\.\.(?:\/|$)/u,iB=/^\/?(?:.|\n)*?(?=\/|$)/u;function sB(e){let t=[];for(;e.length;)if(e.match(Q0))e=e.replace(Q0,"");else if(e.match(X0))e=e.replace(X0,"/");else if(e.match(eS))e=e.replace(eS,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(iB);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}function aB(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function uB(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host),n=tS(r);if(n.isIPV4)r=n.host;else{let o=rS(n.host);o.isIPV6===!0?r=`[${o.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}oS.exports={recomposeAuthority:uB,normalizeComponentEncoding:aB,removeDotSegments:sB,normalizeIPv4:tS,normalizeIPv6:rS,stringArrayToHexStripped:mf}});var pS=x((Tre,lS)=>{"use strict";var cB=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,lB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function sS(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}function aS(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function uS(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function pB(e){return e.secure=sS(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function dB(e){if((e.port===(sS(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function fB(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(lB);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,s=gf[o];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function mB(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,s=gf[o];s&&(e=s.serialize(e,t));let i=e,a=e.nss;return i.path=`${n||t.nid}:${a}`,t.skipEscape=!0,i}function gB(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!cB.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function hB(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var cS={scheme:"http",domainHost:!0,parse:aS,serialize:uS},yB={scheme:"https",domainHost:cS.domainHost,parse:aS,serialize:uS},Iu={scheme:"ws",domainHost:!0,parse:pB,serialize:dB},DB={scheme:"wss",domainHost:Iu.domainHost,parse:Iu.parse,serialize:Iu.serialize},vB={scheme:"urn",parse:fB,serialize:mB,skipNormalize:!0},CB={scheme:"urn:uuid",parse:gB,serialize:hB,skipNormalize:!0},gf={http:cS,https:yB,ws:Iu,wss:DB,urn:vB,"urn:uuid":CB};lS.exports=gf});var fS=x((Fre,Ou)=>{"use strict";var{normalizeIPv6:bB,normalizeIPv4:wB,removeDotSegments:Rs,recomposeAuthority:xB,normalizeComponentEncoding:Nu}=iS(),hf=pS();function SB(e,t){return typeof e=="string"?e=Zr(gn(e,t),t):typeof e=="object"&&(e=gn(Zr(e,t),t)),e}function EB(e,t,r){let n=Object.assign({scheme:"null"},r),o=dS(gn(e,n),gn(t,n),n,!0);return Zr(o,{...n,skipEscape:!0})}function dS(e,t,r,n){let o={};return n||(e=gn(Zr(e,r),r),t=gn(Zr(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Rs(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Rs(t.path||""),o.query=t.query):(t.path?(t.path.charAt(0)==="/"?o.path=Rs(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=Rs(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function PB(e,t,r){return typeof e=="string"?(e=unescape(e),e=Zr(Nu(gn(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Zr(Nu(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Zr(Nu(gn(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Zr(Nu(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Zr(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],s=hf[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let i=xB(r);if(i!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(i),r.path&&r.path.charAt(0)!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=Rs(a)),i===void 0&&(a=a.replace(/^\/\//u,"/%2F")),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var _B=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function AB(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||_B[t])return!0;return!1}var TB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function gn(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=e.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let i=e.match(TB);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host){let u=wB(n.host);if(u.isIPV4===!1){let c=bB(u.host);n.host=c.host.toLowerCase(),s=c.isIPV6}else n.host=u.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=hf[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&AB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}(!a||a&&!a.skipNormalize)&&(o&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),o&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var yf={SCHEMES:hf,normalize:SB,resolve:EB,resolveComponents:dS,equal:PB,serialize:Zr,parse:gn};Ou.exports=yf;Ou.exports.default=yf;Ou.exports.fastUri=yf});var gS=x(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});var mS=fS();mS.code='require("ajv/dist/runtime/uri").default';Df.default=mS});var xS=x(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.CodeGen=lt.Name=lt.nil=lt.stringify=lt.str=lt._=lt.KeywordCxt=void 0;var FB=Ts();Object.defineProperty(lt,"KeywordCxt",{enumerable:!0,get:function(){return FB.KeywordCxt}});var oi=Y();Object.defineProperty(lt,"_",{enumerable:!0,get:function(){return oi._}});Object.defineProperty(lt,"str",{enumerable:!0,get:function(){return oi.str}});Object.defineProperty(lt,"stringify",{enumerable:!0,get:function(){return oi.stringify}});Object.defineProperty(lt,"nil",{enumerable:!0,get:function(){return oi.nil}});Object.defineProperty(lt,"Name",{enumerable:!0,get:function(){return oi.Name}});Object.defineProperty(lt,"CodeGen",{enumerable:!0,get:function(){return oi.CodeGen}});var RB=Ru(),CS=Fs(),$B=Gd(),$s=ku(),kB=Y(),ks=Ps(),Mu=Es(),Cf=pe(),hS=Z0(),IB=gS(),bS=(e,t)=>new RegExp(e,t);bS.code="new RegExp";var NB=["removeAdditional","useDefaults","coerceTypes"],OB=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),MB={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},LB={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},yS=200;function BB(e){var t,r,n,o,s,i,a,u,c,l,p,d,g,m,f,h,y,b,C,_,S,F,$,I,k;let R=e.strict,D=(t=e.code)===null||t===void 0?void 0:t.optimize,L=D===!0||D===void 0?1:D||0,U=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:bS,H=(o=e.uriResolver)!==null&&o!==void 0?o:IB.default;return{strictSchema:(i=(s=e.strictSchema)!==null&&s!==void 0?s:R)!==null&&i!==void 0?i:!0,strictNumbers:(u=(a=e.strictNumbers)!==null&&a!==void 0?a:R)!==null&&u!==void 0?u:!0,strictTypes:(l=(c=e.strictTypes)!==null&&c!==void 0?c:R)!==null&&l!==void 0?l:"log",strictTuples:(d=(p=e.strictTuples)!==null&&p!==void 0?p:R)!==null&&d!==void 0?d:"log",strictRequired:(m=(g=e.strictRequired)!==null&&g!==void 0?g:R)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:L,regExp:U}:{optimize:L,regExp:U},loopRequired:(f=e.loopRequired)!==null&&f!==void 0?f:yS,loopEnum:(h=e.loopEnum)!==null&&h!==void 0?h:yS,meta:(y=e.meta)!==null&&y!==void 0?y:!0,messages:(b=e.messages)!==null&&b!==void 0?b:!0,inlineRefs:(C=e.inlineRefs)!==null&&C!==void 0?C:!0,schemaId:(_=e.schemaId)!==null&&_!==void 0?_:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(F=e.validateSchema)!==null&&F!==void 0?F:!0,validateFormats:($=e.validateFormats)!==null&&$!==void 0?$:!0,unicodeRegExp:(I=e.unicodeRegExp)!==null&&I!==void 0?I:!0,int32range:(k=e.int32range)!==null&&k!==void 0?k:!0,uriResolver:H}}var Is=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...BB(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new kB.ValueScope({scope:{},prefixes:OB,es5:r,lines:n}),this.logger=qB(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,$B.getRules)(),DS.call(this,MB,t,"NOT SUPPORTED"),DS.call(this,LB,t,"DEPRECATED","warn"),this._metaOpts=VB.call(this),t.formats&&jB.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&UB.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),zB.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=hS;n==="id"&&(o={...hS},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(l,p){await s.call(this,l.$schema);let d=this._addSchema(l,p);return d.validate||i.call(this,d)}async function s(l){l&&!this.getSchema(l)&&await o.call(this,{$ref:l},!0)}async function i(l){try{return this._compileSchemaEnv(l)}catch(p){if(!(p instanceof CS.default))throw p;return a.call(this,p),await u.call(this,p.missingSchema),i.call(this,l)}}function a({missingSchema:l,missingRef:p}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${p} cannot be resolved`)}async function u(l){let p=await c.call(this,l);this.refs[l]||await s.call(this,p.$schema),this.refs[l]||this.addSchema(p,l,r)}async function c(l){let p=this._loading[l];if(p)return p;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let i of t)this.addSchema(i,void 0,n,o);return this}let s;if(typeof t=="object"){let{schemaId:i}=this.opts;if(s=t[i],s!==void 0&&typeof s!="string")throw new Error(`schema ${i} must be string`)}return r=(0,ks.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(t){let r;for(;typeof(r=vS.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new $s.SchemaEnv({schema:{},schemaId:n});if(r=$s.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=vS.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,ks.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(GB.call(this,n,r),!r)return(0,Cf.eachItem)(n,s=>vf.call(this,s)),this;ZB.call(this,r);let o={...r,type:(0,Mu.getJSONTypes)(r.type),schemaType:(0,Mu.getJSONTypes)(r.schemaType)};return(0,Cf.eachItem)(n,o.type.length===0?s=>vf.call(this,s,o):s=>o.type.forEach(i=>vf.call(this,s,o,i))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let s=o.split("/").slice(1),i=t;for(let a of s)i=i[a];for(let a in n){let u=n[a];if(typeof u!="object")continue;let{$data:c}=u.definition,l=i[a];c&&l&&(i[a]=wS(l))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof t=="object")i=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(t);if(u!==void 0)return u;n=(0,ks.normalizeId)(i||n);let c=ks.getSchemaRefs.call(this,t,n);return u=new $s.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:c}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),o&&this.validateSchema(t,!0),u}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):$s.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{$s.compileSchema.call(this,t)}finally{this.opts=r}}};Is.ValidationError=RB.default;Is.MissingRefError=CS.default;lt.default=Is;function DS(e,t,r,n="error"){for(let o in e){let s=o;s in t&&this.logger[n](`${r}: option ${o}. ${e[s]}`)}}function vS(e){return e=(0,ks.normalizeId)(e),this.schemas[e]||this.refs[e]}function zB(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function jB(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function UB(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function VB(){let e={...this.opts};for(let t of NB)delete e[t];return e}var HB={log(){},warn(){},error(){}};function qB(e){if(e===!1)return HB;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var KB=/^[a-z_$][a-z0-9_$:-]*$/i;function GB(e,t){let{RULES:r}=this;if((0,Cf.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!KB.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function vf(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=o?s.post:s.rules.find(({type:u})=>u===r);if(i||(i={type:r,rules:[]},s.rules.push(i)),s.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,Mu.getJSONTypes)(t.type),schemaType:(0,Mu.getJSONTypes)(t.schemaType)}};t.before?WB.call(this,i,a,t.before):i.rules.push(a),s.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}function WB(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function ZB(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=wS(t)),e.validateSchema=this.compile(t,!0))}var JB={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function wS(e){return{anyOf:[e,JB]}}});var SS=x(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});var YB={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};bf.default=YB});var AS=x(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.callRef=mo.getValidate=void 0;var QB=Fs(),ES=lr(),zt=Y(),ii=fn(),PS=ku(),Lu=pe(),XB={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:s,validateName:i,opts:a,self:u}=n,{root:c}=s;if((r==="#"||r==="#/")&&o===c.baseId)return p();let l=PS.resolveRef.call(u,c,o,r);if(l===void 0)throw new QB.default(n.opts.uriResolver,o,r);if(l instanceof PS.SchemaEnv)return d(l);return g(l);function p(){if(s===c)return Bu(e,i,s,s.$async);let m=t.scopeValue("root",{ref:c});return Bu(e,(0,zt._)`${m}.validate`,c,c.$async)}function d(m){let f=_S(e,m);Bu(e,f,m,m.$async)}function g(m){let f=t.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,zt.stringify)(m)}:{ref:m}),h=t.name("valid"),y=e.subschema({schema:m,dataTypes:[],schemaPath:zt.nil,topSchemaRef:f,errSchemaPath:r},h);e.mergeEvaluated(y),e.ok(h)}}};function _S(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,zt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}mo.getValidate=_S;function Bu(e,t,r,n){let{gen:o,it:s}=e,{allErrors:i,schemaEnv:a,opts:u}=s,c=u.passContext?ii.default.this:zt.nil;n?l():p();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=o.let("valid");o.try(()=>{o.code((0,zt._)`await ${(0,ES.callValidateCode)(e,t,c)}`),g(t),i||o.assign(m,!0)},f=>{o.if((0,zt._)`!(${f} instanceof ${s.ValidationError})`,()=>o.throw(f)),d(f),i||o.assign(m,!1)}),e.ok(m)}function p(){e.result((0,ES.callValidateCode)(e,t,c),()=>g(t),()=>d(t))}function d(m){let f=(0,zt._)`${m}.errors`;o.assign(ii.default.vErrors,(0,zt._)`${ii.default.vErrors} === null ? ${f} : ${ii.default.vErrors}.concat(${f})`),o.assign(ii.default.errors,(0,zt._)`${ii.default.vErrors}.length`)}function g(m){var f;if(!s.opts.unevaluated)return;let h=(f=r?.validate)===null||f===void 0?void 0:f.evaluated;if(s.props!==!0)if(h&&!h.dynamicProps)h.props!==void 0&&(s.props=Lu.mergeEvaluated.props(o,h.props,s.props));else{let y=o.var("props",(0,zt._)`${m}.evaluated.props`);s.props=Lu.mergeEvaluated.props(o,y,s.props,zt.Name)}if(s.items!==!0)if(h&&!h.dynamicItems)h.items!==void 0&&(s.items=Lu.mergeEvaluated.items(o,h.items,s.items));else{let y=o.var("items",(0,zt._)`${m}.evaluated.items`);s.items=Lu.mergeEvaluated.items(o,y,s.items,zt.Name)}}}mo.callRef=Bu;mo.default=XB});var TS=x(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});var ez=SS(),tz=AS(),rz=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",ez.default,tz.default];wf.default=rz});var FS=x(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});var zu=Y(),On=zu.operators,ju={maximum:{okStr:"<=",ok:On.LTE,fail:On.GT},minimum:{okStr:">=",ok:On.GTE,fail:On.LT},exclusiveMaximum:{okStr:"<",ok:On.LT,fail:On.GTE},exclusiveMinimum:{okStr:">",ok:On.GT,fail:On.LTE}},nz={message:({keyword:e,schemaCode:t})=>(0,zu.str)`must be ${ju[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,zu._)`{comparison: ${ju[e].okStr}, limit: ${t}}`},oz={keyword:Object.keys(ju),type:"number",schemaType:"number",$data:!0,error:nz,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,zu._)`${r} ${ju[t].fail} ${n} || isNaN(${r})`)}};xf.default=oz});var RS=x(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});var Ns=Y(),iz={message:({schemaCode:e})=>(0,Ns.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Ns._)`{multipleOf: ${e}}`},sz={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:iz,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,s=o.opts.multipleOfPrecision,i=t.let("res"),a=s?(0,Ns._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,Ns._)`${i} !== parseInt(${i})`;e.fail$data((0,Ns._)`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};Sf.default=sz});var kS=x(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});function $S(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}Ef.default=$S;$S.code='require("ajv/dist/runtime/ucs2length").default'});var IS=x(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});var go=Y(),az=pe(),uz=kS(),cz={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,go.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,go._)`{limit: ${e}}`},lz={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:cz,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,s=t==="maxLength"?go.operators.GT:go.operators.LT,i=o.opts.unicode===!1?(0,go._)`${r}.length`:(0,go._)`${(0,az.useFunc)(e.gen,uz.default)}(${r})`;e.fail$data((0,go._)`${i} ${s} ${n}`)}};Pf.default=lz});var NS=x(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});var pz=lr(),Uu=Y(),dz={message:({schemaCode:e})=>(0,Uu.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Uu._)`{pattern: ${e}}`},fz={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:dz,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:s}=e,i=s.opts.unicodeRegExp?"u":"",a=r?(0,Uu._)`(new RegExp(${o}, ${i}))`:(0,pz.usePattern)(e,n);e.fail$data((0,Uu._)`!${a}.test(${t})`)}};_f.default=fz});var OS=x(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});var Os=Y(),mz={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Os.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Os._)`{limit: ${e}}`},gz={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:mz,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?Os.operators.GT:Os.operators.LT;e.fail$data((0,Os._)`Object.keys(${r}).length ${o} ${n}`)}};Af.default=gz});var MS=x(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});var Ms=lr(),Ls=Y(),hz=pe(),yz={message:({params:{missingProperty:e}})=>(0,Ls.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Ls._)`{missingProperty: ${e}}`},Dz={keyword:"required",type:"object",schemaType:"array",$data:!0,error:yz,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:s,it:i}=e,{opts:a}=i;if(!s&&r.length===0)return;let u=r.length>=a.loopRequired;if(i.allErrors?c():l(),a.strictRequired){let g=e.parentSchema.properties,{definedProperties:m}=e.it;for(let f of r)if(g?.[f]===void 0&&!m.has(f)){let h=i.schemaEnv.baseId+i.errSchemaPath,y=`required property "${f}" is not defined at "${h}" (strictRequired)`;(0,hz.checkStrictMode)(i,y,i.opts.strictRequired)}}function c(){if(u||s)e.block$data(Ls.nil,p);else for(let g of r)(0,Ms.checkReportMissingProp)(e,g)}function l(){let g=t.let("missing");if(u||s){let m=t.let("valid",!0);e.block$data(m,()=>d(g,m)),e.ok(m)}else t.if((0,Ms.checkMissingProp)(e,r,g)),(0,Ms.reportMissingProp)(e,g),t.else()}function p(){t.forOf("prop",n,g=>{e.setParams({missingProperty:g}),t.if((0,Ms.noPropertyInData)(t,o,g,a.ownProperties),()=>e.error())})}function d(g,m){e.setParams({missingProperty:g}),t.forOf(g,n,()=>{t.assign(m,(0,Ms.propertyInData)(t,o,g,a.ownProperties)),t.if((0,Ls.not)(m),()=>{e.error(),t.break()})},Ls.nil)}}};Tf.default=Dz});var LS=x(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});var Bs=Y(),vz={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Bs.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Bs._)`{limit: ${e}}`},Cz={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:vz,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?Bs.operators.GT:Bs.operators.LT;e.fail$data((0,Bs._)`${r}.length ${o} ${n}`)}};Ff.default=Cz});var Vu=x(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});var BS=tf();BS.code='require("ajv/dist/runtime/equal").default';Rf.default=BS});var zS=x(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});var $f=Es(),pt=Y(),bz=pe(),wz=Vu(),xz={message:({params:{i:e,j:t}})=>(0,pt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,pt._)`{i: ${e}, j: ${t}}`},Sz={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:xz,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:s,schemaCode:i,it:a}=e;if(!n&&!o)return;let u=t.let("valid"),c=s.items?(0,$f.getSchemaTypes)(s.items):[];e.block$data(u,l,(0,pt._)`${i} === false`),e.ok(u);function l(){let m=t.let("i",(0,pt._)`${r}.length`),f=t.let("j");e.setParams({i:m,j:f}),t.assign(u,!0),t.if((0,pt._)`${m} > 1`,()=>(p()?d:g)(m,f))}function p(){return c.length>0&&!c.some(m=>m==="object"||m==="array")}function d(m,f){let h=t.name("item"),y=(0,$f.checkDataTypes)(c,h,a.opts.strictNumbers,$f.DataType.Wrong),b=t.const("indices",(0,pt._)`{}`);t.for((0,pt._)`;${m}--;`,()=>{t.let(h,(0,pt._)`${r}[${m}]`),t.if(y,(0,pt._)`continue`),c.length>1&&t.if((0,pt._)`typeof ${h} == "string"`,(0,pt._)`${h} += "_"`),t.if((0,pt._)`typeof ${b}[${h}] == "number"`,()=>{t.assign(f,(0,pt._)`${b}[${h}]`),e.error(),t.assign(u,!1).break()}).code((0,pt._)`${b}[${h}] = ${m}`)})}function g(m,f){let h=(0,bz.useFunc)(t,wz.default),y=t.name("outer");t.label(y).for((0,pt._)`;${m}--;`,()=>t.for((0,pt._)`${f} = ${m}; ${f}--;`,()=>t.if((0,pt._)`${h}(${r}[${m}], ${r}[${f}])`,()=>{e.error(),t.assign(u,!1).break(y)})))}}};kf.default=Sz});var jS=x(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});var If=Y(),Ez=pe(),Pz=Vu(),_z={message:"must be equal to constant",params:({schemaCode:e})=>(0,If._)`{allowedValue: ${e}}`},Az={keyword:"const",$data:!0,error:_z,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:s}=e;n||s&&typeof s=="object"?e.fail$data((0,If._)`!${(0,Ez.useFunc)(t,Pz.default)}(${r}, ${o})`):e.fail((0,If._)`${s} !== ${r}`)}};Nf.default=Az});var US=x(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});var zs=Y(),Tz=pe(),Fz=Vu(),Rz={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,zs._)`{allowedValues: ${e}}`},$z={keyword:"enum",schemaType:"array",$data:!0,error:Rz,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:s,it:i}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=i.opts.loopEnum,u,c=()=>u??(u=(0,Tz.useFunc)(t,Fz.default)),l;if(a||n)l=t.let("valid"),e.block$data(l,p);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let g=t.const("vSchema",s);l=(0,zs.or)(...o.map((m,f)=>d(g,f)))}e.pass(l);function p(){t.assign(l,!1),t.forOf("v",s,g=>t.if((0,zs._)`${c()}(${r}, ${g})`,()=>t.assign(l,!0).break()))}function d(g,m){let f=o[m];return typeof f=="object"&&f!==null?(0,zs._)`${c()}(${r}, ${g}[${m}])`:(0,zs._)`${r} === ${f}`}}};Of.default=$z});var VS=x(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});var kz=FS(),Iz=RS(),Nz=IS(),Oz=NS(),Mz=OS(),Lz=MS(),Bz=LS(),zz=zS(),jz=jS(),Uz=US(),Vz=[kz.default,Iz.default,Nz.default,Oz.default,Mz.default,Lz.default,Bz.default,zz.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},jz.default,Uz.default];Mf.default=Vz});var Bf=x(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.validateAdditionalItems=void 0;var ho=Y(),Lf=pe(),Hz={message:({params:{len:e}})=>(0,ho.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ho._)`{limit: ${e}}`},qz={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Hz,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Lf.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}HS(e,n)}};function HS(e,t){let{gen:r,schema:n,data:o,keyword:s,it:i}=e;i.items=!0;let a=r.const("len",(0,ho._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,ho._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,Lf.alwaysValidSchema)(i,n)){let c=r.var("valid",(0,ho._)`${a} <= ${t.length}`);r.if((0,ho.not)(c),()=>u(c)),e.ok(c)}function u(c){r.forRange("i",t.length,a,l=>{e.subschema({keyword:s,dataProp:l,dataPropType:Lf.Type.Num},c),i.allErrors||r.if((0,ho.not)(c),()=>r.break())})}}js.validateAdditionalItems=HS;js.default=qz});var zf=x(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.validateTuple=void 0;var qS=Y(),Hu=pe(),Kz=lr(),Gz={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return KS(e,"additionalItems",t);r.items=!0,!(0,Hu.alwaysValidSchema)(r,t)&&e.ok((0,Kz.validateArray)(e))}};function KS(e,t,r=e.schema){let{gen:n,parentSchema:o,data:s,keyword:i,it:a}=e;l(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Hu.mergeEvaluated.items(n,r.length,a.items));let u=n.name("valid"),c=n.const("len",(0,qS._)`${s}.length`);r.forEach((p,d)=>{(0,Hu.alwaysValidSchema)(a,p)||(n.if((0,qS._)`${c} > ${d}`,()=>e.subschema({keyword:i,schemaProp:d,dataProp:d},u)),e.ok(u))});function l(p){let{opts:d,errSchemaPath:g}=a,m=r.length,f=m===p.minItems&&(m===p.maxItems||p[t]===!1);if(d.strictTuples&&!f){let h=`"${i}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${g}"`;(0,Hu.checkStrictMode)(a,h,d.strictTuples)}}}Us.validateTuple=KS;Us.default=Gz});var GS=x(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});var Wz=zf(),Zz={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Wz.validateTuple)(e,"items")};jf.default=Zz});var ZS=x(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});var WS=Y(),Jz=pe(),Yz=lr(),Qz=Bf(),Xz={message:({params:{len:e}})=>(0,WS.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,WS._)`{limit: ${e}}`},e3={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Xz,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,Jz.alwaysValidSchema)(n,t)&&(o?(0,Qz.validateAdditionalItems)(e,o):e.ok((0,Yz.validateArray)(e)))}};Uf.default=e3});var JS=x(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});var dr=Y(),qu=pe(),t3={message:({params:{min:e,max:t}})=>t===void 0?(0,dr.str)`must contain at least ${e} valid item(s)`:(0,dr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,dr._)`{minContains: ${e}}`:(0,dr._)`{minContains: ${e}, maxContains: ${t}}`},r3={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:t3,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:s}=e,i,a,{minContains:u,maxContains:c}=n;s.opts.next?(i=u===void 0?1:u,a=c):i=1;let l=t.const("len",(0,dr._)`${o}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){(0,qu.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,qu.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,qu.alwaysValidSchema)(s,r)){let f=(0,dr._)`${l} >= ${i}`;a!==void 0&&(f=(0,dr._)`${f} && ${l} <= ${a}`),e.pass(f);return}s.items=!0;let p=t.name("valid");a===void 0&&i===1?g(p,()=>t.if(p,()=>t.break())):i===0?(t.let(p,!0),a!==void 0&&t.if((0,dr._)`${o}.length > 0`,d)):(t.let(p,!1),d()),e.result(p,()=>e.reset());function d(){let f=t.name("_valid"),h=t.let("count",0);g(f,()=>t.if(f,()=>m(h)))}function g(f,h){t.forRange("i",0,l,y=>{e.subschema({keyword:"contains",dataProp:y,dataPropType:qu.Type.Num,compositeRule:!0},f),h()})}function m(f){t.code((0,dr._)`${f}++`),a===void 0?t.if((0,dr._)`${f} >= ${i}`,()=>t.assign(p,!0).break()):(t.if((0,dr._)`${f} > ${a}`,()=>t.assign(p,!1).break()),i===1?t.assign(p,!0):t.if((0,dr._)`${f} >= ${i}`,()=>t.assign(p,!0)))}}};Vf.default=r3});var XS=x(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.validateSchemaDeps=Jr.validatePropertyDeps=Jr.error=void 0;var Hf=Y(),n3=pe(),Vs=lr();Jr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,Hf.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,Hf._)`{property: ${e},
31
31
  missingProperty: ${n},
32
32
  depsCount: ${t},
33
- deps: ${r}}`};var Lz={keyword:"dependencies",type:"object",schemaType:"object",error:Jr.error,code(e){let[t,r]=zz(e);JS(e,t),YS(e,r)}};function zz({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function JS(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let i in t){let a=t[i];if(a.length===0)continue;let u=(0,Vs.propertyInData)(r,n,i,o.opts.ownProperties);e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(u,()=>{for(let c of a)(0,Vs.checkReportMissingProp)(e,c)}):(r.if((0,Vf._)`${u} && (${(0,Vs.checkMissingProp)(e,a,s)})`),(0,Vs.reportMissingProp)(e,s),r.else())}}Jr.validatePropertyDeps=JS;function YS(e,t=e.schema){let{gen:r,data:n,keyword:o,it:s}=e,i=r.name("valid");for(let a in t)(0,Bz.alwaysValidSchema)(s,t[a])||(r.if((0,Vs.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let u=e.subschema({keyword:o,schemaProp:a},i);e.mergeValidEvaluated(u,i)},()=>r.var(i,!0)),e.ok(i))}Jr.validateSchemaDeps=YS;Jr.default=Lz});var eE=x(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});var XS=Y(),jz=pe(),Uz={message:"property name must be valid",params:({params:e})=>(0,XS._)`{propertyName: ${e.propertyName}}`},Vz={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Uz,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,jz.alwaysValidSchema)(o,r))return;let s=t.name("valid");t.forIn("key",n,i=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),t.if((0,XS.not)(s),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(s)}};Hf.default=Vz});var Kf=x(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});var qu=lr(),Sr=Y(),Hz=fn(),Ku=pe(),qz={message:"must NOT have additional properties",params:({params:e})=>(0,Sr._)`{additionalProperty: ${e.additionalProperty}}`},Kz={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:qz,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:s,it:i}=e;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:u}=i;if(i.props=!0,u.removeAdditional!=="all"&&(0,Ku.alwaysValidSchema)(i,r))return;let c=(0,qu.allSchemaProperties)(n.properties),l=(0,qu.allSchemaProperties)(n.patternProperties);p(),e.ok((0,Sr._)`${s} === ${Hz.default.errors}`);function p(){t.forIn("key",o,h=>{!c.length&&!l.length?m(h):t.if(d(h),()=>m(h))})}function d(h){let y;if(c.length>8){let b=(0,Ku.schemaRefOrVal)(i,n.properties,"properties");y=(0,qu.isOwnProperty)(t,b,h)}else c.length?y=(0,Sr.or)(...c.map(b=>(0,Sr._)`${h} === ${b}`)):y=Sr.nil;return l.length&&(y=(0,Sr.or)(y,...l.map(b=>(0,Sr._)`${(0,qu.usePattern)(e,b)}.test(${h})`))),(0,Sr.not)(y)}function g(h){t.code((0,Sr._)`delete ${o}[${h}]`)}function m(h){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){g(h);return}if(r===!1){e.setParams({additionalProperty:h}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,Ku.alwaysValidSchema)(i,r)){let y=t.name("valid");u.removeAdditional==="failing"?(f(h,y,!1),t.if((0,Sr.not)(y),()=>{e.reset(),g(h)})):(f(h,y),a||t.if((0,Sr.not)(y),()=>t.break()))}}function f(h,y,b){let C={keyword:"additionalProperties",dataProp:h,dataPropType:Ku.Type.Str};b===!1&&Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(C,y)}}};qf.default=Kz});var nE=x(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});var Gz=Fs(),tE=lr(),Gf=pe(),rE=Kf(),Wz={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:s}=e;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&rE.default.code(new Gz.KeywordCxt(s,rE.default,"additionalProperties"));let i=(0,tE.allSchemaProperties)(r);for(let p of i)s.definedProperties.add(p);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=Gf.mergeEvaluated.props(t,(0,Gf.toHash)(i),s.props));let a=i.filter(p=>!(0,Gf.alwaysValidSchema)(s,r[p]));if(a.length===0)return;let u=t.name("valid");for(let p of a)c(p)?l(p):(t.if((0,tE.propertyInData)(t,o,p,s.opts.ownProperties)),l(p),s.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(p),e.ok(u);function c(p){return s.opts.useDefaults&&!s.compositeRule&&r[p].default!==void 0}function l(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},u)}}};Wf.default=Wz});var aE=x(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});var oE=lr(),Gu=Y(),iE=pe(),sE=pe(),Zz={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:s}=e,{opts:i}=s,a=(0,oE.allSchemaProperties)(r),u=a.filter(f=>(0,iE.alwaysValidSchema)(s,r[f]));if(a.length===0||u.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let c=i.strictSchema&&!i.allowMatchingProperties&&o.properties,l=t.name("valid");s.props!==!0&&!(s.props instanceof Gu.Name)&&(s.props=(0,sE.evaluatedPropsToName)(t,s.props));let{props:p}=s;d();function d(){for(let f of a)c&&g(f),s.allErrors?m(f):(t.var(l,!0),m(f),t.if(l))}function g(f){for(let h in c)new RegExp(f).test(h)&&(0,iE.checkStrictMode)(s,`property ${h} matches pattern ${f} (use allowMatchingProperties)`)}function m(f){t.forIn("key",n,h=>{t.if((0,Gu._)`${(0,oE.usePattern)(e,f)}.test(${h})`,()=>{let y=u.includes(f);y||e.subschema({keyword:"patternProperties",schemaProp:f,dataProp:h,dataPropType:sE.Type.Str},l),s.opts.unevaluated&&p!==!0?t.assign((0,Gu._)`${p}[${h}]`,!0):!y&&!s.allErrors&&t.if((0,Gu.not)(l),()=>t.break())})})}}};Zf.default=Zz});var uE=x(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});var Jz=pe(),Yz={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,Jz.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Jf.default=Yz});var cE=x(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});var Qz=lr(),Xz={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Qz.validateUnion,error:{message:"must match a schema in anyOf"}};Yf.default=Xz});var lE=x(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});var Wu=Y(),e3=pe(),t3={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Wu._)`{passingSchemas: ${e.passing}}`},r3={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:t3,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,i=t.let("valid",!1),a=t.let("passing",null),u=t.name("_valid");e.setParams({passing:a}),t.block(c),e.result(i,()=>e.reset(),()=>e.error(!0));function c(){s.forEach((l,p)=>{let d;(0,e3.alwaysValidSchema)(o,l)?t.var(u,!0):d=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},u),p>0&&t.if((0,Wu._)`${u} && ${i}`).assign(i,!1).assign(a,(0,Wu._)`[${a}, ${p}]`).else(),t.if(u,()=>{t.assign(i,!0),t.assign(a,p),d&&e.mergeEvaluated(d,Wu.Name)})})}}};Qf.default=r3});var pE=x(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});var n3=pe(),o3={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((s,i)=>{if((0,n3.alwaysValidSchema)(n,s))return;let a=e.subschema({keyword:"allOf",schemaProp:i},o);e.ok(o),e.mergeEvaluated(a)})}};Xf.default=o3});var mE=x(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});var Zu=Y(),fE=pe(),i3={message:({params:e})=>(0,Zu.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Zu._)`{failingKeyword: ${e.ifClause}}`},s3={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:i3,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,fE.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=dE(n,"then"),s=dE(n,"else");if(!o&&!s)return;let i=t.let("valid",!0),a=t.name("_valid");if(u(),e.reset(),o&&s){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(a,c("then",l),c("else",l))}else o?t.if(a,c("then")):t.if((0,Zu.not)(a),c("else"));e.pass(i,()=>e.error(!0));function u(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(l)}function c(l,p){return()=>{let d=e.subschema({keyword:l},a);t.assign(i,a),e.mergeValidEvaluated(d,i),p?t.assign(p,(0,Zu._)`${l}`):e.setParams({ifClause:l})}}}};function dE(e,t){let r=e.schema[t];return r!==void 0&&!(0,fE.alwaysValidSchema)(e,r)}em.default=s3});var gE=x(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});var a3=pe(),u3={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,a3.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};tm.default=u3});var hE=x(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});var c3=Bf(),l3=KS(),p3=Lf(),d3=WS(),f3=ZS(),m3=QS(),g3=eE(),h3=Kf(),y3=nE(),D3=aE(),v3=uE(),C3=cE(),b3=lE(),w3=pE(),x3=mE(),S3=gE();function E3(e=!1){let t=[v3.default,C3.default,b3.default,w3.default,x3.default,S3.default,g3.default,h3.default,m3.default,y3.default,D3.default];return e?t.push(l3.default,d3.default):t.push(c3.default,p3.default),t.push(f3.default),t}rm.default=E3});var yE=x(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});var qe=Y(),P3={message:({schemaCode:e})=>(0,qe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,qe._)`{format: ${e}}`},_3={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:P3,code(e,t){let{gen:r,data:n,$data:o,schema:s,schemaCode:i,it:a}=e,{opts:u,errSchemaPath:c,schemaEnv:l,self:p}=a;if(!u.validateFormats)return;o?d():g();function d(){let m=r.scopeValue("formats",{ref:p.formats,code:u.code.formats}),f=r.const("fDef",(0,qe._)`${m}[${i}]`),h=r.let("fType"),y=r.let("format");r.if((0,qe._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>r.assign(h,(0,qe._)`${f}.type || "string"`).assign(y,(0,qe._)`${f}.validate`),()=>r.assign(h,(0,qe._)`"string"`).assign(y,f)),e.fail$data((0,qe.or)(b(),C()));function b(){return u.strictSchema===!1?qe.nil:(0,qe._)`${i} && !${y}`}function C(){let _=l.$async?(0,qe._)`(${f}.async ? await ${y}(${n}) : ${y}(${n}))`:(0,qe._)`${y}(${n})`,S=(0,qe._)`(typeof ${y} == "function" ? ${_} : ${y}.test(${n}))`;return(0,qe._)`${y} && ${y} !== true && ${h} === ${t} && !${S}`}}function g(){let m=p.formats[s];if(!m){b();return}if(m===!0)return;let[f,h,y]=C(m);f===t&&e.pass(_());function b(){if(u.strictSchema===!1){p.logger.warn(S());return}throw new Error(S());function S(){return`unknown format "${s}" ignored in schema at path "${c}"`}}function C(S){let T=S instanceof RegExp?(0,qe.regexpCode)(S):u.code.formats?(0,qe._)`${u.code.formats}${(0,qe.getProperty)(s)}`:void 0,k=r.scopeValue("formats",{key:s,ref:S,code:T});return typeof S=="object"&&!(S instanceof RegExp)?[S.type||"string",S.validate,(0,qe._)`${k}.validate`]:["string",S,k]}function _(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,qe._)`await ${y}(${n})`}return typeof h=="function"?(0,qe._)`${y}(${n})`:(0,qe._)`${y}.test(${n})`}}}};nm.default=_3});var DE=x(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var A3=yE(),F3=[A3.default];om.default=F3});var vE=x(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.contentVocabulary=si.metadataVocabulary=void 0;si.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];si.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var bE=x(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var T3=AS(),$3=US(),k3=hE(),R3=DE(),CE=vE(),I3=[T3.default,$3.default,(0,k3.default)(),R3.default,CE.metadataVocabulary,CE.contentVocabulary];im.default=I3});var xE=x(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.DiscrError=void 0;var wE;(function(e){e.Tag="tag",e.Mapping="mapping"})(wE||(Ju.DiscrError=wE={}))});var EE=x(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var ai=Y(),sm=xE(),SE=ku(),N3=Ts(),O3=pe(),M3={message:({params:{discrError:e,tagName:t}})=>e===sm.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,ai._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},B3={keyword:"discriminator",type:"object",schemaType:"object",error:M3,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:s}=e,{oneOf:i}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let u=t.let("valid",!1),c=t.const("tag",(0,ai._)`${r}${(0,ai.getProperty)(a)}`);t.if((0,ai._)`typeof ${c} == "string"`,()=>l(),()=>e.error(!1,{discrError:sm.DiscrError.Tag,tag:c,tagName:a})),e.ok(u);function l(){let g=d();t.if(!1);for(let m in g)t.elseIf((0,ai._)`${c} === ${m}`),t.assign(u,p(g[m]));t.else(),e.error(!1,{discrError:sm.DiscrError.Mapping,tag:c,tagName:a}),t.endIf()}function p(g){let m=t.name("valid"),f=e.subschema({keyword:"oneOf",schemaProp:g},m);return e.mergeEvaluated(f,ai.Name),m}function d(){var g;let m={},f=y(o),h=!0;for(let _=0;_<i.length;_++){let S=i[_];if(S?.$ref&&!(0,O3.schemaHasRulesButRef)(S,s.self.RULES)){let k=S.$ref;if(S=SE.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,k),S instanceof SE.SchemaEnv&&(S=S.schema),S===void 0)throw new N3.default(s.opts.uriResolver,s.baseId,k)}let T=(g=S?.properties)===null||g===void 0?void 0:g[a];if(typeof T!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);h=h&&(f||y(S)),b(T,_)}if(!h)throw new Error(`discriminator: "${a}" must be required`);return m;function y({required:_}){return Array.isArray(_)&&_.includes(a)}function b(_,S){if(_.const)C(_.const,S);else if(_.enum)for(let T of _.enum)C(T,S);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function C(_,S){if(typeof _!="string"||_ in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[_]=S}}}};am.default=B3});var PE=x((Xre,L3)=>{L3.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var cm=x((ke,um)=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.MissingRefError=ke.ValidationError=ke.CodeGen=ke.Name=ke.nil=ke.stringify=ke.str=ke._=ke.KeywordCxt=ke.Ajv=void 0;var z3=wS(),j3=bE(),U3=EE(),_E=PE(),V3=["/properties"],Yu="http://json-schema.org/draft-07/schema",ui=class extends z3.default{_addVocabularies(){super._addVocabularies(),j3.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(U3.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(_E,V3):_E;this.addMetaSchema(t,Yu,!1),this.refs["http://json-schema.org/schema"]=Yu}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Yu)?Yu:void 0)}};ke.Ajv=ui;um.exports=ke=ui;um.exports.Ajv=ui;Object.defineProperty(ke,"__esModule",{value:!0});ke.default=ui;var H3=Fs();Object.defineProperty(ke,"KeywordCxt",{enumerable:!0,get:function(){return H3.KeywordCxt}});var ci=Y();Object.defineProperty(ke,"_",{enumerable:!0,get:function(){return ci._}});Object.defineProperty(ke,"str",{enumerable:!0,get:function(){return ci.str}});Object.defineProperty(ke,"stringify",{enumerable:!0,get:function(){return ci.stringify}});Object.defineProperty(ke,"nil",{enumerable:!0,get:function(){return ci.nil}});Object.defineProperty(ke,"Name",{enumerable:!0,get:function(){return ci.Name}});Object.defineProperty(ke,"CodeGen",{enumerable:!0,get:function(){return ci.CodeGen}});var q3=Tu();Object.defineProperty(ke,"ValidationError",{enumerable:!0,get:function(){return q3.default}});var K3=Ts();Object.defineProperty(ke,"MissingRefError",{enumerable:!0,get:function(){return K3.default}})});var NE=x(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.formatNames=Qr.fastFormats=Qr.fullFormats=void 0;function Yr(e,t){return{validate:e,compare:t}}Qr.fullFormats={date:Yr($E,fm),time:Yr(pm(!0),mm),"date-time":Yr(AE(!0),RE),"iso-time":Yr(pm(),kE),"iso-date-time":Yr(AE(),IE),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Q3,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:ij,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:X3,int32:{type:"number",validate:rj},int64:{type:"number",validate:nj},float:{type:"number",validate:TE},double:{type:"number",validate:TE},password:!0,binary:!0};Qr.fastFormats={...Qr.fullFormats,date:Yr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,fm),time:Yr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,mm),"date-time":Yr(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,RE),"iso-time":Yr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,kE),"iso-date-time":Yr(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,IE),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Qr.formatNames=Object.keys(Qr.fullFormats);function G3(e){return e%4===0&&(e%100!==0||e%400===0)}var W3=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Z3=[0,31,28,31,30,31,30,31,31,30,31,30,31];function $E(e){let t=W3.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&G3(r)?29:Z3[n])}function fm(e,t){if(e&&t)return e>t?1:e<t?-1:0}var lm=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function pm(e){return function(r){let n=lm.exec(r);if(!n)return!1;let o=+n[1],s=+n[2],i=+n[3],a=n[4],u=n[5]==="-"?-1:1,c=+(n[6]||0),l=+(n[7]||0);if(c>23||l>59||e&&!a)return!1;if(o<=23&&s<=59&&i<60)return!0;let p=s-l*u,d=o-c*u-(p<0?1:0);return(d===23||d===-1)&&(p===59||p===-1)&&i<61}}function mm(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function kE(e,t){if(!(e&&t))return;let r=lm.exec(e),n=lm.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var dm=/t|\s/i;function AE(e){let t=pm(e);return function(n){let o=n.split(dm);return o.length===2&&$E(o[0])&&t(o[1])}}function RE(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function IE(e,t){if(!(e&&t))return;let[r,n]=e.split(dm),[o,s]=t.split(dm),i=fm(r,o);if(i!==void 0)return i||mm(n,s)}var J3=/\/|:/,Y3=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Q3(e){return J3.test(e)&&Y3.test(e)}var FE=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function X3(e){return FE.lastIndex=0,FE.test(e)}var ej=-(2**31),tj=2**31-1;function rj(e){return Number.isInteger(e)&&e<=tj&&e>=ej}function nj(e){return Number.isInteger(e)}function TE(){return!0}var oj=/[^\\]\\Z/;function ij(e){if(oj.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var OE=x(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.formatLimitDefinition=void 0;var sj=cm(),Er=Y(),Mn=Er.operators,Qu={formatMaximum:{okStr:"<=",ok:Mn.LTE,fail:Mn.GT},formatMinimum:{okStr:">=",ok:Mn.GTE,fail:Mn.LT},formatExclusiveMaximum:{okStr:"<",ok:Mn.LT,fail:Mn.GTE},formatExclusiveMinimum:{okStr:">",ok:Mn.GT,fail:Mn.LTE}},aj={message:({keyword:e,schemaCode:t})=>(0,Er.str)`should be ${Qu[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Er._)`{comparison: ${Qu[e].okStr}, limit: ${t}}`};li.formatLimitDefinition={keyword:Object.keys(Qu),type:"string",schemaType:"string",$data:!0,error:aj,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:s}=e,{opts:i,self:a}=s;if(!i.validateFormats)return;let u=new sj.KeywordCxt(s,a.RULES.all.format.definition,"format");u.$data?c():l();function c(){let d=t.scopeValue("formats",{ref:a.formats,code:i.code.formats}),g=t.const("fmt",(0,Er._)`${d}[${u.schemaCode}]`);e.fail$data((0,Er.or)((0,Er._)`typeof ${g} != "object"`,(0,Er._)`${g} instanceof RegExp`,(0,Er._)`typeof ${g}.compare != "function"`,p(g)))}function l(){let d=u.schema,g=a.formats[d];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${o}": format "${d}" does not define "compare" function`);let m=t.scopeValue("formats",{key:d,ref:g,code:i.code.formats?(0,Er._)`${i.code.formats}${(0,Er.getProperty)(d)}`:void 0});e.fail$data(p(m))}function p(d){return(0,Er._)`${d}.compare(${r}, ${n}) ${Qu[o].fail} 0`}},dependencies:["format"]};var uj=e=>(e.addKeyword(li.formatLimitDefinition),e);li.default=uj});var zE=x((Hs,LE)=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});var pi=NE(),cj=OE(),gm=Y(),ME=new gm.Name("fullFormats"),lj=new gm.Name("fastFormats"),hm=(e,t={keywords:!0})=>{if(Array.isArray(t))return BE(e,t,pi.fullFormats,ME),e;let[r,n]=t.mode==="fast"?[pi.fastFormats,lj]:[pi.fullFormats,ME],o=t.formats||pi.formatNames;return BE(e,o,r,n),t.keywords&&(0,cj.default)(e),e};hm.get=(e,t="full")=>{let n=(t==="fast"?pi.fastFormats:pi.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function BE(e,t,r,n){var o,s;(o=(s=e.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,gm._)`require("ajv-formats/dist/formats").${n}`);for(let i of t)e.addFormat(i,r[i])}LE.exports=Hs=hm;Object.defineProperty(Hs,"__esModule",{value:!0});Hs.default=hm});var qE=x((bne,HE)=>{HE.exports=VE;VE.sync=mj;var jE=G("fs");function fj(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function UE(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:fj(t,r)}function VE(e,t,r){jE.stat(e,function(n,o){r(n,n?!1:UE(o,e,t))})}function mj(e,t){return UE(jE.statSync(e),e,t)}});var JE=x((wne,ZE)=>{ZE.exports=GE;GE.sync=gj;var KE=G("fs");function GE(e,t,r){KE.stat(e,function(n,o){r(n,n?!1:WE(o,t))})}function gj(e,t){return WE(KE.statSync(e),t)}function WE(e,t){return e.isFile()&&hj(e,t)}function hj(e,t){var r=e.mode,n=e.uid,o=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,p=r&c||r&u&&o===i||r&a&&n===s||r&l&&s===0;return p}});var QE=x((Sne,YE)=>{var xne=G("fs"),Xu;process.platform==="win32"||global.TESTING_WINDOWS?Xu=qE():Xu=JE();YE.exports=ym;ym.sync=yj;function ym(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){ym(e,t||{},function(s,i){s?o(s):n(i)})})}Xu(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function yj(e,t){try{return Xu.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var iP=x((Ene,oP)=>{var di=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",XE=G("path"),Dj=di?";":":",eP=QE(),tP=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),rP=(e,t)=>{let r=t.colon||Dj,n=e.match(/\//)||di&&e.match(/\\/)?[""]:[...di?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=di?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=di?o.split(r):[""];return di&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},nP=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:s}=rP(e,t),i=[],a=c=>new Promise((l,p)=>{if(c===n.length)return t.all&&i.length?l(i):p(tP(e));let d=n[c],g=/^".*"$/.test(d)?d.slice(1,-1):d,m=XE.join(g,e),f=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+m:m;l(u(f,c,0))}),u=(c,l,p)=>new Promise((d,g)=>{if(p===o.length)return d(a(l+1));let m=o[p];eP(c+m,{pathExt:s},(f,h)=>{if(!f&&h)if(t.all)i.push(c+m);else return d(c+m);return d(u(c,l,p+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},vj=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=rP(e,t),s=[];for(let i=0;i<r.length;i++){let a=r[i],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=XE.join(u,e),l=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let p=0;p<n.length;p++){let d=l+n[p];try{if(eP.sync(d,{pathExt:o}))if(t.all)s.push(d);else return d}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw tP(e)};oP.exports=nP;nP.sync=vj});var aP=x((Pne,Dm)=>{"use strict";var sP=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Dm.exports=sP;Dm.exports.default=sP});var pP=x((_ne,lP)=>{"use strict";var uP=G("path"),Cj=iP(),bj=aP();function cP(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Cj.sync(e.command,{path:r[bj({env:r})],pathExt:t?uP.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return i&&(i=uP.resolve(o?e.options.cwd:"",i)),i}function wj(e){return cP(e)||cP(e,!0)}lP.exports=wj});var dP=x((Ane,Cm)=>{"use strict";var vm=/([()\][%!^"`<>&|;, *?])/g;function xj(e){return e=e.replace(vm,"^$1"),e}function Sj(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(vm,"^$1"),t&&(e=e.replace(vm,"^$1")),e}Cm.exports.command=xj;Cm.exports.argument=Sj});var mP=x((Fne,fP)=>{"use strict";fP.exports=/^#!(.*)/});var hP=x((Tne,gP)=>{"use strict";var Ej=mP();gP.exports=(e="")=>{let t=e.match(Ej);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var DP=x(($ne,yP)=>{"use strict";var bm=G("fs"),Pj=hP();function _j(e){let r=Buffer.alloc(150),n;try{n=bm.openSync(e,"r"),bm.readSync(n,r,0,150,0),bm.closeSync(n)}catch{}return Pj(r.toString())}yP.exports=_j});var wP=x((kne,bP)=>{"use strict";var Aj=G("path"),vP=pP(),CP=dP(),Fj=DP(),Tj=process.platform==="win32",$j=/\.(?:com|exe)$/i,kj=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Rj(e){e.file=vP(e);let t=e.file&&Fj(e.file);return t?(e.args.unshift(e.file),e.command=t,vP(e)):e.file}function Ij(e){if(!Tj)return e;let t=Rj(e),r=!$j.test(t);if(e.options.forceShell||r){let n=kj.test(t);e.command=Aj.normalize(e.command),e.command=CP.command(e.command),e.args=e.args.map(s=>CP.argument(s,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Nj(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:Ij(n)}bP.exports=Nj});var EP=x((Rne,SP)=>{"use strict";var wm=process.platform==="win32";function xm(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Oj(e,t){if(!wm)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let s=xP(o,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function xP(e,t){return wm&&e===1&&!t.file?xm(t.original,"spawn"):null}function Mj(e,t){return wm&&e===1&&!t.file?xm(t.original,"spawnSync"):null}SP.exports={hookChildProcess:Oj,verifyENOENT:xP,verifyENOENTSync:Mj,notFoundError:xm}});var AP=x((Ine,fi)=>{"use strict";var PP=G("child_process"),Sm=wP(),Em=EP();function _P(e,t,r){let n=Sm(e,t,r),o=PP.spawn(n.command,n.args,n.options);return Em.hookChildProcess(o,n),o}function Bj(e,t,r){let n=Sm(e,t,r),o=PP.spawnSync(n.command,n.args,n.options);return o.error=o.error||Em.verifyENOENTSync(o.status,n),o}fi.exports=_P;fi.exports.spawn=_P;fi.exports.sync=Bj;fi.exports._parse=Sm;fi.exports._enoent=Em});var FP=x((Vne,jj)=>{jj.exports={name:"dotenv",version:"16.3.2",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://github.com/motdotla/dotenv?sponsor=1",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var RP=x((Hne,hn)=>{var TP=G("fs"),Pm=G("path"),Uj=G("os"),Vj=G("crypto"),Hj=FP(),_m=Hj.version,qj=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Kj(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
34
- `);let n;for(;(n=qj.exec(r))!=null;){let o=n[1],s=n[2]||"";s=s.trim();let i=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),i==='"'&&(s=s.replace(/\\n/g,`
35
- `),s=s.replace(/\\r/g,"\r")),t[o]=s}return t}function Gj(e){let t=kP(e),r=nt.configDotenv({path:t});if(!r.parsed)throw new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);let n=$P(e).split(","),o=n.length,s;for(let i=0;i<o;i++)try{let a=n[i].trim(),u=Jj(r,a);s=nt.decrypt(u.ciphertext,u.key);break}catch(a){if(i+1>=o)throw a}return nt.parse(s)}function Wj(e){console.log(`[dotenv@${_m}][INFO] ${e}`)}function Zj(e){console.log(`[dotenv@${_m}][WARN] ${e}`)}function ec(e){console.log(`[dotenv@${_m}][DEBUG] ${e}`)}function $P(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Jj(e,t){let r;try{r=new URL(t)}catch(a){throw a.code==="ERR_INVALID_URL"?new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development"):a}let n=r.password;if(!n)throw new Error("INVALID_DOTENV_KEY: Missing key part");let o=r.searchParams.get("environment");if(!o)throw new Error("INVALID_DOTENV_KEY: Missing environment part");let s=`DOTENV_VAULT_${o.toUpperCase()}`,i=e.parsed[s];if(!i)throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`);return{ciphertext:i,key:n}}function kP(e){let t=Pm.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:`${t}.vault`}function Yj(e){return e[0]==="~"?Pm.join(Uj.homedir(),e.slice(1)):e}function Qj(e){Wj("Loading env from encrypted .env.vault");let t=nt._parseVault(e),r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),nt.populate(r,t,e),{parsed:t}}function Xj(e){let t=Pm.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&(e.path!=null&&(t=Yj(e.path)),e.encoding!=null?r=e.encoding:n&&ec("No encoding is specified. UTF-8 is used by default"));try{let o=nt.parse(TP.readFileSync(t,{encoding:r})),s=process.env;return e&&e.processEnv!=null&&(s=e.processEnv),nt.populate(s,o,e),{parsed:o}}catch(o){return n&&ec(`Failed to load ${t} ${o.message}`),{error:o}}}function e8(e){let t=kP(e);return $P(e).length===0?nt.configDotenv(e):TP.existsSync(t)?nt._configVault(e):(Zj(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),nt.configDotenv(e))}function t8(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),o=n.subarray(0,12),s=n.subarray(-16);n=n.subarray(12,-16);try{let i=Vj.createDecipheriv("aes-256-gcm",r,o);return i.setAuthTag(s),`${i.update(n)}${i.final()}`}catch(i){let a=i instanceof RangeError,u=i.message==="Invalid key length",c=i.message==="Unsupported state or unable to authenticate data";if(a||u){let l="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(l)}else if(c){let l="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(l)}else throw console.error("Error: ",i.code),console.error("Error: ",i.message),i}}function r8(e,t,r={}){let n=!!(r&&r.debug),o=!!(r&&r.override);if(typeof t!="object")throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(e,s)?(o===!0&&(e[s]=t[s]),n&&ec(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):e[s]=t[s]}var nt={configDotenv:Xj,_configVault:Qj,_parseVault:Gj,config:e8,decrypt:t8,parse:Kj,populate:r8};hn.exports.configDotenv=nt.configDotenv;hn.exports._configVault=nt._configVault;hn.exports._parseVault=nt._parseVault;hn.exports.config=nt.config;hn.exports.decrypt=nt.decrypt;hn.exports.parse=nt.parse;hn.exports.populate=nt.populate;hn.exports=nt});var o_="1.19.6",Zt=process.env.OVERRIDE_VERSION??o_;import{createServer as L8,request as z8}from"node:http";var oc="preview-url";var yo="framework",Qs="platform",Xs="node",zm="/~builder-connect",zn="/~builder-connected",ic="/~builder-dev-tools",sc="/~builder-dev-tools.js",jn="/~builder-dev-tools-close",jm="/mappings";function se(e,t=""){return e.ts.createSourceFile("module.tsx",typeof t=="string"?t:"",e.ts.ScriptTarget.Latest,void 0)}function ea(e,t=""){let r=se(e,t?.trim());if(r.statements.length===0)throw new Error(`No statements found in code: ${t}`);return r.statements[0]}function Ye(e,t,r){if(t){let n=e.ts.createPrinter({newLine:e.ts.NewLineKind.LineFeed,removeComments:r});return e.ts.isSourceFile(t)?n.printFile(t).trim()+`
33
+ deps: ${r}}`};var o3={keyword:"dependencies",type:"object",schemaType:"object",error:Jr.error,code(e){let[t,r]=i3(e);YS(e,t),QS(e,r)}};function i3({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function YS(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let i in t){let a=t[i];if(a.length===0)continue;let u=(0,Vs.propertyInData)(r,n,i,o.opts.ownProperties);e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(u,()=>{for(let c of a)(0,Vs.checkReportMissingProp)(e,c)}):(r.if((0,Hf._)`${u} && (${(0,Vs.checkMissingProp)(e,a,s)})`),(0,Vs.reportMissingProp)(e,s),r.else())}}Jr.validatePropertyDeps=YS;function QS(e,t=e.schema){let{gen:r,data:n,keyword:o,it:s}=e,i=r.name("valid");for(let a in t)(0,n3.alwaysValidSchema)(s,t[a])||(r.if((0,Vs.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let u=e.subschema({keyword:o,schemaProp:a},i);e.mergeValidEvaluated(u,i)},()=>r.var(i,!0)),e.ok(i))}Jr.validateSchemaDeps=QS;Jr.default=o3});var tE=x(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});var eE=Y(),s3=pe(),a3={message:"property name must be valid",params:({params:e})=>(0,eE._)`{propertyName: ${e.propertyName}}`},u3={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:a3,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,s3.alwaysValidSchema)(o,r))return;let s=t.name("valid");t.forIn("key",n,i=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),t.if((0,eE.not)(s),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(s)}};qf.default=u3});var Gf=x(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});var Ku=lr(),Sr=Y(),c3=fn(),Gu=pe(),l3={message:"must NOT have additional properties",params:({params:e})=>(0,Sr._)`{additionalProperty: ${e.additionalProperty}}`},p3={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:l3,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:s,it:i}=e;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:u}=i;if(i.props=!0,u.removeAdditional!=="all"&&(0,Gu.alwaysValidSchema)(i,r))return;let c=(0,Ku.allSchemaProperties)(n.properties),l=(0,Ku.allSchemaProperties)(n.patternProperties);p(),e.ok((0,Sr._)`${s} === ${c3.default.errors}`);function p(){t.forIn("key",o,h=>{!c.length&&!l.length?m(h):t.if(d(h),()=>m(h))})}function d(h){let y;if(c.length>8){let b=(0,Gu.schemaRefOrVal)(i,n.properties,"properties");y=(0,Ku.isOwnProperty)(t,b,h)}else c.length?y=(0,Sr.or)(...c.map(b=>(0,Sr._)`${h} === ${b}`)):y=Sr.nil;return l.length&&(y=(0,Sr.or)(y,...l.map(b=>(0,Sr._)`${(0,Ku.usePattern)(e,b)}.test(${h})`))),(0,Sr.not)(y)}function g(h){t.code((0,Sr._)`delete ${o}[${h}]`)}function m(h){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){g(h);return}if(r===!1){e.setParams({additionalProperty:h}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,Gu.alwaysValidSchema)(i,r)){let y=t.name("valid");u.removeAdditional==="failing"?(f(h,y,!1),t.if((0,Sr.not)(y),()=>{e.reset(),g(h)})):(f(h,y),a||t.if((0,Sr.not)(y),()=>t.break()))}}function f(h,y,b){let C={keyword:"additionalProperties",dataProp:h,dataPropType:Gu.Type.Str};b===!1&&Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(C,y)}}};Kf.default=p3});var oE=x(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});var d3=Ts(),rE=lr(),Wf=pe(),nE=Gf(),f3={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:s}=e;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&nE.default.code(new d3.KeywordCxt(s,nE.default,"additionalProperties"));let i=(0,rE.allSchemaProperties)(r);for(let p of i)s.definedProperties.add(p);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=Wf.mergeEvaluated.props(t,(0,Wf.toHash)(i),s.props));let a=i.filter(p=>!(0,Wf.alwaysValidSchema)(s,r[p]));if(a.length===0)return;let u=t.name("valid");for(let p of a)c(p)?l(p):(t.if((0,rE.propertyInData)(t,o,p,s.opts.ownProperties)),l(p),s.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(p),e.ok(u);function c(p){return s.opts.useDefaults&&!s.compositeRule&&r[p].default!==void 0}function l(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},u)}}};Zf.default=f3});var uE=x(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});var iE=lr(),Wu=Y(),sE=pe(),aE=pe(),m3={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:s}=e,{opts:i}=s,a=(0,iE.allSchemaProperties)(r),u=a.filter(f=>(0,sE.alwaysValidSchema)(s,r[f]));if(a.length===0||u.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let c=i.strictSchema&&!i.allowMatchingProperties&&o.properties,l=t.name("valid");s.props!==!0&&!(s.props instanceof Wu.Name)&&(s.props=(0,aE.evaluatedPropsToName)(t,s.props));let{props:p}=s;d();function d(){for(let f of a)c&&g(f),s.allErrors?m(f):(t.var(l,!0),m(f),t.if(l))}function g(f){for(let h in c)new RegExp(f).test(h)&&(0,sE.checkStrictMode)(s,`property ${h} matches pattern ${f} (use allowMatchingProperties)`)}function m(f){t.forIn("key",n,h=>{t.if((0,Wu._)`${(0,iE.usePattern)(e,f)}.test(${h})`,()=>{let y=u.includes(f);y||e.subschema({keyword:"patternProperties",schemaProp:f,dataProp:h,dataPropType:aE.Type.Str},l),s.opts.unevaluated&&p!==!0?t.assign((0,Wu._)`${p}[${h}]`,!0):!y&&!s.allErrors&&t.if((0,Wu.not)(l),()=>t.break())})})}}};Jf.default=m3});var cE=x(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});var g3=pe(),h3={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,g3.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Yf.default=h3});var lE=x(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});var y3=lr(),D3={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:y3.validateUnion,error:{message:"must match a schema in anyOf"}};Qf.default=D3});var pE=x(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});var Zu=Y(),v3=pe(),C3={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Zu._)`{passingSchemas: ${e.passing}}`},b3={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:C3,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,i=t.let("valid",!1),a=t.let("passing",null),u=t.name("_valid");e.setParams({passing:a}),t.block(c),e.result(i,()=>e.reset(),()=>e.error(!0));function c(){s.forEach((l,p)=>{let d;(0,v3.alwaysValidSchema)(o,l)?t.var(u,!0):d=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},u),p>0&&t.if((0,Zu._)`${u} && ${i}`).assign(i,!1).assign(a,(0,Zu._)`[${a}, ${p}]`).else(),t.if(u,()=>{t.assign(i,!0),t.assign(a,p),d&&e.mergeEvaluated(d,Zu.Name)})})}}};Xf.default=b3});var dE=x(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});var w3=pe(),x3={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((s,i)=>{if((0,w3.alwaysValidSchema)(n,s))return;let a=e.subschema({keyword:"allOf",schemaProp:i},o);e.ok(o),e.mergeEvaluated(a)})}};em.default=x3});var gE=x(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});var Ju=Y(),mE=pe(),S3={message:({params:e})=>(0,Ju.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Ju._)`{failingKeyword: ${e.ifClause}}`},E3={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:S3,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,mE.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=fE(n,"then"),s=fE(n,"else");if(!o&&!s)return;let i=t.let("valid",!0),a=t.name("_valid");if(u(),e.reset(),o&&s){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(a,c("then",l),c("else",l))}else o?t.if(a,c("then")):t.if((0,Ju.not)(a),c("else"));e.pass(i,()=>e.error(!0));function u(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(l)}function c(l,p){return()=>{let d=e.subschema({keyword:l},a);t.assign(i,a),e.mergeValidEvaluated(d,i),p?t.assign(p,(0,Ju._)`${l}`):e.setParams({ifClause:l})}}}};function fE(e,t){let r=e.schema[t];return r!==void 0&&!(0,mE.alwaysValidSchema)(e,r)}tm.default=E3});var hE=x(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});var P3=pe(),_3={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,P3.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};rm.default=_3});var yE=x(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});var A3=Bf(),T3=GS(),F3=zf(),R3=ZS(),$3=JS(),k3=XS(),I3=tE(),N3=Gf(),O3=oE(),M3=uE(),L3=cE(),B3=lE(),z3=pE(),j3=dE(),U3=gE(),V3=hE();function H3(e=!1){let t=[L3.default,B3.default,z3.default,j3.default,U3.default,V3.default,I3.default,N3.default,k3.default,O3.default,M3.default];return e?t.push(T3.default,R3.default):t.push(A3.default,F3.default),t.push($3.default),t}nm.default=H3});var DE=x(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var Ke=Y(),q3={message:({schemaCode:e})=>(0,Ke.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Ke._)`{format: ${e}}`},K3={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:q3,code(e,t){let{gen:r,data:n,$data:o,schema:s,schemaCode:i,it:a}=e,{opts:u,errSchemaPath:c,schemaEnv:l,self:p}=a;if(!u.validateFormats)return;o?d():g();function d(){let m=r.scopeValue("formats",{ref:p.formats,code:u.code.formats}),f=r.const("fDef",(0,Ke._)`${m}[${i}]`),h=r.let("fType"),y=r.let("format");r.if((0,Ke._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>r.assign(h,(0,Ke._)`${f}.type || "string"`).assign(y,(0,Ke._)`${f}.validate`),()=>r.assign(h,(0,Ke._)`"string"`).assign(y,f)),e.fail$data((0,Ke.or)(b(),C()));function b(){return u.strictSchema===!1?Ke.nil:(0,Ke._)`${i} && !${y}`}function C(){let _=l.$async?(0,Ke._)`(${f}.async ? await ${y}(${n}) : ${y}(${n}))`:(0,Ke._)`${y}(${n})`,S=(0,Ke._)`(typeof ${y} == "function" ? ${_} : ${y}.test(${n}))`;return(0,Ke._)`${y} && ${y} !== true && ${h} === ${t} && !${S}`}}function g(){let m=p.formats[s];if(!m){b();return}if(m===!0)return;let[f,h,y]=C(m);f===t&&e.pass(_());function b(){if(u.strictSchema===!1){p.logger.warn(S());return}throw new Error(S());function S(){return`unknown format "${s}" ignored in schema at path "${c}"`}}function C(S){let F=S instanceof RegExp?(0,Ke.regexpCode)(S):u.code.formats?(0,Ke._)`${u.code.formats}${(0,Ke.getProperty)(s)}`:void 0,$=r.scopeValue("formats",{key:s,ref:S,code:F});return typeof S=="object"&&!(S instanceof RegExp)?[S.type||"string",S.validate,(0,Ke._)`${$}.validate`]:["string",S,$]}function _(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Ke._)`await ${y}(${n})`}return typeof h=="function"?(0,Ke._)`${y}(${n})`:(0,Ke._)`${y}.test(${n})`}}}};om.default=K3});var vE=x(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var G3=DE(),W3=[G3.default];im.default=W3});var CE=x(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.contentVocabulary=si.metadataVocabulary=void 0;si.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];si.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var wE=x(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});var Z3=TS(),J3=VS(),Y3=yE(),Q3=vE(),bE=CE(),X3=[Z3.default,J3.default,(0,Y3.default)(),Q3.default,bE.metadataVocabulary,bE.contentVocabulary];sm.default=X3});var SE=x(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.DiscrError=void 0;var xE;(function(e){e.Tag="tag",e.Mapping="mapping"})(xE||(Yu.DiscrError=xE={}))});var PE=x(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var ai=Y(),am=SE(),EE=ku(),ej=Fs(),tj=pe(),rj={message:({params:{discrError:e,tagName:t}})=>e===am.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,ai._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},nj={keyword:"discriminator",type:"object",schemaType:"object",error:rj,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:s}=e,{oneOf:i}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let u=t.let("valid",!1),c=t.const("tag",(0,ai._)`${r}${(0,ai.getProperty)(a)}`);t.if((0,ai._)`typeof ${c} == "string"`,()=>l(),()=>e.error(!1,{discrError:am.DiscrError.Tag,tag:c,tagName:a})),e.ok(u);function l(){let g=d();t.if(!1);for(let m in g)t.elseIf((0,ai._)`${c} === ${m}`),t.assign(u,p(g[m]));t.else(),e.error(!1,{discrError:am.DiscrError.Mapping,tag:c,tagName:a}),t.endIf()}function p(g){let m=t.name("valid"),f=e.subschema({keyword:"oneOf",schemaProp:g},m);return e.mergeEvaluated(f,ai.Name),m}function d(){var g;let m={},f=y(o),h=!0;for(let _=0;_<i.length;_++){let S=i[_];if(S?.$ref&&!(0,tj.schemaHasRulesButRef)(S,s.self.RULES)){let $=S.$ref;if(S=EE.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,$),S instanceof EE.SchemaEnv&&(S=S.schema),S===void 0)throw new ej.default(s.opts.uriResolver,s.baseId,$)}let F=(g=S?.properties)===null||g===void 0?void 0:g[a];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);h=h&&(f||y(S)),b(F,_)}if(!h)throw new Error(`discriminator: "${a}" must be required`);return m;function y({required:_}){return Array.isArray(_)&&_.includes(a)}function b(_,S){if(_.const)C(_.const,S);else if(_.enum)for(let F of _.enum)C(F,S);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function C(_,S){if(typeof _!="string"||_ in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[_]=S}}}};um.default=nj});var _E=x((Dne,oj)=>{oj.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var lm=x((ke,cm)=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.MissingRefError=ke.ValidationError=ke.CodeGen=ke.Name=ke.nil=ke.stringify=ke.str=ke._=ke.KeywordCxt=ke.Ajv=void 0;var ij=xS(),sj=wE(),aj=PE(),AE=_E(),uj=["/properties"],Qu="http://json-schema.org/draft-07/schema",ui=class extends ij.default{_addVocabularies(){super._addVocabularies(),sj.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(aj.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(AE,uj):AE;this.addMetaSchema(t,Qu,!1),this.refs["http://json-schema.org/schema"]=Qu}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Qu)?Qu:void 0)}};ke.Ajv=ui;cm.exports=ke=ui;cm.exports.Ajv=ui;Object.defineProperty(ke,"__esModule",{value:!0});ke.default=ui;var cj=Ts();Object.defineProperty(ke,"KeywordCxt",{enumerable:!0,get:function(){return cj.KeywordCxt}});var ci=Y();Object.defineProperty(ke,"_",{enumerable:!0,get:function(){return ci._}});Object.defineProperty(ke,"str",{enumerable:!0,get:function(){return ci.str}});Object.defineProperty(ke,"stringify",{enumerable:!0,get:function(){return ci.stringify}});Object.defineProperty(ke,"nil",{enumerable:!0,get:function(){return ci.nil}});Object.defineProperty(ke,"Name",{enumerable:!0,get:function(){return ci.Name}});Object.defineProperty(ke,"CodeGen",{enumerable:!0,get:function(){return ci.CodeGen}});var lj=Ru();Object.defineProperty(ke,"ValidationError",{enumerable:!0,get:function(){return lj.default}});var pj=Fs();Object.defineProperty(ke,"MissingRefError",{enumerable:!0,get:function(){return pj.default}})});var OE=x(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.formatNames=Qr.fastFormats=Qr.fullFormats=void 0;function Yr(e,t){return{validate:e,compare:t}}Qr.fullFormats={date:Yr($E,mm),time:Yr(dm(!0),gm),"date-time":Yr(TE(!0),IE),"iso-time":Yr(dm(),kE),"iso-date-time":Yr(TE(),NE),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:yj,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Sj,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Dj,int32:{type:"number",validate:bj},int64:{type:"number",validate:wj},float:{type:"number",validate:RE},double:{type:"number",validate:RE},password:!0,binary:!0};Qr.fastFormats={...Qr.fullFormats,date:Yr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,mm),time:Yr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,gm),"date-time":Yr(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,IE),"iso-time":Yr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,kE),"iso-date-time":Yr(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,NE),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Qr.formatNames=Object.keys(Qr.fullFormats);function dj(e){return e%4===0&&(e%100!==0||e%400===0)}var fj=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,mj=[0,31,28,31,30,31,30,31,31,30,31,30,31];function $E(e){let t=fj.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&dj(r)?29:mj[n])}function mm(e,t){if(e&&t)return e>t?1:e<t?-1:0}var pm=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function dm(e){return function(r){let n=pm.exec(r);if(!n)return!1;let o=+n[1],s=+n[2],i=+n[3],a=n[4],u=n[5]==="-"?-1:1,c=+(n[6]||0),l=+(n[7]||0);if(c>23||l>59||e&&!a)return!1;if(o<=23&&s<=59&&i<60)return!0;let p=s-l*u,d=o-c*u-(p<0?1:0);return(d===23||d===-1)&&(p===59||p===-1)&&i<61}}function gm(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function kE(e,t){if(!(e&&t))return;let r=pm.exec(e),n=pm.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var fm=/t|\s/i;function TE(e){let t=dm(e);return function(n){let o=n.split(fm);return o.length===2&&$E(o[0])&&t(o[1])}}function IE(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function NE(e,t){if(!(e&&t))return;let[r,n]=e.split(fm),[o,s]=t.split(fm),i=mm(r,o);if(i!==void 0)return i||gm(n,s)}var gj=/\/|:/,hj=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function yj(e){return gj.test(e)&&hj.test(e)}var FE=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Dj(e){return FE.lastIndex=0,FE.test(e)}var vj=-(2**31),Cj=2**31-1;function bj(e){return Number.isInteger(e)&&e<=Cj&&e>=vj}function wj(e){return Number.isInteger(e)}function RE(){return!0}var xj=/[^\\]\\Z/;function Sj(e){if(xj.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var ME=x(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.formatLimitDefinition=void 0;var Ej=lm(),Er=Y(),Mn=Er.operators,Xu={formatMaximum:{okStr:"<=",ok:Mn.LTE,fail:Mn.GT},formatMinimum:{okStr:">=",ok:Mn.GTE,fail:Mn.LT},formatExclusiveMaximum:{okStr:"<",ok:Mn.LT,fail:Mn.GTE},formatExclusiveMinimum:{okStr:">",ok:Mn.GT,fail:Mn.LTE}},Pj={message:({keyword:e,schemaCode:t})=>(0,Er.str)`should be ${Xu[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Er._)`{comparison: ${Xu[e].okStr}, limit: ${t}}`};li.formatLimitDefinition={keyword:Object.keys(Xu),type:"string",schemaType:"string",$data:!0,error:Pj,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:s}=e,{opts:i,self:a}=s;if(!i.validateFormats)return;let u=new Ej.KeywordCxt(s,a.RULES.all.format.definition,"format");u.$data?c():l();function c(){let d=t.scopeValue("formats",{ref:a.formats,code:i.code.formats}),g=t.const("fmt",(0,Er._)`${d}[${u.schemaCode}]`);e.fail$data((0,Er.or)((0,Er._)`typeof ${g} != "object"`,(0,Er._)`${g} instanceof RegExp`,(0,Er._)`typeof ${g}.compare != "function"`,p(g)))}function l(){let d=u.schema,g=a.formats[d];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${o}": format "${d}" does not define "compare" function`);let m=t.scopeValue("formats",{key:d,ref:g,code:i.code.formats?(0,Er._)`${i.code.formats}${(0,Er.getProperty)(d)}`:void 0});e.fail$data(p(m))}function p(d){return(0,Er._)`${d}.compare(${r}, ${n}) ${Xu[o].fail} 0`}},dependencies:["format"]};var _j=e=>(e.addKeyword(li.formatLimitDefinition),e);li.default=_j});var jE=x((Hs,zE)=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});var pi=OE(),Aj=ME(),hm=Y(),LE=new hm.Name("fullFormats"),Tj=new hm.Name("fastFormats"),ym=(e,t={keywords:!0})=>{if(Array.isArray(t))return BE(e,t,pi.fullFormats,LE),e;let[r,n]=t.mode==="fast"?[pi.fastFormats,Tj]:[pi.fullFormats,LE],o=t.formats||pi.formatNames;return BE(e,o,r,n),t.keywords&&(0,Aj.default)(e),e};ym.get=(e,t="full")=>{let n=(t==="fast"?pi.fastFormats:pi.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function BE(e,t,r,n){var o,s;(o=(s=e.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,hm._)`require("ajv-formats/dist/formats").${n}`);for(let i of t)e.addFormat(i,r[i])}zE.exports=Hs=ym;Object.defineProperty(Hs,"__esModule",{value:!0});Hs.default=ym});var KE=x((zne,qE)=>{qE.exports=HE;HE.sync=kj;var UE=G("fs");function $j(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function VE(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:$j(t,r)}function HE(e,t,r){UE.stat(e,function(n,o){r(n,n?!1:VE(o,e,t))})}function kj(e,t){return VE(UE.statSync(e),e,t)}});var YE=x((jne,JE)=>{JE.exports=WE;WE.sync=Ij;var GE=G("fs");function WE(e,t,r){GE.stat(e,function(n,o){r(n,n?!1:ZE(o,t))})}function Ij(e,t){return ZE(GE.statSync(e),t)}function ZE(e,t){return e.isFile()&&Nj(e,t)}function Nj(e,t){var r=e.mode,n=e.uid,o=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,p=r&c||r&u&&o===i||r&a&&n===s||r&l&&s===0;return p}});var XE=x((Vne,QE)=>{var Une=G("fs"),ec;process.platform==="win32"||global.TESTING_WINDOWS?ec=KE():ec=YE();QE.exports=Dm;Dm.sync=Oj;function Dm(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){Dm(e,t||{},function(s,i){s?o(s):n(i)})})}ec(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function Oj(e,t){try{return ec.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var sP=x((Hne,iP)=>{var di=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",eP=G("path"),Mj=di?";":":",tP=XE(),rP=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),nP=(e,t)=>{let r=t.colon||Mj,n=e.match(/\//)||di&&e.match(/\\/)?[""]:[...di?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=di?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=di?o.split(r):[""];return di&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},oP=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:s}=nP(e,t),i=[],a=c=>new Promise((l,p)=>{if(c===n.length)return t.all&&i.length?l(i):p(rP(e));let d=n[c],g=/^".*"$/.test(d)?d.slice(1,-1):d,m=eP.join(g,e),f=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+m:m;l(u(f,c,0))}),u=(c,l,p)=>new Promise((d,g)=>{if(p===o.length)return d(a(l+1));let m=o[p];tP(c+m,{pathExt:s},(f,h)=>{if(!f&&h)if(t.all)i.push(c+m);else return d(c+m);return d(u(c,l,p+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},Lj=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=nP(e,t),s=[];for(let i=0;i<r.length;i++){let a=r[i],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=eP.join(u,e),l=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let p=0;p<n.length;p++){let d=l+n[p];try{if(tP.sync(d,{pathExt:o}))if(t.all)s.push(d);else return d}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw rP(e)};iP.exports=oP;oP.sync=Lj});var uP=x((qne,vm)=>{"use strict";var aP=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};vm.exports=aP;vm.exports.default=aP});var dP=x((Kne,pP)=>{"use strict";var cP=G("path"),Bj=sP(),zj=uP();function lP(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Bj.sync(e.command,{path:r[zj({env:r})],pathExt:t?cP.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return i&&(i=cP.resolve(o?e.options.cwd:"",i)),i}function jj(e){return lP(e)||lP(e,!0)}pP.exports=jj});var fP=x((Gne,bm)=>{"use strict";var Cm=/([()\][%!^"`<>&|;, *?])/g;function Uj(e){return e=e.replace(Cm,"^$1"),e}function Vj(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Cm,"^$1"),t&&(e=e.replace(Cm,"^$1")),e}bm.exports.command=Uj;bm.exports.argument=Vj});var gP=x((Wne,mP)=>{"use strict";mP.exports=/^#!(.*)/});var yP=x((Zne,hP)=>{"use strict";var Hj=gP();hP.exports=(e="")=>{let t=e.match(Hj);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var vP=x((Jne,DP)=>{"use strict";var wm=G("fs"),qj=yP();function Kj(e){let r=Buffer.alloc(150),n;try{n=wm.openSync(e,"r"),wm.readSync(n,r,0,150,0),wm.closeSync(n)}catch{}return qj(r.toString())}DP.exports=Kj});var xP=x((Yne,wP)=>{"use strict";var Gj=G("path"),CP=dP(),bP=fP(),Wj=vP(),Zj=process.platform==="win32",Jj=/\.(?:com|exe)$/i,Yj=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Qj(e){e.file=CP(e);let t=e.file&&Wj(e.file);return t?(e.args.unshift(e.file),e.command=t,CP(e)):e.file}function Xj(e){if(!Zj)return e;let t=Qj(e),r=!Jj.test(t);if(e.options.forceShell||r){let n=Yj.test(t);e.command=Gj.normalize(e.command),e.command=bP.command(e.command),e.args=e.args.map(s=>bP.argument(s,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function e8(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:Xj(n)}wP.exports=e8});var PP=x((Qne,EP)=>{"use strict";var xm=process.platform==="win32";function Sm(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function t8(e,t){if(!xm)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let s=SP(o,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function SP(e,t){return xm&&e===1&&!t.file?Sm(t.original,"spawn"):null}function r8(e,t){return xm&&e===1&&!t.file?Sm(t.original,"spawnSync"):null}EP.exports={hookChildProcess:t8,verifyENOENT:SP,verifyENOENTSync:r8,notFoundError:Sm}});var TP=x((Xne,fi)=>{"use strict";var _P=G("child_process"),Em=xP(),Pm=PP();function AP(e,t,r){let n=Em(e,t,r),o=_P.spawn(n.command,n.args,n.options);return Pm.hookChildProcess(o,n),o}function n8(e,t,r){let n=Em(e,t,r),o=_P.spawnSync(n.command,n.args,n.options);return o.error=o.error||Pm.verifyENOENTSync(o.status,n),o}fi.exports=AP;fi.exports.spawn=AP;fi.exports.sync=n8;fi.exports._parse=Em;fi.exports._enoent=Pm});var FP=x((uoe,s8)=>{s8.exports={name:"dotenv",version:"16.3.2",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://github.com/motdotla/dotenv?sponsor=1",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var IP=x((coe,hn)=>{var RP=G("fs"),_m=G("path"),a8=G("os"),u8=G("crypto"),c8=FP(),Am=c8.version,l8=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function p8(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
34
+ `);let n;for(;(n=l8.exec(r))!=null;){let o=n[1],s=n[2]||"";s=s.trim();let i=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),i==='"'&&(s=s.replace(/\\n/g,`
35
+ `),s=s.replace(/\\r/g,"\r")),t[o]=s}return t}function d8(e){let t=kP(e),r=ot.configDotenv({path:t});if(!r.parsed)throw new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);let n=$P(e).split(","),o=n.length,s;for(let i=0;i<o;i++)try{let a=n[i].trim(),u=g8(r,a);s=ot.decrypt(u.ciphertext,u.key);break}catch(a){if(i+1>=o)throw a}return ot.parse(s)}function f8(e){console.log(`[dotenv@${Am}][INFO] ${e}`)}function m8(e){console.log(`[dotenv@${Am}][WARN] ${e}`)}function tc(e){console.log(`[dotenv@${Am}][DEBUG] ${e}`)}function $P(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function g8(e,t){let r;try{r=new URL(t)}catch(a){throw a.code==="ERR_INVALID_URL"?new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development"):a}let n=r.password;if(!n)throw new Error("INVALID_DOTENV_KEY: Missing key part");let o=r.searchParams.get("environment");if(!o)throw new Error("INVALID_DOTENV_KEY: Missing environment part");let s=`DOTENV_VAULT_${o.toUpperCase()}`,i=e.parsed[s];if(!i)throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`);return{ciphertext:i,key:n}}function kP(e){let t=_m.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:`${t}.vault`}function h8(e){return e[0]==="~"?_m.join(a8.homedir(),e.slice(1)):e}function y8(e){f8("Loading env from encrypted .env.vault");let t=ot._parseVault(e),r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),ot.populate(r,t,e),{parsed:t}}function D8(e){let t=_m.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&(e.path!=null&&(t=h8(e.path)),e.encoding!=null?r=e.encoding:n&&tc("No encoding is specified. UTF-8 is used by default"));try{let o=ot.parse(RP.readFileSync(t,{encoding:r})),s=process.env;return e&&e.processEnv!=null&&(s=e.processEnv),ot.populate(s,o,e),{parsed:o}}catch(o){return n&&tc(`Failed to load ${t} ${o.message}`),{error:o}}}function v8(e){let t=kP(e);return $P(e).length===0?ot.configDotenv(e):RP.existsSync(t)?ot._configVault(e):(m8(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),ot.configDotenv(e))}function C8(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),o=n.subarray(0,12),s=n.subarray(-16);n=n.subarray(12,-16);try{let i=u8.createDecipheriv("aes-256-gcm",r,o);return i.setAuthTag(s),`${i.update(n)}${i.final()}`}catch(i){let a=i instanceof RangeError,u=i.message==="Invalid key length",c=i.message==="Unsupported state or unable to authenticate data";if(a||u){let l="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(l)}else if(c){let l="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(l)}else throw console.error("Error: ",i.code),console.error("Error: ",i.message),i}}function b8(e,t,r={}){let n=!!(r&&r.debug),o=!!(r&&r.override);if(typeof t!="object")throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(e,s)?(o===!0&&(e[s]=t[s]),n&&tc(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):e[s]=t[s]}var ot={configDotenv:D8,_configVault:y8,_parseVault:d8,config:v8,decrypt:C8,parse:p8,populate:b8};hn.exports.configDotenv=ot.configDotenv;hn.exports._configVault=ot._configVault;hn.exports._parseVault=ot._parseVault;hn.exports.config=ot.config;hn.exports.decrypt=ot.decrypt;hn.exports.parse=ot.parse;hn.exports.populate=ot.populate;hn.exports=ot});var i_="1.19.7",Zt=process.env.OVERRIDE_VERSION??i_;import{createServer as o9,request as i9}from"node:http";var ic="preview-url";var yo="framework",Qs="platform",Xs="node",jm="/~builder-connect",zn="/~builder-connected",sc="/~builder-dev-tools",ac="/~builder-dev-tools.js",jn="/~builder-dev-tools-close",Um="/mappings";function se(e,t=""){return e.ts.createSourceFile("module.tsx",typeof t=="string"?t:"",e.ts.ScriptTarget.Latest,void 0)}function ea(e,t=""){let r=se(e,t?.trim());if(r.statements.length===0)throw new Error(`No statements found in code: ${t}`);return r.statements[0]}function Qe(e,t,r){if(t){let n=e.ts.createPrinter({newLine:e.ts.NewLineKind.LineFeed,removeComments:r});return e.ts.isSourceFile(t)?n.printFile(t).trim()+`
36
36
  `:n.printNode(e.ts.EmitHint.Unspecified,t,e.ts.createSourceFile("module.tsx","",e.ts.ScriptTarget.Latest)).trim()+`
37
- `}return""}var qm=Ue(Vm(),1);function Jt(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function ae(e,t,r){t=mr(t),r=mr(r),t=e.dirname(t);let n=e.basename(r,e.extname(r));r=e.dirname(r);let o;return n==="index"?o=e.relative(t,r):o=e.relative(t,e.join(r,n)),o=mr(e.normalize(o)),o.startsWith(".")||(o="./"+o),o}function mr(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function Un(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),o=n[n.length-1];return Hm(o==="index"?e.basename(e.dirname(t)):o)}function Hm(e){return be(e).replace(/ /g,"")}function Yt(e,t){let r=e.extname(t),n=mr(e.basename(t,r)).split("/").pop();return be(n==="index"?e.basename(e.dirname(t)):n)}function we(e,t){let r=mr(e.relative(e.getAppRootDir(),t));r=r.split("/").filter(o=>o!=="."&&o!==".."&&o!=="").join("/"),r.endsWith(".tsx")||r.endsWith(".jsx")?r=r.slice(0,-4):(r.endsWith(".ts")||r.endsWith(".js"))&&(r=r.slice(0,-3));let n=e.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(o=>o.name.includes("next"))?"@/"+r:"~/"+r}function ge(e,t){let r=t,n=[];for(let o=0;o<2;o++){let s=e.basename(r);if(!s||s==="components")break;n.unshift(s),r=e.dirname(r)}return n.join("/")}function be(e){for(e=e.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();e.includes(" ");)e=e.replace(/ /g," ");return e.split(" ").map(t=>t.length>2?t[0].toUpperCase()+t.slice(1):t).join("").trim()}function _t(e){return e.sort((t,r)=>t.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function ve(e,t,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${t}`);return n&&(t=n),t=e.normalize(t),(await e.hash(t+"#"+r)).substring(0,8)}async function Km(e){return(await e.hash(e.getAppRootDir())).substring(0,8)}function hi(e){return typeof e=="number"}function Do(e){return typeof e=="boolean"}function Ct(e){return typeof e=="string"}function vo(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function jt(e){return JSON.parse(JSON.stringify(e))}function ta(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function Gm(){try{let e=(0,qm.default)();if(e?.name)return e.name}catch{}return"npm"}function s_(){return process.platform.startsWith("win")}function Re(){return process.pkg?"@builder.io/agent":s_()?'"@builder.io/dev-tools"':"builder.io"}function bt(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var a_=["node_modules","dist","build","public"];async function At(e,t){async function r(o,s){if(s>10)return;let i=await e.readdir(o);for(let a of i){if(a_.includes(a))continue;let u=e.join(o,a),c=await e.stat(u);if(c){if(c.isFile()&&a.startsWith("builder-registry."))return u;if(c.isDirectory()){let l=await r(u,s+1);if(l)return l}}}}let n=await r(e.getAppRootDir(),0);if(!n){let s=`builder-registry.${await bt(e)?"ts":"js"}`;return e.join(t,s)}return n}async function Dn(e,t){let r=e.resolve("/");for(let n=0;n<20;n++){let o=e.join(t,"package.json"),s=await e.readFile(o);if(s)return JSON.parse(s);if(t===r)break;t=e.dirname(t)}return null}async function Wm(e,t){for(let r=0;r<20;r++){let n=e.dirname(t),o=e.join(n,"node_modules");if(await e.exists(o))return o;if(t===e.getAppRootDir())break;t=e.dirname(t)}return e.join(e.getAppRootDir(),"node_modules")}async function yi(e,t,r){let n=await e.readdir(t);return n.includes(r)?e.join(t,r):(await Promise.all(n.map(async s=>{if(s.startsWith(".")||s==="node_modules")return;let i=e.join(t,s);if((await e.stat(i)).isDirectory()){let u=await yi(e,i,r);if(u)return u}}))).find(s=>typeof s=="string")}async function We(e,t,r){if(!Array.isArray(t)||t.length===0)throw new Error(`createTsProgram() Invalid filePaths: ${t}`);let n=await Wm(e,t[0]),o=e.join(n,"typescript","lib"),s=new Map,i={fileExists:a=>{if(a=e.normalize(a),a.includes("node_modules")){let u=Di.get(a);if(!u){try{e.statSync(a).isFile()?u={exists:!0,content:e.readFileSync(a)}:u={exists:!1}}catch{u={exists:!1}}Di.set(a,u)}return u.exists}if(!s.has(a))if(e.existsSync(a)){let c=e.statSync(a);s.set(a,c.isFile())}else s.set(a,!1);return s.get(a)},getCanonicalFileName:a=>e.normalize(a),getCurrentDirectory:()=>e.cwd(),getDefaultLibFileName:()=>e.join(o,"lib.d.ts"),getDefaultLibLocation:()=>o,getNewLine:()=>`
38
- `,getSourceFile:a=>{if(a=e.normalize(a),a.includes("node_modules")){let c=Di.get(a);if(c)return se(e,c.content)}let u;try{u=e.readFileSync(a)}catch{console.error(`Could not read: ${a}`),u==null}if(u==null){let c=e.basename(a),l=e.extname(c).toLowerCase();if(a.startsWith(o)&&l===".ts"&&(u=Jm.get(c),u==null&&typeof self<"u"&&typeof fetch=="function"))throw new na(c)}return a.includes("node_modules")&&(u?Di.set(a,{exists:!0,content:u}):Di.set(a,{exists:!1})),se(e,u)},readFile:a=>{let u=e.readFileSync(a);return typeof u=="string"?u:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return u_(e,i,t,r)}catch(a){if(a instanceof na){await c_(e,a.libName);continue}throw e.Sentry?.captureException(a),new Error(`createTsProgram() Could not create program for: ${t[0]}`,{cause:a})}}function u_(e,t,r,n){let o={rootNames:[...r],host:t,options:{}},s=e.ts.findConfigFile(e.dirname(r[0]),i=>e.existsSync(i));if(s){let i=Zm.get(s);if(!i){let a=e.ts.readConfigFile(s,u=>{let c=e.readFileSync(u);return typeof c=="string"?c:void 0});a.error?e.Sentry?.captureException(new Error("Error reading tsconfig for createTsProgram"),{extra:{error:a.error,tsConfigPath:s}}):(i=e.ts.parseJsonConfigFileContent(a.config,e.ts.sys||{useCaseSensitiveFileNames:!1,readDirectory:(c,l)=>e.readdirSync(c),fileExists:c=>e.existsSync(c),readFile:c=>e.readFileSync(c)||void 0},e.dirname(s),void 0,s).options,Zm.set(s,i))}i&&(o.options=jt(i))}return o.options.noEmit=!0,o.options.isolatedModules=!1,o.options.strict=!1,o.options.jsx=e.ts.JsxEmit.Preserve,o.options.allowJs=!0,Object.assign(o.options,n),e.ts.createProgram(o)}async function Co(e,t,r){r||(r=await We(e,[t]));let n=r.getSourceFile(t);if(!n)throw new Error(`getTypeChecker() Could not find source file: ${t}`);return{typeChecker:r.getTypeChecker(),sourceFile:n}}var na=class{constructor(t){Je(this,"libName");this.libName=t}};async function c_(e,t){let r=`https://cdn.jsdelivr.net/npm/typescript@${e.ts.version}/lib/${t}`;ra.has(t)||ra.set(t,fetch(r).then(n=>n.text()).then(n=>{Jm.set(t,n)})),await ra.get(t),ra.delete(t)}var Jm=new Map,ra=new Map,Di=new Map,Zm=new Map;async function Ym(e,t){let r=await e.readFile(t.filePath);return r==null?{diagnostics:[{messageText:`Error reading: ${t.filePath}`}],code:null,output:null}:ac(e,{code:r,filePath:t.filePath,compilerOptions:t.compilerOptions})}function ac(e,t){let r={diagnostics:[],code:t.code,output:null};try{let n=e.ts.transpileModule(t.code,{compilerOptions:t.compilerOptions,fileName:t.filePath??"module.tsx",reportDiagnostics:!0});n.diagnostics?.forEach(o=>{r.diagnostics.push({messageText:String(o.messageText)})}),r.output=n.outputText}catch(n){console.error("transpileModule",n),r.diagnostics.push({messageText:String(n)})}return r}import{access as a9,mkdir as d_,readdir as u9,readFile as f_,stat as c9,unlink as l9,writeFile as m_}from"node:fs/promises";import{homedir as g_,hostname as d9}from"node:os";import eg from"node:path";import g9 from"typescript";import y9 from"launch-editor";async function bo(e){let t=[],r=await Dn(e,e.getRepoRootDir());if(r){let n=await Xm(r,e);t.push(...n)}return t}async function Xm(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let o of l_)if(n.has(o)&&!r.some(s=>s.name===o)){let s={name:o};Qm.has(o)&&(s.version=await Qm.get(o)(t)),r.push(s)}}return r}function uc(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var Qm=new Map([["next",async e=>{if(!e.spawnSync)return;let t=Gm(),r=t==="npm"?"npx":t,{stdout:n}=e.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let o=n.match(/(Next.js v)([\d.]+)/g);if(!o)return;let s=o[0].split("Next.js v")[1],[i,a,u]=s.split(".");return{major:uc(i),minor:uc(a),patch:uc(u)}}]]),l_=["@shopify/remix-oxygen","@shopify/hydrogen","@builder.io/qwik-city","@remix-run/react","@sveltejs/kit","astro","gatsby","next","nuxt","@builder.io/qwik","@angular/core","react","solid-js","svelte","vue"];import*as h_ from"@sentry/node";function tg(){let e=g_();return eg.join(e,".config","builder","dev-tools.json")}function cc(e,t){return typeof e=="object"&&e!=null&&t in e}async function wo(){let e=tg();try{let t=await f_(e,"utf-8");if(typeof t=="string")return JSON.parse(t)}catch(t){if(t.code==="ENOENT")return null}return null}async function lc(e){let t=tg();e=typeof e=="object"&&e!=null?e:{},await d_(eg.dirname(t),{recursive:!0}),await m_(t,JSON.stringify(e??{},null,2))}var V={gen1:"Gen 1",gen2:"Gen 2"},vi={CMS:"cms",VCP:"vcp",HYBRID:"hybrid"};import{debug as y_}from"node:console";import{request as D_}from"node:http";import{request as v_}from"node:https";function xo(e){let t=Date.now();return new Promise((r,n)=>{let s=C_(e.url)({protocol:e.url.protocol,host:e.url.host,port:e.url.port,path:e.url.pathname+e.url.search,method:e.method,headers:e.headers},i=>{let a="";i.on("data",u=>{a+=u}),i.on("end",()=>{if(y_(`${e.method} ${e.url.href}, duration: ${Date.now()-t}ms`),typeof i.statusCode=="number"&&i.statusCode>=200&&i.statusCode<300)if(typeof i.headers["content-type"]!="string"||!i.headers["content-type"].includes("application/json"))n(`Response from ${e.url.href} content-type is ${i.headers["content-type"]}`);else try{r(JSON.parse(a))}catch(u){n(`Response from ${e.url.href} is not valid JSON: ${a}
39
- ${u}`)}else n(`Request to ${e.url.href} failed with status ${i.statusCode}: ${a}`)})}).on("error",i=>{n(`Error fetching ${e.url.href}, ${i}`)});e.body&&(s.setHeader("Content-Type","application/json"),s.write(e.body)),s.end()})}function C_(e){if(e.protocol==="https:")return v_;if(e.protocol==="http:")return D_;throw new Error(`Unsupported protocol ${e.protocol}`)}async function rg(e){let t=new URL(`https://cdn.builder.io/api/v3/query/${e.publicApiKey}/${e.model}`);return t.searchParams.set("omit","meta.componentsUsed"),t.searchParams.set("apiKey",e.publicApiKey),t.searchParams.set("userAttributes.urlPath",e.pageUrl),t.searchParams.set("options.page.model",`"${e.model}"`),t.searchParams.set("cachebust","true"),(await xo({url:t,method:"GET"}))[e.model]}async function ng(e,t){if(t.kind===vi.VCP)return!0;let r=new URL("https://cdn.builder.io/api/v2/admin"),n={query:`query {
37
+ `}return""}var Km=Ve(Hm(),1);function Jt(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function ae(e,t,r){t=mr(t),r=mr(r),t=e.dirname(t);let n=e.basename(r,e.extname(r));r=e.dirname(r);let o;return n==="index"?o=e.relative(t,r):o=e.relative(t,e.join(r,n)),o=mr(e.normalize(o)),o.startsWith(".")||(o="./"+o),o}function mr(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function Un(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),o=n[n.length-1];return qm(o==="index"?e.basename(e.dirname(t)):o)}function qm(e){return we(e).replace(/ /g,"")}function Yt(e,t){let r=e.extname(t),n=mr(e.basename(t,r)).split("/").pop();return we(n==="index"?e.basename(e.dirname(t)):n)}function xe(e,t){let r=mr(e.relative(e.getAppRootDir(),t));r=r.split("/").filter(o=>o!=="."&&o!==".."&&o!=="").join("/"),r.endsWith(".tsx")||r.endsWith(".jsx")?r=r.slice(0,-4):(r.endsWith(".ts")||r.endsWith(".js"))&&(r=r.slice(0,-3));let n=e.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(o=>o.name.includes("next"))?"@/"+r:"~/"+r}function ge(e,t){let r=t,n=[];for(let o=0;o<2;o++){let s=e.basename(r);if(!s||s==="components")break;n.unshift(s),r=e.dirname(r)}return n.join("/")}function we(e){for(e=e.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();e.includes(" ");)e=e.replace(/ /g," ");return e.split(" ").map(t=>t.length>2?t[0].toUpperCase()+t.slice(1):t).join("").trim()}function At(e){return e.sort((t,r)=>t.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function Ce(e,t,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${t}`);return n&&(t=n),t=e.normalize(t),(await e.hash(t+"#"+r)).substring(0,8)}async function Gm(e){return(await e.hash(e.getAppRootDir())).substring(0,8)}function hi(e){return typeof e=="number"}function Do(e){return typeof e=="boolean"}function bt(e){return typeof e=="string"}function vo(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function Ut(e){return JSON.parse(JSON.stringify(e))}function ta(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function Wm(){try{let e=(0,Km.default)();if(e?.name)return e.name}catch{}return"npm"}function a_(){return process.platform.startsWith("win")}function Ie(){return process.pkg?"@builder.io/agent":a_()?'"@builder.io/dev-tools"':"builder.io"}function wt(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var u_=["node_modules","dist","build","public"];async function Tt(e,t){async function r(o,s){if(s>10)return;let i=await e.readdir(o);for(let a of i){if(u_.includes(a))continue;let u=e.join(o,a),c=await e.stat(u);if(c){if(c.isFile()&&a.startsWith("builder-registry."))return u;if(c.isDirectory()){let l=await r(u,s+1);if(l)return l}}}}let n=await r(e.getAppRootDir(),0);if(!n){let s=`builder-registry.${await wt(e)?"ts":"js"}`;return e.join(t,s)}return n}async function Dn(e,t){let r=e.resolve("/");for(let n=0;n<20;n++){let o=e.join(t,"package.json"),s=await e.readFile(o);if(s)return JSON.parse(s);if(t===r)break;t=e.dirname(t)}return null}async function Zm(e,t){for(let r=0;r<20;r++){let n=e.dirname(t),o=e.join(n,"node_modules");if(await e.exists(o))return o;if(t===e.getAppRootDir())break;t=e.dirname(t)}return e.join(e.getAppRootDir(),"node_modules")}async function yi(e,t,r){let n=await e.readdir(t);return n.includes(r)?e.join(t,r):(await Promise.all(n.map(async s=>{if(s.startsWith(".")||s==="node_modules")return;let i=e.join(t,s);if((await e.stat(i)).isDirectory()){let u=await yi(e,i,r);if(u)return u}}))).find(s=>typeof s=="string")}async function Ze(e,t,r){if(!Array.isArray(t)||t.length===0)throw new Error(`createTsProgram() Invalid filePaths: ${t}`);let n=await Zm(e,t[0]),o=e.join(n,"typescript","lib"),s=new Map,i={fileExists:a=>{if(a=e.normalize(a),a.includes("node_modules")){let u=Di.get(a);if(!u){try{e.statSync(a).isFile()?u={exists:!0,content:e.readFileSync(a)}:u={exists:!1}}catch{u={exists:!1}}Di.set(a,u)}return u.exists}if(!s.has(a))if(e.existsSync(a)){let c=e.statSync(a);s.set(a,c.isFile())}else s.set(a,!1);return s.get(a)},getCanonicalFileName:a=>e.normalize(a),getCurrentDirectory:()=>e.cwd(),getDefaultLibFileName:()=>e.join(o,"lib.d.ts"),getDefaultLibLocation:()=>o,getNewLine:()=>`
38
+ `,getSourceFile:a=>{if(a=e.normalize(a),a.includes("node_modules")){let c=Di.get(a);if(c)return se(e,c.content)}let u;try{u=e.readFileSync(a)}catch{console.error(`Could not read: ${a}`),u==null}if(u==null){let c=e.basename(a),l=e.extname(c).toLowerCase();if(a.startsWith(o)&&l===".ts"&&(u=Ym.get(c),u==null&&typeof self<"u"&&typeof fetch=="function"))throw new na(c)}return a.includes("node_modules")&&(u?Di.set(a,{exists:!0,content:u}):Di.set(a,{exists:!1})),se(e,u)},readFile:a=>{let u=e.readFileSync(a);return typeof u=="string"?u:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return c_(e,i,t,r)}catch(a){if(a instanceof na){await l_(e,a.libName);continue}throw e.Sentry?.captureException(a),new Error(`createTsProgram() Could not create program for: ${t[0]}`,{cause:a})}}function c_(e,t,r,n){let o={rootNames:[...r],host:t,options:{}},s=e.ts.findConfigFile(e.dirname(r[0]),i=>e.existsSync(i));if(s){let i=Jm.get(s);if(!i){let a=e.ts.readConfigFile(s,u=>{let c=e.readFileSync(u);return typeof c=="string"?c:void 0});a.error?e.Sentry?.captureException(new Error("Error reading tsconfig for createTsProgram"),{extra:{error:a.error,tsConfigPath:s}}):(i=e.ts.parseJsonConfigFileContent(a.config,e.ts.sys||{useCaseSensitiveFileNames:!1,readDirectory:(c,l)=>e.readdirSync(c),fileExists:c=>e.existsSync(c),readFile:c=>e.readFileSync(c)||void 0},e.dirname(s),void 0,s).options,Jm.set(s,i))}i&&(o.options=Ut(i))}return o.options.noEmit=!0,o.options.isolatedModules=!1,o.options.strict=!1,o.options.jsx=e.ts.JsxEmit.Preserve,o.options.allowJs=!0,Object.assign(o.options,n),e.ts.createProgram(o)}async function Co(e,t,r){r||(r=await Ze(e,[t]));let n=r.getSourceFile(t);if(!n)throw new Error(`getTypeChecker() Could not find source file: ${t}`);return{typeChecker:r.getTypeChecker(),sourceFile:n}}var na=class{constructor(t){Ye(this,"libName");this.libName=t}};async function l_(e,t){let r=`https://cdn.jsdelivr.net/npm/typescript@${e.ts.version}/lib/${t}`;ra.has(t)||ra.set(t,fetch(r).then(n=>n.text()).then(n=>{Ym.set(t,n)})),await ra.get(t),ra.delete(t)}var Ym=new Map,ra=new Map,Di=new Map,Jm=new Map;async function Qm(e,t){let r=await e.readFile(t.filePath);return r==null?{diagnostics:[{messageText:`Error reading: ${t.filePath}`}],code:null,output:null}:uc(e,{code:r,filePath:t.filePath,compilerOptions:t.compilerOptions})}function uc(e,t){let r={diagnostics:[],code:t.code,output:null};try{let n=e.ts.transpileModule(t.code,{compilerOptions:t.compilerOptions,fileName:t.filePath??"module.tsx",reportDiagnostics:!0});n.diagnostics?.forEach(o=>{r.diagnostics.push({messageText:String(o.messageText)})}),r.output=n.outputText}catch(n){console.error("transpileModule",n),r.diagnostics.push({messageText:String(n)})}return r}import{access as P9,mkdir as f_,readdir as _9,readFile as m_,stat as A9,unlink as T9,writeFile as g_}from"node:fs/promises";import{homedir as h_,hostname as R9}from"node:os";import tg from"node:path";import I9 from"typescript";import O9 from"launch-editor";async function bo(e){let t=[],r=await Dn(e,e.getRepoRootDir());if(r){let n=await eg(r,e);t.push(...n)}return t}async function eg(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let o of p_)if(n.has(o)&&!r.some(s=>s.name===o)){let s={name:o};Xm.has(o)&&(s.version=await Xm.get(o)(t)),r.push(s)}}return r}function cc(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var Xm=new Map([["next",async e=>{if(!e.spawnSync)return;let t=Wm(),r=t==="npm"?"npx":t,{stdout:n}=e.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let o=n.match(/(Next.js v)([\d.]+)/g);if(!o)return;let s=o[0].split("Next.js v")[1],[i,a,u]=s.split(".");return{major:cc(i),minor:cc(a),patch:cc(u)}}]]),p_=["@shopify/remix-oxygen","@shopify/hydrogen","@builder.io/qwik-city","@remix-run/react","@sveltejs/kit","astro","gatsby","next","nuxt","@builder.io/qwik","@angular/core","react","solid-js","svelte","vue"];import*as y_ from"@sentry/node";function rg(){let e=h_();return tg.join(e,".config","builder","dev-tools.json")}function lc(e,t){return typeof e=="object"&&e!=null&&t in e}async function wo(){let e=rg();try{let t=await m_(e,"utf-8");if(typeof t=="string")return JSON.parse(t)}catch(t){if(t.code==="ENOENT")return null}return null}async function pc(e){let t=rg();e=typeof e=="object"&&e!=null?e:{},await f_(tg.dirname(t),{recursive:!0}),await g_(t,JSON.stringify(e??{},null,2))}var V={gen1:"Gen 1",gen2:"Gen 2"},vi={CMS:"cms",VCP:"vcp",HYBRID:"hybrid"};import{debug as D_}from"node:console";import{request as v_}from"node:http";import{request as C_}from"node:https";function xo(e){let t=Date.now();return new Promise((r,n)=>{let s=b_(e.url)({protocol:e.url.protocol,host:e.url.host,port:e.url.port,path:e.url.pathname+e.url.search,method:e.method,headers:e.headers},i=>{let a="";i.on("data",u=>{a+=u}),i.on("end",()=>{if(D_(`${e.method} ${e.url.href}, duration: ${Date.now()-t}ms`),typeof i.statusCode=="number"&&i.statusCode>=200&&i.statusCode<300)if(typeof i.headers["content-type"]!="string"||!i.headers["content-type"].includes("application/json"))n(`Response from ${e.url.href} content-type is ${i.headers["content-type"]}`);else try{r(JSON.parse(a))}catch(u){n(`Response from ${e.url.href} is not valid JSON: ${a}
39
+ ${u}`)}else n(`Request to ${e.url.href} failed with status ${i.statusCode}: ${a}`)})}).on("error",i=>{n(`Error fetching ${e.url.href}, ${i}`)});e.body&&(s.setHeader("Content-Type","application/json"),s.write(e.body)),s.end()})}function b_(e){if(e.protocol==="https:")return C_;if(e.protocol==="http:")return v_;throw new Error(`Unsupported protocol ${e.protocol}`)}async function ng(e){let t=new URL(`https://cdn.builder.io/api/v3/query/${e.publicApiKey}/${e.model}`);return t.searchParams.set("omit","meta.componentsUsed"),t.searchParams.set("apiKey",e.publicApiKey),t.searchParams.set("userAttributes.urlPath",e.pageUrl),t.searchParams.set("options.page.model",`"${e.model}"`),t.searchParams.set("cachebust","true"),(await xo({url:t,method:"GET"}))[e.model]}async function og(e,t){if(t.kind===vi.VCP)return!0;let r=new URL("https://cdn.builder.io/api/v2/admin"),n={query:`query {
40
40
  models {
41
41
  id
42
42
  name
43
43
  }
44
- }`};e.debug(`Get model id for model name "${t.model}"`);let s=(await xo({url:r,method:"POST",headers:{Authorization:`Bearer ${t.privateAuthKey}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)})).data.models.find(u=>u.name===t.model);if(!s)return e.debug(`No model found for model name "${t.model}"`),!1;e.debug(`Data query, modelId: "${s.id}", urlPath: "${t.pageUrl}"`);let i=new URL("https://cdn.builder.io/api/v3/data");i.searchParams.set("limit","1"),i.searchParams.set("cachebust","true"),i.searchParams.set("collection","content"),i.searchParams.set("query.published.$ne","archived"),i.searchParams.set("query.query.$elemMatch.$and[0].property","urlPath"),i.searchParams.set("query.query.$elemMatch.$and[0].operator","is"),i.searchParams.set("query.query.$elemMatch.$and[0].value",t.pageUrl),i.searchParams.set("query.modelId",s.id),i.searchParams.set("apiKey",t.publicApiKey);let a=await xo({url:i,method:"GET"});return e.debug(`Data results (${a.results.length}): ${i.href}`),a.results.length>0}async function og(e,t){let r=new URL(`https://cdn.builder.io/api/v3/content/${t.model}`);r.searchParams.set("apiKey",t.publicApiKey),r.searchParams.set("cachebust","true"),r.searchParams.set("cb",Date.now().toString()),t.pageUrl&&(r.searchParams.set("url",t.pageUrl),e.debug(`get model: "${t.model}", pageUrl: "${t.pageUrl}":`,r.href)),t.id&&(r.searchParams.set("query.id",t.id),e.debug(`get model: "${t.model}", id: "${t.id}":`,r.href));let n=await xo({url:r,method:"GET"});return e.debug(`get content results: ${n.results.length}`),n}async function ig(e,t){let r=new URL(`https://cdn.builder.io/api/v1/write/${t.model}`);e.debug(`writing "${t.model}" content:`,r.href),await xo({url:r,method:"POST",headers:{Authorization:`Bearer ${t.privateAuthKey}`},body:t.body})}var So="page",sg="integration-welcome-screens",ag="8d9ee72a33344b4b867918b442ebd0af";async function ug(e,t){let r=await og(e,{model:sg,publicApiKey:ag,id:t.templateContentId});if(!Array.isArray(r?.results)||r.results.length===0||!r.results[0].data?.blocks)throw new Error(`No Builder content found for id ${t.templateContentId}`);let n=JSON.stringify(r.results[0].data.blocks),o=b_(t.publicApiKey,t.pathname,t.title,n);await ig(e,{privateAuthKey:t.privateAuthKey,model:So,body:o})}function b_(e,t,r,n){return JSON.stringify({name:r,ownerId:e,published:"published",query:[{property:"urlPath",value:[t],operator:"is"}],data:{title:r,blocksString:n}})}async function cg(e,t,r,n){e.debug(`connect builder with public key: ${t}`),e.publicApiKey=t;let o=e.closeAppServer(),s=await e.setPublicApiKey({publicApiKey:t});if(s.modifiedType==="permission-error")return e.debug("permission error, failed to set public api key"),{success:!1,pathname:""};e.debug(`set public key: process.env.${s.envKey}=${t}`),process.env[s.envKey]=t;let i=await e.builderPageOptions();e.debug(`builder model: ${So}, path: ${i.pathname}, template: ${i.templateContentId}`);let a=await ng(e,{model:So,pageUrl:i.pathname,publicApiKey:t,privateAuthKey:r,kind:n});if(!a){await ug(e,{templateContentId:i.templateContentId,pathname:i.pathname,title:i.title,publicApiKey:t,privateAuthKey:r});let l=5,p=0;for(;!a&&p<l;){await new Promise(g=>setTimeout(g,1e3));let d=await rg({model:So,pageUrl:i.pathname,publicApiKey:t,privateAuthKey:r});p++,d&&d.length>0&&(a=!0)}}await o,e.debug("ensure builder setup");let u=[];n===vi.VCP?u=await e.ensureFigmaImportPage():u=await e.ensureBuilderSetup(),s.modifiedType&&u.push({filePath:s.file,modifiedType:s.modifiedType}),u.forEach(l=>{l.displayFilePath=e.relative(e.getAppRootDir(),l.filePath)}),u.sort((l,p)=>l.filePath.localeCompare(p.filePath)),u.length>0?(e.debug(`modified files: ${u.map(l=>l.displayFilePath).join(", ")}`),await e.restartAppServer(),await new Promise(l=>setTimeout(l,500))):e.debug("no modified files");let c={success:!0,pathname:i.localePathname||i.pathname,modifiedFiles:u,platform:e.platform(),kind:n};return n===vi.VCP&&(c.pathname="/"),e.debug(`connected builder: ${c.pathname}`),c}async function lg(e){let t=await e.builderPageOptions();e.debug(`validateBuilder, pathname: ${t.pathname}, localePathname: ${t.localePathname}, isValid: ${e.isValid}`);let r={isValid:e.isValid,pathname:t.localePathname||t.pathname,platform:e.platform()};if(e.isValid)return r;let n=await e.getPublicApiKey();return n.envValue?(e.debug(`public api key: ${n.envValue}, ${n.file}`),e.publicApiKey=n.envValue,e.debug("builder connection is valid"),r.isValid=!0,e.isValid=!0,r):(e.debug("missing public api key"),r)}async function pg(e,t){let r={type:t.type};switch(t.type){case"getCache":{r.data=await e.getCache();break}case"setCache":{await e.setCache(t.data);break}case"connectBuilder":{r.data=await cg(e,t.data.publicApiKey,t.data.privateAuthKey,t.data.kind);break}case"enableDevTools":{r.data=S_(e,t.data.enabled);break}case"getRegistry":{r.data=await e.getRegistry(t.data);break}case"launchEditor":{r.data=await e.launchEditor(t.data);break}case"validateBuilder":{r.data=await lg(e);break}case"loadComponent":{r.data=await e.loadComponent(t.data);break}case"getAllProjectFiles":{e.getAllProjectFiles?r.data=await e.getAllProjectFiles():r.errors=["getAllProjectFiles not implemented"];break}case"registerComponent":{r.data=await e.registerComponent(t.data),e.serverShouldRestart=!0;break}case"setComponentInfo":{r.data=await e.setRegisteredComponentInfo(t.data),e.serverShouldRestart=!0;break}case"setComponentInput":{r.data=await e.setRegisteredComponentInput(t.data),e.serverShouldRestart=!0;break}case"unregisterComponent":{r.data=await e.unregisterComponent(t.data),e.serverShouldRestart=!0;break}case"getFrameworks":{r.data=e.getFrameworks();break}case"readdir":{pc(e,t.path)?r.data=await e.readdir(t.path,!0):r.errors=[`Invalid file request: ${t.path}`];break}case"readFile":{pc(e,t.path)?r.data=await e.readFile(t.path):r.errors=[`Invalid file request: ${t.path}`];break}case"writeFile":{pc(e,t.path)?await e.writeFile(t.path,t.content):r.errors=[`Invalid file request: ${t.path}`];break}case"ensureFigmaImportPage":{r.data=await e.ensureFigmaImportPage();break}case"transileFile":{r.data=await Ym(e,t);break}case"transileModule":{r.data=ac(e,t);break}case"getPastSyncInfo":{r.data=await e.getPastSyncInfo?.(t.data);break}case"resyncSnippet":{r.data=await e.resyncSnippet?.(t.data);break}case"localConfig":{r.data=await wo();break}default:{r.errors=[`Unknown request type: ${JSON.stringify(t)}`];let n=t}}return r}function pc(e,t){if(!t||t.includes(".."))return!1;t=t.replace(/\\/g,"/");let r=t.split("/"),n=r[r.length-1];if(n.length>0){let o=n.split(".").pop();if(o&&(o=`.${o}`.toLocaleLowerCase(),o=o.split("?")[0],!x_.includes(o)))return!1}return w_(e,t),!1}function w_(e,t){if(!t)return!1;t=e.normalize(e.resolve(t));let r=e.getAppRootDir();return!(!t.startsWith(r)&&!t.includes("node_modules"))}var x_=[".js",".jsx",".ts",".tsx",".json",".css",".scss",".sass",".less",".html",".htm",".xml",".svg",".png",".jpg",".jpeg",".gif",".ico",".webp",".woff",".woff2",".ttf",".eot",".mp4",".webm",".ogg",".md",".txt",".csv",".pdf"];function S_(e,t){return!t&&e.serverShouldRestart&&setTimeout(()=>{console.log(`
44
+ }`};e.debug(`Get model id for model name "${t.model}"`);let s=(await xo({url:r,method:"POST",headers:{Authorization:`Bearer ${t.privateAuthKey}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)})).data.models.find(u=>u.name===t.model);if(!s)return e.debug(`No model found for model name "${t.model}"`),!1;e.debug(`Data query, modelId: "${s.id}", urlPath: "${t.pageUrl}"`);let i=new URL("https://cdn.builder.io/api/v3/data");i.searchParams.set("limit","1"),i.searchParams.set("cachebust","true"),i.searchParams.set("collection","content"),i.searchParams.set("query.published.$ne","archived"),i.searchParams.set("query.query.$elemMatch.$and[0].property","urlPath"),i.searchParams.set("query.query.$elemMatch.$and[0].operator","is"),i.searchParams.set("query.query.$elemMatch.$and[0].value",t.pageUrl),i.searchParams.set("query.modelId",s.id),i.searchParams.set("apiKey",t.publicApiKey);let a=await xo({url:i,method:"GET"});return e.debug(`Data results (${a.results.length}): ${i.href}`),a.results.length>0}async function ig(e,t){let r=new URL(`https://cdn.builder.io/api/v3/content/${t.model}`);r.searchParams.set("apiKey",t.publicApiKey),r.searchParams.set("cachebust","true"),r.searchParams.set("cb",Date.now().toString()),t.pageUrl&&(r.searchParams.set("url",t.pageUrl),e.debug(`get model: "${t.model}", pageUrl: "${t.pageUrl}":`,r.href)),t.id&&(r.searchParams.set("query.id",t.id),e.debug(`get model: "${t.model}", id: "${t.id}":`,r.href));let n=await xo({url:r,method:"GET"});return e.debug(`get content results: ${n.results.length}`),n}async function sg(e,t){let r=new URL(`https://cdn.builder.io/api/v1/write/${t.model}`);e.debug(`writing "${t.model}" content:`,r.href),await xo({url:r,method:"POST",headers:{Authorization:`Bearer ${t.privateAuthKey}`},body:t.body})}var So="page",ag="integration-welcome-screens",ug="8d9ee72a33344b4b867918b442ebd0af";async function cg(e,t){let r=await ig(e,{model:ag,publicApiKey:ug,id:t.templateContentId});if(!Array.isArray(r?.results)||r.results.length===0||!r.results[0].data?.blocks)throw new Error(`No Builder content found for id ${t.templateContentId}`);let n=JSON.stringify(r.results[0].data.blocks),o=w_(t.publicApiKey,t.pathname,t.title,n);await sg(e,{privateAuthKey:t.privateAuthKey,model:So,body:o})}function w_(e,t,r,n){return JSON.stringify({name:r,ownerId:e,published:"published",query:[{property:"urlPath",value:[t],operator:"is"}],data:{title:r,blocksString:n}})}async function lg(e,t,r,n){e.debug(`connect builder with public key: ${t}`),e.publicApiKey=t;let o=e.closeAppServer(),s=await e.setPublicApiKey({publicApiKey:t});if(s.modifiedType==="permission-error")return e.debug("permission error, failed to set public api key"),{success:!1,pathname:""};e.debug(`set public key: process.env.${s.envKey}=${t}`),process.env[s.envKey]=t;let i=await e.builderPageOptions();e.debug(`builder model: ${So}, path: ${i.pathname}, template: ${i.templateContentId}`);let a=await og(e,{model:So,pageUrl:i.pathname,publicApiKey:t,privateAuthKey:r,kind:n});if(!a){await cg(e,{templateContentId:i.templateContentId,pathname:i.pathname,title:i.title,publicApiKey:t,privateAuthKey:r});let l=5,p=0;for(;!a&&p<l;){await new Promise(g=>setTimeout(g,1e3));let d=await ng({model:So,pageUrl:i.pathname,publicApiKey:t,privateAuthKey:r});p++,d&&d.length>0&&(a=!0)}}await o,e.debug("ensure builder setup");let u=[];n===vi.VCP?u=await e.ensureFigmaImportPage():u=await e.ensureBuilderSetup(),s.modifiedType&&u.push({filePath:s.file,modifiedType:s.modifiedType}),u.forEach(l=>{l.displayFilePath=e.relative(e.getAppRootDir(),l.filePath)}),u.sort((l,p)=>l.filePath.localeCompare(p.filePath)),u.length>0?(e.debug(`modified files: ${u.map(l=>l.displayFilePath).join(", ")}`),await e.restartAppServer(),await new Promise(l=>setTimeout(l,500))):e.debug("no modified files");let c={success:!0,pathname:i.localePathname||i.pathname,modifiedFiles:u,platform:e.platform(),kind:n};return n===vi.VCP&&(c.pathname="/"),e.debug(`connected builder: ${c.pathname}`),c}async function pg(e){let t=await e.builderPageOptions();e.debug(`validateBuilder, pathname: ${t.pathname}, localePathname: ${t.localePathname}, isValid: ${e.isValid}`);let r={isValid:e.isValid,pathname:t.localePathname||t.pathname,platform:e.platform()};if(e.isValid)return r;let n=await e.getPublicApiKey();return n.envValue?(e.debug(`public api key: ${n.envValue}, ${n.file}`),e.publicApiKey=n.envValue,e.debug("builder connection is valid"),r.isValid=!0,e.isValid=!0,r):(e.debug("missing public api key"),r)}async function dg(e,t){let r={type:t.type};switch(t.type){case"getCache":{r.data=await e.getCache();break}case"setCache":{await e.setCache(t.data);break}case"connectBuilder":{r.data=await lg(e,t.data.publicApiKey,t.data.privateAuthKey,t.data.kind);break}case"enableDevTools":{r.data=E_(e,t.data.enabled);break}case"getRegistry":{r.data=await e.getRegistry(t.data);break}case"launchEditor":{r.data=await e.launchEditor(t.data);break}case"validateBuilder":{r.data=await pg(e);break}case"loadComponent":{r.data=await e.loadComponent(t.data);break}case"getAllProjectFiles":{e.getAllProjectFiles?r.data=await e.getAllProjectFiles():r.errors=["getAllProjectFiles not implemented"];break}case"registerComponent":{r.data=await e.registerComponent(t.data),e.serverShouldRestart=!0;break}case"setComponentInfo":{r.data=await e.setRegisteredComponentInfo(t.data),e.serverShouldRestart=!0;break}case"setComponentInput":{r.data=await e.setRegisteredComponentInput(t.data),e.serverShouldRestart=!0;break}case"unregisterComponent":{r.data=await e.unregisterComponent(t.data),e.serverShouldRestart=!0;break}case"getFrameworks":{r.data=e.getFrameworks();break}case"readdir":{dc(e,t.path)?r.data=await e.readdir(t.path,!0):r.errors=[`Invalid file request: ${t.path}`];break}case"readFile":{dc(e,t.path)?r.data=await e.readFile(t.path):r.errors=[`Invalid file request: ${t.path}`];break}case"writeFile":{dc(e,t.path)?await e.writeFile(t.path,t.content):r.errors=[`Invalid file request: ${t.path}`];break}case"ensureFigmaImportPage":{r.data=await e.ensureFigmaImportPage();break}case"transileFile":{r.data=await Qm(e,t);break}case"transileModule":{r.data=uc(e,t);break}case"getPastSyncInfo":{r.data=await e.getPastSyncInfo?.(t.data);break}case"resyncSnippet":{r.data=await e.resyncSnippet?.(t.data);break}case"localConfig":{r.data=await wo();break}default:{r.errors=[`Unknown request type: ${JSON.stringify(t)}`];let n=t}}return r}function dc(e,t){if(!t||t.includes(".."))return!1;t=t.replace(/\\/g,"/");let r=t.split("/"),n=r[r.length-1];if(n.length>0){let o=n.split(".").pop();if(o&&(o=`.${o}`.toLocaleLowerCase(),o=o.split("?")[0],!S_.includes(o)))return!1}return x_(e,t),!1}function x_(e,t){if(!t)return!1;t=e.normalize(e.resolve(t));let r=e.getAppRootDir();return!(!t.startsWith(r)&&!t.includes("node_modules"))}var S_=[".js",".jsx",".ts",".tsx",".json",".css",".scss",".sass",".less",".html",".htm",".xml",".svg",".png",".jpg",".jpeg",".gif",".ico",".webp",".woff",".woff2",".ttf",".eot",".mp4",".webm",".ogg",".md",".txt",".csv",".pdf"];function E_(e,t){return!t&&e.serverShouldRestart&&setTimeout(()=>{console.log(`
45
45
  Restarting server after Builder Devtools update...
46
- `),e.restartAppServer()},10),e.enableAppWatch(!t),{enabled:t,platform:e.platform()}}async function dg(e){return mg(e,`"use strict";(()=>{var fi=Object.create;var Mt=Object.defineProperty;var mi=Object.getOwnPropertyDescriptor;var vi=Object.getOwnPropertyNames;var gi=Object.getPrototypeOf,hi=Object.prototype.hasOwnProperty;var yi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),bi=(t,e)=>{for(var r in e)Mt(t,r,{get:e[r],enumerable:!0})},Ei=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vi(e))!hi.call(t,i)&&i!==r&&Mt(t,i,{get:()=>e[i],enumerable:!(n=mi(e,i))||n.enumerable});return t};var _i=(t,e,r)=>(r=t!=null?fi(gi(t)):{},Ei(e||!t||!t.__esModule?Mt(r,"default",{value:t,enumerable:!0}):r,t));var jn=yi((Qe,Ct)=>{(function(t,e){"use strict";var r="0.7.33",n="",i="?",o="function",s="undefined",u="object",d="string",p="major",a="model",c="name",l="type",f="vendor",m="version",_="architecture",b="console",v="mobile",y="tablet",T="smarttv",L="wearable",k="embedded",w=350,C="Amazon",R="Apple",K="ASUS",z="BlackBerry",Q="Browser",P="Chrome",Ce="Edge",ce="Firefox",_e="Google",Me="Huawei",Re="LG",Oe="Microsoft",Be="Motorola",Te="Opera",we="Samsung",ke="Sharp",fe="Sony",me="Xiaomi",Ve="Zebra",U="Facebook",et=function(S,O){var I={};for(var q in S)O[q]&&O[q].length%2===0?I[q]=O[q].concat(S[q]):I[q]=S[q];return I},tt=function(S){for(var O={},I=0;I<S.length;I++)O[S[I].toUpperCase()]=S[I];return O},Pr=function(S,O){return typeof S===d?Fe(O).indexOf(Fe(S))!==-1:!1},Fe=function(S){return S.toLowerCase()},di=function(S){return typeof S===d?S.replace(/[^\\d\\.]/g,n).split(".")[0]:e},Nt=function(S,O){if(typeof S===d)return S=S.replace(/^\\s\\s*/,n),typeof O===s?S:S.substring(0,w)},He=function(S,O){for(var I=0,q,x,nt,D,qe,ie;I<O.length&&!qe;){var Or=O[I],kr=O[I+1];for(q=x=0;q<Or.length&&!qe;)if(qe=Or[q++].exec(S),qe)for(nt=0;nt<kr.length;nt++)ie=qe[++x],D=kr[nt],typeof D===u&&D.length>0?D.length===2?typeof D[1]==o?this[D[0]]=D[1].call(this,ie):this[D[0]]=D[1]:D.length===3?typeof D[1]===o&&!(D[1].exec&&D[1].test)?this[D[0]]=ie?D[1].call(this,ie,D[2]):e:this[D[0]]=ie?ie.replace(D[1],D[2]):e:D.length===4&&(this[D[0]]=ie?D[3].call(this,ie.replace(D[1],D[2])):e):this[D]=ie||e;I+=2}},Ut=function(S,O){for(var I in O)if(typeof O[I]===u&&O[I].length>0){for(var q=0;q<O[I].length;q++)if(Pr(O[I][q],S))return I===i?e:I}else if(Pr(O[I],S))return I===i?e:I;return S},pi={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Cr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Rr={browser:[[/\\b(?:crmo|crios)\\/([\\w\\.]+)/i],[m,[c,"Chrome"]],[/edg(?:e|ios|a)?\\/([\\w\\.]+)/i],[m,[c,"Edge"]],[/(opera mini)\\/([-\\w\\.]+)/i,/(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,/(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i],[c,m],[/opios[\\/ ]+([\\w\\.]+)/i],[m,[c,Te+" Mini"]],[/\\bopr\\/([\\w\\.]+)/i],[m,[c,Te]],[/(kindle)\\/([\\w\\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i,/(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i,/(?:ms|\\()(ie) ([\\w\\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,/(weibo)__([\\d\\.]+)/i],[c,m],[/(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i],[m,[c,"UC"+Q]],[/microm.+\\bqbcore\\/([\\w\\.]+)/i,/\\bqbcore\\/([\\w\\.]+).+microm/i],[m,[c,"WeChat(Win) Desktop"]],[/micromessenger\\/([\\w\\.]+)/i],[m,[c,"WeChat"]],[/konqueror\\/([\\w\\.]+)/i],[m,[c,"Konqueror"]],[/trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i],[m,[c,"IE"]],[/yabrowser\\/([\\w\\.]+)/i],[m,[c,"Yandex"]],[/(avast|avg)\\/([\\w\\.]+)/i],[[c,/(.+)/,"$1 Secure "+Q],m],[/\\bfocus\\/([\\w\\.]+)/i],[m,[c,ce+" Focus"]],[/\\bopt\\/([\\w\\.]+)/i],[m,[c,Te+" Touch"]],[/coc_coc\\w+\\/([\\w\\.]+)/i],[m,[c,"Coc Coc"]],[/dolfin\\/([\\w\\.]+)/i],[m,[c,"Dolphin"]],[/coast\\/([\\w\\.]+)/i],[m,[c,Te+" Coast"]],[/miuibrowser\\/([\\w\\.]+)/i],[m,[c,"MIUI "+Q]],[/fxios\\/([-\\w\\.]+)/i],[m,[c,ce]],[/\\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+Q]],[/(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i],[[c,/(.+)/,"$1 "+Q],m],[/(comodo_dragon)\\/([\\w\\.]+)/i],[[c,/_/g," "],m],[/(electron)\\/([\\w\\.]+) safari/i,/(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i],[c,m],[/(metasr)[\\/ ]?([\\w\\.]+)/i,/(lbbrowser)/i,/\\[(linkedin)app\\]/i],[c],[/((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i],[[c,U],m],[/safari (line)\\/([\\w\\.]+)/i,/\\b(line)\\/([\\w\\.]+)\\/iab/i,/(chromium|instagram)[\\/ ]([-\\w\\.]+)/i],[c,m],[/\\bgsa\\/([\\w\\.]+) .*safari\\//i],[m,[c,"GSA"]],[/headlesschrome(?:\\/([\\w\\.]+)| )/i],[m,[c,P+" Headless"]],[/ wv\\).+(chrome)\\/([\\w\\.]+)/i],[[c,P+" WebView"],m],[/droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i],[m,[c,"Android "+Q]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i],[c,m],[/version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i],[m,[c,"Mobile Safari"]],[/version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i],[m,c],[/webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i],[c,[m,Ut,pi]],[/(webkit|khtml)\\/([\\w\\.]+)/i],[c,m],[/(navigator|netscape\\d?)\\/([-\\w\\.]+)/i],[[c,"Netscape"],m],[/mobile vr; rv:([\\w\\.]+)\\).+firefox/i],[m,[c,ce+" Reality"]],[/ekiohf.+(flow)\\/([\\w\\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,/(firefox)\\/([\\w\\.]+)/i,/(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,/(links) \\(([\\w\\.]+)/i],[c,m],[/(cobalt)\\/([\\w\\.]+)/i],[c,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i],[[_,"amd64"]],[/(ia32(?=;))/i],[[_,Fe]],[/((?:i[346]|x)86)[;\\)]/i],[[_,"ia32"]],[/\\b(aarch64|arm(v?8e?l?|_?64))\\b/i],[[_,"arm64"]],[/\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i],[[_,"armhf"]],[/windows (ce|mobile); ppc;/i],[[_,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i],[[_,/ower/,n,Fe]],[/(sun4\\w)[;\\)]/i],[[_,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i],[[_,Fe]]],device:[[/\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i],[a,[f,we],[l,y]],[/\\b((?:s[cgp]h|gt|sm)-\\w+|galaxy nexus)/i,/samsung[- ]([-\\w]+)/i,/sec-(sgh\\w+)/i],[a,[f,we],[l,v]],[/((ipod|iphone)\\d+,\\d+)/i],[a,[f,R],[l,v]],[/(ipad\\d+,\\d+)/i],[a,[f,R],[l,y]],[/\\((ip(?:hone|od)[\\w ]*);/i],[a,[f,R],[l,v]],[/\\((ipad);[-\\w\\),; ]+apple/i,/applecoremedia\\/[\\w\\.]+ \\((ipad)/i,/\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i],[a,[f,R],[l,y]],[/(macintosh);/i],[a,[f,R]],[/\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i],[a,[f,Me],[l,y]],[/(?:huawei|honor)([-\\w ]+)[;\\)]/i,/\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i],[a,[f,Me],[l,v]],[/\\b(poco[\\w ]+)(?: bui|\\))/i,/\\b; (\\w+) build\\/hm\\1/i,/\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i,/\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i,/\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i],[[a,/_/g," "],[f,me],[l,v]],[/\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i],[[a,/_/g," "],[f,me],[l,y]],[/; (\\w+) bui.+ oppo/i,/\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i],[a,[f,"OPPO"],[l,v]],[/vivo (\\w+)(?: bui|\\))/i,/\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i],[a,[f,"Vivo"],[l,v]],[/\\b(rmx[12]\\d{3})(?: bui|;|\\))/i],[a,[f,"Realme"],[l,v]],[/\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,/\\bmot(?:orola)?[- ](\\w*)/i,/((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i],[a,[f,Be],[l,v]],[/\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i],[a,[f,Be],[l,y]],[/((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i],[a,[f,Re],[l,y]],[/(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,/\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,/\\blg-?([\\d\\w]+) bui/i],[a,[f,Re],[l,v]],[/(ideatab[-\\w ]+)/i,/lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i],[a,[f,"Lenovo"],[l,y]],[/(?:maemo|nokia).*(n900|lumia \\d+)/i,/nokia[-_ ]?([-\\w\\.]*)/i],[[a,/_/g," "],[f,"Nokia"],[l,v]],[/(pixel c)\\b/i],[a,[f,_e],[l,y]],[/droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i],[a,[f,_e],[l,v]],[/droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i],[a,[f,fe],[l,v]],[/sony tablet [ps]/i,/\\b(?:sony)?sgp\\w+(?: bui|\\))/i],[[a,"Xperia Tablet"],[f,fe],[l,y]],[/ (kb2005|in20[12]5|be20[12][59])\\b/i,/(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i],[a,[f,"OnePlus"],[l,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\\))/i,/(kf[a-z]+)( bui|\\)).+silk\\//i],[a,[f,C],[l,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i],[[a,/(.+)/g,"Fire Phone $1"],[f,C],[l,v]],[/(playbook);[-\\w\\),; ]+(rim)/i],[a,f,[l,y]],[/\\b((?:bb[a-f]|st[hv])100-\\d)/i,/\\(bb10; (\\w+)/i],[a,[f,z],[l,v]],[/(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i],[a,[f,K],[l,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i],[a,[f,K],[l,v]],[/(nexus 9)/i],[a,[f,"HTC"],[l,y]],[/(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,/(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\\w]*)/i],[f,[a,/_/g," "],[l,v]],[/droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i],[a,[f,"Acer"],[l,y]],[/droid.+; (m[1-5] note) bui/i,/\\bmz-([-\\w]{2,})/i],[a,[f,"Meizu"],[l,v]],[/\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i],[a,[f,ke],[l,v]],[/(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,/(hp) ([\\w ]+\\w)/i,/(asus)-?(\\w+)/i,/(microsoft); (lumia[\\w ]+)/i,/(lenovo)[-_ ]?([-\\w]+)/i,/(jolla)/i,/(oppo) ?([\\w ]+) bui/i],[f,a,[l,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\\/([\\w\\.]+)/i,/(nook)[\\w ]+build\\/(\\w+)/i,/(dell) (strea[kpr\\d ]*[\\dko])/i,/(le[- ]+pan)[- ]+(\\w{1,9}) bui/i,/(trinity)[- ]*(t\\d{3}) bui/i,/(gigaset)[- ]+(q\\w{1,9}) bui/i,/(vodafone) ([\\w ]+)(?:\\)| bui)/i],[f,a,[l,y]],[/(surface duo)/i],[a,[f,Oe],[l,y]],[/droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i],[a,[f,"Fairphone"],[l,v]],[/(u304aa)/i],[a,[f,"AT&T"],[l,v]],[/\\bsie-(\\w*)/i],[a,[f,"Siemens"],[l,v]],[/\\b(rct\\w+) b/i],[a,[f,"RCA"],[l,y]],[/\\b(venue[\\d ]{2,7}) b/i],[a,[f,"Dell"],[l,y]],[/\\b(q(?:mv|ta)\\w+) b/i],[a,[f,"Verizon"],[l,y]],[/\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i],[a,[f,"Barnes & Noble"],[l,y]],[/\\b(tm\\d{3}\\w+) b/i],[a,[f,"NuVision"],[l,y]],[/\\b(k88) b/i],[a,[f,"ZTE"],[l,y]],[/\\b(nx\\d{3}j) b/i],[a,[f,"ZTE"],[l,v]],[/\\b(gen\\d{3}) b.+49h/i],[a,[f,"Swiss"],[l,v]],[/\\b(zur\\d{3}) b/i],[a,[f,"Swiss"],[l,y]],[/\\b((zeki)?tb.*\\b) b/i],[a,[f,"Zeki"],[l,y]],[/\\b([yr]\\d{2}) b/i,/\\b(dragon[- ]+touch |dt)(\\w{5}) b/i],[[f,"Dragon Touch"],a,[l,y]],[/\\b(ns-?\\w{0,9}) b/i],[a,[f,"Insignia"],[l,y]],[/\\b((nxa|next)-?\\w{0,9}) b/i],[a,[f,"NextBook"],[l,y]],[/\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],a,[l,v]],[/\\b(lvtel\\-)?(v1[12]) b/i],[[f,"LvTel"],a,[l,v]],[/\\b(ph-1) /i],[a,[f,"Essential"],[l,v]],[/\\b(v(100md|700na|7011|917g).*\\b) b/i],[a,[f,"Envizen"],[l,y]],[/\\b(trio[-\\w\\. ]+) b/i],[a,[f,"MachSpeed"],[l,y]],[/\\btu_(1491) b/i],[a,[f,"Rotor"],[l,y]],[/(shield[\\w ]+) b/i],[a,[f,"Nvidia"],[l,y]],[/(sprint) (\\w+)/i],[f,a,[l,v]],[/(kin\\.[onetw]{3})/i],[[a,/\\./g," "],[f,Oe],[l,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i],[a,[f,Ve],[l,y]],[/droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i],[a,[f,Ve],[l,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,a,[l,b]],[/droid.+; (shield) bui/i],[a,[f,"Nvidia"],[l,b]],[/(playstation [345portablevi]+)/i],[a,[f,fe],[l,b]],[/\\b(xbox(?: one)?(?!; xbox))[\\); ]/i],[a,[f,Oe],[l,b]],[/smart-tv.+(samsung)/i],[f,[l,T]],[/hbbtv.+maple;(\\d+)/i],[[a,/^/,"SmartTV"],[f,we],[l,T]],[/(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i],[[f,Re],[l,T]],[/(apple) ?tv/i],[f,[a,R+" TV"],[l,T]],[/crkey/i],[[a,P+"cast"],[f,_e],[l,T]],[/droid.+aft(\\w)( bui|\\))/i],[a,[f,C],[l,T]],[/\\(dtv[\\);].+(aquos)/i,/(aquos-tv[\\w ]+)\\)/i],[a,[f,ke],[l,T]],[/(bravia[\\w ]+)( bui|\\))/i],[a,[f,fe],[l,T]],[/(mitv-\\w{5}) bui/i],[a,[f,me],[l,T]],[/\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,/hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w ]*; *(\\w[^;]*);([^;]*)/i],[[f,Nt],[a,Nt],[l,T]],[/\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i],[[l,T]],[/((pebble))app/i],[f,a,[l,L]],[/droid.+; (glass) \\d/i],[a,[f,_e],[l,L]],[/droid.+; (wt63?0{2,3})\\)/i],[a,[f,Ve],[l,L]],[/(quest( 2)?)/i],[a,[f,U],[l,L]],[/(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i],[f,[l,k]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i],[a,[l,v]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i],[a,[l,y]],[/\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i],[[l,y]],[/(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i],[[l,v]],[/(android[-\\w\\. ]{0,9});.+buil/i],[a,[f,"Generic"]]],engine:[[/windows.+ edge\\/([\\w\\.]+)/i],[m,[c,Ce+"HTML"]],[/webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i],[m,[c,"Blink"]],[/(presto)\\/([\\w\\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i,/ekioh(flow)\\/([\\w\\.]+)/i,/(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i,/(icab)[\\/ ]([23]\\.[\\d\\.]+)/i],[c,m],[/rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i],[m,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,m],[/(windows) nt 6\\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,/(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i],[c,[m,Ut,Cr]],[/(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i],[[c,"Windows"],[m,Ut,Cr]],[/ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,/cfnetwork\\/.+darwin/i],[[m,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\\w\\. ]*)/i,/(macintosh|mac_powerpc\\b)(?!.+haiku)/i],[[c,"Mac OS"],[m,/_/g,"."]],[/droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i],[m,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,/(blackberry)\\w*\\/([\\w\\.]*)/i,/(tizen|kaios)[\\/ ]([\\w\\.]+)/i,/\\((series40);/i],[c,m],[/\\(bb(10);/i],[m,[c,z]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i],[m,[c,"Symbian"]],[/mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i],[m,[c,ce+" OS"]],[/web0s;.+rt(tv)/i,/\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i],[m,[c,"webOS"]],[/crkey\\/([\\d\\.]+)/i],[m,[c,P+"cast"]],[/(cros) [\\w]+ ([\\w\\.]+\\w)/i],[[c,"Chromium OS"],m],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\\);]+)/i,/\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i,/(mint)[\\/\\(\\) ]?(\\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,/(hurd|linux) ?([\\w\\.]*)/i,/(gnu) ?([\\w\\.]*)/i,/\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i,/(haiku) (\\w+)/i],[c,m],[/(sunos) ?([\\w\\.\\d]*)/i],[[c,"Solaris"],m],[/((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,/(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,/\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\\w\\.]*)/i],[c,m]]},Z=function(S,O){if(typeof S===u&&(O=S,S=e),!(this instanceof Z))return new Z(S,O).getResult();var I=S||(typeof t!==s&&t.navigator&&t.navigator.userAgent?t.navigator.userAgent:n),q=O?et(Rr,O):Rr;return this.getBrowser=function(){var x={};return x[c]=e,x[m]=e,He.call(x,I,q.browser),x.major=di(x.version),x},this.getCPU=function(){var x={};return x[_]=e,He.call(x,I,q.cpu),x},this.getDevice=function(){var x={};return x[f]=e,x[a]=e,x[l]=e,He.call(x,I,q.device),x},this.getEngine=function(){var x={};return x[c]=e,x[m]=e,He.call(x,I,q.engine),x},this.getOS=function(){var x={};return x[c]=e,x[m]=e,He.call(x,I,q.os),x},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return I},this.setUA=function(x){return I=typeof x===d&&x.length>w?Nt(x,w):x,this},this.setUA(I),this};Z.VERSION=r,Z.BROWSER=tt([c,m,p]),Z.CPU=tt([_]),Z.DEVICE=tt([a,f,l,b,v,T,y,L,k]),Z.ENGINE=Z.OS=tt([c,m]),typeof Qe!==s?(typeof Ct!==s&&Ct.exports&&(Qe=Ct.exports=Z),Qe.UAParser=Z):typeof define===o&&define.amd?define(function(){return Z}):typeof t!==s&&(t.UAParser=Z);var Ae=typeof t!==s&&(t.jQuery||t.Zepto);if(Ae&&!Ae.ua){var rt=new Z;Ae.ua=rt.getResult(),Ae.ua.get=function(){return rt.getUA()},Ae.ua.set=function(S){rt.setUA(S);var O=rt.getResult();for(var I in O)Ae.ua[I]=O[I]}}})(typeof window=="object"?window:Qe)});var oe=(t,e)=>{Vt(t);let r=t.querySelector("aside");r.dataset.view=e,r.classList.remove("section-ready"),setTimeout(()=>{r.classList.add("section-ready")},200)},Ar=t=>{Array.from(t.querySelectorAll(".back-button")).forEach(e=>{e.addEventListener("click",r=>{Vt(t),r.preventDefault(),r.stopPropagation();let n=r.target;oe(t,n?.dataset.back||"nav-home")})})},Bt=(t,e)=>{Vt(t);let r=t.querySelector("aside"),n=document.createElement("div");n.className="ui-toast",n.innerHTML=e,r.appendChild(n),setTimeout(()=>{n.classList.add("ui-toast-show"),setTimeout(()=>{n.classList.remove("ui-toast-show"),setTimeout(()=>{n.remove()},500)},4e3)},30)},Vt=t=>{let e=t.querySelector("aside");Array.from(e.querySelectorAll(".ui-toast")).forEach(n=>{n.classList.remove("ui-toast-show")})},it=()=>{let t=Dr();return localStorage.getItem(t)!=="true"},Ft=t=>{let e=Dr();t?localStorage.removeItem(e):localStorage.setItem(e,"true")},Dr=()=>Ti("disableEdit"),Ti=t=>\`builder.__LOCAL_APP_ID__.\${t}\`,Nr=()=>{let e=document.body.querySelector("[builder-content-id]")?.getAttribute("builder-content-id");return je(e)},je=(t,e)=>{let r="/content";t&&(r+="/"+t+"/edit");let n=new URL(r,"https://builder.io");t&&e&&n.searchParams.set("selectedBlock",e);let i=new URL(location.pathname,location.href);return n.searchParams.set("overridePreviewUrl",i.href),n.href},ot="__DEV_TOOLS_URL__",G={components:[],registryPath:"",registryDisplayPath:"",frameworks:[],dependencies:[],publicApiKey:void 0,devToolsVersion:""},le=t=>{G.components=t.components,G.registryPath=t.registryPath,G.registryDisplayPath=t.registryDisplayPath,G.dependencies=t.dependencies,G.publicApiKey=t.publicApiKey};function Ur(t){let e=null,r=document.querySelector("builder-dev-tools-menu"),n=()=>{t.hide()},i=u=>{let d=u.target;if(!d){n();return}if(d.closest("builder-dev-tools-edit"))return;let p=d.closest("[builder-content-id]"),a=d.closest("[builder-id]");if(!p||!a){t.hide();return}let c=t.show(p,a);!c||c===e||(r.highlightOpener(),e=c)};document.addEventListener("pointerover",i,{passive:!0}),document.addEventListener("pointerleave",n,{passive:!0}),document.addEventListener("pointercancel",n,{passive:!0}),document.addEventListener("visibilitychange",n,{passive:!0}),window.addEventListener("popstate",n,{passive:!0});let o=history.pushState;history.pushState=function(...u){t.hide(),o.apply(this,u)};let s=history.replaceState;history.replaceState=function(...u){t.hide(),s.apply(this,u)}}var st=class extends HTMLElement{openInBuilder=null;block=null;constructor(){super()}connectedCallback(){this.setAttribute("aria-hidden","true");let e=this.attachShadow({mode:"open"});e.innerHTML='<style>*,*:before,*:after{box-sizing:border-box}:host{--background-color: rgba(40, 40, 40, 1);--primary-color: rgba(72, 161, 255, 1);--primary-color-subdued: rgb(72, 161, 255, .6);--primary-color-highlight: rgb(126, 188, 255);--primary-contrast-color: white;--edit-color: #1d74e2;--edit-color-highlight: #1c6bd1;--edit-color-alpha: rgb(72, 161, 255, .15);--error-color: #ff2b55;--text-color: white;--text-color-highlight: white;--border-color: #454545;--button-background-color-hover: rgba(255, 255, 255, .1);--menu-width: 320px;--transition-time: .15s;--font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-family:var(--font-family);line-height:1.6}button{cursor:pointer;color:var(--text-color);-webkit-tap-highlight-color:transparent}input,select,button{font-family:var(--font-family)}:host{display:none;position:absolute;top:0;left:0;width:100%;height:100%;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}#content-highlight,#block{position:absolute}#content-highlight{border:3px solid var(--primary-color);background-color:var(--primary-color-alpha)}a{position:absolute;top:-33px;left:0;display:block;padding:5px 10px 8px;pointer-events:auto;z-index:100;text-decoration:none}a:hover{text-decoration:none}a span{display:block;padding:3px 6px;font-size:10px;font-weight:300;border-radius:3px;text-align:center;text-decoration:none;pointer-events:none;background-color:var(--edit-color);color:var(--text-color);white-space:nowrap}a:hover span{background-color:var(--edit-color-highlight)}a:hover~.outline{border-color:var(--edit-color-highlight)}#open-in-editor{display:none}.outline{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid var(--edit-color);background-color:var(--edit-color-alpha)}</style><div id="block"> <a id="open-in-builder" target="builder"><span>Open In Builder</span></a> <a id="open-in-editor" href="#open-in-editor"><span>Open In Editor</span></a> <div class="outline"></div> </div>',this.openInBuilder=e.getElementById("open-in-builder"),this.block=e.getElementById("block"),Ur(this)}show(e,r){if(!it())return this.hide(),null;let n=e.getAttribute("builder-content-id"),i=r.getAttribute("builder-id");if(!n||!i)return this.hide(),null;let o=this.block,s=this.openInBuilder,u=r.getBoundingClientRect();o.style.top=u.top+window.scrollY-1+"px",o.style.left=u.left+window.scrollX+"px",o.style.width=u.width+"px",o.style.height=u.height+1+"px";let d=s.getBoundingClientRect();if(d.width>u.width){let p=d.width-u.width;s.style.left=p/2*-1+"px"}else s.style.left="";return s.href=je(n,i),this.style.display="block",i}hide(){this.style.display=""}};var Mr="preview-url";var Br="_b-uid";var Vr="/~builder-connect";var Fr="/~builder-dev-tools";var Hr="https://cdn.builder.io/api/v1/proxy-api?url=https://api2.amplitude.com/2/httpapi";var qr=()=>se({type:"validateBuilder"}),De=t=>se({type:"launchEditor",data:t}),jr=t=>se({type:"getRegistry",data:t}),Gr=t=>se({type:"loadComponent",data:t}),Kr=t=>se({type:"registerComponent",data:t}),Wr=t=>se({type:"setComponentInfo",data:t}),at=t=>se({type:"setComponentInput",data:t}),$r=t=>se({type:"unregisterComponent",data:t}),Yr=t=>se({type:"enableDevTools",data:{enabled:t}}),zr=()=>se({type:"localConfig"}),se=async t=>{let e=new URL(Fr,ot),r;try{r=await fetch(e,{method:"POST",body:JSON.stringify(t)})}catch(i){throw console.error(\`Devtools Fetch Error, \${e.href}\`,i),new Error("Builder Devtools Fetch Error")}if((r.headers.get("content-type")||"").includes("application/json")){let i=await r.json();if(r.ok)return i.data;if(Array.isArray(i.errors)&&i.errors.length>0)throw i.errors.forEach(o=>console.error(o)),new Error(\`Builder Devtools Fetch Error: \${i.errors[0]}\`)}throw new Error(\`Builder Devtools Fetch Error: \${r.status}, \${await r.text()}\`)};var Qr=[{value:"boolean",text:"boolean"},{value:"color",text:"color (provides a color in hex or rgb)"},{value:"date",text:"date (same format as the Date constructor)"},{value:"email",text:"email"},{value:"file",text:"file (uploads a file and provides a url)"},{value:"list",text:"list (collection of items)"},{value:"longText",text:"longText (multiline text editor)"},{value:"number",text:"number"},{value:"object",text:"object (set of specific names and values)"},{value:"richText",text:"richText (provides value as html)"},{value:"string",text:"string"}],ut=["color","date","email","file","longText","richText","string"],ct=["number"],lt=["boolean"],dt=["list"],pt=["object"];function ft(t){return ut.includes(t)?"string":ct.includes(t)?"number":lt.includes(t)?"boolean":dt.includes(t)?"array":pt.includes(t)?"object":"string"}var Io=new Set(["about","accessKey","accessKeyLabel","asChild","autoCapitalize","autoCorrect","autoFocus","autoSave","blur","contentEditable","contextMenu","dangerouslySetInnerHTML","datatype","defaultChecked","defaultValue","dir","draggable","enterKeyHint","focus","form","formAction","formEncType","formMethod","formNoValidate","formTarget","inlist","innerText","inputMode","is","isContentEditable","itemID","itemProp","itemRef","itemScope","itemType","lang","nonce","offsetHeight","offsetLeft","offsetTop","offsetWidth","outerText","prefix","property","radioGroup","rel","resource","results","rev","role","security","slot","spellCheck","suppressContentEditableWarning","suppressHydrationWarning","tabIndex","translate","typeof","unselectable","vocab"].map(t=>t.toLowerCase()));var Ht=function(t,e){return Ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ht(t,e)};function ae(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ht(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var E=function(){return E=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},E.apply(this,arguments)};function Ge(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function g(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function u(a){try{p(n.next(a))}catch(c){s(c)}}function d(a){try{p(n.throw(a))}catch(c){s(c)}}function p(a){a.done?o(a.value):i(a.value).then(u,d)}p((n=n.apply(t,e||[])).next())})}function h(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(p){return function(a){return d([p,a])}}function d(p){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,p[0]&&(r=0)),r;)try{if(n=1,i&&(o=p[0]&2?i.return:p[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,p[1])).done)return o;switch(i=0,o&&(p=[p[0]&2,o.value]),p[0]){case 0:case 1:o=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,i=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!o||p[1]>o[0]&&p[1]<o[3])){r.label=p[1];break}if(p[0]===6&&r.label<o[1]){r.label=o[1],o=p;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(p);break}o[2]&&r.ops.pop(),r.trys.pop();continue}p=e.call(t,r)}catch(a){p=[6,a],i=0}finally{n=o=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function J(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function A(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function ee(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}var mt={};bi(mt,{IdentifyOperation:()=>B,LogLevel:()=>Y,PluginType:()=>N,RevenueProperty:()=>re,ServerZone:()=>Se,SpecialEventType:()=>de,Status:()=>M,TransportType:()=>Ie});var B;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(B||(B={}));var re;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE_CURRENCY="$currency",t.REVENUE="$revenue"})(re||(re={}));var de;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(de||(de={}));var Y;(function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"})(Y||(Y={}));var N;(function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"})(N||(N={}));var Se;(function(t){t.US="US",t.EU="EU",t.STAGING="STAGING"})(Se||(Se={}));var M;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(M||(M={}));var Ie;(function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"})(Ie||(Ie={}));var qt="-",xe="AMP",jt="".concat(xe,"_unsent"),Gt="https://api2.amplitude.com/2/httpapi",Xr="https://api.eu.amplitude.com/2/httpapi",Zr="https://api2.amplitude.com/batch",Jr="https://api.eu.amplitude.com/batch";var wi=1e3,vt=function(t){if(Object.keys(t).length>wi)return!1;for(var e in t){var r=t[e];if(!Kt(e,r))return!1}return!0},Kt=function(t,e){var r,n;if(typeof t!="string")return!1;if(Array.isArray(e)){var i=!0;try{for(var o=J(e),s=o.next();!s.done;s=o.next()){var u=s.value;if(Array.isArray(u))return!1;if(typeof u=="object")i=i&&vt(u);else if(!["number","string"].includes(typeof u))return!1;if(!i)return!1}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(e==null)return!1;if(typeof e=="object")return vt(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0};var ne=(function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return E({},this._properties)},t.prototype.set=function(e,r){return this._safeSet(B.SET,e,r),this},t.prototype.setOnce=function(e,r){return this._safeSet(B.SET_ONCE,e,r),this},t.prototype.append=function(e,r){return this._safeSet(B.APPEND,e,r),this},t.prototype.prepend=function(e,r){return this._safeSet(B.PREPEND,e,r),this},t.prototype.postInsert=function(e,r){return this._safeSet(B.POSTINSERT,e,r),this},t.prototype.preInsert=function(e,r){return this._safeSet(B.PREINSERT,e,r),this},t.prototype.remove=function(e,r){return this._safeSet(B.REMOVE,e,r),this},t.prototype.add=function(e,r){return this._safeSet(B.ADD,e,r),this},t.prototype.unset=function(e){return this._safeSet(B.UNSET,e,qt),this},t.prototype.clearAll=function(){return this._properties={},this._properties[B.CLEAR_ALL]=qt,this},t.prototype._safeSet=function(e,r,n){if(this._validate(e,r,n)){var i=this._properties[e];return i===void 0&&(i={},this._properties[e]=i),i[r]=n,this._propertySet.add(r),!0}return!1},t.prototype._validate=function(e,r,n){return this._properties[B.CLEAR_ALL]!==void 0||this._propertySet.has(r)?!1:e===B.ADD?typeof n=="number":e!==B.UNSET&&e!==B.REMOVE?Kt(r,n):!0},t})();var en=function(t,e,r){var n=typeof t=="string"?{event_type:t}:t;return E(E(E({},n),r),e&&{event_properties:e})},Ke=function(t,e){var r=E(E({},e),{event_type:de.IDENTIFY,user_properties:t.getUserProperties()});return r},tn=function(t,e,r,n){var i,o=E(E({},n),{event_type:de.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(i={},i[t]=e,i)});return o},rn=function(t,e,r){var n,i=new ne;i.set(t,e);var o=E(E({},r),{event_type:de.IDENTIFY,user_properties:i.getUserProperties(),groups:(n={},n[t]=e,n)});return o},nn=function(t,e){return E(E({},e),{event_type:de.REVENUE,event_properties:t.getEventProperties()})};var ve=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=M.Unknown),{event:t,code:e,message:r}};var on=(function(){function t(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return t.prototype.register=function(e,r){return g(this,void 0,void 0,function(){return h(this,function(n){switch(n.label){case 0:return[4,e.setup(r,this.client)];case 1:return n.sent(),this.plugins.push(e),[2]}})})},t.prototype.deregister=function(e,r){var n;return g(this,void 0,void 0,function(){var i,o;return h(this,function(s){switch(s.label){case 0:return i=this.plugins.findIndex(function(u){return u.name===e}),i===-1?(r.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(o=this.plugins[i],this.plugins.splice(i,1),[4,(n=o.teardown)===null||n===void 0?void 0:n.call(o)]);case 1:return s.sent(),[2]}})})},t.prototype.reset=function(e){this.applying=!1;var r=this.plugins;r.map(function(n){var i;return(i=n.teardown)===null||i===void 0?void 0:i.call(n)}),this.plugins=[],this.client=e},t.prototype.push=function(e){var r=this;return new Promise(function(n){r.queue.push([e,n]),r.scheduleApply(0)})},t.prototype.scheduleApply=function(e){var r=this;this.applying||(this.applying=!0,setTimeout(function(){r.apply(r.queue.shift()).then(function(){r.applying=!1,r.queue.length>0&&r.scheduleApply(0)})},e))},t.prototype.apply=function(e){return g(this,void 0,void 0,function(){var r,n,i,o,s,u,d,f,m,p,a,c,l,f,m,_,b,v,y,T,L,k;return h(this,function(w){switch(w.label){case 0:if(!e)return[2];r=A(e,1),n=r[0],i=A(e,2),o=i[1],s=this.plugins.filter(function(C){return C.type===N.BEFORE}),w.label=1;case 1:w.trys.push([1,6,7,8]),u=J(s),d=u.next(),w.label=2;case 2:return d.done?[3,5]:(f=d.value,[4,f.execute(E({},n))]);case 3:if(m=w.sent(),m===null)return o({event:n,code:0,message:""}),[2];n=m,w.label=4;case 4:return d=u.next(),[3,2];case 5:return[3,8];case 6:return p=w.sent(),y={error:p},[3,8];case 7:try{d&&!d.done&&(T=u.return)&&T.call(u)}finally{if(y)throw y.error}return[7];case 8:a=this.plugins.filter(function(C){return C.type===N.ENRICHMENT}),w.label=9;case 9:w.trys.push([9,14,15,16]),c=J(a),l=c.next(),w.label=10;case 10:return l.done?[3,13]:(f=l.value,[4,f.execute(E({},n))]);case 11:if(m=w.sent(),m===null)return o({event:n,code:0,message:""}),[2];n=m,w.label=12;case 12:return l=c.next(),[3,10];case 13:return[3,16];case 14:return _=w.sent(),L={error:_},[3,16];case 15:try{l&&!l.done&&(k=c.return)&&k.call(c)}finally{if(L)throw L.error}return[7];case 16:return b=this.plugins.filter(function(C){return C.type===N.DESTINATION}),v=b.map(function(C){var R=E({},n);return C.execute(R).catch(function(K){return ve(R,0,String(K))})}),Promise.all(v).then(function(C){var R=A(C,1),K=R[0];o(K)}),[2]}})})},t.prototype.flush=function(){return g(this,void 0,void 0,function(){var e,r,n,i=this;return h(this,function(o){switch(o.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(s){return i.apply(s)}))];case 1:return o.sent(),r=this.plugins.filter(function(s){return s.type===N.DESTINATION}),n=r.map(function(s){return s.flush&&s.flush()}),[4,Promise.all(n)];case 2:return o.sent(),[2]}})})},t})();var sn="Event tracked successfully",an="Unexpected error occurred",un="Event rejected due to exceeded retry count",cn="Event skipped due to optOut config",ln="Event rejected due to missing API key",dn="Invalid API key",pn="Client not initialized";var X=function(t){return{promise:t||Promise.resolve()}};var Wt=(function(){function t(e){e===void 0&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new on(this),this.name=e}return t.prototype._init=function(e){return g(this,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return this.config=e,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return r.sent(),[2]}})})},t.prototype.runQueuedFunctions=function(e){return g(this,void 0,void 0,function(){var r,n,i,o,s,u,d;return h(this,function(p){switch(p.label){case 0:r=this[e],this[e]=[],p.label=1;case 1:p.trys.push([1,6,7,8]),n=J(r),i=n.next(),p.label=2;case 2:return i.done?[3,5]:(o=i.value,[4,o()]);case 3:p.sent(),p.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return s=p.sent(),u={error:s},[3,8];case 7:try{i&&!i.done&&(d=n.return)&&d.call(n)}finally{if(u)throw u.error}return[7];case 8:return[2]}})})},t.prototype.track=function(e,r,n){var i=en(e,r,n);return X(this.dispatch(i))},t.prototype.identify=function(e,r){var n=Ke(e,r);return X(this.dispatch(n))},t.prototype.groupIdentify=function(e,r,n,i){var o=tn(e,r,n,i);return X(this.dispatch(o))},t.prototype.setGroup=function(e,r,n){var i=rn(e,r,n);return X(this.dispatch(i))},t.prototype.revenue=function(e,r){var n=nn(e,r);return X(this.dispatch(n))},t.prototype.add=function(e){return this.config?X(this.timeline.register(e,this.config)):(this.q.push(this.add.bind(this,e)),X())},t.prototype.remove=function(e){return this.config?X(this.timeline.deregister(e,this.config)):(this.q.push(this.remove.bind(this,e)),X())},t.prototype.dispatchWithCallback=function(e,r){if(!this.config)return r(ve(e,0,pn));this.process(e).then(r)},t.prototype.dispatch=function(e){return g(this,void 0,void 0,function(){var r=this;return h(this,function(n){return this.config?[2,this.process(e)]:[2,new Promise(function(i){r.dispatchQ.push(r.dispatchWithCallback.bind(r,e,i))})]})})},t.prototype.process=function(e){return g(this,void 0,void 0,function(){var i,r,n,i;return h(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,ve(e,0,cn)]:[4,this.timeline.push(e)];case 1:return i=o.sent(),i.code===200?this.config.loggerProvider.log(i.message):this.config.loggerProvider.error(i.message),[2,i];case 2:return r=o.sent(),this.config.loggerProvider.error(r),n=String(r),i=ve(e,0,n),[2,i];case 3:return[2]}})})},t.prototype.setOptOut=function(e){if(!this.config){this.q.push(this.setOptOut.bind(this,!!e));return}this.config.optOut=!!e},t.prototype.flush=function(){return X(this.timeline.flush())},t})();var gt=(function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(e){return this.productId=e,this},t.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},t.prototype.setPrice=function(e){return this.price=e,this},t.prototype.setRevenueType=function(e){return this.revenueType=e,this},t.prototype.setCurrency=function(e){return this.currency=e,this},t.prototype.setRevenue=function(e){return this.revenue=e,this},t.prototype.setEventProperties=function(e){return vt(e)&&(this.properties=e),this},t.prototype.getEventProperties=function(){var e=this.properties?E({},this.properties):{};return e[re.REVENUE_PRODUCT_ID]=this.productId,e[re.REVENUE_QUANTITY]=this.quantity,e[re.REVENUE_PRICE]=this.price,e[re.REVENUE_TYPE]=this.revenueType,e[re.REVENUE_CURRENCY]=this.currency,e[re.REVENUE]=this.revenue,e},t})();var fn=function(t,e){var r=Math.max(e,1);return t.reduce(function(n,i,o){var s=Math.floor(o/r);return n[s]||(n[s]=[]),n[s].push(i),n},[])};var ht="Amplitude Logger ",mn=(function(){function t(){this.logLevel=Y.None}return t.prototype.disable=function(){this.logLevel=Y.None},t.prototype.enable=function(e){e===void 0&&(e=Y.Warn),this.logLevel=e},t.prototype.log=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Verbose||console.log("".concat(ht,"[Log]: ").concat(e.join(" ")))},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Warn||console.warn("".concat(ht,"[Warn]: ").concat(e.join(" ")))},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Error||console.error("".concat(ht,"[Error]: ").concat(e.join(" ")))},t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Debug||console.log("".concat(ht,"[Debug]: ").concat(e.join(" ")))},t})();var yt=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:Y.Warn,loggerProvider:new mn,optOut:!1,serverUrl:Gt,serverZone:Se.US,useBatch:!1}},$t=(function(){function t(e){var r,n,i,o;this._optOut=!1;var s=yt();this.apiKey=e.apiKey,this.flushIntervalMillis=(r=e.flushIntervalMillis)!==null&&r!==void 0?r:s.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||s.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||s.flushQueueSize,this.instanceName=e.instanceName||s.instanceName,this.loggerProvider=e.loggerProvider||s.loggerProvider,this.logLevel=(n=e.logLevel)!==null&&n!==void 0?n:s.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=(i=e.optOut)!==null&&i!==void 0?i:s.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||s.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=(o=e.useBatch)!==null&&o!==void 0?o:s.useBatch,this.loggerProvider.enable(this.logLevel);var u=Yt(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=u.serverZone,this.serverUrl=u.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),t})();var Si=function(t,e){return t===Se.EU?e?Jr:Xr:e?Zr:Gt},Yt=function(t,e,r){if(t===void 0&&(t=""),e===void 0&&(e=yt().serverZone),r===void 0&&(r=yt().useBatch),t)return{serverUrl:t,serverZone:void 0};var n=["US","EU"].includes(e)?e:yt().serverZone;return{serverZone:n,serverUrl:Si(n,r)}};function Ii(t){return t instanceof Error?t.message:String(t)}function bt(t){var e="";try{"body"in t&&(e=JSON.stringify(t.body))}catch{}return e}var zt=(function(){function t(){this.name="amplitude",this.type=N.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return t.prototype.setup=function(e){var r;return g(this,void 0,void 0,function(){var n,i=this;return h(this,function(o){switch(o.label){case 0:return this.config=e,this.storageKey="".concat(jt,"_").concat(this.config.apiKey.substring(0,10)),[4,(r=this.config.storageProvider)===null||r===void 0?void 0:r.get(this.storageKey)];case 1:return n=o.sent(),this.saveEvents(),n&&n.length>0&&Promise.all(n.map(function(s){return i.execute(s)})).catch(),[2,Promise.resolve(void 0)]}})})},t.prototype.execute=function(e){var r=this;return new Promise(function(n){var i={event:e,attempts:0,callback:function(o){return n(o)},timeout:0};r.addToQueue(i)})},t.prototype.addToQueue=function(){for(var e=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r.filter(function(o){return o.attempts<e.config.flushMaxRetries?(o.attempts+=1,!0):(e.fulfillRequest([o],500,un),!1)});i.forEach(function(o){if(e.queue=e.queue.concat(o),o.timeout===0){e.schedule(e.config.flushIntervalMillis);return}setTimeout(function(){o.timeout=0,e.schedule(0)},o.timeout)}),this.saveEvents()},t.prototype.schedule=function(e){var r=this;this.scheduled||(this.scheduled=setTimeout(function(){r.flush(!0).then(function(){r.queue.length>0&&r.schedule(e)})},e))},t.prototype.flush=function(e){return e===void 0&&(e=!1),g(this,void 0,void 0,function(){var r,n,i,o=this;return h(this,function(s){switch(s.label){case 0:return r=[],n=[],this.queue.forEach(function(u){return u.timeout===0?r.push(u):n.push(u)}),this.queue=n,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),i=fn(r,this.config.flushQueueSize),[4,Promise.all(i.map(function(u){return o.send(u,e)}))];case 1:return s.sent(),[2]}})})},t.prototype.send=function(e,r){return r===void 0&&(r=!0),g(this,void 0,void 0,function(){var n,i,o,s,u;return h(this,function(d){switch(d.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,ln)];n={api_key:this.config.apiKey,events:e.map(function(p){var a=p.event,c=a.extra,l=Ge(a,["extra"]);return l}),options:{min_id_length:this.config.minIdLength}},d.label=1;case 1:return d.trys.push([1,3,,4]),i=Yt(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,n)];case 2:return o=d.sent(),o===null?(this.fulfillRequest(e,0,an),[2]):r?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(bt(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return s=d.sent(),this.config.loggerProvider.error(s),u=Ii(s),this.fulfillRequest(e,0,u),[3,4];case 4:return[2]}})})},t.prototype.handleResponse=function(e,r){var n=e.status;switch(n){case M.Success:{this.handleSuccessResponse(e,r);break}case M.Invalid:{this.handleInvalidResponse(e,r);break}case M.PayloadTooLarge:{this.handlePayloadTooLargeResponse(e,r);break}case M.RateLimit:{this.handleRateLimitResponse(e,r);break}default:{this.config.loggerProvider.warn(\`{code: 0, error: "Status '\`.concat(n,"' provided for ").concat(r.length,' events"}')),this.handleOtherResponse(r);break}}},t.prototype.handleSuccessResponse=function(e,r){this.fulfillRequest(r,e.statusCode,sn)},t.prototype.handleInvalidResponse=function(e,r){var n=this;if(e.body.missingField||e.body.error.startsWith(dn)){this.fulfillRequest(r,e.statusCode,e.body.error);return}var i=ee(ee(ee(ee([],A(Object.values(e.body.eventsWithInvalidFields)),!1),A(Object.values(e.body.eventsWithMissingFields)),!1),A(Object.values(e.body.eventsWithInvalidIdLengths)),!1),A(e.body.silencedEvents),!1).flat(),o=new Set(i),s=r.filter(function(u,d){if(o.has(d)){n.fulfillRequest([u],e.statusCode,e.body.error);return}return!0});s.length>0&&this.config.loggerProvider.warn(bt(e)),this.addToQueue.apply(this,ee([],A(s),!1))},t.prototype.handlePayloadTooLargeResponse=function(e,r){if(r.length===1){this.fulfillRequest(r,e.statusCode,e.body.error);return}this.config.loggerProvider.warn(bt(e)),this.config.flushQueueSize/=2,this.addToQueue.apply(this,ee([],A(r),!1))},t.prototype.handleRateLimitResponse=function(e,r){var n=this,i=Object.keys(e.body.exceededDailyQuotaUsers),o=Object.keys(e.body.exceededDailyQuotaDevices),s=e.body.throttledEvents,u=new Set(i),d=new Set(o),p=new Set(s),a=r.filter(function(c,l){if(c.event.user_id&&u.has(c.event.user_id)||c.event.device_id&&d.has(c.event.device_id)){n.fulfillRequest([c],e.statusCode,e.body.error);return}return p.has(l)&&(c.timeout=n.throttleTimeout),!0});a.length>0&&this.config.loggerProvider.warn(bt(e)),this.addToQueue.apply(this,ee([],A(a),!1))},t.prototype.handleOtherResponse=function(e){var r=this;this.addToQueue.apply(this,ee([],A(e.map(function(n){return n.timeout=n.attempts*r.retryTimeout,n})),!1))},t.prototype.fulfillRequest=function(e,r,n){this.saveEvents(),e.forEach(function(i){return i.callback(ve(i.event,r,n))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map(function(r){return r.event}));this.config.storageProvider.set(this.storageKey,e)}},t})();var xi=function(t){t===void 0&&(t=0);var e=new Error().stack||"";return e.split(\`
46
+ `),e.restartAppServer()},10),e.enableAppWatch(!t),{enabled:t,platform:e.platform()}}async function fg(e){return gg(e,`"use strict";(()=>{var fi=Object.create;var Mt=Object.defineProperty;var mi=Object.getOwnPropertyDescriptor;var vi=Object.getOwnPropertyNames;var gi=Object.getPrototypeOf,hi=Object.prototype.hasOwnProperty;var yi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),bi=(t,e)=>{for(var r in e)Mt(t,r,{get:e[r],enumerable:!0})},Ei=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vi(e))!hi.call(t,i)&&i!==r&&Mt(t,i,{get:()=>e[i],enumerable:!(n=mi(e,i))||n.enumerable});return t};var _i=(t,e,r)=>(r=t!=null?fi(gi(t)):{},Ei(e||!t||!t.__esModule?Mt(r,"default",{value:t,enumerable:!0}):r,t));var jn=yi((Qe,Ct)=>{(function(t,e){"use strict";var r="0.7.33",n="",i="?",o="function",s="undefined",u="object",d="string",p="major",a="model",c="name",l="type",f="vendor",m="version",_="architecture",b="console",v="mobile",y="tablet",T="smarttv",L="wearable",k="embedded",w=350,C="Amazon",R="Apple",K="ASUS",z="BlackBerry",Q="Browser",P="Chrome",Ce="Edge",ce="Firefox",_e="Google",Me="Huawei",Re="LG",Oe="Microsoft",Be="Motorola",Te="Opera",we="Samsung",ke="Sharp",fe="Sony",me="Xiaomi",Ve="Zebra",U="Facebook",et=function(S,O){var I={};for(var q in S)O[q]&&O[q].length%2===0?I[q]=O[q].concat(S[q]):I[q]=S[q];return I},tt=function(S){for(var O={},I=0;I<S.length;I++)O[S[I].toUpperCase()]=S[I];return O},Pr=function(S,O){return typeof S===d?Fe(O).indexOf(Fe(S))!==-1:!1},Fe=function(S){return S.toLowerCase()},di=function(S){return typeof S===d?S.replace(/[^\\d\\.]/g,n).split(".")[0]:e},Nt=function(S,O){if(typeof S===d)return S=S.replace(/^\\s\\s*/,n),typeof O===s?S:S.substring(0,w)},He=function(S,O){for(var I=0,q,x,nt,D,qe,ie;I<O.length&&!qe;){var Or=O[I],kr=O[I+1];for(q=x=0;q<Or.length&&!qe;)if(qe=Or[q++].exec(S),qe)for(nt=0;nt<kr.length;nt++)ie=qe[++x],D=kr[nt],typeof D===u&&D.length>0?D.length===2?typeof D[1]==o?this[D[0]]=D[1].call(this,ie):this[D[0]]=D[1]:D.length===3?typeof D[1]===o&&!(D[1].exec&&D[1].test)?this[D[0]]=ie?D[1].call(this,ie,D[2]):e:this[D[0]]=ie?ie.replace(D[1],D[2]):e:D.length===4&&(this[D[0]]=ie?D[3].call(this,ie.replace(D[1],D[2])):e):this[D]=ie||e;I+=2}},Ut=function(S,O){for(var I in O)if(typeof O[I]===u&&O[I].length>0){for(var q=0;q<O[I].length;q++)if(Pr(O[I][q],S))return I===i?e:I}else if(Pr(O[I],S))return I===i?e:I;return S},pi={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Cr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Rr={browser:[[/\\b(?:crmo|crios)\\/([\\w\\.]+)/i],[m,[c,"Chrome"]],[/edg(?:e|ios|a)?\\/([\\w\\.]+)/i],[m,[c,"Edge"]],[/(opera mini)\\/([-\\w\\.]+)/i,/(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,/(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i],[c,m],[/opios[\\/ ]+([\\w\\.]+)/i],[m,[c,Te+" Mini"]],[/\\bopr\\/([\\w\\.]+)/i],[m,[c,Te]],[/(kindle)\\/([\\w\\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i,/(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i,/(?:ms|\\()(ie) ([\\w\\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,/(weibo)__([\\d\\.]+)/i],[c,m],[/(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i],[m,[c,"UC"+Q]],[/microm.+\\bqbcore\\/([\\w\\.]+)/i,/\\bqbcore\\/([\\w\\.]+).+microm/i],[m,[c,"WeChat(Win) Desktop"]],[/micromessenger\\/([\\w\\.]+)/i],[m,[c,"WeChat"]],[/konqueror\\/([\\w\\.]+)/i],[m,[c,"Konqueror"]],[/trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i],[m,[c,"IE"]],[/yabrowser\\/([\\w\\.]+)/i],[m,[c,"Yandex"]],[/(avast|avg)\\/([\\w\\.]+)/i],[[c,/(.+)/,"$1 Secure "+Q],m],[/\\bfocus\\/([\\w\\.]+)/i],[m,[c,ce+" Focus"]],[/\\bopt\\/([\\w\\.]+)/i],[m,[c,Te+" Touch"]],[/coc_coc\\w+\\/([\\w\\.]+)/i],[m,[c,"Coc Coc"]],[/dolfin\\/([\\w\\.]+)/i],[m,[c,"Dolphin"]],[/coast\\/([\\w\\.]+)/i],[m,[c,Te+" Coast"]],[/miuibrowser\\/([\\w\\.]+)/i],[m,[c,"MIUI "+Q]],[/fxios\\/([-\\w\\.]+)/i],[m,[c,ce]],[/\\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+Q]],[/(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i],[[c,/(.+)/,"$1 "+Q],m],[/(comodo_dragon)\\/([\\w\\.]+)/i],[[c,/_/g," "],m],[/(electron)\\/([\\w\\.]+) safari/i,/(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i],[c,m],[/(metasr)[\\/ ]?([\\w\\.]+)/i,/(lbbrowser)/i,/\\[(linkedin)app\\]/i],[c],[/((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i],[[c,U],m],[/safari (line)\\/([\\w\\.]+)/i,/\\b(line)\\/([\\w\\.]+)\\/iab/i,/(chromium|instagram)[\\/ ]([-\\w\\.]+)/i],[c,m],[/\\bgsa\\/([\\w\\.]+) .*safari\\//i],[m,[c,"GSA"]],[/headlesschrome(?:\\/([\\w\\.]+)| )/i],[m,[c,P+" Headless"]],[/ wv\\).+(chrome)\\/([\\w\\.]+)/i],[[c,P+" WebView"],m],[/droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i],[m,[c,"Android "+Q]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i],[c,m],[/version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i],[m,[c,"Mobile Safari"]],[/version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i],[m,c],[/webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i],[c,[m,Ut,pi]],[/(webkit|khtml)\\/([\\w\\.]+)/i],[c,m],[/(navigator|netscape\\d?)\\/([-\\w\\.]+)/i],[[c,"Netscape"],m],[/mobile vr; rv:([\\w\\.]+)\\).+firefox/i],[m,[c,ce+" Reality"]],[/ekiohf.+(flow)\\/([\\w\\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,/(firefox)\\/([\\w\\.]+)/i,/(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,/(links) \\(([\\w\\.]+)/i],[c,m],[/(cobalt)\\/([\\w\\.]+)/i],[c,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i],[[_,"amd64"]],[/(ia32(?=;))/i],[[_,Fe]],[/((?:i[346]|x)86)[;\\)]/i],[[_,"ia32"]],[/\\b(aarch64|arm(v?8e?l?|_?64))\\b/i],[[_,"arm64"]],[/\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i],[[_,"armhf"]],[/windows (ce|mobile); ppc;/i],[[_,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i],[[_,/ower/,n,Fe]],[/(sun4\\w)[;\\)]/i],[[_,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i],[[_,Fe]]],device:[[/\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i],[a,[f,we],[l,y]],[/\\b((?:s[cgp]h|gt|sm)-\\w+|galaxy nexus)/i,/samsung[- ]([-\\w]+)/i,/sec-(sgh\\w+)/i],[a,[f,we],[l,v]],[/((ipod|iphone)\\d+,\\d+)/i],[a,[f,R],[l,v]],[/(ipad\\d+,\\d+)/i],[a,[f,R],[l,y]],[/\\((ip(?:hone|od)[\\w ]*);/i],[a,[f,R],[l,v]],[/\\((ipad);[-\\w\\),; ]+apple/i,/applecoremedia\\/[\\w\\.]+ \\((ipad)/i,/\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i],[a,[f,R],[l,y]],[/(macintosh);/i],[a,[f,R]],[/\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i],[a,[f,Me],[l,y]],[/(?:huawei|honor)([-\\w ]+)[;\\)]/i,/\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i],[a,[f,Me],[l,v]],[/\\b(poco[\\w ]+)(?: bui|\\))/i,/\\b; (\\w+) build\\/hm\\1/i,/\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i,/\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i,/\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i],[[a,/_/g," "],[f,me],[l,v]],[/\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i],[[a,/_/g," "],[f,me],[l,y]],[/; (\\w+) bui.+ oppo/i,/\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i],[a,[f,"OPPO"],[l,v]],[/vivo (\\w+)(?: bui|\\))/i,/\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i],[a,[f,"Vivo"],[l,v]],[/\\b(rmx[12]\\d{3})(?: bui|;|\\))/i],[a,[f,"Realme"],[l,v]],[/\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,/\\bmot(?:orola)?[- ](\\w*)/i,/((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i],[a,[f,Be],[l,v]],[/\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i],[a,[f,Be],[l,y]],[/((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i],[a,[f,Re],[l,y]],[/(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,/\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,/\\blg-?([\\d\\w]+) bui/i],[a,[f,Re],[l,v]],[/(ideatab[-\\w ]+)/i,/lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i],[a,[f,"Lenovo"],[l,y]],[/(?:maemo|nokia).*(n900|lumia \\d+)/i,/nokia[-_ ]?([-\\w\\.]*)/i],[[a,/_/g," "],[f,"Nokia"],[l,v]],[/(pixel c)\\b/i],[a,[f,_e],[l,y]],[/droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i],[a,[f,_e],[l,v]],[/droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i],[a,[f,fe],[l,v]],[/sony tablet [ps]/i,/\\b(?:sony)?sgp\\w+(?: bui|\\))/i],[[a,"Xperia Tablet"],[f,fe],[l,y]],[/ (kb2005|in20[12]5|be20[12][59])\\b/i,/(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i],[a,[f,"OnePlus"],[l,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\\))/i,/(kf[a-z]+)( bui|\\)).+silk\\//i],[a,[f,C],[l,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i],[[a,/(.+)/g,"Fire Phone $1"],[f,C],[l,v]],[/(playbook);[-\\w\\),; ]+(rim)/i],[a,f,[l,y]],[/\\b((?:bb[a-f]|st[hv])100-\\d)/i,/\\(bb10; (\\w+)/i],[a,[f,z],[l,v]],[/(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i],[a,[f,K],[l,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i],[a,[f,K],[l,v]],[/(nexus 9)/i],[a,[f,"HTC"],[l,y]],[/(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,/(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\\w]*)/i],[f,[a,/_/g," "],[l,v]],[/droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i],[a,[f,"Acer"],[l,y]],[/droid.+; (m[1-5] note) bui/i,/\\bmz-([-\\w]{2,})/i],[a,[f,"Meizu"],[l,v]],[/\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i],[a,[f,ke],[l,v]],[/(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,/(hp) ([\\w ]+\\w)/i,/(asus)-?(\\w+)/i,/(microsoft); (lumia[\\w ]+)/i,/(lenovo)[-_ ]?([-\\w]+)/i,/(jolla)/i,/(oppo) ?([\\w ]+) bui/i],[f,a,[l,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\\/([\\w\\.]+)/i,/(nook)[\\w ]+build\\/(\\w+)/i,/(dell) (strea[kpr\\d ]*[\\dko])/i,/(le[- ]+pan)[- ]+(\\w{1,9}) bui/i,/(trinity)[- ]*(t\\d{3}) bui/i,/(gigaset)[- ]+(q\\w{1,9}) bui/i,/(vodafone) ([\\w ]+)(?:\\)| bui)/i],[f,a,[l,y]],[/(surface duo)/i],[a,[f,Oe],[l,y]],[/droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i],[a,[f,"Fairphone"],[l,v]],[/(u304aa)/i],[a,[f,"AT&T"],[l,v]],[/\\bsie-(\\w*)/i],[a,[f,"Siemens"],[l,v]],[/\\b(rct\\w+) b/i],[a,[f,"RCA"],[l,y]],[/\\b(venue[\\d ]{2,7}) b/i],[a,[f,"Dell"],[l,y]],[/\\b(q(?:mv|ta)\\w+) b/i],[a,[f,"Verizon"],[l,y]],[/\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i],[a,[f,"Barnes & Noble"],[l,y]],[/\\b(tm\\d{3}\\w+) b/i],[a,[f,"NuVision"],[l,y]],[/\\b(k88) b/i],[a,[f,"ZTE"],[l,y]],[/\\b(nx\\d{3}j) b/i],[a,[f,"ZTE"],[l,v]],[/\\b(gen\\d{3}) b.+49h/i],[a,[f,"Swiss"],[l,v]],[/\\b(zur\\d{3}) b/i],[a,[f,"Swiss"],[l,y]],[/\\b((zeki)?tb.*\\b) b/i],[a,[f,"Zeki"],[l,y]],[/\\b([yr]\\d{2}) b/i,/\\b(dragon[- ]+touch |dt)(\\w{5}) b/i],[[f,"Dragon Touch"],a,[l,y]],[/\\b(ns-?\\w{0,9}) b/i],[a,[f,"Insignia"],[l,y]],[/\\b((nxa|next)-?\\w{0,9}) b/i],[a,[f,"NextBook"],[l,y]],[/\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],a,[l,v]],[/\\b(lvtel\\-)?(v1[12]) b/i],[[f,"LvTel"],a,[l,v]],[/\\b(ph-1) /i],[a,[f,"Essential"],[l,v]],[/\\b(v(100md|700na|7011|917g).*\\b) b/i],[a,[f,"Envizen"],[l,y]],[/\\b(trio[-\\w\\. ]+) b/i],[a,[f,"MachSpeed"],[l,y]],[/\\btu_(1491) b/i],[a,[f,"Rotor"],[l,y]],[/(shield[\\w ]+) b/i],[a,[f,"Nvidia"],[l,y]],[/(sprint) (\\w+)/i],[f,a,[l,v]],[/(kin\\.[onetw]{3})/i],[[a,/\\./g," "],[f,Oe],[l,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i],[a,[f,Ve],[l,y]],[/droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i],[a,[f,Ve],[l,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,a,[l,b]],[/droid.+; (shield) bui/i],[a,[f,"Nvidia"],[l,b]],[/(playstation [345portablevi]+)/i],[a,[f,fe],[l,b]],[/\\b(xbox(?: one)?(?!; xbox))[\\); ]/i],[a,[f,Oe],[l,b]],[/smart-tv.+(samsung)/i],[f,[l,T]],[/hbbtv.+maple;(\\d+)/i],[[a,/^/,"SmartTV"],[f,we],[l,T]],[/(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i],[[f,Re],[l,T]],[/(apple) ?tv/i],[f,[a,R+" TV"],[l,T]],[/crkey/i],[[a,P+"cast"],[f,_e],[l,T]],[/droid.+aft(\\w)( bui|\\))/i],[a,[f,C],[l,T]],[/\\(dtv[\\);].+(aquos)/i,/(aquos-tv[\\w ]+)\\)/i],[a,[f,ke],[l,T]],[/(bravia[\\w ]+)( bui|\\))/i],[a,[f,fe],[l,T]],[/(mitv-\\w{5}) bui/i],[a,[f,me],[l,T]],[/\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,/hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w ]*; *(\\w[^;]*);([^;]*)/i],[[f,Nt],[a,Nt],[l,T]],[/\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i],[[l,T]],[/((pebble))app/i],[f,a,[l,L]],[/droid.+; (glass) \\d/i],[a,[f,_e],[l,L]],[/droid.+; (wt63?0{2,3})\\)/i],[a,[f,Ve],[l,L]],[/(quest( 2)?)/i],[a,[f,U],[l,L]],[/(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i],[f,[l,k]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i],[a,[l,v]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i],[a,[l,y]],[/\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i],[[l,y]],[/(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i],[[l,v]],[/(android[-\\w\\. ]{0,9});.+buil/i],[a,[f,"Generic"]]],engine:[[/windows.+ edge\\/([\\w\\.]+)/i],[m,[c,Ce+"HTML"]],[/webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i],[m,[c,"Blink"]],[/(presto)\\/([\\w\\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i,/ekioh(flow)\\/([\\w\\.]+)/i,/(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i,/(icab)[\\/ ]([23]\\.[\\d\\.]+)/i],[c,m],[/rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i],[m,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,m],[/(windows) nt 6\\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,/(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i],[c,[m,Ut,Cr]],[/(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i],[[c,"Windows"],[m,Ut,Cr]],[/ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,/cfnetwork\\/.+darwin/i],[[m,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\\w\\. ]*)/i,/(macintosh|mac_powerpc\\b)(?!.+haiku)/i],[[c,"Mac OS"],[m,/_/g,"."]],[/droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i],[m,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,/(blackberry)\\w*\\/([\\w\\.]*)/i,/(tizen|kaios)[\\/ ]([\\w\\.]+)/i,/\\((series40);/i],[c,m],[/\\(bb(10);/i],[m,[c,z]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i],[m,[c,"Symbian"]],[/mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i],[m,[c,ce+" OS"]],[/web0s;.+rt(tv)/i,/\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i],[m,[c,"webOS"]],[/crkey\\/([\\d\\.]+)/i],[m,[c,P+"cast"]],[/(cros) [\\w]+ ([\\w\\.]+\\w)/i],[[c,"Chromium OS"],m],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\\);]+)/i,/\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i,/(mint)[\\/\\(\\) ]?(\\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,/(hurd|linux) ?([\\w\\.]*)/i,/(gnu) ?([\\w\\.]*)/i,/\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i,/(haiku) (\\w+)/i],[c,m],[/(sunos) ?([\\w\\.\\d]*)/i],[[c,"Solaris"],m],[/((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,/(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,/\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\\w\\.]*)/i],[c,m]]},Z=function(S,O){if(typeof S===u&&(O=S,S=e),!(this instanceof Z))return new Z(S,O).getResult();var I=S||(typeof t!==s&&t.navigator&&t.navigator.userAgent?t.navigator.userAgent:n),q=O?et(Rr,O):Rr;return this.getBrowser=function(){var x={};return x[c]=e,x[m]=e,He.call(x,I,q.browser),x.major=di(x.version),x},this.getCPU=function(){var x={};return x[_]=e,He.call(x,I,q.cpu),x},this.getDevice=function(){var x={};return x[f]=e,x[a]=e,x[l]=e,He.call(x,I,q.device),x},this.getEngine=function(){var x={};return x[c]=e,x[m]=e,He.call(x,I,q.engine),x},this.getOS=function(){var x={};return x[c]=e,x[m]=e,He.call(x,I,q.os),x},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return I},this.setUA=function(x){return I=typeof x===d&&x.length>w?Nt(x,w):x,this},this.setUA(I),this};Z.VERSION=r,Z.BROWSER=tt([c,m,p]),Z.CPU=tt([_]),Z.DEVICE=tt([a,f,l,b,v,T,y,L,k]),Z.ENGINE=Z.OS=tt([c,m]),typeof Qe!==s?(typeof Ct!==s&&Ct.exports&&(Qe=Ct.exports=Z),Qe.UAParser=Z):typeof define===o&&define.amd?define(function(){return Z}):typeof t!==s&&(t.UAParser=Z);var Ae=typeof t!==s&&(t.jQuery||t.Zepto);if(Ae&&!Ae.ua){var rt=new Z;Ae.ua=rt.getResult(),Ae.ua.get=function(){return rt.getUA()},Ae.ua.set=function(S){rt.setUA(S);var O=rt.getResult();for(var I in O)Ae.ua[I]=O[I]}}})(typeof window=="object"?window:Qe)});var oe=(t,e)=>{Vt(t);let r=t.querySelector("aside");r.dataset.view=e,r.classList.remove("section-ready"),setTimeout(()=>{r.classList.add("section-ready")},200)},Ar=t=>{Array.from(t.querySelectorAll(".back-button")).forEach(e=>{e.addEventListener("click",r=>{Vt(t),r.preventDefault(),r.stopPropagation();let n=r.target;oe(t,n?.dataset.back||"nav-home")})})},Bt=(t,e)=>{Vt(t);let r=t.querySelector("aside"),n=document.createElement("div");n.className="ui-toast",n.innerHTML=e,r.appendChild(n),setTimeout(()=>{n.classList.add("ui-toast-show"),setTimeout(()=>{n.classList.remove("ui-toast-show"),setTimeout(()=>{n.remove()},500)},4e3)},30)},Vt=t=>{let e=t.querySelector("aside");Array.from(e.querySelectorAll(".ui-toast")).forEach(n=>{n.classList.remove("ui-toast-show")})},it=()=>{let t=Dr();return localStorage.getItem(t)!=="true"},Ft=t=>{let e=Dr();t?localStorage.removeItem(e):localStorage.setItem(e,"true")},Dr=()=>Ti("disableEdit"),Ti=t=>\`builder.__LOCAL_APP_ID__.\${t}\`,Nr=()=>{let e=document.body.querySelector("[builder-content-id]")?.getAttribute("builder-content-id");return je(e)},je=(t,e)=>{let r="/content";t&&(r+="/"+t+"/edit");let n=new URL(r,"https://builder.io");t&&e&&n.searchParams.set("selectedBlock",e);let i=new URL(location.pathname,location.href);return n.searchParams.set("overridePreviewUrl",i.href),n.href},ot="__DEV_TOOLS_URL__",G={components:[],registryPath:"",registryDisplayPath:"",frameworks:[],dependencies:[],publicApiKey:void 0,devToolsVersion:""},le=t=>{G.components=t.components,G.registryPath=t.registryPath,G.registryDisplayPath=t.registryDisplayPath,G.dependencies=t.dependencies,G.publicApiKey=t.publicApiKey};function Ur(t){let e=null,r=document.querySelector("builder-dev-tools-menu"),n=()=>{t.hide()},i=u=>{let d=u.target;if(!d){n();return}if(d.closest("builder-dev-tools-edit"))return;let p=d.closest("[builder-content-id]"),a=d.closest("[builder-id]");if(!p||!a){t.hide();return}let c=t.show(p,a);!c||c===e||(r.highlightOpener(),e=c)};document.addEventListener("pointerover",i,{passive:!0}),document.addEventListener("pointerleave",n,{passive:!0}),document.addEventListener("pointercancel",n,{passive:!0}),document.addEventListener("visibilitychange",n,{passive:!0}),window.addEventListener("popstate",n,{passive:!0});let o=history.pushState;history.pushState=function(...u){t.hide(),o.apply(this,u)};let s=history.replaceState;history.replaceState=function(...u){t.hide(),s.apply(this,u)}}var st=class extends HTMLElement{openInBuilder=null;block=null;constructor(){super()}connectedCallback(){this.setAttribute("aria-hidden","true");let e=this.attachShadow({mode:"open"});e.innerHTML='<style>*,*:before,*:after{box-sizing:border-box}:host{--background-color: rgba(40, 40, 40, 1);--primary-color: rgba(72, 161, 255, 1);--primary-color-subdued: rgb(72, 161, 255, .6);--primary-color-highlight: rgb(126, 188, 255);--primary-contrast-color: white;--edit-color: #1d74e2;--edit-color-highlight: #1c6bd1;--edit-color-alpha: rgb(72, 161, 255, .15);--error-color: #ff2b55;--text-color: white;--text-color-highlight: white;--border-color: #454545;--button-background-color-hover: rgba(255, 255, 255, .1);--menu-width: 320px;--transition-time: .15s;--font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-family:var(--font-family);line-height:1.6}button{cursor:pointer;color:var(--text-color);-webkit-tap-highlight-color:transparent}input,select,button{font-family:var(--font-family)}:host{display:none;position:absolute;top:0;left:0;width:100%;height:100%;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}#content-highlight,#block{position:absolute}#content-highlight{border:3px solid var(--primary-color);background-color:var(--primary-color-alpha)}a{position:absolute;top:-33px;left:0;display:block;padding:5px 10px 8px;pointer-events:auto;z-index:100;text-decoration:none}a:hover{text-decoration:none}a span{display:block;padding:3px 6px;font-size:10px;font-weight:300;border-radius:3px;text-align:center;text-decoration:none;pointer-events:none;background-color:var(--edit-color);color:var(--text-color);white-space:nowrap}a:hover span{background-color:var(--edit-color-highlight)}a:hover~.outline{border-color:var(--edit-color-highlight)}#open-in-editor{display:none}.outline{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid var(--edit-color);background-color:var(--edit-color-alpha)}</style><div id="block"> <a id="open-in-builder" target="builder"><span>Open In Builder</span></a> <a id="open-in-editor" href="#open-in-editor"><span>Open In Editor</span></a> <div class="outline"></div> </div>',this.openInBuilder=e.getElementById("open-in-builder"),this.block=e.getElementById("block"),Ur(this)}show(e,r){if(!it())return this.hide(),null;let n=e.getAttribute("builder-content-id"),i=r.getAttribute("builder-id");if(!n||!i)return this.hide(),null;let o=this.block,s=this.openInBuilder,u=r.getBoundingClientRect();o.style.top=u.top+window.scrollY-1+"px",o.style.left=u.left+window.scrollX+"px",o.style.width=u.width+"px",o.style.height=u.height+1+"px";let d=s.getBoundingClientRect();if(d.width>u.width){let p=d.width-u.width;s.style.left=p/2*-1+"px"}else s.style.left="";return s.href=je(n,i),this.style.display="block",i}hide(){this.style.display=""}};var Mr="preview-url";var Br="_b-uid";var Vr="/~builder-connect";var Fr="/~builder-dev-tools";var Hr="https://cdn.builder.io/api/v1/proxy-api?url=https://api2.amplitude.com/2/httpapi";var qr=()=>se({type:"validateBuilder"}),De=t=>se({type:"launchEditor",data:t}),jr=t=>se({type:"getRegistry",data:t}),Gr=t=>se({type:"loadComponent",data:t}),Kr=t=>se({type:"registerComponent",data:t}),Wr=t=>se({type:"setComponentInfo",data:t}),at=t=>se({type:"setComponentInput",data:t}),$r=t=>se({type:"unregisterComponent",data:t}),Yr=t=>se({type:"enableDevTools",data:{enabled:t}}),zr=()=>se({type:"localConfig"}),se=async t=>{let e=new URL(Fr,ot),r;try{r=await fetch(e,{method:"POST",body:JSON.stringify(t)})}catch(i){throw console.error(\`Devtools Fetch Error, \${e.href}\`,i),new Error("Builder Devtools Fetch Error")}if((r.headers.get("content-type")||"").includes("application/json")){let i=await r.json();if(r.ok)return i.data;if(Array.isArray(i.errors)&&i.errors.length>0)throw i.errors.forEach(o=>console.error(o)),new Error(\`Builder Devtools Fetch Error: \${i.errors[0]}\`)}throw new Error(\`Builder Devtools Fetch Error: \${r.status}, \${await r.text()}\`)};var Qr=[{value:"boolean",text:"boolean"},{value:"color",text:"color (provides a color in hex or rgb)"},{value:"date",text:"date (same format as the Date constructor)"},{value:"email",text:"email"},{value:"file",text:"file (uploads a file and provides a url)"},{value:"list",text:"list (collection of items)"},{value:"longText",text:"longText (multiline text editor)"},{value:"number",text:"number"},{value:"object",text:"object (set of specific names and values)"},{value:"richText",text:"richText (provides value as html)"},{value:"string",text:"string"}],ut=["color","date","email","file","longText","richText","string"],ct=["number"],lt=["boolean"],dt=["list"],pt=["object"];function ft(t){return ut.includes(t)?"string":ct.includes(t)?"number":lt.includes(t)?"boolean":dt.includes(t)?"array":pt.includes(t)?"object":"string"}var Io=new Set(["about","accessKey","accessKeyLabel","asChild","autoCapitalize","autoCorrect","autoFocus","autoSave","blur","contentEditable","contextMenu","dangerouslySetInnerHTML","datatype","defaultChecked","defaultValue","dir","draggable","enterKeyHint","focus","form","formAction","formEncType","formMethod","formNoValidate","formTarget","inlist","innerText","inputMode","is","isContentEditable","itemID","itemProp","itemRef","itemScope","itemType","lang","nonce","offsetHeight","offsetLeft","offsetTop","offsetWidth","outerText","prefix","property","radioGroup","rel","resource","results","rev","role","security","slot","spellCheck","suppressContentEditableWarning","suppressHydrationWarning","tabIndex","translate","typeof","unselectable","vocab"].map(t=>t.toLowerCase()));var Ht=function(t,e){return Ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ht(t,e)};function ae(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ht(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var E=function(){return E=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},E.apply(this,arguments)};function Ge(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function g(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function u(a){try{p(n.next(a))}catch(c){s(c)}}function d(a){try{p(n.throw(a))}catch(c){s(c)}}function p(a){a.done?o(a.value):i(a.value).then(u,d)}p((n=n.apply(t,e||[])).next())})}function h(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(p){return function(a){return d([p,a])}}function d(p){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,p[0]&&(r=0)),r;)try{if(n=1,i&&(o=p[0]&2?i.return:p[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,p[1])).done)return o;switch(i=0,o&&(p=[p[0]&2,o.value]),p[0]){case 0:case 1:o=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,i=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!o||p[1]>o[0]&&p[1]<o[3])){r.label=p[1];break}if(p[0]===6&&r.label<o[1]){r.label=o[1],o=p;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(p);break}o[2]&&r.ops.pop(),r.trys.pop();continue}p=e.call(t,r)}catch(a){p=[6,a],i=0}finally{n=o=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function J(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function A(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function ee(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}var mt={};bi(mt,{IdentifyOperation:()=>B,LogLevel:()=>Y,PluginType:()=>N,RevenueProperty:()=>re,ServerZone:()=>Se,SpecialEventType:()=>de,Status:()=>M,TransportType:()=>Ie});var B;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(B||(B={}));var re;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE_CURRENCY="$currency",t.REVENUE="$revenue"})(re||(re={}));var de;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(de||(de={}));var Y;(function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"})(Y||(Y={}));var N;(function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"})(N||(N={}));var Se;(function(t){t.US="US",t.EU="EU",t.STAGING="STAGING"})(Se||(Se={}));var M;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(M||(M={}));var Ie;(function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"})(Ie||(Ie={}));var qt="-",xe="AMP",jt="".concat(xe,"_unsent"),Gt="https://api2.amplitude.com/2/httpapi",Xr="https://api.eu.amplitude.com/2/httpapi",Zr="https://api2.amplitude.com/batch",Jr="https://api.eu.amplitude.com/batch";var wi=1e3,vt=function(t){if(Object.keys(t).length>wi)return!1;for(var e in t){var r=t[e];if(!Kt(e,r))return!1}return!0},Kt=function(t,e){var r,n;if(typeof t!="string")return!1;if(Array.isArray(e)){var i=!0;try{for(var o=J(e),s=o.next();!s.done;s=o.next()){var u=s.value;if(Array.isArray(u))return!1;if(typeof u=="object")i=i&&vt(u);else if(!["number","string"].includes(typeof u))return!1;if(!i)return!1}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(e==null)return!1;if(typeof e=="object")return vt(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0};var ne=(function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return E({},this._properties)},t.prototype.set=function(e,r){return this._safeSet(B.SET,e,r),this},t.prototype.setOnce=function(e,r){return this._safeSet(B.SET_ONCE,e,r),this},t.prototype.append=function(e,r){return this._safeSet(B.APPEND,e,r),this},t.prototype.prepend=function(e,r){return this._safeSet(B.PREPEND,e,r),this},t.prototype.postInsert=function(e,r){return this._safeSet(B.POSTINSERT,e,r),this},t.prototype.preInsert=function(e,r){return this._safeSet(B.PREINSERT,e,r),this},t.prototype.remove=function(e,r){return this._safeSet(B.REMOVE,e,r),this},t.prototype.add=function(e,r){return this._safeSet(B.ADD,e,r),this},t.prototype.unset=function(e){return this._safeSet(B.UNSET,e,qt),this},t.prototype.clearAll=function(){return this._properties={},this._properties[B.CLEAR_ALL]=qt,this},t.prototype._safeSet=function(e,r,n){if(this._validate(e,r,n)){var i=this._properties[e];return i===void 0&&(i={},this._properties[e]=i),i[r]=n,this._propertySet.add(r),!0}return!1},t.prototype._validate=function(e,r,n){return this._properties[B.CLEAR_ALL]!==void 0||this._propertySet.has(r)?!1:e===B.ADD?typeof n=="number":e!==B.UNSET&&e!==B.REMOVE?Kt(r,n):!0},t})();var en=function(t,e,r){var n=typeof t=="string"?{event_type:t}:t;return E(E(E({},n),r),e&&{event_properties:e})},Ke=function(t,e){var r=E(E({},e),{event_type:de.IDENTIFY,user_properties:t.getUserProperties()});return r},tn=function(t,e,r,n){var i,o=E(E({},n),{event_type:de.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(i={},i[t]=e,i)});return o},rn=function(t,e,r){var n,i=new ne;i.set(t,e);var o=E(E({},r),{event_type:de.IDENTIFY,user_properties:i.getUserProperties(),groups:(n={},n[t]=e,n)});return o},nn=function(t,e){return E(E({},e),{event_type:de.REVENUE,event_properties:t.getEventProperties()})};var ve=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=M.Unknown),{event:t,code:e,message:r}};var on=(function(){function t(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return t.prototype.register=function(e,r){return g(this,void 0,void 0,function(){return h(this,function(n){switch(n.label){case 0:return[4,e.setup(r,this.client)];case 1:return n.sent(),this.plugins.push(e),[2]}})})},t.prototype.deregister=function(e,r){var n;return g(this,void 0,void 0,function(){var i,o;return h(this,function(s){switch(s.label){case 0:return i=this.plugins.findIndex(function(u){return u.name===e}),i===-1?(r.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(o=this.plugins[i],this.plugins.splice(i,1),[4,(n=o.teardown)===null||n===void 0?void 0:n.call(o)]);case 1:return s.sent(),[2]}})})},t.prototype.reset=function(e){this.applying=!1;var r=this.plugins;r.map(function(n){var i;return(i=n.teardown)===null||i===void 0?void 0:i.call(n)}),this.plugins=[],this.client=e},t.prototype.push=function(e){var r=this;return new Promise(function(n){r.queue.push([e,n]),r.scheduleApply(0)})},t.prototype.scheduleApply=function(e){var r=this;this.applying||(this.applying=!0,setTimeout(function(){r.apply(r.queue.shift()).then(function(){r.applying=!1,r.queue.length>0&&r.scheduleApply(0)})},e))},t.prototype.apply=function(e){return g(this,void 0,void 0,function(){var r,n,i,o,s,u,d,f,m,p,a,c,l,f,m,_,b,v,y,T,L,k;return h(this,function(w){switch(w.label){case 0:if(!e)return[2];r=A(e,1),n=r[0],i=A(e,2),o=i[1],s=this.plugins.filter(function(C){return C.type===N.BEFORE}),w.label=1;case 1:w.trys.push([1,6,7,8]),u=J(s),d=u.next(),w.label=2;case 2:return d.done?[3,5]:(f=d.value,[4,f.execute(E({},n))]);case 3:if(m=w.sent(),m===null)return o({event:n,code:0,message:""}),[2];n=m,w.label=4;case 4:return d=u.next(),[3,2];case 5:return[3,8];case 6:return p=w.sent(),y={error:p},[3,8];case 7:try{d&&!d.done&&(T=u.return)&&T.call(u)}finally{if(y)throw y.error}return[7];case 8:a=this.plugins.filter(function(C){return C.type===N.ENRICHMENT}),w.label=9;case 9:w.trys.push([9,14,15,16]),c=J(a),l=c.next(),w.label=10;case 10:return l.done?[3,13]:(f=l.value,[4,f.execute(E({},n))]);case 11:if(m=w.sent(),m===null)return o({event:n,code:0,message:""}),[2];n=m,w.label=12;case 12:return l=c.next(),[3,10];case 13:return[3,16];case 14:return _=w.sent(),L={error:_},[3,16];case 15:try{l&&!l.done&&(k=c.return)&&k.call(c)}finally{if(L)throw L.error}return[7];case 16:return b=this.plugins.filter(function(C){return C.type===N.DESTINATION}),v=b.map(function(C){var R=E({},n);return C.execute(R).catch(function(K){return ve(R,0,String(K))})}),Promise.all(v).then(function(C){var R=A(C,1),K=R[0];o(K)}),[2]}})})},t.prototype.flush=function(){return g(this,void 0,void 0,function(){var e,r,n,i=this;return h(this,function(o){switch(o.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(s){return i.apply(s)}))];case 1:return o.sent(),r=this.plugins.filter(function(s){return s.type===N.DESTINATION}),n=r.map(function(s){return s.flush&&s.flush()}),[4,Promise.all(n)];case 2:return o.sent(),[2]}})})},t})();var sn="Event tracked successfully",an="Unexpected error occurred",un="Event rejected due to exceeded retry count",cn="Event skipped due to optOut config",ln="Event rejected due to missing API key",dn="Invalid API key",pn="Client not initialized";var X=function(t){return{promise:t||Promise.resolve()}};var Wt=(function(){function t(e){e===void 0&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new on(this),this.name=e}return t.prototype._init=function(e){return g(this,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return this.config=e,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return r.sent(),[2]}})})},t.prototype.runQueuedFunctions=function(e){return g(this,void 0,void 0,function(){var r,n,i,o,s,u,d;return h(this,function(p){switch(p.label){case 0:r=this[e],this[e]=[],p.label=1;case 1:p.trys.push([1,6,7,8]),n=J(r),i=n.next(),p.label=2;case 2:return i.done?[3,5]:(o=i.value,[4,o()]);case 3:p.sent(),p.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return s=p.sent(),u={error:s},[3,8];case 7:try{i&&!i.done&&(d=n.return)&&d.call(n)}finally{if(u)throw u.error}return[7];case 8:return[2]}})})},t.prototype.track=function(e,r,n){var i=en(e,r,n);return X(this.dispatch(i))},t.prototype.identify=function(e,r){var n=Ke(e,r);return X(this.dispatch(n))},t.prototype.groupIdentify=function(e,r,n,i){var o=tn(e,r,n,i);return X(this.dispatch(o))},t.prototype.setGroup=function(e,r,n){var i=rn(e,r,n);return X(this.dispatch(i))},t.prototype.revenue=function(e,r){var n=nn(e,r);return X(this.dispatch(n))},t.prototype.add=function(e){return this.config?X(this.timeline.register(e,this.config)):(this.q.push(this.add.bind(this,e)),X())},t.prototype.remove=function(e){return this.config?X(this.timeline.deregister(e,this.config)):(this.q.push(this.remove.bind(this,e)),X())},t.prototype.dispatchWithCallback=function(e,r){if(!this.config)return r(ve(e,0,pn));this.process(e).then(r)},t.prototype.dispatch=function(e){return g(this,void 0,void 0,function(){var r=this;return h(this,function(n){return this.config?[2,this.process(e)]:[2,new Promise(function(i){r.dispatchQ.push(r.dispatchWithCallback.bind(r,e,i))})]})})},t.prototype.process=function(e){return g(this,void 0,void 0,function(){var i,r,n,i;return h(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,ve(e,0,cn)]:[4,this.timeline.push(e)];case 1:return i=o.sent(),i.code===200?this.config.loggerProvider.log(i.message):this.config.loggerProvider.error(i.message),[2,i];case 2:return r=o.sent(),this.config.loggerProvider.error(r),n=String(r),i=ve(e,0,n),[2,i];case 3:return[2]}})})},t.prototype.setOptOut=function(e){if(!this.config){this.q.push(this.setOptOut.bind(this,!!e));return}this.config.optOut=!!e},t.prototype.flush=function(){return X(this.timeline.flush())},t})();var gt=(function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(e){return this.productId=e,this},t.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},t.prototype.setPrice=function(e){return this.price=e,this},t.prototype.setRevenueType=function(e){return this.revenueType=e,this},t.prototype.setCurrency=function(e){return this.currency=e,this},t.prototype.setRevenue=function(e){return this.revenue=e,this},t.prototype.setEventProperties=function(e){return vt(e)&&(this.properties=e),this},t.prototype.getEventProperties=function(){var e=this.properties?E({},this.properties):{};return e[re.REVENUE_PRODUCT_ID]=this.productId,e[re.REVENUE_QUANTITY]=this.quantity,e[re.REVENUE_PRICE]=this.price,e[re.REVENUE_TYPE]=this.revenueType,e[re.REVENUE_CURRENCY]=this.currency,e[re.REVENUE]=this.revenue,e},t})();var fn=function(t,e){var r=Math.max(e,1);return t.reduce(function(n,i,o){var s=Math.floor(o/r);return n[s]||(n[s]=[]),n[s].push(i),n},[])};var ht="Amplitude Logger ",mn=(function(){function t(){this.logLevel=Y.None}return t.prototype.disable=function(){this.logLevel=Y.None},t.prototype.enable=function(e){e===void 0&&(e=Y.Warn),this.logLevel=e},t.prototype.log=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Verbose||console.log("".concat(ht,"[Log]: ").concat(e.join(" ")))},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Warn||console.warn("".concat(ht,"[Warn]: ").concat(e.join(" ")))},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Error||console.error("".concat(ht,"[Error]: ").concat(e.join(" ")))},t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Debug||console.log("".concat(ht,"[Debug]: ").concat(e.join(" ")))},t})();var yt=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:Y.Warn,loggerProvider:new mn,optOut:!1,serverUrl:Gt,serverZone:Se.US,useBatch:!1}},$t=(function(){function t(e){var r,n,i,o;this._optOut=!1;var s=yt();this.apiKey=e.apiKey,this.flushIntervalMillis=(r=e.flushIntervalMillis)!==null&&r!==void 0?r:s.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||s.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||s.flushQueueSize,this.instanceName=e.instanceName||s.instanceName,this.loggerProvider=e.loggerProvider||s.loggerProvider,this.logLevel=(n=e.logLevel)!==null&&n!==void 0?n:s.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=(i=e.optOut)!==null&&i!==void 0?i:s.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||s.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=(o=e.useBatch)!==null&&o!==void 0?o:s.useBatch,this.loggerProvider.enable(this.logLevel);var u=Yt(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=u.serverZone,this.serverUrl=u.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),t})();var Si=function(t,e){return t===Se.EU?e?Jr:Xr:e?Zr:Gt},Yt=function(t,e,r){if(t===void 0&&(t=""),e===void 0&&(e=yt().serverZone),r===void 0&&(r=yt().useBatch),t)return{serverUrl:t,serverZone:void 0};var n=["US","EU"].includes(e)?e:yt().serverZone;return{serverZone:n,serverUrl:Si(n,r)}};function Ii(t){return t instanceof Error?t.message:String(t)}function bt(t){var e="";try{"body"in t&&(e=JSON.stringify(t.body))}catch{}return e}var zt=(function(){function t(){this.name="amplitude",this.type=N.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return t.prototype.setup=function(e){var r;return g(this,void 0,void 0,function(){var n,i=this;return h(this,function(o){switch(o.label){case 0:return this.config=e,this.storageKey="".concat(jt,"_").concat(this.config.apiKey.substring(0,10)),[4,(r=this.config.storageProvider)===null||r===void 0?void 0:r.get(this.storageKey)];case 1:return n=o.sent(),this.saveEvents(),n&&n.length>0&&Promise.all(n.map(function(s){return i.execute(s)})).catch(),[2,Promise.resolve(void 0)]}})})},t.prototype.execute=function(e){var r=this;return new Promise(function(n){var i={event:e,attempts:0,callback:function(o){return n(o)},timeout:0};r.addToQueue(i)})},t.prototype.addToQueue=function(){for(var e=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r.filter(function(o){return o.attempts<e.config.flushMaxRetries?(o.attempts+=1,!0):(e.fulfillRequest([o],500,un),!1)});i.forEach(function(o){if(e.queue=e.queue.concat(o),o.timeout===0){e.schedule(e.config.flushIntervalMillis);return}setTimeout(function(){o.timeout=0,e.schedule(0)},o.timeout)}),this.saveEvents()},t.prototype.schedule=function(e){var r=this;this.scheduled||(this.scheduled=setTimeout(function(){r.flush(!0).then(function(){r.queue.length>0&&r.schedule(e)})},e))},t.prototype.flush=function(e){return e===void 0&&(e=!1),g(this,void 0,void 0,function(){var r,n,i,o=this;return h(this,function(s){switch(s.label){case 0:return r=[],n=[],this.queue.forEach(function(u){return u.timeout===0?r.push(u):n.push(u)}),this.queue=n,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),i=fn(r,this.config.flushQueueSize),[4,Promise.all(i.map(function(u){return o.send(u,e)}))];case 1:return s.sent(),[2]}})})},t.prototype.send=function(e,r){return r===void 0&&(r=!0),g(this,void 0,void 0,function(){var n,i,o,s,u;return h(this,function(d){switch(d.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,ln)];n={api_key:this.config.apiKey,events:e.map(function(p){var a=p.event,c=a.extra,l=Ge(a,["extra"]);return l}),options:{min_id_length:this.config.minIdLength}},d.label=1;case 1:return d.trys.push([1,3,,4]),i=Yt(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,n)];case 2:return o=d.sent(),o===null?(this.fulfillRequest(e,0,an),[2]):r?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(bt(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return s=d.sent(),this.config.loggerProvider.error(s),u=Ii(s),this.fulfillRequest(e,0,u),[3,4];case 4:return[2]}})})},t.prototype.handleResponse=function(e,r){var n=e.status;switch(n){case M.Success:{this.handleSuccessResponse(e,r);break}case M.Invalid:{this.handleInvalidResponse(e,r);break}case M.PayloadTooLarge:{this.handlePayloadTooLargeResponse(e,r);break}case M.RateLimit:{this.handleRateLimitResponse(e,r);break}default:{this.config.loggerProvider.warn(\`{code: 0, error: "Status '\`.concat(n,"' provided for ").concat(r.length,' events"}')),this.handleOtherResponse(r);break}}},t.prototype.handleSuccessResponse=function(e,r){this.fulfillRequest(r,e.statusCode,sn)},t.prototype.handleInvalidResponse=function(e,r){var n=this;if(e.body.missingField||e.body.error.startsWith(dn)){this.fulfillRequest(r,e.statusCode,e.body.error);return}var i=ee(ee(ee(ee([],A(Object.values(e.body.eventsWithInvalidFields)),!1),A(Object.values(e.body.eventsWithMissingFields)),!1),A(Object.values(e.body.eventsWithInvalidIdLengths)),!1),A(e.body.silencedEvents),!1).flat(),o=new Set(i),s=r.filter(function(u,d){if(o.has(d)){n.fulfillRequest([u],e.statusCode,e.body.error);return}return!0});s.length>0&&this.config.loggerProvider.warn(bt(e)),this.addToQueue.apply(this,ee([],A(s),!1))},t.prototype.handlePayloadTooLargeResponse=function(e,r){if(r.length===1){this.fulfillRequest(r,e.statusCode,e.body.error);return}this.config.loggerProvider.warn(bt(e)),this.config.flushQueueSize/=2,this.addToQueue.apply(this,ee([],A(r),!1))},t.prototype.handleRateLimitResponse=function(e,r){var n=this,i=Object.keys(e.body.exceededDailyQuotaUsers),o=Object.keys(e.body.exceededDailyQuotaDevices),s=e.body.throttledEvents,u=new Set(i),d=new Set(o),p=new Set(s),a=r.filter(function(c,l){if(c.event.user_id&&u.has(c.event.user_id)||c.event.device_id&&d.has(c.event.device_id)){n.fulfillRequest([c],e.statusCode,e.body.error);return}return p.has(l)&&(c.timeout=n.throttleTimeout),!0});a.length>0&&this.config.loggerProvider.warn(bt(e)),this.addToQueue.apply(this,ee([],A(a),!1))},t.prototype.handleOtherResponse=function(e){var r=this;this.addToQueue.apply(this,ee([],A(e.map(function(n){return n.timeout=n.attempts*r.retryTimeout,n})),!1))},t.prototype.fulfillRequest=function(e,r,n){this.saveEvents(),e.forEach(function(i){return i.callback(ve(i.event,r,n))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map(function(r){return r.event}));this.config.storageProvider.set(this.storageKey,e)}},t})();var xi=function(t){t===void 0&&(t=0);var e=new Error().stack||"";return e.split(\`
47
47
  \`).slice(2+t).map(function(r){return r.trim()})},V=function(t){return function(){var e=E({},t.config),r=e.loggerProvider,n=e.logLevel;return{logger:r,logLevel:n}}},Li=function(t,e){var r,n;e=e.replace(/\\[(\\w+)\\]/g,".$1"),e=e.replace(/^\\./,"");try{for(var i=J(e.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(s in t)t=t[s];else return}}catch(u){r={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return t},F=function(t,e){return function(){var r,n,i={};try{for(var o=J(e),s=o.next();!s.done;s=o.next()){var u=s.value;i[u]=Li(t,u)}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},H=function(t,e,r,n,i){return i===void 0&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var u=r(),d=u.logger,p=u.logLevel;if(p&&p<Y.Debug||!p||!d)return t.apply(i,o);var a={type:"invoke public method",name:e,args:o,stacktrace:xi(1),time:{start:new Date().toISOString()},states:{}};n&&a.states&&(a.states.before=n());var c=t.apply(i,o);return c&&c.promise?c.promise.then(function(){n&&a.states&&(a.states.after=n()),a.time&&(a.time.end=new Date().toISOString()),d.debug(JSON.stringify(a,null,2))}):(n&&a.states&&(a.states.after=n()),a.time&&(a.time.end=new Date().toISOString()),d.debug(JSON.stringify(a,null,2))),c}};var ge=function(t){return t?(t^Math.random()*16>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,ge)};var Et=(function(){function t(){this.memoryStorage=new Map}return t.prototype.isEnabled=function(){return g(this,void 0,void 0,function(){return h(this,function(e){return[2,!0]})})},t.prototype.get=function(e){return g(this,void 0,void 0,function(){return h(this,function(r){return[2,this.memoryStorage.get(e)]})})},t.prototype.getRaw=function(e){return g(this,void 0,void 0,function(){var r;return h(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return r=n.sent(),[2,r?JSON.stringify(r):void 0]}})})},t.prototype.set=function(e,r){return g(this,void 0,void 0,function(){return h(this,function(n){return this.memoryStorage.set(e,r),[2]})})},t.prototype.remove=function(e){return g(this,void 0,void 0,function(){return h(this,function(r){return this.memoryStorage.delete(e),[2]})})},t.prototype.reset=function(){return g(this,void 0,void 0,function(){return h(this,function(e){return this.memoryStorage.clear(),[2]})})},t})();var Le=(function(){function t(){}return t.prototype.send=function(e,r){return Promise.resolve(null)},t.prototype.buildResponse=function(e){var r,n,i,o,s,u,d,p,a,c,l,f,m,_,b,v,y,T,L,k,w,C;if(typeof e!="object")return null;var R=e.code||0,K=this.buildStatus(R);switch(K){case M.Success:return{status:K,statusCode:R,body:{eventsIngested:(r=e.events_ingested)!==null&&r!==void 0?r:0,payloadSizeBytes:(n=e.payload_size_bytes)!==null&&n!==void 0?n:0,serverUploadTime:(i=e.server_upload_time)!==null&&i!==void 0?i:0}};case M.Invalid:return{status:K,statusCode:R,body:{error:(o=e.error)!==null&&o!==void 0?o:"",missingField:(s=e.missing_field)!==null&&s!==void 0?s:"",eventsWithInvalidFields:(u=e.events_with_invalid_fields)!==null&&u!==void 0?u:{},eventsWithMissingFields:(d=e.events_with_missing_fields)!==null&&d!==void 0?d:{},eventsWithInvalidIdLengths:(p=e.events_with_invalid_id_lengths)!==null&&p!==void 0?p:{},epsThreshold:(a=e.eps_threshold)!==null&&a!==void 0?a:0,exceededDailyQuotaDevices:(c=e.exceeded_daily_quota_devices)!==null&&c!==void 0?c:{},silencedDevices:(l=e.silenced_devices)!==null&&l!==void 0?l:[],silencedEvents:(f=e.silenced_events)!==null&&f!==void 0?f:[],throttledDevices:(m=e.throttled_devices)!==null&&m!==void 0?m:{},throttledEvents:(_=e.throttled_events)!==null&&_!==void 0?_:[]}};case M.PayloadTooLarge:return{status:K,statusCode:R,body:{error:(b=e.error)!==null&&b!==void 0?b:""}};case M.RateLimit:return{status:K,statusCode:R,body:{error:(v=e.error)!==null&&v!==void 0?v:"",epsThreshold:(y=e.eps_threshold)!==null&&y!==void 0?y:0,throttledDevices:(T=e.throttled_devices)!==null&&T!==void 0?T:{},throttledUsers:(L=e.throttled_users)!==null&&L!==void 0?L:{},exceededDailyQuotaDevices:(k=e.exceeded_daily_quota_devices)!==null&&k!==void 0?k:{},exceededDailyQuotaUsers:(w=e.exceeded_daily_quota_users)!==null&&w!==void 0?w:{},throttledEvents:(C=e.throttled_events)!==null&&C!==void 0?C:[]}};case M.Timeout:default:return{status:K,statusCode:R}}},t.prototype.buildStatus=function(e){return e>=200&&e<300?M.Success:e===429?M.RateLimit:e===413?M.PayloadTooLarge:e===408?M.Timeout:e>=400&&e<500?M.Invalid:e>=500?M.Failed:M.Unknown},t})();var Pi=(function(){function t(){}return t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Ci(),platform:"Web",os:void 0,deviceModel:void 0}},t})(),Ci=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Ri=(function(){function t(){this.queue=[]}return t.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},t.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(r){e(r)}),this.queue=[])},t})(),he=function(){return he=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},he.apply(this,arguments)};function _t(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function vn(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}var Tt=function(t,e){var r,n,i=["string","number","boolean","undefined"],o=typeof t,s=typeof e;if(o!==s)return!1;try{for(var u=_t(i),d=u.next();!d.done;d=u.next()){var p=d.value;if(p===o)return t===e}}catch(b){r={error:b}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}if(t==null&&e==null)return!0;if(t==null||e==null||t.length!==e.length)return!1;var a=Array.isArray(t),c=Array.isArray(e);if(a!==c)return!1;if(a&&c){for(var l=0;l<t.length;l++)if(!Tt(t[l],e[l]))return!1}else{var f=Object.keys(t).sort(),m=Object.keys(e).sort();if(!Tt(f,m))return!1;var _=!0;return Object.keys(t).forEach(function(b){Tt(t[b],e[b])||(_=!1)}),_}return!0},Oi="$set",ki="$unset",Ai="$clearAll";Object.entries||(Object.entries=function(t){for(var e=Object.keys(t),r=e.length,n=new Array(r);r--;)n[r]=[e[r],t[e[r]]];return n});var Di=(function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return t.prototype.editIdentity=function(){var e=this,r=he({},this.identity.userProperties),n=he(he({},this.identity),{userProperties:r});return{setUserId:function(i){return n.userId=i,this},setDeviceId:function(i){return n.deviceId=i,this},setUserProperties:function(i){return n.userProperties=i,this},setOptOut:function(i){return n.optOut=i,this},updateUserProperties:function(i){var o,s,u,d,p,a,c=n.userProperties||{};try{for(var l=_t(Object.entries(i)),f=l.next();!f.done;f=l.next()){var m=vn(f.value,2),_=m[0],b=m[1];switch(_){case Oi:try{for(var v=(u=void 0,_t(Object.entries(b))),y=v.next();!y.done;y=v.next()){var T=vn(y.value,2),L=T[0],k=T[1];c[L]=k}}catch(R){u={error:R}}finally{try{y&&!y.done&&(d=v.return)&&d.call(v)}finally{if(u)throw u.error}}break;case ki:try{for(var w=(p=void 0,_t(Object.keys(b))),C=w.next();!C.done;C=w.next()){var L=C.value;delete c[L]}}catch(R){p={error:R}}finally{try{C&&!C.done&&(a=w.return)&&a.call(w)}finally{if(p)throw p.error}}break;case Ai:c={};break}}}catch(R){o={error:R}}finally{try{f&&!f.done&&(s=l.return)&&s.call(l)}finally{if(o)throw o.error}}return n.userProperties=c,this},commit:function(){return e.setIdentity(n),this}}},t.prototype.getIdentity=function(){return he({},this.identity)},t.prototype.setIdentity=function(e){var r=he({},this.identity);this.identity=he({},e),Tt(r,this.identity)||this.listeners.forEach(function(n){n(e)})},t.prototype.addIdentityListener=function(e){this.listeners.add(e)},t.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},t})(),We=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,gn=(function(){function t(){this.identityStore=new Di,this.eventBridge=new Ri,this.applicationContextProvider=new Pi}return t.getInstance=function(e){return We.analyticsConnectorInstances||(We.analyticsConnectorInstances={}),We.analyticsConnectorInstances[e]||(We.analyticsConnectorInstances[e]=new t),We.analyticsConnectorInstances[e]},t})();var pe=function(t){return t===void 0&&(t="$default_instance"),gn.getInstance(t)},Qt=function(t,e){pe(e).identityStore.editIdentity().setUserId(t).commit()},Xt=function(t,e){pe(e).identityStore.editIdentity().setDeviceId(t).commit()},Zt=function(t,e){pe(e).identityStore.editIdentity().setOptOut(t).commit()};var $=function(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global};var Ne=function(){var t,e=$();if(!(!((t=e?.location)===null||t===void 0)&&t.search))return{};var r=e.location.search.substring(1).split("&").filter(Boolean),n=r.reduce(function(i,o){var s=o.split("=",2),u=hn(s[0]),d=hn(s[1]);return d&&(i[u]=d),i},{});return n},hn=function(t){t===void 0&&(t="");try{return decodeURIComponent(t)}catch{return""}};var yn="utm_campaign",bn="utm_content",En="utm_id",_n="utm_medium",Tn="utm_source",wn="utm_term",Jt="dclid",er="fbclid",tr="gbraid",rr="gclid",nr="ko_click_id",ir="li_fat_id",or="msclkid",sr="rtd_cid",ar="ttclid",ur="twclid",cr="wbraid";var Pe={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0};var $e=(function(){function t(){}return t.prototype.parse=function(){return g(this,void 0,void 0,function(){return h(this,function(e){return[2,E(E(E(E({},Pe),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},t.prototype.getUtmParam=function(){var e=Ne(),r=e[yn],n=e[bn],i=e[En],o=e[_n],s=e[Tn],u=e[wn];return{utm_campaign:r,utm_content:n,utm_id:i,utm_medium:o,utm_source:s,utm_term:u}},t.prototype.getReferrer=function(){var e,r,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=(r=(e=n.referrer)===null||e===void 0?void 0:e.split("/")[2])!==null&&r!==void 0?r:void 0}catch{}return n},t.prototype.getClickIds=function(){var e,r=Ne();return e={},e[Jt]=r[Jt],e[er]=r[er],e[tr]=r[tr],e[rr]=r[rr],e[nr]=r[nr],e[ir]=r[ir],e[or]=r[or],e[sr]=r[sr],e[ar]=r[ar],e[ur]=r[ur],e[cr]=r[cr],e},t})();var Ye=function(t,e,r){return e===void 0&&(e=""),r===void 0&&(r=10),[xe,e,t.substring(0,r)].filter(Boolean).join("_")},lr=function(t){return"".concat(xe.toLowerCase(),"_").concat(t.substring(0,6))};var dr=function(t){return typeof t=="boolean"?t:!!t?.fileDownloads},pr=function(t){return typeof t=="boolean"?t:!!t?.formInteractions},Sn=function(t){return typeof t=="boolean"?t:!!(t?.pageViews===!0||t?.pageViews&&typeof t.pageViews=="object")},fr=function(t){return typeof t=="boolean"?t:!!t?.sessions},mr=function(t){var e,r=!((e=t.attribution)===null||e===void 0)&&e.trackPageViews?"attribution":function(){return!1},n=void 0,i="Page View",o=Sn(t.defaultTracking);return o&&(r=void 0,i=void 0,t.defaultTracking&&typeof t.defaultTracking=="object"&&t.defaultTracking.pageViews&&typeof t.defaultTracking.pageViews=="object"&&("trackOn"in t.defaultTracking.pageViews&&(r=t.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in t.defaultTracking.pageViews&&(n=t.defaultTracking.pageViews.trackHistoryChanges),"eventType"in t.defaultTracking.pageViews&&t.defaultTracking.pageViews.eventType&&(i=t.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:i}};var vr=function(){var t,e,r,n;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return(n=(r=(e=(t=navigator.languages)===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:navigator.language)!==null&&r!==void 0?r:i)!==null&&n!==void 0?n:""};var gr=(function(){function t(){this.name="identity",this.type=N.BEFORE,this.identityStore=pe().identityStore}return t.prototype.execute=function(e){return g(this,void 0,void 0,function(){var r;return h(this,function(n){return r=e.user_properties,r&&this.identityStore.editIdentity().updateUserProperties(r).commit(),[2,e]})})},t.prototype.setup=function(e){return g(this,void 0,void 0,function(){return h(this,function(r){return e.instanceName&&(this.identityStore=pe(e.instanceName).identityStore),[2]})})},t})();var ze=(function(){function t(e){this.options=E({},e)}return t.prototype.isEnabled=function(){return g(this,void 0,void 0,function(){var e,r,n,i;return h(this,function(o){switch(o.label){case 0:if(!$())return[2,!1];t.testValue=String(Date.now()),e=new t(this.options),r="AMP_TEST",o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,e.set(r,t.testValue)];case 2:return o.sent(),[4,e.get(r)];case 3:return n=o.sent(),[2,n===t.testValue];case 4:return i=o.sent(),[2,!1];case 5:return[4,e.remove(r)];case 6:return o.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return g(this,void 0,void 0,function(){var r;return h(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:if(r=n.sent(),!r)return[2,void 0];try{try{r=decodeURIComponent(atob(r))}catch{}return[2,JSON.parse(r)]}catch{return[2,void 0]}return[2]}})})},t.prototype.getRaw=function(e){var r;return g(this,void 0,void 0,function(){var n,i,o;return h(this,function(s){return n=$(),i=(r=n?.document.cookie.split("; "))!==null&&r!==void 0?r:[],o=i.find(function(u){return u.indexOf(e+"=")===0}),o?[2,o.substring(e.length+1)]:[2,void 0]})})},t.prototype.set=function(e,r){var n;return g(this,void 0,void 0,function(){var i,o,s,u,d,p;return h(this,function(a){try{i=(n=this.options.expirationDays)!==null&&n!==void 0?n:0,o=r!==null?i:-1,s=void 0,o&&(u=new Date,u.setTime(u.getTime()+o*24*60*60*1e3),s=u),d="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(r)))),s&&(d+="; expires=".concat(s.toUTCString())),d+="; path=/",this.options.domain&&(d+="; domain=".concat(this.options.domain)),this.options.secure&&(d+="; Secure"),this.options.sameSite&&(d+="; SameSite=".concat(this.options.sameSite)),p=$(),p&&(p.document.cookie=d)}catch{}return[2]})})},t.prototype.remove=function(e){return g(this,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return[4,this.set(e,null)];case 1:return r.sent(),[2]}})})},t.prototype.reset=function(){return g(this,void 0,void 0,function(){return h(this,function(e){return[2]})})},t})();var hr=(function(t){ae(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.send=function(r,n){return g(this,void 0,void 0,function(){var i,o,s;return h(this,function(u){switch(u.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(n),method:"POST"},[4,fetch(r,i)];case 1:return o=u.sent(),[4,o.text()];case 2:s=u.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch{return[2,this.buildResponse({code:o.status})]}return[2]}})})},e})(Le);var In=function(t){var e={};for(var r in t){var n=t[r];n&&(e[r]=n)}return e};var yr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r,n={},i=$(),o=void 0,s,u=A(t,2),d=u[0],p=u[1];d&&"init"in d?(r=d,p&&(n=p)):d&&(n=d);var a=function(){return g(void 0,void 0,void 0,function(){var b,v,y;return h(this,function(T){switch(T.label){case 0:return v={event_type:(y=n.eventType)!==null&&y!==void 0?y:"Page View"},b=[{}],[4,Ni()];case 1:return[2,(v.event_properties=E.apply(void 0,[E.apply(void 0,b.concat([T.sent()])),{page_domain:typeof location<"u"&&location.hostname||"",page_location:typeof location<"u"&&location.href||"",page_path:typeof location<"u"&&location.pathname||"",page_title:typeof document<"u"&&document.title||"",page_url:typeof location<"u"&&location.href.split("?")[0]||""}]),v)]}})})},c=function(){return typeof n.trackOn>"u"||typeof n.trackOn=="function"&&n.trackOn()},l=typeof location<"u"?location.href:null,f=function(){return g(void 0,void 0,void 0,function(){var b,v,y,T,L;return h(this,function(k){switch(k.label){case 0:return b=location.href,v=Mi(n.trackHistoryChanges,b,l||"")&&c(),l=b,v?(o?.log("Tracking page view event"),r!=null?[3,1]:(y=void 0,[3,3])):[3,4];case 1:return L=(T=r).track,[4,a()];case 2:y=L.apply(T,[k.sent()]),k.label=3;case 3:k.label=4;case 4:return[2]}})})},m=function(){f()},_={name:"page-view-tracking",type:N.ENRICHMENT,setup:function(b,v){return g(void 0,void 0,void 0,function(){var y,T,L,k,w;return h(this,function(C){switch(C.label){case 0:return r=r??v,r?(o=b.loggerProvider,o.log("Installing @amplitude/plugin-page-view-tracking-browser"),n.trackOn=!((k=b.attribution)===null||k===void 0)&&k.trackPageViews?"attribution":n.trackOn,!v&&(!((w=b.attribution)===null||w===void 0)&&w.trackPageViews)&&(o.warn("@amplitude/plugin-page-view-tracking-browser overrides page view tracking behavior defined in @amplitude/analytics-browser. Resolve by disabling page view tracking in @amplitude/analytics-browser."),b.attribution.trackPageViews=!1),n.trackHistoryChanges&&i&&(i.addEventListener("popstate",m),s=i.history.pushState,i.history.pushState=new Proxy(i.history.pushState,{apply:function(R,K,z){var Q=A(z,3),P=Q[0],Ce=Q[1],ce=Q[2];R.apply(K,[P,Ce,ce]),f()}})),c()?(o.log("Tracking page view event"),L=(T=r).track,[4,a()]):[3,2]):(y=d?"Options":"undefined",b.loggerProvider.error("Argument of type '".concat(y,"' is not assignable to parameter of type 'BrowserClient'.")),[2]);case 1:L.apply(T,[C.sent()]),C.label=2;case 2:return[2]}})})},execute:function(b){return g(void 0,void 0,void 0,function(){var v;return h(this,function(y){switch(y.label){case 0:return n.trackOn==="attribution"&&Ui(b)?(o?.log("Enriching campaign event to page view event with campaign parameters"),[4,a()]):[3,2];case 1:v=y.sent(),b.event_type=v.event_type,b.event_properties=E(E({},b.event_properties),v.event_properties),y.label=2;case 2:return[2,b]}})})},teardown:function(){return g(void 0,void 0,void 0,function(){return h(this,function(b){return i&&(i.removeEventListener("popstate",m),s&&(i.history.pushState=s)),[2]})})}};return _.__trackHistoryPageView=f,_},Ni=function(){return g(void 0,void 0,void 0,function(){var t;return h(this,function(e){switch(e.label){case 0:return t=In,[4,new $e().parse()];case 1:return[2,t.apply(void 0,[e.sent()])]}})})},Ui=function(t){if(t.event_type==="$identify"&&t.user_properties){var e=t.user_properties,r=e[B.SET]||{},n=e[B.UNSET]||{},i=ee(ee([],A(Object.keys(r)),!1),A(Object.keys(n)),!1);return Object.keys(Pe).every(function(o){return i.includes(o)})}return!1},Mi=function(t,e,r){switch(t){case"pathOnly":return e.split("?")[0]!==r.split("?")[0];default:return e!==r}};var Ln=function(t,e,r){return e===void 0&&(e=""),r===void 0&&(r=10),[xe,e,t.substring(0,r)].filter(Boolean).join("_")},xn=function(t){var e=t.split(".");return e.length<=2?t:e.slice(e.length-2,e.length).join(".")},Pn=function(t,e,r){var n,i=t.referrer,o=t.referring_domain,s=Ge(t,["referrer","referring_domain"]),u=e||{},d=u.referrer,p=u.referring_domain,a=Ge(u,["referrer","referring_domain"]);if(t.referring_domain&&(!((n=r.excludeReferrers)===null||n===void 0)&&n.includes(t.referring_domain)))return!1;var c=JSON.stringify(s)!==JSON.stringify(a),l=xn(o||"")!==xn(p||"");return!e||c||l},Cn=function(t,e){var r=E(E({},Pe),t),n=Object.entries(r).reduce(function(i,o){var s,u=A(o,2),d=u[0],p=u[1];return i.setOnce("initial_".concat(d),(s=p??e.initialEmptyValue)!==null&&s!==void 0?s:"EMPTY"),p?i.set(d,p):i.unset(d)},new ne);return Ke(n)};var br=function(){for(var t=this,e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i,o={},s=A(r,2),u=s[0],d=s[1];u&&"init"in u?(i=u,d&&(o=d)):u&&(o=u);var p=(e=o.excludeReferrers)!==null&&e!==void 0?e:[];typeof location<"u"&&p.unshift(location.hostname),o=E(E({disabled:!1,initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1},o),{excludeReferrers:p});var a={name:"web-attribution",type:N.BEFORE,setup:function(c,l){var f;return g(this,void 0,void 0,function(){var m,_,b,v,y,T,L,k;return h(this,function(w){switch(w.label){case 0:return i=i??l,i?o.disabled?(c.loggerProvider.log("@amplitude/plugin-web-attribution-browser is disabled. Attribution is not tracked."),[2]):(c.loggerProvider.log("Installing @amplitude/plugin-web-attribution-browser."),!l&&!(!((f=c.attribution)===null||f===void 0)&&f.disabled)&&(c.loggerProvider.warn("@amplitude/plugin-web-attribution-browser overrides web attribution behavior defined in @amplitude/analytics-browser. Resolve by disabling web attribution tracking in @amplitude/analytics-browser."),c.attribution={disabled:!0}),_=c.cookieStorage,b=Ln(c.apiKey,"MKTG"),[4,Promise.all([new $e().parse(),_.get(b)])]):(m=u?"Options":"undefined",c.loggerProvider.error("Argument of type '".concat(m,"' is not assignable to parameter of type 'BrowserClient'.")),[2]);case 1:return v=A.apply(void 0,[w.sent(),2]),y=v[0],T=v[1],L=this.__pluginEnabledOverride,(L??Pn(y,T,o))&&(o.resetSessionOnNewCampaign&&(i.setSessionId(Date.now()),c.loggerProvider.log("Created a new session for new campaign.")),c.loggerProvider.log("Tracking attribution."),k=Cn(y,o),i.track(k),_.set(b,y)),[2]}})})},execute:function(c){return g(t,void 0,void 0,function(){return h(this,function(l){return[2,c]})})}};return a.__pluginEnabledOverride=void 0,a};var wt=1e3,Er=(function(){function t(e){this.loggerProvider=e?.loggerProvider}return t.prototype.isEnabled=function(){return g(this,void 0,void 0,function(){var e,r,n,i,o;return h(this,function(s){switch(s.label){case 0:if(!$())return[2,!1];e=String(Date.now()),r=new t,n="AMP_TEST",s.label=1;case 1:return s.trys.push([1,4,5,7]),[4,r.set(n,e)];case 2:return s.sent(),[4,r.get(n)];case 3:return i=s.sent(),[2,i===e];case 4:return o=s.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return s.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return g(this,void 0,void 0,function(){var r,n;return h(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return r=i.sent(),r?[2,JSON.parse(r)]:[2,void 0];case 2:return n=i.sent(),[2,void 0];case 3:return[2]}})})},t.prototype.getRaw=function(e){var r;return g(this,void 0,void 0,function(){return h(this,function(n){return[2,((r=$())===null||r===void 0?void 0:r.localStorage.getItem(e))||void 0]})})},t.prototype.set=function(e,r){var n,i;return g(this,void 0,void 0,function(){var o,s,u;return h(this,function(d){o=Array.isArray(r)&&r.length>wt;try{s=JSON.stringify(o?r.slice(0,wt):r),(n=$())===null||n===void 0||n.localStorage.setItem(e,s)}catch{}return o&&(u=r.length-wt,(i=this.loggerProvider)===null||i===void 0||i.error("Failed to save ".concat(u," events because the queue length exceeded ").concat(wt,"."))),[2]})})},t.prototype.remove=function(e){var r;return g(this,void 0,void 0,function(){return h(this,function(n){try{(r=$())===null||r===void 0||r.localStorage.removeItem(e)}catch{}return[2]})})},t.prototype.reset=function(){var e;return g(this,void 0,void 0,function(){return h(this,function(r){try{(e=$())===null||e===void 0||e.localStorage.clear()}catch{}return[2]})})},t})();var Rn=(function(t){ae(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.state={done:4},r}return e.prototype.send=function(r,n){return g(this,void 0,void 0,function(){var i=this;return h(this,function(o){return[2,new Promise(function(s,u){typeof XMLHttpRequest>"u"&&u(new Error("XHRTransport is not supported."));var d=new XMLHttpRequest;d.open("POST",r,!0),d.onreadystatechange=function(){if(d.readyState===i.state.done)try{var p=d.responseText,a=JSON.parse(p),c=i.buildResponse(a);s(c)}catch(l){u(l)}},d.setRequestHeader("Content-Type","application/json"),d.setRequestHeader("Accept","*/*"),d.send(JSON.stringify(n))})]})})},e})(Le);var On=(function(t){ae(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.send=function(r,n){return g(this,void 0,void 0,function(){var i=this;return h(this,function(o){return[2,new Promise(function(s,u){var d=$();if(!d?.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var p=JSON.stringify(n),a=d.navigator.sendBeacon(r,JSON.stringify(n));return s(a?i.buildResponse({code:200,events_ingested:n.events.length,payload_size_bytes:p.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(c){u(c)}})]})})},e})(Le);var Ue=function(){var t=new Et,e={deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0};return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:t,cookieUpgrade:!0,disableCookies:!1,domain:"",sessionTimeout:1800*1e3,trackingOptions:e,transportProvider:new hr}},kn=(function(t){ae(e,t);function e(r,n){var i=this,o,s,u,d,p,a,c,l,f,m=Ue();return i=t.call(this,E(E({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30,transportProvider:m.transportProvider},n),{apiKey:r}))||this,i._optOut=!1,i.cookieStorage=(o=n?.cookieStorage)!==null&&o!==void 0?o:m.cookieStorage,i.deviceId=n?.deviceId,i.lastEventId=n?.lastEventId,i.lastEventTime=n?.lastEventTime,i.optOut=!!n?.optOut,i.sessionId=n?.sessionId,i.userId=n?.userId,i.appVersion=n?.appVersion,i.attribution=n?.attribution,i.cookieExpiration=(s=n?.cookieExpiration)!==null&&s!==void 0?s:m.cookieExpiration,i.cookieSameSite=(u=n?.cookieSameSite)!==null&&u!==void 0?u:m.cookieSameSite,i.cookieSecure=(d=n?.cookieSecure)!==null&&d!==void 0?d:m.cookieSecure,i.cookieUpgrade=(p=n?.cookieUpgrade)!==null&&p!==void 0?p:m.cookieUpgrade,i.defaultTracking=n?.defaultTracking,i.disableCookies=(a=n?.disableCookies)!==null&&a!==void 0?a:m.disableCookies,i.defaultTracking=n?.defaultTracking,i.domain=(c=n?.domain)!==null&&c!==void 0?c:m.domain,i.partnerId=n?.partnerId,i.sessionTimeout=(l=n?.sessionTimeout)!==null&&l!==void 0?l:m.sessionTimeout,i.trackingOptions=(f=n?.trackingOptions)!==null&&f!==void 0?f:m.trackingOptions,i}return Object.defineProperty(e.prototype,"deviceId",{get:function(){return this._deviceId},set:function(r){this._deviceId!==r&&(this._deviceId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._userId},set:function(r){this._userId!==r&&(this._userId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this._sessionId},set:function(r){this._sessionId!==r&&(this._sessionId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(r){this._optOut!==r&&(this._optOut=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(r){this._lastEventTime!==r&&(this._lastEventTime=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(r){this._lastEventId!==r&&(this._lastEventId=r,this.updateStorage())},enumerable:!1,configurable:!0}),e.prototype.updateStorage=function(){var r,n={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId};(r=this.cookieStorage)===null||r===void 0||r.set(Ye(this.apiKey),n)},e})($t);var An=function(t,e){return g(void 0,void 0,void 0,function(){var r,n,i,o,s,u,d,p,a,c,l,f,m,_,b;return h(this,function(v){switch(v.label){case 0:return r=Ue(),n=(_=e?.deviceId)!==null&&_!==void 0?_:ge(),i=e?.lastEventId,o=e?.lastEventTime,s=e?.optOut,u=e?.sessionId,d=e?.userId,p=e?.cookieStorage,a=e?.domain,c=kn.bind,l=[void 0,t],f=[E({},e)],m={cookieStorage:p,deviceId:n,domain:a,lastEventId:i,lastEventTime:o,optOut:s,sessionId:u},[4,Vi(e)];case 1:return[2,new(c.apply(kn,l.concat([E.apply(void 0,f.concat([(m.storageProvider=v.sent(),m.trackingOptions=E(E({},r.trackingOptions),e?.trackingOptions),m.transportProvider=(b=e?.transportProvider)!==null&&b!==void 0?b:_r(e?.transport),m.userId=d,m)]))])))]}})})},St=function(t,e){return e===void 0&&(e=Ue()),g(void 0,void 0,void 0,function(){var r,n,i;return h(this,function(o){switch(o.label){case 0:return r=E(E({},e),t),n=t?.cookieStorage,i=!n,i?[3,2]:[4,n.isEnabled()];case 1:i=!o.sent(),o.label=2;case 2:return i?[2,Bi(r)]:[2,n]}})})},Bi=function(t){return g(void 0,void 0,void 0,function(){var e,r;return h(this,function(n){switch(n.label){case 0:return e=new ze({domain:t.domain,expirationDays:t.cookieExpiration,sameSite:t.cookieSameSite,secure:t.cookieSecure}),r=t.disableCookies,r?[3,2]:[4,e.isEnabled()];case 1:r=!n.sent(),n.label=2;case 2:return r?(e=new Er,[4,e.isEnabled()]):[3,4];case 3:n.sent()||(e=new Et),n.label=4;case 4:return[2,e]}})})},Vi=function(t){return g(void 0,void 0,void 0,function(){var e,r,n,i,o,s,u,d,p;return h(this,function(a){switch(a.label){case 0:if(e=t&&Object.prototype.hasOwnProperty.call(t,"storageProvider"),r=t&&t.loggerProvider,!(!e||t.storageProvider))return[3,9];a.label=1;case 1:a.trys.push([1,7,8,9]),n=J([t?.storageProvider,new Er({loggerProvider:r})]),i=n.next(),a.label=2;case 2:return i.done?[3,6]:(o=i.value,s=o,s?[4,o.isEnabled()]:[3,4]);case 3:s=a.sent(),a.label=4;case 4:if(s)return[2,o];a.label=5;case 5:return i=n.next(),[3,2];case 6:return[3,9];case 7:return u=a.sent(),d={error:u},[3,9];case 8:try{i&&!i.done&&(p=n.return)&&p.call(n)}finally{if(d)throw d.error}return[7];case 9:return[2,void 0]}})})},_r=function(t){return t===Ie.XHR?new Rn:t===Ie.SendBeacon?new On:Ue().transportProvider},Dn=function(t){return g(void 0,void 0,void 0,function(){var e,r,n,i,o,o,s,u,d,p;return h(this,function(a){switch(a.label){case 0:return[4,new ze().isEnabled()];case 1:if(!a.sent()||!t&&typeof location>"u")return[2,""];for(e=t??location.hostname,r=e.split("."),n=[],i="AMP_TLDTEST",o=r.length-2;o>=0;--o)n.push(r.slice(o).join("."));o=0,a.label=2;case 2:return o<n.length?(s=n[o],u={domain:"."+s},d=new ze(u),[4,d.set(i,1)]):[3,7];case 3:return a.sent(),[4,d.get(i)];case 4:return p=a.sent(),p?[4,d.remove(i)]:[3,6];case 5:return a.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}})})};var W="[Amplitude]",It="".concat(W," Page Viewed"),Tr="".concat(W," Form Started"),Nn="".concat(W," Form Submitted"),Un="".concat(W," File Downloaded"),wr="session_start",Sr="session_end",Mn="".concat(W," File Extension"),Bn="".concat(W," File Name"),Vn="".concat(W," Link ID"),Fn="".concat(W," Link Text"),Hn="".concat(W," Link URL"),xt="".concat(W," Form ID"),Lt="".concat(W," Form Name"),Pt="".concat(W," Form Destination");var qn=function(t,e){return g(void 0,void 0,void 0,function(){var r,n,i,o,s,u,d,p,a,c,l;return h(this,function(f){switch(f.label){case 0:return[4,St(e)];case 1:return r=f.sent(),n=lr(t),[4,r.getRaw(n)];case 2:return i=f.sent(),i?((l=e.cookieUpgrade)!==null&&l!==void 0?l:Ue().cookieUpgrade)?[4,r.remove(n)]:[3,4]:[2,{optOut:!1}];case 3:f.sent(),f.label=4;case 4:return o=A(i.split("."),6),s=o[0],u=o[1],d=o[2],p=o[3],a=o[4],c=o[5],[2,{deviceId:s,userId:Fi(u),sessionId:Ir(p),lastEventId:Ir(c),lastEventTime:Ir(a),optOut:!!d}]}})})},Ir=function(t){var e=parseInt(t,32);if(!isNaN(e))return e},Fi=function(t){if(!(!atob||!escape||!t))try{return decodeURIComponent(escape(atob(t)))}catch{return}};var Kn=_i(jn());var Gn="1.13.4";var Hi="Web",qi="$remote",Wn=(function(){function t(){this.name="context",this.type=N.BEFORE,this.library="amplitude-ts/".concat(Gn),typeof navigator<"u"&&(this.userAgent=navigator.userAgent),this.uaResult=new Kn.default(this.userAgent).getResult()}return t.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},t.prototype.execute=function(e){var r,n;return g(this,void 0,void 0,function(){var i,o,s,u,d,p,a,c;return h(this,function(l){return i=new Date().getTime(),o=this.uaResult.browser.name,s=this.uaResult.browser.version,u=this.uaResult.device.model||this.uaResult.os.name,d=this.uaResult.device.vendor,p=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1,a=(n=e.event_id)!==null&&n!==void 0?n:p+1,this.config.lastEventId=a,e.time||(this.config.lastEventTime=i),c=E(E(E(E(E(E(E(E(E(E(E(E({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:i},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:Hi}),this.config.trackingOptions.osName&&{os_name:o}),this.config.trackingOptions.osVersion&&{os_version:s}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:d}),this.config.trackingOptions.deviceModel&&{device_model:u}),this.config.trackingOptions.language&&{language:vr()}),this.config.trackingOptions.ipAddress&&{ip:qi}),{insert_id:ge(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:a,library:this.library,user_agent:this.userAgent}),[2,c]})})},t})();var ji={page_domain:"".concat(W," Page Domain"),page_location:"".concat(W," Page Location"),page_path:"".concat(W," Page Path"),page_title:"".concat(W," Page Title"),page_url:"".concat(W," Page URL")},$n=function(){var t="@amplitude/plugin-default-page-view-event-enrichment-browser",e=N.ENRICHMENT,r=function(){return g(void 0,void 0,void 0,function(){return h(this,function(i){return[2,void 0]})})},n=function(i){return g(void 0,void 0,void 0,function(){return h(this,function(o){return i.event_type===It&&i.event_properties&&(i.event_properties=Object.entries(i.event_properties).reduce(function(s,u){var d=A(u,2),p=d[0],a=d[1],c=ji[p];return c?s[c]=a:s[p]=a,s},{})),[2,i]})})};return{name:t,type:e,setup:r,execute:n}};var Yn=function(){var t,e=[],r=function(p,a,c){p.addEventListener(a,c),e.push({element:p,type:a,handler:c})},n=function(){e.forEach(function(p){var a=p.element,c=p.type,l=p.handler;a?.removeEventListener(c,l)}),e=[]},i="@amplitude/plugin-file-download-tracking-browser",o=N.ENRICHMENT,s=function(p,a){return g(void 0,void 0,void 0,function(){var c,l,f;return h(this,function(m){return a?typeof document>"u"?[2]:(c=function(_){var b;try{b=new URL(_.href,window.location.href)}catch{return}var v=l.exec(b.href),y=v?.[1];y&&r(_,"click",function(){var T;y&&a.track(Un,(T={},T[Mn]=y,T[Bn]=b.pathname,T[Vn]=_.id,T[Fn]=_.text,T[Hn]=_.href,T))})},l=/\\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$/,f=Array.from(document.getElementsByTagName("a")),f.forEach(c),typeof MutationObserver<"u"&&(t=new MutationObserver(function(_){_.forEach(function(b){b.addedNodes.forEach(function(v){v.nodeName==="A"&&c(v),"querySelectorAll"in v&&typeof v.querySelectorAll=="function"&&Array.from(v.querySelectorAll("a")).map(c)})})}),t.observe(document.body,{subtree:!0,childList:!0})),[2]):(p.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked."),[2])})})},u=function(p){return g(void 0,void 0,void 0,function(){return h(this,function(a){return[2,p]})})},d=function(){return g(void 0,void 0,void 0,function(){return h(this,function(p){return t?.disconnect(),n(),[2]})})};return{name:i,type:o,setup:s,execute:u,teardown:d}};var zn=function(){var t,e=[],r=function(p,a,c){p.addEventListener(a,c),e.push({element:p,type:a,handler:c})},n=function(){e.forEach(function(p){var a=p.element,c=p.type,l=p.handler;a?.removeEventListener(c,l)}),e=[]},i="@amplitude/plugin-form-interaction-tracking-browser",o=N.ENRICHMENT,s=function(p,a){return g(void 0,void 0,void 0,function(){var c,l;return h(this,function(f){return a?typeof document>"u"?[2]:(c=function(m){var _=!1;r(m,"change",function(){var b;_||a.track(Tr,(b={},b[xt]=m.id,b[Lt]=m.name,b[Pt]=m.action,b)),_=!0}),r(m,"submit",function(){var b,v;_||a.track(Tr,(b={},b[xt]=m.id,b[Lt]=m.name,b[Pt]=m.action,b)),a.track(Nn,(v={},v[xt]=m.id,v[Lt]=m.name,v[Pt]=m.action,v)),_=!1})},l=Array.from(document.getElementsByTagName("form")),l.forEach(c),typeof MutationObserver<"u"&&(t=new MutationObserver(function(m){m.forEach(function(_){_.addedNodes.forEach(function(b){b.nodeName==="FORM"&&c(b),"querySelectorAll"in b&&typeof b.querySelectorAll=="function"&&Array.from(b.querySelectorAll("form")).map(c)})})}),t.observe(document.body,{subtree:!0,childList:!0})),[2]):(p.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked."),[2])})})},u=function(p){return g(void 0,void 0,void 0,function(){return h(this,function(a){return[2,p]})})},d=function(){return g(void 0,void 0,void 0,function(){return h(this,function(p){return t?.disconnect(),n(),[2]})})};return{name:i,type:o,setup:s,execute:u,teardown:d}};var Rt=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=n.name,o=n.args,s=n.resolve,u=t&&t[i];if(typeof u=="function"){var d=u.apply(t,o);typeof s=="function"&&s(d?.promise)}}return t},Ot=function(t){var e=t;return e&&e._q!==void 0};var Qn=(function(t){ae(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,n,i){return r===void 0&&(r=""),X(this._init(E(E({},i),{userId:n,apiKey:r})))},e.prototype._init=function(r){var n,i,o,s,u,d,p,a,c,l,f,m,_,b,v,y,T,L,k,w;return g(this,void 0,void 0,function(){var C,R,K,z,Q,P,Ce,ce,_e,Me,Re,Oe,Be,Te,we,ke,fe,me,Ve=this;return h(this,function(U){switch(U.label){case 0:return this.initializing?[2]:(this.initializing=!0,C=r,r.disableCookies?(R="",[3,5]):[3,1]);case 1:return(n=r.domain)!==null&&n!==void 0?(K=n,[3,4]):[3,2];case 2:return[4,Dn()];case 3:K=U.sent(),U.label=4;case 4:R=K,U.label=5;case 5:return C.domain=R,[4,qn(r.apiKey,r)];case 6:return z=U.sent(),[4,St(r)];case 7:return Q=U.sent(),[4,Q.get(Ye(r.apiKey))];case 8:return P=U.sent(),Ce=Ne(),ce=(s=(o=(i=r.deviceId)!==null&&i!==void 0?i:Ce.deviceId)!==null&&o!==void 0?o:P?.deviceId)!==null&&s!==void 0?s:z.deviceId,_e=(u=P?.sessionId)!==null&&u!==void 0?u:z.sessionId,Me=(p=(d=r.optOut)!==null&&d!==void 0?d:P?.optOut)!==null&&p!==void 0?p:z.optOut,Re=(a=P?.lastEventId)!==null&&a!==void 0?a:z.lastEventId,Oe=(c=P?.lastEventTime)!==null&&c!==void 0?c:z.lastEventTime,Be=(f=(l=r.userId)!==null&&l!==void 0?l:P?.userId)!==null&&f!==void 0?f:z.userId,this.previousSessionDeviceId=(m=P?.deviceId)!==null&&m!==void 0?m:z.deviceId,this.previousSessionUserId=(_=P?.userId)!==null&&_!==void 0?_:z.userId,[4,An(r.apiKey,E(E({},r),{deviceId:ce,sessionId:_e,optOut:Me,lastEventId:Re,lastEventTime:Oe,userId:Be,cookieStorage:Q}))];case 9:return Te=U.sent(),[4,t.prototype._init.call(this,Te)];case 10:return U.sent(),we=!1,(!this.config.lastEventTime||!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId((v=(b=r.sessionId)!==null&&b!==void 0?b:this.config.sessionId)!==null&&v!==void 0?v:Date.now()),we=!0),ke=pe(r.instanceName),ke.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new zt).promise];case 11:return U.sent(),[4,this.add(new Wn).promise];case 12:return U.sent(),[4,this.add(new gr).promise];case 13:return U.sent(),dr(this.config.defaultTracking)?[4,this.add(Yn()).promise]:[3,15];case 14:U.sent(),U.label=15;case 15:return pr(this.config.defaultTracking)?[4,this.add(zn()).promise]:[3,17];case 16:U.sent(),U.label=17;case 17:return!((y=this.config.attribution)===null||y===void 0)&&y.disabled?[3,19]:(fe=br({excludeReferrers:(T=this.config.attribution)===null||T===void 0?void 0:T.excludeReferrers,initialEmptyValue:(L=this.config.attribution)===null||L===void 0?void 0:L.initialEmptyValue,resetSessionOnNewCampaign:(k=this.config.attribution)===null||k===void 0?void 0:k.resetSessionOnNewCampaign}),fe.__pluginEnabledOverride=we||!((w=this.config.attribution)===null||w===void 0)&&w.trackNewCampaigns?void 0:!1,[4,this.add(fe).promise]);case 18:U.sent(),U.label=19;case 19:return me=mr(this.config),me.eventType=me.eventType||It,[4,this.add(yr(me)).promise];case 20:return U.sent(),[4,this.add($n()).promise];case 21:return U.sent(),this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 22:return U.sent(),ke.eventBridge.setEventReceiver(function(et){Ve.track(et.eventType,et.eventProperties)}),[2]}})})},e.prototype.getUserId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.userId},e.prototype.setUserId=function(r){if(!this.config){this.q.push(this.setUserId.bind(this,r));return}(r!==this.config.userId||r===void 0)&&(this.config.userId=r,Qt(r,this.config.instanceName))},e.prototype.getDeviceId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.deviceId},e.prototype.setDeviceId=function(r){if(!this.config){this.q.push(this.setDeviceId.bind(this,r));return}this.config.deviceId=r,Xt(r,this.config.instanceName)},e.prototype.setOptOut=function(r){Zt(r,this.config.instanceName),t.prototype.setOptOut.call(this,r)},e.prototype.reset=function(){this.setDeviceId(ge()),this.setUserId(void 0)},e.prototype.getSessionId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.sessionId},e.prototype.setSessionId=function(r){var n;if(!this.config){this.q.push(this.setSessionId.bind(this,r));return}if(r!==this.config.sessionId){var i=this.getSessionId(),o=this.config.lastEventTime,s=(n=this.config.lastEventId)!==null&&n!==void 0?n:-1;this.config.sessionId=r,this.config.lastEventTime=void 0,fr(this.config.defaultTracking)&&(i&&o&&this.track(Sr,void 0,{device_id:this.previousSessionDeviceId,event_id:++s,session_id:i,time:o+1,user_id:this.previousSessionUserId}),this.config.lastEventTime=this.config.sessionId,this.track(wr,void 0,{event_id:++s,session_id:this.config.sessionId,time:this.config.lastEventTime})),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId}},e.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},e.prototype.setTransport=function(r){if(!this.config){this.q.push(this.setTransport.bind(this,r));return}this.config.transportProvider=_r(r)},e.prototype.identify=function(r,n){if(Ot(r)){var i=r._q;r._q=[],r=Rt(new ne,i)}return n?.user_id&&this.setUserId(n.user_id),n?.device_id&&this.setDeviceId(n.device_id),t.prototype.identify.call(this,r,n)},e.prototype.groupIdentify=function(r,n,i,o){if(Ot(i)){var s=i._q;i._q=[],i=Rt(new ne,s)}return t.prototype.groupIdentify.call(this,r,n,i,o)},e.prototype.revenue=function(r,n){if(Ot(r)){var i=r._q;r._q=[],r=Rt(new gt,i)}return t.prototype.revenue.call(this,r,n)},e.prototype.process=function(r){return g(this,void 0,void 0,function(){var n,i,o;return h(this,function(s){return n=Date.now(),i=this.config.lastEventTime||Date.now(),o=n-i,r.event_type!==wr&&r.event_type!==Sr&&(!r.session_id||r.session_id===this.getSessionId())&&o>this.config.sessionTimeout&&this.setSessionId(n),[2,t.prototype.process.call(this,r)]})})},e})(Wt);var Gi=function(){var t=new Qn;return{init:H(t.init.bind(t),"init",V(t),F(t,["config"])),add:H(t.add.bind(t),"add",V(t),F(t,["config.apiKey","timeline.plugins"])),remove:H(t.remove.bind(t),"remove",V(t),F(t,["config.apiKey","timeline.plugins"])),track:H(t.track.bind(t),"track",V(t),F(t,["config.apiKey","timeline.queue.length"])),logEvent:H(t.logEvent.bind(t),"logEvent",V(t),F(t,["config.apiKey","timeline.queue.length"])),identify:H(t.identify.bind(t),"identify",V(t),F(t,["config.apiKey","timeline.queue.length"])),groupIdentify:H(t.groupIdentify.bind(t),"groupIdentify",V(t),F(t,["config.apiKey","timeline.queue.length"])),setGroup:H(t.setGroup.bind(t),"setGroup",V(t),F(t,["config.apiKey","timeline.queue.length"])),revenue:H(t.revenue.bind(t),"revenue",V(t),F(t,["config.apiKey","timeline.queue.length"])),flush:H(t.flush.bind(t),"flush",V(t),F(t,["config.apiKey","timeline.queue.length"])),getUserId:H(t.getUserId.bind(t),"getUserId",V(t),F(t,["config","config.userId"])),setUserId:H(t.setUserId.bind(t),"setUserId",V(t),F(t,["config","config.userId"])),getDeviceId:H(t.getDeviceId.bind(t),"getDeviceId",V(t),F(t,["config","config.deviceId"])),setDeviceId:H(t.setDeviceId.bind(t),"setDeviceId",V(t),F(t,["config","config.deviceId"])),reset:H(t.reset.bind(t),"reset",V(t),F(t,["config","config.userId","config.deviceId"])),getSessionId:H(t.getSessionId.bind(t),"getSessionId",V(t),F(t,["config"])),setSessionId:H(t.setSessionId.bind(t),"setSessionId",V(t),F(t,["config"])),extendSession:H(t.extendSession.bind(t),"extendSession",V(t),F(t,["config"])),setOptOut:H(t.setOptOut.bind(t),"setOptOut",V(t),F(t,["config"])),setTransport:H(t.setTransport.bind(t),"setTransport",V(t),F(t,["config"]))}},j=Gi();var cc=j.add,lc=j.extendSession,dc=j.flush,pc=j.getDeviceId,fc=j.getSessionId,mc=j.getUserId,vc=j.groupIdentify,Xn=j.identify,Zn=j.init,gc=j.logEvent,hc=j.remove,yc=j.reset,bc=j.revenue,Ec=j.setDeviceId,_c=j.setGroup,Tc=j.setOptOut,wc=j.setSessionId,Sc=j.setTransport,Ic=j.setUserId,ye=j.track;var te=t=>{window.dispatchEvent(new CustomEvent("builderdevtools",{detail:{eventName:t}}))};async function Ki(){return zr()}var Jn=async()=>{let t=new URL(window.location.href),e=t.hash,r=\`#\${Br}=\`,n=Math.random().toString(36).substring(2,15),i=await Ki();Zn("f1d2eb79aecd01b28c8a371ea5d1751c",i?.userId||n,{logLevel:mt.LogLevel.None,serverUrl:Hr,flushIntervalMillis:500});let o=new ne;Xn(o,{device_id:i?.deviceId,user_id:i?.userId||n});let s="anonymous";e.startsWith(r)&&(s=e.slice(r.length),s&&(Wi(s),t.hash="",window.history.replaceState({},"",t.href))),te("init")};var Wi=t=>{if(typeof t=="string"&&t.length>0){let e=Ze();Xe({...e,builderUserId:t})}},Ze=()=>{let t=localStorage.getItem(ei);if(t)try{let e=JSON.parse(t);return(!e.ctas||typeof e.ctas!="object")&&(e=Xe({...e,ctas:{}})),e.menuOpenedTs&&(e=Xe({...e,ctas:{...e.ctas,menuOpened:e.menuOpenedTs}}),delete e.menuOpenedTs),e}catch(e){console.error(e)}return Xe({firstVisitTs:Date.now(),ctas:{},builderUserId:""})},Xe=t=>{try{localStorage.setItem(ei,JSON.stringify(t))}catch(e){console.error(e)}return t},xr=t=>!!Ze().ctas[t],Lr=t=>{let e=Ze();return Xe({...e,ctas:{...e.ctas,[t]:Date.now()}})},ei="builderDevtools";function ti(t){$i(t),Yi(t),zi(t),Qi(t)}function $i(t){let e=t.getElementById("input-register");e.addEventListener("change",async r=>{r.stopPropagation();let n=t.getElementById("input-name"),i=t.querySelector(".nav-cmp-input");i.classList.add("input-loading"),i.classList.remove("input-enabled");let o=n.dataset.id,s=n.dataset.prop,u=await at({cmpId:o,name:s,registerInput:e.checked});te("registryUpdate"),le(u),Je(t,o,s),be(t,o),i.classList.remove("input-loading")})}function Yi(t){t.getElementById("input-open-source").addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let n=r.target,i=G.components.find(o=>o.id===n?.dataset.id);i&&De({filePath:i.filePath})})}function zi(t){let e=t.getElementById("input-name"),r=e.closest(".ui-text-input"),n="",i;e.addEventListener("focus",o=>{clearTimeout(i),r.classList.remove("saved"),o.stopPropagation(),n=e.value}),e.addEventListener("blur",async o=>{if(o.stopPropagation(),clearTimeout(i),r.classList.remove("saved"),e.value!==n){if(e.value.trim().length<3){e.value=n;return}r.classList.add("saved"),i=setTimeout(()=>{r.classList.remove("saved")},3e3);let s=e.dataset.id,u=e.dataset.prop,d=await at({cmpId:s,name:u,friendlyName:e.value});te("registryUpdate"),le(d),ue(t),be(t,s),Je(t,s,u)}}),e.addEventListener("keyup",o=>{o.stopPropagation(),clearTimeout(i),r.classList.remove("saved"),o.key==="Escape"?(e.value=n,e.blur()):o.key==="Enter"&&e.blur()})}function Qi(t){let e=t.getElementById("input-type");e.addEventListener("change",async r=>{r.stopPropagation();let n=e.dataset.id,i=e.dataset.prop,o=await at({cmpId:n,name:i,type:e.value});te("registryUpdate"),le(o),ue(t),be(t,n),Je(t,n,i)})}function Je(t,e,r){let n=G.components.find(l=>l.id===e);if(!n)return null;let i=n.inputs.find(l=>l.name===r);if(!i)return null;let o=t.querySelector(".nav-cmp-input");i.isRegistered?o.classList.add("input-enabled"):o.classList.remove("input-enabled");let s=t.getElementById("input-register");s.checked=!!i.isRegistered;let u=t.getElementById("cmp-input-title");u.innerText=n.name+": "+(i.friendlyName||i.name);let d=t.getElementById("input-open-source");d.innerText=\`Open \${n.displayFilePath}\`,d.dataset.id=n.id;let p=t.getElementById("cmp-prop-name");p.innerText=i.name;let a=t.getElementById("cmp-prop-type");a.innerText=ft(i.type);let c=t.getElementById("input-name");return c.dataset.id=n.id,c.dataset.prop=i.name,c.value=i.friendlyName||i.name,Xi(t,n,i),i}function Xi(t,e,r){let n=t.getElementById("input-type");n.dataset.id=e.id,n.dataset.prop=r.name,n.innerHTML="";let i=r.type,o=ut.includes(i),s=ct.includes(i),u=lt.includes(i),d=dt.includes(i),p=pt.includes(i);Qr.forEach(a=>{let c=document.createElement("option");c.value=a.value,c.innerText=a.text,c.disabled=ut.includes(a.value)&&!o||ct.includes(a.value)&&!s||lt.includes(a.value)&&!u||dt.includes(a.value)&&!d||pt.includes(a.value)&&!p,n.appendChild(c)}),n.value=i}function ri(t){Zi(t),Ji(t),eo(t),ro(t),to(t)}function Zi(t){t.getElementById("cmp-register").addEventListener("change",r=>{r.stopPropagation(),kt(t,"update")})}async function kt(t,e){let r=t.querySelector(".nav-cmp-detail"),n=t.getElementById("cmp-error"),i=t.getElementById("cmp-register"),o=i.closest(".ui-switch");r.classList.remove("cmp-enabled"),i.checked&&r.classList.add("cmp-loading");try{let s=i.dataset.id,u;e==="load"?u=await Gr({cmpId:s}):i.checked?(u=await Kr({cmpId:s}),te("registryUpdate"),ye("interaction",{type:"click",name:"register component",detail:s})):(u=await $r({cmpId:s}),te("registryUpdate"),ye("interaction",{type:"click",name:"unregister component",detail:s})),le(u),ue(t);let d=be(t,s);e==="update"&&d&&(i.checked?(r.classList.add("cmp-enabled"),Bt(t,\`<strong>\${d.name}</strong> is now registered in <strong>\${G.registryDisplayPath}</strong> and available for use in the Builder Visual Editor\`)):Bt(t,\`<strong>\${d.name}</strong> has been unregistered from <strong>\${G.registryDisplayPath}</strong> and removed from the Builder Visual Editor\`))}catch(s){console.error(s),n.innerHTML=\`<p class="error">Error loading components</p><p class="error">\${s.message||s}</p>\`,o.style.display="none"}r.classList.remove("cmp-loading")}function Ji(t){let e=t.getElementById("cmp-name"),r=e.closest(".ui-text-input"),n="",i;e.addEventListener("focus",o=>{clearTimeout(i),r.classList.remove("saved"),o.stopPropagation(),n=e.value}),e.addEventListener("blur",async o=>{if(o.stopPropagation(),clearTimeout(i),r.classList.remove("saved"),e.value!==n){if(e.value.trim().length<3){e.value=n;return}r.classList.add("saved"),i=setTimeout(()=>{r.classList.remove("saved")},3e3);let s=e.dataset.id,u=await Wr({cmpId:s,name:e.value});te("registryUpdate"),le(u),ue(t),be(t,s)}}),e.addEventListener("keyup",o=>{o.stopPropagation(),clearTimeout(i),r.classList.remove("saved"),o.key==="Escape"?(e.value=n,e.blur()):o.key==="Enter"&&e.blur()})}function be(t,e){let r=G.components.find(a=>a.id===e);if(!r)return null;let n=t.getElementById("cmp-register"),i=t.getElementById("cmp-error"),o=n.closest(".ui-switch");o.style.display="",i.innerHTML="",n.dataset.id=r.id,n.checked=!!r.isRegistered;let s=t.querySelector(".nav-cmp-detail");r.isRegistered?s.classList.add("cmp-enabled"):s.classList.remove("cmp-enabled");let u=t.getElementById("cmp-name");u.dataset.id=r.id,u.value=r.name;let d=t.getElementById("cmp-open-source");d.innerText=\`Open \${r.displayFilePath}\`,d.dataset.id=r.id;let p=t.getElementById("cmp-detail-title");return p.innerText=\`\${r.name} Component\`,no(t,r),r}function eo(t){t.getElementById("cmp-open-source").addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let n=r.target,i=G.components.find(o=>o.id===n?.dataset.id);i&&(De({filePath:i.filePath}),ye("interaction",{type:"click",name:"open component source file",detail:i.filePath}))})}function to(t){t.getElementById("btn-inputs-reload").addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),kt(t,"load")})}function ro(t){t.getElementById("cmp-detail-inputs").addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let i=r.target?.closest("button"),o=i?.dataset.id,s=i?.dataset.propName;Je(t,o,s)&&oe(t,"nav-cmp-input")})}function no(t,e){let r=t.getElementById("cmp-detail-inputs"),n=e.inputs.filter(i=>!i.hideFromUI);n.length>0?(r.innerHTML="",n.forEach(i=>{r.appendChild(io(e,i))})):r.innerHTML=\`<p class="cmp-inputs-empty">\${e.name} component does not have any props</p>\`}function io(t,e){let r=document.createElement("button");r.dataset.id=t.id,r.dataset.propName=e.name,r.className="cmp-input-item nav-list-item",e.isRegistered||r.classList.add("cmp-input-item-unregistered");let n=document.createElement("span"),i=ft(e.type);n.className=\`nav-list-item-icon input-icon input-icon-\${i}\`,r.appendChild(n);let o=document.createElement("span");o.innerText=e.friendlyName||e.name,r.appendChild(o);let s=document.createElement("span");return s.className="nav-list-item-note",s.innerText=e.type,r.appendChild(s),r}function oi(t){t.getElementById("open-builder-registry").addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),De({filePath:G.registryPath,line:1,column:1})}),t.getElementById("cmp-list").addEventListener("click",o=>{o.preventDefault(),o.stopPropagation();let u=o.target?.dataset.id,d=G.components.find(p=>p.id===u);if(d){let p=t.querySelector(".nav-cmp-detail .section-content");p.scrollTop=0,be(t,d.id),oe(t,"nav-cmp-detail"),d.isRegistered&&kt(t,"load")}});let n=t.getElementById("component-search"),i=t.getElementById("clear-search");n?.addEventListener("input",o=>{let s=o.target.value.toLowerCase(),u=s?G.components.filter(d=>d.name.toLowerCase().includes(s)||d.displayFilePath?.toLowerCase().includes(s)):G.components;ue(t,u),i.style.display=s?"flex":"none"}),i?.addEventListener("click",()=>{n.value="",ue(t),i.style.display="none"}),n?.addEventListener("keydown",o=>{o.key==="Escape"&&(n.value="",ue(t),i.style.display="none")})}function si(t){let e=jr();oo(t,e)}async function oo(t,e){let r=t.getElementById("cmp-list"),n=t.querySelector(".nav-cmp-list");n.classList.add("nav-loading");let i=t.getElementById("open-builder-registry");try{let o=await e;le(o),ue(t),G.registryDisplayPath?i.innerText="Open "+o.registryDisplayPath:i.innerText=""}catch(o){r.innerHTML=\`<p class="error">Error loading components</p><p class="error">\${o.message||o}</p>\`,console.error(o)}n.classList.remove("nav-loading")}function ue(t,e){let r=t.getElementById("cmp-list");r.innerHTML="";let n=e||G.components,i=n.filter(s=>s.isRegistered),o=n.filter(s=>!s.isRegistered);if(e&&e.length===0){let s=document.createElement("p");s.className="no-results",s.innerText="No matching components found",r.appendChild(s);return}ni(r,"Registered Components",i),ni(r,"Unregistered Components",o)}function ni(t,e,r){if(r.length>0){let n=document.createElement("h4");n.innerText=e,t.appendChild(n),r.forEach(i=>{t.appendChild(so(i))})}}function so(t){let e=document.getElementById("component-search")?.value.toLowerCase(),r=document.createElement("button");r.dataset.id=t.id,r.className="cmp-item nav-list-item",t.isRegistered&&r.classList.add("registered");let n=document.createElement("span");n.className="nav-list-item-icon",t.image&&(n.style.backgroundImage=\`url(\${t.image})\`),r.appendChild(n);let i=document.createElement("span");i.className="nav-list-item-name",i.innerHTML=ii(t.name,e),r.appendChild(i);let o=document.createElement("span");return o.className="nav-list-item-note",o.innerHTML=ii(t.displayFilePath||"",e),r.appendChild(o),r}function ii(t,e){if(!e)return t;let r=new RegExp(\`(\${e})\`,"gi");return t.replace(r,'<span class="search-highlight">$1</span>')}var ai=t=>{t.querySelector(".menu-toggle").addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),Ee(t,!0)}),t.getElementById("close").addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),Ee(t,!1)}),t.getElementById("hit").addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),Ee(t,!1)}),Ar(t),t.addEventListener("click",e=>e.stopPropagation()),ao(t)},Ee=(t,e)=>{e?(document.body.classList.add("builder-no-scroll"),t.host.classList.add("show-builder-menu"),te("menuOpen"),Lr("menuOpened"),ye("interaction",{type:"click",name:"open dev-tools menu"})):(document.body.classList.remove("builder-no-scroll"),t.host.classList.remove("show-builder-menu"),te("menuClose"),setTimeout(()=>{oe(t,"nav-home")},300)),Yr(e)},ao=t=>{if(!xr("menuOpened")){uo(t);return}let e=Ze();if(!((Date.now()-e.firstVisitTs)/1e3/60<10)&&!xr("feedback")){Lr("feedback"),co(t);return}},uo=t=>{let e=document.createElement("a");e.classList.add("menu-toggle-tooltip"),e.href="#open-dev-tools",e.innerHTML=\`
48
48
  <div class="menu-toggle-tooltip-content">
49
49
  <h3>Open Builder Devtools</h3>
@@ -54,7 +54,7 @@ Restarting server after Builder Devtools update...
54
54
  <h3>How's Devtools working for you?</h3>
55
55
  <p>We'd love your feedback!</p>
56
56
  </div>
57
- \`,t.appendChild(e),setTimeout(()=>{e.classList.add("menu-toggle-tooltip-show"),e.addEventListener("click",()=>{e.classList.remove("menu-toggle-tooltip-show")})},1e3)};function ui(t){t.getElementById("go-to-builder").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(Nr(),"builder")}),t.getElementById("components-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();let u=t.querySelector(".nav-cmp-list .section-content");u.scrollTop=0,oe(t,"nav-cmp-list"),si(t)}),t.getElementById("settings-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),oe(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(je(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open("https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more")})}function ci(t){let e=t.getElementById("enable-edit");e.addEventListener("change",r=>{r.stopPropagation(),Ft(e.checked)}),e.checked=it(),Ft(e.checked)}var At=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=\`<style>*,*:before,*:after{box-sizing:border-box}:host{--background-color: rgba(40, 40, 40, 1);--primary-color: rgba(72, 161, 255, 1);--primary-color-subdued: rgb(72, 161, 255, .6);--primary-color-highlight: rgb(126, 188, 255);--primary-contrast-color: white;--edit-color: #1d74e2;--edit-color-highlight: #1c6bd1;--edit-color-alpha: rgb(72, 161, 255, .15);--error-color: #ff2b55;--text-color: white;--text-color-highlight: white;--border-color: #454545;--button-background-color-hover: rgba(255, 255, 255, .1);--menu-width: 320px;--transition-time: .15s;--font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-family:var(--font-family);line-height:1.6}button{cursor:pointer;color:var(--text-color);-webkit-tap-highlight-color:transparent}input,select,button{font-family:var(--font-family)}.menu-toggle{position:absolute;right:0;bottom:0;pointer-events:auto;padding:8px;background:transparent;border:none;appearance:none}.menu-toggle div{position:relative;width:64px;height:64px;pointer-events:none;border-radius:50%;background:#000;border:1px solid white;box-shadow:#00000054 0 0 8px}.menu-toggle:hover div{background-color:var(--background-color);border:1px solid rgb(220,220,220)}.menu-toggle svg{position:absolute;top:15px;left:15px;width:33px;height:32px}div.highlight-bg{position:absolute;top:-1px;left:-1px;background-color:#1a1a1a;pointer-events:none;transition:all .4s ease-out;opacity:0}.menu-toggle-highlight-no-transition div.highlight-bg{transition:none}.menu-toggle-highlight div.highlight-bg{opacity:1}.menu-toggle-tooltip{position:absolute;bottom:0;right:0;width:382px;height:72px;padding:0;text-align:left;appearance:none;background-color:transparent;border:none;pointer-events:none;transform:translate3d(320px,0,0);opacity:0;transition:all .15s ease-in-out;color:#fff}.menu-toggle-tooltip.menu-toggle-tooltip-show{pointer-events:auto;opacity:1;transform:translateZ(0)}.menu-toggle-tooltip-content{position:absolute;inset:0 95px 10px 0;padding:8px 12px;background-color:var(--primary-color);box-shadow:#00000054 0 0 20px;border-radius:2px}.menu-toggle-tooltip-content:before{content:"";position:absolute;bottom:15px;right:-6px;width:30px;height:30px;background-color:var(--primary-color);transform:rotate(45deg)}.menu-toggle-tooltip:hover .menu-toggle-tooltip-content,.menu-toggle-tooltip:hover .menu-toggle-tooltip-content:before{background-color:var(--primary-color-highlight)}.menu-toggle-tooltip-content h3{margin:0;font-size:16px}.menu-toggle-tooltip-content p{margin:0;font-size:12px}section{position:absolute;display:grid;grid-template-rows:64px auto 64px;top:0;left:0;width:100%;height:100%;padding:0;pointer-events:none}.section-content{margin:0;padding:0 0 10px;font-weight:300;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;overflow-y:auto}.section-content .error{color:var(--error-color);font-weight:700}section a{text-decoration:none;color:var(--text-color)}section h3,section p{margin-left:16px;margin-right:16px}.info{font-size:12px}ul.list{list-style:none;padding:0;margin:0}ul.list li{display:block;padding:0;margin:0}ul.list a,ul.list button{display:grid;grid-template-columns:24px auto;grid-gap:16px;padding:12px;margin:8px 0;border:none;background:transparent;appearance:none;width:100%;font-weight:300;text-align:left;text-decoration:none;color:var(--text-color)}ul.list a:hover,ul.list button:hover{text-decoration:none;color:var(--text-color);background-color:var(--button-background-color-hover)}ul.list a span,ul.list button span{display:block;font-size:16px;font-weight:500;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}header{position:relative;display:grid;grid-template-columns:44px 1fr;gap:8px;padding-left:8px;border-bottom:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}header>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-home header>div{margin-right:56px}header h2{margin:7px 0 0;font-size:18px;font-weight:500;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p{margin:2px 0 0;font-size:12px;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button{display:block;margin:0;padding:0;width:100%;font-size:12px;font-weight:300;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button:hover{text-decoration:underline;color:var(--primary-color)}.builder-logo{margin:12px 0 0 8px}#close{display:block;position:absolute;appearance:none;background:transparent;border:none;border-radius:50%;margin:0;padding:0;right:4px;top:8px;width:48px;height:48px;z-index:1;opacity:.7}#close:hover{opacity:1;background-color:var(--button-background-color-hover)}#close svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}.back-button{position:relative;display:block;margin:7px 0 0 -2px;width:48px;height:48px;background:transparent;border:none;appearance:none;border-radius:50%}.back-button:hover{background-color:var(--button-background-color-hover)}.back-button svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}footer{border-top:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}section.nav-cmp-list{grid-template-rows:64px auto 120px}footer a{text-decoration:underline;color:var(--primary-color)}footer a:hover{color:var(--primary-color);text-decoration:none}.nav-list{padding:2px 0}.nav-loading{pointer-events:none}.nav-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.nav-loading .nav-loading-icon{opacity:.5}.nav-list h4{margin:8px 8px 8px 10px;font-size:14px;font-weight:600}.nav-list .nav-list-item+h4{margin-top:30px}.nav-list-item{display:grid;grid-template-columns:1fr 1fr;gap:8px;position:relative;margin:2px 0;padding:8px 28px 8px 46px;width:100%;font-size:14px;font-weight:300;text-align:left;border:none;background:transparent;appearance:none}.nav-list-item:hover{background-color:var(--button-background-color-hover)}.nav-list-item-icon{position:absolute;top:4px;left:10px;width:24px;height:24px;object-fit:contain;filter:invert(100%);background-size:24px 24px;background-repeat:no-repeat;background-position:center center}.nav-list-item span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}.nav-list-item:after{display:block;position:absolute;content:"";background-image:url('data:image/svg+xml,<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L7 7L1 13" stroke="%23F2F2F2" stroke-opacity="0.5" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');background-repeat:no-repeat;background-position:12px 9px;top:0;right:0;width:32px;height:32px;pointer-events:none}.nav-list-item-note{opacity:0;font-size:12px;padding-top:1px;text-align:right}.nav-list-item:hover .nav-list-item-note{opacity:.5}.ui-select{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-select h3{margin:0;font-size:14px;font-weight:500}.ui-select p{margin:8px 0;font-size:12px;font-weight:300}.ui-select .select{position:relative;margin:8px 0;border-radius:4px;padding:0;line-height:1.1;overflow:hidden;border:1px solid var(--border-color)}.ui-select select{appearance:none;background-color:transparent;border:none;outline:none;padding:8px 32px 8px 8px;margin:0;width:100%;font-size:14px;cursor:pointer;text-overflow:ellipsis;opacity:.6;color:var(--text-color)}.ui-select .select:after{content:"";top:6px;right:5px;width:24px;height:24px;position:absolute;background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="%23F2F2F2" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>');background-repeat:no-repeat;background-position:center;pointer-events:none;opacity:.6}.ui-select .select:hover{border-color:var(--primary-color-subdued)}.ui-text-input .select:focus-within{border-color:var(--primary-color)}.ui-text-input .select:focus-within select{opacity:1}.spinner:after{content:" ";display:block;width:32px;height:32px;margin:0 auto;pointer-events:auto;border-radius:50%;border:3px solid var(--text-color);border-color:var(--text-color) transparent var(--text-color) transparent;animation:spinner .75s linear infinite}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ui-switch{display:grid;grid-template-columns:auto 48px;grid-gap:20px;margin:8px 0 16px;padding:8px 0 8px 16px;cursor:pointer}.ui-switch>*{pointer-events:none}.ui-switch input{display:none;visibility:hidden}.ui-switch .switcher{display:inline-block;border-radius:100px;width:35px;height:14px;background-color:#ccc;position:relative;top:6px;vertical-align:middle;cursor:pointer}.ui-switch input[type=checkbox]:checked+.switcher{background-color:var(--primary-color-subdued)}.ui-switch .switcher:before{content:"";display:block;width:20px;height:20px;background-color:var(--text-color);box-shadow:0 1px 3px #0009;border-radius:50%;position:absolute;top:-3px;left:0;margin-right:0;transition:all .15s}.ui-switch input[type=checkbox]:checked+.switcher:before{left:100%;margin-left:-20px;background-color:var(--primary-color)}.ui-switch h3{margin:0;font-size:14px;font-weight:500}.ui-switch p{margin:4px 0 0;font-size:12px;font-weight:300}.ui-text-input{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-text-input h3{margin:0;font-size:14px;font-weight:500}.ui-text-input p{margin:8px 0;font-size:12px;font-weight:300}.ui-text-input .input{position:relative;margin:8px 0;border:1px solid var(--border-color);border-radius:4px;background:transparent;padding:2px;overflow:hidden}.ui-text-input input{display:block;width:235px;font-size:14px;border:none;background:transparent;padding:6px;appearance:none;color:var(--text-color);opacity:.6;outline:none}.ui-text-input .input:hover{border-color:var(--primary-color-subdued)}.ui-text-input .input:focus-within{border-color:var(--primary-color)}.ui-text-input .input:focus-within input{opacity:1}.ui-text-input .input:after{content:"";position:absolute;top:5px;right:14px;width:8px;height:17px;border:2px solid rgba(51,181,51,1);border-top:none;border-left:none;transform:rotate(45deg);opacity:0;transition:opacity 80ms ease-in-out;pointer-events:none}.ui-text-input.saved .input:after{opacity:1}.ui-toast{position:fixed;bottom:8px;left:8px;right:8px;padding:6px 12px;font-size:14px;border-radius:4px;transform:translate3d(0,150%,0);opacity:0;transition:all var(--transition-time) ease-in-out;background-color:var(--primary-color-subdued);color:var(--text-color);pointer-events:none}.ui-toast.ui-toast-show{transform:translateZ(0);opacity:1;pointer-events:auto}[data-view=nav-home] .nav-home .section-content,[data-view=nav-cmp-list] .nav-cmp-list .section-content,[data-view=nav-cmp-detail] .nav-cmp-detail .section-content,[data-view=nav-cmp-input] .nav-cmp-input .section-content,[data-view=nav-settings] .nav-settings .section-content{transform:translateZ(0);pointer-events:auto}[data-view=nav-home] .nav-home header,[data-view=nav-home] .nav-home footer,[data-view=nav-cmp-list] .nav-cmp-list header,[data-view=nav-cmp-list] .nav-cmp-list footer,[data-view=nav-cmp-detail] .nav-cmp-detail header,[data-view=nav-cmp-detail] .nav-cmp-detail footer,[data-view=nav-cmp-input] .nav-cmp-input header,[data-view=nav-cmp-input] .nav-cmp-input footer,[data-view=nav-settings] .nav-settings header,[data-view=nav-settings] .nav-settings footer{opacity:1;pointer-events:auto}[data-view=nav-cmp-list] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-home .section-content,[data-view=nav-cmp-input] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-cmp-detail .section-content,[data-view=nav-settings] .nav-home .section-content{transform:translate3d(-105%,0,0)}.cmp-item .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.83 16.809C20.94 16.561 21 16.289 21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L7.988 3.99001M5.441 5.44801L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L18.544 18.56" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.532 10.538L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.27002 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 3L21 21" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');opacity:.3}.cmp-item.registered .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>');opacity:.8}.search-highlight{background-color:var(--primary-color-alpha);padding:0 2px;border-radius:2px;font-weight:500}.search-container{position:sticky;top:0;z-index:10;padding:12px 16px;background:var(--background-color);border-bottom:1px solid var(--border-color)}.search-input-wrapper{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:12px;color:var(--text-color-secondary);pointer-events:none}.component-search-input{width:100%;height:36px;padding:8px 36px;border:1px solid var(--border-color);border-radius:6px;background:var(--input-background);color:var(--text-color);font-size:14px;transition:border-color .2s,box-shadow .2s}.component-search-input:focus{outline:none;border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color-alpha)}.component-search-input::placeholder{color:var(--text-color-tertiary)}.clear-search-button{position:absolute;right:8px;padding:4px;color:var(--text-color-secondary);border:none;background:transparent;border-radius:4px;cursor:pointer;opacity:0;transition:opacity .2s,background-color .2s;display:flex;align-items:center;justify-content:center}.clear-search-button:hover{background-color:var(--hover-color)}.component-search-input:not(:placeholder-shown)+.clear-search-button{opacity:1}.no-results{padding:32px 16px;text-align:center;color:var(--text-color-secondary);font-size:14px}#cmp-detail{position:relative}.cmp-loading{pointer-events:none!important}.cmp-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.cmp-loading .cmp-loading-icon{opacity:.5}.cmp-cover{position:absolute;top:160px;left:0;width:100%;height:100vh;background:var(--background-color);transform:translateZ(0);pointer-events:none;display:none}[data-view=nav-cmp-detail] .cmp-cover{display:block;pointer-events:auto}.cmp-enabled .cmp-cover{transform:translate3d(0,105%,0);pointer-events:none}.section-ready .cmp-cover{transition:all var(--transition-time) ease-in-out}.cmp-detail-inputs-container{margin:8px 0 16px;padding:0}.cmp-detail-inputs-container h3{margin:0 0 6px;padding-left:16px;padding-right:8px;font-size:14px;font-weight:500;display:flex;justify-content:space-between;align-items:center}.cmp-detail-inputs-reload{font-weight:300;font-size:.9em;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmp-detail-inputs-reload:hover{text-decoration:underline;color:var(--primary-color)}.cmp-detail-inputs-container .cmp-inputs-empty{padding:0;margin-top:12px;font-size:12px;font-weight:300;opacity:.5;font-style:italic}.cmp-detail-inputs-container .nav-list-item-icon{opacity:.8;background-size:20px 20px;background-position:4px center}.input-icon{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>')}.input-icon-array{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-6a2 2 0 1 1 4 0v6"></path> <path d="M10 13h4"></path></svg>')}.input-icon-boolean{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16h2a2 2 0 1 0 0 -4h-2h2a2 2 0 1 0 0 -4h-2v8z"></path></svg>')}.input-icon-number{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-8l4 8v-8"></path></svg>')}.input-icon-object{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path></svg>')}.input-icon-string{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path></svg>')}.cmp-input-item-unregistered{opacity:.4}.cmp-input-item-unregistered .input-icon:after{content:"";position:absolute;top:11px;left:4px;width:20px;height:2px;background-color:#000;transform:rotate(-45deg)}.cmp-prop-info{border-bottom:1px solid var(--border-color)}.cmp-input-readonly{margin:16px 0;padding:0 16px;display:grid;grid-template-columns:50% 50%;gap:12px}.cmp-input-readonly h3{margin:0;font-size:14px;font-weight:500}.cmp-input-readonly span{margin-top:2px;font-size:12px;font-weight:300;opacity:.8}.cmp-input-detail{margin:16px 0}.cmp-input-detail a{color:var(--primary-color);text-decoration:none}.cmp-input-detail a:hover{text-decoration:underline}.input-cover{position:absolute;top:175px;left:0;width:100%;height:100%;background:var(--background-color);transform:translateZ(0);transition:all var(--transition-time) ease-in-out;pointer-events:auto}.input-enabled .input-cover{transform:translate3d(0,105%,0);pointer-events:none}.input-loading-icon{position:absolute;display:inline-block;top:190px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.input-loading .input-loading-icon{opacity:.5}:host{position:fixed;inset:0;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}aside{position:absolute;top:0;right:0;width:var(--menu-width);height:100%;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;background:var(--background-color);box-shadow:#000000c9 5px 0 20px;overflow:hidden;z-index:1}:host(.show-builder-menu) aside{pointer-events:auto;transform:translateZ(0)}#hit{position:absolute;inset:0;display:none}:host(.show-builder-menu) #hit{display:block;pointer-events:auto}#version{position:absolute;bottom:6px;right:6px;font-size:8px;color:#9b9b9b}</style><div id="hit"></div> <aside data-view="nav-home"> <section class="nav-home"> <header> <svg class="builder-logo" viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> <div> <h2 class="builder-home-title">Builder Devtools</h2> <p><button id="go-to-builder">Go to Builder</button></p> </div> <button id="close" aria-label="Close Menu"> <svg viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M18 6l-12 12" /> <path d="M6 6l12 12" /> </svg> </button> </header> <div class="section-content"> <ul class="list"> <li> <button id="components-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Components</span> </button> </li> <li> <button id="settings-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M10.325 4.317C10.751 2.561 13.249 2.561 13.675 4.317C13.7389 4.5808 13.8642 4.82578 14.0407 5.032C14.2172 5.23822 14.4399 5.39985 14.6907 5.50375C14.9414 5.60764 15.2132 5.65085 15.4838 5.62987C15.7544 5.60889 16.0162 5.5243 16.248 5.383C17.791 4.443 19.558 6.209 18.618 7.753C18.4769 7.98466 18.3924 8.24634 18.3715 8.51677C18.3506 8.78721 18.3938 9.05877 18.4975 9.30938C18.6013 9.55999 18.7627 9.78258 18.9687 9.95905C19.1747 10.1355 19.4194 10.2609 19.683 10.325C21.439 10.751 21.439 13.249 19.683 13.675C19.4192 13.7389 19.1742 13.8642 18.968 14.0407C18.7618 14.2172 18.6001 14.4399 18.4963 14.6907C18.3924 14.9414 18.3491 15.2132 18.3701 15.4838C18.3911 15.7544 18.4757 16.0162 18.617 16.248C19.557 17.791 17.791 19.558 16.247 18.618C16.0153 18.4769 15.7537 18.3924 15.4832 18.3715C15.2128 18.3506 14.9412 18.3938 14.6906 18.4975C14.44 18.6013 14.2174 18.7627 14.0409 18.9687C13.8645 19.1747 13.7391 19.4194 13.675 19.683C13.249 21.439 10.751 21.439 10.325 19.683C10.2611 19.4192 10.1358 19.1742 9.95929 18.968C9.7828 18.7618 9.56011 18.6001 9.30935 18.4963C9.05859 18.3924 8.78683 18.3491 8.51621 18.3701C8.24559 18.3911 7.98375 18.4757 7.752 18.617C6.209 19.557 4.442 17.791 5.382 16.247C5.5231 16.0153 5.60755 15.7537 5.62848 15.4832C5.64942 15.2128 5.60624 14.9412 5.50247 14.6906C5.3987 14.44 5.23726 14.2174 5.03127 14.0409C4.82529 13.8645 4.58056 13.7391 4.317 13.675C2.561 13.249 2.561 10.751 4.317 10.325C4.5808 10.2611 4.82578 10.1358 5.032 9.95929C5.23822 9.7828 5.39985 9.56011 5.50375 9.30935C5.60764 9.05859 5.65085 8.78683 5.62987 8.51621C5.60889 8.24559 5.5243 7.98375 5.383 7.752C4.443 6.209 6.209 4.442 7.753 5.382C8.753 5.99 10.049 5.452 10.325 4.317Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 12C9 12.7956 9.31607 13.5587 9.87868 14.1213C10.4413 14.6839 11.2044 15 12 15C12.7956 15 13.5587 14.6839 14.1213 14.1213C14.6839 13.5587 15 12.7956 15 12C15 11.2044 14.6839 10.4413 14.1213 9.87868C13.5587 9.31607 12.7956 9 12 9C11.2044 9 10.4413 9.31607 9.87868 9.87868C9.31607 10.4413 9 11.2044 9 12Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Settings</span> </button> </li> <li> <button id="add-page-link"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M14 3v4a1 1 0 0 0 1 1h4" /> <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /> <path d="M12 11l0 6" /> <path d="M9 14l6 0" /> </svg> <span>Add Builder Page</span> </button> </li> <li> <button id="import-from-figma"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-figma" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M15 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M6 3m0 3a3 3 0 0 1 3 -3h6a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-6a3 3 0 0 1 -3 -3z" /> <path d="M9 9a3 3 0 0 0 0 6h3m-3 0a3 3 0 1 0 3 3v-15" /> </svg> <span>Import From Figma</span> </button> </li> </ul> </div> <footer> <ul class="list"> <li> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform" target="_blank" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M11.013 17.0114L10.013 18.0114L2.513 10.5834C2.0183 10.102 1.62864 9.52342 1.36854 8.88404C1.10845 8.24466 0.983558 7.55836 1.00173 6.86834C1.01991 6.17832 1.18076 5.49954 1.47415 4.87474C1.76755 4.24994 2.18713 3.69266 2.70648 3.23799C3.22583 2.78331 3.8337 2.4411 4.49181 2.23289C5.14991 2.02468 5.844 1.95499 6.53036 2.02821C7.21673 2.10143 7.8805 2.31596 8.47987 2.65831C9.07925 3.00066 9.60124 3.46341 10.013 4.01741C10.8086 2.95654 11.9931 2.2552 13.3059 2.06766C14.6186 1.88012 15.9521 2.22176 17.013 3.01741C18.0739 3.81306 18.7752 4.99755 18.9627 6.3103C19.1503 7.62305 18.8086 8.95654 18.013 10.0174" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> <path d="M18.2006 19.8175L16.0286 20.9555C15.9642 20.989 15.8917 21.004 15.8192 20.9987C15.7467 20.9934 15.6771 20.9681 15.6182 20.9256C15.5593 20.8831 15.5134 20.825 15.4855 20.7579C15.4577 20.6907 15.4491 20.6172 15.4606 20.5455L15.8756 18.1345L14.1186 16.4275C14.0662 16.3768 14.0291 16.3123 14.0115 16.2416C13.9939 16.1708 13.9966 16.0965 14.0192 16.0271C14.0418 15.9578 14.0835 15.8962 14.1394 15.8494C14.1954 15.8026 14.2634 15.7725 14.3356 15.7625L16.7636 15.4105L17.8496 13.2175C17.8821 13.1521 17.9322 13.0972 17.9942 13.0588C18.0562 13.0204 18.1277 13 18.2006 13C18.2736 13 18.3451 13.0204 18.4071 13.0588C18.4691 13.0972 18.5191 13.1521 18.5516 13.2175L19.6376 15.4105L22.0656 15.7625C22.1377 15.7728 22.2054 15.8031 22.2611 15.85C22.3168 15.8968 22.3583 15.9583 22.3809 16.0275C22.4034 16.0967 22.4062 16.1708 22.3888 16.2415C22.3715 16.3122 22.3347 16.3766 22.2826 16.4275L20.5256 18.1345L20.9396 20.5445C20.9521 20.6163 20.9441 20.6902 20.9166 20.7578C20.8891 20.8254 20.8433 20.8839 20.7842 20.9267C20.7252 20.9695 20.6553 20.9949 20.5825 21C20.5098 21.005 20.4371 20.9896 20.3726 20.9555L18.2006 19.8175Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Give Feedback</span> </a> </li> </ul> <div id="version"></div> </footer> </section> <section class="nav-cmp-list"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div class="search-container"> <div class="search-input-wrapper"> <svg class="search-icon" viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M15.5 15.5L20 20M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z" /> </svg> <input type="text" id="component-search" class="component-search-input" placeholder="Search components..." autocomplete="off" spellcheck="false" /> <button id="clear-search" class="clear-search-button" type="button" aria-label="Clear search" > <svg viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M6 6l12 12M6 18L18 6" /> </svg> </button> </div> </div> <div> <h2>Custom Components</h2> <p> <button id="open-builder-registry"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-list" class="cmp-list nav-list"></div> </div> <div class="nav-loading-icon spinner"></div> <footer> <p class="info"> Expand on Builder's selection of built-in blocks by <a target="_blank" href="https://www.builder.io/c/docs/custom-components-intro" >registering components</a > from your codebase. This way, teammates can drag and drop your components within Builder's Visual Editor just like any other block. </p> </footer> </section> <section class="nav-cmp-detail"> <header> <button class="back-button" data-back="nav-cmp-list"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-detail-title"></h2> <p> <button id="cmp-open-source"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-error"></div> <label class="ui-switch"> <div> <h3>Register Component</h3> <p> Registers this component so it can be used within Builder Visual CMS </p> </div> <input type="checkbox" role="switch" id="cmp-register" /> <span class="switcher"></span> </label> <div id="cmp-detail"> <label class="ui-text-input"> <h3>Component Name</h3> <div class="input"> <input type="text" id="cmp-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="2" maxlength="30" required placeholder="e.g. My Counter" /> </div> <p> Unique name to identify this custom component within Builder. Press ESC to cancel </p> </label> <div class="cmp-detail-inputs-container"> <h3> <span>Builder Inputs (Props)</span> <button class="cmp-detail-inputs-reload" id="btn-inputs-reload"> Reload </button> </h3> <div id="cmp-detail-inputs"></div> </div> </div> </div> <div class="cmp-cover"></div> <div class="cmp-loading-icon spinner"></div> </section> <section class="nav-cmp-input"> <header> <button class="back-button" data-back="nav-cmp-detail"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-input-title"></h2> <p> <button id="input-open-source"></button> </p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable Input</h3> <p>Add this component prop as a Builder input</p> </div> <input type="checkbox" role="switch" id="input-register" /> <span class="switcher"></span> </label> <div class="cmp-prop-info"> <div class="cmp-input-readonly"> <h3>Prop Name</h3> <span id="cmp-prop-name"></span> </div> <div class="cmp-input-readonly"> <h3>Prop Type</h3> <span id="cmp-prop-type"></span> </div> </div> <div class="cmp-input-detail"> <label class="ui-text-input"> <h3>Builder Input Name</h3> <div class="input"> <input type="text" id="input-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="1" maxlength="30" required placeholder="e.g. Text" /> </div> <p> Friendly name to identify this component prop as a Builder input. Press ESC to cancel </p> </label> <label class="ui-select"> <h3>Builder Input Type</h3> <div class="select"> <select id="input-type"></select> </div> <p> Correlate to what editing UI is appropriate for this Builder input. <a href="https://www.builder.io/c/docs/custom-components-input-types" target="_blank" >Read more about input types.</a > </p> </label> </div> <div class="input-cover"></div> <div class="input-loading-icon spinner"></div> </div> </section> <section class="nav-settings"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2>Settings</h2> <p>Configure Builder's Devtools</p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable edit button in UI</h3> <p>Enables the edit button so you can edit content in Builder</p> </div> <input type="checkbox" role="switch" id="enable-edit" /> <span class="switcher"></span> </label> </div> </section> <div class="ui-toast" id="toast"></div> </aside> <button class="menu-toggle" aria-label="Toggle Builder Devtools"> <div> <div class="highlight-bg"></div> <svg viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> </div> </button>\`,ai(e),ui(e),oi(e),ri(e),ti(e),ci(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.19.6"}highlightOpener(){let e=this.shadowRoot.querySelector(".menu-toggle");e.classList.add("menu-toggle-highlight"),e.classList.add("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight")},20)},20)}};var lo=\`<style>*,*:before,*:after{box-sizing:border-box}html,body,:host{position:fixed;top:0;left:0;width:100%;height:100vh;z-index:2147483646;margin:0;padding:0;line-height:1.8;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background-color:#252525;color:#fff;transition:opacity .25s ease-in-out}:host([aria-hidden="true"]){opacity:0;pointer-events:none}main{position:absolute;top:0;left:0;width:100%;height:100vh}h1{margin-top:0;font-size:24px;font-weight:300;line-height:1.4}p{margin:20px 0;font-weight:300}button{cursor:pointer}aside{position:absolute;top:0;left:0;width:350px;height:100vh;padding:60px 0 0 50px;background-color:#121212}aside ul{margin:30px 0 0;padding:0;list-style:none}aside li{position:relative;margin:0;padding:20px 10px;font-weight:300}aside li.highlight{color:#48a1ff}aside li.active{font-weight:700}aside li .circle{position:absolute;top:20px;left:10px;width:24px;height:24px;border:3px solid white;border-radius:50%;font-size:14px}aside li.highlight .circle{border-color:#48a1ff}aside li.active .circle:after{content:"";position:absolute;top:3px;left:3px;width:12px;height:12px;border-radius:50%;background-color:#48a1ff}aside li.completed .circle{background-color:#48a1ff}aside li.completed .circle:after{content:"";position:absolute;top:2px;left:6px;width:6px;height:13px;border:3px solid black;border-top:none;border-left:none;transform:rotate(45deg)}aside li .line{position:absolute;top:44px;left:21px;width:3px;height:45px;background-color:#fff}aside li.completed .line{background-color:#48a1ff}aside li span{display:block;margin-left:44px}nav{margin-top:30px}section{position:absolute;top:135px;left:350px;padding:0 80px 0 140px;transition:opacity .15s ease-in-out}section[aria-hidden=true]{pointer-events:none;opacity:0}section h1,section p{min-width:300px;max-width:600px}.button{position:relative;display:inline-block;color:#fff;background-color:#48a1ff;border-radius:4px;text-decoration:none;padding:10px 40px 10px 20px;white-space:nowrap}.button:hover{background-color:#48a1ffd9}#button-icon{position:absolute;top:1px;right:5px;bottom:0;width:30px;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>');background-repeat:no-repeat;background-position:center;background-size:24px 24px}.button[aria-disabled=true]{opacity:.9;background-color:#ffffff4d;pointer-events:none;padding-right:60px}.button[aria-disabled=true] #button-icon{top:21px;right:29px;width:8px;height:8px;border-radius:4px;background:#fff;color:#fff;animation:dot-flashing .5s infinite linear alternate;animation-delay:.25s}.button[aria-disabled=true] #button-icon:before,.button[aria-disabled=true] #button-icon:after{content:"";display:inline-block;position:absolute;top:0}.button[aria-disabled=true] #button-icon:before{left:-12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:0s}.button[aria-disabled=true] #button-icon:after{left:12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:.5s}@keyframes dot-flashing{0%{background-color:#fff}50%,to{background-color:#ffffff4d}}.logo{margin-left:9px;background:url('data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>');background-repeat:no-repeat;width:150px;height:32px}@media (max-width: 840px){aside{width:250px;padding:60px 0 0 20px}section{left:250px;padding:0 80px}}@media (max-width: 590px){aside{width:230px;padding:60px 0 0 10px}section{left:230px;padding:0 40px}}#modified-files-message a{color:#cbcbcb;font-weight:300;text-decoration:underline}#modified-files-message a:hover{color:#fff;text-decoration:none}#restart-warning{border-radius:4px;padding:8px 16px;border:1px solid #fd6b3c;background:#fd6b3c1a}#react-router-steps{margin:0 0 5px;padding:0 20px}#need-help{color:#48a1ff;text-decoration:none}#router-message{border-radius:4px;padding:16px;border:1px solid #48a1ff}#router-finish-button{margin-top:12px}#router-checkbox-div{display:flex;align-items:center}#router-checkbox{margin-right:10px;width:15px;height:15px}#success-title{display:flex;align-items:center;gap:10px}#success-title .check-icon{display:inline-block;width:24px;height:24px;border:2px solid #28a745;border-radius:50%;position:relative}#success-title .check-icon:before{content:"";position:absolute;top:50%;left:50%;width:6px;height:12px;border:solid #28a745;border-width:0 2px 2px 0;transform:translate(-50%,-60%) rotate(45deg)}
57
+ \`,t.appendChild(e),setTimeout(()=>{e.classList.add("menu-toggle-tooltip-show"),e.addEventListener("click",()=>{e.classList.remove("menu-toggle-tooltip-show")})},1e3)};function ui(t){t.getElementById("go-to-builder").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(Nr(),"builder")}),t.getElementById("components-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();let u=t.querySelector(".nav-cmp-list .section-content");u.scrollTop=0,oe(t,"nav-cmp-list"),si(t)}),t.getElementById("settings-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),oe(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(je(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open("https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more")})}function ci(t){let e=t.getElementById("enable-edit");e.addEventListener("change",r=>{r.stopPropagation(),Ft(e.checked)}),e.checked=it(),Ft(e.checked)}var At=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=\`<style>*,*:before,*:after{box-sizing:border-box}:host{--background-color: rgba(40, 40, 40, 1);--primary-color: rgba(72, 161, 255, 1);--primary-color-subdued: rgb(72, 161, 255, .6);--primary-color-highlight: rgb(126, 188, 255);--primary-contrast-color: white;--edit-color: #1d74e2;--edit-color-highlight: #1c6bd1;--edit-color-alpha: rgb(72, 161, 255, .15);--error-color: #ff2b55;--text-color: white;--text-color-highlight: white;--border-color: #454545;--button-background-color-hover: rgba(255, 255, 255, .1);--menu-width: 320px;--transition-time: .15s;--font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-family:var(--font-family);line-height:1.6}button{cursor:pointer;color:var(--text-color);-webkit-tap-highlight-color:transparent}input,select,button{font-family:var(--font-family)}.menu-toggle{position:absolute;right:0;bottom:0;pointer-events:auto;padding:8px;background:transparent;border:none;appearance:none}.menu-toggle div{position:relative;width:64px;height:64px;pointer-events:none;border-radius:50%;background:#000;border:1px solid white;box-shadow:#00000054 0 0 8px}.menu-toggle:hover div{background-color:var(--background-color);border:1px solid rgb(220,220,220)}.menu-toggle svg{position:absolute;top:15px;left:15px;width:33px;height:32px}div.highlight-bg{position:absolute;top:-1px;left:-1px;background-color:#1a1a1a;pointer-events:none;transition:all .4s ease-out;opacity:0}.menu-toggle-highlight-no-transition div.highlight-bg{transition:none}.menu-toggle-highlight div.highlight-bg{opacity:1}.menu-toggle-tooltip{position:absolute;bottom:0;right:0;width:382px;height:72px;padding:0;text-align:left;appearance:none;background-color:transparent;border:none;pointer-events:none;transform:translate3d(320px,0,0);opacity:0;transition:all .15s ease-in-out;color:#fff}.menu-toggle-tooltip.menu-toggle-tooltip-show{pointer-events:auto;opacity:1;transform:translateZ(0)}.menu-toggle-tooltip-content{position:absolute;inset:0 95px 10px 0;padding:8px 12px;background-color:var(--primary-color);box-shadow:#00000054 0 0 20px;border-radius:2px}.menu-toggle-tooltip-content:before{content:"";position:absolute;bottom:15px;right:-6px;width:30px;height:30px;background-color:var(--primary-color);transform:rotate(45deg)}.menu-toggle-tooltip:hover .menu-toggle-tooltip-content,.menu-toggle-tooltip:hover .menu-toggle-tooltip-content:before{background-color:var(--primary-color-highlight)}.menu-toggle-tooltip-content h3{margin:0;font-size:16px}.menu-toggle-tooltip-content p{margin:0;font-size:12px}section{position:absolute;display:grid;grid-template-rows:64px auto 64px;top:0;left:0;width:100%;height:100%;padding:0;pointer-events:none}.section-content{margin:0;padding:0 0 10px;font-weight:300;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;overflow-y:auto}.section-content .error{color:var(--error-color);font-weight:700}section a{text-decoration:none;color:var(--text-color)}section h3,section p{margin-left:16px;margin-right:16px}.info{font-size:12px}ul.list{list-style:none;padding:0;margin:0}ul.list li{display:block;padding:0;margin:0}ul.list a,ul.list button{display:grid;grid-template-columns:24px auto;grid-gap:16px;padding:12px;margin:8px 0;border:none;background:transparent;appearance:none;width:100%;font-weight:300;text-align:left;text-decoration:none;color:var(--text-color)}ul.list a:hover,ul.list button:hover{text-decoration:none;color:var(--text-color);background-color:var(--button-background-color-hover)}ul.list a span,ul.list button span{display:block;font-size:16px;font-weight:500;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}header{position:relative;display:grid;grid-template-columns:44px 1fr;gap:8px;padding-left:8px;border-bottom:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}header>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-home header>div{margin-right:56px}header h2{margin:7px 0 0;font-size:18px;font-weight:500;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p{margin:2px 0 0;font-size:12px;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button{display:block;margin:0;padding:0;width:100%;font-size:12px;font-weight:300;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button:hover{text-decoration:underline;color:var(--primary-color)}.builder-logo{margin:12px 0 0 8px}#close{display:block;position:absolute;appearance:none;background:transparent;border:none;border-radius:50%;margin:0;padding:0;right:4px;top:8px;width:48px;height:48px;z-index:1;opacity:.7}#close:hover{opacity:1;background-color:var(--button-background-color-hover)}#close svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}.back-button{position:relative;display:block;margin:7px 0 0 -2px;width:48px;height:48px;background:transparent;border:none;appearance:none;border-radius:50%}.back-button:hover{background-color:var(--button-background-color-hover)}.back-button svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}footer{border-top:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}section.nav-cmp-list{grid-template-rows:64px auto 120px}footer a{text-decoration:underline;color:var(--primary-color)}footer a:hover{color:var(--primary-color);text-decoration:none}.nav-list{padding:2px 0}.nav-loading{pointer-events:none}.nav-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.nav-loading .nav-loading-icon{opacity:.5}.nav-list h4{margin:8px 8px 8px 10px;font-size:14px;font-weight:600}.nav-list .nav-list-item+h4{margin-top:30px}.nav-list-item{display:grid;grid-template-columns:1fr 1fr;gap:8px;position:relative;margin:2px 0;padding:8px 28px 8px 46px;width:100%;font-size:14px;font-weight:300;text-align:left;border:none;background:transparent;appearance:none}.nav-list-item:hover{background-color:var(--button-background-color-hover)}.nav-list-item-icon{position:absolute;top:4px;left:10px;width:24px;height:24px;object-fit:contain;filter:invert(100%);background-size:24px 24px;background-repeat:no-repeat;background-position:center center}.nav-list-item span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}.nav-list-item:after{display:block;position:absolute;content:"";background-image:url('data:image/svg+xml,<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L7 7L1 13" stroke="%23F2F2F2" stroke-opacity="0.5" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');background-repeat:no-repeat;background-position:12px 9px;top:0;right:0;width:32px;height:32px;pointer-events:none}.nav-list-item-note{opacity:0;font-size:12px;padding-top:1px;text-align:right}.nav-list-item:hover .nav-list-item-note{opacity:.5}.ui-select{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-select h3{margin:0;font-size:14px;font-weight:500}.ui-select p{margin:8px 0;font-size:12px;font-weight:300}.ui-select .select{position:relative;margin:8px 0;border-radius:4px;padding:0;line-height:1.1;overflow:hidden;border:1px solid var(--border-color)}.ui-select select{appearance:none;background-color:transparent;border:none;outline:none;padding:8px 32px 8px 8px;margin:0;width:100%;font-size:14px;cursor:pointer;text-overflow:ellipsis;opacity:.6;color:var(--text-color)}.ui-select .select:after{content:"";top:6px;right:5px;width:24px;height:24px;position:absolute;background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="%23F2F2F2" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>');background-repeat:no-repeat;background-position:center;pointer-events:none;opacity:.6}.ui-select .select:hover{border-color:var(--primary-color-subdued)}.ui-text-input .select:focus-within{border-color:var(--primary-color)}.ui-text-input .select:focus-within select{opacity:1}.spinner:after{content:" ";display:block;width:32px;height:32px;margin:0 auto;pointer-events:auto;border-radius:50%;border:3px solid var(--text-color);border-color:var(--text-color) transparent var(--text-color) transparent;animation:spinner .75s linear infinite}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ui-switch{display:grid;grid-template-columns:auto 48px;grid-gap:20px;margin:8px 0 16px;padding:8px 0 8px 16px;cursor:pointer}.ui-switch>*{pointer-events:none}.ui-switch input{display:none;visibility:hidden}.ui-switch .switcher{display:inline-block;border-radius:100px;width:35px;height:14px;background-color:#ccc;position:relative;top:6px;vertical-align:middle;cursor:pointer}.ui-switch input[type=checkbox]:checked+.switcher{background-color:var(--primary-color-subdued)}.ui-switch .switcher:before{content:"";display:block;width:20px;height:20px;background-color:var(--text-color);box-shadow:0 1px 3px #0009;border-radius:50%;position:absolute;top:-3px;left:0;margin-right:0;transition:all .15s}.ui-switch input[type=checkbox]:checked+.switcher:before{left:100%;margin-left:-20px;background-color:var(--primary-color)}.ui-switch h3{margin:0;font-size:14px;font-weight:500}.ui-switch p{margin:4px 0 0;font-size:12px;font-weight:300}.ui-text-input{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-text-input h3{margin:0;font-size:14px;font-weight:500}.ui-text-input p{margin:8px 0;font-size:12px;font-weight:300}.ui-text-input .input{position:relative;margin:8px 0;border:1px solid var(--border-color);border-radius:4px;background:transparent;padding:2px;overflow:hidden}.ui-text-input input{display:block;width:235px;font-size:14px;border:none;background:transparent;padding:6px;appearance:none;color:var(--text-color);opacity:.6;outline:none}.ui-text-input .input:hover{border-color:var(--primary-color-subdued)}.ui-text-input .input:focus-within{border-color:var(--primary-color)}.ui-text-input .input:focus-within input{opacity:1}.ui-text-input .input:after{content:"";position:absolute;top:5px;right:14px;width:8px;height:17px;border:2px solid rgba(51,181,51,1);border-top:none;border-left:none;transform:rotate(45deg);opacity:0;transition:opacity 80ms ease-in-out;pointer-events:none}.ui-text-input.saved .input:after{opacity:1}.ui-toast{position:fixed;bottom:8px;left:8px;right:8px;padding:6px 12px;font-size:14px;border-radius:4px;transform:translate3d(0,150%,0);opacity:0;transition:all var(--transition-time) ease-in-out;background-color:var(--primary-color-subdued);color:var(--text-color);pointer-events:none}.ui-toast.ui-toast-show{transform:translateZ(0);opacity:1;pointer-events:auto}[data-view=nav-home] .nav-home .section-content,[data-view=nav-cmp-list] .nav-cmp-list .section-content,[data-view=nav-cmp-detail] .nav-cmp-detail .section-content,[data-view=nav-cmp-input] .nav-cmp-input .section-content,[data-view=nav-settings] .nav-settings .section-content{transform:translateZ(0);pointer-events:auto}[data-view=nav-home] .nav-home header,[data-view=nav-home] .nav-home footer,[data-view=nav-cmp-list] .nav-cmp-list header,[data-view=nav-cmp-list] .nav-cmp-list footer,[data-view=nav-cmp-detail] .nav-cmp-detail header,[data-view=nav-cmp-detail] .nav-cmp-detail footer,[data-view=nav-cmp-input] .nav-cmp-input header,[data-view=nav-cmp-input] .nav-cmp-input footer,[data-view=nav-settings] .nav-settings header,[data-view=nav-settings] .nav-settings footer{opacity:1;pointer-events:auto}[data-view=nav-cmp-list] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-home .section-content,[data-view=nav-cmp-input] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-cmp-detail .section-content,[data-view=nav-settings] .nav-home .section-content{transform:translate3d(-105%,0,0)}.cmp-item .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.83 16.809C20.94 16.561 21 16.289 21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L7.988 3.99001M5.441 5.44801L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L18.544 18.56" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.532 10.538L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.27002 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 3L21 21" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');opacity:.3}.cmp-item.registered .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>');opacity:.8}.search-highlight{background-color:var(--primary-color-alpha);padding:0 2px;border-radius:2px;font-weight:500}.search-container{position:sticky;top:0;z-index:10;padding:12px 16px;background:var(--background-color);border-bottom:1px solid var(--border-color)}.search-input-wrapper{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:12px;color:var(--text-color-secondary);pointer-events:none}.component-search-input{width:100%;height:36px;padding:8px 36px;border:1px solid var(--border-color);border-radius:6px;background:var(--input-background);color:var(--text-color);font-size:14px;transition:border-color .2s,box-shadow .2s}.component-search-input:focus{outline:none;border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color-alpha)}.component-search-input::placeholder{color:var(--text-color-tertiary)}.clear-search-button{position:absolute;right:8px;padding:4px;color:var(--text-color-secondary);border:none;background:transparent;border-radius:4px;cursor:pointer;opacity:0;transition:opacity .2s,background-color .2s;display:flex;align-items:center;justify-content:center}.clear-search-button:hover{background-color:var(--hover-color)}.component-search-input:not(:placeholder-shown)+.clear-search-button{opacity:1}.no-results{padding:32px 16px;text-align:center;color:var(--text-color-secondary);font-size:14px}#cmp-detail{position:relative}.cmp-loading{pointer-events:none!important}.cmp-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.cmp-loading .cmp-loading-icon{opacity:.5}.cmp-cover{position:absolute;top:160px;left:0;width:100%;height:100vh;background:var(--background-color);transform:translateZ(0);pointer-events:none;display:none}[data-view=nav-cmp-detail] .cmp-cover{display:block;pointer-events:auto}.cmp-enabled .cmp-cover{transform:translate3d(0,105%,0);pointer-events:none}.section-ready .cmp-cover{transition:all var(--transition-time) ease-in-out}.cmp-detail-inputs-container{margin:8px 0 16px;padding:0}.cmp-detail-inputs-container h3{margin:0 0 6px;padding-left:16px;padding-right:8px;font-size:14px;font-weight:500;display:flex;justify-content:space-between;align-items:center}.cmp-detail-inputs-reload{font-weight:300;font-size:.9em;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmp-detail-inputs-reload:hover{text-decoration:underline;color:var(--primary-color)}.cmp-detail-inputs-container .cmp-inputs-empty{padding:0;margin-top:12px;font-size:12px;font-weight:300;opacity:.5;font-style:italic}.cmp-detail-inputs-container .nav-list-item-icon{opacity:.8;background-size:20px 20px;background-position:4px center}.input-icon{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>')}.input-icon-array{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-6a2 2 0 1 1 4 0v6"></path> <path d="M10 13h4"></path></svg>')}.input-icon-boolean{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16h2a2 2 0 1 0 0 -4h-2h2a2 2 0 1 0 0 -4h-2v8z"></path></svg>')}.input-icon-number{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-8l4 8v-8"></path></svg>')}.input-icon-object{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path></svg>')}.input-icon-string{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path></svg>')}.cmp-input-item-unregistered{opacity:.4}.cmp-input-item-unregistered .input-icon:after{content:"";position:absolute;top:11px;left:4px;width:20px;height:2px;background-color:#000;transform:rotate(-45deg)}.cmp-prop-info{border-bottom:1px solid var(--border-color)}.cmp-input-readonly{margin:16px 0;padding:0 16px;display:grid;grid-template-columns:50% 50%;gap:12px}.cmp-input-readonly h3{margin:0;font-size:14px;font-weight:500}.cmp-input-readonly span{margin-top:2px;font-size:12px;font-weight:300;opacity:.8}.cmp-input-detail{margin:16px 0}.cmp-input-detail a{color:var(--primary-color);text-decoration:none}.cmp-input-detail a:hover{text-decoration:underline}.input-cover{position:absolute;top:175px;left:0;width:100%;height:100%;background:var(--background-color);transform:translateZ(0);transition:all var(--transition-time) ease-in-out;pointer-events:auto}.input-enabled .input-cover{transform:translate3d(0,105%,0);pointer-events:none}.input-loading-icon{position:absolute;display:inline-block;top:190px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.input-loading .input-loading-icon{opacity:.5}:host{position:fixed;inset:0;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}aside{position:absolute;top:0;right:0;width:var(--menu-width);height:100%;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;background:var(--background-color);box-shadow:#000000c9 5px 0 20px;overflow:hidden;z-index:1}:host(.show-builder-menu) aside{pointer-events:auto;transform:translateZ(0)}#hit{position:absolute;inset:0;display:none}:host(.show-builder-menu) #hit{display:block;pointer-events:auto}#version{position:absolute;bottom:6px;right:6px;font-size:8px;color:#9b9b9b}</style><div id="hit"></div> <aside data-view="nav-home"> <section class="nav-home"> <header> <svg class="builder-logo" viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> <div> <h2 class="builder-home-title">Builder Devtools</h2> <p><button id="go-to-builder">Go to Builder</button></p> </div> <button id="close" aria-label="Close Menu"> <svg viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M18 6l-12 12" /> <path d="M6 6l12 12" /> </svg> </button> </header> <div class="section-content"> <ul class="list"> <li> <button id="components-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Components</span> </button> </li> <li> <button id="settings-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M10.325 4.317C10.751 2.561 13.249 2.561 13.675 4.317C13.7389 4.5808 13.8642 4.82578 14.0407 5.032C14.2172 5.23822 14.4399 5.39985 14.6907 5.50375C14.9414 5.60764 15.2132 5.65085 15.4838 5.62987C15.7544 5.60889 16.0162 5.5243 16.248 5.383C17.791 4.443 19.558 6.209 18.618 7.753C18.4769 7.98466 18.3924 8.24634 18.3715 8.51677C18.3506 8.78721 18.3938 9.05877 18.4975 9.30938C18.6013 9.55999 18.7627 9.78258 18.9687 9.95905C19.1747 10.1355 19.4194 10.2609 19.683 10.325C21.439 10.751 21.439 13.249 19.683 13.675C19.4192 13.7389 19.1742 13.8642 18.968 14.0407C18.7618 14.2172 18.6001 14.4399 18.4963 14.6907C18.3924 14.9414 18.3491 15.2132 18.3701 15.4838C18.3911 15.7544 18.4757 16.0162 18.617 16.248C19.557 17.791 17.791 19.558 16.247 18.618C16.0153 18.4769 15.7537 18.3924 15.4832 18.3715C15.2128 18.3506 14.9412 18.3938 14.6906 18.4975C14.44 18.6013 14.2174 18.7627 14.0409 18.9687C13.8645 19.1747 13.7391 19.4194 13.675 19.683C13.249 21.439 10.751 21.439 10.325 19.683C10.2611 19.4192 10.1358 19.1742 9.95929 18.968C9.7828 18.7618 9.56011 18.6001 9.30935 18.4963C9.05859 18.3924 8.78683 18.3491 8.51621 18.3701C8.24559 18.3911 7.98375 18.4757 7.752 18.617C6.209 19.557 4.442 17.791 5.382 16.247C5.5231 16.0153 5.60755 15.7537 5.62848 15.4832C5.64942 15.2128 5.60624 14.9412 5.50247 14.6906C5.3987 14.44 5.23726 14.2174 5.03127 14.0409C4.82529 13.8645 4.58056 13.7391 4.317 13.675C2.561 13.249 2.561 10.751 4.317 10.325C4.5808 10.2611 4.82578 10.1358 5.032 9.95929C5.23822 9.7828 5.39985 9.56011 5.50375 9.30935C5.60764 9.05859 5.65085 8.78683 5.62987 8.51621C5.60889 8.24559 5.5243 7.98375 5.383 7.752C4.443 6.209 6.209 4.442 7.753 5.382C8.753 5.99 10.049 5.452 10.325 4.317Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 12C9 12.7956 9.31607 13.5587 9.87868 14.1213C10.4413 14.6839 11.2044 15 12 15C12.7956 15 13.5587 14.6839 14.1213 14.1213C14.6839 13.5587 15 12.7956 15 12C15 11.2044 14.6839 10.4413 14.1213 9.87868C13.5587 9.31607 12.7956 9 12 9C11.2044 9 10.4413 9.31607 9.87868 9.87868C9.31607 10.4413 9 11.2044 9 12Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Settings</span> </button> </li> <li> <button id="add-page-link"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M14 3v4a1 1 0 0 0 1 1h4" /> <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /> <path d="M12 11l0 6" /> <path d="M9 14l6 0" /> </svg> <span>Add Builder Page</span> </button> </li> <li> <button id="import-from-figma"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-figma" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M15 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M6 3m0 3a3 3 0 0 1 3 -3h6a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-6a3 3 0 0 1 -3 -3z" /> <path d="M9 9a3 3 0 0 0 0 6h3m-3 0a3 3 0 1 0 3 3v-15" /> </svg> <span>Import From Figma</span> </button> </li> </ul> </div> <footer> <ul class="list"> <li> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform" target="_blank" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M11.013 17.0114L10.013 18.0114L2.513 10.5834C2.0183 10.102 1.62864 9.52342 1.36854 8.88404C1.10845 8.24466 0.983558 7.55836 1.00173 6.86834C1.01991 6.17832 1.18076 5.49954 1.47415 4.87474C1.76755 4.24994 2.18713 3.69266 2.70648 3.23799C3.22583 2.78331 3.8337 2.4411 4.49181 2.23289C5.14991 2.02468 5.844 1.95499 6.53036 2.02821C7.21673 2.10143 7.8805 2.31596 8.47987 2.65831C9.07925 3.00066 9.60124 3.46341 10.013 4.01741C10.8086 2.95654 11.9931 2.2552 13.3059 2.06766C14.6186 1.88012 15.9521 2.22176 17.013 3.01741C18.0739 3.81306 18.7752 4.99755 18.9627 6.3103C19.1503 7.62305 18.8086 8.95654 18.013 10.0174" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> <path d="M18.2006 19.8175L16.0286 20.9555C15.9642 20.989 15.8917 21.004 15.8192 20.9987C15.7467 20.9934 15.6771 20.9681 15.6182 20.9256C15.5593 20.8831 15.5134 20.825 15.4855 20.7579C15.4577 20.6907 15.4491 20.6172 15.4606 20.5455L15.8756 18.1345L14.1186 16.4275C14.0662 16.3768 14.0291 16.3123 14.0115 16.2416C13.9939 16.1708 13.9966 16.0965 14.0192 16.0271C14.0418 15.9578 14.0835 15.8962 14.1394 15.8494C14.1954 15.8026 14.2634 15.7725 14.3356 15.7625L16.7636 15.4105L17.8496 13.2175C17.8821 13.1521 17.9322 13.0972 17.9942 13.0588C18.0562 13.0204 18.1277 13 18.2006 13C18.2736 13 18.3451 13.0204 18.4071 13.0588C18.4691 13.0972 18.5191 13.1521 18.5516 13.2175L19.6376 15.4105L22.0656 15.7625C22.1377 15.7728 22.2054 15.8031 22.2611 15.85C22.3168 15.8968 22.3583 15.9583 22.3809 16.0275C22.4034 16.0967 22.4062 16.1708 22.3888 16.2415C22.3715 16.3122 22.3347 16.3766 22.2826 16.4275L20.5256 18.1345L20.9396 20.5445C20.9521 20.6163 20.9441 20.6902 20.9166 20.7578C20.8891 20.8254 20.8433 20.8839 20.7842 20.9267C20.7252 20.9695 20.6553 20.9949 20.5825 21C20.5098 21.005 20.4371 20.9896 20.3726 20.9555L18.2006 19.8175Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Give Feedback</span> </a> </li> </ul> <div id="version"></div> </footer> </section> <section class="nav-cmp-list"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div class="search-container"> <div class="search-input-wrapper"> <svg class="search-icon" viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M15.5 15.5L20 20M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z" /> </svg> <input type="text" id="component-search" class="component-search-input" placeholder="Search components..." autocomplete="off" spellcheck="false" /> <button id="clear-search" class="clear-search-button" type="button" aria-label="Clear search" > <svg viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M6 6l12 12M6 18L18 6" /> </svg> </button> </div> </div> <div> <h2>Custom Components</h2> <p> <button id="open-builder-registry"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-list" class="cmp-list nav-list"></div> </div> <div class="nav-loading-icon spinner"></div> <footer> <p class="info"> Expand on Builder's selection of built-in blocks by <a target="_blank" href="https://www.builder.io/c/docs/custom-components-intro" >registering components</a > from your codebase. This way, teammates can drag and drop your components within Builder's Visual Editor just like any other block. </p> </footer> </section> <section class="nav-cmp-detail"> <header> <button class="back-button" data-back="nav-cmp-list"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-detail-title"></h2> <p> <button id="cmp-open-source"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-error"></div> <label class="ui-switch"> <div> <h3>Register Component</h3> <p> Registers this component so it can be used within Builder Visual CMS </p> </div> <input type="checkbox" role="switch" id="cmp-register" /> <span class="switcher"></span> </label> <div id="cmp-detail"> <label class="ui-text-input"> <h3>Component Name</h3> <div class="input"> <input type="text" id="cmp-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="2" maxlength="30" required placeholder="e.g. My Counter" /> </div> <p> Unique name to identify this custom component within Builder. Press ESC to cancel </p> </label> <div class="cmp-detail-inputs-container"> <h3> <span>Builder Inputs (Props)</span> <button class="cmp-detail-inputs-reload" id="btn-inputs-reload"> Reload </button> </h3> <div id="cmp-detail-inputs"></div> </div> </div> </div> <div class="cmp-cover"></div> <div class="cmp-loading-icon spinner"></div> </section> <section class="nav-cmp-input"> <header> <button class="back-button" data-back="nav-cmp-detail"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-input-title"></h2> <p> <button id="input-open-source"></button> </p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable Input</h3> <p>Add this component prop as a Builder input</p> </div> <input type="checkbox" role="switch" id="input-register" /> <span class="switcher"></span> </label> <div class="cmp-prop-info"> <div class="cmp-input-readonly"> <h3>Prop Name</h3> <span id="cmp-prop-name"></span> </div> <div class="cmp-input-readonly"> <h3>Prop Type</h3> <span id="cmp-prop-type"></span> </div> </div> <div class="cmp-input-detail"> <label class="ui-text-input"> <h3>Builder Input Name</h3> <div class="input"> <input type="text" id="input-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="1" maxlength="30" required placeholder="e.g. Text" /> </div> <p> Friendly name to identify this component prop as a Builder input. Press ESC to cancel </p> </label> <label class="ui-select"> <h3>Builder Input Type</h3> <div class="select"> <select id="input-type"></select> </div> <p> Correlate to what editing UI is appropriate for this Builder input. <a href="https://www.builder.io/c/docs/custom-components-input-types" target="_blank" >Read more about input types.</a > </p> </label> </div> <div class="input-cover"></div> <div class="input-loading-icon spinner"></div> </div> </section> <section class="nav-settings"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2>Settings</h2> <p>Configure Builder's Devtools</p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable edit button in UI</h3> <p>Enables the edit button so you can edit content in Builder</p> </div> <input type="checkbox" role="switch" id="enable-edit" /> <span class="switcher"></span> </label> </div> </section> <div class="ui-toast" id="toast"></div> </aside> <button class="menu-toggle" aria-label="Toggle Builder Devtools"> <div> <div class="highlight-bg"></div> <svg viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> </div> </button>\`,ai(e),ui(e),oi(e),ri(e),ti(e),ci(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.19.7"}highlightOpener(){let e=this.shadowRoot.querySelector(".menu-toggle");e.classList.add("menu-toggle-highlight"),e.classList.add("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight")},20)},20)}};var lo=\`<style>*,*:before,*:after{box-sizing:border-box}html,body,:host{position:fixed;top:0;left:0;width:100%;height:100vh;z-index:2147483646;margin:0;padding:0;line-height:1.8;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background-color:#252525;color:#fff;transition:opacity .25s ease-in-out}:host([aria-hidden="true"]){opacity:0;pointer-events:none}main{position:absolute;top:0;left:0;width:100%;height:100vh}h1{margin-top:0;font-size:24px;font-weight:300;line-height:1.4}p{margin:20px 0;font-weight:300}button{cursor:pointer}aside{position:absolute;top:0;left:0;width:350px;height:100vh;padding:60px 0 0 50px;background-color:#121212}aside ul{margin:30px 0 0;padding:0;list-style:none}aside li{position:relative;margin:0;padding:20px 10px;font-weight:300}aside li.highlight{color:#48a1ff}aside li.active{font-weight:700}aside li .circle{position:absolute;top:20px;left:10px;width:24px;height:24px;border:3px solid white;border-radius:50%;font-size:14px}aside li.highlight .circle{border-color:#48a1ff}aside li.active .circle:after{content:"";position:absolute;top:3px;left:3px;width:12px;height:12px;border-radius:50%;background-color:#48a1ff}aside li.completed .circle{background-color:#48a1ff}aside li.completed .circle:after{content:"";position:absolute;top:2px;left:6px;width:6px;height:13px;border:3px solid black;border-top:none;border-left:none;transform:rotate(45deg)}aside li .line{position:absolute;top:44px;left:21px;width:3px;height:45px;background-color:#fff}aside li.completed .line{background-color:#48a1ff}aside li span{display:block;margin-left:44px}nav{margin-top:30px}section{position:absolute;top:135px;left:350px;padding:0 80px 0 140px;transition:opacity .15s ease-in-out}section[aria-hidden=true]{pointer-events:none;opacity:0}section h1,section p{min-width:300px;max-width:600px}.button{position:relative;display:inline-block;color:#fff;background-color:#48a1ff;border-radius:4px;text-decoration:none;padding:10px 40px 10px 20px;white-space:nowrap}.button:hover{background-color:#48a1ffd9}#button-icon{position:absolute;top:1px;right:5px;bottom:0;width:30px;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>');background-repeat:no-repeat;background-position:center;background-size:24px 24px}.button[aria-disabled=true]{opacity:.9;background-color:#ffffff4d;pointer-events:none;padding-right:60px}.button[aria-disabled=true] #button-icon{top:21px;right:29px;width:8px;height:8px;border-radius:4px;background:#fff;color:#fff;animation:dot-flashing .5s infinite linear alternate;animation-delay:.25s}.button[aria-disabled=true] #button-icon:before,.button[aria-disabled=true] #button-icon:after{content:"";display:inline-block;position:absolute;top:0}.button[aria-disabled=true] #button-icon:before{left:-12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:0s}.button[aria-disabled=true] #button-icon:after{left:12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:.5s}@keyframes dot-flashing{0%{background-color:#fff}50%,to{background-color:#ffffff4d}}.logo{margin-left:9px;background:url('data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>');background-repeat:no-repeat;width:150px;height:32px}@media (max-width: 840px){aside{width:250px;padding:60px 0 0 20px}section{left:250px;padding:0 80px}}@media (max-width: 590px){aside{width:230px;padding:60px 0 0 10px}section{left:230px;padding:0 40px}}#modified-files-message a{color:#cbcbcb;font-weight:300;text-decoration:underline}#modified-files-message a:hover{color:#fff;text-decoration:none}#restart-warning{border-radius:4px;padding:8px 16px;border:1px solid #fd6b3c;background:#fd6b3c1a}#react-router-steps{margin:0 0 5px;padding:0 20px}#need-help{color:#48a1ff;text-decoration:none}#router-message{border-radius:4px;padding:16px;border:1px solid #48a1ff}#router-finish-button{margin-top:12px}#router-checkbox-div{display:flex;align-items:center}#router-checkbox{margin-right:10px;width:15px;height:15px}#success-title{display:flex;align-items:center;gap:10px}#success-title .check-icon{display:inline-block;width:24px;height:24px;border:2px solid #28a745;border-radius:50%;position:relative}#success-title .check-icon:before{content:"";position:absolute;top:50%;left:50%;width:6px;height:12px;border:solid #28a745;border-width:0 2px 2px 0;transform:translate(-50%,-60%) rotate(45deg)}
58
58
  </style>\`,Dt=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=lo+\`<main>
59
59
  <aside>
60
60
  <div class="logo"></div>
@@ -93,7 +93,7 @@ Restarting server after Builder Devtools update...
93
93
  </nav>
94
94
  </section>
95
95
  </main>
96
- \`,po();let r=new URL(Vr,ot);r.searchParams.set(Mr,location.href);let n=e.querySelectorAll(".next-step");for(let i of n)i.setAttribute("href",r.href);ye("overview step viewed")}},po=()=>{let t=document.head.querySelector("link[rel='icon'], link[rel='icon shortcut']");t?(t.href="https://cdn.builder.io/favicon.ico",t.removeAttribute("type")):(t=document.createElement("link"),t.rel="icon",t.href="https://cdn.builder.io/favicon.ico",document.head.appendChild(t))};var li=async()=>{(await qr()).isValid||fo()},fo=()=>{customElements.get("builder-dev-tools-overview")||customElements.define("builder-dev-tools-overview",Dt);let t=document.querySelector("builder-dev-tools-overview");t||(t=document.createElement("builder-dev-tools-overview"),t.setAttribute("aria-hidden","true"),document.body.appendChild(t)),setTimeout(()=>{t.removeAttribute("aria-hidden")},32)};var mo=()=>{try{customElements.get("builder-dev-tools-edit")||customElements.define("builder-dev-tools-edit",st),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",At);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.19.6"),document.body.appendChild(t));let e=document.querySelector("builder-dev-tools-edit");e||(e=document.createElement("builder-dev-tools-edit"),document.body.appendChild(e));let r=document.getElementById("builder-dev-tools-style");r||(r=document.createElement("style"),r.id="builder-dev-tools-style",r.innerHTML=".builder-no-scroll{overflow:hidden !important}",document.head.appendChild(r)),li(),Jn()}catch(t){console.error("Builder Devtools:",t)}};window.location===window.parent.location&&(console.debug("Builder.io Devtools v1.19.6"),mo());})();`)}async function fg(e){return mg(e,`<!doctype html>
96
+ \`,po();let r=new URL(Vr,ot);r.searchParams.set(Mr,location.href);let n=e.querySelectorAll(".next-step");for(let i of n)i.setAttribute("href",r.href);ye("overview step viewed")}},po=()=>{let t=document.head.querySelector("link[rel='icon'], link[rel='icon shortcut']");t?(t.href="https://cdn.builder.io/favicon.ico",t.removeAttribute("type")):(t=document.createElement("link"),t.rel="icon",t.href="https://cdn.builder.io/favicon.ico",document.head.appendChild(t))};var li=async()=>{(await qr()).isValid||fo()},fo=()=>{customElements.get("builder-dev-tools-overview")||customElements.define("builder-dev-tools-overview",Dt);let t=document.querySelector("builder-dev-tools-overview");t||(t=document.createElement("builder-dev-tools-overview"),t.setAttribute("aria-hidden","true"),document.body.appendChild(t)),setTimeout(()=>{t.removeAttribute("aria-hidden")},32)};var mo=()=>{try{customElements.get("builder-dev-tools-edit")||customElements.define("builder-dev-tools-edit",st),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",At);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.19.7"),document.body.appendChild(t));let e=document.querySelector("builder-dev-tools-edit");e||(e=document.createElement("builder-dev-tools-edit"),document.body.appendChild(e));let r=document.getElementById("builder-dev-tools-style");r||(r=document.createElement("style"),r.id="builder-dev-tools-style",r.innerHTML=".builder-no-scroll{overflow:hidden !important}",document.head.appendChild(r)),li(),Jn()}catch(t){console.error("Builder Devtools:",t)}};window.location===window.parent.location&&(console.debug("Builder.io Devtools v1.19.7"),mo());})();`)}async function mg(e){return gg(e,`<!doctype html>
97
97
  <html lang="en" dir="ltr">
98
98
  <head>
99
99
  <meta charset="utf-8" />
@@ -259,41 +259,41 @@ Restarting server after Builder Devtools update...
259
259
  </script>
260
260
  </body>
261
261
  </html>
262
- `)}async function mg(e,t){let r=await Km(e),n=e.getFrameworks();return t.replace(/__LOCAL_APP_ID__/g,r).replace(/__DEV_TOOLS_URL__/g,e.devToolsServerUrl).replace(/__CLIENT_ID__/g,e.getClientId()).replace(/__FRAMEWORK__/g,n.length?n[0].name:"")}import{platform as E_}from"node:os";async function gg(e,t){let r=new URL("/cli-auth","https://builder.io");r.searchParams.set("client_id",e.getClientId()),r.searchParams.set("host",await e.getDeviceId()),r.searchParams.set("response_type","code"),r.searchParams.set("cli","true");let n=new URL(zn,e.devToolsServerUrl);n.searchParams.set(Qs,E_()),n.searchParams.set(Xs,process.versions.node);let o=e.getFrameworks();return o.length>0&&(r.searchParams.set(yo,o[0].name),n.searchParams.set(yo,o[0].name)),r.searchParams.set("redirect_url",n.href),r.searchParams.set("preview_url",t),r.href}import{createServer as E8}from"http";import{platform as P8}from"node:os";import{dirname as LP,join as yn}from"node:path";import{existsSync as Mm,mkdirSync as zP,readFileSync as UP,writeFileSync as rc}from"node:fs";var Qt=Ue(oa(),1);import{stdin as $_,stdout as k_}from"node:process";import vg from"node:readline";import{Writable as R_}from"node:stream";function I_({onlyFirst:e=!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,e?void 0:"g")}var N_=I_();function Ag(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(N_,"")}function Fg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tg={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(n){var o=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,i=o;return 55296<=o&&o<=56319&&56320<=s&&s<=57343&&(o&=1023,s&=1023,i=o<<10|s,i+=65536),i==12288||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":i==8361||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||i==172||i==175||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":i==161||i==164||167<=i&&i<=168||i==170||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||i==198||i==208||215<=i&&i<=216||222<=i&&i<=225||i==230||232<=i&&i<=234||236<=i&&i<=237||i==240||242<=i&&i<=243||247<=i&&i<=250||i==252||i==254||i==257||i==273||i==275||i==283||294<=i&&i<=295||i==299||305<=i&&i<=307||i==312||319<=i&&i<=322||i==324||328<=i&&i<=331||i==333||338<=i&&i<=339||358<=i&&i<=359||i==363||i==462||i==464||i==466||i==468||i==470||i==472||i==474||i==476||i==593||i==609||i==708||i==711||713<=i&&i<=715||i==717||i==720||728<=i&&i<=731||i==733||i==735||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||i==1025||1040<=i&&i<=1103||i==1105||i==8208||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||i==8240||8242<=i&&i<=8243||i==8245||i==8251||i==8254||i==8308||i==8319||8321<=i&&i<=8324||i==8364||i==8451||i==8453||i==8457||i==8467||i==8470||8481<=i&&i<=8482||i==8486||i==8491||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||i==8585||8592<=i&&i<=8601||8632<=i&&i<=8633||i==8658||i==8660||i==8679||i==8704||8706<=i&&i<=8707||8711<=i&&i<=8712||i==8715||i==8719||i==8721||i==8725||i==8730||8733<=i&&i<=8736||i==8739||i==8741||8743<=i&&i<=8748||i==8750||8756<=i&&i<=8759||8764<=i&&i<=8765||i==8776||i==8780||i==8786||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||i==8853||i==8857||i==8869||i==8895||i==8978||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||i==9675||9678<=i&&i<=9681||9698<=i&&i<=9701||i==9711||9733<=i&&i<=9734||i==9737||9742<=i&&i<=9743||9748<=i&&i<=9749||i==9756||i==9758||i==9792||i==9794||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||i==9839||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||i==9955||9960<=i&&i<=9983||i==10045||i==10071||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||i==65533||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"},t.characterLength=function(n){var o=this.eastAsianWidth(n);return o=="F"||o=="W"||o=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(n){for(var o=r(n),s=0,i=0;i<o.length;i++)s=s+this.characterLength(o[i]);return s},t.slice=function(n,o,s){textLen=t.length(n),o=o||0,s=s||1,o<0&&(o=textLen+o),s<0&&(s=textLen+s);for(var i="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],p=t.length(l);if(a>=o-(p==2?1:0))if(a+p<=s)i+=l;else break;a+=p}return i}})(Tg);var O_=Tg.exports,M_=Fg(O_),B_=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},L_=Fg(B_);function Ci(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=Ag(e),e.length===0))return 0;e=e.replace(L_()," ");let r=t.ambiguousIsNarrow?1:2,n=0;for(let o of e){let s=o.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(M_.eastAsianWidth(o)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var mc=10,Cg=(e=0)=>t=>`\x1B[${t+e}m`,bg=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,wg=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,Ie={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(Ie.modifier);var z_=Object.keys(Ie.color),j_=Object.keys(Ie.bgColor);[...z_,...j_];function U_(){let e=new Map;for(let[t,r]of Object.entries(Ie)){for(let[n,o]of Object.entries(r))Ie[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Ie[n],e.set(o[0],o[1]);Object.defineProperty(Ie,t,{value:r,enumerable:!1})}return Object.defineProperty(Ie,"codes",{value:e,enumerable:!1}),Ie.color.close="\x1B[39m",Ie.bgColor.close="\x1B[49m",Ie.color.ansi=Cg(),Ie.color.ansi256=bg(),Ie.color.ansi16m=wg(),Ie.bgColor.ansi=Cg(mc),Ie.bgColor.ansi256=bg(mc),Ie.bgColor.ansi16m=wg(mc),Object.defineProperties(Ie,{rgbToAnsi256:{value:(t,r,n)=>t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:t=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>Ie.rgbToAnsi256(...Ie.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let i=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>Ie.ansi256ToAnsi(Ie.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>Ie.ansi256ToAnsi(Ie.hexToAnsi256(t)),enumerable:!1}}),Ie}var V_=U_(),la=new Set(["\x1B","\x9B"]),H_=39,yc="\x07",$g="[",q_="]",kg="m",Dc=`${q_}8;;`,xg=e=>`${la.values().next().value}${$g}${e}${kg}`,Sg=e=>`${la.values().next().value}${Dc}${e}${yc}`,K_=e=>e.split(" ").map(t=>Ci(t)),gc=(e,t,r)=>{let n=[...t],o=!1,s=!1,i=Ci(Ag(e[e.length-1]));for(let[a,u]of n.entries()){let c=Ci(u);if(i+c<=r?e[e.length-1]+=u:(e.push(u),i=0),la.has(u)&&(o=!0,s=n.slice(a+1).join("").startsWith(Dc)),o){s?u===yc&&(o=!1,s=!1):u===kg&&(o=!1);continue}i+=c,i===r&&a<n.length-1&&(e.push(""),i=0)}!i&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},G_=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(Ci(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},W_=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",o,s,i=K_(e),a=[""];for(let[c,l]of e.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=Ci(a[a.length-1]);if(c!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),p=0),(p>0||r.trim===!1)&&(a[a.length-1]+=" ",p++)),r.hard&&i[c]>t){let d=t-p,g=1+Math.floor((i[c]-d-1)/t);Math.floor((i[c]-1)/t)<g&&a.push(""),gc(a,l,t);continue}if(p+i[c]>t&&p>0&&i[c]>0){if(r.wordWrap===!1&&p<t){gc(a,l,t);continue}a.push("")}if(p+i[c]>t&&r.wordWrap===!1){gc(a,l,t);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>G_(c)));let u=[...a.join(`
263
- `)];for(let[c,l]of u.entries()){if(n+=l,la.has(l)){let{groups:d}=new RegExp(`(?:\\${$g}(?<code>\\d+)m|\\${Dc}(?<uri>.*)${yc})`).exec(u.slice(c).join(""))||{groups:{}};if(d.code!==void 0){let g=Number.parseFloat(d.code);o=g===H_?void 0:g}else d.uri!==void 0&&(s=d.uri.length===0?void 0:d.uri)}let p=V_.codes.get(Number(o));u[c+1]===`
264
- `?(s&&(n+=Sg("")),o&&p&&(n+=xg(p))):l===`
265
- `&&(o&&p&&(n+=xg(o)),s&&(n+=Sg(s)))}return n};function Eg(e,t,r){return String(e).normalize().replace(/\r\n/g,`
262
+ `)}async function gg(e,t){let r=await Gm(e),n=e.getFrameworks();return t.replace(/__LOCAL_APP_ID__/g,r).replace(/__DEV_TOOLS_URL__/g,e.devToolsServerUrl).replace(/__CLIENT_ID__/g,e.getClientId()).replace(/__FRAMEWORK__/g,n.length?n[0].name:"")}import{platform as P_}from"node:os";async function hg(e,t){let r=new URL("/cli-auth","https://builder.io");r.searchParams.set("client_id",e.getClientId()),r.searchParams.set("host",await e.getDeviceId()),r.searchParams.set("response_type","code"),r.searchParams.set("cli","true");let n=new URL(zn,e.devToolsServerUrl);n.searchParams.set(Qs,P_()),n.searchParams.set(Xs,process.versions.node);let o=e.getFrameworks();return o.length>0&&(r.searchParams.set(yo,o[0].name),n.searchParams.set(yo,o[0].name)),r.searchParams.set("redirect_url",n.href),r.searchParams.set("preview_url",t),r.href}import{createServer as H8}from"http";import{platform as q8}from"node:os";import{dirname as zP,join as yn}from"node:path";import{existsSync as Lm,mkdirSync as jP,readFileSync as VP,writeFileSync as nc}from"node:fs";var Qt=Ve(oa(),1);import{stdin as $_,stdout as k_}from"node:process";import Cg from"node:readline";import{Writable as I_}from"node:stream";function N_({onlyFirst:e=!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,e?void 0:"g")}var O_=N_();function Tg(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(O_,"")}function Fg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rg={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(n){var o=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,i=o;return 55296<=o&&o<=56319&&56320<=s&&s<=57343&&(o&=1023,s&=1023,i=o<<10|s,i+=65536),i==12288||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":i==8361||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||i==172||i==175||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":i==161||i==164||167<=i&&i<=168||i==170||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||i==198||i==208||215<=i&&i<=216||222<=i&&i<=225||i==230||232<=i&&i<=234||236<=i&&i<=237||i==240||242<=i&&i<=243||247<=i&&i<=250||i==252||i==254||i==257||i==273||i==275||i==283||294<=i&&i<=295||i==299||305<=i&&i<=307||i==312||319<=i&&i<=322||i==324||328<=i&&i<=331||i==333||338<=i&&i<=339||358<=i&&i<=359||i==363||i==462||i==464||i==466||i==468||i==470||i==472||i==474||i==476||i==593||i==609||i==708||i==711||713<=i&&i<=715||i==717||i==720||728<=i&&i<=731||i==733||i==735||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||i==1025||1040<=i&&i<=1103||i==1105||i==8208||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||i==8240||8242<=i&&i<=8243||i==8245||i==8251||i==8254||i==8308||i==8319||8321<=i&&i<=8324||i==8364||i==8451||i==8453||i==8457||i==8467||i==8470||8481<=i&&i<=8482||i==8486||i==8491||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||i==8585||8592<=i&&i<=8601||8632<=i&&i<=8633||i==8658||i==8660||i==8679||i==8704||8706<=i&&i<=8707||8711<=i&&i<=8712||i==8715||i==8719||i==8721||i==8725||i==8730||8733<=i&&i<=8736||i==8739||i==8741||8743<=i&&i<=8748||i==8750||8756<=i&&i<=8759||8764<=i&&i<=8765||i==8776||i==8780||i==8786||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||i==8853||i==8857||i==8869||i==8895||i==8978||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||i==9675||9678<=i&&i<=9681||9698<=i&&i<=9701||i==9711||9733<=i&&i<=9734||i==9737||9742<=i&&i<=9743||9748<=i&&i<=9749||i==9756||i==9758||i==9792||i==9794||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||i==9839||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||i==9955||9960<=i&&i<=9983||i==10045||i==10071||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||i==65533||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"},t.characterLength=function(n){var o=this.eastAsianWidth(n);return o=="F"||o=="W"||o=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(n){for(var o=r(n),s=0,i=0;i<o.length;i++)s=s+this.characterLength(o[i]);return s},t.slice=function(n,o,s){textLen=t.length(n),o=o||0,s=s||1,o<0&&(o=textLen+o),s<0&&(s=textLen+s);for(var i="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],p=t.length(l);if(a>=o-(p==2?1:0))if(a+p<=s)i+=l;else break;a+=p}return i}})(Rg);var M_=Rg.exports,L_=Fg(M_),B_=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},z_=Fg(B_);function Ci(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=Tg(e),e.length===0))return 0;e=e.replace(z_()," ");let r=t.ambiguousIsNarrow?1:2,n=0;for(let o of e){let s=o.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(L_.eastAsianWidth(o)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var gc=10,bg=(e=0)=>t=>`\x1B[${t+e}m`,wg=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,xg=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,Ne={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(Ne.modifier);var j_=Object.keys(Ne.color),U_=Object.keys(Ne.bgColor);[...j_,...U_];function V_(){let e=new Map;for(let[t,r]of Object.entries(Ne)){for(let[n,o]of Object.entries(r))Ne[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Ne[n],e.set(o[0],o[1]);Object.defineProperty(Ne,t,{value:r,enumerable:!1})}return Object.defineProperty(Ne,"codes",{value:e,enumerable:!1}),Ne.color.close="\x1B[39m",Ne.bgColor.close="\x1B[49m",Ne.color.ansi=bg(),Ne.color.ansi256=wg(),Ne.color.ansi16m=xg(),Ne.bgColor.ansi=bg(gc),Ne.bgColor.ansi256=wg(gc),Ne.bgColor.ansi16m=xg(gc),Object.defineProperties(Ne,{rgbToAnsi256:{value:(t,r,n)=>t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:t=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>Ne.rgbToAnsi256(...Ne.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let i=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>Ne.ansi256ToAnsi(Ne.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>Ne.ansi256ToAnsi(Ne.hexToAnsi256(t)),enumerable:!1}}),Ne}var H_=V_(),la=new Set(["\x1B","\x9B"]),q_=39,Dc="\x07",$g="[",K_="]",kg="m",vc=`${K_}8;;`,Sg=e=>`${la.values().next().value}${$g}${e}${kg}`,Eg=e=>`${la.values().next().value}${vc}${e}${Dc}`,G_=e=>e.split(" ").map(t=>Ci(t)),hc=(e,t,r)=>{let n=[...t],o=!1,s=!1,i=Ci(Tg(e[e.length-1]));for(let[a,u]of n.entries()){let c=Ci(u);if(i+c<=r?e[e.length-1]+=u:(e.push(u),i=0),la.has(u)&&(o=!0,s=n.slice(a+1).join("").startsWith(vc)),o){s?u===Dc&&(o=!1,s=!1):u===kg&&(o=!1);continue}i+=c,i===r&&a<n.length-1&&(e.push(""),i=0)}!i&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},W_=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(Ci(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},Z_=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",o,s,i=G_(e),a=[""];for(let[c,l]of e.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=Ci(a[a.length-1]);if(c!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),p=0),(p>0||r.trim===!1)&&(a[a.length-1]+=" ",p++)),r.hard&&i[c]>t){let d=t-p,g=1+Math.floor((i[c]-d-1)/t);Math.floor((i[c]-1)/t)<g&&a.push(""),hc(a,l,t);continue}if(p+i[c]>t&&p>0&&i[c]>0){if(r.wordWrap===!1&&p<t){hc(a,l,t);continue}a.push("")}if(p+i[c]>t&&r.wordWrap===!1){hc(a,l,t);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>W_(c)));let u=[...a.join(`
263
+ `)];for(let[c,l]of u.entries()){if(n+=l,la.has(l)){let{groups:d}=new RegExp(`(?:\\${$g}(?<code>\\d+)m|\\${vc}(?<uri>.*)${Dc})`).exec(u.slice(c).join(""))||{groups:{}};if(d.code!==void 0){let g=Number.parseFloat(d.code);o=g===q_?void 0:g}else d.uri!==void 0&&(s=d.uri.length===0?void 0:d.uri)}let p=H_.codes.get(Number(o));u[c+1]===`
264
+ `?(s&&(n+=Eg("")),o&&p&&(n+=Sg(p))):l===`
265
+ `&&(o&&p&&(n+=Sg(o)),s&&(n+=Eg(s)))}return n};function Pg(e,t,r){return String(e).normalize().replace(/\r\n/g,`
266
266
  `).split(`
267
- `).map(n=>W_(n,t,r)).join(`
268
- `)}var Z_=["up","down","left","right","space","enter","cancel"],ua={actions:new Set(Z_),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function Rg(e,t){if(typeof e=="string")return ua.aliases.get(e)===t;for(let r of e)if(r!==void 0&&Rg(r,t))return!0;return!1}function J_(e,t){if(e===t)return;let r=e.split(`
267
+ `).map(n=>Z_(n,t,r)).join(`
268
+ `)}var J_=["up","down","left","right","space","enter","cancel"],ua={actions:new Set(J_),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function Ig(e,t){if(typeof e=="string")return ua.aliases.get(e)===t;for(let r of e)if(r!==void 0&&Ig(r,t))return!0;return!1}function Y_(e,t){if(e===t)return;let r=e.split(`
269
269
  `),n=t.split(`
270
- `),o=[];for(let s=0;s<Math.max(r.length,n.length);s++)r[s]!==n[s]&&o.push(s);return o}var Q9=globalThis.process.platform.startsWith("win"),Pg=Symbol("clack:cancel");function aa(e,t){let r=e;r.isTTY&&r.setRawMode(t)}var Y_=Object.defineProperty,Q_=(e,t,r)=>t in e?Y_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ut=(e,t,r)=>(Q_(e,typeof t!="symbol"?t+"":t,r),r),hc=class{constructor(t,r=!0){Ut(this,"input"),Ut(this,"output"),Ut(this,"_abortSignal"),Ut(this,"rl"),Ut(this,"opts"),Ut(this,"_render"),Ut(this,"_track",!1),Ut(this,"_prevFrame",""),Ut(this,"_subscribers",new Map),Ut(this,"_cursor",0),Ut(this,"state","initial"),Ut(this,"error",""),Ut(this,"value");let{input:n=$_,output:o=k_,render:s,signal:i,...a}=t;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=s.bind(this),this._track=r,this._abortSignal=i,this.input=n,this.output=o}unsubscribe(){this._subscribers.clear()}setSubscriber(t,r){let n=this._subscribers.get(t)??[];n.push(r),this._subscribers.set(t,n)}on(t,r){this.setSubscriber(t,{cb:r})}once(t,r){this.setSubscriber(t,{cb:r,once:!0})}emit(t,...r){let n=this._subscribers.get(t)??[],o=[];for(let s of n)s.cb(...r),s.once&&o.push(()=>n.splice(n.indexOf(s),1));for(let s of o)s()}prompt(){return new Promise((t,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(Pg);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new R_;n._write=(o,s,i)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),i()},this.input.pipe(n),this.rl=vg.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),vg.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),aa(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Qt.cursor.show),this.output.off("resize",this.render),aa(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(Qt.cursor.show),this.output.off("resize",this.render),aa(this.input,!1),t(Pg)})})}onKeypress(t,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&ua.aliases.has(r.name)&&this.emit("cursor",ua.aliases.get(r.name)),ua.actions.has(r.name)&&this.emit("cursor",r.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),r?.name==="return"){if(!this.value&&this.opts.placeholder&&(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder)),this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Rg([t,r?.name,r?.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(`
271
- `),aa(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=Eg(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
272
- `).length-1;this.output.write(Qt.cursor.move(-999,t*-1))}render(){let t=Eg(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(Qt.cursor.hide);else{let r=J_(this._prevFrame,t);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(Qt.cursor.move(0,n)),this.output.write(Qt.erase.lines(1));let o=t.split(`
270
+ `),o=[];for(let s=0;s<Math.max(r.length,n.length);s++)r[s]!==n[s]&&o.push(s);return o}var y4=globalThis.process.platform.startsWith("win"),_g=Symbol("clack:cancel");function aa(e,t){let r=e;r.isTTY&&r.setRawMode(t)}var Q_=Object.defineProperty,X_=(e,t,r)=>t in e?Q_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vt=(e,t,r)=>(X_(e,typeof t!="symbol"?t+"":t,r),r),yc=class{constructor(t,r=!0){Vt(this,"input"),Vt(this,"output"),Vt(this,"_abortSignal"),Vt(this,"rl"),Vt(this,"opts"),Vt(this,"_render"),Vt(this,"_track",!1),Vt(this,"_prevFrame",""),Vt(this,"_subscribers",new Map),Vt(this,"_cursor",0),Vt(this,"state","initial"),Vt(this,"error",""),Vt(this,"value");let{input:n=$_,output:o=k_,render:s,signal:i,...a}=t;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=s.bind(this),this._track=r,this._abortSignal=i,this.input=n,this.output=o}unsubscribe(){this._subscribers.clear()}setSubscriber(t,r){let n=this._subscribers.get(t)??[];n.push(r),this._subscribers.set(t,n)}on(t,r){this.setSubscriber(t,{cb:r})}once(t,r){this.setSubscriber(t,{cb:r,once:!0})}emit(t,...r){let n=this._subscribers.get(t)??[],o=[];for(let s of n)s.cb(...r),s.once&&o.push(()=>n.splice(n.indexOf(s),1));for(let s of o)s()}prompt(){return new Promise((t,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(_g);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new I_;n._write=(o,s,i)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),i()},this.input.pipe(n),this.rl=Cg.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),Cg.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),aa(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Qt.cursor.show),this.output.off("resize",this.render),aa(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(Qt.cursor.show),this.output.off("resize",this.render),aa(this.input,!1),t(_g)})})}onKeypress(t,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&ua.aliases.has(r.name)&&this.emit("cursor",ua.aliases.get(r.name)),ua.actions.has(r.name)&&this.emit("cursor",r.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),r?.name==="return"){if(!this.value&&this.opts.placeholder&&(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder)),this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Ig([t,r?.name,r?.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(`
271
+ `),aa(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=Pg(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
272
+ `).length-1;this.output.write(Qt.cursor.move(-999,t*-1))}render(){let t=Pg(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(Qt.cursor.hide);else{let r=Y_(this._prevFrame,t);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(Qt.cursor.move(0,n)),this.output.write(Qt.erase.lines(1));let o=t.split(`
273
273
  `);this.output.write(o[n]),this._prevFrame=t,this.output.write(Qt.cursor.move(0,o.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(Qt.cursor.move(0,n)),this.output.write(Qt.erase.down());let o=t.split(`
274
274
  `).slice(n);this.output.write(o.join(`
275
- `)),this._prevFrame=t;return}this.output.write(Qt.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};var X_;X_=new WeakMap;var eA=Object.defineProperty,tA=(e,t,r)=>t in e?eA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_g=(e,t,r)=>(tA(e,typeof t!="symbol"?t+"":t,r),r),ca=class extends hc{constructor(t){super(t,!1),_g(this,"options"),_g(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:r})=>r===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){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}};var fe=Ue(Vn(),1),Ig=Ue(oa(),1);import gr from"node:process";function rA(){return gr.platform!=="win32"?gr.env.TERM!=="linux":!!gr.env.CI||!!gr.env.WT_SESSION||!!gr.env.TERMINUS_SUBLIME||gr.env.ConEmuTask==="{cmd::Cmder}"||gr.env.TERM_PROGRAM==="Terminus-Sublime"||gr.env.TERM_PROGRAM==="vscode"||gr.env.TERM==="xterm-256color"||gr.env.TERM==="alacritty"||gr.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var nA=rA(),Ve=(e,t)=>nA?e:t,oA=Ve("\u25C6","*"),iA=Ve("\u25A0","x"),sA=Ve("\u25B2","x"),Ng=Ve("\u25C7","o"),aA=Ve("\u250C","T"),hr=Ve("\u2502","|"),Og=Ve("\u2514","\u2014"),uA=Ve("\u25CF",">"),cA=Ve("\u25CB"," "),l4=Ve("\u25FB","[\u2022]"),p4=Ve("\u25FC","[+]"),d4=Ve("\u25FB","[ ]"),f4=Ve("\u25AA","\u2022"),m4=Ve("\u2500","-"),g4=Ve("\u256E","+"),h4=Ve("\u251C","+"),y4=Ve("\u256F","+"),lA=Ve("\u25CF","\u2022"),pA=Ve("\u25C6","*"),dA=Ve("\u25B2","!"),fA=Ve("\u25A0","x"),mA=e=>{switch(e){case"initial":case"active":return fe.default.cyan(oA);case"cancel":return fe.default.red(iA);case"error":return fe.default.yellow(sA);case"submit":return fe.default.green(Ng)}},gA=e=>{let{cursor:t,options:r,style:n}=e,o=e.maxItems??Number.POSITIVE_INFINITY,s=Math.max(process.stdout.rows-4,0),i=Math.min(s,Math.max(o,5)),a=0;t>=a+i-3?a=Math.max(Math.min(t-i+3,r.length-i),0):t<a+2&&(a=Math.max(t-2,0));let u=i<r.length&&a>0,c=i<r.length&&a+i<r.length;return r.slice(a,a+i).map((l,p,d)=>{let g=p===0&&u,m=p===d.length-1&&c;return g||m?fe.default.dim("..."):n(l,p+a===t)})};var bi=e=>{let t=(r,n)=>{let o=r.label??String(r.value);switch(n){case"selected":return`${fe.default.dim(o)}`;case"active":return`${fe.default.green(uA)} ${o} ${r.hint?fe.default.dim(`(${r.hint})`):""}`;case"cancelled":return`${fe.default.strikethrough(fe.default.dim(o))}`;default:return`${fe.default.dim(cA)} ${fe.default.dim(o)}`}};return new ca({options:e.options,initialValue:e.initialValue,render(){let r=`${fe.default.gray(hr)}
276
- ${mA(this.state)} ${e.message}
275
+ `)),this._prevFrame=t;return}this.output.write(Qt.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};var eA;eA=new WeakMap;var tA=Object.defineProperty,rA=(e,t,r)=>t in e?tA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ag=(e,t,r)=>(rA(e,typeof t!="symbol"?t+"":t,r),r),ca=class extends yc{constructor(t){super(t,!1),Ag(this,"options"),Ag(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:r})=>r===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){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}};var fe=Ve(Vn(),1),Ng=Ve(oa(),1);import gr from"node:process";function nA(){return gr.platform!=="win32"?gr.env.TERM!=="linux":!!gr.env.CI||!!gr.env.WT_SESSION||!!gr.env.TERMINUS_SUBLIME||gr.env.ConEmuTask==="{cmd::Cmder}"||gr.env.TERM_PROGRAM==="Terminus-Sublime"||gr.env.TERM_PROGRAM==="vscode"||gr.env.TERM==="xterm-256color"||gr.env.TERM==="alacritty"||gr.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var oA=nA(),He=(e,t)=>oA?e:t,iA=He("\u25C6","*"),sA=He("\u25A0","x"),aA=He("\u25B2","x"),Og=He("\u25C7","o"),uA=He("\u250C","T"),hr=He("\u2502","|"),Mg=He("\u2514","\u2014"),cA=He("\u25CF",">"),lA=He("\u25CB"," "),T4=He("\u25FB","[\u2022]"),F4=He("\u25FC","[+]"),R4=He("\u25FB","[ ]"),$4=He("\u25AA","\u2022"),k4=He("\u2500","-"),I4=He("\u256E","+"),N4=He("\u251C","+"),O4=He("\u256F","+"),pA=He("\u25CF","\u2022"),dA=He("\u25C6","*"),fA=He("\u25B2","!"),mA=He("\u25A0","x"),gA=e=>{switch(e){case"initial":case"active":return fe.default.cyan(iA);case"cancel":return fe.default.red(sA);case"error":return fe.default.yellow(aA);case"submit":return fe.default.green(Og)}},hA=e=>{let{cursor:t,options:r,style:n}=e,o=e.maxItems??Number.POSITIVE_INFINITY,s=Math.max(process.stdout.rows-4,0),i=Math.min(s,Math.max(o,5)),a=0;t>=a+i-3?a=Math.max(Math.min(t-i+3,r.length-i),0):t<a+2&&(a=Math.max(t-2,0));let u=i<r.length&&a>0,c=i<r.length&&a+i<r.length;return r.slice(a,a+i).map((l,p,d)=>{let g=p===0&&u,m=p===d.length-1&&c;return g||m?fe.default.dim("..."):n(l,p+a===t)})};var bi=e=>{let t=(r,n)=>{let o=r.label??String(r.value);switch(n){case"selected":return`${fe.default.dim(o)}`;case"active":return`${fe.default.green(cA)} ${o} ${r.hint?fe.default.dim(`(${r.hint})`):""}`;case"cancelled":return`${fe.default.strikethrough(fe.default.dim(o))}`;default:return`${fe.default.dim(lA)} ${fe.default.dim(o)}`}};return new ca({options:e.options,initialValue:e.initialValue,render(){let r=`${fe.default.gray(hr)}
276
+ ${gA(this.state)} ${e.message}
277
277
  `;switch(this.state){case"submit":return`${r}${fe.default.gray(hr)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${fe.default.gray(hr)} ${t(this.options[this.cursor],"cancelled")}
278
- ${fe.default.gray(hr)}`;default:return`${r}${fe.default.cyan(hr)} ${gA({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(n,o)=>t(n,o?"active":"inactive")}).join(`
278
+ ${fe.default.gray(hr)}`;default:return`${r}${fe.default.cyan(hr)} ${hA({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(n,o)=>t(n,o?"active":"inactive")}).join(`
279
279
  ${fe.default.cyan(hr)} `)}
280
- ${fe.default.cyan(Og)}
281
- `}}}).prompt()};var vn=(e="")=>{process.stdout.write(`${fe.default.gray(aA)} ${e}
280
+ ${fe.default.cyan(Mg)}
281
+ `}}}).prompt()};var vn=(e="")=>{process.stdout.write(`${fe.default.gray(uA)} ${e}
282
282
  `)},pa=(e="")=>{process.stdout.write(`${fe.default.gray(hr)}
283
- ${fe.default.gray(Og)} ${e}
283
+ ${fe.default.gray(Mg)} ${e}
284
284
 
285
285
  `)},te={message:(e="",{symbol:t=fe.default.gray(hr)}={})=>{let r=[`${fe.default.gray(hr)}`];if(e){let[n,...o]=e.split(`
286
286
  `);r.push(`${t} ${n}`,...o.map(s=>`${fe.default.gray(hr)} ${s}`))}process.stdout.write(`${r.join(`
287
287
  `)}
288
- `)},info:e=>{te.message(e,{symbol:fe.default.blue(lA)})},success:e=>{te.message(e,{symbol:fe.default.green(pA)})},step:e=>{te.message(e,{symbol:fe.default.green(Ng)})},warn:e=>{te.message(e,{symbol:fe.default.yellow(dA)})},warning:e=>{te.warn(e)},error:e=>{te.message(e,{symbol:fe.default.red(fA)})}},D4=`${fe.default.gray(hr)} `;var Bn=Ue(Vn(),1);import Z from"typescript";async function Xt(e){let t=Mg(e),r=await e.readFile(t);return typeof r=="string"?JSON.parse(r):{}}async function er(e,t){t=typeof t=="object"&&t!=null?t:{};let r=Mg(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function Mg(e){let t=e.getAppRootDir();return e.join(t,"node_modules",".builder","builder-cache.json")}async function Ar(e,t,r){let n={envKey:r,envValue:null,file:""};for(let o of t){let s=e.join(e.getAppRootDir(),o),i=await hA(e,s);if(i){let a=i[r];if(typeof a=="string"&&a.length>0&&a!=="YOUR_API_KEY")return n.envValue=a,n.file=s,n}}return n.file=e.join(e.getAppRootDir(),t[t.length-1]),n}async function hA(e,t){let r=await e.readFile(t);return typeof r=="string"?Bg(r):null}function Bg(e){let t={},r=e.replace(/\r\n?/gm,`
289
- `),n;for(;(n=yA.exec(r))!=null;){let o=n[1],s=n[2]||"";s=s.trim();let i=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),i==='"'&&(s=s.replace(/\\n/g,`
290
- `),s=s.replace(/\\r/g,"\r")),t[o]=s}return t}var yA=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;async function Fr(e,t,r,n){let o="# https://www.builder.io/c/docs/using-your-api-key",s=await e.readFile(t);try{if(s)if(s.includes(r))if(s.includes(n))e.debug(`"${r}" with "${n}" already set in ${t}`);else return e.debug(`Replace "${r}" in ${t}`),s=s.replace(new RegExp(`${r}=.*`),`${r}=${n}`),await e.writeFile(t,s),"update";else return e.debug(`Append "${r}" to ${t}`),s+=`
288
+ `)},info:e=>{te.message(e,{symbol:fe.default.blue(pA)})},success:e=>{te.message(e,{symbol:fe.default.green(dA)})},step:e=>{te.message(e,{symbol:fe.default.green(Og)})},warn:e=>{te.message(e,{symbol:fe.default.yellow(fA)})},warning:e=>{te.warn(e)},error:e=>{te.message(e,{symbol:fe.default.red(mA)})}},M4=`${fe.default.gray(hr)} `;var Ln=Ve(Vn(),1);import Z from"typescript";async function Xt(e){let t=Lg(e),r=await e.readFile(t);return typeof r=="string"?JSON.parse(r):{}}async function er(e,t){t=typeof t=="object"&&t!=null?t:{};let r=Lg(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function Lg(e){let t=e.getAppRootDir();return e.join(t,"node_modules",".builder","builder-cache.json")}async function Ar(e,t,r){let n={envKey:r,envValue:null,file:""};for(let o of t){let s=e.join(e.getAppRootDir(),o),i=await yA(e,s);if(i){let a=i[r];if(typeof a=="string"&&a.length>0&&a!=="YOUR_API_KEY")return n.envValue=a,n.file=s,n}}return n.file=e.join(e.getAppRootDir(),t[t.length-1]),n}async function yA(e,t){let r=await e.readFile(t);return typeof r=="string"?Bg(r):null}function Bg(e){let t={},r=e.replace(/\r\n?/gm,`
289
+ `),n;for(;(n=DA.exec(r))!=null;){let o=n[1],s=n[2]||"";s=s.trim();let i=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),i==='"'&&(s=s.replace(/\\n/g,`
290
+ `),s=s.replace(/\\r/g,"\r")),t[o]=s}return t}var DA=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;async function Tr(e,t,r,n){let o="# https://www.builder.io/c/docs/using-your-api-key",s=await e.readFile(t);try{if(s)if(s.includes(r))if(s.includes(n))e.debug(`"${r}" with "${n}" already set in ${t}`);else return e.debug(`Replace "${r}" in ${t}`),s=s.replace(new RegExp(`${r}=.*`),`${r}=${n}`),await e.writeFile(t,s),"update";else return e.debug(`Append "${r}" to ${t}`),s+=`
291
291
 
292
292
  ${o}
293
293
  ${r}=${n}
294
294
 
295
295
  `,await e.writeFile(t,s),"update";else return e.debug(`Creating new .env file with "${r}" at ${t}`),s=[o,`${r}=${n}`,""].join(`
296
- `),await e.writeFile(t,s),"create"}catch(i){if(i&&String(i).includes("EACCES"))return e.debug(`Permssion denied, failed to create or modify .env file with "${r}=${n}" at ${t}`),"permission-error";e.Sentry?.captureException(i)}return null}async function wi(e){return await Ar(e,[".env.local",".env.development.local",".env.production.local",".env.development",".env.production",".env"],Tr)}async function Lg(e,t){let r=await wi(e),n=await Fr(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var Tr="NEXT_PUBLIC_BUILDER_API_KEY";function Eo(e,t,r,n,o=!0){let s=t.properties.filter(a=>e.ts.isPropertyAssignment(a)),i=DA(e,t,r);return i>-1?n==null&&o?e.ts.factory.updateObjectLiteralExpression(t,s.filter((a,u)=>u!==i)):(s[i]=e.ts.factory.updatePropertyAssignment(s[i],s[i].name,xi(e,n)),e.ts.factory.updateObjectLiteralExpression(t,s)):(n!=null&&s.push(e.ts.factory.createPropertyAssignment(r,xi(e,n))),e.ts.factory.updateObjectLiteralExpression(t,s))}function DA(e,t,r){return t.properties.findIndex(n=>he(e,n)===r)}function Si(e,t){switch(t.kind){case e.ts.SyntaxKind.ArrayLiteralExpression:return CA(e,t);case e.ts.SyntaxKind.ObjectLiteralExpression:return vA(e,t);case e.ts.SyntaxKind.StringLiteral:return t.text;case e.ts.SyntaxKind.NumericLiteral:return Number(t.text);case e.ts.SyntaxKind.NoSubstitutionTemplateLiteral:return t.text;case e.ts.SyntaxKind.TrueKeyword:return!0;case e.ts.SyntaxKind.FalseKeyword:return!1;case e.ts.SyntaxKind.Identifier:switch(t.escapedText){case"undefined":return;case"null":return null;case"String":return String;case"Number":return Number;case"Boolean":return Boolean;case"NaN":return NaN}}}function vA(e,t){let r={};if(t&&e.ts.isObjectLiteralExpression(t)){for(let n of t.properties)if(e.ts.isPropertyAssignment(n)){let o=he(e,n);o&&(r[o]=Si(e,n.initializer))}}return r}function CA(e,t){return t&&e.ts.isArrayLiteralExpression(t)?t.elements.map(r=>Si(e,r)):[]}function he(e,t){if(t&&e.ts.isPropertyAssignment(t)){let r=t.name;switch(r.kind){case e.ts.SyntaxKind.Identifier:return r.text;case e.ts.SyntaxKind.StringLiteral:case e.ts.SyntaxKind.NumericLiteral:return r.text;case e.ts.SyntaxKind.ComputedPropertyName:let n=r.expression;if(e.ts.isStringLiteral(n)||e.ts.isNumericLiteral(n))return r.expression.text}}}function xi(e,t){return vc(e,t,new WeakSet)}function vc(e,t,r){return t===void 0?e.ts.factory.createIdentifier("undefined"):t===null?e.ts.factory.createIdentifier("null"):typeof t=="string"?e.ts.factory.createStringLiteral(t):typeof t=="number"?isNaN(t)?e.ts.factory.createIdentifier("NaN"):e.ts.factory.createNumericLiteral(t):t===!0?e.ts.factory.createTrue():t===!1?e.ts.factory.createFalse():t===String?e.ts.factory.createIdentifier("String"):t===Number?e.ts.factory.createIdentifier("Number"):t===Boolean?e.ts.factory.createIdentifier("Boolean"):Array.isArray(t)?bA(e,t,r):typeof t=="object"?wA(e,t,r):e.ts.factory.createIdentifier(t)}function bA(e,t,r){let n=t.map(o=>vc(e,o,r));return e.ts.factory.createArrayLiteralExpression(n,!0)}function wA(e,t,r){if(r.has(t))return e.ts.factory.createIdentifier("undefined");r.add(t);let n=Object.keys(t).map(o=>e.ts.factory.createPropertyAssignment(o,vc(e,t[o],r)));return e.ts.factory.createObjectLiteralExpression(n,!0)}function qn(e,t,r){let n=[];if(!r)return n;let o=null;if(e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r)||e.ts.isFunctionDeclaration(r)){let s=r.parameters;if(s.length>0){let i=s[0],a=t.getTypeAtLocation(i);a.aliasTypeArguments&&a.aliasTypeArguments.length>0&&(a=a.aliasTypeArguments[0]),!!(a.flags&e.ts.TypeFlags.Object)&&(o=a.getProperties())}}else if(e.ts.isIdentifier(r)){let s=t.getTypeAtLocation(r),i=s.symbol?.valueDeclaration;if(i&&e.ts.isClassDeclaration(i)){let u=i.heritageClauses?.find(c=>c.token===e.ts.SyntaxKind.ExtendsKeyword)?.types;if(u){for(let c of u)if(t.getSymbolAtLocation(c.expression)?.name==="Component"){if(e.ts.isExpressionWithTypeArguments(c)){let p=c.typeArguments;if(p){let d=p[0];o=t.getTypeFromTypeNode(d).getProperties()}}break}}}if(!o){let a=s.getCallSignatures();if(a.length>0){let u=a[0].getParameters();u.length>0&&(o=t.getTypeOfSymbolAtLocation(u[0],r).getProperties())}}}else if(e.ts.isExportSpecifier(r)){let s=t.getSymbolAtLocation(r.name);if(s){let a=t.getTypeOfSymbolAtLocation(s,r).getCallSignatures();if(a.length>0){let u=a[0].getParameters();u.length>0&&(o=t.getTypeOfSymbolAtLocation(u[0],r).getProperties())}}}if(o)for(let s of o){let i=xA(e,t,s);i&&n.push(i)}return n=n.filter(jg),n.length>0?n:SA(e,r)}function xA(e,t,r){let n=r.valueDeclaration,o=r.getName();if(n||(n=r.getDeclarations()?.[0]),n&&e.ts.isPropertySignature(n)){if(o!=="children"&&n.getSourceFile().fileName.includes("node_modules/@types/"))return null;let s="string",i;if(n?.type){let u=t.getTypeFromTypeNode(n.type),c=t.typeToString(u),l=Cc(c);l.knownType?s=l.builderType:PA(c)||u.flags&e.ts.TypeFlags.StringLike?s="string":u.flags&e.ts.TypeFlags.NumberLike?s="number":u.flags&e.ts.TypeFlags.IndexedAccess?s="list":u.flags&e.ts.TypeFlags.Object||u.isUnion()&&u.types.every(p=>p.flags&e.ts.TypeFlags.Object)||u.isIntersection()&&u.types.some(p=>p.flags&e.ts.TypeFlags.Object)?s="object":s="string",c!==s&&(i=c)}let a={name:o,type:s,isRegistered:!1};if(i&&n.type){let u=TA(e,t,t.getTypeFromTypeNode(n.type));a.meta=a.meta||{},u&&u.length>0&&a.type==="string"&&u.every(AA)?a.enum=u.map(FA):a.meta.ts=i}return n.questionToken||(a.required=!0),a}return null}function SA(e,t){let r=[],n=e.ts.getJSDocCommentsAndTags(t);for(let o of n)if(!(!e.ts.isJSDoc(o)||!o.tags))for(let s of o.tags){if(!e.ts.isJSDocParameterTag(s)||s.tagName.text!=="param")continue;let a=s.typeExpression?.type;if(!a||!e.ts.isJSDocTypeLiteral(a))continue;let u=a.jsDocPropertyTags;if(u)for(let c of u){if(!e.ts.isJSDocPropertyLikeTag(c))continue;let l=c.name;if(!e.ts.isQualifiedName(l))continue;let p=c.typeExpression;if(!p)continue;let d="";switch(p.type.kind){case e.ts.SyntaxKind.StringKeyword:{d="string";break}case e.ts.SyntaxKind.NumberKeyword:{d="number";break}case e.ts.SyntaxKind.BooleanKeyword:{d="boolean";break}default:continue}let m={name:l.right.text,type:d,isRegistered:!1};r.push(m)}}return r.filter(jg)}var EA=["ClassicComponent","FunctionComponent","IntrinsicElements","JSX","ReactNode","ReactElement","ReactPortal"];function PA(e){return typeof e!="string"?!1:!!EA.some(t=>e.includes(t))}function Cc(e){return typeof e=="string"&&(e=e.trim(),_A.some(t=>t.value===e))?{builderType:e,knownType:!0}:{builderType:"string",knownType:!1}}var _A=[{value:"boolean",text:"boolean"},{value:"color",text:"color (provides a color in hex or rgb)"},{value:"date",text:"date (same format as the Date constructor)"},{value:"email",text:"email"},{value:"file",text:"file (uploads a file and provides a url)"},{value:"list",text:"list (collection of items)"},{value:"longText",text:"longText (multiline text editor)"},{value:"number",text:"number"},{value:"object",text:"object (set of specific names and values)"},{value:"richText",text:"richText (provides value as html)"},{value:"string",text:"string"}];function AA(e){return/^['"].*['"]$/.test(e)}function FA(e){return(e.startsWith('"')||e.startsWith("'"))&&(e.endsWith('"')||e.endsWith("'"))?e.slice(1,-1):e}var TA=(e,t,r)=>{let n=new Set;zg(e,t,r,n);let o=n.delete("true"),s=n.delete("false");(o||s)&&n.add("boolean");let i=Array.from(n.keys()).sort();if(i.length>1&&(i=i.map(a=>a.indexOf("=>")>=0?`(${a})`:a)),!(i.length>20))return i},$A=(e,t,r)=>{let n=e.ts.TypeFormatFlags.InElementType|e.ts.TypeFormatFlags.NoTruncation;return t.typeToString(r,void 0,n)},zg=(e,t,r,n)=>{if(r.isUnion())r.types.forEach(o=>{zg(e,t,o,n)});else if(r.isLiteral()){let o=$A(e,t,r);n.add(o)}};function jg(e){let t=e?.name;if(typeof t!="string"||t===""||t.startsWith("aria")||t.startsWith("data-"))return!1;if(t.startsWith("on")&&t.length>2){let r=t.charAt(2);if(r.toUpperCase()===r)return!1}return!kA.has(t.toLowerCase())}var kA=new Set(["about","accessKey","accessKeyLabel","asChild","autoCapitalize","autoCorrect","autoFocus","autoSave","blur","contentEditable","contextMenu","dangerouslySetInnerHTML","datatype","defaultChecked","defaultValue","dir","draggable","enterKeyHint","focus","form","formAction","formEncType","formMethod","formNoValidate","formTarget","inlist","innerText","inputMode","is","isContentEditable","itemID","itemProp","itemRef","itemScope","itemType","lang","nonce","offsetHeight","offsetLeft","offsetTop","offsetWidth","outerText","prefix","property","radioGroup","rel","resource","results","rev","role","security","slot","spellCheck","suppressContentEditableWarning","suppressHydrationWarning","tabIndex","translate","typeof","unselectable","vocab"].map(e=>e.toLowerCase()));function Ft(e,t,r){for(let n of r.properties){if(!e.ts.isPropertyAssignment(n))continue;let o=he(e,n);if(o==="name"&&e.ts.isStringLiteral(n.initializer)){t.name=n.initializer.text;continue}if(o==="description"&&e.ts.isStringLiteral(n.initializer)){t.description=n.initializer.text;continue}if(o==="image"&&e.ts.isStringLiteral(n.initializer)){t.image=n.initializer.text;continue}if(o==="inputs"&&e.ts.isArrayLiteralExpression(n.initializer)){let s=RA(e,n.initializer);Vt(t,s);continue}if(o==="meta"&&e.ts.isObjectLiteralExpression(n.initializer)){let s=Si(e,n.initializer);s&&typeof s=="object"&&(t.meta=s);continue}}return t}function RA(e,t){let r=[];for(let n of t.elements)e.ts.isObjectLiteralExpression(n)&&r.push(IA(e,n));return r}function IA(e,t){let r=Si(e,t),n=jA(r);return n.isRegistered=!0,n}function Ze(e,t,r){let n=OA(r);return t=Eo(e,t,"name",n.name,!1),t=Eo(e,t,"description",n.description),t=Eo(e,t,"image",n.image),t=Eo(e,t,"meta",n.meta),t=NA(e,t,n),UA(e,t)}function NA(e,t,r){let n=null,o=t.properties.filter(a=>e.ts.isPropertyAssignment(a)&&e.ts.isIdentifier(a.name)),s=o.findIndex(a=>e.ts.isIdentifier(a.name)&&a.name.text==="inputs"),i=[...r.inputs??[]];if(s>-1){if(i.length===0)return Eo(e,t,"inputs",null);let a=o[s];e.ts.isPropertyAssignment(a)&&e.ts.isArrayLiteralExpression(a.initializer)&&(n=a.initializer)}return i.length===0?t:(n=BA(e,n||e.ts.factory.createArrayLiteralExpression(),i),s>-1?o[s]=e.ts.factory.updatePropertyAssignment(o[s],o[s].name,n):o.push(e.ts.factory.createPropertyAssignment("inputs",n)),e.ts.factory.updateObjectLiteralExpression(t,o))}function OA(e){return{name:e.name,description:e.description,image:e.image,inputs:(e.inputs||[]).filter(r=>r.isRegistered).map(MA),...e.meta?{meta:{...e.meta}}:{}}}function MA(e){let t={name:e.name,type:e.type};return(Ct(e.defaultValue)||hi(e.defaultValue)||Do(e.defaultValue))&&(t.defaultValue=e.defaultValue),Ct(e.friendlyName)&&(t.friendlyName=e.friendlyName),Ct(e.helperText)&&(t.helperText=e.helperText),e.required===!0&&(t.required=!0),Array.isArray(e.enum)&&(t.enum=e.enum),e.hideFromUI===!0&&(t.hideFromUI=!0),typeof e.meta=="object"&&e.meta!=null&&Object.keys(e.meta).length>0&&(t.meta=e.meta),t}function BA(e,t,r){let n=t.elements.filter(o=>{if(!e.ts.isObjectLiteralExpression(o))return!1;let s=o.properties.find(a=>he(e,a)==="name");if(!s)return!1;let i=s.initializer;return e.ts.isStringLiteral(i)?r.some(a=>a.name===i.text):!1});for(let o of r)n=LA(e,n,o);return n.sort((o,s)=>{let i=o.properties.find(d=>he(e,d)==="name"),a=s.properties.find(d=>he(e,d)==="name"),u=i?.initializer,c=a?.initializer,l=u&&e.ts.isStringLiteral(u)?u.text:"zz",p=c&&e.ts.isStringLiteral(c)?c.text:"zz";return l.toLowerCase().localeCompare(p.toLowerCase())}),e.ts.factory.updateArrayLiteralExpression(t,n)}function LA(e,t,r){let n=t.findIndex(o=>o.properties.some(s=>{let i=he(e,s);return e.ts.isPropertyAssignment(s)&&i==="name"&&e.ts.isStringLiteral(s.initializer)&&s.initializer.text===r.name}));if(n>-1)t[n]=Ug(e,t[n],r);else{let o=Ug(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("name",e.ts.factory.createStringLiteral(r.name))],!0),r);t.push(o)}return t}function Ug(e,t,r){let n=t.properties.filter(s=>e.ts.isPropertyAssignment(s)),o=Object.keys(r).filter(s=>s!=="isRegistered");for(let s of o)n=zA(e,n,r,s);return n=VA(e,n.filter(s=>{let i=he(e,s);return o.includes(i)})),e.ts.factory.updateObjectLiteralExpression(t,n)}function zA(e,t,r,n){let o=t.findIndex(s=>e.ts.isIdentifier(s.name)&&s.name.text===n);return o>-1?t[o]=e.ts.factory.updatePropertyAssignment(t[o],t[o].name,xi(e,r[n])):t.push(e.ts.factory.createPropertyAssignment(n,xi(e,r[n]))),t}function Vt(e,t){for(let r of t){let n=e.inputs.findIndex(o=>o.name===r.name);n>-1?(r.isRegistered||!e.inputs[n].isRegistered)&&(e.inputs[n]=r):e.inputs.push(r)}e.acceptsChildren=bc(e)}function jA(e){let t=Cc(e.type),r={name:e.name.trim(),type:t.builderType};return Ct(e.friendlyName)&&e.friendlyName.trim()!==e.name.trim()&&(r.friendlyName=e.friendlyName),(Ct(e.defaultValue)||hi(e.defaultValue)||Do(e.defaultValue))&&(r.defaultValue=e.defaultValue),Ct(e.helperText)&&(r.helperText=e.helperText),Do(e.required)&&(r.required=e.required),typeof e.meta=="object"&&e.meta!=null&&Object.keys(e.meta).length>0&&(r.meta=e.meta),Array.isArray(e.enum)&&e.enum.length>0&&(r.enum=e.enum),e.hideFromUI===!0&&(r.hideFromUI=!0),wc(r)}function bc(e){let t=e.inputs.some(n=>n.name==="children"),r=e.inputs.some(n=>n.meta?.ts==="ReactNode");return!!(t||r||e.acceptsChildren===!0)}function wc(e){if(e.name==="children"&&(e.hideFromUI=!0,delete e.required),e.type==="object"&&e.defaultValue==null&&(e.hideFromUI=!0),e.type==="list"&&e.defaultValue==null&&(e.hideFromUI=!0),e.meta){let t=e.meta.ts;typeof t=="string"&&(t=t.trim(),t.endsWith("ReactNode")&&(t="ReactNode"),e.meta.ts=t,t==="ReactNode"&&(e.hideFromUI=!0))}return e}function UA(e,t){let r=[...t.properties].sort((n,o)=>{let s=he(e,n)||"zz",i=he(e,o)||"zz";if(s==="inputs")return 1;let a=Vg.indexOf(s),u=Vg.indexOf(i);return a>-1?u>-1&&a>u?1:-1:u>-1?a>-1&&u<a?-1:1:s.localeCompare(i)});return e.ts.factory.updateObjectLiteralExpression(t,r)}var Vg=["component","name","description"];function VA(e,t){return[...t].sort((n,o)=>{let s=he(e,n)||"zz",i=he(e,o)||"zz",a=Hg.indexOf(s),u=Hg.indexOf(i);return a>-1?u>-1&&a>u?1:-1:u>-1?a>-1&&u<a?-1:1:s.localeCompare(i)})}var Hg=["name","type"];function Po(e,t){for(let r of t.properties){if(!e.ts.isPropertyAssignment(r)||!e.ts.isIdentifier(r.name))continue;if(he(e,r)==="canHaveChildren"){let{initializer:o}=r;return o.kind===e.ts.SyntaxKind.TrueKeyword}}return!1}function qg(e,t){let r=`Builder.registerComponent(
296
+ `),await e.writeFile(t,s),"create"}catch(i){if(i&&String(i).includes("EACCES"))return e.debug(`Permssion denied, failed to create or modify .env file with "${r}=${n}" at ${t}`),"permission-error";e.Sentry?.captureException(i)}return null}async function wi(e){return await Ar(e,[".env.local",".env.development.local",".env.production.local",".env.development",".env.production",".env"],Fr)}async function zg(e,t){let r=await wi(e),n=await Tr(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var Fr="NEXT_PUBLIC_BUILDER_API_KEY";function Eo(e,t,r,n,o=!0){let s=t.properties.filter(a=>e.ts.isPropertyAssignment(a)),i=vA(e,t,r);return i>-1?n==null&&o?e.ts.factory.updateObjectLiteralExpression(t,s.filter((a,u)=>u!==i)):(s[i]=e.ts.factory.updatePropertyAssignment(s[i],s[i].name,xi(e,n)),e.ts.factory.updateObjectLiteralExpression(t,s)):(n!=null&&s.push(e.ts.factory.createPropertyAssignment(r,xi(e,n))),e.ts.factory.updateObjectLiteralExpression(t,s))}function vA(e,t,r){return t.properties.findIndex(n=>he(e,n)===r)}function Si(e,t){switch(t.kind){case e.ts.SyntaxKind.ArrayLiteralExpression:return bA(e,t);case e.ts.SyntaxKind.ObjectLiteralExpression:return CA(e,t);case e.ts.SyntaxKind.StringLiteral:return t.text;case e.ts.SyntaxKind.NumericLiteral:return Number(t.text);case e.ts.SyntaxKind.NoSubstitutionTemplateLiteral:return t.text;case e.ts.SyntaxKind.TrueKeyword:return!0;case e.ts.SyntaxKind.FalseKeyword:return!1;case e.ts.SyntaxKind.Identifier:switch(t.escapedText){case"undefined":return;case"null":return null;case"String":return String;case"Number":return Number;case"Boolean":return Boolean;case"NaN":return NaN}}}function CA(e,t){let r={};if(t&&e.ts.isObjectLiteralExpression(t)){for(let n of t.properties)if(e.ts.isPropertyAssignment(n)){let o=he(e,n);o&&(r[o]=Si(e,n.initializer))}}return r}function bA(e,t){return t&&e.ts.isArrayLiteralExpression(t)?t.elements.map(r=>Si(e,r)):[]}function he(e,t){if(t&&e.ts.isPropertyAssignment(t)){let r=t.name;switch(r.kind){case e.ts.SyntaxKind.Identifier:return r.text;case e.ts.SyntaxKind.StringLiteral:case e.ts.SyntaxKind.NumericLiteral:return r.text;case e.ts.SyntaxKind.ComputedPropertyName:let n=r.expression;if(e.ts.isStringLiteral(n)||e.ts.isNumericLiteral(n))return r.expression.text}}}function xi(e,t){return Cc(e,t,new WeakSet)}function Cc(e,t,r){return t===void 0?e.ts.factory.createIdentifier("undefined"):t===null?e.ts.factory.createIdentifier("null"):typeof t=="string"?e.ts.factory.createStringLiteral(t):typeof t=="number"?isNaN(t)?e.ts.factory.createIdentifier("NaN"):e.ts.factory.createNumericLiteral(t):t===!0?e.ts.factory.createTrue():t===!1?e.ts.factory.createFalse():t===String?e.ts.factory.createIdentifier("String"):t===Number?e.ts.factory.createIdentifier("Number"):t===Boolean?e.ts.factory.createIdentifier("Boolean"):Array.isArray(t)?wA(e,t,r):typeof t=="object"?xA(e,t,r):e.ts.factory.createIdentifier(t)}function wA(e,t,r){let n=t.map(o=>Cc(e,o,r));return e.ts.factory.createArrayLiteralExpression(n,!0)}function xA(e,t,r){if(r.has(t))return e.ts.factory.createIdentifier("undefined");r.add(t);let n=Object.keys(t).map(o=>e.ts.factory.createPropertyAssignment(o,Cc(e,t[o],r)));return e.ts.factory.createObjectLiteralExpression(n,!0)}function qn(e,t,r){let n=[];if(!r)return n;let o=null;if(e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r)||e.ts.isFunctionDeclaration(r)){let s=r.parameters;if(s.length>0){let i=s[0],a=t.getTypeAtLocation(i);a.aliasTypeArguments&&a.aliasTypeArguments.length>0&&(a=a.aliasTypeArguments[0]),!!(a.flags&e.ts.TypeFlags.Object)&&(o=a.getProperties())}}else if(e.ts.isIdentifier(r)){let s=t.getTypeAtLocation(r),i=s.symbol?.valueDeclaration;if(i&&e.ts.isClassDeclaration(i)){let u=i.heritageClauses?.find(c=>c.token===e.ts.SyntaxKind.ExtendsKeyword)?.types;if(u){for(let c of u)if(t.getSymbolAtLocation(c.expression)?.name==="Component"){if(e.ts.isExpressionWithTypeArguments(c)){let p=c.typeArguments;if(p){let d=p[0];o=t.getTypeFromTypeNode(d).getProperties()}}break}}}if(!o){let a=s.getCallSignatures();if(a.length>0){let u=a[0].getParameters();u.length>0&&(o=t.getTypeOfSymbolAtLocation(u[0],r).getProperties())}}}else if(e.ts.isExportSpecifier(r)){let s=t.getSymbolAtLocation(r.name);if(s){let a=t.getTypeOfSymbolAtLocation(s,r).getCallSignatures();if(a.length>0){let u=a[0].getParameters();u.length>0&&(o=t.getTypeOfSymbolAtLocation(u[0],r).getProperties())}}}if(o)for(let s of o){let i=SA(e,t,s);i&&n.push(i)}return n=n.filter(Ug),n.length>0?n:EA(e,r)}function SA(e,t,r){let n=r.valueDeclaration,o=r.getName();if(n||(n=r.getDeclarations()?.[0]),n&&e.ts.isPropertySignature(n)){if(o!=="children"&&n.getSourceFile().fileName.includes("node_modules/@types/"))return null;let s="string",i;if(n?.type){let u=t.getTypeFromTypeNode(n.type),c=t.typeToString(u),l=bc(c);l.knownType?s=l.builderType:_A(c)||u.flags&e.ts.TypeFlags.StringLike?s="string":u.flags&e.ts.TypeFlags.NumberLike?s="number":u.flags&e.ts.TypeFlags.IndexedAccess?s="list":u.flags&e.ts.TypeFlags.Object||u.isUnion()&&u.types.every(p=>p.flags&e.ts.TypeFlags.Object)||u.isIntersection()&&u.types.some(p=>p.flags&e.ts.TypeFlags.Object)?s="object":s="string",c!==s&&(i=c)}let a={name:o,type:s,isRegistered:!1};if(i&&n.type){let u=RA(e,t,t.getTypeFromTypeNode(n.type));a.meta=a.meta||{},u&&u.length>0&&a.type==="string"&&u.every(TA)?a.enum=u.map(FA):a.meta.ts=i}return n.questionToken||(a.required=!0),a}return null}function EA(e,t){let r=[],n=e.ts.getJSDocCommentsAndTags(t);for(let o of n)if(!(!e.ts.isJSDoc(o)||!o.tags))for(let s of o.tags){if(!e.ts.isJSDocParameterTag(s)||s.tagName.text!=="param")continue;let a=s.typeExpression?.type;if(!a||!e.ts.isJSDocTypeLiteral(a))continue;let u=a.jsDocPropertyTags;if(u)for(let c of u){if(!e.ts.isJSDocPropertyLikeTag(c))continue;let l=c.name;if(!e.ts.isQualifiedName(l))continue;let p=c.typeExpression;if(!p)continue;let d="";switch(p.type.kind){case e.ts.SyntaxKind.StringKeyword:{d="string";break}case e.ts.SyntaxKind.NumberKeyword:{d="number";break}case e.ts.SyntaxKind.BooleanKeyword:{d="boolean";break}default:continue}let m={name:l.right.text,type:d,isRegistered:!1};r.push(m)}}return r.filter(Ug)}var PA=["ClassicComponent","FunctionComponent","IntrinsicElements","JSX","ReactNode","ReactElement","ReactPortal"];function _A(e){return typeof e!="string"?!1:!!PA.some(t=>e.includes(t))}function bc(e){return typeof e=="string"&&(e=e.trim(),AA.some(t=>t.value===e))?{builderType:e,knownType:!0}:{builderType:"string",knownType:!1}}var AA=[{value:"boolean",text:"boolean"},{value:"color",text:"color (provides a color in hex or rgb)"},{value:"date",text:"date (same format as the Date constructor)"},{value:"email",text:"email"},{value:"file",text:"file (uploads a file and provides a url)"},{value:"list",text:"list (collection of items)"},{value:"longText",text:"longText (multiline text editor)"},{value:"number",text:"number"},{value:"object",text:"object (set of specific names and values)"},{value:"richText",text:"richText (provides value as html)"},{value:"string",text:"string"}];function TA(e){return/^['"].*['"]$/.test(e)}function FA(e){return(e.startsWith('"')||e.startsWith("'"))&&(e.endsWith('"')||e.endsWith("'"))?e.slice(1,-1):e}var RA=(e,t,r)=>{let n=new Set;jg(e,t,r,n);let o=n.delete("true"),s=n.delete("false");(o||s)&&n.add("boolean");let i=Array.from(n.keys()).sort();if(i.length>1&&(i=i.map(a=>a.indexOf("=>")>=0?`(${a})`:a)),!(i.length>20))return i},$A=(e,t,r)=>{let n=e.ts.TypeFormatFlags.InElementType|e.ts.TypeFormatFlags.NoTruncation;return t.typeToString(r,void 0,n)},jg=(e,t,r,n)=>{if(r.isUnion())r.types.forEach(o=>{jg(e,t,o,n)});else if(r.isLiteral()){let o=$A(e,t,r);n.add(o)}};function Ug(e){let t=e?.name;if(typeof t!="string"||t===""||t.startsWith("aria")||t.startsWith("data-"))return!1;if(t.startsWith("on")&&t.length>2){let r=t.charAt(2);if(r.toUpperCase()===r)return!1}return!kA.has(t.toLowerCase())}var kA=new Set(["about","accessKey","accessKeyLabel","asChild","autoCapitalize","autoCorrect","autoFocus","autoSave","blur","contentEditable","contextMenu","dangerouslySetInnerHTML","datatype","defaultChecked","defaultValue","dir","draggable","enterKeyHint","focus","form","formAction","formEncType","formMethod","formNoValidate","formTarget","inlist","innerText","inputMode","is","isContentEditable","itemID","itemProp","itemRef","itemScope","itemType","lang","nonce","offsetHeight","offsetLeft","offsetTop","offsetWidth","outerText","prefix","property","radioGroup","rel","resource","results","rev","role","security","slot","spellCheck","suppressContentEditableWarning","suppressHydrationWarning","tabIndex","translate","typeof","unselectable","vocab"].map(e=>e.toLowerCase()));function Ft(e,t,r){for(let n of r.properties){if(!e.ts.isPropertyAssignment(n))continue;let o=he(e,n);if(o==="name"&&e.ts.isStringLiteral(n.initializer)){t.name=n.initializer.text;continue}if(o==="description"&&e.ts.isStringLiteral(n.initializer)){t.description=n.initializer.text;continue}if(o==="image"&&e.ts.isStringLiteral(n.initializer)){t.image=n.initializer.text;continue}if(o==="inputs"&&e.ts.isArrayLiteralExpression(n.initializer)){let s=IA(e,n.initializer);Ht(t,s);continue}if(o==="meta"&&e.ts.isObjectLiteralExpression(n.initializer)){let s=Si(e,n.initializer);s&&typeof s=="object"&&(t.meta=s);continue}}return t}function IA(e,t){let r=[];for(let n of t.elements)e.ts.isObjectLiteralExpression(n)&&r.push(NA(e,n));return r}function NA(e,t){let r=Si(e,t),n=UA(r);return n.isRegistered=!0,n}function Je(e,t,r){let n=MA(r);return t=Eo(e,t,"name",n.name,!1),t=Eo(e,t,"description",n.description),t=Eo(e,t,"image",n.image),t=Eo(e,t,"meta",n.meta),t=OA(e,t,n),VA(e,t)}function OA(e,t,r){let n=null,o=t.properties.filter(a=>e.ts.isPropertyAssignment(a)&&e.ts.isIdentifier(a.name)),s=o.findIndex(a=>e.ts.isIdentifier(a.name)&&a.name.text==="inputs"),i=[...r.inputs??[]];if(s>-1){if(i.length===0)return Eo(e,t,"inputs",null);let a=o[s];e.ts.isPropertyAssignment(a)&&e.ts.isArrayLiteralExpression(a.initializer)&&(n=a.initializer)}return i.length===0?t:(n=BA(e,n||e.ts.factory.createArrayLiteralExpression(),i),s>-1?o[s]=e.ts.factory.updatePropertyAssignment(o[s],o[s].name,n):o.push(e.ts.factory.createPropertyAssignment("inputs",n)),e.ts.factory.updateObjectLiteralExpression(t,o))}function MA(e){return{name:e.name,description:e.description,image:e.image,inputs:(e.inputs||[]).filter(r=>r.isRegistered).map(LA),...e.meta?{meta:{...e.meta}}:{}}}function LA(e){let t={name:e.name,type:e.type};return(bt(e.defaultValue)||hi(e.defaultValue)||Do(e.defaultValue))&&(t.defaultValue=e.defaultValue),bt(e.friendlyName)&&(t.friendlyName=e.friendlyName),bt(e.helperText)&&(t.helperText=e.helperText),e.required===!0&&(t.required=!0),Array.isArray(e.enum)&&(t.enum=e.enum),e.hideFromUI===!0&&(t.hideFromUI=!0),typeof e.meta=="object"&&e.meta!=null&&Object.keys(e.meta).length>0&&(t.meta=e.meta),t}function BA(e,t,r){let n=t.elements.filter(o=>{if(!e.ts.isObjectLiteralExpression(o))return!1;let s=o.properties.find(a=>he(e,a)==="name");if(!s)return!1;let i=s.initializer;return e.ts.isStringLiteral(i)?r.some(a=>a.name===i.text):!1});for(let o of r)n=zA(e,n,o);return n.sort((o,s)=>{let i=o.properties.find(d=>he(e,d)==="name"),a=s.properties.find(d=>he(e,d)==="name"),u=i?.initializer,c=a?.initializer,l=u&&e.ts.isStringLiteral(u)?u.text:"zz",p=c&&e.ts.isStringLiteral(c)?c.text:"zz";return l.toLowerCase().localeCompare(p.toLowerCase())}),e.ts.factory.updateArrayLiteralExpression(t,n)}function zA(e,t,r){let n=t.findIndex(o=>o.properties.some(s=>{let i=he(e,s);return e.ts.isPropertyAssignment(s)&&i==="name"&&e.ts.isStringLiteral(s.initializer)&&s.initializer.text===r.name}));if(n>-1)t[n]=Vg(e,t[n],r);else{let o=Vg(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("name",e.ts.factory.createStringLiteral(r.name))],!0),r);t.push(o)}return t}function Vg(e,t,r){let n=t.properties.filter(s=>e.ts.isPropertyAssignment(s)),o=Object.keys(r).filter(s=>s!=="isRegistered");for(let s of o)n=jA(e,n,r,s);return n=HA(e,n.filter(s=>{let i=he(e,s);return o.includes(i)})),e.ts.factory.updateObjectLiteralExpression(t,n)}function jA(e,t,r,n){let o=t.findIndex(s=>e.ts.isIdentifier(s.name)&&s.name.text===n);return o>-1?t[o]=e.ts.factory.updatePropertyAssignment(t[o],t[o].name,xi(e,r[n])):t.push(e.ts.factory.createPropertyAssignment(n,xi(e,r[n]))),t}function Ht(e,t){for(let r of t){let n=e.inputs.findIndex(o=>o.name===r.name);n>-1?(r.isRegistered||!e.inputs[n].isRegistered)&&(e.inputs[n]=r):e.inputs.push(r)}e.acceptsChildren=wc(e)}function UA(e){let t=bc(e.type),r={name:e.name.trim(),type:t.builderType};return bt(e.friendlyName)&&e.friendlyName.trim()!==e.name.trim()&&(r.friendlyName=e.friendlyName),(bt(e.defaultValue)||hi(e.defaultValue)||Do(e.defaultValue))&&(r.defaultValue=e.defaultValue),bt(e.helperText)&&(r.helperText=e.helperText),Do(e.required)&&(r.required=e.required),typeof e.meta=="object"&&e.meta!=null&&Object.keys(e.meta).length>0&&(r.meta=e.meta),Array.isArray(e.enum)&&e.enum.length>0&&(r.enum=e.enum),e.hideFromUI===!0&&(r.hideFromUI=!0),xc(r)}function wc(e){let t=e.inputs.some(n=>n.name==="children"),r=e.inputs.some(n=>n.meta?.ts==="ReactNode");return!!(t||r||e.acceptsChildren===!0)}function xc(e){if(e.name==="children"&&(e.hideFromUI=!0,delete e.required),e.type==="object"&&e.defaultValue==null&&(e.hideFromUI=!0),e.type==="list"&&e.defaultValue==null&&(e.hideFromUI=!0),e.meta){let t=e.meta.ts;typeof t=="string"&&(t=t.trim(),t.endsWith("ReactNode")&&(t="ReactNode"),e.meta.ts=t,t==="ReactNode"&&(e.hideFromUI=!0))}return e}function VA(e,t){let r=[...t.properties].sort((n,o)=>{let s=he(e,n)||"zz",i=he(e,o)||"zz";if(s==="inputs")return 1;let a=Hg.indexOf(s),u=Hg.indexOf(i);return a>-1?u>-1&&a>u?1:-1:u>-1?a>-1&&u<a?-1:1:s.localeCompare(i)});return e.ts.factory.updateObjectLiteralExpression(t,r)}var Hg=["component","name","description"];function HA(e,t){return[...t].sort((n,o)=>{let s=he(e,n)||"zz",i=he(e,o)||"zz",a=qg.indexOf(s),u=qg.indexOf(i);return a>-1?u>-1&&a>u?1:-1:u>-1?a>-1&&u<a?-1:1:s.localeCompare(i)})}var qg=["name","type"];function Po(e,t){for(let r of t.properties){if(!e.ts.isPropertyAssignment(r)||!e.ts.isIdentifier(r.name))continue;if(he(e,r)==="canHaveChildren"){let{initializer:o}=r;return o.kind===e.ts.SyntaxKind.TrueKeyword}}return!1}function Kg(e,t){let r=`Builder.registerComponent(
297
297
  `;if(e.appDir)t.acceptsChildren?r+=` withChildren(${t.importName}),
298
298
  `:r+=` ${t.importName},
299
299
  `;else{let o=t.externalImportPath?t.externalImportPath:ae(e,e.registryPath,t.filePath);t.exportName==="default"?t.acceptsChildren?r+=` withChildren(dynamic(() => import(${JSON.stringify(o)}))),
@@ -303,7 +303,7 @@ ${r}=${n}
303
303
  `}r+=` {
304
304
  name: "${t.name}",
305
305
  }
306
- `,r+=");";let n=ea(e,r);return xc(e,n,t)}function xc(e,t,r){if(!e.ts.isExpressionStatement(t))return t;let n=t.expression;if(!e.ts.isCallExpression(n))return t;let o=[...n.arguments];if(o.length<2)return t;r.acceptsChildren?e.ts.isCallExpression(o[0])&&e.ts.isIdentifier(o[0].expression)&&o[0].expression.text==="withChildren"||(o[0]=e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("withChildren"),void 0,[o[0]])):e.ts.isCallExpression(o[0])&&e.ts.isIdentifier(o[0].expression)&&o[0].expression.text==="withChildren"&&(o[0]=o[0].arguments[0]);let s=o[1];return e.ts.isObjectLiteralExpression(s)?(o[1]=Ze(e,s,r),e.ts.factory.updateExpressionStatement(t,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,o))):t}function ce(e,t,r,n="esm"){return Array.isArray(r.namedImports)&&r.namedImports.forEach(o=>{t=HA(e,t,o,r.importPath,!!r.isTypeOnly,n)}),typeof r.defaultImport=="string"&&(t=qA(e,t,r.defaultImport,r.importPath,n)),t}function HA(e,t,r,n,o,s){return s==="cjs"?Gg(e,t,null,r,n):Kg(e,t,null,r,n,o)}function qA(e,t,r,n,o){return o==="cjs"?Gg(e,t,r,null,n):Kg(e,t,r,null,n,!1)}function Kg(e,t,r,n,o,s){let i=[...t.statements],a=0,u=!1,c=!1;for(let g=0;g<i.length;g++){let m=i[g];if(!e.ts.isImportDeclaration(m)||(a=g,!m.moduleSpecifier||!e.ts.isStringLiteral(m.moduleSpecifier))||m.moduleSpecifier.text!==o||!!m.importClause?.isTypeOnly!==s)continue;let f=[],h=m.importClause?.namedBindings;if(h&&e.ts.isNamedImports(h)&&h.elements&&f.push(...h.elements),typeof n=="string"){if(f.some(b=>b.name.text===n))return t;f.push(e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))),f.sort((b,C)=>b.name.text.localeCompare(C.name.text)),u=!0}let y=m.importClause?m.importClause.name:void 0;if(typeof r=="string"){if(y&&y.text===r)return t;y=e.ts.factory.createIdentifier(r),c=!0}if(u||c)return i[g]=e.ts.factory.updateImportDeclaration(m,void 0,e.ts.factory.createImportClause(s,y,e.ts.factory.createNamedImports(f)),m.moduleSpecifier,void 0),e.ts.factory.updateSourceFile(t,i)}let l,p;typeof r=="string"&&(l=e.ts.factory.createIdentifier(r)),typeof n=="string"&&(p=e.ts.factory.createNamedImports([e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))]));let d=e.ts.factory.createImportDeclaration(void 0,e.ts.factory.createImportClause(s,l,p),e.ts.factory.createStringLiteral(o));return i.splice(a,0,d),e.ts.factory.updateSourceFile(t,i)}function Gg(e,t,r,n,o){let s=[...t.statements],i=0;for(let a=0;a<s.length;a++){let u=s[a];if(e.ts.isVariableStatement(u))for(let c=0;c<u.declarationList.declarations.length;c++){let l=[...u.declarationList.declarations],p=l[c],d=p.initializer;if(!d||!e.ts.isCallExpression(d))continue;let g=d.expression;if(!e.ts.isIdentifier(g)||g.text!=="require"||d.arguments.length!==1)continue;let m=d.arguments[0];if(e.ts.isStringLiteral(m)&&(i=a,m.text===o)){if(e.ts.isIdentifier(p.name)&&typeof r=="string")return p.name.text===r?t:(l[c]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createIdentifier(r),p.exclamationToken,p.type,p.initializer),s[a]=e.ts.factory.updateVariableStatement(u,u.modifiers,e.ts.factory.updateVariableDeclarationList(u.declarationList,l)),e.ts.factory.updateSourceFile(t,s));if(e.ts.isObjectBindingPattern(p.name)&&typeof n=="string"){let f=[...p.name.elements];return f.some(y=>!e.ts.isBindingElement(y)||!e.ts.isIdentifier(y.name)?!1:y.name.text===n)?t:(f.push(e.ts.factory.createBindingElement(void 0,void 0,n)),f.sort((y,b)=>!e.ts.isBindingElement(y)||!e.ts.isIdentifier(y.name)||!e.ts.isBindingElement(b)||!e.ts.isIdentifier(b.name)?0:y.name.text.localeCompare(b.name.text)),l[c]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createObjectBindingPattern(f),p.exclamationToken,p.type,p.initializer),s[a]=e.ts.factory.updateVariableStatement(u,u.modifiers,e.ts.factory.updateVariableDeclarationList(u.declarationList,l)),e.ts.factory.updateSourceFile(t,s))}}}}if(typeof r=="string"){let a=e.ts.factory.createVariableStatement(void 0,e.ts.factory.createVariableDeclarationList([e.ts.factory.createVariableDeclaration(r,void 0,void 0,e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("require"),void 0,[e.ts.factory.createStringLiteral(o)]))],e.ts.NodeFlags.Const));return s.splice(i,0,a),e.ts.factory.updateSourceFile(t,s)}if(typeof n=="string"){let a=e.ts.factory.createVariableStatement(void 0,e.ts.factory.createVariableDeclarationList([e.ts.factory.createVariableDeclaration(e.ts.factory.createObjectBindingPattern([e.ts.factory.createBindingElement(void 0,void 0,n)]),void 0,void 0,e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("require"),void 0,[e.ts.factory.createStringLiteral(o)]))],e.ts.NodeFlags.Const));return s.splice(i,0,a),e.ts.factory.updateSourceFile(t,s)}return t}function Kn(e,t,r="esm"){return r==="cjs"?GA(e,t):KA(e,t)}function KA(e,t){let r=[];for(let n of t.statements){if(e.ts.isExportDeclaration(n)){if(n.exportClause&&e.ts.isNamedExports(n.exportClause)){for(let o of n.exportClause.elements)if(n.moduleSpecifier&&r.push({isDefaultExport:!1,statement:n,node:o}),e.ts.isIdentifier(o.name)){let s=o.name.text;for(let i of t.statements)if(e.ts.isVariableStatement(i))for(let a of i.declarationList.declarations)e.ts.isIdentifier(a.name)&&a.name.text===s&&r.push({isDefaultExport:!1,statement:i,node:i});else e.ts.isFunctionDeclaration(i)&&i.name&&i.name.text===s&&r.push({isDefaultExport:!1,statement:i,node:i})}}else!n.exportClause&&n.moduleSpecifier&&r.push({isDefaultExport:!1,statement:n,node:n});continue}if(e.ts.isExportAssignment(n)){let o=n.flags===e.ts.NodeFlags.None,s=n.expression;if(e.ts.isIdentifier(s)){let i=s.text;for(let a of t.statements){if(e.ts.isVariableStatement(a))for(let u of a.declarationList.declarations)e.ts.isIdentifier(u.name)&&u.name.text===i&&r.push({isDefaultExport:o,statement:a,node:a});e.ts.isFunctionDeclaration(a)&&a.name?.text===i&&r.push({isDefaultExport:o,statement:a,node:a})}}else(e.ts.isArrowFunction(s)||e.ts.isCallExpression(s)||e.ts.isFunctionDeclaration(s)||e.ts.isObjectLiteralExpression(s))&&r.push({isDefaultExport:o,statement:n,node:s});continue}if((e.ts.isVariableStatement(n)||e.ts.isFunctionDeclaration(n))&&n.modifiers&&n.modifiers.some(o=>o.kind===e.ts.SyntaxKind.ExportKeyword)){r.push({isDefaultExport:n.modifiers.some(o=>o.kind===e.ts.SyntaxKind.DefaultKeyword),statement:n,node:n});continue}}return r}function GA(e,t){let r=[];for(let n of t.statements)if(e.ts.isExpressionStatement(n)&&e.ts.isBinaryExpression(n.expression)&&e.ts.isPropertyAccessExpression(n.expression.left)){let o=n.expression.left,s=n.expression.right;if(!e.ts.isIdentifier(o.expression))continue;if(o.expression.text==="module"&&o.name.text==="exports"){if(e.ts.isIdentifier(s)){let i=s.text;for(let a of t.statements)if(e.ts.isVariableStatement(a))for(let u of a.declarationList.declarations)e.ts.isIdentifier(u.name)&&u.name.text===i&&r.push({isDefaultExport:!0,statement:a,node:a});else e.ts.isFunctionDeclaration(a)&&a.name&&a.name.text===i&&r.push({isDefaultExport:!0,statement:a,node:a})}else r.push({isDefaultExport:!0,statement:n,node:s});continue}}return r}function WA(e,t,r){for(let n of t.statements)if(e.ts.isImportDeclaration(n)&&n.importClause){if(n.importClause.namedBindings&&e.ts.isNamedImports(n.importClause.namedBindings)){for(let o of n.importClause.namedBindings.elements)if(e.ts.isIdentifier(o.name)&&o.name.text===r&&e.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"named"}}if(n.importClause.name&&n.importClause.name.text===r&&e.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"default"}}return null}async function $r(e,t,r,n){let o=WA(e,r,n);if(o){let s=await Ei(e,e.normalize(e.resolve(e.dirname(t),o.importPath))),i=e.relative(e.getAppRootDir(),s);return{displayFilePath:ge(e,s),filePath:s,relFilePath:i,importPath:o.importPath,exportType:o.exportType}}return null}function _o(e,t,r){for(let n=0;n<t.statements.length;n++){let o=t.statements[n];if(e.ts.isVariableStatement(o)){for(let s of o.declarationList.declarations)if(e.ts.isIdentifier(s.name)&&s.name.text===r)return{statement:o,statementIndex:n}}}return null}function Ke(e,t,r){let n=_o(e,t,r);if(n&&n.statement.declarationList.declarations.length>0){let o=n.statement.declarationList.declarations[0];if(o.initializer&&e.ts.isArrayLiteralExpression(o.initializer))return{statement:n.statement,statementIndex:n.statementIndex,variableDeclaration:o,arrayLiteralExp:o.initializer}}return null}function da(e,t){if(t){if(ZA(e,t))return!0;let r=!1;if(t.forEachChild(n=>{da(e,n)&&(r=!0)}),r)return!0}return!1}function ZA(e,t){return e.ts.isJsxElement(t)||e.ts.isJsxOpeningElement(t)||e.ts.isJsxOpeningFragment(t)||e.ts.isJsxSelfClosingElement(t)||e.ts.isJsxFragment(t)||e.ts.isJsxChild(t)}async function Ei(e,t){let r=e.extname(t).toLowerCase();if(r===""||!Sc.includes(r)){for(let n of Sc){let o=t+n;if(await e.exists(o))return o}for(let n of Sc){let o=e.join(t,"index"+n);if(await e.exists(o))return o}}return t}var Sc=[".tsx",".jsx",".ts",".js"];function Ao(e,t,r){if(!r||!t)return;let n=t.getSymbolAtLocation(r);if(!n)return;let o=n.valueDeclaration;if(!o)return;let s=o.getSourceFile().fileName,i=JA(e,s);return i?[{name:i}]:void 0}function JA(e,t){if(typeof t=="string"){t=e.normalize(mr(t));let r=t.split("/"),n=r.lastIndexOf("node_modules");if(n>-1){let o=r.slice(n+1),s=o[0];if(s)return s.startsWith("@")&&o[1]&&(s+="/"+o[1]),s}}}function tr(e){let t=[];for(let r of e)if(r.dependencies)for(let n of r.dependencies)t.some(o=>o.name===n.name)||t.push({...n});return t.sort((r,n)=>r.name.localeCompare(n.name))}function Wg(e,t,r="esm"){return r==="cjs"?XA(e,t):QA(e,t)}var YA=/^(@\w|\w)/;function QA(e,t){let r=[];for(let n of t.statements)if(e.ts.isImportDeclaration(n)&&e.ts.isLiteralExpression(n.moduleSpecifier)){if(!YA.test(n.moduleSpecifier.text)||n.importClause?.isTypeOnly)continue;if(n.importClause&&n.importClause.namedBindings&&e.ts.isNamedImports(n.importClause.namedBindings))for(let o of n.importClause.namedBindings.elements)o.isTypeOnly||r.push({isDefaultExport:!1,statement:n,node:o.name});n.importClause&&n.importClause.name&&r.push({isDefaultExport:!0,statement:n,node:n.importClause.name})}return r}function XA(e,t){return[]}async function Fo(e,t){if(!t.some(i=>!i.isRegistered))return t;let n=await We(e,t.map(i=>i.filePath)),o=n.getTypeChecker();return await Promise.all(t.map(async i=>{let a=n.getSourceFile(i.filePath);if(a){let c=(await Cn(e,o,i.filePath,a,!1)).find(l=>l.cmpInfo.id===i.id);c&&(i.inputs=qn(e,o,c.node.fnNode))}return i}))}async function To(e,t,r,n){if(t.node.fnNode){let{sourceFile:o,typeChecker:s}=await Co(e,t.cmpInfo.filePath,r),a=(await Cn(e,s,t.cmpInfo.filePath,o,n)).find(u=>u.cmpInfo.id===t.cmpInfo.id);if(!a)throw new Error(`createComponentInputs() Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return qn(e,s,a.node.fnNode)}return[]}async function Jg(e,t,r){let n=e.extname(t).toLowerCase();if(n===".tsx"||n===".jsx"||n===".ts"||n===".js"){let o=await e.readFile(t);if(o)return eF(e,t,o,r)}return null}function eF(e,t,r,n=!1){let o=se(e,r);return Cn(e,null,t,o,n)}async function Cn(e,t,r,n,o){let s=[];for(let a of n.statements)if(e.ts.isExpressionStatement(a)&&e.ts.isStringLiteral(a.expression)&&a.expression.text==="use server")return s;let i=Kn(e,n);return o&&i.push(...Wg(e,n)),r=e.normalize(r),await Promise.all(i.map(async a=>{let u=await tF(e,t,r,a);s.push(...u)})),s}async function tF(e,t,r,n){let o=[],s=e.relative(e.getAppRootDir(),r),i=we(e,r);if(e.ts.isVariableStatement(n.node)){for(let a of n.node.declarationList.declarations){if(!e.ts.isIdentifier(a.name)||!vo(a.name.text))continue;let u=en(e,t,a.initializer);if(u){let c=u.name||a.name.text,l=n.isDefaultExport?"default":c,p=n.isDefaultExport?"default":"named";o.push({cmpInfo:{id:await ve(e,r,l),displayFilePath:ge(e,r),name:be(c),inputs:[],exportName:l,exportType:p,importName:c,filePath:r,relFilePath:s,importPath:i,dependencies:u.deps,framework:"react"},node:u})}}return o}if(e.ts.isArrowFunction(n.node)){let a=en(e,t,n.node);if(a){let u=Yt(e,r),c=n.isDefaultExport?"default":u,l=n.isDefaultExport?"default":"named";o.push({cmpInfo:{id:await ve(e,r,c),displayFilePath:ge(e,r),name:u,inputs:[],exportName:c,exportType:l,importName:Un(e,r),filePath:r,relFilePath:s,importPath:i,dependencies:a.deps,framework:"react"},node:a})}return o}if(e.ts.isFunctionExpression(n.node)||e.ts.isFunctionDeclaration(n.node)){let a=n.node.name?.text;if(a&&!vo(a))return o;let u=en(e,t,n.node);if(u){let c=u.name||Yt(e,r),l=n.isDefaultExport||!u.name?"default":u.name,p=n.isDefaultExport?"default":"named";o.push({cmpInfo:{id:await ve(e,r,l),displayFilePath:ge(e,r),name:c,inputs:[],exportName:l,exportType:p,importName:u.name||Un(e,r),filePath:r,relFilePath:s,importPath:i,dependencies:u.deps,framework:"react"},node:u})}return o}if((e.ts.isExportSpecifier(n.node)||e.ts.isIdentifier(n.node))&&vo(n.node.getText())){let a,u=en(e,t,n.node);if(u){let c=u.name||Yt(e,r),l=n.isDefaultExport||!u.name?"default":u.name,p=n.isDefaultExport?"default":"named",d=rF(e,n.node)?.moduleSpecifier??nF(e,n.node)?.moduleSpecifier;if(d&&e.ts.isStringLiteral(d)){let g=t?.getSymbolAtLocation(d);if(g&&g.declarations&&g.declarations.length>0){let m=g.declarations[0];(!e.ts.isSourceFile(m)||e.ts.isSourceFile(m)&&m.fileName.includes("node_modules"))&&(a=d.text)}}o.push({cmpInfo:{id:await ve(e,r,l,a),displayFilePath:ge(e,r),name:c,inputs:[],exportName:l,exportType:p,importName:u.name||Un(e,r),filePath:r,relFilePath:s,importPath:a||i,externalImportPath:a,dependencies:u.deps,framework:"react"},node:u})}return o}if(e.ts.isExportDeclaration(n.node)&&n.node.exportClause===void 0){let a=n.node.moduleSpecifier;if(a&&e.ts.isStringLiteral(a)){let u=await iF(e,t,r,a);o.push(...u)}return o}return o}function rF(e,t){for(;t;){if(e.ts.isExportDeclaration(t))return t;t=t.parent}return null}function nF(e,t){for(;t;){if(e.ts.isImportDeclaration(t))return t;t=t.parent}return null}function en(e,t,r){if(!r)return null;if(e.ts.isArrowFunction(r))return da(e,r.body)?{name:"",fnNode:r,deps:Ao(e,t,r)}:null;if(e.ts.isFunctionExpression(r)||e.ts.isFunctionDeclaration(r))return da(e,r.body)?{name:r.name?.text||"",fnNode:r,deps:Ao(e,t,r)}:null;if(e.ts.isCallExpression(r)){let n=r.expression;if(e.ts.isPropertyAccessExpression(n)){let o=r.arguments;if(o.length===0)return null;let s=n.expression;if(!e.ts.isIdentifier(s)||s.text!=="React")return null;let i=n.name;return!e.ts.isIdentifier(i)||i.text!=="forwardRef"?null:en(e,t,o[0])}else if(e.ts.isIdentifier(n)&&(n.text==="observer"||n.text==="forwardRef")){let o=r.arguments;return o.length===0?null:en(e,t,o[0])}return null}if(!t)return null;if(e.ts.isPropertyAccessExpression(r)){let n=r.expression,o=r.name;if(!e.ts.isIdentifier(n)||!e.ts.isIdentifier(o)||!vo(o.text))return null;let i=t.getTypeAtLocation(o).getCallSignatures();if(i.length>0&&i[0].getParameters().length>0)return{name:"",fnNode:o,deps:Ao(e,t,o)}}if(e.ts.isExportSpecifier(r)){let n=r.name;return{name:n.text||"",fnNode:n,deps:Ao(e,t,n)}}if(e.ts.isIdentifier(r))return{name:r.text||"",fnNode:r,deps:Ao(e,t,r)};if(e.ts.isExpressionStatement(r)){let n=r.expression;if(e.ts.isAsExpression(n)&&e.ts.isIdentifier(n.type)&&n.type.text==="default")return en(e,t,n.expression)}if(e.ts.isVariableStatement(r)){for(let n of r.declarationList.declarations)if(n.initializer&&e.ts.isAsExpression(n.initializer)){let o=n.initializer;if(e.ts.isIdentifier(o.type)&&o.type.text==="default"){let s=en(e,t,o.expression);if(s&&e.ts.isIdentifier(n.name))return{name:n.name.text,fnNode:s.fnNode,deps:s.deps}}}}return null}async function Yg(e,t){let r=[],n=t.getSourceFiles(),o=t.getTypeChecker();return await Promise.all(n.map(async s=>{let i=e.normalize(s.fileName);if(ta(e,oF,s.fileName)||i===e.reactConfigPath||i===e.builderComponentPath)return;let a=await Cn(e,o,i,s,i===e.registryPath);r.push(...a)})),r.sort((s,i)=>s.cmpInfo.name.localeCompare(i.cmpInfo.name))}var oF=new Set(["node_modules","dist"]);async function iF(e,t,r,n){let o=[],s=n.text;if(!t)return o;try{let i=t.getSymbolAtLocation(n);if(!i)return o;let a=t.getExportsOfModule(i);for(let u of a){let c=u.valueDeclaration||u.declarations?.[0];if(!c)continue;let l=u.name;if(!vo(l)&&l!=="default"||!Qg(e,t,c))continue;let p=en(e,t,c);if(p){let d=u.name,g=d==="default"?"default":"named",m=be(d),f=d==="default"?Un(e,r):d;o.push({cmpInfo:{id:await ve(e,r,d,s),displayFilePath:ge(e,r),name:m,inputs:[],exportName:d,exportType:g,importName:f,filePath:r,relFilePath:e.relative(e.getAppRootDir(),r),importPath:s,externalImportPath:s,dependencies:p.deps,framework:"react"},node:p})}}}catch(i){e.Sentry?.captureException(new Error(`Error processing module ${s}:`,{cause:i}),{extra:{modulePath:s,filePath:r}})}return o}function Qg(e,t,r){if(e.ts.isInterfaceDeclaration(r)||e.ts.isTypeAliasDeclaration(r))return!1;if(e.ts.isExportSpecifier(r)){let n=t.getSymbolAtLocation(r.name);if(n){let s=t.getAliasedSymbol(n).declarations?.[0];if(s)return Qg(e,t,s)}return!1}if(e.ts.isFunctionDeclaration(r)||e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r)){let n=t.getSignatureFromDeclaration(r);if(n){let o=t.getReturnTypeOfSignature(n);return Zg(o,t)}}return e.ts.isClassDeclaration(r)?r.heritageClauses?.some(o=>o.types.some(s=>s.expression.getText()==="React.Component"||s.expression.getText()==="Component"))??!1:e.ts.isVariableDeclaration(r)?t.getTypeAtLocation(r).getCallSignatures().some(s=>Zg(t.getReturnTypeOfSignature(s),t)):!1}function Zg(e,t){let r=t.typeToString(e);return r==="JSX.Element"||r==="Element"||r.includes("ReactElement")||r.includes("React.ReactElement")||r.includes("ReactNode")}async function Xg(e,t){let r=[],n=t.getSourceFiles(),o=t.getTypeChecker();return await Promise.all(n.map(async s=>{let i=e.basename(s.fileName);if(e.appDir&&sF.has(i)||e.dirname(s.fileName).includes("node_modules"))return;let a=e.normalize(s.fileName);if(a===e.nextConfigPath||a===e.builderComponentPath)return;let u=await Cn(e,o,a,s,a===e.registryPath||Jt(a));r.push(...u)})),r.sort((s,i)=>s.cmpInfo.name.localeCompare(i.cmpInfo.name))}var sF=new Set(["default.tsx","default.ts","default.jsx","default.js","error.tsx","error.ts","error.jsx","error.js","layout.tsx","layout.ts","layout.jsx","layout.js","loading.tsx","loading.ts","loading.jsx","loading.js","not-found.tsx","not-found.ts","not-found.jsx","not-found.js","page.tsx","page.ts","page.jsx","page.js","route.tsx","route.ts","route.jsx","route.js","template.tsx","template.ts","template.jsx","template.js"]);function kr(e,t){let r=[],n=[],o=[],s=[];for(let i of t.statements){if(e.ts.isImportDeclaration(i)){if(e.ts.isStringLiteral(i.moduleSpecifier)){let u=i.moduleSpecifier.text;if(!u.startsWith(".")&&!u.startsWith("/")){r.push(i);continue}}let a=i.importClause;if(a){if(a.namedBindings){n.push(i);continue}if(a.name){n.push(i);continue}}o.push(i);continue}s.push(i)}return e.ts.factory.updateSourceFile(t,[...Ec(e,r),...Ec(e,n),...Ec(e,o),...s])}function yr(e){let t=e.split(`
306
+ `,r+=");";let n=ea(e,r);return Sc(e,n,t)}function Sc(e,t,r){if(!e.ts.isExpressionStatement(t))return t;let n=t.expression;if(!e.ts.isCallExpression(n))return t;let o=[...n.arguments];if(o.length<2)return t;r.acceptsChildren?e.ts.isCallExpression(o[0])&&e.ts.isIdentifier(o[0].expression)&&o[0].expression.text==="withChildren"||(o[0]=e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("withChildren"),void 0,[o[0]])):e.ts.isCallExpression(o[0])&&e.ts.isIdentifier(o[0].expression)&&o[0].expression.text==="withChildren"&&(o[0]=o[0].arguments[0]);let s=o[1];return e.ts.isObjectLiteralExpression(s)?(o[1]=Je(e,s,r),e.ts.factory.updateExpressionStatement(t,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,o))):t}function ce(e,t,r,n="esm"){return Array.isArray(r.namedImports)&&r.namedImports.forEach(o=>{t=qA(e,t,o,r.importPath,!!r.isTypeOnly,n)}),typeof r.defaultImport=="string"&&(t=KA(e,t,r.defaultImport,r.importPath,n)),t}function qA(e,t,r,n,o,s){return s==="cjs"?Wg(e,t,null,r,n):Gg(e,t,null,r,n,o)}function KA(e,t,r,n,o){return o==="cjs"?Wg(e,t,r,null,n):Gg(e,t,r,null,n,!1)}function Gg(e,t,r,n,o,s){let i=[...t.statements],a=0,u=!1,c=!1;for(let g=0;g<i.length;g++){let m=i[g];if(!e.ts.isImportDeclaration(m)||(a=g,!m.moduleSpecifier||!e.ts.isStringLiteral(m.moduleSpecifier))||m.moduleSpecifier.text!==o||!!m.importClause?.isTypeOnly!==s)continue;let f=[],h=m.importClause?.namedBindings;if(h&&e.ts.isNamedImports(h)&&h.elements&&f.push(...h.elements),typeof n=="string"){if(f.some(b=>b.name.text===n))return t;f.push(e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))),f.sort((b,C)=>b.name.text.localeCompare(C.name.text)),u=!0}let y=m.importClause?m.importClause.name:void 0;if(typeof r=="string"){if(y&&y.text===r)return t;y=e.ts.factory.createIdentifier(r),c=!0}if(u||c)return i[g]=e.ts.factory.updateImportDeclaration(m,void 0,e.ts.factory.createImportClause(s,y,e.ts.factory.createNamedImports(f)),m.moduleSpecifier,void 0),e.ts.factory.updateSourceFile(t,i)}let l,p;typeof r=="string"&&(l=e.ts.factory.createIdentifier(r)),typeof n=="string"&&(p=e.ts.factory.createNamedImports([e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))]));let d=e.ts.factory.createImportDeclaration(void 0,e.ts.factory.createImportClause(s,l,p),e.ts.factory.createStringLiteral(o));return i.splice(a,0,d),e.ts.factory.updateSourceFile(t,i)}function Wg(e,t,r,n,o){let s=[...t.statements],i=0;for(let a=0;a<s.length;a++){let u=s[a];if(e.ts.isVariableStatement(u))for(let c=0;c<u.declarationList.declarations.length;c++){let l=[...u.declarationList.declarations],p=l[c],d=p.initializer;if(!d||!e.ts.isCallExpression(d))continue;let g=d.expression;if(!e.ts.isIdentifier(g)||g.text!=="require"||d.arguments.length!==1)continue;let m=d.arguments[0];if(e.ts.isStringLiteral(m)&&(i=a,m.text===o)){if(e.ts.isIdentifier(p.name)&&typeof r=="string")return p.name.text===r?t:(l[c]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createIdentifier(r),p.exclamationToken,p.type,p.initializer),s[a]=e.ts.factory.updateVariableStatement(u,u.modifiers,e.ts.factory.updateVariableDeclarationList(u.declarationList,l)),e.ts.factory.updateSourceFile(t,s));if(e.ts.isObjectBindingPattern(p.name)&&typeof n=="string"){let f=[...p.name.elements];return f.some(y=>!e.ts.isBindingElement(y)||!e.ts.isIdentifier(y.name)?!1:y.name.text===n)?t:(f.push(e.ts.factory.createBindingElement(void 0,void 0,n)),f.sort((y,b)=>!e.ts.isBindingElement(y)||!e.ts.isIdentifier(y.name)||!e.ts.isBindingElement(b)||!e.ts.isIdentifier(b.name)?0:y.name.text.localeCompare(b.name.text)),l[c]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createObjectBindingPattern(f),p.exclamationToken,p.type,p.initializer),s[a]=e.ts.factory.updateVariableStatement(u,u.modifiers,e.ts.factory.updateVariableDeclarationList(u.declarationList,l)),e.ts.factory.updateSourceFile(t,s))}}}}if(typeof r=="string"){let a=e.ts.factory.createVariableStatement(void 0,e.ts.factory.createVariableDeclarationList([e.ts.factory.createVariableDeclaration(r,void 0,void 0,e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("require"),void 0,[e.ts.factory.createStringLiteral(o)]))],e.ts.NodeFlags.Const));return s.splice(i,0,a),e.ts.factory.updateSourceFile(t,s)}if(typeof n=="string"){let a=e.ts.factory.createVariableStatement(void 0,e.ts.factory.createVariableDeclarationList([e.ts.factory.createVariableDeclaration(e.ts.factory.createObjectBindingPattern([e.ts.factory.createBindingElement(void 0,void 0,n)]),void 0,void 0,e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("require"),void 0,[e.ts.factory.createStringLiteral(o)]))],e.ts.NodeFlags.Const));return s.splice(i,0,a),e.ts.factory.updateSourceFile(t,s)}return t}function Kn(e,t,r="esm"){return r==="cjs"?WA(e,t):GA(e,t)}function GA(e,t){let r=[];for(let n of t.statements){if(e.ts.isExportDeclaration(n)){if(n.exportClause&&e.ts.isNamedExports(n.exportClause)){for(let o of n.exportClause.elements)if(n.moduleSpecifier&&r.push({isDefaultExport:!1,statement:n,node:o}),e.ts.isIdentifier(o.name)){let s=o.name.text;for(let i of t.statements)if(e.ts.isVariableStatement(i))for(let a of i.declarationList.declarations)e.ts.isIdentifier(a.name)&&a.name.text===s&&r.push({isDefaultExport:!1,statement:i,node:i});else e.ts.isFunctionDeclaration(i)&&i.name&&i.name.text===s&&r.push({isDefaultExport:!1,statement:i,node:i})}}else!n.exportClause&&n.moduleSpecifier&&r.push({isDefaultExport:!1,statement:n,node:n});continue}if(e.ts.isExportAssignment(n)){let o=n.flags===e.ts.NodeFlags.None,s=n.expression;if(e.ts.isIdentifier(s)){let i=s.text;for(let a of t.statements){if(e.ts.isVariableStatement(a))for(let u of a.declarationList.declarations)e.ts.isIdentifier(u.name)&&u.name.text===i&&r.push({isDefaultExport:o,statement:a,node:a});e.ts.isFunctionDeclaration(a)&&a.name?.text===i&&r.push({isDefaultExport:o,statement:a,node:a})}}else(e.ts.isArrowFunction(s)||e.ts.isCallExpression(s)||e.ts.isFunctionDeclaration(s)||e.ts.isObjectLiteralExpression(s))&&r.push({isDefaultExport:o,statement:n,node:s});continue}if((e.ts.isVariableStatement(n)||e.ts.isFunctionDeclaration(n))&&n.modifiers&&n.modifiers.some(o=>o.kind===e.ts.SyntaxKind.ExportKeyword)){r.push({isDefaultExport:n.modifiers.some(o=>o.kind===e.ts.SyntaxKind.DefaultKeyword),statement:n,node:n});continue}}return r}function WA(e,t){let r=[];for(let n of t.statements)if(e.ts.isExpressionStatement(n)&&e.ts.isBinaryExpression(n.expression)&&e.ts.isPropertyAccessExpression(n.expression.left)){let o=n.expression.left,s=n.expression.right;if(!e.ts.isIdentifier(o.expression))continue;if(o.expression.text==="module"&&o.name.text==="exports"){if(e.ts.isIdentifier(s)){let i=s.text;for(let a of t.statements)if(e.ts.isVariableStatement(a))for(let u of a.declarationList.declarations)e.ts.isIdentifier(u.name)&&u.name.text===i&&r.push({isDefaultExport:!0,statement:a,node:a});else e.ts.isFunctionDeclaration(a)&&a.name&&a.name.text===i&&r.push({isDefaultExport:!0,statement:a,node:a})}else r.push({isDefaultExport:!0,statement:n,node:s});continue}}return r}function ZA(e,t,r){for(let n of t.statements)if(e.ts.isImportDeclaration(n)&&n.importClause){if(n.importClause.namedBindings&&e.ts.isNamedImports(n.importClause.namedBindings)){for(let o of n.importClause.namedBindings.elements)if(e.ts.isIdentifier(o.name)&&o.name.text===r&&e.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"named"}}if(n.importClause.name&&n.importClause.name.text===r&&e.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"default"}}return null}async function Rr(e,t,r,n){let o=ZA(e,r,n);if(o){let s=await Ei(e,e.normalize(e.resolve(e.dirname(t),o.importPath))),i=e.relative(e.getAppRootDir(),s);return{displayFilePath:ge(e,s),filePath:s,relFilePath:i,importPath:o.importPath,exportType:o.exportType}}return null}function _o(e,t,r){for(let n=0;n<t.statements.length;n++){let o=t.statements[n];if(e.ts.isVariableStatement(o)){for(let s of o.declarationList.declarations)if(e.ts.isIdentifier(s.name)&&s.name.text===r)return{statement:o,statementIndex:n}}}return null}function Ge(e,t,r){let n=_o(e,t,r);if(n&&n.statement.declarationList.declarations.length>0){let o=n.statement.declarationList.declarations[0];if(o.initializer&&e.ts.isArrayLiteralExpression(o.initializer))return{statement:n.statement,statementIndex:n.statementIndex,variableDeclaration:o,arrayLiteralExp:o.initializer}}return null}function da(e,t){if(t){if(JA(e,t))return!0;let r=!1;if(t.forEachChild(n=>{da(e,n)&&(r=!0)}),r)return!0}return!1}function JA(e,t){return e.ts.isJsxElement(t)||e.ts.isJsxOpeningElement(t)||e.ts.isJsxOpeningFragment(t)||e.ts.isJsxSelfClosingElement(t)||e.ts.isJsxFragment(t)||e.ts.isJsxChild(t)}async function Ei(e,t){let r=e.extname(t).toLowerCase();if(r===""||!Ec.includes(r)){for(let n of Ec){let o=t+n;if(await e.exists(o))return o}for(let n of Ec){let o=e.join(t,"index"+n);if(await e.exists(o))return o}}return t}var Ec=[".tsx",".jsx",".ts",".js"];function Ao(e,t,r){if(!r||!t)return;let n=t.getSymbolAtLocation(r);if(!n)return;let o=n.valueDeclaration;if(!o)return;let s=o.getSourceFile().fileName,i=YA(e,s);return i?[{name:i}]:void 0}function YA(e,t){if(typeof t=="string"){t=e.normalize(mr(t));let r=t.split("/"),n=r.lastIndexOf("node_modules");if(n>-1){let o=r.slice(n+1),s=o[0];if(s)return s.startsWith("@")&&o[1]&&(s+="/"+o[1]),s}}}function tr(e){let t=[];for(let r of e)if(r.dependencies)for(let n of r.dependencies)t.some(o=>o.name===n.name)||t.push({...n});return t.sort((r,n)=>r.name.localeCompare(n.name))}function Zg(e,t,r="esm"){return r==="cjs"?eT(e,t):XA(e,t)}var QA=/^(@\w|\w)/;function XA(e,t){let r=[];for(let n of t.statements)if(e.ts.isImportDeclaration(n)&&e.ts.isLiteralExpression(n.moduleSpecifier)){if(!QA.test(n.moduleSpecifier.text)||n.importClause?.isTypeOnly)continue;if(n.importClause&&n.importClause.namedBindings&&e.ts.isNamedImports(n.importClause.namedBindings))for(let o of n.importClause.namedBindings.elements)o.isTypeOnly||r.push({isDefaultExport:!1,statement:n,node:o.name});n.importClause&&n.importClause.name&&r.push({isDefaultExport:!0,statement:n,node:n.importClause.name})}return r}function eT(e,t){return[]}async function To(e,t){if(!t.some(i=>!i.isRegistered))return t;let n=await Ze(e,t.map(i=>i.filePath)),o=n.getTypeChecker();return await Promise.all(t.map(async i=>{let a=n.getSourceFile(i.filePath);if(a){let c=(await Cn(e,o,i.filePath,a,!1)).find(l=>l.cmpInfo.id===i.id);c&&(i.inputs=qn(e,o,c.node.fnNode))}return i}))}async function Fo(e,t,r,n){if(t.node.fnNode){let{sourceFile:o,typeChecker:s}=await Co(e,t.cmpInfo.filePath,r),a=(await Cn(e,s,t.cmpInfo.filePath,o,n)).find(u=>u.cmpInfo.id===t.cmpInfo.id);if(!a)throw new Error(`createComponentInputs() Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return qn(e,s,a.node.fnNode)}return[]}async function Yg(e,t,r){let n=e.extname(t).toLowerCase();if(n===".tsx"||n===".jsx"||n===".ts"||n===".js"){let o=await e.readFile(t);if(o)return tT(e,t,o,r)}return null}function tT(e,t,r,n=!1){let o=se(e,r);return Cn(e,null,t,o,n)}async function Cn(e,t,r,n,o){let s=[];for(let a of n.statements)if(e.ts.isExpressionStatement(a)&&e.ts.isStringLiteral(a.expression)&&a.expression.text==="use server")return s;let i=Kn(e,n);return o&&i.push(...Zg(e,n)),r=e.normalize(r),await Promise.all(i.map(async a=>{let u=await rT(e,t,r,a);s.push(...u)})),s}async function rT(e,t,r,n){let o=[],s=e.relative(e.getAppRootDir(),r),i=xe(e,r);if(e.ts.isVariableStatement(n.node)){for(let a of n.node.declarationList.declarations){if(!e.ts.isIdentifier(a.name)||!vo(a.name.text))continue;let u=en(e,t,a.initializer);if(u){let c=u.name||a.name.text,l=n.isDefaultExport?"default":c,p=n.isDefaultExport?"default":"named";o.push({cmpInfo:{id:await Ce(e,r,l),displayFilePath:ge(e,r),name:we(c),inputs:[],exportName:l,exportType:p,importName:c,filePath:r,relFilePath:s,importPath:i,dependencies:u.deps,framework:"react"},node:u})}}return o}if(e.ts.isArrowFunction(n.node)){let a=en(e,t,n.node);if(a){let u=Yt(e,r),c=n.isDefaultExport?"default":u,l=n.isDefaultExport?"default":"named";o.push({cmpInfo:{id:await Ce(e,r,c),displayFilePath:ge(e,r),name:u,inputs:[],exportName:c,exportType:l,importName:Un(e,r),filePath:r,relFilePath:s,importPath:i,dependencies:a.deps,framework:"react"},node:a})}return o}if(e.ts.isFunctionExpression(n.node)||e.ts.isFunctionDeclaration(n.node)){let a=n.node.name?.text;if(a&&!vo(a))return o;let u=en(e,t,n.node);if(u){let c=u.name||Yt(e,r),l=n.isDefaultExport||!u.name?"default":u.name,p=n.isDefaultExport?"default":"named";o.push({cmpInfo:{id:await Ce(e,r,l),displayFilePath:ge(e,r),name:c,inputs:[],exportName:l,exportType:p,importName:u.name||Un(e,r),filePath:r,relFilePath:s,importPath:i,dependencies:u.deps,framework:"react"},node:u})}return o}if((e.ts.isExportSpecifier(n.node)||e.ts.isIdentifier(n.node))&&vo(n.node.getText())){let a,u=en(e,t,n.node);if(u){let c=u.name||Yt(e,r),l=n.isDefaultExport||!u.name?"default":u.name,p=n.isDefaultExport?"default":"named",d=nT(e,n.node)?.moduleSpecifier??oT(e,n.node)?.moduleSpecifier;if(d&&e.ts.isStringLiteral(d)){let g=t?.getSymbolAtLocation(d);if(g&&g.declarations&&g.declarations.length>0){let m=g.declarations[0];(!e.ts.isSourceFile(m)||e.ts.isSourceFile(m)&&m.fileName.includes("node_modules"))&&(a=d.text)}}o.push({cmpInfo:{id:await Ce(e,r,l,a),displayFilePath:ge(e,r),name:c,inputs:[],exportName:l,exportType:p,importName:u.name||Un(e,r),filePath:r,relFilePath:s,importPath:a||i,externalImportPath:a,dependencies:u.deps,framework:"react"},node:u})}return o}if(e.ts.isExportDeclaration(n.node)&&n.node.exportClause===void 0){let a=n.node.moduleSpecifier;if(a&&e.ts.isStringLiteral(a)){let u=await sT(e,t,r,a);o.push(...u)}return o}return o}function nT(e,t){for(;t;){if(e.ts.isExportDeclaration(t))return t;t=t.parent}return null}function oT(e,t){for(;t;){if(e.ts.isImportDeclaration(t))return t;t=t.parent}return null}function en(e,t,r){if(!r)return null;if(e.ts.isArrowFunction(r))return da(e,r.body)?{name:"",fnNode:r,deps:Ao(e,t,r)}:null;if(e.ts.isFunctionExpression(r)||e.ts.isFunctionDeclaration(r))return da(e,r.body)?{name:r.name?.text||"",fnNode:r,deps:Ao(e,t,r)}:null;if(e.ts.isCallExpression(r)){let n=r.expression;if(e.ts.isPropertyAccessExpression(n)){let o=r.arguments;if(o.length===0)return null;let s=n.expression;if(!e.ts.isIdentifier(s)||s.text!=="React")return null;let i=n.name;return!e.ts.isIdentifier(i)||i.text!=="forwardRef"?null:en(e,t,o[0])}else if(e.ts.isIdentifier(n)&&(n.text==="observer"||n.text==="forwardRef")){let o=r.arguments;return o.length===0?null:en(e,t,o[0])}return null}if(!t)return null;if(e.ts.isPropertyAccessExpression(r)){let n=r.expression,o=r.name;if(!e.ts.isIdentifier(n)||!e.ts.isIdentifier(o)||!vo(o.text))return null;let i=t.getTypeAtLocation(o).getCallSignatures();if(i.length>0&&i[0].getParameters().length>0)return{name:"",fnNode:o,deps:Ao(e,t,o)}}if(e.ts.isExportSpecifier(r)){let n=r.name;return{name:n.text||"",fnNode:n,deps:Ao(e,t,n)}}if(e.ts.isIdentifier(r))return{name:r.text||"",fnNode:r,deps:Ao(e,t,r)};if(e.ts.isExpressionStatement(r)){let n=r.expression;if(e.ts.isAsExpression(n)&&e.ts.isIdentifier(n.type)&&n.type.text==="default")return en(e,t,n.expression)}if(e.ts.isVariableStatement(r)){for(let n of r.declarationList.declarations)if(n.initializer&&e.ts.isAsExpression(n.initializer)){let o=n.initializer;if(e.ts.isIdentifier(o.type)&&o.type.text==="default"){let s=en(e,t,o.expression);if(s&&e.ts.isIdentifier(n.name))return{name:n.name.text,fnNode:s.fnNode,deps:s.deps}}}}return null}async function Qg(e,t){let r=[],n=t.getSourceFiles(),o=t.getTypeChecker();return await Promise.all(n.map(async s=>{let i=e.normalize(s.fileName);if(ta(e,iT,s.fileName)||i===e.reactConfigPath||i===e.builderComponentPath)return;let a=await Cn(e,o,i,s,i===e.registryPath);r.push(...a)})),r.sort((s,i)=>s.cmpInfo.name.localeCompare(i.cmpInfo.name))}var iT=new Set(["node_modules","dist"]);async function sT(e,t,r,n){let o=[],s=n.text;if(!t)return o;try{let i=t.getSymbolAtLocation(n);if(!i)return o;let a=t.getExportsOfModule(i);for(let u of a){let c=u.valueDeclaration||u.declarations?.[0];if(!c)continue;let l=u.name;if(!vo(l)&&l!=="default"||!Xg(e,t,c))continue;let p=en(e,t,c);if(p){let d=u.name,g=d==="default"?"default":"named",m=we(d),f=d==="default"?Un(e,r):d;o.push({cmpInfo:{id:await Ce(e,r,d,s),displayFilePath:ge(e,r),name:m,inputs:[],exportName:d,exportType:g,importName:f,filePath:r,relFilePath:e.relative(e.getAppRootDir(),r),importPath:s,externalImportPath:s,dependencies:p.deps,framework:"react"},node:p})}}}catch(i){e.Sentry?.captureException(new Error(`Error processing module ${s}:`,{cause:i}),{extra:{modulePath:s,filePath:r}})}return o}function Xg(e,t,r){if(e.ts.isInterfaceDeclaration(r)||e.ts.isTypeAliasDeclaration(r))return!1;if(e.ts.isExportSpecifier(r)){let n=t.getSymbolAtLocation(r.name);if(n){let s=t.getAliasedSymbol(n).declarations?.[0];if(s)return Xg(e,t,s)}return!1}if(e.ts.isFunctionDeclaration(r)||e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r)){let n=t.getSignatureFromDeclaration(r);if(n){let o=t.getReturnTypeOfSignature(n);return Jg(o,t)}}return e.ts.isClassDeclaration(r)?r.heritageClauses?.some(o=>o.types.some(s=>s.expression.getText()==="React.Component"||s.expression.getText()==="Component"))??!1:e.ts.isVariableDeclaration(r)?t.getTypeAtLocation(r).getCallSignatures().some(s=>Jg(t.getReturnTypeOfSignature(s),t)):!1}function Jg(e,t){let r=t.typeToString(e);return r==="JSX.Element"||r==="Element"||r.includes("ReactElement")||r.includes("React.ReactElement")||r.includes("ReactNode")}async function eh(e,t){let r=[],n=t.getSourceFiles(),o=t.getTypeChecker();return await Promise.all(n.map(async s=>{let i=e.basename(s.fileName);if(e.appDir&&aT.has(i)||e.dirname(s.fileName).includes("node_modules"))return;let a=e.normalize(s.fileName);if(a===e.nextConfigPath||a===e.builderComponentPath)return;let u=await Cn(e,o,a,s,a===e.registryPath||Jt(a));r.push(...u)})),r.sort((s,i)=>s.cmpInfo.name.localeCompare(i.cmpInfo.name))}var aT=new Set(["default.tsx","default.ts","default.jsx","default.js","error.tsx","error.ts","error.jsx","error.js","layout.tsx","layout.ts","layout.jsx","layout.js","loading.tsx","loading.ts","loading.jsx","loading.js","not-found.tsx","not-found.ts","not-found.jsx","not-found.js","page.tsx","page.ts","page.jsx","page.js","route.tsx","route.ts","route.jsx","route.js","template.tsx","template.ts","template.jsx","template.js"]);function $r(e,t){let r=[],n=[],o=[],s=[];for(let i of t.statements){if(e.ts.isImportDeclaration(i)){if(e.ts.isStringLiteral(i.moduleSpecifier)){let u=i.moduleSpecifier.text;if(!u.startsWith(".")&&!u.startsWith("/")){r.push(i);continue}}let a=i.importClause;if(a){if(a.namedBindings){n.push(i);continue}if(a.name){n.push(i);continue}}o.push(i);continue}s.push(i)}return e.ts.factory.updateSourceFile(t,[...Pc(e,r),...Pc(e,n),...Pc(e,o),...s])}function yr(e){let t=e.split(`
307
307
  `).map(n=>n.trimEnd());e="";let r=!1;for(let n=t.length-1;n>=0;n--){let o=t[n];!r&&o.startsWith("import ")&&(r=!0,o=o+`
308
308
  `),/^builder.init(.*)$/.test(o)&&(o=o+`
309
309
  `),t[n-1]&&!t[n-1].includes("*/")&&(o.trim().startsWith("Builder.registerComponent")&&(o=`
@@ -312,8 +312,8 @@ ${r}=${n}
312
312
  `+o),o.trim().startsWith("export ")&&(o=`
313
313
  `+o)),e=o+`
314
314
  `+e}return e.trim()+`
315
- `}function Ec(e,t){return t.sort((r,n)=>{let o=eh(e,r),s=eh(e,n);return o.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())})}function eh(e,t){let r=t.importClause;if(r){let n=r.namedBindings;if(n&&e.ts.isNamedImports(n)&&n.elements.length>0)return n.elements[0].name.text;if(r.name)return r.name.text}return t.moduleSpecifier&&e.ts.isStringLiteral(t.moduleSpecifier)?t.moduleSpecifier.text:""}function rh(e){return typeof e=="string"&&!e.includes("'use client'")&&!e.includes(`"use client"'`)&&(e=`"use client"
316
- ${e}`),e}function nh(e,t){let r=t.statements.filter(n=>!(e.ts.isExpressionStatement(n)&&e.ts.isStringLiteral(n.expression)&&e.ts.isStringLiteral(n.expression)&&n.expression.text==="use client"));return e.ts.factory.updateSourceFile(t,r)}function Rr(e,t){return t.sort((r,n)=>{if(e.ts.isObjectLiteralExpression(r)&&e.ts.isObjectLiteralExpression(n)){let o=th(e,r),s=th(e,n);return o.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())}return 1})}function th(e,t){let r=t.properties.find(n=>he(e,n)==="name");return r&&e.ts.isPropertyAssignment(r)&&e.ts.isStringLiteral(r.initializer)?r.initializer.text:"zzzz"}async function oh(e){let t=await e.readFile(e.registryPath);return t?aF(e,t):{components:[],sourceFile:se(e,"")}}async function aF(e,t){let r=se(e,t);return e.sdkVersion===V.gen2?cF(e,r):uF(e,r)}async function uF(e,t){let r=[];for(let n=0;n<t.statements.length;n++){let o=t.statements[n];if(!e.ts.isExpressionStatement(o))continue;let s=o.expression;if(!e.ts.isCallExpression(s))continue;let i=s.expression;if(!e.ts.isPropertyAccessExpression(i))continue;let a=i.expression;if(!e.ts.isIdentifier(a)||a.text!=="Builder"||i.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let l=c[1];if(!e.ts.isObjectLiteralExpression(l))continue;let p=c[0];if(e.ts.isCallExpression(p)){let d=e.ts.isIdentifier(p.expression)&&p.expression.text;if(d==="withChildren"){let m=Ac(e,p.arguments[0]);if(e.ts.isCallExpression(m)){let f=await Pc(e,n,m,l,!0);f&&r.push(f)}else{let f=m;if(e.ts.isIdentifier(f)){let h=await _c(e,t,n,f,l,!0);h&&r.push(h)}}continue}if(d==="dynamic"){let m=await Pc(e,n,p,l,!1);m&&r.push(m);continue}let g=Ac(e,p.arguments[0]);if(e.ts.isCallExpression(g)&&e.ts.isIdentifier(g.expression)&&g.expression.text==="dynamic"){let m=await Pc(e,n,g,l,!1);m&&r.push(m);continue}if(e.ts.isIdentifier(g)){let m=await _c(e,t,n,g,l,!1);m&&r.push(m);continue}continue}if(e.ts.isIdentifier(p)){let d=await _c(e,t,n,p,l,!1);d&&r.push(d);continue}}return{sourceFile:t,components:_t(r)}}function Ac(e,t){return e.ts.isCallExpression(t)?(e.ts.isIdentifier(t.expression)&&t.expression.text)==="dynamic"?t:Ac(e,t.arguments[0]):t}async function Pc(e,t,r,n,o){let s={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:t,acceptsChildren:o,framework:"react"},i=r.arguments;if(i.length===0)return null;let a=i[0];if(!e.ts.isArrowFunction(a))return null;let u=a.body;if(e.ts.isCallExpression(u)){if(u.expression.kind!==e.ts.SyntaxKind.ImportKeyword||u.arguments.length!==1)return null;let l=u.arguments[0];if(!e.ts.isStringLiteral(l))return null;let p=l.text,d=await $o(e,p);s.filePath=d,s.relFilePath=e.relative(e.getAppRootDir(),s.filePath),await e.exists(d)?s.importPath=we(e,s.filePath):(s.externalImportPath=p,s.importPath=s.externalImportPath),s.name=Yt(e,s.filePath),s.importName="default",s.exportName="default",s.exportType="default"}else if(e.ts.isPropertyAccessExpression(u)){let c=u.expression;if(!e.ts.isParenthesizedExpression(c))return null;let l=c.expression;if(!e.ts.isAwaitExpression(l))return null;let p=l.expression;if(!e.ts.isCallExpression(p)||p.expression.kind!==e.ts.SyntaxKind.ImportKeyword||p.arguments.length!==1)return null;let g=p.arguments[0];if(!e.ts.isStringLiteral(g)||!e.ts.isIdentifier(u.name))return null;let m=g.text,f=await $o(e,m);s.filePath=f,s.relFilePath=e.relative(e.getAppRootDir(),s.filePath),await e.exists(f)?s.importPath=we(e,s.filePath):(s.externalImportPath=m,s.importPath=s.externalImportPath),s.name=be(u.name.text),s.importName=u.name.text,s.exportName=u.name.text,s.exportType="named"}else return null;return s=Ft(e,s,n),s.displayFilePath=ge(e,s.filePath),s.filePath&&s.exportName&&(s.id=await ve(e,s.filePath,s.exportName,s.externalImportPath)),s}async function _c(e,t,r,n,o,s){let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=t.statements.filter(c=>e.ts.isImportDeclaration(c)),u=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(u){let c=u.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;let l=await $o(e,c.text);i.filePath=l,i.relFilePath=e.relative(e.getAppRootDir(),i.filePath),await e.exists(l)?i.importPath=we(e,i.filePath):(i.externalImportPath=c.text,i.importPath=i.externalImportPath),i.name=Yt(e,i.filePath),i.importName=n.text,i.exportName="default",i.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!e.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(g=>g.name.text===n.text));if(!c)return null;let l=c.moduleSpecifier;if(!e.ts.isStringLiteral(l))return null;let p=await $o(e,l.text);i.filePath=p,i.relFilePath=e.relative(e.getAppRootDir(),i.filePath),await e.exists(p)?i.importPath=we(e,i.filePath):(i.externalImportPath=l.text,i.importPath=i.externalImportPath),i.name=be(n.text),i.importName=n.text,i.exportName=n.text,i.exportType="named"}return i=Ft(e,i,o),i.displayFilePath=ge(e,i.filePath),i.filePath&&i.exportName&&(i.id=await ve(e,i.filePath,i.exportName,i.externalImportPath)),i}function $o(e,t){return Ei(e,e.normalize(e.resolve(e.dirname(e.registryPath),t)))}function ih(e,t,r){let n=!1,o=0,s=[...t.statements];for(let c=0;c<s.length;c++){let l=s[c];if(e.ts.isImportDeclaration(l)){o=c;continue}if(!e.ts.isExpressionStatement(l))continue;let p=l.expression;if(!e.ts.isCallExpression(p))continue;let d=p.expression;if(!e.ts.isPropertyAccessExpression(d))continue;let g=d.expression;if(!e.ts.isIdentifier(g)||g.text!=="builder")continue;if(d.name.text=="init"){n=!0;break}else continue}if(n)return t;let i=e.ts.factory.createPropertyAccessExpression(e.ts.factory.createPropertyAccessExpression(e.ts.factory.createIdentifier("process"),e.ts.factory.createIdentifier("env")),e.ts.factory.createIdentifier(Tr)),a=r?e.ts.factory.createNonNullExpression(i):i,u=e.ts.factory.createExpressionStatement(e.ts.factory.createCallExpression(e.ts.factory.createPropertyAccessExpression(e.ts.factory.createIdentifier("builder"),e.ts.factory.createIdentifier("init")),void 0,[a]));return s.splice(o+1,0,u),e.ts.factory.updateSourceFile(t,s)}async function cF(e,t){let r=[],n=Ke(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(o,s)=>{let i=await Fc(e,t,o);i&&(i.nodeIndex=s,r.push(i))})),{sourceFile:t,components:_t(r)}}async function Fc(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};Po(e,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!e.ts.isPropertyAssignment(s)||!e.ts.isIdentifier(s.name))continue;if(he(e,s)==="component"){let a,{initializer:u}=s;if(e.ts.isCallExpression(u)&&(e.ts.isIdentifier(u.expression)&&u.expression.text)==="dynamic"){let g=u.arguments;if(g.length===0)return null;let m=g[0];if(!e.ts.isArrowFunction(m))return null;let f=m.body;if(e.ts.isCallExpression(f)){if(f.expression.kind!==e.ts.SyntaxKind.ImportKeyword||f.arguments.length!==1)return null;let y=f.arguments[0];if(!e.ts.isStringLiteral(y))return null;let b=y.text,C=await $o(e,b);n.filePath=C,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(C)?n.importPath=we(e,n.filePath):(n.externalImportPath=b,n.importPath=n.externalImportPath),n.name=Yt(e,n.filePath),n.importName="default",n.exportName="default",n.exportType="default"}else if(e.ts.isPropertyAccessExpression(f)){let h=f.expression;if(!e.ts.isParenthesizedExpression(h))return null;let y=h.expression;if(!e.ts.isAwaitExpression(y))return null;let b=y.expression;if(!e.ts.isCallExpression(b)||b.expression.kind!==e.ts.SyntaxKind.ImportKeyword||b.arguments.length!==1)return null;let _=b.arguments[0];if(!e.ts.isStringLiteral(_)||!e.ts.isIdentifier(f.name))return null;let S=_.text,T=await $o(e,S);n.filePath=T,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(T)?n.importPath=we(e,n.filePath):(n.externalImportPath=S,n.importPath=n.externalImportPath),n.name=be(f.name.text),n.importName=f.name.text,n.exportName=f.name.text,n.exportType="named"}else return null;return n=Ft(e,n,r),n.displayFilePath=ge(e,n.filePath),n.filePath&&n.exportName&&(n.id=await ve(e,n.filePath,n.exportName,n.externalImportPath)),n}if(e.ts.isIdentifier(u)&&(a=u.text),!a)continue;n.name===""&&(n.name=be(a)),n.importName=a;let c=await $r(e,e.registryPath,t,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await e.exists(c.filePath)?n.importPath=we(e,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.importPath=we(e,c.filePath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let l=t.statements.filter(d=>e.ts.isImportDeclaration(d)),p=l.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!e.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=l.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let g=d.moduleSpecifier;if(!e.ts.isStringLiteral(g))return null;n.exportName=a}continue}}return n=Ft(e,n,r),n.filePath&&n.exportName&&(n.id=await ve(e,n.filePath,n.exportName,n.externalImportPath)),n}function Ir(e,t){let r=[...t.statements],n=!1;for(let o=t.statements.length-1;o>=0;o--){let s=t.statements[o];if(e.ts.isImportDeclaration(s)&&s.importClause){let i=!1,a=s.importClause.namedBindings;if(a&&e.ts.isNamedImports(a)&&a.elements){let u=[...a.elements];for(let c=u.length-1;c>=0;c--){let l=u[c];if(e.ts.isImportSpecifier(l)){let p=l.name;if(p&&e.ts.isIdentifier(p)){let d=p.text;sh(e,t,d)||u.splice(c,1)}}}if(u.length===0)i=!0;else if(a.elements.length!==u.length){let c=e.ts.factory.updateImportClause(s.importClause,!1,s.importClause.name,e.ts.factory.createNamedImports(u)),l=e.ts.factory.updateImportDeclaration(s,void 0,c,s.moduleSpecifier,void 0);r[o]=l,n=!0}}else if(s.importClause.name&&e.ts.isIdentifier(s.importClause.name)){let u=s.importClause.name.text;sh(e,t,u)||(i=!0)}i&&(r.splice(o,1),n=!0)}}return n?e.ts.factory.updateSourceFile(t,r):t}function sh(e,t,r){let n=!1;function o(s){if(!e.ts.isImportDeclaration(s)){if(e.ts.isIdentifier(s)&&s.text===r){n=!0;return}e.ts.forEachChild(s,o)}}return e.ts.forEachChild(t,o),n}function Nr(e,t,r,n,o,s,i){let a=null,u=null,c=null,l=-1;t=jt(t),r=jt(r);let p=t.find(g=>g.id===e),d=r.find(g=>g.id===e);if(n)d||(a={...jt(p),inputs:jt(p.inputs).map(g=>(g.isRegistered=!0,g))},l=r.length,r.push(a));else if(typeof d?.nodeIndex=="number"&&d.nodeIndex>-1){if(o)l=d.nodeIndex,u=jt(d),r=r.filter(g=>g.id!==e);else if(s!=null)lF(d,s),l=d.nodeIndex,c=d;else if(i!=null){let g=d.inputs.find(m=>m.name===i.name);g&&(i.registerInput===!1?g.isRegistered=!1:(pF(g,i),g.isRegistered=!0),c=d,l=d.nodeIndex)}}return{addCmpToRegistry:a,removeCmpFromRegistry:u,updateRegisteredCmp:c,nodeIndex:l,components:Dr(t,r)}}function Dr(e,t){let r=_t([...t.map(n=>(n.isRegistered=!0,n)),...e.filter(n=>!t.some(o=>o.id===n.id)).map(n=>(n.isRegistered=!1,n))]);return r.forEach(n=>{n.inputs=n.inputs.map(wc),n.inputs.sort((i,a)=>i.name.toLowerCase().localeCompare(a.name.toLowerCase()));let o=t.find(i=>i.id===n.id);o&&(o.acceptsChildren=bc(n));let s=e.find(i=>i.id===n.id&&i.externalImportPath);s&&(n.filePath=s.filePath,n.relFilePath=s.relFilePath)}),r}function lF(e,t){Ct(t.name)?e.name=t.name:t.name===null&&(e.name=e.importName),Ct(t.description)?e.description=t.description:t.description===null&&delete e.description,Ct(t.image)?e.image=t.image:t.image===null&&delete e.image}function pF(e,t){Ct(t.type)&&(e.type=t.type),Ct(t.friendlyName)?e.friendlyName=t.friendlyName:t.friendlyName===null&&delete e.friendlyName,Ct(t.defaultValue)||hi(t.defaultValue)||Do(t.defaultValue)?e.defaultValue=t.defaultValue:t.defaultValue===null&&delete e.defaultValue,Ct(t.helperText)?e.helperText=t.helperText:t.helperText===null&&delete e.helperText,t.required===!0?e.required=t.required:(t.required===null||t.required===!1)&&delete e.required}async function bn(e){let t=new Set,r=async o=>{let s=await e.readdir(o);await Promise.all(s.map(async i=>{if(i.startsWith(".")||i==="node_modules")return;let a=e.join(o,i),u=e.extname(i).toLowerCase();if(u===".tsx"||u===".jsx"||u===".ts"||u===".js"){t.add(a);return}(await e.stat(a)).isDirectory()&&await r(a)}))};return await r(e.getAppRootDir()),await We(e,[...t])}function Or(e,t,r){return _o(e,t,r.variableName)?t:dF(e,t,r)}function dF(e,t,r){let n=typeof r.arrayType=="string"?e.ts.factory.createArrayTypeNode(e.ts.factory.createTypeReferenceNode(r.arrayType,void 0)):void 0,o=e.ts.factory.createArrayLiteralExpression([]),s=e.ts.factory.createVariableDeclaration(r.variableName,void 0,n,o),i=e.ts.factory.createVariableDeclarationList([s],e.ts.NodeFlags.Const),a=e.ts.factory.createModifier(e.ts.SyntaxKind.ExportKeyword),u=e.ts.factory.createVariableStatement([a],i),c=[...t.statements,u];return e.ts.factory.updateSourceFile(t,c)}async function Mr(e,t,r,n,o,s,i,a){let u=await bn(e),[c,l,p,d]=await Promise.all([Xg(e,u),oh(e),bt(e),wi(e)]),g=c.map(C=>C.cmpInfo),m=l.components,f={components:Dr(g,m),registryPath:e.registryPath,registryDisplayPath:ge(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:tr(g),publicApiKey:d.envValue??void 0,devToolsVersion:e.version};if(a)return f.components=await Fo(e,f.components),f;let h=!1,y=l.sourceFile,b=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(b.length>0){let C=b.map(T=>{let k=c.find(I=>I.cmpInfo.id===T);if(!k)throw new Error(`Component ${T} not found`);return k}),_=Array.from(new Set(C.map(T=>T.cmpInfo.filePath))),S=await We(e,_);for(let T of C){let k=f.components.find(D=>D.id===T.cmpInfo.id),I=await To(e,T,S,e.registryPath===T.cmpInfo.filePath||Jt(T.cmpInfo.filePath));Vt(k,I);let R=g.findIndex(D=>D.id===T.cmpInfo.id);g[R].inputs=I;let $=Nr(T.cmpInfo.id,g,m,r,n,o,s);if(e.sdkVersion===V.gen2){let{elements:D,elmIndex:B,statementIndex:U,statement:H,variableDeclaration:w}=await gF(e,y,T);if($.addCmpToRegistry)D.push(mF(e,$.addCmpToRegistry)),h=!0;else if($.removeCmpFromRegistry)D.splice(B,1),h=!0;else if($.updateRegisteredCmp){let E=Ze(e,D[B],$.updateRegisteredCmp);D[B]=e.ts.factory.updateObjectLiteralExpression(E,[uh(e,$.updateRegisteredCmp),...E.properties.slice(1)]),h=!0}if(h&&i){let E=[...y.statements];E[U]=e.ts.factory.updateVariableStatement(H,H.modifiers,e.ts.factory.updateVariableDeclarationList(H.declarationList,[e.ts.factory.updateVariableDeclaration(w,w.name,w.exclamationToken,w.type,e.ts.factory.createArrayLiteralExpression(Rr(e,D)))])),y=e.ts.factory.updateSourceFile(y,E),y=ah(e,$,y),y=ce(e,y,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),y=Or(e,y,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=$.components,m=$.components.filter(Be=>Be.isRegistered)}}else{let D=[...y.statements];$.addCmpToRegistry?(D.push(qg(e,$.addCmpToRegistry)),h=!0):$.removeCmpFromRegistry?(D.splice($.nodeIndex,1),h=!0):$.updateRegisteredCmp&&(D[$.nodeIndex]=xc(e,D[$.nodeIndex],$.updateRegisteredCmp),h=!0),h&&i&&(y=e.ts.factory.updateSourceFile(y,D),y=ce(e,y,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),y=ih(e,y,p),y=ah(e,$,y),k?.acceptsChildren&&(y=ce(e,y,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=$.components,m=$.components.filter(B=>B.isRegistered))}}}if(h&&i){y=Ir(e,y),y=kr(e,y),e.appDir&&(y=nh(e,y));let C=Ye(e,y);C=yr(C),e.appDir&&(C=rh(C)),C=await e.formatCode(e.registryPath,C),await e.writeFile(e.registryPath,C)}return f}function uh(e,t){let r=e.ts.factory.createIdentifier(t.importName);return e.appDir?e.ts.factory.createPropertyAssignment("component",r):e.ts.factory.createPropertyAssignment("component",hF(e,t))}function fF(e){return e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())}function mF(e,t){return Ze(e,e.ts.factory.createObjectLiteralExpression([uh(e,t),...t.acceptsChildren?[fF(e)]:[]],!0),t)}async function gF(e,t,r){let n=Ke(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let o=n.arrayLiteralExp.elements.filter(i=>e.ts.isObjectLiteralExpression(i)),s=-1;for(let i=0;i<o.length;i++)if((await Fc(e,t,o[i]))?.id===r.cmpInfo.id){s=i;break}return{...n,elements:o,elmIndex:s}}function ah(e,t,r){if(e.appDir){let n=t.addCmpToRegistry||t.updateRegisteredCmp;if(n){let o=n.externalImportPath?n.externalImportPath:ae(e,e.registryPath,n.filePath);n.exportType==="default"?r=ce(e,r,{defaultImport:n.importName,importPath:o}):n.exportType==="named"&&(r=ce(e,r,{namedImports:[n.importName],importPath:o}))}}else r=ce(e,r,{defaultImport:"dynamic",importPath:"next/dynamic"});return r}function hF(e,t){let r=t.externalImportPath?t.externalImportPath:ae(e,e.registryPath,t.filePath),n=t.exportName!=="default",o;n?o=e.ts.factory.createPropertyAccessExpression(e.ts.factory.createAwaitExpression(e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("import"),void 0,[e.ts.factory.createStringLiteral(r)])),e.ts.factory.createIdentifier(t.exportName)):o=e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("import"),void 0,[e.ts.factory.createStringLiteral(r)]);let s=e.ts.factory.createArrowFunction(n?[e.ts.factory.createModifier(e.ts.SyntaxKind.AsyncKeyword)]:void 0,void 0,[],void 0,e.ts.factory.createToken(e.ts.SyntaxKind.EqualsGreaterThanToken),o);return e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("dynamic"),void 0,[s])}async function lh(e){let t=[],r=await bF(e,t);return await gh(e,t,r),e.appDir?(e.debug(`ensure builder setup for next.js app ${e.appDir}`),await DF(e,e.appDir,t)):e.pagesDir&&(e.debug(`ensure builder setup for next.js pages ${e.pagesDir}`),await vF(e,e.pagesDir,t)),t}async function ph(e){let t=[];return await gh(e,t),e.appDir?(e.debug(`ensure figma-imports setup for next.js app ${e.appDir}`),await yF(e,e.appDir,t)):e.pagesDir&&(e.debug(`ensure figma-imports setup for next.js pages ${e.pagesDir}`),await CF(e,e.pagesDir,t)),t}async function yF(e,t,r){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,o=e.join(t,"figma-imports",n);if(!await e.exists(o)){let s=await e.formatCode(o,fh({sys:e,routePath:o,modelName:"figma-imports"}));await e.writeFile(o,s),r.push({filePath:o,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let s=await e.formatCode(e.builderComponentPath,dh(e));await e.writeFile(e.builderComponentPath,s),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}}async function DF(e,t,r){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,o=e.join(t,"[...page]",n);if(!await e.exists(o)){let s=await e.formatCode(o,fh({sys:e,routePath:o,modelName:"page"}));await e.writeFile(o,s),r.push({filePath:o,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let s=await e.formatCode(e.builderComponentPath,dh(e));await e.writeFile(e.builderComponentPath,s),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}}function dh(e){let t=e.typescriptEnabled;return e.sdkVersion===V.gen2?`
315
+ `}function Pc(e,t){return t.sort((r,n)=>{let o=th(e,r),s=th(e,n);return o.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())})}function th(e,t){let r=t.importClause;if(r){let n=r.namedBindings;if(n&&e.ts.isNamedImports(n)&&n.elements.length>0)return n.elements[0].name.text;if(r.name)return r.name.text}return t.moduleSpecifier&&e.ts.isStringLiteral(t.moduleSpecifier)?t.moduleSpecifier.text:""}function nh(e){return typeof e=="string"&&!e.includes("'use client'")&&!e.includes(`"use client"'`)&&(e=`"use client"
316
+ ${e}`),e}function oh(e,t){let r=t.statements.filter(n=>!(e.ts.isExpressionStatement(n)&&e.ts.isStringLiteral(n.expression)&&e.ts.isStringLiteral(n.expression)&&n.expression.text==="use client"));return e.ts.factory.updateSourceFile(t,r)}function kr(e,t){return t.sort((r,n)=>{if(e.ts.isObjectLiteralExpression(r)&&e.ts.isObjectLiteralExpression(n)){let o=rh(e,r),s=rh(e,n);return o.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())}return 1})}function rh(e,t){let r=t.properties.find(n=>he(e,n)==="name");return r&&e.ts.isPropertyAssignment(r)&&e.ts.isStringLiteral(r.initializer)?r.initializer.text:"zzzz"}async function ih(e){let t=await e.readFile(e.registryPath);return t?uT(e,t):{components:[],sourceFile:se(e,"")}}async function uT(e,t){let r=se(e,t);return e.sdkVersion===V.gen2?lT(e,r):cT(e,r)}async function cT(e,t){let r=[];for(let n=0;n<t.statements.length;n++){let o=t.statements[n];if(!e.ts.isExpressionStatement(o))continue;let s=o.expression;if(!e.ts.isCallExpression(s))continue;let i=s.expression;if(!e.ts.isPropertyAccessExpression(i))continue;let a=i.expression;if(!e.ts.isIdentifier(a)||a.text!=="Builder"||i.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let l=c[1];if(!e.ts.isObjectLiteralExpression(l))continue;let p=c[0];if(e.ts.isCallExpression(p)){let d=e.ts.isIdentifier(p.expression)&&p.expression.text;if(d==="withChildren"){let m=Tc(e,p.arguments[0]);if(e.ts.isCallExpression(m)){let f=await _c(e,n,m,l,!0);f&&r.push(f)}else{let f=m;if(e.ts.isIdentifier(f)){let h=await Ac(e,t,n,f,l,!0);h&&r.push(h)}}continue}if(d==="dynamic"){let m=await _c(e,n,p,l,!1);m&&r.push(m);continue}let g=Tc(e,p.arguments[0]);if(e.ts.isCallExpression(g)&&e.ts.isIdentifier(g.expression)&&g.expression.text==="dynamic"){let m=await _c(e,n,g,l,!1);m&&r.push(m);continue}if(e.ts.isIdentifier(g)){let m=await Ac(e,t,n,g,l,!1);m&&r.push(m);continue}continue}if(e.ts.isIdentifier(p)){let d=await Ac(e,t,n,p,l,!1);d&&r.push(d);continue}}return{sourceFile:t,components:At(r)}}function Tc(e,t){return e.ts.isCallExpression(t)?(e.ts.isIdentifier(t.expression)&&t.expression.text)==="dynamic"?t:Tc(e,t.arguments[0]):t}async function _c(e,t,r,n,o){let s={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:t,acceptsChildren:o,framework:"react"},i=r.arguments;if(i.length===0)return null;let a=i[0];if(!e.ts.isArrowFunction(a))return null;let u=a.body;if(e.ts.isCallExpression(u)){if(u.expression.kind!==e.ts.SyntaxKind.ImportKeyword||u.arguments.length!==1)return null;let l=u.arguments[0];if(!e.ts.isStringLiteral(l))return null;let p=l.text,d=await Ro(e,p);s.filePath=d,s.relFilePath=e.relative(e.getAppRootDir(),s.filePath),await e.exists(d)?s.importPath=xe(e,s.filePath):(s.externalImportPath=p,s.importPath=s.externalImportPath),s.name=Yt(e,s.filePath),s.importName="default",s.exportName="default",s.exportType="default"}else if(e.ts.isPropertyAccessExpression(u)){let c=u.expression;if(!e.ts.isParenthesizedExpression(c))return null;let l=c.expression;if(!e.ts.isAwaitExpression(l))return null;let p=l.expression;if(!e.ts.isCallExpression(p)||p.expression.kind!==e.ts.SyntaxKind.ImportKeyword||p.arguments.length!==1)return null;let g=p.arguments[0];if(!e.ts.isStringLiteral(g)||!e.ts.isIdentifier(u.name))return null;let m=g.text,f=await Ro(e,m);s.filePath=f,s.relFilePath=e.relative(e.getAppRootDir(),s.filePath),await e.exists(f)?s.importPath=xe(e,s.filePath):(s.externalImportPath=m,s.importPath=s.externalImportPath),s.name=we(u.name.text),s.importName=u.name.text,s.exportName=u.name.text,s.exportType="named"}else return null;return s=Ft(e,s,n),s.displayFilePath=ge(e,s.filePath),s.filePath&&s.exportName&&(s.id=await Ce(e,s.filePath,s.exportName,s.externalImportPath)),s}async function Ac(e,t,r,n,o,s){let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=t.statements.filter(c=>e.ts.isImportDeclaration(c)),u=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(u){let c=u.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;let l=await Ro(e,c.text);i.filePath=l,i.relFilePath=e.relative(e.getAppRootDir(),i.filePath),await e.exists(l)?i.importPath=xe(e,i.filePath):(i.externalImportPath=c.text,i.importPath=i.externalImportPath),i.name=Yt(e,i.filePath),i.importName=n.text,i.exportName="default",i.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!e.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(g=>g.name.text===n.text));if(!c)return null;let l=c.moduleSpecifier;if(!e.ts.isStringLiteral(l))return null;let p=await Ro(e,l.text);i.filePath=p,i.relFilePath=e.relative(e.getAppRootDir(),i.filePath),await e.exists(p)?i.importPath=xe(e,i.filePath):(i.externalImportPath=l.text,i.importPath=i.externalImportPath),i.name=we(n.text),i.importName=n.text,i.exportName=n.text,i.exportType="named"}return i=Ft(e,i,o),i.displayFilePath=ge(e,i.filePath),i.filePath&&i.exportName&&(i.id=await Ce(e,i.filePath,i.exportName,i.externalImportPath)),i}function Ro(e,t){return Ei(e,e.normalize(e.resolve(e.dirname(e.registryPath),t)))}function sh(e,t,r){let n=!1,o=0,s=[...t.statements];for(let c=0;c<s.length;c++){let l=s[c];if(e.ts.isImportDeclaration(l)){o=c;continue}if(!e.ts.isExpressionStatement(l))continue;let p=l.expression;if(!e.ts.isCallExpression(p))continue;let d=p.expression;if(!e.ts.isPropertyAccessExpression(d))continue;let g=d.expression;if(!e.ts.isIdentifier(g)||g.text!=="builder")continue;if(d.name.text=="init"){n=!0;break}else continue}if(n)return t;let i=e.ts.factory.createPropertyAccessExpression(e.ts.factory.createPropertyAccessExpression(e.ts.factory.createIdentifier("process"),e.ts.factory.createIdentifier("env")),e.ts.factory.createIdentifier(Fr)),a=r?e.ts.factory.createNonNullExpression(i):i,u=e.ts.factory.createExpressionStatement(e.ts.factory.createCallExpression(e.ts.factory.createPropertyAccessExpression(e.ts.factory.createIdentifier("builder"),e.ts.factory.createIdentifier("init")),void 0,[a]));return s.splice(o+1,0,u),e.ts.factory.updateSourceFile(t,s)}async function lT(e,t){let r=[],n=Ge(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(o,s)=>{let i=await Fc(e,t,o);i&&(i.nodeIndex=s,r.push(i))})),{sourceFile:t,components:At(r)}}async function Fc(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};Po(e,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!e.ts.isPropertyAssignment(s)||!e.ts.isIdentifier(s.name))continue;if(he(e,s)==="component"){let a,{initializer:u}=s;if(e.ts.isCallExpression(u)&&(e.ts.isIdentifier(u.expression)&&u.expression.text)==="dynamic"){let g=u.arguments;if(g.length===0)return null;let m=g[0];if(!e.ts.isArrowFunction(m))return null;let f=m.body;if(e.ts.isCallExpression(f)){if(f.expression.kind!==e.ts.SyntaxKind.ImportKeyword||f.arguments.length!==1)return null;let y=f.arguments[0];if(!e.ts.isStringLiteral(y))return null;let b=y.text,C=await Ro(e,b);n.filePath=C,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(C)?n.importPath=xe(e,n.filePath):(n.externalImportPath=b,n.importPath=n.externalImportPath),n.name=Yt(e,n.filePath),n.importName="default",n.exportName="default",n.exportType="default"}else if(e.ts.isPropertyAccessExpression(f)){let h=f.expression;if(!e.ts.isParenthesizedExpression(h))return null;let y=h.expression;if(!e.ts.isAwaitExpression(y))return null;let b=y.expression;if(!e.ts.isCallExpression(b)||b.expression.kind!==e.ts.SyntaxKind.ImportKeyword||b.arguments.length!==1)return null;let _=b.arguments[0];if(!e.ts.isStringLiteral(_)||!e.ts.isIdentifier(f.name))return null;let S=_.text,F=await Ro(e,S);n.filePath=F,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(F)?n.importPath=xe(e,n.filePath):(n.externalImportPath=S,n.importPath=n.externalImportPath),n.name=we(f.name.text),n.importName=f.name.text,n.exportName=f.name.text,n.exportType="named"}else return null;return n=Ft(e,n,r),n.displayFilePath=ge(e,n.filePath),n.filePath&&n.exportName&&(n.id=await Ce(e,n.filePath,n.exportName,n.externalImportPath)),n}if(e.ts.isIdentifier(u)&&(a=u.text),!a)continue;n.name===""&&(n.name=we(a)),n.importName=a;let c=await Rr(e,e.registryPath,t,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await e.exists(c.filePath)?n.importPath=xe(e,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.importPath=xe(e,c.filePath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let l=t.statements.filter(d=>e.ts.isImportDeclaration(d)),p=l.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!e.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=l.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let g=d.moduleSpecifier;if(!e.ts.isStringLiteral(g))return null;n.exportName=a}continue}}return n=Ft(e,n,r),n.filePath&&n.exportName&&(n.id=await Ce(e,n.filePath,n.exportName,n.externalImportPath)),n}function Ir(e,t){let r=[...t.statements],n=!1;for(let o=t.statements.length-1;o>=0;o--){let s=t.statements[o];if(e.ts.isImportDeclaration(s)&&s.importClause){let i=!1,a=s.importClause.namedBindings;if(a&&e.ts.isNamedImports(a)&&a.elements){let u=[...a.elements];for(let c=u.length-1;c>=0;c--){let l=u[c];if(e.ts.isImportSpecifier(l)){let p=l.name;if(p&&e.ts.isIdentifier(p)){let d=p.text;ah(e,t,d)||u.splice(c,1)}}}if(u.length===0)i=!0;else if(a.elements.length!==u.length){let c=e.ts.factory.updateImportClause(s.importClause,!1,s.importClause.name,e.ts.factory.createNamedImports(u)),l=e.ts.factory.updateImportDeclaration(s,void 0,c,s.moduleSpecifier,void 0);r[o]=l,n=!0}}else if(s.importClause.name&&e.ts.isIdentifier(s.importClause.name)){let u=s.importClause.name.text;ah(e,t,u)||(i=!0)}i&&(r.splice(o,1),n=!0)}}return n?e.ts.factory.updateSourceFile(t,r):t}function ah(e,t,r){let n=!1;function o(s){if(!e.ts.isImportDeclaration(s)){if(e.ts.isIdentifier(s)&&s.text===r){n=!0;return}e.ts.forEachChild(s,o)}}return e.ts.forEachChild(t,o),n}function Nr(e,t,r,n,o,s,i){let a=null,u=null,c=null,l=-1;t=Ut(t),r=Ut(r);let p=t.find(g=>g.id===e),d=r.find(g=>g.id===e);if(n)d||(a={...Ut(p),inputs:Ut(p.inputs).map(g=>(g.isRegistered=!0,g))},l=r.length,r.push(a));else if(typeof d?.nodeIndex=="number"&&d.nodeIndex>-1){if(o)l=d.nodeIndex,u=Ut(d),r=r.filter(g=>g.id!==e);else if(s!=null)pT(d,s),l=d.nodeIndex,c=d;else if(i!=null){let g=d.inputs.find(m=>m.name===i.name);g&&(i.registerInput===!1?g.isRegistered=!1:(dT(g,i),g.isRegistered=!0),c=d,l=d.nodeIndex)}}return{addCmpToRegistry:a,removeCmpFromRegistry:u,updateRegisteredCmp:c,nodeIndex:l,components:Dr(t,r)}}function Dr(e,t){let r=At([...t.map(n=>(n.isRegistered=!0,n)),...e.filter(n=>!t.some(o=>o.id===n.id)).map(n=>(n.isRegistered=!1,n))]);return r.forEach(n=>{n.inputs=n.inputs.map(xc),n.inputs.sort((i,a)=>i.name.toLowerCase().localeCompare(a.name.toLowerCase()));let o=t.find(i=>i.id===n.id);o&&(o.acceptsChildren=wc(n));let s=e.find(i=>i.id===n.id&&i.externalImportPath);s&&(n.filePath=s.filePath,n.relFilePath=s.relFilePath)}),r}function pT(e,t){bt(t.name)?e.name=t.name:t.name===null&&(e.name=e.importName),bt(t.description)?e.description=t.description:t.description===null&&delete e.description,bt(t.image)?e.image=t.image:t.image===null&&delete e.image}function dT(e,t){bt(t.type)&&(e.type=t.type),bt(t.friendlyName)?e.friendlyName=t.friendlyName:t.friendlyName===null&&delete e.friendlyName,bt(t.defaultValue)||hi(t.defaultValue)||Do(t.defaultValue)?e.defaultValue=t.defaultValue:t.defaultValue===null&&delete e.defaultValue,bt(t.helperText)?e.helperText=t.helperText:t.helperText===null&&delete e.helperText,t.required===!0?e.required=t.required:(t.required===null||t.required===!1)&&delete e.required}async function bn(e){let t=new Set,r=async o=>{let s=await e.readdir(o);await Promise.all(s.map(async i=>{if(i.startsWith(".")||i==="node_modules")return;let a=e.join(o,i),u=e.extname(i).toLowerCase();if(u===".tsx"||u===".jsx"||u===".ts"||u===".js"){t.add(a);return}(await e.stat(a)).isDirectory()&&await r(a)}))};return await r(e.getAppRootDir()),await Ze(e,[...t])}function Or(e,t,r){return _o(e,t,r.variableName)?t:fT(e,t,r)}function fT(e,t,r){let n=typeof r.arrayType=="string"?e.ts.factory.createArrayTypeNode(e.ts.factory.createTypeReferenceNode(r.arrayType,void 0)):void 0,o=e.ts.factory.createArrayLiteralExpression([]),s=e.ts.factory.createVariableDeclaration(r.variableName,void 0,n,o),i=e.ts.factory.createVariableDeclarationList([s],e.ts.NodeFlags.Const),a=e.ts.factory.createModifier(e.ts.SyntaxKind.ExportKeyword),u=e.ts.factory.createVariableStatement([a],i),c=[...t.statements,u];return e.ts.factory.updateSourceFile(t,c)}async function Mr(e,t,r,n,o,s,i,a){let u=await bn(e),[c,l,p,d]=await Promise.all([eh(e,u),ih(e),wt(e),wi(e)]),g=c.map(C=>C.cmpInfo),m=l.components,f={components:Dr(g,m),registryPath:e.registryPath,registryDisplayPath:ge(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:tr(g),publicApiKey:d.envValue??void 0,devToolsVersion:e.version};if(a)return f.components=await To(e,f.components),f;let h=!1,y=l.sourceFile,b=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(b.length>0){let C=b.map(F=>{let $=c.find(I=>I.cmpInfo.id===F);if(!$)throw new Error(`Component ${F} not found`);return $}),_=Array.from(new Set(C.map(F=>F.cmpInfo.filePath))),S=await Ze(e,_);for(let F of C){let $=f.components.find(D=>D.id===F.cmpInfo.id),I=await Fo(e,F,S,e.registryPath===F.cmpInfo.filePath||Jt(F.cmpInfo.filePath));Ht($,I);let k=g.findIndex(D=>D.id===F.cmpInfo.id);g[k].inputs=I;let R=Nr(F.cmpInfo.id,g,m,r,n,o,s);if(e.sdkVersion===V.gen2){let{elements:D,elmIndex:L,statementIndex:U,statement:H,variableDeclaration:w}=await hT(e,y,F);if(R.addCmpToRegistry)D.push(gT(e,R.addCmpToRegistry)),h=!0;else if(R.removeCmpFromRegistry)D.splice(L,1),h=!0;else if(R.updateRegisteredCmp){let E=Je(e,D[L],R.updateRegisteredCmp);D[L]=e.ts.factory.updateObjectLiteralExpression(E,[ch(e,R.updateRegisteredCmp),...E.properties.slice(1)]),h=!0}if(h&&i){let E=[...y.statements];E[U]=e.ts.factory.updateVariableStatement(H,H.modifiers,e.ts.factory.updateVariableDeclarationList(H.declarationList,[e.ts.factory.updateVariableDeclaration(w,w.name,w.exclamationToken,w.type,e.ts.factory.createArrayLiteralExpression(kr(e,D)))])),y=e.ts.factory.updateSourceFile(y,E),y=uh(e,R,y),y=ce(e,y,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),y=Or(e,y,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=R.components,m=R.components.filter(Be=>Be.isRegistered)}}else{let D=[...y.statements];R.addCmpToRegistry?(D.push(Kg(e,R.addCmpToRegistry)),h=!0):R.removeCmpFromRegistry?(D.splice(R.nodeIndex,1),h=!0):R.updateRegisteredCmp&&(D[R.nodeIndex]=Sc(e,D[R.nodeIndex],R.updateRegisteredCmp),h=!0),h&&i&&(y=e.ts.factory.updateSourceFile(y,D),y=ce(e,y,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),y=sh(e,y,p),y=uh(e,R,y),$?.acceptsChildren&&(y=ce(e,y,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=R.components,m=R.components.filter(L=>L.isRegistered))}}}if(h&&i){y=Ir(e,y),y=$r(e,y),e.appDir&&(y=oh(e,y));let C=Qe(e,y);C=yr(C),e.appDir&&(C=nh(C)),C=await e.formatCode(e.registryPath,C),await e.writeFile(e.registryPath,C)}return f}function ch(e,t){let r=e.ts.factory.createIdentifier(t.importName);return e.appDir?e.ts.factory.createPropertyAssignment("component",r):e.ts.factory.createPropertyAssignment("component",yT(e,t))}function mT(e){return e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())}function gT(e,t){return Je(e,e.ts.factory.createObjectLiteralExpression([ch(e,t),...t.acceptsChildren?[mT(e)]:[]],!0),t)}async function hT(e,t,r){let n=Ge(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let o=n.arrayLiteralExp.elements.filter(i=>e.ts.isObjectLiteralExpression(i)),s=-1;for(let i=0;i<o.length;i++)if((await Fc(e,t,o[i]))?.id===r.cmpInfo.id){s=i;break}return{...n,elements:o,elmIndex:s}}function uh(e,t,r){if(e.appDir){let n=t.addCmpToRegistry||t.updateRegisteredCmp;if(n){let o=n.externalImportPath?n.externalImportPath:ae(e,e.registryPath,n.filePath);n.exportType==="default"?r=ce(e,r,{defaultImport:n.importName,importPath:o}):n.exportType==="named"&&(r=ce(e,r,{namedImports:[n.importName],importPath:o}))}}else r=ce(e,r,{defaultImport:"dynamic",importPath:"next/dynamic"});return r}function yT(e,t){let r=t.externalImportPath?t.externalImportPath:ae(e,e.registryPath,t.filePath),n=t.exportName!=="default",o;n?o=e.ts.factory.createPropertyAccessExpression(e.ts.factory.createAwaitExpression(e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("import"),void 0,[e.ts.factory.createStringLiteral(r)])),e.ts.factory.createIdentifier(t.exportName)):o=e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("import"),void 0,[e.ts.factory.createStringLiteral(r)]);let s=e.ts.factory.createArrowFunction(n?[e.ts.factory.createModifier(e.ts.SyntaxKind.AsyncKeyword)]:void 0,void 0,[],void 0,e.ts.factory.createToken(e.ts.SyntaxKind.EqualsGreaterThanToken),o);return e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("dynamic"),void 0,[s])}async function ph(e){let t=[],r=await wT(e,t);return await hh(e,t,r),e.appDir?(e.debug(`ensure builder setup for next.js app ${e.appDir}`),await vT(e,e.appDir,t)):e.pagesDir&&(e.debug(`ensure builder setup for next.js pages ${e.pagesDir}`),await CT(e,e.pagesDir,t)),t}async function dh(e){let t=[];return await hh(e,t),e.appDir?(e.debug(`ensure figma-imports setup for next.js app ${e.appDir}`),await DT(e,e.appDir,t)):e.pagesDir&&(e.debug(`ensure figma-imports setup for next.js pages ${e.pagesDir}`),await bT(e,e.pagesDir,t)),t}async function DT(e,t,r){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,o=e.join(t,"figma-imports",n);if(!await e.exists(o)){let s=await e.formatCode(o,mh({sys:e,routePath:o,modelName:"figma-imports"}));await e.writeFile(o,s),r.push({filePath:o,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let s=await e.formatCode(e.builderComponentPath,fh(e));await e.writeFile(e.builderComponentPath,s),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}}async function vT(e,t,r){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,o=e.join(t,"[...page]",n);if(!await e.exists(o)){let s=await e.formatCode(o,mh({sys:e,routePath:o,modelName:"page"}));await e.writeFile(o,s),r.push({filePath:o,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let s=await e.formatCode(e.builderComponentPath,fh(e));await e.writeFile(e.builderComponentPath,s),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}}function fh(e){let t=e.typescriptEnabled;return e.sdkVersion===V.gen2?`
317
317
  "use client";
318
318
  import { ${t?"BuilderContent, ":""} isPreviewing, Content } from "@builder.io/sdk-react";
319
319
  import DefaultErrorPage from "next/error";
@@ -325,7 +325,7 @@ interface BuilderPageProps {
325
325
  }`:""}
326
326
 
327
327
  // Builder Public API Key set in .env file
328
- const builderApiKey = process.env.${Tr}${t?"!":""};
328
+ const builderApiKey = process.env.${Fr}${t?"!":""};
329
329
 
330
330
  export function RenderBuilderContent({ content, model }${t?": BuilderPageProps":""}) {
331
331
  // Call the isPreviewing hook to determine if
@@ -356,7 +356,7 @@ ${t?`
356
356
  type BuilderPageProps = ComponentProps<typeof BuilderComponent>;`:""}
357
357
 
358
358
  // Builder Public API Key set in .env file
359
- builder.init(process.env.${Tr}${t?"!":""});
359
+ builder.init(process.env.${Fr}${t?"!":""});
360
360
 
361
361
  export function RenderBuilderContent({ content, model }${t?": BuilderPageProps":""}) {
362
362
  // Call the useIsPreviewing hook to determine if
@@ -372,7 +372,7 @@ export function RenderBuilderContent({ content, model }${t?": BuilderPageProps":
372
372
  // DefaultErrorPage with a 404.
373
373
  return <DefaultErrorPage statusCode={404} />;
374
374
  }
375
- `.trimStart()}function ch(e){return e.features.asyncParams?`
375
+ `.trimStart()}function lh(e){return e.features.asyncParams?`
376
376
  interface PageProps {
377
377
  params: Promise<{
378
378
  page: string[];
@@ -382,14 +382,14 @@ interface PageProps {
382
382
  params: {
383
383
  page: string[];
384
384
  };
385
- }`}function fh({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled,o=ae(e,t,e.builderComponentPath);return e.sdkVersion===V.gen2?`
385
+ }`}function mh({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled,o=ae(e,t,e.builderComponentPath);return e.sdkVersion===V.gen2?`
386
386
  import { fetchOneEntry } from "@builder.io/sdk-react";
387
387
  import { RenderBuilderContent } from ${JSON.stringify(o)};
388
388
 
389
389
  // Builder Public API Key set in .env file
390
- const PUBLIC_API_KEY = process.env.${Tr}${n?"!":""};
390
+ const PUBLIC_API_KEY = process.env.${Fr}${n?"!":""};
391
391
 
392
- ${n?ch(e):""}
392
+ ${n?lh(e):""}
393
393
 
394
394
  export default async function Page(props${n?": PageProps":""}) {
395
395
  const builderModelName = "${r}";
@@ -416,8 +416,8 @@ import { builder } from "@builder.io/sdk";
416
416
  import { RenderBuilderContent } from ${JSON.stringify(o)};
417
417
 
418
418
  // Builder Public API Key set in .env file
419
- builder.init(process.env.${Tr}${n?"!":""});
420
- ${n?ch(e):""}
419
+ builder.init(process.env.${Fr}${n?"!":""});
420
+ ${n?lh(e):""}
421
421
 
422
422
  export default async function Page(props${n?": PageProps":""}) {
423
423
  const builderModelName = "${r}";
@@ -440,7 +440,7 @@ export default async function Page(props${n?": PageProps":""}) {
440
440
  </>
441
441
  );
442
442
  }
443
- `.trimStart()}async function vF(e,t,r){let n=`[...page].${e.typescriptEnabled?"tsx":"jsx"}`,o=e.join(t,n);if(!await e.exists(o)){let s=await e.formatCode(o,mh({sys:e,routePath:o,modelName:"page"}));await e.writeFile(o,s),r.push({filePath:o,modifiedType:"create"})}}async function CF(e,t,r){let n=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`,o=e.join(t,n);if(!await e.exists(o)){let s=await e.formatCode(o,mh({sys:e,routePath:o,modelName:"figma-imports"}));await e.writeFile(o,s),r.push({filePath:o,modifiedType:"create"})}}function mh({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled;return e.sdkVersion===V.gen2?`
443
+ `.trimStart()}async function CT(e,t,r){let n=`[...page].${e.typescriptEnabled?"tsx":"jsx"}`,o=e.join(t,n);if(!await e.exists(o)){let s=await e.formatCode(o,gh({sys:e,routePath:o,modelName:"page"}));await e.writeFile(o,s),r.push({filePath:o,modifiedType:"create"})}}async function bT(e,t,r){let n=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`,o=e.join(t,n);if(!await e.exists(o)){let s=await e.formatCode(o,gh({sys:e,routePath:o,modelName:"figma-imports"}));await e.writeFile(o,s),r.push({filePath:o,modifiedType:"create"})}}function gh({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled;return e.sdkVersion===V.gen2?`
444
444
  import React from "react";
445
445
  import { useRouter } from "next/router";
446
446
  ${n?'import type { BuilderContent } from "@builder.io/sdk-react";':""}
@@ -455,7 +455,7 @@ import Head from "next/head";
455
455
  ${n?'import { GetStaticProps } from "next";':""}
456
456
  import { CUSTOM_COMPONENTS } from ${JSON.stringify(ae(e,e.builderComponentPath,e.registryPath))};
457
457
 
458
- const BUILDER_API_KEY = process.env.${Tr}${n?"!":""};
458
+ const BUILDER_API_KEY = process.env.${Fr}${n?"!":""};
459
459
 
460
460
  // Define a function that fetches the Builder
461
461
  // content for a given page
@@ -539,7 +539,7 @@ import { BuilderContent } from "@builder.io/sdk";`:""}${n?`
539
539
  import { GetStaticProps } from "next";`:""}
540
540
  import ${JSON.stringify(ae(e,t,e.registryPath))};
541
541
 
542
- builder.init(process.env.${Tr}${n?"!":""});
542
+ builder.init(process.env.${Fr}${n?"!":""});
543
543
 
544
544
  // Define a function that fetches the Builder
545
545
  // content for a given page
@@ -604,7 +604,7 @@ export default function Page({ page }${n?": { page: BuilderContent | null }":""}
604
604
  </>
605
605
  );
606
606
  }
607
- `.trimStart()}async function bF(e,t){let n=e.typescriptEnabled?"tsx":"jsx",o=e.join(e.componentsDir,"Counter"),s=e.join(o,`Counter.${n}`),i=e.join(o,"styles.module.css"),{component:a,styles:u}=wF(e);if(!await e.exists(s)){let c=await e.formatCode(s,a);await e.writeFile(s,c),t.push({filePath:s,modifiedType:"create"})}return await e.exists(i)||(await e.writeFile(i,u),t.push({filePath:i,modifiedType:"create"})),s}function wF(e){let t=e.typescriptEnabled,r=`
607
+ `.trimStart()}async function wT(e,t){let n=e.typescriptEnabled?"tsx":"jsx",o=e.join(e.componentsDir,"Counter"),s=e.join(o,`Counter.${n}`),i=e.join(o,"styles.module.css"),{component:a,styles:u}=xT(e);if(!await e.exists(s)){let c=await e.formatCode(s,a);await e.writeFile(s,c),t.push({filePath:s,modifiedType:"create"})}return await e.exists(i)||(await e.writeFile(i,u),t.push({filePath:i,modifiedType:"create"})),s}function xT(e){let t=e.typescriptEnabled,r=`
608
608
  "use client"
609
609
  import React, { useState } from "react";
610
610
  import styles from "./styles.module.css";
@@ -667,18 +667,18 @@ export default Counter;
667
667
  font-size: 42px;
668
668
  text-align: center;
669
669
  }
670
- `.trimStart();return{component:r,styles:n}}async function gh(e,t,r){if(!await e.exists(e.registryPath)){if(e.sdkVersion===V.gen2){let s=xF(e);await e.writeFile(e.registryPath,s)}else await e.writeFile(e.registryPath,"");t.push({filePath:e.registryPath,modifiedType:"create"})}if(!r)return;let o=(await Mr(e,null,!1,!1,null,null,!1,!1)).components.find(s=>s.filePath===r);o&&await Mr(e,o.id,!0,!1,null,null,!0,!1)}function xF(e){return e.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-react";
670
+ `.trimStart();return{component:r,styles:n}}async function hh(e,t,r){if(!await e.exists(e.registryPath)){if(e.sdkVersion===V.gen2){let s=ST(e);await e.writeFile(e.registryPath,s)}else await e.writeFile(e.registryPath,"");t.push({filePath:e.registryPath,modifiedType:"create"})}if(!r)return;let o=(await Mr(e,null,!1,!1,null,null,!1,!1)).components.find(s=>s.filePath===r);o&&await Mr(e,o.id,!0,!1,null,null,!0,!1)}function ST(e){return e.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-react";
671
671
 
672
672
  export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
673
673
  ];`:`export const CUSTOM_COMPONENTS = [
674
674
  ];
675
- `}async function ko(e){let t=await Dn(e,e.getRepoRootDir());if(t&&typeof t=="object"){let r=new Set(Object.keys({...t.dependencies,...t.devDependencies}));if(r.has("@builder.io/sdk-react"))return V.gen2;if(r.has("@builder.io/react"))return V.gen1}return null}async function hh(e){let t=await SF(e);return{builderPageOptions:async()=>({templateContentId:"3de2f13211234071a4b19a17b4fbc5a7",pathname:"/builder-demo",title:"Builder + Next.js Demo Page"}),ensureBuilderSetup:()=>lh(t),ensureFigmaImportPage:()=>ph(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Mr(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let o=await Mr(t,n.cmpId,!1,!1,null,null,!1,!1);return{...o,component:o.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Mr(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Mr(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Mr(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Mr(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>wi(t),setPublicApiKey:n=>Lg(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===V.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Xt(t),setCache:n=>er(t,n)}}async function SF(e){let t=e.getAppRootDir(),r=e.join(t,"src"),n=await EF(e),o=await bt(e),s=e.getFrameworks().find(c=>c.name==="next"),i={asyncParams:s?.version?.major!==void 0&&s.version.major>=15},a={},u={...e,addExternalPackage:c=>{a[e.join(t,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>a[c]??e.readFileSync(c),existsSync:c=>!!a[c]||e.existsSync(c),readdirSync:c=>{let l=e.readdirSync(c);return c===t?[...l,...Object.keys(a).map(p=>p.slice(t.length+1))]:l},readdir:async c=>{let l=await e.readdir(c);return c===t?[...l,...Object.keys(a).map(p=>p.slice(t.length+1))]:l},appDir:null,pagesDir:null,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",nextConfigPath:n,typescriptEnabled:o,features:i};if(e.sdkVersion?u.sdkVersion=e.sdkVersion:u.sdkVersion=await ko(u),await e.exists(r)){u.srcDir=r,u.componentsDir=e.join(r,"components");let c=e.join(r,"app");await e.exists(c)&&(u.appDir=c);let l=e.join(r,"pages");await e.exists(l)&&(u.pagesDir=l),u.registryPath=await At(e,r)}else u.componentsDir=e.join(t,"components"),u.registryPath=await At(e,t);if(u.builderComponentPath=e.join(u.componentsDir,`builder.${o?"tsx":"jsx"}`),!u.appDir){let c=e.join(t,"app");await e.exists(c)&&(u.appDir=c)}if(!u.pagesDir){let c=e.join(t,"pages");await e.exists(c)&&(u.pagesDir=c)}if(!u.appDir&&!u.pagesDir&&!e.ignoreMissingConfig)throw new Error(`Could not find Next.js "app" or "pages" directory. Searched in "${t}".`);return u}async function EF(e){let t=e.join(e.getAppRootDir(),"next.config.ts");if(await e.exists(t))return t;let r=e.join(e.getAppRootDir(),"next.config.mjs");if(await e.exists(r))return r;let n=e.join(e.getAppRootDir(),"next.config.js");if(await e.exists(n))return n;throw new Error(`Could not find Next.js config file. Searched for "next.config.ts", "next.config.mjs" and "next.config.js" in "${e.getAppRootDir()}".`)}async function Pi(e){return await Ar(e,[".env"],Dh)}async function yh(e,t){PF(t);let r=await Pi(e),n=await Fr(e,r.file,r.envKey,t);return{...r,modifiedType:n}}function PF(e){typeof process<"u"&&(process.env[Dh]=e)}var Dh="PUBLIC_BUILDER_API_KEY";function vh(e,t,r){if(r.length===0)return e;let n=e.split(`
675
+ `}async function $o(e){let t=await Dn(e,e.getRepoRootDir());if(t&&typeof t=="object"){let r=new Set(Object.keys({...t.dependencies,...t.devDependencies}));if(r.has("@builder.io/sdk-react"))return V.gen2;if(r.has("@builder.io/react"))return V.gen1}return null}async function yh(e){let t=await ET(e);return{builderPageOptions:async()=>({templateContentId:"3de2f13211234071a4b19a17b4fbc5a7",pathname:"/builder-demo",title:"Builder + Next.js Demo Page"}),ensureBuilderSetup:()=>ph(t),ensureFigmaImportPage:()=>dh(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Mr(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let o=await Mr(t,n.cmpId,!1,!1,null,null,!1,!1);return{...o,component:o.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Mr(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Mr(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Mr(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Mr(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>wi(t),setPublicApiKey:n=>zg(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===V.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Xt(t),setCache:n=>er(t,n)}}async function ET(e){let t=e.getAppRootDir(),r=e.join(t,"src"),n=await PT(e),o=await wt(e),s=e.getFrameworks().find(c=>c.name==="next"),i={asyncParams:s?.version?.major!==void 0&&s.version.major>=15},a={},u={...e,addExternalPackage:c=>{a[e.join(t,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>a[c]??e.readFileSync(c),existsSync:c=>!!a[c]||e.existsSync(c),readdirSync:c=>{let l=e.readdirSync(c);return c===t?[...l,...Object.keys(a).map(p=>p.slice(t.length+1))]:l},readdir:async c=>{let l=await e.readdir(c);return c===t?[...l,...Object.keys(a).map(p=>p.slice(t.length+1))]:l},appDir:null,pagesDir:null,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",nextConfigPath:n,typescriptEnabled:o,features:i};if(e.sdkVersion?u.sdkVersion=e.sdkVersion:u.sdkVersion=await $o(u),await e.exists(r)){u.srcDir=r,u.componentsDir=e.join(r,"components");let c=e.join(r,"app");await e.exists(c)&&(u.appDir=c);let l=e.join(r,"pages");await e.exists(l)&&(u.pagesDir=l),u.registryPath=await Tt(e,r)}else u.componentsDir=e.join(t,"components"),u.registryPath=await Tt(e,t);if(u.builderComponentPath=e.join(u.componentsDir,`builder.${o?"tsx":"jsx"}`),!u.appDir){let c=e.join(t,"app");await e.exists(c)&&(u.appDir=c)}if(!u.pagesDir){let c=e.join(t,"pages");await e.exists(c)&&(u.pagesDir=c)}if(!u.appDir&&!u.pagesDir&&!e.ignoreMissingConfig)throw new Error(`Could not find Next.js "app" or "pages" directory. Searched in "${t}".`);return u}async function PT(e){let t=e.join(e.getAppRootDir(),"next.config.ts");if(await e.exists(t))return t;let r=e.join(e.getAppRootDir(),"next.config.mjs");if(await e.exists(r))return r;let n=e.join(e.getAppRootDir(),"next.config.js");if(await e.exists(n))return n;throw new Error(`Could not find Next.js config file. Searched for "next.config.ts", "next.config.mjs" and "next.config.js" in "${e.getAppRootDir()}".`)}async function Pi(e){return await Ar(e,[".env"],vh)}async function Dh(e,t){_T(t);let r=await Pi(e),n=await Tr(e,r.file,r.envKey,t);return{...r,modifiedType:n}}function _T(e){typeof process<"u"&&(process.env[vh]=e)}var vh="PUBLIC_BUILDER_API_KEY";function Ch(e,t,r){if(r.length===0)return e;let n=e.split(`
676
676
  `),o=n.findIndex(a=>a.includes(r));if(o===-1||n.some(a=>a.includes(t[0])))return e;let i=["/**",...t.map(a=>` * ${a.trim()}`)," */"];return n.splice(o,0,...i),n.join(`
677
- `)}async function bh(e,t){let r=[],n=t.getSourceFiles(),o=t.getTypeChecker();return await Promise.all(n.map(async s=>{let i=e.basename(s.fileName);if(i.startsWith(".")||FF.has(i))return;let a=e.normalize(s.fileName);if(a===e.registryPath)return;let u=await fa(e,o,a,s);r.push(...u)})),r}async function wh(e,t){if(e.extname(t).toLowerCase()===".tsx"){let n=await e.readFile(t);if(n)return _F(e,t,n)}return null}function _F(e,t,r){let n=se(e,r);return fa(e,null,t,n)}async function fa(e,t,r,n){r=e.normalize(r);let o=[],s=Kn(e,n);return await Promise.all(s.map(async i=>{let a=await AF(e,t,r,i);a&&o.push(a)})),o}async function AF(e,t,r,n){let o=e.relative(e.getAppRootDir(),r),s=we(e,r);if(e.ts.isVariableStatement(n.node))for(let i of n.node.declarationList.declarations){let a=Ch(e,i.initializer);if(a&&e.ts.isIdentifier(i.name)){let u=i.name.text;return{cmpInfo:{id:await ve(e,r,u),displayFilePath:ge(e,r),name:be(u),inputs:[],exportName:n.isDefaultExport?"default":u,exportType:n.isDefaultExport?"default":"named",importName:u,filePath:r,relFilePath:o,importPath:s,framework:"qwik"},node:a}}}else if(e.ts.isCallExpression(n.node)){let i=Ch(e,n.node);if(i)return{cmpInfo:{id:await ve(e,r,"default"),displayFilePath:ge(e,r),name:Yt(e,r),inputs:[],exportName:"default",exportType:"default",importName:Un(e,r),filePath:r,relFilePath:o,importPath:s,framework:"qwik"},node:i}}return null}function Ch(e,t){if(t&&e.ts.isCallExpression(t)&&e.ts.isIdentifier(t.expression)&&t.expression.text==="component$"&&t.arguments.length>0){let r=t.arguments[0];if(e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r))return{callExpression:t,fnNode:r}}return null}var FF=new Set(["node_modules","layout.tsx","404.tsx","router-head.tsx"]);async function xh(e,t){let r=t.node.fnNode;if((e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r))&&r.parameters.length>0){let{sourceFile:o,typeChecker:s}=await Co(e,t.cmpInfo.filePath,null);if(!(await fa(e,s,t.cmpInfo.filePath,o)).find(u=>u.cmpInfo.id===t.cmpInfo.id))throw new Error(`createComponentInputs() Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return qn(e,s,r)}return[]}async function Sh(e){return Tc(e)}async function Tc(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,TF),t.push({filePath:e.registryPath,modifiedType:"create"})),t}var TF=`import type { RegisteredComponent } from "@builder.io/sdk-qwik";
677
+ `)}async function wh(e,t){let r=[],n=t.getSourceFiles(),o=t.getTypeChecker();return await Promise.all(n.map(async s=>{let i=e.basename(s.fileName);if(i.startsWith(".")||FT.has(i))return;let a=e.normalize(s.fileName);if(a===e.registryPath)return;let u=await fa(e,o,a,s);r.push(...u)})),r}async function xh(e,t){if(e.extname(t).toLowerCase()===".tsx"){let n=await e.readFile(t);if(n)return AT(e,t,n)}return null}function AT(e,t,r){let n=se(e,r);return fa(e,null,t,n)}async function fa(e,t,r,n){r=e.normalize(r);let o=[],s=Kn(e,n);return await Promise.all(s.map(async i=>{let a=await TT(e,t,r,i);a&&o.push(a)})),o}async function TT(e,t,r,n){let o=e.relative(e.getAppRootDir(),r),s=xe(e,r);if(e.ts.isVariableStatement(n.node))for(let i of n.node.declarationList.declarations){let a=bh(e,i.initializer);if(a&&e.ts.isIdentifier(i.name)){let u=i.name.text;return{cmpInfo:{id:await Ce(e,r,u),displayFilePath:ge(e,r),name:we(u),inputs:[],exportName:n.isDefaultExport?"default":u,exportType:n.isDefaultExport?"default":"named",importName:u,filePath:r,relFilePath:o,importPath:s,framework:"qwik"},node:a}}}else if(e.ts.isCallExpression(n.node)){let i=bh(e,n.node);if(i)return{cmpInfo:{id:await Ce(e,r,"default"),displayFilePath:ge(e,r),name:Yt(e,r),inputs:[],exportName:"default",exportType:"default",importName:Un(e,r),filePath:r,relFilePath:o,importPath:s,framework:"qwik"},node:i}}return null}function bh(e,t){if(t&&e.ts.isCallExpression(t)&&e.ts.isIdentifier(t.expression)&&t.expression.text==="component$"&&t.arguments.length>0){let r=t.arguments[0];if(e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r))return{callExpression:t,fnNode:r}}return null}var FT=new Set(["node_modules","layout.tsx","404.tsx","router-head.tsx"]);async function Sh(e,t){let r=t.node.fnNode;if((e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r))&&r.parameters.length>0){let{sourceFile:o,typeChecker:s}=await Co(e,t.cmpInfo.filePath,null);if(!(await fa(e,s,t.cmpInfo.filePath,o)).find(u=>u.cmpInfo.id===t.cmpInfo.id))throw new Error(`createComponentInputs() Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return qn(e,s,r)}return[]}async function Eh(e){return Rc(e)}async function Rc(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,RT),t.push({filePath:e.registryPath,modifiedType:"create"})),t}var RT=`import type { RegisteredComponent } from "@builder.io/sdk-qwik";
678
678
 
679
679
  export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
680
680
  ];
681
- `;async function Eh(e){await Tc(e);let t=await e.readFile(e.registryPath);return t?$F(e,t):{components:[],sourceFile:se(e,"")}}async function $F(e,t){let r=se(e,t);return kF(e,r)}async function kF(e,t){let r=[],n=Ke(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(o,s)=>{let i=await $c(e,t,o);i&&(i.nodeIndex=s,r.push(i))})),{sourceFile:t,components:_t(r)}}async function $c(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"qwik"};for(let o of r.properties){if(!e.ts.isPropertyAssignment(o)||!e.ts.isIdentifier(o.name))continue;if(he(e,o)==="component"&&e.ts.isIdentifier(o.initializer)){let i=o.initializer.text;n.name===""&&(n.name=be(i)),n.importName=i;let a=await $r(e,e.registryPath,t,i);if(!a)continue;n.filePath=a.filePath,n.relFilePath=a.relFilePath,n.importPath=we(e,a.filePath),n.displayFilePath=a.displayFilePath,n.exportType=a.exportType;let u=await wh(e,a.filePath);if(u&&u.length>0)if(u.length===1)n.exportName=u[0].cmpInfo.exportName;else{let c=u.find(l=>l.cmpInfo.exportName===i);c&&(n.exportName=c.cmpInfo.exportName)}continue}}return n=Ft(e,n,r),n.filePath&&n.exportName&&(n.id=await ve(e,n.filePath,n.exportName)),n}async function Ph(e){let t=new Set,r=async o=>{let s=await e.readdir(o);await Promise.all(s.map(async i=>{if(i.startsWith(".")||i==="node_modules")return;let a=e.join(o,i),u=e.extname(i).toLowerCase();if(u===".tsx"||u===".ts"){t.add(a);return}(await e.stat(a)).isDirectory()&&await r(a)}))};return await r(e.getAppRootDir()),await We(e,[...t])}async function Gn(e,t,r,n,o,s,i,a){let u=await Ph(e),[c,l,p]=await Promise.all([bh(e,u),Eh(e),Pi(e)]),d=c.map(f=>f.cmpInfo),g=l.components,m={components:Dr(d,g),registryPath:e.registryPath,registryDisplayPath:ge(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:tr(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m;if(t!=null){let f=c.find($=>$.cmpInfo.id===t);if(!f)throw new Error(`Component ${t} not found`);let h=l.sourceFile,y=m.components.find($=>$.id===t),b=await xh(e,f);Vt(y,b),t=Array.isArray(t)?t[0]:t;let C=Nr(t,d,g,r,n,o,s),{elements:_,elmIndex:S,statementIndex:T,statement:k,variableDeclaration:I}=await IF(e,h,f),R=!1;if(C.addCmpToRegistry?(_.push(RF(e,C.addCmpToRegistry)),R=!0):C.removeCmpFromRegistry?(_.splice(S,1),R=!0):C.updateRegisteredCmp&&(_[S]=Ze(e,_[S],C.updateRegisteredCmp),R=!0),R&&i){let $=[...h.statements];$[T]=e.ts.factory.updateVariableStatement(k,k.modifiers,e.ts.factory.updateVariableDeclarationList(k.declarationList,[e.ts.factory.updateVariableDeclaration(I,I.name,I.exclamationToken,I.type,e.ts.factory.createArrayLiteralExpression(Rr(e,_)))])),h=e.ts.factory.updateSourceFile(h,$),y.exportType==="named"?h=ce(e,h,{namedImports:[y.importName],importPath:ae(e,e.registryPath,y.filePath)}):h=ce(e,h,{defaultImport:y.importName,importPath:ae(e,e.registryPath,y.filePath)}),h=ce(e,h,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),h=Or(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),h=Ir(e,h),h=kr(e,h);let D=Ye(e,h);D=yr(D),D=vh(D,NF,"CUSTOM_COMPONENTS"),D=await e.formatCode(e.registryPath,D),await e.writeFile(e.registryPath,D)}m.components=C.components}return m}function RF(e,t){return Ze(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(t.importName))],!0),t)}async function IF(e,t,r){let n=Ke(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let o=n.arrayLiteralExp.elements.filter(i=>e.ts.isObjectLiteralExpression(i)),s=-1;for(let i=0;i<o.length;i++)if((await $c(e,t,o[i]))?.id===r.cmpInfo.id){s=i;break}return{...n,elements:o,elmIndex:s}}var NF=["This array is used to integrate custom components within Builder.","https://www.builder.io/c/docs/custom-components-intro","",'These components will be found the "Custom Components"',"section of Builder's visual editor.",'You can also turn on "components only mode" to limit',"editing to only these components.","https://www.builder.io/c/docs/guides/components-only-mode"];async function _h(e){let t=await OF(e);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>Sh(t),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>t.registryPath,getRegistry:n=>Gn(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{},loadComponent:async n=>{let o=await Gn(t,n.cmpId,!1,!1,null,null,!1,!1);return{...o,component:o.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Gn(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Gn(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Gn(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Gn(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Pi(t),setPublicApiKey:n=>yh(t,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>Xt(t),setCache:n=>er(t,n)}}async function OF(e){let t=await yi(e,e.getAppRootDir(),"components");if(!t)throw new Error(`Could not find components directory within project: ${e.getAppRootDir()}`);let r=await At(e,t),n=e.join(e.getAppRootDir(),".env");return{...e,componentsDir:t,registryPath:r,envPath:n}}async function _i(e){return await Ar(e,[".env"],Ai)}async function Ah(e,t){let r=await _i(e),n=await Fr(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var Ai="PUBLIC_BUILDER_KEY";var MF=new Set(["dist","node_modules"]);async function Fh(e,t){let r=[],n=t.getSourceFiles(),o=t.getTypeChecker(),s=e.join(e.getAppRootDir(),"build");return await Promise.all(n.map(async i=>{let a=e.basename(i.fileName);if(a.startsWith(".")||a==="node_modules"||ta(e,MF,i.fileName)||BF.has(a)||a.includes("$."))return;let u=e.normalize(i.fileName);if(u===e.remixConfigPath||u===s)return;let c=await Cn(e,o,u,i,u===e.registryPath);r.push(...c)})),r}var BF=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"]);async function Th(e){await ma(e);let t=await e.readFile(e.registryPath);return t?LF(e,t):{components:[],sourceFile:se(e,"")}}async function LF(e,t){let r=se(e,t);return zF(e,r)}async function zF(e,t){let r=[],n=Ke(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(o,s)=>{let i=await kc(e,t,o);i&&(i.nodeIndex=s,r.push(i))})),{sourceFile:t,components:_t(r)}}async function kc(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};e.sdkVersion===V.gen2&&Po(e,r)&&(n.acceptsChildren=!0);for(let o of r.properties){if(!e.ts.isPropertyAssignment(o)||!e.ts.isIdentifier(o.name))continue;if(he(e,o)==="component"){let i,{initializer:a}=o;if(e.ts.isIdentifier(a))i=a.text;else if(e.ts.isCallExpression(a)){(e.ts.isIdentifier(a.expression)&&a.expression.text)==="withChildren"&&(n.acceptsChildren=!0);let l=a.arguments[0];e.ts.isIdentifier(l)&&(i=l.text)}if(!i)continue;n.name===""&&(n.name=be(i)),n.importName=i;let u=await $r(e,e.registryPath,t,i);if(!u)continue;if(n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=we(e,u.filePath):(n.externalImportPath=u.importPath,n.importPath=n.externalImportPath),n.displayFilePath=u.displayFilePath,n.exportType=u.exportType,n.externalImportPath)n.exportName=i;else{let c=await Jg(e,u.filePath,e.registryPath===u.filePath||Jt(u.filePath));if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let l=c.find(p=>p.cmpInfo.exportName===i);l&&(n.exportName=l.cmpInfo.exportName)}}continue}}return n=Ft(e,n,r),n.filePath&&n.exportName&&(n.id=await ve(e,n.filePath,n.exportName,n.externalImportPath)),n}async function Br(e,t,r,n,o,s,i,a){let u=await bn(e),[c,l,p]=await Promise.all([Fh(e,u),Th(e),_i(e)]),d=c.map(b=>b.cmpInfo),g=l.components,m={components:Dr(d,g),registryPath:e.registryPath,registryDisplayPath:ge(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:tr(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m.components=await Fo(e,m.components),m;let f=!1,h=l.sourceFile,y=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(y.length>0){let b=y.map(S=>{let T=c.find(k=>k.cmpInfo.id===S);if(!T)throw new Error(`Component ${S} not found`);return T}),C=Array.from(new Set(b.map(S=>S.cmpInfo.filePath))),_=await We(e,C);for(let S of b){let T=m.components.find(w=>w.id===S.cmpInfo.id),k=await To(e,S,_,e.registryPath===S.cmpInfo.filePath||Jt(S.cmpInfo.filePath));Vt(T,k);let I=d.findIndex(w=>w.id===S.cmpInfo.id);d[I].inputs=k;let R=Nr(S.cmpInfo.id,d,g,r,n,o,s),{elements:$,elmIndex:D,statementIndex:B,statement:U,variableDeclaration:H}=await UF(e,h,S);if(R.addCmpToRegistry)$.push(jF(e,R.addCmpToRegistry)),f=!0;else if(R.removeCmpFromRegistry)$.splice(D,1),f=!0;else if(R.updateRegisteredCmp){let w=Ze(e,$[D],R.updateRegisteredCmp);$[D]=e.ts.factory.updateObjectLiteralExpression(w,[$h(e,R.updateRegisteredCmp),...w.properties.slice(1)]),f=!0}if(f&&i){let w=[...h.statements];w[B]=e.ts.factory.updateVariableStatement(U,U.modifiers,e.ts.factory.updateVariableDeclarationList(U.declarationList,[e.ts.factory.updateVariableDeclaration(H,H.name,H.exclamationToken,H.type,e.ts.factory.createArrayLiteralExpression(Rr(e,$)))])),h=e.ts.factory.updateSourceFile(h,w),T.exportType==="named"?h=ce(e,h,{namedImports:[T.importName],importPath:T.externalImportPath?T.externalImportPath:ae(e,e.registryPath,T.filePath)}):h=ce(e,h,{defaultImport:T.importName,importPath:T.externalImportPath?T.externalImportPath:ae(e,e.registryPath,T.filePath)});let E=e.sdkVersion===V.gen2?"@builder.io/sdk-react":"@builder.io/react";h=ce(e,h,{namedImports:["RegisteredComponent"],importPath:E,isTypeOnly:!0}),T.acceptsChildren&&e.sdkVersion!==V.gen2&&(h=ce(e,h,{namedImports:["withChildren"],importPath:"@builder.io/react"})),h=Or(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m.components=R.components,g=R.components.filter(Be=>Be.isRegistered)}}}if(f&&i){h=Ir(e,h),h=kr(e,h);let b=Ye(e,h);b=yr(b),b=await e.formatCode(e.registryPath,b),await e.writeFile(e.registryPath,b)}return m}function $h(e,t){if(e.sdkVersion===V.gen2)return e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(t.importName));let r=e.ts.factory.createIdentifier(t.importName),n=t.acceptsChildren?e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("withChildren"),void 0,[r]):r;return e.ts.factory.createPropertyAssignment("component",n)}function jF(e,t){return Ze(e,e.ts.factory.createObjectLiteralExpression([$h(e,t),...t.acceptsChildren&&e.sdkVersion===V.gen2?[e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())]:[]],!0),t)}async function UF(e,t,r){let n=Ke(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let o=n.arrayLiteralExp.elements.filter(i=>e.ts.isObjectLiteralExpression(i)),s=-1;for(let i=0;i<o.length;i++)if((await kc(e,t,o[i]))?.id===r.cmpInfo.id){s=i;break}return{...n,elements:o,elmIndex:s}}async function kh(e){let t=[],r=await qF(e,t);return t.push(...await ma(e)),await GF(e,r),await HF(e,t),t}async function Rh(e){let t=[];return t.push(...await ma(e)),await VF(e,t),t}async function VF(e,t){let r=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureFigmaImportRoute, hasLocaleParam"),r=`($locale).${r}`);let n=e.join(e.routesDir,r),o=await e.exists(n);e.debug(`remixEnsureFigmaImportRoute, hasRoute: ${o}`);let s=await e.formatCode(n,Ih({sys:e,routePath:n,modelName:"figma-imports"}));await e.writeFile(n,s),t.push({filePath:n,modifiedType:o?"update":"create"})}async function HF(e,t){let r=`$.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureAppRoute, hasLocaleParam"),r=`($locale).${r}`),e.sdkVersion===V.gen2&&(r=`($slug)._index.${e.typescriptEnabled?"tsx":"jsx"}`);let n=e.join(e.routesDir,r),o=await e.exists(n);e.debug(`remixEnsureAppRoute, hasRoute: ${o}`);let s=await e.formatCode(n,Ih({sys:e,routePath:n,modelName:"page"}));await e.writeFile(n,s),t.push({filePath:n,modifiedType:o?"update":"create"})}function Ih({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled,o=ae(e,t,e.registryPath),s="",i="";n&&(s="import type { LoaderArgs } from '@remix-run/server-runtime';",i=": LoaderArgs");let a=`process.env.${Ai}`,u="";return e.getFrameworks().some(c=>c.name==="@shopify/remix-oxygen")&&(a=`context.env.${Ai}`,u=", context"),n&&(a+="!"),e.sdkVersion===V.gen2?`
681
+ `;async function Ph(e){await Rc(e);let t=await e.readFile(e.registryPath);return t?$T(e,t):{components:[],sourceFile:se(e,"")}}async function $T(e,t){let r=se(e,t);return kT(e,r)}async function kT(e,t){let r=[],n=Ge(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(o,s)=>{let i=await $c(e,t,o);i&&(i.nodeIndex=s,r.push(i))})),{sourceFile:t,components:At(r)}}async function $c(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"qwik"};for(let o of r.properties){if(!e.ts.isPropertyAssignment(o)||!e.ts.isIdentifier(o.name))continue;if(he(e,o)==="component"&&e.ts.isIdentifier(o.initializer)){let i=o.initializer.text;n.name===""&&(n.name=we(i)),n.importName=i;let a=await Rr(e,e.registryPath,t,i);if(!a)continue;n.filePath=a.filePath,n.relFilePath=a.relFilePath,n.importPath=xe(e,a.filePath),n.displayFilePath=a.displayFilePath,n.exportType=a.exportType;let u=await xh(e,a.filePath);if(u&&u.length>0)if(u.length===1)n.exportName=u[0].cmpInfo.exportName;else{let c=u.find(l=>l.cmpInfo.exportName===i);c&&(n.exportName=c.cmpInfo.exportName)}continue}}return n=Ft(e,n,r),n.filePath&&n.exportName&&(n.id=await Ce(e,n.filePath,n.exportName)),n}async function _h(e){let t=new Set,r=async o=>{let s=await e.readdir(o);await Promise.all(s.map(async i=>{if(i.startsWith(".")||i==="node_modules")return;let a=e.join(o,i),u=e.extname(i).toLowerCase();if(u===".tsx"||u===".ts"){t.add(a);return}(await e.stat(a)).isDirectory()&&await r(a)}))};return await r(e.getAppRootDir()),await Ze(e,[...t])}async function Gn(e,t,r,n,o,s,i,a){let u=await _h(e),[c,l,p]=await Promise.all([wh(e,u),Ph(e),Pi(e)]),d=c.map(f=>f.cmpInfo),g=l.components,m={components:Dr(d,g),registryPath:e.registryPath,registryDisplayPath:ge(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:tr(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m;if(t!=null){let f=c.find(R=>R.cmpInfo.id===t);if(!f)throw new Error(`Component ${t} not found`);let h=l.sourceFile,y=m.components.find(R=>R.id===t),b=await Sh(e,f);Ht(y,b),t=Array.isArray(t)?t[0]:t;let C=Nr(t,d,g,r,n,o,s),{elements:_,elmIndex:S,statementIndex:F,statement:$,variableDeclaration:I}=await NT(e,h,f),k=!1;if(C.addCmpToRegistry?(_.push(IT(e,C.addCmpToRegistry)),k=!0):C.removeCmpFromRegistry?(_.splice(S,1),k=!0):C.updateRegisteredCmp&&(_[S]=Je(e,_[S],C.updateRegisteredCmp),k=!0),k&&i){let R=[...h.statements];R[F]=e.ts.factory.updateVariableStatement($,$.modifiers,e.ts.factory.updateVariableDeclarationList($.declarationList,[e.ts.factory.updateVariableDeclaration(I,I.name,I.exclamationToken,I.type,e.ts.factory.createArrayLiteralExpression(kr(e,_)))])),h=e.ts.factory.updateSourceFile(h,R),y.exportType==="named"?h=ce(e,h,{namedImports:[y.importName],importPath:ae(e,e.registryPath,y.filePath)}):h=ce(e,h,{defaultImport:y.importName,importPath:ae(e,e.registryPath,y.filePath)}),h=ce(e,h,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),h=Or(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),h=Ir(e,h),h=$r(e,h);let D=Qe(e,h);D=yr(D),D=Ch(D,OT,"CUSTOM_COMPONENTS"),D=await e.formatCode(e.registryPath,D),await e.writeFile(e.registryPath,D)}m.components=C.components}return m}function IT(e,t){return Je(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(t.importName))],!0),t)}async function NT(e,t,r){let n=Ge(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let o=n.arrayLiteralExp.elements.filter(i=>e.ts.isObjectLiteralExpression(i)),s=-1;for(let i=0;i<o.length;i++)if((await $c(e,t,o[i]))?.id===r.cmpInfo.id){s=i;break}return{...n,elements:o,elmIndex:s}}var OT=["This array is used to integrate custom components within Builder.","https://www.builder.io/c/docs/custom-components-intro","",'These components will be found the "Custom Components"',"section of Builder's visual editor.",'You can also turn on "components only mode" to limit',"editing to only these components.","https://www.builder.io/c/docs/guides/components-only-mode"];async function Ah(e){let t=await MT(e);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>Eh(t),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>t.registryPath,getRegistry:n=>Gn(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{},loadComponent:async n=>{let o=await Gn(t,n.cmpId,!1,!1,null,null,!1,!1);return{...o,component:o.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Gn(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Gn(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Gn(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Gn(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Pi(t),setPublicApiKey:n=>Dh(t,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>Xt(t),setCache:n=>er(t,n)}}async function MT(e){let t=await yi(e,e.getAppRootDir(),"components");if(!t)throw new Error(`Could not find components directory within project: ${e.getAppRootDir()}`);let r=await Tt(e,t),n=e.join(e.getAppRootDir(),".env");return{...e,componentsDir:t,registryPath:r,envPath:n}}async function _i(e){return await Ar(e,[".env"],Ai)}async function Th(e,t){let r=await _i(e),n=await Tr(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var Ai="PUBLIC_BUILDER_KEY";var LT=new Set(["dist","node_modules"]);async function Fh(e,t){let r=[],n=t.getSourceFiles(),o=t.getTypeChecker(),s=e.join(e.getAppRootDir(),"build");return await Promise.all(n.map(async i=>{let a=e.basename(i.fileName);if(a.startsWith(".")||a==="node_modules"||ta(e,LT,i.fileName)||BT.has(a)||a.includes("$."))return;let u=e.normalize(i.fileName);if(u===e.remixConfigPath||u===s)return;let c=await Cn(e,o,u,i,u===e.registryPath);r.push(...c)})),r}var BT=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"]);async function Rh(e){await ma(e);let t=await e.readFile(e.registryPath);return t?zT(e,t):{components:[],sourceFile:se(e,"")}}async function zT(e,t){let r=se(e,t);return jT(e,r)}async function jT(e,t){let r=[],n=Ge(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(o,s)=>{let i=await kc(e,t,o);i&&(i.nodeIndex=s,r.push(i))})),{sourceFile:t,components:At(r)}}async function kc(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};e.sdkVersion===V.gen2&&Po(e,r)&&(n.acceptsChildren=!0);for(let o of r.properties){if(!e.ts.isPropertyAssignment(o)||!e.ts.isIdentifier(o.name))continue;if(he(e,o)==="component"){let i,{initializer:a}=o;if(e.ts.isIdentifier(a))i=a.text;else if(e.ts.isCallExpression(a)){(e.ts.isIdentifier(a.expression)&&a.expression.text)==="withChildren"&&(n.acceptsChildren=!0);let l=a.arguments[0];e.ts.isIdentifier(l)&&(i=l.text)}if(!i)continue;n.name===""&&(n.name=we(i)),n.importName=i;let u=await Rr(e,e.registryPath,t,i);if(!u)continue;if(n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=xe(e,u.filePath):(n.externalImportPath=u.importPath,n.importPath=n.externalImportPath),n.displayFilePath=u.displayFilePath,n.exportType=u.exportType,n.externalImportPath)n.exportName=i;else{let c=await Yg(e,u.filePath,e.registryPath===u.filePath||Jt(u.filePath));if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let l=c.find(p=>p.cmpInfo.exportName===i);l&&(n.exportName=l.cmpInfo.exportName)}}continue}}return n=Ft(e,n,r),n.filePath&&n.exportName&&(n.id=await Ce(e,n.filePath,n.exportName,n.externalImportPath)),n}async function Lr(e,t,r,n,o,s,i,a){let u=await bn(e),[c,l,p]=await Promise.all([Fh(e,u),Rh(e),_i(e)]),d=c.map(b=>b.cmpInfo),g=l.components,m={components:Dr(d,g),registryPath:e.registryPath,registryDisplayPath:ge(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:tr(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m.components=await To(e,m.components),m;let f=!1,h=l.sourceFile,y=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(y.length>0){let b=y.map(S=>{let F=c.find($=>$.cmpInfo.id===S);if(!F)throw new Error(`Component ${S} not found`);return F}),C=Array.from(new Set(b.map(S=>S.cmpInfo.filePath))),_=await Ze(e,C);for(let S of b){let F=m.components.find(w=>w.id===S.cmpInfo.id),$=await Fo(e,S,_,e.registryPath===S.cmpInfo.filePath||Jt(S.cmpInfo.filePath));Ht(F,$);let I=d.findIndex(w=>w.id===S.cmpInfo.id);d[I].inputs=$;let k=Nr(S.cmpInfo.id,d,g,r,n,o,s),{elements:R,elmIndex:D,statementIndex:L,statement:U,variableDeclaration:H}=await VT(e,h,S);if(k.addCmpToRegistry)R.push(UT(e,k.addCmpToRegistry)),f=!0;else if(k.removeCmpFromRegistry)R.splice(D,1),f=!0;else if(k.updateRegisteredCmp){let w=Je(e,R[D],k.updateRegisteredCmp);R[D]=e.ts.factory.updateObjectLiteralExpression(w,[$h(e,k.updateRegisteredCmp),...w.properties.slice(1)]),f=!0}if(f&&i){let w=[...h.statements];w[L]=e.ts.factory.updateVariableStatement(U,U.modifiers,e.ts.factory.updateVariableDeclarationList(U.declarationList,[e.ts.factory.updateVariableDeclaration(H,H.name,H.exclamationToken,H.type,e.ts.factory.createArrayLiteralExpression(kr(e,R)))])),h=e.ts.factory.updateSourceFile(h,w),F.exportType==="named"?h=ce(e,h,{namedImports:[F.importName],importPath:F.externalImportPath?F.externalImportPath:ae(e,e.registryPath,F.filePath)}):h=ce(e,h,{defaultImport:F.importName,importPath:F.externalImportPath?F.externalImportPath:ae(e,e.registryPath,F.filePath)});let E=e.sdkVersion===V.gen2?"@builder.io/sdk-react":"@builder.io/react";h=ce(e,h,{namedImports:["RegisteredComponent"],importPath:E,isTypeOnly:!0}),F.acceptsChildren&&e.sdkVersion!==V.gen2&&(h=ce(e,h,{namedImports:["withChildren"],importPath:"@builder.io/react"})),h=Or(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m.components=k.components,g=k.components.filter(Be=>Be.isRegistered)}}}if(f&&i){h=Ir(e,h),h=$r(e,h);let b=Qe(e,h);b=yr(b),b=await e.formatCode(e.registryPath,b),await e.writeFile(e.registryPath,b)}return m}function $h(e,t){if(e.sdkVersion===V.gen2)return e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(t.importName));let r=e.ts.factory.createIdentifier(t.importName),n=t.acceptsChildren?e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("withChildren"),void 0,[r]):r;return e.ts.factory.createPropertyAssignment("component",n)}function UT(e,t){return Je(e,e.ts.factory.createObjectLiteralExpression([$h(e,t),...t.acceptsChildren&&e.sdkVersion===V.gen2?[e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())]:[]],!0),t)}async function VT(e,t,r){let n=Ge(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let o=n.arrayLiteralExp.elements.filter(i=>e.ts.isObjectLiteralExpression(i)),s=-1;for(let i=0;i<o.length;i++)if((await kc(e,t,o[i]))?.id===r.cmpInfo.id){s=i;break}return{...n,elements:o,elmIndex:s}}async function kh(e){let t=[],r=await KT(e,t);return t.push(...await ma(e)),await WT(e,r),await qT(e,t),t}async function Ih(e){let t=[];return t.push(...await ma(e)),await HT(e,t),t}async function HT(e,t){let r=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureFigmaImportRoute, hasLocaleParam"),r=`($locale).${r}`);let n=e.join(e.routesDir,r),o=await e.exists(n);e.debug(`remixEnsureFigmaImportRoute, hasRoute: ${o}`);let s=await e.formatCode(n,Nh({sys:e,routePath:n,modelName:"figma-imports"}));await e.writeFile(n,s),t.push({filePath:n,modifiedType:o?"update":"create"})}async function qT(e,t){let r=`$.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureAppRoute, hasLocaleParam"),r=`($locale).${r}`),e.sdkVersion===V.gen2&&(r=`($slug)._index.${e.typescriptEnabled?"tsx":"jsx"}`);let n=e.join(e.routesDir,r),o=await e.exists(n);e.debug(`remixEnsureAppRoute, hasRoute: ${o}`);let s=await e.formatCode(n,Nh({sys:e,routePath:n,modelName:"page"}));await e.writeFile(n,s),t.push({filePath:n,modifiedType:o?"update":"create"})}function Nh({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled,o=ae(e,t,e.registryPath),s="",i="";n&&(s="import type { LoaderArgs } from '@remix-run/server-runtime';",i=": LoaderArgs");let a=`process.env.${Ai}`,u="";return e.getFrameworks().some(c=>c.name==="@shopify/remix-oxygen")&&(a=`context.env.${Ai}`,u=", context"),n&&(a+="!"),e.sdkVersion===V.gen2?`
682
682
 
683
683
  import {
684
684
  Content,
@@ -788,7 +788,7 @@ declare global {
788
788
  }
789
789
  }
790
790
  `:""}
791
- `}async function qF(e,t){let n=e.typescriptEnabled?"tsx":"jsx",o=e.join(e.componentsDir,"Counter"),s=e.join(o,`Counter.${n}`),i=e.join(o,"styles.module.css"),{component:a,styles:u}=KF(e),c=await e.exists(s);if(e.debug(`remixEnsureCounterComponent, hasCounterCmp: ${c}`),!c){let p=await e.formatCode(s,a);await e.writeFile(s,p),t.push({filePath:s,modifiedType:"create"})}let l=await e.exists(i);return e.debug(`remixEnsureCounterComponent, hasCounterStyles: ${l}`),l||(await e.writeFile(i,u),t.push({filePath:i,modifiedType:"create"})),s}function KF(e){let t=e.typescriptEnabled,r=`
791
+ `}async function KT(e,t){let n=e.typescriptEnabled?"tsx":"jsx",o=e.join(e.componentsDir,"Counter"),s=e.join(o,`Counter.${n}`),i=e.join(o,"styles.module.css"),{component:a,styles:u}=GT(e),c=await e.exists(s);if(e.debug(`remixEnsureCounterComponent, hasCounterCmp: ${c}`),!c){let p=await e.formatCode(s,a);await e.writeFile(s,p),t.push({filePath:s,modifiedType:"create"})}let l=await e.exists(i);return e.debug(`remixEnsureCounterComponent, hasCounterStyles: ${l}`),l||(await e.writeFile(i,u),t.push({filePath:i,modifiedType:"create"})),s}function GT(e){let t=e.typescriptEnabled,r=`
792
792
  import { useState } from "react";
793
793
  import styles from "./styles.module.css";
794
794
  ${t?`
@@ -851,17 +851,17 @@ export default Counter;
851
851
  font-size: 42px;
852
852
  text-align: center;
853
853
  }
854
- `.trimStart();return{component:r,styles:n}}async function GF(e,t){let n=(await Br(e,null,!1,!1,null,null,!1,!1)).components.find(o=>o.filePath===t);n&&await Br(e,n.id,!0,!1,null,null,!0,!1)}async function ma(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,WF(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}function WF(e){let t=e.sdkVersion===V.gen2;return e.typescriptEnabled?`import type { RegisteredComponent } from ${t?'"@builder.io/sdk-react"':'"@builder.io/react"'};
854
+ `.trimStart();return{component:r,styles:n}}async function WT(e,t){let n=(await Lr(e,null,!1,!1,null,null,!1,!1)).components.find(o=>o.filePath===t);n&&await Lr(e,n.id,!0,!1,null,null,!0,!1)}async function ma(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,ZT(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}function ZT(e){let t=e.sdkVersion===V.gen2;return e.typescriptEnabled?`import type { RegisteredComponent } from ${t?'"@builder.io/sdk-react"':'"@builder.io/react"'};
855
855
 
856
856
  export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
857
857
  ];`:`export const CUSTOM_COMPONENTS = [
858
858
  ];
859
- `}async function Nh(e){let t=await ZF(e);return{builderPageOptions:async()=>{let n="/builder-demo",o=t.hasLocaleParam?`/en-us${n}`:void 0;return{templateContentId:"a5c9eef7909d4fc99554264a17de22c9",pathname:n,localePathname:o,title:"Builder + Remix Demo Page"}},ensureBuilderSetup:()=>kh(t),ensureFigmaImportPage:()=>Rh(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Br(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let o=await Br(t,n.cmpId,!1,!1,null,null,!1,!1);return{...o,component:o.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Br(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Br(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Br(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Br(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>_i(t),setPublicApiKey:n=>Ah(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===V.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Xt(t),setCache:n=>er(t,n)}}async function ZF(e){let t=await YF(e),r=e.getAppRootDir(),n=await QF(e),o=e.dirname(n),s=e.join(o,"components"),i=await bt(e),a=await At(e,o),u={},c={...e,registryPath:a,remixConfigPath:t,typescriptEnabled:i,appDir:o,componentsDir:s,routesDir:n,hasLocaleParam:await JF(e,n),addExternalPackage:l=>{u[e.join(r,l,"index.ts")]=`export * from "${l}";`},readFileSync:l=>u[l]??e.readFileSync(l),existsSync:l=>!!u[l]||e.existsSync(l),readdirSync:l=>{let p=e.readdirSync(l);return l===r?[...p,...Object.keys(u).map(d=>d.slice(r.length+1))]:p},readdir:async l=>{let p=await e.readdir(l);return l===r?[...p,...Object.keys(u).map(d=>d.slice(r.length+1))]:p}};return e.sdkVersion?c.sdkVersion=e.sdkVersion:c.sdkVersion=await ko(c),c}async function JF(e,t){return(await e.readdir(t)).some(n=>n.startsWith("($locale)."))}async function YF(e){let t=["remix.config.ts","remix.config.js","vite.config.ts","vite.config.js"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return n}if(e.ignoreMissingConfig)return"";throw new Error(`Could not find Remix config file. Searched for ${t.join(", ")} in "${e.getAppRootDir()}".`)}async function QF(e){let t=await yi(e,e.getAppRootDir(),"routes");if(t)return t;throw new Error(`Could not find Remix "routes" directory in "${e.getAppRootDir()}". Please ensure this command is ran from within your Remix project's directory.`)}async function Fi(e){let t=[".env"],r=e.configType==="vite"?Ti:ga;return await Ar(e,t,r)}async function Oh(e,t){let r=await Fi(e),n=await Fr(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var Ti="VITE_PUBLIC_BUILDER_KEY",ga="PUBLIC_BUILDER_KEY";function Mh(e,t){let r=`Builder.registerComponent(
859
+ `}async function Oh(e){let t=await JT(e);return{builderPageOptions:async()=>{let n="/builder-demo",o=t.hasLocaleParam?`/en-us${n}`:void 0;return{templateContentId:"a5c9eef7909d4fc99554264a17de22c9",pathname:n,localePathname:o,title:"Builder + Remix Demo Page"}},ensureBuilderSetup:()=>kh(t),ensureFigmaImportPage:()=>Ih(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Lr(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let o=await Lr(t,n.cmpId,!1,!1,null,null,!1,!1);return{...o,component:o.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Lr(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Lr(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Lr(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Lr(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>_i(t),setPublicApiKey:n=>Th(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===V.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Xt(t),setCache:n=>er(t,n)}}async function JT(e){let t=await QT(e),r=e.getAppRootDir(),n=await XT(e),o=e.dirname(n),s=e.join(o,"components"),i=await wt(e),a=await Tt(e,o),u={},c={...e,registryPath:a,remixConfigPath:t,typescriptEnabled:i,appDir:o,componentsDir:s,routesDir:n,hasLocaleParam:await YT(e,n),addExternalPackage:l=>{u[e.join(r,l,"index.ts")]=`export * from "${l}";`},readFileSync:l=>u[l]??e.readFileSync(l),existsSync:l=>!!u[l]||e.existsSync(l),readdirSync:l=>{let p=e.readdirSync(l);return l===r?[...p,...Object.keys(u).map(d=>d.slice(r.length+1))]:p},readdir:async l=>{let p=await e.readdir(l);return l===r?[...p,...Object.keys(u).map(d=>d.slice(r.length+1))]:p}};return e.sdkVersion?c.sdkVersion=e.sdkVersion:c.sdkVersion=await $o(c),c}async function YT(e,t){return(await e.readdir(t)).some(n=>n.startsWith("($locale)."))}async function QT(e){let t=["remix.config.ts","remix.config.js","vite.config.ts","vite.config.js"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return n}if(e.ignoreMissingConfig)return"";throw new Error(`Could not find Remix config file. Searched for ${t.join(", ")} in "${e.getAppRootDir()}".`)}async function XT(e){let t=await yi(e,e.getAppRootDir(),"routes");if(t)return t;throw new Error(`Could not find Remix "routes" directory in "${e.getAppRootDir()}". Please ensure this command is ran from within your Remix project's directory.`)}async function Ti(e){let t=[".env"],r=e.configType==="vite"?Fi:ga;return await Ar(e,t,r)}async function Mh(e,t){let r=await Ti(e),n=await Tr(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var Fi="VITE_PUBLIC_BUILDER_KEY",ga="PUBLIC_BUILDER_KEY";function Lh(e,t){let r=`Builder.registerComponent(
860
860
  `;r+=` ${t.importName},
861
861
  `,r+=` {
862
862
  name: "${t.name}",
863
863
  }
864
- `,r+=");";let n=ea(e,r);return Rc(e,n,t)}function Rc(e,t,r){if(!e.ts.isExpressionStatement(t))return t;let n=t.expression;if(!e.ts.isCallExpression(n))return t;let o=[...n.arguments];if(o.length<2)return t;let s=o[1];return e.ts.isObjectLiteralExpression(s)?(o[1]=Ze(e,s,r),e.ts.factory.updateExpressionStatement(t,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,o))):t}async function Bh(e){let t=await e.readFile(e.registryPath);return t?XF(e,t):{components:[],sourceFile:se(e,"")}}async function XF(e,t){let r=se(e,t);return e.sdkVersion===V.gen2?rT(e,r):eT(e,r)}async function eT(e,t){let r=[];for(let n=0;n<t.statements.length;n++){let o=t.statements[n];if(!e.ts.isExpressionStatement(o))continue;let s=o.expression;if(!e.ts.isCallExpression(s))continue;let i=s.expression;if(!e.ts.isPropertyAccessExpression(i))continue;let a=i.expression;if(!e.ts.isIdentifier(a)||a.text!=="Builder"||i.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let l=c[1];if(!e.ts.isObjectLiteralExpression(l))continue;let p=c[0];if(e.ts.isIdentifier(p)){let d=await tT(e,t,n,p,l,!1);d&&r.push(d);continue}}return{sourceFile:t,components:_t(r)}}async function tT(e,t,r,n,o,s){let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=t.statements.filter(c=>e.ts.isImportDeclaration(c)),u=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(u){let c=u.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;i.filePath=await Ic(e,c.text),i.relFilePath=e.relative(e.getAppRootDir(),i.filePath),i.importPath=we(e,i.filePath),i.name=Yt(e,i.filePath),i.importName=n.text,i.exportName="default",i.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!e.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(g=>g.name.text===n.text));if(!c)return null;let l=c.moduleSpecifier;if(!e.ts.isStringLiteral(l))return null;let p=await Ic(e,l.text);i.filePath=await Ic(e,l.text),i.relFilePath=e.relative(e.getAppRootDir(),i.filePath),await e.exists(p)?i.importPath=we(e,i.filePath):(i.externalImportPath=l.text,i.importPath=i.externalImportPath),i.name=be(n.text),i.importName=n.text,i.exportName=n.text,i.exportType="named"}return i=Ft(e,i,o),i.displayFilePath=ge(e,i.filePath),i.filePath&&i.exportName&&(i.id=await ve(e,i.filePath,i.exportName,i.externalImportPath)),i}function Ic(e,t){return Ei(e,e.normalize(e.resolve(e.dirname(e.registryPath),t)))}async function rT(e,t){let r=[],n=Ke(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(o,s)=>{let i=await Nc(e,t,o);i&&(i.nodeIndex=s,r.push(i))})),{sourceFile:t,components:_t(r)}}async function Nc(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};Po(e,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!e.ts.isPropertyAssignment(s)||!e.ts.isIdentifier(s.name))continue;if(he(e,s)==="component"){let a,{initializer:u}=s;if(e.ts.isIdentifier(u)&&(a=u.text),!a)continue;n.name===""&&(n.name=be(a)),n.importName=a;let c=await $r(e,e.registryPath,t,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await e.exists(c.filePath)?n.importPath=we(e,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let l=t.statements.filter(d=>e.ts.isImportDeclaration(d)),p=l.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!e.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=l.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let g=d.moduleSpecifier;if(!e.ts.isStringLiteral(g))return null;n.exportName=a}continue}}return n=Ft(e,n,r),n.filePath&&n.exportName&&(n.id=await ve(e,n.filePath,n.exportName,n.externalImportPath)),n}async function Lr(e,t,r,n,o,s,i,a){let u=await bn(e),[c,l,p,d]=await Promise.all([Yg(e,u),Bh(e),bt(e),Fi(e)]),g=c.map(C=>C.cmpInfo),m=l.components,f={components:Dr(g,m),registryPath:e.registryPath,registryDisplayPath:ge(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:tr(g),publicApiKey:d.envValue??void 0,devToolsVersion:e.version};if(a)return f.components=await Fo(e,f.components),f;let h=!1,y=l.sourceFile,b=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(b.length>0){let C=b.map(T=>{let k=c.find(I=>I.cmpInfo.id===T);if(!k)throw new Error(`Component ${T} not found`);return k}),_=Array.from(new Set(C.map(T=>T.cmpInfo.filePath))),S=await We(e,_);for(let T of C){let k=f.components.find(D=>D.id===T.cmpInfo.id),I=await To(e,T,S,e.registryPath===T.cmpInfo.filePath||Jt(T.cmpInfo.filePath));Vt(k,I);let R=g.findIndex(D=>D.id===T.cmpInfo.id);g[R].inputs=I;let $=Nr(T.cmpInfo.id,g,m,r,n,o,s);if(e.sdkVersion===V.gen2){let{elements:D,elmIndex:B,statementIndex:U,statement:H,variableDeclaration:w}=await nT(e,y,T);if($.addCmpToRegistry)D.push(oT(e,$.addCmpToRegistry)),h=!0;else if($.removeCmpFromRegistry)D.splice(B,1),h=!0;else if($.updateRegisteredCmp){let E=Ze(e,D[B],$.updateRegisteredCmp),Be=e.ts.factory.createIdentifier($.updateRegisteredCmp.importName);D[B]=e.ts.factory.updateObjectLiteralExpression(E,[e.ts.factory.createPropertyAssignment("component",Be),...E.properties.slice(1)]),h=!0}if(h&&i){let E=[...y.statements];E[U]=e.ts.factory.updateVariableStatement(H,H.modifiers,e.ts.factory.updateVariableDeclarationList(H.declarationList,[e.ts.factory.updateVariableDeclaration(w,w.name,w.exclamationToken,w.type,e.ts.factory.createArrayLiteralExpression(Rr(e,D)))])),y=e.ts.factory.updateSourceFile(y,E),y=Lh(e,$,y),y=ce(e,y,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),y=Or(e,y,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=$.components,m=$.components.filter(Be=>Be.isRegistered)}}else{let D=[...y.statements];$.addCmpToRegistry?(D.push(Mh(e,$.addCmpToRegistry)),h=!0):$.removeCmpFromRegistry?(D.splice($.nodeIndex,1),h=!0):$.updateRegisteredCmp&&(D[$.nodeIndex]=Rc(e,D[$.nodeIndex],$.updateRegisteredCmp),h=!0),h&&i&&(y=e.ts.factory.updateSourceFile(y,D),y=ce(e,y,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),y=Lh(e,$,y),k?.acceptsChildren&&(y=ce(e,y,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=$.components,m=$.components.filter(B=>B.isRegistered))}}}if(h&&i){y=Ir(e,y),y=kr(e,y);let C=Ye(e,y);C=yr(C),C=await e.formatCode(e.registryPath,C),await e.writeFile(e.registryPath,C)}return f}async function nT(e,t,r){let n=Ke(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let o=n.arrayLiteralExp.elements.filter(i=>e.ts.isObjectLiteralExpression(i)),s=-1;for(let i=0;i<o.length;i++)if((await Nc(e,t,o[i]))?.id===r.cmpInfo.id){s=i;break}return{...n,elements:o,elmIndex:s}}function oT(e,t){let r=e.ts.factory.createIdentifier(t.importName);return Ze(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("component",r),...t.acceptsChildren?[e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())]:[]],!0),t)}function Lh(e,t,r){let n=t.addCmpToRegistry||t.updateRegisteredCmp;if(n){let o=n.externalImportPath?n.externalImportPath:ae(e,e.registryPath,n.filePath);n.exportType==="default"?r=ce(e,r,{defaultImport:n.importName,importPath:o}):n.exportType==="named"&&(r=ce(e,r,{namedImports:[n.importName],importPath:o}))}return r}async function zh(e){let t=[],r=await iT(e,t);if(await Vh(e,t,r),!await e.exists(e.builderComponentPath)){let n=await e.formatCode(e.builderComponentPath,Uh(e,e.builderComponentPath));await e.writeFile(e.builderComponentPath,n),t.push({filePath:e.builderComponentPath,modifiedType:"create"})}return t}async function jh(e){let t=[];await Vh(e,t);let r=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`,n=e.join(e.componentsDir,r);if(!await e.exists(n)){let o=await e.formatCode(n,Uh(e,n,"figma-imports"));await e.writeFile(n,o),t.push({filePath:n,modifiedType:"create"})}return t}function Uh(e,t,r="page"){let n=e.typescriptEnabled;return e.sdkVersion===V.gen2?`
864
+ `,r+=");";let n=ea(e,r);return Ic(e,n,t)}function Ic(e,t,r){if(!e.ts.isExpressionStatement(t))return t;let n=t.expression;if(!e.ts.isCallExpression(n))return t;let o=[...n.arguments];if(o.length<2)return t;let s=o[1];return e.ts.isObjectLiteralExpression(s)?(o[1]=Je(e,s,r),e.ts.factory.updateExpressionStatement(t,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,o))):t}async function Bh(e){let t=await e.readFile(e.registryPath);return t?eF(e,t):{components:[],sourceFile:se(e,"")}}async function eF(e,t){let r=se(e,t);return e.sdkVersion===V.gen2?nF(e,r):tF(e,r)}async function tF(e,t){let r=[];for(let n=0;n<t.statements.length;n++){let o=t.statements[n];if(!e.ts.isExpressionStatement(o))continue;let s=o.expression;if(!e.ts.isCallExpression(s))continue;let i=s.expression;if(!e.ts.isPropertyAccessExpression(i))continue;let a=i.expression;if(!e.ts.isIdentifier(a)||a.text!=="Builder"||i.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let l=c[1];if(!e.ts.isObjectLiteralExpression(l))continue;let p=c[0];if(e.ts.isIdentifier(p)){let d=await rF(e,t,n,p,l,!1);d&&r.push(d);continue}}return{sourceFile:t,components:At(r)}}async function rF(e,t,r,n,o,s){let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=t.statements.filter(c=>e.ts.isImportDeclaration(c)),u=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(u){let c=u.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;i.filePath=await Nc(e,c.text),i.relFilePath=e.relative(e.getAppRootDir(),i.filePath),i.importPath=xe(e,i.filePath),i.name=Yt(e,i.filePath),i.importName=n.text,i.exportName="default",i.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!e.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(g=>g.name.text===n.text));if(!c)return null;let l=c.moduleSpecifier;if(!e.ts.isStringLiteral(l))return null;let p=await Nc(e,l.text);i.filePath=await Nc(e,l.text),i.relFilePath=e.relative(e.getAppRootDir(),i.filePath),await e.exists(p)?i.importPath=xe(e,i.filePath):(i.externalImportPath=l.text,i.importPath=i.externalImportPath),i.name=we(n.text),i.importName=n.text,i.exportName=n.text,i.exportType="named"}return i=Ft(e,i,o),i.displayFilePath=ge(e,i.filePath),i.filePath&&i.exportName&&(i.id=await Ce(e,i.filePath,i.exportName,i.externalImportPath)),i}function Nc(e,t){return Ei(e,e.normalize(e.resolve(e.dirname(e.registryPath),t)))}async function nF(e,t){let r=[],n=Ge(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(o,s)=>{let i=await Oc(e,t,o);i&&(i.nodeIndex=s,r.push(i))})),{sourceFile:t,components:At(r)}}async function Oc(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};Po(e,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!e.ts.isPropertyAssignment(s)||!e.ts.isIdentifier(s.name))continue;if(he(e,s)==="component"){let a,{initializer:u}=s;if(e.ts.isIdentifier(u)&&(a=u.text),!a)continue;n.name===""&&(n.name=we(a)),n.importName=a;let c=await Rr(e,e.registryPath,t,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await e.exists(c.filePath)?n.importPath=xe(e,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let l=t.statements.filter(d=>e.ts.isImportDeclaration(d)),p=l.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!e.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=l.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let g=d.moduleSpecifier;if(!e.ts.isStringLiteral(g))return null;n.exportName=a}continue}}return n=Ft(e,n,r),n.filePath&&n.exportName&&(n.id=await Ce(e,n.filePath,n.exportName,n.externalImportPath)),n}async function Br(e,t,r,n,o,s,i,a){let u=await bn(e),[c,l,p,d]=await Promise.all([Qg(e,u),Bh(e),wt(e),Ti(e)]),g=c.map(C=>C.cmpInfo),m=l.components,f={components:Dr(g,m),registryPath:e.registryPath,registryDisplayPath:ge(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:tr(g),publicApiKey:d.envValue??void 0,devToolsVersion:e.version};if(a)return f.components=await To(e,f.components),f;let h=!1,y=l.sourceFile,b=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(b.length>0){let C=b.map(F=>{let $=c.find(I=>I.cmpInfo.id===F);if(!$)throw new Error(`Component ${F} not found`);return $}),_=Array.from(new Set(C.map(F=>F.cmpInfo.filePath))),S=await Ze(e,_);for(let F of C){let $=f.components.find(D=>D.id===F.cmpInfo.id),I=await Fo(e,F,S,e.registryPath===F.cmpInfo.filePath||Jt(F.cmpInfo.filePath));Ht($,I);let k=g.findIndex(D=>D.id===F.cmpInfo.id);g[k].inputs=I;let R=Nr(F.cmpInfo.id,g,m,r,n,o,s);if(e.sdkVersion===V.gen2){let{elements:D,elmIndex:L,statementIndex:U,statement:H,variableDeclaration:w}=await oF(e,y,F);if(R.addCmpToRegistry)D.push(iF(e,R.addCmpToRegistry)),h=!0;else if(R.removeCmpFromRegistry)D.splice(L,1),h=!0;else if(R.updateRegisteredCmp){let E=Je(e,D[L],R.updateRegisteredCmp),Be=e.ts.factory.createIdentifier(R.updateRegisteredCmp.importName);D[L]=e.ts.factory.updateObjectLiteralExpression(E,[e.ts.factory.createPropertyAssignment("component",Be),...E.properties.slice(1)]),h=!0}if(h&&i){let E=[...y.statements];E[U]=e.ts.factory.updateVariableStatement(H,H.modifiers,e.ts.factory.updateVariableDeclarationList(H.declarationList,[e.ts.factory.updateVariableDeclaration(w,w.name,w.exclamationToken,w.type,e.ts.factory.createArrayLiteralExpression(kr(e,D)))])),y=e.ts.factory.updateSourceFile(y,E),y=zh(e,R,y),y=ce(e,y,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),y=Or(e,y,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=R.components,m=R.components.filter(Be=>Be.isRegistered)}}else{let D=[...y.statements];R.addCmpToRegistry?(D.push(Lh(e,R.addCmpToRegistry)),h=!0):R.removeCmpFromRegistry?(D.splice(R.nodeIndex,1),h=!0):R.updateRegisteredCmp&&(D[R.nodeIndex]=Ic(e,D[R.nodeIndex],R.updateRegisteredCmp),h=!0),h&&i&&(y=e.ts.factory.updateSourceFile(y,D),y=ce(e,y,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),y=zh(e,R,y),$?.acceptsChildren&&(y=ce(e,y,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=R.components,m=R.components.filter(L=>L.isRegistered))}}}if(h&&i){y=Ir(e,y),y=$r(e,y);let C=Qe(e,y);C=yr(C),C=await e.formatCode(e.registryPath,C),await e.writeFile(e.registryPath,C)}return f}async function oF(e,t,r){let n=Ge(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let o=n.arrayLiteralExp.elements.filter(i=>e.ts.isObjectLiteralExpression(i)),s=-1;for(let i=0;i<o.length;i++)if((await Oc(e,t,o[i]))?.id===r.cmpInfo.id){s=i;break}return{...n,elements:o,elmIndex:s}}function iF(e,t){let r=e.ts.factory.createIdentifier(t.importName);return Je(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("component",r),...t.acceptsChildren?[e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())]:[]],!0),t)}function zh(e,t,r){let n=t.addCmpToRegistry||t.updateRegisteredCmp;if(n){let o=n.externalImportPath?n.externalImportPath:ae(e,e.registryPath,n.filePath);n.exportType==="default"?r=ce(e,r,{defaultImport:n.importName,importPath:o}):n.exportType==="named"&&(r=ce(e,r,{namedImports:[n.importName],importPath:o}))}return r}async function jh(e){let t=[],r=await sF(e,t);if(await Hh(e,t,r),!await e.exists(e.builderComponentPath)){let n=await e.formatCode(e.builderComponentPath,Vh(e,e.builderComponentPath));await e.writeFile(e.builderComponentPath,n),t.push({filePath:e.builderComponentPath,modifiedType:"create"})}return t}async function Uh(e){let t=[];await Hh(e,t);let r=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`,n=e.join(e.componentsDir,r);if(!await e.exists(n)){let o=await e.formatCode(n,Vh(e,n,"figma-imports"));await e.writeFile(n,o),t.push({filePath:n,modifiedType:"create"})}return t}function Vh(e,t,r="page"){let n=e.typescriptEnabled;return e.sdkVersion===V.gen2?`
865
865
  import React from "react";
866
866
  import {
867
867
  Content,
@@ -873,7 +873,7 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
873
873
  import { CUSTOM_COMPONENTS } from ${JSON.stringify(ae(e,t,e.registryPath))};
874
874
 
875
875
  // Builder Public API Key set in .env file
876
- const BUILDER_API_KEY = ${e.configType==="vite"?`import.meta.env.${Ti};`:`${ga};`}
876
+ const BUILDER_API_KEY = ${e.configType==="vite"?`import.meta.env.${Fi};`:`${ga};`}
877
877
  const MODEL_NAME = "${r}";
878
878
 
879
879
  export default function BuilderPage() {
@@ -926,7 +926,7 @@ import { BuilderComponent, builder, useIsPreviewing } from "@builder.io/react";
926
926
  import ${JSON.stringify(ae(e,t,e.registryPath))};
927
927
 
928
928
  // Builder Public API Key set in .env file
929
- ${e.configType==="vite"?`builder.init(import.meta.env.${Ti}${n?"!":""})`:`builder.init("${ga}")`}
929
+ ${e.configType==="vite"?`builder.init(import.meta.env.${Fi}${n?"!":""})`:`builder.init("${ga}")`}
930
930
 
931
931
  export default function BuilderPage() {
932
932
  const isPreviewingInBuilder = useIsPreviewing();
@@ -971,7 +971,7 @@ export default function BuilderPage() {
971
971
  </>
972
972
  );
973
973
  }
974
- `.trimStart()}async function Vh(e,t,r){if(!await e.exists(e.registryPath)){if(e.sdkVersion===V.gen2){let s=aT(e);await e.writeFile(e.registryPath,s)}else await e.writeFile(e.registryPath,"");t.push({filePath:e.registryPath,modifiedType:"create"})}if(!r)return;let o=(await Lr(e,null,!1,!1,null,null,!1,!1)).components.find(s=>s.filePath===r);o&&await Lr(e,o.id,!0,!1,null,null,!0,!1)}async function iT(e,t){let n=e.typescriptEnabled?"tsx":"jsx",o=e.join(e.componentsDir,"Counter"),s=e.join(o,`Counter.${n}`),i=e.join(o,"styles.module.css"),{component:a,styles:u}=sT(e);if(!await e.exists(s)){let c=await e.formatCode(s,a);await e.writeFile(s,c),t.push({filePath:s,modifiedType:"create"})}return await e.exists(i)||(await e.writeFile(i,u),t.push({filePath:i,modifiedType:"create"})),s}function sT(e){let t=e.typescriptEnabled,r=`
974
+ `.trimStart()}async function Hh(e,t,r){if(!await e.exists(e.registryPath)){if(e.sdkVersion===V.gen2){let s=uF(e);await e.writeFile(e.registryPath,s)}else await e.writeFile(e.registryPath,"");t.push({filePath:e.registryPath,modifiedType:"create"})}if(!r)return;let o=(await Br(e,null,!1,!1,null,null,!1,!1)).components.find(s=>s.filePath===r);o&&await Br(e,o.id,!0,!1,null,null,!0,!1)}async function sF(e,t){let n=e.typescriptEnabled?"tsx":"jsx",o=e.join(e.componentsDir,"Counter"),s=e.join(o,`Counter.${n}`),i=e.join(o,"styles.module.css"),{component:a,styles:u}=aF(e);if(!await e.exists(s)){let c=await e.formatCode(s,a);await e.writeFile(s,c),t.push({filePath:s,modifiedType:"create"})}return await e.exists(i)||(await e.writeFile(i,u),t.push({filePath:i,modifiedType:"create"})),s}function aF(e){let t=e.typescriptEnabled,r=`
975
975
  "use client"
976
976
  import React, { useState } from "react";
977
977
  import styles from "./styles.module.css";
@@ -1034,18 +1034,18 @@ export default Counter;
1034
1034
  font-size: 42px;
1035
1035
  text-align: center;
1036
1036
  }
1037
- `.trimStart();return{component:r,styles:n}}function aT(e){return e.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-react";
1037
+ `.trimStart();return{component:r,styles:n}}function uF(e){return e.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-react";
1038
1038
 
1039
1039
  export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
1040
1040
  ];`:`export const CUSTOM_COMPONENTS = [
1041
1041
  ];
1042
- `}async function Oc(e){let t=await uT(e);return{builderPageOptions:async()=>({templateContentId:"2e36438034894a8abf279ea9e6d3596f",pathname:"/builder-demo",title:"Builder + React Demo Page"}),ensureBuilderSetup:()=>zh(t),ensureFigmaImportPage:()=>jh(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Lr(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let o=await Lr(t,n.cmpId,!1,!1,null,null,!1,!1);return{...o,component:o.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Lr(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Lr(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Lr(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Lr(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Fi(t),setPublicApiKey:n=>Oh(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===V.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Xt(t),setCache:n=>er(t,n)}}async function uT(e){let t=await cT(e),r=e.getAppRootDir(),n=e.join(r,"src"),o=await bt(e),s={},i={...e,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",reactConfigPath:t,typescriptEnabled:o,configType:"",addExternalPackage:a=>{s[e.join(r,a,"index.ts")]=`export * from "${a}";`},readFileSync:a=>s[a]??e.readFileSync(a),existsSync:a=>!!s[a]||e.existsSync(a),readdirSync:a=>{let u=e.readdirSync(a);return a===r?[...u,...Object.keys(s).map(c=>c.slice(r.length+1))]:u},readdir:async a=>{let u=await e.readdir(a);return a===r?[...u,...Object.keys(s).map(c=>c.slice(r.length+1))]:u}};return e.sdkVersion?i.sdkVersion=e.sdkVersion:i.sdkVersion=await ko(i),t.includes("webpack.config")&&(i.configType="webpack"),t.includes("vite.config")&&(i.configType="vite"),await e.exists(n)?(i.srcDir=n,i.componentsDir=e.join(n,"components"),i.registryPath=await At(e,n),i.builderComponentPath=e.join(i.srcDir,`builder-page.${o?"tsx":"jsx"}`)):(i.componentsDir=e.join(r,"components"),i.registryPath=await At(e,r),i.builderComponentPath=e.join(r,`builder-page.${o?"tsx":"jsx"}`)),i}async function cT(e){let t=["vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return n}if(e.ignoreMissingConfig)return"";throw new Error(`Could not find React config file. Searched for ${t.join(", ")} in "${e.getAppRootDir()}".`)}async function $i(e){return await lT(e,["environment.ts"],ha)}async function Hh(e,t){let r=await $i(e),n=await mT(e,r.file,r.envKey,t);return{...r,modifiedType:n}}async function lT(e,t,r){let n={envKey:r,envValue:null,file:""};for(let o of t){let s=e.join(e.getAppRootDir(),"src","environments",o),i=await pT(e,s);if(typeof i=="string"&&i.length>0&&i!=="YOUR_API_KEY")return n.envValue=i,n.file=s,n}return n.file=e.join(e.getAppRootDir(),"src","environments",t[t.length-1]),n}async function pT(e,t){let r=await e.readFile(t);return r?dT(e,r):""}function dT(e,t){let r=se(e,t),n="",s=_o(e,r,"environment");if(s&&s.statement.declarationList.declarations.length>0){let a=s.statement.declarationList.declarations[0].initializer;a&&e.ts.isObjectLiteralExpression(a)&&a.properties.forEach(u=>{e.ts.isPropertyAssignment(u)&&e.ts.isIdentifier(u.name)&&u.name.text===ha&&e.ts.isStringLiteral(u.initializer)&&(n=u.initializer.text)})}return n}async function fT(e,t,r,n){let o=se(e,t),i=_o(e,o,"environment");if(i&&i.statement.declarationList.declarations.length>0){let a=i.statement.declarationList,u=a.declarations[0],c=u.initializer;if(c&&e.ts.isObjectLiteralExpression(c)){let l=e.ts.factory.createPropertyAssignment(e.ts.factory.createIdentifier(r),e.ts.factory.createStringLiteral(n)),p=e.ts.factory.createNodeArray([...c.properties,l]),d=e.ts.factory.updateObjectLiteralExpression(c,p),g=e.ts.factory.updateVariableDeclaration(u,u.name,u.exclamationToken,u.type,d),m=e.ts.factory.updateVariableDeclarationList(a,[g]);return e.ts.factory.updateVariableStatement(i.statement,i.statement.modifiers,m)}return null}return null}async function mT(e,t,r,n){let o=await e.readFile(t);if(o)if(o.includes(r))e.debug(`"${r}" already set in ${t}`);else{e.debug(`Add "${r}" to ${t}`);let s=await fT(e,o,r,n);if(s){let i=Ye(e,s),a=await e.formatCode(t,i);await e.writeFile(t,a)}return"update"}else{e.debug(`Creating new env file with "${r}" at ${t}`);let s=`
1042
+ `}async function Mc(e){let t=await cF(e);return{builderPageOptions:async()=>({templateContentId:"2e36438034894a8abf279ea9e6d3596f",pathname:"/builder-demo",title:"Builder + React Demo Page"}),ensureBuilderSetup:()=>jh(t),ensureFigmaImportPage:()=>Uh(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Br(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let o=await Br(t,n.cmpId,!1,!1,null,null,!1,!1);return{...o,component:o.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Br(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Br(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Br(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Br(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Ti(t),setPublicApiKey:n=>Mh(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===V.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Xt(t),setCache:n=>er(t,n)}}async function cF(e){let t=await lF(e),r=e.getAppRootDir(),n=e.join(r,"src"),o=await wt(e),s={},i={...e,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",reactConfigPath:t,typescriptEnabled:o,configType:"",addExternalPackage:a=>{s[e.join(r,a,"index.ts")]=`export * from "${a}";`},readFileSync:a=>s[a]??e.readFileSync(a),existsSync:a=>!!s[a]||e.existsSync(a),readdirSync:a=>{let u=e.readdirSync(a);return a===r?[...u,...Object.keys(s).map(c=>c.slice(r.length+1))]:u},readdir:async a=>{let u=await e.readdir(a);return a===r?[...u,...Object.keys(s).map(c=>c.slice(r.length+1))]:u}};return e.sdkVersion?i.sdkVersion=e.sdkVersion:i.sdkVersion=await $o(i),t.includes("webpack.config")&&(i.configType="webpack"),t.includes("vite.config")&&(i.configType="vite"),await e.exists(n)?(i.srcDir=n,i.componentsDir=e.join(n,"components"),i.registryPath=await Tt(e,n),i.builderComponentPath=e.join(i.srcDir,`builder-page.${o?"tsx":"jsx"}`)):(i.componentsDir=e.join(r,"components"),i.registryPath=await Tt(e,r),i.builderComponentPath=e.join(r,`builder-page.${o?"tsx":"jsx"}`)),i}async function lF(e){let t=["vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return n}if(e.ignoreMissingConfig)return"";throw new Error(`Could not find React config file. Searched for ${t.join(", ")} in "${e.getAppRootDir()}".`)}async function Ri(e){return await pF(e,["environment.ts"],ha)}async function qh(e,t){let r=await Ri(e),n=await gF(e,r.file,r.envKey,t);return{...r,modifiedType:n}}async function pF(e,t,r){let n={envKey:r,envValue:null,file:""};for(let o of t){let s=e.join(e.getAppRootDir(),"src","environments",o),i=await dF(e,s);if(typeof i=="string"&&i.length>0&&i!=="YOUR_API_KEY")return n.envValue=i,n.file=s,n}return n.file=e.join(e.getAppRootDir(),"src","environments",t[t.length-1]),n}async function dF(e,t){let r=await e.readFile(t);return r?fF(e,r):""}function fF(e,t){let r=se(e,t),n="",s=_o(e,r,"environment");if(s&&s.statement.declarationList.declarations.length>0){let a=s.statement.declarationList.declarations[0].initializer;a&&e.ts.isObjectLiteralExpression(a)&&a.properties.forEach(u=>{e.ts.isPropertyAssignment(u)&&e.ts.isIdentifier(u.name)&&u.name.text===ha&&e.ts.isStringLiteral(u.initializer)&&(n=u.initializer.text)})}return n}async function mF(e,t,r,n){let o=se(e,t),i=_o(e,o,"environment");if(i&&i.statement.declarationList.declarations.length>0){let a=i.statement.declarationList,u=a.declarations[0],c=u.initializer;if(c&&e.ts.isObjectLiteralExpression(c)){let l=e.ts.factory.createPropertyAssignment(e.ts.factory.createIdentifier(r),e.ts.factory.createStringLiteral(n)),p=e.ts.factory.createNodeArray([...c.properties,l]),d=e.ts.factory.updateObjectLiteralExpression(c,p),g=e.ts.factory.updateVariableDeclaration(u,u.name,u.exclamationToken,u.type,d),m=e.ts.factory.updateVariableDeclarationList(a,[g]);return e.ts.factory.updateVariableStatement(i.statement,i.statement.modifiers,m)}return null}return null}async function gF(e,t,r,n){let o=await e.readFile(t);if(o)if(o.includes(r))e.debug(`"${r}" already set in ${t}`);else{e.debug(`Add "${r}" to ${t}`);let s=await mF(e,o,r,n);if(s){let i=Qe(e,s),a=await e.formatCode(t,i);await e.writeFile(t,a)}return"update"}else{e.debug(`Creating new env file with "${r}" at ${t}`);let s=`
1043
1043
  // https://www.builder.io/c/docs/using-your-api-key
1044
1044
  export const environment = {
1045
1045
  production: false,
1046
1046
  builderApiKey: "${n}",
1047
1047
  };
1048
- `.trimStart(),i=await e.formatCode(t,s);return await e.writeFile(t,i),"create"}return null}var ha="builderApiKey";async function Kh(e,t){let r=[],n=t.getSourceFiles(),o=t.getTypeChecker();return await Promise.all(n.map(async s=>{let i=e.basename(s.fileName);if(yT(e,s.fileName)||i.startsWith(".")||i==="node_modules"||gT.has(i))return;let a=e.normalize(s.fileName);if(a===e.registryPath)return;let u=await ya(e,o,a,s);r.push(...u)})),r.sort((s,i)=>s.cmpInfo.name.localeCompare(i.cmpInfo.name))}var gT=new Set([]),hT=new Set(["node_modules"]);function yT(e,t){for(let r of hT)if(e.dirname(t).includes(r))return!0;return!1}async function Gh(e,t){let r=e.extname(t).toLowerCase();if(r===".tsx"||r===".jsx"||r===".ts"||r===".js"){let n=await e.readFile(t);if(n)return DT(e,t,n)}return null}function DT(e,t,r){let n=se(e,r);return ya(e,null,t,n)}async function ya(e,t,r,n){let o=[],s={};r=e.normalize(r);let i=n.statements.filter(l=>e.ts.isClassDeclaration(l)&&xT(e,l)),a=n.statements.find(l=>e.ts.isImportDeclaration(l)&&e.ts.isStringLiteral(l.moduleSpecifier)&&l.moduleSpecifier.text==="@angular/core");if(a&&e.ts.isImportDeclaration(a)){let l=a.importClause?.namedBindings;if(l&&e.ts.isNamedImports(l)){let p=l.elements.find(d=>(d.propertyName??d.name).text==="input");p&&(s.inputSignalImportName=p.name.text)}}let u=await CT(e,t,r,n),c=ST(e,n);return await Promise.all(i.map(async l=>{let p=await vT(e,t,r,l,c,s);o.push(...p)})),o.push(...u),o}async function Mc(e,t,r){if(t.node.fnNode){let{sourceFile:n,typeChecker:o}=await Co(e,t.cmpInfo.filePath,r),i=(await ya(e,o,t.cmpInfo.filePath,n)).find(a=>a.cmpInfo.id===t.cmpInfo.id);if(!i)throw new Error(`Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return i.cmpInfo.inputs}return[]}async function Wh(e,t,r){let n=await We(e,r.map(i=>i.filePath)),o=n.getTypeChecker();return await Promise.all(r.filter(i=>!(i.name.endsWith("Page")||i.name.endsWith("Module")||i.name==="AppComponent")).map(async i=>{if(!i.isRegistered){let a=n.getSourceFile(i.filePath);if(a){let c=(await ya(e,o,i.filePath,a)).find(l=>l.cmpInfo.id===i.id);if(c){i.inputs=qn(e,o,c.node.fnNode);let l=t.find(p=>p.cmpInfo.id===i.id);if(l){let p=await Mc(e,l,n);Vt(i,p)}}}}return i}))}async function vT(e,t,r,n,o,s){let i=[],a=e.relative(e.getAppRootDir(),r),u=we(e,r),c=n.name?.text;if(!c)return i;let l=!1;n.modifiers&&(l=n.modifiers.some(m=>m.kind===e.ts.SyntaxKind.DefaultKeyword));let p=l?"default":c,d=l?"default":"named",g=[];return n.members.forEach(m=>{if(e.ts.isPropertyDeclaration(m)||e.ts.isGetAccessor(m)||e.ts.isSetAccessor(m)){let y=(e.ts.getDecorators(m)??[]).find(C=>bT(e,C))!==void 0&&e.ts.isIdentifier(m.name),b=s?.inputSignalImportName!==void 0&&e.ts.isIdentifier(m.name)&&wT(e,m,s.inputSignalImportName);if(y||b){let C="any";if(e.ts.isSetAccessor(m))C=qh(e,m.parameters[0].type);else if(m.type&&t){let S=t.getTypeAtLocation(m.type);C=t.typeToString(S)}else C=qh(e,m.type);let _={name:m.name.text,type:o[C]?"string":C};o[C]&&(_.enum=o[C]),g.push(_)}}}),i.push({cmpInfo:{id:await ve(e,r,c),displayFilePath:ge(e,r),name:be(c),inputs:g,exportName:p,exportType:d,importName:c,filePath:r,relFilePath:a,importPath:u,meta:{...PT(e,n)},framework:"angular"},node:{name:c,fnNode:n,deps:void 0}}),i}async function CT(e,t,r,n){let o=[],s=e.relative(e.getAppRootDir(),r),i=we(e,r);for(let a of n.statements)if(e.ts.isExportDeclaration(a)&&a.exportClause&&e.ts.isNamedExports(a.exportClause))for(let u of a.exportClause.elements){let c=u.name?.text;if(!c)continue;let l=c,p="named",d=[];if(t){let f=t.getSymbolAtLocation(u.name);if(f){let h=t.getDeclaredTypeOfSymbol(f);t.getPropertiesOfType(h).forEach(b=>{let C=b.getDeclarations();C&&C.forEach(_=>{if(e.ts.isPropertyDeclaration(_)){let S=t.getTypeAtLocation(_),T={name:b.getName(),type:ET(e,t,S)};d.push(T)}})})}}let g=e.ts.isExportSpecifier(u)&&u.parent?u.parent.parent:void 0,m;if(g){let f=g.moduleSpecifier;if(f&&e.ts.isStringLiteral(f)){let h=t?.getSymbolAtLocation(f);if(h&&h.declarations&&h.declarations.length>0){let y=h.declarations[0];(!e.ts.isSourceFile(y)||e.ts.isSourceFile(y)&&y.fileName.includes("node_modules"))&&(m=f.text)}}}o.push({cmpInfo:{id:await ve(e,r,c,m),displayFilePath:ge(e,r),name:be(c),inputs:d,exportName:l,exportType:p,importName:c,filePath:r,relFilePath:s,importPath:m||i,externalImportPath:m,framework:"angular"},node:{name:c,fnNode:u,deps:void 0}})}else if(e.ts.isExportDeclaration(a)&&!a.exportClause&&a.moduleSpecifier&&e.ts.isStringLiteral(a.moduleSpecifier)){let u=a.moduleSpecifier.text;if(t)try{let c=t.getSymbolAtLocation(a.moduleSpecifier);if(c&&c.exports){let l=t.getExportsOfModule(c);for(let p of l)if(p.flags&e.ts.SymbolFlags.Class){let d=p.getName();if(d.startsWith("_"))continue;o.push({cmpInfo:{id:await ve(e,r,d,u),displayFilePath:ge(e,r),name:be(d),inputs:[],exportName:d,exportType:"named",importName:d,filePath:r,relFilePath:s,importPath:u,externalImportPath:u,framework:"angular"},node:{name:d,fnNode:a,deps:void 0}})}}}catch(c){console.warn(`Error processing star export from ${u}:`,c)}}return o}function bT(e,t){return Zh(e,t,"Input")}function wT(e,t,r){return e.ts.isPropertyDeclaration(t)&&t.initializer!==void 0&&e.ts.isCallExpression(t.initializer)&&e.ts.isIdentifier(t.initializer.expression)&&t.initializer.expression.text===r}function Zh(e,t,r){if(e.ts.isCallExpression(t.expression)){let n=t.expression;if(e.ts.isIdentifier(n.expression))return n.expression?.text===r}return!1}function xT(e,t){return!!e.ts.getDecorators(t)?.some(o=>e.ts.isCallExpression(o.expression)&&e.ts.isIdentifier(o.expression.expression)&&o.expression.expression.text==="Component")}function qh(e,t){if(!t)return"any";let r="any";switch(t.kind){case e.ts.SyntaxKind.StringKeyword:r="string";break;case e.ts.SyntaxKind.NumberKeyword:r="number";break;case e.ts.SyntaxKind.BooleanKeyword:r="boolean";break;case e.ts.SyntaxKind.TypeReference:e.ts.isTypeReferenceNode(t)&&e.ts.isIdentifier(t.typeName)&&(r=t.typeName.text);break}return r.includes("|")?"string":r}function ST(e,t){let r={};return e.ts.forEachChild(t,n=>{e.ts.isTypeAliasDeclaration(n)&&e.ts.isUnionTypeNode(n.type)&&n.type.types.every(o=>e.ts.isLiteralTypeNode(o)&&e.ts.isStringLiteral(o.literal))&&(r[n.name.text]=n.type.types.map(o=>o.literal.text))}),r}function ET(e,t,r){let n=t.typeToString(r);if(n==="any"){let o=r.getSymbol();if(o){let s=o.getDeclarations();if(s&&s.length>0){let i=s[0];if(e.ts.isVariableDeclaration(i)){let a=i.type;a&&(n=t.typeToString(t.getTypeAtLocation(a)))}}}}return n}function PT(e,t){let{getDecorators:r,isCallExpression:n,isIdentifier:o,isObjectLiteralExpression:s,isPropertyAssignment:i,isStringLiteral:a,SyntaxKind:u}=e.ts,c,l;return r(t)?.forEach(d=>{if(Zh(e,d,"Component")){let{expression:g}=d;if(n(g)){let[m]=g.arguments;s(m)&&m.properties.forEach(f=>{i(f)&&o(f.name)&&(f.name.escapedText==="selector"&&a(f.initializer)&&(c=f.initializer.text),f.name.escapedText==="standalone"&&(l=f.initializer.kind===u.TrueKeyword))})}}}),{selector:c,standalone:l}}async function Da(e,t,r){let n=e.typescriptEnabled?".ts":".js",o=`app.module${n}`,s=e.join(e.appDir,o),i=await e.readFile(s);if(!i){e.Sentry?.captureException(new Error(`Unable to read app.module.${n} at ${s}`),{extra:{appModuleCode:i,appModulePath:s}});return}let a=await _T(e,s,t,r,i);if(!a){e.Sentry?.captureException(new Error(`Unable to update app.module.${n} at ${s}`),{extra:{appModuleCode:i,appModulePath:s}});return}return await e.writeFile(s,a),s}async function _T(e,t,r,n,o){let s=o,i=se(e,o),a=ae(e,t,n);i=ce(e,i,{namedImports:[r],importPath:a}),i=ce(e,i,{namedImports:["Content"],importPath:"@builder.io/sdk-angular"});let u=[];for(let c of i.statements)if(e.ts.isClassDeclaration(c)&&c.name?.text==="AppModule"){let l=AT(e,r,c);u.push(l)}else u.push(c);return i=e.ts.factory.updateSourceFile(i,u),s=Ye(e,i),s}function AT(e,t,r){let n=e.ts.getDecorators(r);if(n){for(let o of n)if(e.ts.isCallExpression(o.expression)&&e.ts.isIdentifier(o.expression.expression)&&o.expression.expression.text==="NgModule"){let s=o.expression.arguments;if(s.length===1&&e.ts.isObjectLiteralExpression(s[0])){let i=Jh(e,s[0],"declarations",t);if(i){let a=Jh(e,i,"imports","Content");if(a&&(i=a),i){let u=e.ts.factory.updateDecorator(o,e.ts.factory.updateCallExpression(o.expression,o.expression.expression,o.expression.typeArguments,[i])),l=[...n.map(p=>p===o?u:p),...e.ts.getModifiers(r)||[]];return e.ts.factory.updateClassDeclaration(r,l,r.name,r.typeParameters,r.heritageClauses,r.members)}}}}}return r}function Jh(e,t,r,n){let o=[...t.properties],s=o.findIndex(a=>he(e,a)===r);if(s>-1){let a=o[s];if(e.ts.isPropertyAssignment(a)&&a.initializer&&e.ts.isArrayLiteralExpression(a.initializer)){let u=Yh(e,a.initializer,n);return u?(o[s]=e.ts.factory.updatePropertyAssignment(a,a.name,u),e.ts.factory.updateObjectLiteralExpression(t,o)):null}return null}let i=Yh(e,e.ts.factory.createArrayLiteralExpression([],!0),n);return i?e.ts.factory.updateObjectLiteralExpression(t,[...o,e.ts.factory.createPropertyAssignment(r,i)]):null}function Yh(e,t,r){return t.elements.some(o=>e.ts.isIdentifier(o)?o.text===r:!1)?null:e.ts.factory.updateArrayLiteralExpression(t,[...t.elements,e.ts.factory.createIdentifier(r)])}async function Bc(e,t,r,n){let s=`app.routes${e.typescriptEnabled?".ts":".js"}`,i=e.join(e.appDir,s);try{if(e.magicast){let a=await e.magicast.loadFile(i);Object.keys(a.exports).length===0&&(a.exports.routes=[]);let c=Object.keys(a.exports)[0],l=a.exports[c];if(l.find(d=>d.path===t))return;let p=e.magicast.builders.raw("{}");if(p.path=t,p.component=e.magicast.builders.raw(r),l.push(p),a.imports.$items.find(d=>d.imported===r))return;a.imports.$append({imported:r,from:n}),await e.magicast.writeFile(a,i)}}catch(a){let u=null;try{u=e.readFileSync(i)}catch(c){e.Sentry?.captureException(c,{level:"warning"})}e.Sentry?.captureException(a,{extra:{content:u,appRoutesPath:i,componentName:r,componentPath:n}})}}var cy=Ue(uy(),1);async function ly(e){let t=e.ts.findConfigFile(e.getAppRootDir(),e.existsSync);if(t){let r=await e.readFile(t);if(!r)return;let n=cy.default.parse(r);if(!n||typeof n!="object"||Array.isArray(n))return;let o=n.compilerOptions;if(!o||typeof o!="object"||Array.isArray(o))return;let s=o.paths;(!s||typeof s!="object"||Array.isArray(s))&&(o.paths={},s=o.paths),Object.assign(o.paths,{"~/*":["./src/*"]}),await e.writeFile(t,JSON.stringify(n,null,2))}}async function py(e){let t=[],r=await LT(e,t);t.push(...await xa(e)),await MT(e,r);let n="BuilderPage";if(!await e.exists(e.builderPageComponentPath)){let o=await e.formatCode(e.builderPageComponentPath,fy(e,n,e.builderPageComponentPath,"builder-page","page",!0));await e.writeFile(e.builderPageComponentPath,o),t.push({filePath:e.builderPageComponentPath,modifiedType:"create"})}if(e.hasAppModule){await Da(e,"Counter",r);let o=await Da(e,n,e.builderPageComponentPath);o&&t.push({filePath:o,modifiedType:"update"})}return await Bc(e,"**",n,"./components/builder-page.component"),t}async function dy(e){let t=[];t.push(...await xa(e));let r="FigmaImportsPage",n="figma-imports.component",o=e.join(e.componentsDir,`${n}.${e.typescriptEnabled?"ts":"js"}`);if(!await e.exists(o)){let s=await e.formatCode(o,fy(e,r,o,"figma-imports","figma-imports",!1));await e.writeFile(o,s),t.push({filePath:o,modifiedType:"create"})}if(e.hasAppModule){let s=await Da(e,r,o);s&&t.push({filePath:s,modifiedType:"update"})}return await Bc(e,"figma-imports",r,`./components/${n}`),await ly(e),t}async function xa(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,BT(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}async function MT(e,t){let n=(await zr(e,null,!1,!1,null,null,!1,!1)).components.find(o=>o.filePath===t);n&&await zr(e,n.id,!0,!1,null,null,!0,!1)}function fy(e,t,r,n,o,s){let i=!e.hasAppModule,a=ae(e,r,e.registryPath),u=e.join(e.getAppRootDir(),"src","environments","environment.ts"),c=ae(e,r,u),l=s?` <ng-container *ngIf="content || isPreviewing; else notFound">
1048
+ `.trimStart(),i=await e.formatCode(t,s);return await e.writeFile(t,i),"create"}return null}var ha="builderApiKey";async function Gh(e,t){let r=[],n=t.getSourceFiles(),o=t.getTypeChecker();return await Promise.all(n.map(async s=>{let i=e.basename(s.fileName);if(DF(e,s.fileName)||i.startsWith(".")||i==="node_modules"||hF.has(i))return;let a=e.normalize(s.fileName);if(a===e.registryPath)return;let u=await ya(e,o,a,s);r.push(...u)})),r.sort((s,i)=>s.cmpInfo.name.localeCompare(i.cmpInfo.name))}var hF=new Set([]),yF=new Set(["node_modules"]);function DF(e,t){for(let r of yF)if(e.dirname(t).includes(r))return!0;return!1}async function Wh(e,t){let r=e.extname(t).toLowerCase();if(r===".tsx"||r===".jsx"||r===".ts"||r===".js"){let n=await e.readFile(t);if(n)return vF(e,t,n)}return null}function vF(e,t,r){let n=se(e,r);return ya(e,null,t,n)}async function ya(e,t,r,n){let o=[],s={};r=e.normalize(r);let i=n.statements.filter(l=>e.ts.isClassDeclaration(l)&&SF(e,l)),a=n.statements.find(l=>e.ts.isImportDeclaration(l)&&e.ts.isStringLiteral(l.moduleSpecifier)&&l.moduleSpecifier.text==="@angular/core");if(a&&e.ts.isImportDeclaration(a)){let l=a.importClause?.namedBindings;if(l&&e.ts.isNamedImports(l)){let p=l.elements.find(d=>(d.propertyName??d.name).text==="input");p&&(s.inputSignalImportName=p.name.text)}}let u=await bF(e,t,r,n),c=EF(e,n);return await Promise.all(i.map(async l=>{let p=await CF(e,t,r,l,c,s);o.push(...p)})),o.push(...u),o}async function Lc(e,t,r){if(t.node.fnNode){let{sourceFile:n,typeChecker:o}=await Co(e,t.cmpInfo.filePath,r),i=(await ya(e,o,t.cmpInfo.filePath,n)).find(a=>a.cmpInfo.id===t.cmpInfo.id);if(!i)throw new Error(`Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return i.cmpInfo.inputs}return[]}async function Zh(e,t,r){let n=await Ze(e,r.map(i=>i.filePath)),o=n.getTypeChecker();return await Promise.all(r.filter(i=>!(i.name.endsWith("Page")||i.name.endsWith("Module")||i.name==="AppComponent")).map(async i=>{if(!i.isRegistered){let a=n.getSourceFile(i.filePath);if(a){let c=(await ya(e,o,i.filePath,a)).find(l=>l.cmpInfo.id===i.id);if(c){i.inputs=qn(e,o,c.node.fnNode);let l=t.find(p=>p.cmpInfo.id===i.id);if(l){let p=await Lc(e,l,n);Ht(i,p)}}}}return i}))}async function CF(e,t,r,n,o,s){let i=[],a=e.relative(e.getAppRootDir(),r),u=xe(e,r),c=n.name?.text;if(!c)return i;let l=!1;n.modifiers&&(l=n.modifiers.some(m=>m.kind===e.ts.SyntaxKind.DefaultKeyword));let p=l?"default":c,d=l?"default":"named",g=[];return n.members.forEach(m=>{if(e.ts.isPropertyDeclaration(m)||e.ts.isGetAccessor(m)||e.ts.isSetAccessor(m)){let y=(e.ts.getDecorators(m)??[]).find(C=>wF(e,C))!==void 0&&e.ts.isIdentifier(m.name),b=s?.inputSignalImportName!==void 0&&e.ts.isIdentifier(m.name)&&xF(e,m,s.inputSignalImportName);if(y||b){let C="any";if(e.ts.isSetAccessor(m))C=Kh(e,m.parameters[0].type);else if(m.type&&t){let S=t.getTypeAtLocation(m.type);C=t.typeToString(S)}else C=Kh(e,m.type);let _={name:m.name.text,type:o[C]?"string":C};o[C]&&(_.enum=o[C]),g.push(_)}}}),i.push({cmpInfo:{id:await Ce(e,r,c),displayFilePath:ge(e,r),name:we(c),inputs:g,exportName:p,exportType:d,importName:c,filePath:r,relFilePath:a,importPath:u,meta:{..._F(e,n)},framework:"angular"},node:{name:c,fnNode:n,deps:void 0}}),i}async function bF(e,t,r,n){let o=[],s=e.relative(e.getAppRootDir(),r),i=xe(e,r);for(let a of n.statements)if(e.ts.isExportDeclaration(a)&&a.exportClause&&e.ts.isNamedExports(a.exportClause))for(let u of a.exportClause.elements){let c=u.name?.text;if(!c)continue;let l=c,p="named",d=[];if(t){let f=t.getSymbolAtLocation(u.name);if(f){let h=t.getDeclaredTypeOfSymbol(f);t.getPropertiesOfType(h).forEach(b=>{let C=b.getDeclarations();C&&C.forEach(_=>{if(e.ts.isPropertyDeclaration(_)){let S=t.getTypeAtLocation(_),F={name:b.getName(),type:PF(e,t,S)};d.push(F)}})})}}let g=e.ts.isExportSpecifier(u)&&u.parent?u.parent.parent:void 0,m;if(g){let f=g.moduleSpecifier;if(f&&e.ts.isStringLiteral(f)){let h=t?.getSymbolAtLocation(f);if(h&&h.declarations&&h.declarations.length>0){let y=h.declarations[0];(!e.ts.isSourceFile(y)||e.ts.isSourceFile(y)&&y.fileName.includes("node_modules"))&&(m=f.text)}}}o.push({cmpInfo:{id:await Ce(e,r,c,m),displayFilePath:ge(e,r),name:we(c),inputs:d,exportName:l,exportType:p,importName:c,filePath:r,relFilePath:s,importPath:m||i,externalImportPath:m,framework:"angular"},node:{name:c,fnNode:u,deps:void 0}})}else if(e.ts.isExportDeclaration(a)&&!a.exportClause&&a.moduleSpecifier&&e.ts.isStringLiteral(a.moduleSpecifier)){let u=a.moduleSpecifier.text;if(t)try{let c=t.getSymbolAtLocation(a.moduleSpecifier);if(c&&c.exports){let l=t.getExportsOfModule(c);for(let p of l)if(p.flags&e.ts.SymbolFlags.Class){let d=p.getName();if(d.startsWith("_"))continue;o.push({cmpInfo:{id:await Ce(e,r,d,u),displayFilePath:ge(e,r),name:we(d),inputs:[],exportName:d,exportType:"named",importName:d,filePath:r,relFilePath:s,importPath:u,externalImportPath:u,framework:"angular"},node:{name:d,fnNode:a,deps:void 0}})}}}catch(c){console.warn(`Error processing star export from ${u}:`,c)}}return o}function wF(e,t){return Jh(e,t,"Input")}function xF(e,t,r){return e.ts.isPropertyDeclaration(t)&&t.initializer!==void 0&&e.ts.isCallExpression(t.initializer)&&e.ts.isIdentifier(t.initializer.expression)&&t.initializer.expression.text===r}function Jh(e,t,r){if(e.ts.isCallExpression(t.expression)){let n=t.expression;if(e.ts.isIdentifier(n.expression))return n.expression?.text===r}return!1}function SF(e,t){return!!e.ts.getDecorators(t)?.some(o=>e.ts.isCallExpression(o.expression)&&e.ts.isIdentifier(o.expression.expression)&&o.expression.expression.text==="Component")}function Kh(e,t){if(!t)return"any";let r="any";switch(t.kind){case e.ts.SyntaxKind.StringKeyword:r="string";break;case e.ts.SyntaxKind.NumberKeyword:r="number";break;case e.ts.SyntaxKind.BooleanKeyword:r="boolean";break;case e.ts.SyntaxKind.TypeReference:e.ts.isTypeReferenceNode(t)&&e.ts.isIdentifier(t.typeName)&&(r=t.typeName.text);break}return r.includes("|")?"string":r}function EF(e,t){let r={};return e.ts.forEachChild(t,n=>{e.ts.isTypeAliasDeclaration(n)&&e.ts.isUnionTypeNode(n.type)&&n.type.types.every(o=>e.ts.isLiteralTypeNode(o)&&e.ts.isStringLiteral(o.literal))&&(r[n.name.text]=n.type.types.map(o=>o.literal.text))}),r}function PF(e,t,r){let n=t.typeToString(r);if(n==="any"){let o=r.getSymbol();if(o){let s=o.getDeclarations();if(s&&s.length>0){let i=s[0];if(e.ts.isVariableDeclaration(i)){let a=i.type;a&&(n=t.typeToString(t.getTypeAtLocation(a)))}}}}return n}function _F(e,t){let{getDecorators:r,isCallExpression:n,isIdentifier:o,isObjectLiteralExpression:s,isPropertyAssignment:i,isStringLiteral:a,SyntaxKind:u}=e.ts,c,l;return r(t)?.forEach(d=>{if(Jh(e,d,"Component")){let{expression:g}=d;if(n(g)){let[m]=g.arguments;s(m)&&m.properties.forEach(f=>{i(f)&&o(f.name)&&(f.name.escapedText==="selector"&&a(f.initializer)&&(c=f.initializer.text),f.name.escapedText==="standalone"&&(l=f.initializer.kind===u.TrueKeyword))})}}}),{selector:c,standalone:l}}async function Da(e,t,r){let n=e.typescriptEnabled?".ts":".js",o=`app.module${n}`,s=e.join(e.appDir,o),i=await e.readFile(s);if(!i){e.Sentry?.captureException(new Error(`Unable to read app.module.${n} at ${s}`),{extra:{appModuleCode:i,appModulePath:s}});return}let a=await AF(e,s,t,r,i);if(!a){e.Sentry?.captureException(new Error(`Unable to update app.module.${n} at ${s}`),{extra:{appModuleCode:i,appModulePath:s}});return}return await e.writeFile(s,a),s}async function AF(e,t,r,n,o){let s=o,i=se(e,o),a=ae(e,t,n);i=ce(e,i,{namedImports:[r],importPath:a}),i=ce(e,i,{namedImports:["Content"],importPath:"@builder.io/sdk-angular"});let u=[];for(let c of i.statements)if(e.ts.isClassDeclaration(c)&&c.name?.text==="AppModule"){let l=TF(e,r,c);u.push(l)}else u.push(c);return i=e.ts.factory.updateSourceFile(i,u),s=Qe(e,i),s}function TF(e,t,r){let n=e.ts.getDecorators(r);if(n){for(let o of n)if(e.ts.isCallExpression(o.expression)&&e.ts.isIdentifier(o.expression.expression)&&o.expression.expression.text==="NgModule"){let s=o.expression.arguments;if(s.length===1&&e.ts.isObjectLiteralExpression(s[0])){let i=Yh(e,s[0],"declarations",t);if(i){let a=Yh(e,i,"imports","Content");if(a&&(i=a),i){let u=e.ts.factory.updateDecorator(o,e.ts.factory.updateCallExpression(o.expression,o.expression.expression,o.expression.typeArguments,[i])),l=[...n.map(p=>p===o?u:p),...e.ts.getModifiers(r)||[]];return e.ts.factory.updateClassDeclaration(r,l,r.name,r.typeParameters,r.heritageClauses,r.members)}}}}}return r}function Yh(e,t,r,n){let o=[...t.properties],s=o.findIndex(a=>he(e,a)===r);if(s>-1){let a=o[s];if(e.ts.isPropertyAssignment(a)&&a.initializer&&e.ts.isArrayLiteralExpression(a.initializer)){let u=Qh(e,a.initializer,n);return u?(o[s]=e.ts.factory.updatePropertyAssignment(a,a.name,u),e.ts.factory.updateObjectLiteralExpression(t,o)):null}return null}let i=Qh(e,e.ts.factory.createArrayLiteralExpression([],!0),n);return i?e.ts.factory.updateObjectLiteralExpression(t,[...o,e.ts.factory.createPropertyAssignment(r,i)]):null}function Qh(e,t,r){return t.elements.some(o=>e.ts.isIdentifier(o)?o.text===r:!1)?null:e.ts.factory.updateArrayLiteralExpression(t,[...t.elements,e.ts.factory.createIdentifier(r)])}async function Bc(e,t,r,n){let s=`app.routes${e.typescriptEnabled?".ts":".js"}`,i=e.join(e.appDir,s);try{if(e.magicast){let a=await e.magicast.loadFile(i);Object.keys(a.exports).length===0&&(a.exports.routes=[]);let c=Object.keys(a.exports)[0],l=a.exports[c];if(l.find(d=>d.path===t))return;let p=e.magicast.builders.raw("{}");if(p.path=t,p.component=e.magicast.builders.raw(r),l.push(p),a.imports.$items.find(d=>d.imported===r))return;a.imports.$append({imported:r,from:n}),await e.magicast.writeFile(a,i)}}catch(a){let u=null;try{u=e.readFileSync(i)}catch(c){e.Sentry?.captureException(c,{level:"warning"})}e.Sentry?.captureException(a,{extra:{content:u,appRoutesPath:i,componentName:r,componentPath:n}})}}var ly=Ve(cy(),1);async function py(e){let t=e.ts.findConfigFile(e.getAppRootDir(),e.existsSync);if(t){let r=await e.readFile(t);if(!r)return;let n=ly.default.parse(r);if(!n||typeof n!="object"||Array.isArray(n))return;let o=n.compilerOptions;if(!o||typeof o!="object"||Array.isArray(o))return;let s=o.paths;(!s||typeof s!="object"||Array.isArray(s))&&(o.paths={},s=o.paths),Object.assign(o.paths,{"~/*":["./src/*"]}),await e.writeFile(t,JSON.stringify(n,null,2))}}async function dy(e){let t=[],r=await zF(e,t);t.push(...await xa(e)),await LF(e,r);let n="BuilderPage";if(!await e.exists(e.builderPageComponentPath)){let o=await e.formatCode(e.builderPageComponentPath,my(e,n,e.builderPageComponentPath,"builder-page","page",!0));await e.writeFile(e.builderPageComponentPath,o),t.push({filePath:e.builderPageComponentPath,modifiedType:"create"})}if(e.hasAppModule){await Da(e,"Counter",r);let o=await Da(e,n,e.builderPageComponentPath);o&&t.push({filePath:o,modifiedType:"update"})}return await Bc(e,"**",n,"./components/builder-page.component"),t}async function fy(e){let t=[];t.push(...await xa(e));let r="FigmaImportsPage",n="figma-imports.component",o=e.join(e.componentsDir,`${n}.${e.typescriptEnabled?"ts":"js"}`);if(!await e.exists(o)){let s=await e.formatCode(o,my(e,r,o,"figma-imports","figma-imports",!1));await e.writeFile(o,s),t.push({filePath:o,modifiedType:"create"})}if(e.hasAppModule){let s=await Da(e,r,o);s&&t.push({filePath:s,modifiedType:"update"})}return await Bc(e,"figma-imports",r,`./components/${n}`),await py(e),t}async function xa(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,BF(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}async function LF(e,t){let n=(await zr(e,null,!1,!1,null,null,!1,!1)).components.find(o=>o.filePath===t);n&&await zr(e,n.id,!0,!1,null,null,!0,!1)}function my(e,t,r,n,o,s){let i=!e.hasAppModule,a=ae(e,r,e.registryPath),u=e.join(e.getAppRootDir(),"src","environments","environment.ts"),c=ae(e,r,u),l=s?` <ng-container *ngIf="content || isPreviewing; else notFound">
1049
1049
  <builder-content
1050
1050
  [model]="model"
1051
1051
  [content]="content"
@@ -1111,12 +1111,12 @@ export class ${t} {
1111
1111
  }
1112
1112
  }
1113
1113
 
1114
- `.trimStart()}function BT(e){return e.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-angular";
1114
+ `.trimStart()}function BF(e){return e.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-angular";
1115
1115
 
1116
1116
  export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
1117
1117
  ];`:`export const CUSTOM_COMPONENTS = [
1118
1118
  ];
1119
- `}async function LT(e,t){let n=e.typescriptEnabled?"ts":"js",o=e.join(e.componentsDir,`counter.component.${n}`),s=await e.exists(o);e.debug(`angularEnsureCounterComponent, hasCounterCmp: ${s}`);let i=zT(e);if(!s){let a=await e.formatCode(o,i);await e.writeFile(o,a),t.push({filePath:o,modifiedType:"create"})}return o}function zT(e){return`
1119
+ `}async function zF(e,t){let n=e.typescriptEnabled?"ts":"js",o=e.join(e.componentsDir,`counter.component.${n}`),s=await e.exists(o);e.debug(`angularEnsureCounterComponent, hasCounterCmp: ${s}`);let i=jF(e);if(!s){let a=await e.formatCode(o,i);await e.writeFile(o,a),t.push({filePath:o,modifiedType:"create"})}return o}function jF(e){return`
1120
1120
  import { Component, Input } from '@angular/core';
1121
1121
 
1122
1122
  @Component({
@@ -1184,7 +1184,7 @@ export class Counter {
1184
1184
  }
1185
1185
  }
1186
1186
 
1187
- `.trimStart()}async function my(e){await xa(e);let t=await e.readFile(e.registryPath);return t?jT(e,t):{components:[],sourceFile:se(e,"")}}async function jT(e,t){let r=se(e,t);return UT(e,r)}async function UT(e,t){let r=[],n=Ke(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(o,s)=>{let i=await Gc(e,t,o);i&&(i.nodeIndex=s,r.push(i))})),{sourceFile:t,components:_t(r)}}async function Gc(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"angular"};for(let o of r.properties){if(!e.ts.isPropertyAssignment(o)||!e.ts.isIdentifier(o.name))continue;if(he(e,o)==="component"){let i,{initializer:a}=o;if(e.ts.isIdentifier(a))i=a.text;else if(e.ts.isCallExpression(a)){let c=a.arguments[0];e.ts.isIdentifier(c)&&(i=c.text)}if(!i)continue;n.name===""&&(n.name=be(i)),n.importName=i;let u=await $r(e,e.registryPath,t,i);if(!u)continue;if(n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=we(e,u.filePath):(n.externalImportPath=u.importPath,n.importPath=n.externalImportPath),n.displayFilePath=u.displayFilePath,n.exportType=u.exportType,n.externalImportPath)n.exportName=i;else{let c=await Gh(e,u.filePath);if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let l=c.find(p=>p.cmpInfo.exportName===i);l&&(n.exportName=l.cmpInfo.exportName)}}continue}}return n=Ft(e,n,r),n.filePath&&n.exportName&&(n.id=await ve(e,n.filePath,n.exportName,n.externalImportPath)),n}async function zr(e,t,r,n,o,s,i,a){let u=await bn(e),[c,l,p]=await Promise.all([Kh(e,u),my(e),$i(e)]),d=c.map(b=>b.cmpInfo),g=l.components,m={components:Dr(d,g),registryPath:e.registryPath,registryDisplayPath:ge(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:tr(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m.components=await Wh(e,c,m.components),m;let f=!1,h=l.sourceFile,y=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(y.length>0){let b=y.map(S=>{let T=c.find(k=>k.cmpInfo.id===S);if(!T)throw new Error(`Component ${S} not found`);return T}),C=Array.from(new Set(b.map(S=>S.cmpInfo.filePath))),_=await We(e,C);for(let S of b){let T=m.components.find(w=>w.id===S.cmpInfo.id),k=await Mc(e,S,_);Vt(T,k);let I=d.findIndex(w=>w.id===S.cmpInfo.id);d[I].inputs=k;let R=Nr(S.cmpInfo.id,d,g,r,n,o,s),{elements:$,elmIndex:D,statementIndex:B,statement:U,variableDeclaration:H}=await HT(e,h,S);if(R.addCmpToRegistry)$.push(VT(e,R.addCmpToRegistry)),f=!0;else if(R.removeCmpFromRegistry)$.splice(D,1),f=!0;else if(R.updateRegisteredCmp){let w=Ze(e,$[D],R.updateRegisteredCmp);$[D]=e.ts.factory.updateObjectLiteralExpression(w,[gy(e,R.updateRegisteredCmp),...w.properties.slice(1)]),f=!0}if(f&&i){let w=[...h.statements];w[B]=e.ts.factory.updateVariableStatement(U,U.modifiers,e.ts.factory.updateVariableDeclarationList(U.declarationList,[e.ts.factory.updateVariableDeclaration(H,H.name,H.exclamationToken,H.type,e.ts.factory.createArrayLiteralExpression(Rr(e,$)))])),h=e.ts.factory.updateSourceFile(h,w),T.exportType==="named"?h=ce(e,h,{namedImports:[T.importName],importPath:T.externalImportPath?T.externalImportPath:ae(e,e.registryPath,T.filePath)}):h=ce(e,h,{defaultImport:T.importName,importPath:T.externalImportPath?T.externalImportPath:ae(e,e.registryPath,T.filePath)}),h=ce(e,h,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-angular",isTypeOnly:!0}),h=Or(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m.components=R.components,g=R.components.filter(E=>E.isRegistered)}}}if(f&&i){h=Ir(e,h),h=kr(e,h);let b=Ye(e,h);b=yr(b),b=await e.formatCode(e.registryPath,b),await e.writeFile(e.registryPath,b)}return m}function gy(e,t){let r=e.ts.factory.createIdentifier(t.importName);return e.ts.factory.createPropertyAssignment("component",r)}function VT(e,t){return Ze(e,e.ts.factory.createObjectLiteralExpression([gy(e,t)],!0),t)}async function HT(e,t,r){let n=Ke(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let o=n.arrayLiteralExp.elements.filter(i=>e.ts.isObjectLiteralExpression(i)),s=-1;for(let i=0;i<o.length;i++)if((await Gc(e,t,o[i]))?.id===r.cmpInfo.id){s=i;break}return{...n,elements:o,elmIndex:s}}async function hy(e){let t=await qT(e);return{builderPageOptions:async()=>({templateContentId:"f0b8016ac92e474699293211a268ebaa",pathname:"/builder-demo",title:"Builder + Angular Demo Page"}),ensureBuilderSetup:()=>py(t),ensureFigmaImportPage:()=>dy(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>zr(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{t.addExternalPackage(n)},loadComponent:async n=>{let o=await zr(t,n.cmpId,!1,!1,null,null,!1,!1);return{...o,component:o.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>zr(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>zr(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>zr(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>zr(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>$i(t),setPublicApiKey:n=>Hh(t,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-angular"},{name:"concurrently"}],getDevRunCommand:()=>"builder-dev",getCache:()=>Xt(t),setCache:n=>er(t,n)}}async function qT(e){let t=await KT(e),r=e.getAppRootDir(),n=e.join(r,"src"),o=await bt(e),s=e.join(n,"app"),i=await At(e,s),a={},u={...e,srcDir:"",appDir:"",componentsDir:"",registryPath:i,angularConfigPath:t,typescriptEnabled:o,builderPageComponentPath:"",hasAppModule:!1,addExternalPackage:p=>{a[e.join(r,p,"index.ts")]=`export * from "${p}";`},readFileSync:p=>a[p]??e.readFileSync(p),existsSync:p=>!!a[p]||e.existsSync(p),readdirSync:p=>{let d=e.readdirSync(p);return p===r?[...d,...Object.keys(a).map(g=>g.slice(r.length+1))]:d},readdir:async p=>{let d=await e.readdir(p);return p===r?[...d,...Object.keys(a).map(g=>g.slice(r.length+1))]:d}};if(!await e.exists(n))throw new Error(`Could not find src directory. Searched for src in "${e.getAppRootDir()}".`);u.srcDir=n,u.appDir=s,u.componentsDir=e.join(u.appDir,"components"),u.builderPageComponentPath=e.join(u.componentsDir,`builder-page.component.${o?"ts":"js"}`);let c=`app.module.${o?"ts":"js"}`,l=e.join(u.appDir,c);return await e.exists(l)&&(u.hasAppModule=!0),u}async function KT(e){let t=e.join(e.getAppRootDir(),"angular.json");if(await e.exists(t))return t;let r=e.join(e.getAppRootDir(),"project.json");if(await e.exists(r))return r;if(e.ignoreMissingConfig)return"";throw new Error(`Could not find Angular config file. Searched for angular.json & project.json in "${e.getAppRootDir()}".`)}async function Ii(e){let t=e.configType==="vite"?GT:WT;return await Ar(e,[".env"],t)}async function yy(e,t){let r=await Ii(e),n=await Fr(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var GT="VITE_PUBLIC_BUILDER_KEY",WT="PUBLIC_BUILDER_KEY";async function vy(e,t,r){try{let n=await e.readFile(t);if(!n)return null;let o=e.relative(e.getAppRootDir(),t),s=t.split("/").pop()?.replace(".vue","")||"UnknownComponent",i=QT(s),a=JT(n,r),u=ZT(n);return{id:XT(t),name:i,filePath:o,relFilePath:o,inputs:a,framework:"vue",exportType:"default",exportName:"default",importName:i,importPath:o,vueApiType:u}}catch(n){return console.warn(`Failed to parse Vue component ${t}:`,n),null}}function ZT(e){return/<script[^>]*\s+setup[^>]*>/.test(e)?"composition-setup":/import\s+\{[^}]*\b(ref|reactive|computed|watch|onMounted|defineComponent)\b[^}]*\}\s+from\s+['"]vue['"]/.test(e)||/setup\s*\([^)]*\)\s*\{/.test(e)?"composition":"options"}function JT(e,t){if(!t)return[];let r=[],n=[/defineProps<\s*\{([^}]+)\}\s*>\s*\(\s*\)/g,/defineProps\s*\(\s*\{([^}]+)\}\s*\)/g,/defineProps\s*\(\s*\[([^\]]+)\]\s*\)/g];for(let u of n){let c;for(;(c=u.exec(e))!==null;){let l=c[1];l.includes(":")?r.push(...Wc(l)):r.push(...Dy(l))}}let o=/props\s*:\s*(\{[^}]+\}|\[[^\]]+\])/g,s;for(;(s=o.exec(e))!==null;){let u=s[1];if(u.startsWith("{")){let c=u.slice(1,-1);r.push(...Wc(c))}else{let c=u.slice(1,-1);r.push(...Dy(c))}}let i=/setup\s*\(\s*props\s*(?::\s*\{([^}]+)\})?\s*[,)]?/g,a;for(;(a=i.exec(e))!==null;)a[1]&&r.push(...Wc(a[1]));return YT(r)}function Wc(e){let t=[],r=/(\w+)\s*:\s*([^,;]+)/g,n;for(;(n=r.exec(e))!==null;){let[,i,a]=n;t.push({name:i.trim(),type:Zc(a.trim()),required:!a.includes("?")&&!a.includes("undefined")})}let o=/(\w+)\s*:\s*\{([^}]+)\}/g;for(;(n=o.exec(e))!==null;){let[,i,a]=n,u=a.match(/type\s*:\s*(\w+)/),c=a.match(/required\s*:\s*(true|false)/),l=a.match(/default\s*:\s*([^,}]+)/);t.push({name:i.trim(),type:u?Zc(u[1]):"any",required:c?c[1]==="true":!1,defaultValue:l?l[1].trim():void 0})}let s=/(\w+)\s*:\s*(\w+)(?=\s*[,}])/g;for(;(n=s.exec(e))!==null;){let[,i,a]=n;t.some(u=>u.name===i.trim())||t.push({name:i.trim(),type:Zc(a.trim()),required:!1})}return t}function Dy(e){let t=[],r=e.split(",").map(n=>n.trim().replace(/['"]/g,"")).filter(n=>n.length>0);for(let n of r)t.push({name:n,type:"any",required:!1});return t}function Zc(e){let t={String:"string",Number:"number",Boolean:"boolean",Array:"any[]",Object:"object",Function:"function",Date:"Date",Symbol:"symbol",string:"string",number:"number",boolean:"boolean",object:"object",function:"function"},r=e.replace(/\s*\|\s*undefined/g,"").replace(/\?$/,"");return t[r]||r||"any"}function YT(e){let t=new Set;return e.filter(r=>t.has(r.name)?!1:(t.add(r.name),!0))}function QT(e){return e.replace(/[-_\s]+(.)?/g,(t,r)=>r?r.toUpperCase():"").replace(/^(.)/,(t,r)=>r?r.toUpperCase():"")}function XT(e){return e.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}async function Jn(e,t){let r=await e$(e,t.readAllInputTypes),n=await Ii(e);return{components:r,registryPath:e.registryPath,registryDisplayPath:e.relative(e.getAppRootDir(),e.registryPath),frameworks:e.getFrameworks(),dependencies:tr(r),publicApiKey:n.envValue??void 0,devToolsVersion:e.version}}async function e$(e,t){let r=[],n=await t$(e,e.getAppRootDir());for(let o of n){let s=await vy(e,o,t);s&&r.push(s)}return r}async function t$(e,t){let r=[],n=async s=>{try{let i=await e.readdir(s);for(let a of i){let u=e.join(s,a);(await e.stat(u)).isDirectory()?!a.startsWith(".")&&a!=="node_modules"&&a!=="dist"&&a!=="build"&&a!==".nuxt"&&a!==".output"&&await n(u):a.endsWith(".vue")&&r.push(u)}}catch{}};await n(t);let o=["components","pages","layouts"];for(let s of o){let i=e.join(t,s);try{(await e.stat(i)).isDirectory()&&await n(i)}catch{}}return r}async function Cy(e){let t={errors:[]};try{await wy(e)}catch(r){t.errors.push(r instanceof Error?r.message:String(r))}return t}async function by(e){let t=[];t.push(...await wy(e));let n=e.join(e.componentsDir,"FigmaImports.vue");if(!await e.exists(n)){let o=await e.formatCode(n,r$(e,n,"figma-imports"));await e.writeFile(n,o),t.push({filePath:n,modifiedType:"create"})}return t}async function wy(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,o$(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}function r$(e,t,r="page"){let n=ae(e,t,e.registryPath),o=e.typescriptEnabled;return e.isNuxt?`<template>
1187
+ `.trimStart()}async function gy(e){await xa(e);let t=await e.readFile(e.registryPath);return t?UF(e,t):{components:[],sourceFile:se(e,"")}}async function UF(e,t){let r=se(e,t);return VF(e,r)}async function VF(e,t){let r=[],n=Ge(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(o,s)=>{let i=await Wc(e,t,o);i&&(i.nodeIndex=s,r.push(i))})),{sourceFile:t,components:At(r)}}async function Wc(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"angular"};for(let o of r.properties){if(!e.ts.isPropertyAssignment(o)||!e.ts.isIdentifier(o.name))continue;if(he(e,o)==="component"){let i,{initializer:a}=o;if(e.ts.isIdentifier(a))i=a.text;else if(e.ts.isCallExpression(a)){let c=a.arguments[0];e.ts.isIdentifier(c)&&(i=c.text)}if(!i)continue;n.name===""&&(n.name=we(i)),n.importName=i;let u=await Rr(e,e.registryPath,t,i);if(!u)continue;if(n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=xe(e,u.filePath):(n.externalImportPath=u.importPath,n.importPath=n.externalImportPath),n.displayFilePath=u.displayFilePath,n.exportType=u.exportType,n.externalImportPath)n.exportName=i;else{let c=await Wh(e,u.filePath);if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let l=c.find(p=>p.cmpInfo.exportName===i);l&&(n.exportName=l.cmpInfo.exportName)}}continue}}return n=Ft(e,n,r),n.filePath&&n.exportName&&(n.id=await Ce(e,n.filePath,n.exportName,n.externalImportPath)),n}async function zr(e,t,r,n,o,s,i,a){let u=await bn(e),[c,l,p]=await Promise.all([Gh(e,u),gy(e),Ri(e)]),d=c.map(b=>b.cmpInfo),g=l.components,m={components:Dr(d,g),registryPath:e.registryPath,registryDisplayPath:ge(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:tr(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m.components=await Zh(e,c,m.components),m;let f=!1,h=l.sourceFile,y=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(y.length>0){let b=y.map(S=>{let F=c.find($=>$.cmpInfo.id===S);if(!F)throw new Error(`Component ${S} not found`);return F}),C=Array.from(new Set(b.map(S=>S.cmpInfo.filePath))),_=await Ze(e,C);for(let S of b){let F=m.components.find(w=>w.id===S.cmpInfo.id),$=await Lc(e,S,_);Ht(F,$);let I=d.findIndex(w=>w.id===S.cmpInfo.id);d[I].inputs=$;let k=Nr(S.cmpInfo.id,d,g,r,n,o,s),{elements:R,elmIndex:D,statementIndex:L,statement:U,variableDeclaration:H}=await qF(e,h,S);if(k.addCmpToRegistry)R.push(HF(e,k.addCmpToRegistry)),f=!0;else if(k.removeCmpFromRegistry)R.splice(D,1),f=!0;else if(k.updateRegisteredCmp){let w=Je(e,R[D],k.updateRegisteredCmp);R[D]=e.ts.factory.updateObjectLiteralExpression(w,[hy(e,k.updateRegisteredCmp),...w.properties.slice(1)]),f=!0}if(f&&i){let w=[...h.statements];w[L]=e.ts.factory.updateVariableStatement(U,U.modifiers,e.ts.factory.updateVariableDeclarationList(U.declarationList,[e.ts.factory.updateVariableDeclaration(H,H.name,H.exclamationToken,H.type,e.ts.factory.createArrayLiteralExpression(kr(e,R)))])),h=e.ts.factory.updateSourceFile(h,w),F.exportType==="named"?h=ce(e,h,{namedImports:[F.importName],importPath:F.externalImportPath?F.externalImportPath:ae(e,e.registryPath,F.filePath)}):h=ce(e,h,{defaultImport:F.importName,importPath:F.externalImportPath?F.externalImportPath:ae(e,e.registryPath,F.filePath)}),h=ce(e,h,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-angular",isTypeOnly:!0}),h=Or(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m.components=k.components,g=k.components.filter(E=>E.isRegistered)}}}if(f&&i){h=Ir(e,h),h=$r(e,h);let b=Qe(e,h);b=yr(b),b=await e.formatCode(e.registryPath,b),await e.writeFile(e.registryPath,b)}return m}function hy(e,t){let r=e.ts.factory.createIdentifier(t.importName);return e.ts.factory.createPropertyAssignment("component",r)}function HF(e,t){return Je(e,e.ts.factory.createObjectLiteralExpression([hy(e,t)],!0),t)}async function qF(e,t,r){let n=Ge(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let o=n.arrayLiteralExp.elements.filter(i=>e.ts.isObjectLiteralExpression(i)),s=-1;for(let i=0;i<o.length;i++)if((await Wc(e,t,o[i]))?.id===r.cmpInfo.id){s=i;break}return{...n,elements:o,elmIndex:s}}async function yy(e){let t=await KF(e);return{builderPageOptions:async()=>({templateContentId:"f0b8016ac92e474699293211a268ebaa",pathname:"/builder-demo",title:"Builder + Angular Demo Page"}),ensureBuilderSetup:()=>dy(t),ensureFigmaImportPage:()=>fy(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>zr(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{t.addExternalPackage(n)},loadComponent:async n=>{let o=await zr(t,n.cmpId,!1,!1,null,null,!1,!1);return{...o,component:o.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>zr(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>zr(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>zr(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>zr(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Ri(t),setPublicApiKey:n=>qh(t,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-angular"},{name:"concurrently"}],getDevRunCommand:()=>"builder-dev",getCache:()=>Xt(t),setCache:n=>er(t,n)}}async function KF(e){let t=await GF(e),r=e.getAppRootDir(),n=e.join(r,"src"),o=await wt(e),s=e.join(n,"app"),i=await Tt(e,s),a={},u={...e,srcDir:"",appDir:"",componentsDir:"",registryPath:i,angularConfigPath:t,typescriptEnabled:o,builderPageComponentPath:"",hasAppModule:!1,addExternalPackage:p=>{a[e.join(r,p,"index.ts")]=`export * from "${p}";`},readFileSync:p=>a[p]??e.readFileSync(p),existsSync:p=>!!a[p]||e.existsSync(p),readdirSync:p=>{let d=e.readdirSync(p);return p===r?[...d,...Object.keys(a).map(g=>g.slice(r.length+1))]:d},readdir:async p=>{let d=await e.readdir(p);return p===r?[...d,...Object.keys(a).map(g=>g.slice(r.length+1))]:d}};if(!await e.exists(n))throw new Error(`Could not find src directory. Searched for src in "${e.getAppRootDir()}".`);u.srcDir=n,u.appDir=s,u.componentsDir=e.join(u.appDir,"components"),u.builderPageComponentPath=e.join(u.componentsDir,`builder-page.component.${o?"ts":"js"}`);let c=`app.module.${o?"ts":"js"}`,l=e.join(u.appDir,c);return await e.exists(l)&&(u.hasAppModule=!0),u}async function GF(e){let t=e.join(e.getAppRootDir(),"angular.json");if(await e.exists(t))return t;let r=e.join(e.getAppRootDir(),"project.json");if(await e.exists(r))return r;if(e.ignoreMissingConfig)return"";throw new Error(`Could not find Angular config file. Searched for angular.json & project.json in "${e.getAppRootDir()}".`)}async function Ii(e){let t=e.configType==="vite"?WF:ZF;return await Ar(e,[".env"],t)}async function Dy(e,t){let r=await Ii(e),n=await Tr(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var WF="VITE_PUBLIC_BUILDER_KEY",ZF="PUBLIC_BUILDER_KEY";async function Cy(e,t,r){try{let n=await e.readFile(t);if(!n)return null;let o=e.relative(e.getAppRootDir(),t),s=t.split("/").pop()?.replace(".vue","")||"UnknownComponent",i=XF(s),a=YF(n,r),u=JF(n);return{id:eR(t),name:i,filePath:o,relFilePath:o,inputs:a,framework:"vue",exportType:"default",exportName:"default",importName:i,importPath:o,vueApiType:u}}catch(n){return console.warn(`Failed to parse Vue component ${t}:`,n),null}}function JF(e){return/<script[^>]*\s+setup[^>]*>/.test(e)?"composition-setup":/import\s+\{[^}]*\b(ref|reactive|computed|watch|onMounted|defineComponent)\b[^}]*\}\s+from\s+['"]vue['"]/.test(e)||/setup\s*\([^)]*\)\s*\{/.test(e)?"composition":"options"}function YF(e,t){if(!t)return[];let r=[],n=[/defineProps<\s*\{([^}]+)\}\s*>\s*\(\s*\)/g,/defineProps\s*\(\s*\{([^}]+)\}\s*\)/g,/defineProps\s*\(\s*\[([^\]]+)\]\s*\)/g];for(let u of n){let c;for(;(c=u.exec(e))!==null;){let l=c[1];l.includes(":")?r.push(...Zc(l)):r.push(...vy(l))}}let o=/props\s*:\s*(\{[^}]+\}|\[[^\]]+\])/g,s;for(;(s=o.exec(e))!==null;){let u=s[1];if(u.startsWith("{")){let c=u.slice(1,-1);r.push(...Zc(c))}else{let c=u.slice(1,-1);r.push(...vy(c))}}let i=/setup\s*\(\s*props\s*(?::\s*\{([^}]+)\})?\s*[,)]?/g,a;for(;(a=i.exec(e))!==null;)a[1]&&r.push(...Zc(a[1]));return QF(r)}function Zc(e){let t=[],r=/(\w+)\s*:\s*([^,;]+)/g,n;for(;(n=r.exec(e))!==null;){let[,i,a]=n;t.push({name:i.trim(),type:Jc(a.trim()),required:!a.includes("?")&&!a.includes("undefined")})}let o=/(\w+)\s*:\s*\{([^}]+)\}/g;for(;(n=o.exec(e))!==null;){let[,i,a]=n,u=a.match(/type\s*:\s*(\w+)/),c=a.match(/required\s*:\s*(true|false)/),l=a.match(/default\s*:\s*([^,}]+)/);t.push({name:i.trim(),type:u?Jc(u[1]):"any",required:c?c[1]==="true":!1,defaultValue:l?l[1].trim():void 0})}let s=/(\w+)\s*:\s*(\w+)(?=\s*[,}])/g;for(;(n=s.exec(e))!==null;){let[,i,a]=n;t.some(u=>u.name===i.trim())||t.push({name:i.trim(),type:Jc(a.trim()),required:!1})}return t}function vy(e){let t=[],r=e.split(",").map(n=>n.trim().replace(/['"]/g,"")).filter(n=>n.length>0);for(let n of r)t.push({name:n,type:"any",required:!1});return t}function Jc(e){let t={String:"string",Number:"number",Boolean:"boolean",Array:"any[]",Object:"object",Function:"function",Date:"Date",Symbol:"symbol",string:"string",number:"number",boolean:"boolean",object:"object",function:"function"},r=e.replace(/\s*\|\s*undefined/g,"").replace(/\?$/,"");return t[r]||r||"any"}function QF(e){let t=new Set;return e.filter(r=>t.has(r.name)?!1:(t.add(r.name),!0))}function XF(e){return e.replace(/[-_\s]+(.)?/g,(t,r)=>r?r.toUpperCase():"").replace(/^(.)/,(t,r)=>r?r.toUpperCase():"")}function eR(e){return e.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}async function Jn(e,t){let r=await tR(e,t.readAllInputTypes),n=await Ii(e);return{components:r,registryPath:e.registryPath,registryDisplayPath:e.relative(e.getAppRootDir(),e.registryPath),frameworks:e.getFrameworks(),dependencies:tr(r),publicApiKey:n.envValue??void 0,devToolsVersion:e.version}}async function tR(e,t){let r=[],n=await rR(e,e.getAppRootDir());for(let o of n){let s=await Cy(e,o,t);s&&r.push(s)}return r}async function rR(e,t){let r=[],n=async s=>{try{let i=await e.readdir(s);for(let a of i){let u=e.join(s,a);(await e.stat(u)).isDirectory()?!a.startsWith(".")&&a!=="node_modules"&&a!=="dist"&&a!=="build"&&a!==".nuxt"&&a!==".output"&&await n(u):a.endsWith(".vue")&&r.push(u)}}catch{}};await n(t);let o=["components","pages","layouts"];for(let s of o){let i=e.join(t,s);try{(await e.stat(i)).isDirectory()&&await n(i)}catch{}}return r}async function by(e){let t={errors:[]};try{await xy(e)}catch(r){t.errors.push(r instanceof Error?r.message:String(r))}return t}async function wy(e){let t=[];t.push(...await xy(e));let n=e.join(e.componentsDir,"FigmaImports.vue");if(!await e.exists(n)){let o=await e.formatCode(n,nR(e,n,"figma-imports"));await e.writeFile(n,o),t.push({filePath:n,modifiedType:"create"})}return t}async function xy(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,iR(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}function nR(e,t,r="page"){let n=ae(e,t,e.registryPath),o=e.typescriptEnabled;return e.isNuxt?`<template>
1188
1188
  <div>
1189
1189
  <div v-if="pending">Loading...</div>
1190
1190
  <div v-else-if="error">Error loading content</div>
@@ -1240,7 +1240,7 @@ export default defineComponent({
1240
1240
  },
1241
1241
  setup() {
1242
1242
  const model = '${r}'
1243
- const apiKey = ${n$(e)}
1243
+ const apiKey = ${oR(e)}
1244
1244
  const content = ref${o?"<any>":""}(null)
1245
1245
  const loading = ref(true)
1246
1246
  const customComponents = CUSTOM_COMPONENTS
@@ -1273,7 +1273,7 @@ export default defineComponent({
1273
1273
  }
1274
1274
  }
1275
1275
  })
1276
- </script>`}function n$(e){return e.isNuxt?"useRuntimeConfig().public.builderApiKey":e.configType==="vite"?"import.meta.env.VITE_BUILDER_API_KEY":"process.env.VUE_APP_BUILDER_API_KEY"}function o$(e){return`import type { RegisteredComponent } from "@builder.io/sdk-vue";
1276
+ </script>`}function oR(e){return e.isNuxt?"useRuntimeConfig().public.builderApiKey":e.configType==="vite"?"import.meta.env.VITE_BUILDER_API_KEY":"process.env.VUE_APP_BUILDER_API_KEY"}function iR(e){return`import type { RegisteredComponent } from "@builder.io/sdk-vue";
1277
1277
 
1278
1278
  export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
1279
1279
  // Add your Vue components here
@@ -1290,15 +1290,15 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
1290
1290
  // ]
1291
1291
  // }
1292
1292
  ];
1293
- `}async function xy(e){let t=await i$(e);return{builderPageOptions:async()=>({templateContentId:"vue-demo-template-id",pathname:"/builder-demo",title:"Builder + Vue Demo Page"}),ensureBuilderSetup:async()=>(await Cy(t)).errors.length>0?[]:[],ensureFigmaImportPage:()=>by(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Jn(t,{readAllInputTypes:!!n?.readAllInputTypes}),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let o=await Jn(t,{readAllInputTypes:!1}),s=o.components.find(i=>i.id===n.cmpId);return{...o,component:s}},registerComponent:async n=>Jn(t,{readAllInputTypes:!1}),setRegisteredComponentInfo:async n=>Jn(t,{readAllInputTypes:!1}),setRegisteredComponentInput:async n=>Jn(t,{readAllInputTypes:!1}),unregisterComponent:async n=>Jn(t,{readAllInputTypes:!1}),getPublicApiKey:()=>Ii(t),setPublicApiKey:n=>yy(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===V.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-vue"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/vue"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Xt(t),setCache:n=>er(t,n)}}async function i$(e){let t=await s$(e),r=e.getAppRootDir(),n=e.join(r,"src"),o=await bt(e),s={},i={...e,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",vueConfigPath:t,typescriptEnabled:o,configType:"",isNuxt:await a$(e),addExternalPackage:c=>{s[e.join(r,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>s[c]??e.readFileSync(c),existsSync:c=>!!s[c]||e.existsSync(c),readdirSync:c=>{let l=e.readdirSync(c);return c===r?[...l,...Object.keys(s).map(p=>p.slice(r.length+1))]:l},readdir:async c=>{let l=await e.readdir(c);return c===r?[...l,...Object.keys(s).map(p=>p.slice(r.length+1))]:l}};t.includes("webpack.config")&&(i.configType="webpack"),(t.includes("vite.config")||t.includes("nuxt.config"))&&(i.configType="vite");let a=await e.exists(n);i.srcDir=a?n:null;let u=[e.join(r,"components"),e.join(r,"src","components"),e.join(r,"app","components")];for(let c of u)if(await e.exists(c)){i.componentsDir=c;break}return i.componentsDir||(i.componentsDir=a?e.join(n,"components"):e.join(r,"components")),i.registryPath=await At(e,i.componentsDir),i}async function s$(e){let t=["nuxt.config.ts","nuxt.config.js","vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts","vue.config.js","vue.config.ts"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return n}if(e.ignoreMissingConfig)return"";throw new Error(`Could not find Vue config file. Searched for ${t.join(", ")} in "${e.getAppRootDir()}".`)}async function a$(e){let t=["nuxt.config.ts","nuxt.config.js"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return!0}try{let r=e.join(e.getAppRootDir(),"package.json");if(await e.exists(r)){let n=JSON.parse(await e.readFile(r)||"{}"),o={...n.dependencies,...n.devDependencies};return!!(o.nuxt||o["@nuxt/kit"]||o.nuxt3)}}catch{}return!1}var _a=Ue(Oy(),1);async function My(e,t){let n={components:(await t.getRegistry()).components.filter(s=>s.isRegistered).map(s=>{let i={filePath:mr(e.relative(e.getAppRootDir(),s.filePath)),name:s.name,image:s.image,description:s.description,exportName:s.exportName,inputs:jt(s.inputs)};return jt(i)}),version:1};e.debug("exporting registry components:",n.components.length);let o=(0,_a.compress)(n);return btoa(JSON.stringify(o))}async function By(e,t,r){if(typeof r!="string")throw new Error("Invalid registry to import");let n=await t.getRegistry(),o=JSON.parse(atob(r)),s=(0,_a.decompress)(o),i=jt(n);e.debug("importing registry components:",s.components.length);for(let a of s.components){let u=mr(e.normalize(a.filePath)),c=n.components.find(p=>mr(p.filePath).endsWith(u)&&p.exportName===a.exportName);if(!c){console.error(`Could not find component to register: ${a.filePath}, ${a.exportName}`);continue}e.debug(`register (${c.id})`,c.filePath),await t.registerComponent({cmpId:c.id});for(let p of a.inputs)e.debug(`set input (${c.id})`),await t.setRegisteredComponentInput({cmpId:c.id,name:p.name,type:p.type,required:p.required,defaultValue:p.defaultValue,friendlyName:p.friendlyName,helperText:p.helperText});e.debug(`set input (${c.id}) info`);let l=await t.setRegisteredComponentInfo({cmpId:c.id,name:a.name,image:a.image,description:a.description});i=jt(l)}return i}var Tt={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik",vue:"vue",native:"native"},aH={[Tt.react]:[{version:V.gen1,recommended:!0},{version:V.gen2,recommended:!1}],[Tt.remix]:[{version:V.gen1,recommended:!1},{version:V.gen2,recommended:!0}],[Tt.angular]:[{version:V.gen2,recommended:!0}],[Tt.next]:[{version:V.gen1,recommended:!0},{version:V.gen2,recommended:!1}],[Tt.qwik]:[{version:V.gen2,recommended:!0}],[Tt.vue]:[{version:V.gen1,recommended:!0},{version:V.gen2,recommended:!1}]};async function Ly(e,t){let r=[],n=new Set;async function o(s){let i=e.join(s,"package.json");try{if(!await e.exists(i))return null;let u=await e.readFile(i);if(u===null)throw new Error(`Failed to read package.json at ${i}`);let c=JSON.parse(u);if(typeof c.name!="string"||c.name.trim()===""||n.has(c.name))return null;n.add(c.name);let l={name:c.name,subPackages:[]},p=await e.readdir(s);for(let d of p)d!=="node_modules"&&(await e.stat(e.join(s,d))).isDirectory()&&l.subPackages.push(d);return r.push(l),l}catch(a){return e.Sentry?.captureException(a,{level:"warning"}),null}}try{let s=e.join(t,"package.json");if(await e.exists(s)){let a=await e.readFile(s);if(a!==null){let u=JSON.parse(a),c={...u.dependencies,...u.devDependencies};for(let l of Object.keys(c)){let p=e.join(t,"node_modules",l);await o(p)}if(Array.isArray(u.workspaces))for(let l of u.workspaces){let p=await e.readdir(e.join(t,l));for(let d of p){let g=e.join(t,l,d);await o(g)}}}}}catch(s){e.Sentry?.captureException(s,{level:"warning"})}return r}var $$={"@builder.io/qwik-city":_h,next:hh,"@remix-run/react":Nh,react:Oc,"@angular/core":hy,vue:xy,native:Oc},k$={"@builder.io/qwik-city":Tt.qwik,next:Tt.next,"@remix-run/react":Tt.remix,react:Tt.react,"@angular/core":Tt.angular,vue:Tt.vue,native:Tt.native};async function Aa(e,t=!1){if(!e.ts)throw new Error("createDevTools() requires a TypeScript instance passed to the 'ts' option");if((!e.frameworks||e.frameworks.length===0)&&(e.frameworks=await bo(e)),e.frameworks.length===0&&t&&e.frameworks.push({name:"native"}),e.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let r of e.frameworks){let n=$$[r.name];if(n)try{let o=await n(e);return{...o,exportRegistry:()=>My(e,o),importRegistry:i=>By(e,o,i),framework:k$[r.name],findAllDependencies:async()=>await Ly(e,e.getRepoRootDir())}}catch(o){e.Sentry?.captureException(o,{level:"warning"})}}throw new Error(`Devtools framework not found for ${e.getAppRootDir()}, ${JSON.stringify(e.frameworks,null,2)}`)}var oq=`
1293
+ `}async function Sy(e){let t=await sR(e);return{builderPageOptions:async()=>({templateContentId:"vue-demo-template-id",pathname:"/builder-demo",title:"Builder + Vue Demo Page"}),ensureBuilderSetup:async()=>(await by(t)).errors.length>0?[]:[],ensureFigmaImportPage:()=>wy(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Jn(t,{readAllInputTypes:!!n?.readAllInputTypes}),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let o=await Jn(t,{readAllInputTypes:!1}),s=o.components.find(i=>i.id===n.cmpId);return{...o,component:s}},registerComponent:async n=>Jn(t,{readAllInputTypes:!1}),setRegisteredComponentInfo:async n=>Jn(t,{readAllInputTypes:!1}),setRegisteredComponentInput:async n=>Jn(t,{readAllInputTypes:!1}),unregisterComponent:async n=>Jn(t,{readAllInputTypes:!1}),getPublicApiKey:()=>Ii(t),setPublicApiKey:n=>Dy(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===V.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-vue"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/vue"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Xt(t),setCache:n=>er(t,n)}}async function sR(e){let t=await aR(e),r=e.getAppRootDir(),n=e.join(r,"src"),o=await wt(e),s={},i={...e,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",vueConfigPath:t,typescriptEnabled:o,configType:"",isNuxt:await uR(e),addExternalPackage:c=>{s[e.join(r,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>s[c]??e.readFileSync(c),existsSync:c=>!!s[c]||e.existsSync(c),readdirSync:c=>{let l=e.readdirSync(c);return c===r?[...l,...Object.keys(s).map(p=>p.slice(r.length+1))]:l},readdir:async c=>{let l=await e.readdir(c);return c===r?[...l,...Object.keys(s).map(p=>p.slice(r.length+1))]:l}};t.includes("webpack.config")&&(i.configType="webpack"),(t.includes("vite.config")||t.includes("nuxt.config"))&&(i.configType="vite");let a=await e.exists(n);i.srcDir=a?n:null;let u=[e.join(r,"components"),e.join(r,"src","components"),e.join(r,"app","components")];for(let c of u)if(await e.exists(c)){i.componentsDir=c;break}return i.componentsDir||(i.componentsDir=a?e.join(n,"components"):e.join(r,"components")),i.registryPath=await Tt(e,i.componentsDir),i}async function aR(e){let t=["nuxt.config.ts","nuxt.config.js","vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts","vue.config.js","vue.config.ts"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return n}if(e.ignoreMissingConfig)return"";throw new Error(`Could not find Vue config file. Searched for ${t.join(", ")} in "${e.getAppRootDir()}".`)}async function uR(e){let t=["nuxt.config.ts","nuxt.config.js"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return!0}try{let r=e.join(e.getAppRootDir(),"package.json");if(await e.exists(r)){let n=JSON.parse(await e.readFile(r)||"{}"),o={...n.dependencies,...n.devDependencies};return!!(o.nuxt||o["@nuxt/kit"]||o.nuxt3)}}catch{}return!1}var _a=Ve(My(),1);async function Ly(e,t){let n={components:(await t.getRegistry()).components.filter(s=>s.isRegistered).map(s=>{let i={filePath:mr(e.relative(e.getAppRootDir(),s.filePath)),name:s.name,image:s.image,description:s.description,exportName:s.exportName,inputs:Ut(s.inputs)};return Ut(i)}),version:1};e.debug("exporting registry components:",n.components.length);let o=(0,_a.compress)(n);return btoa(JSON.stringify(o))}async function By(e,t,r){if(typeof r!="string")throw new Error("Invalid registry to import");let n=await t.getRegistry(),o=JSON.parse(atob(r)),s=(0,_a.decompress)(o),i=Ut(n);e.debug("importing registry components:",s.components.length);for(let a of s.components){let u=mr(e.normalize(a.filePath)),c=n.components.find(p=>mr(p.filePath).endsWith(u)&&p.exportName===a.exportName);if(!c){console.error(`Could not find component to register: ${a.filePath}, ${a.exportName}`);continue}e.debug(`register (${c.id})`,c.filePath),await t.registerComponent({cmpId:c.id});for(let p of a.inputs)e.debug(`set input (${c.id})`),await t.setRegisteredComponentInput({cmpId:c.id,name:p.name,type:p.type,required:p.required,defaultValue:p.defaultValue,friendlyName:p.friendlyName,helperText:p.helperText});e.debug(`set input (${c.id}) info`);let l=await t.setRegisteredComponentInfo({cmpId:c.id,name:a.name,image:a.image,description:a.description});i=Ut(l)}return i}var Rt={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik",vue:"vue",native:"native"},PH={[Rt.react]:[{version:V.gen1,recommended:!0},{version:V.gen2,recommended:!1}],[Rt.remix]:[{version:V.gen1,recommended:!1},{version:V.gen2,recommended:!0}],[Rt.angular]:[{version:V.gen2,recommended:!0}],[Rt.next]:[{version:V.gen1,recommended:!0},{version:V.gen2,recommended:!1}],[Rt.qwik]:[{version:V.gen2,recommended:!0}],[Rt.vue]:[{version:V.gen1,recommended:!0},{version:V.gen2,recommended:!1}]};async function zy(e,t){let r=[],n=new Set;async function o(s){let i=e.join(s,"package.json");try{if(!await e.exists(i))return null;let u=await e.readFile(i);if(u===null)throw new Error(`Failed to read package.json at ${i}`);let c=JSON.parse(u);if(typeof c.name!="string"||c.name.trim()===""||n.has(c.name))return null;n.add(c.name);let l={name:c.name,subPackages:[]},p=await e.readdir(s);for(let d of p)d!=="node_modules"&&(await e.stat(e.join(s,d))).isDirectory()&&l.subPackages.push(d);return r.push(l),l}catch(a){return e.Sentry?.captureException(a,{level:"warning"}),null}}try{let s=e.join(t,"package.json");if(await e.exists(s)){let a=await e.readFile(s);if(a!==null){let u=JSON.parse(a),c={...u.dependencies,...u.devDependencies};for(let l of Object.keys(c)){let p=e.join(t,"node_modules",l);await o(p)}if(Array.isArray(u.workspaces))for(let l of u.workspaces){let p=await e.readdir(e.join(t,l));for(let d of p){let g=e.join(t,l,d);await o(g)}}}}}catch(s){e.Sentry?.captureException(s,{level:"warning"})}return r}var $R={"@builder.io/qwik-city":Ah,next:yh,"@remix-run/react":Oh,react:Mc,"@angular/core":yy,vue:Sy,native:Mc},kR={"@builder.io/qwik-city":Rt.qwik,next:Rt.next,"@remix-run/react":Rt.remix,react:Rt.react,"@angular/core":Rt.angular,vue:Rt.vue,native:Rt.native};async function Aa(e,t=!1){if(!e.ts)throw new Error("createDevTools() requires a TypeScript instance passed to the 'ts' option");if((!e.frameworks||e.frameworks.length===0)&&(e.frameworks=await bo(e)),e.frameworks.length===0&&t&&e.frameworks.push({name:"native"}),e.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let r of e.frameworks){let n=$R[r.name];if(n)try{let o=await n(e);return{...o,exportRegistry:()=>Ly(e,o),importRegistry:i=>By(e,o,i),framework:kR[r.name],findAllDependencies:async()=>await zy(e,e.getRepoRootDir())}}catch(o){e.Sentry?.captureException(o,{level:"warning"})}}throw new Error(`Devtools framework not found for ${e.getAppRootDir()}, ${JSON.stringify(e.frameworks,null,2)}`)}var xq=`
1294
1294
  /** @type {import('next').NextConfig} */
1295
1295
  const nextConfig = {
1296
1296
  }
1297
1297
 
1298
1298
  module.exports = nextConfig
1299
- `.trimStart();import*as zy from"@sentry/node";import*as jy from"@amplitude/analytics-node";async function sn(e){if(process.env.NODE_ENV!=="test")try{await Promise.allSettled([zy.flush(2e3),jy.flush().promise])}catch(t){console.error(t)}process.exit(e)}var En=process.env.AIR_HOST||"https://api.builder.io";import*as No from"@amplitude/analytics-node";import*as Mi from"@sentry/node";var ot=[];for(let e=0;e<256;++e)ot.push((e+256).toString(16).slice(1));function Uy(e,t=0){return(ot[e[t+0]]+ot[e[t+1]]+ot[e[t+2]]+ot[e[t+3]]+"-"+ot[e[t+4]]+ot[e[t+5]]+"-"+ot[e[t+6]]+ot[e[t+7]]+"-"+ot[e[t+8]]+ot[e[t+9]]+"-"+ot[e[t+10]]+ot[e[t+11]]+ot[e[t+12]]+ot[e[t+13]]+ot[e[t+14]]+ot[e[t+15]]).toLowerCase()}import R$ from"node:crypto";var Ta=new Uint8Array(256),Fa=Ta.length;function pl(){return Fa>Ta.length-16&&(R$.randomFillSync(Ta),Fa=0),Ta.slice(Fa,Fa+=16)}import I$ from"node:crypto";var dl={randomUUID:I$.randomUUID};function N$(e,t,r){if(dl.randomUUID&&!t&&!e)return dl.randomUUID();e=e||{};let n=e.random||(e.rng||pl)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Uy(n)}var fl=N$;var Pn=class extends Error{},Ht=class extends Pn{constructor({type:r,cause:n,message:o,suggestions:s=[],hostname:i,port:a,statusCode:u,errorCode:c}){super(o,{cause:n});Je(this,"type");Je(this,"suggestions");Je(this,"hostname");Je(this,"port");Je(this,"statusCode");Je(this,"errorCode");this.name="NetworkError",this.type=r,this.suggestions=s,this.hostname=i,this.port=a,this.statusCode=u,this.errorCode=c}};function ml(e,t,r){switch(e.code){case"ECONNREFUSED":return new Ht({type:"connection_refused",cause:e,message:`Connection refused to ${t}${r?`:${r}`:""}. The server may be down or unreachable.`,suggestions:["Check your internet connection","Try again in a few minutes - the service may be temporarily unavailable","Contact support if the issue persists"],hostname:t,port:r,errorCode:"ECONNREFUSED"});case"ETIMEDOUT":return new Ht({type:"connection_timeout",cause:e,message:`Connection timed out to ${t}${r?`:${r}`:""}. The request took too long to complete.`,suggestions:["Check your internet connection speed","Try again in a few minutes","Contact support if the issue persists"],hostname:t,port:r,errorCode:"ETIMEDOUT"});case"ENOTFOUND":return new Ht({type:"dns_not_found",cause:e,message:`Cannot resolve ${t}. The server address could not be found.`,suggestions:["Check your internet connection","Try again in a few minutes","Contact support if the issue persists"],hostname:t,errorCode:"ENOTFOUND"});default:return new Ht({type:"unknown",cause:e,message:`Network error connecting to ${t}: ${e.message}`,suggestions:["Check your internet connection","Try again in a few minutes","Contact support if the issue persists"],hostname:t,port:r})}}async function Bi(e,t){let r={...t,app:"dev-tools-cli",package:"cli"},n=await O$(),o=await M$();return await No.track(e,r,{user_id:n,device_id:o}).promise}var $a,gl;async function Vy(e){$a=e;let t=await wo();await lc({...t,userId:e})}async function O$(){if($a)return $a;let e=await wo(),t;return cc(e,"userId")&&(t=e.userId),$a=t,t}async function M$(){if(gl)return gl;let e=await wo(),t=fl();return cc(e,"deviceId")?t=e.deviceId:await lc({...e,deviceId:t}),gl=t,t}import{fetch as L$,Agent as z$}from"undici";var Hy="0.0.0";import yl from"node:process";import*as qy from"@sentry/node";var _n=class extends Error{constructor(r,n,o){super(r,o);Je(this,"code");this.name="CodeGenError",this.code=n}};var hl;function j$(){let e=yl.env.FUSION_REJECT_UNAUTHORIZED!=="0";return hl||(hl=new z$({connect:{rejectUnauthorized:e}})),hl}var jr=async(e,t)=>{let r=new URL(e),n=r.hostname,o=r.port?parseInt(r.port):void 0;try{let s=qy.getTraceData(),i=await L$(e,{...t,dispatcher:j$(),headers:{...t?.headers,...U$(),...s}});if(!i.ok){if(i.status===402){let a=await i.json(),u=a.code??"credits-limit-daily",c=a.message??"You've reached the DAY AI credits limit for your current plan.";throw new _n(c,u)}else if(i.status===429){let a=await i.json(),u=a.code??"credits-limit-other",c=a.message??"Rate limit exceeded. Please try again later.";throw new _n(c,u)}if(i.status>=500){let a;try{let u=await i.text();if(u)try{let c=JSON.parse(u);a=c.message||c.error||u}catch{a=u}}catch{}throw new Ht({type:"server_error",cause:a?new Error(a):void 0,message:`Server error from ${n} (HTTP ${i.status}). The server encountered an internal error.`,suggestions:["Try again in a few minutes - this may be a temporary issue","Contact support if the problem persists"],hostname:n,statusCode:i.status})}}return i}catch(s){if(s instanceof Ht||s instanceof _n||s instanceof Error&&s.name==="AbortError")throw s;if(s instanceof Error){if(s.name==="TypeError"&&s.cause instanceof Error){let c=s.cause;if(c.code)throw ml(c,n,o)}if(s.code)throw ml(s,n,o);if(s.message?.includes("SSL")||s.message?.includes("TLS")||s.message?.includes("certificate")||s.message?.includes("CERT"))throw new Ht({type:"ssl_error",cause:s,message:`SSL/TLS error connecting to ${n}. The connection could not be secured.`,suggestions:["Check your internet connection","Try again in a few minutes","Contact support@builder.io if the issue persists"],hostname:n})}let i=t?.method||"GET",a=s instanceof Error?s.message:String(s);throw new Ht({type:"unknown",cause:s instanceof Error?s:new Error(String(s)),message:`Network error for ${i} ${r.toString()}: ${a}`,suggestions:["Check your internet connection","Try again in a few minutes","Contact support if the issue persists"],hostname:n,port:o})}};function U$(){let t={darwin:"Macintosh",win32:"Windows NT",linux:"Linux",android:"Android",ios:"iPhone"}[yl.platform]||"Unknown",r=yl.platform==="win32"?"10.0":"";return{"User-Agent":`Mozilla/5.0 (${t}${r?"; "+r:""}) builder-cli/${Hy}`,"Sec-Ch-Ua-Platform":t}}import*as V$ from"@sentry/node";var Xr=Ue(Vn(),1);import PK from"chokidar";import AK from"ignore";var v=Ue(Vn(),1);function vl(e){switch(Bi("cli help",{subcommand:e}),console.log(""),vn((0,v.bgCyan)((0,v.bold)((0,v.white)(" help ")))+" "+(0,v.dim)(Zt)),e){case"add":case"generate":case"gen":case"g":vn(`${(0,v.cyan)("\u2192")} ${(0,v.bold)("Generate Figma Components")}
1299
+ `.trimStart();import*as jy from"@sentry/node";import*as Uy from"@amplitude/analytics-node";async function sn(e){if(process.env.NODE_ENV!=="test")try{await Promise.allSettled([jy.flush(2e3),Uy.flush().promise])}catch(t){console.error(t)}process.exit(e)}var En=process.env.AIR_HOST||"https://api.builder.io";import*as No from"@amplitude/analytics-node";import*as Mi from"@sentry/node";var it=[];for(let e=0;e<256;++e)it.push((e+256).toString(16).slice(1));function Vy(e,t=0){return(it[e[t+0]]+it[e[t+1]]+it[e[t+2]]+it[e[t+3]]+"-"+it[e[t+4]]+it[e[t+5]]+"-"+it[e[t+6]]+it[e[t+7]]+"-"+it[e[t+8]]+it[e[t+9]]+"-"+it[e[t+10]]+it[e[t+11]]+it[e[t+12]]+it[e[t+13]]+it[e[t+14]]+it[e[t+15]]).toLowerCase()}import IR from"node:crypto";var Fa=new Uint8Array(256),Ta=Fa.length;function dl(){return Ta>Fa.length-16&&(IR.randomFillSync(Fa),Ta=0),Fa.slice(Ta,Ta+=16)}import NR from"node:crypto";var fl={randomUUID:NR.randomUUID};function OR(e,t,r){if(fl.randomUUID&&!t&&!e)return fl.randomUUID();e=e||{};let n=e.random||(e.rng||dl)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Vy(n)}var ml=OR;var Pn=class extends Error{},De=class extends Pn{constructor({type:r,cause:n,message:o,suggestions:s=[],hostname:i,port:a,statusCode:u,errorCode:c}){super(o,{cause:n});Ye(this,"type");Ye(this,"suggestions");Ye(this,"hostname");Ye(this,"port");Ye(this,"statusCode");Ye(this,"errorCode");this.name="NetworkError",this.type=r,this.suggestions=s,this.hostname=i,this.port=a,this.statusCode=u,this.errorCode=c}},Ra=process.platform==="win32",MR=process.platform==="darwin";function LR(e){return Ra?`tracert ${e}`:`traceroute ${e}`}function BR(){return MR?"sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder":Ra?"ipconfig /flushdns":"sudo systemd-resolve --flush-caches"}function zR(e,t){return Ra?`Test-NetConnection -ComputerName ${e} -Port ${t}`:`nc -zv ${e} ${t}`}function jR(e){return Ra?`nslookup ${e}`:`dig ${e}`}function UR(e,t){return`openssl s_client -connect ${e}:${t} -showcerts`}var VR=new Set(["DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN"]),HR=new Set(["UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","INVALID_CA","CERT_SIGNATURE_FAILURE","CERT_REVOKED","CERT_REJECTED","CERT_UNTRUSTED","CERT_CHAIN_TOO_LONG","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","UNABLE_TO_DECRYPT_CERT_SIGNATURE","HOSTNAME_MISMATCH","ERR_TLS_CERT_ALTNAME_INVALID"]),qR=new Set(["CERT_HAS_EXPIRED","ERROR_IN_CERT_NOT_AFTER_FIELD"]),KR=new Set(["CERT_NOT_YET_VALID","ERROR_IN_CERT_NOT_BEFORE_FIELD"]),GR=new Set(["CRL_HAS_EXPIRED","CRL_NOT_YET_VALID","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD"]),WR=new Set(["ERR_TLS_INVALID_PROTOCOL_VERSION","ERR_TLS_INVALID_PROTOCOL_METHOD","ERR_TLS_PROTOCOL_VERSION_CONFLICT","ERR_TLS_INVALID_STATE","ERR_TLS_INVALID_CONTEXT","ERR_TLS_RENEGOTIATION_DISABLED","ERR_TLS_REQUIRED_SERVER_NAME","ERR_TLS_SESSION_ATTACK","ERR_TLS_SNI_FROM_SERVER","ERR_TLS_DH_PARAM_SIZE","ERR_SSL_WRONG_VERSION_NUMBER","EPROTO"]),ZR=new Set(["ERR_TLS_HANDSHAKE_TIMEOUT","ERR_SSL_HANDSHAKE_FAILURE"]),JR=new Set(["CRYPT_E_NO_REVOCATION_CHECK","CRYPT_E_REVOCATION_OFFLINE","CRYPT_E_NO_REVOCATION_DLL","CRYPT_E_NOT_IN_REVOCATION_DATABASE","UNABLE_TO_GET_CRL","CRL_SIGNATURE_FAILURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE"]),YR=new Set(["ERR_PROXY_INVALID_CONFIG","ERR_PROXY_TUNNEL","ERR_TUNNEL_CONNECTION_FAILED"]),QR=new Set(["ENETUNREACH","EHOSTUNREACH","ENETDOWN","ENONET"]);function gl(e,t,r){let n=e.code,o=`${t}${r?`:${r}`:""}`;if(n==="ECONNREFUSED"){let s=r||443;return new De({type:"connection_refused",cause:e,message:`Connection refused to ${o}. The server may be down or not accepting connections on this port.`,suggestions:["Verify the server is running and accepting connections",`Test if the port is reachable: ${zR(t,s)}`,"Check if a firewall is blocking the connection","Ensure the correct port number is being used","If using a proxy, verify proxy settings are correct","Try again in a few minutes - the service may be temporarily unavailable"],hostname:t,port:r,errorCode:n})}if(n==="ECONNRESET")return new De({type:"connection_reset",cause:e,message:`Connection to ${o} was reset. The server closed the connection unexpectedly.`,suggestions:["The server may have restarted or timed out - try again","Check if a proxy or firewall is terminating connections","If behind a corporate network, the connection may be blocked","Verify network stability - intermittent connectivity can cause resets","If using keep-alive connections, the server may have closed an idle connection"],hostname:t,port:r,errorCode:n});if(n==="ECONNABORTED")return new De({type:"connection_aborted",cause:e,message:`Connection to ${o} was aborted before completing.`,suggestions:["The request may have been interrupted - try again","Check for network instability or packet loss","If using a proxy, verify the proxy is functioning correctly","The server may have terminated the connection early"],hostname:t,port:r,errorCode:n});if(n==="ETIMEDOUT"||n==="ESOCKETTIMEDOUT"||n==="ERR_SOCKET_CONNECTION_TIMEOUT"||n==="ERR_HTTP_REQUEST_TIMEOUT")return new De({type:"connection_timeout",cause:e,message:`Connection to ${o} timed out. The server did not respond in time.`,suggestions:["Check your internet connection speed and stability","The server may be overloaded - try again in a few minutes","If behind a proxy, ensure the proxy is not causing delays","Corporate firewalls may be slowing or blocking the connection","Try using a different network (e.g., mobile hotspot) to isolate the issue"],hostname:t,port:r,errorCode:n});if(n==="ENOTFOUND"||n==="EAI_AGAIN")return new De({type:"dns_not_found",cause:e,message:`Cannot resolve hostname '${t}'. DNS lookup failed.`,suggestions:["Check your internet connection","Verify the hostname is spelled correctly",`Test DNS resolution: ${jR(t)}`,"Try using a different DNS server (e.g., 8.8.8.8 or 1.1.1.1)","If on a VPN, try disconnecting and reconnecting",`Flush your DNS cache: ${BR()}`],hostname:t,errorCode:n});if(n&&VR.has(n)){let s=r||443;return new De({type:"ssl_self_signed",cause:e,message:`SSL certificate error: The server at ${o} is using a self-signed certificate that is not trusted.`,suggestions:["If on a corporate network, add your company's CA certificate:"," \u2192 npm config set cafile /path/to/company-cert.pem"," \u2192 Or set NODE_EXTRA_CA_CERTS=/path/to/company-cert.pem","For Node.js 22+, use --use-system-ca flag if the CA is installed in your system",`Inspect the certificate: ${UR(t,s)}`,"Contact your IT department to get the corporate root CA certificate","If this is your server, consider using Let's Encrypt for free valid certificates","\u26A0\uFE0F Temporary workaround (not secure): npm config set strict-ssl false"],hostname:t,port:r,errorCode:n})}if(n&&qR.has(n))return new De({type:"ssl_certificate_expired",cause:e,message:`SSL certificate error: The certificate for ${o} has expired.`,suggestions:["Contact the server administrator to renew the SSL certificate","Check if your system clock is set correctly - incorrect time can cause certificate errors","If this is your server, renew the certificate immediately","This may indicate a security issue - proceed with caution"],hostname:t,port:r,errorCode:n});if(n&&KR.has(n))return new De({type:"ssl_certificate_not_yet_valid",cause:e,message:`SSL certificate error: The certificate for ${o} is not yet valid. The certificate's validity period has not started yet.`,suggestions:["Check if your system clock is set correctly - this is the most common cause","Verify your system date and time are accurate","If the clock is correct, wait until the certificate becomes valid","Contact the server administrator - they may have deployed a certificate too early"],hostname:t,port:r,errorCode:n});if(n&&GR.has(n)){let s=n==="CRL_HAS_EXPIRED",i=n==="CRL_NOT_YET_VALID";return new De({type:"ssl_certificate_invalid",cause:e,message:`SSL error: The Certificate Revocation List (CRL) for ${o} ${s?"has expired":i?"is not yet valid":"has invalid date fields"}. This means the revocation list is stale, not that the certificate itself has expired.`,suggestions:["This is often a server-side configuration issue - the server needs to update its CRL","Check if your system clock is set correctly - incorrect time can cause CRL validation errors","If behind a corporate proxy, the proxy may be caching an outdated CRL","Try again later - the server administrator may need to refresh the CRL","If on a corporate network, contact your IT department","\u26A0\uFE0F Temporary workaround (not secure): npm config set strict-ssl false"],hostname:t,port:r,errorCode:n})}if(n&&HR.has(n))return new De({type:"ssl_certificate_invalid",cause:e,message:`SSL certificate error: The certificate for ${o} could not be verified. ${XR(n)}`,suggestions:["If on a corporate network, add your company's CA certificate:"," \u2192 npm config set cafile /path/to/company-cert.pem"," \u2192 Or set NODE_EXTRA_CA_CERTS=/path/to/company-cert.pem","For Node.js 22+, use --use-system-ca flag if certificates are installed in your system","The server may be missing intermediate certificates in its chain","If behind a corporate proxy, contact IT for the proxy's root CA certificate","Verify you're connecting to the correct server (check for DNS hijacking)","\u26A0\uFE0F Temporary workaround (not secure): npm config set strict-ssl false"],hostname:t,port:r,errorCode:n});if(n&&ZR.has(n))return new De({type:"ssl_handshake_failed",cause:e,message:`SSL/TLS handshake with ${o} failed. Could not establish a secure connection.`,suggestions:["The server may be temporarily unavailable - try again","Check if a proxy or firewall is intercepting HTTPS traffic","Your corporate network may require specific certificates to be installed","The server may require a specific TLS version your client doesn't support","Try connecting from a different network to isolate the issue"],hostname:t,port:r,errorCode:n});if(n&&JR.has(n)){let s=n==="CRYPT_E_REVOCATION_OFFLINE";return new De({type:"ssl_certificate_invalid",cause:e,message:`Certificate revocation check failed for ${o}. ${s?"The revocation server is offline.":"Unable to verify certificate revocation status."}`,suggestions:["This is often a temporary issue - try again in a few minutes","The certificate revocation server (CRL/OCSP) may be unreachable","If on a corporate network, add your company's CA certificate:"," \u2192 npm config set cafile /path/to/company-cert.pem","Check if a firewall or proxy is blocking access to revocation servers","Contact your IT department for assistance with certificate configuration","\u26A0\uFE0F Temporary workaround (not secure): npm config set strict-ssl false"],hostname:t,port:r,errorCode:n})}return n&&WR.has(n)?new De({type:"ssl_protocol_error",cause:e,message:`SSL/TLS protocol error connecting to ${o}. ${e$(n)}`,suggestions:["The server may require a different TLS version (try TLS 1.2 or 1.3)","If behind a proxy, it may not support modern TLS protocols","Corporate firewalls sometimes downgrade TLS - contact your IT department","The server's SSL configuration may be outdated or misconfigured","Try updating Node.js to get the latest TLS support"],hostname:t,port:r,errorCode:n}):n&&YR.has(n)?new De({type:"proxy_error",cause:e,message:`Proxy error while connecting to ${o}. The proxy server could not establish a tunnel.`,suggestions:["Verify your proxy settings (HTTP_PROXY, HTTPS_PROXY environment variables)","Check if the proxy server is running and accessible","Ensure the proxy allows connections to the target host","Try bypassing the proxy by adding the host to NO_PROXY","Corporate proxies may require authentication - check credentials","The proxy may be blocking this specific destination"],hostname:t,port:r,errorCode:n}):n&&QR.has(n)?new De({type:"network_unreachable",cause:e,message:`Cannot reach ${o}. ${n==="EHOSTUNREACH"?"The host":"The network"} is unreachable.`,suggestions:["Check your internet connection is active","If on WiFi, try reconnecting to the network","VPN connection may have dropped - reconnect if using VPN","The destination network may be down or unreachable from your location","Check if a firewall is blocking outbound connections",`Diagnose the route: ${LR(t)}`],hostname:t,port:r,errorCode:n}):n==="EPIPE"?new De({type:"connection_reset",cause:e,message:`Broken pipe to ${o}. The connection was closed while data was being sent.`,suggestions:["The server closed the connection unexpectedly - try again","Check if the request payload is too large","Network instability may have caused the connection to drop","If using keep-alive, the server may have closed an idle connection"],hostname:t,port:r,errorCode:n}):n==="ERR_SOCKET_BAD_PORT"?new De({type:"socket_error",cause:e,message:`Invalid port number for ${t}. Port must be a number between 1 and 65535.`,suggestions:["Check your configuration for the correct port number","Ensure the port is a valid integer (1-65535)","Common ports: HTTP (80), HTTPS (443), custom services typically use 3000-9999","If using environment variables, verify they are set correctly"],hostname:t,port:r,errorCode:n}):n==="ERR_SOCKET_CLOSED"||n==="ERR_SOCKET_CLOSED_BEFORE_CONNECTION"?new De({type:"socket_error",cause:e,message:`Socket closed unexpectedly while connecting to ${o}.`,suggestions:["The connection was closed unexpectedly - try again","Check for network instability","The server may have rejected the connection"],hostname:t,port:r,errorCode:n}):new De({type:"unknown",cause:e,errorCode:n,message:`Network error connecting to ${o}: ${n?`[${n}] `:""}${e.message}`,suggestions:["Check your internet connection","If behind a proxy, verify proxy settings are correct","Try connecting from a different network","Check if a firewall or antivirus is blocking the connection","Try again in a few minutes - the service may be temporarily unavailable"],hostname:t,port:r})}function XR(e){return{UNABLE_TO_GET_ISSUER_CERT:"The certificate issuer could not be found.",UNABLE_TO_GET_ISSUER_CERT_LOCALLY:"The certificate issuer is not in the local trusted store.",UNABLE_TO_VERIFY_LEAF_SIGNATURE:"The first certificate in the chain could not be verified.",INVALID_CA:"The CA certificate is invalid.",CERT_SIGNATURE_FAILURE:"The certificate signature is invalid.",CERT_REVOKED:"The certificate has been revoked.",CERT_REJECTED:"The certificate was rejected.",CERT_UNTRUSTED:"The certificate is not trusted.",HOSTNAME_MISMATCH:"The certificate hostname does not match the requested hostname.",ERR_TLS_CERT_ALTNAME_INVALID:"The hostname is not in the certificate's subject alternative names."}[e]||""}function e$(e){return{ERR_TLS_INVALID_PROTOCOL_VERSION:"The TLS protocol version is not supported.",ERR_TLS_INVALID_PROTOCOL_METHOD:"The TLS protocol method is invalid.",ERR_TLS_PROTOCOL_VERSION_CONFLICT:"There is a conflict between TLS protocol versions.",EPROTO:"A protocol error occurred during the SSL/TLS handshake.",ERR_SSL_WRONG_VERSION_NUMBER:"SSL version number mismatch.",ERR_TLS_DH_PARAM_SIZE:"The Diffie-Hellman parameters are too small (insecure)."}[e]||""}async function Li(e,t){let r={...t,app:"dev-tools-cli",package:"cli"},n=await t$(),o=await r$();return await No.track(e,r,{user_id:n,device_id:o}).promise}var $a,hl;async function Hy(e){$a=e;let t=await wo();await pc({...t,userId:e})}async function t$(){if($a)return $a;let e=await wo(),t;return lc(e,"userId")&&(t=e.userId),$a=t,t}async function r$(){if(hl)return hl;let e=await wo(),t=ml();return lc(e,"deviceId")?t=e.deviceId:await pc({...e,deviceId:t}),hl=t,t}import{fetch as o$,Agent as i$}from"undici";var qy="0.0.0";import Dl from"node:process";import*as Ky from"@sentry/node";var _n=class extends Error{constructor(r,n,o){super(r,o);Ye(this,"code");this.name="CodeGenError",this.code=n}};var yl;function s$(){let e=Dl.env.FUSION_REJECT_UNAUTHORIZED!=="0";return yl||(yl=new i$({connect:{rejectUnauthorized:e}})),yl}var jr=async(e,t)=>{let r=new URL(e),n=r.hostname,o=r.port?parseInt(r.port):void 0;try{let s=Ky.getTraceData(),i=await o$(e,{...t,dispatcher:s$(),headers:{...t?.headers,...a$(),...s}});if(!i.ok){if(i.status===402){let a=await i.json(),u=a.code??"credits-limit-daily",c=a.message??"You've reached the DAY AI credits limit for your current plan.";throw new _n(c,u)}else if(i.status===429){let a=await i.json(),u=a.code??"credits-limit-other",c=a.message??"Rate limit exceeded. Please try again later.";throw new _n(c,u)}if(i.status>=500){let a;try{let u=await i.text();if(u)try{let c=JSON.parse(u);a=c.message||c.error||u}catch{a=u}}catch{}throw new De({type:"server_error",cause:a?new Error(a):void 0,message:`Server error from ${n} (HTTP ${i.status}). The server encountered an internal error.`,suggestions:["Try again in a few minutes - this may be a temporary issue","Contact support if the problem persists"],hostname:n,statusCode:i.status})}}return i}catch(s){if(s instanceof De||s instanceof _n||s instanceof Error&&s.name==="AbortError")throw s;if(s instanceof Error){if(s.name==="TypeError"&&s.cause instanceof Error){let c=s.cause;if(c.code)throw gl(c,n,o)}if(s.code)throw gl(s,n,o);if(s.message?.includes("SSL")||s.message?.includes("TLS")||s.message?.includes("certificate")||s.message?.includes("CERT"))throw new De({type:"ssl_certificate_invalid",cause:s,message:`SSL/TLS error connecting to ${n}. The connection could not be secured.`,suggestions:["Check if you're behind a corporate proxy that requires custom certificates","Set NODE_EXTRA_CA_CERTS to include your organization's CA certificate","For Node.js 22+, try the --use-system-ca flag if certificates are installed locally","Try again in a few minutes","Contact support@builder.io if the issue persists"],hostname:n})}let i=t?.method||"GET",a=s instanceof Error?s.message:String(s);throw new De({type:"unknown",cause:s instanceof Error?s:new Error(String(s)),message:`Network error for ${i} ${r.toString()}: ${a}`,suggestions:["Check your internet connection","Try again in a few minutes","Contact support if the issue persists"],hostname:n,port:o})}};function a$(){let t={darwin:"Macintosh",win32:"Windows NT",linux:"Linux",android:"Android",ios:"iPhone"}[Dl.platform]||"Unknown",r=Dl.platform==="win32"?"10.0":"";return{"User-Agent":`Mozilla/5.0 (${t}${r?"; "+r:""}) builder-cli/${qy}`,"Sec-Ch-Ua-Platform":t}}import*as u$ from"@sentry/node";var Xr=Ve(Vn(),1);import qK from"chokidar";import GK from"ignore";var v=Ve(Vn(),1);function Cl(e){switch(Li("cli help",{subcommand:e}),console.log(""),vn((0,v.bgCyan)((0,v.bold)((0,v.white)(" help ")))+" "+(0,v.dim)(Zt)),e){case"add":case"generate":case"gen":case"g":vn(`${(0,v.cyan)("\u2192")} ${(0,v.bold)("Generate Figma Components")}
1300
1300
 
1301
- ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} figma generate URL [URL ...] `))}
1301
+ ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} figma generate URL [URL ...] `))}
1302
1302
 
1303
1303
  Start the auto-mapping wizard for the Figma Component URLs pasted in.
1304
1304
 
@@ -1316,7 +1316,7 @@ ${(0,v.yellow)("Arguments:")}
1316
1316
  ${(0,v.cyan)("--skipInstallation")} Skip the package installation step
1317
1317
  ${(0,v.cyan)("--yes")} Auto-confirm all prompts`);break;case"auth":te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bold)("Authentication")}
1318
1318
 
1319
- ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} auth `))}
1319
+ ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} auth `))}
1320
1320
 
1321
1321
  Re-authenticate with Figma and Builder.io.
1322
1322
 
@@ -1332,7 +1332,7 @@ ${(0,v.yellow)("Non-Interactive Authentication:")}
1332
1332
  Example using environment variables:
1333
1333
  ${(0,v.dim)('export BUILDER_PRIVATE_KEY="your-private-key"')}
1334
1334
  ${(0,v.dim)('export FIGMA_PERSONAL_TOKEN="your-figma-token"')}
1335
- ${(0,v.dim)(`npx ${Re()} figma generate <url> --ci`)}
1335
+ ${(0,v.dim)(`npx ${Ie()} figma generate <url> --ci`)}
1336
1336
 
1337
1337
  ${(0,v.yellow)("Arguments:")}
1338
1338
  ${(0,v.cyan)("--figmaToken")} Figma access token for authentication
@@ -1348,17 +1348,17 @@ ${(0,v.yellow)("Learn More:")}
1348
1348
  ${(0,v.yellow)("Subcommands:")}
1349
1349
  ${(0,v.cyan)("status")} Check if you are authenticated and display user/space info
1350
1350
 
1351
- ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} auth status `))}
1351
+ ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} auth status `))}
1352
1352
 
1353
1353
  Check authentication status and user information.
1354
1354
 
1355
1355
  ${(0,v.yellow)("Clear Credentials:")}
1356
1356
 
1357
- ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} auth --reset `))}
1357
+ ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} auth --reset `))}
1358
1358
 
1359
1359
  Clear all stored credentials to logout or switch accounts.`);break;case"publish":te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bold)("Publish Mappings")}
1360
1360
 
1361
- ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} figma publish `))}
1361
+ ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} figma publish `))}
1362
1362
 
1363
1363
  Publish your Figma Mappings to Builder.io.
1364
1364
 
@@ -1371,7 +1371,7 @@ ${(0,v.yellow)("Arguments:")}
1371
1371
  ${(0,v.cyan)("--yes")} Auto-confirm all prompts
1372
1372
  ${(0,v.cyan)("--clearMappings")} Remove all mappings from the space, publishing zero mappings`);break;case"migrate":te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bold)("Migrate Mappings")}
1373
1373
 
1374
- ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} figma migrate `))}
1374
+ ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} figma migrate `))}
1375
1375
 
1376
1376
  Migrate your existing Figma Mappings into the repo as local files.
1377
1377
 
@@ -1383,7 +1383,7 @@ ${(0,v.yellow)("Arguments:")}
1383
1383
  ${(0,v.cyan)("--force")} Force migration even if there are warnings
1384
1384
  ${(0,v.cyan)("--yes")} Auto-confirm all prompts`);break;case"code":te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bold)("Code Generation")}
1385
1385
 
1386
- ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} code --url URL `))}
1386
+ ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} code --url URL `))}
1387
1387
 
1388
1388
  Generate or modify code based on Figma designs.
1389
1389
 
@@ -1401,7 +1401,7 @@ ${(0,v.yellow)("Configuration Files:")}
1401
1401
  ${(0,v.cyan)(".builderrules")} Add custom instructions that will be injected into the LLM prompt
1402
1402
  ${(0,v.cyan)(".cursorrules")} Cursor's settings are automatically supported for consistent behavior`);break;case"indexing":te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bold)("Code Indexing")}
1403
1403
 
1404
- ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} code indexing `))}
1404
+ ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} code indexing `))}
1405
1405
 
1406
1406
  Index your codebase to improve code generation results.
1407
1407
 
@@ -1409,7 +1409,7 @@ ${(0,v.yellow)("Arguments:")}
1409
1409
  ${(0,v.cyan)("--spaceId")} Builder.io space ID to use
1410
1410
  ${(0,v.cyan)("--cwd")} Working directory to run commands from`);break;case"index-repo":case"repo-index":te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bold)("Repository Indexing")}
1411
1411
 
1412
- ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} index-repo `))}
1412
+ ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} index-repo `))}
1413
1413
 
1414
1414
  Index your entire repository to improve code generation results.
1415
1415
 
@@ -1426,11 +1426,11 @@ ${(0,v.yellow)("Arguments:")}
1426
1426
  ${(0,v.cyan)("--instructions")} Add extra instructions to be taken into account during repo indexing
1427
1427
 
1428
1428
  ${(0,v.yellow)("Examples:")}
1429
- ${(0,v.cyan)(`npx ${Re()} index-repo`)} - Index entire repository
1430
- ${(0,v.cyan)(`npx ${Re()} index-repo --components "Button,Input,Card"`)} - Reindex specific components
1431
- ${(0,v.cyan)(`npx ${Re()} index-repo --components "Button" --force`)} - Force reindex Button component`);break;case"launch":case"fusion":te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bold)("Fusion Development Server")}
1429
+ ${(0,v.cyan)(`npx ${Ie()} index-repo`)} - Index entire repository
1430
+ ${(0,v.cyan)(`npx ${Ie()} index-repo --components "Button,Input,Card"`)} - Reindex specific components
1431
+ ${(0,v.cyan)(`npx ${Ie()} index-repo --components "Button" --force`)} - Force reindex Button component`);break;case"launch":case"fusion":te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bold)("Fusion Development Server")}
1432
1432
 
1433
- ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} launch -p <port> -c <command> `))}
1433
+ ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} launch -p <port> -c <command> `))}
1434
1434
 
1435
1435
  This command will:
1436
1436
  1. Run your development server command
@@ -1450,7 +1450,7 @@ ${(0,v.yellow)("Example:")}
1450
1450
  ${(0,v.yellow)("Note:")}
1451
1451
  - The proxy runs on port ${(0,v.cyan)("48752")} and the API server on port ${(0,v.cyan)("48753")}`);break;case"launch-init":vn(`${(0,v.cyan)("\u2192")} ${(0,v.bold)("Initialize Builder.io Repository")}
1452
1452
 
1453
- ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} init `))}
1453
+ ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} init `))}
1454
1454
 
1455
1455
  Clone and initialize a repository for use with Builder.io.
1456
1456
 
@@ -1460,7 +1460,7 @@ ${(0,v.yellow)("Arguments:")}
1460
1460
  ${(0,v.cyan)("--githubToken")} GitHub token for private repositories
1461
1461
  ${(0,v.cyan)("--installCommand")} Command to install dependencies (defaults to npm install)`);break;case"repo-connect":case"connect-repo":te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bold)("Connect Repository to Builder.io")}
1462
1462
 
1463
- ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} connect-repo `))}
1463
+ ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} connect-repo `))}
1464
1464
 
1465
1465
  Connect your existing git repository to Builder.io Fusion by creating a new project.
1466
1466
 
@@ -1488,26 +1488,26 @@ ${(0,v.yellow)("Features:")}
1488
1488
 
1489
1489
  ${(0,v.yellow)("Example:")}
1490
1490
  ${(0,v.cyan)("cd /path/to/your/project")}
1491
- ${(0,v.cyan)(`npx ${Re()} connect-repo`)}
1492
- ${(0,v.cyan)(`npx ${Re()} connect-repo --installCommand "pnpm install"`)}
1493
- ${(0,v.cyan)(`npx ${Re()} connect-repo --dryrun`)}
1491
+ ${(0,v.cyan)(`npx ${Ie()} connect-repo`)}
1492
+ ${(0,v.cyan)(`npx ${Ie()} connect-repo --installCommand "pnpm install"`)}
1493
+ ${(0,v.cyan)(`npx ${Ie()} connect-repo --dryrun`)}
1494
1494
 
1495
1495
  ${(0,v.yellow)("Note:")}
1496
1496
  - Must be run from within a git repository
1497
1497
  - Creates a new Fusion project with needSetup: true
1498
1498
  - Environment variables can be selected interactively
1499
1499
  - Use --dryrun to preview the configuration without creating the project`);break;case"figma":te.info(`${(0,v.bold)("Figma Commands:")}
1500
- `),[{command:"figma generate URL [URL ...]",description:"Start the auto-mapping wizard for Figma Component URLs"},{command:"figma publish",description:"Publish your Figma Mappings to Builder.io"},{command:"figma migrate",description:"Migrate existing Figma Mappings into the repo as local files"},{command:"figma auth",description:"Authenticate with Figma and Builder.io"}].forEach(({command:n,description:o})=>{te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} ${n} `))}
1500
+ `),[{command:"figma generate URL [URL ...]",description:"Start the auto-mapping wizard for Figma Component URLs"},{command:"figma publish",description:"Publish your Figma Mappings to Builder.io"},{command:"figma migrate",description:"Migrate existing Figma Mappings into the repo as local files"},{command:"figma auth",description:"Authenticate with Figma and Builder.io"}].forEach(({command:n,description:o})=>{te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} ${n} `))}
1501
1501
  ${(0,v.dim)(o)}
1502
1502
  `)}),te.info(`For detailed help about a specific command, run:
1503
- ${(0,v.cyan)(`npx ${Re()} figma <command> --help`)}`);break;default:te.info(`${(0,v.bold)("Available Commands:")}
1504
- `),[{command:"launch",description:"Launch Builder Fusion development server"},{command:"auth",description:"Authenticate with Builder.io"},{command:"index-repo",description:"Index your design system repository for AI code generation"},{command:"connect-repo",description:"Connect your git repository to Builder.io Fusion"},{command:"code",description:"Generate or modify code based on Figma designs"},{command:"figma generate",description:"Start the auto-mapping wizard for Figma Component URLs"},{command:"figma publish",description:"Publish your Figma Mappings to Builder.io"},{command:"figma migrate",description:"Migrate existing Figma Mappings into the repo as local files"},{command:"add",description:"Add a component to your project"}].forEach(({command:n,description:o})=>{te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bgGreen)((0,v.white)(` npx ${Re()} ${n} `))}
1503
+ ${(0,v.cyan)(`npx ${Ie()} figma <command> --help`)}`);break;default:te.info(`${(0,v.bold)("Available Commands:")}
1504
+ `),[{command:"launch",description:"Launch Builder Fusion development server"},{command:"auth",description:"Authenticate with Builder.io"},{command:"index-repo",description:"Index your design system repository for AI code generation"},{command:"connect-repo",description:"Connect your git repository to Builder.io Fusion"},{command:"code",description:"Generate or modify code based on Figma designs"},{command:"figma generate",description:"Start the auto-mapping wizard for Figma Component URLs"},{command:"figma publish",description:"Publish your Figma Mappings to Builder.io"},{command:"figma migrate",description:"Migrate existing Figma Mappings into the repo as local files"},{command:"add",description:"Add a component to your project"}].forEach(({command:n,description:o})=>{te.info(`${(0,v.cyan)("\u2192")} ${(0,v.bgGreen)((0,v.white)(` npx ${Ie()} ${n} `))}
1505
1505
  ${(0,v.dim)(o)}
1506
1506
  `)}),te.info(`For detailed help about a specific command, run:
1507
- ${(0,v.cyan)(`npx ${Re()} <command> --help`)}`)}pa("bye \u{1F44B}")}var G$=["steve8708/mui-vite","steve8708/carbon-vite","steve8708/vite-react-shopify-polaris","steve8708/cloudscape-demos","BuilderIO/fusion-angular-tailwind-starter","BuilderIO/fusion-svelte-tailwind-starter","BuilderIO/fusion-vue-tailwind-starter"],W$="BuilderIO/fusion-starter",Cl=[...G$,W$],zK=Cl.map(e=>`https://github.com/${e}`);function an(){}an.prototype={diff:function(t,r){var n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.callback;typeof o=="function"&&(s=o,o={}),this.options=o;var i=this;function a(_){return s?(setTimeout(function(){s(void 0,_)},0),!0):_}t=this.castInput(t),r=this.castInput(r),t=this.removeEmpty(this.tokenize(t)),r=this.removeEmpty(this.tokenize(r));var u=r.length,c=t.length,l=1,p=u+c;o.maxEditLength&&(p=Math.min(p,o.maxEditLength));var d=(n=o.timeout)!==null&&n!==void 0?n:1/0,g=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(m[0],r,t,0);if(m[0].oldPos+1>=c&&f+1>=u)return a([{value:this.join(r),count:r.length}]);var h=-1/0,y=1/0;function b(){for(var _=Math.max(h,-l);_<=Math.min(y,l);_+=2){var S=void 0,T=m[_-1],k=m[_+1];T&&(m[_-1]=void 0);var I=!1;if(k){var R=k.oldPos-_;I=k&&0<=R&&R<u}var $=T&&T.oldPos+1<c;if(!I&&!$){m[_]=void 0;continue}if(!$||I&&T.oldPos+1<k.oldPos?S=i.addToPath(k,!0,void 0,0):S=i.addToPath(T,void 0,!0,1),f=i.extractCommon(S,r,t,_),S.oldPos+1>=c&&f+1>=u)return a(Z$(i,S.lastComponent,r,t,i.useLongestToken));m[_]=S,S.oldPos+1>=c&&(y=Math.min(y,_-1)),f+1>=u&&(h=Math.max(h,_+1))}l++}if(s)(function _(){setTimeout(function(){if(l>p||Date.now()>g)return s();b()||_()},0)})();else for(;l<=p&&Date.now()<=g;){var C=b();if(C)return C}},addToPath:function(t,r,n,o){var s=t.lastComponent;return s&&s.added===r&&s.removed===n?{oldPos:t.oldPos+o,lastComponent:{count:s.count+1,added:r,removed:n,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:r,removed:n,previousComponent:s}}},extractCommon:function(t,r,n,o){for(var s=r.length,i=n.length,a=t.oldPos,u=a-o,c=0;u+1<s&&a+1<i&&this.equals(r[u+1],n[a+1]);)u++,a++,c++;return c&&(t.lastComponent={count:c,previousComponent:t.lastComponent}),t.oldPos=a,u},equals:function(t,r){return this.options.comparator?this.options.comparator(t,r):t===r||this.options.ignoreCase&&t.toLowerCase()===r.toLowerCase()},removeEmpty:function(t){for(var r=[],n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function Z$(e,t,r,n,o){for(var s=[],i;t;)s.push(t),i=t.previousComponent,delete t.previousComponent,t=i;s.reverse();for(var a=0,u=s.length,c=0,l=0;a<u;a++){var p=s[a];if(p.removed){if(p.value=e.join(n.slice(l,l+p.count)),l+=p.count,a&&s[a-1].added){var g=s[a-1];s[a-1]=s[a],s[a]=g}}else{if(!p.added&&o){var d=r.slice(c,c+p.count);d=d.map(function(f,h){var y=n[l+h];return y.length>f.length?y:f}),p.value=e.join(d)}else p.value=e.join(r.slice(c,c+p.count));c+=p.count,p.added||(l+=p.count)}}var m=s[u-1];return u>1&&typeof m.value=="string"&&(m.added||m.removed)&&e.equals("",m.value)&&(s[u-2].value+=m.value,s.pop()),s}var eG=new an;var Wy=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Zy=/\S/,Jy=new an;Jy.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Zy.test(e)&&!Zy.test(t)};Jy.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),r=0;r<t.length-1;r++)!t[r+1]&&t[r+2]&&Wy.test(t[r])&&Wy.test(t[r+2])&&(t[r]+=t[r+2],t.splice(r+1,2),r--);return t};var Yy=new an;Yy.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
1508
- `));var t=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var n=0;n<r.length;n++){var o=r[n];n%2&&!this.options.newlineIsToken?t[t.length-1]+=o:(this.options.ignoreWhitespace&&(o=o.trim()),t.push(o))}return t};var J$=new an;J$.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Y$=new an;Y$.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function ka(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ka=function(t){return typeof t}:ka=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ka(e)}var Q$=Object.prototype.toString,ji=new an;ji.useLongestToken=!0;ji.tokenize=Yy.tokenize;ji.castInput=function(e){var t=this.options,r=t.undefinedReplacement,n=t.stringifyReplacer,o=n===void 0?function(s,i){return typeof i>"u"?r:i}:n;return typeof e=="string"?e:JSON.stringify(bl(e,null,null,o),o," ")};ji.equals=function(e,t){return an.prototype.equals.call(ji,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function bl(e,t,r,n,o){t=t||[],r=r||[],n&&(e=n(o,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return r[s];var i;if(Q$.call(e)==="[object Array]"){for(t.push(e),i=new Array(e.length),r.push(i),s=0;s<e.length;s+=1)i[s]=bl(e[s],t,r,n,o);return t.pop(),r.pop(),i}if(e&&e.toJSON&&(e=e.toJSON()),ka(e)==="object"&&e!==null){t.push(e),i={},r.push(i);var a=[],u;for(u in e)e.hasOwnProperty(u)&&a.push(u);for(a.sort(),s=0;s<a.length;s+=1)u=a[s],i[u]=bl(e[u],t,r,n,u);t.pop(),r.pop()}else i=e;return i}var wl=new an;wl.tokenize=function(e){return e.slice()};wl.join=wl.removeEmpty=function(e){return e};function Ra(){let e=new Error("AbortError");return e.name="AbortError",e}var El=Ue(oD(),1);import*as sk from"@sentry/node";var Pl=class{constructor(){Je(this,"processes",new Set);Je(this,"cleanupHandlersRegistered",!1);this.registerCleanupHandlers()}track(t){this.processes.add(t),t.on("exit",()=>{this.processes.delete(t)})}untrack(t){this.processes.delete(t)}async killAll(t){if(this.processes.size===0)return;let r=[];for(let n of this.processes)n.pid&&n.exitCode===null&&r.push(Ia(t,n));await Promise.all(r),this.processes.clear()}registerCleanupHandlers(){if(this.cleanupHandlersRegistered)return;this.cleanupHandlersRegistered=!0;let t=async r=>{try{await this.killAll()}catch(n){console.error("[ProcessTracker] Error during cleanup:",n)}};process.on("SIGINT",()=>t("SIGINT")),process.on("SIGTERM",()=>t("SIGTERM")),process.on("SIGHUP",()=>t("SIGHUP")),process.on("exit",()=>{for(let r of this.processes)if(r.pid&&r.exitCode===null)try{process.kill(r.pid,"SIGKILL")}catch{}})}get count(){return this.processes.size}},RG=new Pl;function ak(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}async function Ia(e,t,r,n=5e3){if(typeof t!="number"&&(!t||(Sl(t)?t.getExitCode()!==null:t.exitCode!==null)))return null;if(r?.aborted)return Ra();let o=new Promise((a,u)=>{r?.addEventListener("abort",()=>{u(new Error("killProcess aborted by the user"))},{once:!0})}),s,i;if(typeof t=="number"?s=t:(i=t,s=Sl(i)?i.getPid():i.pid),!s){if(e?.Sentry?.captureMessage("killProcess: no pid (process never spawned or already exited)",{level:"info",extra:{procType:i?Sl(i)?"DevCommandProcess":"ChildProcess":"number"}}),i)try{i.kill("SIGKILL")}catch{}return null}try{return await Promise.race([await new Promise((a,u)=>(0,El.default)(s,"SIGTERM",c=>{c?u(c):a()})),new Promise((a,u)=>setTimeout(()=>u(new Error("SIGTERM killProcess timeout")),n)),o]),null}catch(a){if(a.code==="ESRCH")return null;e?.Sentry?.captureException(a,{level:"warning"});try{return await Promise.race([await new Promise((u,c)=>(0,El.default)(s,"SIGKILL",l=>{l?c(l):u()})),new Promise((u,c)=>setTimeout(()=>c(new Error("SIGKILL killProcess timeout")),n)),o]),null}catch(u){return u.code==="ESRCH"||!ak(s)?null:(e?.Sentry?.captureException(u,{level:"warning"}),u instanceof Error?u:new Error("killProcess: failed to kill process: "+String(u)))}}finally{i&&i.removeAllListeners()}}var Sl=e=>"type"in e;import Sie from"chokidar";var _R=Ue(Hl(),1);var ER=Ue(Hl(),1);var LW=process.platform==="win32"?"C:\\Windows\\System32\\drivers\\etc\\hosts":"/etc/hosts";var c1=Ue(nC(),1);var u1=Ue(fC(),1),mC="/_builder.io",iZ=mC+"/api";var cZ=new(G("https")).Agent({rejectUnauthorized:!1});import*as m1 from"@sentry/node";var uJ=Object.freeze({status:"aborted"});function A(e,t,r){function n(a,u){var c;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(c=a._zod).traits??(c.traits=new Set),a._zod.traits.add(e),t(a,u);for(let l in i.prototype)l in a||Object.defineProperty(a,l,{value:i.prototype[l].bind(a)});a._zod.constr=i,a._zod.def=u}let o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var u;let c=r?.Parent?new s:this;n(c,a),(u=c._zod).deferred??(u.deferred=[]);for(let l of c._zod.deferred)l();return c}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}var cJ=Symbol("zod_brand"),cn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ya={};function sr(e){return e&&Object.assign(Ya,e),Ya}var me={};Lm(me,{BIGINT_FORMAT_RANGES:()=>DC,Class:()=>vp,NUMBER_FORMAT_RANGES:()=>_p,aborted:()=>oo,allowsEval:()=>Sp,assert:()=>v1,assertEqual:()=>g1,assertIs:()=>y1,assertNever:()=>D1,assertNotEqual:()=>h1,assignProp:()=>xp,cached:()=>Qi,captureStackTrace:()=>Xa,cleanEnum:()=>k1,cleanRegex:()=>es,clone:()=>qr,createTransparentProxy:()=>E1,defineLazy:()=>xe,esc:()=>no,escapeRegex:()=>Fn,extend:()=>A1,finalizeIssue:()=>Cr,floatSafeRemainder:()=>wp,getElementAtPath:()=>C1,getEnumValues:()=>Cp,getLengthableOrigin:()=>ts,getParsedType:()=>S1,getSizableOrigin:()=>vC,isObject:()=>qo,isPlainObject:()=>Ko,issue:()=>Ap,joinValues:()=>Qa,jsonStringifyReplacer:()=>bp,merge:()=>F1,normalizeParams:()=>j,nullish:()=>Xi,numKeys:()=>x1,omit:()=>_1,optionalKeys:()=>Pp,partial:()=>T1,pick:()=>P1,prefixIssues:()=>Kr,primitiveTypes:()=>yC,promiseAllObject:()=>b1,propertyKeyTypes:()=>Ep,randomString:()=>w1,required:()=>$1,stringifyPrimitive:()=>eu,unwrapMessage:()=>Yi});function g1(e){return e}function h1(e){return e}function y1(e){}function D1(e){throw new Error}function v1(e){}function Cp(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Qa(e,t="|"){return e.map(r=>eu(r)).join(t)}function bp(e,t){return typeof t=="bigint"?t.toString():t}function Qi(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Xi(e){return e==null}function es(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function wp(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}function xe(e,t,r){Object.defineProperty(e,t,{get(){{let o=r();return e[t]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function xp(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function C1(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function b1(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<t.length;s++)o[t[s]]=n[s];return o})}function w1(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function no(e){return JSON.stringify(e)}var Xa=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function qo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Sp=Qi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ko(e){if(qo(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(qo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function x1(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var S1=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ep=new Set(["string","number","symbol"]),yC=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Fn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qr(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function j(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function E1(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,s){return t??(t=e()),Reflect.set(t,n,o,s)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function eu(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Pp(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var _p={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},DC={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function P1(e,t){let r={},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(r[o]=n.shape[o])}return qr(e,{...e._zod.def,shape:r,checks:[]})}function _1(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete r[o]}return qr(e,{...e._zod.def,shape:r,checks:[]})}function A1(e,t){if(!Ko(t))throw new Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return xp(this,"shape",n),n},checks:[]};return qr(e,r)}function F1(e,t){return qr(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return xp(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function T1(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=e?new e({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=e?new e({type:"optional",innerType:n[s]}):n[s];return qr(t,{...t._zod.def,shape:o,checks:[]})}function $1(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new e({type:"nonoptional",innerType:n[s]});return qr(t,{...t._zod.def,shape:o,checks:[]})}function oo(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Kr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Yi(e){return typeof e=="string"?e:e?.message}function Cr(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Yi(e.inst?._zod.def?.error?.(e))??Yi(t?.error?.(e))??Yi(r.customError?.(e))??Yi(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function vC(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ts(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ap(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function k1(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var vp=class{constructor(...t){}};var CC=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,bp,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},tu=A("$ZodError",CC),Fp=A("$ZodError",CC,{Parent:Error});function bC(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function wC(e,t){let r=t||function(s){return s.message},n={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)n._errors.push(r(i));else{let a=n,u=0;for(;u<i.path.length;){let c=i.path[u];u===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(i))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return o(e),n}var xC=e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new cn;if(i.issues.length){let a=new(o?.Err??e)(i.issues.map(u=>Cr(u,s,sr())));throw Xa(a,o?.callee),a}return i.value};var SC=e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(o?.Err??e)(i.issues.map(u=>Cr(u,s,sr())));throw Xa(a,o?.callee),a}return i.value};var Tp=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new cn;return s.issues.length?{success:!1,error:new(e??tu)(s.issues.map(i=>Cr(i,o,sr())))}:{success:!0,data:s.value}},EC=Tp(Fp),$p=e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>Cr(i,o,sr())))}:{success:!0,data:s.value}},PC=$p(Fp);var _C=/^[cC][^\s-]{8,}$/,AC=/^[0-9a-z]+$/,FC=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,TC=/^[0-9a-vA-V]{20}$/,$C=/^[A-Za-z0-9]{27}$/,kC=/^[a-zA-Z0-9_-]{21}$/,RC=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var IC=/^([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})$/,kp=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;var NC=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var I1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function OC(){return new RegExp(I1,"u")}var MC=/^(?:(?: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])$/,BC=/^(([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})$/,LC=/^((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])$/,zC=/^(([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])$/,jC=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Rp=/^[A-Za-z0-9_-]*$/,UC=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var VC=/^\+(?:[0-9]){6,14}[0-9]$/,HC="(?:(?:\\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])))",qC=new RegExp(`^${HC}$`);function KC(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function GC(e){return new RegExp(`^${KC(e)}$`)}function WC(e){let t=KC({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${HC}T(?:${n})$`)}var ZC=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var JC=/^\d+$/,YC=/^-?\d+(?:\.\d+)?/i,QC=/true|false/i,XC=/null/i;var eb=/^[^A-Z]*$/,tb=/^[^a-z]*$/;var gt=A("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),rb={number:"number",bigint:"bigint",object:"date"},Np=A("$ZodCheckLessThan",(e,t)=>{gt.init(e,t);let r=rb[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Op=A("$ZodCheckGreaterThan",(e,t)=>{gt.init(e,t);let r=rb[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nb=A("$ZodCheckMultipleOf",(e,t)=>{gt.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):wp(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ob=A("$ZodCheckNumberFormat",(e,t)=>{gt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=_p[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=o,a.maximum=s,r&&(a.pattern=JC)}),e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:e})}});var ib=A("$ZodCheckMaxLength",(e,t)=>{var r;gt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Xi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let o=n.value;if(o.length<=t.maximum)return;let i=ts(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),sb=A("$ZodCheckMinLength",(e,t)=>{var r;gt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Xi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let i=ts(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ab=A("$ZodCheckLengthEquals",(e,t)=>{var r;gt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Xi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{let o=n.value,s=o.length;if(s===t.length)return;let i=ts(o),a=s>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),rs=A("$ZodCheckStringFormat",(e,t)=>{var r,n;gt.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),ub=A("$ZodCheckRegex",(e,t)=>{rs.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),cb=A("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=eb),rs.init(e,t)}),lb=A("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tb),rs.init(e,t)}),pb=A("$ZodCheckIncludes",(e,t)=>{gt.init(e,t);let r=Fn(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),db=A("$ZodCheckStartsWith",(e,t)=>{gt.init(e,t);let r=new RegExp(`^${Fn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),fb=A("$ZodCheckEndsWith",(e,t)=>{gt.init(e,t);let r=new RegExp(`.*${Fn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var mb=A("$ZodCheckOverwrite",(e,t)=>{gt.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var ru=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
1507
+ ${(0,v.cyan)(`npx ${Ie()} <command> --help`)}`)}pa("bye \u{1F44B}")}var d$=["steve8708/mui-vite","steve8708/carbon-vite","steve8708/vite-react-shopify-polaris","steve8708/cloudscape-demos","BuilderIO/fusion-angular-tailwind-starter","BuilderIO/fusion-svelte-tailwind-starter","BuilderIO/fusion-vue-tailwind-starter"],f$="BuilderIO/fusion-starter",bl=[...d$,f$],iG=bl.map(e=>`https://github.com/${e}`);function an(){}an.prototype={diff:function(t,r){var n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.callback;typeof o=="function"&&(s=o,o={}),this.options=o;var i=this;function a(_){return s?(setTimeout(function(){s(void 0,_)},0),!0):_}t=this.castInput(t),r=this.castInput(r),t=this.removeEmpty(this.tokenize(t)),r=this.removeEmpty(this.tokenize(r));var u=r.length,c=t.length,l=1,p=u+c;o.maxEditLength&&(p=Math.min(p,o.maxEditLength));var d=(n=o.timeout)!==null&&n!==void 0?n:1/0,g=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(m[0],r,t,0);if(m[0].oldPos+1>=c&&f+1>=u)return a([{value:this.join(r),count:r.length}]);var h=-1/0,y=1/0;function b(){for(var _=Math.max(h,-l);_<=Math.min(y,l);_+=2){var S=void 0,F=m[_-1],$=m[_+1];F&&(m[_-1]=void 0);var I=!1;if($){var k=$.oldPos-_;I=$&&0<=k&&k<u}var R=F&&F.oldPos+1<c;if(!I&&!R){m[_]=void 0;continue}if(!R||I&&F.oldPos+1<$.oldPos?S=i.addToPath($,!0,void 0,0):S=i.addToPath(F,void 0,!0,1),f=i.extractCommon(S,r,t,_),S.oldPos+1>=c&&f+1>=u)return a(m$(i,S.lastComponent,r,t,i.useLongestToken));m[_]=S,S.oldPos+1>=c&&(y=Math.min(y,_-1)),f+1>=u&&(h=Math.max(h,_+1))}l++}if(s)(function _(){setTimeout(function(){if(l>p||Date.now()>g)return s();b()||_()},0)})();else for(;l<=p&&Date.now()<=g;){var C=b();if(C)return C}},addToPath:function(t,r,n,o){var s=t.lastComponent;return s&&s.added===r&&s.removed===n?{oldPos:t.oldPos+o,lastComponent:{count:s.count+1,added:r,removed:n,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:r,removed:n,previousComponent:s}}},extractCommon:function(t,r,n,o){for(var s=r.length,i=n.length,a=t.oldPos,u=a-o,c=0;u+1<s&&a+1<i&&this.equals(r[u+1],n[a+1]);)u++,a++,c++;return c&&(t.lastComponent={count:c,previousComponent:t.lastComponent}),t.oldPos=a,u},equals:function(t,r){return this.options.comparator?this.options.comparator(t,r):t===r||this.options.ignoreCase&&t.toLowerCase()===r.toLowerCase()},removeEmpty:function(t){for(var r=[],n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function m$(e,t,r,n,o){for(var s=[],i;t;)s.push(t),i=t.previousComponent,delete t.previousComponent,t=i;s.reverse();for(var a=0,u=s.length,c=0,l=0;a<u;a++){var p=s[a];if(p.removed){if(p.value=e.join(n.slice(l,l+p.count)),l+=p.count,a&&s[a-1].added){var g=s[a-1];s[a-1]=s[a],s[a]=g}}else{if(!p.added&&o){var d=r.slice(c,c+p.count);d=d.map(function(f,h){var y=n[l+h];return y.length>f.length?y:f}),p.value=e.join(d)}else p.value=e.join(r.slice(c,c+p.count));c+=p.count,p.added||(l+=p.count)}}var m=s[u-1];return u>1&&typeof m.value=="string"&&(m.added||m.removed)&&e.equals("",m.value)&&(s[u-2].value+=m.value,s.pop()),s}var vG=new an;var Zy=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Jy=/\S/,Yy=new an;Yy.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Jy.test(e)&&!Jy.test(t)};Yy.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),r=0;r<t.length-1;r++)!t[r+1]&&t[r+2]&&Zy.test(t[r])&&Zy.test(t[r+2])&&(t[r]+=t[r+2],t.splice(r+1,2),r--);return t};var Qy=new an;Qy.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
1508
+ `));var t=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var n=0;n<r.length;n++){var o=r[n];n%2&&!this.options.newlineIsToken?t[t.length-1]+=o:(this.options.ignoreWhitespace&&(o=o.trim()),t.push(o))}return t};var g$=new an;g$.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var h$=new an;h$.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function ka(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ka=function(t){return typeof t}:ka=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ka(e)}var y$=Object.prototype.toString,ji=new an;ji.useLongestToken=!0;ji.tokenize=Qy.tokenize;ji.castInput=function(e){var t=this.options,r=t.undefinedReplacement,n=t.stringifyReplacer,o=n===void 0?function(s,i){return typeof i>"u"?r:i}:n;return typeof e=="string"?e:JSON.stringify(wl(e,null,null,o),o," ")};ji.equals=function(e,t){return an.prototype.equals.call(ji,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function wl(e,t,r,n,o){t=t||[],r=r||[],n&&(e=n(o,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return r[s];var i;if(y$.call(e)==="[object Array]"){for(t.push(e),i=new Array(e.length),r.push(i),s=0;s<e.length;s+=1)i[s]=wl(e[s],t,r,n,o);return t.pop(),r.pop(),i}if(e&&e.toJSON&&(e=e.toJSON()),ka(e)==="object"&&e!==null){t.push(e),i={},r.push(i);var a=[],u;for(u in e)e.hasOwnProperty(u)&&a.push(u);for(a.sort(),s=0;s<a.length;s+=1)u=a[s],i[u]=wl(e[u],t,r,n,u);t.pop(),r.pop()}else i=e;return i}var xl=new an;xl.tokenize=function(e){return e.slice()};xl.join=xl.removeEmpty=function(e){return e};function Ia(){let e=new Error("AbortError");return e.name="AbortError",e}var Pl=Ve(iD(),1);import*as E$ from"@sentry/node";var _l=class{constructor(){Ye(this,"processes",new Set);Ye(this,"cleanupHandlersRegistered",!1);this.registerCleanupHandlers()}track(t){this.processes.add(t),t.on("exit",()=>{this.processes.delete(t)})}untrack(t){this.processes.delete(t)}async killAll(t){if(this.processes.size===0)return;let r=[];for(let n of this.processes)n.pid&&n.exitCode===null&&r.push(Na(t,n));await Promise.all(r),this.processes.clear()}registerCleanupHandlers(){if(this.cleanupHandlersRegistered)return;this.cleanupHandlersRegistered=!0;let t=async r=>{try{await this.killAll()}catch(n){console.error("[ProcessTracker] Error during cleanup:",n)}};process.on("SIGINT",()=>t("SIGINT")),process.on("SIGTERM",()=>t("SIGTERM")),process.on("SIGHUP",()=>t("SIGHUP")),process.on("exit",()=>{for(let r of this.processes)if(r.pid&&r.exitCode===null)try{process.kill(r.pid,"SIGKILL")}catch{}})}get count(){return this.processes.size}},QG=new _l;function P$(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}async function Na(e,t,r,n=5e3){if(typeof t!="number"&&(!t||(El(t)?t.getExitCode()!==null:t.exitCode!==null)))return null;if(r?.aborted)return Ia();let o=new Promise((a,u)=>{r?.addEventListener("abort",()=>{u(new Error("killProcess aborted by the user"))},{once:!0})}),s,i;if(typeof t=="number"?s=t:(i=t,s=El(i)?i.getPid():i.pid),!s){if(e?.Sentry?.captureMessage("killProcess: no pid (process never spawned or already exited)",{level:"info",extra:{procType:i?El(i)?"DevCommandProcess":"ChildProcess":"number"}}),i)try{i.kill("SIGKILL")}catch{}return null}try{return await Promise.race([await new Promise((a,u)=>(0,Pl.default)(s,"SIGTERM",c=>{c?u(c):a()})),new Promise((a,u)=>setTimeout(()=>u(new Error("SIGTERM killProcess timeout")),n)),o]),null}catch(a){if(a.code==="ESRCH")return null;e?.Sentry?.captureException(a,{level:"warning"});try{return await Promise.race([await new Promise((u,c)=>(0,Pl.default)(s,"SIGKILL",l=>{l?c(l):u()})),new Promise((u,c)=>setTimeout(()=>c(new Error("SIGKILL killProcess timeout")),n)),o]),null}catch(u){return u.code==="ESRCH"||!P$(s)?null:(e?.Sentry?.captureException(u,{level:"warning"}),u instanceof Error?u:new Error("killProcess: failed to kill process: "+String(u)))}}finally{i&&i.removeAllListeners()}}var El=e=>"type"in e;import Vie from"chokidar";var Kk=Ve(ql(),1);var Hk=Ve(ql(),1);var oZ=process.platform==="win32"?"C:\\Windows\\System32\\drivers\\etc\\hosts":"/etc/hosts";var A1=Ve(oC(),1);var _1=Ve(mC(),1),gC="/_builder.io",SZ=gC+"/api";var AZ=new(G("https")).Agent({rejectUnauthorized:!1});import*as k1 from"@sentry/node";var _J=Object.freeze({status:"aborted"});function A(e,t,r){function n(a,u){var c;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(c=a._zod).traits??(c.traits=new Set),a._zod.traits.add(e),t(a,u);for(let l in i.prototype)l in a||Object.defineProperty(a,l,{value:i.prototype[l].bind(a)});a._zod.constr=i,a._zod.def=u}let o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var u;let c=r?.Parent?new s:this;n(c,a),(u=c._zod).deferred??(u.deferred=[]);for(let l of c._zod.deferred)l();return c}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}var AJ=Symbol("zod_brand"),cn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Qa={};function sr(e){return e&&Object.assign(Qa,e),Qa}var me={};zm(me,{BIGINT_FORMAT_RANGES:()=>vC,Class:()=>Cp,NUMBER_FORMAT_RANGES:()=>Ap,aborted:()=>oo,allowsEval:()=>Ep,assert:()=>L1,assertEqual:()=>I1,assertIs:()=>O1,assertNever:()=>M1,assertNotEqual:()=>N1,assignProp:()=>Sp,cached:()=>Qi,captureStackTrace:()=>eu,cleanEnum:()=>Y1,cleanRegex:()=>es,clone:()=>qr,createTransparentProxy:()=>H1,defineLazy:()=>Se,esc:()=>no,escapeRegex:()=>Tn,extend:()=>G1,finalizeIssue:()=>Cr,floatSafeRemainder:()=>xp,getElementAtPath:()=>B1,getEnumValues:()=>bp,getLengthableOrigin:()=>ts,getParsedType:()=>V1,getSizableOrigin:()=>CC,isObject:()=>qo,isPlainObject:()=>Ko,issue:()=>Tp,joinValues:()=>Xa,jsonStringifyReplacer:()=>wp,merge:()=>W1,normalizeParams:()=>j,nullish:()=>Xi,numKeys:()=>U1,omit:()=>K1,optionalKeys:()=>_p,partial:()=>Z1,pick:()=>q1,prefixIssues:()=>Kr,primitiveTypes:()=>DC,promiseAllObject:()=>z1,propertyKeyTypes:()=>Pp,randomString:()=>j1,required:()=>J1,stringifyPrimitive:()=>tu,unwrapMessage:()=>Yi});function I1(e){return e}function N1(e){return e}function O1(e){}function M1(e){throw new Error}function L1(e){}function bp(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Xa(e,t="|"){return e.map(r=>tu(r)).join(t)}function wp(e,t){return typeof t=="bigint"?t.toString():t}function Qi(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Xi(e){return e==null}function es(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function xp(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}function Se(e,t,r){Object.defineProperty(e,t,{get(){{let o=r();return e[t]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Sp(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function B1(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function z1(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<t.length;s++)o[t[s]]=n[s];return o})}function j1(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function no(e){return JSON.stringify(e)}var eu=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function qo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ep=Qi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ko(e){if(qo(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(qo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function U1(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var V1=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Pp=new Set(["string","number","symbol"]),DC=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Tn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qr(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function j(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function H1(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,s){return t??(t=e()),Reflect.set(t,n,o,s)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function tu(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function _p(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Ap={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},vC={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function q1(e,t){let r={},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(r[o]=n.shape[o])}return qr(e,{...e._zod.def,shape:r,checks:[]})}function K1(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete r[o]}return qr(e,{...e._zod.def,shape:r,checks:[]})}function G1(e,t){if(!Ko(t))throw new Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return Sp(this,"shape",n),n},checks:[]};return qr(e,r)}function W1(e,t){return qr(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Sp(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function Z1(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=e?new e({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=e?new e({type:"optional",innerType:n[s]}):n[s];return qr(t,{...t._zod.def,shape:o,checks:[]})}function J1(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new e({type:"nonoptional",innerType:n[s]});return qr(t,{...t._zod.def,shape:o,checks:[]})}function oo(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Kr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Yi(e){return typeof e=="string"?e:e?.message}function Cr(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Yi(e.inst?._zod.def?.error?.(e))??Yi(t?.error?.(e))??Yi(r.customError?.(e))??Yi(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function CC(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ts(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Tp(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function Y1(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var Cp=class{constructor(...t){}};var bC=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,wp,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ru=A("$ZodError",bC),Fp=A("$ZodError",bC,{Parent:Error});function wC(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function xC(e,t){let r=t||function(s){return s.message},n={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)n._errors.push(r(i));else{let a=n,u=0;for(;u<i.path.length;){let c=i.path[u];u===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(i))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return o(e),n}var SC=e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new cn;if(i.issues.length){let a=new(o?.Err??e)(i.issues.map(u=>Cr(u,s,sr())));throw eu(a,o?.callee),a}return i.value};var EC=e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(o?.Err??e)(i.issues.map(u=>Cr(u,s,sr())));throw eu(a,o?.callee),a}return i.value};var Rp=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new cn;return s.issues.length?{success:!1,error:new(e??ru)(s.issues.map(i=>Cr(i,o,sr())))}:{success:!0,data:s.value}},PC=Rp(Fp),$p=e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>Cr(i,o,sr())))}:{success:!0,data:s.value}},_C=$p(Fp);var AC=/^[cC][^\s-]{8,}$/,TC=/^[0-9a-z]+$/,FC=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RC=/^[0-9a-vA-V]{20}$/,$C=/^[A-Za-z0-9]{27}$/,kC=/^[a-zA-Z0-9_-]{21}$/,IC=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var NC=/^([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})$/,kp=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;var OC=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var X1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function MC(){return new RegExp(X1,"u")}var LC=/^(?:(?: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])$/,BC=/^(([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})$/,zC=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,jC=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,UC=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ip=/^[A-Za-z0-9_-]*$/,VC=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var HC=/^\+(?:[0-9]){6,14}[0-9]$/,qC="(?:(?:\\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])))",KC=new RegExp(`^${qC}$`);function GC(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function WC(e){return new RegExp(`^${GC(e)}$`)}function ZC(e){let t=GC({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${qC}T(?:${n})$`)}var JC=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var YC=/^\d+$/,QC=/^-?\d+(?:\.\d+)?/i,XC=/true|false/i,eb=/null/i;var tb=/^[^A-Z]*$/,rb=/^[^a-z]*$/;var ht=A("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),nb={number:"number",bigint:"bigint",object:"date"},Op=A("$ZodCheckLessThan",(e,t)=>{ht.init(e,t);let r=nb[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Mp=A("$ZodCheckGreaterThan",(e,t)=>{ht.init(e,t);let r=nb[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ob=A("$ZodCheckMultipleOf",(e,t)=>{ht.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):xp(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ib=A("$ZodCheckNumberFormat",(e,t)=>{ht.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=Ap[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=o,a.maximum=s,r&&(a.pattern=YC)}),e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:e})}});var sb=A("$ZodCheckMaxLength",(e,t)=>{var r;ht.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Xi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let o=n.value;if(o.length<=t.maximum)return;let i=ts(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ab=A("$ZodCheckMinLength",(e,t)=>{var r;ht.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Xi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let i=ts(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ub=A("$ZodCheckLengthEquals",(e,t)=>{var r;ht.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Xi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{let o=n.value,s=o.length;if(s===t.length)return;let i=ts(o),a=s>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),rs=A("$ZodCheckStringFormat",(e,t)=>{var r,n;ht.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),cb=A("$ZodCheckRegex",(e,t)=>{rs.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),lb=A("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tb),rs.init(e,t)}),pb=A("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=rb),rs.init(e,t)}),db=A("$ZodCheckIncludes",(e,t)=>{ht.init(e,t);let r=Tn(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),fb=A("$ZodCheckStartsWith",(e,t)=>{ht.init(e,t);let r=new RegExp(`^${Tn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),mb=A("$ZodCheckEndsWith",(e,t)=>{ht.init(e,t);let r=new RegExp(`.*${Tn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var gb=A("$ZodCheckOverwrite",(e,t)=>{ht.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var nu=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
1509
1509
  `).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...r,o.join(`
1510
- `))}};var hb={major:4,minor:0,patch:0};var Se=A("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=hb;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(s,i,a)=>{let u=oo(s),c;for(let l of i){if(l._zod.def.when){if(!l._zod.def.when(s))continue}else if(u)continue;let p=s.issues.length,d=l._zod.check(s);if(d instanceof Promise&&a?.async===!1)throw new cn;if(c||d instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await d,s.issues.length!==p&&(u||(u=oo(s,p)))});else{if(s.issues.length===p)continue;u||(u=oo(s,p))}}return c?c.then(()=>s):s};e._zod.run=(s,i)=>{let a=e._zod.parse(s,i);if(a instanceof Promise){if(i.async===!1)throw new cn;return a.then(u=>o(u,n,i))}return o(a,n,i)}}e["~standard"]={validate:o=>{try{let s=EC(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return PC(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),ou=A("$ZodString",(e,t)=>{Se.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ZC(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Te=A("$ZodStringFormat",(e,t)=>{rs.init(e,t),ou.init(e,t)}),Pb=A("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=IC),Te.init(e,t)}),_b=A("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=kp(n))}else t.pattern??(t.pattern=kp());Te.init(e,t)}),Ab=A("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=NC),Te.init(e,t)}),Fb=A("$ZodURL",(e,t)=>{Te.init(e,t),e._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:UC.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Tb=A("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=OC()),Te.init(e,t)}),$b=A("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=kC),Te.init(e,t)}),kb=A("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=_C),Te.init(e,t)}),Rb=A("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=AC),Te.init(e,t)}),Ib=A("$ZodULID",(e,t)=>{t.pattern??(t.pattern=FC),Te.init(e,t)}),Nb=A("$ZodXID",(e,t)=>{t.pattern??(t.pattern=TC),Te.init(e,t)}),Ob=A("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$C),Te.init(e,t)}),Mb=A("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=WC(t)),Te.init(e,t)}),Bb=A("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=qC),Te.init(e,t)}),Lb=A("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=GC(t)),Te.init(e,t)}),zb=A("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=RC),Te.init(e,t)}),jb=A("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=MC),Te.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Ub=A("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=BC),Te.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Vb=A("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=LC),Te.init(e,t)}),Hb=A("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=zC),Te.init(e,t),e._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function qb(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Kb=A("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=jC),Te.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{qb(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function N1(e){if(!Rp.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return qb(r)}var Gb=A("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Rp),Te.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{N1(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Wb=A("$ZodE164",(e,t)=>{t.pattern??(t.pattern=VC),Te.init(e,t)});function O1(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}var Zb=A("$ZodJWT",(e,t)=>{Te.init(e,t),e._zod.check=r=>{O1(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Bp=A("$ZodNumber",(e,t)=>{Se.init(e,t),e._zod.pattern=e._zod.bag.pattern??YC,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),Jb=A("$ZodNumber",(e,t)=>{ob.init(e,t),Bp.init(e,t)}),Yb=A("$ZodBoolean",(e,t)=>{Se.init(e,t),e._zod.pattern=QC,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var Qb=A("$ZodNull",(e,t)=>{Se.init(e,t),e._zod.pattern=XC,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}});var Xb=A("$ZodUnknown",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),ew=A("$ZodNever",(e,t)=>{Se.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function yb(e,t,r){e.issues.length&&t.issues.push(...Kr(r,e.issues)),t.value[r]=e.value}var tw=A("$ZodArray",(e,t)=>{Se.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let a=o[i],u=t.element._zod.run({value:a,issues:[]},n);u instanceof Promise?s.push(u.then(c=>yb(c,r,i))):yb(u,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function nu(e,t,r){e.issues.length&&t.issues.push(...Kr(r,e.issues)),t.value[r]=e.value}function Db(e,t,r,n){e.issues.length?n[r]===void 0?r in n?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...Kr(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}var rw=A("$ZodObject",(e,t)=>{Se.init(e,t);let r=Qi(()=>{let p=Object.keys(t.shape);for(let g of p)if(!(t.shape[g]instanceof Se))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);let d=Pp(t.shape);return{shape:t.shape,keys:p,keySet:new Set(p),numKeys:p.length,optionalKeys:new Set(d)}});xe(e._zod,"propValues",()=>{let p=t.shape,d={};for(let g in p){let m=p[g]._zod;if(m.values){d[g]??(d[g]=new Set);for(let f of m.values)d[g].add(f)}}return d});let n=p=>{let d=new ru(["shape","payload","ctx"]),g=r.value,m=b=>{let C=no(b);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};d.write("const input = payload.value;");let f=Object.create(null),h=0;for(let b of g.keys)f[b]=`key_${h++}`;d.write("const newResult = {}");for(let b of g.keys)if(g.optionalKeys.has(b)){let C=f[b];d.write(`const ${C} = ${m(b)};`);let _=no(b);d.write(`
1510
+ `))}};var yb={major:4,minor:0,patch:0};var Ee=A("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yb;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(s,i,a)=>{let u=oo(s),c;for(let l of i){if(l._zod.def.when){if(!l._zod.def.when(s))continue}else if(u)continue;let p=s.issues.length,d=l._zod.check(s);if(d instanceof Promise&&a?.async===!1)throw new cn;if(c||d instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await d,s.issues.length!==p&&(u||(u=oo(s,p)))});else{if(s.issues.length===p)continue;u||(u=oo(s,p))}}return c?c.then(()=>s):s};e._zod.run=(s,i)=>{let a=e._zod.parse(s,i);if(a instanceof Promise){if(i.async===!1)throw new cn;return a.then(u=>o(u,n,i))}return o(a,n,i)}}e["~standard"]={validate:o=>{try{let s=PC(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return _C(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),iu=A("$ZodString",(e,t)=>{Ee.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??JC(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Re=A("$ZodStringFormat",(e,t)=>{rs.init(e,t),iu.init(e,t)}),_b=A("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=NC),Re.init(e,t)}),Ab=A("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=kp(n))}else t.pattern??(t.pattern=kp());Re.init(e,t)}),Tb=A("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=OC),Re.init(e,t)}),Fb=A("$ZodURL",(e,t)=>{Re.init(e,t),e._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:VC.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Rb=A("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=MC()),Re.init(e,t)}),$b=A("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=kC),Re.init(e,t)}),kb=A("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=AC),Re.init(e,t)}),Ib=A("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=TC),Re.init(e,t)}),Nb=A("$ZodULID",(e,t)=>{t.pattern??(t.pattern=FC),Re.init(e,t)}),Ob=A("$ZodXID",(e,t)=>{t.pattern??(t.pattern=RC),Re.init(e,t)}),Mb=A("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$C),Re.init(e,t)}),Lb=A("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ZC(t)),Re.init(e,t)}),Bb=A("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=KC),Re.init(e,t)}),zb=A("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=WC(t)),Re.init(e,t)}),jb=A("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=IC),Re.init(e,t)}),Ub=A("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=LC),Re.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Vb=A("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=BC),Re.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Hb=A("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=zC),Re.init(e,t)}),qb=A("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=jC),Re.init(e,t),e._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Kb(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Gb=A("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=UC),Re.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Kb(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function eN(e){if(!Ip.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Kb(r)}var Wb=A("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ip),Re.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{eN(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Zb=A("$ZodE164",(e,t)=>{t.pattern??(t.pattern=HC),Re.init(e,t)});function tN(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}var Jb=A("$ZodJWT",(e,t)=>{Re.init(e,t),e._zod.check=r=>{tN(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Bp=A("$ZodNumber",(e,t)=>{Ee.init(e,t),e._zod.pattern=e._zod.bag.pattern??QC,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),Yb=A("$ZodNumber",(e,t)=>{ib.init(e,t),Bp.init(e,t)}),Qb=A("$ZodBoolean",(e,t)=>{Ee.init(e,t),e._zod.pattern=XC,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var Xb=A("$ZodNull",(e,t)=>{Ee.init(e,t),e._zod.pattern=eb,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}});var ew=A("$ZodUnknown",(e,t)=>{Ee.init(e,t),e._zod.parse=r=>r}),tw=A("$ZodNever",(e,t)=>{Ee.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Db(e,t,r){e.issues.length&&t.issues.push(...Kr(r,e.issues)),t.value[r]=e.value}var rw=A("$ZodArray",(e,t)=>{Ee.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let a=o[i],u=t.element._zod.run({value:a,issues:[]},n);u instanceof Promise?s.push(u.then(c=>Db(c,r,i))):Db(u,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function ou(e,t,r){e.issues.length&&t.issues.push(...Kr(r,e.issues)),t.value[r]=e.value}function vb(e,t,r,n){e.issues.length?n[r]===void 0?r in n?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...Kr(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}var nw=A("$ZodObject",(e,t)=>{Ee.init(e,t);let r=Qi(()=>{let p=Object.keys(t.shape);for(let g of p)if(!(t.shape[g]instanceof Ee))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);let d=_p(t.shape);return{shape:t.shape,keys:p,keySet:new Set(p),numKeys:p.length,optionalKeys:new Set(d)}});Se(e._zod,"propValues",()=>{let p=t.shape,d={};for(let g in p){let m=p[g]._zod;if(m.values){d[g]??(d[g]=new Set);for(let f of m.values)d[g].add(f)}}return d});let n=p=>{let d=new nu(["shape","payload","ctx"]),g=r.value,m=b=>{let C=no(b);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};d.write("const input = payload.value;");let f=Object.create(null),h=0;for(let b of g.keys)f[b]=`key_${h++}`;d.write("const newResult = {}");for(let b of g.keys)if(g.optionalKeys.has(b)){let C=f[b];d.write(`const ${C} = ${m(b)};`);let _=no(b);d.write(`
1511
1511
  if (${C}.issues.length) {
1512
1512
  if (input[${_}] === undefined) {
1513
1513
  if (${_} in input) {
@@ -1530,19 +1530,19 @@ ${(0,v.yellow)("Note:")}
1530
1530
  if (${C}.issues.length) payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
1531
1531
  ...iss,
1532
1532
  path: iss.path ? [${no(b)}, ...iss.path] : [${no(b)}]
1533
- })));`),d.write(`newResult[${no(b)}] = ${C}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");let y=d.compile();return(b,C)=>y(p,b,C)},o,s=qo,i=!Ya.jitless,u=i&&Sp.value,c=t.catchall,l;e._zod.parse=(p,d)=>{l??(l=r.value);let g=p.value;if(!s(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;let m=[];if(i&&u&&d?.async===!1&&d.jitless!==!0)o||(o=n(t.shape)),p=o(p,d);else{p.value={};let C=l.shape;for(let _ of l.keys){let S=C[_],T=S._zod.run({value:g[_],issues:[]},d),k=S._zod.optin==="optional"&&S._zod.optout==="optional";T instanceof Promise?m.push(T.then(I=>k?Db(I,p,_,g):nu(I,p,_))):k?Db(T,p,_,g):nu(T,p,_)}}if(!c)return m.length?Promise.all(m).then(()=>p):p;let f=[],h=l.keySet,y=c._zod,b=y.def.type;for(let C of Object.keys(g)){if(h.has(C))continue;if(b==="never"){f.push(C);continue}let _=y.run({value:g[C],issues:[]},d);_ instanceof Promise?m.push(_.then(S=>nu(S,p,C))):nu(_,p,C)}return f.length&&p.issues.push({code:"unrecognized_keys",keys:f,input:g,inst:e}),m.length?Promise.all(m).then(()=>p):p}});function vb(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(s=>Cr(s,n,sr())))}),t}var Lp=A("$ZodUnion",(e,t)=>{Se.init(e,t),xe(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),xe(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),xe(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),xe(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>es(n.source)).join("|")})$`)}}),e._zod.parse=(r,n)=>{let o=!1,s=[];for(let i of t.options){let a=i._zod.run({value:r.value,issues:[]},n);if(a instanceof Promise)s.push(a),o=!0;else{if(a.issues.length===0)return a;s.push(a)}}return o?Promise.all(s).then(i=>vb(i,r,e,n)):vb(s,r,e,n)}}),nw=A("$ZodDiscriminatedUnion",(e,t)=>{Lp.init(e,t);let r=e._zod.parse;xe(e._zod,"propValues",()=>{let o={};for(let s of t.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[a,u]of Object.entries(i)){o[a]||(o[a]=new Set);for(let c of u)o[a].add(c)}}return o});let n=Qi(()=>{let o=t.options,s=new Map;for(let i of o){let a=i._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let u of a){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,i)}}return s});e._zod.parse=(o,s)=>{let i=o.value;if(!qo(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),o;let a=n.value.get(i?.[t.discriminator]);return a?a._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:i,path:[t.discriminator],inst:e}),o)}}),ow=A("$ZodIntersection",(e,t)=>{Se.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([u,c])=>Cb(r,u,c)):Cb(r,s,i)}});function Mp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ko(e)&&Ko(t)){let r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(let s of n){let i=Mp(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],s=t[n],i=Mp(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Cb(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),oo(e))return e;let n=Mp(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}var iw=A("$ZodRecord",(e,t)=>{Se.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Ko(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[];if(t.keyType._zod.values){let i=t.keyType._zod.values;r.value={};for(let u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let c=t.valueType._zod.run({value:o[u],issues:[]},n);c instanceof Promise?s.push(c.then(l=>{l.issues.length&&r.issues.push(...Kr(u,l.issues)),r.value[u]=l.value})):(c.issues.length&&r.issues.push(...Kr(u,c.issues)),r.value[u]=c.value)}let a;for(let u in o)i.has(u)||(a=a??[],a.push(u));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(let i of Reflect.ownKeys(o)){if(i==="__proto__")continue;let a=t.keyType._zod.run({value:i,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(c=>Cr(c,n,sr())),input:i,path:[i],inst:e}),r.value[a.value]=a.value;continue}let u=t.valueType._zod.run({value:o[i],issues:[]},n);u instanceof Promise?s.push(u.then(c=>{c.issues.length&&r.issues.push(...Kr(i,c.issues)),r.value[a.value]=c.value})):(u.issues.length&&r.issues.push(...Kr(i,u.issues)),r.value[a.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}});var sw=A("$ZodEnum",(e,t)=>{Se.init(e,t);let r=Cp(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>Ep.has(typeof n)).map(n=>typeof n=="string"?Fn(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return e._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),aw=A("$ZodLiteral",(e,t)=>{Se.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Fn(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}});var uw=A("$ZodTransform",(e,t)=>{Se.init(e,t),e._zod.parse=(r,n)=>{let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new cn;return r.value=o,r}}),cw=A("$ZodOptional",(e,t)=>{Se.init(e,t),e._zod.optin="optional",e._zod.optout="optional",xe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),xe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${es(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(r,n):r.value===void 0?r:t.innerType._zod.run(r,n)}),lw=A("$ZodNullable",(e,t)=>{Se.init(e,t),xe(e._zod,"optin",()=>t.innerType._zod.optin),xe(e._zod,"optout",()=>t.innerType._zod.optout),xe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${es(r.source)}|null)$`):void 0}),xe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),pw=A("$ZodDefault",(e,t)=>{Se.init(e,t),e._zod.optin="optional",xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>bb(s,t)):bb(o,t)}});function bb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var dw=A("$ZodPrefault",(e,t)=>{Se.init(e,t),e._zod.optin="optional",xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),fw=A("$ZodNonOptional",(e,t)=>{Se.init(e,t),xe(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>wb(s,e)):wb(o,e)}});function wb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var mw=A("$ZodCatch",(e,t)=>{Se.init(e,t),e._zod.optin="optional",xe(e._zod,"optout",()=>t.innerType._zod.optout),xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>Cr(i,n,sr()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>Cr(s,n,sr()))},input:r.value}),r.issues=[]),r)}});var gw=A("$ZodPipe",(e,t)=>{Se.init(e,t),xe(e._zod,"values",()=>t.in._zod.values),xe(e._zod,"optin",()=>t.in._zod.optin),xe(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,n)=>{let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>xb(s,t,n)):xb(o,t,n)}});function xb(e,t,r){return oo(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}var hw=A("$ZodReadonly",(e,t)=>{Se.init(e,t),xe(e._zod,"propValues",()=>t.innerType._zod.propValues),xe(e._zod,"values",()=>t.innerType._zod.values),xe(e._zod,"optin",()=>t.innerType._zod.optin),xe(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Sb):Sb(o)}});function Sb(e){return e.value=Object.freeze(e.value),e}var yw=A("$ZodCustom",(e,t)=>{gt.init(e,t),Se.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>Eb(s,r,n,e));Eb(o,r,n,e)}});function Eb(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Ap(o))}}var M1=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},B1=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(n){return e[n]??null}let r={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"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${M1(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${eu(n.values[0])}`:`Invalid option: expected one of ${Qa(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Qa(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Dw(){return{localeError:B1()}}var xJ=Symbol("ZodOutput"),SJ=Symbol("ZodInput"),zp=class{constructor(){this._map=new Map,this._idmap=new Map}add(t,...r){let n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};function L1(){return new zp}var ns=L1();function vw(e,t){return new e({type:"string",...j(t)})}function Cw(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...j(t)})}function jp(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...j(t)})}function bw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...j(t)})}function ww(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(t)})}function xw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(t)})}function Sw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(t)})}function Ew(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...j(t)})}function Pw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...j(t)})}function _w(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(t)})}function Aw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...j(t)})}function Fw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(t)})}function Tw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...j(t)})}function $w(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...j(t)})}function kw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(t)})}function Rw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(t)})}function Iw(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(t)})}function Nw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(t)})}function Ow(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(t)})}function Mw(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...j(t)})}function Bw(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...j(t)})}function Lw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...j(t)})}function zw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...j(t)})}function jw(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(t)})}function Uw(e,t){return new e({type:"string",format:"date",check:"string_format",...j(t)})}function Vw(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...j(t)})}function Hw(e,t){return new e({type:"string",format:"duration",check:"string_format",...j(t)})}function qw(e,t){return new e({type:"number",checks:[],...j(t)})}function Kw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...j(t)})}function Gw(e,t){return new e({type:"boolean",...j(t)})}function Ww(e,t){return new e({type:"null",...j(t)})}function Zw(e){return new e({type:"unknown"})}function Jw(e,t){return new e({type:"never",...j(t)})}function iu(e,t){return new Np({check:"less_than",...j(t),value:e,inclusive:!1})}function os(e,t){return new Np({check:"less_than",...j(t),value:e,inclusive:!0})}function su(e,t){return new Op({check:"greater_than",...j(t),value:e,inclusive:!1})}function is(e,t){return new Op({check:"greater_than",...j(t),value:e,inclusive:!0})}function au(e,t){return new nb({check:"multiple_of",...j(t),value:e})}function uu(e,t){return new ib({check:"max_length",...j(t),maximum:e})}function Go(e,t){return new sb({check:"min_length",...j(t),minimum:e})}function cu(e,t){return new ab({check:"length_equals",...j(t),length:e})}function Up(e,t){return new ub({check:"string_format",format:"regex",...j(t),pattern:e})}function Vp(e){return new cb({check:"string_format",format:"lowercase",...j(e)})}function Hp(e){return new lb({check:"string_format",format:"uppercase",...j(e)})}function qp(e,t){return new pb({check:"string_format",format:"includes",...j(t),includes:e})}function Kp(e,t){return new db({check:"string_format",format:"starts_with",...j(t),prefix:e})}function Gp(e,t){return new fb({check:"string_format",format:"ends_with",...j(t),suffix:e})}function io(e){return new mb({check:"overwrite",tx:e})}function Wp(e){return io(t=>t.normalize(e))}function Zp(){return io(e=>e.trim())}function Jp(){return io(e=>e.toLowerCase())}function Yp(){return io(e=>e.toUpperCase())}function Yw(e,t,r){return new e({type:"array",element:t,...j(r)})}function Qw(e,t,r){let n=j(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Xw(e,t,r){return new e({type:"custom",check:"custom",fn:t,...j(r)})}var as={};Lm(as,{ZodISODate:()=>tx,ZodISODateTime:()=>ex,ZodISODuration:()=>nx,ZodISOTime:()=>rx,date:()=>Xp,datetime:()=>Qp,duration:()=>td,time:()=>ed});var ex=A("ZodISODateTime",(e,t)=>{Mb.init(e,t),Ne.init(e,t)});function Qp(e){return jw(ex,e)}var tx=A("ZodISODate",(e,t)=>{Bb.init(e,t),Ne.init(e,t)});function Xp(e){return Uw(tx,e)}var rx=A("ZodISOTime",(e,t)=>{Lb.init(e,t),Ne.init(e,t)});function ed(e){return Vw(rx,e)}var nx=A("ZodISODuration",(e,t)=>{zb.init(e,t),Ne.init(e,t)});function td(e){return Hw(nx,e)}var ox=(e,t)=>{tu.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>wC(e,r)},flatten:{value:r=>bC(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},QJ=A("ZodError",ox),us=A("ZodError",ox,{Parent:Error});var ix=xC(us),sx=SC(us),ax=Tp(us),ux=$p(us);var je=A("ZodType",(e,t)=>(Se.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>qr(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>ix(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>ax(e,r,n),e.parseAsync=async(r,n)=>sx(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ux(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(ON(r,n)),e.superRefine=r=>e.check(MN(r)),e.overwrite=r=>e.check(io(r)),e.optional=()=>ze(e),e.nullable=()=>px(e),e.nullish=()=>ze(px(e)),e.nonoptional=r=>FN(e,r),e.array=()=>oe(e),e.or=r=>Ee([e,r]),e.and=r=>pu(e,r),e.transform=r=>nd(e,hx(r)),e.default=r=>PN(e,r),e.prefault=r=>AN(e,r),e.catch=r=>$N(e,r),e.pipe=r=>nd(e,r),e.readonly=()=>IN(e),e.describe=r=>{let n=e.clone();return ns.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return ns.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return ns.get(e);let n=e.clone();return ns.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),dx=A("_ZodString",(e,t)=>{ou.init(e,t),je.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Up(...n)),e.includes=(...n)=>e.check(qp(...n)),e.startsWith=(...n)=>e.check(Kp(...n)),e.endsWith=(...n)=>e.check(Gp(...n)),e.min=(...n)=>e.check(Go(...n)),e.max=(...n)=>e.check(uu(...n)),e.length=(...n)=>e.check(cu(...n)),e.nonempty=(...n)=>e.check(Go(1,...n)),e.lowercase=n=>e.check(Vp(n)),e.uppercase=n=>e.check(Hp(n)),e.trim=()=>e.check(Zp()),e.normalize=(...n)=>e.check(Wp(...n)),e.toLowerCase=()=>e.check(Jp()),e.toUpperCase=()=>e.check(Yp())}),W1=A("ZodString",(e,t)=>{ou.init(e,t),dx.init(e,t),e.email=r=>e.check(Cw(Z1,r)),e.url=r=>e.check(Ew(J1,r)),e.jwt=r=>e.check(zw(pN,r)),e.emoji=r=>e.check(Pw(Y1,r)),e.guid=r=>e.check(jp(cx,r)),e.uuid=r=>e.check(bw(lu,r)),e.uuidv4=r=>e.check(ww(lu,r)),e.uuidv6=r=>e.check(xw(lu,r)),e.uuidv7=r=>e.check(Sw(lu,r)),e.nanoid=r=>e.check(_w(Q1,r)),e.guid=r=>e.check(jp(cx,r)),e.cuid=r=>e.check(Aw(X1,r)),e.cuid2=r=>e.check(Fw(eN,r)),e.ulid=r=>e.check(Tw(tN,r)),e.base64=r=>e.check(Mw(uN,r)),e.base64url=r=>e.check(Bw(cN,r)),e.xid=r=>e.check($w(rN,r)),e.ksuid=r=>e.check(kw(nN,r)),e.ipv4=r=>e.check(Rw(oN,r)),e.ipv6=r=>e.check(Iw(iN,r)),e.cidrv4=r=>e.check(Nw(sN,r)),e.cidrv6=r=>e.check(Ow(aN,r)),e.e164=r=>e.check(Lw(lN,r)),e.datetime=r=>e.check(Qp(r)),e.date=r=>e.check(Xp(r)),e.time=r=>e.check(ed(r)),e.duration=r=>e.check(td(r))});function P(e){return vw(W1,e)}var Ne=A("ZodStringFormat",(e,t)=>{Te.init(e,t),dx.init(e,t)}),Z1=A("ZodEmail",(e,t)=>{Ab.init(e,t),Ne.init(e,t)});var cx=A("ZodGUID",(e,t)=>{Pb.init(e,t),Ne.init(e,t)});var lu=A("ZodUUID",(e,t)=>{_b.init(e,t),Ne.init(e,t)});var J1=A("ZodURL",(e,t)=>{Fb.init(e,t),Ne.init(e,t)});var Y1=A("ZodEmoji",(e,t)=>{Tb.init(e,t),Ne.init(e,t)});var Q1=A("ZodNanoID",(e,t)=>{$b.init(e,t),Ne.init(e,t)});var X1=A("ZodCUID",(e,t)=>{kb.init(e,t),Ne.init(e,t)});var eN=A("ZodCUID2",(e,t)=>{Rb.init(e,t),Ne.init(e,t)});var tN=A("ZodULID",(e,t)=>{Ib.init(e,t),Ne.init(e,t)});var rN=A("ZodXID",(e,t)=>{Nb.init(e,t),Ne.init(e,t)});var nN=A("ZodKSUID",(e,t)=>{Ob.init(e,t),Ne.init(e,t)});var oN=A("ZodIPv4",(e,t)=>{jb.init(e,t),Ne.init(e,t)});var iN=A("ZodIPv6",(e,t)=>{Ub.init(e,t),Ne.init(e,t)});var sN=A("ZodCIDRv4",(e,t)=>{Vb.init(e,t),Ne.init(e,t)});var aN=A("ZodCIDRv6",(e,t)=>{Hb.init(e,t),Ne.init(e,t)});var uN=A("ZodBase64",(e,t)=>{Kb.init(e,t),Ne.init(e,t)});var cN=A("ZodBase64URL",(e,t)=>{Gb.init(e,t),Ne.init(e,t)});var lN=A("ZodE164",(e,t)=>{Wb.init(e,t),Ne.init(e,t)});var pN=A("ZodJWT",(e,t)=>{Zb.init(e,t),Ne.init(e,t)});var fx=A("ZodNumber",(e,t)=>{Bp.init(e,t),je.init(e,t),e.gt=(n,o)=>e.check(su(n,o)),e.gte=(n,o)=>e.check(is(n,o)),e.min=(n,o)=>e.check(is(n,o)),e.lt=(n,o)=>e.check(iu(n,o)),e.lte=(n,o)=>e.check(os(n,o)),e.max=(n,o)=>e.check(os(n,o)),e.int=n=>e.check(lx(n)),e.safe=n=>e.check(lx(n)),e.positive=n=>e.check(su(0,n)),e.nonnegative=n=>e.check(is(0,n)),e.negative=n=>e.check(iu(0,n)),e.nonpositive=n=>e.check(os(0,n)),e.multipleOf=(n,o)=>e.check(au(n,o)),e.step=(n,o)=>e.check(au(n,o)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ye(e){return qw(fx,e)}var dN=A("ZodNumberFormat",(e,t)=>{Jb.init(e,t),fx.init(e,t)});function lx(e){return Kw(dN,e)}var fN=A("ZodBoolean",(e,t)=>{Yb.init(e,t),je.init(e,t)});function rt(e){return Gw(fN,e)}var mN=A("ZodNull",(e,t)=>{Qb.init(e,t),je.init(e,t)});function od(e){return Ww(mN,e)}var gN=A("ZodUnknown",(e,t)=>{Xb.init(e,t),je.init(e,t)});function Oe(){return Zw(gN)}var hN=A("ZodNever",(e,t)=>{ew.init(e,t),je.init(e,t)});function yN(e){return Jw(hN,e)}var DN=A("ZodArray",(e,t)=>{tw.init(e,t),je.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(Go(r,n)),e.nonempty=r=>e.check(Go(1,r)),e.max=(r,n)=>e.check(uu(r,n)),e.length=(r,n)=>e.check(cu(r,n)),e.unwrap=()=>e.element});function oe(e,t){return Yw(DN,e,t)}var mx=A("ZodObject",(e,t)=>{rw.init(e,t),je.init(e,t),me.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Nt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Oe()}),e.loose=()=>e.clone({...e._zod.def,catchall:Oe()}),e.strict=()=>e.clone({...e._zod.def,catchall:yN()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>me.extend(e,r),e.merge=r=>me.merge(e,r),e.pick=r=>me.pick(e,r),e.omit=r=>me.omit(e,r),e.partial=(...r)=>me.partial(yx,e,r[0]),e.required=(...r)=>me.required(Dx,e,r[0])});function O(e,t){let r={type:"object",get shape(){return me.assignProp(this,"shape",{...e}),this.shape},...me.normalizeParams(t)};return new mx(r)}function St(e,t){return new mx({type:"object",get shape(){return me.assignProp(this,"shape",{...e}),this.shape},catchall:Oe(),...me.normalizeParams(t)})}var gx=A("ZodUnion",(e,t)=>{Lp.init(e,t),je.init(e,t),e.options=t.options});function Ee(e,t){return new gx({type:"union",options:e,...me.normalizeParams(t)})}var vN=A("ZodDiscriminatedUnion",(e,t)=>{gx.init(e,t),nw.init(e,t)});function id(e,t,r){return new vN({type:"union",options:t,discriminator:e,...me.normalizeParams(r)})}var CN=A("ZodIntersection",(e,t)=>{ow.init(e,t),je.init(e,t)});function pu(e,t){return new CN({type:"intersection",left:e,right:t})}var bN=A("ZodRecord",(e,t)=>{iw.init(e,t),je.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Me(e,t,r){return new bN({type:"record",keyType:e,valueType:t,...me.normalizeParams(r)})}var rd=A("ZodEnum",(e,t)=>{sw.init(e,t),je.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let s={};for(let i of n)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new rd({...t,checks:[],...me.normalizeParams(o),entries:s})},e.exclude=(n,o)=>{let s={...t.entries};for(let i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new rd({...t,checks:[],...me.normalizeParams(o),entries:s})}});function Nt(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new rd({type:"enum",entries:r,...me.normalizeParams(t)})}var wN=A("ZodLiteral",(e,t)=>{aw.init(e,t),je.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"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 L(e,t){return new wN({type:"literal",values:Array.isArray(e)?e:[e],...me.normalizeParams(t)})}var xN=A("ZodTransform",(e,t)=>{uw.init(e,t),je.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(me.issue(s,r.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),i.continue??(i.continue=!0),r.issues.push(me.issue(i))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function hx(e){return new xN({type:"transform",transform:e})}var yx=A("ZodOptional",(e,t)=>{cw.init(e,t),je.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ze(e){return new yx({type:"optional",innerType:e})}var SN=A("ZodNullable",(e,t)=>{lw.init(e,t),je.init(e,t),e.unwrap=()=>e._zod.def.innerType});function px(e){return new SN({type:"nullable",innerType:e})}var EN=A("ZodDefault",(e,t)=>{pw.init(e,t),je.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function PN(e,t){return new EN({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var _N=A("ZodPrefault",(e,t)=>{dw.init(e,t),je.init(e,t),e.unwrap=()=>e._zod.def.innerType});function AN(e,t){return new _N({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var Dx=A("ZodNonOptional",(e,t)=>{fw.init(e,t),je.init(e,t),e.unwrap=()=>e._zod.def.innerType});function FN(e,t){return new Dx({type:"nonoptional",innerType:e,...me.normalizeParams(t)})}var TN=A("ZodCatch",(e,t)=>{mw.init(e,t),je.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $N(e,t){return new TN({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var kN=A("ZodPipe",(e,t)=>{gw.init(e,t),je.init(e,t),e.in=t.in,e.out=t.out});function nd(e,t){return new kN({type:"pipe",in:e,out:t})}var RN=A("ZodReadonly",(e,t)=>{hw.init(e,t),je.init(e,t)});function IN(e){return new RN({type:"readonly",innerType:e})}var vx=A("ZodCustom",(e,t)=>{yw.init(e,t),je.init(e,t)});function NN(e){let t=new gt({check:"custom"});return t._zod.check=e,t}function Cx(e,t){return Qw(vx,e??(()=>!0),t)}function ON(e,t={}){return Xw(vx,e,t)}function MN(e){let t=NN(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(me.issue(n,r.value,t._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(me.issue(o))}},e(r.value,r)));return t}function sd(e,t){return nd(hx(e),t)}sr(Dw());var bx="io.modelcontextprotocol/related-task",fu="2.0",it=Cx(e=>e!==null&&(typeof e=="object"||typeof e=="function")),wx=Ee([P(),ye().int()]),xx=P(),qY=St({ttl:Ee([ye(),od()]).optional(),pollInterval:ye().optional()}),BN=O({ttl:ye().optional()}),LN=O({taskId:P()}),ad=St({progressToken:wx.optional(),[bx]:LN.optional()}),Wt=O({_meta:ad.optional()}),mu=Wt.extend({task:BN.optional()});var st=O({method:P(),params:Wt.loose().optional()}),ar=O({_meta:ad.optional()}),ur=O({method:P(),params:ar.loose().optional()}),at=St({_meta:ad.optional()}),gu=Ee([P(),ye().int()]),zN=O({jsonrpc:L(fu),id:gu,...st.shape}).strict();var jN=O({jsonrpc:L(fu),...ur.shape}).strict();var Sx=O({jsonrpc:L(fu),id:gu,result:at}).strict();var cs;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(cs||(cs={}));var Ex=O({jsonrpc:L(fu),id:gu.optional(),error:O({code:ye().int(),message:P(),data:Oe().optional()})}).strict();var UN=Ee([zN,jN,Sx,Ex]),KY=Ee([Sx,Ex]),ud=at.strict(),VN=ar.extend({requestId:gu.optional(),reason:P().optional()}),cd=ur.extend({method:L("notifications/cancelled"),params:VN}),HN=O({src:P(),mimeType:P().optional(),sizes:oe(P()).optional(),theme:Nt(["light","dark"]).optional()}),ls=O({icons:oe(HN).optional()}),Wo=O({name:P(),title:P().optional()}),Px=Wo.extend({...Wo.shape,...ls.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),qN=pu(O({applyDefaults:rt().optional()}),Me(P(),Oe())),KN=sd(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,pu(O({form:qN.optional(),url:it.optional()}),Me(P(),Oe()).optional())),GN=St({list:it.optional(),cancel:it.optional(),requests:St({sampling:St({createMessage:it.optional()}).optional(),elicitation:St({create:it.optional()}).optional()}).optional()}),WN=St({list:it.optional(),cancel:it.optional(),requests:St({tools:St({call:it.optional()}).optional()}).optional()}),ZN=O({experimental:Me(P(),it).optional(),sampling:O({context:it.optional(),tools:it.optional()}).optional(),elicitation:KN.optional(),roots:O({listChanged:rt().optional()}).optional(),tasks:GN.optional()}),JN=Wt.extend({protocolVersion:P(),capabilities:ZN,clientInfo:Px}),YN=st.extend({method:L("initialize"),params:JN});var QN=O({experimental:Me(P(),it).optional(),logging:it.optional(),completions:it.optional(),prompts:O({listChanged:rt().optional()}).optional(),resources:O({subscribe:rt().optional(),listChanged:rt().optional()}).optional(),tools:O({listChanged:rt().optional()}).optional(),tasks:WN.optional()}),_x=at.extend({protocolVersion:P(),capabilities:QN,serverInfo:Px,instructions:P().optional()}),XN=ur.extend({method:L("notifications/initialized"),params:ar.optional()});var ld=st.extend({method:L("ping"),params:Wt.optional()}),e2=O({progress:ye(),total:ze(ye()),message:ze(P())}),t2=O({...ar.shape,...e2.shape,progressToken:wx}),pd=ur.extend({method:L("notifications/progress"),params:t2}),r2=Wt.extend({cursor:xx.optional()}),ps=st.extend({params:r2.optional()}),ds=at.extend({nextCursor:xx.optional()}),n2=Nt(["working","input_required","completed","failed","cancelled"]),fs=O({taskId:P(),status:n2,ttl:Ee([ye(),od()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:ze(ye()),statusMessage:ze(P())}),hu=at.extend({task:fs}),o2=ar.merge(fs),dd=ur.extend({method:L("notifications/tasks/status"),params:o2}),fd=st.extend({method:L("tasks/get"),params:Wt.extend({taskId:P()})}),md=at.merge(fs),gd=st.extend({method:L("tasks/result"),params:Wt.extend({taskId:P()})}),GY=at.loose(),hd=ps.extend({method:L("tasks/list")}),yd=ds.extend({tasks:oe(fs)}),Dd=st.extend({method:L("tasks/cancel"),params:Wt.extend({taskId:P()})}),i2=at.merge(fs),Ax=O({uri:P(),mimeType:ze(P()),_meta:Me(P(),Oe()).optional()}),Fx=Ax.extend({text:P()}),vd=P().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Tx=Ax.extend({blob:vd}),ms=Nt(["user","assistant"]),Zo=O({audience:oe(ms).optional(),priority:ye().min(0).max(1).optional(),lastModified:as.datetime({offset:!0}).optional()}),$x=O({...Wo.shape,...ls.shape,uri:P(),description:ze(P()),mimeType:ze(P()),annotations:Zo.optional(),_meta:ze(St({}))}),s2=O({...Wo.shape,...ls.shape,uriTemplate:P(),description:ze(P()),mimeType:ze(P()),annotations:Zo.optional(),_meta:ze(St({}))}),a2=ps.extend({method:L("resources/list")}),kx=ds.extend({resources:oe($x)}),u2=ps.extend({method:L("resources/templates/list")}),Rx=ds.extend({resourceTemplates:oe(s2)}),Cd=Wt.extend({uri:P()}),c2=Cd,l2=st.extend({method:L("resources/read"),params:c2}),Ix=at.extend({contents:oe(Ee([Fx,Tx]))}),Nx=ur.extend({method:L("notifications/resources/list_changed"),params:ar.optional()}),p2=Cd,d2=st.extend({method:L("resources/subscribe"),params:p2}),f2=Cd,m2=st.extend({method:L("resources/unsubscribe"),params:f2}),g2=ar.extend({uri:P()}),h2=ur.extend({method:L("notifications/resources/updated"),params:g2}),y2=O({name:P(),description:ze(P()),required:ze(rt())}),D2=O({...Wo.shape,...ls.shape,description:ze(P()),arguments:ze(oe(y2)),_meta:ze(St({}))}),v2=ps.extend({method:L("prompts/list")}),Ox=ds.extend({prompts:oe(D2)}),C2=Wt.extend({name:P(),arguments:Me(P(),P()).optional()}),b2=st.extend({method:L("prompts/get"),params:C2}),bd=O({type:L("text"),text:P(),annotations:Zo.optional(),_meta:Me(P(),Oe()).optional()}),wd=O({type:L("image"),data:vd,mimeType:P(),annotations:Zo.optional(),_meta:Me(P(),Oe()).optional()}),xd=O({type:L("audio"),data:vd,mimeType:P(),annotations:Zo.optional(),_meta:Me(P(),Oe()).optional()}),w2=O({type:L("tool_use"),name:P(),id:P(),input:Me(P(),Oe()),_meta:Me(P(),Oe()).optional()}),x2=O({type:L("resource"),resource:Ee([Fx,Tx]),annotations:Zo.optional(),_meta:Me(P(),Oe()).optional()}),S2=$x.extend({type:L("resource_link")}),Sd=Ee([bd,wd,xd,S2,x2]),E2=O({role:ms,content:Sd}),Mx=at.extend({description:P().optional(),messages:oe(E2)}),Bx=ur.extend({method:L("notifications/prompts/list_changed"),params:ar.optional()}),P2=O({title:P().optional(),readOnlyHint:rt().optional(),destructiveHint:rt().optional(),idempotentHint:rt().optional(),openWorldHint:rt().optional()}),_2=O({taskSupport:Nt(["required","optional","forbidden"]).optional()}),Lx=O({...Wo.shape,...ls.shape,description:P().optional(),inputSchema:O({type:L("object"),properties:Me(P(),it).optional(),required:oe(P()).optional()}).catchall(Oe()),outputSchema:O({type:L("object"),properties:Me(P(),it).optional(),required:oe(P()).optional()}).catchall(Oe()).optional(),annotations:P2.optional(),execution:_2.optional(),_meta:Me(P(),Oe()).optional()}),A2=ps.extend({method:L("tools/list")}),zx=ds.extend({tools:oe(Lx)}),yu=at.extend({content:oe(Sd).default([]),structuredContent:Me(P(),Oe()).optional(),isError:rt().optional()}),WY=yu.or(at.extend({toolResult:Oe()})),F2=mu.extend({name:P(),arguments:Me(P(),Oe()).optional()}),T2=st.extend({method:L("tools/call"),params:F2}),jx=ur.extend({method:L("notifications/tools/list_changed"),params:ar.optional()}),$2=O({autoRefresh:rt().default(!0),debounceMs:ye().int().nonnegative().default(300)}),Ux=Nt(["debug","info","notice","warning","error","critical","alert","emergency"]),k2=Wt.extend({level:Ux}),R2=st.extend({method:L("logging/setLevel"),params:k2}),I2=ar.extend({level:Ux,logger:P().optional(),data:Oe()}),N2=ur.extend({method:L("notifications/message"),params:I2}),O2=O({name:P().optional()}),M2=O({hints:oe(O2).optional(),costPriority:ye().min(0).max(1).optional(),speedPriority:ye().min(0).max(1).optional(),intelligencePriority:ye().min(0).max(1).optional()}),B2=O({mode:Nt(["auto","required","none"]).optional()}),L2=O({type:L("tool_result"),toolUseId:P().describe("The unique identifier for the corresponding tool call."),content:oe(Sd).default([]),structuredContent:O({}).loose().optional(),isError:rt().optional(),_meta:Me(P(),Oe()).optional()}),z2=id("type",[bd,wd,xd]),du=id("type",[bd,wd,xd,w2,L2]),j2=O({role:ms,content:Ee([du,oe(du)]),_meta:Me(P(),Oe()).optional()}),U2=mu.extend({messages:oe(j2),modelPreferences:M2.optional(),systemPrompt:P().optional(),includeContext:Nt(["none","thisServer","allServers"]).optional(),temperature:ye().optional(),maxTokens:ye().int(),stopSequences:oe(P()).optional(),metadata:it.optional(),tools:oe(Lx).optional(),toolChoice:B2.optional()}),Vx=st.extend({method:L("sampling/createMessage"),params:U2}),Hx=at.extend({model:P(),stopReason:ze(Nt(["endTurn","stopSequence","maxTokens"]).or(P())),role:ms,content:z2}),V2=at.extend({model:P(),stopReason:ze(Nt(["endTurn","stopSequence","maxTokens","toolUse"]).or(P())),role:ms,content:Ee([du,oe(du)])}),H2=O({type:L("boolean"),title:P().optional(),description:P().optional(),default:rt().optional()}),q2=O({type:L("string"),title:P().optional(),description:P().optional(),minLength:ye().optional(),maxLength:ye().optional(),format:Nt(["email","uri","date","date-time"]).optional(),default:P().optional()}),K2=O({type:Nt(["number","integer"]),title:P().optional(),description:P().optional(),minimum:ye().optional(),maximum:ye().optional(),default:ye().optional()}),G2=O({type:L("string"),title:P().optional(),description:P().optional(),enum:oe(P()),default:P().optional()}),W2=O({type:L("string"),title:P().optional(),description:P().optional(),oneOf:oe(O({const:P(),title:P()})),default:P().optional()}),Z2=O({type:L("string"),title:P().optional(),description:P().optional(),enum:oe(P()),enumNames:oe(P()).optional(),default:P().optional()}),J2=Ee([G2,W2]),Y2=O({type:L("array"),title:P().optional(),description:P().optional(),minItems:ye().optional(),maxItems:ye().optional(),items:O({type:L("string"),enum:oe(P())}),default:oe(P()).optional()}),Q2=O({type:L("array"),title:P().optional(),description:P().optional(),minItems:ye().optional(),maxItems:ye().optional(),items:O({anyOf:oe(O({const:P(),title:P()}))}),default:oe(P()).optional()}),X2=Ee([Y2,Q2]),eO=Ee([Z2,J2,X2]),tO=Ee([eO,H2,q2,K2]),rO=mu.extend({mode:L("form").optional(),message:P(),requestedSchema:O({type:L("object"),properties:Me(P(),tO),required:oe(P()).optional()})}),nO=mu.extend({mode:L("url"),message:P(),elicitationId:P(),url:P().url()}),oO=Ee([rO,nO]),qx=st.extend({method:L("elicitation/create"),params:oO}),iO=ar.extend({elicitationId:P()}),sO=ur.extend({method:L("notifications/elicitation/complete"),params:iO}),Kx=at.extend({action:Nt(["accept","decline","cancel"]),content:sd(e=>e===null?void 0:e,Me(P(),Ee([P(),ye(),rt(),oe(P())])).optional())}),aO=O({type:L("ref/resource"),uri:P()});var uO=O({type:L("ref/prompt"),name:P()}),cO=Wt.extend({ref:Ee([uO,aO]),argument:O({name:P(),value:P()}),context:O({arguments:Me(P(),P()).optional()}).optional()}),lO=st.extend({method:L("completion/complete"),params:cO});var Gx=at.extend({completion:St({values:oe(P()).max(100),total:ze(ye().int()),hasMore:ze(rt())})}),pO=O({uri:P().startsWith("file://"),name:P().optional(),_meta:Me(P(),Oe()).optional()}),dO=st.extend({method:L("roots/list"),params:Wt.optional()}),fO=at.extend({roots:oe(pO)}),mO=ur.extend({method:L("notifications/roots/list_changed"),params:ar.optional()}),ZY=Ee([ld,YN,lO,R2,b2,v2,a2,u2,l2,d2,m2,T2,A2,fd,gd,hd,Dd]),JY=Ee([cd,pd,XN,mO,dd]),YY=Ee([ud,Hx,V2,Kx,fO,md,yd,hu]),QY=Ee([ld,Vx,qx,dO,fd,gd,hd,Dd]),XY=Ee([cd,pd,N2,h2,Nx,jx,Bx,dd,sO]),eQ=Ee([ud,_x,Gx,Mx,Ox,kx,Rx,Ix,yu,zx,md,yd,hu]);var gO=Symbol("Let zodToJsonSchema decide on which parser to use");var RQ=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var pj=Ue(cm(),1),dj=Ue(zE(),1);var Lj=Ue(AP(),1);import zj from"node:process";var jne=zj.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];import*as i8 from"@sentry/node";var s8=Ue(RP(),1);var a8=()=>{if(typeof globalThis<"u"&&globalThis.crypto)return globalThis.crypto;if(typeof G<"u")try{let e=G("crypto");if(e.webcrypto)return e.webcrypto}catch{}throw new Error("Web Crypto API is not available. Requires Node.js 15+ or a browser environment.")},roe=a8();import IP from"node:process";function Am(){let{env:e}=IP,{TERM:t,TERM_PROGRAM:r}=e;return IP.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Fm=Ue(Vn(),1),mi=Ue(oa(),1),qs=Ue(Vn(),1),$m=()=>{let e=Tm?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],t=Tm?80:120,r,n=!1,o="",s="",i="",a=h=>{let y=h>1?"Something went wrong":"Canceled";n&&g(y,h)},u=(h,y)=>{console.error(y,h),a(2)},c=()=>a(1),l=()=>{process.on("uncaughtExceptionMonitor",u),process.on("unhandledRejection",u),process.on("SIGINT",c),process.on("SIGTERM",c),process.on("exit",a)},p=()=>{process.removeListener("uncaughtExceptionMonitor",u),process.removeListener("unhandledRejection",u),process.removeListener("SIGINT",c),process.removeListener("SIGTERM",c),process.removeListener("exit",a)},d=(h="")=>{n=!0,o=h.replace(/\.+$/,""),process.stdout.write(`${Fm.default.gray(c8)}
1533
+ })));`),d.write(`newResult[${no(b)}] = ${C}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");let y=d.compile();return(b,C)=>y(p,b,C)},o,s=qo,i=!Qa.jitless,u=i&&Ep.value,c=t.catchall,l;e._zod.parse=(p,d)=>{l??(l=r.value);let g=p.value;if(!s(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;let m=[];if(i&&u&&d?.async===!1&&d.jitless!==!0)o||(o=n(t.shape)),p=o(p,d);else{p.value={};let C=l.shape;for(let _ of l.keys){let S=C[_],F=S._zod.run({value:g[_],issues:[]},d),$=S._zod.optin==="optional"&&S._zod.optout==="optional";F instanceof Promise?m.push(F.then(I=>$?vb(I,p,_,g):ou(I,p,_))):$?vb(F,p,_,g):ou(F,p,_)}}if(!c)return m.length?Promise.all(m).then(()=>p):p;let f=[],h=l.keySet,y=c._zod,b=y.def.type;for(let C of Object.keys(g)){if(h.has(C))continue;if(b==="never"){f.push(C);continue}let _=y.run({value:g[C],issues:[]},d);_ instanceof Promise?m.push(_.then(S=>ou(S,p,C))):ou(_,p,C)}return f.length&&p.issues.push({code:"unrecognized_keys",keys:f,input:g,inst:e}),m.length?Promise.all(m).then(()=>p):p}});function Cb(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(s=>Cr(s,n,sr())))}),t}var zp=A("$ZodUnion",(e,t)=>{Ee.init(e,t),Se(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Se(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Se(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Se(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>es(n.source)).join("|")})$`)}}),e._zod.parse=(r,n)=>{let o=!1,s=[];for(let i of t.options){let a=i._zod.run({value:r.value,issues:[]},n);if(a instanceof Promise)s.push(a),o=!0;else{if(a.issues.length===0)return a;s.push(a)}}return o?Promise.all(s).then(i=>Cb(i,r,e,n)):Cb(s,r,e,n)}}),ow=A("$ZodDiscriminatedUnion",(e,t)=>{zp.init(e,t);let r=e._zod.parse;Se(e._zod,"propValues",()=>{let o={};for(let s of t.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[a,u]of Object.entries(i)){o[a]||(o[a]=new Set);for(let c of u)o[a].add(c)}}return o});let n=Qi(()=>{let o=t.options,s=new Map;for(let i of o){let a=i._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let u of a){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,i)}}return s});e._zod.parse=(o,s)=>{let i=o.value;if(!qo(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),o;let a=n.value.get(i?.[t.discriminator]);return a?a._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:i,path:[t.discriminator],inst:e}),o)}}),iw=A("$ZodIntersection",(e,t)=>{Ee.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([u,c])=>bb(r,u,c)):bb(r,s,i)}});function Lp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ko(e)&&Ko(t)){let r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(let s of n){let i=Lp(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],s=t[n],i=Lp(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function bb(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),oo(e))return e;let n=Lp(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}var sw=A("$ZodRecord",(e,t)=>{Ee.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Ko(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[];if(t.keyType._zod.values){let i=t.keyType._zod.values;r.value={};for(let u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let c=t.valueType._zod.run({value:o[u],issues:[]},n);c instanceof Promise?s.push(c.then(l=>{l.issues.length&&r.issues.push(...Kr(u,l.issues)),r.value[u]=l.value})):(c.issues.length&&r.issues.push(...Kr(u,c.issues)),r.value[u]=c.value)}let a;for(let u in o)i.has(u)||(a=a??[],a.push(u));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(let i of Reflect.ownKeys(o)){if(i==="__proto__")continue;let a=t.keyType._zod.run({value:i,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(c=>Cr(c,n,sr())),input:i,path:[i],inst:e}),r.value[a.value]=a.value;continue}let u=t.valueType._zod.run({value:o[i],issues:[]},n);u instanceof Promise?s.push(u.then(c=>{c.issues.length&&r.issues.push(...Kr(i,c.issues)),r.value[a.value]=c.value})):(u.issues.length&&r.issues.push(...Kr(i,u.issues)),r.value[a.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}});var aw=A("$ZodEnum",(e,t)=>{Ee.init(e,t);let r=bp(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>Pp.has(typeof n)).map(n=>typeof n=="string"?Tn(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return e._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),uw=A("$ZodLiteral",(e,t)=>{Ee.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Tn(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}});var cw=A("$ZodTransform",(e,t)=>{Ee.init(e,t),e._zod.parse=(r,n)=>{let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new cn;return r.value=o,r}}),lw=A("$ZodOptional",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Se(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${es(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(r,n):r.value===void 0?r:t.innerType._zod.run(r,n)}),pw=A("$ZodNullable",(e,t)=>{Ee.init(e,t),Se(e._zod,"optin",()=>t.innerType._zod.optin),Se(e._zod,"optout",()=>t.innerType._zod.optout),Se(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${es(r.source)}|null)$`):void 0}),Se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),dw=A("$ZodDefault",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>wb(s,t)):wb(o,t)}});function wb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var fw=A("$ZodPrefault",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),mw=A("$ZodNonOptional",(e,t)=>{Ee.init(e,t),Se(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>xb(s,e)):xb(o,e)}});function xb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var gw=A("$ZodCatch",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",Se(e._zod,"optout",()=>t.innerType._zod.optout),Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>Cr(i,n,sr()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>Cr(s,n,sr()))},input:r.value}),r.issues=[]),r)}});var hw=A("$ZodPipe",(e,t)=>{Ee.init(e,t),Se(e._zod,"values",()=>t.in._zod.values),Se(e._zod,"optin",()=>t.in._zod.optin),Se(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,n)=>{let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Sb(s,t,n)):Sb(o,t,n)}});function Sb(e,t,r){return oo(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}var yw=A("$ZodReadonly",(e,t)=>{Ee.init(e,t),Se(e._zod,"propValues",()=>t.innerType._zod.propValues),Se(e._zod,"values",()=>t.innerType._zod.values),Se(e._zod,"optin",()=>t.innerType._zod.optin),Se(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Eb):Eb(o)}});function Eb(e){return e.value=Object.freeze(e.value),e}var Dw=A("$ZodCustom",(e,t)=>{ht.init(e,t),Ee.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>Pb(s,r,n,e));Pb(o,r,n,e)}});function Pb(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Tp(o))}}var rN=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},nN=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(n){return e[n]??null}let r={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"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${rN(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${tu(n.values[0])}`:`Invalid option: expected one of ${Xa(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Xa(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function vw(){return{localeError:nN()}}var UJ=Symbol("ZodOutput"),VJ=Symbol("ZodInput"),jp=class{constructor(){this._map=new Map,this._idmap=new Map}add(t,...r){let n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};function oN(){return new jp}var ns=oN();function Cw(e,t){return new e({type:"string",...j(t)})}function bw(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...j(t)})}function Up(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...j(t)})}function ww(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...j(t)})}function xw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(t)})}function Sw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(t)})}function Ew(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(t)})}function Pw(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...j(t)})}function _w(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...j(t)})}function Aw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(t)})}function Tw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...j(t)})}function Fw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(t)})}function Rw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...j(t)})}function $w(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...j(t)})}function kw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(t)})}function Iw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(t)})}function Nw(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(t)})}function Ow(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(t)})}function Mw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(t)})}function Lw(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...j(t)})}function Bw(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...j(t)})}function zw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...j(t)})}function jw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...j(t)})}function Uw(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(t)})}function Vw(e,t){return new e({type:"string",format:"date",check:"string_format",...j(t)})}function Hw(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...j(t)})}function qw(e,t){return new e({type:"string",format:"duration",check:"string_format",...j(t)})}function Kw(e,t){return new e({type:"number",checks:[],...j(t)})}function Gw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...j(t)})}function Ww(e,t){return new e({type:"boolean",...j(t)})}function Zw(e,t){return new e({type:"null",...j(t)})}function Jw(e){return new e({type:"unknown"})}function Yw(e,t){return new e({type:"never",...j(t)})}function su(e,t){return new Op({check:"less_than",...j(t),value:e,inclusive:!1})}function os(e,t){return new Op({check:"less_than",...j(t),value:e,inclusive:!0})}function au(e,t){return new Mp({check:"greater_than",...j(t),value:e,inclusive:!1})}function is(e,t){return new Mp({check:"greater_than",...j(t),value:e,inclusive:!0})}function uu(e,t){return new ob({check:"multiple_of",...j(t),value:e})}function cu(e,t){return new sb({check:"max_length",...j(t),maximum:e})}function Go(e,t){return new ab({check:"min_length",...j(t),minimum:e})}function lu(e,t){return new ub({check:"length_equals",...j(t),length:e})}function Vp(e,t){return new cb({check:"string_format",format:"regex",...j(t),pattern:e})}function Hp(e){return new lb({check:"string_format",format:"lowercase",...j(e)})}function qp(e){return new pb({check:"string_format",format:"uppercase",...j(e)})}function Kp(e,t){return new db({check:"string_format",format:"includes",...j(t),includes:e})}function Gp(e,t){return new fb({check:"string_format",format:"starts_with",...j(t),prefix:e})}function Wp(e,t){return new mb({check:"string_format",format:"ends_with",...j(t),suffix:e})}function io(e){return new gb({check:"overwrite",tx:e})}function Zp(e){return io(t=>t.normalize(e))}function Jp(){return io(e=>e.trim())}function Yp(){return io(e=>e.toLowerCase())}function Qp(){return io(e=>e.toUpperCase())}function Qw(e,t,r){return new e({type:"array",element:t,...j(r)})}function Xw(e,t,r){let n=j(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function ex(e,t,r){return new e({type:"custom",check:"custom",fn:t,...j(r)})}var as={};zm(as,{ZodISODate:()=>rx,ZodISODateTime:()=>tx,ZodISODuration:()=>ox,ZodISOTime:()=>nx,date:()=>ed,datetime:()=>Xp,duration:()=>rd,time:()=>td});var tx=A("ZodISODateTime",(e,t)=>{Lb.init(e,t),Oe.init(e,t)});function Xp(e){return Uw(tx,e)}var rx=A("ZodISODate",(e,t)=>{Bb.init(e,t),Oe.init(e,t)});function ed(e){return Vw(rx,e)}var nx=A("ZodISOTime",(e,t)=>{zb.init(e,t),Oe.init(e,t)});function td(e){return Hw(nx,e)}var ox=A("ZodISODuration",(e,t)=>{jb.init(e,t),Oe.init(e,t)});function rd(e){return qw(ox,e)}var ix=(e,t)=>{ru.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>xC(e,r)},flatten:{value:r=>wC(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},yY=A("ZodError",ix),us=A("ZodError",ix,{Parent:Error});var sx=SC(us),ax=EC(us),ux=Rp(us),cx=$p(us);var Ue=A("ZodType",(e,t)=>(Ee.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>qr(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>sx(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>ux(e,r,n),e.parseAsync=async(r,n)=>ax(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>cx(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(tO(r,n)),e.superRefine=r=>e.check(rO(r)),e.overwrite=r=>e.check(io(r)),e.optional=()=>je(e),e.nullable=()=>dx(e),e.nullish=()=>je(dx(e)),e.nonoptional=r=>WN(e,r),e.array=()=>oe(e),e.or=r=>Pe([e,r]),e.and=r=>du(e,r),e.transform=r=>od(e,yx(r)),e.default=r=>qN(e,r),e.prefault=r=>GN(e,r),e.catch=r=>JN(e,r),e.pipe=r=>od(e,r),e.readonly=()=>XN(e),e.describe=r=>{let n=e.clone();return ns.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return ns.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return ns.get(e);let n=e.clone();return ns.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),fx=A("_ZodString",(e,t)=>{iu.init(e,t),Ue.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Vp(...n)),e.includes=(...n)=>e.check(Kp(...n)),e.startsWith=(...n)=>e.check(Gp(...n)),e.endsWith=(...n)=>e.check(Wp(...n)),e.min=(...n)=>e.check(Go(...n)),e.max=(...n)=>e.check(cu(...n)),e.length=(...n)=>e.check(lu(...n)),e.nonempty=(...n)=>e.check(Go(1,...n)),e.lowercase=n=>e.check(Hp(n)),e.uppercase=n=>e.check(qp(n)),e.trim=()=>e.check(Jp()),e.normalize=(...n)=>e.check(Zp(...n)),e.toLowerCase=()=>e.check(Yp()),e.toUpperCase=()=>e.check(Qp())}),fN=A("ZodString",(e,t)=>{iu.init(e,t),fx.init(e,t),e.email=r=>e.check(bw(mN,r)),e.url=r=>e.check(Pw(gN,r)),e.jwt=r=>e.check(jw(FN,r)),e.emoji=r=>e.check(_w(hN,r)),e.guid=r=>e.check(Up(lx,r)),e.uuid=r=>e.check(ww(pu,r)),e.uuidv4=r=>e.check(xw(pu,r)),e.uuidv6=r=>e.check(Sw(pu,r)),e.uuidv7=r=>e.check(Ew(pu,r)),e.nanoid=r=>e.check(Aw(yN,r)),e.guid=r=>e.check(Up(lx,r)),e.cuid=r=>e.check(Tw(DN,r)),e.cuid2=r=>e.check(Fw(vN,r)),e.ulid=r=>e.check(Rw(CN,r)),e.base64=r=>e.check(Lw(_N,r)),e.base64url=r=>e.check(Bw(AN,r)),e.xid=r=>e.check($w(bN,r)),e.ksuid=r=>e.check(kw(wN,r)),e.ipv4=r=>e.check(Iw(xN,r)),e.ipv6=r=>e.check(Nw(SN,r)),e.cidrv4=r=>e.check(Ow(EN,r)),e.cidrv6=r=>e.check(Mw(PN,r)),e.e164=r=>e.check(zw(TN,r)),e.datetime=r=>e.check(Xp(r)),e.date=r=>e.check(ed(r)),e.time=r=>e.check(td(r)),e.duration=r=>e.check(rd(r))});function P(e){return Cw(fN,e)}var Oe=A("ZodStringFormat",(e,t)=>{Re.init(e,t),fx.init(e,t)}),mN=A("ZodEmail",(e,t)=>{Tb.init(e,t),Oe.init(e,t)});var lx=A("ZodGUID",(e,t)=>{_b.init(e,t),Oe.init(e,t)});var pu=A("ZodUUID",(e,t)=>{Ab.init(e,t),Oe.init(e,t)});var gN=A("ZodURL",(e,t)=>{Fb.init(e,t),Oe.init(e,t)});var hN=A("ZodEmoji",(e,t)=>{Rb.init(e,t),Oe.init(e,t)});var yN=A("ZodNanoID",(e,t)=>{$b.init(e,t),Oe.init(e,t)});var DN=A("ZodCUID",(e,t)=>{kb.init(e,t),Oe.init(e,t)});var vN=A("ZodCUID2",(e,t)=>{Ib.init(e,t),Oe.init(e,t)});var CN=A("ZodULID",(e,t)=>{Nb.init(e,t),Oe.init(e,t)});var bN=A("ZodXID",(e,t)=>{Ob.init(e,t),Oe.init(e,t)});var wN=A("ZodKSUID",(e,t)=>{Mb.init(e,t),Oe.init(e,t)});var xN=A("ZodIPv4",(e,t)=>{Ub.init(e,t),Oe.init(e,t)});var SN=A("ZodIPv6",(e,t)=>{Vb.init(e,t),Oe.init(e,t)});var EN=A("ZodCIDRv4",(e,t)=>{Hb.init(e,t),Oe.init(e,t)});var PN=A("ZodCIDRv6",(e,t)=>{qb.init(e,t),Oe.init(e,t)});var _N=A("ZodBase64",(e,t)=>{Gb.init(e,t),Oe.init(e,t)});var AN=A("ZodBase64URL",(e,t)=>{Wb.init(e,t),Oe.init(e,t)});var TN=A("ZodE164",(e,t)=>{Zb.init(e,t),Oe.init(e,t)});var FN=A("ZodJWT",(e,t)=>{Jb.init(e,t),Oe.init(e,t)});var mx=A("ZodNumber",(e,t)=>{Bp.init(e,t),Ue.init(e,t),e.gt=(n,o)=>e.check(au(n,o)),e.gte=(n,o)=>e.check(is(n,o)),e.min=(n,o)=>e.check(is(n,o)),e.lt=(n,o)=>e.check(su(n,o)),e.lte=(n,o)=>e.check(os(n,o)),e.max=(n,o)=>e.check(os(n,o)),e.int=n=>e.check(px(n)),e.safe=n=>e.check(px(n)),e.positive=n=>e.check(au(0,n)),e.nonnegative=n=>e.check(is(0,n)),e.negative=n=>e.check(su(0,n)),e.nonpositive=n=>e.check(os(0,n)),e.multipleOf=(n,o)=>e.check(uu(n,o)),e.step=(n,o)=>e.check(uu(n,o)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ye(e){return Kw(mx,e)}var RN=A("ZodNumberFormat",(e,t)=>{Yb.init(e,t),mx.init(e,t)});function px(e){return Gw(RN,e)}var $N=A("ZodBoolean",(e,t)=>{Qb.init(e,t),Ue.init(e,t)});function nt(e){return Ww($N,e)}var kN=A("ZodNull",(e,t)=>{Xb.init(e,t),Ue.init(e,t)});function id(e){return Zw(kN,e)}var IN=A("ZodUnknown",(e,t)=>{ew.init(e,t),Ue.init(e,t)});function Me(){return Jw(IN)}var NN=A("ZodNever",(e,t)=>{tw.init(e,t),Ue.init(e,t)});function ON(e){return Yw(NN,e)}var MN=A("ZodArray",(e,t)=>{rw.init(e,t),Ue.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(Go(r,n)),e.nonempty=r=>e.check(Go(1,r)),e.max=(r,n)=>e.check(cu(r,n)),e.length=(r,n)=>e.check(lu(r,n)),e.unwrap=()=>e.element});function oe(e,t){return Qw(MN,e,t)}var gx=A("ZodObject",(e,t)=>{nw.init(e,t),Ue.init(e,t),me.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Ot(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Me()}),e.loose=()=>e.clone({...e._zod.def,catchall:Me()}),e.strict=()=>e.clone({...e._zod.def,catchall:ON()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>me.extend(e,r),e.merge=r=>me.merge(e,r),e.pick=r=>me.pick(e,r),e.omit=r=>me.omit(e,r),e.partial=(...r)=>me.partial(Dx,e,r[0]),e.required=(...r)=>me.required(vx,e,r[0])});function O(e,t){let r={type:"object",get shape(){return me.assignProp(this,"shape",{...e}),this.shape},...me.normalizeParams(t)};return new gx(r)}function Et(e,t){return new gx({type:"object",get shape(){return me.assignProp(this,"shape",{...e}),this.shape},catchall:Me(),...me.normalizeParams(t)})}var hx=A("ZodUnion",(e,t)=>{zp.init(e,t),Ue.init(e,t),e.options=t.options});function Pe(e,t){return new hx({type:"union",options:e,...me.normalizeParams(t)})}var LN=A("ZodDiscriminatedUnion",(e,t)=>{hx.init(e,t),ow.init(e,t)});function sd(e,t,r){return new LN({type:"union",options:t,discriminator:e,...me.normalizeParams(r)})}var BN=A("ZodIntersection",(e,t)=>{iw.init(e,t),Ue.init(e,t)});function du(e,t){return new BN({type:"intersection",left:e,right:t})}var zN=A("ZodRecord",(e,t)=>{sw.init(e,t),Ue.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Le(e,t,r){return new zN({type:"record",keyType:e,valueType:t,...me.normalizeParams(r)})}var nd=A("ZodEnum",(e,t)=>{aw.init(e,t),Ue.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let s={};for(let i of n)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new nd({...t,checks:[],...me.normalizeParams(o),entries:s})},e.exclude=(n,o)=>{let s={...t.entries};for(let i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new nd({...t,checks:[],...me.normalizeParams(o),entries:s})}});function Ot(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new nd({type:"enum",entries:r,...me.normalizeParams(t)})}var jN=A("ZodLiteral",(e,t)=>{uw.init(e,t),Ue.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"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 B(e,t){return new jN({type:"literal",values:Array.isArray(e)?e:[e],...me.normalizeParams(t)})}var UN=A("ZodTransform",(e,t)=>{cw.init(e,t),Ue.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(me.issue(s,r.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),i.continue??(i.continue=!0),r.issues.push(me.issue(i))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function yx(e){return new UN({type:"transform",transform:e})}var Dx=A("ZodOptional",(e,t)=>{lw.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function je(e){return new Dx({type:"optional",innerType:e})}var VN=A("ZodNullable",(e,t)=>{pw.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function dx(e){return new VN({type:"nullable",innerType:e})}var HN=A("ZodDefault",(e,t)=>{dw.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qN(e,t){return new HN({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var KN=A("ZodPrefault",(e,t)=>{fw.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function GN(e,t){return new KN({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var vx=A("ZodNonOptional",(e,t)=>{mw.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType});function WN(e,t){return new vx({type:"nonoptional",innerType:e,...me.normalizeParams(t)})}var ZN=A("ZodCatch",(e,t)=>{gw.init(e,t),Ue.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function JN(e,t){return new ZN({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var YN=A("ZodPipe",(e,t)=>{hw.init(e,t),Ue.init(e,t),e.in=t.in,e.out=t.out});function od(e,t){return new YN({type:"pipe",in:e,out:t})}var QN=A("ZodReadonly",(e,t)=>{yw.init(e,t),Ue.init(e,t)});function XN(e){return new QN({type:"readonly",innerType:e})}var Cx=A("ZodCustom",(e,t)=>{Dw.init(e,t),Ue.init(e,t)});function eO(e){let t=new ht({check:"custom"});return t._zod.check=e,t}function bx(e,t){return Xw(Cx,e??(()=>!0),t)}function tO(e,t={}){return ex(Cx,e,t)}function rO(e){let t=eO(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(me.issue(n,r.value,t._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(me.issue(o))}},e(r.value,r)));return t}function ad(e,t){return od(yx(e),t)}sr(vw());var wx="io.modelcontextprotocol/related-task",mu="2.0",st=bx(e=>e!==null&&(typeof e=="object"||typeof e=="function")),xx=Pe([P(),ye().int()]),Sx=P(),lQ=Et({ttl:Pe([ye(),id()]).optional(),pollInterval:ye().optional()}),nO=O({ttl:ye().optional()}),oO=O({taskId:P()}),ud=Et({progressToken:xx.optional(),[wx]:oO.optional()}),Wt=O({_meta:ud.optional()}),gu=Wt.extend({task:nO.optional()});var at=O({method:P(),params:Wt.loose().optional()}),ar=O({_meta:ud.optional()}),ur=O({method:P(),params:ar.loose().optional()}),ut=Et({_meta:ud.optional()}),hu=Pe([P(),ye().int()]),iO=O({jsonrpc:B(mu),id:hu,...at.shape}).strict();var sO=O({jsonrpc:B(mu),...ur.shape}).strict();var Ex=O({jsonrpc:B(mu),id:hu,result:ut}).strict();var cs;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(cs||(cs={}));var Px=O({jsonrpc:B(mu),id:hu.optional(),error:O({code:ye().int(),message:P(),data:Me().optional()})}).strict();var aO=Pe([iO,sO,Ex,Px]),pQ=Pe([Ex,Px]),cd=ut.strict(),uO=ar.extend({requestId:hu.optional(),reason:P().optional()}),ld=ur.extend({method:B("notifications/cancelled"),params:uO}),cO=O({src:P(),mimeType:P().optional(),sizes:oe(P()).optional(),theme:Ot(["light","dark"]).optional()}),ls=O({icons:oe(cO).optional()}),Wo=O({name:P(),title:P().optional()}),_x=Wo.extend({...Wo.shape,...ls.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),lO=du(O({applyDefaults:nt().optional()}),Le(P(),Me())),pO=ad(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,du(O({form:lO.optional(),url:st.optional()}),Le(P(),Me()).optional())),dO=Et({list:st.optional(),cancel:st.optional(),requests:Et({sampling:Et({createMessage:st.optional()}).optional(),elicitation:Et({create:st.optional()}).optional()}).optional()}),fO=Et({list:st.optional(),cancel:st.optional(),requests:Et({tools:Et({call:st.optional()}).optional()}).optional()}),mO=O({experimental:Le(P(),st).optional(),sampling:O({context:st.optional(),tools:st.optional()}).optional(),elicitation:pO.optional(),roots:O({listChanged:nt().optional()}).optional(),tasks:dO.optional()}),gO=Wt.extend({protocolVersion:P(),capabilities:mO,clientInfo:_x}),hO=at.extend({method:B("initialize"),params:gO});var yO=O({experimental:Le(P(),st).optional(),logging:st.optional(),completions:st.optional(),prompts:O({listChanged:nt().optional()}).optional(),resources:O({subscribe:nt().optional(),listChanged:nt().optional()}).optional(),tools:O({listChanged:nt().optional()}).optional(),tasks:fO.optional()}),Ax=ut.extend({protocolVersion:P(),capabilities:yO,serverInfo:_x,instructions:P().optional()}),DO=ur.extend({method:B("notifications/initialized"),params:ar.optional()});var pd=at.extend({method:B("ping"),params:Wt.optional()}),vO=O({progress:ye(),total:je(ye()),message:je(P())}),CO=O({...ar.shape,...vO.shape,progressToken:xx}),dd=ur.extend({method:B("notifications/progress"),params:CO}),bO=Wt.extend({cursor:Sx.optional()}),ps=at.extend({params:bO.optional()}),ds=ut.extend({nextCursor:Sx.optional()}),wO=Ot(["working","input_required","completed","failed","cancelled"]),fs=O({taskId:P(),status:wO,ttl:Pe([ye(),id()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:je(ye()),statusMessage:je(P())}),yu=ut.extend({task:fs}),xO=ar.merge(fs),fd=ur.extend({method:B("notifications/tasks/status"),params:xO}),md=at.extend({method:B("tasks/get"),params:Wt.extend({taskId:P()})}),gd=ut.merge(fs),hd=at.extend({method:B("tasks/result"),params:Wt.extend({taskId:P()})}),dQ=ut.loose(),yd=ps.extend({method:B("tasks/list")}),Dd=ds.extend({tasks:oe(fs)}),vd=at.extend({method:B("tasks/cancel"),params:Wt.extend({taskId:P()})}),SO=ut.merge(fs),Tx=O({uri:P(),mimeType:je(P()),_meta:Le(P(),Me()).optional()}),Fx=Tx.extend({text:P()}),Cd=P().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Rx=Tx.extend({blob:Cd}),ms=Ot(["user","assistant"]),Zo=O({audience:oe(ms).optional(),priority:ye().min(0).max(1).optional(),lastModified:as.datetime({offset:!0}).optional()}),$x=O({...Wo.shape,...ls.shape,uri:P(),description:je(P()),mimeType:je(P()),annotations:Zo.optional(),_meta:je(Et({}))}),EO=O({...Wo.shape,...ls.shape,uriTemplate:P(),description:je(P()),mimeType:je(P()),annotations:Zo.optional(),_meta:je(Et({}))}),PO=ps.extend({method:B("resources/list")}),kx=ds.extend({resources:oe($x)}),_O=ps.extend({method:B("resources/templates/list")}),Ix=ds.extend({resourceTemplates:oe(EO)}),bd=Wt.extend({uri:P()}),AO=bd,TO=at.extend({method:B("resources/read"),params:AO}),Nx=ut.extend({contents:oe(Pe([Fx,Rx]))}),Ox=ur.extend({method:B("notifications/resources/list_changed"),params:ar.optional()}),FO=bd,RO=at.extend({method:B("resources/subscribe"),params:FO}),$O=bd,kO=at.extend({method:B("resources/unsubscribe"),params:$O}),IO=ar.extend({uri:P()}),NO=ur.extend({method:B("notifications/resources/updated"),params:IO}),OO=O({name:P(),description:je(P()),required:je(nt())}),MO=O({...Wo.shape,...ls.shape,description:je(P()),arguments:je(oe(OO)),_meta:je(Et({}))}),LO=ps.extend({method:B("prompts/list")}),Mx=ds.extend({prompts:oe(MO)}),BO=Wt.extend({name:P(),arguments:Le(P(),P()).optional()}),zO=at.extend({method:B("prompts/get"),params:BO}),wd=O({type:B("text"),text:P(),annotations:Zo.optional(),_meta:Le(P(),Me()).optional()}),xd=O({type:B("image"),data:Cd,mimeType:P(),annotations:Zo.optional(),_meta:Le(P(),Me()).optional()}),Sd=O({type:B("audio"),data:Cd,mimeType:P(),annotations:Zo.optional(),_meta:Le(P(),Me()).optional()}),jO=O({type:B("tool_use"),name:P(),id:P(),input:Le(P(),Me()),_meta:Le(P(),Me()).optional()}),UO=O({type:B("resource"),resource:Pe([Fx,Rx]),annotations:Zo.optional(),_meta:Le(P(),Me()).optional()}),VO=$x.extend({type:B("resource_link")}),Ed=Pe([wd,xd,Sd,VO,UO]),HO=O({role:ms,content:Ed}),Lx=ut.extend({description:P().optional(),messages:oe(HO)}),Bx=ur.extend({method:B("notifications/prompts/list_changed"),params:ar.optional()}),qO=O({title:P().optional(),readOnlyHint:nt().optional(),destructiveHint:nt().optional(),idempotentHint:nt().optional(),openWorldHint:nt().optional()}),KO=O({taskSupport:Ot(["required","optional","forbidden"]).optional()}),zx=O({...Wo.shape,...ls.shape,description:P().optional(),inputSchema:O({type:B("object"),properties:Le(P(),st).optional(),required:oe(P()).optional()}).catchall(Me()),outputSchema:O({type:B("object"),properties:Le(P(),st).optional(),required:oe(P()).optional()}).catchall(Me()).optional(),annotations:qO.optional(),execution:KO.optional(),_meta:Le(P(),Me()).optional()}),GO=ps.extend({method:B("tools/list")}),jx=ds.extend({tools:oe(zx)}),Du=ut.extend({content:oe(Ed).default([]),structuredContent:Le(P(),Me()).optional(),isError:nt().optional()}),fQ=Du.or(ut.extend({toolResult:Me()})),WO=gu.extend({name:P(),arguments:Le(P(),Me()).optional()}),ZO=at.extend({method:B("tools/call"),params:WO}),Ux=ur.extend({method:B("notifications/tools/list_changed"),params:ar.optional()}),JO=O({autoRefresh:nt().default(!0),debounceMs:ye().int().nonnegative().default(300)}),Vx=Ot(["debug","info","notice","warning","error","critical","alert","emergency"]),YO=Wt.extend({level:Vx}),QO=at.extend({method:B("logging/setLevel"),params:YO}),XO=ar.extend({level:Vx,logger:P().optional(),data:Me()}),e2=ur.extend({method:B("notifications/message"),params:XO}),t2=O({name:P().optional()}),r2=O({hints:oe(t2).optional(),costPriority:ye().min(0).max(1).optional(),speedPriority:ye().min(0).max(1).optional(),intelligencePriority:ye().min(0).max(1).optional()}),n2=O({mode:Ot(["auto","required","none"]).optional()}),o2=O({type:B("tool_result"),toolUseId:P().describe("The unique identifier for the corresponding tool call."),content:oe(Ed).default([]),structuredContent:O({}).loose().optional(),isError:nt().optional(),_meta:Le(P(),Me()).optional()}),i2=sd("type",[wd,xd,Sd]),fu=sd("type",[wd,xd,Sd,jO,o2]),s2=O({role:ms,content:Pe([fu,oe(fu)]),_meta:Le(P(),Me()).optional()}),a2=gu.extend({messages:oe(s2),modelPreferences:r2.optional(),systemPrompt:P().optional(),includeContext:Ot(["none","thisServer","allServers"]).optional(),temperature:ye().optional(),maxTokens:ye().int(),stopSequences:oe(P()).optional(),metadata:st.optional(),tools:oe(zx).optional(),toolChoice:n2.optional()}),Hx=at.extend({method:B("sampling/createMessage"),params:a2}),qx=ut.extend({model:P(),stopReason:je(Ot(["endTurn","stopSequence","maxTokens"]).or(P())),role:ms,content:i2}),u2=ut.extend({model:P(),stopReason:je(Ot(["endTurn","stopSequence","maxTokens","toolUse"]).or(P())),role:ms,content:Pe([fu,oe(fu)])}),c2=O({type:B("boolean"),title:P().optional(),description:P().optional(),default:nt().optional()}),l2=O({type:B("string"),title:P().optional(),description:P().optional(),minLength:ye().optional(),maxLength:ye().optional(),format:Ot(["email","uri","date","date-time"]).optional(),default:P().optional()}),p2=O({type:Ot(["number","integer"]),title:P().optional(),description:P().optional(),minimum:ye().optional(),maximum:ye().optional(),default:ye().optional()}),d2=O({type:B("string"),title:P().optional(),description:P().optional(),enum:oe(P()),default:P().optional()}),f2=O({type:B("string"),title:P().optional(),description:P().optional(),oneOf:oe(O({const:P(),title:P()})),default:P().optional()}),m2=O({type:B("string"),title:P().optional(),description:P().optional(),enum:oe(P()),enumNames:oe(P()).optional(),default:P().optional()}),g2=Pe([d2,f2]),h2=O({type:B("array"),title:P().optional(),description:P().optional(),minItems:ye().optional(),maxItems:ye().optional(),items:O({type:B("string"),enum:oe(P())}),default:oe(P()).optional()}),y2=O({type:B("array"),title:P().optional(),description:P().optional(),minItems:ye().optional(),maxItems:ye().optional(),items:O({anyOf:oe(O({const:P(),title:P()}))}),default:oe(P()).optional()}),D2=Pe([h2,y2]),v2=Pe([m2,g2,D2]),C2=Pe([v2,c2,l2,p2]),b2=gu.extend({mode:B("form").optional(),message:P(),requestedSchema:O({type:B("object"),properties:Le(P(),C2),required:oe(P()).optional()})}),w2=gu.extend({mode:B("url"),message:P(),elicitationId:P(),url:P().url()}),x2=Pe([b2,w2]),Kx=at.extend({method:B("elicitation/create"),params:x2}),S2=ar.extend({elicitationId:P()}),E2=ur.extend({method:B("notifications/elicitation/complete"),params:S2}),Gx=ut.extend({action:Ot(["accept","decline","cancel"]),content:ad(e=>e===null?void 0:e,Le(P(),Pe([P(),ye(),nt(),oe(P())])).optional())}),P2=O({type:B("ref/resource"),uri:P()});var _2=O({type:B("ref/prompt"),name:P()}),A2=Wt.extend({ref:Pe([_2,P2]),argument:O({name:P(),value:P()}),context:O({arguments:Le(P(),P()).optional()}).optional()}),T2=at.extend({method:B("completion/complete"),params:A2});var Wx=ut.extend({completion:Et({values:oe(P()).max(100),total:je(ye().int()),hasMore:je(nt())})}),F2=O({uri:P().startsWith("file://"),name:P().optional(),_meta:Le(P(),Me()).optional()}),R2=at.extend({method:B("roots/list"),params:Wt.optional()}),$2=ut.extend({roots:oe(F2)}),k2=ur.extend({method:B("notifications/roots/list_changed"),params:ar.optional()}),mQ=Pe([pd,hO,T2,QO,zO,LO,PO,_O,TO,RO,kO,ZO,GO,md,hd,yd,vd]),gQ=Pe([ld,dd,DO,k2,fd]),hQ=Pe([cd,qx,u2,Gx,$2,gd,Dd,yu]),yQ=Pe([pd,Hx,Kx,R2,md,hd,yd,vd]),DQ=Pe([ld,dd,e2,NO,Ox,Ux,Bx,fd,E2]),vQ=Pe([cd,Ax,Wx,Lx,Mx,kx,Ix,Nx,Du,jx,gd,Dd,yu]);var I2=Symbol("Let zodToJsonSchema decide on which parser to use");var QQ=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Fj=Ve(lm(),1),Rj=Ve(jE(),1);var o8=Ve(TP(),1);import i8 from"node:process";var soe=i8.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];import*as S8 from"@sentry/node";var E8=Ve(IP(),1);var P8=()=>{if(typeof globalThis<"u"&&globalThis.crypto)return globalThis.crypto;if(typeof G<"u")try{let e=G("crypto");if(e.webcrypto)return e.webcrypto}catch{}throw new Error("Web Crypto API is not available. Requires Node.js 15+ or a browser environment.")},boe=P8();import NP from"node:process";function Tm(){let{env:e}=NP,{TERM:t,TERM_PROGRAM:r}=e;return NP.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Fm=Ve(Vn(),1),mi=Ve(oa(),1),qs=Ve(Vn(),1),$m=()=>{let e=Rm?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],t=Rm?80:120,r,n=!1,o="",s="",i="",a=h=>{let y=h>1?"Something went wrong":"Canceled";n&&g(y,h)},u=(h,y)=>{console.error(y,h),a(2)},c=()=>a(1),l=()=>{process.on("uncaughtExceptionMonitor",u),process.on("unhandledRejection",u),process.on("SIGINT",c),process.on("SIGTERM",c),process.on("exit",a)},p=()=>{process.removeListener("uncaughtExceptionMonitor",u),process.removeListener("unhandledRejection",u),process.removeListener("SIGINT",c),process.removeListener("SIGTERM",c),process.removeListener("exit",a)},d=(h="")=>{n=!0,o=h.replace(/\.+$/,""),process.stdout.write(`${Fm.default.gray(A8)}
1534
1534
  `);let y=0,b=0;l(),process.env.CI||(r=setInterval(()=>{let C=Fm.default.magenta(e[y]),_=".".repeat(Math.floor(b)).slice(0,3);process.stdout.write(mi.cursor.move(-999,-i.split(`
1535
1535
  `).length+1)),process.stdout.write(mi.erase.down(i.split(`
1536
- `).length));let S=`${C} ${o}${_}${s}`;process.stdout.write(S),y=y+1<e.length?y+1:0,b=b<e.length?b+.125:0,i=S},t))},g=(h,y=0)=>{o=h??o,n=!1,clearInterval(r);let b=y===0?(0,qs.green)(d8):y===1?(0,qs.red)(l8):(0,qs.red)(p8);process.stdout.write(mi.cursor.move(-999,-i.split(`
1536
+ `).length));let S=`${C} ${o}${_}${s}`;process.stdout.write(S),y=y+1<e.length?y+1:0,b=b<e.length?b+.125:0,i=S},t))},g=(h,y=0)=>{o=h??o,n=!1,clearInterval(r);let b=y===0?(0,qs.green)(R8):y===1?(0,qs.red)(T8):(0,qs.red)(F8);process.stdout.write(mi.cursor.move(-999,-i.split(`
1537
1537
  `).length+1)),process.stdout.write(mi.erase.down(i.split(`
1538
1538
  `).length)),process.stdout.write(`${b} ${o}
1539
- `),i=o,p()};return{start:d,stop:g,message:(h="")=>{o=h??o},extra:(h="")=>{s=h}}},Tm=Am(),tc=(e,t)=>Tm?e:t,c8=tc("\u2502","|"),l8=tc("\u25A0","x"),p8=tc("\u25B2","x"),d8=tc("\u25C7","o");import{spawn as f8}from"child_process";async function km(e){try{let s=(await import("open")).default;await s(e);return}catch{}let t=process.platform,r,n;if(t==="darwin")r="open",n=[e];else if(t==="win32"){let o=e.replace(/`/g,"``").replace(/"/g,'`"').replace(/\$/g,"`$");r="powershell",n=["-NoProfile","-Command",`Start-Process "${o}"`]}else r="xdg-open",n=[e];return new Promise((o,s)=>{let i=f8(r,n,{stdio:"ignore",detached:!0});i.on("error",s),i.on("close",a=>{a===0?o():s(new Error(`Failed to open browser with exit code ${a}`))}),i.unref()})}import*as g8 from"@sentry/node";var Ise=`
1540
- `+(0,Xr.dim)("ESC to interrupt");import*as fr from"typescript";function Rm(e){return!(e.category!==fr.DiagnosticCategory.Error||!e.file||e.code===6133||e.code===6138||e.code===6305||e.code===6196||e.code===6192||e.code===6198||e.code===6199||e.code===6205||e.code===1449||e.code===2578||e.code===7006||e.code===5074||e.code===7026||e.code===2503||e.code===2695||e.code===2322)}async function h8(e,t,r){let n=[],o=[t],s=e.relative(e.getAppRootDir(),t.fileName);for(;o.length>0;){let i=o.shift();if(b8(i,t)){let a=D8(e,i,t,r),{line:u,character:c}=t.getLineAndCharacterOfPosition(i.getStart());a&&(a.loc=`${s}:${u+1}:${c+1}`,n.push(a))}o.push(...i.getChildren(t))}return n}var y8="figmaMapping";function D8(e,t,r,n){let[o]=t.arguments;if(!o)throw new Error("Invalid figmaMapping call, no arguments found");if(!Z.isObjectLiteralExpression(o))throw new Error("Invalid figmaMapping call, argument is not an object literal");let s=o.properties;if(!s)throw new Error("Invalid figmaMapping call, argument has no properties");let i="",a,u,c,l="-",p=e.basename(r.fileName).replace(/\.mapper\.[tsxjm]+$/,""),d,g,m,f,h;if(t.typeArguments&&t.typeArguments.length>0){let k=NP(t.typeArguments[0].getText(r));k&&(p=k)}for(let k of s){let I=k.name?.getText(r);if(!I)throw new Error("Invalid figmaMapping call, property has no name");switch(I){case"componentName":{if(!("initializer"in k))throw new Error("Invalid figmaMapping call, componentName has no initializer");let R=k.initializer;if(!Z.isStringLiteral(R))throw new Error("Invalid figmaMapping call, componentName is not a string literal");a=R.text;break}case"url":{if(!("initializer"in k))throw new Error("Invalid figmaMapping call, url has no initializer");let R=k.initializer;if(!Z.isStringLiteral(R))throw new Error("Invalid figmaMapping call, url is not a string literal");f=R.text;break}case"componentKey":{if(!("initializer"in k))throw new Error("Invalid figmaMapping call, componentKey has no initializer");let R=k.initializer;if(!Z.isStringLiteral(R))throw new Error("Invalid figmaMapping call, componentKey is not a string literal");i=R.text;break}case"meta":{if(!("initializer"in k))throw new Error("Invalid figmaMapping call, meta has no initializer");let R=k.initializer;if(Z.isObjectLiteralExpression(R)){h={imports:[]};for(let $ of R.properties)Z.isPropertyAssignment($)&&Z.isIdentifier($.name)&&$.name.text==="imports"&&Z.isArrayLiteralExpression($.initializer)&&(h.imports=$.initializer.elements.map(B=>{if(Z.isStringLiteral(B))return B.text;if(Z.isObjectLiteralExpression(B)){let U={};for(let H of B.properties)if(Z.isPropertyAssignment(H)&&Z.isIdentifier(H.name)){let w=H.name.text;Z.isStringLiteral(H.initializer)&&(U[w]=H.initializer.text)}return U}return null}).filter(Boolean))}break}case"mapper":if(Z.isMethodDeclaration(k)){let R=function(D){let U=n.getSymbolAtLocation(D)?.getDeclarations()?.[0];if(U){let H=C8(U);if(H?.importClause){let w=H.importClause.name?.getText(r);return w===l?(d="default",g=w):H.importClause.namedBindings&&Z.isNamedImports(H.importClause.namedBindings)&&(d="named",H.importClause.namedBindings.elements.forEach(E=>{E.name.getText(r)===l&&(g=E.name.getText(r))})),g&&Z.isStringLiteral(H.moduleSpecifier)&&(m=H.moduleSpecifier.text),!0}}return!1},$=function(D){if((Z.isJsxOpeningElement(D)||Z.isJsxSelfClosingElement(D))&&Z.isIdentifier(D.tagName)){l=D.tagName.getText(r),R(D.tagName);return}else if(Z.isTaggedTemplateExpression(D)&&Z.isIdentifier(D.tag)&&(D.tag.escapedText==="html"||D.tag.escapedText==="tmpl")){if(Z.isTemplateExpression(D.template)){let U=D.template.templateSpans.find(H=>Z.isIdentifier(H.expression)&&v8(H.expression.text)&&R(H.expression));if(U&&Z.isIdentifier(U.expression)){l=U.expression.text;return}}let B=D.template.getText(r).match(/^`\s*<([^\s]+)/);if(B){l=B[1];return}if(B=D.template.getText(r).match(/^`\s*([^\s]+)/),B){l=B[1];return}}else Z.forEachChild(D,$)};var S=R,T=$;if(k.parameters&&k.parameters.length>0&&k.parameters[0]&&k.parameters[0].type){let D=k.parameters[0].type.getText(r),B=NP(D);B&&(p=B)}Z.forEachChild(k,$),c=k.getText(r).replace(/^mapper/,"function Mapper"),u=Im(c);break}case"designTokenMapper":if(Z.isMethodDeclaration(k)){c=k.getText(r).replace(/^designTokenMapper/,"function Mapper"),u=Im(c),i="design-tokens";break}case"genericMapper":if(Z.isMethodDeclaration(k)){c=k.getText(r).replace(/^genericMapper/,"function Mapper"),u=Im(c),i="*";break}}}if(!i&&!f)throw new Error("Invalid figmaMapping call, no componentKey or url found");if(!i&&!u)throw new Error("Invalid figmaMapping call, no mapper found");if(!i&&!c)throw new Error("Invalid figmaMapping call, no original mapper found");let y=S8(r),b=h?.imports??[],C=[],_=[];C.push(...y);for(let k of b)typeof k=="string"?_.push(k):C.push(k);return{builderName:l,figmaName:a??p,figmaKey:i,figmaUrl:f,inputMapper:u,exportType:d,importName:g,importPath:m,originalInputMapper:c,imports:C,importStrings:_.length>0?_:void 0,source:"cli"}}function v8(e){return e.charAt(0)===e.charAt(0).toUpperCase()}function Im(e){return Z.transpile(e,{target:Z.ScriptTarget.Latest,allowNonTsExtensions:!0,moduleResolution:Z.ModuleResolutionKind.NodeJs,module:Z.ModuleKind.CommonJS,noImplicitAny:!1,esModuleInterop:!0,noUnusedLocals:!1,noUnusedParameters:!1,jsx:Z.JsxEmit.React,jsxFactory:"React.createElement",jsxFragmentFactory:"React.Fragment",allowJs:!0,checkJs:!0,strict:!0,suppressImplicitAnyIndexErrors:!0,typeRoots:["node_modules/@types"],inlineSources:!0,inlineSourceMap:!0})}function C8(e){let t=e;for(;t;){if(Z.isImportDeclaration(t))return t;t=t.parent}}function b8(e,t){return Z.isCallExpression(e)&&e.expression.getText(t)===y8}async function OP(e){let t=["node_modules","dist","build","public"];return(await e.readdirRecursive(e.getAppRootDir(),t)).filter(n=>Jt(n))}function NP(e){let t=e.match(/^Figma(\w+)Props$/);if(t&&typeof t[1]=="string")return t[1]}async function MP(e,t,r,n=!1){try{return r||(r=await Aa(e)),(await r.setPublicApiKey({publicApiKey:t})).modifiedType==="permission-error"?{success:!1,error:"permission-error"}:(n&&await r.ensureFigmaImportPage(),{success:!0})}catch(o){let s="unknown-error";return o instanceof Error?s=o.message:typeof o=="string"&&(s=o),{success:!1,error:s}}}var w8={getCanonicalFileName:e=>e,getCurrentDirectory:()=>Z.sys.getCurrentDirectory(),getNewLine:()=>Z.sys.newLine};function x8(e){return Z.formatDiagnosticsWithColorAndContext(e,w8)}async function BP({sys:e,mappingFiles:t,typeCheck:r}){if(e.Sentry?.setContext("findMappings",{mappingFiles:t}),!t.length)return{mapperFiles:[],figmaBuilderLinks:[],figmaLinksToResolve:[],diagnostics:[]};let n=[],o=[],s=[],i=await We(e,t),a=i.getTypeChecker(),u=i.getSyntacticDiagnostics().filter(Rm).filter(p=>p.file?.fileName?t.includes(p.file.fileName):!1);if(u.length>0)return te.error(`At least one of the mappings contain syntactic errors:
1539
+ `),i=o,p()};return{start:d,stop:g,message:(h="")=>{o=h??o},extra:(h="")=>{s=h}}},Rm=Tm(),rc=(e,t)=>Rm?e:t,A8=rc("\u2502","|"),T8=rc("\u25A0","x"),F8=rc("\u25B2","x"),R8=rc("\u25C7","o");import{spawn as $8}from"child_process";async function km(e){try{let s=(await import("open")).default;await s(e);return}catch{}let t=process.platform,r,n;if(t==="darwin")r="open",n=[e];else if(t==="win32"){let o=e.replace(/`/g,"``").replace(/"/g,'`"').replace(/\$/g,"`$");r="powershell",n=["-NoProfile","-Command",`Start-Process "${o}"`]}else r="xdg-open",n=[e];return new Promise((o,s)=>{let i=$8(r,n,{stdio:"ignore",detached:!0});i.on("error",s),i.on("close",a=>{a===0?o():s(new Error(`Failed to open browser with exit code ${a}`))}),i.unref()})}import*as I8 from"@sentry/node";var Xse=`
1540
+ `+(0,Xr.dim)("ESC to interrupt");import*as fr from"typescript";function Im(e){return!(e.category!==fr.DiagnosticCategory.Error||!e.file||e.code===6133||e.code===6138||e.code===6305||e.code===6196||e.code===6192||e.code===6198||e.code===6199||e.code===6205||e.code===1449||e.code===2578||e.code===7006||e.code===5074||e.code===7026||e.code===2503||e.code===2695||e.code===2322)}async function N8(e,t,r){let n=[],o=[t],s=e.relative(e.getAppRootDir(),t.fileName);for(;o.length>0;){let i=o.shift();if(z8(i,t)){let a=M8(e,i,t,r),{line:u,character:c}=t.getLineAndCharacterOfPosition(i.getStart());a&&(a.loc=`${s}:${u+1}:${c+1}`,n.push(a))}o.push(...i.getChildren(t))}return n}var O8="figmaMapping";function M8(e,t,r,n){let[o]=t.arguments;if(!o)throw new Error("Invalid figmaMapping call, no arguments found");if(!Z.isObjectLiteralExpression(o))throw new Error("Invalid figmaMapping call, argument is not an object literal");let s=o.properties;if(!s)throw new Error("Invalid figmaMapping call, argument has no properties");let i="",a,u,c,l="-",p=e.basename(r.fileName).replace(/\.mapper\.[tsxjm]+$/,""),d,g,m,f,h;if(t.typeArguments&&t.typeArguments.length>0){let $=OP(t.typeArguments[0].getText(r));$&&(p=$)}for(let $ of s){let I=$.name?.getText(r);if(!I)throw new Error("Invalid figmaMapping call, property has no name");switch(I){case"componentName":{if(!("initializer"in $))throw new Error("Invalid figmaMapping call, componentName has no initializer");let k=$.initializer;if(!Z.isStringLiteral(k))throw new Error("Invalid figmaMapping call, componentName is not a string literal");a=k.text;break}case"url":{if(!("initializer"in $))throw new Error("Invalid figmaMapping call, url has no initializer");let k=$.initializer;if(!Z.isStringLiteral(k))throw new Error("Invalid figmaMapping call, url is not a string literal");f=k.text;break}case"componentKey":{if(!("initializer"in $))throw new Error("Invalid figmaMapping call, componentKey has no initializer");let k=$.initializer;if(!Z.isStringLiteral(k))throw new Error("Invalid figmaMapping call, componentKey is not a string literal");i=k.text;break}case"meta":{if(!("initializer"in $))throw new Error("Invalid figmaMapping call, meta has no initializer");let k=$.initializer;if(Z.isObjectLiteralExpression(k)){h={imports:[]};for(let R of k.properties)Z.isPropertyAssignment(R)&&Z.isIdentifier(R.name)&&R.name.text==="imports"&&Z.isArrayLiteralExpression(R.initializer)&&(h.imports=R.initializer.elements.map(L=>{if(Z.isStringLiteral(L))return L.text;if(Z.isObjectLiteralExpression(L)){let U={};for(let H of L.properties)if(Z.isPropertyAssignment(H)&&Z.isIdentifier(H.name)){let w=H.name.text;Z.isStringLiteral(H.initializer)&&(U[w]=H.initializer.text)}return U}return null}).filter(Boolean))}break}case"mapper":if(Z.isMethodDeclaration($)){let k=function(D){let U=n.getSymbolAtLocation(D)?.getDeclarations()?.[0];if(U){let H=B8(U);if(H?.importClause){let w=H.importClause.name?.getText(r);return w===l?(d="default",g=w):H.importClause.namedBindings&&Z.isNamedImports(H.importClause.namedBindings)&&(d="named",H.importClause.namedBindings.elements.forEach(E=>{E.name.getText(r)===l&&(g=E.name.getText(r))})),g&&Z.isStringLiteral(H.moduleSpecifier)&&(m=H.moduleSpecifier.text),!0}}return!1},R=function(D){if((Z.isJsxOpeningElement(D)||Z.isJsxSelfClosingElement(D))&&Z.isIdentifier(D.tagName)){l=D.tagName.getText(r),k(D.tagName);return}else if(Z.isTaggedTemplateExpression(D)&&Z.isIdentifier(D.tag)&&(D.tag.escapedText==="html"||D.tag.escapedText==="tmpl")){if(Z.isTemplateExpression(D.template)){let U=D.template.templateSpans.find(H=>Z.isIdentifier(H.expression)&&L8(H.expression.text)&&k(H.expression));if(U&&Z.isIdentifier(U.expression)){l=U.expression.text;return}}let L=D.template.getText(r).match(/^`\s*<([^\s]+)/);if(L){l=L[1];return}if(L=D.template.getText(r).match(/^`\s*([^\s]+)/),L){l=L[1];return}}else Z.forEachChild(D,R)};var S=k,F=R;if($.parameters&&$.parameters.length>0&&$.parameters[0]&&$.parameters[0].type){let D=$.parameters[0].type.getText(r),L=OP(D);L&&(p=L)}Z.forEachChild($,R),c=$.getText(r).replace(/^mapper/,"function Mapper"),u=Nm(c);break}case"designTokenMapper":if(Z.isMethodDeclaration($)){c=$.getText(r).replace(/^designTokenMapper/,"function Mapper"),u=Nm(c),i="design-tokens";break}case"genericMapper":if(Z.isMethodDeclaration($)){c=$.getText(r).replace(/^genericMapper/,"function Mapper"),u=Nm(c),i="*";break}}}if(!i&&!f)throw new Error("Invalid figmaMapping call, no componentKey or url found");if(!i&&!u)throw new Error("Invalid figmaMapping call, no mapper found");if(!i&&!c)throw new Error("Invalid figmaMapping call, no original mapper found");let y=V8(r),b=h?.imports??[],C=[],_=[];C.push(...y);for(let $ of b)typeof $=="string"?_.push($):C.push($);return{builderName:l,figmaName:a??p,figmaKey:i,figmaUrl:f,inputMapper:u,exportType:d,importName:g,importPath:m,originalInputMapper:c,imports:C,importStrings:_.length>0?_:void 0,source:"cli"}}function L8(e){return e.charAt(0)===e.charAt(0).toUpperCase()}function Nm(e){return Z.transpile(e,{target:Z.ScriptTarget.Latest,allowNonTsExtensions:!0,moduleResolution:Z.ModuleResolutionKind.NodeJs,module:Z.ModuleKind.CommonJS,noImplicitAny:!1,esModuleInterop:!0,noUnusedLocals:!1,noUnusedParameters:!1,jsx:Z.JsxEmit.React,jsxFactory:"React.createElement",jsxFragmentFactory:"React.Fragment",allowJs:!0,checkJs:!0,strict:!0,suppressImplicitAnyIndexErrors:!0,typeRoots:["node_modules/@types"],inlineSources:!0,inlineSourceMap:!0})}function B8(e){let t=e;for(;t;){if(Z.isImportDeclaration(t))return t;t=t.parent}}function z8(e,t){return Z.isCallExpression(e)&&e.expression.getText(t)===O8}async function MP(e){let t=["node_modules","dist","build","public"];return(await e.readdirRecursive(e.getAppRootDir(),t)).filter(n=>Jt(n))}function OP(e){let t=e.match(/^Figma(\w+)Props$/);if(t&&typeof t[1]=="string")return t[1]}async function LP(e,t,r,n=!1){try{return r||(r=await Aa(e)),(await r.setPublicApiKey({publicApiKey:t})).modifiedType==="permission-error"?{success:!1,error:"permission-error"}:(n&&await r.ensureFigmaImportPage(),{success:!0})}catch(o){let s="unknown-error";return o instanceof Error?s=o.message:typeof o=="string"&&(s=o),{success:!1,error:s}}}var j8={getCanonicalFileName:e=>e,getCurrentDirectory:()=>Z.sys.getCurrentDirectory(),getNewLine:()=>Z.sys.newLine};function U8(e){return Z.formatDiagnosticsWithColorAndContext(e,j8)}async function BP({sys:e,mappingFiles:t,typeCheck:r}){if(e.Sentry?.setContext("findMappings",{mappingFiles:t}),!t.length)return{mapperFiles:[],figmaBuilderLinks:[],figmaLinksToResolve:[],diagnostics:[]};let n=[],o=[],s=[],i=await Ze(e,t),a=i.getTypeChecker(),u=i.getSyntacticDiagnostics().filter(Im).filter(p=>p.file?.fileName?t.includes(p.file.fileName):!1);if(u.length>0)return te.error(`At least one of the mappings contain syntactic errors:
1541
1541
 
1542
- ${x8(u)}`),sn(1);let c=[...r?i.getSemanticDiagnostics():[]].filter(Rm);for(let p of t)try{let d=i.getSourceFile(p);if(!d){e.Sentry?.captureException(new Error("Could not find source file"),{extra:{file:p,sourceFiles:i.getSourceFiles().map(f=>f.fileName)},level:"warning"});continue}let g=d?.fileName;if(o.push({filePath:p,content:d.getText()}),g){let f=c.filter(h=>h.file?.fileName===g);f.length>0&&s.push(...f)}let m=await h8(e,d,a);n.push(...m)}catch(d){return e.Sentry?.captureException(d),await sn(1)}let l=n.filter(p=>p.figmaUrl&&!p.figmaKey).map(p=>p.figmaUrl);return{mapperFiles:o,figmaBuilderLinks:n,figmaLinksToResolve:l,diagnostics:s}}function S8(e){let t=[];for(let r of e.statements){if(!Z.isImportDeclaration(r)||!r.importClause||r.importClause.isTypeOnly||!Z.isStringLiteral(r.moduleSpecifier))continue;let n=r.moduleSpecifier.text;if(n.startsWith("@builder.io"))continue;r.importClause.name&&t.push({importType:"default",importName:r.importClause.name.text,importPath:n});let o=r.importClause.namedBindings;if(o&&Z.isNamedImports(o))for(let s of o.elements)s.isTypeOnly||t.push({importType:"named",importName:s.name.text,importPath:n})}return t}import{randomUUID as _8}from"crypto";var A8=5294,F8=5284,Om=4,Nm=e=>!!(process.env.CI||e.ci),T8=(e,t)=>{let r=Nm(t)?{}:Bm(e),n=r.spaceName,o=t.builderUserId??process.env.BUILDER_USER_ID??r.userId,s=t.builderPublicKey??process.env.BUILDER_PUBLIC_KEY??r.builderPublicKey,i=t.builderPrivateKey??process.env.BUILDER_PRIVATE_KEY??r.builderPrivateKey,a=process.env.FIGMA_PERSONAL_TOKEN??t.figmaToken,u;return a?u={access_token:a,oauth:!1}:u=r.figmaAuth,{spaceName:n,userId:o,builderPublicKey:s,builderPrivateKey:i,figmaAuth:u,timestamp:r.timestamp}},zi=async(e,t,r)=>{let{spaceName:n,userId:o,builderPublicKey:s,builderPrivateKey:i,figmaAuth:a,timestamp:u}=T8(e,t);if(r.forceSpaceId&&!t.yes&&s&&s!==r.forceSpaceId)if(te.warning(`You are currently authenticated for space ${(0,Bn.yellow)(s)} (${n||"unnamed"}), but this command requires space ${(0,Bn.green)(r.forceSpaceId)}.`),await bi({message:"You must switch to the correct space to continue with this code generation command.",options:[{value:"switch",label:"Switch to required space",hint:"Authenticate with the correct space and continue"},{value:"exit",label:"Exit code generation",hint:"Cancel the command and stay in current space"}]})==="switch")s=r.forceSpaceId,i=void 0,n=void 0,o=void 0;else return te.info("Code generation cancelled. You can run the command again when you're ready to switch spaces."),await sn(1);if(Nm(t)){if(!a&&r.requireFigmaAuth==="if-unset")throw new Error(`No Figma personal token found.
1542
+ ${U8(u)}`),sn(1);let c=[...r?i.getSemanticDiagnostics():[]].filter(Im);for(let p of t)try{let d=i.getSourceFile(p);if(!d){e.Sentry?.captureException(new Error("Could not find source file"),{extra:{file:p,sourceFiles:i.getSourceFiles().map(f=>f.fileName)},level:"warning"});continue}let g=d?.fileName;if(o.push({filePath:p,content:d.getText()}),g){let f=c.filter(h=>h.file?.fileName===g);f.length>0&&s.push(...f)}let m=await N8(e,d,a);n.push(...m)}catch(d){return e.Sentry?.captureException(d),await sn(1)}let l=n.filter(p=>p.figmaUrl&&!p.figmaKey).map(p=>p.figmaUrl);return{mapperFiles:o,figmaBuilderLinks:n,figmaLinksToResolve:l,diagnostics:s}}function V8(e){let t=[];for(let r of e.statements){if(!Z.isImportDeclaration(r)||!r.importClause||r.importClause.isTypeOnly||!Z.isStringLiteral(r.moduleSpecifier))continue;let n=r.moduleSpecifier.text;if(n.startsWith("@builder.io"))continue;r.importClause.name&&t.push({importType:"default",importName:r.importClause.name.text,importPath:n});let o=r.importClause.namedBindings;if(o&&Z.isNamedImports(o))for(let s of o.elements)s.isTypeOnly||t.push({importType:"named",importName:s.name.text,importPath:n})}return t}import{randomUUID as K8}from"crypto";var G8=5294,W8=5284,Mm=4,Om=e=>!!(process.env.CI||e.ci),Z8=(e,t)=>{let r=Om(t)?{}:Bm(e),n=r.spaceName,o=t.builderUserId??process.env.BUILDER_USER_ID??r.userId,s=t.builderPublicKey??process.env.BUILDER_PUBLIC_KEY??r.builderPublicKey,i=t.builderPrivateKey??process.env.BUILDER_PRIVATE_KEY??r.builderPrivateKey,a=process.env.FIGMA_PERSONAL_TOKEN??t.figmaToken,u;return a?u={access_token:a,oauth:!1}:u=r.figmaAuth,{spaceName:n,userId:o,builderPublicKey:s,builderPrivateKey:i,figmaAuth:u,timestamp:r.timestamp}},zi=async(e,t,r)=>{let{spaceName:n,userId:o,builderPublicKey:s,builderPrivateKey:i,figmaAuth:a,timestamp:u}=Z8(e,t);if(r.forceSpaceId&&!t.yes&&s&&s!==r.forceSpaceId)if(te.warning(`You are currently authenticated for space ${(0,Ln.yellow)(s)} (${n||"unnamed"}), but this command requires space ${(0,Ln.green)(r.forceSpaceId)}.`),await bi({message:"You must switch to the correct space to continue with this code generation command.",options:[{value:"switch",label:"Switch to required space",hint:"Authenticate with the correct space and continue"},{value:"exit",label:"Exit code generation",hint:"Cancel the command and stay in current space"}]})==="switch")s=r.forceSpaceId,i=void 0,n=void 0,o=void 0;else return te.info("Code generation cancelled. You can run the command again when you're ready to switch spaces."),await sn(1);if(Om(t)){if(!a&&r.requireFigmaAuth==="if-unset")throw new Error(`No Figma personal token found.
1543
1543
  Please set the FIGMA_PERSONAL_TOKEN environment variable.`);if(!i&&r.builderPrivateKey)throw new Error(`No Builder private key found.
1544
1544
  Please set the BUILDER_PRIVATE_KEY environment variable.`);if(!s&&r.builderPublicKey)throw new Error(`No Builder public key found.
1545
- Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:a,builderPublicKey:s,builderPrivateKey:i,userId:o,spaceName:n}}if((r.requireFigmaAuth==="always"||!a&&r.requireFigmaAuth==="if-unset")&&(a=await k8(e),jP(e,{figmaAuth:a})),r.force||!i&&r.builderPrivateKey||!s&&r.builderPublicKey){let{privateKey:c,spaceId:l,spaceName:p,userId:d}=await R8(e,r.forceSpaceId);if(r.forceSpaceId&&l!==r.forceSpaceId)throw new Error(`OAuth flow returned space ${(0,Bn.yellow)(l)}, however the command specified --spaceId=${(0,Bn.green)(r.forceSpaceId)}`);s=l,i=c,n=p,o=d,await Vy(o),await Dn(e,e.getAppRootDir())&&(await MP(e,l,void 0,!1)||te.warn("Unable to set public api key in an existing .env file or create a new one. Please ensure you have write access in the current directory.")),jP(e,{builderPublicKey:s,builderPrivateKey:i,spaceName:n,userId:o,timestamp:new Date().toISOString()})}return o?e.Sentry?.setUser({id:o,username:process.env.USER||process.env.USERNAME||"unknown"}):s&&e.Sentry?.setUser({id:s,username:process.env.USER||process.env.USERNAME||"unknown"}),(n||s)&&e.Sentry?.setContext("builder",{spaceId:s,spaceName:n,userId:o}),{figmaAuth:a,builderPublicKey:s,builderPrivateKey:i,spaceName:n,userId:o,timestamp:u}},$8="RHr2ed743waC2g2ZHMEJSn6O0NQ08L";async function k8(e){let t=_8();return VP({sys:e,name:"Figma",initialPort:A8,requestListener:async(r,n,o,s,i)=>{let a=new URL(n.url||"",`http://localhost:${r}`);if(a.pathname==="/figma-connect"){let u=a.searchParams.get("code"),c=a.searchParams.get("state"),l="nrGCqw6TLl95QJhVDi097A",p=$8,g=`Basic ${Buffer.from(`${l}:${p}`).toString("base64")}`;if(u&&t===c){let f=await(await jr("https://api.figma.com/v1/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:g},body:new URLSearchParams({redirect_uri:`http://localhost:${r}/figma-connect`,code:u,grant_type:"authorization_code"}).toString()})).json();o.end(`<!doctype html>
1545
+ Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:a,builderPublicKey:s,builderPrivateKey:i,userId:o,spaceName:n}}if((r.requireFigmaAuth==="always"||!a&&r.requireFigmaAuth==="if-unset")&&(a=await Y8(e),UP(e,{figmaAuth:a})),r.force||!i&&r.builderPrivateKey||!s&&r.builderPublicKey){let{privateKey:c,spaceId:l,spaceName:p,userId:d}=await Q8(e,r.forceSpaceId);if(r.forceSpaceId&&l!==r.forceSpaceId)throw new Error(`OAuth flow returned space ${(0,Ln.yellow)(l)}, however the command specified --spaceId=${(0,Ln.green)(r.forceSpaceId)}`);s=l,i=c,n=p,o=d,await Hy(o),await Dn(e,e.getAppRootDir())&&(await LP(e,l,void 0,!1)||te.warn("Unable to set public api key in an existing .env file or create a new one. Please ensure you have write access in the current directory.")),UP(e,{builderPublicKey:s,builderPrivateKey:i,spaceName:n,userId:o,timestamp:new Date().toISOString()})}return o?e.Sentry?.setUser({id:o,username:process.env.USER||process.env.USERNAME||"unknown"}):s&&e.Sentry?.setUser({id:s,username:process.env.USER||process.env.USERNAME||"unknown"}),(n||s)&&e.Sentry?.setContext("builder",{spaceId:s,spaceName:n,userId:o}),{figmaAuth:a,builderPublicKey:s,builderPrivateKey:i,spaceName:n,userId:o,timestamp:u}},J8="RHr2ed743waC2g2ZHMEJSn6O0NQ08L";async function Y8(e){let t=K8();return HP({sys:e,name:"Figma",initialPort:G8,requestListener:async(r,n,o,s,i)=>{let a=new URL(n.url||"",`http://localhost:${r}`);if(a.pathname==="/figma-connect"){let u=a.searchParams.get("code"),c=a.searchParams.get("state"),l="nrGCqw6TLl95QJhVDi097A",p=J8,g=`Basic ${Buffer.from(`${l}:${p}`).toString("base64")}`;if(u&&t===c){let f=await(await jr("https://api.figma.com/v1/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:g},body:new URLSearchParams({redirect_uri:`http://localhost:${r}/figma-connect`,code:u,grant_type:"authorization_code"}).toString()})).json();o.end(`<!doctype html>
1546
1546
  <html lang="en" dir="ltr">
1547
1547
  <head>
1548
1548
  <meta charset="utf-8" />
@@ -1651,7 +1651,7 @@ Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:a,bui
1651
1651
  <!--SCRIPT_PLACEHOLDER-->
1652
1652
  </body>
1653
1653
  </html>
1654
- `.replace("{{MESSAGE}}","The CLI has authenticated correctly with Figma"),()=>{s({...f,oauth:!0})})}}},onListen:r=>{let n=new URL("https://www.figma.com/oauth");return n.searchParams.set("client_id","nrGCqw6TLl95QJhVDi097A"),n.searchParams.set("redirect_uri",`http://localhost:${r}/figma-connect`),n.searchParams.set("scope","files:read,file_dev_resources:read,file_variables:read"),n.searchParams.set("state",t),n.searchParams.set("response_type","code"),n.href}})}async function R8(e,t){let r=await e.getDeviceId();return VP({sys:e,name:"Builder.io",initialPort:F8,requestListener:async(n,o,s,i)=>{let a=new URL(o.url||"",`http://localhost:${n}`);a.pathname===zn&&s.end(`<!doctype html>
1654
+ `.replace("{{MESSAGE}}","The CLI has authenticated correctly with Figma"),()=>{s({...f,oauth:!0})})}}},onListen:r=>{let n=new URL("https://www.figma.com/oauth");return n.searchParams.set("client_id","nrGCqw6TLl95QJhVDi097A"),n.searchParams.set("redirect_uri",`http://localhost:${r}/figma-connect`),n.searchParams.set("scope","files:read,file_dev_resources:read,file_variables:read"),n.searchParams.set("state",t),n.searchParams.set("response_type","code"),n.href}})}async function Q8(e,t){let r=await e.getDeviceId();return HP({sys:e,name:"Builder.io",initialPort:W8,requestListener:async(n,o,s,i)=>{let a=new URL(o.url||"",`http://localhost:${n}`);a.pathname===zn&&s.end(`<!doctype html>
1655
1655
  <html lang="en" dir="ltr">
1656
1656
  <head>
1657
1657
  <meta charset="utf-8" />
@@ -1760,11 +1760,11 @@ Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:a,bui
1760
1760
  <!--SCRIPT_PLACEHOLDER-->
1761
1761
  </body>
1762
1762
  </html>
1763
- `.replace("{{MESSAGE}}","The CLI has authenticated correctly with Builder.io"),()=>{i({privateKey:a.searchParams.get("p-key")||"",spaceId:a.searchParams.get("api-key")||"",spaceName:a.searchParams.get("org-name")||"",userId:a.searchParams.get("user-id")||""})})},onListen:n=>{let o=new URL("/cli-auth","https://builder.io");o.searchParams.set("client_id","builder-dev-tools-cli"),o.searchParams.set("host",r),o.searchParams.set("response_type","code"),o.searchParams.set("cli","true"),t&&o.searchParams.set("space_id",t);let s=new URL(zn,`http://localhost:${n}`);s.searchParams.set(Qs,P8()),s.searchParams.set(Xs,process.versions.node);let i=e.getFrameworks();return i.length>0&&(o.searchParams.set(yo,i[0].name),s.searchParams.set(yo,i[0].name)),o.searchParams.set("redirect_url",s.href),o.href}})}function jP(e,t){if(Mm(yn(e.getAppRootDir(),"node_modules"))){let n=yn(e.getAppRootDir(),"node_modules",".builder"),o=yn(n,"data.json"),s=Bm(e);t=Object.assign(s,t),zP(LP(o),{recursive:!0}),rc(o,JSON.stringify({credentials:t},null,2))}else{let n=yn(e.getAppRootDir(),".config","builderio"),o=yn(n,"data.json"),s=yn(e.getAppRootDir(),".gitignore"),i=Bm(e);t=Object.assign(i,t),zP(LP(o),{recursive:!0}),rc(o,JSON.stringify({credentials:t},null,2));let a=".config/";if(Mm(s)){let u=UP(s,"utf8");u.includes(a)||rc(s,u+`
1763
+ `.replace("{{MESSAGE}}","The CLI has authenticated correctly with Builder.io"),()=>{i({privateKey:a.searchParams.get("p-key")||"",spaceId:a.searchParams.get("api-key")||"",spaceName:a.searchParams.get("org-name")||"",userId:a.searchParams.get("user-id")||""})})},onListen:n=>{let o=new URL("/cli-auth","https://builder.io");o.searchParams.set("client_id","builder-dev-tools-cli"),o.searchParams.set("host",r),o.searchParams.set("response_type","code"),o.searchParams.set("cli","true"),t&&o.searchParams.set("space_id",t);let s=new URL(zn,`http://localhost:${n}`);s.searchParams.set(Qs,q8()),s.searchParams.set(Xs,process.versions.node);let i=e.getFrameworks();return i.length>0&&(o.searchParams.set(yo,i[0].name),s.searchParams.set(yo,i[0].name)),o.searchParams.set("redirect_url",s.href),o.href}})}function UP(e,t){if(Lm(yn(e.getAppRootDir(),"node_modules"))){let n=yn(e.getAppRootDir(),"node_modules",".builder"),o=yn(n,"data.json"),s=Bm(e);t=Object.assign(s,t),jP(zP(o),{recursive:!0}),nc(o,JSON.stringify({credentials:t},null,2))}else{let n=yn(e.getAppRootDir(),".config","builderio"),o=yn(n,"data.json"),s=yn(e.getAppRootDir(),".gitignore"),i=Bm(e);t=Object.assign(i,t),jP(zP(o),{recursive:!0}),nc(o,JSON.stringify({credentials:t},null,2));let a=".config/";if(Lm(s)){let u=VP(s,"utf8");u.includes(a)||nc(s,u+`
1764
1764
  `+a+`
1765
- `)}else rc(s,a+`
1766
- `)}}function Bm(e){let t=yn(e.getAppRootDir(),".config","builderio","data.json"),r=[yn(e.getAppRootDir(),"node_modules",".builder","data.json"),t,yn(e.getRepoRootDir(),".git",".builder.json")];for(let n of r)if(Mm(n))try{let o=UP(n,"utf8");return JSON.parse(o).credentials}catch(o){e.Sentry?.captureException(o,{level:"warning"})}return{}}async function VP(e){let t,r,n,o=new Promise((p,d)=>{t=p,r=d}),s=e.initialPort,i=0,a=E8((p,d)=>e.requestListener(s,p,d,t,r)),u=()=>{c(),a&&("closeAllConnections"in a&&a.closeAllConnections(),a.close(p=>{p&&e.sys.Sentry?.captureException(p)}))};process.on("uncaughtExceptionMonitor",u),process.on("unhandledRejection",u),process.on("SIGINT",u),process.on("SIGTERM",u),process.on("exit",u);let c=()=>{process.removeListener("uncaughtExceptionMonitor",u),process.removeListener("unhandledRejection",u),process.removeListener("SIGINT",u),process.removeListener("SIGTERM",u),process.removeListener("exit",u)},l=()=>new Promise((p,d)=>{let g=m=>{a.removeListener("error",g),m.code==="EADDRINUSE"&&i<Om?(te.warning(`Port ${s} is already in use, trying next port`),s++,i++,p(0)):d(m)};a.once("error",g),a.listen(s,()=>{a.removeListener("error",g);let m=a.address();p(m.port)})});try{let p=0;for(;p===0&&i<Om;)p=await l();if(p===0)throw new Error(`Failed to find an available port after ${Om} attempts`);let d=e.onListen(p);te.warn(`Required authenticating with ${e.name}
1767
- OPEN: ${(0,Bn.dim)(d)}`),n=$m(),n.start(`Waiting for ${e.name} authentication`),await km(d);let g=await o;return n&&n.stop(`Authenticated with ${e.name} successfully`),g}catch(p){throw n&&(n.stop(`Failed to authenticate with ${e.name}.`,-1),vl("auth")),e.sys.Sentry?.captureException(p),u(),p}finally{u()}}async function qP(e,t,r,n){try{if(!e)return gi(r,n,400,"Builder context closed");let o=B8(r);if(o.pathname===ic){if(r.method==="POST"){let s=await M8(r);if(s)try{let i=await pg(e,JSON.parse(s));return HP(r,n,200,i)}catch(i){e.debug("Dev API Error",i.stack||i.message||i);let a={errors:[String(i.message||i)]};return HP(r,n,500,a)}}else if(r.method==="OPTIONS"){let s={"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Cache-Control, X-Builder-Devtools-Version, sentry-trace, baggage"},i=r.headers.origin;i&&i!=="null"?KP(new URL(i))&&(s["Access-Control-Allow-Origin"]=i):s["Access-Control-Allow-Origin"]="*",n.writeHead(200,s),n.end();return}return gi(r,n,405,`${ic} is an API endpoint used only during development by the Builder.io Devtools client-side script`)}if(o.pathname===sc)return I8(r,n,200,await dg(e));if(o.pathname===zm){let s=o.searchParams.get(oc);return s?O8(n,302,await gg(e,s)):gi(r,n,400,`Missing ${oc} querystring`)}if(o.pathname===zn)return N8(r,n,200,await fg(e));if(o.pathname===jm){await zi(e,{_:[]},{});let s=await OP(e),{figmaBuilderLinks:i,diagnostics:a}=await BP({mappingFiles:s,sys:e});return Ks(r,n,200,"application/json",JSON.stringify({figmaBuilderLinks:i,foundErrors:a.length>0,diagnostics:a,version:2,local:!0},null,2))}return o.pathname===jn?(e.debug(`Close Dev Tools Server Requested: ${o.href}`),setTimeout(()=>{try{t.close(s=>{e.debug(`Dev Tools Server Closed Error: ${s}`)})}catch(s){e.debug(`Error closing devtools server: ${s}`)}},20),gi(r,n,200,"Closing Dev Tools Server")):gi(r,n,404,"Not found")}catch(o){return e?.Sentry?.captureException(o),gi(r,n,500,`Dev Server Error: ${o}`)}}function HP(e,t,r,n){Ks(e,t,r,"application/json",JSON.stringify(n))}function I8(e,t,r,n){Ks(e,t,r,"application/javascript",n)}function N8(e,t,r,n){Ks(e,t,r,"text/html",n)}function gi(e,t,r,n){Ks(e,t,r,"text/plain",n)}function Ks(e,t,r,n,o){let s={"Content-Type":`${n}; charset=utf-8`,"Cache-Control":"no-cache, no-store, must-revalidate","X-Builder-Devtools-Version":Zt},i=e.headers.origin;i&&i!=="null"?KP(new URL(i))&&(s["Access-Control-Allow-Origin"]=i):s["Access-Control-Allow-Origin"]="*",t.writeHead(r,s),t.end(o)}function KP(e){return e.hostname==="localhost"||e.origin==="https://builder.io"||e.origin==="https://www.builder.io"||e.origin.endsWith(".builder.io")?!0:e.port===""?!1:e.port!=="80"&&e.port!=="443"}function O8(e,t,r){e.writeHead(t,{Location:r}),e.end()}async function M8(e){let t="";for await(let r of e)t+=r;return t}function B8(e){let t=e.url||"/";return new URL(t,`http://${e.headers.host}`)}async function GP(e){if(globalThis.__builderDevToolsServer)return e.debug("reusing existing devtools server"),globalThis.__builderDevToolsServer.setContext(e),globalThis.__builderDevToolsServer;let t=await j8(e),r=L8((o,s)=>{qP(e,r,o,s)}),n=()=>new Promise((o,s)=>{r.listening?(e.debug(`closing devtools server on port ${t}`),r.close(i=>{e=null,i?(e.debug(`error closing devtools server on port ${t}`),s(i)):(e&&e.debug(`closed devtools server on port ${t}`),o())})):(e.debug(`devtools server on port ${t} not listening`),o())});return process.once("SIGTERM",n),process.once("SIGINT",n),process.env.CI!=="true"&&process.stdin.on("end",n),globalThis.__builderDevToolsServer={url:new URL(`http://localhost:${t}`).href,port:t,setContext:o=>{e.debug(`set devtools context on server ${t}`),e=o},close:async()=>{globalThis.__builderDevToolsServer=null,await n()}},new Promise(o=>{r.listen(t,()=>{e.debug(`started devtools server on port ${t}`),o(globalThis.__builderDevToolsServer)})})}function j8(e){return new Promise(t=>{let r=e.port;try{z8({hostname:"localhost",port:r,path:jn,method:"GET"},o=>{o.on("end",()=>{e.debug(`${jn} - Response ended`),t(r)})}).on("error",o=>{e.debug(`${jn} - No response ${o}`),t(r)}).end()}catch(n){e.debug(`${jn} - Error ${n}`),t(r)}})}async function Gy(e){let t={...e,devToolsServerUrl:"",isValid:!1,serverShouldRestart:!1,publicApiKey:"",port:e.port||5273,ignoreMissingConfig:!1,getAllProjectFiles:e.getAllProjectFiles||(()=>Promise.resolve([]))},r=e.getFrameworks().map(s=>s.name).join(", ");t.debug(`create devtools ${WP} [${r}]`);let n=await GP(t);return t.devToolsServerUrl=n.url,t.port=n.port,{getUrl:()=>t.devToolsServerUrl}}var WP=Zt;export{Gy as createDevToolsServer,WP as version};
1765
+ `)}else nc(s,a+`
1766
+ `)}}function Bm(e){let t=yn(e.getAppRootDir(),".config","builderio","data.json"),r=[yn(e.getAppRootDir(),"node_modules",".builder","data.json"),t,yn(e.getRepoRootDir(),".git",".builder.json")];for(let n of r)if(Lm(n))try{let o=VP(n,"utf8");return JSON.parse(o).credentials}catch(o){e.Sentry?.captureException(o,{level:"warning"})}return{}}async function HP(e){let t,r,n,o=new Promise((p,d)=>{t=p,r=d}),s=e.initialPort,i=0,a=H8((p,d)=>e.requestListener(s,p,d,t,r)),u=()=>{c(),a&&("closeAllConnections"in a&&a.closeAllConnections(),a.close(p=>{p&&e.sys.Sentry?.captureException(p)}))};process.on("uncaughtExceptionMonitor",u),process.on("unhandledRejection",u),process.on("SIGINT",u),process.on("SIGTERM",u),process.on("exit",u);let c=()=>{process.removeListener("uncaughtExceptionMonitor",u),process.removeListener("unhandledRejection",u),process.removeListener("SIGINT",u),process.removeListener("SIGTERM",u),process.removeListener("exit",u)},l=()=>new Promise((p,d)=>{let g=m=>{a.removeListener("error",g),m.code==="EADDRINUSE"&&i<Mm?(te.warning(`Port ${s} is already in use, trying next port`),s++,i++,p(0)):d(m)};a.once("error",g),a.listen(s,()=>{a.removeListener("error",g);let m=a.address();p(m.port)})});try{let p=0;for(;p===0&&i<Mm;)p=await l();if(p===0)throw new Error(`Failed to find an available port after ${Mm} attempts`);let d=e.onListen(p);te.warn(`Required authenticating with ${e.name}
1767
+ OPEN: ${(0,Ln.dim)(d)}`),n=$m(),n.start(`Waiting for ${e.name} authentication`),await km(d);let g=await o;return n&&n.stop(`Authenticated with ${e.name} successfully`),g}catch(p){throw n&&(n.stop(`Failed to authenticate with ${e.name}.`,-1),Cl("auth")),e.sys.Sentry?.captureException(p),u(),p}finally{u()}}async function KP(e,t,r,n){try{if(!e)return gi(r,n,400,"Builder context closed");let o=n9(r);if(o.pathname===sc){if(r.method==="POST"){let s=await r9(r);if(s)try{let i=await dg(e,JSON.parse(s));return qP(r,n,200,i)}catch(i){e.debug("Dev API Error",i.stack||i.message||i);let a={errors:[String(i.message||i)]};return qP(r,n,500,a)}}else if(r.method==="OPTIONS"){let s={"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Cache-Control, X-Builder-Devtools-Version, sentry-trace, baggage"},i=r.headers.origin;i&&i!=="null"?GP(new URL(i))&&(s["Access-Control-Allow-Origin"]=i):s["Access-Control-Allow-Origin"]="*",n.writeHead(200,s),n.end();return}return gi(r,n,405,`${sc} is an API endpoint used only during development by the Builder.io Devtools client-side script`)}if(o.pathname===ac)return X8(r,n,200,await fg(e));if(o.pathname===jm){let s=o.searchParams.get(ic);return s?t9(n,302,await hg(e,s)):gi(r,n,400,`Missing ${ic} querystring`)}if(o.pathname===zn)return e9(r,n,200,await mg(e));if(o.pathname===Um){await zi(e,{_:[]},{});let s=await MP(e),{figmaBuilderLinks:i,diagnostics:a}=await BP({mappingFiles:s,sys:e});return Ks(r,n,200,"application/json",JSON.stringify({figmaBuilderLinks:i,foundErrors:a.length>0,diagnostics:a,version:2,local:!0},null,2))}return o.pathname===jn?(e.debug(`Close Dev Tools Server Requested: ${o.href}`),setTimeout(()=>{try{t.close(s=>{e.debug(`Dev Tools Server Closed Error: ${s}`)})}catch(s){e.debug(`Error closing devtools server: ${s}`)}},20),gi(r,n,200,"Closing Dev Tools Server")):gi(r,n,404,"Not found")}catch(o){return e?.Sentry?.captureException(o),gi(r,n,500,`Dev Server Error: ${o}`)}}function qP(e,t,r,n){Ks(e,t,r,"application/json",JSON.stringify(n))}function X8(e,t,r,n){Ks(e,t,r,"application/javascript",n)}function e9(e,t,r,n){Ks(e,t,r,"text/html",n)}function gi(e,t,r,n){Ks(e,t,r,"text/plain",n)}function Ks(e,t,r,n,o){let s={"Content-Type":`${n}; charset=utf-8`,"Cache-Control":"no-cache, no-store, must-revalidate","X-Builder-Devtools-Version":Zt},i=e.headers.origin;i&&i!=="null"?GP(new URL(i))&&(s["Access-Control-Allow-Origin"]=i):s["Access-Control-Allow-Origin"]="*",t.writeHead(r,s),t.end(o)}function GP(e){return e.hostname==="localhost"||e.origin==="https://builder.io"||e.origin==="https://www.builder.io"||e.origin.endsWith(".builder.io")?!0:e.port===""?!1:e.port!=="80"&&e.port!=="443"}function t9(e,t,r){e.writeHead(t,{Location:r}),e.end()}async function r9(e){let t="";for await(let r of e)t+=r;return t}function n9(e){let t=e.url||"/";return new URL(t,`http://${e.headers.host}`)}async function WP(e){if(globalThis.__builderDevToolsServer)return e.debug("reusing existing devtools server"),globalThis.__builderDevToolsServer.setContext(e),globalThis.__builderDevToolsServer;let t=await s9(e),r=o9((o,s)=>{KP(e,r,o,s)}),n=()=>new Promise((o,s)=>{r.listening?(e.debug(`closing devtools server on port ${t}`),r.close(i=>{e=null,i?(e.debug(`error closing devtools server on port ${t}`),s(i)):(e&&e.debug(`closed devtools server on port ${t}`),o())})):(e.debug(`devtools server on port ${t} not listening`),o())});return process.once("SIGTERM",n),process.once("SIGINT",n),process.env.CI!=="true"&&process.stdin.on("end",n),globalThis.__builderDevToolsServer={url:new URL(`http://localhost:${t}`).href,port:t,setContext:o=>{e.debug(`set devtools context on server ${t}`),e=o},close:async()=>{globalThis.__builderDevToolsServer=null,await n()}},new Promise(o=>{r.listen(t,()=>{e.debug(`started devtools server on port ${t}`),o(globalThis.__builderDevToolsServer)})})}function s9(e){return new Promise(t=>{let r=e.port;try{i9({hostname:"localhost",port:r,path:jn,method:"GET"},o=>{o.on("end",()=>{e.debug(`${jn} - Response ended`),t(r)})}).on("error",o=>{e.debug(`${jn} - No response ${o}`),t(r)}).end()}catch(n){e.debug(`${jn} - Error ${n}`),t(r)}})}async function Wy(e){let t={...e,devToolsServerUrl:"",isValid:!1,serverShouldRestart:!1,publicApiKey:"",port:e.port||5273,ignoreMissingConfig:!1,getAllProjectFiles:e.getAllProjectFiles||(()=>Promise.resolve([]))},r=e.getFrameworks().map(s=>s.name).join(", ");t.debug(`create devtools ${ZP} [${r}]`);let n=await WP(t);return t.devToolsServerUrl=n.url,t.port=n.port,{getUrl:()=>t.devToolsServerUrl}}var ZP=Zt;export{Wy as createDevToolsServer,ZP as version};
1768
1768
  /*! Bundled license information:
1769
1769
 
1770
1770
  is-number/index.js: