@capgo/cli 7.21.4 → 7.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +39 -40
- package/dist/package.json +1 -1
- package/dist/src/bundle/partial.d.ts.map +1 -1
- package/dist/src/bundle/upload.d.ts.map +1 -1
- package/dist/src/sdk.js +50 -51
- package/package.json +1 -1
package/dist/src/sdk.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Oq=Object.create;var pl=Object.defineProperty;var xq=Object.getOwnPropertyDescriptor;var Tq=Object.getOwnPropertyNames;var Fq=Object.getPrototypeOf,Iq=Object.prototype.hasOwnProperty;var Rr=(t,e)=>()=>(t&&(e=t(t=0)),e);var E=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),om=(t,e)=>{for(var r in e)pl(t,r,{get:e[r],enumerable:!0})},TE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Tq(e))!Iq.call(t,i)&&i!==r&&pl(t,i,{get:()=>e[i],enumerable:!(n=xq(e,i))||n.enumerable});return t};var xe=(t,e,r)=>(r=t!=null?Oq(Fq(t)):{},TE(e||!t||!t.__esModule?pl(r,"default",{value:t,enumerable:!0}):r,t)),ue=t=>TE(pl({},"__esModule",{value:!0}),t);var We=E((Whe,FE)=>{"use strict";var am={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},kq={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Pq={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?am.up():"");return t&&(e+=am.left),e}};FE.exports={cursor:am,scroll:kq,erase:Pq,beep:"\x07"}});var cm=E((Xhe,um)=>{var gl=process||{},IE=gl.argv||[],ml=gl.env||{},Rq=!(ml.NO_COLOR||IE.includes("--no-color"))&&(!!ml.FORCE_COLOR||IE.includes("--color")||gl.platform==="win32"||(gl.stdout||{}).isTTY&&ml.TERM!=="dumb"||!!ml.CI),Nq=(t,e,r=t)=>n=>{let i=""+n,s=i.indexOf(e,t.length);return~s?t+$q(i,e,r,s)+e:t+i+e},$q=(t,e,r,n)=>{let i="",s=0;do i+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return i+t.substring(s)},kE=(t=Rq)=>{let e=t?Nq:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};um.exports=kE();um.exports.createColors=kE});var Sl=E(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.isNXMonorepo=pr.isMonorepo=pr.findPackageRelativePathInMonorepo=pr.findPackagePath=pr.findNXMonorepoRoot=pr.findMonorepoRoot=void 0;var cu=require("node:fs"),vi=require("node:path");function Cl(t){let e=(0,vi.join)(t,"package.json"),r=(0,vi.join)(t,"pnpm-workspace.yaml");if((0,cu.existsSync)(r)||(0,cu.existsSync)(e)&&JSON.parse((0,cu.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,vi.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return Cl(n)}pr.findMonorepoRoot=Cl;function Em(t){let e=(0,vi.join)(t,"nx.json");if((0,cu.existsSync)(e))return t;let r=(0,vi.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Em(r)}pr.findNXMonorepoRoot=Em;function _m(t,e,r){let n=(0,vi.join)(e,"node_modules",t);if((0,cu.existsSync)(n))return n;if(e===r)return null;let i=(0,vi.dirname)(e);return _m(t,i,r)}pr.findPackagePath=_m;function pU(t,e){let r=Cl(e),n=_m(t,e,r);return n?(0,vi.relative)(e,n):null}pr.findPackageRelativePathInMonorepo=pU;function mU(t){try{return Cl(t),!0}catch{return!1}}pr.isMonorepo=mU;function gU(t){try{return Em(t),!0}catch{return!1}}pr.isNXMonorepo=gU});var le={};om(le,{__addDisposableResource:()=>$_,__assign:()=>kl,__asyncDelegator:()=>x_,__asyncGenerator:()=>O_,__asyncValues:()=>T_,__await:()=>vo,__awaiter:()=>v_,__classPrivateFieldGet:()=>P_,__classPrivateFieldIn:()=>N_,__classPrivateFieldSet:()=>R_,__createBinding:()=>Rl,__decorate:()=>p_,__disposeResources:()=>L_,__esDecorate:()=>g_,__exportStar:()=>__,__extends:()=>h_,__generator:()=>E_,__importDefault:()=>k_,__importStar:()=>I_,__makeTemplateObject:()=>F_,__metadata:()=>b_,__param:()=>m_,__propKey:()=>D_,__read:()=>Pm,__rest:()=>d_,__rewriteRelativeImportExtension:()=>j_,__runInitializers:()=>y_,__setFunctionName:()=>w_,__spread:()=>C_,__spreadArray:()=>A_,__spreadArrays:()=>S_,__values:()=>Pl,default:()=>MU});function h_(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Im(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function d_(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 p_(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function m_(t,e){return function(r,n){e(r,n,t)}}function g_(t,e,r,n,i,s){function o(S){if(S!==void 0&&typeof S!="function")throw new TypeError("Function expected");return S}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),h,d=!1,f=r.length-1;f>=0;f--){var m={};for(var g in n)m[g]=g==="access"?{}:n[g];for(var g in n.access)m.access[g]=n.access[g];m.addInitializer=function(S){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(S||null))};var b=(0,r[f])(a==="accessor"?{get:l.get,set:l.set}:l[u],m);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(h=o(b.get))&&(l.get=h),(h=o(b.set))&&(l.set=h),(h=o(b.init))&&i.unshift(h)}else(h=o(b))&&(a==="field"?i.unshift(h):l[u]=h)}c&&Object.defineProperty(c,n.name,l),d=!0}function y_(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function D_(t){return typeof t=="symbol"?t:"".concat(t)}function w_(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function b_(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function v_(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function E_(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function __(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rl(e,t,r)}function Pl(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 Pm(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function C_(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Pm(arguments[e]));return t}function S_(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function A_(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}function vo(t){return this instanceof vo?(this.v=t,this):new vo(t)}function O_(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(f){return function(m){return Promise.resolve(m).then(f,h)}}function a(f,m){n[f]&&(i[f]=function(g){return new Promise(function(b,S){s.push([f,g,b,S])>1||u(f,g)})},m&&(i[f]=m(i[f])))}function u(f,m){try{c(n[f](m))}catch(g){d(s[0][3],g)}}function c(f){f.value instanceof vo?Promise.resolve(f.value.v).then(l,h):d(s[0][2],f)}function l(f){u("next",f)}function h(f){u("throw",f)}function d(f,m){f(m),s.shift(),s.length&&u(s[0][0],s[0][1])}}function x_(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:vo(t[i](o)),done:!1}:s?s(o):o}:s}}function T_(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Pl=="function"?Pl(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,u){o=t[s](o),i(a,u,o.done,o.value)})}}function i(s,o,a,u){Promise.resolve(u).then(function(c){s({value:c,done:a})},o)}}function F_(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function I_(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=km(t),n=0;n<r.length;n++)r[n]!=="default"&&Rl(e,t,r[n]);return jU(e,t),e}function k_(t){return t&&t.__esModule?t:{default:t}}function P_(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function R_(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function N_(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function $_(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function L_(t){function e(s){t.error=t.hasError?new BU(s,t.error,"An error was suppressed during disposal."):s,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(s).then(i,function(o){return e(o),i()})}else n|=1}catch(o){e(o)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}function j_(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,s,o){return n?e?".jsx":".js":i&&(!s||!o)?r:i+s+"."+o.toLowerCase()+"js"}):t}var Im,kl,Rl,jU,km,BU,MU,fe=Rr(()=>{Im=function(t,e){return Im=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])},Im(t,e)};kl=function(){return kl=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},kl.apply(this,arguments)};Rl=Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]});jU=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},km=function(t){return km=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},km(t)};BU=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};MU={__extends:h_,__assign:kl,__rest:d_,__decorate:p_,__param:m_,__esDecorate:g_,__runInitializers:y_,__propKey:D_,__setFunctionName:w_,__metadata:b_,__awaiter:v_,__generator:E_,__createBinding:Rl,__exportStar:__,__values:Pl,__read:Pm,__spread:C_,__spreadArrays:S_,__spreadArray:A_,__await:vo,__asyncGenerator:O_,__asyncDelegator:x_,__asyncValues:T_,__makeTemplateObject:F_,__importStar:I_,__importDefault:k_,__classPrivateFieldGet:P_,__classPrivateFieldSet:R_,__classPrivateFieldIn:N_,__addDisposableResource:$_,__disposeResources:L_,__rewriteRelativeImportExtension:j_}});var B_=E(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.resolveFetch=void 0;var qU=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);Nl.resolveFetch=qU});var Lm=E(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.FunctionRegion=Lr.FunctionsHttpError=Lr.FunctionsRelayError=Lr.FunctionsFetchError=Lr.FunctionsError=void 0;var Eo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};Lr.FunctionsError=Eo;var Rm=class extends Eo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};Lr.FunctionsFetchError=Rm;var Nm=class extends Eo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};Lr.FunctionsRelayError=Nm;var $m=class extends Eo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};Lr.FunctionsHttpError=$m;var M_;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(M_||(Lr.FunctionRegion=M_={}))});var q_=E($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.FunctionsClient=void 0;var UU=(fe(),ue(le)),HU=B_(),ls=Lm(),jm=class{constructor(e,{headers:r={},customFetch:n,region:i=ls.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,HU.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return UU.__awaiter(this,arguments,void 0,function*(r,n={}){var i;try{let{headers:s,method:o,body:a,signal:u}=n,c={},{region:l}=n;l||(l=this.region);let h=new URL(`${this.url}/${r}`);l&&l!=="any"&&(c["x-region"]=l,h.searchParams.set("forceFunctionRegion",l));let d;a&&(s&&!Object.prototype.hasOwnProperty.call(s,"Content-Type")||!s)?typeof Blob<"u"&&a instanceof Blob||a instanceof ArrayBuffer?(c["Content-Type"]="application/octet-stream",d=a):typeof a=="string"?(c["Content-Type"]="text/plain",d=a):typeof FormData<"u"&&a instanceof FormData?d=a:(c["Content-Type"]="application/json",d=JSON.stringify(a)):d=a;let f=yield this.fetch(h.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},c),this.headers),s),body:d,signal:u}).catch(S=>{throw S.name==="AbortError"?S:new ls.FunctionsFetchError(S)}),m=f.headers.get("x-relay-error");if(m&&m==="true")throw new ls.FunctionsRelayError(f);if(!f.ok)throw new ls.FunctionsHttpError(f);let g=((i=f.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),b;return g==="application/json"?b=yield f.json():g==="application/octet-stream"||g==="application/pdf"?b=yield f.blob():g==="text/event-stream"?b=f:g==="multipart/form-data"?b=yield f.formData():b=yield f.text(),{data:b,error:null,response:f}}catch(s){return s instanceof Error&&s.name==="AbortError"?{data:null,error:new ls.FunctionsFetchError(s)}:{data:null,error:s,response:s instanceof ls.FunctionsHttpError||s instanceof ls.FunctionsRelayError?s.context:void 0}}})}};$l.FunctionsClient=jm});var Bm=E(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.FunctionRegion=mr.FunctionsRelayError=mr.FunctionsHttpError=mr.FunctionsFetchError=mr.FunctionsError=mr.FunctionsClient=void 0;var VU=q_();Object.defineProperty(mr,"FunctionsClient",{enumerable:!0,get:function(){return VU.FunctionsClient}});var du=Lm();Object.defineProperty(mr,"FunctionsError",{enumerable:!0,get:function(){return du.FunctionsError}});Object.defineProperty(mr,"FunctionsFetchError",{enumerable:!0,get:function(){return du.FunctionsFetchError}});Object.defineProperty(mr,"FunctionsHttpError",{enumerable:!0,get:function(){return du.FunctionsHttpError}});Object.defineProperty(mr,"FunctionsRelayError",{enumerable:!0,get:function(){return du.FunctionsRelayError}});Object.defineProperty(mr,"FunctionRegion",{enumerable:!0,get:function(){return du.FunctionRegion}})});var Um=E(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});var Mm=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};qm.default=Mm});var zm=E(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});var zU=(fe(),ue(le)),GU=zU.__importDefault(Um()),Hm=class{constructor(e){var r,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(r=e.shouldThrowOnError)!==null&&r!==void 0?r:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=new Headers(this.headers),this.headers.set(e,r),this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{var o,a,u,c;let l=null,h=null,d=null,f=s.status,m=s.statusText;if(s.ok){if(this.method!=="HEAD"){let A=await s.text();A===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((o=this.headers.get("Accept"))===null||o===void 0)&&o.includes("application/vnd.pgrst.plan+text"))?h=A:h=JSON.parse(A))}let b=(a=this.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),S=(u=s.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");b&&S&&S.length>1&&(d=parseInt(S[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(h)&&(h.length>1?(l={code:"PGRST116",details:`Results contain ${h.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},h=null,d=null,f=406,m="Not Acceptable"):h.length===1?h=h[0]:h=null)}else{let b=await s.text();try{l=JSON.parse(b),Array.isArray(l)&&s.status===404&&(h=[],l=null,f=200,m="OK")}catch{s.status===404&&b===""?(f=204,m="No Content"):l={message:b}}if(l&&this.isMaybeSingle&&(!((c=l?.details)===null||c===void 0)&&c.includes("0 rows"))&&(l=null,f=200,m="OK"),l&&this.shouldThrowOnError)throw new GU.default(l)}return{error:l,data:h,count:d,status:f,statusText:m}});return this.shouldThrowOnError||(i=i.catch(s=>{var o,a,u;return{error:{message:`${(o=s?.name)!==null&&o!==void 0?o:"FetchError"}: ${s?.message}`,details:`${(a=s?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(u=s?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}returns(){return this}overrideTypes(){return this}};Vm.default=Hm});var Wm=E(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});var KU=(fe(),ue(le)),WU=KU.__importDefault(zm()),Gm=class extends WU.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:s=i}={}){let o=s?`${s}.order`:"order",a=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${a?`${a},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let s=typeof i>"u"?"offset":`${i}.offset`,o=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(o,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:s=!1,format:o="text"}={}){var a;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${c}"; options=${u};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};Km.default=Gm});var Ll=E(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});var XU=(fe(),ue(le)),YU=XU.__importDefault(Wm()),JU=new RegExp("[,()]"),Xm=class extends YU.default{eq(e,r){return this.url.searchParams.append(e,`eq.${r}`),this}neq(e,r){return this.url.searchParams.append(e,`neq.${r}`),this}gt(e,r){return this.url.searchParams.append(e,`gt.${r}`),this}gte(e,r){return this.url.searchParams.append(e,`gte.${r}`),this}lt(e,r){return this.url.searchParams.append(e,`lt.${r}`),this}lte(e,r){return this.url.searchParams.append(e,`lte.${r}`),this}like(e,r){return this.url.searchParams.append(e,`like.${r}`),this}likeAllOf(e,r){return this.url.searchParams.append(e,`like(all).{${r.join(",")}}`),this}likeAnyOf(e,r){return this.url.searchParams.append(e,`like(any).{${r.join(",")}}`),this}ilike(e,r){return this.url.searchParams.append(e,`ilike.${r}`),this}ilikeAllOf(e,r){return this.url.searchParams.append(e,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(e,r){return this.url.searchParams.append(e,`ilike(any).{${r.join(",")}}`),this}is(e,r){return this.url.searchParams.append(e,`is.${r}`),this}in(e,r){let n=Array.from(new Set(r)).map(i=>typeof i=="string"&&JU.test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}contains(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cs.{${r.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(r)}`),this}containedBy(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cd.{${r.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(r)}`),this}rangeGt(e,r){return this.url.searchParams.append(e,`sr.${r}`),this}rangeGte(e,r){return this.url.searchParams.append(e,`nxl.${r}`),this}rangeLt(e,r){return this.url.searchParams.append(e,`sl.${r}`),this}rangeLte(e,r){return this.url.searchParams.append(e,`nxr.${r}`),this}rangeAdjacent(e,r){return this.url.searchParams.append(e,`adj.${r}`),this}overlaps(e,r){return typeof r=="string"?this.url.searchParams.append(e,`ov.${r}`):this.url.searchParams.append(e,`ov.{${r.join(",")}}`),this}textSearch(e,r,{config:n,type:i}={}){let s="";i==="plain"?s="pl":i==="phrase"?s="ph":i==="websearch"&&(s="w");let o=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${o}.${r}`),this}match(e){return Object.entries(e).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(e,r,n){return this.url.searchParams.append(e,`not.${r}.${n}`),this}or(e,{foreignTable:r,referencedTable:n=r}={}){let i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${e})`),this}filter(e,r,n){return this.url.searchParams.append(e,`${r}.${n}`),this}};Ym.default=Xm});var Qm=E(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});var ZU=(fe(),ue(le)),pu=ZU.__importDefault(Ll()),Jm=class{constructor(e,{headers:r={},schema:n,fetch:i}){this.url=e,this.headers=new Headers(r),this.schema=n,this.fetch=i}select(e,r){let{head:n=!1,count:i}=r??{},s=n?"HEAD":"GET",o=!1,a=(e??"*").split("").map(u=>/\s/.test(u)&&!o?"":(u==='"'&&(o=!o),u)).join("");return this.url.searchParams.set("select",a),i&&this.headers.append("Prefer",`count=${i}`),new pu.default({method:s,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(e,{count:r,defaultToNull:n=!0}={}){var i;let s="POST";if(r&&this.headers.append("Prefer",`count=${r}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(e)){let o=e.reduce((a,u)=>a.concat(Object.keys(u)),[]);if(o.length>0){let a=[...new Set(o)].map(u=>`"${u}"`);this.url.searchParams.set("columns",a.join(","))}}return new pu.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:s=!0}={}){var o;let a="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),r!==void 0&&this.url.searchParams.set("on_conflict",r),i&&this.headers.append("Prefer",`count=${i}`),s||this.headers.append("Prefer","missing=default"),Array.isArray(e)){let u=e.reduce((c,l)=>c.concat(Object.keys(l)),[]);if(u.length>0){let c=[...new Set(u)].map(l=>`"${l}"`);this.url.searchParams.set("columns",c.join(","))}}return new pu.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}update(e,{count:r}={}){var n;let i="PATCH";return r&&this.headers.append("Prefer",`count=${r}`),new pu.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:e}={}){var r;let n="DELETE";return e&&this.headers.append("Prefer",`count=${e}`),new pu.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}};Zm.default=Jm});var H_=E(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});var U_=(fe(),ue(le)),QU=U_.__importDefault(Qm()),e4=U_.__importDefault(Ll()),eg=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new QU.default(r,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:s}={}){var o;let a,u=new URL(`${this.url}/rpc/${e}`),c;n||i?(a=n?"HEAD":"GET",Object.entries(r).filter(([h,d])=>d!==void 0).map(([h,d])=>[h,Array.isArray(d)?`{${d.join(",")}}`:`${d}`]).forEach(([h,d])=>{u.searchParams.append(h,d)})):(a="POST",c=r);let l=new Headers(this.headers);return s&&l.set("Prefer",`count=${s}`),new e4.default({method:a,url:u,headers:l,schema:this.schemaName,body:c,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}};tg.default=eg});var rg=E(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.PostgrestError=er.PostgrestBuilder=er.PostgrestTransformBuilder=er.PostgrestFilterBuilder=er.PostgrestQueryBuilder=er.PostgrestClient=void 0;var _o=(fe(),ue(le)),V_=_o.__importDefault(H_());er.PostgrestClient=V_.default;var z_=_o.__importDefault(Qm());er.PostgrestQueryBuilder=z_.default;var G_=_o.__importDefault(Ll());er.PostgrestFilterBuilder=G_.default;var K_=_o.__importDefault(Wm());er.PostgrestTransformBuilder=K_.default;var W_=_o.__importDefault(zm());er.PostgrestBuilder=W_.default;var X_=_o.__importDefault(Um());er.PostgrestError=X_.default;er.default={PostgrestClient:V_.default,PostgrestQueryBuilder:z_.default,PostgrestFilterBuilder:G_.default,PostgrestTransformBuilder:K_.default,PostgrestBuilder:W_.default,PostgrestError:X_.default}});var ng=E(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.WebSocketFactory=void 0;var jl=class{static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){let r=process.versions;if(r&&r.node){let n=r.node,i=parseInt(n.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
1
|
+
"use strict";var Oq=Object.create;var pl=Object.defineProperty;var xq=Object.getOwnPropertyDescriptor;var Tq=Object.getOwnPropertyNames;var Fq=Object.getPrototypeOf,Iq=Object.prototype.hasOwnProperty;var Rr=(t,e)=>()=>(t&&(e=t(t=0)),e);var E=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),om=(t,e)=>{for(var r in e)pl(t,r,{get:e[r],enumerable:!0})},TE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Tq(e))!Iq.call(t,i)&&i!==r&&pl(t,i,{get:()=>e[i],enumerable:!(n=xq(e,i))||n.enumerable});return t};var xe=(t,e,r)=>(r=t!=null?Oq(Fq(t)):{},TE(e||!t||!t.__esModule?pl(r,"default",{value:t,enumerable:!0}):r,t)),ue=t=>TE(pl({},"__esModule",{value:!0}),t);var We=E((Khe,FE)=>{"use strict";var am={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},kq={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Pq={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?am.up():"");return t&&(e+=am.left),e}};FE.exports={cursor:am,scroll:kq,erase:Pq,beep:"\x07"}});var cm=E((Whe,um)=>{var gl=process||{},IE=gl.argv||[],ml=gl.env||{},Rq=!(ml.NO_COLOR||IE.includes("--no-color"))&&(!!ml.FORCE_COLOR||IE.includes("--color")||gl.platform==="win32"||(gl.stdout||{}).isTTY&&ml.TERM!=="dumb"||!!ml.CI),Nq=(t,e,r=t)=>n=>{let i=""+n,s=i.indexOf(e,t.length);return~s?t+$q(i,e,r,s)+e:t+i+e},$q=(t,e,r,n)=>{let i="",s=0;do i+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return i+t.substring(s)},kE=(t=Rq)=>{let e=t?Nq:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};um.exports=kE();um.exports.createColors=kE});var Sl=E(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.isNXMonorepo=pr.isMonorepo=pr.findPackageRelativePathInMonorepo=pr.findPackagePath=pr.findNXMonorepoRoot=pr.findMonorepoRoot=void 0;var cu=require("node:fs"),vi=require("node:path");function Cl(t){let e=(0,vi.join)(t,"package.json"),r=(0,vi.join)(t,"pnpm-workspace.yaml");if((0,cu.existsSync)(r)||(0,cu.existsSync)(e)&&JSON.parse((0,cu.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,vi.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return Cl(n)}pr.findMonorepoRoot=Cl;function Em(t){let e=(0,vi.join)(t,"nx.json");if((0,cu.existsSync)(e))return t;let r=(0,vi.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Em(r)}pr.findNXMonorepoRoot=Em;function _m(t,e,r){let n=(0,vi.join)(e,"node_modules",t);if((0,cu.existsSync)(n))return n;if(e===r)return null;let i=(0,vi.dirname)(e);return _m(t,i,r)}pr.findPackagePath=_m;function pU(t,e){let r=Cl(e),n=_m(t,e,r);return n?(0,vi.relative)(e,n):null}pr.findPackageRelativePathInMonorepo=pU;function mU(t){try{return Cl(t),!0}catch{return!1}}pr.isMonorepo=mU;function gU(t){try{return Em(t),!0}catch{return!1}}pr.isNXMonorepo=gU});var le={};om(le,{__addDisposableResource:()=>$_,__assign:()=>kl,__asyncDelegator:()=>x_,__asyncGenerator:()=>O_,__asyncValues:()=>T_,__await:()=>vo,__awaiter:()=>v_,__classPrivateFieldGet:()=>P_,__classPrivateFieldIn:()=>N_,__classPrivateFieldSet:()=>R_,__createBinding:()=>Rl,__decorate:()=>p_,__disposeResources:()=>L_,__esDecorate:()=>g_,__exportStar:()=>__,__extends:()=>h_,__generator:()=>E_,__importDefault:()=>k_,__importStar:()=>I_,__makeTemplateObject:()=>F_,__metadata:()=>b_,__param:()=>m_,__propKey:()=>D_,__read:()=>Pm,__rest:()=>d_,__rewriteRelativeImportExtension:()=>j_,__runInitializers:()=>y_,__setFunctionName:()=>w_,__spread:()=>C_,__spreadArray:()=>A_,__spreadArrays:()=>S_,__values:()=>Pl,default:()=>MU});function h_(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Im(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function d_(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 p_(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function m_(t,e){return function(r,n){e(r,n,t)}}function g_(t,e,r,n,i,s){function o(S){if(S!==void 0&&typeof S!="function")throw new TypeError("Function expected");return S}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),h,d=!1,f=r.length-1;f>=0;f--){var m={};for(var g in n)m[g]=g==="access"?{}:n[g];for(var g in n.access)m.access[g]=n.access[g];m.addInitializer=function(S){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(S||null))};var b=(0,r[f])(a==="accessor"?{get:l.get,set:l.set}:l[u],m);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(h=o(b.get))&&(l.get=h),(h=o(b.set))&&(l.set=h),(h=o(b.init))&&i.unshift(h)}else(h=o(b))&&(a==="field"?i.unshift(h):l[u]=h)}c&&Object.defineProperty(c,n.name,l),d=!0}function y_(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function D_(t){return typeof t=="symbol"?t:"".concat(t)}function w_(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function b_(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function v_(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{c(n.next(l))}catch(h){o(h)}}function u(l){try{c(n.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function E_(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function __(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rl(e,t,r)}function Pl(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 Pm(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function C_(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Pm(arguments[e]));return t}function S_(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function A_(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}function vo(t){return this instanceof vo?(this.v=t,this):new vo(t)}function O_(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(f){return function(m){return Promise.resolve(m).then(f,h)}}function a(f,m){n[f]&&(i[f]=function(g){return new Promise(function(b,S){s.push([f,g,b,S])>1||u(f,g)})},m&&(i[f]=m(i[f])))}function u(f,m){try{c(n[f](m))}catch(g){d(s[0][3],g)}}function c(f){f.value instanceof vo?Promise.resolve(f.value.v).then(l,h):d(s[0][2],f)}function l(f){u("next",f)}function h(f){u("throw",f)}function d(f,m){f(m),s.shift(),s.length&&u(s[0][0],s[0][1])}}function x_(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:vo(t[i](o)),done:!1}:s?s(o):o}:s}}function T_(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Pl=="function"?Pl(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,u){o=t[s](o),i(a,u,o.done,o.value)})}}function i(s,o,a,u){Promise.resolve(u).then(function(c){s({value:c,done:a})},o)}}function F_(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function I_(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=km(t),n=0;n<r.length;n++)r[n]!=="default"&&Rl(e,t,r[n]);return jU(e,t),e}function k_(t){return t&&t.__esModule?t:{default:t}}function P_(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function R_(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function N_(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function $_(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function L_(t){function e(s){t.error=t.hasError?new BU(s,t.error,"An error was suppressed during disposal."):s,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(s).then(i,function(o){return e(o),i()})}else n|=1}catch(o){e(o)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}function j_(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,s,o){return n?e?".jsx":".js":i&&(!s||!o)?r:i+s+"."+o.toLowerCase()+"js"}):t}var Im,kl,Rl,jU,km,BU,MU,fe=Rr(()=>{Im=function(t,e){return Im=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])},Im(t,e)};kl=function(){return kl=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},kl.apply(this,arguments)};Rl=Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]});jU=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},km=function(t){return km=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},km(t)};BU=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};MU={__extends:h_,__assign:kl,__rest:d_,__decorate:p_,__param:m_,__esDecorate:g_,__runInitializers:y_,__propKey:D_,__setFunctionName:w_,__metadata:b_,__awaiter:v_,__generator:E_,__createBinding:Rl,__exportStar:__,__values:Pl,__read:Pm,__spread:C_,__spreadArrays:S_,__spreadArray:A_,__await:vo,__asyncGenerator:O_,__asyncDelegator:x_,__asyncValues:T_,__makeTemplateObject:F_,__importStar:I_,__importDefault:k_,__classPrivateFieldGet:P_,__classPrivateFieldSet:R_,__classPrivateFieldIn:N_,__addDisposableResource:$_,__disposeResources:L_,__rewriteRelativeImportExtension:j_}});var B_=E(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.resolveFetch=void 0;var qU=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);Nl.resolveFetch=qU});var Lm=E(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.FunctionRegion=Lr.FunctionsHttpError=Lr.FunctionsRelayError=Lr.FunctionsFetchError=Lr.FunctionsError=void 0;var Eo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};Lr.FunctionsError=Eo;var Rm=class extends Eo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};Lr.FunctionsFetchError=Rm;var Nm=class extends Eo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};Lr.FunctionsRelayError=Nm;var $m=class extends Eo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};Lr.FunctionsHttpError=$m;var M_;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(M_||(Lr.FunctionRegion=M_={}))});var q_=E($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.FunctionsClient=void 0;var UU=(fe(),ue(le)),HU=B_(),ls=Lm(),jm=class{constructor(e,{headers:r={},customFetch:n,region:i=ls.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,HU.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return UU.__awaiter(this,arguments,void 0,function*(r,n={}){var i;try{let{headers:s,method:o,body:a,signal:u}=n,c={},{region:l}=n;l||(l=this.region);let h=new URL(`${this.url}/${r}`);l&&l!=="any"&&(c["x-region"]=l,h.searchParams.set("forceFunctionRegion",l));let d;a&&(s&&!Object.prototype.hasOwnProperty.call(s,"Content-Type")||!s)?typeof Blob<"u"&&a instanceof Blob||a instanceof ArrayBuffer?(c["Content-Type"]="application/octet-stream",d=a):typeof a=="string"?(c["Content-Type"]="text/plain",d=a):typeof FormData<"u"&&a instanceof FormData?d=a:(c["Content-Type"]="application/json",d=JSON.stringify(a)):d=a;let f=yield this.fetch(h.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},c),this.headers),s),body:d,signal:u}).catch(S=>{throw S.name==="AbortError"?S:new ls.FunctionsFetchError(S)}),m=f.headers.get("x-relay-error");if(m&&m==="true")throw new ls.FunctionsRelayError(f);if(!f.ok)throw new ls.FunctionsHttpError(f);let g=((i=f.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),b;return g==="application/json"?b=yield f.json():g==="application/octet-stream"||g==="application/pdf"?b=yield f.blob():g==="text/event-stream"?b=f:g==="multipart/form-data"?b=yield f.formData():b=yield f.text(),{data:b,error:null,response:f}}catch(s){return s instanceof Error&&s.name==="AbortError"?{data:null,error:new ls.FunctionsFetchError(s)}:{data:null,error:s,response:s instanceof ls.FunctionsHttpError||s instanceof ls.FunctionsRelayError?s.context:void 0}}})}};$l.FunctionsClient=jm});var Bm=E(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.FunctionRegion=mr.FunctionsRelayError=mr.FunctionsHttpError=mr.FunctionsFetchError=mr.FunctionsError=mr.FunctionsClient=void 0;var VU=q_();Object.defineProperty(mr,"FunctionsClient",{enumerable:!0,get:function(){return VU.FunctionsClient}});var du=Lm();Object.defineProperty(mr,"FunctionsError",{enumerable:!0,get:function(){return du.FunctionsError}});Object.defineProperty(mr,"FunctionsFetchError",{enumerable:!0,get:function(){return du.FunctionsFetchError}});Object.defineProperty(mr,"FunctionsHttpError",{enumerable:!0,get:function(){return du.FunctionsHttpError}});Object.defineProperty(mr,"FunctionsRelayError",{enumerable:!0,get:function(){return du.FunctionsRelayError}});Object.defineProperty(mr,"FunctionRegion",{enumerable:!0,get:function(){return du.FunctionRegion}})});var Um=E(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});var Mm=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};qm.default=Mm});var zm=E(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});var zU=(fe(),ue(le)),GU=zU.__importDefault(Um()),Hm=class{constructor(e){var r,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(r=e.shouldThrowOnError)!==null&&r!==void 0?r:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=new Headers(this.headers),this.headers.set(e,r),this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{var o,a,u,c;let l=null,h=null,d=null,f=s.status,m=s.statusText;if(s.ok){if(this.method!=="HEAD"){let A=await s.text();A===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((o=this.headers.get("Accept"))===null||o===void 0)&&o.includes("application/vnd.pgrst.plan+text"))?h=A:h=JSON.parse(A))}let b=(a=this.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),S=(u=s.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");b&&S&&S.length>1&&(d=parseInt(S[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(h)&&(h.length>1?(l={code:"PGRST116",details:`Results contain ${h.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},h=null,d=null,f=406,m="Not Acceptable"):h.length===1?h=h[0]:h=null)}else{let b=await s.text();try{l=JSON.parse(b),Array.isArray(l)&&s.status===404&&(h=[],l=null,f=200,m="OK")}catch{s.status===404&&b===""?(f=204,m="No Content"):l={message:b}}if(l&&this.isMaybeSingle&&(!((c=l?.details)===null||c===void 0)&&c.includes("0 rows"))&&(l=null,f=200,m="OK"),l&&this.shouldThrowOnError)throw new GU.default(l)}return{error:l,data:h,count:d,status:f,statusText:m}});return this.shouldThrowOnError||(i=i.catch(s=>{var o,a,u;return{error:{message:`${(o=s?.name)!==null&&o!==void 0?o:"FetchError"}: ${s?.message}`,details:`${(a=s?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(u=s?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}returns(){return this}overrideTypes(){return this}};Vm.default=Hm});var Wm=E(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});var KU=(fe(),ue(le)),WU=KU.__importDefault(zm()),Gm=class extends WU.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:s=i}={}){let o=s?`${s}.order`:"order",a=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${a?`${a},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let s=typeof i>"u"?"offset":`${i}.offset`,o=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(o,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:s=!1,format:o="text"}={}){var a;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${c}"; options=${u};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};Km.default=Gm});var Ll=E(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});var XU=(fe(),ue(le)),YU=XU.__importDefault(Wm()),JU=new RegExp("[,()]"),Xm=class extends YU.default{eq(e,r){return this.url.searchParams.append(e,`eq.${r}`),this}neq(e,r){return this.url.searchParams.append(e,`neq.${r}`),this}gt(e,r){return this.url.searchParams.append(e,`gt.${r}`),this}gte(e,r){return this.url.searchParams.append(e,`gte.${r}`),this}lt(e,r){return this.url.searchParams.append(e,`lt.${r}`),this}lte(e,r){return this.url.searchParams.append(e,`lte.${r}`),this}like(e,r){return this.url.searchParams.append(e,`like.${r}`),this}likeAllOf(e,r){return this.url.searchParams.append(e,`like(all).{${r.join(",")}}`),this}likeAnyOf(e,r){return this.url.searchParams.append(e,`like(any).{${r.join(",")}}`),this}ilike(e,r){return this.url.searchParams.append(e,`ilike.${r}`),this}ilikeAllOf(e,r){return this.url.searchParams.append(e,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(e,r){return this.url.searchParams.append(e,`ilike(any).{${r.join(",")}}`),this}is(e,r){return this.url.searchParams.append(e,`is.${r}`),this}in(e,r){let n=Array.from(new Set(r)).map(i=>typeof i=="string"&&JU.test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}contains(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cs.{${r.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(r)}`),this}containedBy(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cd.{${r.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(r)}`),this}rangeGt(e,r){return this.url.searchParams.append(e,`sr.${r}`),this}rangeGte(e,r){return this.url.searchParams.append(e,`nxl.${r}`),this}rangeLt(e,r){return this.url.searchParams.append(e,`sl.${r}`),this}rangeLte(e,r){return this.url.searchParams.append(e,`nxr.${r}`),this}rangeAdjacent(e,r){return this.url.searchParams.append(e,`adj.${r}`),this}overlaps(e,r){return typeof r=="string"?this.url.searchParams.append(e,`ov.${r}`):this.url.searchParams.append(e,`ov.{${r.join(",")}}`),this}textSearch(e,r,{config:n,type:i}={}){let s="";i==="plain"?s="pl":i==="phrase"?s="ph":i==="websearch"&&(s="w");let o=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${o}.${r}`),this}match(e){return Object.entries(e).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(e,r,n){return this.url.searchParams.append(e,`not.${r}.${n}`),this}or(e,{foreignTable:r,referencedTable:n=r}={}){let i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${e})`),this}filter(e,r,n){return this.url.searchParams.append(e,`${r}.${n}`),this}};Ym.default=Xm});var Qm=E(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});var ZU=(fe(),ue(le)),pu=ZU.__importDefault(Ll()),Jm=class{constructor(e,{headers:r={},schema:n,fetch:i}){this.url=e,this.headers=new Headers(r),this.schema=n,this.fetch=i}select(e,r){let{head:n=!1,count:i}=r??{},s=n?"HEAD":"GET",o=!1,a=(e??"*").split("").map(u=>/\s/.test(u)&&!o?"":(u==='"'&&(o=!o),u)).join("");return this.url.searchParams.set("select",a),i&&this.headers.append("Prefer",`count=${i}`),new pu.default({method:s,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(e,{count:r,defaultToNull:n=!0}={}){var i;let s="POST";if(r&&this.headers.append("Prefer",`count=${r}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(e)){let o=e.reduce((a,u)=>a.concat(Object.keys(u)),[]);if(o.length>0){let a=[...new Set(o)].map(u=>`"${u}"`);this.url.searchParams.set("columns",a.join(","))}}return new pu.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:s=!0}={}){var o;let a="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),r!==void 0&&this.url.searchParams.set("on_conflict",r),i&&this.headers.append("Prefer",`count=${i}`),s||this.headers.append("Prefer","missing=default"),Array.isArray(e)){let u=e.reduce((c,l)=>c.concat(Object.keys(l)),[]);if(u.length>0){let c=[...new Set(u)].map(l=>`"${l}"`);this.url.searchParams.set("columns",c.join(","))}}return new pu.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}update(e,{count:r}={}){var n;let i="PATCH";return r&&this.headers.append("Prefer",`count=${r}`),new pu.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:e}={}){var r;let n="DELETE";return e&&this.headers.append("Prefer",`count=${e}`),new pu.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}};Zm.default=Jm});var H_=E(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});var U_=(fe(),ue(le)),QU=U_.__importDefault(Qm()),e4=U_.__importDefault(Ll()),eg=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new QU.default(r,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:s}={}){var o;let a,u=new URL(`${this.url}/rpc/${e}`),c;n||i?(a=n?"HEAD":"GET",Object.entries(r).filter(([h,d])=>d!==void 0).map(([h,d])=>[h,Array.isArray(d)?`{${d.join(",")}}`:`${d}`]).forEach(([h,d])=>{u.searchParams.append(h,d)})):(a="POST",c=r);let l=new Headers(this.headers);return s&&l.set("Prefer",`count=${s}`),new e4.default({method:a,url:u,headers:l,schema:this.schemaName,body:c,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}};tg.default=eg});var rg=E(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.PostgrestError=er.PostgrestBuilder=er.PostgrestTransformBuilder=er.PostgrestFilterBuilder=er.PostgrestQueryBuilder=er.PostgrestClient=void 0;var _o=(fe(),ue(le)),V_=_o.__importDefault(H_());er.PostgrestClient=V_.default;var z_=_o.__importDefault(Qm());er.PostgrestQueryBuilder=z_.default;var G_=_o.__importDefault(Ll());er.PostgrestFilterBuilder=G_.default;var K_=_o.__importDefault(Wm());er.PostgrestTransformBuilder=K_.default;var W_=_o.__importDefault(zm());er.PostgrestBuilder=W_.default;var X_=_o.__importDefault(Um());er.PostgrestError=X_.default;er.default={PostgrestClient:V_.default,PostgrestQueryBuilder:z_.default,PostgrestFilterBuilder:G_.default,PostgrestTransformBuilder:K_.default,PostgrestBuilder:W_.default,PostgrestError:X_.default}});var ng=E(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.WebSocketFactory=void 0;var jl=class{static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){let r=process.versions;if(r&&r.node){let n=r.node,i=parseInt(n.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
2
2
|
import ws from "ws"
|
|
3
3
|
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.constructor)return e.constructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`
|
|
4
4
|
|
|
@@ -37,39 +37,39 @@ Request ID: ${u}`),c){let A=`
|
|
|
37
37
|
Resources:`;for(let p of c){if(!p||typeof p!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${p}`);A+=`
|
|
38
38
|
- ${p}`}S+=A}return`${b}
|
|
39
39
|
${S}`}});var zC=E(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.WebAuthnUnknownError=Gn.WebAuthnError=void 0;Gn.isWebAuthnError=$9;Gn.identifyRegistrationError=L9;Gn.identifyAuthenticationError=j9;var VC=Ty(),st=class extends Error{constructor({message:e,code:r,cause:n,name:i}){var s;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(s=i??(n instanceof Error?n.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=r}};Gn.WebAuthnError=st;var xy=class extends st{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}};Gn.WebAuthnUnknownError=xy;function $9(t){return typeof t=="object"&&t!==null&&"__isWebAuthnError"in t}function L9({error:t,options:e}){var r,n,i;let{publicKey:s}=e;if(!s)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new st({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=s.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new st({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=s.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new st({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((i=s.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new st({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new st({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new st({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return s.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new st({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new st({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){let o=window.location.hostname;if((0,VC.isValidDomain)(o)){if(s.rp.id!==o)return new st({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new st({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new st({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new st({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new st({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function j9({error:t,options:e}){let{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new st({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new st({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){let n=window.location.hostname;if((0,VC.isValidDomain)(n)){if(r.rpId!==n)return new st({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new st({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new st({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new st({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}});var Ty=E(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.WebAuthnApi=Se.DEFAULT_REQUEST_OPTIONS=Se.DEFAULT_CREATION_OPTIONS=Se.webAuthnAbortService=Se.WebAuthnAbortService=Se.identifyAuthenticationError=Se.identifyRegistrationError=Se.isWebAuthnError=Se.WebAuthnError=void 0;Se.deserializeCredentialCreationOptions=M9;Se.deserializeCredentialRequestOptions=q9;Se.serializeCredentialCreationResponse=U9;Se.serializeCredentialRequestResponse=H9;Se.isValidDomain=V9;Se.createCredential=WC;Se.getCredential=XC;Se.mergeCredentialCreationOptions=YC;Se.mergeCredentialRequestOptions=JC;var KC=(fe(),ue(le)),rn=mf(),dn=ds(),B9=Po(),pn=zC();Object.defineProperty(Se,"identifyAuthenticationError",{enumerable:!0,get:function(){return pn.identifyAuthenticationError}});Object.defineProperty(Se,"identifyRegistrationError",{enumerable:!0,get:function(){return pn.identifyRegistrationError}});Object.defineProperty(Se,"isWebAuthnError",{enumerable:!0,get:function(){return pn.isWebAuthnError}});Object.defineProperty(Se,"WebAuthnError",{enumerable:!0,get:function(){return pn.WebAuthnError}});var Ef=class{createNewAbortSignal(){if(this.controller){let r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}};Se.WebAuthnAbortService=Ef;Se.webAuthnAbortService=new Ef;function M9(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);let{challenge:e,user:r,excludeCredentials:n}=t,i=KC.__rest(t,["challenge","user","excludeCredentials"]),s=(0,rn.base64UrlToUint8Array)(e).buffer,o=Object.assign(Object.assign({},r),{id:(0,rn.base64UrlToUint8Array)(r.id).buffer}),a=Object.assign(Object.assign({},i),{challenge:s,user:o});if(n&&n.length>0){a.excludeCredentials=new Array(n.length);for(let u=0;u<n.length;u++){let c=n[u];a.excludeCredentials[u]=Object.assign(Object.assign({},c),{id:(0,rn.base64UrlToUint8Array)(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return a}function q9(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);let{challenge:e,allowCredentials:r}=t,n=KC.__rest(t,["challenge","allowCredentials"]),i=(0,rn.base64UrlToUint8Array)(e).buffer,s=Object.assign(Object.assign({},n),{challenge:i});if(r&&r.length>0){s.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){let a=r[o];s.allowCredentials[o]=Object.assign(Object.assign({},a),{id:(0,rn.base64UrlToUint8Array)(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return s}function U9(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();let r=t;return{id:t.id,rawId:t.id,response:{attestationObject:(0,rn.bytesToBase64URL)(new Uint8Array(t.response.attestationObject)),clientDataJSON:(0,rn.bytesToBase64URL)(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function H9(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();let r=t,n=t.getClientExtensionResults(),i=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:(0,rn.bytesToBase64URL)(new Uint8Array(i.authenticatorData)),clientDataJSON:(0,rn.bytesToBase64URL)(new Uint8Array(i.clientDataJSON)),signature:(0,rn.bytesToBase64URL)(new Uint8Array(i.signature)),userHandle:i.userHandle?(0,rn.bytesToBase64URL)(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function V9(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function GC(){var t,e;return!!((0,B9.isBrowser)()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator?.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator?.credentials)===null||e===void 0?void 0:e.get)=="function")}async function WC(t){try{let e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new pn.WebAuthnUnknownError("Browser returned unexpected credential type",e)}:{data:null,error:new pn.WebAuthnUnknownError("Empty credential response",e)}}catch(e){return{data:null,error:(0,pn.identifyRegistrationError)({error:e,options:t})}}}async function XC(t){try{let e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new pn.WebAuthnUnknownError("Browser returned unexpected credential type",e)}:{data:null,error:new pn.WebAuthnUnknownError("Empty credential response",e)}}catch(e){return{data:null,error:(0,pn.identifyAuthenticationError)({error:e,options:t})}}}Se.DEFAULT_CREATION_OPTIONS={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"none"};Se.DEFAULT_REQUEST_OPTIONS={userVerification:"preferred",hints:["security-key"]};function _f(...t){let e=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),r=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),n={};for(let i of t)if(i)for(let s in i){let o=i[s];if(o!==void 0)if(Array.isArray(o))n[s]=o;else if(r(o))n[s]=o;else if(e(o)){let a=n[s];e(a)?n[s]=_f(a,o):n[s]=_f(o)}else n[s]=o}return n}function YC(t,e){return _f(Se.DEFAULT_CREATION_OPTIONS,t,e||{})}function JC(t,e){return _f(Se.DEFAULT_REQUEST_OPTIONS,t,e||{})}var Fy=class{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:i},s){try{let{data:o,error:a}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!o)return{data:null,error:a};let u=i??Se.webAuthnAbortService.createNewAbortSignal();if(o.webauthn.type==="create"){let{user:c}=o.webauthn.credential_options.publicKey;c.name||(c.name=`${c.id}:${n}`),c.displayName||(c.displayName=c.name)}switch(o.webauthn.type){case"create":{let c=YC(o.webauthn.credential_options.publicKey,s?.create),{data:l,error:h}=await WC({publicKey:c,signal:u});return l?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:l}},error:null}:{data:null,error:h}}case"request":{let c=JC(o.webauthn.credential_options.publicKey,s?.request),{data:l,error:h}=await XC(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:c,signal:u}));return l?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:l}},error:null}:{data:null,error:h}}}}catch(o){return(0,dn.isAuthError)(o)?{data:null,error:o}:{data:null,error:new dn.AuthUnknownError("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}},s){if(!r)return{data:null,error:new dn.AuthError("rpId is required for WebAuthn authentication")};try{if(!GC())return{data:null,error:new dn.AuthUnknownError("Browser does not support WebAuthn",null)};let{data:o,error:a}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:i},{request:s});if(!o)return{data:null,error:a};let{webauthn:u}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:u.type,rpId:r,rpOrigins:n,credential_response:u.credential_response}})}catch(o){return(0,dn.isAuthError)(o)?{data:null,error:o}:{data:null,error:new dn.AuthUnknownError("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i},s){if(!r)return{data:null,error:new dn.AuthError("rpId is required for WebAuthn registration")};try{if(!GC())return{data:null,error:new dn.AuthUnknownError("Browser does not support WebAuthn",null)};let{data:o,error:a}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(l=>{var h;return(h=l.data)===null||h===void 0?void 0:h.all.find(d=>d.factor_type==="webauthn"&&d.friendly_name===e&&d.status!=="unverified")}).then(l=>l?this.client.mfa.unenroll({factorId:l?.id}):void 0),{data:null,error:a};let{data:u,error:c}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:i},{create:s});return u?this._verify({factorId:o.id,challengeId:u.challengeId,webauthn:{rpId:r,rpOrigins:n,type:u.webauthn.type,credential_response:u.webauthn.credential_response}}):{data:null,error:c}}catch(o){return(0,dn.isAuthError)(o)?{data:null,error:o}:{data:null,error:new dn.AuthUnknownError("Unexpected error in register",o)}}}};Se.WebAuthnApi=Fy});var ky=E(Iy=>{"use strict";Object.defineProperty(Iy,"__esModule",{value:!0});var z9=(fe(),ue(le)),G9=z9.__importDefault(wf()),Dr=df(),ee=ds(),he=by(),se=Po(),ZC=BC(),QC=Ay(),K9=qC(),W9=iy(),eS=mf(),Cf=HC(),Iu=Ty();(0,K9.polyfillGlobalThis)();var X9={url:Dr.GOTRUE_URL,storageKey:Dr.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Dr.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function tS(t,e,r){return await r()}var No={},Sf=class t{get jwks(){var e,r;return(r=(e=No[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){No[this.storageKey]=Object.assign(Object.assign({},No[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=No[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){No[this.storageKey]=Object.assign(Object.assign({},No[this.storageKey]),{cachedAt:e})}constructor(e){var r,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=t.nextInstanceID,t.nextInstanceID+=1,this.instanceID>0&&(0,se.isBrowser)()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let i=Object.assign(Object.assign({},X9),e);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new G9.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,se.resolveFetch)(i.fetch),this.lock=i.lock||tS,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,i.lock?this.lock=i.lock:(0,se.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=QC.navigatorLock:this.lock=tS,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Iu.WebAuthnApi(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:(0,se.supportsLocalStorage)()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=(0,ZC.memoryLocalStorageAdapter)(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=(0,ZC.memoryLocalStorageAdapter)(this.memoryStorage)),(0,se.isBrowser)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s),await this._notifyAllSubscribers(s.data.event,s.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${W9.version}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if((0,se.isBrowser)()&&(r=(0,se.parseParametersFromURL)(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),(0,se.isBrowser)()&&this.detectSessionInUrl&&n!=="none"){let{data:i,error:s}=await this._getSessionFromURL(r,n);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),(0,ee.isAuthImplicitGrantRedirectError)(s)){let u=(e=s.details)===null||e===void 0?void 0:e.code;if(u==="identity_already_exists"||u==="identity_not_found"||u==="single_identity_not_deletable")return{error:s}}return await this._removeSession(),{error:s}}let{session:o,redirectType:a}=i;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return(0,ee.isAuthError)(r)?this._returnResult({error:r}):this._returnResult({error:new ee.AuthUnknownError("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let s=await(0,he._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:he._sessionResponse}),{data:o,error:a}=s;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});let u=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:c,session:u},error:null})}catch(s){if((0,ee.isAuthError)(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var r,n,i;try{let s;if("email"in e){let{email:l,password:h,options:d}=e,f=null,m=null;this.flowType==="pkce"&&([f,m]=await(0,se.getCodeChallengeAndMethod)(this.storage,this.storageKey)),s=await(0,he._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:d?.emailRedirectTo,body:{email:l,password:h,data:(r=d?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:d?.captchaToken},code_challenge:f,code_challenge_method:m},xform:he._sessionResponse})}else if("phone"in e){let{phone:l,password:h,options:d}=e;s=await(0,he._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:h,data:(n=d?.data)!==null&&n!==void 0?n:{},channel:(i=d?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:d?.captchaToken}},xform:he._sessionResponse})}else throw new ee.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:o,error:a}=s;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});let u=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:c,session:u},error:null})}catch(s){if((0,ee.isAuthError)(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let r;if("email"in e){let{email:s,password:o,options:a}=e;r=await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:o,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:he._sessionResponsePassword})}else if("phone"in e){let{phone:s,password:o,options:a}=e;r=await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:o,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:he._sessionResponsePassword})}else throw new ee.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:n,error:i}=r;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!n||!n.session||!n.user){let s=new ee.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null},error:s})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,i,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,i,s,o,a,u,c,l,h,d;let f,m;if("message"in e)f=e.message,m=e.signature;else{let{chain:g,wallet:b,statement:S,options:A}=e,p;if((0,se.isBrowser)())if(typeof b=="object")p=b;else{let R=window;if("ethereum"in R&&typeof R.ethereum=="object"&&"request"in R.ethereum&&typeof R.ethereum.request=="function")p=R.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!A?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");p=b}let D=new URL((r=A?.url)!==null&&r!==void 0?r:window.location.href),y=await p.request({method:"eth_requestAccounts"}).then(R=>R).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!y||y.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");let C=(0,Cf.getAddress)(y[0]),k=(n=A?.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!k){let R=await p.request({method:"eth_chainId"});k=(0,Cf.fromHex)(R)}let v={domain:D.host,address:C,statement:S,uri:D.href,version:"1",chainId:k,nonce:(i=A?.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(o=(s=A?.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(a=A?.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(u=A?.signInWithEthereum)===null||u===void 0?void 0:u.notBefore,requestId:(c=A?.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(l=A?.signInWithEthereum)===null||l===void 0?void 0:l.resources};f=(0,Cf.createSiweMessage)(v),m=await p.request({method:"personal_sign",params:[(0,Cf.toHex)(f),C]})}try{let{data:g,error:b}=await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:m},!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(d=e.options)===null||d===void 0?void 0:d.captchaToken}}:null),xform:he._sessionResponse});if(b)throw b;if(!g||!g.session||!g.user){let S=new ee.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null},error:S})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:b})}catch(g){if((0,ee.isAuthError)(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(e){var r,n,i,s,o,a,u,c,l,h,d,f;let m,g;if("message"in e)m=e.message,g=e.signature;else{let{chain:b,wallet:S,statement:A,options:p}=e,D;if((0,se.isBrowser)())if(typeof S=="object")D=S;else{let C=window;if("solana"in C&&typeof C.solana=="object"&&("signIn"in C.solana&&typeof C.solana.signIn=="function"||"signMessage"in C.solana&&typeof C.solana.signMessage=="function"))D=C.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof S!="object"||!p?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");D=S}let y=new URL((r=p?.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in D&&D.signIn){let C=await D.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},p?.signInWithSolana),{version:"1",domain:y.host,uri:y.href}),A?{statement:A}:null)),k;if(Array.isArray(C)&&C[0]&&typeof C[0]=="object")k=C[0];else if(C&&typeof C=="object"&&"signedMessage"in C&&"signature"in C)k=C;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in k&&"signature"in k&&(typeof k.signedMessage=="string"||k.signedMessage instanceof Uint8Array)&&k.signature instanceof Uint8Array)m=typeof k.signedMessage=="string"?k.signedMessage:new TextDecoder().decode(k.signedMessage),g=k.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in D)||typeof D.signMessage!="function"||!("publicKey"in D)||typeof D!="object"||!D.publicKey||!("toBase58"in D.publicKey)||typeof D.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");m=[`${y.host} wants you to sign in with your Solana account:`,D.publicKey.toBase58(),...A?["",A,""]:[""],"Version: 1",`URI: ${y.href}`,`Issued At: ${(i=(n=p?.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((s=p?.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${p.signInWithSolana.notBefore}`]:[],...!((o=p?.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${p.signInWithSolana.expirationTime}`]:[],...!((a=p?.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${p.signInWithSolana.chainId}`]:[],...!((u=p?.signInWithSolana)===null||u===void 0)&&u.nonce?[`Nonce: ${p.signInWithSolana.nonce}`]:[],...!((c=p?.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${p.signInWithSolana.requestId}`]:[],...!((h=(l=p?.signInWithSolana)===null||l===void 0?void 0:l.resources)===null||h===void 0)&&h.length?["Resources",...p.signInWithSolana.resources.map(k=>`- ${k}`)]:[]].join(`
|
|
40
|
-
`);let C=await D.signMessage(new TextEncoder().encode(m),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=C}}try{let{data:b,error:S}=await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:m,signature:(0,eS.bytesToBase64URL)(g)},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:he._sessionResponse});if(S)throw S;if(!b||!b.session||!b.user){let A=new ee.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null},error:A})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:S})}catch(b){if((0,ee.isAuthError)(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(e){let r=await(0,se.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:s,error:o}=await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:he._sessionResponse});if(await(0,se.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!s||!s.session||!s.user){let a=new ee.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:o})}catch(s){if((0,ee.isAuthError)(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:s,nonce:o}=e,a=await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:s,nonce:o,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:he._sessionResponse}),{data:u,error:c}=a;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!u||!u.session||!u.user){let l=new ee.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null},error:l})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),this._returnResult({data:u,error:c})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,i,s,o;try{if("email"in e){let{email:a,options:u}=e,c=null,l=null;this.flowType==="pkce"&&([c,l]=await(0,se.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:h}=await(0,he._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=u?.data)!==null&&r!==void 0?r:{},create_user:(n=u?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:c,code_challenge_method:l},redirectTo:u?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in e){let{phone:a,options:u}=e,{data:c,error:l}=await(0,he._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=u?.data)!==null&&i!==void 0?i:{},create_user:(s=u?.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(o=u?.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c?.message_id},error:l})}throw new ee.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,ee.isAuthError)(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(e){var r,n;try{let i,s;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,s=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:o,error:a}=await(0,he._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:he._sessionResponse});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");let u=o.session,c=o.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),this._returnResult({data:{user:c,session:u},error:null})}catch(i){if((0,ee.isAuthError)(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(e){var r,n,i;try{let s=null,o=null;this.flowType==="pkce"&&([s,o]=await(0,se.getCodeChallengeAndMethod)(this.storage,this.storageKey));let a=await(0,he._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:s,code_challenge_method:o}),headers:this.headers,xform:he._ssoResponse});return this._returnResult(a)}catch(s){if((0,ee.isAuthError)(s))return this._returnResult({data:null,error:s});throw s}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new ee.AuthSessionMissingError;let{error:i}=await(0,he._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(e){if((0,ee.isAuthError)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:s}=e,{error:o}=await(0,he._request)(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:s?.captchaToken}},redirectTo:s?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in e){let{phone:n,type:i,options:s}=e,{data:o,error:a}=await(0,he._request)(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:s?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o?.message_id},error:a})}throw new ee.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,se.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()<Dr.EXPIRY_MARGIN_MS:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){let o=await(0,se.getItemAsync)(this.userStorage,this.storageKey+"-user");o?.user?e.user=o.user:e.user=(0,se.userNotAvailableProxy)()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let o={value:this.suppressGetSessionWarning};e.user=(0,se.insecureUserWarningProxy)(e.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}let{data:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{session:null},error:s}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await(0,he._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:he._userResponse}):await this._useSession(async r=>{var n,i,s;let{data:o,error:a}=r;if(a)throw a;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new ee.AuthSessionMissingError}:await(0,he._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:he._userResponse})})}catch(r){if((0,ee.isAuthError)(r))return(0,ee.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,se.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:s}=n;if(s)throw s;if(!i.session)throw new ee.AuthSessionMissingError;let o=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,se.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:c,error:l}=await(0,he._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:u}),jwt:o.access_token,xform:he._userResponse});if(l)throw l;return o.user=c.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if((0,ee.isAuthError)(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new ee.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,s=null,{payload:o}=(0,se.decodeJWT)(e.access_token);if(o.exp&&(n=o.exp,i=n<=r),i){let{data:a,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!a)return{data:{user:null,session:null},error:null};s=a}else{let{data:a,error:u}=await this._getUser(e.access_token);if(u)throw u;s={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:o,error:a}=r;if(a)throw a;e=(n=o.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new ee.AuthSessionMissingError;let{data:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){try{if(!(0,se.isBrowser)())throw new ee.AuthImplicitGrantRedirectError("No browser detected.");if(e.error||e.error_description||e.error_code)throw new ee.AuthImplicitGrantRedirectError(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new ee.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ee.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new ee.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:A,error:p}=await this._exchangeCodeForSession(e.code);if(p)throw p;let D=new URL(window.location.href);return D.searchParams.delete("code"),window.history.replaceState(window.history.state,"",D.toString()),{data:{session:A.session,redirectType:null},error:null}}let{provider_token:n,provider_refresh_token:i,access_token:s,refresh_token:o,expires_in:a,expires_at:u,token_type:c}=e;if(!s||!a||!o||!c)throw new ee.AuthImplicitGrantRedirectError("No session defined in URL");let l=Math.round(Date.now()/1e3),h=parseInt(a),d=l+h;u&&(d=parseInt(u));let f=d-l;f*1e3<=Dr.AUTO_REFRESH_TICK_DURATION_MS&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${h}s`);let m=d-h;l-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,d,l):l-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,d,l);let{data:g,error:b}=await this._getUser(s);if(b)throw b;let S={provider_token:n,provider_refresh_token:i,access_token:s,expires_in:h,expires_at:d,refresh_token:o,token_type:c,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:S,redirectType:e.type},error:null})}catch(n){if((0,ee.isAuthError)(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){let r=await(0,se.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:s}=r;if(s)return this._returnResult({error:s});let o=(n=i.session)===null||n===void 0?void 0:n.access_token;if(o){let{error:a}=await this.admin.signOut(o,e);if(a&&!((0,ee.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return this._returnResult({error:a})}return e!=="others"&&(await this._removeSession(),await(0,se.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let r=(0,se.uuid)(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:s},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),console.error(s)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await(0,se.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,he._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(s){if((0,ee.isAuthError)(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{let{data:n,error:i}=await this._useSession(async s=>{var o,a,u,c,l;let{data:h,error:d}=s;if(d)throw d;let f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await(0,he._request)(this.fetch,"GET",f,{headers:this.headers,jwt:(l=(c=h.session)===null||c===void 0?void 0:c.access_token)!==null&&l!==void 0?l:void 0})});if(i)throw i;return(0,se.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),this._returnResult({data:{provider:e.provider,url:n?.url},error:null})}catch(n){if((0,ee.isAuthError)(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{let{error:i,data:{session:s}}=r;if(i)throw i;let{options:o,provider:a,token:u,access_token:c,nonce:l}=e,h=await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=s?.access_token)!==null&&n!==void 0?n:void 0,body:{provider:a,id_token:u,access_token:c,nonce:l,link_identity:!0,gotrue_meta_security:{captcha_token:o?.captchaToken}},xform:he._sessionResponse}),{data:d,error:f}=h;return f?this._returnResult({data:{user:null,session:null},error:f}):!d||!d.session||!d.user?this._returnResult({data:{user:null,session:null},error:new ee.AuthInvalidTokenResponseError}):(d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("USER_UPDATED",d.session)),this._returnResult({data:d,error:f}))}catch(i){if((0,ee.isAuthError)(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:s,error:o}=r;if(o)throw o;return await(0,he._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=s.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await(0,se.retryable)(async i=>(i>0&&await(0,se.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:he._sessionResponse})),(i,s)=>{let o=200*Math.pow(2,i);return s&&(0,ee.isAuthRetryableFetchError)(s)&&Date.now()+o-n<Dr.AUTO_REFRESH_TICK_DURATION_MS})}catch(n){if(this._debug(r,"error",n),(0,ee.isAuthError)(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),(0,se.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;let n="#_recoverAndRefresh()";this._debug(n,"begin");try{let i=await(0,se.getItemAsync)(this.storage,this.storageKey);if(i&&this.userStorage){let o=await(0,se.getItemAsync)(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:i.user},await(0,se.setItemAsync)(this.userStorage,this.storageKey+"-user",o)),i.user=(e=o?.user)!==null&&e!==void 0?e:(0,se.userNotAvailableProxy)()}else if(i&&!i.user&&!i.user){let o=await(0,se.getItemAsync)(this.storage,this.storageKey+"-user");o&&o?.user?(i.user=o.user,await(0,se.removeItemAsync)(this.storage,this.storageKey+"-user"),await(0,se.setItemAsync)(this.storage,this.storageKey,i)):i.user=(0,se.userNotAvailableProxy)()}if(this._debug(n,"session from storage",i),!this._isValidSession(i)){this._debug(n,"session is not valid"),i!==null&&await this._removeSession();return}let s=((r=i.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Dr.EXPIRY_MARGIN_MS;if(this._debug(n,`session has${s?"":" not"} expired with margin of ${Dr.EXPIRY_MARGIN_MS}s`),s){if(this.autoRefreshToken&&i.refresh_token){let{error:o}=await this._callRefreshToken(i.refresh_token);o&&(console.error(o),(0,ee.isAuthRetryableFetchError)(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{let{data:o,error:a}=await this._getUser(i.access_token);!a&&o?.user?(i.user=o.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(n,"error",i),console.error(i);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new ee.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new se.Deferred;let{data:s,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!s.session)throw new ee.AuthSessionMissingError;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);let a={data:s.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(s){if(this._debug(i,"error",s),(0,ee.isAuthError)(s)){let o={data:null,error:s};return(0,ee.isAuthRetryableFetchError)(s)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(s),s}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let s=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(u){s.push(u)}});if(await Promise.all(o),s.length>0){for(let a=0;a<s.length;a+=1)console.error(s[a]);throw s[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;let r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await(0,se.setItemAsync)(this.userStorage,this.storageKey+"-user",{user:r.user});let i=Object.assign({},r);delete i.user;let s=(0,se.deepClone)(i);await(0,se.setItemAsync)(this.storage,this.storageKey,s)}else{let i=(0,se.deepClone)(r);await(0,se.setItemAsync)(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),await(0,se.removeItemAsync)(this.storage,this.storageKey),await(0,se.removeItemAsync)(this.storage,this.storageKey+"-code-verifier"),await(0,se.removeItemAsync)(this.storage,this.storageKey+"-user"),this.userStorage&&await(0,se.removeItemAsync)(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,se.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),Dr.AUTO_REFRESH_TICK_DURATION_MS);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async r=>{let{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let i=Math.floor((n.expires_at*1e3-e)/Dr.AUTO_REFRESH_TICK_DURATION_MS);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Dr.AUTO_REFRESH_TICK_DURATION_MS}ms, refresh threshold is ${Dr.AUTO_REFRESH_TICK_THRESHOLD} ticks`),i<=Dr.AUTO_REFRESH_TICK_THRESHOLD&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof QC.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,se.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[s,o]=await(0,se.getCodeChallengeAndMethod)(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(a.toString())}if(n?.queryParams){let s=new URLSearchParams(n.queryParams);i.push(s.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:s}=r;return s?this._returnResult({data:null,error:s}):await(0,he._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:s,error:o}=r;if(o)return this._returnResult({data:null,error:o});let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:u,error:c}=await(0,he._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=s?.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(e.factorType==="totp"&&u.type==="totp"&&(!((i=u?.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),this._returnResult({data:u,error:null}))})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:s}=r;if(s)return this._returnResult({data:null,error:s});let o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?(0,Iu.serializeCredentialCreationResponse)(e.webauthn.credential_response):(0,Iu.serializeCredentialRequestResponse)(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:u}=await(0,he._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:u}))})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:s}=r;if(s)return this._returnResult({data:null,error:s});let o=await(0,he._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;let{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:(0,Iu.deserializeCredentialCreationOptions)(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:(0,Iu.deserializeCredentialRequestOptions)(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;let{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};let i={all:[],phone:[],totp:[],webauthn:[]};for(let s of(e=r?.factors)!==null&&e!==void 0?e:[])i.all.push(s),s.status==="verified"&&i[s.factor_type].push(s);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(){var e,r;let{data:{session:n},error:i}=await this.getSession();if(i)return this._returnResult({data:null,error:i});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:s}=(0,se.decodeJWT)(n.access_token),o=null;s.aal&&(o=s.aal);let a=o;((r=(e=n.user.factors)===null||e===void 0?void 0:e.filter(l=>l.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(a="aal2");let c=s.amr||[];return{data:{currentLevel:o,nextLevel:a,currentAuthenticationMethods:c},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{let{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?await(0,he._request)(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new ee.AuthSessionMissingError})})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{let{data:{session:i},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new ee.AuthSessionMissingError});let o=await(0,he._request)(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&(0,se.isBrowser)()&&!r?.skipBrowserRedirect&&window.location.assign(o.data.redirect_url),o})}catch(n){if((0,ee.isAuthError)(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{let{data:{session:i},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new ee.AuthSessionMissingError});let o=await(0,he._request)(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&(0,se.isBrowser)()&&!r?.skipBrowserRedirect&&window.location.assign(o.data.redirect_url),o})}catch(n){if((0,ee.isAuthError)(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(a=>a.kid===e);if(n)return n;let i=Date.now();if(n=this.jwks.keys.find(a=>a.kid===e),n&&this.jwks_cached_at+Dr.JWKS_TTL>i)return n;let{data:s,error:o}=await(0,he._request)(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=i,n=s.keys.find(a=>a.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){let{data:f,error:m}=await this.getSession();if(m||!f.session)return this._returnResult({data:null,error:m});n=f.session.access_token}let{header:i,payload:s,signature:o,raw:{header:a,payload:u}}=(0,se.decodeJWT)(n);r?.allowExpired||(0,se.validateExp)(s.exp);let c=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,r?.keys?{keys:r.keys}:r?.jwks);if(!c){let{error:f}=await this.getUser(n);if(f)throw f;return{data:{claims:s,header:i,signature:o},error:null}}let l=(0,se.getAlgorithm)(i.alg),h=await crypto.subtle.importKey("jwk",c,l,!0,["verify"]);if(!await crypto.subtle.verify(l,h,o,(0,eS.stringToUint8Array)(`${a}.${u}`)))throw new ee.AuthInvalidJwtError("Invalid JWT signature");return{data:{claims:s,header:i,signature:o},error:null}}catch(n){if((0,ee.isAuthError)(n))return this._returnResult({data:null,error:n});throw n}}};Sf.nextInstanceID=0;Iy.default=Sf});var rS=E(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});var Y9=(fe(),ue(le)),J9=Y9.__importDefault(wf()),Z9=J9.default;Py.default=Z9});var nS=E(Ry=>{"use strict";Object.defineProperty(Ry,"__esModule",{value:!0});var Q9=(fe(),ue(le)),e7=Q9.__importDefault(ky()),t7=e7.default;Ry.default=t7});var Ny=E(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.processLock=Ct.lockInternals=Ct.NavigatorLockAcquireTimeoutError=Ct.navigatorLock=Ct.AuthClient=Ct.AuthAdminApi=Ct.GoTrueClient=Ct.GoTrueAdminApi=void 0;var $o=(fe(),ue(le)),r7=$o.__importDefault(wf());Ct.GoTrueAdminApi=r7.default;var n7=$o.__importDefault(ky());Ct.GoTrueClient=n7.default;var i7=$o.__importDefault(rS());Ct.AuthAdminApi=i7.default;var s7=$o.__importDefault(nS());Ct.AuthClient=s7.default;$o.__exportStar(vy(),Ct);$o.__exportStar(ds(),Ct);var Af=Ay();Object.defineProperty(Ct,"navigatorLock",{enumerable:!0,get:function(){return Af.navigatorLock}});Object.defineProperty(Ct,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Af.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Ct,"lockInternals",{enumerable:!0,get:function(){return Af.internals}});Object.defineProperty(Ct,"processLock",{enumerable:!0,get:function(){return Af.processLock}})});var iS=E(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.SupabaseAuthClient=void 0;var o7=Ny(),$y=class extends o7.AuthClient{constructor(e){super(e)}};Of.SupabaseAuthClient=$y});var By=E(jy=>{"use strict";Object.defineProperty(jy,"__esModule",{value:!0});var a7=Bm(),u7=rg(),c7=bg(),l7=SC(),xf=OC(),f7=xC(),sS=FC(),h7=iS(),Ly=class{constructor(e,r,n){var i,s,o;this.supabaseUrl=e,this.supabaseKey=r;let a=(0,sS.validateSupabaseUrl)(e);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);let u=`sb-${a.hostname.split(".")[0]}-auth-token`,c={db:xf.DEFAULT_DB_OPTIONS,realtime:xf.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},xf.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:xf.DEFAULT_GLOBAL_OPTIONS},l=(0,sS.applySettingDefaults)(n??{},c);this.storageKey=(i=l.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(h,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=l.auth)!==null&&o!==void 0?o:{},this.headers,l.global.fetch),this.fetch=(0,f7.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.rest=new u7.PostgrestClient(new URL("rest/v1",a).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new l7.StorageClient(this.storageUrl.href,this.headers,this.fetch,n?.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new a7.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,r;if(this.accessToken)return await this.accessToken();let{data:n}=await this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,userStorage:s,storageKey:o,flowType:a,lock:u,debug:c,throwOnError:l},h,d){let f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new h7.SupabaseAuthClient({url:this.authUrl.href,headers:Object.assign(Object.assign({},f),h),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,userStorage:s,flowType:a,lock:u,debug:c,throwOnError:l,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new c7.RealtimeClient(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};jy.default=Ly});var uS=E(Ve=>{"use strict";var d7=Ve&&Ve.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oS=Ve&&Ve.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&d7(e,t,r)},aS=Ve&&Ve.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.createClient=Ve.SupabaseClient=Ve.FunctionRegion=Ve.FunctionsError=Ve.FunctionsRelayError=Ve.FunctionsFetchError=Ve.FunctionsHttpError=Ve.PostgrestError=void 0;var p7=aS(By());oS(Ny(),Ve);var m7=rg();Object.defineProperty(Ve,"PostgrestError",{enumerable:!0,get:function(){return m7.PostgrestError}});var ku=Bm();Object.defineProperty(Ve,"FunctionsHttpError",{enumerable:!0,get:function(){return ku.FunctionsHttpError}});Object.defineProperty(Ve,"FunctionsFetchError",{enumerable:!0,get:function(){return ku.FunctionsFetchError}});Object.defineProperty(Ve,"FunctionsRelayError",{enumerable:!0,get:function(){return ku.FunctionsRelayError}});Object.defineProperty(Ve,"FunctionsError",{enumerable:!0,get:function(){return ku.FunctionsError}});Object.defineProperty(Ve,"FunctionRegion",{enumerable:!0,get:function(){return ku.FunctionRegion}});oS(bg(),Ve);var g7=By();Object.defineProperty(Ve,"SupabaseClient",{enumerable:!0,get:function(){return aS(g7).default}});var y7=(t,e,r)=>new p7.default(t,e,r);Ve.createClient=y7;function D7(){if(typeof window<"u"||typeof process>"u")return!1;let t=process.version;if(t==null)return!1;let e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}D7()&&console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217")});var My=E((vge,cS)=>{cS.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Tf=E(fS=>{var lS={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function w7(t){return function(...e){return e.length&&(t=t.replace(/\{(\d)\}/g,(r,n)=>e[n]||"")),new Error("ADM-ZIP: "+t)}}for(let t of Object.keys(lS))fS[t]=w7(lS[t])});var gS=E((_ge,mS)=>{var b7=require("fs"),xt=require("path"),hS=My(),v7=Tf(),E7=typeof process=="object"&&process.platform==="win32",dS=t=>typeof t=="object"&&t!==null,pS=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=3988292384^e>>>1:e>>>=1;return e>>>0});function ft(t){this.sep=xt.sep,this.fs=b7,dS(t)&&dS(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}mS.exports=ft;ft.prototype.makeDir=function(t){let e=this;function r(n){let i=n.split(e.sep)[0];n.split(e.sep).forEach(function(s){if(!(!s||s.substr(-1,1)===":")){i+=e.sep+s;var o;try{o=e.fs.statSync(i)}catch{e.fs.mkdirSync(i)}if(o&&o.isFile())throw v7.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};ft.prototype.writeFileTo=function(t,e,r,n){let i=this;if(i.fs.existsSync(t)){if(!r)return!1;var s=i.fs.statSync(t);if(s.isDirectory())return!1}var o=xt.dirname(t);i.fs.existsSync(o)||i.makeDir(o);var a;try{a=i.fs.openSync(t,"w",438)}catch{i.fs.chmodSync(t,438),a=i.fs.openSync(t,"w",438)}if(a)try{i.fs.writeSync(a,e,0,e.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(t,n||438),!0};ft.prototype.writeFileToAsync=function(t,e,r,n,i){typeof n=="function"&&(i=n,n=void 0);let s=this;s.fs.exists(t,function(o){if(o&&!r)return i(!1);s.fs.stat(t,function(a,u){if(o&&u.isDirectory())return i(!1);var c=xt.dirname(t);s.fs.exists(c,function(l){l||s.makeDir(c),s.fs.open(t,"w",438,function(h,d){h?s.fs.chmod(t,438,function(){s.fs.open(t,"w",438,function(f,m){s.fs.write(m,e,0,e.length,0,function(){s.fs.close(m,function(){s.fs.chmod(t,n||438,function(){i(!0)})})})})}):d?s.fs.write(d,e,0,e.length,0,function(){s.fs.close(d,function(){s.fs.chmod(t,n||438,function(){i(!0)})})}):s.fs.chmod(t,n||438,function(){i(!0)})})})})})};ft.prototype.findFiles=function(t){let e=this;function r(n,i,s){typeof i=="boolean"&&(s=i,i=void 0);let o=[];return e.fs.readdirSync(n).forEach(function(a){let u=xt.join(n,a),c=e.fs.statSync(u);(!i||i.test(u))&&o.push(xt.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&s&&(o=o.concat(r(u,i,s)))}),o}return r(t,void 0,!0)};ft.prototype.findFilesAsync=function(t,e){let r=this,n=[];r.fs.readdir(t,function(i,s){if(i)return e(i);let o=s.length;if(!o)return e(null,n);s.forEach(function(a){a=xt.join(t,a),r.fs.stat(a,function(u,c){if(u)return e(u);c&&(n.push(xt.normalize(a)+(c.isDirectory()?r.sep:"")),c.isDirectory()?r.findFilesAsync(a,function(l,h){if(l)return e(l);n=n.concat(h),--o||e(null,n)}):--o||e(null,n))})})})};ft.prototype.getAttributes=function(){};ft.prototype.setAttributes=function(){};ft.crc32update=function(t,e){return pS[(t^e)&255]^t>>>8};ft.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=ft.crc32update(r,t[n++]);return~r>>>0};ft.methodToString=function(t){switch(t){case hS.STORED:return"STORED ("+t+")";case hS.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};ft.canonical=function(t){if(!t)return"";let e=xt.posix.normalize("/"+t.split("\\").join("/"));return xt.join(".",e)};ft.zipnamefix=function(t){if(!t)return"";let e=xt.posix.normalize("/"+t.split("\\").join("/"));return xt.posix.join(".",e)};ft.findLast=function(t,e){if(!Array.isArray(t))throw new TypeError("arr is not array");let r=t.length>>>0;for(let n=r-1;n>=0;n--)if(e(t[n],n,t))return t[n]};ft.sanitize=function(t,e){t=xt.resolve(xt.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var s=xt.normalize(xt.join(t,r.slice(n,i).join(xt.sep)));if(s.indexOf(t)===0)return s}return xt.normalize(xt.join(t,xt.basename(e)))};ft.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};ft.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};ft.fromDOS2Date=function(t){return new Date((t>>25&127)+1980,Math.max((t>>21&15)-1,0),Math.max(t>>16&31,1),t>>11&31,t>>5&63,(t&31)<<1)};ft.fromDate2DOS=function(t){let e=0,r=0;return t.getFullYear()>1979&&(e=(t.getFullYear()-1980&127)<<9|t.getMonth()+1<<5|t.getDate(),r=t.getHours()<<11|t.getMinutes()<<5|t.getSeconds()>>1),e<<16|r};ft.isWin=E7;ft.crcTable=pS});var DS=E((Cge,yS)=>{var _7=require("path");yS.exports=function(t,{fs:e}){var r=t||"",n=s(),i=null;function s(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return r&&e.existsSync(r)?(i=e.statSync(r),n.directory=i.isDirectory(),n.mtime=i.mtime,n.atime=i.atime,n.executable=(73&i.mode)!==0,n.readonly=(128&i.mode)===0,n.hidden=_7.basename(r)[0]==="."):console.warn("Invalid path: "+r),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:r,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var bS=E((Sge,wS)=>{wS.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var jo=E((Age,Lo)=>{Lo.exports=gS();Lo.exports.Constants=My();Lo.exports.Errors=Tf();Lo.exports.FileAttr=DS();Lo.exports.decoder=bS()});var ES=E((Oge,vS)=>{var Ti=jo(),X=Ti.Constants;vS.exports=function(){var t=20,e=10,r=0,n=0,i=0,s=0,o=0,a=0,u=0,c=0,l=0,h=0,d=0,f=0,m=0;t|=Ti.isWin?2560:768,r|=X.FLG_EFS;let g={extraLen:0},b=p=>Math.max(0,p)>>>0,S=p=>Math.max(0,p)&65535,A=p=>Math.max(0,p)&255;return i=Ti.fromDate2DOS(new Date),{get made(){return t},set made(p){t=p},get version(){return e},set version(p){e=p},get flags(){return r},set flags(p){r=p},get flags_efs(){return(r&X.FLG_EFS)>0},set flags_efs(p){p?r|=X.FLG_EFS:r&=~X.FLG_EFS},get flags_desc(){return(r&X.FLG_DESC)>0},set flags_desc(p){p?r|=X.FLG_DESC:r&=~X.FLG_DESC},get method(){return n},set method(p){switch(p){case X.STORED:this.version=10;case X.DEFLATED:default:this.version=20}n=p},get time(){return Ti.fromDOS2Date(this.timeval)},set time(p){this.timeval=Ti.fromDate2DOS(p)},get timeval(){return i},set timeval(p){i=b(p)},get timeHighByte(){return A(i>>>8)},get crc(){return s},set crc(p){s=b(p)},get compressedSize(){return o},set compressedSize(p){o=b(p)},get size(){return a},set size(p){a=b(p)},get fileNameLength(){return u},set fileNameLength(p){u=p},get extraLength(){return c},set extraLength(p){c=p},get extraLocalLength(){return g.extraLen},set extraLocalLength(p){g.extraLen=p},get commentLength(){return l},set commentLength(p){l=p},get diskNumStart(){return h},set diskNumStart(p){h=b(p)},get inAttr(){return d},set inAttr(p){d=b(p)},get attr(){return f},set attr(p){f=b(p)},get fileAttr(){return(f||0)>>16&4095},get offset(){return m},set offset(p){m=b(p)},get encrypted(){return(r&X.FLG_ENC)===X.FLG_ENC},get centralHeaderSize(){return X.CENHDR+u+c+l},get realDataOffset(){return m+X.LOCHDR+g.fnameLen+g.extraLen},get localHeader(){return g},loadLocalHeaderFromBinary:function(p){var D=p.slice(m,m+X.LOCHDR);if(D.readUInt32LE(0)!==X.LOCSIG)throw Ti.Errors.INVALID_LOC();g.version=D.readUInt16LE(X.LOCVER),g.flags=D.readUInt16LE(X.LOCFLG),g.method=D.readUInt16LE(X.LOCHOW),g.time=D.readUInt32LE(X.LOCTIM),g.crc=D.readUInt32LE(X.LOCCRC),g.compressedSize=D.readUInt32LE(X.LOCSIZ),g.size=D.readUInt32LE(X.LOCLEN),g.fnameLen=D.readUInt16LE(X.LOCNAM),g.extraLen=D.readUInt16LE(X.LOCEXT);let y=m+X.LOCHDR+g.fnameLen,C=y+g.extraLen;return p.slice(y,C)},loadFromBinary:function(p){if(p.length!==X.CENHDR||p.readUInt32LE(0)!==X.CENSIG)throw Ti.Errors.INVALID_CEN();t=p.readUInt16LE(X.CENVEM),e=p.readUInt16LE(X.CENVER),r=p.readUInt16LE(X.CENFLG),n=p.readUInt16LE(X.CENHOW),i=p.readUInt32LE(X.CENTIM),s=p.readUInt32LE(X.CENCRC),o=p.readUInt32LE(X.CENSIZ),a=p.readUInt32LE(X.CENLEN),u=p.readUInt16LE(X.CENNAM),c=p.readUInt16LE(X.CENEXT),l=p.readUInt16LE(X.CENCOM),h=p.readUInt16LE(X.CENDSK),d=p.readUInt16LE(X.CENATT),f=p.readUInt32LE(X.CENATX),m=p.readUInt32LE(X.CENOFF)},localHeaderToBinary:function(){var p=Buffer.alloc(X.LOCHDR);return p.writeUInt32LE(X.LOCSIG,0),p.writeUInt16LE(e,X.LOCVER),p.writeUInt16LE(r,X.LOCFLG),p.writeUInt16LE(n,X.LOCHOW),p.writeUInt32LE(i,X.LOCTIM),p.writeUInt32LE(s,X.LOCCRC),p.writeUInt32LE(o,X.LOCSIZ),p.writeUInt32LE(a,X.LOCLEN),p.writeUInt16LE(u,X.LOCNAM),p.writeUInt16LE(g.extraLen,X.LOCEXT),p},centralHeaderToBinary:function(){var p=Buffer.alloc(X.CENHDR+u+c+l);return p.writeUInt32LE(X.CENSIG,0),p.writeUInt16LE(t,X.CENVEM),p.writeUInt16LE(e,X.CENVER),p.writeUInt16LE(r,X.CENFLG),p.writeUInt16LE(n,X.CENHOW),p.writeUInt32LE(i,X.CENTIM),p.writeUInt32LE(s,X.CENCRC),p.writeUInt32LE(o,X.CENSIZ),p.writeUInt32LE(a,X.CENLEN),p.writeUInt16LE(u,X.CENNAM),p.writeUInt16LE(c,X.CENEXT),p.writeUInt16LE(l,X.CENCOM),p.writeUInt16LE(h,X.CENDSK),p.writeUInt16LE(d,X.CENATT),p.writeUInt32LE(f,X.CENATX),p.writeUInt32LE(m,X.CENOFF),p},toJSON:function(){let p=function(D){return D+" bytes"};return{made:t,version:e,flags:r,method:Ti.methodToString(n),time:this.time,crc:"0x"+s.toString(16).toUpperCase(),compressedSize:p(o),size:p(a),fileNameLength:p(u),extraLength:p(c),commentLength:p(l),diskNumStart:h,inAttr:d,attr:f,offset:m,centralHeaderSize:p(X.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var CS=E((xge,_S)=>{var Bo=jo(),ot=Bo.Constants;_S.exports=function(){var t=0,e=0,r=0,n=0,i=0;return{get diskEntries(){return t},set diskEntries(s){t=e=s},get totalEntries(){return e},set totalEntries(s){e=t=s},get size(){return r},set size(s){r=s},get offset(){return n},set offset(s){n=s},get commentLength(){return i},set commentLength(s){i=s},get mainHeaderSize(){return ot.ENDHDR+i},loadFromBinary:function(s){if((s.length!==ot.ENDHDR||s.readUInt32LE(0)!==ot.ENDSIG)&&(s.length<ot.ZIP64HDR||s.readUInt32LE(0)!==ot.ZIP64SIG))throw Bo.Errors.INVALID_END();s.readUInt32LE(0)===ot.ENDSIG?(t=s.readUInt16LE(ot.ENDSUB),e=s.readUInt16LE(ot.ENDTOT),r=s.readUInt32LE(ot.ENDSIZ),n=s.readUInt32LE(ot.ENDOFF),i=s.readUInt16LE(ot.ENDCOM)):(t=Bo.readBigUInt64LE(s,ot.ZIP64SUB),e=Bo.readBigUInt64LE(s,ot.ZIP64TOT),r=Bo.readBigUInt64LE(s,ot.ZIP64SIZE),n=Bo.readBigUInt64LE(s,ot.ZIP64OFF),i=0)},toBinary:function(){var s=Buffer.alloc(ot.ENDHDR+i);return s.writeUInt32LE(ot.ENDSIG,0),s.writeUInt32LE(0,4),s.writeUInt16LE(t,ot.ENDSUB),s.writeUInt16LE(e,ot.ENDTOT),s.writeUInt32LE(r,ot.ENDSIZ),s.writeUInt32LE(n,ot.ENDOFF),s.writeUInt16LE(i,ot.ENDCOM),s.fill(" ",ot.ENDHDR),s},toJSON:function(){let s=function(o,a){let u=o.toString(16).toUpperCase();for(;u.length<a;)u="0"+u;return"0x"+u};return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:s(n,4),commentLength:i}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Uy=E(qy=>{qy.EntryHeader=ES();qy.MainHeader=CS()});var AS=E((Fge,SS)=>{SS.exports=function(t){var e=require("zlib"),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(t,r)},deflateAsync:function(n){var i=e.createDeflateRaw(r),s=[],o=0;i.on("data",function(a){s.push(a),o+=a.length}),i.on("end",function(){var a=Buffer.alloc(o),u=0;a.fill(0);for(var c=0;c<s.length;c++){var l=s[c];l.copy(a,u),u+=l.length}n&&n(a)}),i.end(t)}}}});var xS=E((Ige,OS)=>{var C7=+(process.versions?process.versions.node:"").split(".")[0]||0;OS.exports=function(t,e){var r=require("zlib");let n=C7>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(i){var s=r.createInflateRaw(n),o=[],a=0;s.on("data",function(u){o.push(u),a+=u.length}),s.on("end",function(){var u=Buffer.alloc(a),c=0;u.fill(0);for(var l=0;l<o.length;l++){var h=o[l];h.copy(u,c),c+=h.length}i&&i(u)}),s.end(t)}}}});var PS=E((kge,kS)=>{"use strict";var{randomFillSync:TS}=require("crypto"),S7=Tf(),A7=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=e>>>1^3988292384:e>>>=1;return e>>>0}),IS=(t,e)=>Math.imul(t,e)>>>0,FS=(t,e)=>A7[(t^e)&255]^t>>>8,Pu=()=>typeof TS=="function"?TS(Buffer.alloc(12)):Pu.node();Pu.node=()=>{let t=Buffer.alloc(12),e=t.length;for(let r=0;r<e;r++)t[r]=Math.random()*256&255;return t};var Ff={genSalt:Pu};function If(t){let e=Buffer.isBuffer(t)?t:Buffer.from(t);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let r=0;r<e.length;r++)this.updateKeys(e[r])}If.prototype.updateKeys=function(t){let e=this.keys;return e[0]=FS(e[0],t),e[1]+=e[0]&255,e[1]=IS(e[1],134775813)+1,e[2]=FS(e[2],e[1]>>>24),t};If.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return IS(t,t^1)>>8&255};function O7(t){let e=new If(t);return function(r){let n=Buffer.alloc(r.length),i=0;for(let s of r)n[i++]=e.updateKeys(s^e.next());return n}}function x7(t){let e=new If(t);return function(r,n,i=0){n||(n=Buffer.alloc(r.length));for(let s of r){let o=e.next();n[i++]=s^o,e.updateKeys(s)}return n}}function T7(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=O7(r),i=n(t.slice(0,12)),s=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==s)throw S7.WRONG_PASSWORD();return n(t.slice(12))}function F7(t){Buffer.isBuffer(t)&&t.length>=12?Ff.genSalt=function(){return t.slice(0,12)}:t==="node"?Ff.genSalt=Pu.node:Ff.genSalt=Pu}function I7(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=x7(r),s=Ff.genSalt();s[11]=e.crc>>>24&255,n&&(s[10]=e.crc>>>16&255);let o=Buffer.alloc(t.length+12);return i(s,o),i(t,o,12)}kS.exports={decrypt:T7,encrypt:I7,_salter:F7}});var RS=E(kf=>{kf.Deflater=AS();kf.Inflater=xS();kf.ZipCrypto=PS()});var Vy=E((Rge,NS)=>{var ke=jo(),k7=Uy(),ht=ke.Constants,Hy=RS();NS.exports=function(t,e){var r=new k7.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),s=!1,o=null,a=Buffer.alloc(0),u=Buffer.alloc(0),c=!0;let l=t,h=typeof l.decoder=="object"?l.decoder:ke.decoder;c=h.hasOwnProperty("efs")?h.efs:!1;function d(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function f(p){if(r.flags_desc){let D={},y=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(y)==ht.LOCSIG||e.readUInt32LE(y)==ht.CENSIG)throw ke.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(y)==ht.EXTSIG)D.crc=e.readUInt32LE(y+ht.EXTCRC),D.compressedSize=e.readUInt32LE(y+ht.EXTSIZ),D.size=e.readUInt32LE(y+ht.EXTLEN);else if(e.readUInt16LE(y+12)===19280)D.crc=e.readUInt32LE(y+ht.EXTCRC-4),D.compressedSize=e.readUInt32LE(y+ht.EXTSIZ-4),D.size=e.readUInt32LE(y+ht.EXTLEN-4);else throw ke.Errors.DESCRIPTOR_UNKNOWN();if(D.compressedSize!==r.compressedSize||D.size!==r.size||D.crc!==r.crc)throw ke.Errors.DESCRIPTOR_FAULTY();if(ke.crc32(p)!==D.crc)return!1}else if(ke.crc32(p)!==r.localHeader.crc)return!1;return!0}function m(p,D,y){if(typeof D>"u"&&typeof p=="string"&&(y=p,p=void 0),s)return p&&D&&D(Buffer.alloc(0),ke.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var C=d();if(C.length===0)return p&&D&&D(C),C;if(r.encrypted){if(typeof y!="string"&&!Buffer.isBuffer(y))throw ke.Errors.INVALID_PASS_PARAM();C=Hy.ZipCrypto.decrypt(C,r,y)}var k=Buffer.alloc(r.size);switch(r.method){case ke.Constants.STORED:if(C.copy(k),f(k))return p&&D&&D(k),k;throw p&&D&&D(k,ke.Errors.BAD_CRC()),ke.Errors.BAD_CRC();case ke.Constants.DEFLATED:var v=new Hy.Inflater(C,r.size);if(p)v.inflateAsync(function(R){R.copy(R,0),D&&(f(R)?D(R):D(R,ke.Errors.BAD_CRC()))});else{if(v.inflate(k).copy(k,0),!f(k))throw ke.Errors.BAD_CRC(`"${h.decode(n)}"`);return k}break;default:throw p&&D&&D(Buffer.alloc(0),ke.Errors.UNKNOWN_METHOD()),ke.Errors.UNKNOWN_METHOD()}}function g(p,D){if((!o||!o.length)&&Buffer.isBuffer(e))return p&&D&&D(d()),d();if(o.length&&!s){var y;switch(r.method){case ke.Constants.STORED:return r.compressedSize=r.size,y=Buffer.alloc(o.length),o.copy(y),p&&D&&D(y),y;default:case ke.Constants.DEFLATED:var C=new Hy.Deflater(o);if(p)C.deflateAsync(function(v){y=Buffer.alloc(v.length),r.compressedSize=v.length,v.copy(y),D&&D(y)});else{var k=C.deflate();return r.compressedSize=k.length,k}C=null;break}}else if(p&&D)D(Buffer.alloc(0));else return Buffer.alloc(0)}function b(p,D){return(p.readUInt32LE(D+4)<<4)+p.readUInt32LE(D)}function S(p){try{for(var D=0,y,C,k;D+4<p.length;)y=p.readUInt16LE(D),D+=2,C=p.readUInt16LE(D),D+=2,k=p.slice(D,D+C),D+=C,ht.ID_ZIP64===y&&A(k)}catch{throw ke.Errors.EXTRA_FIELD_PARSE_ERROR()}}function A(p){var D,y,C,k;p.length>=ht.EF_ZIP64_SCOMP&&(D=b(p,ht.EF_ZIP64_SUNCOMP),r.size===ht.EF_ZIP64_OR_32&&(r.size=D)),p.length>=ht.EF_ZIP64_RHO&&(y=b(p,ht.EF_ZIP64_SCOMP),r.compressedSize===ht.EF_ZIP64_OR_32&&(r.compressedSize=y)),p.length>=ht.EF_ZIP64_DSN&&(C=b(p,ht.EF_ZIP64_RHO),r.offset===ht.EF_ZIP64_OR_32&&(r.offset=C)),p.length>=ht.EF_ZIP64_DSN+4&&(k=p.readUInt32LE(ht.EF_ZIP64_DSN),r.diskNumStart===ht.EF_ZIP64_OR_16&&(r.diskNumStart=k))}return{get entryName(){return h.decode(n)},get rawEntryName(){return n},set entryName(p){n=ke.toBuffer(p,h.encode);var D=n[n.length-1];s=D===47||D===92,r.fileNameLength=n.length},get efs(){return typeof c=="function"?c(this.entryName):c},get extra(){return a},set extra(p){a=p,r.extraLength=p.length,S(p)},get comment(){return h.decode(i)},set comment(p){if(i=ke.toBuffer(p,h.encode),r.commentLength=i.length,i.length>65535)throw ke.Errors.COMMENT_TOO_LONG()},get name(){var p=h.decode(n);return s?p.substr(p.length-1).split("/").pop():p.split("/").pop()},get isDirectory(){return s},getCompressedData:function(){return g(!1,null)},getCompressedDataAsync:function(p){g(!0,p)},setData:function(p){o=ke.toBuffer(p,ke.decoder.encode),!s&&o.length?(r.size=o.length,r.method=ke.Constants.DEFLATED,r.crc=ke.crc32(p),r.changed=!0):r.method=ke.Constants.STORED},getData:function(p){return r.changed?o:m(!1,null,p)},getDataAsync:function(p,D){r.changed?p(o):m(!0,p,D)},set attr(p){r.attr=p},get attr(){return r.attr},set header(p){r.loadFromBinary(p)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var p=r.centralHeaderToBinary(),D=ke.Constants.CENHDR;return n.copy(p,D),D+=n.length,a.copy(p,D),D+=r.extraLength,i.copy(p,D),p},packLocalHeader:function(){let p=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let D=r.localHeaderToBinary(),y=Buffer.alloc(D.length+n.length+r.extraLocalLength);return D.copy(y,p),p+=D.length,n.copy(y,p),p+=n.length,u.copy(y,p),p+=u.length,y},toJSON:function(){let p=function(D){return"<"+(D&&D.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:p(e),data:p(o)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var jS=E((Nge,LS)=>{var $S=Vy(),P7=Uy(),Bt=jo();LS.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),s=new P7.MainHeader,o=!1,a=null;let u=new Set,c=e,{noSort:l,decoder:h}=c;t?m(c.readEntries):o=!0;function d(){let b=new Set;for(let S of Object.keys(n)){let A=S.split("/");if(A.pop(),!!A.length)for(let p=0;p<A.length;p++){let D=A.slice(0,p+1).join("/")+"/";b.add(D)}}for(let S of b)if(!(S in n)){let A=new $S(c);A.entryName=S,A.attr=16,A.temporary=!0,r.push(A),n[A.entryName]=A,u.add(A)}}function f(){if(o=!0,n={},s.diskEntries>(t.length-s.offset)/Bt.Constants.CENHDR)throw Bt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(s.diskEntries);for(var b=s.offset,S=0;S<r.length;S++){var A=b,p=new $S(c,t);p.header=t.slice(A,A+=Bt.Constants.CENHDR),p.entryName=t.slice(A,A+=p.header.fileNameLength),p.header.extraLength&&(p.extra=t.slice(A,A+=p.header.extraLength)),p.header.commentLength&&(p.comment=t.slice(A,A+p.header.commentLength)),b+=p.header.centralHeaderSize,r[S]=p,n[p.entryName]=p}u.clear(),d()}function m(b){var S=t.length-Bt.Constants.ENDHDR,A=Math.max(0,S-65535),p=A,D=t.length,y=-1,C=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(A=0),S;S>=p;S--)if(t[S]===80){if(t.readUInt32LE(S)===Bt.Constants.ENDSIG){y=S,C=S,D=S+Bt.Constants.ENDHDR,p=S-Bt.Constants.END64HDR;continue}if(t.readUInt32LE(S)===Bt.Constants.END64SIG){p=A;continue}if(t.readUInt32LE(S)===Bt.Constants.ZIP64SIG){y=S,D=S+Bt.readBigUInt64LE(t,S+Bt.Constants.ZIP64SIZE)+Bt.Constants.ZIP64LEAD;break}}if(y==-1)throw Bt.Errors.INVALID_FORMAT();s.loadFromBinary(t.slice(y,D)),s.commentLength&&(i=t.slice(C+Bt.Constants.ENDHDR)),b&&f()}function g(){r.length>1&&!l&&r.sort((b,S)=>b.entryName.toLowerCase().localeCompare(S.entryName.toLowerCase()))}return{get entries(){return o||f(),r.filter(b=>!u.has(b))},get comment(){return h.decode(i)},set comment(b){i=Bt.toBuffer(b,h.encode),s.commentLength=i.length},getEntryCount:function(){return o?r.length:s.diskEntries},forEach:function(b){this.entries.forEach(b)},getEntry:function(b){return o||f(),n[b]||null},setEntry:function(b){o||f(),r.push(b),n[b.entryName]=b,s.totalEntries=r.length},deleteFile:function(b,S=!0){o||f();let A=n[b];this.getEntryChildren(A,S).map(D=>D.entryName).forEach(this.deleteEntry)},deleteEntry:function(b){o||f();let S=n[b],A=r.indexOf(S);A>=0&&(r.splice(A,1),delete n[b],s.totalEntries=r.length)},getEntryChildren:function(b,S=!0){if(o||f(),typeof b=="object")if(b.isDirectory&&S){let A=[],p=b.entryName;for(let D of r)D.entryName.startsWith(p)&&A.push(D);return A}else return[b];return[]},getChildCount:function(b){if(b&&b.isDirectory){let S=this.getEntryChildren(b);return S.includes(b)?S.length-1:S.length}return 0},compressToBuffer:function(){o||f(),g();let b=[],S=[],A=0,p=0;s.size=0,s.offset=0;let D=0;for(let k of this.entries){let v=k.getCompressedData();k.header.offset=p;let R=k.packLocalHeader(),P=R.length+v.length;p+=P,b.push(R),b.push(v);let F=k.packCentralHeader();S.push(F),s.size+=F.length,A+=P+F.length,D++}A+=s.mainHeaderSize,s.offset=p,s.totalEntries=D,p=0;let y=Buffer.alloc(A);for(let k of b)k.copy(y,p),p+=k.length;for(let k of S)k.copy(y,p),p+=k.length;let C=s.toBinary();return i&&i.copy(C,Bt.Constants.ENDHDR),C.copy(y,p),t=y,o=!1,y},toAsyncBuffer:function(b,S,A,p){try{o||f(),g();let D=[],y=[],C=0,k=0,v=0;s.size=0,s.offset=0;let R=function(P){if(P.length>0){let F=P.shift(),j=F.entryName+F.extra.toString();A&&A(j),F.getCompressedDataAsync(function(U){p&&p(j),F.header.offset=k;let G=F.packLocalHeader(),L=G.length+U.length;k+=L,D.push(G),D.push(U);let _=F.packCentralHeader();y.push(_),s.size+=_.length,C+=L+_.length,v++,R(P)})}else{C+=s.mainHeaderSize,s.offset=k,s.totalEntries=v,k=0;let F=Buffer.alloc(C);D.forEach(function(U){U.copy(F,k),k+=U.length}),y.forEach(function(U){U.copy(F,k),k+=U.length});let j=s.toBinary();i&&i.copy(j,Bt.Constants.ENDHDR),j.copy(F,k),t=F,o=!1,b(F)}};R(Array.from(this.entries))}catch(D){S(D)}}}}});var qS=E(($ge,MS)=>{var at=jo(),dt=require("path"),R7=Vy(),N7=jS(),ys=(...t)=>at.findLast(t,e=>typeof e=="boolean"),BS=(...t)=>at.findLast(t,e=>typeof e=="string"),$7=(...t)=>at.findLast(t,e=>typeof e=="function"),L7={noSort:!1,readEntries:!1,method:at.Constants.NONE,fs:null};MS.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),L7);t&&typeof t=="object"&&(t instanceof Uint8Array||(Object.assign(n,t),t=n.input?n.input:void 0,n.input&&delete n.input),Buffer.isBuffer(t)&&(r=t,n.method=at.Constants.BUFFER,t=void 0)),Object.assign(n,e);let i=new at(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=at.decoder),t&&typeof t=="string")if(i.fs.existsSync(t))n.method=at.Constants.FILE,n.filename=t,r=i.fs.readFileSync(t);else throw at.Errors.INVALID_FILENAME();let s=new N7(r,n),{canonical:o,sanitize:a,zipnamefix:u}=at;function c(f){if(f&&s){var m;if(typeof f=="string"&&(m=s.getEntry(dt.posix.normalize(f))),typeof f=="object"&&typeof f.entryName<"u"&&typeof f.header<"u"&&(m=s.getEntry(f.entryName)),m)return m}return null}function l(f){let{join:m,normalize:g,sep:b}=dt.posix;return m(".",g(b+f.split("\\").join(b)+b))}function h(f){return f instanceof RegExp?(function(m){return function(g){return m.test(g)}})(f):typeof f!="function"?()=>!0:f}let d=(f,m)=>{let g=m.slice(-1);return g=g===i.sep?i.sep:"",dt.relative(f,m)+g};return{readFile:function(f,m){var g=c(f);return g&&g.getData(m)||null},childCount:function(f){let m=c(f);if(m)return s.getChildCount(m)},readFileAsync:function(f,m){var g=c(f);g?g.getDataAsync(m):m(null,"getEntry failed for:"+f)},readAsText:function(f,m){var g=c(f);if(g){var b=g.getData();if(b&&b.length)return b.toString(m||"utf8")}return""},readAsTextAsync:function(f,m,g){var b=c(f);b?b.getDataAsync(function(S,A){if(A){m(S,A);return}S&&S.length?m(S.toString(g||"utf8")):m("")}):m("")},deleteFile:function(f,m=!0){var g=c(f);g&&s.deleteFile(g.entryName,m)},deleteEntry:function(f){var m=c(f);m&&s.deleteEntry(m.entryName)},addZipComment:function(f){s.comment=f},getZipComment:function(){return s.comment||""},addZipEntryComment:function(f,m){var g=c(f);g&&(g.comment=m)},getZipEntryComment:function(f){var m=c(f);return m&&m.comment||""},updateFile:function(f,m){var g=c(f);g&&g.setData(m)},addLocalFile:function(f,m,g,b){if(i.fs.existsSync(f)){m=m?l(m):"";let S=dt.win32.basename(dt.win32.normalize(f));m+=g||S;let A=i.fs.statSync(f),p=A.isFile()?i.fs.readFileSync(f):Buffer.alloc(0);A.isDirectory()&&(m+=i.sep),this.addFile(m,p,b,A)}else throw at.Errors.FILE_NOT_FOUND(f)},addLocalFileAsync:function(f,m){f=typeof f=="object"?f:{localPath:f};let g=dt.resolve(f.localPath),{comment:b}=f,{zipPath:S,zipName:A}=f,p=this;i.fs.stat(g,function(D,y){if(D)return m(D,!1);S=S?l(S):"";let C=dt.win32.basename(dt.win32.normalize(g));if(S+=A||C,y.isFile())i.fs.readFile(g,function(k,v){return k?m(k,!1):(p.addFile(S,v,b,y),setImmediate(m,void 0,!0))});else if(y.isDirectory())return S+=i.sep,p.addFile(S,Buffer.alloc(0),b,y),setImmediate(m,void 0,!0)})},addLocalFolder:function(f,m,g){if(g=h(g),m=m?l(m):"",f=dt.normalize(f),i.fs.existsSync(f)){let b=i.findFiles(f),S=this;if(b.length)for(let A of b){let p=dt.join(m,d(f,A));g(p)&&S.addLocalFile(A,dt.dirname(p))}}else throw at.Errors.FILE_NOT_FOUND(f)},addLocalFolderAsync:function(f,m,g,b){b=h(b),g=g?l(g):"",f=dt.normalize(f);var S=this;i.fs.open(f,"r",function(A){if(A&&A.code==="ENOENT")m(void 0,at.Errors.FILE_NOT_FOUND(f));else if(A)m(void 0,A);else{var p=i.findFiles(f),D=-1,y=function(){if(D+=1,D<p.length){var C=p[D],k=d(f,C).split("\\").join("/");k=k.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),b(k)?i.fs.stat(C,function(v,R){v&&m(void 0,v),R.isFile()?i.fs.readFile(C,function(P,F){P?m(void 0,P):(S.addFile(g+k,F,"",R),y())}):(S.addFile(g+k+"/",Buffer.alloc(0),"",R),y())}):process.nextTick(()=>{y()})}else m(!0,void 0)};y()}})},addLocalFolderAsync2:function(f,m){let g=this;f=typeof f=="object"?f:{localPath:f},localPath=dt.resolve(l(f.localPath));let{zipPath:b,filter:S,namefix:A}=f;S instanceof RegExp?S=(function(y){return function(C){return y.test(C)}})(S):typeof S!="function"&&(S=function(){return!0}),b=b?l(b):"",A=="latin1"&&(A=y=>y.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof A!="function"&&(A=y=>y);let p=y=>dt.join(b,A(d(localPath,y))),D=y=>dt.win32.basename(dt.win32.normalize(A(y)));i.fs.open(localPath,"r",function(y){y&&y.code==="ENOENT"?m(void 0,at.Errors.FILE_NOT_FOUND(localPath)):y?m(void 0,y):i.findFilesAsync(localPath,function(C,k){if(C)return m(C);k=k.filter(v=>S(p(v))),k.length||m(void 0,!1),setImmediate(k.reverse().reduce(function(v,R){return function(P,F){if(P||F===!1)return setImmediate(v,P,!1);g.addLocalFileAsync({localPath:R,zipPath:dt.dirname(p(R)),zipName:D(R)},v)}},m))})})},addLocalFolderPromise:function(f,m){return new Promise((g,b)=>{this.addLocalFolderAsync2(Object.assign({localPath:f},m),(S,A)=>{S&&b(S),A&&g(this)})})},addFile:function(f,m,g,b){f=u(f);let S=c(f),A=S!=null;A||(S=new R7(n),S.entryName=f),S.comment=g||"";let p=typeof b=="object"&&b instanceof i.fs.Stats;p&&(S.header.time=b.mtime);var D=S.isDirectory?16:0;let y=S.isDirectory?16384:32768;return p?y|=4095&b.mode:typeof b=="number"?y|=4095&b:y|=S.isDirectory?493:420,D=(D|y<<16)>>>0,S.attr=D,S.setData(m),A||s.setEntry(S),S},getEntries:function(f){return s.password=f,s?s.entries:[]},getEntry:function(f){return c(f)},getEntryCount:function(){return s.getEntryCount()},forEach:function(f){return s.forEach(f)},extractEntryTo:function(f,m,g,b,S,A){b=ys(!1,b),S=ys(!1,S),g=ys(!0,g),A=BS(S,A);var p=c(f);if(!p)throw at.Errors.NO_ENTRY();var D=o(p.entryName),y=a(m,A&&!p.isDirectory?A:g?D:dt.basename(D));if(p.isDirectory){var C=s.getEntryChildren(p);return C.forEach(function(R){if(R.isDirectory)return;var P=R.getData();if(!P)throw at.Errors.CANT_EXTRACT_FILE();var F=o(R.entryName),j=a(m,g?F:dt.basename(F));let U=S?R.header.fileAttr:void 0;i.writeFileTo(j,P,b,U)}),!0}var k=p.getData(s.password);if(!k)throw at.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(y)&&!b)throw at.Errors.CANT_OVERRIDE();let v=S?f.header.fileAttr:void 0;return i.writeFileTo(y,k,b,v),!0},test:function(f){if(!s)return!1;for(var m in s.entries)try{if(m.isDirectory)continue;var g=s.entries[m].getData(f);if(!g)return!1}catch{return!1}return!0},extractAllTo:function(f,m,g,b){if(g=ys(!1,g),b=BS(g,b),m=ys(!1,m),!s)throw at.Errors.NO_ZIP();s.entries.forEach(function(S){var A=a(f,o(S.entryName));if(S.isDirectory){i.makeDir(A);return}var p=S.getData(b);if(!p)throw at.Errors.CANT_EXTRACT_FILE();let D=g?S.header.fileAttr:void 0;i.writeFileTo(A,p,m,D);try{i.fs.utimesSync(A,S.header.time,S.header.time)}catch{throw at.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(f,m,g,b){if(b=$7(m,g,b),g=ys(!1,g),m=ys(!1,m),!b)return new Promise((y,C)=>{this.extractAllToAsync(f,m,g,function(k){k?C(k):y(this)})});if(!s){b(at.Errors.NO_ZIP());return}f=dt.resolve(f);let S=y=>a(f,dt.normalize(o(y.entryName))),A=(y,C)=>new Error(y+': "'+C+'"'),p=[],D=[];s.entries.forEach(y=>{y.isDirectory?p.push(y):D.push(y)});for(let y of p){let C=S(y),k=g?y.header.fileAttr:void 0;try{i.makeDir(C),k&&i.fs.chmodSync(C,k),i.fs.utimesSync(C,y.header.time,y.header.time)}catch{b(A("Unable to create folder",C))}}D.reverse().reduce(function(y,C){return function(k){if(k)y(k);else{let v=dt.normalize(o(C.entryName)),R=a(f,v);C.getDataAsync(function(P,F){if(F)y(F);else if(!P)y(at.Errors.CANT_EXTRACT_FILE());else{let j=g?C.header.fileAttr:void 0;i.writeFileToAsync(R,P,m,j,function(U){U||y(A("Unable to write file",R)),i.fs.utimes(R,C.header.time,C.header.time,function(G){G?y(A("Unable to set times",R)):y()})})}})}}},b)()},writeZip:function(f,m){if(arguments.length===1&&typeof f=="function"&&(m=f,f=""),!f&&n.filename&&(f=n.filename),!!f){var g=s.compressToBuffer();if(g){var b=i.writeFileTo(f,g,!0);typeof m=="function"&&m(b?null:new Error("failed"),"")}}},writeZipPromise:function(f,m){let{overwrite:g,perm:b}=Object.assign({overwrite:!0},m);return new Promise((S,A)=>{!f&&n.filename&&(f=n.filename),f||A("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(p=>{let D=y=>y?S(y):A("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(f,p,g,b,D)},A)})},toBufferPromise:function(){return new Promise((f,m)=>{s.toAsyncBuffer(f,m)})},toBuffer:function(f,m,g,b){return typeof f=="function"?(s.toAsyncBuffer(f,m,g,b),null):s.compressToBuffer()}}}});var zS=E((Lge,VS)=>{var HS={};VS.exports=HS;var US={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(US).forEach(function(t){var e=US[t],r=HS[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var KS=E((jge,GS)=>{"use strict";GS.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var XS=E((Bge,WS)=>{"use strict";var j7=require("os"),nn=KS(),rr=process.env,Mo=void 0;nn("no-color")||nn("no-colors")||nn("color=false")?Mo=!1:(nn("color")||nn("colors")||nn("color=true")||nn("color=always"))&&(Mo=!0);"FORCE_COLOR"in rr&&(Mo=rr.FORCE_COLOR.length===0||parseInt(rr.FORCE_COLOR,10)!==0);function B7(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function M7(t){if(Mo===!1)return 0;if(nn("color=16m")||nn("color=full")||nn("color=truecolor"))return 3;if(nn("color=256"))return 2;if(t&&!t.isTTY&&Mo!==!0)return 0;var e=Mo?1:0;if(process.platform==="win32"){var r=j7.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in rr)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in rr})||rr.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in rr)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(rr.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in rr){var n=parseInt((rr.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(rr.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(rr.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(rr.TERM)||"COLORTERM"in rr?1:(rr.TERM==="dumb",e)}function zy(t){var e=M7(t);return B7(e)}WS.exports={supportsColor:zy,stdout:zy(process.stdout),stderr:zy(process.stderr)}});var JS=E((Mge,YS)=>{YS.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(s){s=s.toLowerCase();var o=i[s]||[" "],a=Math.floor(Math.random()*o.length);typeof i[s]<"u"?n+=i[s][a]:n+=s}),n}});var QS=E((qge,ZS)=>{ZS.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function s(u){var c=Math.floor(Math.random()*u);return c}function o(u){var c=!1;return i.filter(function(l){c=l===u}),c}function a(u,c){var l="",h,d;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(d in u)if(!o(d)){switch(l=l+u[d],h={up:0,down:0,mid:0},c.size){case"mini":h.up=s(8),h.mid=s(2),h.down=s(8);break;case"maxi":h.up=s(16)+3,h.mid=s(4)+1,h.down=s(64)+3;break;default:h.up=s(8)+1,h.mid=s(6)/2,h.down=s(8)+1;break}var f=["up","mid","down"];for(var m in f)for(var g=f[m],b=0;b<=h[g];b++)c[g]&&(l=l+n[g][s(n[g].length)])}return l}return a(e,r)}});var tA=E((Uge,eA)=>{eA.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var nA=E((Hge,rA)=>{rA.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var sA=E((Vge,iA)=>{iA.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var aA=E((zge,oA)=>{oA.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var dA=E((Kge,hA)=>{var be={};hA.exports=be;be.themes={};var q7=require("util"),Ds=be.styles=zS(),cA=Object.defineProperties,U7=new RegExp(/[\r\n]+/g);be.supportsColor=XS().supportsColor;typeof be.enabled>"u"&&(be.enabled=be.supportsColor()!==!1);be.enable=function(){be.enabled=!0};be.disable=function(){be.enabled=!1};be.stripColors=be.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var Gge=be.stylize=function(e,r){if(!be.enabled)return e+"";var n=Ds[r];return!n&&r in be?be[r](e):n.open+e+n.close},H7=/[|\\{}()[\]^$+*?.]/g,V7=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(H7,"\\$&")};function lA(t){var e=function r(){return G7.apply(r,arguments)};return e._styles=t,e.__proto__=z7,e}var fA=(function(){var t={};return Ds.grey=Ds.gray,Object.keys(Ds).forEach(function(e){Ds[e].closeRe=new RegExp(V7(Ds[e].close),"g"),t[e]={get:function(){return lA(this._styles.concat(e))}}}),t})(),z7=cA(function(){},fA);function G7(){var t=Array.prototype.slice.call(arguments),e=t.map(function(o){return o!=null&&o.constructor===String?o:q7.inspect(o)}).join(" ");if(!be.enabled||!e)return e;for(var r=e.indexOf(`
|
|
41
|
-
`)!=-1,n=this._styles,i=n.length;i--;){var s=Ds[n[i]];e=s.open+e.replace(s.closeRe,s.open)+s.close,r&&(e=e.replace(U7,function(o){return s.close+o+s.open}))}return e}be.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){be[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var s in t[r])i=be[t[r][s]](i);return i}return be[t[r]](n)}})(e)};function K7(){var t={};return Object.keys(fA).forEach(function(e){t[e]={get:function(){return lA([e])}}}),t}var W7=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};be.trap=JS();be.zalgo=QS();be.maps={};be.maps.america=tA()(be);be.maps.zebra=nA()(be);be.maps.rainbow=sA()(be);be.maps.random=aA()(be);for(uA in be.maps)(function(t){be[t]=function(e){return W7(be.maps[t],e)}})(uA);var uA;cA(be,K7())});var mA=E((
|
|
40
|
+
`);let C=await D.signMessage(new TextEncoder().encode(m),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=C}}try{let{data:b,error:S}=await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:m,signature:(0,eS.bytesToBase64URL)(g)},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:he._sessionResponse});if(S)throw S;if(!b||!b.session||!b.user){let A=new ee.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null},error:A})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:S})}catch(b){if((0,ee.isAuthError)(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(e){let r=await(0,se.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:s,error:o}=await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:he._sessionResponse});if(await(0,se.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!s||!s.session||!s.user){let a=new ee.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:o})}catch(s){if((0,ee.isAuthError)(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:s,nonce:o}=e,a=await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:s,nonce:o,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:he._sessionResponse}),{data:u,error:c}=a;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!u||!u.session||!u.user){let l=new ee.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null},error:l})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),this._returnResult({data:u,error:c})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,i,s,o;try{if("email"in e){let{email:a,options:u}=e,c=null,l=null;this.flowType==="pkce"&&([c,l]=await(0,se.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:h}=await(0,he._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=u?.data)!==null&&r!==void 0?r:{},create_user:(n=u?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:c,code_challenge_method:l},redirectTo:u?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in e){let{phone:a,options:u}=e,{data:c,error:l}=await(0,he._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=u?.data)!==null&&i!==void 0?i:{},create_user:(s=u?.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(o=u?.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c?.message_id},error:l})}throw new ee.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,ee.isAuthError)(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(e){var r,n;try{let i,s;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,s=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:o,error:a}=await(0,he._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:he._sessionResponse});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");let u=o.session,c=o.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),this._returnResult({data:{user:c,session:u},error:null})}catch(i){if((0,ee.isAuthError)(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(e){var r,n,i;try{let s=null,o=null;this.flowType==="pkce"&&([s,o]=await(0,se.getCodeChallengeAndMethod)(this.storage,this.storageKey));let a=await(0,he._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:s,code_challenge_method:o}),headers:this.headers,xform:he._ssoResponse});return this._returnResult(a)}catch(s){if((0,ee.isAuthError)(s))return this._returnResult({data:null,error:s});throw s}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new ee.AuthSessionMissingError;let{error:i}=await(0,he._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(e){if((0,ee.isAuthError)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:s}=e,{error:o}=await(0,he._request)(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:s?.captchaToken}},redirectTo:s?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in e){let{phone:n,type:i,options:s}=e,{data:o,error:a}=await(0,he._request)(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:s?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o?.message_id},error:a})}throw new ee.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,se.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()<Dr.EXPIRY_MARGIN_MS:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){let o=await(0,se.getItemAsync)(this.userStorage,this.storageKey+"-user");o?.user?e.user=o.user:e.user=(0,se.userNotAvailableProxy)()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let o={value:this.suppressGetSessionWarning};e.user=(0,se.insecureUserWarningProxy)(e.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}let{data:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{session:null},error:s}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await(0,he._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:he._userResponse}):await this._useSession(async r=>{var n,i,s;let{data:o,error:a}=r;if(a)throw a;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new ee.AuthSessionMissingError}:await(0,he._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:he._userResponse})})}catch(r){if((0,ee.isAuthError)(r))return(0,ee.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,se.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:s}=n;if(s)throw s;if(!i.session)throw new ee.AuthSessionMissingError;let o=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,se.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:c,error:l}=await(0,he._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:u}),jwt:o.access_token,xform:he._userResponse});if(l)throw l;return o.user=c.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if((0,ee.isAuthError)(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new ee.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,s=null,{payload:o}=(0,se.decodeJWT)(e.access_token);if(o.exp&&(n=o.exp,i=n<=r),i){let{data:a,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!a)return{data:{user:null,session:null},error:null};s=a}else{let{data:a,error:u}=await this._getUser(e.access_token);if(u)throw u;s={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:o,error:a}=r;if(a)throw a;e=(n=o.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new ee.AuthSessionMissingError;let{data:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){try{if(!(0,se.isBrowser)())throw new ee.AuthImplicitGrantRedirectError("No browser detected.");if(e.error||e.error_description||e.error_code)throw new ee.AuthImplicitGrantRedirectError(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new ee.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ee.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new ee.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:A,error:p}=await this._exchangeCodeForSession(e.code);if(p)throw p;let D=new URL(window.location.href);return D.searchParams.delete("code"),window.history.replaceState(window.history.state,"",D.toString()),{data:{session:A.session,redirectType:null},error:null}}let{provider_token:n,provider_refresh_token:i,access_token:s,refresh_token:o,expires_in:a,expires_at:u,token_type:c}=e;if(!s||!a||!o||!c)throw new ee.AuthImplicitGrantRedirectError("No session defined in URL");let l=Math.round(Date.now()/1e3),h=parseInt(a),d=l+h;u&&(d=parseInt(u));let f=d-l;f*1e3<=Dr.AUTO_REFRESH_TICK_DURATION_MS&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${h}s`);let m=d-h;l-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,d,l):l-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,d,l);let{data:g,error:b}=await this._getUser(s);if(b)throw b;let S={provider_token:n,provider_refresh_token:i,access_token:s,expires_in:h,expires_at:d,refresh_token:o,token_type:c,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:S,redirectType:e.type},error:null})}catch(n){if((0,ee.isAuthError)(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){let r=await(0,se.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:s}=r;if(s)return this._returnResult({error:s});let o=(n=i.session)===null||n===void 0?void 0:n.access_token;if(o){let{error:a}=await this.admin.signOut(o,e);if(a&&!((0,ee.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return this._returnResult({error:a})}return e!=="others"&&(await this._removeSession(),await(0,se.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let r=(0,se.uuid)(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:s},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),console.error(s)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await(0,se.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,he._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(s){if((0,ee.isAuthError)(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{let{data:n,error:i}=await this._useSession(async s=>{var o,a,u,c,l;let{data:h,error:d}=s;if(d)throw d;let f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await(0,he._request)(this.fetch,"GET",f,{headers:this.headers,jwt:(l=(c=h.session)===null||c===void 0?void 0:c.access_token)!==null&&l!==void 0?l:void 0})});if(i)throw i;return(0,se.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),this._returnResult({data:{provider:e.provider,url:n?.url},error:null})}catch(n){if((0,ee.isAuthError)(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{let{error:i,data:{session:s}}=r;if(i)throw i;let{options:o,provider:a,token:u,access_token:c,nonce:l}=e,h=await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=s?.access_token)!==null&&n!==void 0?n:void 0,body:{provider:a,id_token:u,access_token:c,nonce:l,link_identity:!0,gotrue_meta_security:{captcha_token:o?.captchaToken}},xform:he._sessionResponse}),{data:d,error:f}=h;return f?this._returnResult({data:{user:null,session:null},error:f}):!d||!d.session||!d.user?this._returnResult({data:{user:null,session:null},error:new ee.AuthInvalidTokenResponseError}):(d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("USER_UPDATED",d.session)),this._returnResult({data:d,error:f}))}catch(i){if((0,ee.isAuthError)(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:s,error:o}=r;if(o)throw o;return await(0,he._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=s.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await(0,se.retryable)(async i=>(i>0&&await(0,se.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,he._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:he._sessionResponse})),(i,s)=>{let o=200*Math.pow(2,i);return s&&(0,ee.isAuthRetryableFetchError)(s)&&Date.now()+o-n<Dr.AUTO_REFRESH_TICK_DURATION_MS})}catch(n){if(this._debug(r,"error",n),(0,ee.isAuthError)(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),(0,se.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;let n="#_recoverAndRefresh()";this._debug(n,"begin");try{let i=await(0,se.getItemAsync)(this.storage,this.storageKey);if(i&&this.userStorage){let o=await(0,se.getItemAsync)(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:i.user},await(0,se.setItemAsync)(this.userStorage,this.storageKey+"-user",o)),i.user=(e=o?.user)!==null&&e!==void 0?e:(0,se.userNotAvailableProxy)()}else if(i&&!i.user&&!i.user){let o=await(0,se.getItemAsync)(this.storage,this.storageKey+"-user");o&&o?.user?(i.user=o.user,await(0,se.removeItemAsync)(this.storage,this.storageKey+"-user"),await(0,se.setItemAsync)(this.storage,this.storageKey,i)):i.user=(0,se.userNotAvailableProxy)()}if(this._debug(n,"session from storage",i),!this._isValidSession(i)){this._debug(n,"session is not valid"),i!==null&&await this._removeSession();return}let s=((r=i.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Dr.EXPIRY_MARGIN_MS;if(this._debug(n,`session has${s?"":" not"} expired with margin of ${Dr.EXPIRY_MARGIN_MS}s`),s){if(this.autoRefreshToken&&i.refresh_token){let{error:o}=await this._callRefreshToken(i.refresh_token);o&&(console.error(o),(0,ee.isAuthRetryableFetchError)(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{let{data:o,error:a}=await this._getUser(i.access_token);!a&&o?.user?(i.user=o.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(n,"error",i),console.error(i);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new ee.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new se.Deferred;let{data:s,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!s.session)throw new ee.AuthSessionMissingError;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);let a={data:s.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(s){if(this._debug(i,"error",s),(0,ee.isAuthError)(s)){let o={data:null,error:s};return(0,ee.isAuthRetryableFetchError)(s)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(s),s}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let s=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(u){s.push(u)}});if(await Promise.all(o),s.length>0){for(let a=0;a<s.length;a+=1)console.error(s[a]);throw s[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;let r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await(0,se.setItemAsync)(this.userStorage,this.storageKey+"-user",{user:r.user});let i=Object.assign({},r);delete i.user;let s=(0,se.deepClone)(i);await(0,se.setItemAsync)(this.storage,this.storageKey,s)}else{let i=(0,se.deepClone)(r);await(0,se.setItemAsync)(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),await(0,se.removeItemAsync)(this.storage,this.storageKey),await(0,se.removeItemAsync)(this.storage,this.storageKey+"-code-verifier"),await(0,se.removeItemAsync)(this.storage,this.storageKey+"-user"),this.userStorage&&await(0,se.removeItemAsync)(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,se.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),Dr.AUTO_REFRESH_TICK_DURATION_MS);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async r=>{let{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let i=Math.floor((n.expires_at*1e3-e)/Dr.AUTO_REFRESH_TICK_DURATION_MS);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Dr.AUTO_REFRESH_TICK_DURATION_MS}ms, refresh threshold is ${Dr.AUTO_REFRESH_TICK_THRESHOLD} ticks`),i<=Dr.AUTO_REFRESH_TICK_THRESHOLD&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof QC.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,se.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[s,o]=await(0,se.getCodeChallengeAndMethod)(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(a.toString())}if(n?.queryParams){let s=new URLSearchParams(n.queryParams);i.push(s.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:s}=r;return s?this._returnResult({data:null,error:s}):await(0,he._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:s,error:o}=r;if(o)return this._returnResult({data:null,error:o});let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:u,error:c}=await(0,he._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=s?.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(e.factorType==="totp"&&u.type==="totp"&&(!((i=u?.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),this._returnResult({data:u,error:null}))})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:s}=r;if(s)return this._returnResult({data:null,error:s});let o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?(0,Iu.serializeCredentialCreationResponse)(e.webauthn.credential_response):(0,Iu.serializeCredentialRequestResponse)(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:u}=await(0,he._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:u}))})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:s}=r;if(s)return this._returnResult({data:null,error:s});let o=await(0,he._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;let{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:(0,Iu.deserializeCredentialCreationOptions)(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:(0,Iu.deserializeCredentialRequestOptions)(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;let{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};let i={all:[],phone:[],totp:[],webauthn:[]};for(let s of(e=r?.factors)!==null&&e!==void 0?e:[])i.all.push(s),s.status==="verified"&&i[s.factor_type].push(s);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(){var e,r;let{data:{session:n},error:i}=await this.getSession();if(i)return this._returnResult({data:null,error:i});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:s}=(0,se.decodeJWT)(n.access_token),o=null;s.aal&&(o=s.aal);let a=o;((r=(e=n.user.factors)===null||e===void 0?void 0:e.filter(l=>l.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(a="aal2");let c=s.amr||[];return{data:{currentLevel:o,nextLevel:a,currentAuthenticationMethods:c},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{let{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?await(0,he._request)(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new ee.AuthSessionMissingError})})}catch(r){if((0,ee.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{let{data:{session:i},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new ee.AuthSessionMissingError});let o=await(0,he._request)(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&(0,se.isBrowser)()&&!r?.skipBrowserRedirect&&window.location.assign(o.data.redirect_url),o})}catch(n){if((0,ee.isAuthError)(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{let{data:{session:i},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new ee.AuthSessionMissingError});let o=await(0,he._request)(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&(0,se.isBrowser)()&&!r?.skipBrowserRedirect&&window.location.assign(o.data.redirect_url),o})}catch(n){if((0,ee.isAuthError)(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(a=>a.kid===e);if(n)return n;let i=Date.now();if(n=this.jwks.keys.find(a=>a.kid===e),n&&this.jwks_cached_at+Dr.JWKS_TTL>i)return n;let{data:s,error:o}=await(0,he._request)(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=i,n=s.keys.find(a=>a.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){let{data:f,error:m}=await this.getSession();if(m||!f.session)return this._returnResult({data:null,error:m});n=f.session.access_token}let{header:i,payload:s,signature:o,raw:{header:a,payload:u}}=(0,se.decodeJWT)(n);r?.allowExpired||(0,se.validateExp)(s.exp);let c=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,r?.keys?{keys:r.keys}:r?.jwks);if(!c){let{error:f}=await this.getUser(n);if(f)throw f;return{data:{claims:s,header:i,signature:o},error:null}}let l=(0,se.getAlgorithm)(i.alg),h=await crypto.subtle.importKey("jwk",c,l,!0,["verify"]);if(!await crypto.subtle.verify(l,h,o,(0,eS.stringToUint8Array)(`${a}.${u}`)))throw new ee.AuthInvalidJwtError("Invalid JWT signature");return{data:{claims:s,header:i,signature:o},error:null}}catch(n){if((0,ee.isAuthError)(n))return this._returnResult({data:null,error:n});throw n}}};Sf.nextInstanceID=0;Iy.default=Sf});var rS=E(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});var Y9=(fe(),ue(le)),J9=Y9.__importDefault(wf()),Z9=J9.default;Py.default=Z9});var nS=E(Ry=>{"use strict";Object.defineProperty(Ry,"__esModule",{value:!0});var Q9=(fe(),ue(le)),e7=Q9.__importDefault(ky()),t7=e7.default;Ry.default=t7});var Ny=E(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.processLock=Ct.lockInternals=Ct.NavigatorLockAcquireTimeoutError=Ct.navigatorLock=Ct.AuthClient=Ct.AuthAdminApi=Ct.GoTrueClient=Ct.GoTrueAdminApi=void 0;var $o=(fe(),ue(le)),r7=$o.__importDefault(wf());Ct.GoTrueAdminApi=r7.default;var n7=$o.__importDefault(ky());Ct.GoTrueClient=n7.default;var i7=$o.__importDefault(rS());Ct.AuthAdminApi=i7.default;var s7=$o.__importDefault(nS());Ct.AuthClient=s7.default;$o.__exportStar(vy(),Ct);$o.__exportStar(ds(),Ct);var Af=Ay();Object.defineProperty(Ct,"navigatorLock",{enumerable:!0,get:function(){return Af.navigatorLock}});Object.defineProperty(Ct,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Af.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Ct,"lockInternals",{enumerable:!0,get:function(){return Af.internals}});Object.defineProperty(Ct,"processLock",{enumerable:!0,get:function(){return Af.processLock}})});var iS=E(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.SupabaseAuthClient=void 0;var o7=Ny(),$y=class extends o7.AuthClient{constructor(e){super(e)}};Of.SupabaseAuthClient=$y});var By=E(jy=>{"use strict";Object.defineProperty(jy,"__esModule",{value:!0});var a7=Bm(),u7=rg(),c7=bg(),l7=SC(),xf=OC(),f7=xC(),sS=FC(),h7=iS(),Ly=class{constructor(e,r,n){var i,s,o;this.supabaseUrl=e,this.supabaseKey=r;let a=(0,sS.validateSupabaseUrl)(e);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);let u=`sb-${a.hostname.split(".")[0]}-auth-token`,c={db:xf.DEFAULT_DB_OPTIONS,realtime:xf.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},xf.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:xf.DEFAULT_GLOBAL_OPTIONS},l=(0,sS.applySettingDefaults)(n??{},c);this.storageKey=(i=l.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(h,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=l.auth)!==null&&o!==void 0?o:{},this.headers,l.global.fetch),this.fetch=(0,f7.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.rest=new u7.PostgrestClient(new URL("rest/v1",a).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new l7.StorageClient(this.storageUrl.href,this.headers,this.fetch,n?.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new a7.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,r;if(this.accessToken)return await this.accessToken();let{data:n}=await this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,userStorage:s,storageKey:o,flowType:a,lock:u,debug:c,throwOnError:l},h,d){let f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new h7.SupabaseAuthClient({url:this.authUrl.href,headers:Object.assign(Object.assign({},f),h),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,userStorage:s,flowType:a,lock:u,debug:c,throwOnError:l,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new c7.RealtimeClient(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};jy.default=Ly});var uS=E(Ve=>{"use strict";var d7=Ve&&Ve.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oS=Ve&&Ve.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&d7(e,t,r)},aS=Ve&&Ve.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.createClient=Ve.SupabaseClient=Ve.FunctionRegion=Ve.FunctionsError=Ve.FunctionsRelayError=Ve.FunctionsFetchError=Ve.FunctionsHttpError=Ve.PostgrestError=void 0;var p7=aS(By());oS(Ny(),Ve);var m7=rg();Object.defineProperty(Ve,"PostgrestError",{enumerable:!0,get:function(){return m7.PostgrestError}});var ku=Bm();Object.defineProperty(Ve,"FunctionsHttpError",{enumerable:!0,get:function(){return ku.FunctionsHttpError}});Object.defineProperty(Ve,"FunctionsFetchError",{enumerable:!0,get:function(){return ku.FunctionsFetchError}});Object.defineProperty(Ve,"FunctionsRelayError",{enumerable:!0,get:function(){return ku.FunctionsRelayError}});Object.defineProperty(Ve,"FunctionsError",{enumerable:!0,get:function(){return ku.FunctionsError}});Object.defineProperty(Ve,"FunctionRegion",{enumerable:!0,get:function(){return ku.FunctionRegion}});oS(bg(),Ve);var g7=By();Object.defineProperty(Ve,"SupabaseClient",{enumerable:!0,get:function(){return aS(g7).default}});var y7=(t,e,r)=>new p7.default(t,e,r);Ve.createClient=y7;function D7(){if(typeof window<"u"||typeof process>"u")return!1;let t=process.version;if(t==null)return!1;let e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}D7()&&console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217")});var My=E((bge,cS)=>{cS.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Tf=E(fS=>{var lS={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function w7(t){return function(...e){return e.length&&(t=t.replace(/\{(\d)\}/g,(r,n)=>e[n]||"")),new Error("ADM-ZIP: "+t)}}for(let t of Object.keys(lS))fS[t]=w7(lS[t])});var gS=E((Ege,mS)=>{var b7=require("fs"),xt=require("path"),hS=My(),v7=Tf(),E7=typeof process=="object"&&process.platform==="win32",dS=t=>typeof t=="object"&&t!==null,pS=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=3988292384^e>>>1:e>>>=1;return e>>>0});function ft(t){this.sep=xt.sep,this.fs=b7,dS(t)&&dS(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}mS.exports=ft;ft.prototype.makeDir=function(t){let e=this;function r(n){let i=n.split(e.sep)[0];n.split(e.sep).forEach(function(s){if(!(!s||s.substr(-1,1)===":")){i+=e.sep+s;var o;try{o=e.fs.statSync(i)}catch{e.fs.mkdirSync(i)}if(o&&o.isFile())throw v7.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};ft.prototype.writeFileTo=function(t,e,r,n){let i=this;if(i.fs.existsSync(t)){if(!r)return!1;var s=i.fs.statSync(t);if(s.isDirectory())return!1}var o=xt.dirname(t);i.fs.existsSync(o)||i.makeDir(o);var a;try{a=i.fs.openSync(t,"w",438)}catch{i.fs.chmodSync(t,438),a=i.fs.openSync(t,"w",438)}if(a)try{i.fs.writeSync(a,e,0,e.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(t,n||438),!0};ft.prototype.writeFileToAsync=function(t,e,r,n,i){typeof n=="function"&&(i=n,n=void 0);let s=this;s.fs.exists(t,function(o){if(o&&!r)return i(!1);s.fs.stat(t,function(a,u){if(o&&u.isDirectory())return i(!1);var c=xt.dirname(t);s.fs.exists(c,function(l){l||s.makeDir(c),s.fs.open(t,"w",438,function(h,d){h?s.fs.chmod(t,438,function(){s.fs.open(t,"w",438,function(f,m){s.fs.write(m,e,0,e.length,0,function(){s.fs.close(m,function(){s.fs.chmod(t,n||438,function(){i(!0)})})})})}):d?s.fs.write(d,e,0,e.length,0,function(){s.fs.close(d,function(){s.fs.chmod(t,n||438,function(){i(!0)})})}):s.fs.chmod(t,n||438,function(){i(!0)})})})})})};ft.prototype.findFiles=function(t){let e=this;function r(n,i,s){typeof i=="boolean"&&(s=i,i=void 0);let o=[];return e.fs.readdirSync(n).forEach(function(a){let u=xt.join(n,a),c=e.fs.statSync(u);(!i||i.test(u))&&o.push(xt.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&s&&(o=o.concat(r(u,i,s)))}),o}return r(t,void 0,!0)};ft.prototype.findFilesAsync=function(t,e){let r=this,n=[];r.fs.readdir(t,function(i,s){if(i)return e(i);let o=s.length;if(!o)return e(null,n);s.forEach(function(a){a=xt.join(t,a),r.fs.stat(a,function(u,c){if(u)return e(u);c&&(n.push(xt.normalize(a)+(c.isDirectory()?r.sep:"")),c.isDirectory()?r.findFilesAsync(a,function(l,h){if(l)return e(l);n=n.concat(h),--o||e(null,n)}):--o||e(null,n))})})})};ft.prototype.getAttributes=function(){};ft.prototype.setAttributes=function(){};ft.crc32update=function(t,e){return pS[(t^e)&255]^t>>>8};ft.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=ft.crc32update(r,t[n++]);return~r>>>0};ft.methodToString=function(t){switch(t){case hS.STORED:return"STORED ("+t+")";case hS.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};ft.canonical=function(t){if(!t)return"";let e=xt.posix.normalize("/"+t.split("\\").join("/"));return xt.join(".",e)};ft.zipnamefix=function(t){if(!t)return"";let e=xt.posix.normalize("/"+t.split("\\").join("/"));return xt.posix.join(".",e)};ft.findLast=function(t,e){if(!Array.isArray(t))throw new TypeError("arr is not array");let r=t.length>>>0;for(let n=r-1;n>=0;n--)if(e(t[n],n,t))return t[n]};ft.sanitize=function(t,e){t=xt.resolve(xt.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var s=xt.normalize(xt.join(t,r.slice(n,i).join(xt.sep)));if(s.indexOf(t)===0)return s}return xt.normalize(xt.join(t,xt.basename(e)))};ft.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};ft.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};ft.fromDOS2Date=function(t){return new Date((t>>25&127)+1980,Math.max((t>>21&15)-1,0),Math.max(t>>16&31,1),t>>11&31,t>>5&63,(t&31)<<1)};ft.fromDate2DOS=function(t){let e=0,r=0;return t.getFullYear()>1979&&(e=(t.getFullYear()-1980&127)<<9|t.getMonth()+1<<5|t.getDate(),r=t.getHours()<<11|t.getMinutes()<<5|t.getSeconds()>>1),e<<16|r};ft.isWin=E7;ft.crcTable=pS});var DS=E((_ge,yS)=>{var _7=require("path");yS.exports=function(t,{fs:e}){var r=t||"",n=s(),i=null;function s(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return r&&e.existsSync(r)?(i=e.statSync(r),n.directory=i.isDirectory(),n.mtime=i.mtime,n.atime=i.atime,n.executable=(73&i.mode)!==0,n.readonly=(128&i.mode)===0,n.hidden=_7.basename(r)[0]==="."):console.warn("Invalid path: "+r),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:r,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var bS=E((Cge,wS)=>{wS.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var jo=E((Sge,Lo)=>{Lo.exports=gS();Lo.exports.Constants=My();Lo.exports.Errors=Tf();Lo.exports.FileAttr=DS();Lo.exports.decoder=bS()});var ES=E((Age,vS)=>{var Ti=jo(),X=Ti.Constants;vS.exports=function(){var t=20,e=10,r=0,n=0,i=0,s=0,o=0,a=0,u=0,c=0,l=0,h=0,d=0,f=0,m=0;t|=Ti.isWin?2560:768,r|=X.FLG_EFS;let g={extraLen:0},b=p=>Math.max(0,p)>>>0,S=p=>Math.max(0,p)&65535,A=p=>Math.max(0,p)&255;return i=Ti.fromDate2DOS(new Date),{get made(){return t},set made(p){t=p},get version(){return e},set version(p){e=p},get flags(){return r},set flags(p){r=p},get flags_efs(){return(r&X.FLG_EFS)>0},set flags_efs(p){p?r|=X.FLG_EFS:r&=~X.FLG_EFS},get flags_desc(){return(r&X.FLG_DESC)>0},set flags_desc(p){p?r|=X.FLG_DESC:r&=~X.FLG_DESC},get method(){return n},set method(p){switch(p){case X.STORED:this.version=10;case X.DEFLATED:default:this.version=20}n=p},get time(){return Ti.fromDOS2Date(this.timeval)},set time(p){this.timeval=Ti.fromDate2DOS(p)},get timeval(){return i},set timeval(p){i=b(p)},get timeHighByte(){return A(i>>>8)},get crc(){return s},set crc(p){s=b(p)},get compressedSize(){return o},set compressedSize(p){o=b(p)},get size(){return a},set size(p){a=b(p)},get fileNameLength(){return u},set fileNameLength(p){u=p},get extraLength(){return c},set extraLength(p){c=p},get extraLocalLength(){return g.extraLen},set extraLocalLength(p){g.extraLen=p},get commentLength(){return l},set commentLength(p){l=p},get diskNumStart(){return h},set diskNumStart(p){h=b(p)},get inAttr(){return d},set inAttr(p){d=b(p)},get attr(){return f},set attr(p){f=b(p)},get fileAttr(){return(f||0)>>16&4095},get offset(){return m},set offset(p){m=b(p)},get encrypted(){return(r&X.FLG_ENC)===X.FLG_ENC},get centralHeaderSize(){return X.CENHDR+u+c+l},get realDataOffset(){return m+X.LOCHDR+g.fnameLen+g.extraLen},get localHeader(){return g},loadLocalHeaderFromBinary:function(p){var D=p.slice(m,m+X.LOCHDR);if(D.readUInt32LE(0)!==X.LOCSIG)throw Ti.Errors.INVALID_LOC();g.version=D.readUInt16LE(X.LOCVER),g.flags=D.readUInt16LE(X.LOCFLG),g.method=D.readUInt16LE(X.LOCHOW),g.time=D.readUInt32LE(X.LOCTIM),g.crc=D.readUInt32LE(X.LOCCRC),g.compressedSize=D.readUInt32LE(X.LOCSIZ),g.size=D.readUInt32LE(X.LOCLEN),g.fnameLen=D.readUInt16LE(X.LOCNAM),g.extraLen=D.readUInt16LE(X.LOCEXT);let y=m+X.LOCHDR+g.fnameLen,C=y+g.extraLen;return p.slice(y,C)},loadFromBinary:function(p){if(p.length!==X.CENHDR||p.readUInt32LE(0)!==X.CENSIG)throw Ti.Errors.INVALID_CEN();t=p.readUInt16LE(X.CENVEM),e=p.readUInt16LE(X.CENVER),r=p.readUInt16LE(X.CENFLG),n=p.readUInt16LE(X.CENHOW),i=p.readUInt32LE(X.CENTIM),s=p.readUInt32LE(X.CENCRC),o=p.readUInt32LE(X.CENSIZ),a=p.readUInt32LE(X.CENLEN),u=p.readUInt16LE(X.CENNAM),c=p.readUInt16LE(X.CENEXT),l=p.readUInt16LE(X.CENCOM),h=p.readUInt16LE(X.CENDSK),d=p.readUInt16LE(X.CENATT),f=p.readUInt32LE(X.CENATX),m=p.readUInt32LE(X.CENOFF)},localHeaderToBinary:function(){var p=Buffer.alloc(X.LOCHDR);return p.writeUInt32LE(X.LOCSIG,0),p.writeUInt16LE(e,X.LOCVER),p.writeUInt16LE(r,X.LOCFLG),p.writeUInt16LE(n,X.LOCHOW),p.writeUInt32LE(i,X.LOCTIM),p.writeUInt32LE(s,X.LOCCRC),p.writeUInt32LE(o,X.LOCSIZ),p.writeUInt32LE(a,X.LOCLEN),p.writeUInt16LE(u,X.LOCNAM),p.writeUInt16LE(g.extraLen,X.LOCEXT),p},centralHeaderToBinary:function(){var p=Buffer.alloc(X.CENHDR+u+c+l);return p.writeUInt32LE(X.CENSIG,0),p.writeUInt16LE(t,X.CENVEM),p.writeUInt16LE(e,X.CENVER),p.writeUInt16LE(r,X.CENFLG),p.writeUInt16LE(n,X.CENHOW),p.writeUInt32LE(i,X.CENTIM),p.writeUInt32LE(s,X.CENCRC),p.writeUInt32LE(o,X.CENSIZ),p.writeUInt32LE(a,X.CENLEN),p.writeUInt16LE(u,X.CENNAM),p.writeUInt16LE(c,X.CENEXT),p.writeUInt16LE(l,X.CENCOM),p.writeUInt16LE(h,X.CENDSK),p.writeUInt16LE(d,X.CENATT),p.writeUInt32LE(f,X.CENATX),p.writeUInt32LE(m,X.CENOFF),p},toJSON:function(){let p=function(D){return D+" bytes"};return{made:t,version:e,flags:r,method:Ti.methodToString(n),time:this.time,crc:"0x"+s.toString(16).toUpperCase(),compressedSize:p(o),size:p(a),fileNameLength:p(u),extraLength:p(c),commentLength:p(l),diskNumStart:h,inAttr:d,attr:f,offset:m,centralHeaderSize:p(X.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var CS=E((Oge,_S)=>{var Bo=jo(),ot=Bo.Constants;_S.exports=function(){var t=0,e=0,r=0,n=0,i=0;return{get diskEntries(){return t},set diskEntries(s){t=e=s},get totalEntries(){return e},set totalEntries(s){e=t=s},get size(){return r},set size(s){r=s},get offset(){return n},set offset(s){n=s},get commentLength(){return i},set commentLength(s){i=s},get mainHeaderSize(){return ot.ENDHDR+i},loadFromBinary:function(s){if((s.length!==ot.ENDHDR||s.readUInt32LE(0)!==ot.ENDSIG)&&(s.length<ot.ZIP64HDR||s.readUInt32LE(0)!==ot.ZIP64SIG))throw Bo.Errors.INVALID_END();s.readUInt32LE(0)===ot.ENDSIG?(t=s.readUInt16LE(ot.ENDSUB),e=s.readUInt16LE(ot.ENDTOT),r=s.readUInt32LE(ot.ENDSIZ),n=s.readUInt32LE(ot.ENDOFF),i=s.readUInt16LE(ot.ENDCOM)):(t=Bo.readBigUInt64LE(s,ot.ZIP64SUB),e=Bo.readBigUInt64LE(s,ot.ZIP64TOT),r=Bo.readBigUInt64LE(s,ot.ZIP64SIZE),n=Bo.readBigUInt64LE(s,ot.ZIP64OFF),i=0)},toBinary:function(){var s=Buffer.alloc(ot.ENDHDR+i);return s.writeUInt32LE(ot.ENDSIG,0),s.writeUInt32LE(0,4),s.writeUInt16LE(t,ot.ENDSUB),s.writeUInt16LE(e,ot.ENDTOT),s.writeUInt32LE(r,ot.ENDSIZ),s.writeUInt32LE(n,ot.ENDOFF),s.writeUInt16LE(i,ot.ENDCOM),s.fill(" ",ot.ENDHDR),s},toJSON:function(){let s=function(o,a){let u=o.toString(16).toUpperCase();for(;u.length<a;)u="0"+u;return"0x"+u};return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:s(n,4),commentLength:i}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Uy=E(qy=>{qy.EntryHeader=ES();qy.MainHeader=CS()});var AS=E((Tge,SS)=>{SS.exports=function(t){var e=require("zlib"),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(t,r)},deflateAsync:function(n){var i=e.createDeflateRaw(r),s=[],o=0;i.on("data",function(a){s.push(a),o+=a.length}),i.on("end",function(){var a=Buffer.alloc(o),u=0;a.fill(0);for(var c=0;c<s.length;c++){var l=s[c];l.copy(a,u),u+=l.length}n&&n(a)}),i.end(t)}}}});var xS=E((Fge,OS)=>{var C7=+(process.versions?process.versions.node:"").split(".")[0]||0;OS.exports=function(t,e){var r=require("zlib");let n=C7>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(i){var s=r.createInflateRaw(n),o=[],a=0;s.on("data",function(u){o.push(u),a+=u.length}),s.on("end",function(){var u=Buffer.alloc(a),c=0;u.fill(0);for(var l=0;l<o.length;l++){var h=o[l];h.copy(u,c),c+=h.length}i&&i(u)}),s.end(t)}}}});var PS=E((Ige,kS)=>{"use strict";var{randomFillSync:TS}=require("crypto"),S7=Tf(),A7=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=e>>>1^3988292384:e>>>=1;return e>>>0}),IS=(t,e)=>Math.imul(t,e)>>>0,FS=(t,e)=>A7[(t^e)&255]^t>>>8,Pu=()=>typeof TS=="function"?TS(Buffer.alloc(12)):Pu.node();Pu.node=()=>{let t=Buffer.alloc(12),e=t.length;for(let r=0;r<e;r++)t[r]=Math.random()*256&255;return t};var Ff={genSalt:Pu};function If(t){let e=Buffer.isBuffer(t)?t:Buffer.from(t);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let r=0;r<e.length;r++)this.updateKeys(e[r])}If.prototype.updateKeys=function(t){let e=this.keys;return e[0]=FS(e[0],t),e[1]+=e[0]&255,e[1]=IS(e[1],134775813)+1,e[2]=FS(e[2],e[1]>>>24),t};If.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return IS(t,t^1)>>8&255};function O7(t){let e=new If(t);return function(r){let n=Buffer.alloc(r.length),i=0;for(let s of r)n[i++]=e.updateKeys(s^e.next());return n}}function x7(t){let e=new If(t);return function(r,n,i=0){n||(n=Buffer.alloc(r.length));for(let s of r){let o=e.next();n[i++]=s^o,e.updateKeys(s)}return n}}function T7(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=O7(r),i=n(t.slice(0,12)),s=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==s)throw S7.WRONG_PASSWORD();return n(t.slice(12))}function F7(t){Buffer.isBuffer(t)&&t.length>=12?Ff.genSalt=function(){return t.slice(0,12)}:t==="node"?Ff.genSalt=Pu.node:Ff.genSalt=Pu}function I7(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=x7(r),s=Ff.genSalt();s[11]=e.crc>>>24&255,n&&(s[10]=e.crc>>>16&255);let o=Buffer.alloc(t.length+12);return i(s,o),i(t,o,12)}kS.exports={decrypt:T7,encrypt:I7,_salter:F7}});var RS=E(kf=>{kf.Deflater=AS();kf.Inflater=xS();kf.ZipCrypto=PS()});var Vy=E((Pge,NS)=>{var ke=jo(),k7=Uy(),ht=ke.Constants,Hy=RS();NS.exports=function(t,e){var r=new k7.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),s=!1,o=null,a=Buffer.alloc(0),u=Buffer.alloc(0),c=!0;let l=t,h=typeof l.decoder=="object"?l.decoder:ke.decoder;c=h.hasOwnProperty("efs")?h.efs:!1;function d(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function f(p){if(r.flags_desc){let D={},y=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(y)==ht.LOCSIG||e.readUInt32LE(y)==ht.CENSIG)throw ke.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(y)==ht.EXTSIG)D.crc=e.readUInt32LE(y+ht.EXTCRC),D.compressedSize=e.readUInt32LE(y+ht.EXTSIZ),D.size=e.readUInt32LE(y+ht.EXTLEN);else if(e.readUInt16LE(y+12)===19280)D.crc=e.readUInt32LE(y+ht.EXTCRC-4),D.compressedSize=e.readUInt32LE(y+ht.EXTSIZ-4),D.size=e.readUInt32LE(y+ht.EXTLEN-4);else throw ke.Errors.DESCRIPTOR_UNKNOWN();if(D.compressedSize!==r.compressedSize||D.size!==r.size||D.crc!==r.crc)throw ke.Errors.DESCRIPTOR_FAULTY();if(ke.crc32(p)!==D.crc)return!1}else if(ke.crc32(p)!==r.localHeader.crc)return!1;return!0}function m(p,D,y){if(typeof D>"u"&&typeof p=="string"&&(y=p,p=void 0),s)return p&&D&&D(Buffer.alloc(0),ke.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var C=d();if(C.length===0)return p&&D&&D(C),C;if(r.encrypted){if(typeof y!="string"&&!Buffer.isBuffer(y))throw ke.Errors.INVALID_PASS_PARAM();C=Hy.ZipCrypto.decrypt(C,r,y)}var k=Buffer.alloc(r.size);switch(r.method){case ke.Constants.STORED:if(C.copy(k),f(k))return p&&D&&D(k),k;throw p&&D&&D(k,ke.Errors.BAD_CRC()),ke.Errors.BAD_CRC();case ke.Constants.DEFLATED:var v=new Hy.Inflater(C,r.size);if(p)v.inflateAsync(function(R){R.copy(R,0),D&&(f(R)?D(R):D(R,ke.Errors.BAD_CRC()))});else{if(v.inflate(k).copy(k,0),!f(k))throw ke.Errors.BAD_CRC(`"${h.decode(n)}"`);return k}break;default:throw p&&D&&D(Buffer.alloc(0),ke.Errors.UNKNOWN_METHOD()),ke.Errors.UNKNOWN_METHOD()}}function g(p,D){if((!o||!o.length)&&Buffer.isBuffer(e))return p&&D&&D(d()),d();if(o.length&&!s){var y;switch(r.method){case ke.Constants.STORED:return r.compressedSize=r.size,y=Buffer.alloc(o.length),o.copy(y),p&&D&&D(y),y;default:case ke.Constants.DEFLATED:var C=new Hy.Deflater(o);if(p)C.deflateAsync(function(v){y=Buffer.alloc(v.length),r.compressedSize=v.length,v.copy(y),D&&D(y)});else{var k=C.deflate();return r.compressedSize=k.length,k}C=null;break}}else if(p&&D)D(Buffer.alloc(0));else return Buffer.alloc(0)}function b(p,D){return(p.readUInt32LE(D+4)<<4)+p.readUInt32LE(D)}function S(p){try{for(var D=0,y,C,k;D+4<p.length;)y=p.readUInt16LE(D),D+=2,C=p.readUInt16LE(D),D+=2,k=p.slice(D,D+C),D+=C,ht.ID_ZIP64===y&&A(k)}catch{throw ke.Errors.EXTRA_FIELD_PARSE_ERROR()}}function A(p){var D,y,C,k;p.length>=ht.EF_ZIP64_SCOMP&&(D=b(p,ht.EF_ZIP64_SUNCOMP),r.size===ht.EF_ZIP64_OR_32&&(r.size=D)),p.length>=ht.EF_ZIP64_RHO&&(y=b(p,ht.EF_ZIP64_SCOMP),r.compressedSize===ht.EF_ZIP64_OR_32&&(r.compressedSize=y)),p.length>=ht.EF_ZIP64_DSN&&(C=b(p,ht.EF_ZIP64_RHO),r.offset===ht.EF_ZIP64_OR_32&&(r.offset=C)),p.length>=ht.EF_ZIP64_DSN+4&&(k=p.readUInt32LE(ht.EF_ZIP64_DSN),r.diskNumStart===ht.EF_ZIP64_OR_16&&(r.diskNumStart=k))}return{get entryName(){return h.decode(n)},get rawEntryName(){return n},set entryName(p){n=ke.toBuffer(p,h.encode);var D=n[n.length-1];s=D===47||D===92,r.fileNameLength=n.length},get efs(){return typeof c=="function"?c(this.entryName):c},get extra(){return a},set extra(p){a=p,r.extraLength=p.length,S(p)},get comment(){return h.decode(i)},set comment(p){if(i=ke.toBuffer(p,h.encode),r.commentLength=i.length,i.length>65535)throw ke.Errors.COMMENT_TOO_LONG()},get name(){var p=h.decode(n);return s?p.substr(p.length-1).split("/").pop():p.split("/").pop()},get isDirectory(){return s},getCompressedData:function(){return g(!1,null)},getCompressedDataAsync:function(p){g(!0,p)},setData:function(p){o=ke.toBuffer(p,ke.decoder.encode),!s&&o.length?(r.size=o.length,r.method=ke.Constants.DEFLATED,r.crc=ke.crc32(p),r.changed=!0):r.method=ke.Constants.STORED},getData:function(p){return r.changed?o:m(!1,null,p)},getDataAsync:function(p,D){r.changed?p(o):m(!0,p,D)},set attr(p){r.attr=p},get attr(){return r.attr},set header(p){r.loadFromBinary(p)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var p=r.centralHeaderToBinary(),D=ke.Constants.CENHDR;return n.copy(p,D),D+=n.length,a.copy(p,D),D+=r.extraLength,i.copy(p,D),p},packLocalHeader:function(){let p=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let D=r.localHeaderToBinary(),y=Buffer.alloc(D.length+n.length+r.extraLocalLength);return D.copy(y,p),p+=D.length,n.copy(y,p),p+=n.length,u.copy(y,p),p+=u.length,y},toJSON:function(){let p=function(D){return"<"+(D&&D.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:p(e),data:p(o)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var jS=E((Rge,LS)=>{var $S=Vy(),P7=Uy(),Bt=jo();LS.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),s=new P7.MainHeader,o=!1,a=null;let u=new Set,c=e,{noSort:l,decoder:h}=c;t?m(c.readEntries):o=!0;function d(){let b=new Set;for(let S of Object.keys(n)){let A=S.split("/");if(A.pop(),!!A.length)for(let p=0;p<A.length;p++){let D=A.slice(0,p+1).join("/")+"/";b.add(D)}}for(let S of b)if(!(S in n)){let A=new $S(c);A.entryName=S,A.attr=16,A.temporary=!0,r.push(A),n[A.entryName]=A,u.add(A)}}function f(){if(o=!0,n={},s.diskEntries>(t.length-s.offset)/Bt.Constants.CENHDR)throw Bt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(s.diskEntries);for(var b=s.offset,S=0;S<r.length;S++){var A=b,p=new $S(c,t);p.header=t.slice(A,A+=Bt.Constants.CENHDR),p.entryName=t.slice(A,A+=p.header.fileNameLength),p.header.extraLength&&(p.extra=t.slice(A,A+=p.header.extraLength)),p.header.commentLength&&(p.comment=t.slice(A,A+p.header.commentLength)),b+=p.header.centralHeaderSize,r[S]=p,n[p.entryName]=p}u.clear(),d()}function m(b){var S=t.length-Bt.Constants.ENDHDR,A=Math.max(0,S-65535),p=A,D=t.length,y=-1,C=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(A=0),S;S>=p;S--)if(t[S]===80){if(t.readUInt32LE(S)===Bt.Constants.ENDSIG){y=S,C=S,D=S+Bt.Constants.ENDHDR,p=S-Bt.Constants.END64HDR;continue}if(t.readUInt32LE(S)===Bt.Constants.END64SIG){p=A;continue}if(t.readUInt32LE(S)===Bt.Constants.ZIP64SIG){y=S,D=S+Bt.readBigUInt64LE(t,S+Bt.Constants.ZIP64SIZE)+Bt.Constants.ZIP64LEAD;break}}if(y==-1)throw Bt.Errors.INVALID_FORMAT();s.loadFromBinary(t.slice(y,D)),s.commentLength&&(i=t.slice(C+Bt.Constants.ENDHDR)),b&&f()}function g(){r.length>1&&!l&&r.sort((b,S)=>b.entryName.toLowerCase().localeCompare(S.entryName.toLowerCase()))}return{get entries(){return o||f(),r.filter(b=>!u.has(b))},get comment(){return h.decode(i)},set comment(b){i=Bt.toBuffer(b,h.encode),s.commentLength=i.length},getEntryCount:function(){return o?r.length:s.diskEntries},forEach:function(b){this.entries.forEach(b)},getEntry:function(b){return o||f(),n[b]||null},setEntry:function(b){o||f(),r.push(b),n[b.entryName]=b,s.totalEntries=r.length},deleteFile:function(b,S=!0){o||f();let A=n[b];this.getEntryChildren(A,S).map(D=>D.entryName).forEach(this.deleteEntry)},deleteEntry:function(b){o||f();let S=n[b],A=r.indexOf(S);A>=0&&(r.splice(A,1),delete n[b],s.totalEntries=r.length)},getEntryChildren:function(b,S=!0){if(o||f(),typeof b=="object")if(b.isDirectory&&S){let A=[],p=b.entryName;for(let D of r)D.entryName.startsWith(p)&&A.push(D);return A}else return[b];return[]},getChildCount:function(b){if(b&&b.isDirectory){let S=this.getEntryChildren(b);return S.includes(b)?S.length-1:S.length}return 0},compressToBuffer:function(){o||f(),g();let b=[],S=[],A=0,p=0;s.size=0,s.offset=0;let D=0;for(let k of this.entries){let v=k.getCompressedData();k.header.offset=p;let R=k.packLocalHeader(),P=R.length+v.length;p+=P,b.push(R),b.push(v);let F=k.packCentralHeader();S.push(F),s.size+=F.length,A+=P+F.length,D++}A+=s.mainHeaderSize,s.offset=p,s.totalEntries=D,p=0;let y=Buffer.alloc(A);for(let k of b)k.copy(y,p),p+=k.length;for(let k of S)k.copy(y,p),p+=k.length;let C=s.toBinary();return i&&i.copy(C,Bt.Constants.ENDHDR),C.copy(y,p),t=y,o=!1,y},toAsyncBuffer:function(b,S,A,p){try{o||f(),g();let D=[],y=[],C=0,k=0,v=0;s.size=0,s.offset=0;let R=function(P){if(P.length>0){let F=P.shift(),j=F.entryName+F.extra.toString();A&&A(j),F.getCompressedDataAsync(function(U){p&&p(j),F.header.offset=k;let G=F.packLocalHeader(),L=G.length+U.length;k+=L,D.push(G),D.push(U);let _=F.packCentralHeader();y.push(_),s.size+=_.length,C+=L+_.length,v++,R(P)})}else{C+=s.mainHeaderSize,s.offset=k,s.totalEntries=v,k=0;let F=Buffer.alloc(C);D.forEach(function(U){U.copy(F,k),k+=U.length}),y.forEach(function(U){U.copy(F,k),k+=U.length});let j=s.toBinary();i&&i.copy(j,Bt.Constants.ENDHDR),j.copy(F,k),t=F,o=!1,b(F)}};R(Array.from(this.entries))}catch(D){S(D)}}}}});var qS=E((Nge,MS)=>{var at=jo(),dt=require("path"),R7=Vy(),N7=jS(),ys=(...t)=>at.findLast(t,e=>typeof e=="boolean"),BS=(...t)=>at.findLast(t,e=>typeof e=="string"),$7=(...t)=>at.findLast(t,e=>typeof e=="function"),L7={noSort:!1,readEntries:!1,method:at.Constants.NONE,fs:null};MS.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),L7);t&&typeof t=="object"&&(t instanceof Uint8Array||(Object.assign(n,t),t=n.input?n.input:void 0,n.input&&delete n.input),Buffer.isBuffer(t)&&(r=t,n.method=at.Constants.BUFFER,t=void 0)),Object.assign(n,e);let i=new at(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=at.decoder),t&&typeof t=="string")if(i.fs.existsSync(t))n.method=at.Constants.FILE,n.filename=t,r=i.fs.readFileSync(t);else throw at.Errors.INVALID_FILENAME();let s=new N7(r,n),{canonical:o,sanitize:a,zipnamefix:u}=at;function c(f){if(f&&s){var m;if(typeof f=="string"&&(m=s.getEntry(dt.posix.normalize(f))),typeof f=="object"&&typeof f.entryName<"u"&&typeof f.header<"u"&&(m=s.getEntry(f.entryName)),m)return m}return null}function l(f){let{join:m,normalize:g,sep:b}=dt.posix;return m(".",g(b+f.split("\\").join(b)+b))}function h(f){return f instanceof RegExp?(function(m){return function(g){return m.test(g)}})(f):typeof f!="function"?()=>!0:f}let d=(f,m)=>{let g=m.slice(-1);return g=g===i.sep?i.sep:"",dt.relative(f,m)+g};return{readFile:function(f,m){var g=c(f);return g&&g.getData(m)||null},childCount:function(f){let m=c(f);if(m)return s.getChildCount(m)},readFileAsync:function(f,m){var g=c(f);g?g.getDataAsync(m):m(null,"getEntry failed for:"+f)},readAsText:function(f,m){var g=c(f);if(g){var b=g.getData();if(b&&b.length)return b.toString(m||"utf8")}return""},readAsTextAsync:function(f,m,g){var b=c(f);b?b.getDataAsync(function(S,A){if(A){m(S,A);return}S&&S.length?m(S.toString(g||"utf8")):m("")}):m("")},deleteFile:function(f,m=!0){var g=c(f);g&&s.deleteFile(g.entryName,m)},deleteEntry:function(f){var m=c(f);m&&s.deleteEntry(m.entryName)},addZipComment:function(f){s.comment=f},getZipComment:function(){return s.comment||""},addZipEntryComment:function(f,m){var g=c(f);g&&(g.comment=m)},getZipEntryComment:function(f){var m=c(f);return m&&m.comment||""},updateFile:function(f,m){var g=c(f);g&&g.setData(m)},addLocalFile:function(f,m,g,b){if(i.fs.existsSync(f)){m=m?l(m):"";let S=dt.win32.basename(dt.win32.normalize(f));m+=g||S;let A=i.fs.statSync(f),p=A.isFile()?i.fs.readFileSync(f):Buffer.alloc(0);A.isDirectory()&&(m+=i.sep),this.addFile(m,p,b,A)}else throw at.Errors.FILE_NOT_FOUND(f)},addLocalFileAsync:function(f,m){f=typeof f=="object"?f:{localPath:f};let g=dt.resolve(f.localPath),{comment:b}=f,{zipPath:S,zipName:A}=f,p=this;i.fs.stat(g,function(D,y){if(D)return m(D,!1);S=S?l(S):"";let C=dt.win32.basename(dt.win32.normalize(g));if(S+=A||C,y.isFile())i.fs.readFile(g,function(k,v){return k?m(k,!1):(p.addFile(S,v,b,y),setImmediate(m,void 0,!0))});else if(y.isDirectory())return S+=i.sep,p.addFile(S,Buffer.alloc(0),b,y),setImmediate(m,void 0,!0)})},addLocalFolder:function(f,m,g){if(g=h(g),m=m?l(m):"",f=dt.normalize(f),i.fs.existsSync(f)){let b=i.findFiles(f),S=this;if(b.length)for(let A of b){let p=dt.join(m,d(f,A));g(p)&&S.addLocalFile(A,dt.dirname(p))}}else throw at.Errors.FILE_NOT_FOUND(f)},addLocalFolderAsync:function(f,m,g,b){b=h(b),g=g?l(g):"",f=dt.normalize(f);var S=this;i.fs.open(f,"r",function(A){if(A&&A.code==="ENOENT")m(void 0,at.Errors.FILE_NOT_FOUND(f));else if(A)m(void 0,A);else{var p=i.findFiles(f),D=-1,y=function(){if(D+=1,D<p.length){var C=p[D],k=d(f,C).split("\\").join("/");k=k.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),b(k)?i.fs.stat(C,function(v,R){v&&m(void 0,v),R.isFile()?i.fs.readFile(C,function(P,F){P?m(void 0,P):(S.addFile(g+k,F,"",R),y())}):(S.addFile(g+k+"/",Buffer.alloc(0),"",R),y())}):process.nextTick(()=>{y()})}else m(!0,void 0)};y()}})},addLocalFolderAsync2:function(f,m){let g=this;f=typeof f=="object"?f:{localPath:f},localPath=dt.resolve(l(f.localPath));let{zipPath:b,filter:S,namefix:A}=f;S instanceof RegExp?S=(function(y){return function(C){return y.test(C)}})(S):typeof S!="function"&&(S=function(){return!0}),b=b?l(b):"",A=="latin1"&&(A=y=>y.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof A!="function"&&(A=y=>y);let p=y=>dt.join(b,A(d(localPath,y))),D=y=>dt.win32.basename(dt.win32.normalize(A(y)));i.fs.open(localPath,"r",function(y){y&&y.code==="ENOENT"?m(void 0,at.Errors.FILE_NOT_FOUND(localPath)):y?m(void 0,y):i.findFilesAsync(localPath,function(C,k){if(C)return m(C);k=k.filter(v=>S(p(v))),k.length||m(void 0,!1),setImmediate(k.reverse().reduce(function(v,R){return function(P,F){if(P||F===!1)return setImmediate(v,P,!1);g.addLocalFileAsync({localPath:R,zipPath:dt.dirname(p(R)),zipName:D(R)},v)}},m))})})},addLocalFolderPromise:function(f,m){return new Promise((g,b)=>{this.addLocalFolderAsync2(Object.assign({localPath:f},m),(S,A)=>{S&&b(S),A&&g(this)})})},addFile:function(f,m,g,b){f=u(f);let S=c(f),A=S!=null;A||(S=new R7(n),S.entryName=f),S.comment=g||"";let p=typeof b=="object"&&b instanceof i.fs.Stats;p&&(S.header.time=b.mtime);var D=S.isDirectory?16:0;let y=S.isDirectory?16384:32768;return p?y|=4095&b.mode:typeof b=="number"?y|=4095&b:y|=S.isDirectory?493:420,D=(D|y<<16)>>>0,S.attr=D,S.setData(m),A||s.setEntry(S),S},getEntries:function(f){return s.password=f,s?s.entries:[]},getEntry:function(f){return c(f)},getEntryCount:function(){return s.getEntryCount()},forEach:function(f){return s.forEach(f)},extractEntryTo:function(f,m,g,b,S,A){b=ys(!1,b),S=ys(!1,S),g=ys(!0,g),A=BS(S,A);var p=c(f);if(!p)throw at.Errors.NO_ENTRY();var D=o(p.entryName),y=a(m,A&&!p.isDirectory?A:g?D:dt.basename(D));if(p.isDirectory){var C=s.getEntryChildren(p);return C.forEach(function(R){if(R.isDirectory)return;var P=R.getData();if(!P)throw at.Errors.CANT_EXTRACT_FILE();var F=o(R.entryName),j=a(m,g?F:dt.basename(F));let U=S?R.header.fileAttr:void 0;i.writeFileTo(j,P,b,U)}),!0}var k=p.getData(s.password);if(!k)throw at.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(y)&&!b)throw at.Errors.CANT_OVERRIDE();let v=S?f.header.fileAttr:void 0;return i.writeFileTo(y,k,b,v),!0},test:function(f){if(!s)return!1;for(var m in s.entries)try{if(m.isDirectory)continue;var g=s.entries[m].getData(f);if(!g)return!1}catch{return!1}return!0},extractAllTo:function(f,m,g,b){if(g=ys(!1,g),b=BS(g,b),m=ys(!1,m),!s)throw at.Errors.NO_ZIP();s.entries.forEach(function(S){var A=a(f,o(S.entryName));if(S.isDirectory){i.makeDir(A);return}var p=S.getData(b);if(!p)throw at.Errors.CANT_EXTRACT_FILE();let D=g?S.header.fileAttr:void 0;i.writeFileTo(A,p,m,D);try{i.fs.utimesSync(A,S.header.time,S.header.time)}catch{throw at.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(f,m,g,b){if(b=$7(m,g,b),g=ys(!1,g),m=ys(!1,m),!b)return new Promise((y,C)=>{this.extractAllToAsync(f,m,g,function(k){k?C(k):y(this)})});if(!s){b(at.Errors.NO_ZIP());return}f=dt.resolve(f);let S=y=>a(f,dt.normalize(o(y.entryName))),A=(y,C)=>new Error(y+': "'+C+'"'),p=[],D=[];s.entries.forEach(y=>{y.isDirectory?p.push(y):D.push(y)});for(let y of p){let C=S(y),k=g?y.header.fileAttr:void 0;try{i.makeDir(C),k&&i.fs.chmodSync(C,k),i.fs.utimesSync(C,y.header.time,y.header.time)}catch{b(A("Unable to create folder",C))}}D.reverse().reduce(function(y,C){return function(k){if(k)y(k);else{let v=dt.normalize(o(C.entryName)),R=a(f,v);C.getDataAsync(function(P,F){if(F)y(F);else if(!P)y(at.Errors.CANT_EXTRACT_FILE());else{let j=g?C.header.fileAttr:void 0;i.writeFileToAsync(R,P,m,j,function(U){U||y(A("Unable to write file",R)),i.fs.utimes(R,C.header.time,C.header.time,function(G){G?y(A("Unable to set times",R)):y()})})}})}}},b)()},writeZip:function(f,m){if(arguments.length===1&&typeof f=="function"&&(m=f,f=""),!f&&n.filename&&(f=n.filename),!!f){var g=s.compressToBuffer();if(g){var b=i.writeFileTo(f,g,!0);typeof m=="function"&&m(b?null:new Error("failed"),"")}}},writeZipPromise:function(f,m){let{overwrite:g,perm:b}=Object.assign({overwrite:!0},m);return new Promise((S,A)=>{!f&&n.filename&&(f=n.filename),f||A("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(p=>{let D=y=>y?S(y):A("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(f,p,g,b,D)},A)})},toBufferPromise:function(){return new Promise((f,m)=>{s.toAsyncBuffer(f,m)})},toBuffer:function(f,m,g,b){return typeof f=="function"?(s.toAsyncBuffer(f,m,g,b),null):s.compressToBuffer()}}}});var zS=E(($ge,VS)=>{var HS={};VS.exports=HS;var US={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(US).forEach(function(t){var e=US[t],r=HS[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var KS=E((Lge,GS)=>{"use strict";GS.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var XS=E((jge,WS)=>{"use strict";var j7=require("os"),nn=KS(),rr=process.env,Mo=void 0;nn("no-color")||nn("no-colors")||nn("color=false")?Mo=!1:(nn("color")||nn("colors")||nn("color=true")||nn("color=always"))&&(Mo=!0);"FORCE_COLOR"in rr&&(Mo=rr.FORCE_COLOR.length===0||parseInt(rr.FORCE_COLOR,10)!==0);function B7(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function M7(t){if(Mo===!1)return 0;if(nn("color=16m")||nn("color=full")||nn("color=truecolor"))return 3;if(nn("color=256"))return 2;if(t&&!t.isTTY&&Mo!==!0)return 0;var e=Mo?1:0;if(process.platform==="win32"){var r=j7.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in rr)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in rr})||rr.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in rr)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(rr.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in rr){var n=parseInt((rr.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(rr.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(rr.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(rr.TERM)||"COLORTERM"in rr?1:(rr.TERM==="dumb",e)}function zy(t){var e=M7(t);return B7(e)}WS.exports={supportsColor:zy,stdout:zy(process.stdout),stderr:zy(process.stderr)}});var JS=E((Bge,YS)=>{YS.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(s){s=s.toLowerCase();var o=i[s]||[" "],a=Math.floor(Math.random()*o.length);typeof i[s]<"u"?n+=i[s][a]:n+=s}),n}});var QS=E((Mge,ZS)=>{ZS.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function s(u){var c=Math.floor(Math.random()*u);return c}function o(u){var c=!1;return i.filter(function(l){c=l===u}),c}function a(u,c){var l="",h,d;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(d in u)if(!o(d)){switch(l=l+u[d],h={up:0,down:0,mid:0},c.size){case"mini":h.up=s(8),h.mid=s(2),h.down=s(8);break;case"maxi":h.up=s(16)+3,h.mid=s(4)+1,h.down=s(64)+3;break;default:h.up=s(8)+1,h.mid=s(6)/2,h.down=s(8)+1;break}var f=["up","mid","down"];for(var m in f)for(var g=f[m],b=0;b<=h[g];b++)c[g]&&(l=l+n[g][s(n[g].length)])}return l}return a(e,r)}});var tA=E((qge,eA)=>{eA.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var nA=E((Uge,rA)=>{rA.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var sA=E((Hge,iA)=>{iA.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var aA=E((Vge,oA)=>{oA.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var dA=E((Gge,hA)=>{var be={};hA.exports=be;be.themes={};var q7=require("util"),Ds=be.styles=zS(),cA=Object.defineProperties,U7=new RegExp(/[\r\n]+/g);be.supportsColor=XS().supportsColor;typeof be.enabled>"u"&&(be.enabled=be.supportsColor()!==!1);be.enable=function(){be.enabled=!0};be.disable=function(){be.enabled=!1};be.stripColors=be.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var zge=be.stylize=function(e,r){if(!be.enabled)return e+"";var n=Ds[r];return!n&&r in be?be[r](e):n.open+e+n.close},H7=/[|\\{}()[\]^$+*?.]/g,V7=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(H7,"\\$&")};function lA(t){var e=function r(){return G7.apply(r,arguments)};return e._styles=t,e.__proto__=z7,e}var fA=(function(){var t={};return Ds.grey=Ds.gray,Object.keys(Ds).forEach(function(e){Ds[e].closeRe=new RegExp(V7(Ds[e].close),"g"),t[e]={get:function(){return lA(this._styles.concat(e))}}}),t})(),z7=cA(function(){},fA);function G7(){var t=Array.prototype.slice.call(arguments),e=t.map(function(o){return o!=null&&o.constructor===String?o:q7.inspect(o)}).join(" ");if(!be.enabled||!e)return e;for(var r=e.indexOf(`
|
|
41
|
+
`)!=-1,n=this._styles,i=n.length;i--;){var s=Ds[n[i]];e=s.open+e.replace(s.closeRe,s.open)+s.close,r&&(e=e.replace(U7,function(o){return s.close+o+s.open}))}return e}be.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){be[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var s in t[r])i=be[t[r][s]](i);return i}return be[t[r]](n)}})(e)};function K7(){var t={};return Object.keys(fA).forEach(function(e){t[e]={get:function(){return lA([e])}}}),t}var W7=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};be.trap=JS();be.zalgo=QS();be.maps={};be.maps.america=tA()(be);be.maps.zebra=nA()(be);be.maps.rainbow=sA()(be);be.maps.random=aA()(be);for(uA in be.maps)(function(t){be[t]=function(e){return W7(be.maps[t],e)}})(uA);var uA;cA(be,K7())});var mA=E((Kge,pA)=>{var X7=dA();pA.exports=X7});var gA=E(Gy=>{"use strict";Gy.indent=function(e){return new Array(e+1).join(" ")};Gy.getMaxIndexLength=function(t){var e=0;return Object.getOwnPropertyNames(t).forEach(function(r){t[r]!==void 0&&(e=Math.max(e,r.length))}),e}});var yA=E((Xge,Y7)=>{Y7.exports={author:"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)",name:"prettyjson",description:"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",version:"1.2.5",homepage:"http://rafeca.com/prettyjson",keywords:["json","cli","formatting","colors"],repository:{type:"git",url:"https://github.com/rafeca/prettyjson.git"},bugs:{url:"https://github.com/rafeca/prettyjson/issues"},main:"./lib/prettyjson",files:["bin/prettyjson","lib/*.js"],license:"MIT",scripts:{test:"npm run jshint && mocha --reporter spec",testwin:"node ./node_modules/mocha/bin/mocha --reporter spec",jshint:"jshint lib/*.js test/*.js",coverage:"istanbul cover _mocha --report lcovonly -- -R spec",coveralls:"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",changelog:"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},bin:{prettyjson:"./bin/prettyjson"},dependencies:{colors:"1.4.0",minimist:"^1.2.0"},devDependencies:{coveralls:"^2.11.15",istanbul:"^0.4.5",jshint:"^2.9.4",mocha:"^3.1.2","mocha-lcov-reporter":"^1.2.0",should:"^11.1.1"}}});var DA=E(Ru=>{"use strict";var mn=mA(),Fi=gA(),J7=/[^\w\s\n\r\v\t\.,]/i;Ru.version=yA().version;var Ky=function(t,e){return t!==void 0||e.renderUndefined},Pf=function(t,e,r){return!!(typeof t=="boolean"||typeof t=="number"||typeof t=="function"||t===null||t===void 0||t instanceof Date||typeof t=="string"&&t.indexOf(`
|
|
42
42
|
`)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&Pf(t[0],!0,r))},Z7=function(t,e){if(e.noColor)return t;if(typeof t=="string")return e.stringColor?mn[e.stringColor](t):t;var r=t+"";return t===!0?mn.green(r):t===!1?mn.red(r):t==null?mn.grey(r):typeof t=="number"?t>=0?mn[e.positiveNumberColor](r):mn[e.negativeNumberColor](r):typeof t=="function"?"function() {}":Array.isArray(t)?t.join(", "):r},Wy=function(t,e){return t.multilineStringColor===null||t.noColor?e:mn[t.multilineStringColor](e)},Q7=function(t,e,r){var n=t.split(`
|
|
43
43
|
`);return n=n.map(function(i){return Fi.indent(e)+Wy(r,i)}),n.join(`
|
|
44
44
|
`)},qo=function(t,e,r){if(typeof t=="string"&&t.match(J7)&&e.escape&&(t=JSON.stringify(t)),!Ky(t,e))return[];if(Pf(t,!1,e))return[Fi.indent(r)+Z7(t,e)];if(typeof t=="string")return[Fi.indent(r)+Wy(e,'"""'),Q7(t,r+e.defaultIndentation,e),Fi.indent(r)+Wy(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[Fi.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(a){if(Ky(a,e)){var u="- ";e.noColor||(u=mn[e.dashColor](u)),u=Fi.indent(r)+u,Pf(a,!1,e)?(u+=qo(a,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,qo(a,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return qo({message:t.message,stack:t.stack.split(`
|
|
45
45
|
`)},e,r);var i=e.noAlign?0:Fi.getMaxIndexLength(t),s,o=[];return Object.getOwnPropertyNames(t).forEach(function(a){if(Ky(t[a],e))if(s=a+": ",e.noColor||(s=mn[e.keysColor](s)),s=Fi.indent(r)+s,Pf(t[a],!1,e)){var u=e.noAlign?0:i-a.length;s+=qo(t[a],e,u)[0],o.push(s)}else o.push(s),o.push.apply(o,qo(t[a],e,r+e.defaultIndentation))}),o};Ru.render=function(e,r,n){return n=n||0,r=r||{},r.emptyArrayMsg=r.emptyArrayMsg||"(empty array)",r.keysColor=r.keysColor||"green",r.dashColor=r.dashColor||"green",r.numberColor=r.numberColor||"blue",r.positiveNumberColor=r.positiveNumberColor||r.numberColor,r.negativeNumberColor=r.negativeNumberColor||r.numberColor,r.defaultIndentation=r.defaultIndentation||2,r.noColor=!!r.noColor,r.noAlign=!!r.noAlign,r.escape=!!r.escape,r.renderUndefined=!!r.renderUndefined,r.stringColor=r.stringColor||null,r.multilineStringColor=r.multilineStringColor||null,qo(e,r,n).join(`
|
|
46
46
|
`)};Ru.renderString=function(e,r,n){var i="",s;if(typeof e!="string"||e==="")return"";if(e[0]!=="{"&&e[0]!=="["){var o;e.indexOf("{")===-1?o=e.indexOf("["):e.indexOf("[")===-1||e.indexOf("{")<e.indexOf("[")?o=e.indexOf("{"):o=e.indexOf("["),i+=e.substr(0,o)+`
|
|
47
|
-
`,e=e.substr(o)}try{s=JSON.parse(e)}catch{return mn.red("Error:")+" Not valid JSON!"}return i+=Ru.render(s,r,n),i}});var Jy=E(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.default=void 0;function Uo(t){"@babel/helpers - typeof";return Uo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uo(t)}function wA(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tH(n.key),n)}}function eH(t,e,r){return e&&wA(t.prototype,e),r&&wA(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function tH(t){var e=rH(t,"string");return Uo(e)=="symbol"?e:e+""}function rH(t,e){if(Uo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Uo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function iH(t,e,r){return e=$u(e),sH(t,Yy()?Reflect.construct(e,r||[],$u(t).constructor):e.apply(t,r))}function sH(t,e){if(e&&(Uo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oH(t)}function oH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function aH(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nu(t,e)}function Xy(t){var e=typeof Map=="function"?new Map:void 0;return Xy=function(n){if(n===null||!cH(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return uH(n,arguments,$u(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Nu(i,n)},Xy(t)}function uH(t,e,r){if(Yy())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Nu(i,r.prototype),i}function Yy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Yy=function(){return!!t})()}function cH(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Nu(t,e){return Nu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Nu(t,e)}function $u(t){return $u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$u(t)}var lH=(function(t){function e(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(nH(this,e),n=iH(this,e,[r]),n.originalRequest=s,n.originalResponse=o,n.causingError=i,i!=null&&(r+=", caused by ".concat(i.toString())),s!=null){var a=s.getHeader("X-Request-ID")||"n/a",u=s.getMethod(),c=s.getURL(),l=o?o.getStatus():"n/a",h=o?o.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(c,", response code: ").concat(l,", response text: ").concat(h,", request id: ").concat(a,")")}return n.message=r,n}return aH(e,t),eH(e)})(Xy(Error)),Zge=Rf.default=lH});var Zy=E(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.enableDebugLog=fH;Nf.log=hH;var bA=!1;function fH(){bA=!0}function hH(t){bA&&console.log(t)}});var EA=E($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.default=void 0;function Lu(t){"@babel/helpers - typeof";return Lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lu(t)}function dH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vA(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mH(n.key),n)}}function pH(t,e,r){return e&&vA(t.prototype,e),r&&vA(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function mH(t){var e=gH(t,"string");return Lu(e)=="symbol"?e:e+""}function gH(t,e){if(Lu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Lu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var tye=$f.default=(function(){function t(){dH(this,t)}return pH(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])})()});var _A=E((Qy,eD)=>{(function(t,e){typeof Qy=="object"&&typeof eD<"u"?eD.exports=e():typeof define=="function"&&define.amd?define(e):(function(){var r=t.Base64,n=e();n.noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n})()})(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Qy,function(){"use strict";var t="3.7.8",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,i=typeof TextEncoder=="function"?new TextEncoder:void 0,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=Array.prototype.slice.call(s),a=(function(q){var V={};return q.forEach(function(ae,x){return V[ae]=x}),V})(o),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),l=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(q){return new Uint8Array(Array.prototype.slice.call(q,0))},h=function(q){return q.replace(/=/g,"").replace(/[+\/]/g,function(V){return V=="+"?"-":"_"})},d=function(q){return q.replace(/[^A-Za-z0-9\+\/]/g,"")},f=function(q){for(var V,ae,x,O,H="",N=q.length%3,re=0;re<q.length;){if((ae=q.charCodeAt(re++))>255||(x=q.charCodeAt(re++))>255||(O=q.charCodeAt(re++))>255)throw new TypeError("invalid character found");V=ae<<16|x<<8|O,H+=o[V>>18&63]+o[V>>12&63]+o[V>>6&63]+o[V&63]}return N?H.slice(0,N-3)+"===".substring(N):H},m=typeof btoa=="function"?function(q){return btoa(q)}:r?function(q){return Buffer.from(q,"binary").toString("base64")}:f,g=r?function(q){return Buffer.from(q).toString("base64")}:function(q){for(var V=4096,ae=[],x=0,O=q.length;x<O;x+=V)ae.push(c.apply(null,q.subarray(x,x+V)));return m(ae.join(""))},b=function(q,V){return V===void 0&&(V=!1),V?h(g(q)):g(q)},S=function(q){if(q.length<2){var V=q.charCodeAt(0);return V<128?q:V<2048?c(192|V>>>6)+c(128|V&63):c(224|V>>>12&15)+c(128|V>>>6&63)+c(128|V&63)}else{var V=65536+(q.charCodeAt(0)-55296)*1024+(q.charCodeAt(1)-56320);return c(240|V>>>18&7)+c(128|V>>>12&63)+c(128|V>>>6&63)+c(128|V&63)}},A=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,p=function(q){return q.replace(A,S)},D=r?function(q){return Buffer.from(q,"utf8").toString("base64")}:i?function(q){return g(i.encode(q))}:function(q){return m(p(q))},y=function(q,V){return V===void 0&&(V=!1),V?h(D(q)):D(q)},C=function(q){return y(q,!0)},k=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(q){switch(q.length){case 4:var V=(7&q.charCodeAt(0))<<18|(63&q.charCodeAt(1))<<12|(63&q.charCodeAt(2))<<6|63&q.charCodeAt(3),ae=V-65536;return c((ae>>>10)+55296)+c((ae&1023)+56320);case 3:return c((15&q.charCodeAt(0))<<12|(63&q.charCodeAt(1))<<6|63&q.charCodeAt(2));default:return c((31&q.charCodeAt(0))<<6|63&q.charCodeAt(1))}},R=function(q){return q.replace(k,v)},P=function(q){if(q=q.replace(/\s+/g,""),!u.test(q))throw new TypeError("malformed base64.");q+="==".slice(2-(q.length&3));for(var V,ae,x,O=[],H=0;H<q.length;)V=a[q.charAt(H++)]<<18|a[q.charAt(H++)]<<12|(ae=a[q.charAt(H++)])<<6|(x=a[q.charAt(H++)]),ae===64?O.push(c(V>>16&255)):x===64?O.push(c(V>>16&255,V>>8&255)):O.push(c(V>>16&255,V>>8&255,V&255));return O.join("")},F=typeof atob=="function"?function(q){return atob(d(q))}:r?function(q){return Buffer.from(q,"base64").toString("binary")}:P,j=r?function(q){return l(Buffer.from(q,"base64"))}:function(q){return l(F(q).split("").map(function(V){return V.charCodeAt(0)}))},U=function(q){return j(L(q))},G=r?function(q){return Buffer.from(q,"base64").toString("utf8")}:n?function(q){return n.decode(j(q))}:function(q){return R(F(q))},L=function(q){return d(q.replace(/[-_]/g,function(V){return V=="-"?"+":"/"}))},_=function(q){return G(L(q))},T=function(q){if(typeof q!="string")return!1;var V=q.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(V)||!/[^\s0-9a-zA-Z\-_]/.test(V)},I=function(q){return{value:q,enumerable:!1,writable:!0,configurable:!0}},$=function(){var q=function(V,ae){return Object.defineProperty(String.prototype,V,I(ae))};q("fromBase64",function(){return _(this)}),q("toBase64",function(V){return y(this,V)}),q("toBase64URI",function(){return y(this,!0)}),q("toBase64URL",function(){return y(this,!0)}),q("toUint8Array",function(){return U(this)})},M=function(){var q=function(V,ae){return Object.defineProperty(Uint8Array.prototype,V,I(ae))};q("toBase64",function(V){return b(this,V)}),q("toBase64URI",function(){return b(this,!0)}),q("toBase64URL",function(){return b(this,!0)})},B=function(){$(),M()},K={version:t,VERSION:e,atob:F,atobPolyfill:P,btoa:m,btoaPolyfill:f,fromBase64:_,toBase64:y,encode:y,encodeURI:C,encodeURL:C,utob:p,btou:R,decode:_,isValid:T,fromUint8Array:b,toUint8Array:U,extendString:$,extendUint8Array:M,extendBuiltins:B};return K.Base64={},Object.keys(K).forEach(function(q){return K.Base64[q]=K[q]}),K})});var SA=E((nye,CA)=>{"use strict";CA.exports=function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var xA=E(tD=>{"use strict";var yH=Object.prototype.hasOwnProperty,DH;function AA(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function OA(t){try{return encodeURIComponent(t)}catch{return null}}function wH(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=AA(n[1]),s=AA(n[2]);i===null||s===null||i in r||(r[i]=s)}return r}function bH(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(yH.call(t,i)){if(n=t[i],!n&&(n===null||n===DH||isNaN(n))&&(n=""),i=OA(i),n=OA(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}tD.stringify=bH;tD.parse=wH});var $A=E((sye,NA)=>{"use strict";var FA=SA(),Lf=xA(),vH=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,IA=/[\n\r\t]/g,EH=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,kA=/:\d+$/,_H=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,CH=/^[a-zA-Z]:/;function nD(t){return(t||"").toString().replace(vH,"")}var rD=[["#","hash"],["?","query"],function(e,r){return gn(r.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],TA={hash:1,query:1};function PA(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},i=typeof t,s;if(t.protocol==="blob:")n=new yn(unescape(t.pathname),{});else if(i==="string"){n=new yn(t,{});for(s in TA)delete n[s]}else if(i==="object"){for(s in t)s in TA||(n[s]=t[s]);n.slashes===void 0&&(n.slashes=EH.test(t.href))}return n}function gn(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function RA(t,e){t=nD(t),t=t.replace(IA,""),e=e||{};var r=_H.exec(t),n=r[1]?r[1].toLowerCase():"",i=!!r[2],s=!!r[3],o=0,a;return i?s?(a=r[2]+r[3]+r[4],o=r[2].length+r[3].length):(a=r[2]+r[4],o=r[2].length):s?(a=r[3]+r[4],o=r[3].length):a=r[4],n==="file:"?o>=2&&(a=a.slice(2)):gn(n)?a=r[4]:n?i&&(a=a.slice(2)):o>=2&&gn(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||gn(n),slashesCount:o,rest:a}}function SH(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],s=!1,o=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),o++):o&&(n===0&&(s=!0),r.splice(n,1),o--);return s&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function yn(t,e,r){if(t=nD(t),t=t.replace(IA,""),!(this instanceof yn))return new yn(t,e,r);var n,i,s,o,a,u,c=rD.slice(),l=typeof e,h=this,d=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=Lf.parse),e=PA(e),i=RA(t||"",e),n=!i.protocol&&!i.slashes,h.slashes=i.slashes||n&&e.slashes,h.protocol=i.protocol||e.protocol||"",t=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||CH.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!gn(h.protocol)))&&(c[3]=[/(.*)/,"pathname"]);d<c.length;d++){if(o=c[d],typeof o=="function"){t=o(t,h);continue}s=o[0],u=o[1],s!==s?h[u]=t:typeof s=="string"?(a=s==="@"?t.lastIndexOf(s):t.indexOf(s),~a&&(typeof o[2]=="number"?(h[u]=t.slice(0,a),t=t.slice(a+o[2])):(h[u]=t.slice(a),t=t.slice(0,a)))):(a=s.exec(t))&&(h[u]=a[1],t=t.slice(0,a.index)),h[u]=h[u]||n&&o[3]&&e[u]||"",o[4]&&(h[u]=h[u].toLowerCase())}r&&(h.query=r(h.query)),n&&e.slashes&&h.pathname.charAt(0)!=="/"&&(h.pathname!==""||e.pathname!=="")&&(h.pathname=SH(h.pathname,e.pathname)),h.pathname.charAt(0)!=="/"&&gn(h.protocol)&&(h.pathname="/"+h.pathname),FA(h.port,h.protocol)||(h.host=h.hostname,h.port=""),h.username=h.password="",h.auth&&(a=h.auth.indexOf(":"),~a?(h.username=h.auth.slice(0,a),h.username=encodeURIComponent(decodeURIComponent(h.username)),h.password=h.auth.slice(a+1),h.password=encodeURIComponent(decodeURIComponent(h.password))):h.username=encodeURIComponent(decodeURIComponent(h.auth)),h.auth=h.password?h.username+":"+h.password:h.username),h.origin=h.protocol!=="file:"&&gn(h.protocol)&&h.host?h.protocol+"//"+h.host:"null",h.href=h.toString()}function AH(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||Lf.parse)(e)),n[t]=e;break;case"port":n[t]=e,FA(e,n.protocol)?e&&(n.host=n.hostname+":"+e):(n.host=n.hostname,n[t]="");break;case"hostname":n[t]=e,n.port&&(e+=":"+n.port),n.host=e;break;case"host":n[t]=e,kA.test(e)?(e=e.split(":"),n.port=e.pop(),n.hostname=e.join(":")):(n.hostname=e,n.port="");break;case"protocol":n.protocol=e.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(e){var i=t==="pathname"?"/":"#";n[t]=e.charAt(0)!==i?i+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var s=e.indexOf(":");~s?(n.username=e.slice(0,s),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(s+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var o=0;o<rD.length;o++){var a=rD[o];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&gn(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function OH(t){(!t||typeof t!="function")&&(t=Lf.stringify);var e,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var s=i+(r.protocol&&r.slashes||gn(r.protocol)?"//":"");return r.username?(s+=r.username,r.password&&(s+=":"+r.password),s+="@"):r.password?(s+=":"+r.password,s+="@"):r.protocol!=="file:"&&gn(r.protocol)&&!n&&r.pathname!=="/"&&(s+="@"),(n[n.length-1]===":"||kA.test(r.hostname)&&!r.port)&&(n+=":"),s+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(s+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(s+=r.hash),s}yn.prototype={set:AH,toString:OH};yn.extractProtocol=RA;yn.location=PA;yn.trimLeft=nD;yn.qs=Lf;NA.exports=yn});var LA=E(iD=>{"use strict";Object.defineProperty(iD,"__esModule",{value:!0});iD.default=xH;function xH(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t==="x"?e:e&3|8;return r.toString(16)})}});var ZA=E(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.default=void 0;var TH=_A(),FH=aD($A()),jf=aD(Jy()),ws=Zy(),IH=aD(LA());function aD(t){return t&&t.__esModule?t:{default:t}}function sD(){"use strict";sD=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(_,T,I){_[T]=I.value},s=typeof Symbol=="function"?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function c(_,T,I){return Object.defineProperty(_,T,{value:I,enumerable:!0,configurable:!0,writable:!0}),_[T]}try{c({},"")}catch{c=function(I,$,M){return I[$]=M}}function l(_,T,I,$){var M=T&&T.prototype instanceof S?T:S,B=Object.create(M.prototype),K=new G($||[]);return i(B,"_invoke",{value:P(_,I,K)}),B}function h(_,T,I){try{return{type:"normal",arg:_.call(T,I)}}catch($){return{type:"throw",arg:$}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",m="executing",g="completed",b={};function S(){}function A(){}function p(){}var D={};c(D,o,function(){return this});var y=Object.getPrototypeOf,C=y&&y(y(L([])));C&&C!==r&&n.call(C,o)&&(D=C);var k=p.prototype=S.prototype=Object.create(D);function v(_){["next","throw","return"].forEach(function(T){c(_,T,function(I){return this._invoke(T,I)})})}function R(_,T){function I(M,B,K,q){var V=h(_[M],_,B);if(V.type!=="throw"){var ae=V.arg,x=ae.value;return x&&bs(x)=="object"&&n.call(x,"__await")?T.resolve(x.__await).then(function(O){I("next",O,K,q)},function(O){I("throw",O,K,q)}):T.resolve(x).then(function(O){ae.value=O,K(ae)},function(O){return I("throw",O,K,q)})}q(V.arg)}var $;i(this,"_invoke",{value:function(B,K){function q(){return new T(function(V,ae){I(B,K,V,ae)})}return $=$?$.then(q,q):q()}})}function P(_,T,I){var $=d;return function(M,B){if($===m)throw Error("Generator is already running");if($===g){if(M==="throw")throw B;return{value:t,done:!0}}for(I.method=M,I.arg=B;;){var K=I.delegate;if(K){var q=F(K,I);if(q){if(q===b)continue;return q}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if($===d)throw $=g,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);$=m;var V=h(_,T,I);if(V.type==="normal"){if($=I.done?g:f,V.arg===b)continue;return{value:V.arg,done:I.done}}V.type==="throw"&&($=g,I.method="throw",I.arg=V.arg)}}}function F(_,T){var I=T.method,$=_.iterator[I];if($===t)return T.delegate=null,I==="throw"&&_.iterator.return&&(T.method="return",T.arg=t,F(_,T),T.method==="throw")||I!=="return"&&(T.method="throw",T.arg=new TypeError("The iterator does not provide a '"+I+"' method")),b;var M=h($,_.iterator,T.arg);if(M.type==="throw")return T.method="throw",T.arg=M.arg,T.delegate=null,b;var B=M.arg;return B?B.done?(T[_.resultName]=B.value,T.next=_.nextLoc,T.method!=="return"&&(T.method="next",T.arg=t),T.delegate=null,b):B:(T.method="throw",T.arg=new TypeError("iterator result is not an object"),T.delegate=null,b)}function j(_){var T={tryLoc:_[0]};1 in _&&(T.catchLoc=_[1]),2 in _&&(T.finallyLoc=_[2],T.afterLoc=_[3]),this.tryEntries.push(T)}function U(_){var T=_.completion||{};T.type="normal",delete T.arg,_.completion=T}function G(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(j,this),this.reset(!0)}function L(_){if(_||_===""){var T=_[o];if(T)return T.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var I=-1,$=function M(){for(;++I<_.length;)if(n.call(_,I))return M.value=_[I],M.done=!1,M;return M.value=t,M.done=!0,M};return $.next=$}}throw new TypeError(bs(_)+" is not iterable")}return A.prototype=p,i(k,"constructor",{value:p,configurable:!0}),i(p,"constructor",{value:A,configurable:!0}),A.displayName=c(p,u,"GeneratorFunction"),e.isGeneratorFunction=function(_){var T=typeof _=="function"&&_.constructor;return!!T&&(T===A||(T.displayName||T.name)==="GeneratorFunction")},e.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,p):(_.__proto__=p,c(_,u,"GeneratorFunction")),_.prototype=Object.create(k),_},e.awrap=function(_){return{__await:_}},v(R.prototype),c(R.prototype,a,function(){return this}),e.AsyncIterator=R,e.async=function(_,T,I,$,M){M===void 0&&(M=Promise);var B=new R(l(_,T,I,$),M);return e.isGeneratorFunction(T)?B:B.next().then(function(K){return K.done?K.value:B.next()})},v(k),c(k,u,"Generator"),c(k,o,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(_){var T=Object(_),I=[];for(var $ in T)I.push($);return I.reverse(),function M(){for(;I.length;){var B=I.pop();if(B in T)return M.value=B,M.done=!1,M}return M.done=!0,M}},e.values=L,G.prototype={constructor:G,reset:function(T){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(U),!T)for(var I in this)I.charAt(0)==="t"&&n.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=t)},stop:function(){this.done=!0;var T=this.tryEntries[0].completion;if(T.type==="throw")throw T.arg;return this.rval},dispatchException:function(T){if(this.done)throw T;var I=this;function $(ae,x){return K.type="throw",K.arg=T,I.next=ae,x&&(I.method="next",I.arg=t),!!x}for(var M=this.tryEntries.length-1;M>=0;--M){var B=this.tryEntries[M],K=B.completion;if(B.tryLoc==="root")return $("end");if(B.tryLoc<=this.prev){var q=n.call(B,"catchLoc"),V=n.call(B,"finallyLoc");if(q&&V){if(this.prev<B.catchLoc)return $(B.catchLoc,!0);if(this.prev<B.finallyLoc)return $(B.finallyLoc)}else if(q){if(this.prev<B.catchLoc)return $(B.catchLoc,!0)}else{if(!V)throw Error("try statement without catch or finally");if(this.prev<B.finallyLoc)return $(B.finallyLoc)}}}},abrupt:function(T,I){for(var $=this.tryEntries.length-1;$>=0;--$){var M=this.tryEntries[$];if(M.tryLoc<=this.prev&&n.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var B=M;break}}B&&(T==="break"||T==="continue")&&B.tryLoc<=I&&I<=B.finallyLoc&&(B=null);var K=B?B.completion:{};return K.type=T,K.arg=I,B?(this.method="next",this.next=B.finallyLoc,b):this.complete(K)},complete:function(T,I){if(T.type==="throw")throw T.arg;return T.type==="break"||T.type==="continue"?this.next=T.arg:T.type==="return"?(this.rval=this.arg=T.arg,this.method="return",this.next="end"):T.type==="normal"&&I&&(this.next=I),b},finish:function(T){for(var I=this.tryEntries.length-1;I>=0;--I){var $=this.tryEntries[I];if($.finallyLoc===T)return this.complete($.completion,$.afterLoc),U($),b}},catch:function(T){for(var I=this.tryEntries.length-1;I>=0;--I){var $=this.tryEntries[I];if($.tryLoc===T){var M=$.completion;if(M.type==="throw"){var B=M.arg;U($)}return B}}throw Error("illegal catch attempt")},delegateYield:function(T,I,$){return this.delegate={iterator:L(T),resultName:I,nextLoc:$},this.method==="next"&&(this.arg=t),b}},e}function jA(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function kH(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(u){jA(s,n,i,o,a,"next",u)}function a(u){jA(s,n,i,o,a,"throw",u)}o(void 0)})}}function KA(t,e){return NH(t)||RH(t,e)||WA(t,e)||PH()}function PH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
47
|
+
`,e=e.substr(o)}try{s=JSON.parse(e)}catch{return mn.red("Error:")+" Not valid JSON!"}return i+=Ru.render(s,r,n),i}});var Jy=E(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.default=void 0;function Uo(t){"@babel/helpers - typeof";return Uo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uo(t)}function wA(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tH(n.key),n)}}function eH(t,e,r){return e&&wA(t.prototype,e),r&&wA(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function tH(t){var e=rH(t,"string");return Uo(e)=="symbol"?e:e+""}function rH(t,e){if(Uo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Uo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function iH(t,e,r){return e=$u(e),sH(t,Yy()?Reflect.construct(e,r||[],$u(t).constructor):e.apply(t,r))}function sH(t,e){if(e&&(Uo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oH(t)}function oH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function aH(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nu(t,e)}function Xy(t){var e=typeof Map=="function"?new Map:void 0;return Xy=function(n){if(n===null||!cH(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return uH(n,arguments,$u(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Nu(i,n)},Xy(t)}function uH(t,e,r){if(Yy())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Nu(i,r.prototype),i}function Yy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Yy=function(){return!!t})()}function cH(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Nu(t,e){return Nu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Nu(t,e)}function $u(t){return $u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$u(t)}var lH=(function(t){function e(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(nH(this,e),n=iH(this,e,[r]),n.originalRequest=s,n.originalResponse=o,n.causingError=i,i!=null&&(r+=", caused by ".concat(i.toString())),s!=null){var a=s.getHeader("X-Request-ID")||"n/a",u=s.getMethod(),c=s.getURL(),l=o?o.getStatus():"n/a",h=o?o.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(c,", response code: ").concat(l,", response text: ").concat(h,", request id: ").concat(a,")")}return n.message=r,n}return aH(e,t),eH(e)})(Xy(Error)),Jge=Rf.default=lH});var Zy=E(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.enableDebugLog=fH;Nf.log=hH;var bA=!1;function fH(){bA=!0}function hH(t){bA&&console.log(t)}});var EA=E($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.default=void 0;function Lu(t){"@babel/helpers - typeof";return Lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lu(t)}function dH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vA(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mH(n.key),n)}}function pH(t,e,r){return e&&vA(t.prototype,e),r&&vA(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function mH(t){var e=gH(t,"string");return Lu(e)=="symbol"?e:e+""}function gH(t,e){if(Lu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Lu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var eye=$f.default=(function(){function t(){dH(this,t)}return pH(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])})()});var _A=E((Qy,eD)=>{(function(t,e){typeof Qy=="object"&&typeof eD<"u"?eD.exports=e():typeof define=="function"&&define.amd?define(e):(function(){var r=t.Base64,n=e();n.noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n})()})(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Qy,function(){"use strict";var t="3.7.8",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,i=typeof TextEncoder=="function"?new TextEncoder:void 0,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=Array.prototype.slice.call(s),a=(function(q){var V={};return q.forEach(function(ae,x){return V[ae]=x}),V})(o),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),l=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(q){return new Uint8Array(Array.prototype.slice.call(q,0))},h=function(q){return q.replace(/=/g,"").replace(/[+\/]/g,function(V){return V=="+"?"-":"_"})},d=function(q){return q.replace(/[^A-Za-z0-9\+\/]/g,"")},f=function(q){for(var V,ae,x,O,H="",N=q.length%3,re=0;re<q.length;){if((ae=q.charCodeAt(re++))>255||(x=q.charCodeAt(re++))>255||(O=q.charCodeAt(re++))>255)throw new TypeError("invalid character found");V=ae<<16|x<<8|O,H+=o[V>>18&63]+o[V>>12&63]+o[V>>6&63]+o[V&63]}return N?H.slice(0,N-3)+"===".substring(N):H},m=typeof btoa=="function"?function(q){return btoa(q)}:r?function(q){return Buffer.from(q,"binary").toString("base64")}:f,g=r?function(q){return Buffer.from(q).toString("base64")}:function(q){for(var V=4096,ae=[],x=0,O=q.length;x<O;x+=V)ae.push(c.apply(null,q.subarray(x,x+V)));return m(ae.join(""))},b=function(q,V){return V===void 0&&(V=!1),V?h(g(q)):g(q)},S=function(q){if(q.length<2){var V=q.charCodeAt(0);return V<128?q:V<2048?c(192|V>>>6)+c(128|V&63):c(224|V>>>12&15)+c(128|V>>>6&63)+c(128|V&63)}else{var V=65536+(q.charCodeAt(0)-55296)*1024+(q.charCodeAt(1)-56320);return c(240|V>>>18&7)+c(128|V>>>12&63)+c(128|V>>>6&63)+c(128|V&63)}},A=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,p=function(q){return q.replace(A,S)},D=r?function(q){return Buffer.from(q,"utf8").toString("base64")}:i?function(q){return g(i.encode(q))}:function(q){return m(p(q))},y=function(q,V){return V===void 0&&(V=!1),V?h(D(q)):D(q)},C=function(q){return y(q,!0)},k=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(q){switch(q.length){case 4:var V=(7&q.charCodeAt(0))<<18|(63&q.charCodeAt(1))<<12|(63&q.charCodeAt(2))<<6|63&q.charCodeAt(3),ae=V-65536;return c((ae>>>10)+55296)+c((ae&1023)+56320);case 3:return c((15&q.charCodeAt(0))<<12|(63&q.charCodeAt(1))<<6|63&q.charCodeAt(2));default:return c((31&q.charCodeAt(0))<<6|63&q.charCodeAt(1))}},R=function(q){return q.replace(k,v)},P=function(q){if(q=q.replace(/\s+/g,""),!u.test(q))throw new TypeError("malformed base64.");q+="==".slice(2-(q.length&3));for(var V,ae,x,O=[],H=0;H<q.length;)V=a[q.charAt(H++)]<<18|a[q.charAt(H++)]<<12|(ae=a[q.charAt(H++)])<<6|(x=a[q.charAt(H++)]),ae===64?O.push(c(V>>16&255)):x===64?O.push(c(V>>16&255,V>>8&255)):O.push(c(V>>16&255,V>>8&255,V&255));return O.join("")},F=typeof atob=="function"?function(q){return atob(d(q))}:r?function(q){return Buffer.from(q,"base64").toString("binary")}:P,j=r?function(q){return l(Buffer.from(q,"base64"))}:function(q){return l(F(q).split("").map(function(V){return V.charCodeAt(0)}))},U=function(q){return j(L(q))},G=r?function(q){return Buffer.from(q,"base64").toString("utf8")}:n?function(q){return n.decode(j(q))}:function(q){return R(F(q))},L=function(q){return d(q.replace(/[-_]/g,function(V){return V=="-"?"+":"/"}))},_=function(q){return G(L(q))},T=function(q){if(typeof q!="string")return!1;var V=q.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(V)||!/[^\s0-9a-zA-Z\-_]/.test(V)},I=function(q){return{value:q,enumerable:!1,writable:!0,configurable:!0}},$=function(){var q=function(V,ae){return Object.defineProperty(String.prototype,V,I(ae))};q("fromBase64",function(){return _(this)}),q("toBase64",function(V){return y(this,V)}),q("toBase64URI",function(){return y(this,!0)}),q("toBase64URL",function(){return y(this,!0)}),q("toUint8Array",function(){return U(this)})},M=function(){var q=function(V,ae){return Object.defineProperty(Uint8Array.prototype,V,I(ae))};q("toBase64",function(V){return b(this,V)}),q("toBase64URI",function(){return b(this,!0)}),q("toBase64URL",function(){return b(this,!0)})},B=function(){$(),M()},K={version:t,VERSION:e,atob:F,atobPolyfill:P,btoa:m,btoaPolyfill:f,fromBase64:_,toBase64:y,encode:y,encodeURI:C,encodeURL:C,utob:p,btou:R,decode:_,isValid:T,fromUint8Array:b,toUint8Array:U,extendString:$,extendUint8Array:M,extendBuiltins:B};return K.Base64={},Object.keys(K).forEach(function(q){return K.Base64[q]=K[q]}),K})});var SA=E((rye,CA)=>{"use strict";CA.exports=function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var xA=E(tD=>{"use strict";var yH=Object.prototype.hasOwnProperty,DH;function AA(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function OA(t){try{return encodeURIComponent(t)}catch{return null}}function wH(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=AA(n[1]),s=AA(n[2]);i===null||s===null||i in r||(r[i]=s)}return r}function bH(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(yH.call(t,i)){if(n=t[i],!n&&(n===null||n===DH||isNaN(n))&&(n=""),i=OA(i),n=OA(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}tD.stringify=bH;tD.parse=wH});var $A=E((iye,NA)=>{"use strict";var FA=SA(),Lf=xA(),vH=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,IA=/[\n\r\t]/g,EH=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,kA=/:\d+$/,_H=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,CH=/^[a-zA-Z]:/;function nD(t){return(t||"").toString().replace(vH,"")}var rD=[["#","hash"],["?","query"],function(e,r){return gn(r.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],TA={hash:1,query:1};function PA(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},i=typeof t,s;if(t.protocol==="blob:")n=new yn(unescape(t.pathname),{});else if(i==="string"){n=new yn(t,{});for(s in TA)delete n[s]}else if(i==="object"){for(s in t)s in TA||(n[s]=t[s]);n.slashes===void 0&&(n.slashes=EH.test(t.href))}return n}function gn(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function RA(t,e){t=nD(t),t=t.replace(IA,""),e=e||{};var r=_H.exec(t),n=r[1]?r[1].toLowerCase():"",i=!!r[2],s=!!r[3],o=0,a;return i?s?(a=r[2]+r[3]+r[4],o=r[2].length+r[3].length):(a=r[2]+r[4],o=r[2].length):s?(a=r[3]+r[4],o=r[3].length):a=r[4],n==="file:"?o>=2&&(a=a.slice(2)):gn(n)?a=r[4]:n?i&&(a=a.slice(2)):o>=2&&gn(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||gn(n),slashesCount:o,rest:a}}function SH(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],s=!1,o=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),o++):o&&(n===0&&(s=!0),r.splice(n,1),o--);return s&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function yn(t,e,r){if(t=nD(t),t=t.replace(IA,""),!(this instanceof yn))return new yn(t,e,r);var n,i,s,o,a,u,c=rD.slice(),l=typeof e,h=this,d=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=Lf.parse),e=PA(e),i=RA(t||"",e),n=!i.protocol&&!i.slashes,h.slashes=i.slashes||n&&e.slashes,h.protocol=i.protocol||e.protocol||"",t=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||CH.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!gn(h.protocol)))&&(c[3]=[/(.*)/,"pathname"]);d<c.length;d++){if(o=c[d],typeof o=="function"){t=o(t,h);continue}s=o[0],u=o[1],s!==s?h[u]=t:typeof s=="string"?(a=s==="@"?t.lastIndexOf(s):t.indexOf(s),~a&&(typeof o[2]=="number"?(h[u]=t.slice(0,a),t=t.slice(a+o[2])):(h[u]=t.slice(a),t=t.slice(0,a)))):(a=s.exec(t))&&(h[u]=a[1],t=t.slice(0,a.index)),h[u]=h[u]||n&&o[3]&&e[u]||"",o[4]&&(h[u]=h[u].toLowerCase())}r&&(h.query=r(h.query)),n&&e.slashes&&h.pathname.charAt(0)!=="/"&&(h.pathname!==""||e.pathname!=="")&&(h.pathname=SH(h.pathname,e.pathname)),h.pathname.charAt(0)!=="/"&&gn(h.protocol)&&(h.pathname="/"+h.pathname),FA(h.port,h.protocol)||(h.host=h.hostname,h.port=""),h.username=h.password="",h.auth&&(a=h.auth.indexOf(":"),~a?(h.username=h.auth.slice(0,a),h.username=encodeURIComponent(decodeURIComponent(h.username)),h.password=h.auth.slice(a+1),h.password=encodeURIComponent(decodeURIComponent(h.password))):h.username=encodeURIComponent(decodeURIComponent(h.auth)),h.auth=h.password?h.username+":"+h.password:h.username),h.origin=h.protocol!=="file:"&&gn(h.protocol)&&h.host?h.protocol+"//"+h.host:"null",h.href=h.toString()}function AH(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||Lf.parse)(e)),n[t]=e;break;case"port":n[t]=e,FA(e,n.protocol)?e&&(n.host=n.hostname+":"+e):(n.host=n.hostname,n[t]="");break;case"hostname":n[t]=e,n.port&&(e+=":"+n.port),n.host=e;break;case"host":n[t]=e,kA.test(e)?(e=e.split(":"),n.port=e.pop(),n.hostname=e.join(":")):(n.hostname=e,n.port="");break;case"protocol":n.protocol=e.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(e){var i=t==="pathname"?"/":"#";n[t]=e.charAt(0)!==i?i+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var s=e.indexOf(":");~s?(n.username=e.slice(0,s),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(s+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var o=0;o<rD.length;o++){var a=rD[o];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&gn(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function OH(t){(!t||typeof t!="function")&&(t=Lf.stringify);var e,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var s=i+(r.protocol&&r.slashes||gn(r.protocol)?"//":"");return r.username?(s+=r.username,r.password&&(s+=":"+r.password),s+="@"):r.password?(s+=":"+r.password,s+="@"):r.protocol!=="file:"&&gn(r.protocol)&&!n&&r.pathname!=="/"&&(s+="@"),(n[n.length-1]===":"||kA.test(r.hostname)&&!r.port)&&(n+=":"),s+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(s+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(s+=r.hash),s}yn.prototype={set:AH,toString:OH};yn.extractProtocol=RA;yn.location=PA;yn.trimLeft=nD;yn.qs=Lf;NA.exports=yn});var LA=E(iD=>{"use strict";Object.defineProperty(iD,"__esModule",{value:!0});iD.default=xH;function xH(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t==="x"?e:e&3|8;return r.toString(16)})}});var ZA=E(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.default=void 0;var TH=_A(),FH=aD($A()),jf=aD(Jy()),ws=Zy(),IH=aD(LA());function aD(t){return t&&t.__esModule?t:{default:t}}function sD(){"use strict";sD=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(_,T,I){_[T]=I.value},s=typeof Symbol=="function"?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function c(_,T,I){return Object.defineProperty(_,T,{value:I,enumerable:!0,configurable:!0,writable:!0}),_[T]}try{c({},"")}catch{c=function(I,$,M){return I[$]=M}}function l(_,T,I,$){var M=T&&T.prototype instanceof S?T:S,B=Object.create(M.prototype),K=new G($||[]);return i(B,"_invoke",{value:P(_,I,K)}),B}function h(_,T,I){try{return{type:"normal",arg:_.call(T,I)}}catch($){return{type:"throw",arg:$}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",m="executing",g="completed",b={};function S(){}function A(){}function p(){}var D={};c(D,o,function(){return this});var y=Object.getPrototypeOf,C=y&&y(y(L([])));C&&C!==r&&n.call(C,o)&&(D=C);var k=p.prototype=S.prototype=Object.create(D);function v(_){["next","throw","return"].forEach(function(T){c(_,T,function(I){return this._invoke(T,I)})})}function R(_,T){function I(M,B,K,q){var V=h(_[M],_,B);if(V.type!=="throw"){var ae=V.arg,x=ae.value;return x&&bs(x)=="object"&&n.call(x,"__await")?T.resolve(x.__await).then(function(O){I("next",O,K,q)},function(O){I("throw",O,K,q)}):T.resolve(x).then(function(O){ae.value=O,K(ae)},function(O){return I("throw",O,K,q)})}q(V.arg)}var $;i(this,"_invoke",{value:function(B,K){function q(){return new T(function(V,ae){I(B,K,V,ae)})}return $=$?$.then(q,q):q()}})}function P(_,T,I){var $=d;return function(M,B){if($===m)throw Error("Generator is already running");if($===g){if(M==="throw")throw B;return{value:t,done:!0}}for(I.method=M,I.arg=B;;){var K=I.delegate;if(K){var q=F(K,I);if(q){if(q===b)continue;return q}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if($===d)throw $=g,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);$=m;var V=h(_,T,I);if(V.type==="normal"){if($=I.done?g:f,V.arg===b)continue;return{value:V.arg,done:I.done}}V.type==="throw"&&($=g,I.method="throw",I.arg=V.arg)}}}function F(_,T){var I=T.method,$=_.iterator[I];if($===t)return T.delegate=null,I==="throw"&&_.iterator.return&&(T.method="return",T.arg=t,F(_,T),T.method==="throw")||I!=="return"&&(T.method="throw",T.arg=new TypeError("The iterator does not provide a '"+I+"' method")),b;var M=h($,_.iterator,T.arg);if(M.type==="throw")return T.method="throw",T.arg=M.arg,T.delegate=null,b;var B=M.arg;return B?B.done?(T[_.resultName]=B.value,T.next=_.nextLoc,T.method!=="return"&&(T.method="next",T.arg=t),T.delegate=null,b):B:(T.method="throw",T.arg=new TypeError("iterator result is not an object"),T.delegate=null,b)}function j(_){var T={tryLoc:_[0]};1 in _&&(T.catchLoc=_[1]),2 in _&&(T.finallyLoc=_[2],T.afterLoc=_[3]),this.tryEntries.push(T)}function U(_){var T=_.completion||{};T.type="normal",delete T.arg,_.completion=T}function G(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(j,this),this.reset(!0)}function L(_){if(_||_===""){var T=_[o];if(T)return T.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var I=-1,$=function M(){for(;++I<_.length;)if(n.call(_,I))return M.value=_[I],M.done=!1,M;return M.value=t,M.done=!0,M};return $.next=$}}throw new TypeError(bs(_)+" is not iterable")}return A.prototype=p,i(k,"constructor",{value:p,configurable:!0}),i(p,"constructor",{value:A,configurable:!0}),A.displayName=c(p,u,"GeneratorFunction"),e.isGeneratorFunction=function(_){var T=typeof _=="function"&&_.constructor;return!!T&&(T===A||(T.displayName||T.name)==="GeneratorFunction")},e.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,p):(_.__proto__=p,c(_,u,"GeneratorFunction")),_.prototype=Object.create(k),_},e.awrap=function(_){return{__await:_}},v(R.prototype),c(R.prototype,a,function(){return this}),e.AsyncIterator=R,e.async=function(_,T,I,$,M){M===void 0&&(M=Promise);var B=new R(l(_,T,I,$),M);return e.isGeneratorFunction(T)?B:B.next().then(function(K){return K.done?K.value:B.next()})},v(k),c(k,u,"Generator"),c(k,o,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(_){var T=Object(_),I=[];for(var $ in T)I.push($);return I.reverse(),function M(){for(;I.length;){var B=I.pop();if(B in T)return M.value=B,M.done=!1,M}return M.done=!0,M}},e.values=L,G.prototype={constructor:G,reset:function(T){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(U),!T)for(var I in this)I.charAt(0)==="t"&&n.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=t)},stop:function(){this.done=!0;var T=this.tryEntries[0].completion;if(T.type==="throw")throw T.arg;return this.rval},dispatchException:function(T){if(this.done)throw T;var I=this;function $(ae,x){return K.type="throw",K.arg=T,I.next=ae,x&&(I.method="next",I.arg=t),!!x}for(var M=this.tryEntries.length-1;M>=0;--M){var B=this.tryEntries[M],K=B.completion;if(B.tryLoc==="root")return $("end");if(B.tryLoc<=this.prev){var q=n.call(B,"catchLoc"),V=n.call(B,"finallyLoc");if(q&&V){if(this.prev<B.catchLoc)return $(B.catchLoc,!0);if(this.prev<B.finallyLoc)return $(B.finallyLoc)}else if(q){if(this.prev<B.catchLoc)return $(B.catchLoc,!0)}else{if(!V)throw Error("try statement without catch or finally");if(this.prev<B.finallyLoc)return $(B.finallyLoc)}}}},abrupt:function(T,I){for(var $=this.tryEntries.length-1;$>=0;--$){var M=this.tryEntries[$];if(M.tryLoc<=this.prev&&n.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var B=M;break}}B&&(T==="break"||T==="continue")&&B.tryLoc<=I&&I<=B.finallyLoc&&(B=null);var K=B?B.completion:{};return K.type=T,K.arg=I,B?(this.method="next",this.next=B.finallyLoc,b):this.complete(K)},complete:function(T,I){if(T.type==="throw")throw T.arg;return T.type==="break"||T.type==="continue"?this.next=T.arg:T.type==="return"?(this.rval=this.arg=T.arg,this.method="return",this.next="end"):T.type==="normal"&&I&&(this.next=I),b},finish:function(T){for(var I=this.tryEntries.length-1;I>=0;--I){var $=this.tryEntries[I];if($.finallyLoc===T)return this.complete($.completion,$.afterLoc),U($),b}},catch:function(T){for(var I=this.tryEntries.length-1;I>=0;--I){var $=this.tryEntries[I];if($.tryLoc===T){var M=$.completion;if(M.type==="throw"){var B=M.arg;U($)}return B}}throw Error("illegal catch attempt")},delegateYield:function(T,I,$){return this.delegate={iterator:L(T),resultName:I,nextLoc:$},this.method==="next"&&(this.arg=t),b}},e}function jA(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function kH(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(u){jA(s,n,i,o,a,"next",u)}function a(u){jA(s,n,i,o,a,"throw",u)}o(void 0)})}}function KA(t,e){return NH(t)||RH(t,e)||WA(t,e)||PH()}function PH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
48
48
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RH(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,o,a=[],u=!0,c=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=s.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function NH(t){if(Array.isArray(t))return t}function bs(t){"@babel/helpers - typeof";return bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bs(t)}function $H(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=WA(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
49
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return s=c.done,c},e:function(c){o=!0,a=c},f:function(){try{!s&&r.return!=null&&r.return()}finally{if(o)throw a}}}}function WA(t,e){if(t){if(typeof t=="string")return BA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return BA(t,e)}}function BA(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function MA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ho(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?MA(Object(r),!0).forEach(function(n){LH(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):MA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function LH(t,e,r){return e=XA(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qA(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,XA(n.key),n)}}function BH(t,e,r){return e&&qA(t.prototype,e),r&&qA(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function XA(t){var e=MH(t,"string");return bs(e)=="symbol"?e:e+""}function MH(t,e){if(bs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(bs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Bf="tus-v1",Mf="ietf-draft-03",ju="ietf-draft-05",qH={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:JA,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:Bf},YA=(function(){function t(e,r){jH(this,t),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return BH(t,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![Bf,Mf,ju].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var i=this.options.retryDelays;if(i!=null&&Object.prototype.toString.call(i)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var s=0,o=["uploadUrl","uploadSize","uploadLengthDeferred"];s<o.length;s++){var a=o[s];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return u==null?(0,ws.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,ws.log)("Calculated fingerprint: ".concat(u)),r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,i=this._size,s=0;this._parallelUploads=[];var o=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:HH(this._source.size,o);this._parallelUploadUrls&&a.forEach(function(l,h){l.uploadUrl=n._parallelUploadUrls[h]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(l,h){var d=0;return n._source.slice(l.start,l.end).then(function(f){var m=f.value;return new Promise(function(g,b){var S=Ho(Ho({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:Ho(Ho({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:g,onError:b,onProgress:function(D){s=s-d+D,d=D,n._emitProgress(s,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[h]=A.url,n._parallelUploadUrls.filter(function(D){return!!D}).length===a.length&&n._saveUploadInUrlStorage()}}),A=new t(m,S);A.start(),n._parallelUploads.push(A)})})}),c;Promise.all(u).then(function(){c=n._openRequest("POST",n.options.endpoint),c.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var l=UA(n.options.metadata);return l!==""&&c.setHeader("Upload-Metadata",l),n._sendRequest(c,null)}).then(function(l){if(!Vo(l.getStatus(),200)){n._emitHttpError(c,l,"tus: unexpected response while creating upload");return}var h=l.getHeader("Location");if(h==null){n._emitHttpError(c,l,"tus: invalid or missing Location header");return}n.url=GA(n.options.endpoint,h),(0,ws.log)("Created upload at ".concat(n.url)),n._emitSuccess(l)}).catch(function(l){n._emitError(l)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,ws.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,ws.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,ws.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=$H(this._parallelUploads),s;try{for(i.s();!(s=i.n()).done;){var o=s.value;o.abort(r)}}catch(a){i.e(a)}finally{i.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():t.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,i,s){this._emitError(new jf.default(i,s,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var i=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(i&&(this._retryAttempt=0),zA(r,this._retryAttempt,this.options)){var s=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},s);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,i){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,i)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var i=UA(this.options.metadata);i!==""&&n.setHeader("Upload-Metadata",i);var s;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,s=this._addChunkToRequest(n)):((this.options.protocol===Mf||this.options.protocol===ju)&&n.setHeader("Upload-Complete","?0"),s=this._sendRequest(n,null)),s.then(function(o){if(!Vo(o.getStatus(),200)){r._emitHttpError(n,o,"tus: unexpected response while creating upload");return}var a=o.getHeader("Location");if(a==null){r._emitHttpError(n,o,"tus: invalid or missing Location header");return}if(r.url=GA(r.options.endpoint,a),(0,ws.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(o),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,o):(r._offset=0,r._performUpload())})}).catch(function(o){r._emitHttpError(n,null,"tus: failed to create upload",o)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),i=this._sendRequest(n,null);i.then(function(s){var o=s.getStatus();if(!Vo(o,200)){if(o===423){r._emitHttpError(n,s,"tus: upload is currently locked; retry later");return}if(Vo(o,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,s,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var a=Number.parseInt(s.getHeader("Upload-Offset"),10);if(Number.isNaN(a)){r._emitHttpError(n,s,"tus: invalid or missing offset value");return}var u=Number.parseInt(s.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!r.options.uploadLengthDeferred&&r.options.protocol===Bf){r._emitHttpError(n,s,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(a===u){r._emitProgress(u,u),r._emitSuccess(s);return}r._offset=a,r._performUpload()})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to resume upload",s)})}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var i=this._addChunkToRequest(n);i.then(function(s){if(!Vo(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,s)}).catch(function(s){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),s)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,i=this._offset,s=this._offset+this.options.chunkSize;return r.setProgressHandler(function(o){n._emitProgress(i+o,n._size)}),this.options.protocol===Bf?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===ju&&r.setHeader("Content-Type","application/partial-upload"),(s===Number.POSITIVE_INFINITY||s>this._size)&&!this.options.uploadLengthDeferred&&(s=this._size),this._source.slice(i,s).then(function(o){var a=o.value,u=o.done,c=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+c,r.setHeader("Upload-Length","".concat(n._size)));var l=n._offset+c;return!n.options.uploadLengthDeferred&&u&&l!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(l," bytes"))):a===null?n._sendRequest(r):((n.options.protocol===Mf||n.options.protocol===ju)&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,a))})}},{key:"_handleUploadResponse",value:function(r,n){var i=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(i,this._size),this._emitChunkComplete(i-this._offset,i,this._size),this._offset=i,i===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var i=HA(r,n,this.options);return this._req=i,i}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(i){r._urlStorageKey=i})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return VA(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=HA("DELETE",r,n);return VA(i,null,n).then(function(s){if(s.getStatus()!==204)throw new jf.default("tus: unexpected response while terminating upload",null,i,s)}).catch(function(s){if(s instanceof jf.default||(s=new jf.default("tus: failed to terminate upload",s,i,null)),!zA(s,0,n))throw s;var o=n.retryDelays[0],a=n.retryDelays.slice(1),u=Ho(Ho({},n),{},{retryDelays:a});return new Promise(function(c){return setTimeout(c,o)}).then(function(){return t.terminate(r,u)})})}}])})();function UA(t){return Object.entries(t).map(function(e){var r=KA(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(TH.Base64.encode(String(i)))}).join(",")}function Vo(t,e){return t>=e&&t<e+100}function HA(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===Mf?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===ju?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},s=0,o=Object.entries(i);s<o.length;s++){var a=KA(o[s],2),u=a[0],c=a[1];n.setHeader(u,c)}if(r.addRequestId){var l=(0,IH.default)();n.setHeader("X-Request-ID",l)}return n}function VA(t,e,r){return oD.apply(this,arguments)}function oD(){return oD=kH(sD().mark(function t(e,r,n){var i;return sD().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(typeof n.onBeforeRequest!="function"){o.next=3;break}return o.next=3,n.onBeforeRequest(e);case 3:return o.next=5,e.send(r);case 5:if(i=o.sent,typeof n.onAfterResponse!="function"){o.next=9;break}return o.next=9,n.onAfterResponse(e,i);case 9:return o.abrupt("return",i);case 10:case"end":return o.stop()}},t)})),oD.apply(this,arguments)}function UH(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function zA(t,e,r){return r.retryDelays==null||e>=r.retryDelays.length||t.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(t,e,r):JA(t)}function JA(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!Vo(e,400)||e===409||e===423)&&UH()}function GA(t,e){return new FH.default(e,t).toString()}function HH(t,e){for(var r=Math.floor(t/e),n=[],i=0;i<e;i++)n.push({start:r*i,end:r*(i+1)});return n[e-1].end=t,n}YA.defaultOptions=qH;var aye=qf.default=YA});var eO=E((cye,QA)=>{"use strict";var Dn=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Dn.writable=t=>Dn(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Dn.readable=t=>Dn(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Dn.duplex=t=>Dn.writable(t)&&Dn.readable(t);Dn.transform=t=>Dn.duplex(t)&&typeof t._transform=="function";QA.exports=Dn});var rO=E(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});Uf.default=void 0;function Bu(t){"@babel/helpers - typeof";return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bu(t)}function VH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,GH(n.key),n)}}function zH(t,e,r){return e&&tO(t.prototype,e),r&&tO(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function GH(t){var e=KH(t,"string");return Bu(e)=="symbol"?e:e+""}function KH(t,e){if(Bu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var lye=Uf.default=(function(){function t(e){VH(this,t),this._buffer=e,this.size=e.length}return zH(t,[{key:"slice",value:function(r,n){var i=this._buffer.slice(r,n);i.size=i.length;var s=n>=this.size;return Promise.resolve({value:i,done:s})}},{key:"close",value:function(){}}])})()});var oO=E(lD=>{"use strict";Object.defineProperty(lD,"__esModule",{value:!0});lD.default=QH;var sO=require("fs");function vs(t){"@babel/helpers - typeof";return vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vs(t)}function uD(){"use strict";uD=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(_,T,I){_[T]=I.value},s=typeof Symbol=="function"?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function c(_,T,I){return Object.defineProperty(_,T,{value:I,enumerable:!0,configurable:!0,writable:!0}),_[T]}try{c({},"")}catch{c=function(I,$,M){return I[$]=M}}function l(_,T,I,$){var M=T&&T.prototype instanceof S?T:S,B=Object.create(M.prototype),K=new G($||[]);return i(B,"_invoke",{value:P(_,I,K)}),B}function h(_,T,I){try{return{type:"normal",arg:_.call(T,I)}}catch($){return{type:"throw",arg:$}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",m="executing",g="completed",b={};function S(){}function A(){}function p(){}var D={};c(D,o,function(){return this});var y=Object.getPrototypeOf,C=y&&y(y(L([])));C&&C!==r&&n.call(C,o)&&(D=C);var k=p.prototype=S.prototype=Object.create(D);function v(_){["next","throw","return"].forEach(function(T){c(_,T,function(I){return this._invoke(T,I)})})}function R(_,T){function I(M,B,K,q){var V=h(_[M],_,B);if(V.type!=="throw"){var ae=V.arg,x=ae.value;return x&&vs(x)=="object"&&n.call(x,"__await")?T.resolve(x.__await).then(function(O){I("next",O,K,q)},function(O){I("throw",O,K,q)}):T.resolve(x).then(function(O){ae.value=O,K(ae)},function(O){return I("throw",O,K,q)})}q(V.arg)}var $;i(this,"_invoke",{value:function(B,K){function q(){return new T(function(V,ae){I(B,K,V,ae)})}return $=$?$.then(q,q):q()}})}function P(_,T,I){var $=d;return function(M,B){if($===m)throw Error("Generator is already running");if($===g){if(M==="throw")throw B;return{value:t,done:!0}}for(I.method=M,I.arg=B;;){var K=I.delegate;if(K){var q=F(K,I);if(q){if(q===b)continue;return q}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if($===d)throw $=g,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);$=m;var V=h(_,T,I);if(V.type==="normal"){if($=I.done?g:f,V.arg===b)continue;return{value:V.arg,done:I.done}}V.type==="throw"&&($=g,I.method="throw",I.arg=V.arg)}}}function F(_,T){var I=T.method,$=_.iterator[I];if($===t)return T.delegate=null,I==="throw"&&_.iterator.return&&(T.method="return",T.arg=t,F(_,T),T.method==="throw")||I!=="return"&&(T.method="throw",T.arg=new TypeError("The iterator does not provide a '"+I+"' method")),b;var M=h($,_.iterator,T.arg);if(M.type==="throw")return T.method="throw",T.arg=M.arg,T.delegate=null,b;var B=M.arg;return B?B.done?(T[_.resultName]=B.value,T.next=_.nextLoc,T.method!=="return"&&(T.method="next",T.arg=t),T.delegate=null,b):B:(T.method="throw",T.arg=new TypeError("iterator result is not an object"),T.delegate=null,b)}function j(_){var T={tryLoc:_[0]};1 in _&&(T.catchLoc=_[1]),2 in _&&(T.finallyLoc=_[2],T.afterLoc=_[3]),this.tryEntries.push(T)}function U(_){var T=_.completion||{};T.type="normal",delete T.arg,_.completion=T}function G(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(j,this),this.reset(!0)}function L(_){if(_||_===""){var T=_[o];if(T)return T.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var I=-1,$=function M(){for(;++I<_.length;)if(n.call(_,I))return M.value=_[I],M.done=!1,M;return M.value=t,M.done=!0,M};return $.next=$}}throw new TypeError(vs(_)+" is not iterable")}return A.prototype=p,i(k,"constructor",{value:p,configurable:!0}),i(p,"constructor",{value:A,configurable:!0}),A.displayName=c(p,u,"GeneratorFunction"),e.isGeneratorFunction=function(_){var T=typeof _=="function"&&_.constructor;return!!T&&(T===A||(T.displayName||T.name)==="GeneratorFunction")},e.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,p):(_.__proto__=p,c(_,u,"GeneratorFunction")),_.prototype=Object.create(k),_},e.awrap=function(_){return{__await:_}},v(R.prototype),c(R.prototype,a,function(){return this}),e.AsyncIterator=R,e.async=function(_,T,I,$,M){M===void 0&&(M=Promise);var B=new R(l(_,T,I,$),M);return e.isGeneratorFunction(T)?B:B.next().then(function(K){return K.done?K.value:B.next()})},v(k),c(k,u,"Generator"),c(k,o,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(_){var T=Object(_),I=[];for(var $ in T)I.push($);return I.reverse(),function M(){for(;I.length;){var B=I.pop();if(B in T)return M.value=B,M.done=!1,M}return M.done=!0,M}},e.values=L,G.prototype={constructor:G,reset:function(T){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(U),!T)for(var I in this)I.charAt(0)==="t"&&n.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=t)},stop:function(){this.done=!0;var T=this.tryEntries[0].completion;if(T.type==="throw")throw T.arg;return this.rval},dispatchException:function(T){if(this.done)throw T;var I=this;function $(ae,x){return K.type="throw",K.arg=T,I.next=ae,x&&(I.method="next",I.arg=t),!!x}for(var M=this.tryEntries.length-1;M>=0;--M){var B=this.tryEntries[M],K=B.completion;if(B.tryLoc==="root")return $("end");if(B.tryLoc<=this.prev){var q=n.call(B,"catchLoc"),V=n.call(B,"finallyLoc");if(q&&V){if(this.prev<B.catchLoc)return $(B.catchLoc,!0);if(this.prev<B.finallyLoc)return $(B.finallyLoc)}else if(q){if(this.prev<B.catchLoc)return $(B.catchLoc,!0)}else{if(!V)throw Error("try statement without catch or finally");if(this.prev<B.finallyLoc)return $(B.finallyLoc)}}}},abrupt:function(T,I){for(var $=this.tryEntries.length-1;$>=0;--$){var M=this.tryEntries[$];if(M.tryLoc<=this.prev&&n.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var B=M;break}}B&&(T==="break"||T==="continue")&&B.tryLoc<=I&&I<=B.finallyLoc&&(B=null);var K=B?B.completion:{};return K.type=T,K.arg=I,B?(this.method="next",this.next=B.finallyLoc,b):this.complete(K)},complete:function(T,I){if(T.type==="throw")throw T.arg;return T.type==="break"||T.type==="continue"?this.next=T.arg:T.type==="return"?(this.rval=this.arg=T.arg,this.method="return",this.next="end"):T.type==="normal"&&I&&(this.next=I),b},finish:function(T){for(var I=this.tryEntries.length-1;I>=0;--I){var $=this.tryEntries[I];if($.finallyLoc===T)return this.complete($.completion,$.afterLoc),U($),b}},catch:function(T){for(var I=this.tryEntries.length-1;I>=0;--I){var $=this.tryEntries[I];if($.tryLoc===T){var M=$.completion;if(M.type==="throw"){var B=M.arg;U($)}return B}}throw Error("illegal catch attempt")},delegateYield:function(T,I,$){return this.delegate={iterator:L(T),resultName:I,nextLoc:$},this.method==="next"&&(this.arg=t),b}},e}function WH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,YH(n.key),n)}}function XH(t,e,r){return e&&nO(t.prototype,e),r&&nO(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function YH(t){var e=JH(t,"string");return vs(e)=="symbol"?e:e+""}function JH(t,e){if(vs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(vs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function iO(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function ZH(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(u){iO(s,n,i,o,a,"next",u)}function a(u){iO(s,n,i,o,a,"throw",u)}o(void 0)})}}function QH(t){return cD.apply(this,arguments)}function cD(){return cD=ZH(uD().mark(function t(e){var r,n,i,s,o,a,u;return uD().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.path.toString(),l.next=3,sO.promises.stat(n);case 3:return i=l.sent,s=i.size,o=(r=e.start)!==null&&r!==void 0?r:0,a=Number.isFinite(e.end)?e.end+1:s,u=a-o,l.abrupt("return",new eV(e,n,u));case 9:case"end":return l.stop()}},t)})),cD.apply(this,arguments)}var eV=(function(){function t(e,r,n){WH(this,t),this._stream=e,this._path=r,this.size=n}return XH(t,[{key:"slice",value:function(r,n){var i,s=(i=this._stream.start)!==null&&i!==void 0?i:0,o=(0,sO.createReadStream)(this._path,{start:s+r,end:s+n-1,autoClose:!0});o.size=Math.min(n-r,this.size);var a=o.size>=this.size;return Promise.resolve({value:o,done:a})}},{key:"close",value:function(){this._stream.destroy()}}])})()});var hD=E(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.default=void 0;function Es(t){"@babel/helpers - typeof";return Es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Es(t)}function Mu(){"use strict";Mu=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(_,T,I){_[T]=I.value},s=typeof Symbol=="function"?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function c(_,T,I){return Object.defineProperty(_,T,{value:I,enumerable:!0,configurable:!0,writable:!0}),_[T]}try{c({},"")}catch{c=function(I,$,M){return I[$]=M}}function l(_,T,I,$){var M=T&&T.prototype instanceof S?T:S,B=Object.create(M.prototype),K=new G($||[]);return i(B,"_invoke",{value:P(_,I,K)}),B}function h(_,T,I){try{return{type:"normal",arg:_.call(T,I)}}catch($){return{type:"throw",arg:$}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",m="executing",g="completed",b={};function S(){}function A(){}function p(){}var D={};c(D,o,function(){return this});var y=Object.getPrototypeOf,C=y&&y(y(L([])));C&&C!==r&&n.call(C,o)&&(D=C);var k=p.prototype=S.prototype=Object.create(D);function v(_){["next","throw","return"].forEach(function(T){c(_,T,function(I){return this._invoke(T,I)})})}function R(_,T){function I(M,B,K,q){var V=h(_[M],_,B);if(V.type!=="throw"){var ae=V.arg,x=ae.value;return x&&Es(x)=="object"&&n.call(x,"__await")?T.resolve(x.__await).then(function(O){I("next",O,K,q)},function(O){I("throw",O,K,q)}):T.resolve(x).then(function(O){ae.value=O,K(ae)},function(O){return I("throw",O,K,q)})}q(V.arg)}var $;i(this,"_invoke",{value:function(B,K){function q(){return new T(function(V,ae){I(B,K,V,ae)})}return $=$?$.then(q,q):q()}})}function P(_,T,I){var $=d;return function(M,B){if($===m)throw Error("Generator is already running");if($===g){if(M==="throw")throw B;return{value:t,done:!0}}for(I.method=M,I.arg=B;;){var K=I.delegate;if(K){var q=F(K,I);if(q){if(q===b)continue;return q}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if($===d)throw $=g,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);$=m;var V=h(_,T,I);if(V.type==="normal"){if($=I.done?g:f,V.arg===b)continue;return{value:V.arg,done:I.done}}V.type==="throw"&&($=g,I.method="throw",I.arg=V.arg)}}}function F(_,T){var I=T.method,$=_.iterator[I];if($===t)return T.delegate=null,I==="throw"&&_.iterator.return&&(T.method="return",T.arg=t,F(_,T),T.method==="throw")||I!=="return"&&(T.method="throw",T.arg=new TypeError("The iterator does not provide a '"+I+"' method")),b;var M=h($,_.iterator,T.arg);if(M.type==="throw")return T.method="throw",T.arg=M.arg,T.delegate=null,b;var B=M.arg;return B?B.done?(T[_.resultName]=B.value,T.next=_.nextLoc,T.method!=="return"&&(T.method="next",T.arg=t),T.delegate=null,b):B:(T.method="throw",T.arg=new TypeError("iterator result is not an object"),T.delegate=null,b)}function j(_){var T={tryLoc:_[0]};1 in _&&(T.catchLoc=_[1]),2 in _&&(T.finallyLoc=_[2],T.afterLoc=_[3]),this.tryEntries.push(T)}function U(_){var T=_.completion||{};T.type="normal",delete T.arg,_.completion=T}function G(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(j,this),this.reset(!0)}function L(_){if(_||_===""){var T=_[o];if(T)return T.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var I=-1,$=function M(){for(;++I<_.length;)if(n.call(_,I))return M.value=_[I],M.done=!1,M;return M.value=t,M.done=!0,M};return $.next=$}}throw new TypeError(Es(_)+" is not iterable")}return A.prototype=p,i(k,"constructor",{value:p,configurable:!0}),i(p,"constructor",{value:A,configurable:!0}),A.displayName=c(p,u,"GeneratorFunction"),e.isGeneratorFunction=function(_){var T=typeof _=="function"&&_.constructor;return!!T&&(T===A||(T.displayName||T.name)==="GeneratorFunction")},e.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,p):(_.__proto__=p,c(_,u,"GeneratorFunction")),_.prototype=Object.create(k),_},e.awrap=function(_){return{__await:_}},v(R.prototype),c(R.prototype,a,function(){return this}),e.AsyncIterator=R,e.async=function(_,T,I,$,M){M===void 0&&(M=Promise);var B=new R(l(_,T,I,$),M);return e.isGeneratorFunction(T)?B:B.next().then(function(K){return K.done?K.value:B.next()})},v(k),c(k,u,"Generator"),c(k,o,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(_){var T=Object(_),I=[];for(var $ in T)I.push($);return I.reverse(),function M(){for(;I.length;){var B=I.pop();if(B in T)return M.value=B,M.done=!1,M}return M.done=!0,M}},e.values=L,G.prototype={constructor:G,reset:function(T){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(U),!T)for(var I in this)I.charAt(0)==="t"&&n.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=t)},stop:function(){this.done=!0;var T=this.tryEntries[0].completion;if(T.type==="throw")throw T.arg;return this.rval},dispatchException:function(T){if(this.done)throw T;var I=this;function $(ae,x){return K.type="throw",K.arg=T,I.next=ae,x&&(I.method="next",I.arg=t),!!x}for(var M=this.tryEntries.length-1;M>=0;--M){var B=this.tryEntries[M],K=B.completion;if(B.tryLoc==="root")return $("end");if(B.tryLoc<=this.prev){var q=n.call(B,"catchLoc"),V=n.call(B,"finallyLoc");if(q&&V){if(this.prev<B.catchLoc)return $(B.catchLoc,!0);if(this.prev<B.finallyLoc)return $(B.finallyLoc)}else if(q){if(this.prev<B.catchLoc)return $(B.catchLoc,!0)}else{if(!V)throw Error("try statement without catch or finally");if(this.prev<B.finallyLoc)return $(B.finallyLoc)}}}},abrupt:function(T,I){for(var $=this.tryEntries.length-1;$>=0;--$){var M=this.tryEntries[$];if(M.tryLoc<=this.prev&&n.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var B=M;break}}B&&(T==="break"||T==="continue")&&B.tryLoc<=I&&I<=B.finallyLoc&&(B=null);var K=B?B.completion:{};return K.type=T,K.arg=I,B?(this.method="next",this.next=B.finallyLoc,b):this.complete(K)},complete:function(T,I){if(T.type==="throw")throw T.arg;return T.type==="break"||T.type==="continue"?this.next=T.arg:T.type==="return"?(this.rval=this.arg=T.arg,this.method="return",this.next="end"):T.type==="normal"&&I&&(this.next=I),b},finish:function(T){for(var I=this.tryEntries.length-1;I>=0;--I){var $=this.tryEntries[I];if($.finallyLoc===T)return this.complete($.completion,$.afterLoc),U($),b}},catch:function(T){for(var I=this.tryEntries.length-1;I>=0;--I){var $=this.tryEntries[I];if($.tryLoc===T){var M=$.completion;if(M.type==="throw"){var B=M.arg;U($)}return B}}throw Error("illegal catch attempt")},delegateYield:function(T,I,$){return this.delegate={iterator:L(T),resultName:I,nextLoc:$},this.method==="next"&&(this.arg=t),b}},e}function tV(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function aO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nV(n.key),n)}}function rV(t,e,r){return e&&aO(t.prototype,e),r&&aO(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function nV(t){var e=iV(t,"string");return Es(e)=="symbol"?e:e+""}function iV(t,e){if(Es(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Es(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function uO(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function cO(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(u){uO(s,n,i,o,a,"next",u)}function a(u){uO(s,n,i,o,a,"throw",u)}o(void 0)})}}function sV(t,e){return fD.apply(this,arguments)}function fD(){return fD=cO(Mu().mark(function t(e,r){return Mu().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(s,o){var a=function(l){e.off("readable",u),o(l)},u=function c(){var l=e.read(r);l!==null&&(e.off("error",a),e.off("readable",c),s(l))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),fD.apply(this,arguments)}var dye=Hf.default=(function(){function t(e){var r=this;tV(this,t),this._stream=e,this.size=null,this._buf=Buffer.alloc(0),this._bufPos=0,this._ended=!1,this._error=null,e.pause(),e.on("end",function(){r._ended=!0}),e.on("error",function(n){r._error=n})}return rV(t,[{key:"slice",value:(function(){var e=cO(Mu().mark(function n(i,s){var o,a,u,c,l;return Mu().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(!(i<this._bufPos)){d.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(i>this._bufPos+this._buf.length)){d.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){d.next=6;break}throw this._error;case 6:if(i<this._bufPos+this._buf.length?(a=i-this._bufPos,u=Math.min(this._buf.length,s-this._bufPos),o=this._buf.slice(a,u)):o=Buffer.alloc(0),!this._ended){d.next=10;break}return o.size=o.length,d.abrupt("return",{value:o,done:!0});case 10:if(c=s-i,!(c>o.length)){d.next=16;break}return d.next=14,sV(this._stream,c-o.length);case 14:l=d.sent,o=Buffer.concat([o,l]);case 16:return this._buf=o,this._bufPos=i,o.size=o.length,d.abrupt("return",{value:o,done:this._ended});case 20:case"end":return d.stop()}},n,this)}));function r(n,i){return e.apply(this,arguments)}return r})()},{key:"close",value:function(){this._stream.destroy()}}])})()});var fO=E(zf=>{"use strict";Object.defineProperty(zf,"__esModule",{value:!0});zf.default=void 0;var oV=require("fs"),aV=Vf(eO()),uV=Vf(rO()),cV=Vf(oO()),lV=Vf(hD());function Vf(t){return t&&t.__esModule?t:{default:t}}function qu(t){"@babel/helpers - typeof";return qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qu(t)}function fV(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dV(n.key),n)}}function hV(t,e,r){return e&&lO(t.prototype,e),r&&lO(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function dV(t){var e=pV(t,"string");return qu(e)=="symbol"?e:e+""}function pV(t,e){if(qu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var mye=zf.default=(function(){function t(){fV(this,t)}return hV(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new uV.default(r)):r instanceof oV.ReadStream&&r.path!=null?(0,cV.default)(r):aV.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new lV.default(r)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option; specify a chunkSize to control the memory consumption"))):Promise.reject(new Error("source object may only be an instance of Buffer or Readable in this environment"))}}])})()});var mO=E(dD=>{"use strict";Object.defineProperty(dD,"__esModule",{value:!0});dD.default=yV;var mV=require("crypto"),hO=pO(require("fs")),gV=pO(require("path"));function dO(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(dO=function(n){return n?r:e})(t)}function pO(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=dO(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function yV(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,mV.createHash)("md5").update(n).digest("hex"),s=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(s)}return t instanceof hO.ReadStream&&t.path!=null?new Promise(function(o,a){var u=gV.resolve(t.path);hO.stat(t.path,function(c,l){if(c){a(c);return}var h=["node-file",u,l.size,l.mtime.getTime(),e.endpoint].join("-");o(h)})}):Promise.resolve(null)}});var bO=E((Dye,wO)=>{var DO="Expected a function",gO=NaN,DV="[object Symbol]",wV=/^\s+|\s+$/g,bV=/^[-+]0x[0-9a-f]+$/i,vV=/^0b[01]+$/i,EV=/^0o[0-7]+$/i,_V=parseInt,CV=typeof global=="object"&&global&&global.Object===Object&&global,SV=typeof self=="object"&&self&&self.Object===Object&&self,AV=CV||SV||Function("return this")(),OV=Object.prototype,xV=OV.toString,TV=Math.max,FV=Math.min,pD=function(){return AV.Date.now()};function IV(t,e,r){var n,i,s,o,a,u,c=0,l=!1,h=!1,d=!0;if(typeof t!="function")throw new TypeError(DO);e=yO(e)||0,Gf(r)&&(l=!!r.leading,h="maxWait"in r,s=h?TV(yO(r.maxWait)||0,e):s,d="trailing"in r?!!r.trailing:d);function f(C){var k=n,v=i;return n=i=void 0,c=C,o=t.apply(v,k),o}function m(C){return c=C,a=setTimeout(S,e),l?f(C):o}function g(C){var k=C-u,v=C-c,R=e-k;return h?FV(R,s-v):R}function b(C){var k=C-u,v=C-c;return u===void 0||k>=e||k<0||h&&v>=s}function S(){var C=pD();if(b(C))return A(C);a=setTimeout(S,g(C))}function A(C){return a=void 0,d&&n?f(C):(n=i=void 0,o)}function p(){a!==void 0&&clearTimeout(a),c=0,n=u=i=a=void 0}function D(){return a===void 0?o:A(pD())}function y(){var C=pD(),k=b(C);if(n=arguments,i=this,u=C,k){if(a===void 0)return m(u);if(h)return a=setTimeout(S,e),f(u)}return a===void 0&&(a=setTimeout(S,e)),o}return y.cancel=p,y.flush=D,y}function kV(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(DO);return Gf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),IV(t,e,{leading:n,maxWait:e,trailing:i})}function Gf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function PV(t){return!!t&&typeof t=="object"}function RV(t){return typeof t=="symbol"||PV(t)&&xV.call(t)==DV}function yO(t){if(typeof t=="number")return t;if(RV(t))return gO;if(Gf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Gf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(wV,"");var r=vV.test(t);return r||EV.test(t)?_V(t.slice(2),r?2:8):bV.test(t)?gO:+t}wO.exports=kV});var TO=E(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.default=void 0;var NV=AO(require("http")),$V=AO(require("https")),_O=require("stream"),LV=require("url"),CO=jV(bO());function jV(t){return t&&t.__esModule?t:{default:t}}function SO(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(SO=function(n){return n?r:e})(t)}function AO(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=SO(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function BV(t,e,r){return e=Kf(e),MV(t,OO()?Reflect.construct(e,r||[],Kf(t).constructor):e.apply(t,r))}function MV(t,e){if(e&&(zo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qV(t)}function qV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function OO(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OO=function(){return!!t})()}function Kf(t){return Kf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kf(t)}function UV(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mD(t,e)}function mD(t,e){return mD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mD(t,e)}function vO(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Uu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vO(Object(r),!0).forEach(function(n){HV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vO(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function HV(t,e,r){return e=xO(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zo(t){"@babel/helpers - typeof";return zo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zo(t)}function Wf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function EO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xO(n.key),n)}}function Xf(t,e,r){return e&&EO(t.prototype,e),r&&EO(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function xO(t){var e=VV(t,"string");return zo(e)=="symbol"?e:e+""}function VV(t,e){if(zo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(zo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var wye=Yf.default=(function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wf(this,t),this._requestOptions=e}return Xf(t,[{key:"createRequest",value:function(r,n){return new zV(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])})(),zV=(function(){function t(e,r,n){Wf(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return Xf(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){this._progressHandler=r}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(i,s){var o=Uu(Uu(Uu({},(0,LV.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Uu(Uu({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(o.headers["Content-Length"]=n.size);var a=o.protocol==="https:"?$V:NV;r._request=a.request(o);var u=r._request;u.on("response",function(c){var l=[];c.on("data",function(h){l.push(h)}),c.on("end",function(){var h=Buffer.concat(l).toString("utf8");i(new GV(c,h))})}),u.on("error",function(c){s(c)}),n instanceof _O.Readable?n.pipe(new KV(r._progressHandler)).pipe(u):n instanceof Uint8Array?WV(u,n,r._progressHandler):u.end(n)})}},{key:"abort",value:function(){return this._request!==null&&this._request.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._request}}])})(),GV=(function(){function t(e,r){Wf(this,t),this._response=e,this._body=r}return Xf(t,[{key:"getStatus",value:function(){return this._response.statusCode}},{key:"getHeader",value:function(r){return this._response.headers[r.toLowerCase()]}},{key:"getBody",value:function(){return this._body}},{key:"getUnderlyingObject",value:function(){return this._response}}])})(),KV=(function(t){function e(r){var n;return Wf(this,e),n=BV(this,e),n._onprogress=(0,CO.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return UV(e,t),Xf(e,[{key:"_transform",value:function(n,i,s){this._position+=n.length,this._onprogress(this._position),s(null,n)}}])})(_O.Transform),WV=function(e,r,n){n=(0,CO.default)(n,100,{leading:!0,trailing:!1});var i=0;function s(){var o=Math.min(e.writableHighWaterMark,r.length-i),a=r.subarray(i,i+o);i+=a.length;var u=e.write(a);u?i<r.length?s():e.end():(e.once("drain",s),n(i))}s()}});var FO=E(gD=>{"use strict";gD.expectReceive=function(t,e,r){var n;r.root(t,e,r),n=this.message,t.hasOwnProperty("expected")&&(n+=" Expected "+t.expected+"."),t.hasOwnProperty("received")&&(n+=" Received: "+t.received+"."),this.message=n};gD.root=function(t,e,r){var n=this,i,s={stackLength:Error.stackTraceLimit,rootOnly:!0},o="",a=Error.stackTraceLimit,u;function c(){u[0]=n.toString(),n.stack=u.join(`
|
|
49
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return s=c.done,c},e:function(c){o=!0,a=c},f:function(){try{!s&&r.return!=null&&r.return()}finally{if(o)throw a}}}}function WA(t,e){if(t){if(typeof t=="string")return BA(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return BA(t,e)}}function BA(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function MA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ho(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?MA(Object(r),!0).forEach(function(n){LH(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):MA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function LH(t,e,r){return e=XA(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qA(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,XA(n.key),n)}}function BH(t,e,r){return e&&qA(t.prototype,e),r&&qA(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function XA(t){var e=MH(t,"string");return bs(e)=="symbol"?e:e+""}function MH(t,e){if(bs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(bs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Bf="tus-v1",Mf="ietf-draft-03",ju="ietf-draft-05",qH={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:JA,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:Bf},YA=(function(){function t(e,r){jH(this,t),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return BH(t,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![Bf,Mf,ju].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var i=this.options.retryDelays;if(i!=null&&Object.prototype.toString.call(i)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var s=0,o=["uploadUrl","uploadSize","uploadLengthDeferred"];s<o.length;s++){var a=o[s];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return u==null?(0,ws.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,ws.log)("Calculated fingerprint: ".concat(u)),r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,i=this._size,s=0;this._parallelUploads=[];var o=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:HH(this._source.size,o);this._parallelUploadUrls&&a.forEach(function(l,h){l.uploadUrl=n._parallelUploadUrls[h]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(l,h){var d=0;return n._source.slice(l.start,l.end).then(function(f){var m=f.value;return new Promise(function(g,b){var S=Ho(Ho({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:Ho(Ho({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:g,onError:b,onProgress:function(D){s=s-d+D,d=D,n._emitProgress(s,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[h]=A.url,n._parallelUploadUrls.filter(function(D){return!!D}).length===a.length&&n._saveUploadInUrlStorage()}}),A=new t(m,S);A.start(),n._parallelUploads.push(A)})})}),c;Promise.all(u).then(function(){c=n._openRequest("POST",n.options.endpoint),c.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var l=UA(n.options.metadata);return l!==""&&c.setHeader("Upload-Metadata",l),n._sendRequest(c,null)}).then(function(l){if(!Vo(l.getStatus(),200)){n._emitHttpError(c,l,"tus: unexpected response while creating upload");return}var h=l.getHeader("Location");if(h==null){n._emitHttpError(c,l,"tus: invalid or missing Location header");return}n.url=GA(n.options.endpoint,h),(0,ws.log)("Created upload at ".concat(n.url)),n._emitSuccess(l)}).catch(function(l){n._emitError(l)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,ws.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,ws.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,ws.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=$H(this._parallelUploads),s;try{for(i.s();!(s=i.n()).done;){var o=s.value;o.abort(r)}}catch(a){i.e(a)}finally{i.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():t.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,i,s){this._emitError(new jf.default(i,s,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var i=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(i&&(this._retryAttempt=0),zA(r,this._retryAttempt,this.options)){var s=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},s);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,i){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,i)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var i=UA(this.options.metadata);i!==""&&n.setHeader("Upload-Metadata",i);var s;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,s=this._addChunkToRequest(n)):((this.options.protocol===Mf||this.options.protocol===ju)&&n.setHeader("Upload-Complete","?0"),s=this._sendRequest(n,null)),s.then(function(o){if(!Vo(o.getStatus(),200)){r._emitHttpError(n,o,"tus: unexpected response while creating upload");return}var a=o.getHeader("Location");if(a==null){r._emitHttpError(n,o,"tus: invalid or missing Location header");return}if(r.url=GA(r.options.endpoint,a),(0,ws.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(o),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,o):(r._offset=0,r._performUpload())})}).catch(function(o){r._emitHttpError(n,null,"tus: failed to create upload",o)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),i=this._sendRequest(n,null);i.then(function(s){var o=s.getStatus();if(!Vo(o,200)){if(o===423){r._emitHttpError(n,s,"tus: upload is currently locked; retry later");return}if(Vo(o,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,s,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var a=Number.parseInt(s.getHeader("Upload-Offset"),10);if(Number.isNaN(a)){r._emitHttpError(n,s,"tus: invalid or missing offset value");return}var u=Number.parseInt(s.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!r.options.uploadLengthDeferred&&r.options.protocol===Bf){r._emitHttpError(n,s,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(a===u){r._emitProgress(u,u),r._emitSuccess(s);return}r._offset=a,r._performUpload()})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to resume upload",s)})}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var i=this._addChunkToRequest(n);i.then(function(s){if(!Vo(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,s)}).catch(function(s){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),s)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,i=this._offset,s=this._offset+this.options.chunkSize;return r.setProgressHandler(function(o){n._emitProgress(i+o,n._size)}),this.options.protocol===Bf?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===ju&&r.setHeader("Content-Type","application/partial-upload"),(s===Number.POSITIVE_INFINITY||s>this._size)&&!this.options.uploadLengthDeferred&&(s=this._size),this._source.slice(i,s).then(function(o){var a=o.value,u=o.done,c=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+c,r.setHeader("Upload-Length","".concat(n._size)));var l=n._offset+c;return!n.options.uploadLengthDeferred&&u&&l!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(l," bytes"))):a===null?n._sendRequest(r):((n.options.protocol===Mf||n.options.protocol===ju)&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,a))})}},{key:"_handleUploadResponse",value:function(r,n){var i=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(i,this._size),this._emitChunkComplete(i-this._offset,i,this._size),this._offset=i,i===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var i=HA(r,n,this.options);return this._req=i,i}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(i){r._urlStorageKey=i})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return VA(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=HA("DELETE",r,n);return VA(i,null,n).then(function(s){if(s.getStatus()!==204)throw new jf.default("tus: unexpected response while terminating upload",null,i,s)}).catch(function(s){if(s instanceof jf.default||(s=new jf.default("tus: failed to terminate upload",s,i,null)),!zA(s,0,n))throw s;var o=n.retryDelays[0],a=n.retryDelays.slice(1),u=Ho(Ho({},n),{},{retryDelays:a});return new Promise(function(c){return setTimeout(c,o)}).then(function(){return t.terminate(r,u)})})}}])})();function UA(t){return Object.entries(t).map(function(e){var r=KA(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(TH.Base64.encode(String(i)))}).join(",")}function Vo(t,e){return t>=e&&t<e+100}function HA(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===Mf?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===ju?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},s=0,o=Object.entries(i);s<o.length;s++){var a=KA(o[s],2),u=a[0],c=a[1];n.setHeader(u,c)}if(r.addRequestId){var l=(0,IH.default)();n.setHeader("X-Request-ID",l)}return n}function VA(t,e,r){return oD.apply(this,arguments)}function oD(){return oD=kH(sD().mark(function t(e,r,n){var i;return sD().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(typeof n.onBeforeRequest!="function"){o.next=3;break}return o.next=3,n.onBeforeRequest(e);case 3:return o.next=5,e.send(r);case 5:if(i=o.sent,typeof n.onAfterResponse!="function"){o.next=9;break}return o.next=9,n.onAfterResponse(e,i);case 9:return o.abrupt("return",i);case 10:case"end":return o.stop()}},t)})),oD.apply(this,arguments)}function UH(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function zA(t,e,r){return r.retryDelays==null||e>=r.retryDelays.length||t.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(t,e,r):JA(t)}function JA(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!Vo(e,400)||e===409||e===423)&&UH()}function GA(t,e){return new FH.default(e,t).toString()}function HH(t,e){for(var r=Math.floor(t/e),n=[],i=0;i<e;i++)n.push({start:r*i,end:r*(i+1)});return n[e-1].end=t,n}YA.defaultOptions=qH;var oye=qf.default=YA});var eO=E((uye,QA)=>{"use strict";var Dn=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Dn.writable=t=>Dn(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Dn.readable=t=>Dn(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Dn.duplex=t=>Dn.writable(t)&&Dn.readable(t);Dn.transform=t=>Dn.duplex(t)&&typeof t._transform=="function";QA.exports=Dn});var rO=E(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});Uf.default=void 0;function Bu(t){"@babel/helpers - typeof";return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bu(t)}function VH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,GH(n.key),n)}}function zH(t,e,r){return e&&tO(t.prototype,e),r&&tO(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function GH(t){var e=KH(t,"string");return Bu(e)=="symbol"?e:e+""}function KH(t,e){if(Bu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var cye=Uf.default=(function(){function t(e){VH(this,t),this._buffer=e,this.size=e.length}return zH(t,[{key:"slice",value:function(r,n){var i=this._buffer.slice(r,n);i.size=i.length;var s=n>=this.size;return Promise.resolve({value:i,done:s})}},{key:"close",value:function(){}}])})()});var oO=E(lD=>{"use strict";Object.defineProperty(lD,"__esModule",{value:!0});lD.default=QH;var sO=require("fs");function vs(t){"@babel/helpers - typeof";return vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vs(t)}function uD(){"use strict";uD=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(_,T,I){_[T]=I.value},s=typeof Symbol=="function"?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function c(_,T,I){return Object.defineProperty(_,T,{value:I,enumerable:!0,configurable:!0,writable:!0}),_[T]}try{c({},"")}catch{c=function(I,$,M){return I[$]=M}}function l(_,T,I,$){var M=T&&T.prototype instanceof S?T:S,B=Object.create(M.prototype),K=new G($||[]);return i(B,"_invoke",{value:P(_,I,K)}),B}function h(_,T,I){try{return{type:"normal",arg:_.call(T,I)}}catch($){return{type:"throw",arg:$}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",m="executing",g="completed",b={};function S(){}function A(){}function p(){}var D={};c(D,o,function(){return this});var y=Object.getPrototypeOf,C=y&&y(y(L([])));C&&C!==r&&n.call(C,o)&&(D=C);var k=p.prototype=S.prototype=Object.create(D);function v(_){["next","throw","return"].forEach(function(T){c(_,T,function(I){return this._invoke(T,I)})})}function R(_,T){function I(M,B,K,q){var V=h(_[M],_,B);if(V.type!=="throw"){var ae=V.arg,x=ae.value;return x&&vs(x)=="object"&&n.call(x,"__await")?T.resolve(x.__await).then(function(O){I("next",O,K,q)},function(O){I("throw",O,K,q)}):T.resolve(x).then(function(O){ae.value=O,K(ae)},function(O){return I("throw",O,K,q)})}q(V.arg)}var $;i(this,"_invoke",{value:function(B,K){function q(){return new T(function(V,ae){I(B,K,V,ae)})}return $=$?$.then(q,q):q()}})}function P(_,T,I){var $=d;return function(M,B){if($===m)throw Error("Generator is already running");if($===g){if(M==="throw")throw B;return{value:t,done:!0}}for(I.method=M,I.arg=B;;){var K=I.delegate;if(K){var q=F(K,I);if(q){if(q===b)continue;return q}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if($===d)throw $=g,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);$=m;var V=h(_,T,I);if(V.type==="normal"){if($=I.done?g:f,V.arg===b)continue;return{value:V.arg,done:I.done}}V.type==="throw"&&($=g,I.method="throw",I.arg=V.arg)}}}function F(_,T){var I=T.method,$=_.iterator[I];if($===t)return T.delegate=null,I==="throw"&&_.iterator.return&&(T.method="return",T.arg=t,F(_,T),T.method==="throw")||I!=="return"&&(T.method="throw",T.arg=new TypeError("The iterator does not provide a '"+I+"' method")),b;var M=h($,_.iterator,T.arg);if(M.type==="throw")return T.method="throw",T.arg=M.arg,T.delegate=null,b;var B=M.arg;return B?B.done?(T[_.resultName]=B.value,T.next=_.nextLoc,T.method!=="return"&&(T.method="next",T.arg=t),T.delegate=null,b):B:(T.method="throw",T.arg=new TypeError("iterator result is not an object"),T.delegate=null,b)}function j(_){var T={tryLoc:_[0]};1 in _&&(T.catchLoc=_[1]),2 in _&&(T.finallyLoc=_[2],T.afterLoc=_[3]),this.tryEntries.push(T)}function U(_){var T=_.completion||{};T.type="normal",delete T.arg,_.completion=T}function G(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(j,this),this.reset(!0)}function L(_){if(_||_===""){var T=_[o];if(T)return T.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var I=-1,$=function M(){for(;++I<_.length;)if(n.call(_,I))return M.value=_[I],M.done=!1,M;return M.value=t,M.done=!0,M};return $.next=$}}throw new TypeError(vs(_)+" is not iterable")}return A.prototype=p,i(k,"constructor",{value:p,configurable:!0}),i(p,"constructor",{value:A,configurable:!0}),A.displayName=c(p,u,"GeneratorFunction"),e.isGeneratorFunction=function(_){var T=typeof _=="function"&&_.constructor;return!!T&&(T===A||(T.displayName||T.name)==="GeneratorFunction")},e.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,p):(_.__proto__=p,c(_,u,"GeneratorFunction")),_.prototype=Object.create(k),_},e.awrap=function(_){return{__await:_}},v(R.prototype),c(R.prototype,a,function(){return this}),e.AsyncIterator=R,e.async=function(_,T,I,$,M){M===void 0&&(M=Promise);var B=new R(l(_,T,I,$),M);return e.isGeneratorFunction(T)?B:B.next().then(function(K){return K.done?K.value:B.next()})},v(k),c(k,u,"Generator"),c(k,o,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(_){var T=Object(_),I=[];for(var $ in T)I.push($);return I.reverse(),function M(){for(;I.length;){var B=I.pop();if(B in T)return M.value=B,M.done=!1,M}return M.done=!0,M}},e.values=L,G.prototype={constructor:G,reset:function(T){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(U),!T)for(var I in this)I.charAt(0)==="t"&&n.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=t)},stop:function(){this.done=!0;var T=this.tryEntries[0].completion;if(T.type==="throw")throw T.arg;return this.rval},dispatchException:function(T){if(this.done)throw T;var I=this;function $(ae,x){return K.type="throw",K.arg=T,I.next=ae,x&&(I.method="next",I.arg=t),!!x}for(var M=this.tryEntries.length-1;M>=0;--M){var B=this.tryEntries[M],K=B.completion;if(B.tryLoc==="root")return $("end");if(B.tryLoc<=this.prev){var q=n.call(B,"catchLoc"),V=n.call(B,"finallyLoc");if(q&&V){if(this.prev<B.catchLoc)return $(B.catchLoc,!0);if(this.prev<B.finallyLoc)return $(B.finallyLoc)}else if(q){if(this.prev<B.catchLoc)return $(B.catchLoc,!0)}else{if(!V)throw Error("try statement without catch or finally");if(this.prev<B.finallyLoc)return $(B.finallyLoc)}}}},abrupt:function(T,I){for(var $=this.tryEntries.length-1;$>=0;--$){var M=this.tryEntries[$];if(M.tryLoc<=this.prev&&n.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var B=M;break}}B&&(T==="break"||T==="continue")&&B.tryLoc<=I&&I<=B.finallyLoc&&(B=null);var K=B?B.completion:{};return K.type=T,K.arg=I,B?(this.method="next",this.next=B.finallyLoc,b):this.complete(K)},complete:function(T,I){if(T.type==="throw")throw T.arg;return T.type==="break"||T.type==="continue"?this.next=T.arg:T.type==="return"?(this.rval=this.arg=T.arg,this.method="return",this.next="end"):T.type==="normal"&&I&&(this.next=I),b},finish:function(T){for(var I=this.tryEntries.length-1;I>=0;--I){var $=this.tryEntries[I];if($.finallyLoc===T)return this.complete($.completion,$.afterLoc),U($),b}},catch:function(T){for(var I=this.tryEntries.length-1;I>=0;--I){var $=this.tryEntries[I];if($.tryLoc===T){var M=$.completion;if(M.type==="throw"){var B=M.arg;U($)}return B}}throw Error("illegal catch attempt")},delegateYield:function(T,I,$){return this.delegate={iterator:L(T),resultName:I,nextLoc:$},this.method==="next"&&(this.arg=t),b}},e}function WH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,YH(n.key),n)}}function XH(t,e,r){return e&&nO(t.prototype,e),r&&nO(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function YH(t){var e=JH(t,"string");return vs(e)=="symbol"?e:e+""}function JH(t,e){if(vs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(vs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function iO(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function ZH(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(u){iO(s,n,i,o,a,"next",u)}function a(u){iO(s,n,i,o,a,"throw",u)}o(void 0)})}}function QH(t){return cD.apply(this,arguments)}function cD(){return cD=ZH(uD().mark(function t(e){var r,n,i,s,o,a,u;return uD().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.path.toString(),l.next=3,sO.promises.stat(n);case 3:return i=l.sent,s=i.size,o=(r=e.start)!==null&&r!==void 0?r:0,a=Number.isFinite(e.end)?e.end+1:s,u=a-o,l.abrupt("return",new eV(e,n,u));case 9:case"end":return l.stop()}},t)})),cD.apply(this,arguments)}var eV=(function(){function t(e,r,n){WH(this,t),this._stream=e,this._path=r,this.size=n}return XH(t,[{key:"slice",value:function(r,n){var i,s=(i=this._stream.start)!==null&&i!==void 0?i:0,o=(0,sO.createReadStream)(this._path,{start:s+r,end:s+n-1,autoClose:!0});o.size=Math.min(n-r,this.size);var a=o.size>=this.size;return Promise.resolve({value:o,done:a})}},{key:"close",value:function(){this._stream.destroy()}}])})()});var hD=E(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.default=void 0;function Es(t){"@babel/helpers - typeof";return Es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Es(t)}function Mu(){"use strict";Mu=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(_,T,I){_[T]=I.value},s=typeof Symbol=="function"?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function c(_,T,I){return Object.defineProperty(_,T,{value:I,enumerable:!0,configurable:!0,writable:!0}),_[T]}try{c({},"")}catch{c=function(I,$,M){return I[$]=M}}function l(_,T,I,$){var M=T&&T.prototype instanceof S?T:S,B=Object.create(M.prototype),K=new G($||[]);return i(B,"_invoke",{value:P(_,I,K)}),B}function h(_,T,I){try{return{type:"normal",arg:_.call(T,I)}}catch($){return{type:"throw",arg:$}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",m="executing",g="completed",b={};function S(){}function A(){}function p(){}var D={};c(D,o,function(){return this});var y=Object.getPrototypeOf,C=y&&y(y(L([])));C&&C!==r&&n.call(C,o)&&(D=C);var k=p.prototype=S.prototype=Object.create(D);function v(_){["next","throw","return"].forEach(function(T){c(_,T,function(I){return this._invoke(T,I)})})}function R(_,T){function I(M,B,K,q){var V=h(_[M],_,B);if(V.type!=="throw"){var ae=V.arg,x=ae.value;return x&&Es(x)=="object"&&n.call(x,"__await")?T.resolve(x.__await).then(function(O){I("next",O,K,q)},function(O){I("throw",O,K,q)}):T.resolve(x).then(function(O){ae.value=O,K(ae)},function(O){return I("throw",O,K,q)})}q(V.arg)}var $;i(this,"_invoke",{value:function(B,K){function q(){return new T(function(V,ae){I(B,K,V,ae)})}return $=$?$.then(q,q):q()}})}function P(_,T,I){var $=d;return function(M,B){if($===m)throw Error("Generator is already running");if($===g){if(M==="throw")throw B;return{value:t,done:!0}}for(I.method=M,I.arg=B;;){var K=I.delegate;if(K){var q=F(K,I);if(q){if(q===b)continue;return q}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if($===d)throw $=g,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);$=m;var V=h(_,T,I);if(V.type==="normal"){if($=I.done?g:f,V.arg===b)continue;return{value:V.arg,done:I.done}}V.type==="throw"&&($=g,I.method="throw",I.arg=V.arg)}}}function F(_,T){var I=T.method,$=_.iterator[I];if($===t)return T.delegate=null,I==="throw"&&_.iterator.return&&(T.method="return",T.arg=t,F(_,T),T.method==="throw")||I!=="return"&&(T.method="throw",T.arg=new TypeError("The iterator does not provide a '"+I+"' method")),b;var M=h($,_.iterator,T.arg);if(M.type==="throw")return T.method="throw",T.arg=M.arg,T.delegate=null,b;var B=M.arg;return B?B.done?(T[_.resultName]=B.value,T.next=_.nextLoc,T.method!=="return"&&(T.method="next",T.arg=t),T.delegate=null,b):B:(T.method="throw",T.arg=new TypeError("iterator result is not an object"),T.delegate=null,b)}function j(_){var T={tryLoc:_[0]};1 in _&&(T.catchLoc=_[1]),2 in _&&(T.finallyLoc=_[2],T.afterLoc=_[3]),this.tryEntries.push(T)}function U(_){var T=_.completion||{};T.type="normal",delete T.arg,_.completion=T}function G(_){this.tryEntries=[{tryLoc:"root"}],_.forEach(j,this),this.reset(!0)}function L(_){if(_||_===""){var T=_[o];if(T)return T.call(_);if(typeof _.next=="function")return _;if(!isNaN(_.length)){var I=-1,$=function M(){for(;++I<_.length;)if(n.call(_,I))return M.value=_[I],M.done=!1,M;return M.value=t,M.done=!0,M};return $.next=$}}throw new TypeError(Es(_)+" is not iterable")}return A.prototype=p,i(k,"constructor",{value:p,configurable:!0}),i(p,"constructor",{value:A,configurable:!0}),A.displayName=c(p,u,"GeneratorFunction"),e.isGeneratorFunction=function(_){var T=typeof _=="function"&&_.constructor;return!!T&&(T===A||(T.displayName||T.name)==="GeneratorFunction")},e.mark=function(_){return Object.setPrototypeOf?Object.setPrototypeOf(_,p):(_.__proto__=p,c(_,u,"GeneratorFunction")),_.prototype=Object.create(k),_},e.awrap=function(_){return{__await:_}},v(R.prototype),c(R.prototype,a,function(){return this}),e.AsyncIterator=R,e.async=function(_,T,I,$,M){M===void 0&&(M=Promise);var B=new R(l(_,T,I,$),M);return e.isGeneratorFunction(T)?B:B.next().then(function(K){return K.done?K.value:B.next()})},v(k),c(k,u,"Generator"),c(k,o,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(_){var T=Object(_),I=[];for(var $ in T)I.push($);return I.reverse(),function M(){for(;I.length;){var B=I.pop();if(B in T)return M.value=B,M.done=!1,M}return M.done=!0,M}},e.values=L,G.prototype={constructor:G,reset:function(T){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(U),!T)for(var I in this)I.charAt(0)==="t"&&n.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=t)},stop:function(){this.done=!0;var T=this.tryEntries[0].completion;if(T.type==="throw")throw T.arg;return this.rval},dispatchException:function(T){if(this.done)throw T;var I=this;function $(ae,x){return K.type="throw",K.arg=T,I.next=ae,x&&(I.method="next",I.arg=t),!!x}for(var M=this.tryEntries.length-1;M>=0;--M){var B=this.tryEntries[M],K=B.completion;if(B.tryLoc==="root")return $("end");if(B.tryLoc<=this.prev){var q=n.call(B,"catchLoc"),V=n.call(B,"finallyLoc");if(q&&V){if(this.prev<B.catchLoc)return $(B.catchLoc,!0);if(this.prev<B.finallyLoc)return $(B.finallyLoc)}else if(q){if(this.prev<B.catchLoc)return $(B.catchLoc,!0)}else{if(!V)throw Error("try statement without catch or finally");if(this.prev<B.finallyLoc)return $(B.finallyLoc)}}}},abrupt:function(T,I){for(var $=this.tryEntries.length-1;$>=0;--$){var M=this.tryEntries[$];if(M.tryLoc<=this.prev&&n.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var B=M;break}}B&&(T==="break"||T==="continue")&&B.tryLoc<=I&&I<=B.finallyLoc&&(B=null);var K=B?B.completion:{};return K.type=T,K.arg=I,B?(this.method="next",this.next=B.finallyLoc,b):this.complete(K)},complete:function(T,I){if(T.type==="throw")throw T.arg;return T.type==="break"||T.type==="continue"?this.next=T.arg:T.type==="return"?(this.rval=this.arg=T.arg,this.method="return",this.next="end"):T.type==="normal"&&I&&(this.next=I),b},finish:function(T){for(var I=this.tryEntries.length-1;I>=0;--I){var $=this.tryEntries[I];if($.finallyLoc===T)return this.complete($.completion,$.afterLoc),U($),b}},catch:function(T){for(var I=this.tryEntries.length-1;I>=0;--I){var $=this.tryEntries[I];if($.tryLoc===T){var M=$.completion;if(M.type==="throw"){var B=M.arg;U($)}return B}}throw Error("illegal catch attempt")},delegateYield:function(T,I,$){return this.delegate={iterator:L(T),resultName:I,nextLoc:$},this.method==="next"&&(this.arg=t),b}},e}function tV(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function aO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nV(n.key),n)}}function rV(t,e,r){return e&&aO(t.prototype,e),r&&aO(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function nV(t){var e=iV(t,"string");return Es(e)=="symbol"?e:e+""}function iV(t,e){if(Es(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Es(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function uO(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function cO(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(u){uO(s,n,i,o,a,"next",u)}function a(u){uO(s,n,i,o,a,"throw",u)}o(void 0)})}}function sV(t,e){return fD.apply(this,arguments)}function fD(){return fD=cO(Mu().mark(function t(e,r){return Mu().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(s,o){var a=function(l){e.off("readable",u),o(l)},u=function c(){var l=e.read(r);l!==null&&(e.off("error",a),e.off("readable",c),s(l))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),fD.apply(this,arguments)}var hye=Hf.default=(function(){function t(e){var r=this;tV(this,t),this._stream=e,this.size=null,this._buf=Buffer.alloc(0),this._bufPos=0,this._ended=!1,this._error=null,e.pause(),e.on("end",function(){r._ended=!0}),e.on("error",function(n){r._error=n})}return rV(t,[{key:"slice",value:(function(){var e=cO(Mu().mark(function n(i,s){var o,a,u,c,l;return Mu().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(!(i<this._bufPos)){d.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(i>this._bufPos+this._buf.length)){d.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){d.next=6;break}throw this._error;case 6:if(i<this._bufPos+this._buf.length?(a=i-this._bufPos,u=Math.min(this._buf.length,s-this._bufPos),o=this._buf.slice(a,u)):o=Buffer.alloc(0),!this._ended){d.next=10;break}return o.size=o.length,d.abrupt("return",{value:o,done:!0});case 10:if(c=s-i,!(c>o.length)){d.next=16;break}return d.next=14,sV(this._stream,c-o.length);case 14:l=d.sent,o=Buffer.concat([o,l]);case 16:return this._buf=o,this._bufPos=i,o.size=o.length,d.abrupt("return",{value:o,done:this._ended});case 20:case"end":return d.stop()}},n,this)}));function r(n,i){return e.apply(this,arguments)}return r})()},{key:"close",value:function(){this._stream.destroy()}}])})()});var fO=E(zf=>{"use strict";Object.defineProperty(zf,"__esModule",{value:!0});zf.default=void 0;var oV=require("fs"),aV=Vf(eO()),uV=Vf(rO()),cV=Vf(oO()),lV=Vf(hD());function Vf(t){return t&&t.__esModule?t:{default:t}}function qu(t){"@babel/helpers - typeof";return qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qu(t)}function fV(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dV(n.key),n)}}function hV(t,e,r){return e&&lO(t.prototype,e),r&&lO(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function dV(t){var e=pV(t,"string");return qu(e)=="symbol"?e:e+""}function pV(t,e){if(qu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var pye=zf.default=(function(){function t(){fV(this,t)}return hV(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new uV.default(r)):r instanceof oV.ReadStream&&r.path!=null?(0,cV.default)(r):aV.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new lV.default(r)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option; specify a chunkSize to control the memory consumption"))):Promise.reject(new Error("source object may only be an instance of Buffer or Readable in this environment"))}}])})()});var mO=E(dD=>{"use strict";Object.defineProperty(dD,"__esModule",{value:!0});dD.default=yV;var mV=require("crypto"),hO=pO(require("fs")),gV=pO(require("path"));function dO(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(dO=function(n){return n?r:e})(t)}function pO(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=dO(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function yV(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,mV.createHash)("md5").update(n).digest("hex"),s=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(s)}return t instanceof hO.ReadStream&&t.path!=null?new Promise(function(o,a){var u=gV.resolve(t.path);hO.stat(t.path,function(c,l){if(c){a(c);return}var h=["node-file",u,l.size,l.mtime.getTime(),e.endpoint].join("-");o(h)})}):Promise.resolve(null)}});var bO=E((yye,wO)=>{var DO="Expected a function",gO=NaN,DV="[object Symbol]",wV=/^\s+|\s+$/g,bV=/^[-+]0x[0-9a-f]+$/i,vV=/^0b[01]+$/i,EV=/^0o[0-7]+$/i,_V=parseInt,CV=typeof global=="object"&&global&&global.Object===Object&&global,SV=typeof self=="object"&&self&&self.Object===Object&&self,AV=CV||SV||Function("return this")(),OV=Object.prototype,xV=OV.toString,TV=Math.max,FV=Math.min,pD=function(){return AV.Date.now()};function IV(t,e,r){var n,i,s,o,a,u,c=0,l=!1,h=!1,d=!0;if(typeof t!="function")throw new TypeError(DO);e=yO(e)||0,Gf(r)&&(l=!!r.leading,h="maxWait"in r,s=h?TV(yO(r.maxWait)||0,e):s,d="trailing"in r?!!r.trailing:d);function f(C){var k=n,v=i;return n=i=void 0,c=C,o=t.apply(v,k),o}function m(C){return c=C,a=setTimeout(S,e),l?f(C):o}function g(C){var k=C-u,v=C-c,R=e-k;return h?FV(R,s-v):R}function b(C){var k=C-u,v=C-c;return u===void 0||k>=e||k<0||h&&v>=s}function S(){var C=pD();if(b(C))return A(C);a=setTimeout(S,g(C))}function A(C){return a=void 0,d&&n?f(C):(n=i=void 0,o)}function p(){a!==void 0&&clearTimeout(a),c=0,n=u=i=a=void 0}function D(){return a===void 0?o:A(pD())}function y(){var C=pD(),k=b(C);if(n=arguments,i=this,u=C,k){if(a===void 0)return m(u);if(h)return a=setTimeout(S,e),f(u)}return a===void 0&&(a=setTimeout(S,e)),o}return y.cancel=p,y.flush=D,y}function kV(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(DO);return Gf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),IV(t,e,{leading:n,maxWait:e,trailing:i})}function Gf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function PV(t){return!!t&&typeof t=="object"}function RV(t){return typeof t=="symbol"||PV(t)&&xV.call(t)==DV}function yO(t){if(typeof t=="number")return t;if(RV(t))return gO;if(Gf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Gf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(wV,"");var r=vV.test(t);return r||EV.test(t)?_V(t.slice(2),r?2:8):bV.test(t)?gO:+t}wO.exports=kV});var TO=E(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.default=void 0;var NV=AO(require("http")),$V=AO(require("https")),_O=require("stream"),LV=require("url"),CO=jV(bO());function jV(t){return t&&t.__esModule?t:{default:t}}function SO(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(SO=function(n){return n?r:e})(t)}function AO(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=SO(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function BV(t,e,r){return e=Kf(e),MV(t,OO()?Reflect.construct(e,r||[],Kf(t).constructor):e.apply(t,r))}function MV(t,e){if(e&&(zo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qV(t)}function qV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function OO(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OO=function(){return!!t})()}function Kf(t){return Kf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kf(t)}function UV(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mD(t,e)}function mD(t,e){return mD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mD(t,e)}function vO(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Uu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vO(Object(r),!0).forEach(function(n){HV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vO(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function HV(t,e,r){return e=xO(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zo(t){"@babel/helpers - typeof";return zo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zo(t)}function Wf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function EO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xO(n.key),n)}}function Xf(t,e,r){return e&&EO(t.prototype,e),r&&EO(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function xO(t){var e=VV(t,"string");return zo(e)=="symbol"?e:e+""}function VV(t,e){if(zo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(zo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Dye=Yf.default=(function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wf(this,t),this._requestOptions=e}return Xf(t,[{key:"createRequest",value:function(r,n){return new zV(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])})(),zV=(function(){function t(e,r,n){Wf(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return Xf(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){this._progressHandler=r}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(i,s){var o=Uu(Uu(Uu({},(0,LV.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Uu(Uu({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(o.headers["Content-Length"]=n.size);var a=o.protocol==="https:"?$V:NV;r._request=a.request(o);var u=r._request;u.on("response",function(c){var l=[];c.on("data",function(h){l.push(h)}),c.on("end",function(){var h=Buffer.concat(l).toString("utf8");i(new GV(c,h))})}),u.on("error",function(c){s(c)}),n instanceof _O.Readable?n.pipe(new KV(r._progressHandler)).pipe(u):n instanceof Uint8Array?WV(u,n,r._progressHandler):u.end(n)})}},{key:"abort",value:function(){return this._request!==null&&this._request.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._request}}])})(),GV=(function(){function t(e,r){Wf(this,t),this._response=e,this._body=r}return Xf(t,[{key:"getStatus",value:function(){return this._response.statusCode}},{key:"getHeader",value:function(r){return this._response.headers[r.toLowerCase()]}},{key:"getBody",value:function(){return this._body}},{key:"getUnderlyingObject",value:function(){return this._response}}])})(),KV=(function(t){function e(r){var n;return Wf(this,e),n=BV(this,e),n._onprogress=(0,CO.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return UV(e,t),Xf(e,[{key:"_transform",value:function(n,i,s){this._position+=n.length,this._onprogress(this._position),s(null,n)}}])})(_O.Transform),WV=function(e,r,n){n=(0,CO.default)(n,100,{leading:!0,trailing:!1});var i=0;function s(){var o=Math.min(e.writableHighWaterMark,r.length-i),a=r.subarray(i,i+o);i+=a.length;var u=e.write(a);u?i<r.length?s():e.end():(e.once("drain",s),n(i))}s()}});var FO=E(gD=>{"use strict";gD.expectReceive=function(t,e,r){var n;r.root(t,e,r),n=this.message,t.hasOwnProperty("expected")&&(n+=" Expected "+t.expected+"."),t.hasOwnProperty("received")&&(n+=" Received: "+t.received+"."),this.message=n};gD.root=function(t,e,r){var n=this,i,s={stackLength:Error.stackTraceLimit,rootOnly:!0},o="",a=Error.stackTraceLimit,u;function c(){u[0]=n.toString(),n.stack=u.join(`
|
|
50
50
|
`)}(!e||typeof e!="object")&&(e={}),e.hasOwnProperty("stackLength")&&typeof e.stackLength=="number"&&!isNaN(e.stackLength)&&e.stackLength>=0&&(s.stackLength=e.stackLength),e.hasOwnProperty("rootOnly")||(s.rootOnly=e.rootOnly),(!s.rootOnly||this.CustomError.parent===Error)&&(Object.keys(t).forEach(function(l){switch(l){case"code":i=t.code||void 0;break;case"message":o=t.message||"";break;default:n[l]=t[l]}}),Error.stackTraceLimit=s.stackLength+2,u=new Error().stack.split(`
|
|
51
51
|
`),u.splice(0,3),u.unshift(""),Error.stackTraceLimit=a,this.stack=u.join(`
|
|
52
|
-
`),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(l){i=l,c()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return o},set:function(l){o=l,c()}}),c())}});var PO=E((Eye,kO)=>{"use strict";kO.exports=_s;_s.factory=FO();var wD=_s("CustomError");wD.order=_s(wD,{message:"Arguments out of order.",code:"EOARG"});function _s(t,e,r,n){var i,s;return e=Jf(arguments,1,Error,IO,[yD,Zf]),r=Jf(arguments,2,{},yD,[Zf]),n=Jf(arguments,3,DD,Zf,[]),t=Jf(arguments,0,e===Error?"Error":e.prototype.CustomError.name,XV,[IO,yD,Zf]),s=e===Error,s&&n===DD&&(n=_s.factory.root),i=function(o,a){var u,c,l,h,d,f;if(!(this instanceof i))return new i(o,a);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof o=="string"&&(o={message:o}),o||(o={}),c=this.CustomError.chain.slice(0).reverse().map(function(m){return m.properties}),c.push(o),c.unshift({}),f=Object.assign.apply(Object,c),u=this,l={},Object.keys(_s.factory).forEach(function(m){l[m]=function(g,b){_s.factory[m].call(u,g,b,l)}}),h=this.CustomError.chain.length-1;h>=0;h--)d=this.CustomError.chain[h],d.factory!==DD&&d.factory.call(this,f,a,l)},i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.name=t,i.prototype.CustomError={chain:s?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},i.prototype.CustomError.chain.unshift(i.prototype.CustomError),i.prototype.toString=function(){var o=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(o+=" "+this.code),this.message&&(o+=": "+this.message),o},i}function Jf(t,e,r,n,i){var s=-1,o=-1,a,u,c=e<t.length?e:t.length,l;for(a=0;a<=c;a++){if(l=t[a],s===-1)for(u=0;u<i.length;u++)i[u](l)&&(s=a);o===-1&&n(l)&&(o=a)}if(o!==-1&&s!==-1&&s<o)throw new wD.order;return o!==-1?t[o]:r}function Zf(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function XV(t){return typeof t=="string"}function IO(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function yD(t){return t&&typeof t=="object"}function DD(){}});var NO=E((_ye,RO)=>{RO.exports=PO()});var MO=E((Cs,Go)=>{var YV=1/0,JV="[object Symbol]",Hu={function:!0,object:!0},ZV=Hu[typeof Cs]&&Cs&&!Cs.nodeType?Cs:void 0,QV=Hu[typeof Go]&&Go&&!Go.nodeType?Go:void 0,ez=Qf(ZV&&QV&&typeof global=="object"&&global),tz=Qf(Hu[typeof self]&&self),$O=Qf(Hu[typeof window]&&window),bD=Qf(Hu[typeof Cs]&&Cs),rz=ez||$O!==(bD&&bD.window)&&$O||tz||bD||Function("return this")();function Qf(t){return t&&t.Object===Object?t:null}var nz=Object.prototype,iz=nz.toString,LO=rz.Symbol,jO=LO?LO.prototype:void 0,BO=jO?jO.toString:void 0;function sz(t){if(typeof t=="string")return t;if(az(t))return BO?BO.call(t):"";var e=t+"";return e=="0"&&1/t==-YV?"-0":e}function oz(t){return!!t&&typeof t=="object"}function az(t){return typeof t=="symbol"||oz(t)&&iz.call(t)==JV}Go.exports=sz});var KO=E((Ss,Ko)=>{var uz=MO(),cz="Expected a function",UO="__lodash_hash_undefined__",lz="[object Function]",fz="[object GeneratorFunction]",hz=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,dz=/[\\^$.*+?()[\]{}|]/g,pz=/\\(\\)?/g,mz=/^\[object .+?Constructor\]$/,zu={function:!0,object:!0},gz=zu[typeof Ss]&&Ss&&!Ss.nodeType?Ss:void 0,yz=zu[typeof Ko]&&Ko&&!Ko.nodeType?Ko:void 0,Dz=eh(gz&&yz&&typeof global=="object"&&global),wz=eh(zu[typeof self]&&self),qO=eh(zu[typeof window]&&window),vD=eh(zu[typeof Ss]&&Ss),bz=Dz||qO!==(vD&&vD.window)&&qO||wz||vD||Function("return this")();function eh(t){return t&&t.Object===Object?t:null}function vz(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var Ez=Array.prototype,HO=Object.prototype,VO=Function.prototype.toString,ED=HO.hasOwnProperty,_z=HO.toString,Cz=RegExp("^"+VO.call(ED).replace(dz,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Sz=Ez.splice,Az=zO(bz,"Map"),Vu=zO(Object,"create");function As(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Oz(){this.__data__=Vu?Vu(null):{}}function xz(t){return this.has(t)&&delete this.__data__[t]}function Tz(t){var e=this.__data__;if(Vu){var r=e[t];return r===UO?void 0:r}return ED.call(e,t)?e[t]:void 0}function Fz(t){var e=this.__data__;return Vu?e[t]!==void 0:ED.call(e,t)}function Iz(t,e){var r=this.__data__;return r[t]=Vu&&e===void 0?UO:e,this}As.prototype.clear=Oz;As.prototype.delete=xz;As.prototype.get=Tz;As.prototype.has=Fz;As.prototype.set=Iz;function Wo(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function kz(){this.__data__=[]}function Pz(t){var e=this.__data__,r=th(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Sz.call(e,r,1),!0}function Rz(t){var e=this.__data__,r=th(e,t);return r<0?void 0:e[r][1]}function Nz(t){return th(this.__data__,t)>-1}function $z(t,e){var r=this.__data__,n=th(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Wo.prototype.clear=kz;Wo.prototype.delete=Pz;Wo.prototype.get=Rz;Wo.prototype.has=Nz;Wo.prototype.set=$z;function Os(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Lz(){this.__data__={hash:new As,map:new(Az||Wo),string:new As}}function jz(t){return rh(this,t).delete(t)}function Bz(t){return rh(this,t).get(t)}function Mz(t){return rh(this,t).has(t)}function qz(t,e){return rh(this,t).set(t,e),this}Os.prototype.clear=Lz;Os.prototype.delete=jz;Os.prototype.get=Bz;Os.prototype.has=Mz;Os.prototype.set=qz;function th(t,e){for(var r=t.length;r--;)if(zz(t[r][0],e))return r;return-1}function rh(t,e){var r=t.__data__;return Uz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function zO(t,e){var r=t[e];return Kz(r)?r:void 0}function Uz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Hz=_D(function(t){var e=[];return Wz(t).replace(hz,function(r,n,i,s){e.push(i?s.replace(pz,"$1"):n||r)}),e});function Vz(t){if(t!=null){try{return VO.call(t)}catch{}try{return t+""}catch{}}return""}function _D(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(cz);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=t.apply(this,n);return r.cache=s.set(i,o),o};return r.cache=new(_D.Cache||Os),r}_D.Cache=Os;function zz(t,e){return t===e||t!==t&&e!==e}function Gz(t){var e=GO(t)?_z.call(t):"";return e==lz||e==fz}function GO(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Kz(t){if(!GO(t))return!1;var e=Gz(t)||vz(t)?Cz:mz;return e.test(Vz(t))}function Wz(t){return t==null?"":uz(t)}Ko.exports=Hz});var _x=E((xs,Yo)=>{var Xz=KO(),Yz=200,RD="__lodash_hash_undefined__",ah=1,Jo=2,Jz=1/0,QO=9007199254740991,nh="[object Arguments]",AD="[object Array]",ex="[object Boolean]",tx="[object Date]",rx="[object Error]",nx="[object Function]",Zz="[object GeneratorFunction]",Gu="[object Map]",ix="[object Number]",Xo="[object Object]",WO="[object Promise]",sx="[object RegExp]",Ku="[object Set]",ND="[object String]",ox="[object Symbol]",OD="[object WeakMap]",ax="[object ArrayBuffer]",ih="[object DataView]",Qz="[object Float32Array]",eG="[object Float64Array]",tG="[object Int8Array]",rG="[object Int16Array]",nG="[object Int32Array]",iG="[object Uint8Array]",sG="[object Uint8ClampedArray]",oG="[object Uint16Array]",aG="[object Uint32Array]",uG=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cG=/^\w*$/,lG=/[\\^$.*+?()[\]{}|]/g,fG=/^\[object .+?Constructor\]$/,hG=/^(?:0|[1-9]\d*)$/,Xe={};Xe[Qz]=Xe[eG]=Xe[tG]=Xe[rG]=Xe[nG]=Xe[iG]=Xe[sG]=Xe[oG]=Xe[aG]=!0;Xe[nh]=Xe[AD]=Xe[ax]=Xe[ex]=Xe[ih]=Xe[tx]=Xe[rx]=Xe[nx]=Xe[Gu]=Xe[ix]=Xe[Xo]=Xe[sx]=Xe[Ku]=Xe[ND]=Xe[OD]=!1;var Xu={function:!0,object:!0},dG=Xu[typeof xs]&&xs&&!xs.nodeType?xs:void 0,pG=Xu[typeof Yo]&&Yo&&!Yo.nodeType?Yo:void 0,mG=uh(dG&&pG&&typeof global=="object"&&global),gG=uh(Xu[typeof self]&&self),XO=uh(Xu[typeof window]&&window),CD=uh(Xu[typeof xs]&&xs),Is=mG||XO!==(CD&&CD.window)&&XO||gG||CD||Function("return this")();function yG(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function DG(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function wG(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function bG(t,e){return yG(e,function(r){return[r,t[r]]})}function uh(t){return t&&t.Object===Object?t:null}function xD(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function ux(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function vG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function EG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var _G=Array.prototype,ch=Object.prototype,cx=Function.prototype.toString,Ts=ch.hasOwnProperty,ks=ch.toString,CG=RegExp("^"+cx.call(Ts).replace(lG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),YO=Is.Symbol,JO=Is.Uint8Array,SG=ch.propertyIsEnumerable,AG=_G.splice,OG=Object.getPrototypeOf,xG=Object.keys,TD=Zo(Is,"DataView"),sh=Zo(Is,"Map"),FD=Zo(Is,"Promise"),ID=Zo(Is,"Set"),kD=Zo(Is,"WeakMap"),Wu=Zo(Object,"create"),TG=Rs(TD),FG=Rs(sh),IG=Rs(FD),kG=Rs(ID),PG=Rs(kD),ZO=YO?YO.prototype:void 0,SD=ZO?ZO.valueOf:void 0;function Fs(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function RG(){this.__data__=Wu?Wu(null):{}}function NG(t){return this.has(t)&&delete this.__data__[t]}function $G(t){var e=this.__data__;if(Wu){var r=e[t];return r===RD?void 0:r}return Ts.call(e,t)?e[t]:void 0}function LG(t){var e=this.__data__;return Wu?e[t]!==void 0:Ts.call(e,t)}function jG(t,e){var r=this.__data__;return r[t]=Wu&&e===void 0?RD:e,this}Fs.prototype.clear=RG;Fs.prototype.delete=NG;Fs.prototype.get=$G;Fs.prototype.has=LG;Fs.prototype.set=jG;function Xn(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function BG(){this.__data__=[]}function MG(t){var e=this.__data__,r=lh(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():AG.call(e,r,1),!0}function qG(t){var e=this.__data__,r=lh(e,t);return r<0?void 0:e[r][1]}function UG(t){return lh(this.__data__,t)>-1}function HG(t,e){var r=this.__data__,n=lh(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Xn.prototype.clear=BG;Xn.prototype.delete=MG;Xn.prototype.get=qG;Xn.prototype.has=UG;Xn.prototype.set=HG;function Ps(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function VG(){this.__data__={hash:new Fs,map:new(sh||Xn),string:new Fs}}function zG(t){return fh(this,t).delete(t)}function GG(t){return fh(this,t).get(t)}function KG(t){return fh(this,t).has(t)}function WG(t,e){return fh(this,t).set(t,e),this}Ps.prototype.clear=VG;Ps.prototype.delete=zG;Ps.prototype.get=GG;Ps.prototype.has=KG;Ps.prototype.set=WG;function oh(t){var e=-1,r=t?t.length:0;for(this.__data__=new Ps;++e<r;)this.add(t[e])}function XG(t){return this.__data__.set(t,RD),this}function YG(t){return this.__data__.has(t)}oh.prototype.add=oh.prototype.push=XG;oh.prototype.has=YG;function Wn(t){this.__data__=new Xn(t)}function JG(){this.__data__=new Xn}function ZG(t){return this.__data__.delete(t)}function QG(t){return this.__data__.get(t)}function eK(t){return this.__data__.has(t)}function tK(t,e){var r=this.__data__;return r instanceof Xn&&r.__data__.length==Yz&&(r=this.__data__=new Ps(r.__data__)),r.set(t,e),this}Wn.prototype.clear=JG;Wn.prototype.delete=ZG;Wn.prototype.get=QG;Wn.prototype.has=eK;Wn.prototype.set=tK;function lh(t,e){for(var r=t.length;r--;)if(bK(t[r][0],e))return r;return-1}function lx(t,e){e=hh(e,t)?[e]:dx(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[dh(e[r++])];return r&&r==n?t:void 0}function fx(t,e){return Ts.call(t,e)||typeof t=="object"&&e in t&&mK(t)===null}function rK(t,e){return e in Object(t)}function $D(t,e,r,n,i){return t===e?!0:t==null||e==null||!mh(t)&&!Yu(e)?t!==t&&e!==e:nK(t,e,$D,r,n,i)}function nK(t,e,r,n,i,s){var o=Ii(t),a=Ii(e),u=AD,c=AD;o||(u=Kn(t),u=u==nh?Xo:u),a||(c=Kn(e),c=c==nh?Xo:c);var l=u==Xo&&!xD(t),h=c==Xo&&!xD(e),d=u==c;if(d&&!l)return s||(s=new Wn),o||_K(t)?px(t,e,r,n,i,s):fK(t,e,u,r,n,i,s);if(!(i&Jo)){var f=l&&Ts.call(t,"__wrapped__"),m=h&&Ts.call(e,"__wrapped__");if(f||m){var g=f?t.value():t,b=m?e.value():e;return s||(s=new Wn),r(g,b,n,i,s)}}return d?(s||(s=new Wn),hK(t,e,r,n,i,s)):!1}function iK(t,e,r,n){var i=r.length,s=i,o=!n;if(t==null)return!s;for(t=Object(t);i--;){var a=r[i];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=r[i];var u=a[0],c=t[u],l=a[1];if(o&&a[2]){if(c===void 0&&!(u in t))return!1}else{var h=new Wn;if(n)var d=n(c,l,u,t,e,h);if(!(d===void 0?$D(l,c,n,ah|Jo,h):d))return!1}}return!0}function sK(t){return typeof t=="function"?t:t==null?OK:typeof t=="object"?Ii(t)?uK(t[0],t[1]):aK(t):xK(t)}function oK(t){return xG(Object(t))}function aK(t){var e=pK(t);return e.length==1&&e[0][2]?yx(e[0][0],e[0][1]):function(r){return r===t||iK(r,t,e)}}function uK(t,e){return hh(t)&&gx(e)?yx(dh(t),e):function(r){var n=CK(r,t);return n===void 0&&n===e?SK(r,t):$D(e,n,void 0,ah|Jo)}}function hx(t){return function(e){return e?.[t]}}function cK(t){return function(e){return lx(e,t)}}function dx(t){return Ii(t)?t:Xz(t)}function lK(t){return function(e){var r=Kn(e);return r==Gu?ux(e):r==Ku?EG(e):bG(e,t(e))}}function px(t,e,r,n,i,s){var o=i&Jo,a=t.length,u=e.length;if(a!=u&&!(o&&u>a))return!1;var c=s.get(t);if(c)return c==e;var l=-1,h=!0,d=i&ah?new oh:void 0;for(s.set(t,e);++l<a;){var f=t[l],m=e[l];if(n)var g=o?n(m,f,l,e,t,s):n(f,m,l,t,e,s);if(g!==void 0){if(g)continue;h=!1;break}if(d){if(!DG(e,function(b,S){if(!d.has(S)&&(f===b||r(f,b,n,i,s)))return d.add(S)})){h=!1;break}}else if(!(f===m||r(f,m,n,i,s))){h=!1;break}}return s.delete(t),h}function fK(t,e,r,n,i,s,o){switch(r){case ih:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ax:return!(t.byteLength!=e.byteLength||!n(new JO(t),new JO(e)));case ex:case tx:return+t==+e;case rx:return t.name==e.name&&t.message==e.message;case ix:return t!=+t?e!=+e:t==+e;case sx:case ND:return t==e+"";case Gu:var a=ux;case Ku:var u=s&Jo;if(a||(a=vG),t.size!=e.size&&!u)return!1;var c=o.get(t);return c?c==e:(s|=ah,o.set(t,e),px(a(t),a(e),n,i,s,o));case ox:if(SD)return SD.call(t)==SD.call(e)}return!1}function hK(t,e,r,n,i,s){var o=i&Jo,a=PD(t),u=a.length,c=PD(e),l=c.length;if(u!=l&&!o)return!1;for(var h=u;h--;){var d=a[h];if(!(o?d in e:fx(e,d)))return!1}var f=s.get(t);if(f)return f==e;var m=!0;s.set(t,e);for(var g=o;++h<u;){d=a[h];var b=t[d],S=e[d];if(n)var A=o?n(S,b,d,e,t,s):n(b,S,d,t,e,s);if(!(A===void 0?b===S||r(b,S,n,i,s):A)){m=!1;break}g||(g=d=="constructor")}if(m&&!g){var p=t.constructor,D=e.constructor;p!=D&&"constructor"in t&&"constructor"in e&&!(typeof p=="function"&&p instanceof p&&typeof D=="function"&&D instanceof D)&&(m=!1)}return s.delete(t),m}var dK=hx("length");function fh(t,e){var r=t.__data__;return DK(e)?r[typeof e=="string"?"string":"hash"]:r.map}function pK(t){for(var e=AK(t),r=e.length;r--;)e[r][2]=gx(e[r][1]);return e}function Zo(t,e){var r=t[e];return EK(r)?r:void 0}function mK(t){return OG(Object(t))}function Kn(t){return ks.call(t)}(TD&&Kn(new TD(new ArrayBuffer(1)))!=ih||sh&&Kn(new sh)!=Gu||FD&&Kn(FD.resolve())!=WO||ID&&Kn(new ID)!=Ku||kD&&Kn(new kD)!=OD)&&(Kn=function(t){var e=ks.call(t),r=e==Xo?t.constructor:void 0,n=r?Rs(r):void 0;if(n)switch(n){case TG:return ih;case FG:return Gu;case IG:return WO;case kG:return Ku;case PG:return OD}return e});function gK(t,e,r){e=hh(e,t)?[e]:dx(e);for(var n,i=-1,o=e.length;++i<o;){var s=dh(e[i]);if(!(n=t!=null&&r(t,s)))break;t=t[s]}if(n)return n;var o=t?t.length:0;return!!o&&ph(o)&&mx(s,o)&&(Ii(t)||vx(t)||Dx(t))}function yK(t){var e=t?t.length:void 0;return ph(e)&&(Ii(t)||vx(t)||Dx(t))?wG(e,String):null}function mx(t,e){return e=e??QO,!!e&&(typeof t=="number"||hG.test(t))&&t>-1&&t%1==0&&t<e}function hh(t,e){if(Ii(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ex(t)?!0:cG.test(t)||!uG.test(t)||e!=null&&t in Object(e)}function DK(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function wK(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ch;return t===r}function gx(t){return t===t&&!mh(t)}function yx(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function dh(t){if(typeof t=="string"||Ex(t))return t;var e=t+"";return e=="0"&&1/t==-Jz?"-0":e}function Rs(t){if(t!=null){try{return cx.call(t)}catch{}try{return t+""}catch{}}return""}function bK(t,e){return t===e||t!==t&&e!==e}function Dx(t){return vK(t)&&Ts.call(t,"callee")&&(!SG.call(t,"callee")||ks.call(t)==nh)}var Ii=Array.isArray;function wx(t){return t!=null&&ph(dK(t))&&!bx(t)}function vK(t){return Yu(t)&&wx(t)}function bx(t){var e=mh(t)?ks.call(t):"";return e==nx||e==Zz}function ph(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=QO}function mh(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Yu(t){return!!t&&typeof t=="object"}function EK(t){if(!mh(t))return!1;var e=bx(t)||xD(t)?CG:fG;return e.test(Rs(t))}function vx(t){return typeof t=="string"||!Ii(t)&&Yu(t)&&ks.call(t)==ND}function Ex(t){return typeof t=="symbol"||Yu(t)&&ks.call(t)==ox}function _K(t){return Yu(t)&&ph(t.length)&&!!Xe[ks.call(t)]}function CK(t,e,r){var n=t==null?void 0:lx(t,e);return n===void 0?r:n}function SK(t,e){return t!=null&&gK(t,e,rK)}function PD(t){var e=wK(t);if(!(e||wx(t)))return oK(t);var r=yK(t),n=!!r,i=r||[],s=i.length;for(var o in t)fx(t,o)&&!(n&&(o=="length"||mx(o,s)))&&!(e&&o=="constructor")&&i.push(o);return i}var AK=lK(PD);function OK(t){return t}function xK(t){return hh(t)?hx(dh(t)):cK(t)}Yo.exports=sK});var xx=E((Ns,Qo)=>{var TK=1/0,FK="[object Function]",IK="[object GeneratorFunction]",kK=/[\\^$.*+?()[\]{}|]/g,PK=/^\[object .+?Constructor\]$/,Ju={function:!0,object:!0},RK=Ju[typeof Ns]&&Ns&&!Ns.nodeType?Ns:void 0,NK=Ju[typeof Qo]&&Qo&&!Qo.nodeType?Qo:void 0,$K=gh(RK&&NK&&typeof global=="object"&&global),LK=gh(Ju[typeof self]&&self),Cx=gh(Ju[typeof window]&&window),LD=gh(Ju[typeof Ns]&&Ns),jK=$K||Cx!==(LD&&LD.window)&&Cx||LK||LD||Function("return this")();function gh(t){return t&&t.Object===Object?t:null}function BK(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function MK(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Sx=Object.prototype,Ax=Function.prototype.toString,qK=Sx.hasOwnProperty,UK=Sx.toString,HK=RegExp("^"+Ax.call(qK).replace(kK,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jD=zK(jK,"Set"),VK=jD&&1/MK(new jD([,-0]))[1]==TK?function(t){return new jD(t)}:XK;function zK(t,e){var r=t[e];return WK(r)?r:void 0}function GK(t){if(t!=null){try{return Ax.call(t)}catch{}try{return t+""}catch{}}return""}function KK(t){var e=Ox(t)?UK.call(t):"";return e==FK||e==IK}function Ox(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function WK(t){if(!Ox(t))return!1;var e=KK(t)||BK(t)?HK:PK;return e.test(GK(t))}function XK(){}Qo.exports=VK});var Fx=E(($s,ea)=>{var Zu={function:!0,object:!0},YK=Zu[typeof $s]&&$s&&!$s.nodeType?$s:void 0,JK=Zu[typeof ea]&&ea&&!ea.nodeType?ea:void 0,ZK=yh(YK&&JK&&typeof global=="object"&&global),QK=yh(Zu[typeof self]&&self),Tx=yh(Zu[typeof window]&&window),BD=yh(Zu[typeof $s]&&$s),eW=ZK||Tx!==(BD&&BD.window)&&Tx||QK||BD||Function("return this")();function yh(t){return t&&t.Object===Object?t:null}ea.exports=eW});var $x=E((Cye,Nx)=>{var tW=xx(),rW=Fx(),nW=200,MD="__lodash_hash_undefined__",iW="[object Function]",sW="[object GeneratorFunction]",oW=/[\\^$.*+?()[\]{}|]/g,aW=/^\[object .+?Constructor\]$/;function uW(t,e){return!!t.length&&lW(t,e,0)>-1}function cW(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function lW(t,e,r){if(e!==e)return hW(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function fW(t,e){return t.has(e)}function hW(t,e,r){for(var n=t.length,i=e+(r?0:-1);r?i--:++i<n;){var s=t[i];if(s!==s)return i}return-1}function dW(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function pW(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var mW=Array.prototype,Ix=Object.prototype,kx=Function.prototype.toString,qD=Ix.hasOwnProperty,gW=Ix.toString,yW=RegExp("^"+kx.call(qD).replace(oW,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),DW=mW.splice,wW=Px(rW,"Map"),Qu=Px(Object,"create");function Ls(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function bW(){this.__data__=Qu?Qu(null):{}}function vW(t){return this.has(t)&&delete this.__data__[t]}function EW(t){var e=this.__data__;if(Qu){var r=e[t];return r===MD?void 0:r}return qD.call(e,t)?e[t]:void 0}function _W(t){var e=this.__data__;return Qu?e[t]!==void 0:qD.call(e,t)}function CW(t,e){var r=this.__data__;return r[t]=Qu&&e===void 0?MD:e,this}Ls.prototype.clear=bW;Ls.prototype.delete=vW;Ls.prototype.get=EW;Ls.prototype.has=_W;Ls.prototype.set=CW;function ta(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function SW(){this.__data__=[]}function AW(t){var e=this.__data__,r=wh(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():DW.call(e,r,1),!0}function OW(t){var e=this.__data__,r=wh(e,t);return r<0?void 0:e[r][1]}function xW(t){return wh(this.__data__,t)>-1}function TW(t,e){var r=this.__data__,n=wh(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ta.prototype.clear=SW;ta.prototype.delete=AW;ta.prototype.get=OW;ta.prototype.has=xW;ta.prototype.set=TW;function ra(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function FW(){this.__data__={hash:new Ls,map:new(wW||ta),string:new Ls}}function IW(t){return bh(this,t).delete(t)}function kW(t){return bh(this,t).get(t)}function PW(t){return bh(this,t).has(t)}function RW(t,e){return bh(this,t).set(t,e),this}ra.prototype.clear=FW;ra.prototype.delete=IW;ra.prototype.get=kW;ra.prototype.has=PW;ra.prototype.set=RW;function Dh(t){var e=-1,r=t?t.length:0;for(this.__data__=new ra;++e<r;)this.add(t[e])}function NW(t){return this.__data__.set(t,MD),this}function $W(t){return this.__data__.has(t)}Dh.prototype.add=Dh.prototype.push=NW;Dh.prototype.has=$W;function wh(t,e){for(var r=t.length;r--;)if(MW(t[r][0],e))return r;return-1}function LW(t,e,r){var n=-1,i=uW,s=t.length,o=!0,a=[],u=a;if(r)o=!1,i=cW;else if(s>=nW){var c=e?null:tW(t);if(c)return pW(c);o=!1,i=fW,u=new Dh}else u=e?[]:a;e:for(;++n<s;){var l=t[n],h=e?e(l):l;if(l=r||l!==0?l:0,o&&h===h){for(var d=u.length;d--;)if(u[d]===h)continue e;e&&u.push(h),a.push(l)}else i(u,h,r)||(u!==a&&u.push(h),a.push(l))}return a}function bh(t,e){var r=t.__data__;return jW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Px(t,e){var r=t[e];return UW(r)?r:void 0}function jW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function BW(t){if(t!=null){try{return kx.call(t)}catch{}try{return t+""}catch{}}return""}function MW(t,e){return t===e||t!==t&&e!==e}function qW(t){var e=Rx(t)?gW.call(t):"";return e==iW||e==sW}function Rx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function UW(t){if(!Rx(t))return!1;var e=qW(t)||dW(t)?yW:aW;return e.test(BW(t))}Nx.exports=LW});var jx=E((Sye,Lx)=>{var HW=_x(),VW=$x();function zW(t,e){return t&&t.length?VW(t,HW(e)):[]}Lx.exports=zW});var Mx=E((Aye,Bx)=>{"use strict";var GW=NO(),KW=jx(),WW=GW("MultiError");Bx.exports=UD;function UD(t){if(!(this instanceof UD))return new UD(t);if(t=Array.isArray(t)?t:[t],t=KW(t,function(r){return r.stack}),t.length===1)return t[0];var e=new WW({message:t.map(function(r){return r.message}).join("; "),errors:t.reduce(function(r,n){return r.concat(n.errors||n)},[])});return e.__defineGetter__("stack",function(){return t.map(function(r){return r.stack}).join(`
|
|
52
|
+
`),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(l){i=l,c()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return o},set:function(l){o=l,c()}}),c())}});var PO=E((vye,kO)=>{"use strict";kO.exports=_s;_s.factory=FO();var wD=_s("CustomError");wD.order=_s(wD,{message:"Arguments out of order.",code:"EOARG"});function _s(t,e,r,n){var i,s;return e=Jf(arguments,1,Error,IO,[yD,Zf]),r=Jf(arguments,2,{},yD,[Zf]),n=Jf(arguments,3,DD,Zf,[]),t=Jf(arguments,0,e===Error?"Error":e.prototype.CustomError.name,XV,[IO,yD,Zf]),s=e===Error,s&&n===DD&&(n=_s.factory.root),i=function(o,a){var u,c,l,h,d,f;if(!(this instanceof i))return new i(o,a);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof o=="string"&&(o={message:o}),o||(o={}),c=this.CustomError.chain.slice(0).reverse().map(function(m){return m.properties}),c.push(o),c.unshift({}),f=Object.assign.apply(Object,c),u=this,l={},Object.keys(_s.factory).forEach(function(m){l[m]=function(g,b){_s.factory[m].call(u,g,b,l)}}),h=this.CustomError.chain.length-1;h>=0;h--)d=this.CustomError.chain[h],d.factory!==DD&&d.factory.call(this,f,a,l)},i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.name=t,i.prototype.CustomError={chain:s?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},i.prototype.CustomError.chain.unshift(i.prototype.CustomError),i.prototype.toString=function(){var o=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(o+=" "+this.code),this.message&&(o+=": "+this.message),o},i}function Jf(t,e,r,n,i){var s=-1,o=-1,a,u,c=e<t.length?e:t.length,l;for(a=0;a<=c;a++){if(l=t[a],s===-1)for(u=0;u<i.length;u++)i[u](l)&&(s=a);o===-1&&n(l)&&(o=a)}if(o!==-1&&s!==-1&&s<o)throw new wD.order;return o!==-1?t[o]:r}function Zf(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function XV(t){return typeof t=="string"}function IO(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function yD(t){return t&&typeof t=="object"}function DD(){}});var NO=E((Eye,RO)=>{RO.exports=PO()});var MO=E((Cs,Go)=>{var YV=1/0,JV="[object Symbol]",Hu={function:!0,object:!0},ZV=Hu[typeof Cs]&&Cs&&!Cs.nodeType?Cs:void 0,QV=Hu[typeof Go]&&Go&&!Go.nodeType?Go:void 0,ez=Qf(ZV&&QV&&typeof global=="object"&&global),tz=Qf(Hu[typeof self]&&self),$O=Qf(Hu[typeof window]&&window),bD=Qf(Hu[typeof Cs]&&Cs),rz=ez||$O!==(bD&&bD.window)&&$O||tz||bD||Function("return this")();function Qf(t){return t&&t.Object===Object?t:null}var nz=Object.prototype,iz=nz.toString,LO=rz.Symbol,jO=LO?LO.prototype:void 0,BO=jO?jO.toString:void 0;function sz(t){if(typeof t=="string")return t;if(az(t))return BO?BO.call(t):"";var e=t+"";return e=="0"&&1/t==-YV?"-0":e}function oz(t){return!!t&&typeof t=="object"}function az(t){return typeof t=="symbol"||oz(t)&&iz.call(t)==JV}Go.exports=sz});var KO=E((Ss,Ko)=>{var uz=MO(),cz="Expected a function",UO="__lodash_hash_undefined__",lz="[object Function]",fz="[object GeneratorFunction]",hz=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,dz=/[\\^$.*+?()[\]{}|]/g,pz=/\\(\\)?/g,mz=/^\[object .+?Constructor\]$/,zu={function:!0,object:!0},gz=zu[typeof Ss]&&Ss&&!Ss.nodeType?Ss:void 0,yz=zu[typeof Ko]&&Ko&&!Ko.nodeType?Ko:void 0,Dz=eh(gz&&yz&&typeof global=="object"&&global),wz=eh(zu[typeof self]&&self),qO=eh(zu[typeof window]&&window),vD=eh(zu[typeof Ss]&&Ss),bz=Dz||qO!==(vD&&vD.window)&&qO||wz||vD||Function("return this")();function eh(t){return t&&t.Object===Object?t:null}function vz(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var Ez=Array.prototype,HO=Object.prototype,VO=Function.prototype.toString,ED=HO.hasOwnProperty,_z=HO.toString,Cz=RegExp("^"+VO.call(ED).replace(dz,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Sz=Ez.splice,Az=zO(bz,"Map"),Vu=zO(Object,"create");function As(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Oz(){this.__data__=Vu?Vu(null):{}}function xz(t){return this.has(t)&&delete this.__data__[t]}function Tz(t){var e=this.__data__;if(Vu){var r=e[t];return r===UO?void 0:r}return ED.call(e,t)?e[t]:void 0}function Fz(t){var e=this.__data__;return Vu?e[t]!==void 0:ED.call(e,t)}function Iz(t,e){var r=this.__data__;return r[t]=Vu&&e===void 0?UO:e,this}As.prototype.clear=Oz;As.prototype.delete=xz;As.prototype.get=Tz;As.prototype.has=Fz;As.prototype.set=Iz;function Wo(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function kz(){this.__data__=[]}function Pz(t){var e=this.__data__,r=th(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Sz.call(e,r,1),!0}function Rz(t){var e=this.__data__,r=th(e,t);return r<0?void 0:e[r][1]}function Nz(t){return th(this.__data__,t)>-1}function $z(t,e){var r=this.__data__,n=th(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Wo.prototype.clear=kz;Wo.prototype.delete=Pz;Wo.prototype.get=Rz;Wo.prototype.has=Nz;Wo.prototype.set=$z;function Os(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Lz(){this.__data__={hash:new As,map:new(Az||Wo),string:new As}}function jz(t){return rh(this,t).delete(t)}function Bz(t){return rh(this,t).get(t)}function Mz(t){return rh(this,t).has(t)}function qz(t,e){return rh(this,t).set(t,e),this}Os.prototype.clear=Lz;Os.prototype.delete=jz;Os.prototype.get=Bz;Os.prototype.has=Mz;Os.prototype.set=qz;function th(t,e){for(var r=t.length;r--;)if(zz(t[r][0],e))return r;return-1}function rh(t,e){var r=t.__data__;return Uz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function zO(t,e){var r=t[e];return Kz(r)?r:void 0}function Uz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Hz=_D(function(t){var e=[];return Wz(t).replace(hz,function(r,n,i,s){e.push(i?s.replace(pz,"$1"):n||r)}),e});function Vz(t){if(t!=null){try{return VO.call(t)}catch{}try{return t+""}catch{}}return""}function _D(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(cz);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=t.apply(this,n);return r.cache=s.set(i,o),o};return r.cache=new(_D.Cache||Os),r}_D.Cache=Os;function zz(t,e){return t===e||t!==t&&e!==e}function Gz(t){var e=GO(t)?_z.call(t):"";return e==lz||e==fz}function GO(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Kz(t){if(!GO(t))return!1;var e=Gz(t)||vz(t)?Cz:mz;return e.test(Vz(t))}function Wz(t){return t==null?"":uz(t)}Ko.exports=Hz});var _x=E((xs,Yo)=>{var Xz=KO(),Yz=200,RD="__lodash_hash_undefined__",ah=1,Jo=2,Jz=1/0,QO=9007199254740991,nh="[object Arguments]",AD="[object Array]",ex="[object Boolean]",tx="[object Date]",rx="[object Error]",nx="[object Function]",Zz="[object GeneratorFunction]",Gu="[object Map]",ix="[object Number]",Xo="[object Object]",WO="[object Promise]",sx="[object RegExp]",Ku="[object Set]",ND="[object String]",ox="[object Symbol]",OD="[object WeakMap]",ax="[object ArrayBuffer]",ih="[object DataView]",Qz="[object Float32Array]",eG="[object Float64Array]",tG="[object Int8Array]",rG="[object Int16Array]",nG="[object Int32Array]",iG="[object Uint8Array]",sG="[object Uint8ClampedArray]",oG="[object Uint16Array]",aG="[object Uint32Array]",uG=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cG=/^\w*$/,lG=/[\\^$.*+?()[\]{}|]/g,fG=/^\[object .+?Constructor\]$/,hG=/^(?:0|[1-9]\d*)$/,Xe={};Xe[Qz]=Xe[eG]=Xe[tG]=Xe[rG]=Xe[nG]=Xe[iG]=Xe[sG]=Xe[oG]=Xe[aG]=!0;Xe[nh]=Xe[AD]=Xe[ax]=Xe[ex]=Xe[ih]=Xe[tx]=Xe[rx]=Xe[nx]=Xe[Gu]=Xe[ix]=Xe[Xo]=Xe[sx]=Xe[Ku]=Xe[ND]=Xe[OD]=!1;var Xu={function:!0,object:!0},dG=Xu[typeof xs]&&xs&&!xs.nodeType?xs:void 0,pG=Xu[typeof Yo]&&Yo&&!Yo.nodeType?Yo:void 0,mG=uh(dG&&pG&&typeof global=="object"&&global),gG=uh(Xu[typeof self]&&self),XO=uh(Xu[typeof window]&&window),CD=uh(Xu[typeof xs]&&xs),Is=mG||XO!==(CD&&CD.window)&&XO||gG||CD||Function("return this")();function yG(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function DG(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function wG(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function bG(t,e){return yG(e,function(r){return[r,t[r]]})}function uh(t){return t&&t.Object===Object?t:null}function xD(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function ux(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function vG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function EG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var _G=Array.prototype,ch=Object.prototype,cx=Function.prototype.toString,Ts=ch.hasOwnProperty,ks=ch.toString,CG=RegExp("^"+cx.call(Ts).replace(lG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),YO=Is.Symbol,JO=Is.Uint8Array,SG=ch.propertyIsEnumerable,AG=_G.splice,OG=Object.getPrototypeOf,xG=Object.keys,TD=Zo(Is,"DataView"),sh=Zo(Is,"Map"),FD=Zo(Is,"Promise"),ID=Zo(Is,"Set"),kD=Zo(Is,"WeakMap"),Wu=Zo(Object,"create"),TG=Rs(TD),FG=Rs(sh),IG=Rs(FD),kG=Rs(ID),PG=Rs(kD),ZO=YO?YO.prototype:void 0,SD=ZO?ZO.valueOf:void 0;function Fs(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function RG(){this.__data__=Wu?Wu(null):{}}function NG(t){return this.has(t)&&delete this.__data__[t]}function $G(t){var e=this.__data__;if(Wu){var r=e[t];return r===RD?void 0:r}return Ts.call(e,t)?e[t]:void 0}function LG(t){var e=this.__data__;return Wu?e[t]!==void 0:Ts.call(e,t)}function jG(t,e){var r=this.__data__;return r[t]=Wu&&e===void 0?RD:e,this}Fs.prototype.clear=RG;Fs.prototype.delete=NG;Fs.prototype.get=$G;Fs.prototype.has=LG;Fs.prototype.set=jG;function Xn(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function BG(){this.__data__=[]}function MG(t){var e=this.__data__,r=lh(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():AG.call(e,r,1),!0}function qG(t){var e=this.__data__,r=lh(e,t);return r<0?void 0:e[r][1]}function UG(t){return lh(this.__data__,t)>-1}function HG(t,e){var r=this.__data__,n=lh(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Xn.prototype.clear=BG;Xn.prototype.delete=MG;Xn.prototype.get=qG;Xn.prototype.has=UG;Xn.prototype.set=HG;function Ps(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function VG(){this.__data__={hash:new Fs,map:new(sh||Xn),string:new Fs}}function zG(t){return fh(this,t).delete(t)}function GG(t){return fh(this,t).get(t)}function KG(t){return fh(this,t).has(t)}function WG(t,e){return fh(this,t).set(t,e),this}Ps.prototype.clear=VG;Ps.prototype.delete=zG;Ps.prototype.get=GG;Ps.prototype.has=KG;Ps.prototype.set=WG;function oh(t){var e=-1,r=t?t.length:0;for(this.__data__=new Ps;++e<r;)this.add(t[e])}function XG(t){return this.__data__.set(t,RD),this}function YG(t){return this.__data__.has(t)}oh.prototype.add=oh.prototype.push=XG;oh.prototype.has=YG;function Wn(t){this.__data__=new Xn(t)}function JG(){this.__data__=new Xn}function ZG(t){return this.__data__.delete(t)}function QG(t){return this.__data__.get(t)}function eK(t){return this.__data__.has(t)}function tK(t,e){var r=this.__data__;return r instanceof Xn&&r.__data__.length==Yz&&(r=this.__data__=new Ps(r.__data__)),r.set(t,e),this}Wn.prototype.clear=JG;Wn.prototype.delete=ZG;Wn.prototype.get=QG;Wn.prototype.has=eK;Wn.prototype.set=tK;function lh(t,e){for(var r=t.length;r--;)if(bK(t[r][0],e))return r;return-1}function lx(t,e){e=hh(e,t)?[e]:dx(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[dh(e[r++])];return r&&r==n?t:void 0}function fx(t,e){return Ts.call(t,e)||typeof t=="object"&&e in t&&mK(t)===null}function rK(t,e){return e in Object(t)}function $D(t,e,r,n,i){return t===e?!0:t==null||e==null||!mh(t)&&!Yu(e)?t!==t&&e!==e:nK(t,e,$D,r,n,i)}function nK(t,e,r,n,i,s){var o=Ii(t),a=Ii(e),u=AD,c=AD;o||(u=Kn(t),u=u==nh?Xo:u),a||(c=Kn(e),c=c==nh?Xo:c);var l=u==Xo&&!xD(t),h=c==Xo&&!xD(e),d=u==c;if(d&&!l)return s||(s=new Wn),o||_K(t)?px(t,e,r,n,i,s):fK(t,e,u,r,n,i,s);if(!(i&Jo)){var f=l&&Ts.call(t,"__wrapped__"),m=h&&Ts.call(e,"__wrapped__");if(f||m){var g=f?t.value():t,b=m?e.value():e;return s||(s=new Wn),r(g,b,n,i,s)}}return d?(s||(s=new Wn),hK(t,e,r,n,i,s)):!1}function iK(t,e,r,n){var i=r.length,s=i,o=!n;if(t==null)return!s;for(t=Object(t);i--;){var a=r[i];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=r[i];var u=a[0],c=t[u],l=a[1];if(o&&a[2]){if(c===void 0&&!(u in t))return!1}else{var h=new Wn;if(n)var d=n(c,l,u,t,e,h);if(!(d===void 0?$D(l,c,n,ah|Jo,h):d))return!1}}return!0}function sK(t){return typeof t=="function"?t:t==null?OK:typeof t=="object"?Ii(t)?uK(t[0],t[1]):aK(t):xK(t)}function oK(t){return xG(Object(t))}function aK(t){var e=pK(t);return e.length==1&&e[0][2]?yx(e[0][0],e[0][1]):function(r){return r===t||iK(r,t,e)}}function uK(t,e){return hh(t)&&gx(e)?yx(dh(t),e):function(r){var n=CK(r,t);return n===void 0&&n===e?SK(r,t):$D(e,n,void 0,ah|Jo)}}function hx(t){return function(e){return e?.[t]}}function cK(t){return function(e){return lx(e,t)}}function dx(t){return Ii(t)?t:Xz(t)}function lK(t){return function(e){var r=Kn(e);return r==Gu?ux(e):r==Ku?EG(e):bG(e,t(e))}}function px(t,e,r,n,i,s){var o=i&Jo,a=t.length,u=e.length;if(a!=u&&!(o&&u>a))return!1;var c=s.get(t);if(c)return c==e;var l=-1,h=!0,d=i&ah?new oh:void 0;for(s.set(t,e);++l<a;){var f=t[l],m=e[l];if(n)var g=o?n(m,f,l,e,t,s):n(f,m,l,t,e,s);if(g!==void 0){if(g)continue;h=!1;break}if(d){if(!DG(e,function(b,S){if(!d.has(S)&&(f===b||r(f,b,n,i,s)))return d.add(S)})){h=!1;break}}else if(!(f===m||r(f,m,n,i,s))){h=!1;break}}return s.delete(t),h}function fK(t,e,r,n,i,s,o){switch(r){case ih:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ax:return!(t.byteLength!=e.byteLength||!n(new JO(t),new JO(e)));case ex:case tx:return+t==+e;case rx:return t.name==e.name&&t.message==e.message;case ix:return t!=+t?e!=+e:t==+e;case sx:case ND:return t==e+"";case Gu:var a=ux;case Ku:var u=s&Jo;if(a||(a=vG),t.size!=e.size&&!u)return!1;var c=o.get(t);return c?c==e:(s|=ah,o.set(t,e),px(a(t),a(e),n,i,s,o));case ox:if(SD)return SD.call(t)==SD.call(e)}return!1}function hK(t,e,r,n,i,s){var o=i&Jo,a=PD(t),u=a.length,c=PD(e),l=c.length;if(u!=l&&!o)return!1;for(var h=u;h--;){var d=a[h];if(!(o?d in e:fx(e,d)))return!1}var f=s.get(t);if(f)return f==e;var m=!0;s.set(t,e);for(var g=o;++h<u;){d=a[h];var b=t[d],S=e[d];if(n)var A=o?n(S,b,d,e,t,s):n(b,S,d,t,e,s);if(!(A===void 0?b===S||r(b,S,n,i,s):A)){m=!1;break}g||(g=d=="constructor")}if(m&&!g){var p=t.constructor,D=e.constructor;p!=D&&"constructor"in t&&"constructor"in e&&!(typeof p=="function"&&p instanceof p&&typeof D=="function"&&D instanceof D)&&(m=!1)}return s.delete(t),m}var dK=hx("length");function fh(t,e){var r=t.__data__;return DK(e)?r[typeof e=="string"?"string":"hash"]:r.map}function pK(t){for(var e=AK(t),r=e.length;r--;)e[r][2]=gx(e[r][1]);return e}function Zo(t,e){var r=t[e];return EK(r)?r:void 0}function mK(t){return OG(Object(t))}function Kn(t){return ks.call(t)}(TD&&Kn(new TD(new ArrayBuffer(1)))!=ih||sh&&Kn(new sh)!=Gu||FD&&Kn(FD.resolve())!=WO||ID&&Kn(new ID)!=Ku||kD&&Kn(new kD)!=OD)&&(Kn=function(t){var e=ks.call(t),r=e==Xo?t.constructor:void 0,n=r?Rs(r):void 0;if(n)switch(n){case TG:return ih;case FG:return Gu;case IG:return WO;case kG:return Ku;case PG:return OD}return e});function gK(t,e,r){e=hh(e,t)?[e]:dx(e);for(var n,i=-1,o=e.length;++i<o;){var s=dh(e[i]);if(!(n=t!=null&&r(t,s)))break;t=t[s]}if(n)return n;var o=t?t.length:0;return!!o&&ph(o)&&mx(s,o)&&(Ii(t)||vx(t)||Dx(t))}function yK(t){var e=t?t.length:void 0;return ph(e)&&(Ii(t)||vx(t)||Dx(t))?wG(e,String):null}function mx(t,e){return e=e??QO,!!e&&(typeof t=="number"||hG.test(t))&&t>-1&&t%1==0&&t<e}function hh(t,e){if(Ii(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ex(t)?!0:cG.test(t)||!uG.test(t)||e!=null&&t in Object(e)}function DK(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function wK(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ch;return t===r}function gx(t){return t===t&&!mh(t)}function yx(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function dh(t){if(typeof t=="string"||Ex(t))return t;var e=t+"";return e=="0"&&1/t==-Jz?"-0":e}function Rs(t){if(t!=null){try{return cx.call(t)}catch{}try{return t+""}catch{}}return""}function bK(t,e){return t===e||t!==t&&e!==e}function Dx(t){return vK(t)&&Ts.call(t,"callee")&&(!SG.call(t,"callee")||ks.call(t)==nh)}var Ii=Array.isArray;function wx(t){return t!=null&&ph(dK(t))&&!bx(t)}function vK(t){return Yu(t)&&wx(t)}function bx(t){var e=mh(t)?ks.call(t):"";return e==nx||e==Zz}function ph(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=QO}function mh(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Yu(t){return!!t&&typeof t=="object"}function EK(t){if(!mh(t))return!1;var e=bx(t)||xD(t)?CG:fG;return e.test(Rs(t))}function vx(t){return typeof t=="string"||!Ii(t)&&Yu(t)&&ks.call(t)==ND}function Ex(t){return typeof t=="symbol"||Yu(t)&&ks.call(t)==ox}function _K(t){return Yu(t)&&ph(t.length)&&!!Xe[ks.call(t)]}function CK(t,e,r){var n=t==null?void 0:lx(t,e);return n===void 0?r:n}function SK(t,e){return t!=null&&gK(t,e,rK)}function PD(t){var e=wK(t);if(!(e||wx(t)))return oK(t);var r=yK(t),n=!!r,i=r||[],s=i.length;for(var o in t)fx(t,o)&&!(n&&(o=="length"||mx(o,s)))&&!(e&&o=="constructor")&&i.push(o);return i}var AK=lK(PD);function OK(t){return t}function xK(t){return hh(t)?hx(dh(t)):cK(t)}Yo.exports=sK});var xx=E((Ns,Qo)=>{var TK=1/0,FK="[object Function]",IK="[object GeneratorFunction]",kK=/[\\^$.*+?()[\]{}|]/g,PK=/^\[object .+?Constructor\]$/,Ju={function:!0,object:!0},RK=Ju[typeof Ns]&&Ns&&!Ns.nodeType?Ns:void 0,NK=Ju[typeof Qo]&&Qo&&!Qo.nodeType?Qo:void 0,$K=gh(RK&&NK&&typeof global=="object"&&global),LK=gh(Ju[typeof self]&&self),Cx=gh(Ju[typeof window]&&window),LD=gh(Ju[typeof Ns]&&Ns),jK=$K||Cx!==(LD&&LD.window)&&Cx||LK||LD||Function("return this")();function gh(t){return t&&t.Object===Object?t:null}function BK(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function MK(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Sx=Object.prototype,Ax=Function.prototype.toString,qK=Sx.hasOwnProperty,UK=Sx.toString,HK=RegExp("^"+Ax.call(qK).replace(kK,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jD=zK(jK,"Set"),VK=jD&&1/MK(new jD([,-0]))[1]==TK?function(t){return new jD(t)}:XK;function zK(t,e){var r=t[e];return WK(r)?r:void 0}function GK(t){if(t!=null){try{return Ax.call(t)}catch{}try{return t+""}catch{}}return""}function KK(t){var e=Ox(t)?UK.call(t):"";return e==FK||e==IK}function Ox(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function WK(t){if(!Ox(t))return!1;var e=KK(t)||BK(t)?HK:PK;return e.test(GK(t))}function XK(){}Qo.exports=VK});var Fx=E(($s,ea)=>{var Zu={function:!0,object:!0},YK=Zu[typeof $s]&&$s&&!$s.nodeType?$s:void 0,JK=Zu[typeof ea]&&ea&&!ea.nodeType?ea:void 0,ZK=yh(YK&&JK&&typeof global=="object"&&global),QK=yh(Zu[typeof self]&&self),Tx=yh(Zu[typeof window]&&window),BD=yh(Zu[typeof $s]&&$s),eW=ZK||Tx!==(BD&&BD.window)&&Tx||QK||BD||Function("return this")();function yh(t){return t&&t.Object===Object?t:null}ea.exports=eW});var $x=E((_ye,Nx)=>{var tW=xx(),rW=Fx(),nW=200,MD="__lodash_hash_undefined__",iW="[object Function]",sW="[object GeneratorFunction]",oW=/[\\^$.*+?()[\]{}|]/g,aW=/^\[object .+?Constructor\]$/;function uW(t,e){return!!t.length&&lW(t,e,0)>-1}function cW(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function lW(t,e,r){if(e!==e)return hW(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function fW(t,e){return t.has(e)}function hW(t,e,r){for(var n=t.length,i=e+(r?0:-1);r?i--:++i<n;){var s=t[i];if(s!==s)return i}return-1}function dW(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function pW(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var mW=Array.prototype,Ix=Object.prototype,kx=Function.prototype.toString,qD=Ix.hasOwnProperty,gW=Ix.toString,yW=RegExp("^"+kx.call(qD).replace(oW,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),DW=mW.splice,wW=Px(rW,"Map"),Qu=Px(Object,"create");function Ls(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function bW(){this.__data__=Qu?Qu(null):{}}function vW(t){return this.has(t)&&delete this.__data__[t]}function EW(t){var e=this.__data__;if(Qu){var r=e[t];return r===MD?void 0:r}return qD.call(e,t)?e[t]:void 0}function _W(t){var e=this.__data__;return Qu?e[t]!==void 0:qD.call(e,t)}function CW(t,e){var r=this.__data__;return r[t]=Qu&&e===void 0?MD:e,this}Ls.prototype.clear=bW;Ls.prototype.delete=vW;Ls.prototype.get=EW;Ls.prototype.has=_W;Ls.prototype.set=CW;function ta(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function SW(){this.__data__=[]}function AW(t){var e=this.__data__,r=wh(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():DW.call(e,r,1),!0}function OW(t){var e=this.__data__,r=wh(e,t);return r<0?void 0:e[r][1]}function xW(t){return wh(this.__data__,t)>-1}function TW(t,e){var r=this.__data__,n=wh(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}ta.prototype.clear=SW;ta.prototype.delete=AW;ta.prototype.get=OW;ta.prototype.has=xW;ta.prototype.set=TW;function ra(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function FW(){this.__data__={hash:new Ls,map:new(wW||ta),string:new Ls}}function IW(t){return bh(this,t).delete(t)}function kW(t){return bh(this,t).get(t)}function PW(t){return bh(this,t).has(t)}function RW(t,e){return bh(this,t).set(t,e),this}ra.prototype.clear=FW;ra.prototype.delete=IW;ra.prototype.get=kW;ra.prototype.has=PW;ra.prototype.set=RW;function Dh(t){var e=-1,r=t?t.length:0;for(this.__data__=new ra;++e<r;)this.add(t[e])}function NW(t){return this.__data__.set(t,MD),this}function $W(t){return this.__data__.has(t)}Dh.prototype.add=Dh.prototype.push=NW;Dh.prototype.has=$W;function wh(t,e){for(var r=t.length;r--;)if(MW(t[r][0],e))return r;return-1}function LW(t,e,r){var n=-1,i=uW,s=t.length,o=!0,a=[],u=a;if(r)o=!1,i=cW;else if(s>=nW){var c=e?null:tW(t);if(c)return pW(c);o=!1,i=fW,u=new Dh}else u=e?[]:a;e:for(;++n<s;){var l=t[n],h=e?e(l):l;if(l=r||l!==0?l:0,o&&h===h){for(var d=u.length;d--;)if(u[d]===h)continue e;e&&u.push(h),a.push(l)}else i(u,h,r)||(u!==a&&u.push(h),a.push(l))}return a}function bh(t,e){var r=t.__data__;return jW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Px(t,e){var r=t[e];return UW(r)?r:void 0}function jW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function BW(t){if(t!=null){try{return kx.call(t)}catch{}try{return t+""}catch{}}return""}function MW(t,e){return t===e||t!==t&&e!==e}function qW(t){var e=Rx(t)?gW.call(t):"";return e==iW||e==sW}function Rx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function UW(t){if(!Rx(t))return!1;var e=qW(t)||dW(t)?yW:aW;return e.test(BW(t))}Nx.exports=LW});var jx=E((Cye,Lx)=>{var HW=_x(),VW=$x();function zW(t,e){return t&&t.length?VW(t,HW(e)):[]}Lx.exports=zW});var Mx=E((Sye,Bx)=>{"use strict";var GW=NO(),KW=jx(),WW=GW("MultiError");Bx.exports=UD;function UD(t){if(!(this instanceof UD))return new UD(t);if(t=Array.isArray(t)?t:[t],t=KW(t,function(r){return r.stack}),t.length===1)return t[0];var e=new WW({message:t.map(function(r){return r.message}).join("; "),errors:t.reduce(function(r,n){return r.concat(n.errors||n)},[])});return e.__defineGetter__("stack",function(){return t.map(function(r){return r.stack}).join(`
|
|
53
53
|
|
|
54
54
|
`)}),e.__defineSetter__("stack",function(r){return[r].concat(e.stack).join(`
|
|
55
55
|
|
|
56
|
-
`)}),e}});var Ux=E((
|
|
57
|
-
GFS4: `),console.error(t)});ut[Mt]||(Wx=global[Mt]||[],Yx(ut,Wx),ut.close=(function(t){function e(r,n){return t.call(ut,r,function(i){i||Xx(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Ch,{value:t}),e})(ut.close),ut.closeSync=(function(t){function e(r){t.apply(ut,arguments),Xx()}return Object.defineProperty(e,Ch,{value:t}),e})(ut.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){js(ut[Mt]),require("assert").equal(ut[Mt].length,0)}));var Wx;global[Mt]||Yx(global,ut[Mt]);GD.exports=VD(nX(ut));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ut.__patched&&(GD.exports=VD(ut),ut.__patched=!0);function VD(t){tX(t),t.gracefulify=VD,t.createReadStream=y,t.createWriteStream=C;var e=t.readFile;t.readFile=r;function r(R,P,F){return typeof P=="function"&&(F=P,P=null),j(R,P,F);function j(U,G,L,_){return e(U,G,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?na([j,[U,G,L],T,_||Date.now(),Date.now()]):typeof L=="function"&&L.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(R,P,F,j){return typeof F=="function"&&(j=F,F=null),U(R,P,F,j);function U(G,L,_,T,I){return n(G,L,_,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?na([U,[G,L,_,T],$,I||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var s=t.appendFile;s&&(t.appendFile=o);function o(R,P,F,j){return typeof F=="function"&&(j=F,F=null),U(R,P,F,j);function U(G,L,_,T,I){return s(G,L,_,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?na([U,[G,L,_,T],$,I||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(R,P,F,j){return typeof F=="function"&&(j=F,F=0),U(R,P,F,j);function U(G,L,_,T,I){return a(G,L,_,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?na([U,[G,L,_,T],$,I||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var c=t.readdir;t.readdir=h;var l=/^v[0-5]\./;function h(R,P,F){typeof P=="function"&&(F=P,P=null);var j=l.test(process.version)?function(L,_,T,I){return c(L,U(L,_,T,I))}:function(L,_,T,I){return c(L,_,U(L,_,T,I))};return j(R,P,F);function U(G,L,_,T){return function(I,$){I&&(I.code==="EMFILE"||I.code==="ENFILE")?na([j,[G,L,_],I,T||Date.now(),Date.now()]):($&&$.sort&&$.sort(),typeof _=="function"&&_.call(this,I,$))}}}if(process.version.substr(0,4)==="v0.8"){var d=rX(t);S=d.ReadStream,p=d.WriteStream}var f=t.ReadStream;f&&(S.prototype=Object.create(f.prototype),S.prototype.open=A);var m=t.WriteStream;m&&(p.prototype=Object.create(m.prototype),p.prototype.open=D),Object.defineProperty(t,"ReadStream",{get:function(){return S},set:function(R){S=R},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return p},set:function(R){p=R},enumerable:!0,configurable:!0});var g=S;Object.defineProperty(t,"FileReadStream",{get:function(){return g},set:function(R){g=R},enumerable:!0,configurable:!0});var b=p;Object.defineProperty(t,"FileWriteStream",{get:function(){return b},set:function(R){b=R},enumerable:!0,configurable:!0});function S(R,P){return this instanceof S?(f.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}function A(){var R=this;v(R.path,R.flags,R.mode,function(P,F){P?(R.autoClose&&R.destroy(),R.emit("error",P)):(R.fd=F,R.emit("open",F),R.read())})}function p(R,P){return this instanceof p?(m.apply(this,arguments),this):p.apply(Object.create(p.prototype),arguments)}function D(){var R=this;v(R.path,R.flags,R.mode,function(P,F){P?(R.destroy(),R.emit("error",P)):(R.fd=F,R.emit("open",F))})}function y(R,P){return new t.ReadStream(R,P)}function C(R,P){return new t.WriteStream(R,P)}var k=t.open;t.open=v;function v(R,P,F,j){return typeof F=="function"&&(j=F,F=null),U(R,P,F,j);function U(G,L,_,T,I){return k(G,L,_,function($,M){$&&($.code==="EMFILE"||$.code==="ENFILE")?na([U,[G,L,_,T],$,I||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}return t}function na(t){js("ENQUEUE",t[0].name,t[1]),ut[Mt].push(t),zD()}var _h;function Xx(){for(var t=Date.now(),e=0;e<ut[Mt].length;++e)ut[Mt][e].length>2&&(ut[Mt][e][3]=t,ut[Mt][e][4]=t);zD()}function zD(){if(clearTimeout(_h),_h=void 0,ut[Mt].length!==0){var t=ut[Mt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],s=t[4];if(i===void 0)js("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){js("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n)}else{var a=Date.now()-s,u=Math.max(s-i,1),c=Math.min(u*1.2,100);a>=c?(js("RETRY",e.name,r),e.apply(null,r.concat([i]))):ut[Mt].push(t)}_h===void 0&&(_h=setTimeout(zD,0))}}});var Zx=E((Iye,Jx)=>{function Ur(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Jx.exports=Ur;Ur.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Ur.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Ur.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};Ur.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Ur.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Ur.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Ur.prototype.start=Ur.prototype.try;Ur.prototype.errors=function(){return this._errors};Ur.prototype.attempts=function(){return this._attempts};Ur.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],s=i.message,o=(t[s]||0)+1;t[s]=o,o>=r&&(e=i,r=o)}return e}});var Qx=E(Bs=>{var sX=Zx();Bs.operation=function(t){var e=Bs.timeouts(t);return new sX(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};Bs.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(s,o){return s-o}),n};Bs.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};Bs.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var s=r[i],o=t[s];t[s]=function(u){var c=Bs.operation(e),l=Array.prototype.slice.call(arguments,1),h=l.pop();l.push(function(d){c.retry(d)||(d&&(arguments[0]=c.mainError()),h.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,o),t[s].options=e}}});var t1=E((Pye,e1)=>{e1.exports=Qx()});var r1=E((Rye,Sh)=>{Sh.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Sh.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Sh.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Th=E((Nye,oa)=>{var rt=global.process,Ms=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};Ms(rt)?(n1=require("assert"),ia=r1(),i1=/^win/i.test(rt.platform),ec=require("events"),typeof ec!="function"&&(ec=ec.EventEmitter),rt.__signal_exit_emitter__?kt=rt.__signal_exit_emitter__:(kt=rt.__signal_exit_emitter__=new ec,kt.count=0,kt.emitted={}),kt.infinite||(kt.setMaxListeners(1/0),kt.infinite=!0),oa.exports=function(t,e){if(!Ms(global.process))return function(){};n1.equal(typeof t,"function","a callback must be provided for exit handler"),sa===!1&&KD();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){kt.removeListener(r,t),kt.listeners("exit").length===0&&kt.listeners("afterexit").length===0&&Ah()};return kt.on(r,t),n},Ah=function(){!sa||!Ms(global.process)||(sa=!1,ia.forEach(function(e){try{rt.removeListener(e,Oh[e])}catch{}}),rt.emit=xh,rt.reallyExit=WD,kt.count-=1)},oa.exports.unload=Ah,qs=function(e,r,n){kt.emitted[e]||(kt.emitted[e]=!0,kt.emit(e,r,n))},Oh={},ia.forEach(function(t){Oh[t]=function(){if(Ms(global.process)){var r=rt.listeners(t);r.length===kt.count&&(Ah(),qs("exit",null,t),qs("afterexit",null,t),i1&&t==="SIGHUP"&&(t="SIGINT"),rt.kill(rt.pid,t))}}}),oa.exports.signals=function(){return ia},sa=!1,KD=function(){sa||!Ms(global.process)||(sa=!0,kt.count+=1,ia=ia.filter(function(e){try{return rt.on(e,Oh[e]),!0}catch{return!1}}),rt.emit=o1,rt.reallyExit=s1)},oa.exports.load=KD,WD=rt.reallyExit,s1=function(e){Ms(global.process)&&(rt.exitCode=e||0,qs("exit",rt.exitCode,null),qs("afterexit",rt.exitCode,null),WD.call(rt,rt.exitCode))},xh=rt.emit,o1=function(e,r){if(e==="exit"&&Ms(global.process)){r!==void 0&&(rt.exitCode=r);var n=xh.apply(this,arguments);return qs("exit",rt.exitCode,null),qs("afterexit",rt.exitCode,null),n}else return xh.apply(this,arguments)}):oa.exports=function(){return function(){}};var n1,ia,i1,ec,kt,Ah,qs,Oh,sa,KD,WD,s1,xh,o1});var u1=E(($ye,XD)=>{"use strict";var a1=Symbol();function oX(t,e,r){let n=e[a1];if(n)return e.stat(t,(s,o)=>{if(s)return r(s);r(null,o.mtime,n)});let i=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,i,i,s=>{if(s)return r(s);e.stat(t,(o,a)=>{if(o)return r(o);let u=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,a1,{value:u}),r(null,a.mtime,u)})})}function aX(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}XD.exports.probe=oX;XD.exports.getMtime=aX});var d1=E((Lye,rc)=>{"use strict";var uX=require("path"),ZD=pt(),cX=t1(),lX=Th(),c1=u1(),Yn={};function tc(t,e){return e.lockfilePath||`${t}.lock`}function QD(t,e,r){if(!e.realpath)return r(null,uX.resolve(t));e.fs.realpath(t,r)}function JD(t,e,r){let n=tc(t,e);e.fs.mkdir(n,i=>{if(!i)return c1.probe(n,e.fs,(s,o,a)=>{if(s)return e.fs.rmdir(n,()=>{}),r(s);r(null,o,a)});if(i.code!=="EEXIST")return r(i);if(e.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(n,(s,o)=>{if(s)return s.code==="ENOENT"?JD(t,{...e,stale:0},r):r(s);if(!l1(o,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));f1(t,e,a=>{if(a)return r(a);JD(t,{...e,stale:0},r)})})})}function l1(t,e){return t.mtime.getTime()<Date.now()-e.stale}function f1(t,e,r){e.fs.rmdir(tc(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Fh(t,e){let r=Yn[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,i)=>{let s=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||s?YD(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Fh(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return YD(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=c1.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let c=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||c?YD(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Fh(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,Fh(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function YD(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),Yn[t]===e&&delete Yn[t],e.options.onCompromised(r)}function fX(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:ZD,onCompromised:n=>{throw n},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),QD(t,e,(n,i)=>{if(n)return r(n);let s=cX.operation(e.retries);s.attempt(()=>{JD(i,e,(o,a,u)=>{if(s.retry(o))return;if(o)return r(s.mainError());let c=Yn[i]={lockfilePath:tc(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};Fh(i,e),r(null,l=>{if(c.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));h1(i,{...e,realpath:!1},l)})})})})}function h1(t,e,r){e={fs:ZD,realpath:!0,...e},QD(t,e,(n,i)=>{if(n)return r(n);let s=Yn[i];if(!s)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));s.updateTimeout&&clearTimeout(s.updateTimeout),s.released=!0,delete Yn[i],f1(i,e,r)})}function hX(t,e,r){e={stale:1e4,realpath:!0,fs:ZD,...e},e.stale=Math.max(e.stale||0,2e3),QD(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(tc(i,e),(s,o)=>s?s.code==="ENOENT"?r(null,!1):r(s):r(null,!l1(o,e)))})}function dX(){return Yn}lX(()=>{for(let t in Yn){let e=Yn[t].options;try{e.fs.rmdirSync(tc(t,e))}catch{}}});rc.exports.lock=fX;rc.exports.unlock=h1;rc.exports.check=hX;rc.exports.getLocks=dX});var m1=E((jye,p1)=>{"use strict";var pX=pt();function mX(t){let e=["mkdir","realpath","stat","rmdir","utimes"],r={...t};return e.forEach(n=>{r[n]=(...i)=>{let s=i.pop(),o;try{o=t[`${n}Sync`](...i)}catch(a){return s(a)}s(null,o)}}),r}function gX(t){return(...e)=>new Promise((r,n)=>{e.push((i,s)=>{i?n(i):r(s)}),t(...e)})}function yX(t){return(...e)=>{let r,n;if(e.push((i,s)=>{r=i,n=s}),t(...e),r)throw r;return n}}function DX(t){if(t={...t},t.fs=mX(t.fs||pX),typeof t.retries=="number"&&t.retries>0||t.retries&&typeof t.retries.retries=="number"&&t.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return t}p1.exports={toPromise:gX,toSync:yX,toSyncOptions:DX}});var y1=E((Bye,Pi)=>{"use strict";var aa=d1(),{toPromise:Ih,toSync:kh,toSyncOptions:e0}=m1();async function g1(t,e){let r=await Ih(aa.lock)(t,e);return Ih(r)}function wX(t,e){let r=kh(aa.lock)(t,e0(e));return kh(r)}function bX(t,e){return Ih(aa.unlock)(t,e)}function vX(t,e){return kh(aa.unlock)(t,e0(e))}function EX(t,e){return Ih(aa.check)(t,e)}function _X(t,e){return kh(aa.check)(t,e0(e))}Pi.exports=g1;Pi.exports.lock=g1;Pi.exports.unlock=bX;Pi.exports.lockSync=wX;Pi.exports.unlockSync=vX;Pi.exports.check=EX;Pi.exports.checkSync=_X});var E1=E(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.canStoreURLs=ua.FileUrlStorage=void 0;var D1=require("fs"),CX=AX(Mx()),w1=SX(y1());function v1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(v1=function(n){return n?r:e})(t)}function SX(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=v1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function AX(t){return t&&t.__esModule?t:{default:t}}function nc(t){"@babel/helpers - typeof";return nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nc(t)}function OX(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,TX(n.key),n)}}function xX(t,e,r){return e&&b1(t.prototype,e),r&&b1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function TX(t){var e=FX(t,"string");return nc(e)=="symbol"?e:e+""}function FX(t,e){if(nc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(nc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Mye=ua.canStoreURLs=!0,qye=ua.FileUrlStorage=(function(){function t(e){OX(this,t),this.path=e}return xX(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,i){r._getItems("tus::",function(s,o){s?i(s):n(o)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(i,s){n._getItems("tus::".concat(r),function(o,a){o?s(o):i(a)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(i,s){n._removeItem(r,function(o){o?s(o):i()})})}},{key:"addUpload",value:function(r,n){var i=this,s=Math.round(Math.random()*1e12),o="tus::".concat(r,"::").concat(s);return new Promise(function(a,u){i._setItem(o,n,function(c){c?u(c):a(o)})})}},{key:"_setItem",value:function(r,n,i){var s=this;w1.lock(this.path,this._lockfileOptions()).then(function(o){i=s._releaseAndCb(o,i),s._getData(function(a,u){if(a){i(a);return}u[r]=n,s._writeData(u,function(c){return i(c)})})}).catch(i)}},{key:"_getItems",value:function(r,n){this._getData(function(i,s){if(i){n(i);return}var o=Object.keys(s).filter(function(a){return a.startsWith(r)}).map(function(a){var u=s[a];return u.urlStorageKey=a,u});n(null,o)})}},{key:"_removeItem",value:function(r,n){var i=this;w1.lock(this.path,this._lockfileOptions()).then(function(s){n=i._releaseAndCb(s,n),i._getData(function(o,a){if(o){n(o);return}delete a[r],i._writeData(a,function(u){return n(u)})})}).catch(n)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(r,n){return function(i){if(i){r().then(function(){return n(i)}).catch(function(s){return n((0,CX.default)([i,s]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,D1.writeFile)(this.path,JSON.stringify(r),i,function(s){return n(s)})}},{key:"_getData",value:function(r){(0,D1.readFile)(this.path,"utf8",function(n,i){if(n){n.code==="ENOENT"?r(null,{}):r(n);return}try{i=i.trim().length?JSON.parse(i):{}}catch(s){r(s);return}r(null,i)})}}])})()});var n0=E(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});Object.defineProperty(wr,"DefaultHttpStack",{enumerable:!0,get:function(){return A1.default}});Object.defineProperty(wr,"DetailedError",{enumerable:!0,get:function(){return IX.default}});Object.defineProperty(wr,"FileUrlStorage",{enumerable:!0,get:function(){return O1.FileUrlStorage}});Object.defineProperty(wr,"StreamSource",{enumerable:!0,get:function(){return $X.default}});wr.Upload=void 0;Object.defineProperty(wr,"canStoreURLs",{enumerable:!0,get:function(){return O1.canStoreURLs}});wr.defaultOptions=void 0;Object.defineProperty(wr,"enableDebugLog",{enumerable:!0,get:function(){return kX.enableDebugLog}});wr.isSupported=void 0;var IX=Us(Jy()),kX=Zy(),PX=Us(EA()),t0=Us(ZA()),RX=Us(fO()),NX=Us(mO()),A1=Us(TO()),$X=Us(hD()),O1=E1();function Us(t){return t&&t.__esModule?t:{default:t}}function la(t){"@babel/helpers - typeof";return la=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},la(t)}function LX(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,T1(n.key),n)}}function jX(t,e,r){return e&&_1(t.prototype,e),r&&_1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function BX(t,e,r){return e=Ph(e),MX(t,x1()?Reflect.construct(e,r||[],Ph(t).constructor):e.apply(t,r))}function MX(t,e){if(e&&(la(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qX(t)}function qX(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x1=function(){return!!t})()}function Ph(t){return Ph=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ph(t)}function UX(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r0(t,e)}function r0(t,e){return r0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},r0(t,e)}function C1(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ca(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?C1(Object(r),!0).forEach(function(n){HX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C1(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function HX(t,e,r){return e=T1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T1(t){var e=VX(t,"string");return la(e)=="symbol"?e:e+""}function VX(t,e){if(la(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(la(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var S1=wr.defaultOptions=ca(ca({},t0.default.defaultOptions),{},{httpStack:new A1.default,fileReader:new RX.default,urlStorage:new PX.default,fingerprint:NX.default}),Hye=wr.Upload=(function(t){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return LX(this,e),n=ca(ca({},S1),n),BX(this,e,[r,n])}return UX(e,t),jX(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=ca(ca({},S1),i),t0.default.terminate(n,i)}}])})(t0.default),Vye=wr.isSupported=!0});var P1=E((iDe,k1)=>{var fa=1e3,ha=fa*60,da=ha*60,Hs=da*24,WX=Hs*7,XX=Hs*365.25;k1.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return YX(t);if(r==="number"&&isFinite(t))return e.long?ZX(t):JX(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function YX(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*XX;case"weeks":case"week":case"w":return r*WX;case"days":case"day":case"d":return r*Hs;case"hours":case"hour":case"hrs":case"hr":case"h":return r*da;case"minutes":case"minute":case"mins":case"min":case"m":return r*ha;case"seconds":case"second":case"secs":case"sec":case"s":return r*fa;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function JX(t){var e=Math.abs(t);return e>=Hs?Math.round(t/Hs)+"d":e>=da?Math.round(t/da)+"h":e>=ha?Math.round(t/ha)+"m":e>=fa?Math.round(t/fa)+"s":t+"ms"}function ZX(t){var e=Math.abs(t);return e>=Hs?Nh(t,e,Hs,"day"):e>=da?Nh(t,e,da,"hour"):e>=ha?Nh(t,e,ha,"minute"):e>=fa?Nh(t,e,fa,"second"):t+" ms"}function Nh(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var s0=E((sDe,R1)=>{function QX(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=a,r.humanize=P1(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let h=0;for(let d=0;d<l.length;d++)h=(h<<5)-h+l.charCodeAt(d),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=e;function r(l){let h,d=null,f,m;function g(...b){if(!g.enabled)return;let S=g,A=Number(new Date),p=A-(h||A);S.diff=p,S.prev=h,S.curr=A,h=A,b[0]=r.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let D=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(C,k)=>{if(C==="%%")return"%";D++;let v=r.formatters[k];if(typeof v=="function"){let R=b[D];C=v.call(S,R),b.splice(D,1),D--}return C}),r.formatArgs.call(S,b),(S.log||r.log).apply(S,b)}return g.namespace=l,g.useColors=r.useColors(),g.color=r.selectColor(l),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(f!==r.namespaces&&(f=r.namespaces,m=r.enabled(l)),m),set:b=>{d=b}}),typeof r.init=="function"&&r.init(g),g}function n(l,h){let d=r(this.namespace+(typeof h>"u"?":":h)+l);return d.log=this.log,d}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let h=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of h)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function s(l,h){let d=0,f=0,m=-1,g=0;for(;d<l.length;)if(f<h.length&&(h[f]===l[d]||h[f]==="*"))h[f]==="*"?(m=f,g=d,f++):(d++,f++);else if(m!==-1)f=m+1,g++,d=g;else return!1;for(;f<h.length&&h[f]==="*";)f++;return f===h.length}function o(){let l=[...r.names,...r.skips.map(h=>"-"+h)].join(",");return r.enable(""),l}function a(l){for(let h of r.skips)if(s(l,h))return!1;for(let h of r.names)if(s(l,h))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}R1.exports=QX});var N1=E((br,$h)=>{br.formatArgs=tY;br.save=rY;br.load=nY;br.useColors=eY;br.storage=iY();br.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();br.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 eY(){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 t;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&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function tY(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+$h.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}br.log=console.debug||console.log||(()=>{});function rY(t){try{t?br.storage.setItem("debug",t):br.storage.removeItem("debug")}catch{}}function nY(){let t;try{t=br.storage.getItem("debug")||br.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function iY(){try{return localStorage}catch{}}$h.exports=s0()(br);var{formatters:sY}=$h.exports;sY.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var L1=E((oDe,$1)=>{"use strict";$1.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var M1=E((aDe,B1)=>{"use strict";var oY=require("os"),j1=require("tty"),Hr=L1(),{env:Pt}=process,Ni;Hr("no-color")||Hr("no-colors")||Hr("color=false")||Hr("color=never")?Ni=0:(Hr("color")||Hr("colors")||Hr("color=true")||Hr("color=always"))&&(Ni=1);"FORCE_COLOR"in Pt&&(Pt.FORCE_COLOR==="true"?Ni=1:Pt.FORCE_COLOR==="false"?Ni=0:Ni=Pt.FORCE_COLOR.length===0?1:Math.min(parseInt(Pt.FORCE_COLOR,10),3));function o0(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function a0(t,e){if(Ni===0)return 0;if(Hr("color=16m")||Hr("color=full")||Hr("color=truecolor"))return 3;if(Hr("color=256"))return 2;if(t&&!e&&Ni===void 0)return 0;let r=Ni||0;if(Pt.TERM==="dumb")return r;if(process.platform==="win32"){let n=oY.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Pt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in Pt)||Pt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in Pt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Pt.TEAMCITY_VERSION)?1:0;if(Pt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Pt){let n=parseInt((Pt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Pt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Pt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Pt.TERM)||"COLORTERM"in Pt?1:r}function aY(t){let e=a0(t,t&&t.isTTY);return o0(e)}B1.exports={supportsColor:aY,stdout:o0(a0(!0,j1.isatty(1))),stderr:o0(a0(!0,j1.isatty(2)))}});var U1=E((Rt,jh)=>{var uY=require("tty"),Lh=require("util");Rt.init=mY;Rt.log=hY;Rt.formatArgs=lY;Rt.save=dY;Rt.load=pY;Rt.useColors=cY;Rt.destroy=Lh.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 t=M1();t&&(t.stderr||t).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(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];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),t[r]=n,t},{});function cY(){return"colors"in Rt.inspectOpts?!!Rt.inspectOpts.colors:uY.isatty(process.stderr.fd)}function lY(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
56
|
+
`)}),e}});var Ux=E((Aye,qx)=>{var ki=require("constants"),XW=process.cwd,vh=null,YW=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return vh||(vh=XW.call(process)),vh};try{process.cwd()}catch{}typeof process.chdir=="function"&&(HD=process.chdir,process.chdir=function(t){vh=null,HD.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,HD));var HD;qx.exports=JW;function JW(t){ki.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,h,d){d&&process.nextTick(d)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,h,d,f){f&&process.nextTick(f)},t.lchownSync=function(){}),YW==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(l){function h(d,f,m){var g=Date.now(),b=0;l(d,f,function S(A){if(A&&(A.code==="EACCES"||A.code==="EPERM"||A.code==="EBUSY")&&Date.now()-g<6e4){setTimeout(function(){t.stat(f,function(p,D){p&&p.code==="ENOENT"?l(d,f,S):m(A)})},b),b<100&&(b+=10);return}m&&m(A)})}return Object.setPrototypeOf&&Object.setPrototypeOf(h,l),h})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(l){function h(d,f,m,g,b,S){var A;if(S&&typeof S=="function"){var p=0;A=function(D,y,C){if(D&&D.code==="EAGAIN"&&p<10)return p++,l.call(t,d,f,m,g,b,A);S.apply(this,arguments)}}return l.call(t,d,f,m,g,b,A)}return Object.setPrototypeOf&&Object.setPrototypeOf(h,l),h})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(l){return function(h,d,f,m,g){for(var b=0;;)try{return l.call(t,h,d,f,m,g)}catch(S){if(S.code==="EAGAIN"&&b<10){b++;continue}throw S}}})(t.readSync);function e(l){l.lchmod=function(h,d,f){l.open(h,ki.O_WRONLY|ki.O_SYMLINK,d,function(m,g){if(m){f&&f(m);return}l.fchmod(g,d,function(b){l.close(g,function(S){f&&f(b||S)})})})},l.lchmodSync=function(h,d){var f=l.openSync(h,ki.O_WRONLY|ki.O_SYMLINK,d),m=!0,g;try{g=l.fchmodSync(f,d),m=!1}finally{if(m)try{l.closeSync(f)}catch{}else l.closeSync(f)}return g}}function r(l){ki.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(h,d,f,m){l.open(h,ki.O_SYMLINK,function(g,b){if(g){m&&m(g);return}l.futimes(b,d,f,function(S){l.close(b,function(A){m&&m(S||A)})})})},l.lutimesSync=function(h,d,f){var m=l.openSync(h,ki.O_SYMLINK),g,b=!0;try{g=l.futimesSync(m,d,f),b=!1}finally{if(b)try{l.closeSync(m)}catch{}else l.closeSync(m)}return g}):l.futimes&&(l.lutimes=function(h,d,f,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function n(l){return l&&function(h,d,f){return l.call(t,h,d,function(m){c(m)&&(m=null),f&&f.apply(this,arguments)})}}function i(l){return l&&function(h,d){try{return l.call(t,h,d)}catch(f){if(!c(f))throw f}}}function s(l){return l&&function(h,d,f,m){return l.call(t,h,d,f,function(g){c(g)&&(g=null),m&&m.apply(this,arguments)})}}function o(l){return l&&function(h,d,f){try{return l.call(t,h,d,f)}catch(m){if(!c(m))throw m}}}function a(l){return l&&function(h,d,f){typeof d=="function"&&(f=d,d=null);function m(g,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),f&&f.apply(this,arguments)}return d?l.call(t,h,d,m):l.call(t,h,m)}}function u(l){return l&&function(h,d){var f=d?l.call(t,h,d):l.call(t,h);return f&&(f.uid<0&&(f.uid+=4294967296),f.gid<0&&(f.gid+=4294967296)),f}}function c(l){if(!l||l.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var zx=E((Oye,Vx)=>{var Hx=require("stream").Stream;Vx.exports=ZW;function ZW(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Hx.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),a=0,u=o.length;a<u;a++){var c=o[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(l,h){if(l){s.emit("error",l),s.readable=!1;return}s.fd=h,s.emit("open",h),s._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Hx.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,a=s.length;o<a;o++){var u=s[o];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Kx=E((xye,Gx)=>{"use strict";Gx.exports=eX;var QW=Object.getPrototypeOf||function(t){return t.__proto__};function eX(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:QW(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var pt=E((Tye,GD)=>{var ut=require("fs"),tX=Ux(),rX=zx(),nX=Kx(),Eh=require("util"),Mt,Ch;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Mt=Symbol.for("graceful-fs.queue"),Ch=Symbol.for("graceful-fs.previous")):(Mt="___graceful-fs.queue",Ch="___graceful-fs.previous");function iX(){}function Yx(t,e){Object.defineProperty(t,Mt,{get:function(){return e}})}var js=iX;Eh.debuglog?js=Eh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(js=function(){var t=Eh.format.apply(Eh,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
57
|
+
GFS4: `),console.error(t)});ut[Mt]||(Wx=global[Mt]||[],Yx(ut,Wx),ut.close=(function(t){function e(r,n){return t.call(ut,r,function(i){i||Xx(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Ch,{value:t}),e})(ut.close),ut.closeSync=(function(t){function e(r){t.apply(ut,arguments),Xx()}return Object.defineProperty(e,Ch,{value:t}),e})(ut.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){js(ut[Mt]),require("assert").equal(ut[Mt].length,0)}));var Wx;global[Mt]||Yx(global,ut[Mt]);GD.exports=VD(nX(ut));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ut.__patched&&(GD.exports=VD(ut),ut.__patched=!0);function VD(t){tX(t),t.gracefulify=VD,t.createReadStream=y,t.createWriteStream=C;var e=t.readFile;t.readFile=r;function r(R,P,F){return typeof P=="function"&&(F=P,P=null),j(R,P,F);function j(U,G,L,_){return e(U,G,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?na([j,[U,G,L],T,_||Date.now(),Date.now()]):typeof L=="function"&&L.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(R,P,F,j){return typeof F=="function"&&(j=F,F=null),U(R,P,F,j);function U(G,L,_,T,I){return n(G,L,_,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?na([U,[G,L,_,T],$,I||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var s=t.appendFile;s&&(t.appendFile=o);function o(R,P,F,j){return typeof F=="function"&&(j=F,F=null),U(R,P,F,j);function U(G,L,_,T,I){return s(G,L,_,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?na([U,[G,L,_,T],$,I||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(R,P,F,j){return typeof F=="function"&&(j=F,F=0),U(R,P,F,j);function U(G,L,_,T,I){return a(G,L,_,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?na([U,[G,L,_,T],$,I||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var c=t.readdir;t.readdir=h;var l=/^v[0-5]\./;function h(R,P,F){typeof P=="function"&&(F=P,P=null);var j=l.test(process.version)?function(L,_,T,I){return c(L,U(L,_,T,I))}:function(L,_,T,I){return c(L,_,U(L,_,T,I))};return j(R,P,F);function U(G,L,_,T){return function(I,$){I&&(I.code==="EMFILE"||I.code==="ENFILE")?na([j,[G,L,_],I,T||Date.now(),Date.now()]):($&&$.sort&&$.sort(),typeof _=="function"&&_.call(this,I,$))}}}if(process.version.substr(0,4)==="v0.8"){var d=rX(t);S=d.ReadStream,p=d.WriteStream}var f=t.ReadStream;f&&(S.prototype=Object.create(f.prototype),S.prototype.open=A);var m=t.WriteStream;m&&(p.prototype=Object.create(m.prototype),p.prototype.open=D),Object.defineProperty(t,"ReadStream",{get:function(){return S},set:function(R){S=R},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return p},set:function(R){p=R},enumerable:!0,configurable:!0});var g=S;Object.defineProperty(t,"FileReadStream",{get:function(){return g},set:function(R){g=R},enumerable:!0,configurable:!0});var b=p;Object.defineProperty(t,"FileWriteStream",{get:function(){return b},set:function(R){b=R},enumerable:!0,configurable:!0});function S(R,P){return this instanceof S?(f.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}function A(){var R=this;v(R.path,R.flags,R.mode,function(P,F){P?(R.autoClose&&R.destroy(),R.emit("error",P)):(R.fd=F,R.emit("open",F),R.read())})}function p(R,P){return this instanceof p?(m.apply(this,arguments),this):p.apply(Object.create(p.prototype),arguments)}function D(){var R=this;v(R.path,R.flags,R.mode,function(P,F){P?(R.destroy(),R.emit("error",P)):(R.fd=F,R.emit("open",F))})}function y(R,P){return new t.ReadStream(R,P)}function C(R,P){return new t.WriteStream(R,P)}var k=t.open;t.open=v;function v(R,P,F,j){return typeof F=="function"&&(j=F,F=null),U(R,P,F,j);function U(G,L,_,T,I){return k(G,L,_,function($,M){$&&($.code==="EMFILE"||$.code==="ENFILE")?na([U,[G,L,_,T],$,I||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}return t}function na(t){js("ENQUEUE",t[0].name,t[1]),ut[Mt].push(t),zD()}var _h;function Xx(){for(var t=Date.now(),e=0;e<ut[Mt].length;++e)ut[Mt][e].length>2&&(ut[Mt][e][3]=t,ut[Mt][e][4]=t);zD()}function zD(){if(clearTimeout(_h),_h=void 0,ut[Mt].length!==0){var t=ut[Mt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],s=t[4];if(i===void 0)js("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){js("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n)}else{var a=Date.now()-s,u=Math.max(s-i,1),c=Math.min(u*1.2,100);a>=c?(js("RETRY",e.name,r),e.apply(null,r.concat([i]))):ut[Mt].push(t)}_h===void 0&&(_h=setTimeout(zD,0))}}});var Zx=E((Fye,Jx)=>{function Ur(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Jx.exports=Ur;Ur.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Ur.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Ur.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};Ur.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Ur.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Ur.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Ur.prototype.start=Ur.prototype.try;Ur.prototype.errors=function(){return this._errors};Ur.prototype.attempts=function(){return this._attempts};Ur.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],s=i.message,o=(t[s]||0)+1;t[s]=o,o>=r&&(e=i,r=o)}return e}});var Qx=E(Bs=>{var sX=Zx();Bs.operation=function(t){var e=Bs.timeouts(t);return new sX(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};Bs.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(s,o){return s-o}),n};Bs.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};Bs.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var s=r[i],o=t[s];t[s]=function(u){var c=Bs.operation(e),l=Array.prototype.slice.call(arguments,1),h=l.pop();l.push(function(d){c.retry(d)||(d&&(arguments[0]=c.mainError()),h.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,o),t[s].options=e}}});var t1=E((kye,e1)=>{e1.exports=Qx()});var r1=E((Pye,Sh)=>{Sh.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Sh.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Sh.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Th=E((Rye,oa)=>{var rt=global.process,Ms=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};Ms(rt)?(n1=require("assert"),ia=r1(),i1=/^win/i.test(rt.platform),ec=require("events"),typeof ec!="function"&&(ec=ec.EventEmitter),rt.__signal_exit_emitter__?kt=rt.__signal_exit_emitter__:(kt=rt.__signal_exit_emitter__=new ec,kt.count=0,kt.emitted={}),kt.infinite||(kt.setMaxListeners(1/0),kt.infinite=!0),oa.exports=function(t,e){if(!Ms(global.process))return function(){};n1.equal(typeof t,"function","a callback must be provided for exit handler"),sa===!1&&KD();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){kt.removeListener(r,t),kt.listeners("exit").length===0&&kt.listeners("afterexit").length===0&&Ah()};return kt.on(r,t),n},Ah=function(){!sa||!Ms(global.process)||(sa=!1,ia.forEach(function(e){try{rt.removeListener(e,Oh[e])}catch{}}),rt.emit=xh,rt.reallyExit=WD,kt.count-=1)},oa.exports.unload=Ah,qs=function(e,r,n){kt.emitted[e]||(kt.emitted[e]=!0,kt.emit(e,r,n))},Oh={},ia.forEach(function(t){Oh[t]=function(){if(Ms(global.process)){var r=rt.listeners(t);r.length===kt.count&&(Ah(),qs("exit",null,t),qs("afterexit",null,t),i1&&t==="SIGHUP"&&(t="SIGINT"),rt.kill(rt.pid,t))}}}),oa.exports.signals=function(){return ia},sa=!1,KD=function(){sa||!Ms(global.process)||(sa=!0,kt.count+=1,ia=ia.filter(function(e){try{return rt.on(e,Oh[e]),!0}catch{return!1}}),rt.emit=o1,rt.reallyExit=s1)},oa.exports.load=KD,WD=rt.reallyExit,s1=function(e){Ms(global.process)&&(rt.exitCode=e||0,qs("exit",rt.exitCode,null),qs("afterexit",rt.exitCode,null),WD.call(rt,rt.exitCode))},xh=rt.emit,o1=function(e,r){if(e==="exit"&&Ms(global.process)){r!==void 0&&(rt.exitCode=r);var n=xh.apply(this,arguments);return qs("exit",rt.exitCode,null),qs("afterexit",rt.exitCode,null),n}else return xh.apply(this,arguments)}):oa.exports=function(){return function(){}};var n1,ia,i1,ec,kt,Ah,qs,Oh,sa,KD,WD,s1,xh,o1});var u1=E((Nye,XD)=>{"use strict";var a1=Symbol();function oX(t,e,r){let n=e[a1];if(n)return e.stat(t,(s,o)=>{if(s)return r(s);r(null,o.mtime,n)});let i=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,i,i,s=>{if(s)return r(s);e.stat(t,(o,a)=>{if(o)return r(o);let u=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,a1,{value:u}),r(null,a.mtime,u)})})}function aX(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}XD.exports.probe=oX;XD.exports.getMtime=aX});var d1=E(($ye,rc)=>{"use strict";var uX=require("path"),ZD=pt(),cX=t1(),lX=Th(),c1=u1(),Yn={};function tc(t,e){return e.lockfilePath||`${t}.lock`}function QD(t,e,r){if(!e.realpath)return r(null,uX.resolve(t));e.fs.realpath(t,r)}function JD(t,e,r){let n=tc(t,e);e.fs.mkdir(n,i=>{if(!i)return c1.probe(n,e.fs,(s,o,a)=>{if(s)return e.fs.rmdir(n,()=>{}),r(s);r(null,o,a)});if(i.code!=="EEXIST")return r(i);if(e.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(n,(s,o)=>{if(s)return s.code==="ENOENT"?JD(t,{...e,stale:0},r):r(s);if(!l1(o,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));f1(t,e,a=>{if(a)return r(a);JD(t,{...e,stale:0},r)})})})}function l1(t,e){return t.mtime.getTime()<Date.now()-e.stale}function f1(t,e,r){e.fs.rmdir(tc(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Fh(t,e){let r=Yn[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,i)=>{let s=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||s?YD(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Fh(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return YD(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=c1.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let c=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||c?YD(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Fh(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,Fh(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function YD(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),Yn[t]===e&&delete Yn[t],e.options.onCompromised(r)}function fX(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:ZD,onCompromised:n=>{throw n},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),QD(t,e,(n,i)=>{if(n)return r(n);let s=cX.operation(e.retries);s.attempt(()=>{JD(i,e,(o,a,u)=>{if(s.retry(o))return;if(o)return r(s.mainError());let c=Yn[i]={lockfilePath:tc(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};Fh(i,e),r(null,l=>{if(c.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));h1(i,{...e,realpath:!1},l)})})})})}function h1(t,e,r){e={fs:ZD,realpath:!0,...e},QD(t,e,(n,i)=>{if(n)return r(n);let s=Yn[i];if(!s)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));s.updateTimeout&&clearTimeout(s.updateTimeout),s.released=!0,delete Yn[i],f1(i,e,r)})}function hX(t,e,r){e={stale:1e4,realpath:!0,fs:ZD,...e},e.stale=Math.max(e.stale||0,2e3),QD(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(tc(i,e),(s,o)=>s?s.code==="ENOENT"?r(null,!1):r(s):r(null,!l1(o,e)))})}function dX(){return Yn}lX(()=>{for(let t in Yn){let e=Yn[t].options;try{e.fs.rmdirSync(tc(t,e))}catch{}}});rc.exports.lock=fX;rc.exports.unlock=h1;rc.exports.check=hX;rc.exports.getLocks=dX});var m1=E((Lye,p1)=>{"use strict";var pX=pt();function mX(t){let e=["mkdir","realpath","stat","rmdir","utimes"],r={...t};return e.forEach(n=>{r[n]=(...i)=>{let s=i.pop(),o;try{o=t[`${n}Sync`](...i)}catch(a){return s(a)}s(null,o)}}),r}function gX(t){return(...e)=>new Promise((r,n)=>{e.push((i,s)=>{i?n(i):r(s)}),t(...e)})}function yX(t){return(...e)=>{let r,n;if(e.push((i,s)=>{r=i,n=s}),t(...e),r)throw r;return n}}function DX(t){if(t={...t},t.fs=mX(t.fs||pX),typeof t.retries=="number"&&t.retries>0||t.retries&&typeof t.retries.retries=="number"&&t.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return t}p1.exports={toPromise:gX,toSync:yX,toSyncOptions:DX}});var y1=E((jye,Pi)=>{"use strict";var aa=d1(),{toPromise:Ih,toSync:kh,toSyncOptions:e0}=m1();async function g1(t,e){let r=await Ih(aa.lock)(t,e);return Ih(r)}function wX(t,e){let r=kh(aa.lock)(t,e0(e));return kh(r)}function bX(t,e){return Ih(aa.unlock)(t,e)}function vX(t,e){return kh(aa.unlock)(t,e0(e))}function EX(t,e){return Ih(aa.check)(t,e)}function _X(t,e){return kh(aa.check)(t,e0(e))}Pi.exports=g1;Pi.exports.lock=g1;Pi.exports.unlock=bX;Pi.exports.lockSync=wX;Pi.exports.unlockSync=vX;Pi.exports.check=EX;Pi.exports.checkSync=_X});var E1=E(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.canStoreURLs=ua.FileUrlStorage=void 0;var D1=require("fs"),CX=AX(Mx()),w1=SX(y1());function v1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(v1=function(n){return n?r:e})(t)}function SX(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=v1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&{}.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=t[s]}return n.default=t,r&&r.set(t,n),n}function AX(t){return t&&t.__esModule?t:{default:t}}function nc(t){"@babel/helpers - typeof";return nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nc(t)}function OX(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,TX(n.key),n)}}function xX(t,e,r){return e&&b1(t.prototype,e),r&&b1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function TX(t){var e=FX(t,"string");return nc(e)=="symbol"?e:e+""}function FX(t,e){if(nc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(nc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Bye=ua.canStoreURLs=!0,Mye=ua.FileUrlStorage=(function(){function t(e){OX(this,t),this.path=e}return xX(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,i){r._getItems("tus::",function(s,o){s?i(s):n(o)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(i,s){n._getItems("tus::".concat(r),function(o,a){o?s(o):i(a)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(i,s){n._removeItem(r,function(o){o?s(o):i()})})}},{key:"addUpload",value:function(r,n){var i=this,s=Math.round(Math.random()*1e12),o="tus::".concat(r,"::").concat(s);return new Promise(function(a,u){i._setItem(o,n,function(c){c?u(c):a(o)})})}},{key:"_setItem",value:function(r,n,i){var s=this;w1.lock(this.path,this._lockfileOptions()).then(function(o){i=s._releaseAndCb(o,i),s._getData(function(a,u){if(a){i(a);return}u[r]=n,s._writeData(u,function(c){return i(c)})})}).catch(i)}},{key:"_getItems",value:function(r,n){this._getData(function(i,s){if(i){n(i);return}var o=Object.keys(s).filter(function(a){return a.startsWith(r)}).map(function(a){var u=s[a];return u.urlStorageKey=a,u});n(null,o)})}},{key:"_removeItem",value:function(r,n){var i=this;w1.lock(this.path,this._lockfileOptions()).then(function(s){n=i._releaseAndCb(s,n),i._getData(function(o,a){if(o){n(o);return}delete a[r],i._writeData(a,function(u){return n(u)})})}).catch(n)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(r,n){return function(i){if(i){r().then(function(){return n(i)}).catch(function(s){return n((0,CX.default)([i,s]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,D1.writeFile)(this.path,JSON.stringify(r),i,function(s){return n(s)})}},{key:"_getData",value:function(r){(0,D1.readFile)(this.path,"utf8",function(n,i){if(n){n.code==="ENOENT"?r(null,{}):r(n);return}try{i=i.trim().length?JSON.parse(i):{}}catch(s){r(s);return}r(null,i)})}}])})()});var n0=E(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});Object.defineProperty(wr,"DefaultHttpStack",{enumerable:!0,get:function(){return A1.default}});Object.defineProperty(wr,"DetailedError",{enumerable:!0,get:function(){return IX.default}});Object.defineProperty(wr,"FileUrlStorage",{enumerable:!0,get:function(){return O1.FileUrlStorage}});Object.defineProperty(wr,"StreamSource",{enumerable:!0,get:function(){return $X.default}});wr.Upload=void 0;Object.defineProperty(wr,"canStoreURLs",{enumerable:!0,get:function(){return O1.canStoreURLs}});wr.defaultOptions=void 0;Object.defineProperty(wr,"enableDebugLog",{enumerable:!0,get:function(){return kX.enableDebugLog}});wr.isSupported=void 0;var IX=Us(Jy()),kX=Zy(),PX=Us(EA()),t0=Us(ZA()),RX=Us(fO()),NX=Us(mO()),A1=Us(TO()),$X=Us(hD()),O1=E1();function Us(t){return t&&t.__esModule?t:{default:t}}function la(t){"@babel/helpers - typeof";return la=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},la(t)}function LX(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,T1(n.key),n)}}function jX(t,e,r){return e&&_1(t.prototype,e),r&&_1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function BX(t,e,r){return e=Ph(e),MX(t,x1()?Reflect.construct(e,r||[],Ph(t).constructor):e.apply(t,r))}function MX(t,e){if(e&&(la(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qX(t)}function qX(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x1=function(){return!!t})()}function Ph(t){return Ph=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ph(t)}function UX(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r0(t,e)}function r0(t,e){return r0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},r0(t,e)}function C1(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ca(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?C1(Object(r),!0).forEach(function(n){HX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C1(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function HX(t,e,r){return e=T1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T1(t){var e=VX(t,"string");return la(e)=="symbol"?e:e+""}function VX(t,e){if(la(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(la(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var S1=wr.defaultOptions=ca(ca({},t0.default.defaultOptions),{},{httpStack:new A1.default,fileReader:new RX.default,urlStorage:new PX.default,fingerprint:NX.default}),Uye=wr.Upload=(function(t){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return LX(this,e),n=ca(ca({},S1),n),BX(this,e,[r,n])}return UX(e,t),jX(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=ca(ca({},S1),i),t0.default.terminate(n,i)}}])})(t0.default),Hye=wr.isSupported=!0});var P1=E((nDe,k1)=>{var fa=1e3,ha=fa*60,da=ha*60,Hs=da*24,WX=Hs*7,XX=Hs*365.25;k1.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return YX(t);if(r==="number"&&isFinite(t))return e.long?ZX(t):JX(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function YX(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*XX;case"weeks":case"week":case"w":return r*WX;case"days":case"day":case"d":return r*Hs;case"hours":case"hour":case"hrs":case"hr":case"h":return r*da;case"minutes":case"minute":case"mins":case"min":case"m":return r*ha;case"seconds":case"second":case"secs":case"sec":case"s":return r*fa;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function JX(t){var e=Math.abs(t);return e>=Hs?Math.round(t/Hs)+"d":e>=da?Math.round(t/da)+"h":e>=ha?Math.round(t/ha)+"m":e>=fa?Math.round(t/fa)+"s":t+"ms"}function ZX(t){var e=Math.abs(t);return e>=Hs?Nh(t,e,Hs,"day"):e>=da?Nh(t,e,da,"hour"):e>=ha?Nh(t,e,ha,"minute"):e>=fa?Nh(t,e,fa,"second"):t+" ms"}function Nh(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var s0=E((iDe,R1)=>{function QX(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=a,r.humanize=P1(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let h=0;for(let d=0;d<l.length;d++)h=(h<<5)-h+l.charCodeAt(d),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=e;function r(l){let h,d=null,f,m;function g(...b){if(!g.enabled)return;let S=g,A=Number(new Date),p=A-(h||A);S.diff=p,S.prev=h,S.curr=A,h=A,b[0]=r.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let D=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(C,k)=>{if(C==="%%")return"%";D++;let v=r.formatters[k];if(typeof v=="function"){let R=b[D];C=v.call(S,R),b.splice(D,1),D--}return C}),r.formatArgs.call(S,b),(S.log||r.log).apply(S,b)}return g.namespace=l,g.useColors=r.useColors(),g.color=r.selectColor(l),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(f!==r.namespaces&&(f=r.namespaces,m=r.enabled(l)),m),set:b=>{d=b}}),typeof r.init=="function"&&r.init(g),g}function n(l,h){let d=r(this.namespace+(typeof h>"u"?":":h)+l);return d.log=this.log,d}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let h=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of h)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function s(l,h){let d=0,f=0,m=-1,g=0;for(;d<l.length;)if(f<h.length&&(h[f]===l[d]||h[f]==="*"))h[f]==="*"?(m=f,g=d,f++):(d++,f++);else if(m!==-1)f=m+1,g++,d=g;else return!1;for(;f<h.length&&h[f]==="*";)f++;return f===h.length}function o(){let l=[...r.names,...r.skips.map(h=>"-"+h)].join(",");return r.enable(""),l}function a(l){for(let h of r.skips)if(s(l,h))return!1;for(let h of r.names)if(s(l,h))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}R1.exports=QX});var N1=E((br,$h)=>{br.formatArgs=tY;br.save=rY;br.load=nY;br.useColors=eY;br.storage=iY();br.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();br.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 eY(){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 t;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&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function tY(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+$h.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}br.log=console.debug||console.log||(()=>{});function rY(t){try{t?br.storage.setItem("debug",t):br.storage.removeItem("debug")}catch{}}function nY(){let t;try{t=br.storage.getItem("debug")||br.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function iY(){try{return localStorage}catch{}}$h.exports=s0()(br);var{formatters:sY}=$h.exports;sY.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var L1=E((sDe,$1)=>{"use strict";$1.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var M1=E((oDe,B1)=>{"use strict";var oY=require("os"),j1=require("tty"),Hr=L1(),{env:Pt}=process,Ni;Hr("no-color")||Hr("no-colors")||Hr("color=false")||Hr("color=never")?Ni=0:(Hr("color")||Hr("colors")||Hr("color=true")||Hr("color=always"))&&(Ni=1);"FORCE_COLOR"in Pt&&(Pt.FORCE_COLOR==="true"?Ni=1:Pt.FORCE_COLOR==="false"?Ni=0:Ni=Pt.FORCE_COLOR.length===0?1:Math.min(parseInt(Pt.FORCE_COLOR,10),3));function o0(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function a0(t,e){if(Ni===0)return 0;if(Hr("color=16m")||Hr("color=full")||Hr("color=truecolor"))return 3;if(Hr("color=256"))return 2;if(t&&!e&&Ni===void 0)return 0;let r=Ni||0;if(Pt.TERM==="dumb")return r;if(process.platform==="win32"){let n=oY.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Pt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in Pt)||Pt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in Pt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Pt.TEAMCITY_VERSION)?1:0;if(Pt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Pt){let n=parseInt((Pt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Pt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Pt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Pt.TERM)||"COLORTERM"in Pt?1:r}function aY(t){let e=a0(t,t&&t.isTTY);return o0(e)}B1.exports={supportsColor:aY,stdout:o0(a0(!0,j1.isatty(1))),stderr:o0(a0(!0,j1.isatty(2)))}});var U1=E((Rt,jh)=>{var uY=require("tty"),Lh=require("util");Rt.init=mY;Rt.log=hY;Rt.formatArgs=lY;Rt.save=dY;Rt.load=pY;Rt.useColors=cY;Rt.destroy=Lh.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 t=M1();t&&(t.stderr||t).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(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];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),t[r]=n,t},{});function cY(){return"colors"in Rt.inspectOpts?!!Rt.inspectOpts.colors:uY.isatty(process.stderr.fd)}function lY(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
58
58
|
`).join(`
|
|
59
59
|
`+s),t.push(i+"m+"+jh.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=fY()+e+" "+t[0]}function fY(){return Rt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function hY(...t){return process.stderr.write(Lh.formatWithOptions(Rt.inspectOpts,...t)+`
|
|
60
60
|
`)}function dY(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function pY(){return process.env.DEBUG}function mY(t){t.inspectOpts={};let e=Object.keys(Rt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=Rt.inspectOpts[e[r]]}jh.exports=s0()(Rt);var{formatters:q1}=jh.exports;q1.o=function(t){return this.inspectOpts.colors=this.useColors,Lh.inspect(t,this.inspectOpts).split(`
|
|
61
|
-
`).map(e=>e.trim()).join(" ")};q1.O=function(t){return this.inspectOpts.colors=this.useColors,Lh.inspect(t,this.inspectOpts)}});var Bh=E((
|
|
61
|
+
`).map(e=>e.trim()).join(" ")};q1.O=function(t){return this.inspectOpts.colors=this.useColors,Lh.inspect(t,this.inspectOpts)}});var Bh=E((aDe,u0)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?u0.exports=N1():u0.exports=U1()});var Fe=E(c0=>{"use strict";c0.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((i,s)=>i!=null?n(i):r(s)),t.apply(this,e)})},"name",{value:t.name})};c0.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var ir=E(Zn=>{"use strict";var H1=Fe().fromCallback,nr=pt(),gY=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof nr[t]=="function");Object.assign(Zn,nr);gY.forEach(t=>{Zn[t]=H1(nr[t])});Zn.exists=function(t,e){return typeof e=="function"?nr.exists(t,e):new Promise(r=>nr.exists(t,r))};Zn.read=function(t,e,r,n,i,s){return typeof s=="function"?nr.read(t,e,r,n,i,s):new Promise((o,a)=>{nr.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);o({bytesRead:c,buffer:l})})})};Zn.write=function(t,e,...r){return typeof r[r.length-1]=="function"?nr.write(t,e,...r):new Promise((n,i)=>{nr.write(t,e,...r,(s,o,a)=>{if(s)return i(s);n({bytesWritten:o,buffer:a})})})};Zn.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?nr.readv(t,e,...r):new Promise((n,i)=>{nr.readv(t,e,...r,(s,o,a)=>{if(s)return i(s);n({bytesRead:o,buffers:a})})})};Zn.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?nr.writev(t,e,...r):new Promise((n,i)=>{nr.writev(t,e,...r,(s,o,a)=>{if(s)return i(s);n({bytesWritten:o,buffers:a})})})};typeof nr.realpath.native=="function"?Zn.realpath.native=H1(nr.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var z1=E((lDe,V1)=>{"use strict";var yY=require("path");V1.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(yY.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}}});var X1=E((fDe,l0)=>{"use strict";var G1=ir(),{checkPath:K1}=z1(),W1=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};l0.exports.makeDir=async(t,e)=>(K1(t),G1.mkdir(t,{mode:W1(e),recursive:!0}));l0.exports.makeDirSync=(t,e)=>(K1(t),G1.mkdirSync(t,{mode:W1(e),recursive:!0}))});var on=E((hDe,Y1)=>{"use strict";var DY=Fe().fromPromise,{makeDir:wY,makeDirSync:f0}=X1(),h0=DY(wY);Y1.exports={mkdirs:h0,mkdirsSync:f0,mkdirp:h0,mkdirpSync:f0,ensureDir:h0,ensureDirSync:f0}});var $i=E((dDe,Z1)=>{"use strict";var bY=Fe().fromPromise,J1=ir();function vY(t){return J1.access(t).then(()=>!0).catch(()=>!1)}Z1.exports={pathExists:bY(vY),pathExistsSync:J1.existsSync}});var d0=E((pDe,Q1)=>{"use strict";var pa=ir(),EY=Fe().fromPromise;async function _Y(t,e,r){let n=await pa.open(t,"r+"),i=null;try{await pa.futimes(n,e,r)}finally{try{await pa.close(n)}catch(s){i=s}}if(i)throw i}function CY(t,e,r){let n=pa.openSync(t,"r+");return pa.futimesSync(n,e,r),pa.closeSync(n)}Q1.exports={utimesMillis:EY(_Y),utimesMillisSync:CY}});var Vs=E((mDe,nT)=>{"use strict";var ma=ir(),Nt=require("path"),eT=Fe().fromPromise;function SY(t,e,r){let n=r.dereference?i=>ma.stat(i,{bigint:!0}):i=>ma.lstat(i,{bigint:!0});return Promise.all([n(t),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}function AY(t,e,r){let n,i=r.dereference?o=>ma.statSync(o,{bigint:!0}):o=>ma.lstatSync(o,{bigint:!0}),s=i(t);try{n=i(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:n}}async function OY(t,e,r,n){let{srcStat:i,destStat:s}=await SY(t,e,n);if(s){if(ic(i,s)){let o=Nt.basename(t),a=Nt.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&p0(t,e))throw new Error(Mh(t,e,r));return{srcStat:i,destStat:s}}function xY(t,e,r,n){let{srcStat:i,destStat:s}=AY(t,e,n);if(s){if(ic(i,s)){let o=Nt.basename(t),a=Nt.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&p0(t,e))throw new Error(Mh(t,e,r));return{srcStat:i,destStat:s}}async function tT(t,e,r,n){let i=Nt.resolve(Nt.dirname(t)),s=Nt.resolve(Nt.dirname(r));if(s===i||s===Nt.parse(s).root)return;let o;try{o=await ma.stat(s,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(ic(e,o))throw new Error(Mh(t,r,n));return tT(t,e,s,n)}function rT(t,e,r,n){let i=Nt.resolve(Nt.dirname(t)),s=Nt.resolve(Nt.dirname(r));if(s===i||s===Nt.parse(s).root)return;let o;try{o=ma.statSync(s,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(ic(e,o))throw new Error(Mh(t,r,n));return rT(t,e,s,n)}function ic(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}function p0(t,e){let r=Nt.resolve(t).split(Nt.sep).filter(i=>i),n=Nt.resolve(e).split(Nt.sep).filter(i=>i);return r.every((i,s)=>n[s]===i)}function Mh(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}nT.exports={checkPaths:eT(OY),checkPathsSync:xY,checkParentPaths:eT(tT),checkParentPathsSync:rT,isSrcSubdir:p0,areIdentical:ic}});var sT=E((gDe,iT)=>{"use strict";async function TY(t,e){let r=[];for await(let n of t)r.push(e(n).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(r.map(n=>n.then(i=>{if(i!==null)throw i})))}iT.exports={asyncIteratorConcurrentProcess:TY}});var lT=E((yDe,cT)=>{"use strict";var Gt=ir(),sc=require("path"),{mkdirs:FY}=on(),{pathExists:IY}=$i(),{utimesMillis:kY}=d0(),oc=Vs(),{asyncIteratorConcurrentProcess:PY}=sT();async function RY(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
62
62
|
|
|
63
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await oc.checkPaths(t,e,"copy",r);if(await oc.checkParentPaths(t,n,e,"copy"),!await aT(t,e,r))return;let o=sc.dirname(e);await IY(o)||await FY(o),await uT(i,t,e,r)}async function aT(t,e,r){return r.filter?r.filter(t,e):!0}async function uT(t,e,r,n){let s=await(n.dereference?Gt.stat:Gt.lstat)(e);if(s.isDirectory())return jY(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return NY(s,t,e,r,n);if(s.isSymbolicLink())return BY(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function NY(t,e,r,n,i){if(!e)return oT(t,r,n,i);if(i.overwrite)return await Gt.unlink(n),oT(t,r,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}async function oT(t,e,r,n){if(await Gt.copyFile(e,r),n.preserveTimestamps){$Y(t.mode)&&await LY(r,t.mode);let i=await Gt.stat(e);await kY(r,i.atime,i.mtime)}return Gt.chmod(r,t.mode)}function $Y(t){return(t&128)===0}function LY(t,e){return Gt.chmod(t,e|128)}async function jY(t,e,r,n,i){e||await Gt.mkdir(n),await PY(await Gt.opendir(r),async s=>{let o=sc.join(r,s.name),a=sc.join(n,s.name);if(await aT(o,a,i)){let{destStat:c}=await oc.checkPaths(o,a,"copy",i);await uT(c,o,a,i)}}),e||await Gt.chmod(n,t.mode)}async function BY(t,e,r,n){let i=await Gt.readlink(e);if(n.dereference&&(i=sc.resolve(process.cwd(),i)),!t)return Gt.symlink(i,r);let s=null;try{s=await Gt.readlink(r)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Gt.symlink(i,r);throw o}if(n.dereference&&(s=sc.resolve(process.cwd(),s)),oc.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(oc.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await Gt.unlink(r),Gt.symlink(i,r)}cT.exports=RY});var mT=E((
|
|
63
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await oc.checkPaths(t,e,"copy",r);if(await oc.checkParentPaths(t,n,e,"copy"),!await aT(t,e,r))return;let o=sc.dirname(e);await IY(o)||await FY(o),await uT(i,t,e,r)}async function aT(t,e,r){return r.filter?r.filter(t,e):!0}async function uT(t,e,r,n){let s=await(n.dereference?Gt.stat:Gt.lstat)(e);if(s.isDirectory())return jY(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return NY(s,t,e,r,n);if(s.isSymbolicLink())return BY(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function NY(t,e,r,n,i){if(!e)return oT(t,r,n,i);if(i.overwrite)return await Gt.unlink(n),oT(t,r,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}async function oT(t,e,r,n){if(await Gt.copyFile(e,r),n.preserveTimestamps){$Y(t.mode)&&await LY(r,t.mode);let i=await Gt.stat(e);await kY(r,i.atime,i.mtime)}return Gt.chmod(r,t.mode)}function $Y(t){return(t&128)===0}function LY(t,e){return Gt.chmod(t,e|128)}async function jY(t,e,r,n,i){e||await Gt.mkdir(n),await PY(await Gt.opendir(r),async s=>{let o=sc.join(r,s.name),a=sc.join(n,s.name);if(await aT(o,a,i)){let{destStat:c}=await oc.checkPaths(o,a,"copy",i);await uT(c,o,a,i)}}),e||await Gt.chmod(n,t.mode)}async function BY(t,e,r,n){let i=await Gt.readlink(e);if(n.dereference&&(i=sc.resolve(process.cwd(),i)),!t)return Gt.symlink(i,r);let s=null;try{s=await Gt.readlink(r)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Gt.symlink(i,r);throw o}if(n.dereference&&(s=sc.resolve(process.cwd(),s)),oc.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(oc.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await Gt.unlink(r),Gt.symlink(i,r)}cT.exports=RY});var mT=E((DDe,pT)=>{"use strict";var sr=pt(),ac=require("path"),MY=on().mkdirsSync,qY=d0().utimesMillisSync,uc=Vs();function UY(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
64
64
|
|
|
65
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=uc.checkPathsSync(t,e,"copy",r);if(uc.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let s=ac.dirname(e);return sr.existsSync(s)||MY(s),fT(i,t,e,r)}function fT(t,e,r,n){let s=(n.dereference?sr.statSync:sr.lstatSync)(e);if(s.isDirectory())return XY(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return HY(s,t,e,r,n);if(s.isSymbolicLink())return ZY(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function HY(t,e,r,n,i){return e?VY(t,r,n,i):hT(t,r,n,i)}function VY(t,e,r,n){if(n.overwrite)return sr.unlinkSync(r),hT(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function hT(t,e,r,n){return sr.copyFileSync(e,r),n.preserveTimestamps&&zY(t.mode,e,r),m0(r,t.mode)}function zY(t,e,r){return GY(t)&&KY(r,t),WY(e,r)}function GY(t){return(t&128)===0}function KY(t,e){return m0(t,e|128)}function m0(t,e){return sr.chmodSync(t,e)}function WY(t,e){let r=sr.statSync(t);return qY(e,r.atime,r.mtime)}function XY(t,e,r,n,i){return e?dT(r,n,i):YY(t.mode,r,n,i)}function YY(t,e,r,n){return sr.mkdirSync(r),dT(e,r,n),m0(r,t)}function dT(t,e,r){let n=sr.opendirSync(t);try{let i;for(;(i=n.readSync())!==null;)JY(i.name,t,e,r)}finally{n.closeSync()}}function JY(t,e,r,n){let i=ac.join(e,t),s=ac.join(r,t);if(n.filter&&!n.filter(i,s))return;let{destStat:o}=uc.checkPathsSync(i,s,"copy",n);return fT(o,i,s,n)}function ZY(t,e,r,n){let i=sr.readlinkSync(e);if(n.dereference&&(i=ac.resolve(process.cwd(),i)),t){let s;try{s=sr.readlinkSync(r)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return sr.symlinkSync(i,r);throw o}if(n.dereference&&(s=ac.resolve(process.cwd(),s)),uc.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(uc.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return QY(i,r)}else return sr.symlinkSync(i,r)}function QY(t,e){return sr.unlinkSync(e),sr.symlinkSync(t,e)}pT.exports=UY});var qh=E((
|
|
66
|
-
`,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let s=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+s}function FJ(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}QT.exports={stringify:TJ,stripBom:FJ}});var g0=E((FDe,rF)=>{var ya;try{ya=pt()}catch{ya=require("fs")}var Uh=Fe(),{stringify:eF,stripBom:tF}=ga();async function IJ(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||ya,n="throws"in e?e.throws:!0,i=await Uh.fromCallback(r.readFile)(t,e);i=tF(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}return s}var kJ=Uh.fromPromise(IJ);function PJ(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||ya,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=tF(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function RJ(t,e,r={}){let n=r.fs||ya,i=eF(e,r);await Uh.fromCallback(n.writeFile)(t,i,r)}var NJ=Uh.fromPromise(RJ);function $J(t,e,r={}){let n=r.fs||ya,i=eF(e,r);return n.writeFileSync(t,i,r)}rF.exports={readFile:kJ,readFileSync:PJ,writeFile:NJ,writeFileSync:$J}});var iF=E((IDe,nF)=>{"use strict";var Hh=g0();nF.exports={readJson:Hh.readFile,readJsonSync:Hh.readFileSync,writeJson:Hh.writeFile,writeJsonSync:Hh.writeFileSync}});var Vh=E((kDe,aF)=>{"use strict";var LJ=Fe().fromPromise,y0=ir(),sF=require("path"),oF=on(),jJ=$i().pathExists;async function BJ(t,e,r="utf-8"){let n=sF.dirname(t);return await jJ(n)||await oF.mkdirs(n),y0.writeFile(t,e,r)}function MJ(t,...e){let r=sF.dirname(t);y0.existsSync(r)||oF.mkdirsSync(r),y0.writeFileSync(t,...e)}aF.exports={outputFile:LJ(BJ),outputFileSync:MJ}});var cF=E((PDe,uF)=>{"use strict";var{stringify:qJ}=ga(),{outputFile:UJ}=Vh();async function HJ(t,e,r={}){let n=qJ(e,r);await UJ(t,n,r)}uF.exports=HJ});var fF=E((RDe,lF)=>{"use strict";var{stringify:VJ}=ga(),{outputFileSync:zJ}=Vh();function GJ(t,e,r){let n=VJ(e,r);zJ(t,n,r)}lF.exports=GJ});var dF=E((NDe,hF)=>{"use strict";var KJ=Fe().fromPromise,or=iF();or.outputJson=KJ(cF());or.outputJsonSync=fF();or.outputJSON=or.outputJson;or.outputJSONSync=or.outputJsonSync;or.writeJSON=or.writeJson;or.writeJSONSync=or.writeJsonSync;or.readJSON=or.readJson;or.readJSONSync=or.readJsonSync;hF.exports=or});var DF=E(($De,yF)=>{"use strict";var WJ=ir(),pF=require("path"),{copy:XJ}=qh(),{remove:gF}=cc(),{mkdirp:YJ}=on(),{pathExists:JJ}=$i(),mF=Vs();async function ZJ(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await mF.checkPaths(t,e,"move",r);await mF.checkParentPaths(t,i,e,"move");let o=pF.dirname(e);return pF.parse(o).root!==o&&await YJ(o),QJ(t,e,n,s)}async function QJ(t,e,r,n){if(!n){if(r)await gF(e);else if(await JJ(e))throw new Error("dest already exists.")}try{await WJ.rename(t,e)}catch(i){if(i.code!=="EXDEV")throw i;await eZ(t,e,r)}}async function eZ(t,e,r){return await XJ(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),gF(t)}yF.exports=ZJ});var _F=E((LDe,EF)=>{"use strict";var bF=pt(),w0=require("path"),tZ=qh().copySync,vF=cc().removeSync,rZ=on().mkdirpSync,wF=Vs();function nZ(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:s=!1}=wF.checkPathsSync(t,e,"move",r);return wF.checkParentPathsSync(t,i,e,"move"),iZ(e)||rZ(w0.dirname(e)),sZ(t,e,n,s)}function iZ(t){let e=w0.dirname(t);return w0.parse(e).root===e}function sZ(t,e,r,n){if(n)return D0(t,e,r);if(r)return vF(e),D0(t,e,r);if(bF.existsSync(e))throw new Error("dest already exists.");return D0(t,e,r)}function D0(t,e,r){try{bF.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return oZ(t,e,r)}}function oZ(t,e,r){return tZ(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),vF(t)}EF.exports=nZ});var SF=E((jDe,CF)=>{"use strict";var aZ=Fe().fromPromise;CF.exports={move:aZ(DF()),moveSync:_F()}});var Da=E((BDe,AF)=>{"use strict";AF.exports={...ir(),...qh(),...AT(),...ZT(),...dF(),...on(),...SF(),...Vh(),...$i(),...cc()}});var PF=E((MDe,kF)=>{"use strict";var b0,xF,TF,FF,IF=!0;typeof process<"u"&&({FORCE_COLOR:b0,NODE_DISABLE_COLORS:xF,NO_COLOR:TF,TERM:FF}=process.env||{},IF=process.stdout&&process.stdout.isTTY);var Re={enabled:!xF&&TF==null&&FF!=="dumb"&&(b0!=null&&b0!=="0"||IF),reset:Ge(0,0),bold:Ge(1,22),dim:Ge(2,22),italic:Ge(3,23),underline:Ge(4,24),inverse:Ge(7,27),hidden:Ge(8,28),strikethrough:Ge(9,29),black:Ge(30,39),red:Ge(31,39),green:Ge(32,39),yellow:Ge(33,39),blue:Ge(34,39),magenta:Ge(35,39),cyan:Ge(36,39),white:Ge(37,39),gray:Ge(90,39),grey:Ge(90,39),bgBlack:Ge(40,49),bgRed:Ge(41,49),bgGreen:Ge(42,49),bgYellow:Ge(43,49),bgBlue:Ge(44,49),bgMagenta:Ge(45,49),bgCyan:Ge(46,49),bgWhite:Ge(47,49)};function OF(t,e){let r=0,n,i="",s="";for(;r<t.length;r++)n=t[r],i+=n.open,s+=n.close,~e.indexOf(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+s}function uZ(t,e){let r={has:t,keys:e};return r.reset=Re.reset.bind(r),r.bold=Re.bold.bind(r),r.dim=Re.dim.bind(r),r.italic=Re.italic.bind(r),r.underline=Re.underline.bind(r),r.inverse=Re.inverse.bind(r),r.hidden=Re.hidden.bind(r),r.strikethrough=Re.strikethrough.bind(r),r.black=Re.black.bind(r),r.red=Re.red.bind(r),r.green=Re.green.bind(r),r.yellow=Re.yellow.bind(r),r.blue=Re.blue.bind(r),r.magenta=Re.magenta.bind(r),r.cyan=Re.cyan.bind(r),r.white=Re.white.bind(r),r.gray=Re.gray.bind(r),r.grey=Re.grey.bind(r),r.bgBlack=Re.bgBlack.bind(r),r.bgRed=Re.bgRed.bind(r),r.bgGreen=Re.bgGreen.bind(r),r.bgYellow=Re.bgYellow.bind(r),r.bgBlue=Re.bgBlue.bind(r),r.bgMagenta=Re.bgMagenta.bind(r),r.bgCyan=Re.bgCyan.bind(r),r.bgWhite=Re.bgWhite.bind(r),r}function Ge(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:Re.enabled?OF(this.keys,n+""):n+""):n===void 0?uZ([t],[r]):Re.enabled?OF([r],n+""):n+""}}kF.exports=Re});var wa=E(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.ancillary=wt.failure=wt.success=wt.input=wt.weak=wt.strong=void 0;var cZ=(fe(),ue(le)),vn=cZ.__importDefault(PF());wt.strong=vn.default.bold;wt.weak=vn.default.dim;wt.input=vn.default.cyan;wt.success=vn.default.green;wt.failure=vn.default.red;wt.ancillary=vn.default.cyan;var lZ={strong:wt.strong,weak:wt.weak,input:wt.input,success:wt.success,failure:wt.failure,ancillary:wt.ancillary,log:{DEBUG:vn.default.magenta,INFO:vn.default.cyan,WARN:vn.default.yellow,ERROR:vn.default.red}};wt.default=lZ});var v0=E(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});zh.EscapeCode=void 0;var an="\x1B[",$t=class{};zh.EscapeCode=$t;$t.cursorLeft=()=>`${an}G`;$t.cursorUp=(t=1)=>`${an}${t}A`;$t.cursorDown=(t=1)=>`${an}${t}B`;$t.cursorForward=(t=1)=>`${an}${t}C`;$t.cursorBackward=(t=1)=>`${an}${t}D`;$t.cursorHide=()=>`${an}?25l`;$t.cursorShow=()=>`${an}?25h`;$t.eraseLine=()=>`${an}2K`;$t.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=$t.eraseLine(),r<t-1&&(e+=$t.cursorUp());return`${e}${$t.cursorLeft()}`};$t.eraseUp=()=>`${an}1J`;$t.eraseDown=()=>`${an}J`;$t.eraseScreen=()=>`${an}2J`});var NF=E(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});Gh.Cursor=void 0;var fZ=(fe(),ue(le)),hZ=fZ.__importDefault(Th()),RF=v0(),ba=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(RF.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,hZ.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(RF.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};Gh.Cursor=ba;ba.stream=process.stderr;ba._isVisible=!0;ba._listenerAttached=!1});var _0=E((VDe,E0)=>{"use strict";var $F=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);E0.exports=$F;E0.exports.default=$F});var BF=E((zDe,jF)=>{"use strict";var LF="[\uD800-\uDBFF][\uDC00-\uDFFF]",dZ=t=>t&&t.exact?new RegExp(`^${LF}$`):new RegExp(LF,"g");jF.exports=dZ});var qF=E((GDe,MF)=>{"use strict";MF.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var C0=E((KDe,HF)=>{var fc=qF(),UF={};for(let t of Object.keys(fc))UF[fc[t]]=t;var te={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};HF.exports=te;for(let t of Object.keys(te)){if(!("channels"in te[t]))throw new Error("missing channels property: "+t);if(!("labels"in te[t]))throw new Error("missing channel labels property: "+t);if(te[t].labels.length!==te[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=te[t];delete te[t].channels,delete te[t].labels,Object.defineProperty(te[t],"channels",{value:e}),Object.defineProperty(te[t],"labels",{value:r})}te.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),s=Math.max(e,r,n),o=s-i,a,u;s===i?a=0:e===s?a=(r-n)/o:r===s?a=2+(n-e)/o:n===s&&(a=4+(e-r)/o),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+s)/2;return s===i?u=0:c<=.5?u=o/(s+i):u=o/(2-s-i),[a,u*100,c*100]};te.rgb.hsv=function(t){let e,r,n,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(o,a,u),l=c-Math.min(o,a,u),h=function(d){return(c-d)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=h(o),r=h(a),n=h(u),o===c?i=n-r:a===c?i=1/3+e-n:u===c&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,c*100]};te.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=te.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,s*100,n*100]};te.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),s=(1-e-i)/(1-i)||0,o=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function pZ(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}te.rgb.keyword=function(t){let e=UF[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(fc)){let s=fc[i],o=pZ(t,s);o<r&&(r=o,n=i)}return n};te.keyword.rgb=function(t){return fc[t]};te.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+r*.3576+n*.1805,s=e*.2126+r*.7152+n*.0722,o=e*.0193+r*.1192+n*.9505;return[i*100,s*100,o*100]};te.rgb.lab=function(t){let e=te.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*n-16,o=500*(r-n),a=200*(n-i);return[s,o,a]};te.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,s,o;if(r===0)return o=n*255,[o,o,o];n<.5?i=n*(1+r):i=n+r-n*r;let a=2*n-i,u=[0,0,0];for(let c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(i-a)*6*s:2*s<1?o=i:3*s<2?o=a+(i-a)*(2/3-s)*6:o=a,u[c]=o*255;return u};te.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,s=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=s<=1?s:2-s;let o=(n+r)/2,a=n===0?2*i/(s+i):2*r/(n+r);return[e,a*100,o*100]};te.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*n*(1-r),a=255*n*(1-r*s),u=255*n*(1-r*(1-s));switch(n*=255,i){case 0:return[n,u,o];case 1:return[a,n,o];case 2:return[o,n,u];case 3:return[o,a,n];case 4:return[u,o,n];case 5:return[n,o,a]}};te.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),s,o;o=(2-r)*n;let a=(2-r)*i;return s=r*i,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};te.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,s;i>1&&(r/=i,n/=i);let o=Math.floor(6*e),a=1-n;s=6*e-o,(o&1)!==0&&(s=1-s);let u=r+s*(a-r),c,l,h;switch(o){default:case 6:case 0:c=a,l=u,h=r;break;case 1:c=u,l=a,h=r;break;case 2:c=r,l=a,h=u;break;case 3:c=r,l=u,h=a;break;case 4:c=u,l=r,h=a;break;case 5:c=a,l=r,h=u;break}return[c*255,l*255,h*255]};te.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[s*255,o*255,a*255]};te.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,s,o;return i=e*3.2406+r*-1.5372+n*-.4986,s=e*-.9689+r*1.8758+n*.0415,o=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};te.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*r-16,s=500*(e-r),o=200*(r-n);return[i,s,o]};te.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,s,o;s=(e+16)/116,i=r/500+s,o=s-n/200;let a=s**3,u=i**3,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};te.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(r*r+n*n);return[e,o,i]};te.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,s=r*Math.cos(i),o=r*Math.sin(i);return[e,s,o]};te.rgb.ansi16=function(t,e=null){let[r,n,i]=t,s=e===null?te.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return s===2&&(o+=60),o};te.hsv.ansi16=function(t){return te.rgb.ansi16(te.hsv.rgb(t),t[2])};te.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};te.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,s=(e>>2&1)*r*255;return[n,i,s]};te.ansi256.rgb=function(t){if(t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};te.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};te.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),i=n>>16&255,s=n>>8&255,o=n&255;return[i,s,o]};te.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),s=Math.min(Math.min(e,r),n),o=i-s,a,u;return o<1?a=s/(1-o):a=0,o<=0?u=0:i===e?u=(r-n)/o%6:i===r?u=2+(n-e)/o:u=4+(e-r)/o,u/=6,u%=1,[u*360,o*100,a*100]};te.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};te.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};te.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],s=e%1*6,o=s%1,a=1-o,u=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-r)*n,[(r*i[0]+u)*255,(r*i[1]+u)*255,(r*i[2]+u)*255]};te.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};te.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};te.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};te.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,s=0;return i<1&&(s=(n-i)/(1-i)),[t[0],i*100,s*100]};te.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};te.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};te.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};te.gray.hsl=function(t){return[0,0,t[0]]};te.gray.hsv=te.gray.hsl;te.gray.hwb=function(t){return[0,100,t[0]]};te.gray.cmyk=function(t){return[0,0,0,t[0]]};te.gray.lab=function(t){return[t[0],0,0]};te.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};te.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var zF=E((WDe,VF)=>{var Kh=C0();function mZ(){let t={},e=Object.keys(Kh);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function gZ(t){let e=mZ(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys(Kh[n]);for(let s=i.length,o=0;o<s;o++){let a=i[o],u=e[a];u.distance===-1&&(u.distance=e[n].distance+1,u.parent=n,r.unshift(a))}}return e}function yZ(t,e){return function(r){return e(t(r))}}function DZ(t,e){let r=[e[t].parent,t],n=Kh[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=yZ(Kh[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}VF.exports=function(t){let e=gZ(t),r={},n=Object.keys(e);for(let i=n.length,s=0;s<i;s++){let o=n[s];e[o].parent!==null&&(r[o]=DZ(o,e))}return r}});var KF=E((XDe,GF)=>{var S0=C0(),wZ=zF(),va={},bZ=Object.keys(S0);function vZ(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function EZ(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=t(r);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}bZ.forEach(t=>{va[t]={},Object.defineProperty(va[t],"channels",{value:S0[t].channels}),Object.defineProperty(va[t],"labels",{value:S0[t].labels});let e=wZ(t);Object.keys(e).forEach(n=>{let i=e[n];va[t][n]=EZ(i),va[t][n].raw=vZ(i)})});GF.exports=va});var O0=E((YDe,ZF)=>{"use strict";var WF=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,XF=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},YF=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},Wh=t=>t,JF=(t,e,r)=>[t,e,r],Ea=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let n=r();return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},A0,_a=(t,e,r,n)=>{A0===void 0&&(A0=KF());let i=n?10:0,s={};for(let[o,a]of Object.entries(A0)){let u=o==="ansi16"?"ansi":o;o===e?s[u]=t(r,i):typeof a=="object"&&(s[u]=t(a[e],i))}return s};function _Z(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,n]of Object.entries(e)){for(let[i,s]of Object.entries(n))e[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[i]=e[i],t.set(s[0],s[1]);Object.defineProperty(e,r,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Ea(e.color,"ansi",()=>_a(WF,"ansi16",Wh,!1)),Ea(e.color,"ansi256",()=>_a(XF,"ansi256",Wh,!1)),Ea(e.color,"ansi16m",()=>_a(YF,"rgb",JF,!1)),Ea(e.bgColor,"ansi",()=>_a(WF,"ansi16",Wh,!0)),Ea(e.bgColor,"ansi256",()=>_a(XF,"ansi256",Wh,!0)),Ea(e.bgColor,"ansi16m",()=>_a(YF,"rgb",JF,!0)),e}Object.defineProperty(ZF,"exports",{enumerable:!0,get:_Z})});var n2=E((JDe,r2)=>{"use strict";var CZ=_0(),SZ=BF(),QF=O0(),t2=["\x1B","\x9B"],Xh=t=>`${t2[0]}[${t}m`,e2=(t,e,r)=>{let n=[];t=[...t];for(let i of t){let s=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");let o=QF.codes.get(Number.parseInt(i,10));if(o){let a=t.indexOf(o.toString());a===-1?n.push(Xh(e?o:s)):t.splice(a,1)}else if(e){n.push(Xh(0));break}else n.push(Xh(s))}if(e&&(n=n.filter((i,s)=>n.indexOf(i)===s),r!==void 0)){let i=Xh(QF.codes.get(Number.parseInt(r,10)));n=n.reduce((s,o)=>o===i?[o,...s]:[...s,o],[])}return n.join("")};r2.exports=(t,e,r)=>{let n=[...t],i=[],s=typeof r=="number"?r:n.length,o=!1,a,u=0,c="";for(let[l,h]of n.entries()){let d=!1;if(t2.includes(h)){let f=/\d[^m]*/.exec(t.slice(l,l+18));a=f&&f.length>0?f[0]:void 0,u<s&&(o=!0,a!==void 0&&i.push(a))}else o&&h==="m"&&(o=!1,d=!0);if(!o&&!d&&u++,!SZ({exact:!0}).test(h)&&CZ(h.codePointAt())&&(u++,typeof r!="number"&&s++),u>e&&u<=s)c+=h;else if(u===e&&!o&&a!==void 0)c=e2(i);else if(u>=s){c+=e2(i,!0,a);break}}return c}});var s2=E((ZDe,i2)=>{"use strict";i2.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var Yh=E((QDe,o2)=>{"use strict";var AZ=s2();o2.exports=t=>typeof t=="string"?t.replace(AZ(),""):t});var u2=E((e0e,a2)=>{"use strict";a2.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var T0=E((t0e,x0)=>{"use strict";var OZ=Yh(),xZ=_0(),TZ=u2(),c2=t=>{if(typeof t!="string"||t.length===0||(t=OZ(t),t.length===0))return 0;t=t.replace(TZ()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=xZ(n)?2:1)}return e};x0.exports=c2;x0.exports.default=c2});var m2=E((r0e,p2)=>{"use strict";var hc=T0(),FZ=Yh(),IZ=O0(),Jh=new Set(["\x1B","\x9B"]),kZ=39,I0="\x07",h2="[",PZ="]",d2="m",k0=`${PZ}8;;`,l2=t=>`${Jh.values().next().value}${h2}${t}${d2}`,f2=t=>`${Jh.values().next().value}${k0}${t}${I0}`,RZ=t=>t.split(" ").map(e=>hc(e)),F0=(t,e,r)=>{let n=[...e],i=!1,s=!1,o=hc(FZ(t[t.length-1]));for(let[a,u]of n.entries()){let c=hc(u);if(o+c<=r?t[t.length-1]+=u:(t.push(u),o=0),Jh.has(u)&&(i=!0,s=n.slice(a+1).join("").startsWith(k0)),i){s?u===I0&&(i=!1,s=!1):u===d2&&(i=!1);continue}o+=c,o===r&&a<n.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},NZ=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(hc(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},$Z=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,s,o=RZ(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let h=hc(a[a.length-1]);if(c!==0&&(h>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),h=0),(h>0||r.trim===!1)&&(a[a.length-1]+=" ",h++)),r.hard&&o[c]>e){let d=e-h,f=1+Math.floor((o[c]-d-1)/e);Math.floor((o[c]-1)/e)<f&&a.push(""),F0(a,l,e);continue}if(h+o[c]>e&&h>0&&o[c]>0){if(r.wordWrap===!1&&h<e){F0(a,l,e);continue}a.push("")}if(h+o[c]>e&&r.wordWrap===!1){F0(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(NZ));let u=[...a.join(`
|
|
65
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=uc.checkPathsSync(t,e,"copy",r);if(uc.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let s=ac.dirname(e);return sr.existsSync(s)||MY(s),fT(i,t,e,r)}function fT(t,e,r,n){let s=(n.dereference?sr.statSync:sr.lstatSync)(e);if(s.isDirectory())return XY(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return HY(s,t,e,r,n);if(s.isSymbolicLink())return ZY(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function HY(t,e,r,n,i){return e?VY(t,r,n,i):hT(t,r,n,i)}function VY(t,e,r,n){if(n.overwrite)return sr.unlinkSync(r),hT(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function hT(t,e,r,n){return sr.copyFileSync(e,r),n.preserveTimestamps&&zY(t.mode,e,r),m0(r,t.mode)}function zY(t,e,r){return GY(t)&&KY(r,t),WY(e,r)}function GY(t){return(t&128)===0}function KY(t,e){return m0(t,e|128)}function m0(t,e){return sr.chmodSync(t,e)}function WY(t,e){let r=sr.statSync(t);return qY(e,r.atime,r.mtime)}function XY(t,e,r,n,i){return e?dT(r,n,i):YY(t.mode,r,n,i)}function YY(t,e,r,n){return sr.mkdirSync(r),dT(e,r,n),m0(r,t)}function dT(t,e,r){let n=sr.opendirSync(t);try{let i;for(;(i=n.readSync())!==null;)JY(i.name,t,e,r)}finally{n.closeSync()}}function JY(t,e,r,n){let i=ac.join(e,t),s=ac.join(r,t);if(n.filter&&!n.filter(i,s))return;let{destStat:o}=uc.checkPathsSync(i,s,"copy",n);return fT(o,i,s,n)}function ZY(t,e,r,n){let i=sr.readlinkSync(e);if(n.dereference&&(i=ac.resolve(process.cwd(),i)),t){let s;try{s=sr.readlinkSync(r)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return sr.symlinkSync(i,r);throw o}if(n.dereference&&(s=ac.resolve(process.cwd(),s)),uc.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(uc.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return QY(i,r)}else return sr.symlinkSync(i,r)}function QY(t,e){return sr.unlinkSync(e),sr.symlinkSync(t,e)}pT.exports=UY});var qh=E((wDe,gT)=>{"use strict";var eJ=Fe().fromPromise;gT.exports={copy:eJ(lT()),copySync:mT()}});var cc=E((bDe,DT)=>{"use strict";var yT=pt(),tJ=Fe().fromCallback;function rJ(t,e){yT.rm(t,{recursive:!0,force:!0},e)}function nJ(t){yT.rmSync(t,{recursive:!0,force:!0})}DT.exports={remove:tJ(rJ),removeSync:nJ}});var AT=E((vDe,ST)=>{"use strict";var iJ=Fe().fromPromise,vT=ir(),ET=require("path"),_T=on(),CT=cc(),wT=iJ(async function(e){let r;try{r=await vT.readdir(e)}catch{return _T.mkdirs(e)}return Promise.all(r.map(n=>CT.remove(ET.join(e,n))))});function bT(t){let e;try{e=vT.readdirSync(t)}catch{return _T.mkdirsSync(t)}e.forEach(r=>{r=ET.join(t,r),CT.removeSync(r)})}ST.exports={emptyDirSync:bT,emptydirSync:bT,emptyDir:wT,emptydir:wT}});var FT=E((EDe,TT)=>{"use strict";var sJ=Fe().fromPromise,OT=require("path"),Qn=ir(),xT=on();async function oJ(t){let e;try{e=await Qn.stat(t)}catch{}if(e&&e.isFile())return;let r=OT.dirname(t),n=null;try{n=await Qn.stat(r)}catch(i){if(i.code==="ENOENT"){await xT.mkdirs(r),await Qn.writeFile(t,"");return}else throw i}n.isDirectory()?await Qn.writeFile(t,""):await Qn.readdir(r)}function aJ(t){let e;try{e=Qn.statSync(t)}catch{}if(e&&e.isFile())return;let r=OT.dirname(t);try{Qn.statSync(r).isDirectory()||Qn.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")xT.mkdirsSync(r);else throw n}Qn.writeFileSync(t,"")}TT.exports={createFile:sJ(oJ),createFileSync:aJ}});var NT=E((_De,RT)=>{"use strict";var uJ=Fe().fromPromise,IT=require("path"),Li=ir(),kT=on(),{pathExists:cJ}=$i(),{areIdentical:PT}=Vs();async function lJ(t,e){let r;try{r=await Li.lstat(e)}catch{}let n;try{n=await Li.lstat(t)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(r&&PT(n,r))return;let i=IT.dirname(e);await cJ(i)||await kT.mkdirs(i),await Li.link(t,e)}function fJ(t,e){let r;try{r=Li.lstatSync(e)}catch{}try{let s=Li.lstatSync(t);if(r&&PT(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=IT.dirname(e);return Li.existsSync(n)||kT.mkdirsSync(n),Li.linkSync(t,e)}RT.exports={createLink:uJ(lJ),createLinkSync:fJ}});var LT=E((CDe,$T)=>{"use strict";var ji=require("path"),lc=ir(),{pathExists:hJ}=$i(),dJ=Fe().fromPromise;async function pJ(t,e){if(ji.isAbsolute(t)){try{await lc.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=ji.dirname(e),n=ji.join(r,t);if(await hJ(n))return{toCwd:n,toDst:t};try{await lc.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:ji.relative(r,t)}}function mJ(t,e){if(ji.isAbsolute(t)){if(!lc.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=ji.dirname(e),n=ji.join(r,t);if(lc.existsSync(n))return{toCwd:n,toDst:t};if(!lc.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:ji.relative(r,t)}}$T.exports={symlinkPaths:dJ(pJ),symlinkPathsSync:mJ}});var MT=E((SDe,BT)=>{"use strict";var jT=ir(),gJ=Fe().fromPromise;async function yJ(t,e){if(e)return e;let r;try{r=await jT.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}function DJ(t,e){if(e)return e;let r;try{r=jT.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}BT.exports={symlinkType:gJ(yJ),symlinkTypeSync:DJ}});var VT=E((ADe,HT)=>{"use strict";var wJ=Fe().fromPromise,qT=require("path"),bn=ir(),{mkdirs:bJ,mkdirsSync:vJ}=on(),{symlinkPaths:EJ,symlinkPathsSync:_J}=LT(),{symlinkType:CJ,symlinkTypeSync:SJ}=MT(),{pathExists:AJ}=$i(),{areIdentical:UT}=Vs();async function OJ(t,e,r){let n;try{n=await bn.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let[a,u]=await Promise.all([bn.stat(t),bn.stat(e)]);if(UT(a,u))return}let i=await EJ(t,e);t=i.toDst;let s=await CJ(i.toCwd,r),o=qT.dirname(e);return await AJ(o)||await bJ(o),bn.symlink(t,e,s)}function xJ(t,e,r){let n;try{n=bn.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let a=bn.statSync(t),u=bn.statSync(e);if(UT(a,u))return}let i=_J(t,e);t=i.toDst,r=SJ(i.toCwd,r);let s=qT.dirname(e);return bn.existsSync(s)||vJ(s),bn.symlinkSync(t,e,r)}HT.exports={createSymlink:wJ(OJ),createSymlinkSync:xJ}});var ZT=E((ODe,JT)=>{"use strict";var{createFile:zT,createFileSync:GT}=FT(),{createLink:KT,createLinkSync:WT}=NT(),{createSymlink:XT,createSymlinkSync:YT}=VT();JT.exports={createFile:zT,createFileSync:GT,ensureFile:zT,ensureFileSync:GT,createLink:KT,createLinkSync:WT,ensureLink:KT,ensureLinkSync:WT,createSymlink:XT,createSymlinkSync:YT,ensureSymlink:XT,ensureSymlinkSync:YT}});var ga=E((xDe,QT)=>{function TJ(t,{EOL:e=`
|
|
66
|
+
`,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let s=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+s}function FJ(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}QT.exports={stringify:TJ,stripBom:FJ}});var g0=E((TDe,rF)=>{var ya;try{ya=pt()}catch{ya=require("fs")}var Uh=Fe(),{stringify:eF,stripBom:tF}=ga();async function IJ(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||ya,n="throws"in e?e.throws:!0,i=await Uh.fromCallback(r.readFile)(t,e);i=tF(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}return s}var kJ=Uh.fromPromise(IJ);function PJ(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||ya,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=tF(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function RJ(t,e,r={}){let n=r.fs||ya,i=eF(e,r);await Uh.fromCallback(n.writeFile)(t,i,r)}var NJ=Uh.fromPromise(RJ);function $J(t,e,r={}){let n=r.fs||ya,i=eF(e,r);return n.writeFileSync(t,i,r)}rF.exports={readFile:kJ,readFileSync:PJ,writeFile:NJ,writeFileSync:$J}});var iF=E((FDe,nF)=>{"use strict";var Hh=g0();nF.exports={readJson:Hh.readFile,readJsonSync:Hh.readFileSync,writeJson:Hh.writeFile,writeJsonSync:Hh.writeFileSync}});var Vh=E((IDe,aF)=>{"use strict";var LJ=Fe().fromPromise,y0=ir(),sF=require("path"),oF=on(),jJ=$i().pathExists;async function BJ(t,e,r="utf-8"){let n=sF.dirname(t);return await jJ(n)||await oF.mkdirs(n),y0.writeFile(t,e,r)}function MJ(t,...e){let r=sF.dirname(t);y0.existsSync(r)||oF.mkdirsSync(r),y0.writeFileSync(t,...e)}aF.exports={outputFile:LJ(BJ),outputFileSync:MJ}});var cF=E((kDe,uF)=>{"use strict";var{stringify:qJ}=ga(),{outputFile:UJ}=Vh();async function HJ(t,e,r={}){let n=qJ(e,r);await UJ(t,n,r)}uF.exports=HJ});var fF=E((PDe,lF)=>{"use strict";var{stringify:VJ}=ga(),{outputFileSync:zJ}=Vh();function GJ(t,e,r){let n=VJ(e,r);zJ(t,n,r)}lF.exports=GJ});var dF=E((RDe,hF)=>{"use strict";var KJ=Fe().fromPromise,or=iF();or.outputJson=KJ(cF());or.outputJsonSync=fF();or.outputJSON=or.outputJson;or.outputJSONSync=or.outputJsonSync;or.writeJSON=or.writeJson;or.writeJSONSync=or.writeJsonSync;or.readJSON=or.readJson;or.readJSONSync=or.readJsonSync;hF.exports=or});var DF=E((NDe,yF)=>{"use strict";var WJ=ir(),pF=require("path"),{copy:XJ}=qh(),{remove:gF}=cc(),{mkdirp:YJ}=on(),{pathExists:JJ}=$i(),mF=Vs();async function ZJ(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await mF.checkPaths(t,e,"move",r);await mF.checkParentPaths(t,i,e,"move");let o=pF.dirname(e);return pF.parse(o).root!==o&&await YJ(o),QJ(t,e,n,s)}async function QJ(t,e,r,n){if(!n){if(r)await gF(e);else if(await JJ(e))throw new Error("dest already exists.")}try{await WJ.rename(t,e)}catch(i){if(i.code!=="EXDEV")throw i;await eZ(t,e,r)}}async function eZ(t,e,r){return await XJ(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),gF(t)}yF.exports=ZJ});var _F=E(($De,EF)=>{"use strict";var bF=pt(),w0=require("path"),tZ=qh().copySync,vF=cc().removeSync,rZ=on().mkdirpSync,wF=Vs();function nZ(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:s=!1}=wF.checkPathsSync(t,e,"move",r);return wF.checkParentPathsSync(t,i,e,"move"),iZ(e)||rZ(w0.dirname(e)),sZ(t,e,n,s)}function iZ(t){let e=w0.dirname(t);return w0.parse(e).root===e}function sZ(t,e,r,n){if(n)return D0(t,e,r);if(r)return vF(e),D0(t,e,r);if(bF.existsSync(e))throw new Error("dest already exists.");return D0(t,e,r)}function D0(t,e,r){try{bF.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return oZ(t,e,r)}}function oZ(t,e,r){return tZ(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),vF(t)}EF.exports=nZ});var SF=E((LDe,CF)=>{"use strict";var aZ=Fe().fromPromise;CF.exports={move:aZ(DF()),moveSync:_F()}});var Da=E((jDe,AF)=>{"use strict";AF.exports={...ir(),...qh(),...AT(),...ZT(),...dF(),...on(),...SF(),...Vh(),...$i(),...cc()}});var PF=E((BDe,kF)=>{"use strict";var b0,xF,TF,FF,IF=!0;typeof process<"u"&&({FORCE_COLOR:b0,NODE_DISABLE_COLORS:xF,NO_COLOR:TF,TERM:FF}=process.env||{},IF=process.stdout&&process.stdout.isTTY);var Re={enabled:!xF&&TF==null&&FF!=="dumb"&&(b0!=null&&b0!=="0"||IF),reset:Ge(0,0),bold:Ge(1,22),dim:Ge(2,22),italic:Ge(3,23),underline:Ge(4,24),inverse:Ge(7,27),hidden:Ge(8,28),strikethrough:Ge(9,29),black:Ge(30,39),red:Ge(31,39),green:Ge(32,39),yellow:Ge(33,39),blue:Ge(34,39),magenta:Ge(35,39),cyan:Ge(36,39),white:Ge(37,39),gray:Ge(90,39),grey:Ge(90,39),bgBlack:Ge(40,49),bgRed:Ge(41,49),bgGreen:Ge(42,49),bgYellow:Ge(43,49),bgBlue:Ge(44,49),bgMagenta:Ge(45,49),bgCyan:Ge(46,49),bgWhite:Ge(47,49)};function OF(t,e){let r=0,n,i="",s="";for(;r<t.length;r++)n=t[r],i+=n.open,s+=n.close,~e.indexOf(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+s}function uZ(t,e){let r={has:t,keys:e};return r.reset=Re.reset.bind(r),r.bold=Re.bold.bind(r),r.dim=Re.dim.bind(r),r.italic=Re.italic.bind(r),r.underline=Re.underline.bind(r),r.inverse=Re.inverse.bind(r),r.hidden=Re.hidden.bind(r),r.strikethrough=Re.strikethrough.bind(r),r.black=Re.black.bind(r),r.red=Re.red.bind(r),r.green=Re.green.bind(r),r.yellow=Re.yellow.bind(r),r.blue=Re.blue.bind(r),r.magenta=Re.magenta.bind(r),r.cyan=Re.cyan.bind(r),r.white=Re.white.bind(r),r.gray=Re.gray.bind(r),r.grey=Re.grey.bind(r),r.bgBlack=Re.bgBlack.bind(r),r.bgRed=Re.bgRed.bind(r),r.bgGreen=Re.bgGreen.bind(r),r.bgYellow=Re.bgYellow.bind(r),r.bgBlue=Re.bgBlue.bind(r),r.bgMagenta=Re.bgMagenta.bind(r),r.bgCyan=Re.bgCyan.bind(r),r.bgWhite=Re.bgWhite.bind(r),r}function Ge(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:Re.enabled?OF(this.keys,n+""):n+""):n===void 0?uZ([t],[r]):Re.enabled?OF([r],n+""):n+""}}kF.exports=Re});var wa=E(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.ancillary=wt.failure=wt.success=wt.input=wt.weak=wt.strong=void 0;var cZ=(fe(),ue(le)),vn=cZ.__importDefault(PF());wt.strong=vn.default.bold;wt.weak=vn.default.dim;wt.input=vn.default.cyan;wt.success=vn.default.green;wt.failure=vn.default.red;wt.ancillary=vn.default.cyan;var lZ={strong:wt.strong,weak:wt.weak,input:wt.input,success:wt.success,failure:wt.failure,ancillary:wt.ancillary,log:{DEBUG:vn.default.magenta,INFO:vn.default.cyan,WARN:vn.default.yellow,ERROR:vn.default.red}};wt.default=lZ});var v0=E(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});zh.EscapeCode=void 0;var an="\x1B[",$t=class{};zh.EscapeCode=$t;$t.cursorLeft=()=>`${an}G`;$t.cursorUp=(t=1)=>`${an}${t}A`;$t.cursorDown=(t=1)=>`${an}${t}B`;$t.cursorForward=(t=1)=>`${an}${t}C`;$t.cursorBackward=(t=1)=>`${an}${t}D`;$t.cursorHide=()=>`${an}?25l`;$t.cursorShow=()=>`${an}?25h`;$t.eraseLine=()=>`${an}2K`;$t.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=$t.eraseLine(),r<t-1&&(e+=$t.cursorUp());return`${e}${$t.cursorLeft()}`};$t.eraseUp=()=>`${an}1J`;$t.eraseDown=()=>`${an}J`;$t.eraseScreen=()=>`${an}2J`});var NF=E(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});Gh.Cursor=void 0;var fZ=(fe(),ue(le)),hZ=fZ.__importDefault(Th()),RF=v0(),ba=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(RF.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,hZ.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(RF.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};Gh.Cursor=ba;ba.stream=process.stderr;ba._isVisible=!0;ba._listenerAttached=!1});var _0=E((HDe,E0)=>{"use strict";var $F=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);E0.exports=$F;E0.exports.default=$F});var BF=E((VDe,jF)=>{"use strict";var LF="[\uD800-\uDBFF][\uDC00-\uDFFF]",dZ=t=>t&&t.exact?new RegExp(`^${LF}$`):new RegExp(LF,"g");jF.exports=dZ});var qF=E((zDe,MF)=>{"use strict";MF.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var C0=E((GDe,HF)=>{var fc=qF(),UF={};for(let t of Object.keys(fc))UF[fc[t]]=t;var te={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};HF.exports=te;for(let t of Object.keys(te)){if(!("channels"in te[t]))throw new Error("missing channels property: "+t);if(!("labels"in te[t]))throw new Error("missing channel labels property: "+t);if(te[t].labels.length!==te[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=te[t];delete te[t].channels,delete te[t].labels,Object.defineProperty(te[t],"channels",{value:e}),Object.defineProperty(te[t],"labels",{value:r})}te.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),s=Math.max(e,r,n),o=s-i,a,u;s===i?a=0:e===s?a=(r-n)/o:r===s?a=2+(n-e)/o:n===s&&(a=4+(e-r)/o),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+s)/2;return s===i?u=0:c<=.5?u=o/(s+i):u=o/(2-s-i),[a,u*100,c*100]};te.rgb.hsv=function(t){let e,r,n,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(o,a,u),l=c-Math.min(o,a,u),h=function(d){return(c-d)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=h(o),r=h(a),n=h(u),o===c?i=n-r:a===c?i=1/3+e-n:u===c&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,c*100]};te.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=te.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,s*100,n*100]};te.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),s=(1-e-i)/(1-i)||0,o=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function pZ(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}te.rgb.keyword=function(t){let e=UF[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(fc)){let s=fc[i],o=pZ(t,s);o<r&&(r=o,n=i)}return n};te.keyword.rgb=function(t){return fc[t]};te.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+r*.3576+n*.1805,s=e*.2126+r*.7152+n*.0722,o=e*.0193+r*.1192+n*.9505;return[i*100,s*100,o*100]};te.rgb.lab=function(t){let e=te.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*n-16,o=500*(r-n),a=200*(n-i);return[s,o,a]};te.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,s,o;if(r===0)return o=n*255,[o,o,o];n<.5?i=n*(1+r):i=n+r-n*r;let a=2*n-i,u=[0,0,0];for(let c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(i-a)*6*s:2*s<1?o=i:3*s<2?o=a+(i-a)*(2/3-s)*6:o=a,u[c]=o*255;return u};te.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,s=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=s<=1?s:2-s;let o=(n+r)/2,a=n===0?2*i/(s+i):2*r/(n+r);return[e,a*100,o*100]};te.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*n*(1-r),a=255*n*(1-r*s),u=255*n*(1-r*(1-s));switch(n*=255,i){case 0:return[n,u,o];case 1:return[a,n,o];case 2:return[o,n,u];case 3:return[o,a,n];case 4:return[u,o,n];case 5:return[n,o,a]}};te.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),s,o;o=(2-r)*n;let a=(2-r)*i;return s=r*i,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};te.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,s;i>1&&(r/=i,n/=i);let o=Math.floor(6*e),a=1-n;s=6*e-o,(o&1)!==0&&(s=1-s);let u=r+s*(a-r),c,l,h;switch(o){default:case 6:case 0:c=a,l=u,h=r;break;case 1:c=u,l=a,h=r;break;case 2:c=r,l=a,h=u;break;case 3:c=r,l=u,h=a;break;case 4:c=u,l=r,h=a;break;case 5:c=a,l=r,h=u;break}return[c*255,l*255,h*255]};te.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[s*255,o*255,a*255]};te.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,s,o;return i=e*3.2406+r*-1.5372+n*-.4986,s=e*-.9689+r*1.8758+n*.0415,o=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};te.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*r-16,s=500*(e-r),o=200*(r-n);return[i,s,o]};te.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,s,o;s=(e+16)/116,i=r/500+s,o=s-n/200;let a=s**3,u=i**3,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};te.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(r*r+n*n);return[e,o,i]};te.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,s=r*Math.cos(i),o=r*Math.sin(i);return[e,s,o]};te.rgb.ansi16=function(t,e=null){let[r,n,i]=t,s=e===null?te.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return s===2&&(o+=60),o};te.hsv.ansi16=function(t){return te.rgb.ansi16(te.hsv.rgb(t),t[2])};te.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};te.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,s=(e>>2&1)*r*255;return[n,i,s]};te.ansi256.rgb=function(t){if(t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};te.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};te.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),i=n>>16&255,s=n>>8&255,o=n&255;return[i,s,o]};te.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),s=Math.min(Math.min(e,r),n),o=i-s,a,u;return o<1?a=s/(1-o):a=0,o<=0?u=0:i===e?u=(r-n)/o%6:i===r?u=2+(n-e)/o:u=4+(e-r)/o,u/=6,u%=1,[u*360,o*100,a*100]};te.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};te.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};te.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],s=e%1*6,o=s%1,a=1-o,u=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-r)*n,[(r*i[0]+u)*255,(r*i[1]+u)*255,(r*i[2]+u)*255]};te.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};te.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};te.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};te.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,s=0;return i<1&&(s=(n-i)/(1-i)),[t[0],i*100,s*100]};te.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};te.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};te.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};te.gray.hsl=function(t){return[0,0,t[0]]};te.gray.hsv=te.gray.hsl;te.gray.hwb=function(t){return[0,100,t[0]]};te.gray.cmyk=function(t){return[0,0,0,t[0]]};te.gray.lab=function(t){return[t[0],0,0]};te.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};te.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var zF=E((KDe,VF)=>{var Kh=C0();function mZ(){let t={},e=Object.keys(Kh);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function gZ(t){let e=mZ(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys(Kh[n]);for(let s=i.length,o=0;o<s;o++){let a=i[o],u=e[a];u.distance===-1&&(u.distance=e[n].distance+1,u.parent=n,r.unshift(a))}}return e}function yZ(t,e){return function(r){return e(t(r))}}function DZ(t,e){let r=[e[t].parent,t],n=Kh[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=yZ(Kh[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}VF.exports=function(t){let e=gZ(t),r={},n=Object.keys(e);for(let i=n.length,s=0;s<i;s++){let o=n[s];e[o].parent!==null&&(r[o]=DZ(o,e))}return r}});var KF=E((WDe,GF)=>{var S0=C0(),wZ=zF(),va={},bZ=Object.keys(S0);function vZ(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function EZ(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=t(r);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}bZ.forEach(t=>{va[t]={},Object.defineProperty(va[t],"channels",{value:S0[t].channels}),Object.defineProperty(va[t],"labels",{value:S0[t].labels});let e=wZ(t);Object.keys(e).forEach(n=>{let i=e[n];va[t][n]=EZ(i),va[t][n].raw=vZ(i)})});GF.exports=va});var O0=E((XDe,ZF)=>{"use strict";var WF=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,XF=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},YF=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},Wh=t=>t,JF=(t,e,r)=>[t,e,r],Ea=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let n=r();return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},A0,_a=(t,e,r,n)=>{A0===void 0&&(A0=KF());let i=n?10:0,s={};for(let[o,a]of Object.entries(A0)){let u=o==="ansi16"?"ansi":o;o===e?s[u]=t(r,i):typeof a=="object"&&(s[u]=t(a[e],i))}return s};function _Z(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,n]of Object.entries(e)){for(let[i,s]of Object.entries(n))e[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[i]=e[i],t.set(s[0],s[1]);Object.defineProperty(e,r,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Ea(e.color,"ansi",()=>_a(WF,"ansi16",Wh,!1)),Ea(e.color,"ansi256",()=>_a(XF,"ansi256",Wh,!1)),Ea(e.color,"ansi16m",()=>_a(YF,"rgb",JF,!1)),Ea(e.bgColor,"ansi",()=>_a(WF,"ansi16",Wh,!0)),Ea(e.bgColor,"ansi256",()=>_a(XF,"ansi256",Wh,!0)),Ea(e.bgColor,"ansi16m",()=>_a(YF,"rgb",JF,!0)),e}Object.defineProperty(ZF,"exports",{enumerable:!0,get:_Z})});var n2=E((YDe,r2)=>{"use strict";var CZ=_0(),SZ=BF(),QF=O0(),t2=["\x1B","\x9B"],Xh=t=>`${t2[0]}[${t}m`,e2=(t,e,r)=>{let n=[];t=[...t];for(let i of t){let s=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");let o=QF.codes.get(Number.parseInt(i,10));if(o){let a=t.indexOf(o.toString());a===-1?n.push(Xh(e?o:s)):t.splice(a,1)}else if(e){n.push(Xh(0));break}else n.push(Xh(s))}if(e&&(n=n.filter((i,s)=>n.indexOf(i)===s),r!==void 0)){let i=Xh(QF.codes.get(Number.parseInt(r,10)));n=n.reduce((s,o)=>o===i?[o,...s]:[...s,o],[])}return n.join("")};r2.exports=(t,e,r)=>{let n=[...t],i=[],s=typeof r=="number"?r:n.length,o=!1,a,u=0,c="";for(let[l,h]of n.entries()){let d=!1;if(t2.includes(h)){let f=/\d[^m]*/.exec(t.slice(l,l+18));a=f&&f.length>0?f[0]:void 0,u<s&&(o=!0,a!==void 0&&i.push(a))}else o&&h==="m"&&(o=!1,d=!0);if(!o&&!d&&u++,!SZ({exact:!0}).test(h)&&CZ(h.codePointAt())&&(u++,typeof r!="number"&&s++),u>e&&u<=s)c+=h;else if(u===e&&!o&&a!==void 0)c=e2(i);else if(u>=s){c+=e2(i,!0,a);break}}return c}});var s2=E((JDe,i2)=>{"use strict";i2.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var Yh=E((ZDe,o2)=>{"use strict";var AZ=s2();o2.exports=t=>typeof t=="string"?t.replace(AZ(),""):t});var u2=E((QDe,a2)=>{"use strict";a2.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var T0=E((e0e,x0)=>{"use strict";var OZ=Yh(),xZ=_0(),TZ=u2(),c2=t=>{if(typeof t!="string"||t.length===0||(t=OZ(t),t.length===0))return 0;t=t.replace(TZ()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=xZ(n)?2:1)}return e};x0.exports=c2;x0.exports.default=c2});var m2=E((t0e,p2)=>{"use strict";var hc=T0(),FZ=Yh(),IZ=O0(),Jh=new Set(["\x1B","\x9B"]),kZ=39,I0="\x07",h2="[",PZ="]",d2="m",k0=`${PZ}8;;`,l2=t=>`${Jh.values().next().value}${h2}${t}${d2}`,f2=t=>`${Jh.values().next().value}${k0}${t}${I0}`,RZ=t=>t.split(" ").map(e=>hc(e)),F0=(t,e,r)=>{let n=[...e],i=!1,s=!1,o=hc(FZ(t[t.length-1]));for(let[a,u]of n.entries()){let c=hc(u);if(o+c<=r?t[t.length-1]+=u:(t.push(u),o=0),Jh.has(u)&&(i=!0,s=n.slice(a+1).join("").startsWith(k0)),i){s?u===I0&&(i=!1,s=!1):u===d2&&(i=!1);continue}o+=c,o===r&&a<n.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},NZ=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(hc(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},$Z=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,s,o=RZ(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let h=hc(a[a.length-1]);if(c!==0&&(h>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),h=0),(h>0||r.trim===!1)&&(a[a.length-1]+=" ",h++)),r.hard&&o[c]>e){let d=e-h,f=1+Math.floor((o[c]-d-1)/e);Math.floor((o[c]-1)/e)<f&&a.push(""),F0(a,l,e);continue}if(h+o[c]>e&&h>0&&o[c]>0){if(r.wordWrap===!1&&h<e){F0(a,l,e);continue}a.push("")}if(h+o[c]>e&&r.wordWrap===!1){F0(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(NZ));let u=[...a.join(`
|
|
67
67
|
`)];for(let[c,l]of u.entries()){if(n+=l,Jh.has(l)){let{groups:d}=new RegExp(`(?:\\${h2}(?<code>\\d+)m|\\${k0}(?<uri>.*)${I0})`).exec(u.slice(c).join(""))||{groups:{}};if(d.code!==void 0){let f=Number.parseFloat(d.code);i=f===kZ?void 0:f}else d.uri!==void 0&&(s=d.uri.length===0?void 0:d.uri)}let h=IZ.codes.get(Number(i));u[c+1]===`
|
|
68
68
|
`?(s&&(n+=f2("")),i&&h&&(n+=l2(h))):l===`
|
|
69
69
|
`&&(i&&h&&(n+=l2(i)),s&&(n+=f2(s)))}return n};p2.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
|
|
70
70
|
`).split(`
|
|
71
71
|
`).map(n=>$Z(n,e,r)).join(`
|
|
72
|
-
`)});var D2=E((
|
|
72
|
+
`)});var D2=E((r0e,y2)=>{"use strict";var LZ=require("os"),g2=LZ.homedir();y2.exports=t=>{if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return g2?t.replace(/^~(?=$|\/|\\)/,g2):t}});var C2=E(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.columnar=ct.generateFillSpaceStringList=ct.expandPath=ct.prettyPath=ct.wordWrap=ct.indent=ct.TTY_WIDTH=ct.stripAnsi=ct.stringWidth=ct.sliceAnsi=void 0;var w2=(fe(),ue(le)),jZ=w2.__importStar(require("os")),ei=w2.__importStar(require("path")),b2=n2();ct.sliceAnsi=b2;var Zh=T0();ct.stringWidth=Zh;var BZ=Yh();ct.stripAnsi=BZ;var MZ=m2(),qZ=D2(),UZ=80,HZ=120;ct.TTY_WIDTH=process.stdout.columns?Math.max(UZ,Math.min(process.stdout.columns,HZ)):1/0;function v2(t=4){return" ".repeat(t)}ct.indent=v2;function VZ(t,{width:e=ct.TTY_WIDTH,indentation:r=0,append:n=""}){return MZ(t,e-r-n.length,{trim:!0}).split(`
|
|
73
73
|
`).join(`${n}
|
|
74
74
|
${v2(r)}`)}ct.wordWrap=VZ;function zZ(t){t=E2(t);let e=process.cwd(),r=ei.dirname(t),n=jZ.homedir(),i=Math.abs(r.split(ei.sep).length-e.split(ei.sep).length);if(e===r)return"."+ei.sep+ei.basename(t);if(r.startsWith(e))return"."+ei.sep+t.substring(e.length+1);if(i<=2){let s=ei.relative(e,t);return s||"."}else{if(t===n)return"~";if(t.indexOf(n)===0)return"~"+ei.sep+t.substring(n.length+1)}return t}ct.prettyPath=zZ;function E2(t){return ei.resolve(qZ(t))}ct.expandPath=E2;function _2(t,e=1,r=" "){e<2&&(e=2);let n=Math.max(...t.map(o=>Zh(o))),i=n>e?n+1:e,s=r.repeat(i);return t.map(o=>b2(s,0,i-Zh(o)))}ct.generateFillSpaceStringList=_2;function GZ(t,{hsep:e="-",vsep:r="|",headers:n}){let i=!!n;if(!t[0])return"";let s=n?n.length:t[0].length,o=n?n.map(l=>[l]):t[0].map(()=>[]);for(let l of t){let h=0,d=l.map(f=>{let m=f.split(`
|
|
75
75
|
`);return h=Math.max(h,m.length),m});for(let f in l)o[f]&&o[f].push(...d[f],...Array(h-d[f].length).fill(""))}let a=o.map((l,h)=>{if(h<s-1){let d=_2(l);return l.map((f,m)=>`${f}${d[m]}${r===""?"":`${r} `}`)}else return l}),u=0,c=a.reduce((l,h)=>l.map((d,f)=>{let m=l[f]+h[f];return u=Math.max(u,Zh(m)),m}));return i&&e!==""&&c.splice(1,0,e.repeat(u)),c.join(`
|
|
@@ -84,29 +84,29 @@ ${v2(r)}`)}ct.wordWrap=VZ;function zZ(t){t=E2(t);let e=process.cwd(),r=ei.dirnam
|
|
|
84
84
|
`)})}),i}};Mi.StreamOutputStrategy=od;var q0=class extends od{constructor({stream:e=process.stdout,colors:r=F2.NO_COLORS}={}){super({stream:e,colors:r}),this.stream=e,this.redrawer=new ad({stream:e})}createTaskChain(){let{failure:e,strong:r,success:n,weak:i}=this.colors,s=new zs.TaskChain({taskOptions:{tickInterval:50}});return s.on("next",o=>{o.on("end",u=>{u.success?this.write(`${n(zs.ICON_SUCCESS)} ${o.msg} ${i(`in ${(0,I2.formatHrTime)(u.elapsedTime)}`)}
|
|
85
85
|
`):this.write(`${e(zs.ICON_FAILURE)} ${o.msg} ${e(i("- failed!"))}
|
|
86
86
|
`)});let a=new zs.Spinner;o.on("tick",()=>{let u=o.progressRatio?(o.progressRatio*100).toFixed(2):"",c=a.frame();this.redrawer.redraw(`${r(c)} ${o.msg}${u?" ("+r(String(u)+"%")+")":""} `)}),o.on("clear",()=>{this.redrawer.clear()})}),s.on("end",()=>{this.redrawer.end()}),s}};Mi.TTYOutputStrategy=q0;var ad=class{constructor({stream:e=process.stdout}){this.stream=e}get width(){return this.stream.columns||80}redraw(e){sd.Cursor.hide(),this.stream.write(sd.EscapeCode.eraseLines(1)+e.replace(/[\r\n]+$/,""))}clear(){this.stream.write(sd.EscapeCode.eraseLines(1))}end(){sd.Cursor.show()}};Mi.TTYOutputRedrawer=ad});var V0=E(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.createDefaultLogger=St.wordWrap=St.stripAnsi=St.stringWidth=St.sliceAnsi=St.indent=St.TTY_WIDTH=void 0;var ud=(fe(),ue(le)),Sa=Bi();Object.defineProperty(St,"TTY_WIDTH",{enumerable:!0,get:function(){return Sa.TTY_WIDTH}});Object.defineProperty(St,"indent",{enumerable:!0,get:function(){return Sa.indent}});Object.defineProperty(St,"sliceAnsi",{enumerable:!0,get:function(){return Sa.sliceAnsi}});Object.defineProperty(St,"stringWidth",{enumerable:!0,get:function(){return Sa.stringWidth}});Object.defineProperty(St,"stripAnsi",{enumerable:!0,get:function(){return Sa.stripAnsi}});Object.defineProperty(St,"wordWrap",{enumerable:!0,get:function(){return Sa.wordWrap}});var dQ=pc(),H0=$0(),pQ=U0();ud.__exportStar(pc(),St);ud.__exportStar($0(),St);ud.__exportStar(U0(),St);ud.__exportStar(M0(),St);function mQ({output:t=new pQ.StreamOutputStrategy({colors:dQ.NO_COLORS,stream:process.stdout}),formatterOptions:e}={}){let{weak:r}=t.colors,n=process.argv.includes("--log-timestamps")?()=>`${r("["+new Date().toISOString()+"]")}`:"",i=(0,H0.createTaggedFormatter)({colors:t.colors,prefix:n,titleize:!0,wrap:!0,...e}),s=new Set([new H0.StreamHandler({stream:t.stream,formatter:i})]);return new H0.Logger({handlers:s})}St.createDefaultLogger=mQ});var P2=E(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.isInteractive=Gs.checkInteractive=void 0;var gQ=(fe(),ue(le)),k2=Bi(),yQ=gQ.__importDefault(wa()),DQ=gc(),wQ=(...t)=>(0,Gs.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(DQ.logger.error(`Non-interactive shell detected.
|
|
87
|
-
Run the command with ${yQ.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;Gs.checkInteractive=wQ;var bQ=()=>k2.TERMINAL_INFO.tty&&!k2.TERMINAL_INFO.ci;Gs.isInteractive=bQ});var lt=E((
|
|
88
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return s=c.done,c},e:function(c){o=!0,a=c},f:function(){try{!s&&r.return!=null&&r.return()}finally{if(o)throw a}}}}function AQ(t,e){if(t){if(typeof t=="string")return B2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B2(t,e)}}function B2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var OQ=cd(),q2=We(),M2=q2.erase,xQ=q2.cursor,TQ=t=>[...OQ(t)].length;U2.exports=function(t,e){if(!e)return M2.line+xQ.to(0);let r=0,n=t.split(/\r?\n/);var i=SQ(n),s;try{for(i.s();!(s=i.n()).done;){let o=s.value;r+=1+Math.floor(Math.max(TQ(o)-1,0)/e)}}catch(o){i.e(o)}finally{i.f()}return M2.lines(r)}});var z0=E((
|
|
87
|
+
Run the command with ${yQ.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;Gs.checkInteractive=wQ;var bQ=()=>k2.TERMINAL_INFO.tty&&!k2.TERMINAL_INFO.ci;Gs.isInteractive=bQ});var lt=E((m0e,N2)=>{"use strict";var{FORCE_COLOR:vQ,NODE_DISABLE_COLORS:EQ,TERM:_Q}=process.env,Ne={enabled:!EQ&&_Q!=="dumb"&&vQ!=="0",reset:Ke(0,0),bold:Ke(1,22),dim:Ke(2,22),italic:Ke(3,23),underline:Ke(4,24),inverse:Ke(7,27),hidden:Ke(8,28),strikethrough:Ke(9,29),black:Ke(30,39),red:Ke(31,39),green:Ke(32,39),yellow:Ke(33,39),blue:Ke(34,39),magenta:Ke(35,39),cyan:Ke(36,39),white:Ke(37,39),gray:Ke(90,39),grey:Ke(90,39),bgBlack:Ke(40,49),bgRed:Ke(41,49),bgGreen:Ke(42,49),bgYellow:Ke(43,49),bgBlue:Ke(44,49),bgMagenta:Ke(45,49),bgCyan:Ke(46,49),bgWhite:Ke(47,49)};function R2(t,e){let r=0,n,i="",s="";for(;r<t.length;r++)n=t[r],i+=n.open,s+=n.close,e.includes(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+s}function CQ(t,e){let r={has:t,keys:e};return r.reset=Ne.reset.bind(r),r.bold=Ne.bold.bind(r),r.dim=Ne.dim.bind(r),r.italic=Ne.italic.bind(r),r.underline=Ne.underline.bind(r),r.inverse=Ne.inverse.bind(r),r.hidden=Ne.hidden.bind(r),r.strikethrough=Ne.strikethrough.bind(r),r.black=Ne.black.bind(r),r.red=Ne.red.bind(r),r.green=Ne.green.bind(r),r.yellow=Ne.yellow.bind(r),r.blue=Ne.blue.bind(r),r.magenta=Ne.magenta.bind(r),r.cyan=Ne.cyan.bind(r),r.white=Ne.white.bind(r),r.gray=Ne.gray.bind(r),r.grey=Ne.grey.bind(r),r.bgBlack=Ne.bgBlack.bind(r),r.bgRed=Ne.bgRed.bind(r),r.bgGreen=Ne.bgGreen.bind(r),r.bgYellow=Ne.bgYellow.bind(r),r.bgBlue=Ne.bgBlue.bind(r),r.bgMagenta=Ne.bgMagenta.bind(r),r.bgCyan=Ne.bgCyan.bind(r),r.bgWhite=Ne.bgWhite.bind(r),r}function Ke(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:Ne.enabled?R2(this.keys,n+""):n+""):n===void 0?CQ([t],[r]):Ne.enabled?R2([r],n+""):n+""}}N2.exports=Ne});var L2=E((g0e,$2)=>{"use strict";$2.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var cd=E((y0e,j2)=>{"use strict";j2.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var H2=E((D0e,U2)=>{"use strict";function SQ(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=AQ(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
88
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return s=c.done,c},e:function(c){o=!0,a=c},f:function(){try{!s&&r.return!=null&&r.return()}finally{if(o)throw a}}}}function AQ(t,e){if(t){if(typeof t=="string")return B2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B2(t,e)}}function B2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var OQ=cd(),q2=We(),M2=q2.erase,xQ=q2.cursor,TQ=t=>[...OQ(t)].length;U2.exports=function(t,e){if(!e)return M2.line+xQ.to(0);let r=0,n=t.split(/\r?\n/);var i=SQ(n),s;try{for(i.s();!(s=i.n()).done;){let o=s.value;r+=1+Math.floor(Math.max(TQ(o)-1,0)/e)}}catch(o){i.e(o)}finally{i.f()}return M2.lines(r)}});var z0=E((w0e,V2)=>{"use strict";var yc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},FQ={arrowUp:yc.arrowUp,arrowDown:yc.arrowDown,arrowLeft:yc.arrowLeft,arrowRight:yc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},IQ=process.platform==="win32"?FQ:yc;V2.exports=IQ});var G2=E((b0e,z2)=>{"use strict";var Aa=lt(),Ks=z0(),G0=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),kQ=t=>G0[t]||G0.default,Dc=Object.freeze({aborted:Aa.red(Ks.cross),done:Aa.green(Ks.tick),exited:Aa.yellow(Ks.cross),default:Aa.cyan("?")}),PQ=(t,e,r)=>e?Dc.aborted:r?Dc.exited:t?Dc.done:Dc.default,RQ=t=>Aa.gray(t?Ks.ellipsis:Ks.pointerSmall),NQ=(t,e)=>Aa.gray(t?e?Ks.pointerSmall:"+":Ks.line);z2.exports={styles:G0,render:kQ,symbols:Dc,symbol:PQ,delimiter:RQ,item:NQ}});var W2=E((v0e,K2)=>{"use strict";var $Q=cd();K2.exports=function(t,e){let r=String($Q(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var Y2=E((E0e,X2)=>{"use strict";X2.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((s,o)=>(o.length+r.length>=n||s[s.length-1].length+o.length+1<n?s[s.length-1]+=` ${o}`:s.push(`${r}${o}`),s),[r]).join(`
|
|
89
89
|
`)).join(`
|
|
90
|
-
`)}});var Z2=E((
|
|
90
|
+
`)}});var Z2=E((_0e,J2)=>{"use strict";J2.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var un=E((C0e,Q2)=>{"use strict";Q2.exports={action:L2(),clear:H2(),style:G2(),strip:cd(),figures:z0(),lines:W2(),wrap:Y2(),entriesToDisplay:Z2()}});var ti=E((S0e,rI)=>{"use strict";var eI=require("readline"),LQ=un(),jQ=LQ.action,BQ=require("events"),tI=We(),MQ=tI.beep,qQ=tI.cursor,UQ=lt(),K0=class extends BQ{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=eI.createInterface({input:this.in,escapeCodeTimeout:50});eI.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(s,o)=>{let a=jQ(o,n);a===!1?this._&&this._(s,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(qQ.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(MQ)}render(){this.onRender(UQ),this.firstRender&&(this.firstRender=!1)}};rI.exports=K0});var aI=E((A0e,oI)=>{"use strict";function nI(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function iI(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(u){nI(s,n,i,o,a,"next",u)}function a(u){nI(s,n,i,o,a,"throw",u)}o(void 0)})}}var ld=lt(),HQ=ti(),sI=We(),VQ=sI.erase,wc=sI.cursor,fd=un(),W0=fd.style,X0=fd.clear,zQ=fd.lines,GQ=fd.figures,Y0=class extends HQ{constructor(e={}){super(e),this.transform=W0.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=X0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=ld.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
91
91
|
`),this.close()}validate(){var e=this;return iI(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return iI(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
|
|
92
92
|
`),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(wc.down(zQ(this.outputError,this.out.columns)-1)+X0(this.outputError,this.out.columns)),this.out.write(X0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[W0.symbol(this.done,this.aborted),ld.bold(this.msg),W0.delimiter(this.done),this.red?ld.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
93
93
|
`).reduce((e,r,n)=>e+`
|
|
94
|
-
${n?" ":GQ.pointerSmall} ${ld.red().italic(r)}`,"")),this.out.write(VQ.line+wc.to(0)+this.outputText+wc.save+this.outputError+wc.restore+wc.move(this.cursorOffset,0)))}};oI.exports=Y0});var fI=E((
|
|
94
|
+
${n?" ":GQ.pointerSmall} ${ld.red().italic(r)}`,"")),this.out.write(VQ.line+wc.to(0)+this.outputText+wc.save+this.outputError+wc.restore+wc.move(this.cursorOffset,0)))}};oI.exports=Y0});var fI=E((O0e,lI)=>{"use strict";var ri=lt(),KQ=ti(),bc=un(),uI=bc.style,cI=bc.clear,hd=bc.figures,WQ=bc.wrap,XQ=bc.entriesToDisplay,YQ=We(),JQ=YQ.cursor,J0=class extends KQ{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=cI("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
95
95
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
96
96
|
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(JQ.hide):this.out.write(cI(this.outputText,this.out.columns)),super.render();let e=XQ(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,n=e.endIndex;if(this.outputText=[uI.symbol(this.done,this.aborted),ri.bold(this.msg),uI.delimiter(!1),this.done?this.selection.title:this.selection.disabled?ri.yellow(this.warn):ri.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
97
97
|
`;for(let i=r;i<n;i++){let s,o,a="",u=this.choices[i];i===r&&r>0?o=hd.arrowUp:i===n-1&&n<this.choices.length?o=hd.arrowDown:o=" ",u.disabled?(s=this.cursor===i?ri.gray().underline(u.title):ri.strikethrough().gray(u.title),o=(this.cursor===i?ri.bold().gray(hd.pointer)+" ":" ")+o):(s=this.cursor===i?ri.cyan().underline(u.title):u.title,o=(this.cursor===i?ri.cyan(hd.pointer)+" ":" ")+o,u.description&&this.cursor===i&&(a=` - ${u.description}`,(o.length+s.length+a.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(a=`
|
|
98
98
|
`+WQ(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${s}${ri.gray(a)}
|
|
99
|
-
`}}this.out.write(this.outputText)}};lI.exports=J0});var yI=E((
|
|
99
|
+
`}}this.out.write(this.outputText)}};lI.exports=J0});var yI=E((x0e,gI)=>{"use strict";var dd=lt(),ZQ=ti(),pI=un(),hI=pI.style,QQ=pI.clear,mI=We(),dI=mI.cursor,eee=mI.erase,Z0=class extends ZQ{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
100
100
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
101
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(dI.hide):this.out.write(QQ(this.outputText,this.out.columns)),super.render(),this.outputText=[hI.symbol(this.done,this.aborted),dd.bold(this.msg),hI.delimiter(this.done),this.value?this.inactive:dd.cyan().underline(this.inactive),dd.gray("/"),this.value?dd.cyan().underline(this.active):this.active].join(" "),this.out.write(eee.line+dI.to(0)+this.outputText))}};gI.exports=Z0});var Sn=E((
|
|
101
|
+
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(dI.hide):this.out.write(QQ(this.outputText,this.out.columns)),super.render(),this.outputText=[hI.symbol(this.done,this.aborted),dd.bold(this.msg),hI.delimiter(this.done),this.value?this.inactive:dd.cyan().underline(this.inactive),dd.gray("/"),this.value?dd.cyan().underline(this.active):this.active].join(" "),this.out.write(eee.line+dI.to(0)+this.outputText))}};gI.exports=Z0});var Sn=E((T0e,DI)=>{"use strict";var Q0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};DI.exports=Q0});var bI=E((F0e,wI)=>{"use strict";var tee=Sn(),ew=class extends tee{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};wI.exports=ew});var EI=E((I0e,vI)=>{"use strict";var ree=Sn(),nee=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),tw=class extends ree{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+nee(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};vI.exports=tw});var CI=E((k0e,_I)=>{"use strict";var iee=Sn(),rw=class extends iee{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};_I.exports=rw});var AI=E((P0e,SI)=>{"use strict";var see=Sn(),nw=class extends see{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};SI.exports=nw});var xI=E((R0e,OI)=>{"use strict";var oee=Sn(),iw=class extends oee{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};OI.exports=iw});var FI=E((N0e,TI)=>{"use strict";var aee=Sn(),sw=class extends aee{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};TI.exports=sw});var kI=E(($0e,II)=>{"use strict";var uee=Sn(),ow=class extends uee{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};II.exports=ow});var RI=E((L0e,PI)=>{"use strict";var cee=Sn(),aw=class extends cee{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};PI.exports=aw});var $I=E((j0e,NI)=>{"use strict";NI.exports={DatePart:Sn(),Meridiem:bI(),Day:EI(),Hours:CI(),Milliseconds:AI(),Minutes:xI(),Month:FI(),Seconds:kI(),Year:RI()}});var GI=E((B0e,zI)=>{"use strict";function LI(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function jI(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(u){LI(s,n,i,o,a,"next",u)}function a(u){LI(s,n,i,o,a,"throw",u)}o(void 0)})}}var uw=lt(),lee=ti(),lw=un(),BI=lw.style,MI=lw.clear,fee=lw.figures,VI=We(),hee=VI.erase,qI=VI.cursor,ni=$I(),UI=ni.DatePart,dee=ni.Meridiem,pee=ni.Day,mee=ni.Hours,gee=ni.Milliseconds,yee=ni.Minutes,Dee=ni.Month,wee=ni.Seconds,bee=ni.Year,vee=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,HI={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new pee(t),3:t=>new Dee(t),4:t=>new bee(t),5:t=>new dee(t),6:t=>new mee(t),7:t=>new yee(t),8:t=>new wee(t),9:t=>new gee(t)},Eee={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},cw=class extends lee{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(Eee,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=MI("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=vee.exec(e);){let i=r.shift(),s=r.findIndex(o=>o!=null);this.parts.push(s in HI?HI[s]({token:r[s]||i,date:this.date,parts:this.parts,locales:this.locales}):r[s]||i)}let n=this.parts.reduce((i,s)=>(typeof s=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=s:i.push(s),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof UI)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
102
102
|
`),this.close()}validate(){var e=this;return jI(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return jI(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
|
|
103
103
|
`),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof UI)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(qI.hide):this.out.write(MI(this.outputText,this.out.columns)),super.render(),this.outputText=[BI.symbol(this.done,this.aborted),uw.bold(this.msg),BI.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?uw.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
104
104
|
`).reduce((e,r,n)=>e+`
|
|
105
|
-
${n?" ":fee.pointerSmall} ${uw.red().italic(r)}`,"")),this.out.write(hee.line+qI.to(0)+this.outputText))}};zI.exports=cw});var QI=E((
|
|
105
|
+
${n?" ":fee.pointerSmall} ${uw.red().italic(r)}`,"")),this.out.write(hee.line+qI.to(0)+this.outputText))}};zI.exports=cw});var QI=E((M0e,ZI)=>{"use strict";function KI(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function WI(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(u){KI(s,n,i,o,a,"next",u)}function a(u){KI(s,n,i,o,a,"throw",u)}o(void 0)})}}var pd=lt(),_ee=ti(),JI=We(),md=JI.cursor,Cee=JI.erase,gd=un(),fw=gd.style,See=gd.figures,XI=gd.clear,Aee=gd.lines,Oee=/[0-9]/,hw=t=>t!==void 0,YI=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},dw=class extends _ee{constructor(e={}){super(e),this.transform=fw.render(e.style),this.msg=e.message,this.initial=hw(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=hw(e.min)?e.min:-1/0,this.max=hw(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=pd.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${YI(e,this.round)}`),this._value=YI(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||Oee.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
106
106
|
`),this.close()}validate(){var e=this;return WI(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return WI(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
|
|
107
107
|
`),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(md.down(Aee(this.outputError,this.out.columns)-1)+XI(this.outputError,this.out.columns)),this.out.write(XI(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[fw.symbol(this.done,this.aborted),pd.bold(this.msg),fw.delimiter(this.done),!this.done||!this.done&&!this.placeholder?pd[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
108
108
|
`).reduce((e,r,n)=>e+`
|
|
109
|
-
${n?" ":See.pointerSmall} ${pd.red().italic(r)}`,"")),this.out.write(Cee.line+md.to(0)+this.outputText+md.save+this.outputError+md.restore))}};ZI.exports=dw});var mw=E((
|
|
109
|
+
${n?" ":See.pointerSmall} ${pd.red().italic(r)}`,"")),this.out.write(Cee.line+md.to(0)+this.outputText+md.save+this.outputError+md.restore))}};ZI.exports=dw});var mw=E((q0e,rk)=>{"use strict";var An=lt(),xee=We(),Tee=xee.cursor,Fee=ti(),vc=un(),ek=vc.clear,qi=vc.figures,tk=vc.style,Iee=vc.wrap,kee=vc.entriesToDisplay,pw=class extends Fee{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=ek("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
110
110
|
`),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
111
111
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
112
112
|
Instructions:
|
|
@@ -116,13 +116,13 @@ Instructions:
|
|
|
116
116
|
`:"")+" enter/return: Complete answer":""}renderOption(e,r,n,i){let s=(r.selected?An.green(qi.radioOn):qi.radioOff)+" "+i+" ",o,a;return r.disabled?o=e===n?An.gray().underline(r.title):An.strikethrough().gray(r.title):(o=e===n?An.cyan().underline(r.title):r.title,e===n&&r.description&&(a=` - ${r.description}`,(s.length+o.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
|
|
117
117
|
`+Iee(r.description,{margin:s.length,width:this.out.columns})))),s+o+An.gray(a||"")}paginateOptions(e){if(e.length===0)return An.red("No matches for this query.");let r=kee(this.cursor,e.length,this.optionsPerPage),n=r.startIndex,i=r.endIndex,s,o=[];for(let a=n;a<i;a++)a===n&&n>0?s=qi.arrowUp:a===i-1&&i<e.length?s=qi.arrowDown:s=" ",o.push(this.renderOption(this.cursor,e[a],a,s));return`
|
|
118
118
|
`+o.join(`
|
|
119
|
-
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[An.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(An.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Tee.hide),super.render();let e=[tk.symbol(this.done,this.aborted),An.bold(this.msg),tk.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=An.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=ek(e,this.out.columns)}};rk.exports=pw});var ck=E((
|
|
119
|
+
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[An.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(An.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Tee.hide),super.render();let e=[tk.symbol(this.done,this.aborted),An.bold(this.msg),tk.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=An.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=ek(e,this.out.columns)}};rk.exports=pw});var ck=E((U0e,uk)=>{"use strict";function nk(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Pee(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(u){nk(s,n,i,o,a,"next",u)}function a(u){nk(s,n,i,o,a,"throw",u)}o(void 0)})}}var Ec=lt(),Ree=ti(),ak=We(),Nee=ak.erase,ik=ak.cursor,_c=un(),gw=_c.style,sk=_c.clear,yw=_c.figures,$ee=_c.wrap,Lee=_c.entriesToDisplay,ok=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),jee=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),Bee=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},Dw=class extends Ree{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:Bee(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=gw.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=sk("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=ok(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var r=this;return Pee(function*(){let n=r.completing=r.suggest(r.input,r.choices),i=yield n;if(r.completing!==n)return;r.suggestions=i.map((o,a,u)=>({title:jee(u,a),value:ok(u,a),description:o.description})),r.completing=!1;let s=Math.max(i.length-1,0);r.moveSelect(Math.min(s,r.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
120
120
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
121
121
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
122
122
|
`),this.close()}_(e,r){let n=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${n}${e}${i}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,r,n,i){let s,o=n?yw.arrowUp:i?yw.arrowDown:" ",a=r?Ec.cyan().underline(e.title):e.title;return o=(r?Ec.cyan(yw.pointer)+" ":" ")+o,e.description&&(s=` - ${e.description}`,(o.length+a.length+s.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(s=`
|
|
123
123
|
`+$ee(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Ec.gray(s||"")}render(){if(this.closed)return;this.firstRender?this.out.write(ik.hide):this.out.write(sk(this.outputText,this.out.columns)),super.render();let e=Lee(this.select,this.choices.length,this.limit),r=e.startIndex,n=e.endIndex;if(this.outputText=[gw.symbol(this.done,this.aborted,this.exited),Ec.bold(this.msg),gw.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(r,n).map((s,o)=>this.renderOption(s,this.select===o+r,o===0&&r>0,o+r===n-1&&n<this.choices.length)).join(`
|
|
124
124
|
`);this.outputText+=`
|
|
125
|
-
`+(i||Ec.gray(this.fallback.title))}this.out.write(Nee.line+ik.to(0)+this.outputText)}};uk.exports=Dw});var dk=E((
|
|
125
|
+
`+(i||Ec.gray(this.fallback.title))}this.out.write(Nee.line+ik.to(0)+this.outputText)}};uk.exports=Dw});var dk=E((H0e,hk)=>{"use strict";var ii=lt(),Mee=We(),qee=Mee.cursor,Uee=mw(),bw=un(),lk=bw.clear,fk=bw.style,Oa=bw.figures,ww=class extends Uee{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=lk("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
126
126
|
Instructions:
|
|
127
127
|
${Oa.arrowUp}/${Oa.arrowDown}: Highlight option
|
|
128
128
|
${Oa.arrowLeft}/${Oa.arrowRight}/[space]: Toggle selection
|
|
@@ -130,31 +130,31 @@ Instructions:
|
|
|
130
130
|
enter/return: Complete answer
|
|
131
131
|
`:""}renderCurrentInput(){return`
|
|
132
132
|
Filtered results for: ${this.inputValue?this.inputValue:ii.gray("Enter something to filter")}
|
|
133
|
-
`}renderOption(e,r,n){let i;return r.disabled?i=e===n?ii.gray().underline(r.title):ii.strikethrough().gray(r.title):i=e===n?ii.cyan().underline(r.title):r.title,(r.selected?ii.green(Oa.radioOn):Oa.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[ii.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(ii.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(qee.hide),super.render();let e=[fk.symbol(this.done,this.aborted),ii.bold(this.msg),fk.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=ii.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=lk(e,this.out.columns)}};hk.exports=ww});var bk=E((
|
|
133
|
+
`}renderOption(e,r,n){let i;return r.disabled?i=e===n?ii.gray().underline(r.title):ii.strikethrough().gray(r.title):i=e===n?ii.cyan().underline(r.title):r.title,(r.selected?ii.green(Oa.radioOn):Oa.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[ii.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(ii.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(qee.hide),super.render();let e=[fk.symbol(this.done,this.aborted),ii.bold(this.msg),fk.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=ii.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=lk(e,this.out.columns)}};hk.exports=ww});var bk=E((V0e,wk)=>{"use strict";var pk=lt(),Hee=ti(),yk=un(),mk=yk.style,Vee=yk.clear,Dk=We(),zee=Dk.erase,gk=Dk.cursor,vw=class extends Hee{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
134
134
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
135
|
-
`),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(gk.hide):this.out.write(Vee(this.outputText,this.out.columns)),super.render(),this.outputText=[mk.symbol(this.done,this.aborted),pk.bold(this.msg),mk.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:pk.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(zee.line+gk.to(0)+this.outputText))}};wk.exports=vw});var Ek=E((
|
|
136
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return s=c.done,c},e:function(c){o=!0,a=c},f:function(){try{!s&&r.return!=null&&r.return()}finally{if(o)throw a}}}}function Yee(t,e){if(t){if(typeof t=="string")return Ok(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ok(t,e)}}function Ok(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function xk(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Tk(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(u){xk(s,n,i,o,a,"next",u)}function a(u){xk(s,n,i,o,a,"throw",u)}o(void 0)})}}var Ew=Ck(),Jee=["suggest","format","onState","validate","onRender","type"],Fk=()=>{};function Ui(){return _w.apply(this,arguments)}function _w(){return _w=Tk(function*(t=[],{onSubmit:e=Fk,onCancel:r=Fk}={}){let n={},i=Ui._override||{};t=[].concat(t);let s,o,a,u,c,l,h=(function(){var b=Tk(function*(S,A,p=!1){if(!(!p&&S.validate&&S.validate(A)!==!0))return S.format?yield S.format(A,n):A});return function(A,p){return b.apply(this,arguments)}})();var d=Xee(t),f;try{for(d.s();!(f=d.n()).done;){o=f.value;var m=o;if(u=m.name,c=m.type,typeof c=="function"&&(c=yield c(s,Ak({},n),o),o.type=c),!!c){for(let b in o){if(Jee.includes(b))continue;let S=o[b];o[b]=typeof S=="function"?yield S(s,Ak({},n),l):S}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");var g=o;if(u=g.name,c=g.type,Ew[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[o.name]!==void 0&&(s=yield h(o,i[o.name]),s!==void 0)){n[u]=s;continue}try{s=Ui._injected?Zee(Ui._injected,o.initial):yield Ew[c](o),n[u]=s=yield h(o,s,!0),a=yield e(o,s,n)}catch{a=!(yield r(o,n))}if(a)return n}}}catch(b){d.e(b)}finally{d.f()}return n}),_w.apply(this,arguments)}function Zee(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Qee(t){Ui._injected=(Ui._injected||[]).concat(t)}function ete(t){Ui._override=Object.assign({},t)}Ik.exports=Object.assign(Ui,{prompt:Ui,prompts:Ew,inject:Qee,override:ete})});var Rk=E((
|
|
135
|
+
`),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(gk.hide):this.out.write(Vee(this.outputText,this.out.columns)),super.render(),this.outputText=[mk.symbol(this.done,this.aborted),pk.bold(this.msg),mk.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:pk.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(zee.line+gk.to(0)+this.outputText))}};wk.exports=vw});var Ek=E((z0e,vk)=>{"use strict";vk.exports={TextPrompt:aI(),SelectPrompt:fI(),TogglePrompt:yI(),DatePrompt:GI(),NumberPrompt:QI(),MultiselectPrompt:mw(),AutocompletePrompt:ck(),AutocompleteMultiselectPrompt:dk(),ConfirmPrompt:bk()}});var Ck=E(_k=>{"use strict";var vr=_k,Gee=Ek(),yd=t=>t;function On(t,e,r={}){return new Promise((n,i)=>{let s=new Gee[t](e),o=r.onAbort||yd,a=r.onSubmit||yd,u=r.onExit||yd;s.on("state",e.onState||yd),s.on("submit",c=>n(a(c))),s.on("exit",c=>n(u(c))),s.on("abort",c=>i(o(c)))})}vr.text=t=>On("TextPrompt",t);vr.password=t=>(t.style="password",vr.text(t));vr.invisible=t=>(t.style="invisible",vr.text(t));vr.number=t=>On("NumberPrompt",t);vr.date=t=>On("DatePrompt",t);vr.confirm=t=>On("ConfirmPrompt",t);vr.list=t=>{let e=t.separator||",";return On("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};vr.toggle=t=>On("TogglePrompt",t);vr.select=t=>On("SelectPrompt",t);vr.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return On("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};vr.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return On("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var Kee=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));vr.autocomplete=t=>(t.suggest=t.suggest||Kee,t.choices=[].concat(t.choices||[]),On("AutocompletePrompt",t))});var kk=E((K0e,Ik)=>{"use strict";function Sk(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ak(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Sk(Object(r),!0).forEach(function(n){Wee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Sk(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Wee(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xee(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Yee(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
136
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return s=c.done,c},e:function(c){o=!0,a=c},f:function(){try{!s&&r.return!=null&&r.return()}finally{if(o)throw a}}}}function Yee(t,e){if(t){if(typeof t=="string")return Ok(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ok(t,e)}}function Ok(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function xk(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function Tk(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(u){xk(s,n,i,o,a,"next",u)}function a(u){xk(s,n,i,o,a,"throw",u)}o(void 0)})}}var Ew=Ck(),Jee=["suggest","format","onState","validate","onRender","type"],Fk=()=>{};function Ui(){return _w.apply(this,arguments)}function _w(){return _w=Tk(function*(t=[],{onSubmit:e=Fk,onCancel:r=Fk}={}){let n={},i=Ui._override||{};t=[].concat(t);let s,o,a,u,c,l,h=(function(){var b=Tk(function*(S,A,p=!1){if(!(!p&&S.validate&&S.validate(A)!==!0))return S.format?yield S.format(A,n):A});return function(A,p){return b.apply(this,arguments)}})();var d=Xee(t),f;try{for(d.s();!(f=d.n()).done;){o=f.value;var m=o;if(u=m.name,c=m.type,typeof c=="function"&&(c=yield c(s,Ak({},n),o),o.type=c),!!c){for(let b in o){if(Jee.includes(b))continue;let S=o[b];o[b]=typeof S=="function"?yield S(s,Ak({},n),l):S}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");var g=o;if(u=g.name,c=g.type,Ew[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[o.name]!==void 0&&(s=yield h(o,i[o.name]),s!==void 0)){n[u]=s;continue}try{s=Ui._injected?Zee(Ui._injected,o.initial):yield Ew[c](o),n[u]=s=yield h(o,s,!0),a=yield e(o,s,n)}catch{a=!(yield r(o,n))}if(a)return n}}}catch(b){d.e(b)}finally{d.f()}return n}),_w.apply(this,arguments)}function Zee(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Qee(t){Ui._injected=(Ui._injected||[]).concat(t)}function ete(t){Ui._override=Object.assign({},t)}Ik.exports=Object.assign(Ui,{prompt:Ui,prompts:Ew,inject:Qee,override:ete})});var Rk=E((W0e,Pk)=>{"use strict";Pk.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var Dd=E((X0e,Nk)=>{"use strict";Nk.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var jk=E((Y0e,Lk)=>{"use strict";var tte=Dd(),{erase:$k,cursor:rte}=We(),nte=t=>[...tte(t)].length;Lk.exports=function(t,e){if(!e)return $k.line+rte.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(nte(i)-1,0)/e);return $k.lines(r)}});var Cw=E((J0e,Bk)=>{"use strict";var Cc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},ite={arrowUp:Cc.arrowUp,arrowDown:Cc.arrowDown,arrowLeft:Cc.arrowLeft,arrowRight:Cc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},ste=process.platform==="win32"?ite:Cc;Bk.exports=ste});var qk=E((Z0e,Mk)=>{"use strict";var xa=lt(),Ws=Cw(),Sw=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),ote=t=>Sw[t]||Sw.default,Sc=Object.freeze({aborted:xa.red(Ws.cross),done:xa.green(Ws.tick),exited:xa.yellow(Ws.cross),default:xa.cyan("?")}),ate=(t,e,r)=>e?Sc.aborted:r?Sc.exited:t?Sc.done:Sc.default,ute=t=>xa.gray(t?Ws.ellipsis:Ws.pointerSmall),cte=(t,e)=>xa.gray(t?e?Ws.pointerSmall:"+":Ws.line);Mk.exports={styles:Sw,render:ote,symbols:Sc,symbol:ate,delimiter:ute,item:cte}});var Hk=E((Q0e,Uk)=>{"use strict";var lte=Dd();Uk.exports=function(t,e){let r=String(lte(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var zk=E((ewe,Vk)=>{"use strict";Vk.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((s,o)=>(o.length+r.length>=n||s[s.length-1].length+o.length+1<n?s[s.length-1]+=` ${o}`:s.push(`${r}${o}`),s),[r]).join(`
|
|
137
137
|
`)).join(`
|
|
138
|
-
`)}});var Kk=E((
|
|
138
|
+
`)}});var Kk=E((twe,Gk)=>{"use strict";Gk.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var cn=E((rwe,Wk)=>{"use strict";Wk.exports={action:Rk(),clear:jk(),style:qk(),strip:Dd(),figures:Cw(),lines:Hk(),wrap:zk(),entriesToDisplay:Kk()}});var si=E((nwe,Yk)=>{"use strict";var Xk=require("readline"),{action:fte}=cn(),hte=require("events"),{beep:dte,cursor:pte}=We(),mte=lt(),Aw=class extends hte{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=Xk.createInterface({input:this.in,escapeCodeTimeout:50});Xk.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(s,o)=>{let a=fte(o,n);a===!1?this._&&this._(s,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(pte.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(dte)}render(){this.onRender(mte),this.firstRender&&(this.firstRender=!1)}};Yk.exports=Aw});var Zk=E((iwe,Jk)=>{var wd=lt(),gte=si(),{erase:yte,cursor:Ac}=We(),{style:Ow,clear:xw,lines:Dte,figures:wte}=cn(),Tw=class extends gte{constructor(e={}){super(e),this.transform=Ow.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=xw("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=wd.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
139
139
|
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
140
140
|
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Ac.down(Dte(this.outputError,this.out.columns)-1)+xw(this.outputError,this.out.columns)),this.out.write(xw(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ow.symbol(this.done,this.aborted),wd.bold(this.msg),Ow.delimiter(this.done),this.red?wd.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
141
141
|
`).reduce((e,r,n)=>e+`
|
|
142
|
-
${n?" ":wte.pointerSmall} ${wd.red().italic(r)}`,"")),this.out.write(yte.line+Ac.to(0)+this.outputText+Ac.save+this.outputError+Ac.restore+Ac.move(this.cursorOffset,0)))}};Jk.exports=Tw});var rP=E((
|
|
142
|
+
${n?" ":wte.pointerSmall} ${wd.red().italic(r)}`,"")),this.out.write(yte.line+Ac.to(0)+this.outputText+Ac.save+this.outputError+Ac.restore+Ac.move(this.cursorOffset,0)))}};Jk.exports=Tw});var rP=E((swe,tP)=>{"use strict";var oi=lt(),bte=si(),{style:Qk,clear:eP,figures:bd,wrap:vte,entriesToDisplay:Ete}=cn(),{cursor:_te}=We(),Fw=class extends bte{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=eP("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
143
143
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
144
144
|
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(_te.hide):this.out.write(eP(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Ete(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[Qk.symbol(this.done,this.aborted),oi.bold(this.msg),Qk.delimiter(!1),this.done?this.selection.title:this.selection.disabled?oi.yellow(this.warn):oi.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
145
145
|
`;for(let n=e;n<r;n++){let i,s,o="",a=this.choices[n];n===e&&e>0?s=bd.arrowUp:n===r-1&&r<this.choices.length?s=bd.arrowDown:s=" ",a.disabled?(i=this.cursor===n?oi.gray().underline(a.title):oi.strikethrough().gray(a.title),s=(this.cursor===n?oi.bold().gray(bd.pointer)+" ":" ")+s):(i=this.cursor===n?oi.cyan().underline(a.title):a.title,s=(this.cursor===n?oi.cyan(bd.pointer)+" ":" ")+s,a.description&&this.cursor===n&&(o=` - ${a.description}`,(s.length+i.length+o.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(o=`
|
|
146
146
|
`+vte(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${i}${oi.gray(o)}
|
|
147
|
-
`}}this.out.write(this.outputText)}};tP.exports=Fw});var oP=E((
|
|
147
|
+
`}}this.out.write(this.outputText)}};tP.exports=Fw});var oP=E((owe,sP)=>{var vd=lt(),Cte=si(),{style:nP,clear:Ste}=cn(),{cursor:iP,erase:Ate}=We(),Iw=class extends Cte{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
148
148
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
149
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(iP.hide):this.out.write(Ste(this.outputText,this.out.columns)),super.render(),this.outputText=[nP.symbol(this.done,this.aborted),vd.bold(this.msg),nP.delimiter(this.done),this.value?this.inactive:vd.cyan().underline(this.inactive),vd.gray("/"),this.value?vd.cyan().underline(this.active):this.active].join(" "),this.out.write(Ate.line+iP.to(0)+this.outputText))}};sP.exports=Iw});var xn=E((
|
|
149
|
+
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(iP.hide):this.out.write(Ste(this.outputText,this.out.columns)),super.render(),this.outputText=[nP.symbol(this.done,this.aborted),vd.bold(this.msg),nP.delimiter(this.done),this.value?this.inactive:vd.cyan().underline(this.inactive),vd.gray("/"),this.value?vd.cyan().underline(this.active):this.active].join(" "),this.out.write(Ate.line+iP.to(0)+this.outputText))}};sP.exports=Iw});var xn=E((awe,aP)=>{"use strict";var kw=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};aP.exports=kw});var cP=E((uwe,uP)=>{"use strict";var Ote=xn(),Pw=class extends Ote{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};uP.exports=Pw});var fP=E((cwe,lP)=>{"use strict";var xte=xn(),Tte=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),Rw=class extends xte{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Tte(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};lP.exports=Rw});var dP=E((lwe,hP)=>{"use strict";var Fte=xn(),Nw=class extends Fte{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};hP.exports=Nw});var mP=E((fwe,pP)=>{"use strict";var Ite=xn(),$w=class extends Ite{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};pP.exports=$w});var yP=E((hwe,gP)=>{"use strict";var kte=xn(),Lw=class extends kte{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};gP.exports=Lw});var wP=E((dwe,DP)=>{"use strict";var Pte=xn(),jw=class extends Pte{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};DP.exports=jw});var vP=E((pwe,bP)=>{"use strict";var Rte=xn(),Bw=class extends Rte{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};bP.exports=Bw});var _P=E((mwe,EP)=>{"use strict";var Nte=xn(),Mw=class extends Nte{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};EP.exports=Mw});var SP=E((gwe,CP)=>{"use strict";CP.exports={DatePart:xn(),Meridiem:cP(),Day:fP(),Hours:dP(),Milliseconds:mP(),Minutes:yP(),Month:wP(),Seconds:vP(),Year:_P()}});var kP=E((ywe,IP)=>{"use strict";var qw=lt(),$te=si(),{style:AP,clear:OP,figures:Lte}=cn(),{erase:jte,cursor:xP}=We(),{DatePart:TP,Meridiem:Bte,Day:Mte,Hours:qte,Milliseconds:Ute,Minutes:Hte,Month:Vte,Seconds:zte,Year:Gte}=SP(),Kte=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,FP={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new Mte(t),3:t=>new Vte(t),4:t=>new Gte(t),5:t=>new Bte(t),6:t=>new qte(t),7:t=>new Hte(t),8:t=>new zte(t),9:t=>new Ute(t)},Wte={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},Uw=class extends $te{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(Wte,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=OP("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=Kte.exec(e);){let i=r.shift(),s=r.findIndex(o=>o!=null);this.parts.push(s in FP?FP[s]({token:r[s]||i,date:this.date,parts:this.parts,locales:this.locales}):r[s]||i)}let n=this.parts.reduce((i,s)=>(typeof s=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=s:i.push(s),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof TP)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
150
150
|
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
151
151
|
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof TP)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(xP.hide):this.out.write(OP(this.outputText,this.out.columns)),super.render(),this.outputText=[AP.symbol(this.done,this.aborted),qw.bold(this.msg),AP.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?qw.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
152
152
|
`).reduce((e,r,n)=>e+`
|
|
153
|
-
${n?" ":Lte.pointerSmall} ${qw.red().italic(r)}`,"")),this.out.write(jte.line+xP.to(0)+this.outputText))}};IP.exports=Uw});var $P=E((
|
|
153
|
+
${n?" ":Lte.pointerSmall} ${qw.red().italic(r)}`,"")),this.out.write(jte.line+xP.to(0)+this.outputText))}};IP.exports=Uw});var $P=E((Dwe,NP)=>{var Ed=lt(),Xte=si(),{cursor:_d,erase:Yte}=We(),{style:Hw,figures:Jte,clear:PP,lines:Zte}=cn(),Qte=/[0-9]/,Vw=t=>t!==void 0,RP=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},zw=class extends Xte{constructor(e={}){super(e),this.transform=Hw.render(e.style),this.msg=e.message,this.initial=Vw(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Vw(e.min)?e.min:-1/0,this.max=Vw(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Ed.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${RP(e,this.round)}`),this._value=RP(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||Qte.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
154
154
|
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
155
155
|
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(_d.down(Zte(this.outputError,this.out.columns)-1)+PP(this.outputError,this.out.columns)),this.out.write(PP(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Hw.symbol(this.done,this.aborted),Ed.bold(this.msg),Hw.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Ed[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
156
156
|
`).reduce((e,r,n)=>e+`
|
|
157
|
-
${n?" ":Jte.pointerSmall} ${Ed.red().italic(r)}`,"")),this.out.write(Yte.line+_d.to(0)+this.outputText+_d.save+this.outputError+_d.restore))}};NP.exports=zw});var Kw=E((
|
|
157
|
+
${n?" ":Jte.pointerSmall} ${Ed.red().italic(r)}`,"")),this.out.write(Yte.line+_d.to(0)+this.outputText+_d.save+this.outputError+_d.restore))}};NP.exports=zw});var Kw=E((wwe,BP)=>{"use strict";var Tn=lt(),{cursor:ere}=We(),tre=si(),{clear:LP,figures:Hi,style:jP,wrap:rre,entriesToDisplay:nre}=cn(),Gw=class extends tre{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=LP("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
158
158
|
`),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
159
159
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
160
160
|
Instructions:
|
|
@@ -164,13 +164,13 @@ Instructions:
|
|
|
164
164
|
`:"")+" enter/return: Complete answer":""}renderOption(e,r,n,i){let s=(r.selected?Tn.green(Hi.radioOn):Hi.radioOff)+" "+i+" ",o,a;return r.disabled?o=e===n?Tn.gray().underline(r.title):Tn.strikethrough().gray(r.title):(o=e===n?Tn.cyan().underline(r.title):r.title,e===n&&r.description&&(a=` - ${r.description}`,(s.length+o.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
|
|
165
165
|
`+rre(r.description,{margin:s.length,width:this.out.columns})))),s+o+Tn.gray(a||"")}paginateOptions(e){if(e.length===0)return Tn.red("No matches for this query.");let{startIndex:r,endIndex:n}=nre(this.cursor,e.length,this.optionsPerPage),i,s=[];for(let o=r;o<n;o++)o===r&&r>0?i=Hi.arrowUp:o===n-1&&n<e.length?i=Hi.arrowDown:i=" ",s.push(this.renderOption(this.cursor,e[o],o,i));return`
|
|
166
166
|
`+s.join(`
|
|
167
|
-
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Tn.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ere.hide),super.render();let e=[jP.symbol(this.done,this.aborted),Tn.bold(this.msg),jP.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=LP(e,this.out.columns)}};BP.exports=Gw});var VP=E((
|
|
167
|
+
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Tn.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ere.hide),super.render();let e=[jP.symbol(this.done,this.aborted),Tn.bold(this.msg),jP.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=LP(e,this.out.columns)}};BP.exports=Gw});var VP=E((bwe,HP)=>{"use strict";var Oc=lt(),ire=si(),{erase:sre,cursor:MP}=We(),{style:Ww,clear:qP,figures:Xw,wrap:ore,entriesToDisplay:are}=cn(),UP=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),ure=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),cre=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},Yw=class extends ire{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:cre(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=Ww.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=qP("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=UP(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),n=await r;if(this.completing!==r)return;this.suggestions=n.map((s,o,a)=>({title:ure(a,o),value:UP(a,o),description:s.description})),this.completing=!1;let i=Math.max(n.length-1,0);this.moveSelect(Math.min(i,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
168
168
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
169
169
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
170
170
|
`),this.close()}_(e,r){let n=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${n}${e}${i}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,r,n,i){let s,o=n?Xw.arrowUp:i?Xw.arrowDown:" ",a=r?Oc.cyan().underline(e.title):e.title;return o=(r?Oc.cyan(Xw.pointer)+" ":" ")+o,e.description&&(s=` - ${e.description}`,(o.length+a.length+s.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(s=`
|
|
171
171
|
`+ore(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Oc.gray(s||"")}render(){if(this.closed)return;this.firstRender?this.out.write(MP.hide):this.out.write(qP(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=are(this.select,this.choices.length,this.limit);if(this.outputText=[Ww.symbol(this.done,this.aborted,this.exited),Oc.bold(this.msg),Ww.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(e,r).map((i,s)=>this.renderOption(i,this.select===s+e,s===0&&e>0,s+e===r-1&&r<this.choices.length)).join(`
|
|
172
172
|
`);this.outputText+=`
|
|
173
|
-
`+(n||Oc.gray(this.fallback.title))}this.out.write(sre.line+MP.to(0)+this.outputText)}};HP.exports=Yw});var WP=E((
|
|
173
|
+
`+(n||Oc.gray(this.fallback.title))}this.out.write(sre.line+MP.to(0)+this.outputText)}};HP.exports=Yw});var WP=E((vwe,KP)=>{"use strict";var ai=lt(),{cursor:lre}=We(),fre=Kw(),{clear:zP,style:GP,figures:Ta}=cn(),Jw=class extends fre{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=zP("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
174
174
|
Instructions:
|
|
175
175
|
${Ta.arrowUp}/${Ta.arrowDown}: Highlight option
|
|
176
176
|
${Ta.arrowLeft}/${Ta.arrowRight}/[space]: Toggle selection
|
|
@@ -178,9 +178,9 @@ Instructions:
|
|
|
178
178
|
enter/return: Complete answer
|
|
179
179
|
`:""}renderCurrentInput(){return`
|
|
180
180
|
Filtered results for: ${this.inputValue?this.inputValue:ai.gray("Enter something to filter")}
|
|
181
|
-
`}renderOption(e,r,n){let i;return r.disabled?i=e===n?ai.gray().underline(r.title):ai.strikethrough().gray(r.title):i=e===n?ai.cyan().underline(r.title):r.title,(r.selected?ai.green(Ta.radioOn):Ta.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[ai.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(ai.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(lre.hide),super.render();let e=[GP.symbol(this.done,this.aborted),ai.bold(this.msg),GP.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=ai.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=zP(e,this.out.columns)}};KP.exports=Jw});var QP=E((
|
|
181
|
+
`}renderOption(e,r,n){let i;return r.disabled?i=e===n?ai.gray().underline(r.title):ai.strikethrough().gray(r.title):i=e===n?ai.cyan().underline(r.title):r.title,(r.selected?ai.green(Ta.radioOn):Ta.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[ai.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(ai.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(lre.hide),super.render();let e=[GP.symbol(this.done,this.aborted),ai.bold(this.msg),GP.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=ai.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=zP(e,this.out.columns)}};KP.exports=Jw});var QP=E((Ewe,ZP)=>{var XP=lt(),hre=si(),{style:YP,clear:dre}=cn(),{erase:pre,cursor:JP}=We(),Zw=class extends hre{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
182
182
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
183
|
-
`),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(JP.hide):this.out.write(dre(this.outputText,this.out.columns)),super.render(),this.outputText=[YP.symbol(this.done,this.aborted),XP.bold(this.msg),YP.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:XP.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(pre.line+JP.to(0)+this.outputText))}};ZP.exports=Zw});var tR=E((
|
|
183
|
+
`),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(JP.hide):this.out.write(dre(this.outputText,this.out.columns)),super.render(),this.outputText=[YP.symbol(this.done,this.aborted),XP.bold(this.msg),YP.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:XP.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(pre.line+JP.to(0)+this.outputText))}};ZP.exports=Zw});var tR=E((_we,eR)=>{"use strict";eR.exports={TextPrompt:Zk(),SelectPrompt:rP(),TogglePrompt:oP(),DatePrompt:kP(),NumberPrompt:$P(),MultiselectPrompt:Kw(),AutocompletePrompt:VP(),AutocompleteMultiselectPrompt:WP(),ConfirmPrompt:QP()}});var nR=E(rR=>{"use strict";var Er=rR,mre=tR(),Cd=t=>t;function Fn(t,e,r={}){return new Promise((n,i)=>{let s=new mre[t](e),o=r.onAbort||Cd,a=r.onSubmit||Cd,u=r.onExit||Cd;s.on("state",e.onState||Cd),s.on("submit",c=>n(a(c))),s.on("exit",c=>n(u(c))),s.on("abort",c=>i(o(c)))})}Er.text=t=>Fn("TextPrompt",t);Er.password=t=>(t.style="password",Er.text(t));Er.invisible=t=>(t.style="invisible",Er.text(t));Er.number=t=>Fn("NumberPrompt",t);Er.date=t=>Fn("DatePrompt",t);Er.confirm=t=>Fn("ConfirmPrompt",t);Er.list=t=>{let e=t.separator||",";return Fn("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Er.toggle=t=>Fn("TogglePrompt",t);Er.select=t=>Fn("SelectPrompt",t);Er.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Fn("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Er.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Fn("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var gre=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Er.autocomplete=t=>(t.suggest=t.suggest||gre,t.choices=[].concat(t.choices||[]),Fn("AutocompletePrompt",t))});var oR=E((Swe,sR)=>{"use strict";var Qw=nR(),yre=["suggest","format","onState","validate","onRender","type"],iR=()=>{};async function Vi(t=[],{onSubmit:e=iR,onCancel:r=iR}={}){let n={},i=Vi._override||{};t=[].concat(t);let s,o,a,u,c,l,h=async(d,f,m=!1)=>{if(!(!m&&d.validate&&d.validate(f)!==!0))return d.format?await d.format(f,n):f};for(o of t)if({name:u,type:c}=o,typeof c=="function"&&(c=await c(s,{...n},o),o.type=c),!!c){for(let d in o){if(yre.includes(d))continue;let f=o[d];o[d]=typeof f=="function"?await f(s,{...n},l):f}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:u,type:c}=o,Qw[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[o.name]!==void 0&&(s=await h(o,i[o.name]),s!==void 0)){n[u]=s;continue}try{s=Vi._injected?Dre(Vi._injected,o.initial):await Qw[c](o),n[u]=s=await h(o,s,!0),a=await e(o,s,n)}catch{a=!await r(o,n)}if(a)return n}return n}function Dre(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function wre(t){Vi._injected=(Vi._injected||[]).concat(t)}function bre(t){Vi._override=Object.assign({},t)}sR.exports=Object.assign(Vi,{prompt:Vi,prompts:Qw,inject:wre,override:bre})});var Sd=E((Awe,aR)=>{function vre(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return!1;if(t[e]>r[e])return!0}return!1}aR.exports=vre("8.6.0")?kk():oR()});var gc=E(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.logSuccess=_r.logPrompt=_r.logger=_r.output=void 0;var eb=(fe(),ue(le)),Xs=V0(),Ys=eb.__importDefault(wa()),Ere=P2(),uR={colors:Ys.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};_r.output=(0,Ere.isInteractive)()?new Xs.TTYOutputStrategy(uR):new Xs.StreamOutputStrategy(uR);_r.logger=(0,Xs.createDefaultLogger)({output:_r.output,formatterOptions:{titleize:!1,tags:new Map([[Xs.LOGGER_LEVELS.DEBUG,Ys.default.log.DEBUG("[debug]")],[Xs.LOGGER_LEVELS.INFO,Ys.default.log.INFO("[info]")],[Xs.LOGGER_LEVELS.WARN,Ys.default.log.WARN("[warn]")],[Xs.LOGGER_LEVELS.ERROR,Ys.default.log.ERROR("[error]")]])}});async function _re(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>eb.__importStar(V0())),{prompt:n}=await Promise.resolve().then(()=>eb.__importStar(Sd()));return _r.logger.log({msg:`${Ys.default.input("[?]")} ${r(t,{indentation:4})}`,logger:_r.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}_r.logPrompt=_re;function Cre(t){_r.logger.msg(`${Ys.default.success("[success]")} ${t}`)}_r.logSuccess=Cre});var Ad=E(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.resolveNode=Fa.requireTS=void 0;var Sre=require("fs"),Are=Da(),Ore=require("path"),xre=(t,e)=>{let r=(0,Ore.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,s)=>{var o;let a=(0,Are.readFileSync)(s,"utf8");s.endsWith(".ts")?a=t.transpileModule(a,{fileName:s,compilerOptions:{module:t.ModuleKind.CommonJS,moduleResolution:t.ModuleResolutionKind.NodeJs,esModuleInterop:!0,strict:!0,target:t.ScriptTarget.ES2017},reportDiagnostics:!0}).outputText:a=a.replace(/export\s+\w+\s+(\w+)/gm,"exports.$1"),(o=i._compile)===null||o===void 0||o.call(i,a,s)};let n=require(r);return delete require.extensions[".ts"],n};Fa.requireTS=xre;function Tre(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,Sre.existsSync)(n)?n:null}}Fa.resolveNode=Tre});var Od=E(tb=>{(function(){tb.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
|
|
184
184
|
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(tb)});var In=E((cR,zi)=>{(function(){var t,e,r,n,i,s,o,a=[].slice,u={}.hasOwnProperty;t=function(){var c,l,h,d,f,m;if(m=arguments[0],f=2<=arguments.length?a.call(arguments,1):[],i(Object.assign))Object.assign.apply(null,arguments);else for(c=0,h=f.length;c<h;c++)if(d=f[c],d!=null)for(l in d)u.call(d,l)&&(m[l]=d[l]);return m},i=function(c){return!!c&&Object.prototype.toString.call(c)==="[object Function]"},s=function(c){var l;return!!c&&((l=typeof c)=="function"||l==="object")},r=function(c){return i(Array.isArray)?Array.isArray(c):Object.prototype.toString.call(c)==="[object Array]"},n=function(c){var l;if(r(c))return!c.length;for(l in c)if(u.call(c,l))return!1;return!0},o=function(c){var l,h;return s(c)&&(h=Object.getPrototypeOf(c))&&(l=h.constructor)&&typeof l=="function"&&l instanceof l&&Function.prototype.toString.call(l)===Function.prototype.toString.call(Object)},e=function(c){return i(c.valueOf)?c.valueOf():c},zi.exports.assign=t,zi.exports.isFunction=i,zi.exports.isObject=s,zi.exports.isArray=r,zi.exports.isEmpty=n,zi.exports.isPlainObject=o,zi.exports.getValue=e}).call(cR)});var rb=E((lR,fR)=>{(function(){var t;fR.exports=t=(function(){function e(){}return e.prototype.hasFeature=function(r,n){return!0},e.prototype.createDocumentType=function(r,n,i){throw new Error("This DOM method is not implemented.")},e.prototype.createDocument=function(r,n,i){throw new Error("This DOM method is not implemented.")},e.prototype.createHTMLDocument=function(r){throw new Error("This DOM method is not implemented.")},e.prototype.getFeature=function(r,n){throw new Error("This DOM method is not implemented.")},e})()}).call(lR)});var pR=E((hR,dR)=>{(function(){var t;dR.exports=t=(function(){function e(){}return e.prototype.handleError=function(r){throw new Error(r)},e})()}).call(hR)});var yR=E((mR,gR)=>{(function(){var t;gR.exports=t=(function(){function e(r){this.arr=r||[]}return Object.defineProperty(e.prototype,"length",{get:function(){return this.arr.length}}),e.prototype.item=function(r){return this.arr[r]||null},e.prototype.contains=function(r){return this.arr.indexOf(r)!==-1},e})()}).call(mR)});var bR=E((DR,wR)=>{(function(){var t,e,r;e=pR(),r=yR(),wR.exports=t=(function(){function n(){var i;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=i=Object.create(this.defaultParams)}return Object.defineProperty(n.prototype,"parameterNames",{get:function(){return new r(Object.keys(this.defaultParams))}}),n.prototype.getParameter=function(i){return this.params.hasOwnProperty(i)?this.params[i]:null},n.prototype.canSetParameter=function(i,s){return!0},n.prototype.setParameter=function(i,s){return s!=null?this.params[i]=s:delete this.params[i]},n})()}).call(DR)});var bt=E((vR,ER)=>{(function(){ER.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(vR)});var nb=E((_R,CR)=>{(function(){var t,e,r;t=bt(),r=Fr(),CR.exports=e=(function(){function n(i,s,o){if(this.parent=i,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),s==null)throw new Error("Missing attribute name. "+this.debugInfo(s));this.name=this.stringify.name(s),this.value=this.stringify.attValue(o),this.type=t.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(n.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(n.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(n.prototype,"textContent",{get:function(){return this.value},set:function(i){return this.value=i||""}}),Object.defineProperty(n.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(n.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(n.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(n.prototype,"specified",{get:function(){return!0}}),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(i){return this.options.writer.attribute(this,this.options.writer.filterOptions(i))},n.prototype.debugInfo=function(i){return i=i||this.name,i==null?"parent: <"+this.parent.name+">":"attribute: {"+i+"}, parent: <"+this.parent.name+">"},n.prototype.isEqualNode=function(i){return!(i.namespaceURI!==this.namespaceURI||i.prefix!==this.prefix||i.localName!==this.localName||i.value!==this.value)},n})()}).call(_R)});var xd=E((SR,AR)=>{(function(){var t;AR.exports=t=(function(){function e(r){this.nodes=r}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),e.prototype.clone=function(){return this.nodes=null},e.prototype.getNamedItem=function(r){return this.nodes[r]},e.prototype.setNamedItem=function(r){var n;return n=this.nodes[r.nodeName],this.nodes[r.nodeName]=r,n||null},e.prototype.removeNamedItem=function(r){var n;return n=this.nodes[r],delete this.nodes[r],n||null},e.prototype.item=function(r){return this.nodes[Object.keys(this.nodes)[r]]||null},e.prototype.getNamedItemNS=function(r,n){throw new Error("This DOM method is not implemented.")},e.prototype.setNamedItemNS=function(r){throw new Error("This DOM method is not implemented.")},e.prototype.removeNamedItemNS=function(r,n){throw new Error("This DOM method is not implemented.")},e})()}).call(SR)});var Td=E((OR,xR)=>{(function(){var t,e,r,n,i,s,o,a,u,c=function(h,d){for(var f in d)l.call(d,f)&&(h[f]=d[f]);function m(){this.constructor=h}return m.prototype=d.prototype,h.prototype=new m,h.__super__=d.prototype,h},l={}.hasOwnProperty;u=In(),a=u.isObject,o=u.isFunction,s=u.getValue,i=Fr(),t=bt(),e=nb(),n=xd(),xR.exports=r=(function(h){c(d,h);function d(f,m,g){var b,S,A,p;if(d.__super__.constructor.call(this,f),m==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(m),this.type=t.Element,this.attribs={},this.schemaTypeInfo=null,g!=null&&this.attribute(g),f.type===t.Document&&(this.isRoot=!0,this.documentObject=f,f.rootObject=this,f.children)){for(p=f.children,S=0,A=p.length;S<A;S++)if(b=p[S],b.type===t.DocType){b.name=this.name;break}}}return Object.defineProperty(d.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(d.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(d.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(d.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(d.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(d.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(d.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(d.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new n(this.attribs)),this.attributeMap}}),d.prototype.clone=function(){var f,m,g,b;g=Object.create(this),g.isRoot&&(g.documentObject=null),g.attribs={},b=this.attribs;for(m in b)l.call(b,m)&&(f=b[m],g.attribs[m]=f.clone());return g.children=[],this.children.forEach(function(S){var A;return A=S.clone(),A.parent=g,g.children.push(A)}),g},d.prototype.attribute=function(f,m){var g,b;if(f!=null&&(f=s(f)),a(f))for(g in f)l.call(f,g)&&(b=f[g],this.attribute(g,b));else o(m)&&(m=m.apply()),this.options.keepNullAttributes&&m==null?this.attribs[f]=new e(this,f,""):m!=null&&(this.attribs[f]=new e(this,f,m));return this},d.prototype.removeAttribute=function(f){var m,g,b;if(f==null)throw new Error("Missing attribute name. "+this.debugInfo());if(f=s(f),Array.isArray(f))for(g=0,b=f.length;g<b;g++)m=f[g],delete this.attribs[m];else delete this.attribs[f];return this},d.prototype.toString=function(f){return this.options.writer.element(this,this.options.writer.filterOptions(f))},d.prototype.att=function(f,m){return this.attribute(f,m)},d.prototype.a=function(f,m){return this.attribute(f,m)},d.prototype.getAttribute=function(f){return this.attribs.hasOwnProperty(f)?this.attribs[f].value:null},d.prototype.setAttribute=function(f,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getAttributeNode=function(f){return this.attribs.hasOwnProperty(f)?this.attribs[f]:null},d.prototype.setAttributeNode=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.removeAttributeNode=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByTagName=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getAttributeNS=function(f,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.setAttributeNS=function(f,m,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.removeAttributeNS=function(f,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getAttributeNodeNS=function(f,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.setAttributeNodeNS=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByTagNameNS=function(f,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.hasAttribute=function(f){return this.attribs.hasOwnProperty(f)},d.prototype.hasAttributeNS=function(f,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.setIdAttribute=function(f,m){return this.attribs.hasOwnProperty(f)?this.attribs[f].isId:m},d.prototype.setIdAttributeNS=function(f,m,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.setIdAttributeNode=function(f,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByTagName=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByTagNameNS=function(f,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByClassName=function(f){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.isEqualNode=function(f){var m,g,b;if(!d.__super__.isEqualNode.apply(this,arguments).isEqualNode(f)||f.namespaceURI!==this.namespaceURI||f.prefix!==this.prefix||f.localName!==this.localName||f.attribs.length!==this.attribs.length)return!1;for(m=g=0,b=this.attribs.length-1;0<=b?g<=b:g>=b;m=0<=b?++g:--g)if(!this.attribs[m].isEqualNode(f.attribs[m]))return!1;return!0},d})(i)}).call(OR)});var xc=E((TR,FR)=>{(function(){var t,e,r=function(i,s){for(var o in s)n.call(s,o)&&(i[o]=s[o]);function a(){this.constructor=i}return a.prototype=s.prototype,i.prototype=new a,i.__super__=s.prototype,i},n={}.hasOwnProperty;e=Fr(),FR.exports=t=(function(i){r(s,i);function s(o){s.__super__.constructor.call(this,o),this.value=""}return Object.defineProperty(s.prototype,"data",{get:function(){return this.value},set:function(o){return this.value=o||""}}),Object.defineProperty(s.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(s.prototype,"textContent",{get:function(){return this.value},set:function(o){return this.value=o||""}}),s.prototype.clone=function(){return Object.create(this)},s.prototype.substringData=function(o,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.appendData=function(o){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.insertData=function(o,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.deleteData=function(o,a){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.replaceData=function(o,a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.isEqualNode=function(o){return!(!s.__super__.isEqualNode.apply(this,arguments).isEqualNode(o)||o.data!==this.data)},s})(e)}).call(TR)});var Fd=E((IR,kR)=>{(function(){var t,e,r,n=function(s,o){for(var a in o)i.call(o,a)&&(s[a]=o[a]);function u(){this.constructor=s}return u.prototype=o.prototype,s.prototype=new u,s.__super__=o.prototype,s},i={}.hasOwnProperty;t=bt(),r=xc(),kR.exports=e=(function(s){n(o,s);function o(a,u){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=t.CData,this.value=this.stringify.cdata(u)}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.cdata(this,this.options.writer.filterOptions(a))},o})(r)}).call(IR)});var Id=E((PR,RR)=>{(function(){var t,e,r,n=function(s,o){for(var a in o)i.call(o,a)&&(s[a]=o[a]);function u(){this.constructor=s}return u.prototype=o.prototype,s.prototype=new u,s.__super__=o.prototype,s},i={}.hasOwnProperty;t=bt(),e=xc(),RR.exports=r=(function(s){n(o,s);function o(a,u){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=t.Comment,this.value=this.stringify.comment(u)}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.comment(this,this.options.writer.filterOptions(a))},o})(e)}).call(PR)});var kd=E((NR,$R)=>{(function(){var t,e,r,n,i=function(o,a){for(var u in a)s.call(a,u)&&(o[u]=a[u]);function c(){this.constructor=o}return c.prototype=a.prototype,o.prototype=new c,o.__super__=a.prototype,o},s={}.hasOwnProperty;n=In().isObject,r=Fr(),t=bt(),$R.exports=e=(function(o){i(a,o);function a(u,c,l,h){var d;a.__super__.constructor.call(this,u),n(c)&&(d=c,c=d.version,l=d.encoding,h=d.standalone),c||(c="1.0"),this.type=t.Declaration,this.version=this.stringify.xmlVersion(c),l!=null&&(this.encoding=this.stringify.xmlEncoding(l)),h!=null&&(this.standalone=this.stringify.xmlStandalone(h))}return a.prototype.toString=function(u){return this.options.writer.declaration(this,this.options.writer.filterOptions(u))},a})(r)}).call(NR)});var Pd=E((LR,jR)=>{(function(){var t,e,r,n=function(s,o){for(var a in o)i.call(o,a)&&(s[a]=o[a]);function u(){this.constructor=s}return u.prototype=o.prototype,s.prototype=new u,s.__super__=o.prototype,s},i={}.hasOwnProperty;r=Fr(),t=bt(),jR.exports=e=(function(s){n(o,s);function o(a,u,c,l,h,d){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(c==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(u));if(!l)throw new Error("Missing DTD attribute type. "+this.debugInfo(u));if(!h)throw new Error("Missing DTD attribute default. "+this.debugInfo(u));if(h.indexOf("#")!==0&&(h="#"+h),!h.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(u));if(d&&!h.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(u));this.elementName=this.stringify.name(u),this.type=t.AttributeDeclaration,this.attributeName=this.stringify.name(c),this.attributeType=this.stringify.dtdAttType(l),d&&(this.defaultValue=this.stringify.dtdAttDefault(d)),this.defaultValueType=h}return o.prototype.toString=function(a){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(a))},o})(r)}).call(LR)});var Rd=E((BR,MR)=>{(function(){var t,e,r,n,i=function(o,a){for(var u in a)s.call(a,u)&&(o[u]=a[u]);function c(){this.constructor=o}return c.prototype=a.prototype,o.prototype=new c,o.__super__=a.prototype,o},s={}.hasOwnProperty;n=In().isObject,r=Fr(),t=bt(),MR.exports=e=(function(o){i(a,o);function a(u,c,l,h){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing DTD entity name. "+this.debugInfo(l));if(h==null)throw new Error("Missing DTD entity value. "+this.debugInfo(l));if(this.pe=!!c,this.name=this.stringify.name(l),this.type=t.EntityDeclaration,!n(h))this.value=this.stringify.dtdEntityValue(h),this.internal=!0;else{if(!h.pubID&&!h.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(l));if(h.pubID&&!h.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(l));if(this.internal=!1,h.pubID!=null&&(this.pubID=this.stringify.dtdPubID(h.pubID)),h.sysID!=null&&(this.sysID=this.stringify.dtdSysID(h.sysID)),h.nData!=null&&(this.nData=this.stringify.dtdNData(h.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(l))}}return Object.defineProperty(a.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(a.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(a.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(a.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(a.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(a.prototype,"xmlVersion",{get:function(){return null}}),a.prototype.toString=function(u){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(u))},a})(r)}).call(BR)});var Nd=E((qR,UR)=>{(function(){var t,e,r,n=function(s,o){for(var a in o)i.call(o,a)&&(s[a]=o[a]);function u(){this.constructor=s}return u.prototype=o.prototype,s.prototype=new u,s.__super__=o.prototype,s},i={}.hasOwnProperty;r=Fr(),t=bt(),UR.exports=e=(function(s){n(o,s);function o(a,u,c){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing DTD element name. "+this.debugInfo());c||(c="(#PCDATA)"),Array.isArray(c)&&(c="("+c.join(",")+")"),this.name=this.stringify.name(u),this.type=t.ElementDeclaration,this.value=this.stringify.dtdElementValue(c)}return o.prototype.toString=function(a){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(a))},o})(r)}).call(qR)});var $d=E((HR,VR)=>{(function(){var t,e,r,n=function(s,o){for(var a in o)i.call(o,a)&&(s[a]=o[a]);function u(){this.constructor=s}return u.prototype=o.prototype,s.prototype=new u,s.__super__=o.prototype,s},i={}.hasOwnProperty;r=Fr(),t=bt(),VR.exports=e=(function(s){n(o,s);function o(a,u,c){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing DTD notation name. "+this.debugInfo(u));if(!c.pubID&&!c.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(u));this.name=this.stringify.name(u),this.type=t.NotationDeclaration,c.pubID!=null&&(this.pubID=this.stringify.dtdPubID(c.pubID)),c.sysID!=null&&(this.sysID=this.stringify.dtdSysID(c.sysID))}return Object.defineProperty(o.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(o.prototype,"systemId",{get:function(){return this.sysID}}),o.prototype.toString=function(a){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(a))},o})(r)}).call(HR)});var Ld=E((zR,GR)=>{(function(){var t,e,r,n,i,s,o,a,u,c=function(h,d){for(var f in d)l.call(d,f)&&(h[f]=d[f]);function m(){this.constructor=h}return m.prototype=d.prototype,h.prototype=new m,h.__super__=d.prototype,h},l={}.hasOwnProperty;u=In().isObject,a=Fr(),t=bt(),e=Pd(),n=Rd(),r=Nd(),i=$d(),o=xd(),GR.exports=s=(function(h){c(d,h);function d(f,m,g){var b,S,A,p,D,y;if(d.__super__.constructor.call(this,f),this.type=t.DocType,f.children){for(p=f.children,S=0,A=p.length;S<A;S++)if(b=p[S],b.type===t.Element){this.name=b.name;break}}this.documentObject=f,u(m)&&(D=m,m=D.pubID,g=D.sysID),g==null&&(y=[m,g],g=y[0],m=y[1]),m!=null&&(this.pubID=this.stringify.dtdPubID(m)),g!=null&&(this.sysID=this.stringify.dtdSysID(g))}return Object.defineProperty(d.prototype,"entities",{get:function(){var f,m,g,b,S;for(b={},S=this.children,m=0,g=S.length;m<g;m++)f=S[m],f.type===t.EntityDeclaration&&!f.pe&&(b[f.name]=f);return new o(b)}}),Object.defineProperty(d.prototype,"notations",{get:function(){var f,m,g,b,S;for(b={},S=this.children,m=0,g=S.length;m<g;m++)f=S[m],f.type===t.NotationDeclaration&&(b[f.name]=f);return new o(b)}}),Object.defineProperty(d.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(d.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(d.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),d.prototype.element=function(f,m){var g;return g=new r(this,f,m),this.children.push(g),this},d.prototype.attList=function(f,m,g,b,S){var A;return A=new e(this,f,m,g,b,S),this.children.push(A),this},d.prototype.entity=function(f,m){var g;return g=new n(this,!1,f,m),this.children.push(g),this},d.prototype.pEntity=function(f,m){var g;return g=new n(this,!0,f,m),this.children.push(g),this},d.prototype.notation=function(f,m){var g;return g=new i(this,f,m),this.children.push(g),this},d.prototype.toString=function(f){return this.options.writer.docType(this,this.options.writer.filterOptions(f))},d.prototype.ele=function(f,m){return this.element(f,m)},d.prototype.att=function(f,m,g,b,S){return this.attList(f,m,g,b,S)},d.prototype.ent=function(f,m){return this.entity(f,m)},d.prototype.pent=function(f,m){return this.pEntity(f,m)},d.prototype.not=function(f,m){return this.notation(f,m)},d.prototype.up=function(){return this.root()||this.documentObject},d.prototype.isEqualNode=function(f){return!(!d.__super__.isEqualNode.apply(this,arguments).isEqualNode(f)||f.name!==this.name||f.publicId!==this.publicId||f.systemId!==this.systemId)},d})(a)}).call(zR)});var jd=E((KR,WR)=>{(function(){var t,e,r,n=function(s,o){for(var a in o)i.call(o,a)&&(s[a]=o[a]);function u(){this.constructor=s}return u.prototype=o.prototype,s.prototype=new u,s.__super__=o.prototype,s},i={}.hasOwnProperty;t=bt(),e=Fr(),WR.exports=r=(function(s){n(o,s);function o(a,u){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=t.Raw,this.value=this.stringify.raw(u)}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.raw(this,this.options.writer.filterOptions(a))},o})(e)}).call(KR)});var Bd=E((XR,YR)=>{(function(){var t,e,r,n=function(s,o){for(var a in o)i.call(o,a)&&(s[a]=o[a]);function u(){this.constructor=s}return u.prototype=o.prototype,s.prototype=new u,s.__super__=o.prototype,s},i={}.hasOwnProperty;t=bt(),e=xc(),YR.exports=r=(function(s){n(o,s);function o(a,u){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=t.Text,this.value=this.stringify.text(u)}return Object.defineProperty(o.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(o.prototype,"wholeText",{get:function(){var a,u,c;for(c="",u=this.previousSibling;u;)c=u.data+c,u=u.previousSibling;for(c+=this.data,a=this.nextSibling;a;)c=c+a.data,a=a.nextSibling;return c}}),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.text(this,this.options.writer.filterOptions(a))},o.prototype.splitText=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.replaceWholeText=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},o})(e)}).call(XR)});var Md=E((JR,ZR)=>{(function(){var t,e,r,n=function(s,o){for(var a in o)i.call(o,a)&&(s[a]=o[a]);function u(){this.constructor=s}return u.prototype=o.prototype,s.prototype=new u,s.__super__=o.prototype,s},i={}.hasOwnProperty;t=bt(),e=xc(),ZR.exports=r=(function(s){n(o,s);function o(a,u,c){if(o.__super__.constructor.call(this,a),u==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=t.ProcessingInstruction,this.target=this.stringify.insTarget(u),this.name=this.target,c&&(this.value=this.stringify.insValue(c))}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(a))},o.prototype.isEqualNode=function(a){return!(!o.__super__.isEqualNode.apply(this,arguments).isEqualNode(a)||a.target!==this.target)},o})(e)}).call(JR)});var ib=E((QR,eN)=>{(function(){var t,e,r,n=function(s,o){for(var a in o)i.call(o,a)&&(s[a]=o[a]);function u(){this.constructor=s}return u.prototype=o.prototype,s.prototype=new u,s.__super__=o.prototype,s},i={}.hasOwnProperty;r=Fr(),t=bt(),eN.exports=e=(function(s){n(o,s);function o(a){o.__super__.constructor.call(this,a),this.type=t.Dummy}return o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(a){return""},o})(r)}).call(QR)});var nN=E((tN,rN)=>{(function(){var t;rN.exports=t=(function(){function e(r){this.nodes=r}return Object.defineProperty(e.prototype,"length",{get:function(){return this.nodes.length||0}}),e.prototype.clone=function(){return this.nodes=null},e.prototype.item=function(r){return this.nodes[r]||null},e})()}).call(tN)});var oN=E((iN,sN)=>{(function(){sN.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(iN)});var Fr=E((aN,uN)=>{(function(){var t,e,r,n,i,s,o,a,u,c,l,h,d,f,m,g,b,S,A,p={}.hasOwnProperty;A=In(),S=A.isObject,b=A.isFunction,g=A.isEmpty,m=A.getValue,a=null,r=null,n=null,i=null,s=null,d=null,f=null,h=null,o=null,e=null,l=null,u=null,t=null,uN.exports=c=(function(){function D(y){this.parent=y,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,a||(a=Td(),r=Fd(),n=Id(),i=kd(),s=Ld(),d=jd(),f=Bd(),h=Md(),o=ib(),e=bt(),l=nN(),u=xd(),t=oN())}return Object.defineProperty(D.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(D.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(D.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(D.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(D.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new l(this.children)),this.childNodeList}}),Object.defineProperty(D.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(D.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(D.prototype,"previousSibling",{get:function(){var y;return y=this.parent.children.indexOf(this),this.parent.children[y-1]||null}}),Object.defineProperty(D.prototype,"nextSibling",{get:function(){var y;return y=this.parent.children.indexOf(this),this.parent.children[y+1]||null}}),Object.defineProperty(D.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(D.prototype,"textContent",{get:function(){var y,C,k,v,R;if(this.nodeType===e.Element||this.nodeType===e.DocumentFragment){for(R="",v=this.children,C=0,k=v.length;C<k;C++)y=v[C],y.textContent&&(R+=y.textContent);return R}else return null},set:function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),D.prototype.setParent=function(y){var C,k,v,R,P;for(this.parent=y,y&&(this.options=y.options,this.stringify=y.stringify),R=this.children,P=[],k=0,v=R.length;k<v;k++)C=R[k],P.push(C.setParent(this));return P},D.prototype.element=function(y,C,k){var v,R,P,F,j,U,G,L,_,T,I;if(U=null,C===null&&k==null&&(_=[{},null],C=_[0],k=_[1]),C==null&&(C={}),C=m(C),S(C)||(T=[C,k],k=T[0],C=T[1]),y!=null&&(y=m(y)),Array.isArray(y))for(P=0,G=y.length;P<G;P++)R=y[P],U=this.element(R);else if(b(y))U=this.element(y.apply());else if(S(y)){for(j in y)if(p.call(y,j))if(I=y[j],b(I)&&(I=I.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&j.indexOf(this.stringify.convertAttKey)===0)U=this.attribute(j.substr(this.stringify.convertAttKey.length),I);else if(!this.options.separateArrayItems&&Array.isArray(I)&&g(I))U=this.dummy();else if(S(I)&&g(I))U=this.element(j);else if(!this.options.keepNullNodes&&I==null)U=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(I))for(F=0,L=I.length;F<L;F++)R=I[F],v={},v[j]=R,U=this.element(v);else S(I)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&j.indexOf(this.stringify.convertTextKey)===0?U=this.element(I):(U=this.element(j),U.element(I)):U=this.element(j,I)}else!this.options.keepNullNodes&&k===null?U=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&y.indexOf(this.stringify.convertTextKey)===0?U=this.text(k):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&y.indexOf(this.stringify.convertCDataKey)===0?U=this.cdata(k):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&y.indexOf(this.stringify.convertCommentKey)===0?U=this.comment(k):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&y.indexOf(this.stringify.convertRawKey)===0?U=this.raw(k):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&y.indexOf(this.stringify.convertPIKey)===0?U=this.instruction(y.substr(this.stringify.convertPIKey.length),k):U=this.node(y,C,k);if(U==null)throw new Error("Could not create any elements with: "+y+". "+this.debugInfo());return U},D.prototype.insertBefore=function(y,C,k){var v,R,P,F,j;if(y?.type)return P=y,F=C,P.setParent(this),F?(R=children.indexOf(F),j=children.splice(R),children.push(P),Array.prototype.push.apply(children,j)):children.push(P),P;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(y));return R=this.parent.children.indexOf(this),j=this.parent.children.splice(R),v=this.parent.element(y,C,k),Array.prototype.push.apply(this.parent.children,j),v},D.prototype.insertAfter=function(y,C,k){var v,R,P;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(y));return R=this.parent.children.indexOf(this),P=this.parent.children.splice(R+1),v=this.parent.element(y,C,k),Array.prototype.push.apply(this.parent.children,P),v},D.prototype.remove=function(){var y,C;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return y=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[y,y-y+1].concat(C=[])),this.parent},D.prototype.node=function(y,C,k){var v,R;return y!=null&&(y=m(y)),C||(C={}),C=m(C),S(C)||(R=[C,k],k=R[0],C=R[1]),v=new a(this,y,C),k!=null&&v.text(k),this.children.push(v),v},D.prototype.text=function(y){var C;return S(y)&&this.element(y),C=new f(this,y),this.children.push(C),this},D.prototype.cdata=function(y){var C;return C=new r(this,y),this.children.push(C),this},D.prototype.comment=function(y){var C;return C=new n(this,y),this.children.push(C),this},D.prototype.commentBefore=function(y){var C,k,v;return k=this.parent.children.indexOf(this),v=this.parent.children.splice(k),C=this.parent.comment(y),Array.prototype.push.apply(this.parent.children,v),this},D.prototype.commentAfter=function(y){var C,k,v;return k=this.parent.children.indexOf(this),v=this.parent.children.splice(k+1),C=this.parent.comment(y),Array.prototype.push.apply(this.parent.children,v),this},D.prototype.raw=function(y){var C;return C=new d(this,y),this.children.push(C),this},D.prototype.dummy=function(){var y;return y=new o(this),y},D.prototype.instruction=function(y,C){var k,v,R,P,F;if(y!=null&&(y=m(y)),C!=null&&(C=m(C)),Array.isArray(y))for(P=0,F=y.length;P<F;P++)k=y[P],this.instruction(k);else if(S(y))for(k in y)p.call(y,k)&&(v=y[k],this.instruction(k,v));else b(C)&&(C=C.apply()),R=new h(this,y,C),this.children.push(R);return this},D.prototype.instructionBefore=function(y,C){var k,v,R;return v=this.parent.children.indexOf(this),R=this.parent.children.splice(v),k=this.parent.instruction(y,C),Array.prototype.push.apply(this.parent.children,R),this},D.prototype.instructionAfter=function(y,C){var k,v,R;return v=this.parent.children.indexOf(this),R=this.parent.children.splice(v+1),k=this.parent.instruction(y,C),Array.prototype.push.apply(this.parent.children,R),this},D.prototype.declaration=function(y,C,k){var v,R;return v=this.document(),R=new i(v,y,C,k),v.children.length===0?v.children.unshift(R):v.children[0].type===e.Declaration?v.children[0]=R:v.children.unshift(R),v.root()||v},D.prototype.dtd=function(y,C){var k,v,R,P,F,j,U,G,L,_;for(v=this.document(),R=new s(v,y,C),L=v.children,P=F=0,U=L.length;F<U;P=++F)if(k=L[P],k.type===e.DocType)return v.children[P]=R,R;for(_=v.children,P=j=0,G=_.length;j<G;P=++j)if(k=_[P],k.isRoot)return v.children.splice(P,0,R),R;return v.children.push(R),R},D.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},D.prototype.root=function(){var y;for(y=this;y;){if(y.type===e.Document)return y.rootObject;if(y.isRoot)return y;y=y.parent}},D.prototype.document=function(){var y;for(y=this;y;){if(y.type===e.Document)return y;y=y.parent}},D.prototype.end=function(y){return this.document().end(y)},D.prototype.prev=function(){var y;if(y=this.parent.children.indexOf(this),y<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[y-1]},D.prototype.next=function(){var y;if(y=this.parent.children.indexOf(this),y===-1||y===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[y+1]},D.prototype.importDocument=function(y){var C;return C=y.root().clone(),C.parent=this,C.isRoot=!1,this.children.push(C),this},D.prototype.debugInfo=function(y){var C,k;return y=y||this.name,y==null&&!((C=this.parent)!=null&&C.name)?"":y==null?"parent: <"+this.parent.name+">":(k=this.parent)!=null&&k.name?"node: <"+y+">, parent: <"+this.parent.name+">":"node: <"+y+">"},D.prototype.ele=function(y,C,k){return this.element(y,C,k)},D.prototype.nod=function(y,C,k){return this.node(y,C,k)},D.prototype.txt=function(y){return this.text(y)},D.prototype.dat=function(y){return this.cdata(y)},D.prototype.com=function(y){return this.comment(y)},D.prototype.ins=function(y,C){return this.instruction(y,C)},D.prototype.doc=function(){return this.document()},D.prototype.dec=function(y,C,k){return this.declaration(y,C,k)},D.prototype.e=function(y,C,k){return this.element(y,C,k)},D.prototype.n=function(y,C,k){return this.node(y,C,k)},D.prototype.t=function(y){return this.text(y)},D.prototype.d=function(y){return this.cdata(y)},D.prototype.c=function(y){return this.comment(y)},D.prototype.r=function(y){return this.raw(y)},D.prototype.i=function(y,C){return this.instruction(y,C)},D.prototype.u=function(){return this.up()},D.prototype.importXMLBuilder=function(y){return this.importDocument(y)},D.prototype.replaceChild=function(y,C){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.removeChild=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.appendChild=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.hasChildNodes=function(){return this.children.length!==0},D.prototype.cloneNode=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.isSupported=function(y,C){return!0},D.prototype.hasAttributes=function(){return this.attribs.length!==0},D.prototype.compareDocumentPosition=function(y){var C,k;return C=this,C===y?0:this.document()!==y.document()?(k=t.Disconnected|t.ImplementationSpecific,Math.random()<.5?k|=t.Preceding:k|=t.Following,k):C.isAncestor(y)?t.Contains|t.Preceding:C.isDescendant(y)?t.Contains|t.Following:C.isPreceding(y)?t.Preceding:t.Following},D.prototype.isSameNode=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.lookupPrefix=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.isDefaultNamespace=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.lookupNamespaceURI=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.isEqualNode=function(y){var C,k,v;if(y.nodeType!==this.nodeType||y.children.length!==this.children.length)return!1;for(C=k=0,v=this.children.length-1;0<=v?k<=v:k>=v;C=0<=v?++k:--k)if(!this.children[C].isEqualNode(y.children[C]))return!1;return!0},D.prototype.getFeature=function(y,C){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.setUserData=function(y,C,k){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.getUserData=function(y){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.contains=function(y){return y?y===this||this.isDescendant(y):!1},D.prototype.isDescendant=function(y){var C,k,v,R,P;for(P=this.children,v=0,R=P.length;v<R;v++)if(C=P[v],y===C||(k=C.isDescendant(y),k))return!0;return!1},D.prototype.isAncestor=function(y){return y.isDescendant(this)},D.prototype.isPreceding=function(y){var C,k;return C=this.treePosition(y),k=this.treePosition(this),C===-1||k===-1?!1:C<k},D.prototype.isFollowing=function(y){var C,k;return C=this.treePosition(y),k=this.treePosition(this),C===-1||k===-1?!1:C>k},D.prototype.treePosition=function(y){var C,k;return k=0,C=!1,this.foreachTreeNode(this.document(),function(v){if(k++,!C&&v===y)return C=!0}),C?k:-1},D.prototype.foreachTreeNode=function(y,C){var k,v,R,P,F;for(y||(y=this.document()),P=y.children,v=0,R=P.length;v<R;v++){if(k=P[v],F=C(k))return F;if(F=this.foreachTreeNode(k,C),F)return F}},D})()}).call(aN)});var sb=E((cN,lN)=>{(function(){var t,e=function(n,i){return function(){return n.apply(i,arguments)}},r={}.hasOwnProperty;lN.exports=t=(function(){function n(i){this.assertLegalName=e(this.assertLegalName,this),this.assertLegalChar=e(this.assertLegalChar,this);var s,o,a;i||(i={}),this.options=i,this.options.version||(this.options.version="1.0"),o=i.stringify||{};for(s in o)r.call(o,s)&&(a=o[s],this[s]=a)}return n.prototype.name=function(i){return this.options.noValidation?i:this.assertLegalName(""+i||"")},n.prototype.text=function(i){return this.options.noValidation?i:this.assertLegalChar(this.textEscape(""+i||""))},n.prototype.cdata=function(i){return this.options.noValidation?i:(i=""+i||"",i=i.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(i))},n.prototype.comment=function(i){if(this.options.noValidation)return i;if(i=""+i||"",i.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+i);return this.assertLegalChar(i)},n.prototype.raw=function(i){return this.options.noValidation?i:""+i||""},n.prototype.attValue=function(i){return this.options.noValidation?i:this.assertLegalChar(this.attEscape(i=""+i||""))},n.prototype.insTarget=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.insValue=function(i){if(this.options.noValidation)return i;if(i=""+i||"",i.match(/\?>/))throw new Error("Invalid processing instruction value: "+i);return this.assertLegalChar(i)},n.prototype.xmlVersion=function(i){if(this.options.noValidation)return i;if(i=""+i||"",!i.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+i);return i},n.prototype.xmlEncoding=function(i){if(this.options.noValidation)return i;if(i=""+i||"",!i.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+i);return this.assertLegalChar(i)},n.prototype.xmlStandalone=function(i){return this.options.noValidation?i:i?"yes":"no"},n.prototype.dtdPubID=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.dtdSysID=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.dtdElementValue=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.dtdAttType=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.dtdAttDefault=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.dtdEntityValue=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.dtdNData=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},n.prototype.convertAttKey="@",n.prototype.convertPIKey="?",n.prototype.convertTextKey="#text",n.prototype.convertCDataKey="#cdata",n.prototype.convertCommentKey="#comment",n.prototype.convertRawKey="#raw",n.prototype.assertLegalChar=function(i){var s,o;if(this.options.noValidation)return i;if(s="",this.options.version==="1.0"){if(s=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,o=i.match(s))throw new Error("Invalid character in string: "+i+" at index "+o.index)}else if(this.options.version==="1.1"&&(s=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,o=i.match(s)))throw new Error("Invalid character in string: "+i+" at index "+o.index);return i},n.prototype.assertLegalName=function(i){var s;if(this.options.noValidation)return i;if(this.assertLegalChar(i),s=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!i.match(s))throw new Error("Invalid character in name");return i},n.prototype.textEscape=function(i){var s;return this.options.noValidation?i:(s=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,i.replace(s,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},n.prototype.attEscape=function(i){var s;return this.options.noValidation?i:(s=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,i.replace(s,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},n})()}).call(cN)});var Tc=E((fN,hN)=>{(function(){hN.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(fN)});var ob=E((dN,pN)=>{(function(){var t,e,r,n,i,s,o,a,u,c,l,h,d,f,m,g,b,S={}.hasOwnProperty;b=In().assign,t=bt(),u=kd(),c=Ld(),r=Fd(),n=Id(),h=Td(),f=jd(),m=Bd(),d=Md(),l=ib(),i=Pd(),s=Nd(),o=Rd(),a=$d(),e=Tc(),pN.exports=g=(function(){function A(p){var D,y,C;p||(p={}),this.options=p,y=p.writer||{};for(D in y)S.call(y,D)&&(C=y[D],this["_"+D]=this[D],this[D]=C)}return A.prototype.filterOptions=function(p){var D,y,C,k,v,R,P,F;return p||(p={}),p=b({},this.options,p),D={writer:this},D.pretty=p.pretty||!1,D.allowEmpty=p.allowEmpty||!1,D.indent=(y=p.indent)!=null?y:" ",D.newline=(C=p.newline)!=null?C:`
|
|
185
185
|
`,D.offset=(k=p.offset)!=null?k:0,D.dontPrettyTextNodes=(v=(R=p.dontPrettyTextNodes)!=null?R:p.dontprettytextnodes)!=null?v:0,D.spaceBeforeSlash=(P=(F=p.spaceBeforeSlash)!=null?F:p.spacebeforeslash)!=null?P:"",D.spaceBeforeSlash===!0&&(D.spaceBeforeSlash=" "),D.suppressPrettyCount=0,D.user={},D.state=e.None,D},A.prototype.indent=function(p,D,y){var C;return!D.pretty||D.suppressPrettyCount?"":D.pretty&&(C=(y||0)+D.offset+1,C>0)?new Array(C).join(D.indent):""},A.prototype.endline=function(p,D,y){return!D.pretty||D.suppressPrettyCount?"":D.newline},A.prototype.attribute=function(p,D,y){var C;return this.openAttribute(p,D,y),C=" "+p.name+'="'+p.value+'"',this.closeAttribute(p,D,y),C},A.prototype.cdata=function(p,D,y){var C;return this.openNode(p,D,y),D.state=e.OpenTag,C=this.indent(p,D,y)+"<![CDATA[",D.state=e.InsideTag,C+=p.value,D.state=e.CloseTag,C+="]]>"+this.endline(p,D,y),D.state=e.None,this.closeNode(p,D,y),C},A.prototype.comment=function(p,D,y){var C;return this.openNode(p,D,y),D.state=e.OpenTag,C=this.indent(p,D,y)+"<!-- ",D.state=e.InsideTag,C+=p.value,D.state=e.CloseTag,C+=" -->"+this.endline(p,D,y),D.state=e.None,this.closeNode(p,D,y),C},A.prototype.declaration=function(p,D,y){var C;return this.openNode(p,D,y),D.state=e.OpenTag,C=this.indent(p,D,y)+"<?xml",D.state=e.InsideTag,C+=' version="'+p.version+'"',p.encoding!=null&&(C+=' encoding="'+p.encoding+'"'),p.standalone!=null&&(C+=' standalone="'+p.standalone+'"'),D.state=e.CloseTag,C+=D.spaceBeforeSlash+"?>",C+=this.endline(p,D,y),D.state=e.None,this.closeNode(p,D,y),C},A.prototype.docType=function(p,D,y){var C,k,v,R,P;if(y||(y=0),this.openNode(p,D,y),D.state=e.OpenTag,R=this.indent(p,D,y),R+="<!DOCTYPE "+p.root().name,p.pubID&&p.sysID?R+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(R+=' SYSTEM "'+p.sysID+'"'),p.children.length>0){for(R+=" [",R+=this.endline(p,D,y),D.state=e.InsideTag,P=p.children,k=0,v=P.length;k<v;k++)C=P[k],R+=this.writeChildNode(C,D,y+1);D.state=e.CloseTag,R+="]"}return D.state=e.CloseTag,R+=D.spaceBeforeSlash+">",R+=this.endline(p,D,y),D.state=e.None,this.closeNode(p,D,y),R},A.prototype.element=function(p,D,y){var C,k,v,R,P,F,j,U,G,L,_,T,I,$;y||(y=0),L=!1,_="",this.openNode(p,D,y),D.state=e.OpenTag,_+=this.indent(p,D,y)+"<"+p.name,T=p.attribs;for(G in T)S.call(T,G)&&(C=T[G],_+=this.attribute(C,D,y));if(v=p.children.length,R=v===0?null:p.children[0],v===0||p.children.every(function(M){return(M.type===t.Text||M.type===t.Raw)&&M.value===""}))D.allowEmpty?(_+=">",D.state=e.CloseTag,_+="</"+p.name+">"+this.endline(p,D,y)):(D.state=e.CloseTag,_+=D.spaceBeforeSlash+"/>"+this.endline(p,D,y));else if(D.pretty&&v===1&&(R.type===t.Text||R.type===t.Raw)&&R.value!=null)_+=">",D.state=e.InsideTag,D.suppressPrettyCount++,L=!0,_+=this.writeChildNode(R,D,y+1),D.suppressPrettyCount--,L=!1,D.state=e.CloseTag,_+="</"+p.name+">"+this.endline(p,D,y);else{if(D.dontPrettyTextNodes){for(I=p.children,P=0,j=I.length;P<j;P++)if(k=I[P],(k.type===t.Text||k.type===t.Raw)&&k.value!=null){D.suppressPrettyCount++,L=!0;break}}for(_+=">"+this.endline(p,D,y),D.state=e.InsideTag,$=p.children,F=0,U=$.length;F<U;F++)k=$[F],_+=this.writeChildNode(k,D,y+1);D.state=e.CloseTag,_+=this.indent(p,D,y)+"</"+p.name+">",L&&D.suppressPrettyCount--,_+=this.endline(p,D,y),D.state=e.None}return this.closeNode(p,D,y),_},A.prototype.writeChildNode=function(p,D,y){switch(p.type){case t.CData:return this.cdata(p,D,y);case t.Comment:return this.comment(p,D,y);case t.Element:return this.element(p,D,y);case t.Raw:return this.raw(p,D,y);case t.Text:return this.text(p,D,y);case t.ProcessingInstruction:return this.processingInstruction(p,D,y);case t.Dummy:return"";case t.Declaration:return this.declaration(p,D,y);case t.DocType:return this.docType(p,D,y);case t.AttributeDeclaration:return this.dtdAttList(p,D,y);case t.ElementDeclaration:return this.dtdElement(p,D,y);case t.EntityDeclaration:return this.dtdEntity(p,D,y);case t.NotationDeclaration:return this.dtdNotation(p,D,y);default:throw new Error("Unknown XML node type: "+p.constructor.name)}},A.prototype.processingInstruction=function(p,D,y){var C;return this.openNode(p,D,y),D.state=e.OpenTag,C=this.indent(p,D,y)+"<?",D.state=e.InsideTag,C+=p.target,p.value&&(C+=" "+p.value),D.state=e.CloseTag,C+=D.spaceBeforeSlash+"?>",C+=this.endline(p,D,y),D.state=e.None,this.closeNode(p,D,y),C},A.prototype.raw=function(p,D,y){var C;return this.openNode(p,D,y),D.state=e.OpenTag,C=this.indent(p,D,y),D.state=e.InsideTag,C+=p.value,D.state=e.CloseTag,C+=this.endline(p,D,y),D.state=e.None,this.closeNode(p,D,y),C},A.prototype.text=function(p,D,y){var C;return this.openNode(p,D,y),D.state=e.OpenTag,C=this.indent(p,D,y),D.state=e.InsideTag,C+=p.value,D.state=e.CloseTag,C+=this.endline(p,D,y),D.state=e.None,this.closeNode(p,D,y),C},A.prototype.dtdAttList=function(p,D,y){var C;return this.openNode(p,D,y),D.state=e.OpenTag,C=this.indent(p,D,y)+"<!ATTLIST",D.state=e.InsideTag,C+=" "+p.elementName+" "+p.attributeName+" "+p.attributeType,p.defaultValueType!=="#DEFAULT"&&(C+=" "+p.defaultValueType),p.defaultValue&&(C+=' "'+p.defaultValue+'"'),D.state=e.CloseTag,C+=D.spaceBeforeSlash+">"+this.endline(p,D,y),D.state=e.None,this.closeNode(p,D,y),C},A.prototype.dtdElement=function(p,D,y){var C;return this.openNode(p,D,y),D.state=e.OpenTag,C=this.indent(p,D,y)+"<!ELEMENT",D.state=e.InsideTag,C+=" "+p.name+" "+p.value,D.state=e.CloseTag,C+=D.spaceBeforeSlash+">"+this.endline(p,D,y),D.state=e.None,this.closeNode(p,D,y),C},A.prototype.dtdEntity=function(p,D,y){var C;return this.openNode(p,D,y),D.state=e.OpenTag,C=this.indent(p,D,y)+"<!ENTITY",D.state=e.InsideTag,p.pe&&(C+=" %"),C+=" "+p.name,p.value?C+=' "'+p.value+'"':(p.pubID&&p.sysID?C+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.sysID&&(C+=' SYSTEM "'+p.sysID+'"'),p.nData&&(C+=" NDATA "+p.nData)),D.state=e.CloseTag,C+=D.spaceBeforeSlash+">"+this.endline(p,D,y),D.state=e.None,this.closeNode(p,D,y),C},A.prototype.dtdNotation=function(p,D,y){var C;return this.openNode(p,D,y),D.state=e.OpenTag,C=this.indent(p,D,y)+"<!NOTATION",D.state=e.InsideTag,C+=" "+p.name,p.pubID&&p.sysID?C+=' PUBLIC "'+p.pubID+'" "'+p.sysID+'"':p.pubID?C+=' PUBLIC "'+p.pubID+'"':p.sysID&&(C+=' SYSTEM "'+p.sysID+'"'),D.state=e.CloseTag,C+=D.spaceBeforeSlash+">"+this.endline(p,D,y),D.state=e.None,this.closeNode(p,D,y),C},A.prototype.openNode=function(p,D,y){},A.prototype.closeNode=function(p,D,y){},A.prototype.openAttribute=function(p,D,y){},A.prototype.closeAttribute=function(p,D,y){},A})()}).call(dN)});var qd=E((mN,gN)=>{(function(){var t,e,r=function(i,s){for(var o in s)n.call(s,o)&&(i[o]=s[o]);function a(){this.constructor=i}return a.prototype=s.prototype,i.prototype=new a,i.__super__=s.prototype,i},n={}.hasOwnProperty;e=ob(),gN.exports=t=(function(i){r(s,i);function s(o){s.__super__.constructor.call(this,o)}return s.prototype.document=function(o,a){var u,c,l,h,d;for(a=this.filterOptions(a),h="",d=o.children,c=0,l=d.length;c<l;c++)u=d[c],h+=this.writeChildNode(u,a,0);return a.pretty&&h.slice(-a.newline.length)===a.newline&&(h=h.slice(0,-a.newline.length)),h},s})(e)}).call(mN)});var ab=E((yN,DN)=>{(function(){var t,e,r,n,i,s,o,a,u=function(l,h){for(var d in h)c.call(h,d)&&(l[d]=h[d]);function f(){this.constructor=l}return f.prototype=h.prototype,l.prototype=new f,l.__super__=h.prototype,l},c={}.hasOwnProperty;a=In().isPlainObject,r=rb(),e=bR(),i=Fr(),t=bt(),o=sb(),s=qd(),DN.exports=n=(function(l){u(h,l);function h(d){h.__super__.constructor.call(this,null),this.name="#document",this.type=t.Document,this.documentURI=null,this.domConfig=new e,d||(d={}),d.writer||(d.writer=new s),this.options=d,this.stringify=new o(d)}return Object.defineProperty(h.prototype,"implementation",{value:new r}),Object.defineProperty(h.prototype,"doctype",{get:function(){var d,f,m,g;for(g=this.children,f=0,m=g.length;f<m;f++)if(d=g[f],d.type===t.DocType)return d;return null}}),Object.defineProperty(h.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(h.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(h.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(h.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===t.Declaration?this.children[0].encoding:null}}),Object.defineProperty(h.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===t.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(h.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===t.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(h.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(h.prototype,"origin",{get:function(){return null}}),Object.defineProperty(h.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(h.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(h.prototype,"contentType",{get:function(){return null}}),h.prototype.end=function(d){var f;return f={},d?a(d)&&(f=d,d=this.options.writer):d=this.options.writer,d.document(this,d.filterOptions(f))},h.prototype.toString=function(d){return this.options.writer.document(this,this.options.writer.filterOptions(d))},h.prototype.createElement=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createTextNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createComment=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createCDATASection=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createProcessingInstruction=function(d,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createAttribute=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createEntityReference=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.getElementsByTagName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.importNode=function(d,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createElementNS=function(d,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createAttributeNS=function(d,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.getElementsByTagNameNS=function(d,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.getElementById=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.adoptNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.renameNode=function(d,f,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.getElementsByClassName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createEvent=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createNodeIterator=function(d,f,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h.prototype.createTreeWalker=function(d,f,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},h})(i)}).call(yN)});var vN=E((wN,bN)=>{(function(){var t,e,r,n,i,s,o,a,u,c,l,h,d,f,m,g,b,S,A,p,D,y,C,k,v={}.hasOwnProperty;k=In(),y=k.isObject,D=k.isFunction,C=k.isPlainObject,p=k.getValue,t=bt(),h=ab(),f=Td(),n=Fd(),i=Id(),g=jd(),A=Bd(),m=Md(),c=kd(),l=Ld(),s=Pd(),a=Rd(),o=Nd(),u=$d(),r=nb(),S=sb(),b=qd(),e=Tc(),bN.exports=d=(function(){function R(P,F,j){var U;this.name="?xml",this.type=t.Document,P||(P={}),U={},P.writer?C(P.writer)&&(U=P.writer,P.writer=new b):P.writer=new b,this.options=P,this.writer=P.writer,this.writerOptions=this.writer.filterOptions(U),this.stringify=new S(P),this.onDataCallback=F||function(){},this.onEndCallback=j||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return R.prototype.createChildNode=function(P){var F,j,U,G,L,_,T,I;switch(P.type){case t.CData:this.cdata(P.value);break;case t.Comment:this.comment(P.value);break;case t.Element:U={},T=P.attribs;for(j in T)v.call(T,j)&&(F=T[j],U[j]=F.value);this.node(P.name,U);break;case t.Dummy:this.dummy();break;case t.Raw:this.raw(P.value);break;case t.Text:this.text(P.value);break;case t.ProcessingInstruction:this.instruction(P.target,P.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+P.constructor.name)}for(I=P.children,L=0,_=I.length;L<_;L++)G=I[L],this.createChildNode(G),G.type===t.Element&&this.up();return this},R.prototype.dummy=function(){return this},R.prototype.node=function(P,F,j){var U;if(P==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(P));return this.openCurrent(),P=p(P),F==null&&(F={}),F=p(F),y(F)||(U=[F,j],j=U[0],F=U[1]),this.currentNode=new f(this,P,F),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,j!=null&&this.text(j),this},R.prototype.element=function(P,F,j){var U,G,L,_,T,I;if(this.currentNode&&this.currentNode.type===t.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(P)||y(P)||D(P))for(_=this.options.noValidation,this.options.noValidation=!0,I=new h(this.options).element("TEMP_ROOT"),I.element(P),this.options.noValidation=_,T=I.children,G=0,L=T.length;G<L;G++)U=T[G],this.createChildNode(U),U.type===t.Element&&this.up();else this.node(P,F,j);return this},R.prototype.attribute=function(P,F){var j,U;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(P));if(P!=null&&(P=p(P)),y(P))for(j in P)v.call(P,j)&&(U=P[j],this.attribute(j,U));else D(F)&&(F=F.apply()),this.options.keepNullAttributes&&F==null?this.currentNode.attribs[P]=new r(this,P,""):F!=null&&(this.currentNode.attribs[P]=new r(this,P,F));return this},R.prototype.text=function(P){var F;return this.openCurrent(),F=new A(this,P),this.onData(this.writer.text(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},R.prototype.cdata=function(P){var F;return this.openCurrent(),F=new n(this,P),this.onData(this.writer.cdata(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},R.prototype.comment=function(P){var F;return this.openCurrent(),F=new i(this,P),this.onData(this.writer.comment(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},R.prototype.raw=function(P){var F;return this.openCurrent(),F=new g(this,P),this.onData(this.writer.raw(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},R.prototype.instruction=function(P,F){var j,U,G,L,_;if(this.openCurrent(),P!=null&&(P=p(P)),F!=null&&(F=p(F)),Array.isArray(P))for(j=0,L=P.length;j<L;j++)U=P[j],this.instruction(U);else if(y(P))for(U in P)v.call(P,U)&&(G=P[U],this.instruction(U,G));else D(F)&&(F=F.apply()),_=new m(this,P,F),this.onData(this.writer.processingInstruction(_,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},R.prototype.declaration=function(P,F,j){var U;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return U=new c(this,P,F,j),this.onData(this.writer.declaration(U,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},R.prototype.doctype=function(P,F,j){if(this.openCurrent(),P==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new l(this,F,j),this.currentNode.rootNodeName=P,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},R.prototype.dtdElement=function(P,F){var j;return this.openCurrent(),j=new o(this,P,F),this.onData(this.writer.dtdElement(j,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},R.prototype.attList=function(P,F,j,U,G){var L;return this.openCurrent(),L=new s(this,P,F,j,U,G),this.onData(this.writer.dtdAttList(L,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},R.prototype.entity=function(P,F){var j;return this.openCurrent(),j=new a(this,!1,P,F),this.onData(this.writer.dtdEntity(j,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},R.prototype.pEntity=function(P,F){var j;return this.openCurrent(),j=new a(this,!0,P,F),this.onData(this.writer.dtdEntity(j,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},R.prototype.notation=function(P,F){var j;return this.openCurrent(),j=new u(this,P,F),this.onData(this.writer.dtdNotation(j,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},R.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},R.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},R.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},R.prototype.openNode=function(P){var F,j,U,G;if(!P.isOpen){if(!this.root&&this.currentLevel===0&&P.type===t.Element&&(this.root=P),j="",P.type===t.Element){this.writerOptions.state=e.OpenTag,j=this.writer.indent(P,this.writerOptions,this.currentLevel)+"<"+P.name,G=P.attribs;for(U in G)v.call(G,U)&&(F=G[U],j+=this.writer.attribute(F,this.writerOptions,this.currentLevel));j+=(P.children?">":"/>")+this.writer.endline(P,this.writerOptions,this.currentLevel),this.writerOptions.state=e.InsideTag}else this.writerOptions.state=e.OpenTag,j=this.writer.indent(P,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+P.rootNodeName,P.pubID&&P.sysID?j+=' PUBLIC "'+P.pubID+'" "'+P.sysID+'"':P.sysID&&(j+=' SYSTEM "'+P.sysID+'"'),P.children?(j+=" [",this.writerOptions.state=e.InsideTag):(this.writerOptions.state=e.CloseTag,j+=">"),j+=this.writer.endline(P,this.writerOptions,this.currentLevel);return this.onData(j,this.currentLevel),P.isOpen=!0}},R.prototype.closeNode=function(P){var F;if(!P.isClosed)return F="",this.writerOptions.state=e.CloseTag,P.type===t.Element?F=this.writer.indent(P,this.writerOptions,this.currentLevel)+"</"+P.name+">"+this.writer.endline(P,this.writerOptions,this.currentLevel):F=this.writer.indent(P,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(P,this.writerOptions,this.currentLevel),this.writerOptions.state=e.None,this.onData(F,this.currentLevel),P.isClosed=!0},R.prototype.onData=function(P,F){return this.documentStarted=!0,this.onDataCallback(P,F+1)},R.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},R.prototype.debugInfo=function(P){return P==null?"":"node: <"+P+">"},R.prototype.ele=function(){return this.element.apply(this,arguments)},R.prototype.nod=function(P,F,j){return this.node(P,F,j)},R.prototype.txt=function(P){return this.text(P)},R.prototype.dat=function(P){return this.cdata(P)},R.prototype.com=function(P){return this.comment(P)},R.prototype.ins=function(P,F){return this.instruction(P,F)},R.prototype.dec=function(P,F,j){return this.declaration(P,F,j)},R.prototype.dtd=function(P,F,j){return this.doctype(P,F,j)},R.prototype.e=function(P,F,j){return this.element(P,F,j)},R.prototype.n=function(P,F,j){return this.node(P,F,j)},R.prototype.t=function(P){return this.text(P)},R.prototype.d=function(P){return this.cdata(P)},R.prototype.c=function(P){return this.comment(P)},R.prototype.r=function(P){return this.raw(P)},R.prototype.i=function(P,F){return this.instruction(P,F)},R.prototype.att=function(){return this.currentNode&&this.currentNode.type===t.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},R.prototype.a=function(){return this.currentNode&&this.currentNode.type===t.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},R.prototype.ent=function(P,F){return this.entity(P,F)},R.prototype.pent=function(P,F){return this.pEntity(P,F)},R.prototype.not=function(P,F){return this.notation(P,F)},R})()}).call(wN)});var CN=E((EN,_N)=>{(function(){var t,e,r,n,i=function(o,a){for(var u in a)s.call(a,u)&&(o[u]=a[u]);function c(){this.constructor=o}return c.prototype=a.prototype,o.prototype=new c,o.__super__=a.prototype,o},s={}.hasOwnProperty;t=bt(),n=ob(),e=Tc(),_N.exports=r=(function(o){i(a,o);function a(u,c){this.stream=u,a.__super__.constructor.call(this,c)}return a.prototype.endline=function(u,c,l){return u.isLastRootNode&&c.state===e.CloseTag?"":a.__super__.endline.call(this,u,c,l)},a.prototype.document=function(u,c){var l,h,d,f,m,g,b,S,A;for(b=u.children,h=d=0,m=b.length;d<m;h=++d)l=b[h],l.isLastRootNode=h===u.children.length-1;for(c=this.filterOptions(c),S=u.children,A=[],f=0,g=S.length;f<g;f++)l=S[f],A.push(this.writeChildNode(l,c,0));return A},a.prototype.attribute=function(u,c,l){return this.stream.write(a.__super__.attribute.call(this,u,c,l))},a.prototype.cdata=function(u,c,l){return this.stream.write(a.__super__.cdata.call(this,u,c,l))},a.prototype.comment=function(u,c,l){return this.stream.write(a.__super__.comment.call(this,u,c,l))},a.prototype.declaration=function(u,c,l){return this.stream.write(a.__super__.declaration.call(this,u,c,l))},a.prototype.docType=function(u,c,l){var h,d,f,m;if(l||(l=0),this.openNode(u,c,l),c.state=e.OpenTag,this.stream.write(this.indent(u,c,l)),this.stream.write("<!DOCTYPE "+u.root().name),u.pubID&&u.sysID?this.stream.write(' PUBLIC "'+u.pubID+'" "'+u.sysID+'"'):u.sysID&&this.stream.write(' SYSTEM "'+u.sysID+'"'),u.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(u,c,l)),c.state=e.InsideTag,m=u.children,d=0,f=m.length;d<f;d++)h=m[d],this.writeChildNode(h,c,l+1);c.state=e.CloseTag,this.stream.write("]")}return c.state=e.CloseTag,this.stream.write(c.spaceBeforeSlash+">"),this.stream.write(this.endline(u,c,l)),c.state=e.None,this.closeNode(u,c,l)},a.prototype.element=function(u,c,l){var h,d,f,m,g,b,S,A,p,D;l||(l=0),this.openNode(u,c,l),c.state=e.OpenTag,this.stream.write(this.indent(u,c,l)+"<"+u.name),p=u.attribs;for(S in p)s.call(p,S)&&(h=p[S],this.attribute(h,c,l));if(f=u.children.length,m=f===0?null:u.children[0],f===0||u.children.every(function(y){return(y.type===t.Text||y.type===t.Raw)&&y.value===""}))c.allowEmpty?(this.stream.write(">"),c.state=e.CloseTag,this.stream.write("</"+u.name+">")):(c.state=e.CloseTag,this.stream.write(c.spaceBeforeSlash+"/>"));else if(c.pretty&&f===1&&(m.type===t.Text||m.type===t.Raw)&&m.value!=null)this.stream.write(">"),c.state=e.InsideTag,c.suppressPrettyCount++,A=!0,this.writeChildNode(m,c,l+1),c.suppressPrettyCount--,A=!1,c.state=e.CloseTag,this.stream.write("</"+u.name+">");else{for(this.stream.write(">"+this.endline(u,c,l)),c.state=e.InsideTag,D=u.children,g=0,b=D.length;g<b;g++)d=D[g],this.writeChildNode(d,c,l+1);c.state=e.CloseTag,this.stream.write(this.indent(u,c,l)+"</"+u.name+">")}return this.stream.write(this.endline(u,c,l)),c.state=e.None,this.closeNode(u,c,l)},a.prototype.processingInstruction=function(u,c,l){return this.stream.write(a.__super__.processingInstruction.call(this,u,c,l))},a.prototype.raw=function(u,c,l){return this.stream.write(a.__super__.raw.call(this,u,c,l))},a.prototype.text=function(u,c,l){return this.stream.write(a.__super__.text.call(this,u,c,l))},a.prototype.dtdAttList=function(u,c,l){return this.stream.write(a.__super__.dtdAttList.call(this,u,c,l))},a.prototype.dtdElement=function(u,c,l){return this.stream.write(a.__super__.dtdElement.call(this,u,c,l))},a.prototype.dtdEntity=function(u,c,l){return this.stream.write(a.__super__.dtdEntity.call(this,u,c,l))},a.prototype.dtdNotation=function(u,c,l){return this.stream.write(a.__super__.dtdNotation.call(this,u,c,l))},a})(n)}).call(EN)});var AN=E((SN,Gi)=>{(function(){var t,e,r,n,i,s,o,a,u,c;c=In(),a=c.assign,u=c.isFunction,r=rb(),n=ab(),i=vN(),o=qd(),s=CN(),t=bt(),e=Tc(),Gi.exports.create=function(l,h,d,f){var m,g;if(l==null)throw new Error("Root element needs a name.");return f=a({},h,d,f),m=new n(f),g=m.element(l),f.headless||(m.declaration(f),(f.pubID!=null||f.sysID!=null)&&m.dtd(f)),g},Gi.exports.begin=function(l,h,d){var f;return u(l)&&(f=[l,h],h=f[0],d=f[1],l={}),h?new i(l,h,d):new n(l)},Gi.exports.stringWriter=function(l){return new o(l)},Gi.exports.streamWriter=function(l,h){return new s(l,h)},Gi.exports.implementation=new r,Gi.exports.nodeType=t,Gi.exports.writerState=e}).call(SN)});var ON=E(ub=>{(function(){"use strict";var t,e,r,n,i,s={}.hasOwnProperty;t=AN(),e=Od().defaults,n=function(o){return typeof o=="string"&&(o.indexOf("&")>=0||o.indexOf(">")>=0||o.indexOf("<")>=0)},i=function(o){return"<![CDATA["+r(o)+"]]>"},r=function(o){return o.replace("]]>","]]]]><![CDATA[>")},ub.Builder=(function(){function o(a){var u,c,l;this.options={},c=e["0.2"];for(u in c)s.call(c,u)&&(l=c[u],this.options[u]=l);for(u in a)s.call(a,u)&&(l=a[u],this.options[u]=l)}return o.prototype.buildObject=function(a){var u,c,l,h,d;return u=this.options.attrkey,c=this.options.charkey,Object.keys(a).length===1&&this.options.rootName===e["0.2"].rootName?(d=Object.keys(a)[0],a=a[d]):d=this.options.rootName,l=(function(f){return function(m,g){var b,S,A,p,D,y;if(typeof g!="object")f.options.cdata&&n(g)?m.raw(i(g)):m.txt(g);else if(Array.isArray(g)){for(p in g)if(s.call(g,p)){S=g[p];for(D in S)A=S[D],m=l(m.ele(D),A).up()}}else for(D in g)if(s.call(g,D))if(S=g[D],D===u){if(typeof S=="object")for(b in S)y=S[b],m=m.att(b,y)}else if(D===c)f.options.cdata&&n(S)?m=m.raw(i(S)):m=m.txt(S);else if(Array.isArray(S))for(p in S)s.call(S,p)&&(A=S[p],typeof A=="string"?f.options.cdata&&n(A)?m=m.ele(D).raw(i(A)).up():m=m.ele(D,A).up():m=l(m.ele(D),A).up());else typeof S=="object"?m=l(m.ele(D),S).up():typeof S=="string"&&f.options.cdata&&n(S)?m=m.ele(D).raw(i(S)).up():(S==null&&(S=""),m=m.ele(D,S.toString()).up());return m}})(this),h=t.create(d,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),l(h,a).end(this.options.renderOpts)},o})()}).call(ub)});var xN=E(Ud=>{(function(t){t.parser=function(x,O){return new r(x,O)},t.SAXParser=r,t.SAXStream=c,t.createStream=u,t.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(x,O){if(!(this instanceof r))return new r(x,O);var H=this;i(H),H.q=H.c="",H.bufferCheckPosition=t.MAX_BUFFER_LENGTH,H.opt=O||{},H.opt.lowercase=H.opt.lowercase||H.opt.lowercasetags,H.looseCase=H.opt.lowercase?"toLowerCase":"toUpperCase",H.tags=[],H.closed=H.closedRoot=H.sawRoot=!1,H.tag=H.error=null,H.strict=!!x,H.noscript=!!(x||H.opt.noscript),H.state=v.BEGIN,H.strictEntities=H.opt.strictEntities,H.ENTITIES=H.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),H.attribList=[],H.opt.xmlns&&(H.ns=Object.create(m)),H.opt.unquotedAttributeValues===void 0&&(H.opt.unquotedAttributeValues=!x),H.trackPosition=H.opt.position!==!1,H.trackPosition&&(H.position=H.line=H.column=0),P(H,"onready")}Object.create||(Object.create=function(x){function O(){}O.prototype=x;var H=new O;return H}),Object.keys||(Object.keys=function(x){var O=[];for(var H in x)x.hasOwnProperty(H)&&O.push(H);return O});function n(x){for(var O=Math.max(t.MAX_BUFFER_LENGTH,10),H=0,N=0,re=e.length;N<re;N++){var z=x[e[N]].length;if(z>O)switch(e[N]){case"textNode":j(x);break;case"cdata":F(x,"oncdata",x.cdata),x.cdata="";break;case"script":F(x,"onscript",x.script),x.script="";break;default:G(x,"Max buffer length exceeded: "+e[N])}H=Math.max(H,z)}var ie=t.MAX_BUFFER_LENGTH-H;x.bufferCheckPosition=ie+x.position}function i(x){for(var O=0,H=e.length;O<H;O++)x[e[O]]=""}function s(x){j(x),x.cdata!==""&&(F(x,"oncdata",x.cdata),x.cdata=""),x.script!==""&&(F(x,"onscript",x.script),x.script="")}r.prototype={end:function(){L(this)},write:ae,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var o;try{o=require("stream").Stream}catch{o=function(){}}o||(o=function(){});var a=t.EVENTS.filter(function(x){return x!=="error"&&x!=="end"});function u(x,O){return new c(x,O)}function c(x,O){if(!(this instanceof c))return new c(x,O);o.apply(this),this._parser=new r(x,O),this.writable=!0,this.readable=!0;var H=this;this._parser.onend=function(){H.emit("end")},this._parser.onerror=function(N){H.emit("error",N),H._parser.error=null},this._decoder=null,a.forEach(function(N){Object.defineProperty(H,"on"+N,{get:function(){return H._parser["on"+N]},set:function(re){if(!re)return H.removeAllListeners(N),H._parser["on"+N]=re,re;H.on(N,re)},enumerable:!0,configurable:!1})})}c.prototype=Object.create(o.prototype,{constructor:{value:c}}),c.prototype.write=function(x){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(x)){if(!this._decoder){var O=require("string_decoder").StringDecoder;this._decoder=new O("utf8")}x=this._decoder.write(x)}return this._parser.write(x.toString()),this.emit("data",x),!0},c.prototype.end=function(x){return x&&x.length&&this.write(x),this._parser.end(),!0},c.prototype.on=function(x,O){var H=this;return!H._parser["on"+x]&&a.indexOf(x)!==-1&&(H._parser["on"+x]=function(){var N=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);N.splice(0,0,x),H.emit.apply(H,N)}),o.prototype.on.call(H,x,O)};var l="[CDATA[",h="DOCTYPE",d="http://www.w3.org/XML/1998/namespace",f="http://www.w3.org/2000/xmlns/",m={xml:d,xmlns:f},g=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,b=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,S=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,A=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function p(x){return x===" "||x===`
|
|
186
186
|
`||x==="\r"||x===" "}function D(x){return x==='"'||x==="'"}function y(x){return x===">"||p(x)}function C(x,O){return x.test(O)}function k(x,O){return!C(x,O)}var v=0;t.STATE={BEGIN:v++,BEGIN_WHITESPACE:v++,TEXT:v++,TEXT_ENTITY:v++,OPEN_WAKA:v++,SGML_DECL:v++,SGML_DECL_QUOTED:v++,DOCTYPE:v++,DOCTYPE_QUOTED:v++,DOCTYPE_DTD:v++,DOCTYPE_DTD_QUOTED:v++,COMMENT_STARTING:v++,COMMENT:v++,COMMENT_ENDING:v++,COMMENT_ENDED:v++,CDATA:v++,CDATA_ENDING:v++,CDATA_ENDING_2:v++,PROC_INST:v++,PROC_INST_BODY:v++,PROC_INST_ENDING:v++,OPEN_TAG:v++,OPEN_TAG_SLASH:v++,ATTRIB:v++,ATTRIB_NAME:v++,ATTRIB_NAME_SAW_WHITE:v++,ATTRIB_VALUE:v++,ATTRIB_VALUE_QUOTED:v++,ATTRIB_VALUE_CLOSED:v++,ATTRIB_VALUE_UNQUOTED:v++,ATTRIB_VALUE_ENTITY_Q:v++,ATTRIB_VALUE_ENTITY_U:v++,CLOSE_TAG:v++,CLOSE_TAG_SAW_WHITE:v++,SCRIPT:v++,SCRIPT_ENDING:v++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(x){var O=t.ENTITIES[x],H=typeof O=="number"?String.fromCharCode(O):O;t.ENTITIES[x]=H});for(var R in t.STATE)t.STATE[t.STATE[R]]=R;v=t.STATE;function P(x,O,H){x[O]&&x[O](H)}function F(x,O,H){x.textNode&&j(x),P(x,O,H)}function j(x){x.textNode=U(x.opt,x.textNode),x.textNode&&P(x,"ontext",x.textNode),x.textNode=""}function U(x,O){return x.trim&&(O=O.trim()),x.normalize&&(O=O.replace(/\s+/g," ")),O}function G(x,O){return j(x),x.trackPosition&&(O+=`
|
|
@@ -196,11 +196,11 @@ Are you sure ${Ia.default.strong(e)} is installed?`);let n=(0,fb.dirname)(r),i=a
|
|
|
196
196
|
`;break;case"incompatible":n=`Found ${t.length} incompatible Cordova plugin${i} for ${Ia.default.strong(e)}, skipped install:
|
|
197
197
|
`;break;case"capacitor":n=`Found ${t.length} Capacitor plugin${i} for ${Ia.default.strong(e)}:
|
|
198
198
|
`;break}n+=t.map(s=>`${s.id}${Ia.default.weak(`@${s.version}`)}`).join(`
|
|
199
|
-
`),Bre.logger.info(n)}Le.printPlugins=Ure;function db(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Le.getPluginPlatform=db;function Hre(t,e,r){let n=db(t,e);if(n){let i=n[r];if(i)return i}return[]}Le.getPlatformElement=Hre;function Vre(t,e){var r,n,i,s;switch(e){case"ios":return(n=(r=t.ios)===null||r===void 0?void 0:r.type)!==null&&n!==void 0?n:0;case"android":return(s=(i=t.android)===null||i===void 0?void 0:i.type)!==null&&s!==void 0?s:0}return 0}Le.getPluginType=Vre;function zre(t,e){return pb(t,e,"js-module")}Le.getJSModules=zre;function Gre(t,e){return pb(t,e,"asset")}Le.getAssets=Gre;function Kre(t,e,r){if(r.startsWith("node_modules")){let n=r.split("/").slice(1);n[0].startsWith("@")&&(n=[n[0]+"/"+n[1],...n.slice(2)]);let i=(0,PN.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,fb.join)(e.rootPath,r)}Le.getFilePath=Kre;function pb(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=db(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Le.getAllElements=pb});var jN=E(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.replace=Lt.move=Lt.splice=Lt.reduce=Lt.map=Lt.filter=Lt.concurrentFilter=Lt.conform=void 0;function Wre(t){return typeof t>"u"?[]:Array.isArray(t)?t:[t]}Lt.conform=Wre;async function Xre(t,e){let r=async i=>[i,await e(i)];return(await Promise.all(t.map(r))).filter(([,i])=>i).map(([i])=>i)}Lt.concurrentFilter=Xre;async function Yre(t,e){return mb(t,async(n,i,s,o)=>(await e(i,s,o)&&n.push(i),n),[])}Lt.filter=Yre;async function Jre(t,e){return mb(t,async(n,i,s,o)=>(n.push(await e(i,s,o)),n),[])}Lt.map=Jre;async function mb(t,e,r){let i=typeof r>"u"?1:0;if(typeof r>"u"){if(t.length===0)throw new TypeError("Reduce of empty array with no initial value");r=t[0]}let s=r;for(let o=i;o<t.length;o++)s=await e(s,t[o],o,t);return s}Lt.reduce=mb;function Hd(t,e,r=t.length-e,...n){let i=[...t];return i.splice(e,r,...n),i}Lt.splice=Hd;function Zre(t,e,r){let n=t[e];return e<0||r<0||e>=t.length||r>=t.length?[...t]:Hd(Hd(t,e,1),r,0,n)}Lt.move=Zre;function Qre(t,e,r){return e<0||e>t.length?[...t]:Hd(t,e,1,r)}Lt.replace=Qre});var Ic=E(Ki=>{"use strict";var BN=Fe().fromCallback,ar=pt(),ene=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof ar[t]=="function");Object.keys(ar).forEach(t=>{t!=="promises"&&(Ki[t]=ar[t])});ene.forEach(t=>{Ki[t]=BN(ar[t])});Ki.exists=function(t,e){return typeof e=="function"?ar.exists(t,e):new Promise(r=>ar.exists(t,r))};Ki.read=function(t,e,r,n,i,s){return typeof s=="function"?ar.read(t,e,r,n,i,s):new Promise((o,a)=>{ar.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);o({bytesRead:c,buffer:l})})})};Ki.write=function(t,e,...r){return typeof r[r.length-1]=="function"?ar.write(t,e,...r):new Promise((n,i)=>{ar.write(t,e,...r,(s,o,a)=>{if(s)return i(s);n({bytesWritten:o,buffer:a})})})};typeof ar.writev=="function"&&(Ki.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?ar.writev(t,e,...r):new Promise((n,i)=>{ar.writev(t,e,...r,(s,o,a)=>{if(s)return i(s);n({bytesWritten:o,buffers:a})})})});typeof ar.realpath.native=="function"&&(Ki.realpath.native=BN(ar.realpath.native))});var gb=E((
|
|
199
|
+
`),Bre.logger.info(n)}Le.printPlugins=Ure;function db(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Le.getPluginPlatform=db;function Hre(t,e,r){let n=db(t,e);if(n){let i=n[r];if(i)return i}return[]}Le.getPlatformElement=Hre;function Vre(t,e){var r,n,i,s;switch(e){case"ios":return(n=(r=t.ios)===null||r===void 0?void 0:r.type)!==null&&n!==void 0?n:0;case"android":return(s=(i=t.android)===null||i===void 0?void 0:i.type)!==null&&s!==void 0?s:0}return 0}Le.getPluginType=Vre;function zre(t,e){return pb(t,e,"js-module")}Le.getJSModules=zre;function Gre(t,e){return pb(t,e,"asset")}Le.getAssets=Gre;function Kre(t,e,r){if(r.startsWith("node_modules")){let n=r.split("/").slice(1);n[0].startsWith("@")&&(n=[n[0]+"/"+n[1],...n.slice(2)]);let i=(0,PN.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,fb.join)(e.rootPath,r)}Le.getFilePath=Kre;function pb(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=db(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Le.getAllElements=pb});var jN=E(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.replace=Lt.move=Lt.splice=Lt.reduce=Lt.map=Lt.filter=Lt.concurrentFilter=Lt.conform=void 0;function Wre(t){return typeof t>"u"?[]:Array.isArray(t)?t:[t]}Lt.conform=Wre;async function Xre(t,e){let r=async i=>[i,await e(i)];return(await Promise.all(t.map(r))).filter(([,i])=>i).map(([i])=>i)}Lt.concurrentFilter=Xre;async function Yre(t,e){return mb(t,async(n,i,s,o)=>(await e(i,s,o)&&n.push(i),n),[])}Lt.filter=Yre;async function Jre(t,e){return mb(t,async(n,i,s,o)=>(n.push(await e(i,s,o)),n),[])}Lt.map=Jre;async function mb(t,e,r){let i=typeof r>"u"?1:0;if(typeof r>"u"){if(t.length===0)throw new TypeError("Reduce of empty array with no initial value");r=t[0]}let s=r;for(let o=i;o<t.length;o++)s=await e(s,t[o],o,t);return s}Lt.reduce=mb;function Hd(t,e,r=t.length-e,...n){let i=[...t];return i.splice(e,r,...n),i}Lt.splice=Hd;function Zre(t,e,r){let n=t[e];return e<0||r<0||e>=t.length||r>=t.length?[...t]:Hd(Hd(t,e,1),r,0,n)}Lt.move=Zre;function Qre(t,e,r){return e<0||e>t.length?[...t]:Hd(t,e,1,r)}Lt.replace=Qre});var Ic=E(Ki=>{"use strict";var BN=Fe().fromCallback,ar=pt(),ene=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof ar[t]=="function");Object.keys(ar).forEach(t=>{t!=="promises"&&(Ki[t]=ar[t])});ene.forEach(t=>{Ki[t]=BN(ar[t])});Ki.exists=function(t,e){return typeof e=="function"?ar.exists(t,e):new Promise(r=>ar.exists(t,r))};Ki.read=function(t,e,r,n,i,s){return typeof s=="function"?ar.read(t,e,r,n,i,s):new Promise((o,a)=>{ar.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);o({bytesRead:c,buffer:l})})})};Ki.write=function(t,e,...r){return typeof r[r.length-1]=="function"?ar.write(t,e,...r):new Promise((n,i)=>{ar.write(t,e,...r,(s,o,a)=>{if(s)return i(s);n({bytesWritten:o,buffer:a})})})};typeof ar.writev=="function"&&(Ki.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?ar.writev(t,e,...r):new Promise((n,i)=>{ar.writev(t,e,...r,(s,o,a)=>{if(s)return i(s);n({bytesWritten:o,buffers:a})})})});typeof ar.realpath.native=="function"&&(Ki.realpath.native=BN(ar.realpath.native))});var gb=E((Mwe,MN)=>{MN.exports=t=>{let e=process.versions.node.split(".").map(r=>parseInt(r,10));return t=t.split(".").map(r=>parseInt(r,10)),e[0]>t[0]||e[0]===t[0]&&(e[1]>t[1]||e[1]===t[1]&&e[2]>=t[2])}});var zN=E((qwe,yb)=>{"use strict";var ka=Ic(),li=require("path"),tne=gb(),qN=tne("10.12.0"),UN=t=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(li.parse(t).root,""))){let r=new Error(`Path contains invalid characters: ${t}`);throw r.code="EINVAL",r}},HN=t=>{let e={mode:511};return typeof t=="number"&&(t={mode:t}),{...e,...t}},VN=t=>{let e=new Error(`operation not permitted, mkdir '${t}'`);return e.code="EPERM",e.errno=-4048,e.path=t,e.syscall="mkdir",e};yb.exports.makeDir=async(t,e)=>{if(UN(t),e=HN(e),qN){let n=li.resolve(t);return ka.mkdir(n,{mode:e.mode,recursive:!0})}let r=async n=>{try{await ka.mkdir(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(li.dirname(n)===n)throw VN(n);if(i.message.includes("null bytes"))throw i;return await r(li.dirname(n)),r(n)}try{if(!(await ka.stat(n)).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(li.resolve(t))};yb.exports.makeDirSync=(t,e)=>{if(UN(t),e=HN(e),qN){let n=li.resolve(t);return ka.mkdirSync(n,{mode:e.mode,recursive:!0})}let r=n=>{try{ka.mkdirSync(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(li.dirname(n)===n)throw VN(n);if(i.message.includes("null bytes"))throw i;return r(li.dirname(n)),r(n)}try{if(!ka.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(li.resolve(t))}});var ln=E((Uwe,GN)=>{"use strict";var rne=Fe().fromPromise,{makeDir:nne,makeDirSync:Db}=zN(),wb=rne(nne);GN.exports={mkdirs:wb,mkdirsSync:Db,mkdirp:wb,mkdirpSync:Db,ensureDir:wb,ensureDirSync:Db}});var bb=E((Hwe,KN)=>{"use strict";var Pa=pt();function ine(t,e,r,n){Pa.open(t,"r+",(i,s)=>{if(i)return n(i);Pa.futimes(s,e,r,o=>{Pa.close(s,a=>{n&&n(o||a)})})})}function sne(t,e,r){let n=Pa.openSync(t,"r+");return Pa.futimesSync(n,e,r),Pa.closeSync(n)}KN.exports={utimesMillis:ine,utimesMillisSync:sne}});var kc=E((Vwe,JN)=>{"use strict";var Ra=Ic(),Cr=require("path"),one=require("util"),ane=gb(),Vd=ane("10.5.0"),WN=t=>Vd?Ra.stat(t,{bigint:!0}):Ra.stat(t),vb=t=>Vd?Ra.statSync(t,{bigint:!0}):Ra.statSync(t);function une(t,e){return Promise.all([WN(t),WN(e).catch(r=>{if(r.code==="ENOENT")return null;throw r})]).then(([r,n])=>({srcStat:r,destStat:n}))}function cne(t,e){let r,n=vb(t);try{r=vb(e)}catch(i){if(i.code==="ENOENT")return{srcStat:n,destStat:null};throw i}return{srcStat:n,destStat:r}}function lne(t,e,r,n){one.callbackify(une)(t,e,(i,s)=>{if(i)return n(i);let{srcStat:o,destStat:a}=s;return a&&zd(o,a)?n(new Error("Source and destination must not be the same.")):o.isDirectory()&&Eb(t,e)?n(new Error(Gd(t,e,r))):n(null,{srcStat:o,destStat:a})})}function fne(t,e,r){let{srcStat:n,destStat:i}=cne(t,e);if(i&&zd(n,i))throw new Error("Source and destination must not be the same.");if(n.isDirectory()&&Eb(t,e))throw new Error(Gd(t,e,r));return{srcStat:n,destStat:i}}function XN(t,e,r,n,i){let s=Cr.resolve(Cr.dirname(t)),o=Cr.resolve(Cr.dirname(r));if(o===s||o===Cr.parse(o).root)return i();let a=(u,c)=>u?u.code==="ENOENT"?i():i(u):zd(e,c)?i(new Error(Gd(t,r,n))):XN(t,e,o,n,i);Vd?Ra.stat(o,{bigint:!0},a):Ra.stat(o,a)}function YN(t,e,r,n){let i=Cr.resolve(Cr.dirname(t)),s=Cr.resolve(Cr.dirname(r));if(s===i||s===Cr.parse(s).root)return;let o;try{o=vb(s)}catch(a){if(a.code==="ENOENT")return;throw a}if(zd(e,o))throw new Error(Gd(t,r,n));return YN(t,e,s,n)}function zd(t,e){return!!(e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev&&(Vd||e.ino<Number.MAX_SAFE_INTEGER||e.size===t.size&&e.mode===t.mode&&e.nlink===t.nlink&&e.atimeMs===t.atimeMs&&e.mtimeMs===t.mtimeMs&&e.ctimeMs===t.ctimeMs&&e.birthtimeMs===t.birthtimeMs))}function Eb(t,e){let r=Cr.resolve(t).split(Cr.sep).filter(i=>i),n=Cr.resolve(e).split(Cr.sep).filter(i=>i);return r.reduce((i,s,o)=>i&&n[o]===s,!0)}function Gd(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}JN.exports={checkPaths:lne,checkPathsSync:fne,checkParentPaths:XN,checkParentPathsSync:YN,isSrcSubdir:Eb}});var r$=E((zwe,t$)=>{"use strict";var Kt=pt(),Pc=require("path"),hne=ln().mkdirsSync,dne=bb().utimesMillisSync,Rc=kc();function pne(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
200
200
|
|
|
201
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:n,destStat:i}=Rc.checkPathsSync(t,e,"copy");return Rc.checkParentPathsSync(t,n,e,"copy"),mne(i,t,e,r)}function mne(t,e,r,n){if(n.filter&&!n.filter(e,r))return;let i=Pc.dirname(r);return Kt.existsSync(i)||hne(i),ZN(t,e,r,n)}function ZN(t,e,r,n){if(!(n.filter&&!n.filter(e,r)))return gne(t,e,r,n)}function gne(t,e,r,n){let s=(n.dereference?Kt.statSync:Kt.lstatSync)(e);if(s.isDirectory())return _ne(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return yne(s,t,e,r,n);if(s.isSymbolicLink())return Ane(t,e,r,n)}function yne(t,e,r,n,i){return e?Dne(t,r,n,i):QN(t,r,n,i)}function Dne(t,e,r,n){if(n.overwrite)return Kt.unlinkSync(r),QN(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function QN(t,e,r,n){return Kt.copyFileSync(e,r),n.preserveTimestamps&&wne(t.mode,e,r),_b(r,t.mode)}function wne(t,e,r){return bne(t)&&vne(r,t),Ene(e,r)}function bne(t){return(t&128)===0}function vne(t,e){return _b(t,e|128)}function _b(t,e){return Kt.chmodSync(t,e)}function Ene(t,e){let r=Kt.statSync(t);return dne(e,r.atime,r.mtime)}function _ne(t,e,r,n,i){if(!e)return Cne(t.mode,r,n,i);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`);return e$(r,n,i)}function Cne(t,e,r,n){return Kt.mkdirSync(r),e$(e,r,n),_b(r,t)}function e$(t,e,r){Kt.readdirSync(t).forEach(n=>Sne(n,t,e,r))}function Sne(t,e,r,n){let i=Pc.join(e,t),s=Pc.join(r,t),{destStat:o}=Rc.checkPathsSync(i,s,"copy");return ZN(o,i,s,n)}function Ane(t,e,r,n){let i=Kt.readlinkSync(e);if(n.dereference&&(i=Pc.resolve(process.cwd(),i)),t){let s;try{s=Kt.readlinkSync(r)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Kt.symlinkSync(i,r);throw o}if(n.dereference&&(s=Pc.resolve(process.cwd(),s)),Rc.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Kt.statSync(r).isDirectory()&&Rc.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return One(i,r)}else return Kt.symlinkSync(i,r)}function One(t,e){return Kt.unlinkSync(e),Kt.symlinkSync(t,e)}t$.exports=pne});var Cb=E((
|
|
201
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:n,destStat:i}=Rc.checkPathsSync(t,e,"copy");return Rc.checkParentPathsSync(t,n,e,"copy"),mne(i,t,e,r)}function mne(t,e,r,n){if(n.filter&&!n.filter(e,r))return;let i=Pc.dirname(r);return Kt.existsSync(i)||hne(i),ZN(t,e,r,n)}function ZN(t,e,r,n){if(!(n.filter&&!n.filter(e,r)))return gne(t,e,r,n)}function gne(t,e,r,n){let s=(n.dereference?Kt.statSync:Kt.lstatSync)(e);if(s.isDirectory())return _ne(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return yne(s,t,e,r,n);if(s.isSymbolicLink())return Ane(t,e,r,n)}function yne(t,e,r,n,i){return e?Dne(t,r,n,i):QN(t,r,n,i)}function Dne(t,e,r,n){if(n.overwrite)return Kt.unlinkSync(r),QN(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function QN(t,e,r,n){return Kt.copyFileSync(e,r),n.preserveTimestamps&&wne(t.mode,e,r),_b(r,t.mode)}function wne(t,e,r){return bne(t)&&vne(r,t),Ene(e,r)}function bne(t){return(t&128)===0}function vne(t,e){return _b(t,e|128)}function _b(t,e){return Kt.chmodSync(t,e)}function Ene(t,e){let r=Kt.statSync(t);return dne(e,r.atime,r.mtime)}function _ne(t,e,r,n,i){if(!e)return Cne(t.mode,r,n,i);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`);return e$(r,n,i)}function Cne(t,e,r,n){return Kt.mkdirSync(r),e$(e,r,n),_b(r,t)}function e$(t,e,r){Kt.readdirSync(t).forEach(n=>Sne(n,t,e,r))}function Sne(t,e,r,n){let i=Pc.join(e,t),s=Pc.join(r,t),{destStat:o}=Rc.checkPathsSync(i,s,"copy");return ZN(o,i,s,n)}function Ane(t,e,r,n){let i=Kt.readlinkSync(e);if(n.dereference&&(i=Pc.resolve(process.cwd(),i)),t){let s;try{s=Kt.readlinkSync(r)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Kt.symlinkSync(i,r);throw o}if(n.dereference&&(s=Pc.resolve(process.cwd(),s)),Rc.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Kt.statSync(r).isDirectory()&&Rc.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return One(i,r)}else return Kt.symlinkSync(i,r)}function One(t,e){return Kt.unlinkSync(e),Kt.symlinkSync(t,e)}t$.exports=pne});var Cb=E((Gwe,n$)=>{"use strict";n$.exports={copySync:r$()}});var Wi=E((Kwe,s$)=>{"use strict";var xne=Fe().fromPromise,i$=Ic();function Tne(t){return i$.access(t).then(()=>!0).catch(()=>!1)}s$.exports={pathExists:xne(Tne),pathExistsSync:i$.existsSync}});var p$=E((Wwe,d$)=>{"use strict";var Sr=pt(),Nc=require("path"),Fne=ln().mkdirs,Ine=Wi().pathExists,kne=bb().utimesMillis,$c=kc();function Pne(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
202
202
|
|
|
203
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`),$c.checkPaths(t,e,"copy",(i,s)=>{if(i)return n(i);let{srcStat:o,destStat:a}=s;$c.checkParentPaths(t,o,e,"copy",u=>u?n(u):r.filter?c$(o$,a,t,e,r,n):o$(a,t,e,r,n))})}function o$(t,e,r,n,i){let s=Nc.dirname(r);Ine(s,(o,a)=>{if(o)return i(o);if(a)return Sb(t,e,r,n,i);Fne(s,u=>u?i(u):Sb(t,e,r,n,i))})}function c$(t,e,r,n,i,s){Promise.resolve(i.filter(r,n)).then(o=>o?t(e,r,n,i,s):s(),o=>s(o))}function Sb(t,e,r,n,i){return n.filter?c$(a$,t,e,r,n,i):a$(t,e,r,n,i)}function a$(t,e,r,n,i){(n.dereference?Sr.stat:Sr.lstat)(e,(o,a)=>{if(o)return i(o);if(a.isDirectory())return Mne(a,t,e,r,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return Rne(a,t,e,r,n,i);if(a.isSymbolicLink())return Hne(t,e,r,n,i)})}function Rne(t,e,r,n,i,s){return e?Nne(t,r,n,i,s):l$(t,r,n,i,s)}function Nne(t,e,r,n,i){if(n.overwrite)Sr.unlink(r,s=>s?i(s):l$(t,e,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function l$(t,e,r,n,i){Sr.copyFile(e,r,s=>s?i(s):n.preserveTimestamps?$ne(t.mode,e,r,i):Kd(r,t.mode,i))}function $ne(t,e,r,n){return Lne(t)?jne(r,t,i=>i?n(i):u$(t,e,r,n)):u$(t,e,r,n)}function Lne(t){return(t&128)===0}function jne(t,e,r){return Kd(t,e|128,r)}function u$(t,e,r,n){Bne(e,r,i=>i?n(i):Kd(r,t,n))}function Kd(t,e,r){return Sr.chmod(t,e,r)}function Bne(t,e,r){Sr.stat(t,(n,i)=>n?r(n):kne(e,i.atime,i.mtime,r))}function Mne(t,e,r,n,i,s){return e?e&&!e.isDirectory()?s(new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`)):f$(r,n,i,s):qne(t.mode,r,n,i,s)}function qne(t,e,r,n,i){Sr.mkdir(r,s=>{if(s)return i(s);f$(e,r,n,o=>o?i(o):Kd(r,t,i))})}function f$(t,e,r,n){Sr.readdir(t,(i,s)=>i?n(i):h$(s,t,e,r,n))}function h$(t,e,r,n,i){let s=t.pop();return s?Une(t,s,e,r,n,i):i()}function Une(t,e,r,n,i,s){let o=Nc.join(r,e),a=Nc.join(n,e);$c.checkPaths(o,a,"copy",(u,c)=>{if(u)return s(u);let{destStat:l}=c;Sb(l,o,a,i,h=>h?s(h):h$(t,r,n,i,s))})}function Hne(t,e,r,n,i){Sr.readlink(e,(s,o)=>{if(s)return i(s);if(n.dereference&&(o=Nc.resolve(process.cwd(),o)),t)Sr.readlink(r,(a,u)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Sr.symlink(o,r,i):i(a):(n.dereference&&(u=Nc.resolve(process.cwd(),u)),$c.isSrcSubdir(o,u)?i(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${u}'.`)):t.isDirectory()&&$c.isSrcSubdir(u,o)?i(new Error(`Cannot overwrite '${u}' with '${o}'.`)):Vne(o,r,i)));else return Sr.symlink(o,r,i)})}function Vne(t,e,r){Sr.unlink(e,n=>n?r(n):Sr.symlink(t,e,r))}d$.exports=Pne});var Ab=E((Ywe,m$)=>{"use strict";var zne=Fe().fromCallback;m$.exports={copy:zne(p$())}});var C$=E((Jwe,_$)=>{"use strict";var g$=pt(),b$=require("path"),Be=require("assert"),Lc=process.platform==="win32";function v$(t){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{t[r]=t[r]||g$[r],r=r+"Sync",t[r]=t[r]||g$[r]}),t.maxBusyTries=t.maxBusyTries||3}function Ob(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),Be(t,"rimraf: missing path"),Be.strictEqual(typeof t,"string","rimraf: path should be a string"),Be.strictEqual(typeof r,"function","rimraf: callback function required"),Be(e,"rimraf: invalid options argument provided"),Be.strictEqual(typeof e,"object","rimraf: options should be object"),v$(e),y$(t,e,function i(s){if(s){if((s.code==="EBUSY"||s.code==="ENOTEMPTY"||s.code==="EPERM")&&n<e.maxBusyTries){n++;let o=n*100;return setTimeout(()=>y$(t,e,i),o)}s.code==="ENOENT"&&(s=null)}r(s)})}function y$(t,e,r){Be(t),Be(e),Be(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&Lc)return D$(t,e,n,r);if(i&&i.isDirectory())return Wd(t,e,n,r);e.unlink(t,s=>{if(s){if(s.code==="ENOENT")return r(null);if(s.code==="EPERM")return Lc?D$(t,e,s,r):Wd(t,e,s,r);if(s.code==="EISDIR")return Wd(t,e,s,r)}return r(s)})})}function D$(t,e,r,n){Be(t),Be(e),Be(typeof n=="function"),e.chmod(t,438,i=>{i?n(i.code==="ENOENT"?null:r):e.stat(t,(s,o)=>{s?n(s.code==="ENOENT"?null:r):o.isDirectory()?Wd(t,e,r,n):e.unlink(t,n)})})}function w$(t,e,r){let n;Be(t),Be(e);try{e.chmodSync(t,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?Xd(t,e,r):e.unlinkSync(t)}function Wd(t,e,r,n){Be(t),Be(e),Be(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?Gne(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function Gne(t,e,r){Be(t),Be(e),Be(typeof r=="function"),e.readdir(t,(n,i)=>{if(n)return r(n);let s=i.length,o;if(s===0)return e.rmdir(t,r);i.forEach(a=>{Ob(b$.join(t,a),e,u=>{if(!o){if(u)return r(o=u);--s===0&&e.rmdir(t,r)}})})})}function E$(t,e){let r;e=e||{},v$(e),Be(t,"rimraf: missing path"),Be.strictEqual(typeof t,"string","rimraf: path should be a string"),Be(e,"rimraf: missing options"),Be.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&Lc&&w$(t,e,n)}try{r&&r.isDirectory()?Xd(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return Lc?w$(t,e,n):Xd(t,e,n);if(n.code!=="EISDIR")throw n;Xd(t,e,n)}}function Xd(t,e,r){Be(t),Be(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")Kne(t,e);else if(n.code!=="ENOENT")throw n}}function Kne(t,e){if(Be(t),Be(e),e.readdirSync(t).forEach(r=>E$(b$.join(t,r),e)),Lc){let r=Date.now();do try{return e.rmdirSync(t,e)}catch{}while(Date.now()-r<500)}else return e.rmdirSync(t,e)}_$.exports=Ob;Ob.sync=E$});var jc=E((Zwe,A$)=>{"use strict";var Wne=Fe().fromCallback,S$=C$();A$.exports={remove:Wne(S$),removeSync:S$.sync}});var R$=E((Qwe,P$)=>{"use strict";var Xne=Fe().fromCallback,T$=pt(),F$=require("path"),I$=ln(),k$=jc(),O$=Xne(function(e,r){r=r||function(){},T$.readdir(e,(n,i)=>{if(n)return I$.mkdirs(e,r);i=i.map(o=>F$.join(e,o)),s();function s(){let o=i.pop();if(!o)return r();k$.remove(o,a=>{if(a)return r(a);s()})}})});function x$(t){let e;try{e=T$.readdirSync(t)}catch{return I$.mkdirsSync(t)}e.forEach(r=>{r=F$.join(t,r),k$.removeSync(r)})}P$.exports={emptyDirSync:x$,emptydirSync:x$,emptyDir:O$,emptydir:O$}});var j$=E((ebe,L$)=>{"use strict";var Yne=Fe().fromCallback,N$=require("path"),Xi=pt(),$$=ln();function Jne(t,e){function r(){Xi.writeFile(t,"",n=>{if(n)return e(n);e()})}Xi.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let s=N$.dirname(t);Xi.stat(s,(o,a)=>{if(o)return o.code==="ENOENT"?$$.mkdirs(s,u=>{if(u)return e(u);r()}):e(o);a.isDirectory()?r():Xi.readdir(s,u=>{if(u)return e(u)})})})}function Zne(t){let e;try{e=Xi.statSync(t)}catch{}if(e&&e.isFile())return;let r=N$.dirname(t);try{Xi.statSync(r).isDirectory()||Xi.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")$$.mkdirsSync(r);else throw n}Xi.writeFileSync(t,"")}L$.exports={createFile:Yne(Jne),createFileSync:Zne}});var H$=E((tbe,U$)=>{"use strict";var Qne=Fe().fromCallback,M$=require("path"),Zs=pt(),q$=ln(),B$=Wi().pathExists;function eie(t,e,r){function n(i,s){Zs.link(i,s,o=>{if(o)return r(o);r(null)})}B$(e,(i,s)=>{if(i)return r(i);if(s)return r(null);Zs.lstat(t,o=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),r(o);let a=M$.dirname(e);B$(a,(u,c)=>{if(u)return r(u);if(c)return n(t,e);q$.mkdirs(a,l=>{if(l)return r(l);n(t,e)})})})})}function tie(t,e){if(Zs.existsSync(e))return;try{Zs.lstatSync(t)}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=M$.dirname(e);return Zs.existsSync(n)||q$.mkdirsSync(n),Zs.linkSync(t,e)}U$.exports={createLink:Qne(eie),createLinkSync:tie}});var z$=E((rbe,V$)=>{"use strict";var Yi=require("path"),Bc=pt(),rie=Wi().pathExists;function nie(t,e,r){if(Yi.isAbsolute(t))return Bc.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=Yi.dirname(e),i=Yi.join(n,t);return rie(i,(s,o)=>s?r(s):o?r(null,{toCwd:i,toDst:t}):Bc.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:Yi.relative(n,t)})))}}function iie(t,e){let r;if(Yi.isAbsolute(t)){if(r=Bc.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=Yi.dirname(e),i=Yi.join(n,t);if(r=Bc.existsSync(i),r)return{toCwd:i,toDst:t};if(r=Bc.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:Yi.relative(n,t)}}}V$.exports={symlinkPaths:nie,symlinkPathsSync:iie}});var W$=E((nbe,K$)=>{"use strict";var G$=pt();function sie(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);G$.lstat(t,(n,i)=>{if(n)return r(null,"file");e=i&&i.isDirectory()?"dir":"file",r(null,e)})}function oie(t,e){let r;if(e)return e;try{r=G$.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}K$.exports={symlinkType:sie,symlinkTypeSync:oie}});var t3=E((ibe,e3)=>{"use strict";var aie=Fe().fromCallback,Y$=require("path"),Na=pt(),J$=ln(),uie=J$.mkdirs,cie=J$.mkdirsSync,Z$=z$(),lie=Z$.symlinkPaths,fie=Z$.symlinkPathsSync,Q$=W$(),hie=Q$.symlinkType,die=Q$.symlinkTypeSync,X$=Wi().pathExists;function pie(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,X$(e,(i,s)=>{if(i)return n(i);if(s)return n(null);lie(t,e,(o,a)=>{if(o)return n(o);t=a.toDst,hie(a.toCwd,r,(u,c)=>{if(u)return n(u);let l=Y$.dirname(e);X$(l,(h,d)=>{if(h)return n(h);if(d)return Na.symlink(t,e,c,n);uie(l,f=>{if(f)return n(f);Na.symlink(t,e,c,n)})})})})})}function mie(t,e,r){if(Na.existsSync(e))return;let i=fie(t,e);t=i.toDst,r=die(i.toCwd,r);let s=Y$.dirname(e);return Na.existsSync(s)||cie(s),Na.symlinkSync(t,e,r)}e3.exports={createSymlink:aie(pie),createSymlinkSync:mie}});var n3=E((sbe,r3)=>{"use strict";var Yd=j$(),Jd=H$(),Zd=t3();r3.exports={createFile:Yd.createFile,createFileSync:Yd.createFileSync,ensureFile:Yd.createFile,ensureFileSync:Yd.createFileSync,createLink:Jd.createLink,createLinkSync:Jd.createLinkSync,ensureLink:Jd.createLink,ensureLinkSync:Jd.createLinkSync,createSymlink:Zd.createSymlink,createSymlinkSync:Zd.createSymlinkSync,ensureSymlink:Zd.createSymlink,ensureSymlinkSync:Zd.createSymlinkSync}});var s3=E((obe,i3)=>{"use strict";var Qd=g0();i3.exports={readJson:Qd.readFile,readJsonSync:Qd.readFileSync,writeJson:Qd.writeFile,writeJsonSync:Qd.writeFileSync}});var ep=E((abe,u3)=>{"use strict";var gie=Fe().fromCallback,Mc=pt(),o3=require("path"),a3=ln(),yie=Wi().pathExists;function Die(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=o3.dirname(t);yie(i,(s,o)=>{if(s)return n(s);if(o)return Mc.writeFile(t,e,r,n);a3.mkdirs(i,a=>{if(a)return n(a);Mc.writeFile(t,e,r,n)})})}function wie(t,...e){let r=o3.dirname(t);if(Mc.existsSync(r))return Mc.writeFileSync(t,...e);a3.mkdirsSync(r),Mc.writeFileSync(t,...e)}u3.exports={outputFile:gie(Die),outputFileSync:wie}});var l3=E((ube,c3)=>{"use strict";var{stringify:bie}=ga(),{outputFile:vie}=ep();async function Eie(t,e,r={}){let n=bie(e,r);await vie(t,n,r)}c3.exports=Eie});var h3=E((cbe,f3)=>{"use strict";var{stringify:_ie}=ga(),{outputFileSync:Cie}=ep();function Sie(t,e,r){let n=_ie(e,r);Cie(t,n,r)}f3.exports=Sie});var p3=E((lbe,d3)=>{"use strict";var Aie=Fe().fromPromise,ur=s3();ur.outputJson=Aie(l3());ur.outputJsonSync=h3();ur.outputJSON=ur.outputJson;ur.outputJSONSync=ur.outputJsonSync;ur.writeJSON=ur.writeJson;ur.writeJSONSync=ur.writeJsonSync;ur.readJSON=ur.readJson;ur.readJSONSync=ur.readJsonSync;d3.exports=ur});var b3=E((fbe,w3)=>{"use strict";var y3=pt(),Oie=require("path"),xie=Cb().copySync,D3=jc().removeSync,Tie=ln().mkdirpSync,m3=kc();function Fie(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i}=m3.checkPathsSync(t,e,"move");return m3.checkParentPathsSync(t,i,e,"move"),Tie(Oie.dirname(e)),Iie(t,e,n)}function Iie(t,e,r){if(r)return D3(e),g3(t,e,r);if(y3.existsSync(e))throw new Error("dest already exists.");return g3(t,e,r)}function g3(t,e,r){try{y3.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return kie(t,e,r)}}function kie(t,e,r){return xie(t,e,{overwrite:r,errorOnExist:!0}),D3(t)}w3.exports=Fie});var E3=E((hbe,v3)=>{"use strict";v3.exports={moveSync:b3()}});var O3=E((dbe,A3)=>{"use strict";var Pie=pt(),Rie=require("path"),Nie=Ab().copy,S3=jc().remove,$ie=ln().mkdirp,Lie=Wi().pathExists,_3=kc();function jie(t,e,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;_3.checkPaths(t,e,"move",(s,o)=>{if(s)return n(s);let{srcStat:a}=o;_3.checkParentPaths(t,a,e,"move",u=>{if(u)return n(u);$ie(Rie.dirname(e),c=>c?n(c):Bie(t,e,i,n))})})}function Bie(t,e,r,n){if(r)return S3(e,i=>i?n(i):C3(t,e,r,n));Lie(e,(i,s)=>i?n(i):s?n(new Error("dest already exists.")):C3(t,e,r,n))}function C3(t,e,r,n){Pie.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):Mie(t,e,r,n):n())}function Mie(t,e,r,n){Nie(t,e,{overwrite:r,errorOnExist:!0},s=>s?n(s):S3(t,n))}A3.exports=jie});var T3=E((pbe,x3)=>{"use strict";var qie=Fe().fromCallback;x3.exports={move:qie(O3())}});var tp=E((mbe,xb)=>{"use strict";xb.exports={...Ic(),...Cb(),...Ab(),...R$(),...n3(),...p3(),...ln(),...E3(),...T3(),...ep(),...Wi(),...jc()};var F3=require("fs");Object.getOwnPropertyDescriptor(F3,"promises")&&Object.defineProperty(xb.exports,"promises",{get(){return F3.promises}})});var Tb=E($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.readdir=$a.stat=void 0;var I3=tp();async function Uie(t){try{return await I3.stat(t)}catch{}}$a.stat=Uie;async function Hie(t){try{return await I3.readdir(t)}catch{return[]}}$a.readdir=Hie});var L3=E(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.walk=me.Walker=me.compilePaths=me.tmpfilepath=me.findBaseDirectory=me.isExecutableFile=me.pathExecutable=me.pathWritable=me.pathReadable=me.pathExists=me.pathAccessible=me.writeStreamToFile=me.cacheFileChecksum=me.getFileChecksums=me.getFileChecksum=me.fileToString=me.getFileTree=me.readdirp=me.readdirSafe=me.statSafe=void 0;var Vie=(fe(),ue(le)),Gr=tp(),zie=require("os"),fi=require("path"),k3=require("stream"),P3=Tb();Vie.__exportStar(tp(),me);var R3=Tb();Object.defineProperty(me,"statSafe",{enumerable:!0,get:function(){return R3.stat}});Object.defineProperty(me,"readdirSafe",{enumerable:!0,get:function(){return R3.readdir}});async function Gie(t,{filter:e,onError:r,walkerOptions:n}={}){return new Promise((i,s)=>{let o=[],a=Ib(t,n);e&&(a=a.pipe(new k3.Transform({objectMode:!0,transform(u,c,l){(!e||e(u))&&this.push(u),l()}}))),a.on("error",u=>r?r(u):s(u)).on("data",u=>o.push(u.path)).on("end",()=>i(o))})}me.readdirp=Gie;async function Kie(t,{onError:e,onFileNode:r=s=>s,onDirectoryNode:n=s=>s,walkerOptions:i}={}){let s=new Map([]),o=u=>{let c=fi.dirname(u.path),l=s.get(c);return l&&l.type==="directory"?l:n({path:c,type:"directory",children:[]})},a=(u,c)=>{let l={path:u.path,parent:c};return u.stats.isDirectory()?n({...l,type:"directory",children:[]}):r({...l,type:"file"})};return new Promise((u,c)=>{t=fi.resolve(t),Ib(t,i).on("error",h=>e?e(h):c(h)).on("data",h=>{let d=o(h),f=a(h,d);d.children.push(f),s.set(h.path,f),s.set(d.path,d)}).on("end",()=>{let h=s.get(t);if(!h)return c(new Error("No root node found after walking directory structure."));delete h.parent,u(h)})})}me.getFileTree=Kie;async function Wie(t){try{return await Gr.readFile(t,{encoding:"utf8"})}catch(e){if(e.code==="ENOENT"||e.code==="ENOTDIR")return"";throw e}}me.fileToString=Wie;async function Fb(t){let e=await Promise.resolve().then(()=>require("crypto"));return new Promise((r,n)=>{let i=e.createHash("md5"),s=Gr.createReadStream(t);s.on("error",o=>{n(o)}),i.once("readable",()=>{let o=i.read().toString("hex");r(o)}),s.pipe(i)})}me.getFileChecksum=Fb;async function Xie(t){return Promise.all([Fb(t),(async()=>{try{return(await Gr.readFile(`${t}.md5`,{encoding:"utf8"})).trim()}catch(e){if(e.code!=="ENOENT")throw e}})()])}me.getFileChecksums=Xie;async function Yie(t,e){let r=await Fb(t);await Gr.writeFile(`${t}.md5`,r,{encoding:"utf8"})}me.cacheFileChecksum=Yie;function Jie(t,e){return new Promise((r,n)=>{let i=Gr.createWriteStream(e);t.pipe(i),i.on("error",n),i.on("finish",r)})}me.writeStreamToFile=Jie;async function qc(t,e){try{await Gr.access(t,e)}catch{return!1}return!0}me.pathAccessible=qc;async function Zie(t){return qc(t,Gr.constants.F_OK)}me.pathExists=Zie;async function Qie(t){return qc(t,Gr.constants.R_OK)}me.pathReadable=Qie;async function ese(t){return qc(t,Gr.constants.W_OK)}me.pathWritable=ese;async function N3(t){return qc(t,Gr.constants.X_OK)}me.pathExecutable=N3;async function tse(t){let[e,r]=await Promise.all([P3.stat(t),N3(t)]);return!!e&&(e.isFile()||e.isSymbolicLink())&&r}me.isExecutableFile=tse;async function rse(t,e){if(!(!t||!e)){for(let r of $3(t))if((await P3.readdir(r)).includes(e))return r}}me.findBaseDirectory=rse;function nse(t){let e=Math.random().toString(16).substring(2,8);return fi.resolve(zie.tmpdir(),t?`${t}-${e}`:e)}me.tmpfilepath=nse;function $3(t){if(t=fi.normalize(t),!fi.isAbsolute(t))throw new Error(`${t} is not an absolute path`);let e=fi.parse(t);return t===e.root?[t]:t.slice(e.root.length).split(fi.sep).map((r,n,i)=>e.root+fi.join(...i.slice(0,i.length-n))).concat(e.root)}me.compilePaths=$3;var rp=class extends k3.Readable{constructor(e,r={}){super({objectMode:!0}),this.p=e,this.options=r,this.paths=[this.p]}_read(){let e=this.paths.shift(),{pathFilter:r}=this.options;if(!e){this.push(null);return}Gr.lstat(e,(n,i)=>{if(n){this.emit("error",n);return}let s={path:e,stats:i};i.isDirectory()?Gr.readdir(e,(o,a)=>{if(o){this.emit("error",o);return}let u=a.map(c=>fi.join(e,c));r&&(u=u.filter(c=>r(c.substring(this.p.length+1)))),this.paths.push(...u),this.push(s)}):this.push(s)})}};me.Walker=rp;function Ib(t,e={}){return new rp(t,e)}me.walk=Ib});var j3=E(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.AliasedMap=hi.CaseInsensitiveProxyHandler=hi.createCaseInsensitiveObject=void 0;function ise(){return new Proxy({},hi.CaseInsensitiveProxyHandler)}hi.createCaseInsensitiveObject=ise;hi.CaseInsensitiveProxyHandler={has:(t,e)=>np(e)in t,get:(t,e)=>t[np(e)],set:(t,e,r)=>(t[np(e)]=r,!0),deleteProperty:(t,e)=>delete t[np(e)]};var np=t=>typeof t=="string"?t.toLowerCase():t,kb=class extends Map{getAliases(){let e=new Map;return[...this.entries()].filter(([,n])=>typeof n=="string"||typeof n=="symbol").forEach(([n,i])=>{let s=e.get(i)||[];s.push(n),e.set(i,s)}),e}resolveAlias(e){let r=this.get(e);return typeof r!="string"&&typeof r!="symbol"?r:this.resolveAlias(r)}keysWithoutAliases(){return[...this.entries()].filter(e=>typeof e[1]!="string"&&typeof e[1]!="symbol").map(([e,r])=>e)}};hi.AliasedMap=kb});var V3=E((wbe,H3)=>{"use strict";var U3=require("child_process"),B3=U3.spawn,sse=U3.exec;H3.exports=function(t,e,r){if(typeof e=="function"&&r===void 0&&(r=e,e=void 0),t=parseInt(t),Number.isNaN(t)){if(r)return r(new Error("pid must be a number"));throw new Error("pid must be a number")}var n={},i={};switch(n[t]=[],i[t]=1,process.platform){case"win32":sse("taskkill /pid "+t+" /T /F",r);break;case"darwin":Pb(t,n,i,function(s){return B3("pgrep",["-P",s])},function(){M3(n,e,r)});break;default:Pb(t,n,i,function(s){return B3("ps",["-o","pid","--no-headers","--ppid",s])},function(){M3(n,e,r)});break}};function M3(t,e,r){var n={};try{Object.keys(t).forEach(function(i){t[i].forEach(function(s){n[s]||(q3(s,e),n[s]=1)}),n[i]||(q3(i,e),n[i]=1)})}catch(i){if(r)return r(i);throw i}if(r)return r()}function q3(t,e){try{process.kill(parseInt(t,10),e)}catch(r){if(r.code!=="ESRCH")throw r}}function Pb(t,e,r,n,i){var s=n(t),o="";s.stdout.on("data",function(c){var c=c.toString("ascii");o+=c});var a=function(u){if(delete r[t],u!=0){Object.keys(r).length==0&&i();return}o.match(/\d+/g).forEach(function(c){c=parseInt(c,10),e[t].push(c),e[c]=[],r[c]=1,Pb(c,e,r,n,i)})};s.on("close",a)}});var K3=E(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.processExit=Ye.offBeforeExit=Ye.onBeforeExit=Ye.onExit=Ye.sleepForever=Ye.sleepUntil=Ye.sleep=Ye.getPathParts=Ye.createProcessEnv=Ye.killProcessTree=Ye.ERROR_TIMEOUT_REACHED=void 0;var Rb=(fe(),ue(le)),ose=j3(),ase=Bi(),use=Bh(),cse=Rb.__importStar(require("path")),lse=Rb.__importDefault(Th()),fse=Rb.__importDefault(V3()),Qs=(0,use.debug)("ionic:utils-process");Ye.ERROR_TIMEOUT_REACHED=new Error("TIMEOUT_REACHED");function hse(t,e="SIGTERM"){return new Promise((r,n)=>{(0,fse.default)(t,e,i=>{if(i)return Qs("error while killing process tree for %d: %O",t,i),n(i);r()})})}Ye.killProcessTree=hse;function dse(...t){return Object.assign(ase.TERMINAL_INFO.windows?(0,ose.createCaseInsensitiveObject)():{},...t)}Ye.createProcessEnv=dse;function pse(t=process.env.PATH||""){return t.split(cse.delimiter)}Ye.getPathParts=pse;async function z3(t){return new Promise(e=>{setTimeout(e,t)})}Ye.sleep=z3;async function mse(t,{interval:e=30,timeout:r=1/0}){let n=0;for(;!t();)if(await z3(e),n+=e,n>r)throw Ye.ERROR_TIMEOUT_REACHED}Ye.sleepUntil=mse;async function gse(){return new Promise(()=>{setInterval(()=>{},1e3)})}Ye.sleepForever=gse;function yse(t){(0,lse.default)(()=>{Qs("onExit: process.exit/normal shutdown"),t()})}Ye.onExit=yse;var ip=new Set;function Dse(t){ip.add(t)}Ye.onBeforeExit=Dse;function wse(t){ip.delete(t)}Ye.offBeforeExit=wse;var bse=t=>{let e=!1;return async()=>{e||(await t(),e=!0)}},Uc=t=>bse(async()=>{Qs("onBeforeExit handler: %O received",t),Qs("onBeforeExit handler: running %O functions",ip.size),await Promise.all([...ip.values()].map(async e=>{try{await e()}catch(r){Qs("onBeforeExit handler: error from function: %O",r)}})),t!=="process.exit"&&(Qs("onBeforeExit handler: killing self (exit code %O, signal %O)",process.exitCode?process.exitCode:0,t),process.removeListener(t,G3[t]),process.kill(process.pid,t))}),G3={SIGINT:Uc("SIGINT"),SIGTERM:Uc("SIGTERM"),SIGHUP:Uc("SIGHUP"),SIGBREAK:Uc("SIGBREAK")};for(let[t,e]of Object.entries(G3))process.on(t,e);var vse=Uc("process.exit");async function Ese(t=0){process.exitCode=t,await vse(),Qs("processExit: exiting (exit code: %O)",process.exitCode),process.exit()}Ye.processExit=Ese});var Y3=E(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.growBufferForAppendedData=Pn.WritableStreamBuffer=Pn.ReadableStreamBuffer=Pn.NullStream=void 0;var jb=require("stream"),_se=4,W3=32,X3=16,Nb=class extends jb.Writable{_write(e,r,n){n()}};Pn.NullStream=Nb;var $b=class extends jb.Readable{constructor(e){super(e),this._size=0,this._stopped=!1,this.buffer=Buffer.alloc(e&&e.allocSize?e.allocSize:W3),this.chunkSize=e&&e.chunkSize?e.chunkSize:_se,this.growSize=e&&e.growSize?e.growSize:X3}get size(){return this._size}get stopped(){return this._stopped}_read(){this._send()}feed(e,r="utf8"){if(this._stopped)throw new Error("ReadableStreamBuffer is stopped. Can no longer feed.");let n=typeof e=="string"?Buffer.byteLength(e):e.length;this.buffer=Bb(this.buffer,this._size,Math.ceil(n/this.growSize)*this.growSize),typeof e=="string"?this.buffer.write(e,this._size,n,r):this.buffer.copy(e,this._size,0),this._size+=n}stop(){this._stopped||(this._stopped=!0,this._size===0&&this.push(null))}_send(){let e=Math.min(this.chunkSize,this._size),r=!1;if(e>0){let n=Buffer.alloc(e);this.buffer.copy(n,0,0,e),r=!this.push(n),this.buffer.copy(this.buffer,0,e,this._size),this._size-=e}this._size===0&&this._stopped&&this.push(null),r||setTimeout(()=>this._send(),1)}};Pn.ReadableStreamBuffer=$b;var Lb=class extends jb.Writable{constructor(e){super(e),this._size=0,this.buffer=Buffer.alloc(e&&e.allocSize?e.allocSize:W3),this.growSize=e&&e.growSize?e.growSize:X3}get size(){return this._size}_write(e,r,n){this.buffer=Bb(this.buffer,this._size,Math.ceil(e.length/this.growSize)*this.growSize),e.copy(this.buffer,this._size,0),this._size+=e.length,n()}consume(e){e=typeof e=="number"?e:this._size;let r=Buffer.alloc(e);return this.buffer.copy(r,0,0,r.length),this.buffer.copy(this.buffer,0,r.length),this._size-=r.length,r}};Pn.WritableStreamBuffer=Lb;function Bb(t,e,r){if(t.length-e>=r)return t;let n=Buffer.alloc(t.length+r);return t.copy(n,0,0,e),n}Pn.growBufferForAppendedData=Bb});var tL=E((Ebe,eL)=>{eL.exports=Q3;Q3.sync=Sse;var J3=require("fs");function Cse(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function Z3(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:Cse(e,r)}function Q3(t,e,r){J3.stat(t,function(n,i){r(n,n?!1:Z3(i,t,e))})}function Sse(t,e){return Z3(J3.statSync(t),t,e)}});var oL=E((_be,sL)=>{sL.exports=nL;nL.sync=Ase;var rL=require("fs");function nL(t,e,r){rL.stat(t,function(n,i){r(n,n?!1:iL(i,e))})}function Ase(t,e){return iL(rL.statSync(t),e)}function iL(t,e){return t.isFile()&&Ose(t,e)}function Ose(t,e){var r=t.mode,n=t.uid,i=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,h=r&c||r&u&&i===o||r&a&&n===s||r&l&&s===0;return h}});var uL=E((Sbe,aL)=>{var Cbe=require("fs"),sp;process.platform==="win32"||global.TESTING_WINDOWS?sp=tL():sp=oL();aL.exports=Mb;Mb.sync=xse;function Mb(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){Mb(t,e||{},function(s,o){s?i(s):n(o)})})}sp(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function xse(t,e){try{return sp.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var mL=E((Abe,pL)=>{var La=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",cL=require("path"),Tse=La?";":":",lL=uL(),fL=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),hL=(t,e)=>{let r=e.colon||Tse,n=t.match(/\//)||La&&t.match(/\\/)?[""]:[...La?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=La?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=La?i.split(r):[""];return La&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:i}},dL=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:s}=hL(t,e),o=[],a=c=>new Promise((l,h)=>{if(c===n.length)return e.all&&o.length?l(o):h(fL(t));let d=n[c],f=/^".*"$/.test(d)?d.slice(1,-1):d,m=cL.join(f,t),g=!f&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;l(u(g,c,0))}),u=(c,l,h)=>new Promise((d,f)=>{if(h===i.length)return d(a(l+1));let m=i[h];lL(c+m,{pathExt:s},(g,b)=>{if(!g&&b)if(e.all)o.push(c+m);else return d(c+m);return d(u(c,l,h+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},Fse=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=hL(t,e),s=[];for(let o=0;o<r.length;o++){let a=r[o],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=cL.join(u,t),l=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let h=0;h<n.length;h++){let d=l+n[h];try{if(lL.sync(d,{pathExt:i}))if(e.all)s.push(d);else return d}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw fL(t)};pL.exports=dL;dL.sync=Fse});var yL=E((Obe,qb)=>{"use strict";var gL=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};qb.exports=gL;qb.exports.default=gL});var vL=E((xbe,bL)=>{"use strict";var DL=require("path"),Ise=mL(),kse=yL();function wL(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,s=i&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let o;try{o=Ise.sync(t.command,{path:r[kse({env:r})],pathExt:e?DL.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return o&&(o=DL.resolve(i?t.options.cwd:"",o)),o}function Pse(t){return wL(t)||wL(t,!0)}bL.exports=Pse});var EL=E((Tbe,Hb)=>{"use strict";var Ub=/([()\][%!^"`<>&|;, *?])/g;function Rse(t){return t=t.replace(Ub,"^$1"),t}function Nse(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Ub,"^$1"),e&&(t=t.replace(Ub,"^$1")),t}Hb.exports.command=Rse;Hb.exports.argument=Nse});var CL=E((Fbe,_L)=>{"use strict";_L.exports=/^#!(.*)/});var AL=E((Ibe,SL)=>{"use strict";var $se=CL();SL.exports=(t="")=>{let e=t.match($se);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var xL=E((kbe,OL)=>{"use strict";var Vb=require("fs"),Lse=AL();function jse(t){let r=Buffer.alloc(150),n;try{n=Vb.openSync(t,"r"),Vb.readSync(n,r,0,150,0),Vb.closeSync(n)}catch{}return Lse(r.toString())}OL.exports=jse});var kL=E((Pbe,IL)=>{"use strict";var Bse=require("path"),TL=vL(),FL=EL(),Mse=xL(),qse=process.platform==="win32",Use=/\.(?:com|exe)$/i,Hse=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Vse(t){t.file=TL(t);let e=t.file&&Mse(t.file);return e?(t.args.unshift(t.file),t.command=e,TL(t)):t.file}function zse(t){if(!qse)return t;let e=Vse(t),r=!Use.test(e);if(t.options.forceShell||r){let n=Hse.test(e);t.command=Bse.normalize(t.command),t.command=FL.command(t.command),t.args=t.args.map(s=>FL.argument(s,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function Gse(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:zse(n)}IL.exports=Gse});var NL=E((Rbe,RL)=>{"use strict";var zb=process.platform==="win32";function Gb(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function Kse(t,e){if(!zb)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let s=PL(i,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}function PL(t,e){return zb&&t===1&&!e.file?Gb(e.original,"spawn"):null}function Wse(t,e){return zb&&t===1&&!e.file?Gb(e.original,"spawnSync"):null}RL.exports={hookChildProcess:Kse,verifyENOENT:PL,verifyENOENTSync:Wse,notFoundError:Gb}});var jL=E((Nbe,ja)=>{"use strict";var $L=require("child_process"),Kb=kL(),Wb=NL();function LL(t,e,r){let n=Kb(t,e,r),i=$L.spawn(n.command,n.args,n.options);return Wb.hookChildProcess(i,n),i}function Xse(t,e,r){let n=Kb(t,e,r),i=$L.spawnSync(n.command,n.args,n.options);return i.error=i.error||Wb.verifyENOENTSync(i.status,n),i}ja.exports=LL;ja.exports.spawn=LL;ja.exports.sync=Xse;ja.exports._parse=Kb;ja.exports._enoent=Wb});var zL=E(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.findExecutables=Ie.which=Ie.fork=Ie.spawn=Ie.Subprocess=Ie.SubprocessError=Ie.convertPATH=Ie.expandTildePath=Ie.TILDE_PATH_REGEX=Ie.ERROR_SIGNAL_EXIT=Ie.ERROR_NON_ZERO_EXIT=Ie.ERROR_COMMAND_NOT_FOUND=void 0;var Jb=(fe(),ue(le)),BL=jN(),Yse=L3(),Xb=K3(),op=Y3(),ML=Bi(),Jse=require("child_process"),Zse=Jb.__importDefault(jL()),Qse=Jb.__importStar(require("os")),to=Jb.__importStar(require("path"));Ie.ERROR_COMMAND_NOT_FOUND="ERR_SUBPROCESS_COMMAND_NOT_FOUND";Ie.ERROR_NON_ZERO_EXIT="ERR_SUBPROCESS_NON_ZERO_EXIT";Ie.ERROR_SIGNAL_EXIT="ERR_SUBPROCESS_SIGNAL_EXIT";Ie.TILDE_PATH_REGEX=/^~($|\/|\\)/;function qL(t){let e=Qse.homedir();return t.replace(Ie.TILDE_PATH_REGEX,`${e}$1`)}Ie.expandTildePath=qL;function UL(t=process.env.PATH||""){return t.split(to.delimiter).map(qL).join(to.delimiter)}Ie.convertPATH=UL;var eo=class extends Error{constructor(){super(...arguments),this.name="SubprocessError"}};Ie.SubprocessError=eo;var Yb=class{constructor(e,r,n={}){this.name=e,this.args=r;let i=this.maskArg(e);i!==e&&(this.name=i,this.path=e),this._options=n}get options(){let e=this._options;e.env||(e.env=process.env);let r=(0,Xb.createProcessEnv)(e.env||{},{PATH:UL(typeof e.env.PATH=="string"?e.env.PATH:process.env.PATH)});return{...e,env:r}}async output(){this._options.stdio="pipe";let e=this.run(),r=new op.WritableStreamBuffer,n=new op.WritableStreamBuffer,i=new op.WritableStreamBuffer;e.p.stdout?.pipe(r),e.p.stdout?.pipe(i),e.p.stderr?.pipe(n),e.p.stderr?.pipe(i);try{await e}catch(s){throw r.end(),n.end(),s.output=i.consume().toString(),s}return n.end(),i.end(),r.consume().toString()}async combinedOutput(){this._options.stdio="pipe";let e=this.run(),r=new op.WritableStreamBuffer;e.p.stdout?.pipe(r),e.p.stderr?.pipe(r);try{await e}catch(n){throw n.output=r.consume().toString(),n}return r.consume().toString()}run(){let e=this.spawn(),r=new Promise((n,i)=>{e.on("error",s=>{let o;s.code==="ENOENT"?(o=new eo("Command not found.",{cause:s}),o.code=Ie.ERROR_COMMAND_NOT_FOUND):o=new eo("Command error.",{cause:s}),i(o)}),e.on("close",(s,o)=>{let a;if(s===0)return n();if(o)a=new eo("Signal exit from subprocess."),a.code=Ie.ERROR_SIGNAL_EXIT,a.signal=o;else if(s)a=new eo("Non-zero exit from subprocess."),a.code=Ie.ERROR_NON_ZERO_EXIT,a.exitCode=s;else return n();i(a)})});return Object.defineProperties(r,{p:{value:e}}),r}spawn(){return HL(this.path?this.path:this.name,this.args,this.options)}bashify({maskArgv0:e=!0,maskArgv1:r=!1,shiftArgv0:n=!1}={}){let i=[this.path?this.path:this.name,...this.args];return n&&i.shift(),i[0]&&e&&(i[0]=this.maskArg(i[0])),i[1]&&r&&(i[1]=this.maskArg(i[1])),i.length>0?i.map(s=>this.bashifyArg(s)).join(" "):""}bashifyArg(e){return e.includes(" ")?`"${e.replace(/\"/g,'\\"')}"`:e}maskArg(e){let r=e.lastIndexOf(to.sep);return r>=0?e.substring(r+1):e}};Ie.Subprocess=Yb;function HL(t,e=[],r){return(0,Zse.default)(t,[...e],r)}Ie.spawn=HL;function eoe(t,e=[],r={}){return(0,Jse.fork)(t,[...e],r)}Ie.fork=eoe;var Zb=ML.TERMINAL_INFO.windows?".COM;.EXE;.BAT;.CMD":void 0;async function toe(t,{PATH:e=process.env.PATH,PATHEXT:r=process.env.PATHEXT||Zb}={}){if(t.includes(to.sep))return t;let n=await VL(t,{PATH:e});if(!n.length){let i=new Error(`${t} cannot be found within PATH`);throw i.code="ENOENT",i}return n[0]}Ie.which=toe;async function roe(t,{PATH:e=process.env.PATH,PATHEXT:r=process.env.PATHEXT||Zb}={}){return t.includes(to.sep)?[t]:VL(t,{PATH:e})}Ie.findExecutables=roe;async function VL(t,{PATH:e=process.env.PATH,PATHEXT:r=process.env.PATHEXT||Zb}={}){let n=(0,Xb.getPathParts)(e),i;if(ML.TERMINAL_INFO.windows){let s=(0,Xb.getPathParts)(r).map(o=>o.toLowerCase());i=s.includes(to.extname(t).toLowerCase())?[t]:s.map(o=>t+o)}else i=[t];return[].concat(...await(0,BL.map)(i,async s=>(0,BL.concurrentFilter)(n.map(o=>to.join(o,s)),async o=>(0,Yse.isExecutableFile)(o))))}});var ap=E(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.isInstalled=Ji.getCommandOutput=Ji.runCommand=void 0;var Qb=zL();async function GL(t,e,r={}){let n=new Qb.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof Qb.SubprocessError?i.output?i.output:i.cause?`${i.message} ${i.cause.toString()}`:i.code?i.code:"Unknown error":i}}Ji.runCommand=GL;async function noe(t,e,r={}){try{return(await GL(t,e,r)).trim()}catch{return null}}Ji.getCommandOutput=noe;async function ioe(t){try{await(0,Qb.which)(t)}catch{return!1}return!0}Ji.isInstalled=ioe});var Hc=E((jbe,KL)=>{"use strict";var soe="2.0.0",ooe=Number.MAX_SAFE_INTEGER||9007199254740991,aoe=16,uoe=250,coe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];KL.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:aoe,MAX_SAFE_BUILD_LENGTH:uoe,MAX_SAFE_INTEGER:ooe,RELEASE_TYPES:coe,SEMVER_SPEC_VERSION:soe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Vc=E((Bbe,WL)=>{"use strict";var loe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};WL.exports=loe});var Ba=E((Rn,XL)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ev,MAX_SAFE_BUILD_LENGTH:foe,MAX_LENGTH:hoe}=Hc(),doe=Vc();Rn=XL.exports={};var poe=Rn.re=[],moe=Rn.safeRe=[],J=Rn.src=[],goe=Rn.safeSrc=[],Z=Rn.t={},yoe=0,tv="[a-zA-Z0-9-]",Doe=[["\\s",1],["\\d",hoe],[tv,foe]],woe=t=>{for(let[e,r]of Doe)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ge=(t,e,r)=>{let n=woe(e),i=yoe++;doe(t,i,e),Z[t]=i,J[i]=e,goe[i]=n,poe[i]=new RegExp(e,r?"g":void 0),moe[i]=new RegExp(n,r?"g":void 0)};ge("NUMERICIDENTIFIER","0|[1-9]\\d*");ge("NUMERICIDENTIFIERLOOSE","\\d+");ge("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${tv}*`);ge("MAINVERSION",`(${J[Z.NUMERICIDENTIFIER]})\\.(${J[Z.NUMERICIDENTIFIER]})\\.(${J[Z.NUMERICIDENTIFIER]})`);ge("MAINVERSIONLOOSE",`(${J[Z.NUMERICIDENTIFIERLOOSE]})\\.(${J[Z.NUMERICIDENTIFIERLOOSE]})\\.(${J[Z.NUMERICIDENTIFIERLOOSE]})`);ge("PRERELEASEIDENTIFIER",`(?:${J[Z.NONNUMERICIDENTIFIER]}|${J[Z.NUMERICIDENTIFIER]})`);ge("PRERELEASEIDENTIFIERLOOSE",`(?:${J[Z.NONNUMERICIDENTIFIER]}|${J[Z.NUMERICIDENTIFIERLOOSE]})`);ge("PRERELEASE",`(?:-(${J[Z.PRERELEASEIDENTIFIER]}(?:\\.${J[Z.PRERELEASEIDENTIFIER]})*))`);ge("PRERELEASELOOSE",`(?:-?(${J[Z.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${J[Z.PRERELEASEIDENTIFIERLOOSE]})*))`);ge("BUILDIDENTIFIER",`${tv}+`);ge("BUILD",`(?:\\+(${J[Z.BUILDIDENTIFIER]}(?:\\.${J[Z.BUILDIDENTIFIER]})*))`);ge("FULLPLAIN",`v?${J[Z.MAINVERSION]}${J[Z.PRERELEASE]}?${J[Z.BUILD]}?`);ge("FULL",`^${J[Z.FULLPLAIN]}$`);ge("LOOSEPLAIN",`[v=\\s]*${J[Z.MAINVERSIONLOOSE]}${J[Z.PRERELEASELOOSE]}?${J[Z.BUILD]}?`);ge("LOOSE",`^${J[Z.LOOSEPLAIN]}$`);ge("GTLT","((?:<|>)?=?)");ge("XRANGEIDENTIFIERLOOSE",`${J[Z.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ge("XRANGEIDENTIFIER",`${J[Z.NUMERICIDENTIFIER]}|x|X|\\*`);ge("XRANGEPLAIN",`[v=\\s]*(${J[Z.XRANGEIDENTIFIER]})(?:\\.(${J[Z.XRANGEIDENTIFIER]})(?:\\.(${J[Z.XRANGEIDENTIFIER]})(?:${J[Z.PRERELEASE]})?${J[Z.BUILD]}?)?)?`);ge("XRANGEPLAINLOOSE",`[v=\\s]*(${J[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${J[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${J[Z.XRANGEIDENTIFIERLOOSE]})(?:${J[Z.PRERELEASELOOSE]})?${J[Z.BUILD]}?)?)?`);ge("XRANGE",`^${J[Z.GTLT]}\\s*${J[Z.XRANGEPLAIN]}$`);ge("XRANGELOOSE",`^${J[Z.GTLT]}\\s*${J[Z.XRANGEPLAINLOOSE]}$`);ge("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ev}})(?:\\.(\\d{1,${ev}}))?(?:\\.(\\d{1,${ev}}))?`);ge("COERCE",`${J[Z.COERCEPLAIN]}(?:$|[^\\d])`);ge("COERCEFULL",J[Z.COERCEPLAIN]+`(?:${J[Z.PRERELEASE]})?(?:${J[Z.BUILD]})?(?:$|[^\\d])`);ge("COERCERTL",J[Z.COERCE],!0);ge("COERCERTLFULL",J[Z.COERCEFULL],!0);ge("LONETILDE","(?:~>?)");ge("TILDETRIM",`(\\s*)${J[Z.LONETILDE]}\\s+`,!0);Rn.tildeTrimReplace="$1~";ge("TILDE",`^${J[Z.LONETILDE]}${J[Z.XRANGEPLAIN]}$`);ge("TILDELOOSE",`^${J[Z.LONETILDE]}${J[Z.XRANGEPLAINLOOSE]}$`);ge("LONECARET","(?:\\^)");ge("CARETTRIM",`(\\s*)${J[Z.LONECARET]}\\s+`,!0);Rn.caretTrimReplace="$1^";ge("CARET",`^${J[Z.LONECARET]}${J[Z.XRANGEPLAIN]}$`);ge("CARETLOOSE",`^${J[Z.LONECARET]}${J[Z.XRANGEPLAINLOOSE]}$`);ge("COMPARATORLOOSE",`^${J[Z.GTLT]}\\s*(${J[Z.LOOSEPLAIN]})$|^$`);ge("COMPARATOR",`^${J[Z.GTLT]}\\s*(${J[Z.FULLPLAIN]})$|^$`);ge("COMPARATORTRIM",`(\\s*)${J[Z.GTLT]}\\s*(${J[Z.LOOSEPLAIN]}|${J[Z.XRANGEPLAIN]})`,!0);Rn.comparatorTrimReplace="$1$2$3";ge("HYPHENRANGE",`^\\s*(${J[Z.XRANGEPLAIN]})\\s+-\\s+(${J[Z.XRANGEPLAIN]})\\s*$`);ge("HYPHENRANGELOOSE",`^\\s*(${J[Z.XRANGEPLAINLOOSE]})\\s+-\\s+(${J[Z.XRANGEPLAINLOOSE]})\\s*$`);ge("STAR","(<|>)?=?\\s*\\*");ge("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ge("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var up=E((Mbe,YL)=>{"use strict";var boe=Object.freeze({loose:!0}),voe=Object.freeze({}),Eoe=t=>t?typeof t!="object"?boe:t:voe;YL.exports=Eoe});var rv=E((qbe,QL)=>{"use strict";var JL=/^[0-9]+$/,ZL=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=JL.test(t),n=JL.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},_oe=(t,e)=>ZL(e,t);QL.exports={compareIdentifiers:ZL,rcompareIdentifiers:_oe}});var Wt=E((Ube,tj)=>{"use strict";var cp=Vc(),{MAX_LENGTH:ej,MAX_SAFE_INTEGER:lp}=Hc(),{safeRe:fp,t:hp}=Ba(),Coe=up(),{compareIdentifiers:nv}=rv(),iv=class t{constructor(e,r){if(r=Coe(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ej)throw new TypeError(`version is longer than ${ej} characters`);cp("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?fp[hp.LOOSE]:fp[hp.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>lp||this.major<0)throw new TypeError("Invalid major version");if(this.minor>lp||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>lp||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<lp)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(cp("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(cp("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return nv(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(cp("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return nv(n,i)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?fp[hp.PRERELEASELOOSE]:fp[hp.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),nv(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};tj.exports=iv});var ro=E((Hbe,nj)=>{"use strict";var rj=Wt(),Soe=(t,e,r=!1)=>{if(t instanceof rj)return t;try{return new rj(t,e)}catch(n){if(!r)return null;throw n}};nj.exports=Soe});var sj=E((Vbe,ij)=>{"use strict";var Aoe=ro(),Ooe=(t,e)=>{let r=Aoe(t,e);return r?r.version:null};ij.exports=Ooe});var aj=E((zbe,oj)=>{"use strict";var xoe=ro(),Toe=(t,e)=>{let r=xoe(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};oj.exports=Toe});var lj=E((Gbe,cj)=>{"use strict";var uj=Wt(),Foe=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new uj(t instanceof uj?t.version:t,r).inc(e,n,i).version}catch{return null}};cj.exports=Foe});var dj=E((Kbe,hj)=>{"use strict";var fj=ro(),Ioe=(t,e)=>{let r=fj(t,null,!0),n=fj(e,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,a=s?n:r,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};hj.exports=Ioe});var mj=E((Wbe,pj)=>{"use strict";var koe=Wt(),Poe=(t,e)=>new koe(t,e).major;pj.exports=Poe});var yj=E((Xbe,gj)=>{"use strict";var Roe=Wt(),Noe=(t,e)=>new Roe(t,e).minor;gj.exports=Noe});var wj=E((Ybe,Dj)=>{"use strict";var $oe=Wt(),Loe=(t,e)=>new $oe(t,e).patch;Dj.exports=Loe});var vj=E((Jbe,bj)=>{"use strict";var joe=ro(),Boe=(t,e)=>{let r=joe(t,e);return r&&r.prerelease.length?r.prerelease:null};bj.exports=Boe});var Kr=E((Zbe,_j)=>{"use strict";var Ej=Wt(),Moe=(t,e,r)=>new Ej(t,r).compare(new Ej(e,r));_j.exports=Moe});var Sj=E((Qbe,Cj)=>{"use strict";var qoe=Kr(),Uoe=(t,e,r)=>qoe(e,t,r);Cj.exports=Uoe});var Oj=E((eve,Aj)=>{"use strict";var Hoe=Kr(),Voe=(t,e)=>Hoe(t,e,!0);Aj.exports=Voe});var dp=E((tve,Tj)=>{"use strict";var xj=Wt(),zoe=(t,e,r)=>{let n=new xj(t,r),i=new xj(e,r);return n.compare(i)||n.compareBuild(i)};Tj.exports=zoe});var Ij=E((rve,Fj)=>{"use strict";var Goe=dp(),Koe=(t,e)=>t.sort((r,n)=>Goe(r,n,e));Fj.exports=Koe});var Pj=E((nve,kj)=>{"use strict";var Woe=dp(),Xoe=(t,e)=>t.sort((r,n)=>Woe(n,r,e));kj.exports=Xoe});var zc=E((ive,Rj)=>{"use strict";var Yoe=Kr(),Joe=(t,e,r)=>Yoe(t,e,r)>0;Rj.exports=Joe});var pp=E((sve,Nj)=>{"use strict";var Zoe=Kr(),Qoe=(t,e,r)=>Zoe(t,e,r)<0;Nj.exports=Qoe});var sv=E((ove,$j)=>{"use strict";var eae=Kr(),tae=(t,e,r)=>eae(t,e,r)===0;$j.exports=tae});var ov=E((ave,Lj)=>{"use strict";var rae=Kr(),nae=(t,e,r)=>rae(t,e,r)!==0;Lj.exports=nae});var mp=E((uve,jj)=>{"use strict";var iae=Kr(),sae=(t,e,r)=>iae(t,e,r)>=0;jj.exports=sae});var gp=E((cve,Bj)=>{"use strict";var oae=Kr(),aae=(t,e,r)=>oae(t,e,r)<=0;Bj.exports=aae});var av=E((lve,Mj)=>{"use strict";var uae=sv(),cae=ov(),lae=zc(),fae=mp(),hae=pp(),dae=gp(),pae=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return uae(t,r,n);case"!=":return cae(t,r,n);case">":return lae(t,r,n);case">=":return fae(t,r,n);case"<":return hae(t,r,n);case"<=":return dae(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Mj.exports=pae});var Uj=E((fve,qj)=>{"use strict";var mae=Wt(),gae=ro(),{safeRe:yp,t:Dp}=Ba(),yae=(t,e)=>{if(t instanceof mae)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?yp[Dp.COERCEFULL]:yp[Dp.COERCE]);else{let u=e.includePrerelease?yp[Dp.COERCERTLFULL]:yp[Dp.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return gae(`${n}.${i}.${s}${o}${a}`,e)};qj.exports=yae});var Vj=E((hve,Hj)=>{"use strict";var uv=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};Hj.exports=uv});var Wr=E((dve,Wj)=>{"use strict";var Dae=/\s+/g,cv=class t{constructor(e,r){if(r=bae(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof lv)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Dae," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!Gj(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Oae(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&Sae)|(this.options.loose&&Aae))+":"+e,i=zj.get(n);if(i)return i;let s=this.options.loose,o=s?cr[Xt.HYPHENRANGELOOSE]:cr[Xt.HYPHENRANGE];e=e.replace(o,Lae(this.options.includePrerelease)),Je("hyphen replace",e),e=e.replace(cr[Xt.COMPARATORTRIM],Eae),Je("comparator trim",e),e=e.replace(cr[Xt.TILDETRIM],_ae),Je("tilde trim",e),e=e.replace(cr[Xt.CARETTRIM],Cae),Je("caret trim",e);let a=e.split(" ").map(h=>xae(h,this.options)).join(" ").split(/\s+/).map(h=>$ae(h,this.options));s&&(a=a.filter(h=>(Je("loose invalid filter",h,this.options),!!h.match(cr[Xt.COMPARATORLOOSE])))),Je("range list",a);let u=new Map,c=a.map(h=>new lv(h,this.options));for(let h of c){if(Gj(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return zj.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Kj(n,r)&&e.set.some(i=>Kj(i,r)&&n.every(s=>i.every(o=>s.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new vae(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(jae(this.set[r],e,this.options))return!0;return!1}};Wj.exports=cv;var wae=Vj(),zj=new wae,bae=up(),lv=Gc(),Je=Vc(),vae=Wt(),{safeRe:cr,t:Xt,comparatorTrimReplace:Eae,tildeTrimReplace:_ae,caretTrimReplace:Cae}=Ba(),{FLAG_INCLUDE_PRERELEASE:Sae,FLAG_LOOSE:Aae}=Hc(),Gj=t=>t.value==="<0.0.0-0",Oae=t=>t.value==="",Kj=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(s=>i.intersects(s,e)),i=n.pop();return r},xae=(t,e)=>(t=t.replace(cr[Xt.BUILD],""),Je("comp",t,e),t=Iae(t,e),Je("caret",t),t=Tae(t,e),Je("tildes",t),t=Pae(t,e),Je("xrange",t),t=Nae(t,e),Je("stars",t),t),lr=t=>!t||t.toLowerCase()==="x"||t==="*",Tae=(t,e)=>t.trim().split(/\s+/).map(r=>Fae(r,e)).join(" "),Fae=(t,e)=>{let r=e.loose?cr[Xt.TILDELOOSE]:cr[Xt.TILDE];return t.replace(r,(n,i,s,o,a)=>{Je("tilde",t,n,i,s,o,a);let u;return lr(i)?u="":lr(s)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:lr(o)?u=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:a?(Je("replaceTilde pr",a),u=`>=${i}.${s}.${o}-${a} <${i}.${+s+1}.0-0`):u=`>=${i}.${s}.${o} <${i}.${+s+1}.0-0`,Je("tilde return",u),u})},Iae=(t,e)=>t.trim().split(/\s+/).map(r=>kae(r,e)).join(" "),kae=(t,e)=>{Je("caret",t,e);let r=e.loose?cr[Xt.CARETLOOSE]:cr[Xt.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,s,o,a,u)=>{Je("caret",t,i,s,o,a,u);let c;return lr(s)?c="":lr(o)?c=`>=${s}.0.0${n} <${+s+1}.0.0-0`:lr(a)?s==="0"?c=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:u?(Je("replaceCaret pr",u),s==="0"?o==="0"?c=`>=${s}.${o}.${a}-${u} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}-${u} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a}-${u} <${+s+1}.0.0-0`):(Je("no pr"),s==="0"?o==="0"?c=`>=${s}.${o}.${a}${n} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}${n} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),Je("caret return",c),c})},Pae=(t,e)=>(Je("replaceXRanges",t,e),t.split(/\s+/).map(r=>Rae(r,e)).join(" ")),Rae=(t,e)=>{t=t.trim();let r=e.loose?cr[Xt.XRANGELOOSE]:cr[Xt.XRANGE];return t.replace(r,(n,i,s,o,a,u)=>{Je("xRange",t,n,i,s,o,a,u);let c=lr(s),l=c||lr(o),h=l||lr(a),d=h;return i==="="&&d&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&d?(l&&(o=0),a=0,i===">"?(i=">=",l?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",l?s=+s+1:o=+o+1),i==="<"&&(u="-0"),n=`${i+s}.${o}.${a}${u}`):l?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),Je("xRange return",n),n})},Nae=(t,e)=>(Je("replaceStars",t,e),t.trim().replace(cr[Xt.STAR],"")),$ae=(t,e)=>(Je("replaceGTE0",t,e),t.trim().replace(cr[e.includePrerelease?Xt.GTE0PRE:Xt.GTE0],"")),Lae=t=>(e,r,n,i,s,o,a,u,c,l,h,d)=>(lr(n)?r="":lr(i)?r=`>=${n}.0.0${t?"-0":""}`:lr(s)?r=`>=${n}.${i}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,lr(c)?u="":lr(l)?u=`<${+c+1}.0.0-0`:lr(h)?u=`<${c}.${+l+1}.0-0`:d?u=`<=${c}.${l}.${h}-${d}`:t?u=`<${c}.${l}.${+h+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),jae=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Je(t[n].semver),t[n].semver!==lv.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Gc=E((pve,eB)=>{"use strict";var Kc=Symbol("SemVer ANY"),dv=class t{static get ANY(){return Kc}constructor(e,r){if(r=Xj(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),hv("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Kc?this.value="":this.value=this.operator+this.semver.version,hv("comp",this)}parse(e){let r=this.options.loose?Yj[Jj.COMPARATORLOOSE]:Yj[Jj.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Zj(n[2],this.options.loose):this.semver=Kc}toString(){return this.value}test(e){if(hv("Comparator.test",e,this.options.loose),this.semver===Kc||e===Kc)return!0;if(typeof e=="string")try{e=new Zj(e,this.options)}catch{return!1}return fv(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Qj(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Qj(this.value,r).test(e.semver):(r=Xj(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||fv(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||fv(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};eB.exports=dv;var Xj=up(),{safeRe:Yj,t:Jj}=Ba(),fv=av(),hv=Vc(),Zj=Wt(),Qj=Wr()});var Wc=E((mve,tB)=>{"use strict";var Bae=Wr(),Mae=(t,e,r)=>{try{e=new Bae(e,r)}catch{return!1}return e.test(t)};tB.exports=Mae});var nB=E((gve,rB)=>{"use strict";var qae=Wr(),Uae=(t,e)=>new qae(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));rB.exports=Uae});var sB=E((yve,iB)=>{"use strict";var Hae=Wt(),Vae=Wr(),zae=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Vae(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Hae(n,r))}),n};iB.exports=zae});var aB=E((Dve,oB)=>{"use strict";var Gae=Wt(),Kae=Wr(),Wae=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Kae(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Gae(n,r))}),n};oB.exports=Wae});var lB=E((wve,cB)=>{"use strict";var pv=Wt(),Xae=Wr(),uB=zc(),Yae=(t,e)=>{t=new Xae(t,e);let r=new pv("0.0.0");if(t.test(r)||(r=new pv("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],s=null;i.forEach(o=>{let a=new pv(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||uB(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||uB(r,s))&&(r=s)}return r&&t.test(r)?r:null};cB.exports=Yae});var hB=E((bve,fB)=>{"use strict";var Jae=Wr(),Zae=(t,e)=>{try{return new Jae(t,e).range||"*"}catch{return null}};fB.exports=Zae});var wp=E((vve,gB)=>{"use strict";var Qae=Wt(),mB=Gc(),{ANY:eue}=mB,tue=Wr(),rue=Wc(),dB=zc(),pB=pp(),nue=gp(),iue=mp(),sue=(t,e,r,n)=>{t=new Qae(t,n),e=new tue(e,n);let i,s,o,a,u;switch(r){case">":i=dB,s=nue,o=pB,a=">",u=">=";break;case"<":i=pB,s=iue,o=dB,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(rue(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],h=null,d=null;if(l.forEach(f=>{f.semver===eue&&(f=new mB(">=0.0.0")),h=h||f,d=d||f,i(f.semver,h.semver,n)?h=f:o(f.semver,d.semver,n)&&(d=f)}),h.operator===a||h.operator===u||(!d.operator||d.operator===a)&&s(t,d.semver))return!1;if(d.operator===u&&o(t,d.semver))return!1}return!0};gB.exports=sue});var DB=E((Eve,yB)=>{"use strict";var oue=wp(),aue=(t,e,r)=>oue(t,e,">",r);yB.exports=aue});var bB=E((_ve,wB)=>{"use strict";var uue=wp(),cue=(t,e,r)=>uue(t,e,"<",r);wB.exports=cue});var _B=E((Cve,EB)=>{"use strict";var vB=Wr(),lue=(t,e,r)=>(t=new vB(t,r),e=new vB(e,r),t.intersects(e,r));EB.exports=lue});var SB=E((Sve,CB)=>{"use strict";var fue=Wc(),hue=Kr();CB.exports=(t,e,r)=>{let n=[],i=null,s=null,o=t.sort((l,h)=>hue(l,h,r));for(let l of o)fue(l,e,r)?(s=l,i||(i=l)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,h]of n)l===h?a.push(l):!h&&l===o[0]?a.push("*"):h?l===o[0]?a.push(`<=${h}`):a.push(`${l} - ${h}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var IB=E((Ave,FB)=>{"use strict";var AB=Wr(),gv=Gc(),{ANY:mv}=gv,Xc=Wc(),yv=Kr(),due=(t,e,r={})=>{if(t===e)return!0;t=new AB(t,r),e=new AB(e,r);let n=!1;e:for(let i of t.set){for(let s of e.set){let o=mue(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},pue=[new gv(">=0.0.0-0")],OB=[new gv(">=0.0.0")],mue=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===mv){if(e.length===1&&e[0].semver===mv)return!0;r.includePrerelease?t=pue:t=OB}if(e.length===1&&e[0].semver===mv){if(r.includePrerelease)return!0;e=OB}let n=new Set,i,s;for(let f of t)f.operator===">"||f.operator===">="?i=xB(i,f,r):f.operator==="<"||f.operator==="<="?s=TB(s,f,r):n.add(f.semver);if(n.size>1)return null;let o;if(i&&s){if(o=yv(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let f of n){if(i&&!Xc(f,String(i),r)||s&&!Xc(f,String(s),r))return null;for(let m of e)if(!Xc(f,String(m),r))return!1;return!0}let a,u,c,l,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let f of e){if(l=l||f.operator===">"||f.operator===">=",c=c||f.operator==="<"||f.operator==="<=",i){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator===">"||f.operator===">="){if(a=xB(i,f,r),a===f&&a!==i)return!1}else if(i.operator===">="&&!Xc(i.semver,String(f),r))return!1}if(s){if(h&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===h.major&&f.semver.minor===h.minor&&f.semver.patch===h.patch&&(h=!1),f.operator==="<"||f.operator==="<="){if(u=TB(s,f,r),u===f&&u!==s)return!1}else if(s.operator==="<="&&!Xc(s.semver,String(f),r))return!1}if(!f.operator&&(s||i)&&o!==0)return!1}return!(i&&c&&!s&&o!==0||s&&l&&!i&&o!==0||d||h)},xB=(t,e,r)=>{if(!t)return e;let n=yv(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},TB=(t,e,r)=>{if(!t)return e;let n=yv(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};FB.exports=due});var NB=E((Ove,RB)=>{"use strict";var Dv=Ba(),kB=Hc(),gue=Wt(),PB=rv(),yue=ro(),Due=sj(),wue=aj(),bue=lj(),vue=dj(),Eue=mj(),_ue=yj(),Cue=wj(),Sue=vj(),Aue=Kr(),Oue=Sj(),xue=Oj(),Tue=dp(),Fue=Ij(),Iue=Pj(),kue=zc(),Pue=pp(),Rue=sv(),Nue=ov(),$ue=mp(),Lue=gp(),jue=av(),Bue=Uj(),Mue=Gc(),que=Wr(),Uue=Wc(),Hue=nB(),Vue=sB(),zue=aB(),Gue=lB(),Kue=hB(),Wue=wp(),Xue=DB(),Yue=bB(),Jue=_B(),Zue=SB(),Que=IB();RB.exports={parse:yue,valid:Due,clean:wue,inc:bue,diff:vue,major:Eue,minor:_ue,patch:Cue,prerelease:Sue,compare:Aue,rcompare:Oue,compareLoose:xue,compareBuild:Tue,sort:Fue,rsort:Iue,gt:kue,lt:Pue,eq:Rue,neq:Nue,gte:$ue,lte:Lue,cmp:jue,coerce:Bue,Comparator:Mue,Range:que,satisfies:Uue,toComparators:Hue,maxSatisfying:Vue,minSatisfying:zue,minVersion:Gue,validRange:Kue,outside:Wue,gtr:Xue,ltr:Yue,intersects:Jue,simplifyRange:Zue,subset:Que,SemVer:gue,re:Dv.re,src:Dv.src,tokens:Dv.t,SEMVER_SPEC_VERSION:kB.SEMVER_SPEC_VERSION,RELEASE_TYPES:kB.RELEASE_TYPES,compareIdentifiers:PB.compareIdentifiers,rcompareIdentifiers:PB.rcompareIdentifiers}});var KB=E(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.parseApkNameFromFlavor=Q.checkJDKMajorVersion=Q.resolvePlatform=Q.checkPlatformVersions=Q.getAddedPlatforms=Q.getPlatformTargetName=Q.promptForPlatformTarget=Q.promptForPlatform=Q.isValidEnterprisePlatform=Q.getKnownEnterprisePlatforms=Q.isValidCommunityPlatform=Q.getKnownCommunityPlatforms=Q.isValidPlatform=Q.getKnownPlatforms=Q.selectPlatforms=Q.getProjectPlatformDirectory=Q.getCLIVersion=Q.getCoreVersion=Q.getCapacitorPackageVersion=Q.requireCapacitorPackage=Q.getCapacitorPackage=Q.runTask=Q.runPlatformHook=Q.runHooks=Q.wait=Q.checkAppName=Q.checkAppId=Q.checkAppDir=Q.checkAppConfig=Q.checkCapacitorPlatform=Q.checkPackage=Q.checkWebDir=Q.check=void 0;var Jc=(fe(),ue(le)),$B=Bi(),Zi=Da(),no=require("path"),je=Jc.__importDefault(wa()),Ma=td(),jB=gc(),ece=LN(),LB=Sl(),Yc=Ad(),tce=ap();async function rce(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
|
|
203
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`),$c.checkPaths(t,e,"copy",(i,s)=>{if(i)return n(i);let{srcStat:o,destStat:a}=s;$c.checkParentPaths(t,o,e,"copy",u=>u?n(u):r.filter?c$(o$,a,t,e,r,n):o$(a,t,e,r,n))})}function o$(t,e,r,n,i){let s=Nc.dirname(r);Ine(s,(o,a)=>{if(o)return i(o);if(a)return Sb(t,e,r,n,i);Fne(s,u=>u?i(u):Sb(t,e,r,n,i))})}function c$(t,e,r,n,i,s){Promise.resolve(i.filter(r,n)).then(o=>o?t(e,r,n,i,s):s(),o=>s(o))}function Sb(t,e,r,n,i){return n.filter?c$(a$,t,e,r,n,i):a$(t,e,r,n,i)}function a$(t,e,r,n,i){(n.dereference?Sr.stat:Sr.lstat)(e,(o,a)=>{if(o)return i(o);if(a.isDirectory())return Mne(a,t,e,r,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return Rne(a,t,e,r,n,i);if(a.isSymbolicLink())return Hne(t,e,r,n,i)})}function Rne(t,e,r,n,i,s){return e?Nne(t,r,n,i,s):l$(t,r,n,i,s)}function Nne(t,e,r,n,i){if(n.overwrite)Sr.unlink(r,s=>s?i(s):l$(t,e,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function l$(t,e,r,n,i){Sr.copyFile(e,r,s=>s?i(s):n.preserveTimestamps?$ne(t.mode,e,r,i):Kd(r,t.mode,i))}function $ne(t,e,r,n){return Lne(t)?jne(r,t,i=>i?n(i):u$(t,e,r,n)):u$(t,e,r,n)}function Lne(t){return(t&128)===0}function jne(t,e,r){return Kd(t,e|128,r)}function u$(t,e,r,n){Bne(e,r,i=>i?n(i):Kd(r,t,n))}function Kd(t,e,r){return Sr.chmod(t,e,r)}function Bne(t,e,r){Sr.stat(t,(n,i)=>n?r(n):kne(e,i.atime,i.mtime,r))}function Mne(t,e,r,n,i,s){return e?e&&!e.isDirectory()?s(new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`)):f$(r,n,i,s):qne(t.mode,r,n,i,s)}function qne(t,e,r,n,i){Sr.mkdir(r,s=>{if(s)return i(s);f$(e,r,n,o=>o?i(o):Kd(r,t,i))})}function f$(t,e,r,n){Sr.readdir(t,(i,s)=>i?n(i):h$(s,t,e,r,n))}function h$(t,e,r,n,i){let s=t.pop();return s?Une(t,s,e,r,n,i):i()}function Une(t,e,r,n,i,s){let o=Nc.join(r,e),a=Nc.join(n,e);$c.checkPaths(o,a,"copy",(u,c)=>{if(u)return s(u);let{destStat:l}=c;Sb(l,o,a,i,h=>h?s(h):h$(t,r,n,i,s))})}function Hne(t,e,r,n,i){Sr.readlink(e,(s,o)=>{if(s)return i(s);if(n.dereference&&(o=Nc.resolve(process.cwd(),o)),t)Sr.readlink(r,(a,u)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Sr.symlink(o,r,i):i(a):(n.dereference&&(u=Nc.resolve(process.cwd(),u)),$c.isSrcSubdir(o,u)?i(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${u}'.`)):t.isDirectory()&&$c.isSrcSubdir(u,o)?i(new Error(`Cannot overwrite '${u}' with '${o}'.`)):Vne(o,r,i)));else return Sr.symlink(o,r,i)})}function Vne(t,e,r){Sr.unlink(e,n=>n?r(n):Sr.symlink(t,e,r))}d$.exports=Pne});var Ab=E((Xwe,m$)=>{"use strict";var zne=Fe().fromCallback;m$.exports={copy:zne(p$())}});var C$=E((Ywe,_$)=>{"use strict";var g$=pt(),b$=require("path"),Be=require("assert"),Lc=process.platform==="win32";function v$(t){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{t[r]=t[r]||g$[r],r=r+"Sync",t[r]=t[r]||g$[r]}),t.maxBusyTries=t.maxBusyTries||3}function Ob(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),Be(t,"rimraf: missing path"),Be.strictEqual(typeof t,"string","rimraf: path should be a string"),Be.strictEqual(typeof r,"function","rimraf: callback function required"),Be(e,"rimraf: invalid options argument provided"),Be.strictEqual(typeof e,"object","rimraf: options should be object"),v$(e),y$(t,e,function i(s){if(s){if((s.code==="EBUSY"||s.code==="ENOTEMPTY"||s.code==="EPERM")&&n<e.maxBusyTries){n++;let o=n*100;return setTimeout(()=>y$(t,e,i),o)}s.code==="ENOENT"&&(s=null)}r(s)})}function y$(t,e,r){Be(t),Be(e),Be(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&Lc)return D$(t,e,n,r);if(i&&i.isDirectory())return Wd(t,e,n,r);e.unlink(t,s=>{if(s){if(s.code==="ENOENT")return r(null);if(s.code==="EPERM")return Lc?D$(t,e,s,r):Wd(t,e,s,r);if(s.code==="EISDIR")return Wd(t,e,s,r)}return r(s)})})}function D$(t,e,r,n){Be(t),Be(e),Be(typeof n=="function"),e.chmod(t,438,i=>{i?n(i.code==="ENOENT"?null:r):e.stat(t,(s,o)=>{s?n(s.code==="ENOENT"?null:r):o.isDirectory()?Wd(t,e,r,n):e.unlink(t,n)})})}function w$(t,e,r){let n;Be(t),Be(e);try{e.chmodSync(t,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?Xd(t,e,r):e.unlinkSync(t)}function Wd(t,e,r,n){Be(t),Be(e),Be(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?Gne(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function Gne(t,e,r){Be(t),Be(e),Be(typeof r=="function"),e.readdir(t,(n,i)=>{if(n)return r(n);let s=i.length,o;if(s===0)return e.rmdir(t,r);i.forEach(a=>{Ob(b$.join(t,a),e,u=>{if(!o){if(u)return r(o=u);--s===0&&e.rmdir(t,r)}})})})}function E$(t,e){let r;e=e||{},v$(e),Be(t,"rimraf: missing path"),Be.strictEqual(typeof t,"string","rimraf: path should be a string"),Be(e,"rimraf: missing options"),Be.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&Lc&&w$(t,e,n)}try{r&&r.isDirectory()?Xd(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return Lc?w$(t,e,n):Xd(t,e,n);if(n.code!=="EISDIR")throw n;Xd(t,e,n)}}function Xd(t,e,r){Be(t),Be(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")Kne(t,e);else if(n.code!=="ENOENT")throw n}}function Kne(t,e){if(Be(t),Be(e),e.readdirSync(t).forEach(r=>E$(b$.join(t,r),e)),Lc){let r=Date.now();do try{return e.rmdirSync(t,e)}catch{}while(Date.now()-r<500)}else return e.rmdirSync(t,e)}_$.exports=Ob;Ob.sync=E$});var jc=E((Jwe,A$)=>{"use strict";var Wne=Fe().fromCallback,S$=C$();A$.exports={remove:Wne(S$),removeSync:S$.sync}});var R$=E((Zwe,P$)=>{"use strict";var Xne=Fe().fromCallback,T$=pt(),F$=require("path"),I$=ln(),k$=jc(),O$=Xne(function(e,r){r=r||function(){},T$.readdir(e,(n,i)=>{if(n)return I$.mkdirs(e,r);i=i.map(o=>F$.join(e,o)),s();function s(){let o=i.pop();if(!o)return r();k$.remove(o,a=>{if(a)return r(a);s()})}})});function x$(t){let e;try{e=T$.readdirSync(t)}catch{return I$.mkdirsSync(t)}e.forEach(r=>{r=F$.join(t,r),k$.removeSync(r)})}P$.exports={emptyDirSync:x$,emptydirSync:x$,emptyDir:O$,emptydir:O$}});var j$=E((Qwe,L$)=>{"use strict";var Yne=Fe().fromCallback,N$=require("path"),Xi=pt(),$$=ln();function Jne(t,e){function r(){Xi.writeFile(t,"",n=>{if(n)return e(n);e()})}Xi.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let s=N$.dirname(t);Xi.stat(s,(o,a)=>{if(o)return o.code==="ENOENT"?$$.mkdirs(s,u=>{if(u)return e(u);r()}):e(o);a.isDirectory()?r():Xi.readdir(s,u=>{if(u)return e(u)})})})}function Zne(t){let e;try{e=Xi.statSync(t)}catch{}if(e&&e.isFile())return;let r=N$.dirname(t);try{Xi.statSync(r).isDirectory()||Xi.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")$$.mkdirsSync(r);else throw n}Xi.writeFileSync(t,"")}L$.exports={createFile:Yne(Jne),createFileSync:Zne}});var H$=E((ebe,U$)=>{"use strict";var Qne=Fe().fromCallback,M$=require("path"),Zs=pt(),q$=ln(),B$=Wi().pathExists;function eie(t,e,r){function n(i,s){Zs.link(i,s,o=>{if(o)return r(o);r(null)})}B$(e,(i,s)=>{if(i)return r(i);if(s)return r(null);Zs.lstat(t,o=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),r(o);let a=M$.dirname(e);B$(a,(u,c)=>{if(u)return r(u);if(c)return n(t,e);q$.mkdirs(a,l=>{if(l)return r(l);n(t,e)})})})})}function tie(t,e){if(Zs.existsSync(e))return;try{Zs.lstatSync(t)}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=M$.dirname(e);return Zs.existsSync(n)||q$.mkdirsSync(n),Zs.linkSync(t,e)}U$.exports={createLink:Qne(eie),createLinkSync:tie}});var z$=E((tbe,V$)=>{"use strict";var Yi=require("path"),Bc=pt(),rie=Wi().pathExists;function nie(t,e,r){if(Yi.isAbsolute(t))return Bc.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=Yi.dirname(e),i=Yi.join(n,t);return rie(i,(s,o)=>s?r(s):o?r(null,{toCwd:i,toDst:t}):Bc.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:Yi.relative(n,t)})))}}function iie(t,e){let r;if(Yi.isAbsolute(t)){if(r=Bc.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=Yi.dirname(e),i=Yi.join(n,t);if(r=Bc.existsSync(i),r)return{toCwd:i,toDst:t};if(r=Bc.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:Yi.relative(n,t)}}}V$.exports={symlinkPaths:nie,symlinkPathsSync:iie}});var W$=E((rbe,K$)=>{"use strict";var G$=pt();function sie(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);G$.lstat(t,(n,i)=>{if(n)return r(null,"file");e=i&&i.isDirectory()?"dir":"file",r(null,e)})}function oie(t,e){let r;if(e)return e;try{r=G$.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}K$.exports={symlinkType:sie,symlinkTypeSync:oie}});var t3=E((nbe,e3)=>{"use strict";var aie=Fe().fromCallback,Y$=require("path"),Na=pt(),J$=ln(),uie=J$.mkdirs,cie=J$.mkdirsSync,Z$=z$(),lie=Z$.symlinkPaths,fie=Z$.symlinkPathsSync,Q$=W$(),hie=Q$.symlinkType,die=Q$.symlinkTypeSync,X$=Wi().pathExists;function pie(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,X$(e,(i,s)=>{if(i)return n(i);if(s)return n(null);lie(t,e,(o,a)=>{if(o)return n(o);t=a.toDst,hie(a.toCwd,r,(u,c)=>{if(u)return n(u);let l=Y$.dirname(e);X$(l,(h,d)=>{if(h)return n(h);if(d)return Na.symlink(t,e,c,n);uie(l,f=>{if(f)return n(f);Na.symlink(t,e,c,n)})})})})})}function mie(t,e,r){if(Na.existsSync(e))return;let i=fie(t,e);t=i.toDst,r=die(i.toCwd,r);let s=Y$.dirname(e);return Na.existsSync(s)||cie(s),Na.symlinkSync(t,e,r)}e3.exports={createSymlink:aie(pie),createSymlinkSync:mie}});var n3=E((ibe,r3)=>{"use strict";var Yd=j$(),Jd=H$(),Zd=t3();r3.exports={createFile:Yd.createFile,createFileSync:Yd.createFileSync,ensureFile:Yd.createFile,ensureFileSync:Yd.createFileSync,createLink:Jd.createLink,createLinkSync:Jd.createLinkSync,ensureLink:Jd.createLink,ensureLinkSync:Jd.createLinkSync,createSymlink:Zd.createSymlink,createSymlinkSync:Zd.createSymlinkSync,ensureSymlink:Zd.createSymlink,ensureSymlinkSync:Zd.createSymlinkSync}});var s3=E((sbe,i3)=>{"use strict";var Qd=g0();i3.exports={readJson:Qd.readFile,readJsonSync:Qd.readFileSync,writeJson:Qd.writeFile,writeJsonSync:Qd.writeFileSync}});var ep=E((obe,u3)=>{"use strict";var gie=Fe().fromCallback,Mc=pt(),o3=require("path"),a3=ln(),yie=Wi().pathExists;function Die(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=o3.dirname(t);yie(i,(s,o)=>{if(s)return n(s);if(o)return Mc.writeFile(t,e,r,n);a3.mkdirs(i,a=>{if(a)return n(a);Mc.writeFile(t,e,r,n)})})}function wie(t,...e){let r=o3.dirname(t);if(Mc.existsSync(r))return Mc.writeFileSync(t,...e);a3.mkdirsSync(r),Mc.writeFileSync(t,...e)}u3.exports={outputFile:gie(Die),outputFileSync:wie}});var l3=E((abe,c3)=>{"use strict";var{stringify:bie}=ga(),{outputFile:vie}=ep();async function Eie(t,e,r={}){let n=bie(e,r);await vie(t,n,r)}c3.exports=Eie});var h3=E((ube,f3)=>{"use strict";var{stringify:_ie}=ga(),{outputFileSync:Cie}=ep();function Sie(t,e,r){let n=_ie(e,r);Cie(t,n,r)}f3.exports=Sie});var p3=E((cbe,d3)=>{"use strict";var Aie=Fe().fromPromise,ur=s3();ur.outputJson=Aie(l3());ur.outputJsonSync=h3();ur.outputJSON=ur.outputJson;ur.outputJSONSync=ur.outputJsonSync;ur.writeJSON=ur.writeJson;ur.writeJSONSync=ur.writeJsonSync;ur.readJSON=ur.readJson;ur.readJSONSync=ur.readJsonSync;d3.exports=ur});var b3=E((lbe,w3)=>{"use strict";var y3=pt(),Oie=require("path"),xie=Cb().copySync,D3=jc().removeSync,Tie=ln().mkdirpSync,m3=kc();function Fie(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i}=m3.checkPathsSync(t,e,"move");return m3.checkParentPathsSync(t,i,e,"move"),Tie(Oie.dirname(e)),Iie(t,e,n)}function Iie(t,e,r){if(r)return D3(e),g3(t,e,r);if(y3.existsSync(e))throw new Error("dest already exists.");return g3(t,e,r)}function g3(t,e,r){try{y3.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return kie(t,e,r)}}function kie(t,e,r){return xie(t,e,{overwrite:r,errorOnExist:!0}),D3(t)}w3.exports=Fie});var E3=E((fbe,v3)=>{"use strict";v3.exports={moveSync:b3()}});var O3=E((hbe,A3)=>{"use strict";var Pie=pt(),Rie=require("path"),Nie=Ab().copy,S3=jc().remove,$ie=ln().mkdirp,Lie=Wi().pathExists,_3=kc();function jie(t,e,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;_3.checkPaths(t,e,"move",(s,o)=>{if(s)return n(s);let{srcStat:a}=o;_3.checkParentPaths(t,a,e,"move",u=>{if(u)return n(u);$ie(Rie.dirname(e),c=>c?n(c):Bie(t,e,i,n))})})}function Bie(t,e,r,n){if(r)return S3(e,i=>i?n(i):C3(t,e,r,n));Lie(e,(i,s)=>i?n(i):s?n(new Error("dest already exists.")):C3(t,e,r,n))}function C3(t,e,r,n){Pie.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):Mie(t,e,r,n):n())}function Mie(t,e,r,n){Nie(t,e,{overwrite:r,errorOnExist:!0},s=>s?n(s):S3(t,n))}A3.exports=jie});var T3=E((dbe,x3)=>{"use strict";var qie=Fe().fromCallback;x3.exports={move:qie(O3())}});var tp=E((pbe,xb)=>{"use strict";xb.exports={...Ic(),...Cb(),...Ab(),...R$(),...n3(),...p3(),...ln(),...E3(),...T3(),...ep(),...Wi(),...jc()};var F3=require("fs");Object.getOwnPropertyDescriptor(F3,"promises")&&Object.defineProperty(xb.exports,"promises",{get(){return F3.promises}})});var Tb=E($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.readdir=$a.stat=void 0;var I3=tp();async function Uie(t){try{return await I3.stat(t)}catch{}}$a.stat=Uie;async function Hie(t){try{return await I3.readdir(t)}catch{return[]}}$a.readdir=Hie});var L3=E(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.walk=me.Walker=me.compilePaths=me.tmpfilepath=me.findBaseDirectory=me.isExecutableFile=me.pathExecutable=me.pathWritable=me.pathReadable=me.pathExists=me.pathAccessible=me.writeStreamToFile=me.cacheFileChecksum=me.getFileChecksums=me.getFileChecksum=me.fileToString=me.getFileTree=me.readdirp=me.readdirSafe=me.statSafe=void 0;var Vie=(fe(),ue(le)),Gr=tp(),zie=require("os"),fi=require("path"),k3=require("stream"),P3=Tb();Vie.__exportStar(tp(),me);var R3=Tb();Object.defineProperty(me,"statSafe",{enumerable:!0,get:function(){return R3.stat}});Object.defineProperty(me,"readdirSafe",{enumerable:!0,get:function(){return R3.readdir}});async function Gie(t,{filter:e,onError:r,walkerOptions:n}={}){return new Promise((i,s)=>{let o=[],a=Ib(t,n);e&&(a=a.pipe(new k3.Transform({objectMode:!0,transform(u,c,l){(!e||e(u))&&this.push(u),l()}}))),a.on("error",u=>r?r(u):s(u)).on("data",u=>o.push(u.path)).on("end",()=>i(o))})}me.readdirp=Gie;async function Kie(t,{onError:e,onFileNode:r=s=>s,onDirectoryNode:n=s=>s,walkerOptions:i}={}){let s=new Map([]),o=u=>{let c=fi.dirname(u.path),l=s.get(c);return l&&l.type==="directory"?l:n({path:c,type:"directory",children:[]})},a=(u,c)=>{let l={path:u.path,parent:c};return u.stats.isDirectory()?n({...l,type:"directory",children:[]}):r({...l,type:"file"})};return new Promise((u,c)=>{t=fi.resolve(t),Ib(t,i).on("error",h=>e?e(h):c(h)).on("data",h=>{let d=o(h),f=a(h,d);d.children.push(f),s.set(h.path,f),s.set(d.path,d)}).on("end",()=>{let h=s.get(t);if(!h)return c(new Error("No root node found after walking directory structure."));delete h.parent,u(h)})})}me.getFileTree=Kie;async function Wie(t){try{return await Gr.readFile(t,{encoding:"utf8"})}catch(e){if(e.code==="ENOENT"||e.code==="ENOTDIR")return"";throw e}}me.fileToString=Wie;async function Fb(t){let e=await Promise.resolve().then(()=>require("crypto"));return new Promise((r,n)=>{let i=e.createHash("md5"),s=Gr.createReadStream(t);s.on("error",o=>{n(o)}),i.once("readable",()=>{let o=i.read().toString("hex");r(o)}),s.pipe(i)})}me.getFileChecksum=Fb;async function Xie(t){return Promise.all([Fb(t),(async()=>{try{return(await Gr.readFile(`${t}.md5`,{encoding:"utf8"})).trim()}catch(e){if(e.code!=="ENOENT")throw e}})()])}me.getFileChecksums=Xie;async function Yie(t,e){let r=await Fb(t);await Gr.writeFile(`${t}.md5`,r,{encoding:"utf8"})}me.cacheFileChecksum=Yie;function Jie(t,e){return new Promise((r,n)=>{let i=Gr.createWriteStream(e);t.pipe(i),i.on("error",n),i.on("finish",r)})}me.writeStreamToFile=Jie;async function qc(t,e){try{await Gr.access(t,e)}catch{return!1}return!0}me.pathAccessible=qc;async function Zie(t){return qc(t,Gr.constants.F_OK)}me.pathExists=Zie;async function Qie(t){return qc(t,Gr.constants.R_OK)}me.pathReadable=Qie;async function ese(t){return qc(t,Gr.constants.W_OK)}me.pathWritable=ese;async function N3(t){return qc(t,Gr.constants.X_OK)}me.pathExecutable=N3;async function tse(t){let[e,r]=await Promise.all([P3.stat(t),N3(t)]);return!!e&&(e.isFile()||e.isSymbolicLink())&&r}me.isExecutableFile=tse;async function rse(t,e){if(!(!t||!e)){for(let r of $3(t))if((await P3.readdir(r)).includes(e))return r}}me.findBaseDirectory=rse;function nse(t){let e=Math.random().toString(16).substring(2,8);return fi.resolve(zie.tmpdir(),t?`${t}-${e}`:e)}me.tmpfilepath=nse;function $3(t){if(t=fi.normalize(t),!fi.isAbsolute(t))throw new Error(`${t} is not an absolute path`);let e=fi.parse(t);return t===e.root?[t]:t.slice(e.root.length).split(fi.sep).map((r,n,i)=>e.root+fi.join(...i.slice(0,i.length-n))).concat(e.root)}me.compilePaths=$3;var rp=class extends k3.Readable{constructor(e,r={}){super({objectMode:!0}),this.p=e,this.options=r,this.paths=[this.p]}_read(){let e=this.paths.shift(),{pathFilter:r}=this.options;if(!e){this.push(null);return}Gr.lstat(e,(n,i)=>{if(n){this.emit("error",n);return}let s={path:e,stats:i};i.isDirectory()?Gr.readdir(e,(o,a)=>{if(o){this.emit("error",o);return}let u=a.map(c=>fi.join(e,c));r&&(u=u.filter(c=>r(c.substring(this.p.length+1)))),this.paths.push(...u),this.push(s)}):this.push(s)})}};me.Walker=rp;function Ib(t,e={}){return new rp(t,e)}me.walk=Ib});var j3=E(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.AliasedMap=hi.CaseInsensitiveProxyHandler=hi.createCaseInsensitiveObject=void 0;function ise(){return new Proxy({},hi.CaseInsensitiveProxyHandler)}hi.createCaseInsensitiveObject=ise;hi.CaseInsensitiveProxyHandler={has:(t,e)=>np(e)in t,get:(t,e)=>t[np(e)],set:(t,e,r)=>(t[np(e)]=r,!0),deleteProperty:(t,e)=>delete t[np(e)]};var np=t=>typeof t=="string"?t.toLowerCase():t,kb=class extends Map{getAliases(){let e=new Map;return[...this.entries()].filter(([,n])=>typeof n=="string"||typeof n=="symbol").forEach(([n,i])=>{let s=e.get(i)||[];s.push(n),e.set(i,s)}),e}resolveAlias(e){let r=this.get(e);return typeof r!="string"&&typeof r!="symbol"?r:this.resolveAlias(r)}keysWithoutAliases(){return[...this.entries()].filter(e=>typeof e[1]!="string"&&typeof e[1]!="symbol").map(([e,r])=>e)}};hi.AliasedMap=kb});var V3=E((Dbe,H3)=>{"use strict";var U3=require("child_process"),B3=U3.spawn,sse=U3.exec;H3.exports=function(t,e,r){if(typeof e=="function"&&r===void 0&&(r=e,e=void 0),t=parseInt(t),Number.isNaN(t)){if(r)return r(new Error("pid must be a number"));throw new Error("pid must be a number")}var n={},i={};switch(n[t]=[],i[t]=1,process.platform){case"win32":sse("taskkill /pid "+t+" /T /F",r);break;case"darwin":Pb(t,n,i,function(s){return B3("pgrep",["-P",s])},function(){M3(n,e,r)});break;default:Pb(t,n,i,function(s){return B3("ps",["-o","pid","--no-headers","--ppid",s])},function(){M3(n,e,r)});break}};function M3(t,e,r){var n={};try{Object.keys(t).forEach(function(i){t[i].forEach(function(s){n[s]||(q3(s,e),n[s]=1)}),n[i]||(q3(i,e),n[i]=1)})}catch(i){if(r)return r(i);throw i}if(r)return r()}function q3(t,e){try{process.kill(parseInt(t,10),e)}catch(r){if(r.code!=="ESRCH")throw r}}function Pb(t,e,r,n,i){var s=n(t),o="";s.stdout.on("data",function(c){var c=c.toString("ascii");o+=c});var a=function(u){if(delete r[t],u!=0){Object.keys(r).length==0&&i();return}o.match(/\d+/g).forEach(function(c){c=parseInt(c,10),e[t].push(c),e[c]=[],r[c]=1,Pb(c,e,r,n,i)})};s.on("close",a)}});var K3=E(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.processExit=Ye.offBeforeExit=Ye.onBeforeExit=Ye.onExit=Ye.sleepForever=Ye.sleepUntil=Ye.sleep=Ye.getPathParts=Ye.createProcessEnv=Ye.killProcessTree=Ye.ERROR_TIMEOUT_REACHED=void 0;var Rb=(fe(),ue(le)),ose=j3(),ase=Bi(),use=Bh(),cse=Rb.__importStar(require("path")),lse=Rb.__importDefault(Th()),fse=Rb.__importDefault(V3()),Qs=(0,use.debug)("ionic:utils-process");Ye.ERROR_TIMEOUT_REACHED=new Error("TIMEOUT_REACHED");function hse(t,e="SIGTERM"){return new Promise((r,n)=>{(0,fse.default)(t,e,i=>{if(i)return Qs("error while killing process tree for %d: %O",t,i),n(i);r()})})}Ye.killProcessTree=hse;function dse(...t){return Object.assign(ase.TERMINAL_INFO.windows?(0,ose.createCaseInsensitiveObject)():{},...t)}Ye.createProcessEnv=dse;function pse(t=process.env.PATH||""){return t.split(cse.delimiter)}Ye.getPathParts=pse;async function z3(t){return new Promise(e=>{setTimeout(e,t)})}Ye.sleep=z3;async function mse(t,{interval:e=30,timeout:r=1/0}){let n=0;for(;!t();)if(await z3(e),n+=e,n>r)throw Ye.ERROR_TIMEOUT_REACHED}Ye.sleepUntil=mse;async function gse(){return new Promise(()=>{setInterval(()=>{},1e3)})}Ye.sleepForever=gse;function yse(t){(0,lse.default)(()=>{Qs("onExit: process.exit/normal shutdown"),t()})}Ye.onExit=yse;var ip=new Set;function Dse(t){ip.add(t)}Ye.onBeforeExit=Dse;function wse(t){ip.delete(t)}Ye.offBeforeExit=wse;var bse=t=>{let e=!1;return async()=>{e||(await t(),e=!0)}},Uc=t=>bse(async()=>{Qs("onBeforeExit handler: %O received",t),Qs("onBeforeExit handler: running %O functions",ip.size),await Promise.all([...ip.values()].map(async e=>{try{await e()}catch(r){Qs("onBeforeExit handler: error from function: %O",r)}})),t!=="process.exit"&&(Qs("onBeforeExit handler: killing self (exit code %O, signal %O)",process.exitCode?process.exitCode:0,t),process.removeListener(t,G3[t]),process.kill(process.pid,t))}),G3={SIGINT:Uc("SIGINT"),SIGTERM:Uc("SIGTERM"),SIGHUP:Uc("SIGHUP"),SIGBREAK:Uc("SIGBREAK")};for(let[t,e]of Object.entries(G3))process.on(t,e);var vse=Uc("process.exit");async function Ese(t=0){process.exitCode=t,await vse(),Qs("processExit: exiting (exit code: %O)",process.exitCode),process.exit()}Ye.processExit=Ese});var Y3=E(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.growBufferForAppendedData=Pn.WritableStreamBuffer=Pn.ReadableStreamBuffer=Pn.NullStream=void 0;var jb=require("stream"),_se=4,W3=32,X3=16,Nb=class extends jb.Writable{_write(e,r,n){n()}};Pn.NullStream=Nb;var $b=class extends jb.Readable{constructor(e){super(e),this._size=0,this._stopped=!1,this.buffer=Buffer.alloc(e&&e.allocSize?e.allocSize:W3),this.chunkSize=e&&e.chunkSize?e.chunkSize:_se,this.growSize=e&&e.growSize?e.growSize:X3}get size(){return this._size}get stopped(){return this._stopped}_read(){this._send()}feed(e,r="utf8"){if(this._stopped)throw new Error("ReadableStreamBuffer is stopped. Can no longer feed.");let n=typeof e=="string"?Buffer.byteLength(e):e.length;this.buffer=Bb(this.buffer,this._size,Math.ceil(n/this.growSize)*this.growSize),typeof e=="string"?this.buffer.write(e,this._size,n,r):this.buffer.copy(e,this._size,0),this._size+=n}stop(){this._stopped||(this._stopped=!0,this._size===0&&this.push(null))}_send(){let e=Math.min(this.chunkSize,this._size),r=!1;if(e>0){let n=Buffer.alloc(e);this.buffer.copy(n,0,0,e),r=!this.push(n),this.buffer.copy(this.buffer,0,e,this._size),this._size-=e}this._size===0&&this._stopped&&this.push(null),r||setTimeout(()=>this._send(),1)}};Pn.ReadableStreamBuffer=$b;var Lb=class extends jb.Writable{constructor(e){super(e),this._size=0,this.buffer=Buffer.alloc(e&&e.allocSize?e.allocSize:W3),this.growSize=e&&e.growSize?e.growSize:X3}get size(){return this._size}_write(e,r,n){this.buffer=Bb(this.buffer,this._size,Math.ceil(e.length/this.growSize)*this.growSize),e.copy(this.buffer,this._size,0),this._size+=e.length,n()}consume(e){e=typeof e=="number"?e:this._size;let r=Buffer.alloc(e);return this.buffer.copy(r,0,0,r.length),this.buffer.copy(this.buffer,0,r.length),this._size-=r.length,r}};Pn.WritableStreamBuffer=Lb;function Bb(t,e,r){if(t.length-e>=r)return t;let n=Buffer.alloc(t.length+r);return t.copy(n,0,0,e),n}Pn.growBufferForAppendedData=Bb});var tL=E((vbe,eL)=>{eL.exports=Q3;Q3.sync=Sse;var J3=require("fs");function Cse(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function Z3(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:Cse(e,r)}function Q3(t,e,r){J3.stat(t,function(n,i){r(n,n?!1:Z3(i,t,e))})}function Sse(t,e){return Z3(J3.statSync(t),t,e)}});var oL=E((Ebe,sL)=>{sL.exports=nL;nL.sync=Ase;var rL=require("fs");function nL(t,e,r){rL.stat(t,function(n,i){r(n,n?!1:iL(i,e))})}function Ase(t,e){return iL(rL.statSync(t),e)}function iL(t,e){return t.isFile()&&Ose(t,e)}function Ose(t,e){var r=t.mode,n=t.uid,i=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,h=r&c||r&u&&i===o||r&a&&n===s||r&l&&s===0;return h}});var uL=E((Cbe,aL)=>{var _be=require("fs"),sp;process.platform==="win32"||global.TESTING_WINDOWS?sp=tL():sp=oL();aL.exports=Mb;Mb.sync=xse;function Mb(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){Mb(t,e||{},function(s,o){s?i(s):n(o)})})}sp(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function xse(t,e){try{return sp.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var mL=E((Sbe,pL)=>{var La=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",cL=require("path"),Tse=La?";":":",lL=uL(),fL=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),hL=(t,e)=>{let r=e.colon||Tse,n=t.match(/\//)||La&&t.match(/\\/)?[""]:[...La?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=La?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=La?i.split(r):[""];return La&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:i}},dL=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:s}=hL(t,e),o=[],a=c=>new Promise((l,h)=>{if(c===n.length)return e.all&&o.length?l(o):h(fL(t));let d=n[c],f=/^".*"$/.test(d)?d.slice(1,-1):d,m=cL.join(f,t),g=!f&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;l(u(g,c,0))}),u=(c,l,h)=>new Promise((d,f)=>{if(h===i.length)return d(a(l+1));let m=i[h];lL(c+m,{pathExt:s},(g,b)=>{if(!g&&b)if(e.all)o.push(c+m);else return d(c+m);return d(u(c,l,h+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},Fse=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=hL(t,e),s=[];for(let o=0;o<r.length;o++){let a=r[o],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=cL.join(u,t),l=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let h=0;h<n.length;h++){let d=l+n[h];try{if(lL.sync(d,{pathExt:i}))if(e.all)s.push(d);else return d}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw fL(t)};pL.exports=dL;dL.sync=Fse});var yL=E((Abe,qb)=>{"use strict";var gL=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};qb.exports=gL;qb.exports.default=gL});var vL=E((Obe,bL)=>{"use strict";var DL=require("path"),Ise=mL(),kse=yL();function wL(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,s=i&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let o;try{o=Ise.sync(t.command,{path:r[kse({env:r})],pathExt:e?DL.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return o&&(o=DL.resolve(i?t.options.cwd:"",o)),o}function Pse(t){return wL(t)||wL(t,!0)}bL.exports=Pse});var EL=E((xbe,Hb)=>{"use strict";var Ub=/([()\][%!^"`<>&|;, *?])/g;function Rse(t){return t=t.replace(Ub,"^$1"),t}function Nse(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Ub,"^$1"),e&&(t=t.replace(Ub,"^$1")),t}Hb.exports.command=Rse;Hb.exports.argument=Nse});var CL=E((Tbe,_L)=>{"use strict";_L.exports=/^#!(.*)/});var AL=E((Fbe,SL)=>{"use strict";var $se=CL();SL.exports=(t="")=>{let e=t.match($se);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var xL=E((Ibe,OL)=>{"use strict";var Vb=require("fs"),Lse=AL();function jse(t){let r=Buffer.alloc(150),n;try{n=Vb.openSync(t,"r"),Vb.readSync(n,r,0,150,0),Vb.closeSync(n)}catch{}return Lse(r.toString())}OL.exports=jse});var kL=E((kbe,IL)=>{"use strict";var Bse=require("path"),TL=vL(),FL=EL(),Mse=xL(),qse=process.platform==="win32",Use=/\.(?:com|exe)$/i,Hse=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Vse(t){t.file=TL(t);let e=t.file&&Mse(t.file);return e?(t.args.unshift(t.file),t.command=e,TL(t)):t.file}function zse(t){if(!qse)return t;let e=Vse(t),r=!Use.test(e);if(t.options.forceShell||r){let n=Hse.test(e);t.command=Bse.normalize(t.command),t.command=FL.command(t.command),t.args=t.args.map(s=>FL.argument(s,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function Gse(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:zse(n)}IL.exports=Gse});var NL=E((Pbe,RL)=>{"use strict";var zb=process.platform==="win32";function Gb(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function Kse(t,e){if(!zb)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let s=PL(i,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}function PL(t,e){return zb&&t===1&&!e.file?Gb(e.original,"spawn"):null}function Wse(t,e){return zb&&t===1&&!e.file?Gb(e.original,"spawnSync"):null}RL.exports={hookChildProcess:Kse,verifyENOENT:PL,verifyENOENTSync:Wse,notFoundError:Gb}});var jL=E((Rbe,ja)=>{"use strict";var $L=require("child_process"),Kb=kL(),Wb=NL();function LL(t,e,r){let n=Kb(t,e,r),i=$L.spawn(n.command,n.args,n.options);return Wb.hookChildProcess(i,n),i}function Xse(t,e,r){let n=Kb(t,e,r),i=$L.spawnSync(n.command,n.args,n.options);return i.error=i.error||Wb.verifyENOENTSync(i.status,n),i}ja.exports=LL;ja.exports.spawn=LL;ja.exports.sync=Xse;ja.exports._parse=Kb;ja.exports._enoent=Wb});var zL=E(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.findExecutables=Ie.which=Ie.fork=Ie.spawn=Ie.Subprocess=Ie.SubprocessError=Ie.convertPATH=Ie.expandTildePath=Ie.TILDE_PATH_REGEX=Ie.ERROR_SIGNAL_EXIT=Ie.ERROR_NON_ZERO_EXIT=Ie.ERROR_COMMAND_NOT_FOUND=void 0;var Jb=(fe(),ue(le)),BL=jN(),Yse=L3(),Xb=K3(),op=Y3(),ML=Bi(),Jse=require("child_process"),Zse=Jb.__importDefault(jL()),Qse=Jb.__importStar(require("os")),to=Jb.__importStar(require("path"));Ie.ERROR_COMMAND_NOT_FOUND="ERR_SUBPROCESS_COMMAND_NOT_FOUND";Ie.ERROR_NON_ZERO_EXIT="ERR_SUBPROCESS_NON_ZERO_EXIT";Ie.ERROR_SIGNAL_EXIT="ERR_SUBPROCESS_SIGNAL_EXIT";Ie.TILDE_PATH_REGEX=/^~($|\/|\\)/;function qL(t){let e=Qse.homedir();return t.replace(Ie.TILDE_PATH_REGEX,`${e}$1`)}Ie.expandTildePath=qL;function UL(t=process.env.PATH||""){return t.split(to.delimiter).map(qL).join(to.delimiter)}Ie.convertPATH=UL;var eo=class extends Error{constructor(){super(...arguments),this.name="SubprocessError"}};Ie.SubprocessError=eo;var Yb=class{constructor(e,r,n={}){this.name=e,this.args=r;let i=this.maskArg(e);i!==e&&(this.name=i,this.path=e),this._options=n}get options(){let e=this._options;e.env||(e.env=process.env);let r=(0,Xb.createProcessEnv)(e.env||{},{PATH:UL(typeof e.env.PATH=="string"?e.env.PATH:process.env.PATH)});return{...e,env:r}}async output(){this._options.stdio="pipe";let e=this.run(),r=new op.WritableStreamBuffer,n=new op.WritableStreamBuffer,i=new op.WritableStreamBuffer;e.p.stdout?.pipe(r),e.p.stdout?.pipe(i),e.p.stderr?.pipe(n),e.p.stderr?.pipe(i);try{await e}catch(s){throw r.end(),n.end(),s.output=i.consume().toString(),s}return n.end(),i.end(),r.consume().toString()}async combinedOutput(){this._options.stdio="pipe";let e=this.run(),r=new op.WritableStreamBuffer;e.p.stdout?.pipe(r),e.p.stderr?.pipe(r);try{await e}catch(n){throw n.output=r.consume().toString(),n}return r.consume().toString()}run(){let e=this.spawn(),r=new Promise((n,i)=>{e.on("error",s=>{let o;s.code==="ENOENT"?(o=new eo("Command not found.",{cause:s}),o.code=Ie.ERROR_COMMAND_NOT_FOUND):o=new eo("Command error.",{cause:s}),i(o)}),e.on("close",(s,o)=>{let a;if(s===0)return n();if(o)a=new eo("Signal exit from subprocess."),a.code=Ie.ERROR_SIGNAL_EXIT,a.signal=o;else if(s)a=new eo("Non-zero exit from subprocess."),a.code=Ie.ERROR_NON_ZERO_EXIT,a.exitCode=s;else return n();i(a)})});return Object.defineProperties(r,{p:{value:e}}),r}spawn(){return HL(this.path?this.path:this.name,this.args,this.options)}bashify({maskArgv0:e=!0,maskArgv1:r=!1,shiftArgv0:n=!1}={}){let i=[this.path?this.path:this.name,...this.args];return n&&i.shift(),i[0]&&e&&(i[0]=this.maskArg(i[0])),i[1]&&r&&(i[1]=this.maskArg(i[1])),i.length>0?i.map(s=>this.bashifyArg(s)).join(" "):""}bashifyArg(e){return e.includes(" ")?`"${e.replace(/\"/g,'\\"')}"`:e}maskArg(e){let r=e.lastIndexOf(to.sep);return r>=0?e.substring(r+1):e}};Ie.Subprocess=Yb;function HL(t,e=[],r){return(0,Zse.default)(t,[...e],r)}Ie.spawn=HL;function eoe(t,e=[],r={}){return(0,Jse.fork)(t,[...e],r)}Ie.fork=eoe;var Zb=ML.TERMINAL_INFO.windows?".COM;.EXE;.BAT;.CMD":void 0;async function toe(t,{PATH:e=process.env.PATH,PATHEXT:r=process.env.PATHEXT||Zb}={}){if(t.includes(to.sep))return t;let n=await VL(t,{PATH:e});if(!n.length){let i=new Error(`${t} cannot be found within PATH`);throw i.code="ENOENT",i}return n[0]}Ie.which=toe;async function roe(t,{PATH:e=process.env.PATH,PATHEXT:r=process.env.PATHEXT||Zb}={}){return t.includes(to.sep)?[t]:VL(t,{PATH:e})}Ie.findExecutables=roe;async function VL(t,{PATH:e=process.env.PATH,PATHEXT:r=process.env.PATHEXT||Zb}={}){let n=(0,Xb.getPathParts)(e),i;if(ML.TERMINAL_INFO.windows){let s=(0,Xb.getPathParts)(r).map(o=>o.toLowerCase());i=s.includes(to.extname(t).toLowerCase())?[t]:s.map(o=>t+o)}else i=[t];return[].concat(...await(0,BL.map)(i,async s=>(0,BL.concurrentFilter)(n.map(o=>to.join(o,s)),async o=>(0,Yse.isExecutableFile)(o))))}});var ap=E(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.isInstalled=Ji.getCommandOutput=Ji.runCommand=void 0;var Qb=zL();async function GL(t,e,r={}){let n=new Qb.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof Qb.SubprocessError?i.output?i.output:i.cause?`${i.message} ${i.cause.toString()}`:i.code?i.code:"Unknown error":i}}Ji.runCommand=GL;async function noe(t,e,r={}){try{return(await GL(t,e,r)).trim()}catch{return null}}Ji.getCommandOutput=noe;async function ioe(t){try{await(0,Qb.which)(t)}catch{return!1}return!0}Ji.isInstalled=ioe});var Hc=E((Lbe,KL)=>{"use strict";var soe="2.0.0",ooe=Number.MAX_SAFE_INTEGER||9007199254740991,aoe=16,uoe=250,coe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];KL.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:aoe,MAX_SAFE_BUILD_LENGTH:uoe,MAX_SAFE_INTEGER:ooe,RELEASE_TYPES:coe,SEMVER_SPEC_VERSION:soe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Vc=E((jbe,WL)=>{"use strict";var loe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};WL.exports=loe});var Ba=E((Rn,XL)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ev,MAX_SAFE_BUILD_LENGTH:foe,MAX_LENGTH:hoe}=Hc(),doe=Vc();Rn=XL.exports={};var poe=Rn.re=[],moe=Rn.safeRe=[],J=Rn.src=[],goe=Rn.safeSrc=[],Z=Rn.t={},yoe=0,tv="[a-zA-Z0-9-]",Doe=[["\\s",1],["\\d",hoe],[tv,foe]],woe=t=>{for(let[e,r]of Doe)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ge=(t,e,r)=>{let n=woe(e),i=yoe++;doe(t,i,e),Z[t]=i,J[i]=e,goe[i]=n,poe[i]=new RegExp(e,r?"g":void 0),moe[i]=new RegExp(n,r?"g":void 0)};ge("NUMERICIDENTIFIER","0|[1-9]\\d*");ge("NUMERICIDENTIFIERLOOSE","\\d+");ge("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${tv}*`);ge("MAINVERSION",`(${J[Z.NUMERICIDENTIFIER]})\\.(${J[Z.NUMERICIDENTIFIER]})\\.(${J[Z.NUMERICIDENTIFIER]})`);ge("MAINVERSIONLOOSE",`(${J[Z.NUMERICIDENTIFIERLOOSE]})\\.(${J[Z.NUMERICIDENTIFIERLOOSE]})\\.(${J[Z.NUMERICIDENTIFIERLOOSE]})`);ge("PRERELEASEIDENTIFIER",`(?:${J[Z.NONNUMERICIDENTIFIER]}|${J[Z.NUMERICIDENTIFIER]})`);ge("PRERELEASEIDENTIFIERLOOSE",`(?:${J[Z.NONNUMERICIDENTIFIER]}|${J[Z.NUMERICIDENTIFIERLOOSE]})`);ge("PRERELEASE",`(?:-(${J[Z.PRERELEASEIDENTIFIER]}(?:\\.${J[Z.PRERELEASEIDENTIFIER]})*))`);ge("PRERELEASELOOSE",`(?:-?(${J[Z.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${J[Z.PRERELEASEIDENTIFIERLOOSE]})*))`);ge("BUILDIDENTIFIER",`${tv}+`);ge("BUILD",`(?:\\+(${J[Z.BUILDIDENTIFIER]}(?:\\.${J[Z.BUILDIDENTIFIER]})*))`);ge("FULLPLAIN",`v?${J[Z.MAINVERSION]}${J[Z.PRERELEASE]}?${J[Z.BUILD]}?`);ge("FULL",`^${J[Z.FULLPLAIN]}$`);ge("LOOSEPLAIN",`[v=\\s]*${J[Z.MAINVERSIONLOOSE]}${J[Z.PRERELEASELOOSE]}?${J[Z.BUILD]}?`);ge("LOOSE",`^${J[Z.LOOSEPLAIN]}$`);ge("GTLT","((?:<|>)?=?)");ge("XRANGEIDENTIFIERLOOSE",`${J[Z.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ge("XRANGEIDENTIFIER",`${J[Z.NUMERICIDENTIFIER]}|x|X|\\*`);ge("XRANGEPLAIN",`[v=\\s]*(${J[Z.XRANGEIDENTIFIER]})(?:\\.(${J[Z.XRANGEIDENTIFIER]})(?:\\.(${J[Z.XRANGEIDENTIFIER]})(?:${J[Z.PRERELEASE]})?${J[Z.BUILD]}?)?)?`);ge("XRANGEPLAINLOOSE",`[v=\\s]*(${J[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${J[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${J[Z.XRANGEIDENTIFIERLOOSE]})(?:${J[Z.PRERELEASELOOSE]})?${J[Z.BUILD]}?)?)?`);ge("XRANGE",`^${J[Z.GTLT]}\\s*${J[Z.XRANGEPLAIN]}$`);ge("XRANGELOOSE",`^${J[Z.GTLT]}\\s*${J[Z.XRANGEPLAINLOOSE]}$`);ge("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ev}})(?:\\.(\\d{1,${ev}}))?(?:\\.(\\d{1,${ev}}))?`);ge("COERCE",`${J[Z.COERCEPLAIN]}(?:$|[^\\d])`);ge("COERCEFULL",J[Z.COERCEPLAIN]+`(?:${J[Z.PRERELEASE]})?(?:${J[Z.BUILD]})?(?:$|[^\\d])`);ge("COERCERTL",J[Z.COERCE],!0);ge("COERCERTLFULL",J[Z.COERCEFULL],!0);ge("LONETILDE","(?:~>?)");ge("TILDETRIM",`(\\s*)${J[Z.LONETILDE]}\\s+`,!0);Rn.tildeTrimReplace="$1~";ge("TILDE",`^${J[Z.LONETILDE]}${J[Z.XRANGEPLAIN]}$`);ge("TILDELOOSE",`^${J[Z.LONETILDE]}${J[Z.XRANGEPLAINLOOSE]}$`);ge("LONECARET","(?:\\^)");ge("CARETTRIM",`(\\s*)${J[Z.LONECARET]}\\s+`,!0);Rn.caretTrimReplace="$1^";ge("CARET",`^${J[Z.LONECARET]}${J[Z.XRANGEPLAIN]}$`);ge("CARETLOOSE",`^${J[Z.LONECARET]}${J[Z.XRANGEPLAINLOOSE]}$`);ge("COMPARATORLOOSE",`^${J[Z.GTLT]}\\s*(${J[Z.LOOSEPLAIN]})$|^$`);ge("COMPARATOR",`^${J[Z.GTLT]}\\s*(${J[Z.FULLPLAIN]})$|^$`);ge("COMPARATORTRIM",`(\\s*)${J[Z.GTLT]}\\s*(${J[Z.LOOSEPLAIN]}|${J[Z.XRANGEPLAIN]})`,!0);Rn.comparatorTrimReplace="$1$2$3";ge("HYPHENRANGE",`^\\s*(${J[Z.XRANGEPLAIN]})\\s+-\\s+(${J[Z.XRANGEPLAIN]})\\s*$`);ge("HYPHENRANGELOOSE",`^\\s*(${J[Z.XRANGEPLAINLOOSE]})\\s+-\\s+(${J[Z.XRANGEPLAINLOOSE]})\\s*$`);ge("STAR","(<|>)?=?\\s*\\*");ge("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ge("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var up=E((Bbe,YL)=>{"use strict";var boe=Object.freeze({loose:!0}),voe=Object.freeze({}),Eoe=t=>t?typeof t!="object"?boe:t:voe;YL.exports=Eoe});var rv=E((Mbe,QL)=>{"use strict";var JL=/^[0-9]+$/,ZL=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=JL.test(t),n=JL.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},_oe=(t,e)=>ZL(e,t);QL.exports={compareIdentifiers:ZL,rcompareIdentifiers:_oe}});var Wt=E((qbe,tj)=>{"use strict";var cp=Vc(),{MAX_LENGTH:ej,MAX_SAFE_INTEGER:lp}=Hc(),{safeRe:fp,t:hp}=Ba(),Coe=up(),{compareIdentifiers:nv}=rv(),iv=class t{constructor(e,r){if(r=Coe(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ej)throw new TypeError(`version is longer than ${ej} characters`);cp("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?fp[hp.LOOSE]:fp[hp.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>lp||this.major<0)throw new TypeError("Invalid major version");if(this.minor>lp||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>lp||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<lp)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(cp("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(cp("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return nv(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(cp("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return nv(n,i)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?fp[hp.PRERELEASELOOSE]:fp[hp.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),nv(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};tj.exports=iv});var ro=E((Ube,nj)=>{"use strict";var rj=Wt(),Soe=(t,e,r=!1)=>{if(t instanceof rj)return t;try{return new rj(t,e)}catch(n){if(!r)return null;throw n}};nj.exports=Soe});var sj=E((Hbe,ij)=>{"use strict";var Aoe=ro(),Ooe=(t,e)=>{let r=Aoe(t,e);return r?r.version:null};ij.exports=Ooe});var aj=E((Vbe,oj)=>{"use strict";var xoe=ro(),Toe=(t,e)=>{let r=xoe(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};oj.exports=Toe});var lj=E((zbe,cj)=>{"use strict";var uj=Wt(),Foe=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new uj(t instanceof uj?t.version:t,r).inc(e,n,i).version}catch{return null}};cj.exports=Foe});var dj=E((Gbe,hj)=>{"use strict";var fj=ro(),Ioe=(t,e)=>{let r=fj(t,null,!0),n=fj(e,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,a=s?n:r,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};hj.exports=Ioe});var mj=E((Kbe,pj)=>{"use strict";var koe=Wt(),Poe=(t,e)=>new koe(t,e).major;pj.exports=Poe});var yj=E((Wbe,gj)=>{"use strict";var Roe=Wt(),Noe=(t,e)=>new Roe(t,e).minor;gj.exports=Noe});var wj=E((Xbe,Dj)=>{"use strict";var $oe=Wt(),Loe=(t,e)=>new $oe(t,e).patch;Dj.exports=Loe});var vj=E((Ybe,bj)=>{"use strict";var joe=ro(),Boe=(t,e)=>{let r=joe(t,e);return r&&r.prerelease.length?r.prerelease:null};bj.exports=Boe});var Kr=E((Jbe,_j)=>{"use strict";var Ej=Wt(),Moe=(t,e,r)=>new Ej(t,r).compare(new Ej(e,r));_j.exports=Moe});var Sj=E((Zbe,Cj)=>{"use strict";var qoe=Kr(),Uoe=(t,e,r)=>qoe(e,t,r);Cj.exports=Uoe});var Oj=E((Qbe,Aj)=>{"use strict";var Hoe=Kr(),Voe=(t,e)=>Hoe(t,e,!0);Aj.exports=Voe});var dp=E((eve,Tj)=>{"use strict";var xj=Wt(),zoe=(t,e,r)=>{let n=new xj(t,r),i=new xj(e,r);return n.compare(i)||n.compareBuild(i)};Tj.exports=zoe});var Ij=E((tve,Fj)=>{"use strict";var Goe=dp(),Koe=(t,e)=>t.sort((r,n)=>Goe(r,n,e));Fj.exports=Koe});var Pj=E((rve,kj)=>{"use strict";var Woe=dp(),Xoe=(t,e)=>t.sort((r,n)=>Woe(n,r,e));kj.exports=Xoe});var zc=E((nve,Rj)=>{"use strict";var Yoe=Kr(),Joe=(t,e,r)=>Yoe(t,e,r)>0;Rj.exports=Joe});var pp=E((ive,Nj)=>{"use strict";var Zoe=Kr(),Qoe=(t,e,r)=>Zoe(t,e,r)<0;Nj.exports=Qoe});var sv=E((sve,$j)=>{"use strict";var eae=Kr(),tae=(t,e,r)=>eae(t,e,r)===0;$j.exports=tae});var ov=E((ove,Lj)=>{"use strict";var rae=Kr(),nae=(t,e,r)=>rae(t,e,r)!==0;Lj.exports=nae});var mp=E((ave,jj)=>{"use strict";var iae=Kr(),sae=(t,e,r)=>iae(t,e,r)>=0;jj.exports=sae});var gp=E((uve,Bj)=>{"use strict";var oae=Kr(),aae=(t,e,r)=>oae(t,e,r)<=0;Bj.exports=aae});var av=E((cve,Mj)=>{"use strict";var uae=sv(),cae=ov(),lae=zc(),fae=mp(),hae=pp(),dae=gp(),pae=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return uae(t,r,n);case"!=":return cae(t,r,n);case">":return lae(t,r,n);case">=":return fae(t,r,n);case"<":return hae(t,r,n);case"<=":return dae(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Mj.exports=pae});var Uj=E((lve,qj)=>{"use strict";var mae=Wt(),gae=ro(),{safeRe:yp,t:Dp}=Ba(),yae=(t,e)=>{if(t instanceof mae)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?yp[Dp.COERCEFULL]:yp[Dp.COERCE]);else{let u=e.includePrerelease?yp[Dp.COERCERTLFULL]:yp[Dp.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return gae(`${n}.${i}.${s}${o}${a}`,e)};qj.exports=yae});var Vj=E((fve,Hj)=>{"use strict";var uv=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};Hj.exports=uv});var Wr=E((hve,Wj)=>{"use strict";var Dae=/\s+/g,cv=class t{constructor(e,r){if(r=bae(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof lv)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Dae," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!Gj(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Oae(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&Sae)|(this.options.loose&&Aae))+":"+e,i=zj.get(n);if(i)return i;let s=this.options.loose,o=s?cr[Xt.HYPHENRANGELOOSE]:cr[Xt.HYPHENRANGE];e=e.replace(o,Lae(this.options.includePrerelease)),Je("hyphen replace",e),e=e.replace(cr[Xt.COMPARATORTRIM],Eae),Je("comparator trim",e),e=e.replace(cr[Xt.TILDETRIM],_ae),Je("tilde trim",e),e=e.replace(cr[Xt.CARETTRIM],Cae),Je("caret trim",e);let a=e.split(" ").map(h=>xae(h,this.options)).join(" ").split(/\s+/).map(h=>$ae(h,this.options));s&&(a=a.filter(h=>(Je("loose invalid filter",h,this.options),!!h.match(cr[Xt.COMPARATORLOOSE])))),Je("range list",a);let u=new Map,c=a.map(h=>new lv(h,this.options));for(let h of c){if(Gj(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return zj.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Kj(n,r)&&e.set.some(i=>Kj(i,r)&&n.every(s=>i.every(o=>s.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new vae(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(jae(this.set[r],e,this.options))return!0;return!1}};Wj.exports=cv;var wae=Vj(),zj=new wae,bae=up(),lv=Gc(),Je=Vc(),vae=Wt(),{safeRe:cr,t:Xt,comparatorTrimReplace:Eae,tildeTrimReplace:_ae,caretTrimReplace:Cae}=Ba(),{FLAG_INCLUDE_PRERELEASE:Sae,FLAG_LOOSE:Aae}=Hc(),Gj=t=>t.value==="<0.0.0-0",Oae=t=>t.value==="",Kj=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(s=>i.intersects(s,e)),i=n.pop();return r},xae=(t,e)=>(t=t.replace(cr[Xt.BUILD],""),Je("comp",t,e),t=Iae(t,e),Je("caret",t),t=Tae(t,e),Je("tildes",t),t=Pae(t,e),Je("xrange",t),t=Nae(t,e),Je("stars",t),t),lr=t=>!t||t.toLowerCase()==="x"||t==="*",Tae=(t,e)=>t.trim().split(/\s+/).map(r=>Fae(r,e)).join(" "),Fae=(t,e)=>{let r=e.loose?cr[Xt.TILDELOOSE]:cr[Xt.TILDE];return t.replace(r,(n,i,s,o,a)=>{Je("tilde",t,n,i,s,o,a);let u;return lr(i)?u="":lr(s)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:lr(o)?u=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:a?(Je("replaceTilde pr",a),u=`>=${i}.${s}.${o}-${a} <${i}.${+s+1}.0-0`):u=`>=${i}.${s}.${o} <${i}.${+s+1}.0-0`,Je("tilde return",u),u})},Iae=(t,e)=>t.trim().split(/\s+/).map(r=>kae(r,e)).join(" "),kae=(t,e)=>{Je("caret",t,e);let r=e.loose?cr[Xt.CARETLOOSE]:cr[Xt.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,s,o,a,u)=>{Je("caret",t,i,s,o,a,u);let c;return lr(s)?c="":lr(o)?c=`>=${s}.0.0${n} <${+s+1}.0.0-0`:lr(a)?s==="0"?c=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:u?(Je("replaceCaret pr",u),s==="0"?o==="0"?c=`>=${s}.${o}.${a}-${u} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}-${u} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a}-${u} <${+s+1}.0.0-0`):(Je("no pr"),s==="0"?o==="0"?c=`>=${s}.${o}.${a}${n} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}${n} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),Je("caret return",c),c})},Pae=(t,e)=>(Je("replaceXRanges",t,e),t.split(/\s+/).map(r=>Rae(r,e)).join(" ")),Rae=(t,e)=>{t=t.trim();let r=e.loose?cr[Xt.XRANGELOOSE]:cr[Xt.XRANGE];return t.replace(r,(n,i,s,o,a,u)=>{Je("xRange",t,n,i,s,o,a,u);let c=lr(s),l=c||lr(o),h=l||lr(a),d=h;return i==="="&&d&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&d?(l&&(o=0),a=0,i===">"?(i=">=",l?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",l?s=+s+1:o=+o+1),i==="<"&&(u="-0"),n=`${i+s}.${o}.${a}${u}`):l?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),Je("xRange return",n),n})},Nae=(t,e)=>(Je("replaceStars",t,e),t.trim().replace(cr[Xt.STAR],"")),$ae=(t,e)=>(Je("replaceGTE0",t,e),t.trim().replace(cr[e.includePrerelease?Xt.GTE0PRE:Xt.GTE0],"")),Lae=t=>(e,r,n,i,s,o,a,u,c,l,h,d)=>(lr(n)?r="":lr(i)?r=`>=${n}.0.0${t?"-0":""}`:lr(s)?r=`>=${n}.${i}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,lr(c)?u="":lr(l)?u=`<${+c+1}.0.0-0`:lr(h)?u=`<${c}.${+l+1}.0-0`:d?u=`<=${c}.${l}.${h}-${d}`:t?u=`<${c}.${l}.${+h+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),jae=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Je(t[n].semver),t[n].semver!==lv.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Gc=E((dve,eB)=>{"use strict";var Kc=Symbol("SemVer ANY"),dv=class t{static get ANY(){return Kc}constructor(e,r){if(r=Xj(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),hv("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Kc?this.value="":this.value=this.operator+this.semver.version,hv("comp",this)}parse(e){let r=this.options.loose?Yj[Jj.COMPARATORLOOSE]:Yj[Jj.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Zj(n[2],this.options.loose):this.semver=Kc}toString(){return this.value}test(e){if(hv("Comparator.test",e,this.options.loose),this.semver===Kc||e===Kc)return!0;if(typeof e=="string")try{e=new Zj(e,this.options)}catch{return!1}return fv(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Qj(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Qj(this.value,r).test(e.semver):(r=Xj(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||fv(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||fv(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};eB.exports=dv;var Xj=up(),{safeRe:Yj,t:Jj}=Ba(),fv=av(),hv=Vc(),Zj=Wt(),Qj=Wr()});var Wc=E((pve,tB)=>{"use strict";var Bae=Wr(),Mae=(t,e,r)=>{try{e=new Bae(e,r)}catch{return!1}return e.test(t)};tB.exports=Mae});var nB=E((mve,rB)=>{"use strict";var qae=Wr(),Uae=(t,e)=>new qae(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));rB.exports=Uae});var sB=E((gve,iB)=>{"use strict";var Hae=Wt(),Vae=Wr(),zae=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Vae(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Hae(n,r))}),n};iB.exports=zae});var aB=E((yve,oB)=>{"use strict";var Gae=Wt(),Kae=Wr(),Wae=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Kae(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Gae(n,r))}),n};oB.exports=Wae});var lB=E((Dve,cB)=>{"use strict";var pv=Wt(),Xae=Wr(),uB=zc(),Yae=(t,e)=>{t=new Xae(t,e);let r=new pv("0.0.0");if(t.test(r)||(r=new pv("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],s=null;i.forEach(o=>{let a=new pv(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||uB(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||uB(r,s))&&(r=s)}return r&&t.test(r)?r:null};cB.exports=Yae});var hB=E((wve,fB)=>{"use strict";var Jae=Wr(),Zae=(t,e)=>{try{return new Jae(t,e).range||"*"}catch{return null}};fB.exports=Zae});var wp=E((bve,gB)=>{"use strict";var Qae=Wt(),mB=Gc(),{ANY:eue}=mB,tue=Wr(),rue=Wc(),dB=zc(),pB=pp(),nue=gp(),iue=mp(),sue=(t,e,r,n)=>{t=new Qae(t,n),e=new tue(e,n);let i,s,o,a,u;switch(r){case">":i=dB,s=nue,o=pB,a=">",u=">=";break;case"<":i=pB,s=iue,o=dB,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(rue(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],h=null,d=null;if(l.forEach(f=>{f.semver===eue&&(f=new mB(">=0.0.0")),h=h||f,d=d||f,i(f.semver,h.semver,n)?h=f:o(f.semver,d.semver,n)&&(d=f)}),h.operator===a||h.operator===u||(!d.operator||d.operator===a)&&s(t,d.semver))return!1;if(d.operator===u&&o(t,d.semver))return!1}return!0};gB.exports=sue});var DB=E((vve,yB)=>{"use strict";var oue=wp(),aue=(t,e,r)=>oue(t,e,">",r);yB.exports=aue});var bB=E((Eve,wB)=>{"use strict";var uue=wp(),cue=(t,e,r)=>uue(t,e,"<",r);wB.exports=cue});var _B=E((_ve,EB)=>{"use strict";var vB=Wr(),lue=(t,e,r)=>(t=new vB(t,r),e=new vB(e,r),t.intersects(e,r));EB.exports=lue});var SB=E((Cve,CB)=>{"use strict";var fue=Wc(),hue=Kr();CB.exports=(t,e,r)=>{let n=[],i=null,s=null,o=t.sort((l,h)=>hue(l,h,r));for(let l of o)fue(l,e,r)?(s=l,i||(i=l)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,h]of n)l===h?a.push(l):!h&&l===o[0]?a.push("*"):h?l===o[0]?a.push(`<=${h}`):a.push(`${l} - ${h}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var IB=E((Sve,FB)=>{"use strict";var AB=Wr(),gv=Gc(),{ANY:mv}=gv,Xc=Wc(),yv=Kr(),due=(t,e,r={})=>{if(t===e)return!0;t=new AB(t,r),e=new AB(e,r);let n=!1;e:for(let i of t.set){for(let s of e.set){let o=mue(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},pue=[new gv(">=0.0.0-0")],OB=[new gv(">=0.0.0")],mue=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===mv){if(e.length===1&&e[0].semver===mv)return!0;r.includePrerelease?t=pue:t=OB}if(e.length===1&&e[0].semver===mv){if(r.includePrerelease)return!0;e=OB}let n=new Set,i,s;for(let f of t)f.operator===">"||f.operator===">="?i=xB(i,f,r):f.operator==="<"||f.operator==="<="?s=TB(s,f,r):n.add(f.semver);if(n.size>1)return null;let o;if(i&&s){if(o=yv(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let f of n){if(i&&!Xc(f,String(i),r)||s&&!Xc(f,String(s),r))return null;for(let m of e)if(!Xc(f,String(m),r))return!1;return!0}let a,u,c,l,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let f of e){if(l=l||f.operator===">"||f.operator===">=",c=c||f.operator==="<"||f.operator==="<=",i){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator===">"||f.operator===">="){if(a=xB(i,f,r),a===f&&a!==i)return!1}else if(i.operator===">="&&!Xc(i.semver,String(f),r))return!1}if(s){if(h&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===h.major&&f.semver.minor===h.minor&&f.semver.patch===h.patch&&(h=!1),f.operator==="<"||f.operator==="<="){if(u=TB(s,f,r),u===f&&u!==s)return!1}else if(s.operator==="<="&&!Xc(s.semver,String(f),r))return!1}if(!f.operator&&(s||i)&&o!==0)return!1}return!(i&&c&&!s&&o!==0||s&&l&&!i&&o!==0||d||h)},xB=(t,e,r)=>{if(!t)return e;let n=yv(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},TB=(t,e,r)=>{if(!t)return e;let n=yv(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};FB.exports=due});var NB=E((Ave,RB)=>{"use strict";var Dv=Ba(),kB=Hc(),gue=Wt(),PB=rv(),yue=ro(),Due=sj(),wue=aj(),bue=lj(),vue=dj(),Eue=mj(),_ue=yj(),Cue=wj(),Sue=vj(),Aue=Kr(),Oue=Sj(),xue=Oj(),Tue=dp(),Fue=Ij(),Iue=Pj(),kue=zc(),Pue=pp(),Rue=sv(),Nue=ov(),$ue=mp(),Lue=gp(),jue=av(),Bue=Uj(),Mue=Gc(),que=Wr(),Uue=Wc(),Hue=nB(),Vue=sB(),zue=aB(),Gue=lB(),Kue=hB(),Wue=wp(),Xue=DB(),Yue=bB(),Jue=_B(),Zue=SB(),Que=IB();RB.exports={parse:yue,valid:Due,clean:wue,inc:bue,diff:vue,major:Eue,minor:_ue,patch:Cue,prerelease:Sue,compare:Aue,rcompare:Oue,compareLoose:xue,compareBuild:Tue,sort:Fue,rsort:Iue,gt:kue,lt:Pue,eq:Rue,neq:Nue,gte:$ue,lte:Lue,cmp:jue,coerce:Bue,Comparator:Mue,Range:que,satisfies:Uue,toComparators:Hue,maxSatisfying:Vue,minSatisfying:zue,minVersion:Gue,validRange:Kue,outside:Wue,gtr:Xue,ltr:Yue,intersects:Jue,simplifyRange:Zue,subset:Que,SemVer:gue,re:Dv.re,src:Dv.src,tokens:Dv.t,SEMVER_SPEC_VERSION:kB.SEMVER_SPEC_VERSION,RELEASE_TYPES:kB.RELEASE_TYPES,compareIdentifiers:PB.compareIdentifiers,rcompareIdentifiers:PB.rcompareIdentifiers}});var KB=E(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.parseApkNameFromFlavor=Q.checkJDKMajorVersion=Q.resolvePlatform=Q.checkPlatformVersions=Q.getAddedPlatforms=Q.getPlatformTargetName=Q.promptForPlatformTarget=Q.promptForPlatform=Q.isValidEnterprisePlatform=Q.getKnownEnterprisePlatforms=Q.isValidCommunityPlatform=Q.getKnownCommunityPlatforms=Q.isValidPlatform=Q.getKnownPlatforms=Q.selectPlatforms=Q.getProjectPlatformDirectory=Q.getCLIVersion=Q.getCoreVersion=Q.getCapacitorPackageVersion=Q.requireCapacitorPackage=Q.getCapacitorPackage=Q.runTask=Q.runPlatformHook=Q.runHooks=Q.wait=Q.checkAppName=Q.checkAppId=Q.checkAppDir=Q.checkAppConfig=Q.checkCapacitorPlatform=Q.checkPackage=Q.checkWebDir=Q.check=void 0;var Jc=(fe(),ue(le)),$B=Bi(),Zi=Da(),no=require("path"),je=Jc.__importDefault(wa()),Ma=td(),jB=gc(),ece=LN(),LB=Sl(),Yc=Ad(),tce=ap();async function rce(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
|
|
204
204
|
`)}Q.check=rce;async function nce(t){var e;return!((e=t.app.extConfig.server)===null||e===void 0)&&e.url?null:["",".","..","../","./"].includes(t.app.webDir)?`"${t.app.webDir}" is not a valid value for webDir`:await(0,Zi.pathExists)(t.app.webDirAbs)?await(0,Zi.pathExists)((0,no.join)(t.app.webDirAbs,"index.html"))?null:`The web assets directory (${je.default.strong((0,$B.prettyPath)(t.app.webDirAbs))}) must contain an ${je.default.strong("index.html")} file.
|
|
205
205
|
It will be the entry point for the web portion of the Capacitor app.`:`Could not find the web assets directory: ${je.default.strong((0,$B.prettyPath)(t.app.webDirAbs))}.
|
|
206
206
|
Please create it and make sure it has an ${je.default.strong("index.html")} file. You can change the path of this directory in ${je.default.strong(t.app.extConfigName)} (${je.default.input("webDir")} option). You may need to compile the web assets for your app (typically ${je.default.input("npm run build")}). More info: ${je.default.strong("https://capacitorjs.com/docs/basics/workflow#sync-your-project")}`}Q.checkWebDir=nce;async function ice(){return await(0,Zi.pathExists)("package.json")||await(0,Zi.pathExists)("project.json")?null:`The Capacitor CLI needs to run at the root of an npm package or in a valid NX monorepo.
|
|
@@ -234,8 +234,8 @@ const config: CapacitorConfig = ${(0,Ice.formatJSObject)(t)};
|
|
|
234
234
|
|
|
235
235
|
export default config;
|
|
236
236
|
`}});function Wce(){try{return Ov.default.statSync("/.dockerenv"),!0}catch{return!1}}function Xce(){try{return Ov.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function xv(){return Av===void 0&&(Av=Wce()||Xce()),Av}var Ov,Av,r8=Rr(()=>{Ov=xe(require("node:fs"),1)});function Ha(){return Tv===void 0&&(Tv=Yce()||xv()),Tv}var n8,Tv,Yce,Fv=Rr(()=>{n8=xe(require("node:fs"),1);r8();Yce=()=>{try{return n8.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var Iv,s8,o8,i8,es,kv=Rr(()=>{Iv=xe(require("node:process"),1),s8=xe(require("node:os"),1),o8=xe(require("node:fs"),1);Fv();i8=()=>{if(Iv.default.platform!=="linux")return!1;if(s8.default.release().toLowerCase().includes("microsoft"))return!Ha();try{return o8.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Ha():!1}catch{return!1}},es=Iv.default.env.__IS_WSL_TEST__?i8:i8()});var Pv,Qc,Jce,Zce,Rv,a8=Rr(()=>{Pv=xe(require("node:process"),1),Qc=xe(require("node:fs/promises"),1);kv();kv();Jce=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await Qc.default.access(r,Qc.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await Qc.default.readFile(r,{encoding:"utf8"}),s=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),Zce=async()=>`${await Jce()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,Rv=async()=>es?Zce():`${Pv.default.env.SYSTEMROOT||Pv.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`});function ts(t,e,r){let n=i=>Object.defineProperty(t,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),t}var u8=Rr(()=>{});async function Nv(){if(l8.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await Qce("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var c8,l8,f8,Qce,h8=Rr(()=>{c8=require("node:util"),l8=xe(require("node:process"),1),f8=require("node:child_process"),Qce=(0,c8.promisify)(f8.execFile)});async function m8(t,{humanReadableOutput:e=!0,signal:r}={}){if(d8.default.platform!=="darwin")throw new Error("macOS only");let n=e?[]:["-ss"],i={};r&&(i.signal=r);let{stdout:s}=await ele("osascript",["-e",t,n],i);return s.trim()}var d8,p8,$v,ele,g8=Rr(()=>{d8=xe(require("node:process"),1),p8=require("node:util"),$v=require("node:child_process"),ele=(0,p8.promisify)($v.execFile)});async function Lv(t){return m8(`tell application "Finder" to set app_path to application file id "${t}" as string
|
|
237
|
-
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var y8=Rr(()=>{g8()});async function jv(t=tle){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!r)throw new Ap(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=rle[n];if(!i)throw new Ap(`Unknown browser ID: ${n}`);return i}var D8,w8,tle,rle,Ap,b8=Rr(()=>{D8=require("node:util"),w8=require("node:child_process"),tle=(0,D8.promisify)(w8.execFile),rle={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},Ap=class extends Error{}});async function Bv(){if(Op.default.platform==="darwin"){let t=await Nv();return{name:await Lv(t),id:t}}if(Op.default.platform==="linux"){let{stdout:t}=await nle("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:ile(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Op.default.platform==="win32")return jv();throw new Error("Only macOS, Linux, and Windows are supported")}var v8,Op,E8,nle,ile,_8=Rr(()=>{v8=require("node:util"),Op=xe(require("node:process"),1),E8=require("node:child_process");h8();y8();b8();nle=(0,v8.promisify)(E8.execFile),ile=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var zv={};om(zv,{apps:()=>rs,default:()=>cle,openApp:()=>ule});async function ole(){let t=await Rv(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=Uv.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await sle(t,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",r],{encoding:"utf8"}),i=n.trim(),s={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return s[i]?{id:s[i]}:{}}function O8(t){if(typeof t=="string"||Array.isArray(t))return t;let{[S8]:e}=t;if(!e)throw new Error(`${S8} is not supported`);return e}function Tp({[Va]:t},{wsl:e}){if(e&&es)return O8(e);if(!t)throw new Error(`${Va} is not supported`);return O8(t)}var qv,Uv,Hv,x8,T8,Vv,xp,lle,sle,Mv,C8,Va,S8,A8,el,ale,ule,rs,cle,Gv=Rr(()=>{qv=xe(require("node:process"),1),Uv=require("node:buffer"),Hv=xe(require("node:path"),1),x8=require("node:url"),T8=require("node:util"),Vv=xe(require("node:child_process"),1),xp=xe(require("node:fs/promises"),1);a8();u8();_8();Fv();lle={},sle=(0,T8.promisify)(Vv.default.execFile),Mv=Hv.default.dirname((0,x8.fileURLToPath)(lle.url)),C8=Hv.default.join(Mv,"xdg-open"),{platform:Va,arch:S8}=qv.default;A8=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},el=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return A8(t.app,a=>el({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return A8(e,a=>el({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=es?await ole():await Bv();if(c.id in a){let l=a[c.id];return e==="browserPrivate"&&r.push(u[l]),el({...t,app:{name:rs[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],s={};if(Va==="darwin")n="open",t.wait&&i.push("--wait-apps"),t.background&&i.push("--background"),t.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(Va==="win32"||es&&!Ha()&&!e){n=await Rv(),i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),es||(s.windowsVerbatimArguments=!0);let a=["Start"];t.wait&&a.push("-Wait"),e?(a.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&a.push(`"${t.target}"`),r.length>0&&(r=r.map(u=>`"\`"${u}\`""`),a.push("-ArgumentList",r.join(","))),t.target=Uv.Buffer.from(a.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!Mv||Mv==="/",u=!1;try{await xp.default.access(C8,xp.constants.X_OK),u=!0}catch{}n=qv.default.versions.electron??(Va==="android"||a||!u)?"xdg-open":C8}r.length>0&&i.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}Va==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let o=Vv.default.spawn(n,i,s);return t.wait?new Promise((a,u)=>{o.once("error",u),o.once("close",c=>{if(!t.allowNonzeroExitCode&&c>0){u(new Error(`Exited with code ${c}`));return}a(o)})}):(o.unref(),o)},ale=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return el({...e,target:t})},ule=(t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return el({...e,app:{name:t,arguments:r}})};rs={};ts(rs,"chrome",()=>Tp({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));ts(rs,"brave",()=>Tp({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));ts(rs,"firefox",()=>Tp({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));ts(rs,"edge",()=>Tp({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));ts(rs,"browser",()=>"browser");ts(rs,"browserPrivate",()=>"browserPrivate");cle=ale});var Yp=E(Jr=>{"use strict";Jr.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;Jr.find=(t,e)=>t.nodes.find(r=>r.type===e);Jr.exceedsLimit=(t,e,r=1,n)=>n===!1||!Jr.isInteger(t)||!Jr.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;Jr.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};Jr.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;Jr.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;Jr.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;Jr.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);Jr.flatten=(...t)=>{let e=[],r=n=>{for(let i=0;i<n.length;i++){let s=n[i];if(Array.isArray(s)){r(s);continue}s!==void 0&&e.push(s)}return e};return r(t),e}});var Jp=E((U_e,MM)=>{"use strict";var BM=Yp();MM.exports=(t,e={})=>{let r=(n,i={})=>{let s=e.escapeInvalid&&BM.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&BM.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(t)}});var UM=E((H_e,qM)=>{"use strict";qM.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var JM=E((V_e,YM)=>{"use strict";var HM=UM(),fo=(t,e,r)=>{if(HM(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(HM(e)===!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 i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),u=t+":"+e+"="+i+s+o+a;if(fo.cache.hasOwnProperty(u))return fo.cache[u].result;let c=Math.min(t,e),l=Math.max(t,e);if(Math.abs(c-l)===1){let g=t+"|"+e;return n.capture?`(${g})`:n.wrap===!1?g:`(?:${g})`}let h=XM(t)||XM(e),d={min:t,max:e,a:c,b:l},f=[],m=[];if(h&&(d.isPadded=h,d.maxLen=String(d.max).length),c<0){let g=l<0?Math.abs(l):1;m=VM(g,Math.abs(c),d,n),c=d.a=0}return l>=0&&(f=VM(c,l,d,n)),d.negatives=m,d.positives=f,d.result=Hle(m,f,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&f.length+m.length>1&&(d.result=`(?:${d.result})`),fo.cache[u]=d,d.result};function Hle(t,e,r){let n=cE(t,e,"-",!1,r)||[],i=cE(e,t,"",!1,r)||[],s=cE(t,e,"-?",!0,r)||[];return n.concat(s).concat(i).join("|")}function Vle(t,e){let r=1,n=1,i=GM(t,r),s=new Set([e]);for(;t<=i&&i<=e;)s.add(i),r+=1,i=GM(t,r);for(i=KM(e+1,n)-1;t<i&&i<=e;)s.add(i),n+=1,i=KM(e+1,n)-1;return s=[...s],s.sort(Kle),s}function zle(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=Gle(t,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[u,c]=n[a];u===c?s+=u:u!=="0"||c!=="9"?s+=Wle(u,c,r):o++}return o&&(s+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function VM(t,e,r,n){let i=Vle(t,e),s=[],o=t,a;for(let u=0;u<i.length;u++){let c=i[u],l=zle(String(o),String(c),n),h="";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+WM(a.count),o=c+1;continue}r.isPadded&&(h=Xle(c,r,n)),l.string=h+l.pattern+WM(l.count),s.push(l),o=c+1,a=l}return s}function cE(t,e,r,n,i){let s=[];for(let o of t){let{string:a}=o;!n&&!zM(e,"string",a)&&s.push(r+a),n&&zM(e,"string",a)&&s.push(r+a)}return s}function Gle(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function Kle(t,e){return t>e?1:e>t?-1:0}function zM(t,e,r){return t.some(n=>n[e]===r)}function GM(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function KM(t,e){return t-t%Math.pow(10,e)}function WM(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function Wle(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function XM(t){return/^-?(0+)\d/.test(t)}function Xle(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),i=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}fo.cache={};fo.clearCache=()=>fo.cache={};YM.exports=fo});var hE=E((z_e,i6)=>{"use strict";var Yle=require("util"),QM=JM(),ZM=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Jle=t=>e=>t===!0?Number(e):String(e),lE=t=>typeof t=="number"||typeof t=="string"&&t!=="",cl=t=>Number.isInteger(+t),fE=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},Zle=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,Qle=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return r===!1?String(t):t},Qp=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},efe=(t,e,r)=>{t.negatives.sort((a,u)=>a<u?-1:a>u?1:0),t.positives.sort((a,u)=>a<u?-1:a>u?1:0);let n=e.capture?"":"?:",i="",s="",o;return t.positives.length&&(i=t.positives.map(a=>Qp(String(a),r)).join("|")),t.negatives.length&&(s=`-(${n}${t.negatives.map(a=>Qp(String(a),r)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},e6=(t,e,r,n)=>{if(r)return QM(t,e,{wrap:!1,...n});let i=String.fromCharCode(t);if(t===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},t6=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,i=r.capture?"":"?:";return n?`(${i}${t.join("|")})`:t.join("|")}return QM(t,e,r)},r6=(...t)=>new RangeError("Invalid range arguments: "+Yle.inspect(...t)),n6=(t,e,r)=>{if(r.strictRanges===!0)throw r6([t,e]);return[]},tfe=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},rfe=(t,e,r=1,n={})=>{let i=Number(t),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw r6([t,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(t),u=String(e),c=String(r);r=Math.max(Math.abs(r),1);let l=fE(a)||fE(u)||fE(c),h=l?Math.max(a.length,u.length,c.length):0,d=l===!1&&Zle(t,e,n)===!1,f=n.transform||Jle(d);if(n.toRegex&&r===1)return e6(Qp(t,h),Qp(e,h),!0,n);let m={negatives:[],positives:[]},g=A=>m[A<0?"negatives":"positives"].push(Math.abs(A)),b=[],S=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&r>1?g(i):b.push(Qle(f(i,S),h,d)),i=o?i-r:i+r,S++;return n.toRegex===!0?r>1?efe(m,n,h):t6(b,null,{wrap:!1,...n}):b},nfe=(t,e,r=1,n={})=>{if(!cl(t)&&t.length>1||!cl(e)&&e.length>1)return n6(t,e,n);let i=n.transform||(d=>String.fromCharCode(d)),s=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,u=Math.min(s,o),c=Math.max(s,o);if(n.toRegex&&r===1)return e6(u,c,!1,n);let l=[],h=0;for(;a?s>=o:s<=o;)l.push(i(s,h)),s=a?s-r:s+r,h++;return n.toRegex===!0?t6(l,null,{wrap:!1,options:n}):l},Zp=(t,e,r,n={})=>{if(e==null&&lE(t))return[t];if(!lE(t)||!lE(e))return n6(t,e,n);if(typeof r=="function")return Zp(t,e,1,{transform:r});if(ZM(r))return Zp(t,e,0,r);let i={...n};return i.capture===!0&&(i.wrap=!0),r=r||i.step||1,cl(r)?cl(t)&&cl(e)?rfe(t,e,r,i):nfe(t,e,Math.max(Math.abs(r),1),i):r!=null&&!ZM(r)?tfe(r,i):Zp(t,e,1,r)};i6.exports=Zp});var a6=E((G_e,o6)=>{"use strict";var ife=hE(),s6=Yp(),sfe=(t,e={})=>{let r=(n,i={})=>{let s=s6.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,u=e.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=s6.reduce(n.nodes),h=ife(...l,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(h.length!==0)return l.length>1&&h.length>1?`(${h})`:h}if(n.nodes)for(let l of n.nodes)c+=r(l,n);return c};return r(t)};o6.exports=sfe});var l6=E((K_e,c6)=>{"use strict";var ofe=hE(),u6=Jp(),nu=Yp(),ho=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?nu.flatten(e).map(i=>`{${i}}`):e;for(let i of t)if(Array.isArray(i))for(let s of i)n.push(ho(s,e,r));else for(let s of e)r===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?ho(i,s,r):i+s);return nu.flatten(n)},afe=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(ho(a.pop(),u6(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(ho(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let h=nu.reduce(i.nodes);if(nu.exceedsLimit(...h,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=ofe(...h,e);d.length===0&&(d=u6(i,e)),a.push(ho(a.pop(),d)),i.nodes=[];return}let u=nu.encloseBrace(i),c=i.queue,l=i;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,c=l.queue;for(let h=0;h<i.nodes.length;h++){let d=i.nodes[h];if(d.type==="comma"&&i.type==="brace"){h===1&&c.push(""),c.push("");continue}if(d.type==="close"){a.push(ho(a.pop(),c,u));continue}if(d.value&&d.type!=="open"){c.push(ho(c.pop(),d.value));continue}d.nodes&&n(d,i)}return c};return nu.flatten(n(t))};c6.exports=afe});var h6=E((W_e,f6)=>{"use strict";f6.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:`
|
|
238
|
-
`,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 y6=E((X_e,g6)=>{"use strict";var ufe=Jp(),{MAX_LENGTH:d6,CHAR_BACKSLASH:dE,CHAR_BACKTICK:cfe,CHAR_COMMA:lfe,CHAR_DOT:ffe,CHAR_LEFT_PARENTHESES:hfe,CHAR_RIGHT_PARENTHESES:dfe,CHAR_LEFT_CURLY_BRACE:pfe,CHAR_RIGHT_CURLY_BRACE:mfe,CHAR_LEFT_SQUARE_BRACKET:p6,CHAR_RIGHT_SQUARE_BRACKET:m6,CHAR_DOUBLE_QUOTE:gfe,CHAR_SINGLE_QUOTE:yfe,CHAR_NO_BREAK_SPACE:Dfe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:wfe}=h6(),bfe=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(d6,r.maxLength):d6;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let i={type:"root",input:t,nodes:[]},s=[i],o=i,a=i,u=0,c=t.length,l=0,h=0,d,f=()=>t[l++],m=g=>{if(g.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&g.type==="text"){a.value+=g.value;return}return o.nodes.push(g),g.parent=o,g.prev=a,a=g,g};for(m({type:"bos"});l<c;)if(o=s[s.length-1],d=f(),!(d===wfe||d===Dfe)){if(d===dE){m({type:"text",value:(e.keepEscaping?d:"")+f()});continue}if(d===m6){m({type:"text",value:"\\"+d});continue}if(d===p6){u++;let g;for(;l<c&&(g=f());){if(d+=g,g===p6){u++;continue}if(g===dE){d+=f();continue}if(g===m6&&(u--,u===0))break}m({type:"text",value:d});continue}if(d===hfe){o=m({type:"paren",nodes:[]}),s.push(o),m({type:"text",value:d});continue}if(d===dfe){if(o.type!=="paren"){m({type:"text",value:d});continue}o=s.pop(),m({type:"text",value:d}),o=s[s.length-1];continue}if(d===gfe||d===yfe||d===cfe){let g=d,b;for(e.keepQuotes!==!0&&(d="");l<c&&(b=f());){if(b===dE){d+=b+f();continue}if(b===g){e.keepQuotes===!0&&(d+=b);break}d+=b}m({type:"text",value:d});continue}if(d===pfe){h++;let b={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:h,commas:0,ranges:0,nodes:[]};o=m(b),s.push(o),m({type:"open",value:d});continue}if(d===mfe){if(o.type!=="brace"){m({type:"text",value:d});continue}let g="close";o=s.pop(),o.close=!0,m({type:g,value:d}),h--,o=s[s.length-1];continue}if(d===lfe&&h>0){if(o.ranges>0){o.ranges=0;let g=o.nodes.shift();o.nodes=[g,{type:"text",value:ufe(o)}]}m({type:"comma",value:d}),o.commas++;continue}if(d===ffe&&h>0&&o.commas===0){let g=o.nodes;if(h===0||g.length===0){m({type:"text",value:d});continue}if(a.type==="dot"){if(o.range=[],a.value+=d,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){g.pop();let b=g[g.length-1];b.value+=a.value+d,a=b,o.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(S=>{S.nodes||(S.type==="open"&&(S.isOpen=!0),S.type==="close"&&(S.isClose=!0),S.nodes||(S.type="text"),S.invalid=!0)});let g=s[s.length-1],b=g.nodes.indexOf(o);g.nodes.splice(b,1,...o.nodes)}while(s.length>0);return m({type:"eos"}),i};g6.exports=bfe});var b6=E((Y_e,w6)=>{"use strict";var D6=Jp(),vfe=a6(),Efe=l6(),_fe=y6(),kr=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let i=kr.create(n,e);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(kr.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};kr.parse=(t,e={})=>_fe(t,e);kr.stringify=(t,e={})=>D6(typeof t=="string"?kr.parse(t,e):t,e);kr.compile=(t,e={})=>(typeof t=="string"&&(t=kr.parse(t,e)),vfe(t,e));kr.expand=(t,e={})=>{typeof t=="string"&&(t=kr.parse(t,e));let r=Efe(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};kr.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?kr.compile(t,e):kr.expand(t,e);w6.exports=kr});var ll=E((J_e,S6)=>{"use strict";var Cfe=require("path"),Mn="\\\\/",v6=`[^${Mn}]`,wi="\\.",Sfe="\\+",Afe="\\?",em="\\/",Ofe="(?=.)",E6="[^/]",pE=`(?:${em}|$)`,_6=`(?:^|${em})`,mE=`${wi}{1,2}${pE}`,xfe=`(?!${wi})`,Tfe=`(?!${_6}${mE})`,Ffe=`(?!${wi}{0,1}${pE})`,Ife=`(?!${mE})`,kfe=`[^.${em}]`,Pfe=`${E6}*?`,C6={DOT_LITERAL:wi,PLUS_LITERAL:Sfe,QMARK_LITERAL:Afe,SLASH_LITERAL:em,ONE_CHAR:Ofe,QMARK:E6,END_ANCHOR:pE,DOTS_SLASH:mE,NO_DOT:xfe,NO_DOTS:Tfe,NO_DOT_SLASH:Ffe,NO_DOTS_SLASH:Ife,QMARK_NO_DOT:kfe,STAR:Pfe,START_ANCHOR:_6},Rfe={...C6,SLASH_LITERAL:`[${Mn}]`,QMARK:v6,STAR:`${v6}*?`,DOTS_SLASH:`${wi}{1,2}(?:[${Mn}]|$)`,NO_DOT:`(?!${wi})`,NO_DOTS:`(?!(?:^|[${Mn}])${wi}{1,2}(?:[${Mn}]|$))`,NO_DOT_SLASH:`(?!${wi}{0,1}(?:[${Mn}]|$))`,NO_DOTS_SLASH:`(?!${wi}{1,2}(?:[${Mn}]|$))`,QMARK_NO_DOT:`[^.${Mn}]`,START_ANCHOR:`(?:^|[${Mn}])`,END_ANCHOR:`(?:[${Mn}]|$)`},Nfe={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"};S6.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Nfe,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:Cfe.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Rfe:C6}}});var fl=E(Or=>{"use strict";var $fe=require("path"),Lfe=process.platform==="win32",{REGEX_BACKSLASH:jfe,REGEX_REMOVE_BACKSLASH:Bfe,REGEX_SPECIAL_CHARS:Mfe,REGEX_SPECIAL_CHARS_GLOBAL:qfe}=ll();Or.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Or.hasRegexChars=t=>Mfe.test(t);Or.isRegexChar=t=>t.length===1&&Or.hasRegexChars(t);Or.escapeRegex=t=>t.replace(qfe,"\\$1");Or.toPosixSlashes=t=>t.replace(jfe,"/");Or.removeBackslashes=t=>t.replace(Bfe,e=>e==="\\"?"":e);Or.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Or.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:Lfe===!0||$fe.sep==="\\";Or.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Or.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Or.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Or.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",s=`${n}(?:${t})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var P6=E((Q_e,k6)=>{"use strict";var A6=fl(),{CHAR_ASTERISK:gE,CHAR_AT:Ufe,CHAR_BACKWARD_SLASH:hl,CHAR_COMMA:Hfe,CHAR_DOT:yE,CHAR_EXCLAMATION_MARK:DE,CHAR_FORWARD_SLASH:I6,CHAR_LEFT_CURLY_BRACE:wE,CHAR_LEFT_PARENTHESES:bE,CHAR_LEFT_SQUARE_BRACKET:Vfe,CHAR_PLUS:zfe,CHAR_QUESTION_MARK:O6,CHAR_RIGHT_CURLY_BRACE:Gfe,CHAR_RIGHT_PARENTHESES:x6,CHAR_RIGHT_SQUARE_BRACKET:Kfe}=ll(),T6=t=>t===I6||t===hl,F6=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Wfe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,s=[],o=[],a=[],u=t,c=-1,l=0,h=0,d=!1,f=!1,m=!1,g=!1,b=!1,S=!1,A=!1,p=!1,D=!1,y=!1,C=0,k,v,R={value:"",depth:0,isGlob:!1},P=()=>c>=n,F=()=>u.charCodeAt(c+1),j=()=>(k=v,u.charCodeAt(++c));for(;c<n;){v=j();let T;if(v===hl){A=R.backslashes=!0,v=j(),v===wE&&(S=!0);continue}if(S===!0||v===wE){for(C++;P()!==!0&&(v=j());){if(v===hl){A=R.backslashes=!0,j();continue}if(v===wE){C++;continue}if(S!==!0&&v===yE&&(v=j())===yE){if(d=R.isBrace=!0,m=R.isGlob=!0,y=!0,i===!0)continue;break}if(S!==!0&&v===Hfe){if(d=R.isBrace=!0,m=R.isGlob=!0,y=!0,i===!0)continue;break}if(v===Gfe&&(C--,C===0)){S=!1,d=R.isBrace=!0,y=!0;break}}if(i===!0)continue;break}if(v===I6){if(s.push(c),o.push(R),R={value:"",depth:0,isGlob:!1},y===!0)continue;if(k===yE&&c===l+1){l+=2;continue}h=c+1;continue}if(r.noext!==!0&&(v===zfe||v===Ufe||v===gE||v===O6||v===DE)===!0&&F()===bE){if(m=R.isGlob=!0,g=R.isExtglob=!0,y=!0,v===DE&&c===l&&(D=!0),i===!0){for(;P()!==!0&&(v=j());){if(v===hl){A=R.backslashes=!0,v=j();continue}if(v===x6){m=R.isGlob=!0,y=!0;break}}continue}break}if(v===gE){if(k===gE&&(b=R.isGlobstar=!0),m=R.isGlob=!0,y=!0,i===!0)continue;break}if(v===O6){if(m=R.isGlob=!0,y=!0,i===!0)continue;break}if(v===Vfe){for(;P()!==!0&&(T=j());){if(T===hl){A=R.backslashes=!0,j();continue}if(T===Kfe){f=R.isBracket=!0,m=R.isGlob=!0,y=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&v===DE&&c===l){p=R.negated=!0,l++;continue}if(r.noparen!==!0&&v===bE){if(m=R.isGlob=!0,i===!0){for(;P()!==!0&&(v=j());){if(v===bE){A=R.backslashes=!0,v=j();continue}if(v===x6){y=!0;break}}continue}break}if(m===!0){if(y=!0,i===!0)continue;break}}r.noext===!0&&(g=!1,m=!1);let U=u,G="",L="";l>0&&(G=u.slice(0,l),u=u.slice(l),h-=l),U&&m===!0&&h>0?(U=u.slice(0,h),L=u.slice(h)):m===!0?(U="",L=u):U=u,U&&U!==""&&U!=="/"&&U!==u&&T6(U.charCodeAt(U.length-1))&&(U=U.slice(0,-1)),r.unescape===!0&&(L&&(L=A6.removeBackslashes(L)),U&&A===!0&&(U=A6.removeBackslashes(U)));let _={prefix:G,input:t,start:l,base:U,glob:L,isBrace:d,isBracket:f,isGlob:m,isExtglob:g,isGlobstar:b,negated:p,negatedExtglob:D};if(r.tokens===!0&&(_.maxDepth=0,T6(v)||o.push(R),_.tokens=o),r.parts===!0||r.tokens===!0){let T;for(let I=0;I<s.length;I++){let $=T?T+1:l,M=s[I],B=t.slice($,M);r.tokens&&(I===0&&l!==0?(o[I].isPrefix=!0,o[I].value=G):o[I].value=B,F6(o[I]),_.maxDepth+=o[I].depth),(I!==0||B!=="")&&a.push(B),T=M}if(T&&T+1<t.length){let I=t.slice(T+1);a.push(I),r.tokens&&(o[o.length-1].value=I,F6(o[o.length-1]),_.maxDepth+=o[o.length-1].depth)}_.slashes=s,_.parts=a}return _};k6.exports=Wfe});var $6=E((eCe,N6)=>{"use strict";var tm=ll(),Pr=fl(),{MAX_LENGTH:rm,POSIX_REGEX_SOURCE:Xfe,REGEX_NON_SPECIAL_CHARS:Yfe,REGEX_SPECIAL_CHARS_BACKREF:Jfe,REPLACEMENTS:R6}=tm,Zfe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>Pr.escapeRegex(i)).join("..")}return r},iu=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,vE=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=R6[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(rm,r.maxLength):rm,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},o=[s],a=r.capture?"":"?:",u=Pr.isWindows(e),c=tm.globChars(u),l=tm.extglobChars(c),{DOT_LITERAL:h,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:m,DOTS_SLASH:g,NO_DOT:b,NO_DOT_SLASH:S,NO_DOTS_SLASH:A,QMARK:p,QMARK_NO_DOT:D,STAR:y,START_ANCHOR:C}=c,k=N=>`(${a}(?:(?!${C}${N.dot?g:h}).)*?)`,v=r.dot?"":b,R=r.dot?p:D,P=r.bash===!0?k(r):y;r.capture&&(P=`(${P})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let F={input:t,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:o};t=Pr.removePrefix(t,F),i=t.length;let j=[],U=[],G=[],L=s,_,T=()=>F.index===i-1,I=F.peek=(N=1)=>t[F.index+N],$=F.advance=()=>t[++F.index]||"",M=()=>t.slice(F.index+1),B=(N="",re=0)=>{F.consumed+=N,F.index+=re},K=N=>{F.output+=N.output!=null?N.output:N.value,B(N.value)},q=()=>{let N=1;for(;I()==="!"&&(I(2)!=="("||I(3)==="?");)$(),F.start++,N++;return N%2===0?!1:(F.negated=!0,F.start++,!0)},V=N=>{F[N]++,G.push(N)},ae=N=>{F[N]--,G.pop()},x=N=>{if(L.type==="globstar"){let re=F.braces>0&&(N.type==="comma"||N.type==="brace"),z=N.extglob===!0||j.length&&(N.type==="pipe"||N.type==="paren");N.type!=="slash"&&N.type!=="paren"&&!re&&!z&&(F.output=F.output.slice(0,-L.output.length),L.type="star",L.value="*",L.output=P,F.output+=L.output)}if(j.length&&N.type!=="paren"&&(j[j.length-1].inner+=N.value),(N.value||N.output)&&K(N),L&&L.type==="text"&&N.type==="text"){L.value+=N.value,L.output=(L.output||"")+N.value;return}N.prev=L,o.push(N),L=N},O=(N,re)=>{let z={...l[re],conditions:1,inner:""};z.prev=L,z.parens=F.parens,z.output=F.output;let ie=(r.capture?"(":"")+z.open;V("parens"),x({type:N,value:re,output:F.output?"":m}),x({type:"paren",extglob:!0,value:$(),output:ie}),j.push(z)},H=N=>{let re=N.close+(r.capture?")":""),z;if(N.type==="negate"){let ie=P;if(N.inner&&N.inner.length>1&&N.inner.includes("/")&&(ie=k(r)),(ie!==P||T()||/^\)+$/.test(M()))&&(re=N.close=`)$))${ie}`),N.inner.includes("*")&&(z=M())&&/^\.[^\\/.]+$/.test(z)){let we=vE(z,{...e,fastpaths:!1}).output;re=N.close=`)${we})${ie})`}N.prev.type==="bos"&&(F.negatedExtglob=!0)}x({type:"paren",extglob:!0,value:_,output:re}),ae("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let N=!1,re=t.replace(Jfe,(z,ie,we,Oe,Me,yt)=>Oe==="\\"?(N=!0,z):Oe==="?"?ie?ie+Oe+(Me?p.repeat(Me.length):""):yt===0?R+(Me?p.repeat(Me.length):""):p.repeat(we.length):Oe==="."?h.repeat(we.length):Oe==="*"?ie?ie+Oe+(Me?P:""):P:ie?z:`\\${z}`);return N===!0&&(r.unescape===!0?re=re.replace(/\\/g,""):re=re.replace(/\\+/g,z=>z.length%2===0?"\\\\":z?"\\":"")),re===t&&r.contains===!0?(F.output=t,F):(F.output=Pr.wrapOutput(re,F,e),F)}for(;!T();){if(_=$(),_==="\0")continue;if(_==="\\"){let z=I();if(z==="/"&&r.bash!==!0||z==="."||z===";")continue;if(!z){_+="\\",x({type:"text",value:_});continue}let ie=/^\\+/.exec(M()),we=0;if(ie&&ie[0].length>2&&(we=ie[0].length,F.index+=we,we%2!==0&&(_+="\\")),r.unescape===!0?_=$():_+=$(),F.brackets===0){x({type:"text",value:_});continue}}if(F.brackets>0&&(_!=="]"||L.value==="["||L.value==="[^")){if(r.posix!==!1&&_===":"){let z=L.value.slice(1);if(z.includes("[")&&(L.posix=!0,z.includes(":"))){let ie=L.value.lastIndexOf("["),we=L.value.slice(0,ie),Oe=L.value.slice(ie+2),Me=Xfe[Oe];if(Me){L.value=we+Me,F.backtrack=!0,$(),!s.output&&o.indexOf(L)===1&&(s.output=m);continue}}}(_==="["&&I()!==":"||_==="-"&&I()==="]")&&(_=`\\${_}`),_==="]"&&(L.value==="["||L.value==="[^")&&(_=`\\${_}`),r.posix===!0&&_==="!"&&L.value==="["&&(_="^"),L.value+=_,K({value:_});continue}if(F.quotes===1&&_!=='"'){_=Pr.escapeRegex(_),L.value+=_,K({value:_});continue}if(_==='"'){F.quotes=F.quotes===1?0:1,r.keepQuotes===!0&&x({type:"text",value:_});continue}if(_==="("){V("parens"),x({type:"paren",value:_});continue}if(_===")"){if(F.parens===0&&r.strictBrackets===!0)throw new SyntaxError(iu("opening","("));let z=j[j.length-1];if(z&&F.parens===z.parens+1){H(j.pop());continue}x({type:"paren",value:_,output:F.parens?")":"\\)"}),ae("parens");continue}if(_==="["){if(r.nobracket===!0||!M().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(iu("closing","]"));_=`\\${_}`}else V("brackets");x({type:"bracket",value:_});continue}if(_==="]"){if(r.nobracket===!0||L&&L.type==="bracket"&&L.value.length===1){x({type:"text",value:_,output:`\\${_}`});continue}if(F.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(iu("opening","["));x({type:"text",value:_,output:`\\${_}`});continue}ae("brackets");let z=L.value.slice(1);if(L.posix!==!0&&z[0]==="^"&&!z.includes("/")&&(_=`/${_}`),L.value+=_,K({value:_}),r.literalBrackets===!1||Pr.hasRegexChars(z))continue;let ie=Pr.escapeRegex(L.value);if(F.output=F.output.slice(0,-L.value.length),r.literalBrackets===!0){F.output+=ie,L.value=ie;continue}L.value=`(${a}${ie}|${L.value})`,F.output+=L.value;continue}if(_==="{"&&r.nobrace!==!0){V("braces");let z={type:"brace",value:_,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};U.push(z),x(z);continue}if(_==="}"){let z=U[U.length-1];if(r.nobrace===!0||!z){x({type:"text",value:_,output:_});continue}let ie=")";if(z.dots===!0){let we=o.slice(),Oe=[];for(let Me=we.length-1;Me>=0&&(o.pop(),we[Me].type!=="brace");Me--)we[Me].type!=="dots"&&Oe.unshift(we[Me].value);ie=Zfe(Oe,r),F.backtrack=!0}if(z.comma!==!0&&z.dots!==!0){let we=F.output.slice(0,z.outputIndex),Oe=F.tokens.slice(z.tokensIndex);z.value=z.output="\\{",_=ie="\\}",F.output=we;for(let Me of Oe)F.output+=Me.output||Me.value}x({type:"brace",value:_,output:ie}),ae("braces"),U.pop();continue}if(_==="|"){j.length>0&&j[j.length-1].conditions++,x({type:"text",value:_});continue}if(_===","){let z=_,ie=U[U.length-1];ie&&G[G.length-1]==="braces"&&(ie.comma=!0,z="|"),x({type:"comma",value:_,output:z});continue}if(_==="/"){if(L.type==="dot"&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",o.pop(),L=s;continue}x({type:"slash",value:_,output:f});continue}if(_==="."){if(F.braces>0&&L.type==="dot"){L.value==="."&&(L.output=h);let z=U[U.length-1];L.type="dots",L.output+=_,L.value+=_,z.dots=!0;continue}if(F.braces+F.parens===0&&L.type!=="bos"&&L.type!=="slash"){x({type:"text",value:_,output:h});continue}x({type:"dot",value:_,output:h});continue}if(_==="?"){if(!(L&&L.value==="(")&&r.noextglob!==!0&&I()==="("&&I(2)!=="?"){O("qmark",_);continue}if(L&&L.type==="paren"){let ie=I(),we=_;if(ie==="<"&&!Pr.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(L.value==="("&&!/[!=<:]/.test(ie)||ie==="<"&&!/<([!=]|\w+>)/.test(M()))&&(we=`\\${_}`),x({type:"text",value:_,output:we});continue}if(r.dot!==!0&&(L.type==="slash"||L.type==="bos")){x({type:"qmark",value:_,output:D});continue}x({type:"qmark",value:_,output:p});continue}if(_==="!"){if(r.noextglob!==!0&&I()==="("&&(I(2)!=="?"||!/[!=<:]/.test(I(3)))){O("negate",_);continue}if(r.nonegate!==!0&&F.index===0){q();continue}}if(_==="+"){if(r.noextglob!==!0&&I()==="("&&I(2)!=="?"){O("plus",_);continue}if(L&&L.value==="("||r.regex===!1){x({type:"plus",value:_,output:d});continue}if(L&&(L.type==="bracket"||L.type==="paren"||L.type==="brace")||F.parens>0){x({type:"plus",value:_});continue}x({type:"plus",value:d});continue}if(_==="@"){if(r.noextglob!==!0&&I()==="("&&I(2)!=="?"){x({type:"at",extglob:!0,value:_,output:""});continue}x({type:"text",value:_});continue}if(_!=="*"){(_==="$"||_==="^")&&(_=`\\${_}`);let z=Yfe.exec(M());z&&(_+=z[0],F.index+=z[0].length),x({type:"text",value:_});continue}if(L&&(L.type==="globstar"||L.star===!0)){L.type="star",L.star=!0,L.value+=_,L.output=P,F.backtrack=!0,F.globstar=!0,B(_);continue}let N=M();if(r.noextglob!==!0&&/^\([^?]/.test(N)){O("star",_);continue}if(L.type==="star"){if(r.noglobstar===!0){B(_);continue}let z=L.prev,ie=z.prev,we=z.type==="slash"||z.type==="bos",Oe=ie&&(ie.type==="star"||ie.type==="globstar");if(r.bash===!0&&(!we||N[0]&&N[0]!=="/")){x({type:"star",value:_,output:""});continue}let Me=F.braces>0&&(z.type==="comma"||z.type==="brace"),yt=j.length&&(z.type==="pipe"||z.type==="paren");if(!we&&z.type!=="paren"&&!Me&&!yt){x({type:"star",value:_,output:""});continue}for(;N.slice(0,3)==="/**";){let dr=t[F.index+4];if(dr&&dr!=="/")break;N=N.slice(3),B("/**",3)}if(z.type==="bos"&&T()){L.type="globstar",L.value+=_,L.output=k(r),F.output=L.output,F.globstar=!0,B(_);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&!Oe&&T()){F.output=F.output.slice(0,-(z.output+L.output).length),z.output=`(?:${z.output}`,L.type="globstar",L.output=k(r)+(r.strictSlashes?")":"|$)"),L.value+=_,F.globstar=!0,F.output+=z.output+L.output,B(_);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&N[0]==="/"){let dr=N[1]!==void 0?"|$":"";F.output=F.output.slice(0,-(z.output+L.output).length),z.output=`(?:${z.output}`,L.type="globstar",L.output=`${k(r)}${f}|${f}${dr})`,L.value+=_,F.output+=z.output+L.output,F.globstar=!0,B(_+$()),x({type:"slash",value:"/",output:""});continue}if(z.type==="bos"&&N[0]==="/"){L.type="globstar",L.value+=_,L.output=`(?:^|${f}|${k(r)}${f})`,F.output=L.output,F.globstar=!0,B(_+$()),x({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-L.output.length),L.type="globstar",L.output=k(r),L.value+=_,F.output+=L.output,F.globstar=!0,B(_);continue}let re={type:"star",value:_,output:P};if(r.bash===!0){re.output=".*?",(L.type==="bos"||L.type==="slash")&&(re.output=v+re.output),x(re);continue}if(L&&(L.type==="bracket"||L.type==="paren")&&r.regex===!0){re.output=_,x(re);continue}(F.index===F.start||L.type==="slash"||L.type==="dot")&&(L.type==="dot"?(F.output+=S,L.output+=S):r.dot===!0?(F.output+=A,L.output+=A):(F.output+=v,L.output+=v),I()!=="*"&&(F.output+=m,L.output+=m)),x(re)}for(;F.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(iu("closing","]"));F.output=Pr.escapeLast(F.output,"["),ae("brackets")}for(;F.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(iu("closing",")"));F.output=Pr.escapeLast(F.output,"("),ae("parens")}for(;F.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(iu("closing","}"));F.output=Pr.escapeLast(F.output,"{"),ae("braces")}if(r.strictSlashes!==!0&&(L.type==="star"||L.type==="bracket")&&x({type:"maybe_slash",value:"",output:`${f}?`}),F.backtrack===!0){F.output="";for(let N of F.tokens)F.output+=N.output!=null?N.output:N.value,N.suffix&&(F.output+=N.suffix)}return F};vE.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(rm,r.maxLength):rm,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=R6[t]||t;let s=Pr.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:h,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:m}=tm.globChars(s),g=r.dot?h:l,b=r.dot?d:l,S=r.capture?"":"?:",A={negated:!1,prefix:""},p=r.bash===!0?".*?":f;r.capture&&(p=`(${p})`);let D=v=>v.noglobstar===!0?p:`(${S}(?:(?!${m}${v.dot?c:o}).)*?)`,y=v=>{switch(v){case"*":return`${g}${u}${p}`;case".*":return`${o}${u}${p}`;case"*.*":return`${g}${p}${o}${u}${p}`;case"*/*":return`${g}${p}${a}${u}${b}${p}`;case"**":return g+D(r);case"**/*":return`(?:${g}${D(r)}${a})?${b}${u}${p}`;case"**/*.*":return`(?:${g}${D(r)}${a})?${b}${p}${o}${u}${p}`;case"**/.*":return`(?:${g}${D(r)}${a})?${o}${u}${p}`;default:{let R=/^(.*?)\.(\w+)$/.exec(v);if(!R)return;let P=y(R[1]);return P?P+o+R[2]:void 0}}},C=Pr.removePrefix(t,A),k=y(C);return k&&r.strictSlashes!==!0&&(k+=`${a}?`),k};N6.exports=vE});var j6=E((tCe,L6)=>{"use strict";var Qfe=require("path"),ehe=P6(),EE=$6(),_E=fl(),the=ll(),rhe=t=>t&&typeof t=="object"&&!Array.isArray(t),vt=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(d=>vt(d,e,r));return d=>{for(let f of l){let m=f(d);if(m)return m}return!1}}let n=rhe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=_E.isWindows(e),o=n?vt.compileRe(t,e):vt.makeRe(t,e,!1,!0),a=o.state;delete o.state;let u=()=>!1;if(i.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};u=vt(i.ignore,l,r)}let c=(l,h=!1)=>{let{isMatch:d,match:f,output:m}=vt.test(l,o,e,{glob:t,posix:s}),g={glob:t,state:a,regex:o,posix:s,input:l,output:m,match:f,isMatch:d};return typeof i.onResult=="function"&&i.onResult(g),d===!1?(g.isMatch=!1,h?g:!1):u(l)?(typeof i.onIgnore=="function"&&i.onIgnore(g),g.isMatch=!1,h?g:!1):(typeof i.onMatch=="function"&&i.onMatch(g),h?g:!0)};return r&&(c.state=a),c};vt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=r||{},o=s.format||(i?_E.toPosixSlashes:null),a=t===n,u=a&&o?o(t):t;return a===!1&&(u=o?o(t):t,a=u===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=vt.matchBase(t,e,r,i):a=e.exec(u)),{isMatch:!!a,match:a,output:u}};vt.matchBase=(t,e,r,n=_E.isWindows(r))=>(e instanceof RegExp?e:vt.makeRe(e,r)).test(Qfe.basename(t));vt.isMatch=(t,e,r)=>vt(e,r)(t);vt.parse=(t,e)=>Array.isArray(t)?t.map(r=>vt.parse(r,e)):EE(t,{...e,fastpaths:!1});vt.scan=(t,e)=>ehe(t,e);vt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let u=vt.toRegex(a,e);return n===!0&&(u.state=t),u};vt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=EE.fastpaths(t,e)),i.output||(i=EE(t,e)),vt.compileRe(i,e,r,n)};vt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};vt.constants=the;L6.exports=vt});var M6=E((rCe,B6)=>{"use strict";B6.exports=j6()});var G6=E((nCe,z6)=>{"use strict";var U6=require("util"),H6=b6(),qn=M6(),CE=fl(),q6=t=>t===""||t==="./",V6=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Ze=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,i=new Set,s=new Set,o=0,a=l=>{s.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<e.length;l++){let h=qn(String(e[l]),{...r,onResult:a},!0),d=h.state.negated||h.state.negatedExtglob;d&&o++;for(let f of t){let m=h(f,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),i.add(m.output)))}}let c=(o===e.length?[...s]:[...i]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(l=>l.replace(/\\/g,"")):e}return c};Ze.match=Ze;Ze.matcher=(t,e)=>qn(t,e);Ze.isMatch=(t,e,r)=>qn(e,r)(t);Ze.any=Ze.isMatch;Ze.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,i=[],s=a=>{r.onResult&&r.onResult(a),i.push(a.output)},o=new Set(Ze(t,e,{...r,onResult:s}));for(let a of i)o.has(a)||n.add(a);return[...n]};Ze.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${U6.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>Ze.contains(t,n,r));if(typeof e=="string"){if(q6(t)||q6(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Ze.isMatch(t,e,{...r,contains:!0})};Ze.matchKeys=(t,e,r)=>{if(!CE.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=Ze(Object.keys(t),e,r),i={};for(let s of n)i[s]=t[s];return i};Ze.some=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let s=qn(String(i),r);if(n.some(o=>s(o)))return!0}return!1};Ze.every=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let s=qn(String(i),r);if(!n.every(o=>s(o)))return!1}return!0};Ze.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${U6.inspect(t)}"`);return[].concat(e).every(n=>qn(n,r)(t))};Ze.capture=(t,e,r)=>{let n=CE.isWindows(r),s=qn.makeRe(String(t),{...r,capture:!0}).exec(n?CE.toPosixSlashes(e):e);if(s)return s.slice(1).map(o=>o===void 0?"":o)};Ze.makeRe=(...t)=>qn.makeRe(...t);Ze.scan=(...t)=>qn.scan(...t);Ze.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let i of H6(String(n),e))r.push(qn.parse(i,e));return r};Ze.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!V6(t)?[t]:H6(t,e)};Ze.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Ze.braces(t,{...e,expand:!0})};Ze.hasBraces=V6;z6.exports=Ze});var Ghe={};om(Ghe,{CapgoSDK:()=>nt,addApp:()=>qhe,addChannel:()=>Hhe,addOrganization:()=>jhe,checkBundleCompatibility:()=>Ohe,createSupabaseClient:()=>pe,decryptBundle:()=>The,deleteLegacyEncryptionKey:()=>Phe,deleteOrganization:()=>Mhe,doctor:()=>Ahe,encryptBundle:()=>xhe,generateEncryptionKeys:()=>Ihe,getAccountId:()=>$he,getCapacitorConfig:()=>zhe,getCurrentBundle:()=>Rhe,getStats:()=>Vhe,listBundles:()=>Uhe,listOrganizations:()=>Lhe,login:()=>She,saveEncryptionKey:()=>khe,updateAppSetting:()=>Nhe,updateOrganization:()=>Bhe,uploadBundle:()=>Che,zipBundle:()=>Fhe});module.exports=ue(Ghe);var Ut=xe(We(),1),go=require("node:process"),bi=xe(require("node:readline"),1),hm=xe(require("node:readline"),1),ME=require("node:stream"),qE=xe(cm(),1);function Lq({onlyFirst:t=!1}={}){let e=["[\\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(e,t?void 0:"g")}var jq=Lq();function UE(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(jq,"")}function HE(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var VE={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,o=i;return 55296<=i&&i<=56319&&56320<=s&&s<=57343&&(i&=1023,s&=1023,o=i<<10|s,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=r(n),s=0,o=0;o<i.length;o++)s=s+this.characterLength(i[o]);return s},e.slice=function(n,i,s){textLen=e.length(n),i=i||0,s=s||1,i<0&&(i=textLen+i),s<0&&(s=textLen+s);for(var o="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],h=e.length(l);if(a>=i-(h==2?1:0))if(a+h<=s)o+=l;else break;a+=h}return o}})(VE);var Bq=VE.exports,Mq=HE(Bq),qq=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},Uq=HE(qq);function ou(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=UE(t),t.length===0))return 0;t=t.replace(Uq()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let s=i.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(Mq.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var lm=10,PE=(t=0)=>e=>`\x1B[${e+t}m`,RE=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,NE=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Qe={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(Qe.modifier);var Hq=Object.keys(Qe.color),Vq=Object.keys(Qe.bgColor);[...Hq,...Vq];function zq(){let t=new Map;for(let[e,r]of Object.entries(Qe)){for(let[n,i]of Object.entries(r))Qe[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Qe[n],t.set(i[0],i[1]);Object.defineProperty(Qe,e,{value:r,enumerable:!1})}return Object.defineProperty(Qe,"codes",{value:t,enumerable:!1}),Qe.color.close="\x1B[39m",Qe.bgColor.close="\x1B[49m",Qe.color.ansi=PE(),Qe.color.ansi256=RE(),Qe.color.ansi16m=NE(),Qe.bgColor.ansi=PE(lm),Qe.bgColor.ansi256=RE(lm),Qe.bgColor.ansi16m=NE(lm),Object.defineProperties(Qe,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Qe.rgbToAnsi256(...Qe.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Qe.ansi256ToAnsi(Qe.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Qe.ansi256ToAnsi(Qe.hexToAnsi256(e)),enumerable:!1}}),Qe}var Gq=zq(),El=new Set(["\x1B","\x9B"]),Kq=39,pm="\x07",zE="[",Wq="]",GE="m",mm=`${Wq}8;;`,$E=t=>`${El.values().next().value}${zE}${t}${GE}`,LE=t=>`${El.values().next().value}${mm}${t}${pm}`,Xq=t=>t.split(" ").map(e=>ou(e)),fm=(t,e,r)=>{let n=[...e],i=!1,s=!1,o=ou(UE(t[t.length-1]));for(let[a,u]of n.entries()){let c=ou(u);if(o+c<=r?t[t.length-1]+=u:(t.push(u),o=0),El.has(u)&&(i=!0,s=n.slice(a+1).join("").startsWith(mm)),i){s?u===pm&&(i=!1,s=!1):u===GE&&(i=!1);continue}o+=c,o===r&&a<n.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},Yq=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(ou(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},Jq=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,s,o=Xq(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let h=ou(a[a.length-1]);if(c!==0&&(h>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),h=0),(h>0||r.trim===!1)&&(a[a.length-1]+=" ",h++)),r.hard&&o[c]>e){let d=e-h,f=1+Math.floor((o[c]-d-1)/e);Math.floor((o[c]-1)/e)<f&&a.push(""),fm(a,l,e);continue}if(h+o[c]>e&&h>0&&o[c]>0){if(r.wordWrap===!1&&h<e){fm(a,l,e);continue}a.push("")}if(h+o[c]>e&&r.wordWrap===!1){fm(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>Yq(c)));let u=[...a.join(`
|
|
237
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var y8=Rr(()=>{g8()});async function jv(t=tle){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!r)throw new Ap(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=rle[n];if(!i)throw new Ap(`Unknown browser ID: ${n}`);return i}var D8,w8,tle,rle,Ap,b8=Rr(()=>{D8=require("node:util"),w8=require("node:child_process"),tle=(0,D8.promisify)(w8.execFile),rle={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},Ap=class extends Error{}});async function Bv(){if(Op.default.platform==="darwin"){let t=await Nv();return{name:await Lv(t),id:t}}if(Op.default.platform==="linux"){let{stdout:t}=await nle("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:ile(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Op.default.platform==="win32")return jv();throw new Error("Only macOS, Linux, and Windows are supported")}var v8,Op,E8,nle,ile,_8=Rr(()=>{v8=require("node:util"),Op=xe(require("node:process"),1),E8=require("node:child_process");h8();y8();b8();nle=(0,v8.promisify)(E8.execFile),ile=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var zv={};om(zv,{apps:()=>rs,default:()=>cle,openApp:()=>ule});async function ole(){let t=await Rv(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=Uv.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await sle(t,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",r],{encoding:"utf8"}),i=n.trim(),s={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return s[i]?{id:s[i]}:{}}function O8(t){if(typeof t=="string"||Array.isArray(t))return t;let{[S8]:e}=t;if(!e)throw new Error(`${S8} is not supported`);return e}function Tp({[Va]:t},{wsl:e}){if(e&&es)return O8(e);if(!t)throw new Error(`${Va} is not supported`);return O8(t)}var qv,Uv,Hv,x8,T8,Vv,xp,lle,sle,Mv,C8,Va,S8,A8,el,ale,ule,rs,cle,Gv=Rr(()=>{qv=xe(require("node:process"),1),Uv=require("node:buffer"),Hv=xe(require("node:path"),1),x8=require("node:url"),T8=require("node:util"),Vv=xe(require("node:child_process"),1),xp=xe(require("node:fs/promises"),1);a8();u8();_8();Fv();lle={},sle=(0,T8.promisify)(Vv.default.execFile),Mv=Hv.default.dirname((0,x8.fileURLToPath)(lle.url)),C8=Hv.default.join(Mv,"xdg-open"),{platform:Va,arch:S8}=qv.default;A8=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},el=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return A8(t.app,a=>el({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return A8(e,a=>el({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=es?await ole():await Bv();if(c.id in a){let l=a[c.id];return e==="browserPrivate"&&r.push(u[l]),el({...t,app:{name:rs[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],s={};if(Va==="darwin")n="open",t.wait&&i.push("--wait-apps"),t.background&&i.push("--background"),t.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(Va==="win32"||es&&!Ha()&&!e){n=await Rv(),i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),es||(s.windowsVerbatimArguments=!0);let a=["Start"];t.wait&&a.push("-Wait"),e?(a.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&a.push(`"${t.target}"`),r.length>0&&(r=r.map(u=>`"\`"${u}\`""`),a.push("-ArgumentList",r.join(","))),t.target=Uv.Buffer.from(a.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!Mv||Mv==="/",u=!1;try{await xp.default.access(C8,xp.constants.X_OK),u=!0}catch{}n=qv.default.versions.electron??(Va==="android"||a||!u)?"xdg-open":C8}r.length>0&&i.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}Va==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let o=Vv.default.spawn(n,i,s);return t.wait?new Promise((a,u)=>{o.once("error",u),o.once("close",c=>{if(!t.allowNonzeroExitCode&&c>0){u(new Error(`Exited with code ${c}`));return}a(o)})}):(o.unref(),o)},ale=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return el({...e,target:t})},ule=(t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return el({...e,app:{name:t,arguments:r}})};rs={};ts(rs,"chrome",()=>Tp({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));ts(rs,"brave",()=>Tp({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));ts(rs,"firefox",()=>Tp({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));ts(rs,"edge",()=>Tp({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));ts(rs,"browser",()=>"browser");ts(rs,"browserPrivate",()=>"browserPrivate");cle=ale});var Yp=E(Jr=>{"use strict";Jr.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;Jr.find=(t,e)=>t.nodes.find(r=>r.type===e);Jr.exceedsLimit=(t,e,r=1,n)=>n===!1||!Jr.isInteger(t)||!Jr.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;Jr.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};Jr.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;Jr.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;Jr.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;Jr.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);Jr.flatten=(...t)=>{let e=[],r=n=>{for(let i=0;i<n.length;i++){let s=n[i];if(Array.isArray(s)){r(s);continue}s!==void 0&&e.push(s)}return e};return r(t),e}});var Jp=E((q_e,MM)=>{"use strict";var BM=Yp();MM.exports=(t,e={})=>{let r=(n,i={})=>{let s=e.escapeInvalid&&BM.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&BM.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(t)}});var UM=E((U_e,qM)=>{"use strict";qM.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var JM=E((H_e,YM)=>{"use strict";var HM=UM(),fo=(t,e,r)=>{if(HM(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(HM(e)===!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 i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),u=t+":"+e+"="+i+s+o+a;if(fo.cache.hasOwnProperty(u))return fo.cache[u].result;let c=Math.min(t,e),l=Math.max(t,e);if(Math.abs(c-l)===1){let g=t+"|"+e;return n.capture?`(${g})`:n.wrap===!1?g:`(?:${g})`}let h=XM(t)||XM(e),d={min:t,max:e,a:c,b:l},f=[],m=[];if(h&&(d.isPadded=h,d.maxLen=String(d.max).length),c<0){let g=l<0?Math.abs(l):1;m=VM(g,Math.abs(c),d,n),c=d.a=0}return l>=0&&(f=VM(c,l,d,n)),d.negatives=m,d.positives=f,d.result=Hle(m,f,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&f.length+m.length>1&&(d.result=`(?:${d.result})`),fo.cache[u]=d,d.result};function Hle(t,e,r){let n=cE(t,e,"-",!1,r)||[],i=cE(e,t,"",!1,r)||[],s=cE(t,e,"-?",!0,r)||[];return n.concat(s).concat(i).join("|")}function Vle(t,e){let r=1,n=1,i=GM(t,r),s=new Set([e]);for(;t<=i&&i<=e;)s.add(i),r+=1,i=GM(t,r);for(i=KM(e+1,n)-1;t<i&&i<=e;)s.add(i),n+=1,i=KM(e+1,n)-1;return s=[...s],s.sort(Kle),s}function zle(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=Gle(t,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[u,c]=n[a];u===c?s+=u:u!=="0"||c!=="9"?s+=Wle(u,c,r):o++}return o&&(s+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function VM(t,e,r,n){let i=Vle(t,e),s=[],o=t,a;for(let u=0;u<i.length;u++){let c=i[u],l=zle(String(o),String(c),n),h="";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+WM(a.count),o=c+1;continue}r.isPadded&&(h=Xle(c,r,n)),l.string=h+l.pattern+WM(l.count),s.push(l),o=c+1,a=l}return s}function cE(t,e,r,n,i){let s=[];for(let o of t){let{string:a}=o;!n&&!zM(e,"string",a)&&s.push(r+a),n&&zM(e,"string",a)&&s.push(r+a)}return s}function Gle(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function Kle(t,e){return t>e?1:e>t?-1:0}function zM(t,e,r){return t.some(n=>n[e]===r)}function GM(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function KM(t,e){return t-t%Math.pow(10,e)}function WM(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function Wle(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function XM(t){return/^-?(0+)\d/.test(t)}function Xle(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),i=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}fo.cache={};fo.clearCache=()=>fo.cache={};YM.exports=fo});var hE=E((V_e,i6)=>{"use strict";var Yle=require("util"),QM=JM(),ZM=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Jle=t=>e=>t===!0?Number(e):String(e),lE=t=>typeof t=="number"||typeof t=="string"&&t!=="",cl=t=>Number.isInteger(+t),fE=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},Zle=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,Qle=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return r===!1?String(t):t},Qp=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},efe=(t,e,r)=>{t.negatives.sort((a,u)=>a<u?-1:a>u?1:0),t.positives.sort((a,u)=>a<u?-1:a>u?1:0);let n=e.capture?"":"?:",i="",s="",o;return t.positives.length&&(i=t.positives.map(a=>Qp(String(a),r)).join("|")),t.negatives.length&&(s=`-(${n}${t.negatives.map(a=>Qp(String(a),r)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},e6=(t,e,r,n)=>{if(r)return QM(t,e,{wrap:!1,...n});let i=String.fromCharCode(t);if(t===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},t6=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,i=r.capture?"":"?:";return n?`(${i}${t.join("|")})`:t.join("|")}return QM(t,e,r)},r6=(...t)=>new RangeError("Invalid range arguments: "+Yle.inspect(...t)),n6=(t,e,r)=>{if(r.strictRanges===!0)throw r6([t,e]);return[]},tfe=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},rfe=(t,e,r=1,n={})=>{let i=Number(t),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw r6([t,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(t),u=String(e),c=String(r);r=Math.max(Math.abs(r),1);let l=fE(a)||fE(u)||fE(c),h=l?Math.max(a.length,u.length,c.length):0,d=l===!1&&Zle(t,e,n)===!1,f=n.transform||Jle(d);if(n.toRegex&&r===1)return e6(Qp(t,h),Qp(e,h),!0,n);let m={negatives:[],positives:[]},g=A=>m[A<0?"negatives":"positives"].push(Math.abs(A)),b=[],S=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&r>1?g(i):b.push(Qle(f(i,S),h,d)),i=o?i-r:i+r,S++;return n.toRegex===!0?r>1?efe(m,n,h):t6(b,null,{wrap:!1,...n}):b},nfe=(t,e,r=1,n={})=>{if(!cl(t)&&t.length>1||!cl(e)&&e.length>1)return n6(t,e,n);let i=n.transform||(d=>String.fromCharCode(d)),s=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,u=Math.min(s,o),c=Math.max(s,o);if(n.toRegex&&r===1)return e6(u,c,!1,n);let l=[],h=0;for(;a?s>=o:s<=o;)l.push(i(s,h)),s=a?s-r:s+r,h++;return n.toRegex===!0?t6(l,null,{wrap:!1,options:n}):l},Zp=(t,e,r,n={})=>{if(e==null&&lE(t))return[t];if(!lE(t)||!lE(e))return n6(t,e,n);if(typeof r=="function")return Zp(t,e,1,{transform:r});if(ZM(r))return Zp(t,e,0,r);let i={...n};return i.capture===!0&&(i.wrap=!0),r=r||i.step||1,cl(r)?cl(t)&&cl(e)?rfe(t,e,r,i):nfe(t,e,Math.max(Math.abs(r),1),i):r!=null&&!ZM(r)?tfe(r,i):Zp(t,e,1,r)};i6.exports=Zp});var a6=E((z_e,o6)=>{"use strict";var ife=hE(),s6=Yp(),sfe=(t,e={})=>{let r=(n,i={})=>{let s=s6.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,u=e.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=s6.reduce(n.nodes),h=ife(...l,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(h.length!==0)return l.length>1&&h.length>1?`(${h})`:h}if(n.nodes)for(let l of n.nodes)c+=r(l,n);return c};return r(t)};o6.exports=sfe});var l6=E((G_e,c6)=>{"use strict";var ofe=hE(),u6=Jp(),nu=Yp(),ho=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?nu.flatten(e).map(i=>`{${i}}`):e;for(let i of t)if(Array.isArray(i))for(let s of i)n.push(ho(s,e,r));else for(let s of e)r===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?ho(i,s,r):i+s);return nu.flatten(n)},afe=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(ho(a.pop(),u6(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(ho(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let h=nu.reduce(i.nodes);if(nu.exceedsLimit(...h,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=ofe(...h,e);d.length===0&&(d=u6(i,e)),a.push(ho(a.pop(),d)),i.nodes=[];return}let u=nu.encloseBrace(i),c=i.queue,l=i;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,c=l.queue;for(let h=0;h<i.nodes.length;h++){let d=i.nodes[h];if(d.type==="comma"&&i.type==="brace"){h===1&&c.push(""),c.push("");continue}if(d.type==="close"){a.push(ho(a.pop(),c,u));continue}if(d.value&&d.type!=="open"){c.push(ho(c.pop(),d.value));continue}d.nodes&&n(d,i)}return c};return nu.flatten(n(t))};c6.exports=afe});var h6=E((K_e,f6)=>{"use strict";f6.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:`
|
|
238
|
+
`,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 y6=E((W_e,g6)=>{"use strict";var ufe=Jp(),{MAX_LENGTH:d6,CHAR_BACKSLASH:dE,CHAR_BACKTICK:cfe,CHAR_COMMA:lfe,CHAR_DOT:ffe,CHAR_LEFT_PARENTHESES:hfe,CHAR_RIGHT_PARENTHESES:dfe,CHAR_LEFT_CURLY_BRACE:pfe,CHAR_RIGHT_CURLY_BRACE:mfe,CHAR_LEFT_SQUARE_BRACKET:p6,CHAR_RIGHT_SQUARE_BRACKET:m6,CHAR_DOUBLE_QUOTE:gfe,CHAR_SINGLE_QUOTE:yfe,CHAR_NO_BREAK_SPACE:Dfe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:wfe}=h6(),bfe=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(d6,r.maxLength):d6;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let i={type:"root",input:t,nodes:[]},s=[i],o=i,a=i,u=0,c=t.length,l=0,h=0,d,f=()=>t[l++],m=g=>{if(g.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&g.type==="text"){a.value+=g.value;return}return o.nodes.push(g),g.parent=o,g.prev=a,a=g,g};for(m({type:"bos"});l<c;)if(o=s[s.length-1],d=f(),!(d===wfe||d===Dfe)){if(d===dE){m({type:"text",value:(e.keepEscaping?d:"")+f()});continue}if(d===m6){m({type:"text",value:"\\"+d});continue}if(d===p6){u++;let g;for(;l<c&&(g=f());){if(d+=g,g===p6){u++;continue}if(g===dE){d+=f();continue}if(g===m6&&(u--,u===0))break}m({type:"text",value:d});continue}if(d===hfe){o=m({type:"paren",nodes:[]}),s.push(o),m({type:"text",value:d});continue}if(d===dfe){if(o.type!=="paren"){m({type:"text",value:d});continue}o=s.pop(),m({type:"text",value:d}),o=s[s.length-1];continue}if(d===gfe||d===yfe||d===cfe){let g=d,b;for(e.keepQuotes!==!0&&(d="");l<c&&(b=f());){if(b===dE){d+=b+f();continue}if(b===g){e.keepQuotes===!0&&(d+=b);break}d+=b}m({type:"text",value:d});continue}if(d===pfe){h++;let b={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:h,commas:0,ranges:0,nodes:[]};o=m(b),s.push(o),m({type:"open",value:d});continue}if(d===mfe){if(o.type!=="brace"){m({type:"text",value:d});continue}let g="close";o=s.pop(),o.close=!0,m({type:g,value:d}),h--,o=s[s.length-1];continue}if(d===lfe&&h>0){if(o.ranges>0){o.ranges=0;let g=o.nodes.shift();o.nodes=[g,{type:"text",value:ufe(o)}]}m({type:"comma",value:d}),o.commas++;continue}if(d===ffe&&h>0&&o.commas===0){let g=o.nodes;if(h===0||g.length===0){m({type:"text",value:d});continue}if(a.type==="dot"){if(o.range=[],a.value+=d,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){g.pop();let b=g[g.length-1];b.value+=a.value+d,a=b,o.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(S=>{S.nodes||(S.type==="open"&&(S.isOpen=!0),S.type==="close"&&(S.isClose=!0),S.nodes||(S.type="text"),S.invalid=!0)});let g=s[s.length-1],b=g.nodes.indexOf(o);g.nodes.splice(b,1,...o.nodes)}while(s.length>0);return m({type:"eos"}),i};g6.exports=bfe});var b6=E((X_e,w6)=>{"use strict";var D6=Jp(),vfe=a6(),Efe=l6(),_fe=y6(),kr=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let i=kr.create(n,e);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(kr.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};kr.parse=(t,e={})=>_fe(t,e);kr.stringify=(t,e={})=>D6(typeof t=="string"?kr.parse(t,e):t,e);kr.compile=(t,e={})=>(typeof t=="string"&&(t=kr.parse(t,e)),vfe(t,e));kr.expand=(t,e={})=>{typeof t=="string"&&(t=kr.parse(t,e));let r=Efe(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};kr.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?kr.compile(t,e):kr.expand(t,e);w6.exports=kr});var ll=E((Y_e,S6)=>{"use strict";var Cfe=require("path"),Mn="\\\\/",v6=`[^${Mn}]`,wi="\\.",Sfe="\\+",Afe="\\?",em="\\/",Ofe="(?=.)",E6="[^/]",pE=`(?:${em}|$)`,_6=`(?:^|${em})`,mE=`${wi}{1,2}${pE}`,xfe=`(?!${wi})`,Tfe=`(?!${_6}${mE})`,Ffe=`(?!${wi}{0,1}${pE})`,Ife=`(?!${mE})`,kfe=`[^.${em}]`,Pfe=`${E6}*?`,C6={DOT_LITERAL:wi,PLUS_LITERAL:Sfe,QMARK_LITERAL:Afe,SLASH_LITERAL:em,ONE_CHAR:Ofe,QMARK:E6,END_ANCHOR:pE,DOTS_SLASH:mE,NO_DOT:xfe,NO_DOTS:Tfe,NO_DOT_SLASH:Ffe,NO_DOTS_SLASH:Ife,QMARK_NO_DOT:kfe,STAR:Pfe,START_ANCHOR:_6},Rfe={...C6,SLASH_LITERAL:`[${Mn}]`,QMARK:v6,STAR:`${v6}*?`,DOTS_SLASH:`${wi}{1,2}(?:[${Mn}]|$)`,NO_DOT:`(?!${wi})`,NO_DOTS:`(?!(?:^|[${Mn}])${wi}{1,2}(?:[${Mn}]|$))`,NO_DOT_SLASH:`(?!${wi}{0,1}(?:[${Mn}]|$))`,NO_DOTS_SLASH:`(?!${wi}{1,2}(?:[${Mn}]|$))`,QMARK_NO_DOT:`[^.${Mn}]`,START_ANCHOR:`(?:^|[${Mn}])`,END_ANCHOR:`(?:[${Mn}]|$)`},Nfe={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"};S6.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Nfe,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:Cfe.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Rfe:C6}}});var fl=E(Or=>{"use strict";var $fe=require("path"),Lfe=process.platform==="win32",{REGEX_BACKSLASH:jfe,REGEX_REMOVE_BACKSLASH:Bfe,REGEX_SPECIAL_CHARS:Mfe,REGEX_SPECIAL_CHARS_GLOBAL:qfe}=ll();Or.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Or.hasRegexChars=t=>Mfe.test(t);Or.isRegexChar=t=>t.length===1&&Or.hasRegexChars(t);Or.escapeRegex=t=>t.replace(qfe,"\\$1");Or.toPosixSlashes=t=>t.replace(jfe,"/");Or.removeBackslashes=t=>t.replace(Bfe,e=>e==="\\"?"":e);Or.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Or.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:Lfe===!0||$fe.sep==="\\";Or.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Or.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Or.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Or.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",s=`${n}(?:${t})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var P6=E((Z_e,k6)=>{"use strict";var A6=fl(),{CHAR_ASTERISK:gE,CHAR_AT:Ufe,CHAR_BACKWARD_SLASH:hl,CHAR_COMMA:Hfe,CHAR_DOT:yE,CHAR_EXCLAMATION_MARK:DE,CHAR_FORWARD_SLASH:I6,CHAR_LEFT_CURLY_BRACE:wE,CHAR_LEFT_PARENTHESES:bE,CHAR_LEFT_SQUARE_BRACKET:Vfe,CHAR_PLUS:zfe,CHAR_QUESTION_MARK:O6,CHAR_RIGHT_CURLY_BRACE:Gfe,CHAR_RIGHT_PARENTHESES:x6,CHAR_RIGHT_SQUARE_BRACKET:Kfe}=ll(),T6=t=>t===I6||t===hl,F6=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Wfe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,s=[],o=[],a=[],u=t,c=-1,l=0,h=0,d=!1,f=!1,m=!1,g=!1,b=!1,S=!1,A=!1,p=!1,D=!1,y=!1,C=0,k,v,R={value:"",depth:0,isGlob:!1},P=()=>c>=n,F=()=>u.charCodeAt(c+1),j=()=>(k=v,u.charCodeAt(++c));for(;c<n;){v=j();let T;if(v===hl){A=R.backslashes=!0,v=j(),v===wE&&(S=!0);continue}if(S===!0||v===wE){for(C++;P()!==!0&&(v=j());){if(v===hl){A=R.backslashes=!0,j();continue}if(v===wE){C++;continue}if(S!==!0&&v===yE&&(v=j())===yE){if(d=R.isBrace=!0,m=R.isGlob=!0,y=!0,i===!0)continue;break}if(S!==!0&&v===Hfe){if(d=R.isBrace=!0,m=R.isGlob=!0,y=!0,i===!0)continue;break}if(v===Gfe&&(C--,C===0)){S=!1,d=R.isBrace=!0,y=!0;break}}if(i===!0)continue;break}if(v===I6){if(s.push(c),o.push(R),R={value:"",depth:0,isGlob:!1},y===!0)continue;if(k===yE&&c===l+1){l+=2;continue}h=c+1;continue}if(r.noext!==!0&&(v===zfe||v===Ufe||v===gE||v===O6||v===DE)===!0&&F()===bE){if(m=R.isGlob=!0,g=R.isExtglob=!0,y=!0,v===DE&&c===l&&(D=!0),i===!0){for(;P()!==!0&&(v=j());){if(v===hl){A=R.backslashes=!0,v=j();continue}if(v===x6){m=R.isGlob=!0,y=!0;break}}continue}break}if(v===gE){if(k===gE&&(b=R.isGlobstar=!0),m=R.isGlob=!0,y=!0,i===!0)continue;break}if(v===O6){if(m=R.isGlob=!0,y=!0,i===!0)continue;break}if(v===Vfe){for(;P()!==!0&&(T=j());){if(T===hl){A=R.backslashes=!0,j();continue}if(T===Kfe){f=R.isBracket=!0,m=R.isGlob=!0,y=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&v===DE&&c===l){p=R.negated=!0,l++;continue}if(r.noparen!==!0&&v===bE){if(m=R.isGlob=!0,i===!0){for(;P()!==!0&&(v=j());){if(v===bE){A=R.backslashes=!0,v=j();continue}if(v===x6){y=!0;break}}continue}break}if(m===!0){if(y=!0,i===!0)continue;break}}r.noext===!0&&(g=!1,m=!1);let U=u,G="",L="";l>0&&(G=u.slice(0,l),u=u.slice(l),h-=l),U&&m===!0&&h>0?(U=u.slice(0,h),L=u.slice(h)):m===!0?(U="",L=u):U=u,U&&U!==""&&U!=="/"&&U!==u&&T6(U.charCodeAt(U.length-1))&&(U=U.slice(0,-1)),r.unescape===!0&&(L&&(L=A6.removeBackslashes(L)),U&&A===!0&&(U=A6.removeBackslashes(U)));let _={prefix:G,input:t,start:l,base:U,glob:L,isBrace:d,isBracket:f,isGlob:m,isExtglob:g,isGlobstar:b,negated:p,negatedExtglob:D};if(r.tokens===!0&&(_.maxDepth=0,T6(v)||o.push(R),_.tokens=o),r.parts===!0||r.tokens===!0){let T;for(let I=0;I<s.length;I++){let $=T?T+1:l,M=s[I],B=t.slice($,M);r.tokens&&(I===0&&l!==0?(o[I].isPrefix=!0,o[I].value=G):o[I].value=B,F6(o[I]),_.maxDepth+=o[I].depth),(I!==0||B!=="")&&a.push(B),T=M}if(T&&T+1<t.length){let I=t.slice(T+1);a.push(I),r.tokens&&(o[o.length-1].value=I,F6(o[o.length-1]),_.maxDepth+=o[o.length-1].depth)}_.slashes=s,_.parts=a}return _};k6.exports=Wfe});var $6=E((Q_e,N6)=>{"use strict";var tm=ll(),Pr=fl(),{MAX_LENGTH:rm,POSIX_REGEX_SOURCE:Xfe,REGEX_NON_SPECIAL_CHARS:Yfe,REGEX_SPECIAL_CHARS_BACKREF:Jfe,REPLACEMENTS:R6}=tm,Zfe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>Pr.escapeRegex(i)).join("..")}return r},iu=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,vE=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=R6[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(rm,r.maxLength):rm,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},o=[s],a=r.capture?"":"?:",u=Pr.isWindows(e),c=tm.globChars(u),l=tm.extglobChars(c),{DOT_LITERAL:h,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:m,DOTS_SLASH:g,NO_DOT:b,NO_DOT_SLASH:S,NO_DOTS_SLASH:A,QMARK:p,QMARK_NO_DOT:D,STAR:y,START_ANCHOR:C}=c,k=N=>`(${a}(?:(?!${C}${N.dot?g:h}).)*?)`,v=r.dot?"":b,R=r.dot?p:D,P=r.bash===!0?k(r):y;r.capture&&(P=`(${P})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let F={input:t,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:o};t=Pr.removePrefix(t,F),i=t.length;let j=[],U=[],G=[],L=s,_,T=()=>F.index===i-1,I=F.peek=(N=1)=>t[F.index+N],$=F.advance=()=>t[++F.index]||"",M=()=>t.slice(F.index+1),B=(N="",re=0)=>{F.consumed+=N,F.index+=re},K=N=>{F.output+=N.output!=null?N.output:N.value,B(N.value)},q=()=>{let N=1;for(;I()==="!"&&(I(2)!=="("||I(3)==="?");)$(),F.start++,N++;return N%2===0?!1:(F.negated=!0,F.start++,!0)},V=N=>{F[N]++,G.push(N)},ae=N=>{F[N]--,G.pop()},x=N=>{if(L.type==="globstar"){let re=F.braces>0&&(N.type==="comma"||N.type==="brace"),z=N.extglob===!0||j.length&&(N.type==="pipe"||N.type==="paren");N.type!=="slash"&&N.type!=="paren"&&!re&&!z&&(F.output=F.output.slice(0,-L.output.length),L.type="star",L.value="*",L.output=P,F.output+=L.output)}if(j.length&&N.type!=="paren"&&(j[j.length-1].inner+=N.value),(N.value||N.output)&&K(N),L&&L.type==="text"&&N.type==="text"){L.value+=N.value,L.output=(L.output||"")+N.value;return}N.prev=L,o.push(N),L=N},O=(N,re)=>{let z={...l[re],conditions:1,inner:""};z.prev=L,z.parens=F.parens,z.output=F.output;let ie=(r.capture?"(":"")+z.open;V("parens"),x({type:N,value:re,output:F.output?"":m}),x({type:"paren",extglob:!0,value:$(),output:ie}),j.push(z)},H=N=>{let re=N.close+(r.capture?")":""),z;if(N.type==="negate"){let ie=P;if(N.inner&&N.inner.length>1&&N.inner.includes("/")&&(ie=k(r)),(ie!==P||T()||/^\)+$/.test(M()))&&(re=N.close=`)$))${ie}`),N.inner.includes("*")&&(z=M())&&/^\.[^\\/.]+$/.test(z)){let we=vE(z,{...e,fastpaths:!1}).output;re=N.close=`)${we})${ie})`}N.prev.type==="bos"&&(F.negatedExtglob=!0)}x({type:"paren",extglob:!0,value:_,output:re}),ae("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let N=!1,re=t.replace(Jfe,(z,ie,we,Oe,Me,yt)=>Oe==="\\"?(N=!0,z):Oe==="?"?ie?ie+Oe+(Me?p.repeat(Me.length):""):yt===0?R+(Me?p.repeat(Me.length):""):p.repeat(we.length):Oe==="."?h.repeat(we.length):Oe==="*"?ie?ie+Oe+(Me?P:""):P:ie?z:`\\${z}`);return N===!0&&(r.unescape===!0?re=re.replace(/\\/g,""):re=re.replace(/\\+/g,z=>z.length%2===0?"\\\\":z?"\\":"")),re===t&&r.contains===!0?(F.output=t,F):(F.output=Pr.wrapOutput(re,F,e),F)}for(;!T();){if(_=$(),_==="\0")continue;if(_==="\\"){let z=I();if(z==="/"&&r.bash!==!0||z==="."||z===";")continue;if(!z){_+="\\",x({type:"text",value:_});continue}let ie=/^\\+/.exec(M()),we=0;if(ie&&ie[0].length>2&&(we=ie[0].length,F.index+=we,we%2!==0&&(_+="\\")),r.unescape===!0?_=$():_+=$(),F.brackets===0){x({type:"text",value:_});continue}}if(F.brackets>0&&(_!=="]"||L.value==="["||L.value==="[^")){if(r.posix!==!1&&_===":"){let z=L.value.slice(1);if(z.includes("[")&&(L.posix=!0,z.includes(":"))){let ie=L.value.lastIndexOf("["),we=L.value.slice(0,ie),Oe=L.value.slice(ie+2),Me=Xfe[Oe];if(Me){L.value=we+Me,F.backtrack=!0,$(),!s.output&&o.indexOf(L)===1&&(s.output=m);continue}}}(_==="["&&I()!==":"||_==="-"&&I()==="]")&&(_=`\\${_}`),_==="]"&&(L.value==="["||L.value==="[^")&&(_=`\\${_}`),r.posix===!0&&_==="!"&&L.value==="["&&(_="^"),L.value+=_,K({value:_});continue}if(F.quotes===1&&_!=='"'){_=Pr.escapeRegex(_),L.value+=_,K({value:_});continue}if(_==='"'){F.quotes=F.quotes===1?0:1,r.keepQuotes===!0&&x({type:"text",value:_});continue}if(_==="("){V("parens"),x({type:"paren",value:_});continue}if(_===")"){if(F.parens===0&&r.strictBrackets===!0)throw new SyntaxError(iu("opening","("));let z=j[j.length-1];if(z&&F.parens===z.parens+1){H(j.pop());continue}x({type:"paren",value:_,output:F.parens?")":"\\)"}),ae("parens");continue}if(_==="["){if(r.nobracket===!0||!M().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(iu("closing","]"));_=`\\${_}`}else V("brackets");x({type:"bracket",value:_});continue}if(_==="]"){if(r.nobracket===!0||L&&L.type==="bracket"&&L.value.length===1){x({type:"text",value:_,output:`\\${_}`});continue}if(F.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(iu("opening","["));x({type:"text",value:_,output:`\\${_}`});continue}ae("brackets");let z=L.value.slice(1);if(L.posix!==!0&&z[0]==="^"&&!z.includes("/")&&(_=`/${_}`),L.value+=_,K({value:_}),r.literalBrackets===!1||Pr.hasRegexChars(z))continue;let ie=Pr.escapeRegex(L.value);if(F.output=F.output.slice(0,-L.value.length),r.literalBrackets===!0){F.output+=ie,L.value=ie;continue}L.value=`(${a}${ie}|${L.value})`,F.output+=L.value;continue}if(_==="{"&&r.nobrace!==!0){V("braces");let z={type:"brace",value:_,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};U.push(z),x(z);continue}if(_==="}"){let z=U[U.length-1];if(r.nobrace===!0||!z){x({type:"text",value:_,output:_});continue}let ie=")";if(z.dots===!0){let we=o.slice(),Oe=[];for(let Me=we.length-1;Me>=0&&(o.pop(),we[Me].type!=="brace");Me--)we[Me].type!=="dots"&&Oe.unshift(we[Me].value);ie=Zfe(Oe,r),F.backtrack=!0}if(z.comma!==!0&&z.dots!==!0){let we=F.output.slice(0,z.outputIndex),Oe=F.tokens.slice(z.tokensIndex);z.value=z.output="\\{",_=ie="\\}",F.output=we;for(let Me of Oe)F.output+=Me.output||Me.value}x({type:"brace",value:_,output:ie}),ae("braces"),U.pop();continue}if(_==="|"){j.length>0&&j[j.length-1].conditions++,x({type:"text",value:_});continue}if(_===","){let z=_,ie=U[U.length-1];ie&&G[G.length-1]==="braces"&&(ie.comma=!0,z="|"),x({type:"comma",value:_,output:z});continue}if(_==="/"){if(L.type==="dot"&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",o.pop(),L=s;continue}x({type:"slash",value:_,output:f});continue}if(_==="."){if(F.braces>0&&L.type==="dot"){L.value==="."&&(L.output=h);let z=U[U.length-1];L.type="dots",L.output+=_,L.value+=_,z.dots=!0;continue}if(F.braces+F.parens===0&&L.type!=="bos"&&L.type!=="slash"){x({type:"text",value:_,output:h});continue}x({type:"dot",value:_,output:h});continue}if(_==="?"){if(!(L&&L.value==="(")&&r.noextglob!==!0&&I()==="("&&I(2)!=="?"){O("qmark",_);continue}if(L&&L.type==="paren"){let ie=I(),we=_;if(ie==="<"&&!Pr.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(L.value==="("&&!/[!=<:]/.test(ie)||ie==="<"&&!/<([!=]|\w+>)/.test(M()))&&(we=`\\${_}`),x({type:"text",value:_,output:we});continue}if(r.dot!==!0&&(L.type==="slash"||L.type==="bos")){x({type:"qmark",value:_,output:D});continue}x({type:"qmark",value:_,output:p});continue}if(_==="!"){if(r.noextglob!==!0&&I()==="("&&(I(2)!=="?"||!/[!=<:]/.test(I(3)))){O("negate",_);continue}if(r.nonegate!==!0&&F.index===0){q();continue}}if(_==="+"){if(r.noextglob!==!0&&I()==="("&&I(2)!=="?"){O("plus",_);continue}if(L&&L.value==="("||r.regex===!1){x({type:"plus",value:_,output:d});continue}if(L&&(L.type==="bracket"||L.type==="paren"||L.type==="brace")||F.parens>0){x({type:"plus",value:_});continue}x({type:"plus",value:d});continue}if(_==="@"){if(r.noextglob!==!0&&I()==="("&&I(2)!=="?"){x({type:"at",extglob:!0,value:_,output:""});continue}x({type:"text",value:_});continue}if(_!=="*"){(_==="$"||_==="^")&&(_=`\\${_}`);let z=Yfe.exec(M());z&&(_+=z[0],F.index+=z[0].length),x({type:"text",value:_});continue}if(L&&(L.type==="globstar"||L.star===!0)){L.type="star",L.star=!0,L.value+=_,L.output=P,F.backtrack=!0,F.globstar=!0,B(_);continue}let N=M();if(r.noextglob!==!0&&/^\([^?]/.test(N)){O("star",_);continue}if(L.type==="star"){if(r.noglobstar===!0){B(_);continue}let z=L.prev,ie=z.prev,we=z.type==="slash"||z.type==="bos",Oe=ie&&(ie.type==="star"||ie.type==="globstar");if(r.bash===!0&&(!we||N[0]&&N[0]!=="/")){x({type:"star",value:_,output:""});continue}let Me=F.braces>0&&(z.type==="comma"||z.type==="brace"),yt=j.length&&(z.type==="pipe"||z.type==="paren");if(!we&&z.type!=="paren"&&!Me&&!yt){x({type:"star",value:_,output:""});continue}for(;N.slice(0,3)==="/**";){let dr=t[F.index+4];if(dr&&dr!=="/")break;N=N.slice(3),B("/**",3)}if(z.type==="bos"&&T()){L.type="globstar",L.value+=_,L.output=k(r),F.output=L.output,F.globstar=!0,B(_);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&!Oe&&T()){F.output=F.output.slice(0,-(z.output+L.output).length),z.output=`(?:${z.output}`,L.type="globstar",L.output=k(r)+(r.strictSlashes?")":"|$)"),L.value+=_,F.globstar=!0,F.output+=z.output+L.output,B(_);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&N[0]==="/"){let dr=N[1]!==void 0?"|$":"";F.output=F.output.slice(0,-(z.output+L.output).length),z.output=`(?:${z.output}`,L.type="globstar",L.output=`${k(r)}${f}|${f}${dr})`,L.value+=_,F.output+=z.output+L.output,F.globstar=!0,B(_+$()),x({type:"slash",value:"/",output:""});continue}if(z.type==="bos"&&N[0]==="/"){L.type="globstar",L.value+=_,L.output=`(?:^|${f}|${k(r)}${f})`,F.output=L.output,F.globstar=!0,B(_+$()),x({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-L.output.length),L.type="globstar",L.output=k(r),L.value+=_,F.output+=L.output,F.globstar=!0,B(_);continue}let re={type:"star",value:_,output:P};if(r.bash===!0){re.output=".*?",(L.type==="bos"||L.type==="slash")&&(re.output=v+re.output),x(re);continue}if(L&&(L.type==="bracket"||L.type==="paren")&&r.regex===!0){re.output=_,x(re);continue}(F.index===F.start||L.type==="slash"||L.type==="dot")&&(L.type==="dot"?(F.output+=S,L.output+=S):r.dot===!0?(F.output+=A,L.output+=A):(F.output+=v,L.output+=v),I()!=="*"&&(F.output+=m,L.output+=m)),x(re)}for(;F.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(iu("closing","]"));F.output=Pr.escapeLast(F.output,"["),ae("brackets")}for(;F.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(iu("closing",")"));F.output=Pr.escapeLast(F.output,"("),ae("parens")}for(;F.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(iu("closing","}"));F.output=Pr.escapeLast(F.output,"{"),ae("braces")}if(r.strictSlashes!==!0&&(L.type==="star"||L.type==="bracket")&&x({type:"maybe_slash",value:"",output:`${f}?`}),F.backtrack===!0){F.output="";for(let N of F.tokens)F.output+=N.output!=null?N.output:N.value,N.suffix&&(F.output+=N.suffix)}return F};vE.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(rm,r.maxLength):rm,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=R6[t]||t;let s=Pr.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:h,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:m}=tm.globChars(s),g=r.dot?h:l,b=r.dot?d:l,S=r.capture?"":"?:",A={negated:!1,prefix:""},p=r.bash===!0?".*?":f;r.capture&&(p=`(${p})`);let D=v=>v.noglobstar===!0?p:`(${S}(?:(?!${m}${v.dot?c:o}).)*?)`,y=v=>{switch(v){case"*":return`${g}${u}${p}`;case".*":return`${o}${u}${p}`;case"*.*":return`${g}${p}${o}${u}${p}`;case"*/*":return`${g}${p}${a}${u}${b}${p}`;case"**":return g+D(r);case"**/*":return`(?:${g}${D(r)}${a})?${b}${u}${p}`;case"**/*.*":return`(?:${g}${D(r)}${a})?${b}${p}${o}${u}${p}`;case"**/.*":return`(?:${g}${D(r)}${a})?${o}${u}${p}`;default:{let R=/^(.*?)\.(\w+)$/.exec(v);if(!R)return;let P=y(R[1]);return P?P+o+R[2]:void 0}}},C=Pr.removePrefix(t,A),k=y(C);return k&&r.strictSlashes!==!0&&(k+=`${a}?`),k};N6.exports=vE});var j6=E((eCe,L6)=>{"use strict";var Qfe=require("path"),ehe=P6(),EE=$6(),_E=fl(),the=ll(),rhe=t=>t&&typeof t=="object"&&!Array.isArray(t),vt=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(d=>vt(d,e,r));return d=>{for(let f of l){let m=f(d);if(m)return m}return!1}}let n=rhe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=_E.isWindows(e),o=n?vt.compileRe(t,e):vt.makeRe(t,e,!1,!0),a=o.state;delete o.state;let u=()=>!1;if(i.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};u=vt(i.ignore,l,r)}let c=(l,h=!1)=>{let{isMatch:d,match:f,output:m}=vt.test(l,o,e,{glob:t,posix:s}),g={glob:t,state:a,regex:o,posix:s,input:l,output:m,match:f,isMatch:d};return typeof i.onResult=="function"&&i.onResult(g),d===!1?(g.isMatch=!1,h?g:!1):u(l)?(typeof i.onIgnore=="function"&&i.onIgnore(g),g.isMatch=!1,h?g:!1):(typeof i.onMatch=="function"&&i.onMatch(g),h?g:!0)};return r&&(c.state=a),c};vt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=r||{},o=s.format||(i?_E.toPosixSlashes:null),a=t===n,u=a&&o?o(t):t;return a===!1&&(u=o?o(t):t,a=u===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=vt.matchBase(t,e,r,i):a=e.exec(u)),{isMatch:!!a,match:a,output:u}};vt.matchBase=(t,e,r,n=_E.isWindows(r))=>(e instanceof RegExp?e:vt.makeRe(e,r)).test(Qfe.basename(t));vt.isMatch=(t,e,r)=>vt(e,r)(t);vt.parse=(t,e)=>Array.isArray(t)?t.map(r=>vt.parse(r,e)):EE(t,{...e,fastpaths:!1});vt.scan=(t,e)=>ehe(t,e);vt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let u=vt.toRegex(a,e);return n===!0&&(u.state=t),u};vt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=EE.fastpaths(t,e)),i.output||(i=EE(t,e)),vt.compileRe(i,e,r,n)};vt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};vt.constants=the;L6.exports=vt});var M6=E((tCe,B6)=>{"use strict";B6.exports=j6()});var G6=E((rCe,z6)=>{"use strict";var U6=require("util"),H6=b6(),qn=M6(),CE=fl(),q6=t=>t===""||t==="./",V6=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Ze=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,i=new Set,s=new Set,o=0,a=l=>{s.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<e.length;l++){let h=qn(String(e[l]),{...r,onResult:a},!0),d=h.state.negated||h.state.negatedExtglob;d&&o++;for(let f of t){let m=h(f,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),i.add(m.output)))}}let c=(o===e.length?[...s]:[...i]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(l=>l.replace(/\\/g,"")):e}return c};Ze.match=Ze;Ze.matcher=(t,e)=>qn(t,e);Ze.isMatch=(t,e,r)=>qn(e,r)(t);Ze.any=Ze.isMatch;Ze.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,i=[],s=a=>{r.onResult&&r.onResult(a),i.push(a.output)},o=new Set(Ze(t,e,{...r,onResult:s}));for(let a of i)o.has(a)||n.add(a);return[...n]};Ze.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${U6.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>Ze.contains(t,n,r));if(typeof e=="string"){if(q6(t)||q6(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Ze.isMatch(t,e,{...r,contains:!0})};Ze.matchKeys=(t,e,r)=>{if(!CE.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=Ze(Object.keys(t),e,r),i={};for(let s of n)i[s]=t[s];return i};Ze.some=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let s=qn(String(i),r);if(n.some(o=>s(o)))return!0}return!1};Ze.every=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let s=qn(String(i),r);if(!n.every(o=>s(o)))return!1}return!0};Ze.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${U6.inspect(t)}"`);return[].concat(e).every(n=>qn(n,r)(t))};Ze.capture=(t,e,r)=>{let n=CE.isWindows(r),s=qn.makeRe(String(t),{...r,capture:!0}).exec(n?CE.toPosixSlashes(e):e);if(s)return s.slice(1).map(o=>o===void 0?"":o)};Ze.makeRe=(...t)=>qn.makeRe(...t);Ze.scan=(...t)=>qn.scan(...t);Ze.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let i of H6(String(n),e))r.push(qn.parse(i,e));return r};Ze.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!V6(t)?[t]:H6(t,e)};Ze.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Ze.braces(t,{...e,expand:!0})};Ze.hasBraces=V6;z6.exports=Ze});var zhe={};om(zhe,{CapgoSDK:()=>nt,addApp:()=>Mhe,addChannel:()=>Uhe,addOrganization:()=>Lhe,checkBundleCompatibility:()=>Ahe,createSupabaseClient:()=>pe,decryptBundle:()=>xhe,deleteLegacyEncryptionKey:()=>khe,deleteOrganization:()=>Bhe,doctor:()=>She,encryptBundle:()=>Ohe,generateEncryptionKeys:()=>Fhe,getAccountId:()=>Nhe,getCapacitorConfig:()=>Vhe,getCurrentBundle:()=>Phe,getStats:()=>Hhe,listBundles:()=>qhe,listOrganizations:()=>$he,login:()=>Che,saveEncryptionKey:()=>Ihe,updateAppSetting:()=>Rhe,updateOrganization:()=>jhe,uploadBundle:()=>_he,zipBundle:()=>The});module.exports=ue(zhe);var Ut=xe(We(),1),go=require("node:process"),bi=xe(require("node:readline"),1),hm=xe(require("node:readline"),1),ME=require("node:stream"),qE=xe(cm(),1);function Lq({onlyFirst:t=!1}={}){let e=["[\\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(e,t?void 0:"g")}var jq=Lq();function UE(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(jq,"")}function HE(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var VE={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,o=i;return 55296<=i&&i<=56319&&56320<=s&&s<=57343&&(i&=1023,s&=1023,o=i<<10|s,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=r(n),s=0,o=0;o<i.length;o++)s=s+this.characterLength(i[o]);return s},e.slice=function(n,i,s){textLen=e.length(n),i=i||0,s=s||1,i<0&&(i=textLen+i),s<0&&(s=textLen+s);for(var o="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],h=e.length(l);if(a>=i-(h==2?1:0))if(a+h<=s)o+=l;else break;a+=h}return o}})(VE);var Bq=VE.exports,Mq=HE(Bq),qq=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},Uq=HE(qq);function ou(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=UE(t),t.length===0))return 0;t=t.replace(Uq()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let s=i.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(Mq.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var lm=10,PE=(t=0)=>e=>`\x1B[${e+t}m`,RE=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,NE=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Qe={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(Qe.modifier);var Hq=Object.keys(Qe.color),Vq=Object.keys(Qe.bgColor);[...Hq,...Vq];function zq(){let t=new Map;for(let[e,r]of Object.entries(Qe)){for(let[n,i]of Object.entries(r))Qe[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Qe[n],t.set(i[0],i[1]);Object.defineProperty(Qe,e,{value:r,enumerable:!1})}return Object.defineProperty(Qe,"codes",{value:t,enumerable:!1}),Qe.color.close="\x1B[39m",Qe.bgColor.close="\x1B[49m",Qe.color.ansi=PE(),Qe.color.ansi256=RE(),Qe.color.ansi16m=NE(),Qe.bgColor.ansi=PE(lm),Qe.bgColor.ansi256=RE(lm),Qe.bgColor.ansi16m=NE(lm),Object.defineProperties(Qe,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Qe.rgbToAnsi256(...Qe.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Qe.ansi256ToAnsi(Qe.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Qe.ansi256ToAnsi(Qe.hexToAnsi256(e)),enumerable:!1}}),Qe}var Gq=zq(),El=new Set(["\x1B","\x9B"]),Kq=39,pm="\x07",zE="[",Wq="]",GE="m",mm=`${Wq}8;;`,$E=t=>`${El.values().next().value}${zE}${t}${GE}`,LE=t=>`${El.values().next().value}${mm}${t}${pm}`,Xq=t=>t.split(" ").map(e=>ou(e)),fm=(t,e,r)=>{let n=[...e],i=!1,s=!1,o=ou(UE(t[t.length-1]));for(let[a,u]of n.entries()){let c=ou(u);if(o+c<=r?t[t.length-1]+=u:(t.push(u),o=0),El.has(u)&&(i=!0,s=n.slice(a+1).join("").startsWith(mm)),i){s?u===pm&&(i=!1,s=!1):u===GE&&(i=!1);continue}o+=c,o===r&&a<n.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},Yq=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(ou(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},Jq=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,s,o=Xq(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let h=ou(a[a.length-1]);if(c!==0&&(h>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),h=0),(h>0||r.trim===!1)&&(a[a.length-1]+=" ",h++)),r.hard&&o[c]>e){let d=e-h,f=1+Math.floor((o[c]-d-1)/e);Math.floor((o[c]-1)/e)<f&&a.push(""),fm(a,l,e);continue}if(h+o[c]>e&&h>0&&o[c]>0){if(r.wordWrap===!1&&h<e){fm(a,l,e);continue}a.push("")}if(h+o[c]>e&&r.wordWrap===!1){fm(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>Yq(c)));let u=[...a.join(`
|
|
239
239
|
`)];for(let[c,l]of u.entries()){if(n+=l,El.has(l)){let{groups:d}=new RegExp(`(?:\\${zE}(?<code>\\d+)m|\\${mm}(?<uri>.*)${pm})`).exec(u.slice(c).join(""))||{groups:{}};if(d.code!==void 0){let f=Number.parseFloat(d.code);i=f===Kq?void 0:f}else d.uri!==void 0&&(s=d.uri.length===0?void 0:d.uri)}let h=Gq.codes.get(Number(i));u[c+1]===`
|
|
240
240
|
`?(s&&(n+=LE("")),i&&h&&(n+=$E(h))):l===`
|
|
241
241
|
`&&(i&&h&&(n+=$E(i)),s&&(n+=LE(s)))}return n};function jE(t,e,r){return String(t).normalize().replace(/\r\n/g,`
|
|
@@ -248,7 +248,7 @@ tell application "System Events" to get value of property list item "CFBundleNam
|
|
|
248
248
|
`).length-1;this.output.write(Ut.cursor.move(-999,e*-1))}render(){let e=jE(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Ut.cursor.hide);else{let r=Qq(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(Ut.cursor.move(0,n)),this.output.write(Ut.erase.lines(1));let i=e.split(`
|
|
249
249
|
`);this.output.write(i[n]),this._prevFrame=e,this.output.write(Ut.cursor.move(0,i.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(Ut.cursor.move(0,n)),this.output.write(Ut.erase.down());let i=e.split(`
|
|
250
250
|
`).slice(n);this.output.write(i.join(`
|
|
251
|
-
`)),this._prevFrame=e;return}this.output.write(Ut.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},wl=class extends au{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(Ut.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var nU;nU=new WeakMap;var iU=Object.defineProperty,sU=(t,e,r)=>e in t?iU(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,BE=(t,e,r)=>(sU(t,typeof e!="symbol"?e+"":e,r),r),bl=class extends au{constructor(e){super(e,!1),BE(this,"options"),BE(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:r})=>r===e.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 vl=class extends au{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[r,...n]=this.value.slice(this.cursor);return`${e}${qE.default.inverse(r)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};var Nr=xe(require("node:process"),1),Y=xe(cm(),1),_l=xe(We(),1);function oU(){return Nr.default.platform!=="win32"?Nr.default.env.TERM!=="linux":!!Nr.default.env.CI||!!Nr.default.env.WT_SESSION||!!Nr.default.env.TERMINUS_SUBLIME||Nr.default.env.ConEmuTask==="{cmd::Cmder}"||Nr.default.env.TERM_PROGRAM==="Terminus-Sublime"||Nr.default.env.TERM_PROGRAM==="vscode"||Nr.default.env.TERM==="xterm-256color"||Nr.default.env.TERM==="alacritty"||Nr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ym=oU(),Dt=(t,e)=>ym?t:e,aU=Dt("\u25C6","*"),WE=Dt("\u25A0","x"),XE=Dt("\u25B2","x"),bm=Dt("\u25C7","o"),uU=Dt("\u250C","T"),it=Dt("\u2502","|"),uu=Dt("\u2514","\u2014"),Dm=Dt("\u25CF",">"),wm=Dt("\u25CB"," "),
|
|
251
|
+
`)),this._prevFrame=e;return}this.output.write(Ut.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},wl=class extends au{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(Ut.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var nU;nU=new WeakMap;var iU=Object.defineProperty,sU=(t,e,r)=>e in t?iU(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,BE=(t,e,r)=>(sU(t,typeof e!="symbol"?e+"":e,r),r),bl=class extends au{constructor(e){super(e,!1),BE(this,"options"),BE(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:r})=>r===e.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 vl=class extends au{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[r,...n]=this.value.slice(this.cursor);return`${e}${qE.default.inverse(r)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};var Nr=xe(require("node:process"),1),Y=xe(cm(),1),_l=xe(We(),1);function oU(){return Nr.default.platform!=="win32"?Nr.default.env.TERM!=="linux":!!Nr.default.env.CI||!!Nr.default.env.WT_SESSION||!!Nr.default.env.TERMINUS_SUBLIME||Nr.default.env.ConEmuTask==="{cmd::Cmder}"||Nr.default.env.TERM_PROGRAM==="Terminus-Sublime"||Nr.default.env.TERM_PROGRAM==="vscode"||Nr.default.env.TERM==="xterm-256color"||Nr.default.env.TERM==="alacritty"||Nr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ym=oU(),Dt=(t,e)=>ym?t:e,aU=Dt("\u25C6","*"),WE=Dt("\u25A0","x"),XE=Dt("\u25B2","x"),bm=Dt("\u25C7","o"),uU=Dt("\u250C","T"),it=Dt("\u2502","|"),uu=Dt("\u2514","\u2014"),Dm=Dt("\u25CF",">"),wm=Dt("\u25CB"," "),rde=Dt("\u25FB","[\u2022]"),nde=Dt("\u25FC","[+]"),ide=Dt("\u25FB","[ ]"),sde=Dt("\u25AA","\u2022"),ode=Dt("\u2500","-"),ade=Dt("\u256E","+"),ude=Dt("\u251C","+"),cde=Dt("\u256F","+"),cU=Dt("\u25CF","\u2022"),lU=Dt("\u25C6","*"),fU=Dt("\u25B2","!"),hU=Dt("\u25A0","x"),vm=t=>{switch(t){case"initial":case"active":return Y.default.cyan(aU);case"cancel":return Y.default.red(WE);case"error":return Y.default.yellow(XE);case"submit":return Y.default.green(bm)}},dU=t=>{let{cursor:e,options:r,style:n}=t,i=t.maxItems??Number.POSITIVE_INFINITY,s=Math.max(process.stdout.rows-4,0),o=Math.min(s,Math.max(i,5)),a=0;e>=a+o-3?a=Math.max(Math.min(e-o+3,r.length-o),0):e<a+2&&(a=Math.max(e-2,0));let u=o<r.length&&a>0,c=o<r.length&&a+o<r.length;return r.slice(a,a+o).map((l,h,d)=>{let f=h===0&&u,m=h===d.length-1&&c;return f||m?Y.default.dim("..."):n(l,h+a===e)})},yo=t=>new vl({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${Y.default.gray(it)}
|
|
252
252
|
${vm(this.state)} ${t.message}
|
|
253
253
|
`,r=t.placeholder?Y.default.inverse(t.placeholder[0])+Y.default.dim(t.placeholder.slice(1)):Y.default.inverse(Y.default.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
|
|
254
254
|
${Y.default.yellow(it)} ${n}
|
|
@@ -274,13 +274,13 @@ ${Y.default.gray(uu)} ${t}
|
|
|
274
274
|
`)},w={message:(t="",{symbol:e=Y.default.gray(it)}={})=>{let r=[`${Y.default.gray(it)}`];if(t){let[n,...i]=t.split(`
|
|
275
275
|
`);r.push(`${e} ${n}`,...i.map(s=>`${Y.default.gray(it)} ${s}`))}process.stdout.write(`${r.join(`
|
|
276
276
|
`)}
|
|
277
|
-
`)},info:t=>{w.message(t,{symbol:Y.default.blue(cU)})},success:t=>{w.message(t,{symbol:Y.default.green(lU)})},step:t=>{w.message(t,{symbol:Y.default.green(bm)})},warn:t=>{w.message(t,{symbol:Y.default.yellow(fU)})},warning:t=>{w.warn(t)},error:t=>{w.message(t,{symbol:Y.default.red(hU)})}},
|
|
277
|
+
`)},info:t=>{w.message(t,{symbol:Y.default.blue(cU)})},success:t=>{w.message(t,{symbol:Y.default.green(lU)})},step:t=>{w.message(t,{symbol:Y.default.green(bm)})},warn:t=>{w.message(t,{symbol:Y.default.yellow(fU)})},warning:t=>{w.warn(t)},error:t=>{w.message(t,{symbol:Y.default.red(hU)})}},lde=`${Y.default.gray(it)} `;var Ft=({indicator:t="dots"}={})=>{let e=ym?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],r=ym?80:120,n=process.env.CI==="true",i,s,o=!1,a="",u,c=performance.now(),l=D=>{let y=D>1?"Something went wrong":"Canceled";o&&p(y,D)},h=()=>l(2),d=()=>l(1),f=()=>{process.on("uncaughtExceptionMonitor",h),process.on("unhandledRejection",h),process.on("SIGINT",d),process.on("SIGTERM",d),process.on("exit",l)},m=()=>{process.removeListener("uncaughtExceptionMonitor",h),process.removeListener("unhandledRejection",h),process.removeListener("SIGINT",d),process.removeListener("SIGTERM",d),process.removeListener("exit",l)},g=()=>{if(u===void 0)return;n&&process.stdout.write(`
|
|
278
278
|
`);let D=u.split(`
|
|
279
279
|
`);process.stdout.write(_l.cursor.move(-999,D.length-1)),process.stdout.write(_l.erase.down(D.length))},b=D=>D.replace(/\.+$/,""),S=D=>{let y=(performance.now()-D)/1e3,C=Math.floor(y/60),k=Math.floor(y%60);return C>0?`[${C}m ${k}s]`:`[${k}s]`},A=(D="")=>{o=!0,i=KE(),a=b(D),c=performance.now(),process.stdout.write(`${Y.default.gray(it)}
|
|
280
280
|
`);let y=0,C=0;f(),s=setInterval(()=>{if(n&&a===u)return;g(),u=a;let k=Y.default.magenta(e[y]);if(n)process.stdout.write(`${k} ${a}...`);else if(t==="timer")process.stdout.write(`${k} ${a} ${S(c)}`);else{let v=".".repeat(Math.floor(C)).slice(0,3);process.stdout.write(`${k} ${a}${v}`)}y=y+1<e.length?y+1:0,C=C<e.length?C+.125:0},r)},p=(D="",y=0)=>{o=!1,clearInterval(s),g();let C=y===0?Y.default.green(bm):y===1?Y.default.red(WE):Y.default.red(XE);a=b(D??a),t==="timer"?process.stdout.write(`${C} ${a} ${S(c)}
|
|
281
281
|
`):process.stdout.write(`${C} ${a}
|
|
282
282
|
`),m(),i()};return{start:A,stop:p,message:(D="")=>{a=b(D??a)}}};function YE(t,e){let n=["normal","bold","dim","italic","underline","strikethrough"].indexOf(t),i="\x1B[";return i+n+"m"+e+i+"0m"}var Ht=class t{title=null;headers=[];rows=[];static narrowTheme={top:["\u2554","\u2550","\u2564","\u2557"],row:["\u2551"," ","\u2502","\u2551"],div:["\u255F","\u2500","\u253C","\u2562"],bot:["\u255A","\u2550","\u2567","\u255D"]};static wideTheme={top:["\u2554\u2550","\u2550","\u2550\u2564\u2550","\u2550\u2557"],row:["\u2551 "," "," \u2502 "," \u2551"],div:["\u255F\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2562"],bot:["\u255A\u2550","\u2550","\u2550\u2567\u2550","\u2550\u255D"]};static roundTheme={top:["\u256D\u2500","\u2500","\u2500\u252C\u2500","\u2500\u256E"],row:["\u2502 "," "," \u2502 "," \u2502"],div:["\u251C\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2524"],bot:["\u2570\u2500","\u2500","\u2500\u2534\u2500","\u2500\u256F"]};theme=t.wideTheme;columnWidth(){let e=[this.headers,...this.rows].filter(n=>n.length>0),r=e[0].map(n=>this.cast(n).length);for(let n of e.slice(1))for(let i=0;i<r.length;i++){let s=this.cast(n[i]).length;s>r[i]&&(r[i]=s)}return r}cast(e){return typeof e=="object"?"obj":e!==void 0&&typeof e.toString=="function"?e.toString():""}renderTitle(){return"[ "+this.title+" ]"}renderLine(e){let r=this.columnWidth();return e[0]+r.map(n=>e[1].repeat(n)).join(e[2])+e[3]}renderCell(e,r,n=!1){let i=this.cast(e),s=n?YE("bold",i):i,o=r-i.length,a=this.theme.row[1];switch(typeof e){case"number":return a.repeat(o)+s;case"string":return s+a.repeat(o);case"boolean":case"object":return a.repeat(Math.ceil(o/2))+YE("italic",i)+a.repeat(Math.floor(o/2));default:return a.repeat(o)}}renderRow(e,r=!1){let n=this.theme.row,i=this.columnWidth();return n[0]+e.map((s,o)=>this.renderCell(s,i[o],r)).join(n[2])+n[3]}toString(){let e=this.theme,r=this.headers.length>0,n=this.rows.length>0;return[this.title?this.renderTitle():"",r||n?this.renderLine(e.top):"",r?this.renderRow(this.headers,!0):"",r&&n?this.renderLine(e.div):"",...this.rows.map(i=>this.renderRow(i)),r||n?this.renderLine(e.bot):""].filter(i=>i.length>0).join(`
|
|
283
|
-
`)}};var $8=require("node:child_process"),At=require("node:fs"),Ip=require("node:os"),Tt=xe(require("node:path")),di=require("node:process"),ns=xe(Sl());var Jt=require("fs"),lu=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/bun.lock`,i=`${t}/pnpm-lock.yaml`,s=`${t}/shrinkwrap.yaml`,o=`${t}/yarn.lock`,a=`${t}/package-lock.json`,u=`${t}/npm-shrinkwrap.json`;return(0,Jt.existsSync)(r)||(0,Jt.existsSync)(n)?"bun":(0,Jt.existsSync)(i)||(0,Jt.existsSync)(s)?"pnpm":(0,Jt.existsSync)(o)?"yarn":(0,Jt.existsSync)(a)||(0,Jt.existsSync)(u)?"npm":e},Al=(t=lu(),e=!1)=>{switch(t){case"bun":return e?"bun install":"install";case"pnpm":return e?"pnpm install":"install";case"yarn":return e?"yarn install":"install";case"npm":return e?"npm install":"install";case"unknown":return e?"unknown unknown":"unknown";default:return e?"npm install":"install"}},JE=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/bun.lock`,i=`${t}/pnpm-lock.yaml`,s=`${t}/shrinkwrap.yaml`,o=`${t}/yarn.lock`,a=`${t}/package-lock.json`,u=`${t}/npm-shrinkwrap.json`;return(0,Jt.existsSync)(r)||(0,Jt.existsSync)(n)?"bunx":(0,Jt.existsSync)(i)||(0,Jt.existsSync)(s)?"pnpm exec":(0,Jt.existsSync)(o)?"yarn dlx":(0,Jt.existsSync)(a)||(0,Jt.existsSync)(u)?"npx":e};function Ol(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function e_(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function Sm(t=[],e=[]){let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let i=t[n],s=e[n];if(i===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(i===void 0)return-1;if(typeof i=="string"&&typeof s=="number")return 1;if(typeof i=="number"&&typeof s=="string"||i<s)return-1;if(i>s)return 1}return 0}var wo="0|[1-9]\\d*",yU="\\d*[a-zA-Z-][a-zA-Z0-9-]*",DU=`(?<major>${wo})\\.(?<minor>${wo})\\.(?<patch>${wo})`,ZE=`(?:${wo}|${yU})`,t_=`(?:-(?<prerelease>${ZE}(?:\\.${ZE})*))`,QE="[0-9A-Za-z-]+",r_=`(?:\\+(?<buildmetadata>${QE}(?:\\.${QE})*))`,n_=`v?${DU}${t_}?${r_}?`,i_=new RegExp(`^${n_}$`),s_="(?:<|>)?=?",wU="x|X|\\*",Cm=`${wo}|${wU}`,xl=`[v=\\s]*(?<major>${Cm})(?:\\.(?<minor>${Cm})(?:\\.(?<patch>${Cm})${t_}?${r_}?)?)?`,o_=new RegExp(`^(?<operator>~>?|\\^|${s_})\\s*${xl}$`),a_=new RegExp(`^(?<operator>${s_})\\s*(${n_})$|^$`);function Am(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Om=256;var bU=new RegExp(`^${wo}$`);function Zt(t){return t.split(".").filter(Boolean).map(e=>{if(bU.test(e)){let r=Number(e);if(Am(r))return r}return e})}function Zr(t){return t.split(".").filter(Boolean)}function Ei(t,e){let r=Number(t);if(!Am(r))throw new TypeError(e);return r}function Un(t){return Number.isNaN(t.major)&&Number.isNaN(t.minor)&&Number.isNaN(t.patch)&&(t.prerelease===void 0||t.prerelease.length===0)&&(t.build===void 0||t.build.length===0)}function Qt(t,e){return t===e?0:Ol(t.major,e.major)||Ol(t.minor,e.minor)||Ol(t.patch,e.patch)||e_(t.prerelease,e.prerelease)||Sm(t.prerelease,e.prerelease)}function xm(t){return t.toFixed(0)}function _i(t){let e=xm(t.major),r=xm(t.minor),n=xm(t.patch),i=t.prerelease?.join(".")??"",s=t.build?.join(".")??"";return[[`${e}.${r}.${n}`,i].filter(u=>u).join("-"),s].filter(u=>u).join("+")}function vU(t,e){if(Un(e))return!0;let r=Qt(t,e);switch(e.operator){case"=":case void 0:return r===0;case"!=":return r!==0;case">":return r>0;case"<":return r<0;case">=":return r>=0;case"<=":return r<=0}}function Tl(t,e){for(let r of e)if(!vU(t,r))return!1;if(t.prerelease&&t.prerelease.length>0){for(let r of e){if(Un(r))continue;let{major:n,minor:i,patch:s,prerelease:o}=r;if(o&&o.length>0&&t.major===n&&t.minor===i&&t.patch===s)return!0}return!1}return!0}function fu(t,e){return e.some(r=>Tl(t,r))}function EU(t=[]){let e=[...t],r=e.length;for(;r>=0;){let n=e[r];if(typeof n=="number"){e[r]=n+1;break}r-=1}return r===-1&&e.push(0),e}function hu(t=[],e){let r=EU(t);if(!e)return r;let n=Zt(e);if(n.every(i=>typeof i=="string")){if(n.every((i,s)=>i===r[s])&&typeof r[n.length]=="number")return r;n=[...n,0]}return n}function u_(t,e,r={}){let n=r.build!==void 0?Zr(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:hu(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:hu(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:hu(t.prerelease,r.prerelease),build:n};case"prerelease":{let s=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:s,prerelease:hu(t.prerelease,r.prerelease),build:n}}case"major":return{major:(t.prerelease??[]).length===0||t.minor!==0||t.patch!==0?t.major+1:t.major,minor:0,patch:0,prerelease:[],build:n};case"minor":{let s=(t.prerelease??[]).length===0||t.patch!==0?t.minor+1:t.minor;return{major:t.major,minor:s,patch:0,prerelease:[],build:n}}case"patch":{let s=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:s,prerelease:[],build:n}}case"pre":return{major:t.major,minor:t.minor,patch:t.patch,prerelease:hu(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var Fl={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},bo={operator:void 0,...Fl};function Tm(t,e){return Qt(t,e)>0}function Fm(t,e){return Qt(t,e)<0}function _U(t){let r=t.match(a_)?.groups;if(!r)return null;let{operator:n,prerelease:i,buildmetadata:s}=r,o=r.major?{major:Ei(r.major,`Cannot parse comparator ${t}: invalid major version`),minor:Ei(r.minor,`Cannot parse comparator ${t}: invalid minor version`),patch:Ei(r.patch,`Cannot parse comparator ${t}: invalid patch version`),prerelease:i?Zt(i):[],build:s?Zr(s):[]}:Fl;return{operator:n||void 0,...o}}function qe(t){return!t||t.toLowerCase()==="x"||t==="*"}function CU(t){if(!qe(t.major))return qe(t.minor)?{operator:">=",major:+t.major,minor:0,patch:0,prerelease:[],build:[]}:qe(t.patch)?{operator:">=",major:+t.major,minor:+t.minor,patch:0,prerelease:[],build:[]}:{operator:">=",major:+t.major,minor:+t.minor,patch:+t.patch,prerelease:t.prerelease?Zt(t.prerelease):[],build:[]}}function SU(t){if(!qe(t.major))return qe(t.minor)?{operator:"<",major:+t.major+1,minor:0,patch:0,prerelease:[],build:[]}:qe(t.patch)?{operator:"<",major:+t.major,minor:+t.minor+1,patch:0,prerelease:[],build:[]}:t.prerelease?{operator:"<=",major:+t.major,minor:+t.minor,patch:+t.patch,prerelease:Zt(t.prerelease),build:[]}:{operator:"<=",major:+t.major,minor:+t.minor,patch:+t.patch,prerelease:[],build:[]}}function AU(t){let e=t.match(new RegExp(`^${xl}`)),r=e?.groups;if(!r)return null;let n=e[0].length,i=t.slice(n).match(/^\s+-\s+/);if(!i)return null;let s=i[0].length,a=t.slice(n+s).match(new RegExp(`^${xl}\\s*$`))?.groups;if(!a)return null;let u=CU(r),c=SU(a);return[u,c].filter(Boolean)}function OU(t){let e=qe(t.major),r=qe(t.minor),n=qe(t.patch),i=+t.major,s=+t.minor,o=+t.patch;if(e)return[bo];if(r)return[{operator:">=",major:i,minor:0,patch:0},{operator:"<",major:i+1,minor:0,patch:0}];if(n)return i===0?[{operator:">=",major:i,minor:s,patch:0},{operator:"<",major:i,minor:s+1,patch:0}]:[{operator:">=",major:i,minor:s,patch:0},{operator:"<",major:i+1,minor:0,patch:0}];let a=Zt(t.prerelease??"");return i===0?s===0?[{operator:">=",major:i,minor:s,patch:o,prerelease:a},{operator:"<",major:i,minor:s,patch:o+1}]:[{operator:">=",major:i,minor:s,patch:o,prerelease:a},{operator:"<",major:i,minor:s+1,patch:0}]:[{operator:">=",major:i,minor:s,patch:o,prerelease:a},{operator:"<",major:i+1,minor:0,patch:0}]}function xU(t){let e=qe(t.major),r=qe(t.minor),n=qe(t.patch),i=+t.major,s=+t.minor,o=+t.patch;if(e)return[bo];if(r)return[{operator:">=",major:i,minor:0,patch:0},{operator:"<",major:i+1,minor:0,patch:0}];if(n)return[{operator:">=",major:i,minor:s,patch:0},{operator:"<",major:i,minor:s+1,patch:0}];let a=Zt(t.prerelease??"");return[{operator:">=",major:i,minor:s,patch:o,prerelease:a},{operator:"<",major:i,minor:s+1,patch:0}]}function TU(t){let e=qe(t.major),r=qe(t.minor),n=qe(t.patch),i=+t.major,s=+t.minor,o=+t.patch;if(e)return[{operator:"<",major:0,minor:0,patch:0}];if(r)return n?[{operator:"<",major:i,minor:0,patch:0}]:[{operator:"<",major:i,minor:0,patch:0}];if(n)return[{operator:"<",major:i,minor:s,patch:0}];let a=Zt(t.prerelease??""),u=Zr(t.build??"");return[{operator:"<",major:i,minor:s,patch:o,prerelease:a,build:u}]}function FU(t){let e=qe(t.minor),r=qe(t.patch),n=+t.major,i=+t.minor,s=+t.patch;if(e)return r?[{operator:"<",major:n+1,minor:0,patch:0}]:[{operator:"<",major:n,minor:i+1,patch:0}];if(r)return[{operator:"<",major:n,minor:i+1,patch:0}];let o=Zt(t.prerelease??""),a=Zr(t.build??"");return[{operator:"<=",major:n,minor:i,patch:s,prerelease:o,build:a}]}function IU(t){let e=qe(t.major),r=qe(t.minor),n=qe(t.patch),i=+t.major,s=+t.minor,o=+t.patch;if(e)return[{operator:"<",major:0,minor:0,patch:0}];if(r)return[{operator:">=",major:i+1,minor:0,patch:0}];if(n)return[{operator:">=",major:i,minor:s+1,patch:0}];let a=Zt(t.prerelease??""),u=Zr(t.build??"");return[{operator:">",major:i,minor:s,patch:o,prerelease:a,build:u}]}function kU(t){let e=qe(t.major),r=qe(t.minor),n=qe(t.patch),i=+t.major,s=+t.minor,o=+t.patch;if(e)return[bo];if(r)return n?[{operator:">=",major:i,minor:0,patch:0}]:[{operator:">=",major:i,minor:0,patch:0}];if(n)return[{operator:">=",major:i,minor:s,patch:0}];let a=Zt(t.prerelease??""),u=Zr(t.build??"");return[{operator:">=",major:i,minor:s,patch:o,prerelease:a,build:u}]}function PU(t){let e=qe(t.major),r=qe(t.minor),n=qe(t.patch),i=+t.major,s=+t.minor,o=+t.patch;if(e)return[bo];if(r)return[{operator:">=",major:i,minor:0,patch:0},{operator:"<",major:i+1,minor:0,patch:0}];if(n)return[{operator:">=",major:i,minor:s,patch:0},{operator:"<",major:i,minor:s+1,patch:0}];let a=Zt(t.prerelease??""),u=Zr(t.build??"");return[{operator:void 0,major:i,minor:s,patch:o,prerelease:a,build:u}]}function RU(t){let e=t.match(o_)?.groups;if(!e)return _U(t);switch(e.operator){case"^":return OU(e);case"~":case"~>":return xU(e);case"<":return TU(e);case"<=":return FU(e);case">":return IU(e);case">=":return kU(e);case"=":case"":return PU(e);default:throw new Error(`Cannot parse version range: '${e.operator}' is not a valid operator`)}}function NU(t){return t.split(/\s+/).flatMap(RU)}function Il(t){let e=t.replaceAll(/(?<=<|>|=|~|\^)(\s+)/g,"").split(/\s*\|\|\s*/).map(r=>AU(r)||NU(r));if(e.some(r=>r.includes(null)))throw new TypeError(`Cannot parse version range: range "${t}" is invalid`);return e}function Et(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Om)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Om}`);t=t.trim();let e=t.match(i_)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=Ei(e.major,`Cannot parse version ${t}: invalid major version`),n=Ei(e.minor,`Cannot parse version ${t}: invalid minor version`),i=Ei(e.patch,`Cannot parse version ${t}: invalid patch version`),s=e.prerelease?Zt(e.prerelease):[],o=e.buildmetadata?Zr(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:s,build:o}}function c_(t,e){let r=t.operator,n=e.operator;if(r===void 0)return Un(t)?!0:fu(t,[[e]]);if(n===void 0)return Un(e)?!0:fu(e,[[t]]);let i=Qt(t,e);return(r===">="||r===">")&&(n===">="||n===">")||(r==="<="||r==="<")&&(n==="<="||n==="<")||i===0&&((r===">="||r==="<=")&&(n===">="||n==="<="))||i===-1&&(r===">="||r===">")&&(n==="<="||n==="<")||i===1&&(r==="<="||r==="<")&&(n===">="||n===">")}function $U(t){return t.every(e=>e.some(r=>LU(r)))}function LU(t){for(let e=0;e<t.length-1;e++){let r=t[e];for(let n of t.slice(e+1))if(!c_(r,n))return!1}return!0}function l_(t,e){return $U([t,e])&&t.some(r=>e.some(n=>r.every(i=>n.every(s=>c_(i,s)))))}function f_(t){try{return Et(t),!0}catch{return!1}}function Ci(t,e){return Qt(t,e)>=0}var Ga=xe(uS()),Wv=xe(qS()),L8=xe(DA()),kp=xe(n0());var Ri={name:"@capgo/cli",version:"7.21.4",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js",require:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && node build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload"},devDependencies:{"@antfu/eslint-config":"^6.1.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^7.4.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^0.11.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.6","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^24.9.1","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",esbuild:"^0.25.11",eslint:"^9.38.0","git-format-staged":"3.1.1",husky:"^9.1.7","is-wsl":"^3.1.0",open:"^10.1.2",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3"}};async function Rh(t){try{let r=`https://registry.npmjs.org/${encodeURIComponent(t.toLowerCase())}`,n=await fetch(r,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});return n.ok&&(await n.json())["dist-tags"]?.latest||null}catch{return null}}async function ze(){let t=await Rh("@capgo/cli")??"",e=t?.split(".")[0];t!==Ri.version&&w.warning(`\u{1F6A8} You are using @capgo/cli@${Ri.version} it's not the latest version.
|
|
283
|
+
`)}};var $8=require("node:child_process"),At=require("node:fs"),Ip=require("node:os"),Tt=xe(require("node:path")),di=require("node:process"),ns=xe(Sl());var Jt=require("fs"),lu=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/bun.lock`,i=`${t}/pnpm-lock.yaml`,s=`${t}/shrinkwrap.yaml`,o=`${t}/yarn.lock`,a=`${t}/package-lock.json`,u=`${t}/npm-shrinkwrap.json`;return(0,Jt.existsSync)(r)||(0,Jt.existsSync)(n)?"bun":(0,Jt.existsSync)(i)||(0,Jt.existsSync)(s)?"pnpm":(0,Jt.existsSync)(o)?"yarn":(0,Jt.existsSync)(a)||(0,Jt.existsSync)(u)?"npm":e},Al=(t=lu(),e=!1)=>{switch(t){case"bun":return e?"bun install":"install";case"pnpm":return e?"pnpm install":"install";case"yarn":return e?"yarn install":"install";case"npm":return e?"npm install":"install";case"unknown":return e?"unknown unknown":"unknown";default:return e?"npm install":"install"}},JE=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/bun.lock`,i=`${t}/pnpm-lock.yaml`,s=`${t}/shrinkwrap.yaml`,o=`${t}/yarn.lock`,a=`${t}/package-lock.json`,u=`${t}/npm-shrinkwrap.json`;return(0,Jt.existsSync)(r)||(0,Jt.existsSync)(n)?"bunx":(0,Jt.existsSync)(i)||(0,Jt.existsSync)(s)?"pnpm exec":(0,Jt.existsSync)(o)?"yarn dlx":(0,Jt.existsSync)(a)||(0,Jt.existsSync)(u)?"npx":e};function Ol(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function e_(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function Sm(t=[],e=[]){let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let i=t[n],s=e[n];if(i===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(i===void 0)return-1;if(typeof i=="string"&&typeof s=="number")return 1;if(typeof i=="number"&&typeof s=="string"||i<s)return-1;if(i>s)return 1}return 0}var wo="0|[1-9]\\d*",yU="\\d*[a-zA-Z-][a-zA-Z0-9-]*",DU=`(?<major>${wo})\\.(?<minor>${wo})\\.(?<patch>${wo})`,ZE=`(?:${wo}|${yU})`,t_=`(?:-(?<prerelease>${ZE}(?:\\.${ZE})*))`,QE="[0-9A-Za-z-]+",r_=`(?:\\+(?<buildmetadata>${QE}(?:\\.${QE})*))`,n_=`v?${DU}${t_}?${r_}?`,i_=new RegExp(`^${n_}$`),s_="(?:<|>)?=?",wU="x|X|\\*",Cm=`${wo}|${wU}`,xl=`[v=\\s]*(?<major>${Cm})(?:\\.(?<minor>${Cm})(?:\\.(?<patch>${Cm})${t_}?${r_}?)?)?`,o_=new RegExp(`^(?<operator>~>?|\\^|${s_})\\s*${xl}$`),a_=new RegExp(`^(?<operator>${s_})\\s*(${n_})$|^$`);function Am(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Om=256;var bU=new RegExp(`^${wo}$`);function Zt(t){return t.split(".").filter(Boolean).map(e=>{if(bU.test(e)){let r=Number(e);if(Am(r))return r}return e})}function Zr(t){return t.split(".").filter(Boolean)}function Ei(t,e){let r=Number(t);if(!Am(r))throw new TypeError(e);return r}function Un(t){return Number.isNaN(t.major)&&Number.isNaN(t.minor)&&Number.isNaN(t.patch)&&(t.prerelease===void 0||t.prerelease.length===0)&&(t.build===void 0||t.build.length===0)}function Qt(t,e){return t===e?0:Ol(t.major,e.major)||Ol(t.minor,e.minor)||Ol(t.patch,e.patch)||e_(t.prerelease,e.prerelease)||Sm(t.prerelease,e.prerelease)}function xm(t){return t.toFixed(0)}function _i(t){let e=xm(t.major),r=xm(t.minor),n=xm(t.patch),i=t.prerelease?.join(".")??"",s=t.build?.join(".")??"";return[[`${e}.${r}.${n}`,i].filter(u=>u).join("-"),s].filter(u=>u).join("+")}function vU(t,e){if(Un(e))return!0;let r=Qt(t,e);switch(e.operator){case"=":case void 0:return r===0;case"!=":return r!==0;case">":return r>0;case"<":return r<0;case">=":return r>=0;case"<=":return r<=0}}function Tl(t,e){for(let r of e)if(!vU(t,r))return!1;if(t.prerelease&&t.prerelease.length>0){for(let r of e){if(Un(r))continue;let{major:n,minor:i,patch:s,prerelease:o}=r;if(o&&o.length>0&&t.major===n&&t.minor===i&&t.patch===s)return!0}return!1}return!0}function fu(t,e){return e.some(r=>Tl(t,r))}function EU(t=[]){let e=[...t],r=e.length;for(;r>=0;){let n=e[r];if(typeof n=="number"){e[r]=n+1;break}r-=1}return r===-1&&e.push(0),e}function hu(t=[],e){let r=EU(t);if(!e)return r;let n=Zt(e);if(n.every(i=>typeof i=="string")){if(n.every((i,s)=>i===r[s])&&typeof r[n.length]=="number")return r;n=[...n,0]}return n}function u_(t,e,r={}){let n=r.build!==void 0?Zr(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:hu(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:hu(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:hu(t.prerelease,r.prerelease),build:n};case"prerelease":{let s=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:s,prerelease:hu(t.prerelease,r.prerelease),build:n}}case"major":return{major:(t.prerelease??[]).length===0||t.minor!==0||t.patch!==0?t.major+1:t.major,minor:0,patch:0,prerelease:[],build:n};case"minor":{let s=(t.prerelease??[]).length===0||t.patch!==0?t.minor+1:t.minor;return{major:t.major,minor:s,patch:0,prerelease:[],build:n}}case"patch":{let s=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:s,prerelease:[],build:n}}case"pre":return{major:t.major,minor:t.minor,patch:t.patch,prerelease:hu(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var Fl={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},bo={operator:void 0,...Fl};function Tm(t,e){return Qt(t,e)>0}function Fm(t,e){return Qt(t,e)<0}function _U(t){let r=t.match(a_)?.groups;if(!r)return null;let{operator:n,prerelease:i,buildmetadata:s}=r,o=r.major?{major:Ei(r.major,`Cannot parse comparator ${t}: invalid major version`),minor:Ei(r.minor,`Cannot parse comparator ${t}: invalid minor version`),patch:Ei(r.patch,`Cannot parse comparator ${t}: invalid patch version`),prerelease:i?Zt(i):[],build:s?Zr(s):[]}:Fl;return{operator:n||void 0,...o}}function qe(t){return!t||t.toLowerCase()==="x"||t==="*"}function CU(t){if(!qe(t.major))return qe(t.minor)?{operator:">=",major:+t.major,minor:0,patch:0,prerelease:[],build:[]}:qe(t.patch)?{operator:">=",major:+t.major,minor:+t.minor,patch:0,prerelease:[],build:[]}:{operator:">=",major:+t.major,minor:+t.minor,patch:+t.patch,prerelease:t.prerelease?Zt(t.prerelease):[],build:[]}}function SU(t){if(!qe(t.major))return qe(t.minor)?{operator:"<",major:+t.major+1,minor:0,patch:0,prerelease:[],build:[]}:qe(t.patch)?{operator:"<",major:+t.major,minor:+t.minor+1,patch:0,prerelease:[],build:[]}:t.prerelease?{operator:"<=",major:+t.major,minor:+t.minor,patch:+t.patch,prerelease:Zt(t.prerelease),build:[]}:{operator:"<=",major:+t.major,minor:+t.minor,patch:+t.patch,prerelease:[],build:[]}}function AU(t){let e=t.match(new RegExp(`^${xl}`)),r=e?.groups;if(!r)return null;let n=e[0].length,i=t.slice(n).match(/^\s+-\s+/);if(!i)return null;let s=i[0].length,a=t.slice(n+s).match(new RegExp(`^${xl}\\s*$`))?.groups;if(!a)return null;let u=CU(r),c=SU(a);return[u,c].filter(Boolean)}function OU(t){let e=qe(t.major),r=qe(t.minor),n=qe(t.patch),i=+t.major,s=+t.minor,o=+t.patch;if(e)return[bo];if(r)return[{operator:">=",major:i,minor:0,patch:0},{operator:"<",major:i+1,minor:0,patch:0}];if(n)return i===0?[{operator:">=",major:i,minor:s,patch:0},{operator:"<",major:i,minor:s+1,patch:0}]:[{operator:">=",major:i,minor:s,patch:0},{operator:"<",major:i+1,minor:0,patch:0}];let a=Zt(t.prerelease??"");return i===0?s===0?[{operator:">=",major:i,minor:s,patch:o,prerelease:a},{operator:"<",major:i,minor:s,patch:o+1}]:[{operator:">=",major:i,minor:s,patch:o,prerelease:a},{operator:"<",major:i,minor:s+1,patch:0}]:[{operator:">=",major:i,minor:s,patch:o,prerelease:a},{operator:"<",major:i+1,minor:0,patch:0}]}function xU(t){let e=qe(t.major),r=qe(t.minor),n=qe(t.patch),i=+t.major,s=+t.minor,o=+t.patch;if(e)return[bo];if(r)return[{operator:">=",major:i,minor:0,patch:0},{operator:"<",major:i+1,minor:0,patch:0}];if(n)return[{operator:">=",major:i,minor:s,patch:0},{operator:"<",major:i,minor:s+1,patch:0}];let a=Zt(t.prerelease??"");return[{operator:">=",major:i,minor:s,patch:o,prerelease:a},{operator:"<",major:i,minor:s+1,patch:0}]}function TU(t){let e=qe(t.major),r=qe(t.minor),n=qe(t.patch),i=+t.major,s=+t.minor,o=+t.patch;if(e)return[{operator:"<",major:0,minor:0,patch:0}];if(r)return n?[{operator:"<",major:i,minor:0,patch:0}]:[{operator:"<",major:i,minor:0,patch:0}];if(n)return[{operator:"<",major:i,minor:s,patch:0}];let a=Zt(t.prerelease??""),u=Zr(t.build??"");return[{operator:"<",major:i,minor:s,patch:o,prerelease:a,build:u}]}function FU(t){let e=qe(t.minor),r=qe(t.patch),n=+t.major,i=+t.minor,s=+t.patch;if(e)return r?[{operator:"<",major:n+1,minor:0,patch:0}]:[{operator:"<",major:n,minor:i+1,patch:0}];if(r)return[{operator:"<",major:n,minor:i+1,patch:0}];let o=Zt(t.prerelease??""),a=Zr(t.build??"");return[{operator:"<=",major:n,minor:i,patch:s,prerelease:o,build:a}]}function IU(t){let e=qe(t.major),r=qe(t.minor),n=qe(t.patch),i=+t.major,s=+t.minor,o=+t.patch;if(e)return[{operator:"<",major:0,minor:0,patch:0}];if(r)return[{operator:">=",major:i+1,minor:0,patch:0}];if(n)return[{operator:">=",major:i,minor:s+1,patch:0}];let a=Zt(t.prerelease??""),u=Zr(t.build??"");return[{operator:">",major:i,minor:s,patch:o,prerelease:a,build:u}]}function kU(t){let e=qe(t.major),r=qe(t.minor),n=qe(t.patch),i=+t.major,s=+t.minor,o=+t.patch;if(e)return[bo];if(r)return n?[{operator:">=",major:i,minor:0,patch:0}]:[{operator:">=",major:i,minor:0,patch:0}];if(n)return[{operator:">=",major:i,minor:s,patch:0}];let a=Zt(t.prerelease??""),u=Zr(t.build??"");return[{operator:">=",major:i,minor:s,patch:o,prerelease:a,build:u}]}function PU(t){let e=qe(t.major),r=qe(t.minor),n=qe(t.patch),i=+t.major,s=+t.minor,o=+t.patch;if(e)return[bo];if(r)return[{operator:">=",major:i,minor:0,patch:0},{operator:"<",major:i+1,minor:0,patch:0}];if(n)return[{operator:">=",major:i,minor:s,patch:0},{operator:"<",major:i,minor:s+1,patch:0}];let a=Zt(t.prerelease??""),u=Zr(t.build??"");return[{operator:void 0,major:i,minor:s,patch:o,prerelease:a,build:u}]}function RU(t){let e=t.match(o_)?.groups;if(!e)return _U(t);switch(e.operator){case"^":return OU(e);case"~":case"~>":return xU(e);case"<":return TU(e);case"<=":return FU(e);case">":return IU(e);case">=":return kU(e);case"=":case"":return PU(e);default:throw new Error(`Cannot parse version range: '${e.operator}' is not a valid operator`)}}function NU(t){return t.split(/\s+/).flatMap(RU)}function Il(t){let e=t.replaceAll(/(?<=<|>|=|~|\^)(\s+)/g,"").split(/\s*\|\|\s*/).map(r=>AU(r)||NU(r));if(e.some(r=>r.includes(null)))throw new TypeError(`Cannot parse version range: range "${t}" is invalid`);return e}function Et(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Om)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Om}`);t=t.trim();let e=t.match(i_)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=Ei(e.major,`Cannot parse version ${t}: invalid major version`),n=Ei(e.minor,`Cannot parse version ${t}: invalid minor version`),i=Ei(e.patch,`Cannot parse version ${t}: invalid patch version`),s=e.prerelease?Zt(e.prerelease):[],o=e.buildmetadata?Zr(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:s,build:o}}function c_(t,e){let r=t.operator,n=e.operator;if(r===void 0)return Un(t)?!0:fu(t,[[e]]);if(n===void 0)return Un(e)?!0:fu(e,[[t]]);let i=Qt(t,e);return(r===">="||r===">")&&(n===">="||n===">")||(r==="<="||r==="<")&&(n==="<="||n==="<")||i===0&&((r===">="||r==="<=")&&(n===">="||n==="<="))||i===-1&&(r===">="||r===">")&&(n==="<="||n==="<")||i===1&&(r==="<="||r==="<")&&(n===">="||n===">")}function $U(t){return t.every(e=>e.some(r=>LU(r)))}function LU(t){for(let e=0;e<t.length-1;e++){let r=t[e];for(let n of t.slice(e+1))if(!c_(r,n))return!1}return!0}function l_(t,e){return $U([t,e])&&t.some(r=>e.some(n=>r.every(i=>n.every(s=>c_(i,s)))))}function f_(t){try{return Et(t),!0}catch{return!1}}function Ci(t,e){return Qt(t,e)>=0}var Ga=xe(uS()),Wv=xe(qS()),L8=xe(DA()),kp=xe(n0());var Ri={name:"@capgo/cli",version:"7.22.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js",require:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && node build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload"},devDependencies:{"@antfu/eslint-config":"^6.1.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^7.4.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^0.11.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.6","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^24.9.1","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",esbuild:"^0.25.11",eslint:"^9.38.0","git-format-staged":"3.1.1",husky:"^9.1.7","is-wsl":"^3.1.0",open:"^10.1.2",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3"}};async function Rh(t){try{let r=`https://registry.npmjs.org/${encodeURIComponent(t.toLowerCase())}`,n=await fetch(r,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});return n.ok&&(await n.json())["dist-tags"]?.latest||null}catch{return null}}async function ze(){let t=await Rh("@capgo/cli")??"",e=t?.split(".")[0];t!==Ri.version&&w.warning(`\u{1F6A8} You are using @capgo/cli@${Ri.version} it's not the latest version.
|
|
284
284
|
Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function F1(t,e,r,n,i,s="\u2705"){await Ae(r,{channel:t,event:n,icon:s,user_id:e,...i?{tags:{"app-id":i}}:{},notify:!1})}var i0=require("node:buffer"),I1=require("node:crypto"),GX=(()=>{let t=[];for(let e=0;e<256;e++){let r=e;for(let n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;t[e]=r}return t})();function KX(t){let e=4294967295;for(let r=0;r<t.length;r++){let n=t[r];e=GX[(e^n)&255]^e>>>8}return e=e^4294967295,(e>>>0).toString(16).padStart(8,"0")}async function Jn(t,e="sha256"){let r=i0.Buffer.isBuffer(t)?t:i0.Buffer.from(t);if(e==="crc32")return KX(r);let n=(0,I1.createHash)(e);return n.update(r),n.digest("hex")}var Zc=xe(e8());async function t8(){let t=await(0,Zc.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function Sv(t,e,r=!1){let n=await(0,Zc.loadConfig)(),{extConfig:i}=n.app;i&&(i.plugins||(i.plugins={extConfig:{},[t]:{}}),i.plugins[t]||(i.plugins[t]={}),r?i=e.config:i.plugins[t]=e.config.plugins?.[t],(0,Zc.writeConfig)(i,n.app.extConfigFilePath))}async function Ua(t,e=!1){await Sv("CapacitorUpdater",t,e)}var Ka=".capgo_key",Ir=".capgo_key_v2",Pp=`${Ka}.pub`,pi=`${Ir}.pub`,F8="https://capgo.app",I8="https://files.capgo.app",k8="https://api.capgo.app",P8="https://console.capgo.app",Xv=12e4,fle=1024*1024*20,hle=1024*1024*1024,dle=1024*1024*99,$n="package.json",Wa=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i,W=t=>t?`
|
|
285
285
|
${L8.default.render(t)}`:"";function Fp(t){return new Promise(e=>{setTimeout(e,t)})}function Xr(t){return(0,ns.isMonorepo)(t)?(0,ns.findMonorepoRoot)(t):(0,ns.isNXMonorepo)(t)?(0,ns.findNXMonorepoRoot)(t):t}function ple(t=Xr((0,di.cwd)()),e=void 0){let r=e?.split(",")[0];if(r&&!(0,At.existsSync)(r)){let i=`Package.json at ${r} does not exist`;throw w.error(i),new Error(i)}let n=(0,At.readFileSync)(r??(0,Tt.join)(t,$n));return JSON.parse(n)}function is(t=Xr((0,di.cwd)()),e=void 0){return ple(t,e).version??""}function R8(t){let e=t.replace("^","").replace("~","");if(f_(e))try{let r=Et(e);return _i(r)}catch{return e}return e}async function Ln(t=Xr((0,di.cwd)()),e=void 0){let r=e?.split(",");if(r??=[(0,Tt.join)(t,$n)],r){for(let i of r)if(!(0,At.existsSync)(i)){let s=`Package.json at ${i} does not exist`;throw w.error(s),new Error(s)}}let n=new Map;for(let i of r){let s=(0,At.readFileSync)(i),o=JSON.parse(s);for(let a in o.dependencies)n.set(a,R8(o.dependencies[a]));for(let a in o.devDependencies)n.set(a,R8(o.devDependencies[a]))}return n}async function de(){try{let t=await t8();if(!t){let e="No capacitor config file found, run `cap init` first";throw w.error(e),new Error(e)}return t}catch(t){let e=`No capacitor config file found, run \`cap init\` first ${W(t)}`;throw w.error(e),new Error(e)}}async function mle(t,e){let r=await de();return r?.config&&(r.config.plugins??={},r.config.plugins.extConfig??={},r.config.plugins[t]??={},r.config.plugins[t]={...r.config.plugins[t],...e},await Sv(t,r)),r}async function j8(t){return mle("CapacitorUpdater",t)}async function wn(){try{let t=await de(),e={host:t?.config?.plugins?.CapacitorUpdater?.localHost||F8,hostWeb:t?.config?.plugins?.CapacitorUpdater?.localWebHost||P8,hostFilesApi:t?.config?.plugins?.CapacitorUpdater?.localApiFiles||I8,hostApi:t?.config?.plugins?.CapacitorUpdater?.localApi||k8};return t?.config?.plugins?.CapacitorUpdater?.localSupa&&t?.config?.plugins?.CapacitorUpdater?.localSupaAnon&&(w.info("Using custom supabase instance from capacitor.config.json"),e.supaKey=t?.config?.plugins?.CapacitorUpdater?.localSupaAnon,e.supaHost=t?.config?.plugins?.CapacitorUpdater?.localSupa),e}catch{return{host:F8,hostWeb:P8,hostFilesApi:I8,hostApi:k8}}}var gle=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function Rp(){let t=await wn();try{let e=await fetch(`${t.hostApi}/private/config`);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return{...await e.json(),...t}}catch{return w.info(`Local config ${W(t)}`),t}}async function B8(){let t=await wn();try{let e=await fetch(`${t.hostFilesApi}/files/config`);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch{return{partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1,maxUploadLength:hle,maxChunkSize:dle,alertUploadSize:fle}}}async function pe(t,e,r){let n=await Rp();if(e&&r&&(w.info("Using custom supabase instance from provided options"),n.supaHost=e,n.supaKey=r),!n.supaHost||!n.supaKey)throw w.error("Cannot connect to server please try again later"),new Error("Cannot connect to server please try again later");return(0,Ga.createClient)(n.supaHost,n.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function yle(t,e,r){let{data:n}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:r}).single();if(!n){w.error("Invalid API key or insufficient permissions.");let s=`Your key should be: ${r.map((o,a)=>r.length===1?`"${o}"`:a===r.length-1?`or "${o}"`:`"${o}", `).join("")} mode.`;throw w.error(s),new Error("Invalid API key or insufficient permissions.")}}async function M8(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function q8(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function Dle(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function wle(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var fr=(o=>(o[o.none=0]="none",o[o.read=1]="read",o[o.upload=2]="upload",o[o.write=3]="write",o[o.admin=4]="admin",o[o.super_admin=5]="super_admin",o))(fr||{}),Xa=(t,e)=>t>=e;async function U8(t,e,r){let{data:n,error:i}=await t.rpc("get_org_perm_for_apikey",{apikey:e,app_id:r}).single();if(i)throw w.error("Cannot get permissions for organization!"),console.error(i),new Error("Cannot get permissions for organization");if(n.includes("perm")){let a=null;switch(n){case"perm_none":{a=0;break}case"perm_read":{a=1;break}case"perm_upload":{a=2;break}case"perm_write":{a=3;break}case"perm_admin":{a=4;break}case"perm_owner":{a=5;break}default:throw n.includes("invite")?(w.info("Please accept/deny the organization invitation before trying to access the app"),new Error("Organization invitation pending")):(w.error(`Invalid output when fetching organization permission. Response: ${n}`),new Error(`Invalid output when fetching organization permission. Response: ${n}`))}return{okay:!0,data:a}}let o=null;switch(n){case"INVALID_APIKEY":{o="INVALID_APIKEY";break}case"NO_APP":{o="NO_APP";break}case"NO_ORG":{o="NO_ORG";break}default:throw w.error(`Invalid error when fetching organization permission. Response: ${n}`),new Error(`Invalid error when fetching organization permission. Response: ${n}`)}return{okay:!1,error:o}}async function H8(t,e,r){let{data:n,error:i}=await t.rpc("get_organization_cli_warnings",{orgid:e,cli_version:r});if(i){w.error(`Cannot get cli warnings: ${W(i)}`);return}if(n.length>0){w.warn(`Found ${n.length} cli warnings for your organization.`);let s=null;for(let o of n){if(typeof o!="object"||typeof o.message!="string"||typeof o.fatal!="boolean"){w.error(`Invalid cli warning: ${o}`);continue}let a=o;a.fatal?(w.error(`${a.message.replaceAll("\\n",`
|
|
286
286
|
`)}`),s=new Error(a.message)):w.warn(`${a.message.replaceAll("\\n",`
|
|
@@ -325,23 +325,22 @@ ${W(s)}`),new Error(`Cannot retrieve unknown version for app ${e}: ${W(s)}`)}fun
|
|
|
325
325
|
`)+`
|
|
326
326
|
`,n.join(";").toLowerCase(),i].join(`
|
|
327
327
|
`)}async function LM(t,e,r){let n=await Gp(t),i=iE(r,e);return[ol,ao(e),i,n].join(`
|
|
328
|
-
`)}async function oE(t,e,r){let n=nE(t),i=await co("AWS4"+r,n),s=await co(i,e),o=await co(s,"s3");return await co(o,"aws4_request")}function aE(t,e,r){return`${t}/${iE(e,r)}`}async function co(t,e){let r=new TextEncoder,n=await crypto.subtle.importKey("raw",t instanceof Uint8Array?t:r.encode(t),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),i=await crypto.subtle.sign("HMAC",n,e instanceof Uint8Array?e:r.encode(e));return new Uint8Array(i)}async function jM(t){if(!t.accessKey)throw new as;if(!t.secretKey)throw new ru;if(t.expirySeconds<1||t.expirySeconds>604800)throw new il;let e=new Date(t.date);e.setSeconds(e.getSeconds()+t.expirySeconds);let r=aE(t.accessKey,t.region,t.date),n=ao(t.date),i={"X-Amz-Algorithm":ol,"X-Amz-Credential":r,"X-Amz-Date":n,key:t.objectKey,...t.fields},s=[{bucket:t.bucket},{key:t.objectKey},{"X-Amz-Algorithm":ol},{"X-Amz-Credential":r},{"X-Amz-Date":n}];t.conditions&&s.push(...t.conditions);for(let[f,m]of Object.entries(t.fields||{}))["key","X-Amz-Algorithm","X-Amz-Credential","X-Amz-Date"].includes(f)||s.push({[f]:m});let o={expiration:e.toISOString(),conditions:s},a=new TextEncoder().encode(JSON.stringify(o)),u=btoa(String.fromCharCode(...a));i.policy=u;let c=u,l=await oE(t.date,t.region,t.secretKey),h=sl(await co(l,c)).toLowerCase();return i["X-Amz-Signature"]=h,{url:`${t.protocol}//${t.host}/${t.bucket}`,fields:i}}var Ble=["Content-Type","Cache-Control","Content-Disposition","Content-Encoding","Content-Language","Expires","x-amz-checksum-sha256","x-amz-grant-full-control","x-amz-grant-read","x-amz-grant-read-acp","x-amz-grant-write-acp","x-amz-server-side-encryption","x-amz-storage-class","x-amz-website-redirect-location","x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5","x-amz-server-side-encryption-aws-kms-key-id","x-amz-server-side-encryption-context","x-amz-server-side-encryption-bucket-key-enabled","x-amz-request-payer","x-amz-tagging","x-amz-object-lock-mode","x-amz-object-lock-retain-until-date","x-amz-object-lock-legal-hold","x-amz-expected-bucket-owner"],Mle=5*1024*1024,qle=5*1024*1024*1024,uE=5*1024*1024*1024*1024,al=class{host;port;protocol;accessKey;#e;sessionToken;defaultBucket;region;userAgent="s3-lite-client";pathStyle;pathPrefix;constructor({endPoint:e,useSSL:r,port:n,pathPrefix:i,...s}){if(/^https?:\/\//i.test(e)){if(r!==void 0||n!==void 0||i!==void 0)throw new Yt("useSSL/port/pathPrefix cannot be specified if endPoint is a URL.");try{let a=new URL(e);e=a.hostname,r=a.protocol==="https:",n=a.port?parseInt(a.port,10):r?443:80,a.pathname&&a.pathname!=="/"&&(i=a.pathname.endsWith("/")?a.pathname.slice(0,-1):a.pathname)}catch{throw new nl(`Invalid endPoint URL: ${e}`)}}if(typeof e!="string"||e.length===0)throw new nl(`Invalid endPoint: ${e}`);if(r===void 0&&(r=!0),n!==void 0&&!IM(n))throw new Yt(`Invalid port: ${n}`);if(s.accessKey&&!s.secretKey)throw new Yt("If specifying access key, secret key must also be provided.");if(s.accessKey&&s.accessKey.startsWith("ASIA")&&!s.sessionToken)throw new Yt("If specifying temporary access key, session token must also be provided.");let o=r?443:80;if(this.port=n??o,this.host=e.toLowerCase()+(this.port!==o?`:${this.port}`:""),this.protocol=r?"https:":"http:",this.accessKey=s.accessKey,this.#e=s.secretKey??"",this.sessionToken=s.sessionToken,this.pathStyle=s.pathStyle??!0,this.pathPrefix=i??"",this.defaultBucket=s.bucket,this.region=s.region,this.pathPrefix){if(!this.pathStyle)throw new Yt("pathPrefix is incompatible with pathStyle=false");if(!this.pathPrefix.startsWith("/"))throw new Yt("pathPrefix should start with /");if(this.pathPrefix.endsWith("/"))throw new Yt("pathPrefix should not end with /")}}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!kM(r))throw new zp(r??"");return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,i=e.headers??new Headers;i.set("host",n);let s=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,o=this.pathStyle?`${this.pathPrefix}/${r}/${e.objectName}`:`/${e.objectName}`,a=s?`?${s}`:"",u=o+a,c=o.split("/").map(l=>encodeURIComponent(l)).join("/")+a;return{headers:i,host:n,path:u,encodedPath:c}}async makeRequest({method:e,payload:r,...n}){let i=new Date,{headers:s,host:o,path:a,encodedPath:u}=this.buildRequestOptions(n),c=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),s.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let l=await Gp(r??new Uint8Array);s.set("x-amz-date",ao(i)),s.set("x-amz-content-sha256",l),this.accessKey&&(this.sessionToken&&s.set("x-amz-security-token",this.sessionToken),s.set("authorization",await PM({headers:s,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let h=`${this.protocol}//${o}${u}`,d=await fetch(h,{method:e,headers:s,body:r});if(d.status!==c)throw d.status>=400?await FM(d):d.status===301?new Di(d.status,"UnexpectedRedirect",'The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"'):new Di(d.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${c}, got ${d.status} ${d.statusText}).`);return n.returnBody||await d.body?.getReader().read(),d}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!us(e))throw new Bn(e);let i=r.versionId?{versionId:r.versionId}:{},s=new Headers;r.governanceBypass&&s.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:s,query:i,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof Di&&n.statusCode===404)return!1;throw n}}getObject(e,r){return this.getPartialObject(e,{...r,offset:0,length:0})}async getPartialObject(e,{offset:r,length:n,...i}){let s=this.getBucketName(i);if(!us(e))throw new Bn(e);let o=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let c="";r?c=`bytes=${+r}-`:(c="bytes=0-",r=0),n&&(c+=`${+n+r-1}`),o.set("Range",c),a=206}let u={...i.responseParams,...i.versionId?{versionId:i.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:s,objectName:e,headers:o,query:u,statusCode:a,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new as;if(!us(r))throw new Bn(r);let{headers:i,path:s}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),o=n.requestDate??new Date,a=n.expirySeconds??1440*60*7;return RM({protocol:this.protocol,headers:i,method:e,path:s,accessKey:this.accessKey,secretKey:this.#e,sessionToken:this.sessionToken,region:this.region,date:o,expirySeconds:a})}presignedGetObject(e,r={}){let{versionId:n,responseParams:i,...s}=r,o={...i,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:o,...s})}async*listObjects(e={}){for await(let r of this.listObjectsGrouped({...e,delimiter:""}))if(r.type==="Object")yield r;else throw new Error(`Unexpected result from listObjectsGrouped(): ${r}`)}async*listObjectsGrouped(e){let r=this.getBucketName(e),n="",i=e.pageSize??1e3;if(i<1||i>1e3)throw new Yt("pageSize must be between 1 and 1,000.");let s=0;for(;;){let o=e.maxResults?Math.min(i,e.maxResults-s):i;if(o===0)return;let u=await(await this.makeRequest({method:"GET",bucketName:r,objectName:"",query:{"list-type":"2",prefix:e.prefix??"",delimiter:e.delimiter,"max-keys":String(o),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),c=os(u).root;if(!c||c.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let l=c.children.filter(f=>f.name==="CommonPrefixes").flatMap(f=>f.children),h=[];for(let f of l)h.push({type:"CommonPrefix",prefix:f.content??""}),s++;for(let f of c.children.filter(m=>m.name==="Contents"))h.push({type:"Object",key:f.children.find(m=>m.name==="Key")?.content??"",etag:oo(f.children.find(m=>m.name==="ETag")?.content??""),size:parseInt(f.children.find(m=>m.name==="Size")?.content??"",10),lastModified:new Date(f.children.find(m=>m.name==="LastModified")?.content??"invalid")}),s++;h.sort((f,m)=>{let g=f.type==="Object"?f.key:f.prefix,b=m.type==="Object"?m.key:m.prefix;return g>b?1:g<b?-1:0});for(let f of h)yield f;if(c.children.find(f=>f.name==="IsTruncated")?.content==="true"){let f=c.children.find(m=>m.name==="NextContinuationToken")?.content;if(!f)throw new Error("Unexpectedly missing continuation token, but server said there are more results.");n=f}else return}}async putObject(e,r,n){let i=this.getBucketName(n);if(!us(e))throw new Bn(e);let s,o;if(typeof r=="string"){let l=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?o=ReadableStream.from([l]):o=new ReadableStream({start(h){h.enqueue(l),h.close()}}),s=l.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?o=ReadableStream.from([r]):o=new ReadableStream({start(l){l.enqueue(r),l.close()}}),s=r.byteLength;else if(r instanceof ReadableStream)o=r;else throw new Yt("Invalid stream/data type provided.");if(n?.size!==void 0){if(s!==void 0&&n?.size!==s)throw new Yt(`size was specified (${n.size}) but doesn't match auto-detected size (${s}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new Yt(`invalid size specified: ${n.size}`);s=n.size}let a=n?.partSize??this.calculatePartSize(s);if(a<Mle)throw new Yt("Part size should be greater than 5MB");if(a>qle)throw new Yt("Part size should be less than 6MB");let u=new Vp(a),c=new Kp({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await o.pipeThrough(u).pipeTo(c),c.getResult()}calculatePartSize(e){if(e===void 0&&(e=uE),e>uE)throw new TypeError(`size should not be more than ${uE}`);let r=64*1024*1024;for(;;){if(r*1e4>e)return r;r+=16*1024*1024}}async statObject(e,r){let n=this.getBucketName(r);if(!us(e))throw new Bn(e);let i={};r?.versionId&&(i.versionId=r.versionId);let s=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:i,headers:new Headers(r?.headers)}),o={};for(let a of Ble)s.headers.has(a)&&(o[a]=s.headers.get(a));return s.headers.forEach((a,u)=>{u.startsWith("x-amz-meta-")&&(o[u]=s.headers.get(u))}),{type:"Object",key:e,size:parseInt(s.headers.get("content-length")??"",10),metadata:o,lastModified:new Date(s.headers.get("Last-Modified")??"error: missing last modified"),versionId:s.headers.get("x-amz-version-id")||null,etag:oo(s.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),s=e.sourceBucketName??i;if(!us(r))throw new Bn(r);let o=`${s}/${e.sourceKey}`;e.sourceVersionId&&(o+=`?versionId=${e.sourceVersionId}`);let a=new Headers(n?.metadata);n?.metadata!==void 0&&a.set("x-amz-metadata-directive","REPLACE"),a.set("x-amz-copy-source",o);let u=await this.makeRequest({method:"PUT",bucketName:i,objectName:r,headers:a,returnBody:!0}),c=await u.text(),l=os(c).root;if(!l||l.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${c}`);let h=l.children.find(f=>f.name==="ETag")?.content??"",d=l.children.find(f=>f.name==="LastModified")?.content;if(d===void 0)throw new Error("Unable to find <LastModified>...</LastModified> from the server.");return{copySourceVersionId:u.headers.get("x-amz-copy-source-version-id")||null,etag:oo(h),lastModified:new Date(d),versionId:u.headers.get("x-amz-version-id")||null}}async bucketExists(e){try{return await this.listObjects({bucketName:e}).next(),!0}catch(r){if(r instanceof Di&&r.statusCode===404)return!1;throw r}}async makeBucket(e){await this.makeRequest({method:"PUT",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:200})}async removeBucket(e){await this.makeRequest({method:"DELETE",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:204})}presignedPostObject(e,r={}){if(!us(e))throw new Bn(e);let n=this.getBucketName(r);if(!n)throw new Error("Bucket name is required for presignedPost, but none was provided either to this method nor to the client constructor");let i=r.requestDate||new Date,s=r.expirySeconds??3600;return jM({protocol:this.protocol,host:this.host,bucket:n,objectKey:e,accessKey:this.accessKey||"",secretKey:this.#e||"",region:this.region,date:i,expirySeconds:s,conditions:r.conditions,fields:r.fields})}};var lo=require("node:fs"),Wp=require("node:path");function Ule(t,e){return(0,lo.readFileSync)(t,"utf8").includes(e)}function ul(t,e){let r=(0,lo.readdirSync)(t);for(let n of r){let i=(0,Wp.join)(t,n),s=(0,lo.statSync)(i);if(s.isDirectory()){if(ul(i,e))return!0}else if(s.isFile()&&(0,Wp.extname)(i)===".js"&&Ule(i,e))return!0}return!1}function Xp(t){return(0,lo.readdirSync)(t).indexOf("index.html")>-1}var su=require("node:fs"),K6=require("node:os"),cs=require("node:path"),W6=require("node:process"),nm=require("node:stream/consumers"),X6=require("node:zlib");var Y6=xe(G6()),J6=xe(n0());async function nhe(t,e){try{return(await fetch(`${t.hostFilesApi}/files/read/attachments/${encodeURIComponent(e)}`,{method:"HEAD"})).ok}catch{return!1}}var Z6=8192,Q6="6.25.0",eq="7.0.35";async function ihe(t){let e=(0,cs.join)(Xr((0,W6.cwd)()),$n),n=(await Ln(void 0,t.packageJson||e)).get("@capgo/capacitor-updater"),i;try{i=n?Et(n):void 0}catch{i=void 0}if(!n||!i)return{version:null,supportsBrotliV2:!1};let s=i.major===6&&Ci(i,Et(Q6)),o=i.major>=7&&Ci(i,Et(eq)),a=s||o;return{version:`${i.major}.${i.minor}.${i.patch}`,supportsBrotliV2:a}}function she(t,e){if(!e)return!1;let r=e.split(",").map(n=>n.trim()).filter(n=>!!n);return r.length===0?!1:Y6.isMatch(t,r)}async function ohe(t,e,r){let i=(0,su.statSync)(t).size,s=await(0,nm.buffer)((0,su.createReadStream)(t));if(i===0)return{buffer:s,useBrotli:!1};if(she(e,r.noBrotliPatterns))return w.info(`Skipping brotli for excluded file: ${e}`),{buffer:s,useBrotli:!1};if(i<Z6)return{buffer:s,useBrotli:!1};try{let o=await(0,nm.buffer)((0,su.createReadStream)(t).pipe((0,X6.createBrotliCompress)({})));return o.length>=i-10?(w.info(`Brotli not effective for ${e} (${i} bytes), using original file`),{buffer:s,useBrotli:!1}):{buffer:o,useBrotli:!0}}catch(o){return w.warn(`Brotli compression failed for ${t}: ${o}, using original file`),{buffer:s,useBrotli:!1}}}async function tq(t,e,r,n,i,s){let o=Ft();o.start(i!=="v2"?"Generating the update manifest":"Generating the update manifest with v2 encryption");let a=await W8(t);if(i==="v2")for(let u of a)u.hash=tu(u.hash,s);return o.stop("Manifest generated successfully"),await Ae(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),a}function ahe(t){return(0,K6.platform)()!=="win32"?t:cs.win32.normalize(t).split(cs.win32.sep).join(cs.posix.sep)}function uhe(t){let e=t.split("/").map(r=>encodeURIComponent(r)).join("/");return t.includes(" ")&&w.warn(`File "${t}" contains spaces in its name.`),e}async function rq(t,e,r,n,i,s,o){let a=Ft();a.start("Preparing partial update with TUS protocol");let u=performance.now(),c=await wn(),l=!!(o.partial||o.delta||o.partialOnly||o.deltaOnly),{version:h,supportsBrotliV2:d}=await ihe(o);if(d)o.disableBrotli?w.info("Brotli compression disabled by user request"):(a.message(`Using .br extension for compatible files (updater ${h})`),o.noBrotliPatterns&&w.info(`Files matching patterns (${o.noBrotliPatterns}) will be excluded from brotli compression`),w.info(`Files smaller than ${Z6} bytes will be excluded from brotli compression (Brotli RFC minimum)`));else throw new Error(`Your project is using an older version of @capgo/capacitor-updater (${h||"unknown"}). To use Delta updates, please upgrade to version ${Q6} (v6) or ${eq} (v7) or higher.`);let f=e.filter(S=>S.file.includes(" "));if(f.length>0)throw new Error(`Files with spaces in their names (${f.map(S=>S.file).join(", ")}). Please rename the files.`);let m=0,g=e.length,b=0;try{let S=e.map(async y=>{let C=(0,cs.join)(r,y.file),k=ahe(y.file),v,R=!1;if(o.disableBrotli)v=await(0,nm.buffer)((0,su.createReadStream)(C)),R=!1;else{let G=await ohe(C,k,o);v=G.buffer,R=G.useBrotli}let P=v;s&&(P=eu(v,s.sessionKey,s.ivSessionKey));let F=k;R&&(F=`${k}.br`,b++);let j=uhe(F),U=`orgs/${i}/apps/${n}/delta/${y.hash}_${j}`;return await nhe(c,U)?(m++,Promise.resolve({file_name:j,s3_path:U,file_hash:y.hash})):new Promise((G,L)=>{let _=0,T=3,I=()=>{new J6.Upload(P,{endpoint:`${c.hostFilesApi}/files/upload/attachments/`,chunkSize:o.tusChunkSize,retryDelays:[0,1e3,3e3,5e3],removeFingerprintOnSuccess:!0,metadata:{filename:U},headers:{Authorization:t},onError:async M=>{let B=M.toString();if(B.includes("offset")||B.includes("409")||B.includes("conflict"))if(_++,_<=T){w.warn(`Offset mismatch for ${k}, retrying (attempt ${_}/${T})...`),await new Promise(K=>setTimeout(K,1e3*_)),I();return}else w.error(`Failed to upload ${k} after ${T} retries due to offset errors`),w.info("This may happen if the upload expired or there was a network issue. The file will be skipped.");else w.error(`Failed to upload ${k}: ${B}`);L(M)},onProgress(){let M=(m/g*100).toFixed(2);a.message(`Uploading partial update: ${M}%`)},onSuccess(){m++,G({file_name:j,s3_path:U,file_hash:y.hash})}}).start()};I()})}),A=await Promise.all(S),D=((performance.now()-u)/1e3).toFixed(2);return a.stop(`Partial update uploaded successfully \u{1F4AA} in (${D} seconds)`),b>0&&w.info(`${b} of ${g} files were compressed with brotli and use .br extension`),await Ae(t,{channel:"app",event:`App Partial TUS done${b>0?" with .br extension":""}`,icon:"\u23EB",user_id:i,tags:{"app-id":n},notify:!1}),await Ae(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":n,time:D},notify:!1}),A}catch(S){let p=((performance.now()-u)/1e3).toFixed(2);if(a.stop(`Failed to upload Partial bundle (after ${p} seconds)`),l)throw w.error(`Error uploading partial update: ${S}`),w.error("Delta/partial upload was explicitly requested but failed. Upload aborted."),S;return w.info(`Error uploading partial update: ${S}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}function gt(t){throw w.error(t),new Error(t)}async function che(t,e){let r=is("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r||`0.0.1-beta.${(0,nq.randomUUID)().split("-")[0]}`;return Wa.test(n)||gt(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),n}function lhe(t){let e=t.apikey||ne();return e||gt("Missing API key, you need to provide an API key to upload your bundle"),e}function fhe(t,e,r){let n=Pe(t,r),i=e.path||r?.webDir;return n||gt("Missing argument, you need to provide a appid or be in a capacitor project"),i||gt("Missing argument, you need to provide a path (--path), or be in a capacitor project"),(0,po.existsSync)(i)||gt(`Path ${i} does not exist, build your app first, or provide a valid path`),{appid:n,path:i}}function hhe(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(ul(e,"notifyAppReady")||gt(`notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready
|
|
329
|
-
If you are sure your app has this code, you can use the --no-code-check option`),Xp(e)||gt(`index.html is missing in the root folder of ${e}`))}async function dhe(t,e,r,n,i,s){let o=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:c,error:l}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),h=!!c&&c.disable_auto_update==="version_number",d,f;if(!l&&c&&c.version&&c.version.native_packages&&!o){let b=Ft();b.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:S,localDependencies:A}=await jp(t,i,n,r.packageJson,r.nodeModules);if(f=S,d=A,f.find(p=>!so(p)))b.stop(`Bundle NOT compatible with ${n} channel`),w.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=s,w.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:p}=c.version;(!p||!Wa.test(p))&>("Invalid remote min update version, skipping auto setting compatibility"),u=p,b.stop(`Auto set min-update-version to ${u}`)}catch{gt(`Cannot auto set compatibility, invalid data ${c}`)}else b.stop(`Bundle compatible with ${n} channel`)}else o||(w.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),d=await Jv(r.packageJson,r.nodeModules),a&&(u=s,w.info(`Auto set min-update-version to ${u}`)));h&&!u&&!o&>("You need to provide a min-update-version to upload a bundle to this channel"),u&&(Wa.test(u)||gt(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`));let m=d?new Map(d.filter(b=>!!b.native&&b.native!==void 0).map(b=>[b.name,b])):new Map;return{nativePackages:m.size>0||!r.ignoreMetadataCheck?Array.from(m,([b,S])=>({name:b,version:S.version})):void 0,minUpdateVersion:u}}async function phe(t,e,r){let{data:
|
|
330
|
-
Trial expires in ${n} days`),w.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function mhe(t,e,r,n=!1){let{data:i,error:s}=await t.rpc("exist_app_versions",{appid:e,name_version:r}).single();if(i||s){if(n)return w.warn(`Version ${r} already exists - exiting gracefully due to --silent-fail option`),ce("Bundle version already exists - exiting gracefully \u{1F389}"),!0;gt(`Version ${r} already exists ${W(s)}`)}return!1}async function ghe(t,e,r,n,i,s,o){let a,u,c="",l=null,h="none",d="",f=e.keyV2,m=e.key===!1;l=await Np(t);let g=Ft();g.start("Calculating checksum");let b=(0,SE.join)(Xr((0,AE.cwd)()),$n),A=(await Ln(void 0,e.packageJson||b)).get("@capgo/capacitor-updater"),p=!1,D;try{D=A?Et(A):void 0}catch{D=void 0}if(A?D?p=Ci(D,Et("6.25.0")):(A==="link:@capgo/capacitor-updater"||A==="file:.."||A==="file:../")&&(w.warn("Using local @capgo/capacitor-updater. Assuming latest version for checksum calculation."),p=!0):gt("Cannot find @capgo/capacitor-updater in ./package.json, provide the package.json path with --package-json it's required for v7 CLI to work"),(f||e.keyDataV2||(0,po.existsSync)(Ir))&&!m||p?c=await Jn(l,"sha256"):c=await Jn(l,"crc32"),g.stop(`Checksum ${p?"SHA256":"CRC32"}: ${c}`),m)w.info("Encryption ignored");else if((f||(0,po.existsSync)(Ir)||e.keyDataV2)&&!e.oldEncryption){let k=typeof f=="string"?f:Ir,v=e.keyDataV2||"";!v&&!(0,po.existsSync)(k)&>(`Cannot find private key ${k}`),await Ae(r,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:n,tags:{"app-id":i},notify:!1},e.verbose),v||(v=(0,po.readFileSync)(k).toString()),w.info("Encrypting your bundle with V2");let{sessionKey:R,ivSessionKey:P}=Hp(v),F=eu(l,R,P);c=tu(c,v),a=P,u=R,h="v2",d=v,e.displayIvSession&&w.info(`Your Iv Session key is ${a},
|
|
328
|
+
`)}async function oE(t,e,r){let n=nE(t),i=await co("AWS4"+r,n),s=await co(i,e),o=await co(s,"s3");return await co(o,"aws4_request")}function aE(t,e,r){return`${t}/${iE(e,r)}`}async function co(t,e){let r=new TextEncoder,n=await crypto.subtle.importKey("raw",t instanceof Uint8Array?t:r.encode(t),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),i=await crypto.subtle.sign("HMAC",n,e instanceof Uint8Array?e:r.encode(e));return new Uint8Array(i)}async function jM(t){if(!t.accessKey)throw new as;if(!t.secretKey)throw new ru;if(t.expirySeconds<1||t.expirySeconds>604800)throw new il;let e=new Date(t.date);e.setSeconds(e.getSeconds()+t.expirySeconds);let r=aE(t.accessKey,t.region,t.date),n=ao(t.date),i={"X-Amz-Algorithm":ol,"X-Amz-Credential":r,"X-Amz-Date":n,key:t.objectKey,...t.fields},s=[{bucket:t.bucket},{key:t.objectKey},{"X-Amz-Algorithm":ol},{"X-Amz-Credential":r},{"X-Amz-Date":n}];t.conditions&&s.push(...t.conditions);for(let[f,m]of Object.entries(t.fields||{}))["key","X-Amz-Algorithm","X-Amz-Credential","X-Amz-Date"].includes(f)||s.push({[f]:m});let o={expiration:e.toISOString(),conditions:s},a=new TextEncoder().encode(JSON.stringify(o)),u=btoa(String.fromCharCode(...a));i.policy=u;let c=u,l=await oE(t.date,t.region,t.secretKey),h=sl(await co(l,c)).toLowerCase();return i["X-Amz-Signature"]=h,{url:`${t.protocol}//${t.host}/${t.bucket}`,fields:i}}var Ble=["Content-Type","Cache-Control","Content-Disposition","Content-Encoding","Content-Language","Expires","x-amz-checksum-sha256","x-amz-grant-full-control","x-amz-grant-read","x-amz-grant-read-acp","x-amz-grant-write-acp","x-amz-server-side-encryption","x-amz-storage-class","x-amz-website-redirect-location","x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5","x-amz-server-side-encryption-aws-kms-key-id","x-amz-server-side-encryption-context","x-amz-server-side-encryption-bucket-key-enabled","x-amz-request-payer","x-amz-tagging","x-amz-object-lock-mode","x-amz-object-lock-retain-until-date","x-amz-object-lock-legal-hold","x-amz-expected-bucket-owner"],Mle=5*1024*1024,qle=5*1024*1024*1024,uE=5*1024*1024*1024*1024,al=class{host;port;protocol;accessKey;#e;sessionToken;defaultBucket;region;userAgent="s3-lite-client";pathStyle;pathPrefix;constructor({endPoint:e,useSSL:r,port:n,pathPrefix:i,...s}){if(/^https?:\/\//i.test(e)){if(r!==void 0||n!==void 0||i!==void 0)throw new Yt("useSSL/port/pathPrefix cannot be specified if endPoint is a URL.");try{let a=new URL(e);e=a.hostname,r=a.protocol==="https:",n=a.port?parseInt(a.port,10):r?443:80,a.pathname&&a.pathname!=="/"&&(i=a.pathname.endsWith("/")?a.pathname.slice(0,-1):a.pathname)}catch{throw new nl(`Invalid endPoint URL: ${e}`)}}if(typeof e!="string"||e.length===0)throw new nl(`Invalid endPoint: ${e}`);if(r===void 0&&(r=!0),n!==void 0&&!IM(n))throw new Yt(`Invalid port: ${n}`);if(s.accessKey&&!s.secretKey)throw new Yt("If specifying access key, secret key must also be provided.");if(s.accessKey&&s.accessKey.startsWith("ASIA")&&!s.sessionToken)throw new Yt("If specifying temporary access key, session token must also be provided.");let o=r?443:80;if(this.port=n??o,this.host=e.toLowerCase()+(this.port!==o?`:${this.port}`:""),this.protocol=r?"https:":"http:",this.accessKey=s.accessKey,this.#e=s.secretKey??"",this.sessionToken=s.sessionToken,this.pathStyle=s.pathStyle??!0,this.pathPrefix=i??"",this.defaultBucket=s.bucket,this.region=s.region,this.pathPrefix){if(!this.pathStyle)throw new Yt("pathPrefix is incompatible with pathStyle=false");if(!this.pathPrefix.startsWith("/"))throw new Yt("pathPrefix should start with /");if(this.pathPrefix.endsWith("/"))throw new Yt("pathPrefix should not end with /")}}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!kM(r))throw new zp(r??"");return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,i=e.headers??new Headers;i.set("host",n);let s=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,o=this.pathStyle?`${this.pathPrefix}/${r}/${e.objectName}`:`/${e.objectName}`,a=s?`?${s}`:"",u=o+a,c=o.split("/").map(l=>encodeURIComponent(l)).join("/")+a;return{headers:i,host:n,path:u,encodedPath:c}}async makeRequest({method:e,payload:r,...n}){let i=new Date,{headers:s,host:o,path:a,encodedPath:u}=this.buildRequestOptions(n),c=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),s.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let l=await Gp(r??new Uint8Array);s.set("x-amz-date",ao(i)),s.set("x-amz-content-sha256",l),this.accessKey&&(this.sessionToken&&s.set("x-amz-security-token",this.sessionToken),s.set("authorization",await PM({headers:s,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let h=`${this.protocol}//${o}${u}`,d=await fetch(h,{method:e,headers:s,body:r});if(d.status!==c)throw d.status>=400?await FM(d):d.status===301?new Di(d.status,"UnexpectedRedirect",'The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"'):new Di(d.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${c}, got ${d.status} ${d.statusText}).`);return n.returnBody||await d.body?.getReader().read(),d}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!us(e))throw new Bn(e);let i=r.versionId?{versionId:r.versionId}:{},s=new Headers;r.governanceBypass&&s.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:s,query:i,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof Di&&n.statusCode===404)return!1;throw n}}getObject(e,r){return this.getPartialObject(e,{...r,offset:0,length:0})}async getPartialObject(e,{offset:r,length:n,...i}){let s=this.getBucketName(i);if(!us(e))throw new Bn(e);let o=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let c="";r?c=`bytes=${+r}-`:(c="bytes=0-",r=0),n&&(c+=`${+n+r-1}`),o.set("Range",c),a=206}let u={...i.responseParams,...i.versionId?{versionId:i.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:s,objectName:e,headers:o,query:u,statusCode:a,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new as;if(!us(r))throw new Bn(r);let{headers:i,path:s}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),o=n.requestDate??new Date,a=n.expirySeconds??1440*60*7;return RM({protocol:this.protocol,headers:i,method:e,path:s,accessKey:this.accessKey,secretKey:this.#e,sessionToken:this.sessionToken,region:this.region,date:o,expirySeconds:a})}presignedGetObject(e,r={}){let{versionId:n,responseParams:i,...s}=r,o={...i,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:o,...s})}async*listObjects(e={}){for await(let r of this.listObjectsGrouped({...e,delimiter:""}))if(r.type==="Object")yield r;else throw new Error(`Unexpected result from listObjectsGrouped(): ${r}`)}async*listObjectsGrouped(e){let r=this.getBucketName(e),n="",i=e.pageSize??1e3;if(i<1||i>1e3)throw new Yt("pageSize must be between 1 and 1,000.");let s=0;for(;;){let o=e.maxResults?Math.min(i,e.maxResults-s):i;if(o===0)return;let u=await(await this.makeRequest({method:"GET",bucketName:r,objectName:"",query:{"list-type":"2",prefix:e.prefix??"",delimiter:e.delimiter,"max-keys":String(o),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),c=os(u).root;if(!c||c.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let l=c.children.filter(f=>f.name==="CommonPrefixes").flatMap(f=>f.children),h=[];for(let f of l)h.push({type:"CommonPrefix",prefix:f.content??""}),s++;for(let f of c.children.filter(m=>m.name==="Contents"))h.push({type:"Object",key:f.children.find(m=>m.name==="Key")?.content??"",etag:oo(f.children.find(m=>m.name==="ETag")?.content??""),size:parseInt(f.children.find(m=>m.name==="Size")?.content??"",10),lastModified:new Date(f.children.find(m=>m.name==="LastModified")?.content??"invalid")}),s++;h.sort((f,m)=>{let g=f.type==="Object"?f.key:f.prefix,b=m.type==="Object"?m.key:m.prefix;return g>b?1:g<b?-1:0});for(let f of h)yield f;if(c.children.find(f=>f.name==="IsTruncated")?.content==="true"){let f=c.children.find(m=>m.name==="NextContinuationToken")?.content;if(!f)throw new Error("Unexpectedly missing continuation token, but server said there are more results.");n=f}else return}}async putObject(e,r,n){let i=this.getBucketName(n);if(!us(e))throw new Bn(e);let s,o;if(typeof r=="string"){let l=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?o=ReadableStream.from([l]):o=new ReadableStream({start(h){h.enqueue(l),h.close()}}),s=l.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?o=ReadableStream.from([r]):o=new ReadableStream({start(l){l.enqueue(r),l.close()}}),s=r.byteLength;else if(r instanceof ReadableStream)o=r;else throw new Yt("Invalid stream/data type provided.");if(n?.size!==void 0){if(s!==void 0&&n?.size!==s)throw new Yt(`size was specified (${n.size}) but doesn't match auto-detected size (${s}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new Yt(`invalid size specified: ${n.size}`);s=n.size}let a=n?.partSize??this.calculatePartSize(s);if(a<Mle)throw new Yt("Part size should be greater than 5MB");if(a>qle)throw new Yt("Part size should be less than 6MB");let u=new Vp(a),c=new Kp({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await o.pipeThrough(u).pipeTo(c),c.getResult()}calculatePartSize(e){if(e===void 0&&(e=uE),e>uE)throw new TypeError(`size should not be more than ${uE}`);let r=64*1024*1024;for(;;){if(r*1e4>e)return r;r+=16*1024*1024}}async statObject(e,r){let n=this.getBucketName(r);if(!us(e))throw new Bn(e);let i={};r?.versionId&&(i.versionId=r.versionId);let s=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:i,headers:new Headers(r?.headers)}),o={};for(let a of Ble)s.headers.has(a)&&(o[a]=s.headers.get(a));return s.headers.forEach((a,u)=>{u.startsWith("x-amz-meta-")&&(o[u]=s.headers.get(u))}),{type:"Object",key:e,size:parseInt(s.headers.get("content-length")??"",10),metadata:o,lastModified:new Date(s.headers.get("Last-Modified")??"error: missing last modified"),versionId:s.headers.get("x-amz-version-id")||null,etag:oo(s.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),s=e.sourceBucketName??i;if(!us(r))throw new Bn(r);let o=`${s}/${e.sourceKey}`;e.sourceVersionId&&(o+=`?versionId=${e.sourceVersionId}`);let a=new Headers(n?.metadata);n?.metadata!==void 0&&a.set("x-amz-metadata-directive","REPLACE"),a.set("x-amz-copy-source",o);let u=await this.makeRequest({method:"PUT",bucketName:i,objectName:r,headers:a,returnBody:!0}),c=await u.text(),l=os(c).root;if(!l||l.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${c}`);let h=l.children.find(f=>f.name==="ETag")?.content??"",d=l.children.find(f=>f.name==="LastModified")?.content;if(d===void 0)throw new Error("Unable to find <LastModified>...</LastModified> from the server.");return{copySourceVersionId:u.headers.get("x-amz-copy-source-version-id")||null,etag:oo(h),lastModified:new Date(d),versionId:u.headers.get("x-amz-version-id")||null}}async bucketExists(e){try{return await this.listObjects({bucketName:e}).next(),!0}catch(r){if(r instanceof Di&&r.statusCode===404)return!1;throw r}}async makeBucket(e){await this.makeRequest({method:"PUT",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:200})}async removeBucket(e){await this.makeRequest({method:"DELETE",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:204})}presignedPostObject(e,r={}){if(!us(e))throw new Bn(e);let n=this.getBucketName(r);if(!n)throw new Error("Bucket name is required for presignedPost, but none was provided either to this method nor to the client constructor");let i=r.requestDate||new Date,s=r.expirySeconds??3600;return jM({protocol:this.protocol,host:this.host,bucket:n,objectKey:e,accessKey:this.accessKey||"",secretKey:this.#e||"",region:this.region,date:i,expirySeconds:s,conditions:r.conditions,fields:r.fields})}};var lo=require("node:fs"),Wp=require("node:path");function Ule(t,e){return(0,lo.readFileSync)(t,"utf8").includes(e)}function ul(t,e){let r=(0,lo.readdirSync)(t);for(let n of r){let i=(0,Wp.join)(t,n),s=(0,lo.statSync)(i);if(s.isDirectory()){if(ul(i,e))return!0}else if(s.isFile()&&(0,Wp.extname)(i)===".js"&&Ule(i,e))return!0}return!1}function Xp(t){return(0,lo.readdirSync)(t).indexOf("index.html")>-1}var su=require("node:fs"),K6=require("node:os"),cs=require("node:path"),W6=require("node:process"),nm=require("node:stream/consumers"),X6=require("node:zlib");var Y6=xe(G6()),J6=xe(n0());async function nhe(t,e){try{return(await fetch(`${t.hostFilesApi}/files/read/attachments/${encodeURIComponent(e)}`,{method:"HEAD"})).ok}catch{return!1}}var Z6=8192,Q6="6.25.0",eq="7.0.35";async function ihe(t){let e=(0,cs.join)(Xr((0,W6.cwd)()),$n),n=(await Ln(void 0,t.packageJson||e)).get("@capgo/capacitor-updater"),i;try{i=n?Et(n):void 0}catch{i=void 0}if(!n||!i)return{version:null,supportsBrotliV2:!1};let s=i.major===6&&Ci(i,Et(Q6)),o=i.major>=7&&Ci(i,Et(eq)),a=s||o;return{version:`${i.major}.${i.minor}.${i.patch}`,supportsBrotliV2:a}}function she(t,e){if(!e)return!1;let r=e.split(",").map(n=>n.trim()).filter(n=>!!n);return r.length===0?!1:Y6.isMatch(t,r)}async function ohe(t,e,r){let i=(0,su.statSync)(t).size,s=await(0,nm.buffer)((0,su.createReadStream)(t));if(i===0)return{buffer:s,useBrotli:!1};if(she(e,r.noBrotliPatterns))return w.info(`Skipping brotli for excluded file: ${e}`),{buffer:s,useBrotli:!1};if(i<Z6)return{buffer:s,useBrotli:!1};try{let o=await(0,nm.buffer)((0,su.createReadStream)(t).pipe((0,X6.createBrotliCompress)({})));return o.length>=i-10?{buffer:s,useBrotli:!1}:{buffer:o,useBrotli:!0}}catch(o){return w.warn(`Brotli compression failed for ${t}: ${o}, using original file`),{buffer:s,useBrotli:!1}}}async function tq(t,e,r,n,i,s){let o=Ft();o.start(i!=="v2"?"Generating the update manifest":"Generating the update manifest with v2 encryption");let a=await W8(t);if(i==="v2")for(let u of a)u.hash=tu(u.hash,s);return o.stop("Manifest generated successfully"),await Ae(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),a}function ahe(t){return(0,K6.platform)()!=="win32"?t:cs.win32.normalize(t).split(cs.win32.sep).join(cs.posix.sep)}function uhe(t){let e=t.split("/").map(r=>encodeURIComponent(r)).join("/");return t.includes(" ")&&w.warn(`File "${t}" contains spaces in its name.`),e}async function rq(t,e,r,n,i,s,o){let a=Ft();a.start("Preparing partial update with TUS protocol");let u=performance.now(),c=await wn(),l=!!(o.partial||o.delta||o.partialOnly||o.deltaOnly),{version:h,supportsBrotliV2:d}=await ihe(o);if(d)o.disableBrotli?w.info("Brotli compression disabled by user request"):(a.message(`Using .br extension for compatible files (updater ${h})`),o.noBrotliPatterns&&w.info(`Files matching patterns (${o.noBrotliPatterns}) will be excluded from brotli compression`),w.info(`Files smaller than ${Z6} bytes will be excluded from brotli compression (Brotli RFC minimum)`));else throw new Error(`Your project is using an older version of @capgo/capacitor-updater (${h||"unknown"}). To use Delta updates, please upgrade to version ${Q6} (v6) or ${eq} (v7) or higher.`);let f=e.filter(S=>S.file.includes(" "));if(f.length>0)throw new Error(`Files with spaces in their names (${f.map(S=>S.file).join(", ")}). Please rename the files.`);let m=0,g=e.length,b=0;try{let S=e.map(async y=>{let C=(0,cs.join)(r,y.file),k=ahe(y.file),v,R=!1;if(o.disableBrotli)v=await(0,nm.buffer)((0,su.createReadStream)(C)),R=!1;else{let G=await ohe(C,k,o);v=G.buffer,R=G.useBrotli}let P=v;s&&(P=eu(v,s.sessionKey,s.ivSessionKey));let F=k;R&&(F=`${k}.br`,b++);let j=uhe(F),U=`orgs/${i}/apps/${n}/delta/${y.hash}_${j}`;return await nhe(c,U)?(m++,Promise.resolve({file_name:j,s3_path:U,file_hash:y.hash})):new Promise((G,L)=>{let _=0,T=3,I=()=>{new J6.Upload(P,{endpoint:`${c.hostFilesApi}/files/upload/attachments/`,chunkSize:o.tusChunkSize,retryDelays:[0,1e3,3e3,5e3],removeFingerprintOnSuccess:!0,metadata:{filename:U},headers:{Authorization:t},onError:async M=>{let B=M.toString(),K;try{let V=B.match(/response text: (\{.*?\})/);V&&V[1]&&(K=JSON.parse(V[1]).moreInfo?.requestId)}catch{}let q=K?` [requestId: ${K}]`:"";if(B.includes("offset")||B.includes("409")||B.includes("conflict"))if(_++,_<=T){w.warn(`Offset mismatch for ${k}, retrying (attempt ${_}/${T})...${q}`),await new Promise(V=>setTimeout(V,1e3*_)),I();return}else w.error(`Failed to upload ${k} after ${T} retries due to offset errors${q}`),w.info("This may happen if the upload expired or there was a network issue. The file will be skipped.");else w.error(`Failed to upload ${k}: ${B}${q}`);L(M)},onProgress(){let M=(m/g*100).toFixed(2);a.message(`Uploading partial update: ${M}%`)},onSuccess(){m++,G({file_name:j,s3_path:U,file_hash:y.hash})}}).start()};I()})}),A=await Promise.all(S),D=((performance.now()-u)/1e3).toFixed(2);return a.stop(`Partial update uploaded successfully \u{1F4AA} in (${D} seconds)`),b>0&&w.info(`${b} of ${g} files were compressed with brotli and use .br extension`),await Ae(t,{channel:"app",event:`App Partial TUS done${b>0?" with .br extension":""}`,icon:"\u23EB",user_id:i,tags:{"app-id":n},notify:!1}),await Ae(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":n,time:D},notify:!1}),A}catch(S){let p=((performance.now()-u)/1e3).toFixed(2);if(a.stop(`Failed to upload Partial bundle (after ${p} seconds)`),l)throw w.error(`Error uploading partial update: ${S}`),w.error("Delta/partial upload was explicitly requested but failed. Upload aborted."),S;return w.info(`Error uploading partial update: ${S}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}function gt(t){throw w.error(t),new Error(t)}async function che(t,e){let r=is("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r||`0.0.1-beta.${(0,nq.randomUUID)().split("-")[0]}`;return Wa.test(n)||gt(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),n}function lhe(t){let e=t.apikey||ne();return e||gt("Missing API key, you need to provide an API key to upload your bundle"),e}function fhe(t,e,r){let n=Pe(t,r),i=e.path||r?.webDir;return n||gt("Missing argument, you need to provide a appid or be in a capacitor project"),i||gt("Missing argument, you need to provide a path (--path), or be in a capacitor project"),(0,po.existsSync)(i)||gt(`Path ${i} does not exist, build your app first, or provide a valid path`),{appid:n,path:i}}function hhe(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(ul(e,"notifyAppReady")||gt(`notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready
|
|
329
|
+
If you are sure your app has this code, you can use the --no-code-check option`),Xp(e)||gt(`index.html is missing in the root folder of ${e}`))}async function dhe(t,e,r,n,i,s){let o=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:c,error:l}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),h=!!c&&c.disable_auto_update==="version_number",d,f;if(!l&&c&&c.version&&c.version.native_packages&&!o){let b=Ft();b.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:S,localDependencies:A}=await jp(t,i,n,r.packageJson,r.nodeModules);if(f=S,d=A,f.find(p=>!so(p)))b.stop(`Bundle NOT compatible with ${n} channel`),w.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=s,w.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:p}=c.version;(!p||!Wa.test(p))&>("Invalid remote min update version, skipping auto setting compatibility"),u=p,b.stop(`Auto set min-update-version to ${u}`)}catch{gt(`Cannot auto set compatibility, invalid data ${c}`)}else b.stop(`Bundle compatible with ${n} channel`)}else o||(w.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),d=await Jv(r.packageJson,r.nodeModules),a&&(u=s,w.info(`Auto set min-update-version to ${u}`)));h&&!u&&!o&>("You need to provide a min-update-version to upload a bundle to this channel"),u&&(Wa.test(u)||gt(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`));let m=d?new Map(d.filter(b=>!!b.native&&b.native!==void 0).map(b=>[b.name,b])):new Map;return{nativePackages:m.size>0||!r.ignoreMetadataCheck?Array.from(m,([b,S])=>({name:b,version:S.version})):void 0,minUpdateVersion:u}}async function phe(t,e,r,n=!1){let{data:i,error:s}=await t.rpc("exist_app_versions",{appid:e,name_version:r}).single();if(i||s){if(n)return w.warn(`Version ${r} already exists - exiting gracefully due to --silent-fail option`),ce("Bundle version already exists - exiting gracefully \u{1F389}"),!0;gt(`Version ${r} already exists ${W(s)}`)}return!1}async function mhe(t,e,r,n,i,s,o){let a,u,c="",l=null,h="none",d="",f=e.keyV2,m=e.key===!1;l=await Np(t);let g=Ft();g.start("Calculating checksum");let b=(0,SE.join)(Xr((0,AE.cwd)()),$n),A=(await Ln(void 0,e.packageJson||b)).get("@capgo/capacitor-updater"),p=!1,D;try{D=A?Et(A):void 0}catch{D=void 0}if(A?D?p=Ci(D,Et("6.25.0")):(A==="link:@capgo/capacitor-updater"||A==="file:.."||A==="file:../")&&(w.warn("Using local @capgo/capacitor-updater. Assuming latest version for checksum calculation."),p=!0):gt("Cannot find @capgo/capacitor-updater in ./package.json, provide the package.json path with --package-json it's required for v7 CLI to work"),(f||e.keyDataV2||(0,po.existsSync)(Ir))&&!m||p?c=await Jn(l,"sha256"):c=await Jn(l,"crc32"),g.stop(`Checksum ${p?"SHA256":"CRC32"}: ${c}`),m)w.info("Encryption ignored");else if((f||(0,po.existsSync)(Ir)||e.keyDataV2)&&!e.oldEncryption){let k=typeof f=="string"?f:Ir,v=e.keyDataV2||"";!v&&!(0,po.existsSync)(k)&>(`Cannot find private key ${k}`),await Ae(r,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:n,tags:{"app-id":i},notify:!1},e.verbose),v||(v=(0,po.readFileSync)(k).toString()),w.info("Encrypting your bundle with V2");let{sessionKey:R,ivSessionKey:P}=Hp(v),F=eu(l,R,P);c=tu(c,v),a=P,u=R,h="v2",d=v,e.displayIvSession&&w.info(`Your Iv Session key is ${a},
|
|
331
330
|
keep it safe, you will need it to decrypt your bundle.
|
|
332
331
|
It will be also visible in your dashboard
|
|
333
332
|
`),l=F}let y=Math.floor((l?.byteLength??0)/1024/1024),C=Math.floor(s/1024/1024);return l?.byteLength>s?gt(`The bundle size is ${y} Mb, this is greater than the maximum upload length ${C} Mb, please reduce the size of your bundle`):l?.byteLength>o?(w.warn(`WARNING !!
|
|
334
333
|
The bundle size is ${y} Mb, this may take a while to download for users
|
|
335
334
|
`),w.info(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
|
|
336
|
-
`),e.verbose&&(w.info("[Verbose] Bundle size details:"),w.info(` - Actual size: ${y} MB (${l?.byteLength} bytes)`),w.info(` - Alert threshold: ${Math.floor(o/1024/1024)} MB`),w.info(` - Maximum allowed: ${C} MB`),w.info("[Verbose] Sending 'App Too Large' event to analytics...")),await Ae(r,{channel:"app-error",event:"App Too Large",icon:"\u{1F69B}",user_id:n,tags:{"app-id":i},notify:!1},e.verbose),e.verbose&&w.info("[Verbose] Event sent successfully")):e.verbose&&w.info(`[Verbose] Bundle size OK: ${y} MB (under ${Math.floor(o/1024/1024)} MB alert threshold)`),e.verbose&&w.info("[Verbose] Bundle preparation complete, returning bundle data"),{zipped:l,ivSessionKey:a,sessionKey:u,checksum:c,encryptionMethod:h,finalKeyData:d}}async function
|
|
337
|
-
Bundle uploaded \u{1F4AA} in 0 seconds`),o.verbose&&w.info("[Verbose] Dry upload mode - skipping actual upload");return}try{let f=await wn();if(o.verbose&&w.info("[Verbose] Local config retrieved for upload"),o.multipart!==void 0&&o.multipart||o.tus!==void 0&&o.tus){o.multipart?w.info("Uploading bundle with multipart is deprecated, we upload with TUS instead"):w.info("Uploading bundle with TUS protocol"),o.verbose&&(w.info("[Verbose] Starting TUS resumable upload..."),w.info(` - Host: ${f.hostWeb}`),w.info(` - Chunk size: ${Math.floor(a/1024/1024)} MB`)),await X8(t,s,i,r,n,u,f,a),l=!0,o.verbose&&w.info("[Verbose] TUS upload completed, updating database with R2 path...");let m=`orgs/${i}/apps/${r}/${n}.zip`,{error:g}=await e.from("app_versions").update({r2_path:m}).eq("name",n).eq("app_id",r);if(g)return w.error(`Cannot finish TUS upload ${W(g)}`),o.verbose&&w.info(`[Verbose] Database update failed: ${W(g)}`),Promise.reject(new Error("Cannot finish TUS upload"));o.verbose&&w.info(`[Verbose] Database updated with R2 path: ${m}`)}else{o.verbose&&w.info("[Verbose] Using standard upload (non-TUS), getting presigned URL...");let m=await G8(e,r,n);if(!m)return w.error("Cannot get upload url"),o.verbose&&w.info("[Verbose] Failed to retrieve presigned upload URL from database"),Promise.reject(new Error("Cannot get upload url"));o.verbose&&(w.info("[Verbose] Presigned URL obtained, uploading via HTTP PUT..."),w.info(` - Timeout: ${o.timeout||Xv}ms`),w.info(" - Retry attempts: 5"),w.info(" - Content-Type: application/zip"));let g=new AbortController,b=setTimeout(()=>g.abort(),o.timeout||Xv);try{let S=await fetch(m,{method:"PUT",body:s,headers:{"Content-Type":"application/zip"},signal:g.signal});if(!S.ok)throw new Error(`HTTP error! status: ${S.status}`)}finally{clearTimeout(b)}o.verbose&&w.info("[Verbose] HTTP PUT upload completed successfully")}}catch(f){let g=((performance.now()-c)/1e3).toFixed(2);if(u.stop(`Failed to upload bundle ( after ${g} seconds)`),o.verbose&&(w.info(`[Verbose] Upload failed after ${g} seconds`),w.info(`[Verbose] Error type: ${f instanceof Error?"Error":typeof f}`)),f instanceof Error&&f.message.includes("HTTP error"))try{let b=f.message.match(/status: (\d+)/),S=b?b[1]:"unknown";w.error(`Upload failed with status ${S}: ${f.message}`)}catch{w.error(`Upload failed: ${f.message}`)}else o.verbose&&w.info(`[Verbose] Non-HTTP error: ${W(f)}`),o.tus?w.error(`Cannot upload bundle please contact support if the issue persists ${W(f)}`):w.error(`Cannot upload bundle ( try again with --tus option) ${W(f)}`);throw o.verbose&&w.info("[Verbose] Cleaning up failed version from database..."),await Y8(e,r,n),o.verbose&&w.info("[Verbose] Failed version cleaned up"),f instanceof Error?f:new Error(String(f))}let d=((performance.now()-c)/1e3).toFixed(2);u.stop(`Bundle uploaded \u{1F4AA} in (${d} seconds)`),o.verbose&&(w.info("[Verbose] Upload successful:"),w.info(` - Upload time: ${d} seconds`),w.info(` - Upload method: ${l?"TUS (resumable)":"Standard HTTP PUT"}`),w.info(` - Bundle size: ${Math.floor(s.byteLength/1024)} KB`),w.info("[Verbose] Sending performance event...")),await Ae(t,{channel:"performance",event:l?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:d},notify:!1},o.verbose),o.verbose&&w.info("[Verbose] Performance event sent successfully")}async function Dhe(t,e,r){let{data:n,error:i}=await t.from("channels").select("version ( id, name, deleted )").eq("app_id",e).eq("name",r);if(i){w.error(`Cannot delete linked bundle on upload ${W(i)}`);return}if(n.length===0){w.warn("No linked bundle found in the channel you are trying to upload to");return}let s=n[0].version;if(s.deleted){w.warn("The linked bundle is already deleted");return}let{error:o}=await t.from("app_versions").update({deleted:!0}).eq("id",s.id);if(o){w.error(`Cannot delete linked bundle on upload ${W(o)}`);return}w.info("Linked bundle deleted")}async function whe(t,e,r,n,i,s,o,a,u,c){let{data:l}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();l||gt("Cannot get version id, cannot set channel");let{data:h}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:["write","all"]}).single();if(h){let{error:d,data:f}=await $p(t,{name:i,app_id:a,created_by:s,version:l,owner_org:o,...c?{allow_device_self_set:!0}:{}});d&>(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${W(d)}`);let m=`${u.hostWeb}/app/p/${a}/channel/${f.id}`;f?.public?w.info("Your update is now available in your public channel \u{1F389}"):f?.id&&w.info(`Link device to this bundle to try it: ${m}`),r&&w.info(`Bundle url: ${m}`)}else w.warn("The upload key is not allowed to set the version in the channel")}async function bhe(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").eq("app_id",t).single();return n?(w.warn("Cannot find default upload channel"),w.info(`You can set it here: ${r}/app/p/${t}/settings`),null):i.default_upload_channel}async function iq(t,e,r=!1){r||oe(`Uploading with CLI version ${Ri.version}`);let n,i=Nn();await ze();let{s3Region:s,s3Apikey:o,s3Apisecret:a,s3BucketName:u,s3Endpoint:c,s3Port:l,s3SSL:h}=e;e.verbose&&(w.info("[Verbose] Starting upload process with options:"),w.info(` - API key: ${e.apikey?"provided":"from saved key"}`),w.info(` - Path: ${e.path||"from capacitor config"}`),w.info(` - Channel: ${e.channel||"from default upload channel"}`),w.info(` - Bundle: ${e.bundle||"auto-detected"}`),w.info(` - External: ${e.external||"false"}`),w.info(` - Encryption: ${e.keyV2||e.keyDataV2?"v2":e.key===!1?"disabled":"auto"}`),w.info(` - Upload method: ${e.tus?"TUS":e.zip?"ZIP":"auto"}`),w.info(` - Delta updates: ${e.delta||e.partial?"enabled":"disabled"}`));let d=lhe(e);e.verbose&&w.info("[Verbose] API key retrieved successfully");let f=await de();e.verbose&&w.info("[Verbose] Capacitor config loaded successfully");let m=await B8();e.verbose&&(w.info("[Verbose] Remote file config retrieved:"),w.info(` - Max upload length: ${Math.floor(m.maxUploadLength/1024/1024)} MB`),w.info(` - Alert upload size: ${Math.floor(m.alertUploadSize/1024/1024)} MB`),w.info(` - TUS upload: ${m.TUSUpload?"enabled":"disabled"}`),w.info(` - TUS upload forced: ${m.TUSUploadForced?"yes":"no"}`),w.info(` - Partial upload: ${m.partialUpload?"enabled":"disabled"}`),w.info(` - Max chunk size: ${Math.floor(m.maxChunkSize/1024/1024)} MB`));let{appid:g,path:b}=fhe(t,e,f.config);e.verbose&&w.info(`[Verbose] App ID: ${g}, Build path: ${b}`);let S=await che(f.config,e);e.verbose&&w.info(`[Verbose] Bundle version: ${S}`);let A=e.external?"external":"r2-direct",p="none";e.autoSetBundle&&(await j8({version:S}),e.verbose&&w.info("[Verbose] Auto-set bundle version in capacitor.config.json")),hhe(e,b),e.verbose&&w.info("[Verbose] Code check passed (notifyAppReady found and index.html present)"),w.info(`Upload ${g}@${S} started from path "${b}" to Capgo cloud`);let D=await wn();e.verbose&&w.info(`[Verbose] Local config loaded: host=${D.hostWeb}`),e.supaHost&&e.supaAnon&&(w.info("Using custom supabase instance from provided options"),D.supaHost=e.supaHost,D.supaKey=e.supaAnon,e.verbose&&w.info(`[Verbose] Custom Supabase host: ${e.supaHost}`));let y=await pe(d,e.supaHost,e.supaAnon);e.verbose&&w.info("[Verbose] Supabase client created successfully");let C=await De(y,d,["write","all","upload"]);e.verbose&&w.info(`[Verbose] User verified successfully, user_id: ${C}`);let k=e.channel||await bhe(g,y,D.hostWeb)||"dev";e.verbose&&w.info(`[Verbose] Target channel: ${k}`);let v=await sn(y,g);e.verbose&&w.info(`[Verbose] Organization ID: ${v}`),await H8(y,v,Ri.version),e.verbose&&w.info("[Verbose] Remote CLI messages checked"),await z8(y,v,d,g,!0),e.verbose&&w.info("[Verbose] Plan validation passed"),await phe(y,v,D),e.verbose&&w.info("[Verbose] Trial check completed"),e.verbose&&w.info(`[Verbose] Checking compatibility with channel ${k}...`);let{nativePackages:R,minUpdateVersion:P}=await dhe(y,i,e,k,g,S);e.verbose&&(w.info("[Verbose] Compatibility check completed:"),w.info(` - Native packages: ${R?R.length:0}`),w.info(` - Min update version: ${P||"none"}`)),e.verbose&&w.info(`[Verbose] Checking if version ${S} already exists...`);let F=await mhe(y,g,S,e.versionExistsOk);if(e.verbose&&w.info(`[Verbose] Version exists check: ${F?"yes (skipping)":"no (continuing)"}`),F)return{success:!0,skipped:!0,reason:"VERSION_EXISTS",bundle:S,checksum:null,encryptionMethod:p,storageProvider:A};e.external&&!e.external.startsWith("https://")&>(`External link should should start with "https://" current is "${e.external}"`),e.deleteLinkedBundleOnUpload&&(w.warn("Deleting linked bundle on upload is destructive, it will delete the currently linked bundle in the channel you are trying to upload to."),w.warn("Please make sure you want to do this, if you are not sure, please do not use this option."));let j={name:S,app_id:g,session_key:void 0,external_url:e.external,storage_provider:A,min_update_version:P,native_packages:R,owner_org:v,user_id:C,checksum:void 0,link:e.link||null,comment:e.comment||null},U=null,G="";if(e.external)e.verbose&&w.info(`[Verbose] Using external URL: ${e.external}`),await Ae(d,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:v,tags:{"app-id":g},notify:!1},e.verbose),j.session_key=e.ivSessionKey,j.checksum=e.encryptedChecksum,e.verbose&&(w.info("[Verbose] External bundle configured:"),w.info(` - URL: ${e.external}`),w.info(` - IV Session Key: ${e.ivSessionKey?"provided":"none"}`),w.info(` - Encrypted Checksum: ${e.encryptedChecksum?"provided":"none"}`));else{e.verbose&&w.info(`[Verbose] Preparing bundle file from path: ${b}`);let{zipped:$,ivSessionKey:M,checksum:B,sessionKey:K,encryptionMethod:q,finalKeyData:V}=await ghe(b,e,d,v,g,m.maxUploadLength,m.alertUploadSize);j.session_key=M,j.checksum=B,n=K,U=$,p=q,G=V,e.verbose&&(w.info("[Verbose] Bundle prepared:"),w.info(` - Size: ${Math.floor(($?.byteLength??0)/1024)} KB`),w.info(` - Checksum: ${B}`),w.info(` - Encryption: ${q}`),w.info(` - IV Session Key: ${M?"present":"none"}`)),e.ignoreChecksumCheck||(e.verbose&&w.info("[Verbose] Checking for duplicate checksum..."),await Q8(y,g,k,B),e.verbose&&w.info("[Verbose] Checksum is unique"))}if(e.zip?(e.tus=!1,e.verbose&&w.info("[Verbose] Upload method: ZIP (explicitly set via --zip)")):!m.TUSUpload||e.external?(e.tus=!1,e.verbose&&w.info("[Verbose] Upload method: Standard (TUS not available or external URL)")):(e.tus=e.tus||m.TUSUploadForced,e.verbose&&w.info(`[Verbose] Upload method: ${e.tus?"TUS (resumable)":"Standard"}`)),!m.partialUpload||e.external?(e.delta=!1,e.verbose&&e.external&&w.info("[Verbose] Delta updates disabled (not available with external URLs)")):(e.delta=e.delta||e.partial||e.deltaOnly||e.partialOnly||m.partialUploadForced,e.verbose&&w.info(`[Verbose] Delta updates: ${e.delta?"enabled":"disabled"}`)),e.encryptPartial&&p==="v1"&>("You cannot encrypt the partial update if you are not using the v2 encryption method"),e.delta&&p==="v2"&&!e.encryptPartial){let $=(0,SE.join)(Xr((0,AE.cwd)()),$n),B=(await Ln(void 0,e.packageJson||$)).get("@capgo/capacitor-updater"),K;try{K=B?Et(B):void 0}catch{K=void 0}B&&K&&Ci(K,Et("6.14.4"))&&(w.info(`Auto-enabling partial update encryption for updater version ${K} (> 6.14.4)`),e.verbose&&w.info("[Verbose] Partial encryption auto-enabled for updater >= 6.14.4"),e.encryptPartial=!0)}e.verbose&&e.delta&&w.info("[Verbose] Preparing delta/partial update manifest...");let L=e.delta?await tq(b,d,v,g,e.encryptPartial?p:"none",G):[];e.verbose&&e.delta&&w.info(`[Verbose] Delta manifest prepared with ${L.length} files`),e.verbose&&w.info("[Verbose] Creating version record in database...");let{error:_}=await Yv(y,j);if(_&>(`Cannot add bundle ${W(_)}`),e.verbose&&w.info("[Verbose] Version record created successfully"),e.tusChunkSize&&e.tusChunkSize>m.maxChunkSize?(w.error(`Chunk size ${e.tusChunkSize} is greater than the maximum chunk size ${m.maxChunkSize}, using the maximum chunk size`),e.tusChunkSize=m.maxChunkSize):e.tusChunkSize||(e.tusChunkSize=m.maxChunkSize),e.verbose&&w.info(`[Verbose] TUS chunk size: ${Math.floor(e.tusChunkSize/1024/1024)} MB`),U&&(u||c||s||o||a||l||h)){(!u||!c||!s||!o||!a||!l)&>("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),w.info("Uploading to S3"),e.verbose&&(w.info("[Verbose] S3 configuration:"),w.info(` - Endpoint: ${c}`),w.info(` - Region: ${s}`),w.info(` - Bucket: ${u}`),w.info(` - Port: ${l}`),w.info(` - SSL: ${h?"enabled":"disabled"}`));let $=h?`https://${c}`:`http://${c}`,M=new al({endPoint:c,region:s,port:l,pathStyle:!0,bucket:u,accessKey:o,secretKey:a}),B=`${g}-${S}`,K=encodeURIComponent(B);e.verbose&&w.info(`[Verbose] Uploading to S3 as: ${B}`),await M.putObject(B,Uint8Array.from(U)),j.external_url=`${$}/${K}`,j.storage_provider="external",e.verbose&&w.info(`[Verbose] S3 upload complete, external URL: ${j.external_url}`)}else if(U){!e.partialOnly&&!e.deltaOnly?(e.verbose&&w.info("[Verbose] Starting full bundle upload to Capgo Cloud..."),await yhe(d,y,g,S,v,U,e,e.tusChunkSize)):e.verbose&&w.info("[Verbose] Skipping full bundle upload (delta-only mode)");let $=null;try{e.dryUpload&&(e.delta=!1,e.verbose&&w.info("[Verbose] Dry upload mode: skipping delta upload"));let B=j.session_key&&e.encryptPartial&&n?{sessionKey:n,ivSessionKey:j.session_key}:void 0;e.verbose&&e.delta&&(w.info("[Verbose] Starting delta/partial file upload..."),w.info(` - Manifest entries: ${L.length}`),w.info(` - Encryption: ${B?"enabled":"disabled"}`)),$=e.delta?await rq(d,L,b,g,v,B,e):null,e.verbose&&$&&w.info(`[Verbose] Delta upload complete with ${$.length} files`)}catch(B){if(!!(e.partial||e.delta||e.partialOnly||e.deltaOnly))throw B;w.info(`Failed to upload partial files to capgo cloud. Error: ${W(B)}. This is not a critical error, the bundle has been uploaded without the partial files`),e.verbose&&w.info(`[Verbose] Delta upload error details: ${W(B)}`)}j.storage_provider="r2",j.manifest=$,e.verbose&&w.info("[Verbose] Updating version record with storage provider and manifest...");let{error:M}=await Yv(y,j);M&>(`Cannot update bundle ${W(M)}`),e.verbose&&w.info("[Verbose] Version record updated successfully")}e.verbose&&w.info("[Verbose] Checking app permissions...");let T=await mt(y,d,g,2);e.verbose&&(w.info("[Verbose] Permissions:"),w.info(` - Upload: ${Xa(T,2)?"yes":"no"}`),w.info(` - Write: ${Xa(T,3)?"yes":"no"}`),w.info(` - Admin: ${Xa(T,4)?"yes":"no"}`)),e.deleteLinkedBundleOnUpload&&Xa(T,3)?(e.verbose&&w.info(`[Verbose] Deleting linked bundle in channel ${k}...`),await Dhe(y,g,k)):e.deleteLinkedBundleOnUpload&&w.warn("Cannot delete linked bundle on upload as a upload organization member"),Xa(T,3)?(e.verbose&&w.info(`[Verbose] Setting bundle ${S} to channel ${k}...`),await whe(y,d,!!e.bundleUrl,S,k,C,v,g,D,e.selfAssign),e.verbose&&w.info("[Verbose] Channel updated successfully")):w.warn("Cannot set channel as a upload organization member"),e.verbose&&w.info("[Verbose] Sending upload event..."),await Ae(d,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:v,tags:{"app-id":g},notify:!1},e.verbose);let I={success:!0,bundle:S,checksum:j.checksum??null,encryptionMethod:p,sessionKey:n?n.toString("base64"):void 0,ivSessionKey:typeof j.session_key=="string"?j.session_key:void 0,storageProvider:j.storage_provider};return e.verbose&&(w.info("[Verbose] Upload completed successfully:"),w.info(` - Bundle: ${I.bundle}`),w.info(` - Checksum: ${I.checksum}`),w.info(` - Encryption: ${I.encryptionMethod}`),w.info(` - Storage: ${I.storageProvider}`)),r&&!I.skipped&&ce("Time to share your update to the world \u{1F30D}"),I}var sq=require("node:crypto"),im=require("node:fs"),oq=require("node:path"),aq=require("node:process");var vhe=20;function Ehe(t){console.log(JSON.stringify(t,null,2))}function dl(t){console.error(W(t))}async function uq(t,e,r=!1){let{json:n}=e,{bundle:i,path:s}=e,o=!n&&!r;try{o&&await ze();let a=await de(),u=Pe(t,a?.config),c=(0,sq.randomUUID)().split("-")[0],l=is("",e.packageJson);if(i=i||l||`0.0.1-beta.${c}`,o&&oe(`Zipping ${u}@${i}`),i&&!Wa.test(i)){let k=`Your bundle name ${i}, is not valid it should follow semver convention : https://semver.org/`;throw r||(n?dl({error:"invalid_semver"}):w.error(k)),new Error("Invalid bundle version format")}if(s=s||a?.config?.webDir,!u||!i||!s){let k="Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project";throw r||(n?dl({error:"missing_argument"}):w.error(k)),new Error(k)}if(o&&w.info(`Started from path "${s}"`),typeof e.codeCheck>"u"?!0:e.codeCheck){if(!ul(s,"notifyAppReady"))throw r||(n?dl({error:"notifyAppReady_not_in_source_code"}):w.error("notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready")),new Error("notifyAppReady() is missing in build folder");if(!Xp(s))throw r||(n?dl({error:"index_html_not_found"}):w.error(`index.html is missing in the root folder of ${s}`)),new Error("index.html is missing in root folder")}let d=await Np(s);o&&w.info(`Zipped ${d.byteLength} bytes`);let f=o?Ft():null;f&&f.start("Calculating checksum");let m=(0,oq.join)(Xr((0,aq.cwd)()),$n),b=(await Ln(void 0,e.packageJson||m)).get("@capgo/capacitor-updater");if(!b){let k="Cannot find @capgo/capacitor-updater in ./package.json, provide the package.json path with --package-json it's required for v7 CLI to work";throw r||w.warn(k),new Error(k)}let S=!1,A;try{A=b?Et(b):void 0}catch{A=void 0}if(A){let k=A.major===6&&Ci(A,Et("6.25.0")),v=A.major>=7;S=k||v}else b==="link:@capgo/capacitor-updater"&&(r||w.warn("Using local @capgo/capacitor-updater. Assuming v7"),S=!0);let p=await Jn(d,e.keyV2||(0,im.existsSync)(Ir)||S?"sha256":"crc32");f&&f.stop(`Checksum ${S?"SHA256":"CRC32"}: ${p}`);let D=Math.floor(d.byteLength/1024/1024);D>vhe&&o&&(w.warn(`WARNING !!
|
|
335
|
+
`),e.verbose&&(w.info("[Verbose] Bundle size details:"),w.info(` - Actual size: ${y} MB (${l?.byteLength} bytes)`),w.info(` - Alert threshold: ${Math.floor(o/1024/1024)} MB`),w.info(` - Maximum allowed: ${C} MB`),w.info("[Verbose] Sending 'App Too Large' event to analytics...")),await Ae(r,{channel:"app-error",event:"App Too Large",icon:"\u{1F69B}",user_id:n,tags:{"app-id":i},notify:!1},e.verbose),e.verbose&&w.info("[Verbose] Event sent successfully")):e.verbose&&w.info(`[Verbose] Bundle size OK: ${y} MB (under ${Math.floor(o/1024/1024)} MB alert threshold)`),e.verbose&&w.info("[Verbose] Bundle preparation complete, returning bundle data"),{zipped:l,ivSessionKey:a,sessionKey:u,checksum:c,encryptionMethod:h,finalKeyData:d}}async function ghe(t,e,r,n,i,s,o,a){let u=Ft();u.start("Uploading Bundle");let c=performance.now(),l=!1;if(o.verbose&&(w.info("[Verbose] uploadBundleToCapgoCloud called:"),w.info(` - Bundle size: ${Math.floor(s.byteLength/1024)} KB`),w.info(` - App ID: ${r}`),w.info(` - Bundle version: ${n}`),w.info(` - Chunk size: ${Math.floor(a/1024/1024)} MB`)),o.dryUpload){u.stop(`Dry run, bundle not uploaded
|
|
336
|
+
Bundle uploaded \u{1F4AA} in 0 seconds`),o.verbose&&w.info("[Verbose] Dry upload mode - skipping actual upload");return}try{let f=await wn();if(o.verbose&&w.info("[Verbose] Local config retrieved for upload"),o.multipart!==void 0&&o.multipart||o.tus!==void 0&&o.tus){o.multipart?w.info("Uploading bundle with multipart is deprecated, we upload with TUS instead"):w.info("Uploading bundle with TUS protocol"),o.verbose&&(w.info("[Verbose] Starting TUS resumable upload..."),w.info(` - Host: ${f.hostWeb}`),w.info(` - Chunk size: ${Math.floor(a/1024/1024)} MB`)),await X8(t,s,i,r,n,u,f,a),l=!0,o.verbose&&w.info("[Verbose] TUS upload completed, updating database with R2 path...");let m=`orgs/${i}/apps/${r}/${n}.zip`,{error:g}=await e.from("app_versions").update({r2_path:m}).eq("name",n).eq("app_id",r);if(g)return w.error(`Cannot finish TUS upload ${W(g)}`),o.verbose&&w.info(`[Verbose] Database update failed: ${W(g)}`),Promise.reject(new Error("Cannot finish TUS upload"));o.verbose&&w.info(`[Verbose] Database updated with R2 path: ${m}`)}else{o.verbose&&w.info("[Verbose] Using standard upload (non-TUS), getting presigned URL...");let m=await G8(e,r,n);if(!m)return w.error("Cannot get upload url"),o.verbose&&w.info("[Verbose] Failed to retrieve presigned upload URL from database"),Promise.reject(new Error("Cannot get upload url"));o.verbose&&(w.info("[Verbose] Presigned URL obtained, uploading via HTTP PUT..."),w.info(` - Timeout: ${o.timeout||Xv}ms`),w.info(" - Retry attempts: 5"),w.info(" - Content-Type: application/zip"));let g=new AbortController,b=setTimeout(()=>g.abort(),o.timeout||Xv);try{let S=await fetch(m,{method:"PUT",body:s,headers:{"Content-Type":"application/zip"},signal:g.signal});if(!S.ok)throw new Error(`HTTP error! status: ${S.status}`)}finally{clearTimeout(b)}o.verbose&&w.info("[Verbose] HTTP PUT upload completed successfully")}}catch(f){let g=((performance.now()-c)/1e3).toFixed(2);if(u.stop(`Failed to upload bundle ( after ${g} seconds)`),o.verbose&&(w.info(`[Verbose] Upload failed after ${g} seconds`),w.info(`[Verbose] Error type: ${f instanceof Error?"Error":typeof f}`)),f instanceof Error&&f.message.includes("HTTP error"))try{let b=f.message.match(/status: (\d+)/),S=b?b[1]:"unknown";w.error(`Upload failed with status ${S}: ${f.message}`)}catch{w.error(`Upload failed: ${f.message}`)}else o.verbose&&w.info(`[Verbose] Non-HTTP error: ${W(f)}`),o.tus?w.error(`Cannot upload bundle please contact support if the issue persists ${W(f)}`):w.error(`Cannot upload bundle ( try again with --tus option) ${W(f)}`);throw o.verbose&&w.info("[Verbose] Cleaning up failed version from database..."),await Y8(e,r,n),o.verbose&&w.info("[Verbose] Failed version cleaned up"),f instanceof Error?f:new Error(String(f))}let d=((performance.now()-c)/1e3).toFixed(2);u.stop(`Bundle uploaded \u{1F4AA} in (${d} seconds)`),o.verbose&&(w.info("[Verbose] Upload successful:"),w.info(` - Upload time: ${d} seconds`),w.info(` - Upload method: ${l?"TUS (resumable)":"Standard HTTP PUT"}`),w.info(` - Bundle size: ${Math.floor(s.byteLength/1024)} KB`),w.info("[Verbose] Sending performance event...")),await Ae(t,{channel:"performance",event:l?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:d},notify:!1},o.verbose),o.verbose&&w.info("[Verbose] Performance event sent successfully")}async function yhe(t,e,r){let{data:n,error:i}=await t.from("channels").select("version ( id, name, deleted )").eq("app_id",e).eq("name",r);if(i){w.error(`Cannot delete linked bundle on upload ${W(i)}`);return}if(n.length===0){w.warn("No linked bundle found in the channel you are trying to upload to");return}let s=n[0].version;if(s.deleted){w.warn("The linked bundle is already deleted");return}let{error:o}=await t.from("app_versions").update({deleted:!0}).eq("id",s.id);if(o){w.error(`Cannot delete linked bundle on upload ${W(o)}`);return}w.info("Linked bundle deleted")}async function Dhe(t,e,r,n,i,s,o,a,u,c){let{data:l}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();l||gt("Cannot get version id, cannot set channel");let{data:h}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:["write","all"]}).single();if(h){let{error:d,data:f}=await $p(t,{name:i,app_id:a,created_by:s,version:l,owner_org:o,...c?{allow_device_self_set:!0}:{}});d&>(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${W(d)}`);let m=`${u.hostWeb}/app/p/${a}/channel/${f.id}`;f?.public?w.info("Your update is now available in your public channel \u{1F389}"):f?.id&&w.info(`Link device to this bundle to try it: ${m}`),r&&w.info(`Bundle url: ${m}`)}else w.warn("The upload key is not allowed to set the version in the channel")}async function whe(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").eq("app_id",t).single();return n?(w.warn("Cannot find default upload channel"),w.info(`You can set it here: ${r}/app/p/${t}/settings`),null):i.default_upload_channel}async function iq(t,e,r=!1){r||oe(`Uploading with CLI version ${Ri.version}`);let n,i=Nn();await ze();let{s3Region:s,s3Apikey:o,s3Apisecret:a,s3BucketName:u,s3Endpoint:c,s3Port:l,s3SSL:h}=e;e.verbose&&(w.info("[Verbose] Starting upload process with options:"),w.info(` - API key: ${e.apikey?"provided":"from saved key"}`),w.info(` - Path: ${e.path||"from capacitor config"}`),w.info(` - Channel: ${e.channel||"from default upload channel"}`),w.info(` - Bundle: ${e.bundle||"auto-detected"}`),w.info(` - External: ${e.external||"false"}`),w.info(` - Encryption: ${e.keyV2||e.keyDataV2?"v2":e.key===!1?"disabled":"auto"}`),w.info(` - Upload method: ${e.tus?"TUS":e.zip?"ZIP":"auto"}`),w.info(` - Delta updates: ${e.delta||e.partial?"enabled":"disabled"}`));let d=lhe(e);e.verbose&&w.info("[Verbose] API key retrieved successfully");let f=await de();e.verbose&&w.info("[Verbose] Capacitor config loaded successfully");let m=await B8();e.verbose&&(w.info("[Verbose] Remote file config retrieved:"),w.info(` - Max upload length: ${Math.floor(m.maxUploadLength/1024/1024)} MB`),w.info(` - Alert upload size: ${Math.floor(m.alertUploadSize/1024/1024)} MB`),w.info(` - TUS upload: ${m.TUSUpload?"enabled":"disabled"}`),w.info(` - TUS upload forced: ${m.TUSUploadForced?"yes":"no"}`),w.info(` - Partial upload: ${m.partialUpload?"enabled":"disabled"}`),w.info(` - Max chunk size: ${Math.floor(m.maxChunkSize/1024/1024)} MB`));let{appid:g,path:b}=fhe(t,e,f.config);e.verbose&&w.info(`[Verbose] App ID: ${g}, Build path: ${b}`);let S=await che(f.config,e);e.verbose&&w.info(`[Verbose] Bundle version: ${S}`);let A=e.external?"external":"r2-direct",p="none";e.autoSetBundle&&(await j8({version:S}),e.verbose&&w.info("[Verbose] Auto-set bundle version in capacitor.config.json")),hhe(e,b),e.verbose&&w.info("[Verbose] Code check passed (notifyAppReady found and index.html present)"),w.info(`Upload ${g}@${S} started from path "${b}" to Capgo cloud`);let D=await wn();e.verbose&&w.info(`[Verbose] Local config loaded: host=${D.hostWeb}`),e.supaHost&&e.supaAnon&&(w.info("Using custom supabase instance from provided options"),D.supaHost=e.supaHost,D.supaKey=e.supaAnon,e.verbose&&w.info(`[Verbose] Custom Supabase host: ${e.supaHost}`));let y=await pe(d,e.supaHost,e.supaAnon);e.verbose&&w.info("[Verbose] Supabase client created successfully");let C=await De(y,d,["write","all","upload"]);e.verbose&&w.info(`[Verbose] User verified successfully, user_id: ${C}`);let k=e.channel||await whe(g,y,D.hostWeb)||"dev";e.verbose&&w.info(`[Verbose] Target channel: ${k}`);let v=await sn(y,g);e.verbose&&w.info(`[Verbose] Organization ID: ${v}`),await H8(y,v,Ri.version),e.verbose&&w.info("[Verbose] Remote CLI messages checked"),await z8(y,v,d,g,!0),e.verbose&&w.info("[Verbose] Plan validation passed"),e.verbose&&w.info("[Verbose] Trial check completed"),e.verbose&&w.info(`[Verbose] Checking compatibility with channel ${k}...`);let{nativePackages:R,minUpdateVersion:P}=await dhe(y,i,e,k,g,S);e.verbose&&(w.info("[Verbose] Compatibility check completed:"),w.info(` - Native packages: ${R?R.length:0}`),w.info(` - Min update version: ${P||"none"}`)),e.verbose&&w.info(`[Verbose] Checking if version ${S} already exists...`);let F=await phe(y,g,S,e.versionExistsOk);if(e.verbose&&w.info(`[Verbose] Version exists check: ${F?"yes (skipping)":"no (continuing)"}`),F)return{success:!0,skipped:!0,reason:"VERSION_EXISTS",bundle:S,checksum:null,encryptionMethod:p,storageProvider:A};e.external&&!e.external.startsWith("https://")&>(`External link should should start with "https://" current is "${e.external}"`),e.deleteLinkedBundleOnUpload&&(w.warn("Deleting linked bundle on upload is destructive, it will delete the currently linked bundle in the channel you are trying to upload to."),w.warn("Please make sure you want to do this, if you are not sure, please do not use this option."));let j={name:S,app_id:g,session_key:void 0,external_url:e.external,storage_provider:A,min_update_version:P,native_packages:R,owner_org:v,user_id:C,checksum:void 0,link:e.link||null,comment:e.comment||null},U=null,G="";if(e.external)e.verbose&&w.info(`[Verbose] Using external URL: ${e.external}`),await Ae(d,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:v,tags:{"app-id":g},notify:!1},e.verbose),j.session_key=e.ivSessionKey,j.checksum=e.encryptedChecksum,e.verbose&&(w.info("[Verbose] External bundle configured:"),w.info(` - URL: ${e.external}`),w.info(` - IV Session Key: ${e.ivSessionKey?"provided":"none"}`),w.info(` - Encrypted Checksum: ${e.encryptedChecksum?"provided":"none"}`));else{e.verbose&&w.info(`[Verbose] Preparing bundle file from path: ${b}`);let{zipped:$,ivSessionKey:M,checksum:B,sessionKey:K,encryptionMethod:q,finalKeyData:V}=await mhe(b,e,d,v,g,m.maxUploadLength,m.alertUploadSize);j.session_key=M,j.checksum=B,n=K,U=$,p=q,G=V,e.verbose&&(w.info("[Verbose] Bundle prepared:"),w.info(` - Size: ${Math.floor(($?.byteLength??0)/1024)} KB`),w.info(` - Checksum: ${B}`),w.info(` - Encryption: ${q}`),w.info(` - IV Session Key: ${M?"present":"none"}`)),e.ignoreChecksumCheck||(e.verbose&&w.info("[Verbose] Checking for duplicate checksum..."),await Q8(y,g,k,B),e.verbose&&w.info("[Verbose] Checksum is unique"))}if(e.zip?(e.tus=!1,e.verbose&&w.info("[Verbose] Upload method: ZIP (explicitly set via --zip)")):!m.TUSUpload||e.external?(e.tus=!1,e.verbose&&w.info("[Verbose] Upload method: Standard (TUS not available or external URL)")):(e.tus=e.tus||m.TUSUploadForced,e.verbose&&w.info(`[Verbose] Upload method: ${e.tus?"TUS (resumable)":"Standard"}`)),!m.partialUpload||e.external?(e.delta=!1,e.verbose&&e.external&&w.info("[Verbose] Delta updates disabled (not available with external URLs)")):(e.delta=e.delta||e.partial||e.deltaOnly||e.partialOnly||m.partialUploadForced,e.verbose&&w.info(`[Verbose] Delta updates: ${e.delta?"enabled":"disabled"}`)),e.encryptPartial&&p==="v1"&>("You cannot encrypt the partial update if you are not using the v2 encryption method"),e.delta&&p==="v2"&&!e.encryptPartial){let $=(0,SE.join)(Xr((0,AE.cwd)()),$n),B=(await Ln(void 0,e.packageJson||$)).get("@capgo/capacitor-updater"),K;try{K=B?Et(B):void 0}catch{K=void 0}B&&K&&Ci(K,Et("6.14.4"))&&(w.info(`Auto-enabling partial update encryption for updater version ${K} (> 6.14.4)`),e.verbose&&w.info("[Verbose] Partial encryption auto-enabled for updater >= 6.14.4"),e.encryptPartial=!0)}e.verbose&&e.delta&&w.info("[Verbose] Preparing delta/partial update manifest...");let L=e.delta?await tq(b,d,v,g,e.encryptPartial?p:"none",G):[];e.verbose&&e.delta&&w.info(`[Verbose] Delta manifest prepared with ${L.length} files`),e.verbose&&w.info("[Verbose] Creating version record in database...");let{error:_}=await Yv(y,j);if(_&>(`Cannot add bundle ${W(_)}`),e.verbose&&w.info("[Verbose] Version record created successfully"),e.tusChunkSize&&e.tusChunkSize>m.maxChunkSize?(w.error(`Chunk size ${e.tusChunkSize} is greater than the maximum chunk size ${m.maxChunkSize}, using the maximum chunk size`),e.tusChunkSize=m.maxChunkSize):e.tusChunkSize||(e.tusChunkSize=m.maxChunkSize),e.verbose&&w.info(`[Verbose] TUS chunk size: ${Math.floor(e.tusChunkSize/1024/1024)} MB`),U&&(u||c||s||o||a||l||h)){(!u||!c||!s||!o||!a||!l)&>("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),w.info("Uploading to S3"),e.verbose&&(w.info("[Verbose] S3 configuration:"),w.info(` - Endpoint: ${c}`),w.info(` - Region: ${s}`),w.info(` - Bucket: ${u}`),w.info(` - Port: ${l}`),w.info(` - SSL: ${h?"enabled":"disabled"}`));let $=h?`https://${c}`:`http://${c}`,M=new al({endPoint:c,region:s,port:l,pathStyle:!0,bucket:u,accessKey:o,secretKey:a}),B=`${g}-${S}`,K=encodeURIComponent(B);e.verbose&&w.info(`[Verbose] Uploading to S3 as: ${B}`),await M.putObject(B,Uint8Array.from(U)),j.external_url=`${$}/${K}`,j.storage_provider="external",e.verbose&&w.info(`[Verbose] S3 upload complete, external URL: ${j.external_url}`)}else if(U){!e.partialOnly&&!e.deltaOnly?(e.verbose&&w.info("[Verbose] Starting full bundle upload to Capgo Cloud..."),await ghe(d,y,g,S,v,U,e,e.tusChunkSize)):e.verbose&&w.info("[Verbose] Skipping full bundle upload (delta-only mode)");let $=null;try{e.dryUpload&&(e.delta=!1,e.verbose&&w.info("[Verbose] Dry upload mode: skipping delta upload"));let B=j.session_key&&e.encryptPartial&&n?{sessionKey:n,ivSessionKey:j.session_key}:void 0;e.verbose&&e.delta&&(w.info("[Verbose] Starting delta/partial file upload..."),w.info(` - Manifest entries: ${L.length}`),w.info(` - Encryption: ${B?"enabled":"disabled"}`)),$=e.delta?await rq(d,L,b,g,v,B,e):null,e.verbose&&$&&w.info(`[Verbose] Delta upload complete with ${$.length} files`)}catch(B){if(!!(e.partial||e.delta||e.partialOnly||e.deltaOnly))throw B;w.info(`Failed to upload partial files to capgo cloud. Error: ${W(B)}. This is not a critical error, the bundle has been uploaded without the partial files`),e.verbose&&w.info(`[Verbose] Delta upload error details: ${W(B)}`)}j.storage_provider="r2",j.manifest=$,e.verbose&&w.info("[Verbose] Updating version record with storage provider and manifest...");let{error:M}=await Yv(y,j);M&>(`Cannot update bundle ${W(M)}`),e.verbose&&w.info("[Verbose] Version record updated successfully")}e.verbose&&w.info("[Verbose] Checking app permissions...");let T=await mt(y,d,g,2);e.verbose&&(w.info("[Verbose] Permissions:"),w.info(` - Upload: ${Xa(T,2)?"yes":"no"}`),w.info(` - Write: ${Xa(T,3)?"yes":"no"}`),w.info(` - Admin: ${Xa(T,4)?"yes":"no"}`)),e.deleteLinkedBundleOnUpload&&Xa(T,3)?(e.verbose&&w.info(`[Verbose] Deleting linked bundle in channel ${k}...`),await yhe(y,g,k)):e.deleteLinkedBundleOnUpload&&w.warn("Cannot delete linked bundle on upload as a upload organization member"),Xa(T,3)?(e.verbose&&w.info(`[Verbose] Setting bundle ${S} to channel ${k}...`),await Dhe(y,d,!!e.bundleUrl,S,k,C,v,g,D,e.selfAssign),e.verbose&&w.info("[Verbose] Channel updated successfully")):w.warn("Cannot set channel as a upload organization member"),e.verbose&&w.info("[Verbose] Sending upload event..."),await Ae(d,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:v,tags:{"app-id":g},notify:!1},e.verbose);let I={success:!0,bundle:S,checksum:j.checksum??null,encryptionMethod:p,sessionKey:n?n.toString("base64"):void 0,ivSessionKey:typeof j.session_key=="string"?j.session_key:void 0,storageProvider:j.storage_provider};return e.verbose&&(w.info("[Verbose] Upload completed successfully:"),w.info(` - Bundle: ${I.bundle}`),w.info(` - Checksum: ${I.checksum}`),w.info(` - Encryption: ${I.encryptionMethod}`),w.info(` - Storage: ${I.storageProvider}`)),r&&!I.skipped&&ce("Time to share your update to the world \u{1F30D}"),I}var sq=require("node:crypto"),im=require("node:fs"),oq=require("node:path"),aq=require("node:process");var bhe=20;function vhe(t){console.log(JSON.stringify(t,null,2))}function dl(t){console.error(W(t))}async function uq(t,e,r=!1){let{json:n}=e,{bundle:i,path:s}=e,o=!n&&!r;try{o&&await ze();let a=await de(),u=Pe(t,a?.config),c=(0,sq.randomUUID)().split("-")[0],l=is("",e.packageJson);if(i=i||l||`0.0.1-beta.${c}`,o&&oe(`Zipping ${u}@${i}`),i&&!Wa.test(i)){let k=`Your bundle name ${i}, is not valid it should follow semver convention : https://semver.org/`;throw r||(n?dl({error:"invalid_semver"}):w.error(k)),new Error("Invalid bundle version format")}if(s=s||a?.config?.webDir,!u||!i||!s){let k="Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project";throw r||(n?dl({error:"missing_argument"}):w.error(k)),new Error(k)}if(o&&w.info(`Started from path "${s}"`),typeof e.codeCheck>"u"?!0:e.codeCheck){if(!ul(s,"notifyAppReady"))throw r||(n?dl({error:"notifyAppReady_not_in_source_code"}):w.error("notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready")),new Error("notifyAppReady() is missing in build folder");if(!Xp(s))throw r||(n?dl({error:"index_html_not_found"}):w.error(`index.html is missing in the root folder of ${s}`)),new Error("index.html is missing in root folder")}let d=await Np(s);o&&w.info(`Zipped ${d.byteLength} bytes`);let f=o?Ft():null;f&&f.start("Calculating checksum");let m=(0,oq.join)(Xr((0,aq.cwd)()),$n),b=(await Ln(void 0,e.packageJson||m)).get("@capgo/capacitor-updater");if(!b){let k="Cannot find @capgo/capacitor-updater in ./package.json, provide the package.json path with --package-json it's required for v7 CLI to work";throw r||w.warn(k),new Error(k)}let S=!1,A;try{A=b?Et(b):void 0}catch{A=void 0}if(A){let k=A.major===6&&Ci(A,Et("6.25.0")),v=A.major>=7;S=k||v}else b==="link:@capgo/capacitor-updater"&&(r||w.warn("Using local @capgo/capacitor-updater. Assuming v7"),S=!0);let p=await Jn(d,e.keyV2||(0,im.existsSync)(Ir)||S?"sha256":"crc32");f&&f.stop(`Checksum ${S?"SHA256":"CRC32"}: ${p}`);let D=Math.floor(d.byteLength/1024/1024);D>bhe&&o&&(w.warn(`WARNING !!
|
|
338
337
|
The bundle size is ${D} Mb, this may take a while to download for users
|
|
339
338
|
`),w.warn(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
|
|
340
|
-
`));let y=o?Ft():null,C=e.name||`${u}_${i}.zip`;return y&&y.start(`Saving to ${C}`),(0,im.writeFileSync)(C,d),y&&y.stop(`Saved to ${C}`),o&&ce("Done \u2705"),!r&&n&&
|
|
339
|
+
`));let y=o?Ft():null,C=e.name||`${u}_${i}.zip`;return y&&y.start(`Saving to ${C}`),(0,im.writeFileSync)(C,d),y&&y.stop(`Saved to ${C}`),o&&ce("Done \u2705"),!r&&n&&vhe({bundle:i,filename:C,checksum:p}),{bundle:i,filename:C,checksum:p}}catch(a){throw r||(n?dl(a):w.error(W(a))),a instanceof Error?a:new Error(String(a))}}async function cq(t,e,r,n=!1){n||oe("Create channel"),r.apikey=r.apikey||ne();let i=await de().catch(()=>{});if(e=Pe(e,i?.config),!r.apikey)throw n||w.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!e)throw n||w.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");let s=await pe(r.apikey,r.supaHost,r.supaAnon);await De(s,r.apikey,["write","all"]),await mt(s,r.apikey,e,4,n),n||w.info(`Creating channel ${e}#${t} to Capgo`);let o=await Qv(s,e);if(!o)throw n||w.error("Cannot find default version for channel creation, please contact Capgo support \u{1F928}"),new Error("Cannot find default version for channel creation");let a=await sn(s,e),u=await De(s,r.apikey,["write","all"]),c=await rM(s,{name:t,app_id:e,version:o.id,created_by:u,owner_org:a,allow_device_self_set:r.selfAssign??!1,public:r.default??!1});if(c.error)throw n||w.error(`Cannot create Channel \u{1F640}
|
|
341
340
|
${W(c.error)}`),new Error(`Cannot create channel: ${W(c.error)}`);return await Ae(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:a,tags:{"app-id":e,channel:t},notify:!1}).catch(()=>{}),n||(w.success("Channel created \u2705"),ce("Done \u2705")),c.data??!0}async function lq(t,e,r,n=!1){let{quiet:i}=r;!i&&!n&&oe("List current bundle"),r.apikey=r.apikey||ne(i);let s=await de();if(e=Pe(e,s?.config),!r.apikey)throw n||w.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!e)throw n||w.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");let o=await pe(r.apikey,r.supaHost,r.supaAnon);if(await De(o,r.apikey,["write","all","read"]),await mt(o,r.apikey,e,1,n),!t)throw n||w.error("Please provide a channel to get the bundle from."),new Error("Channel name missing");let{data:a,error:u}=await o.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);if(u||!a?.length)throw n||w.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exist?`),new Error(`Channel ${t} not found for app ${e}`);let{version:c}=a[0];if(!c)throw n||w.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exist?`),new Error(`Channel ${t} does not have a bundle linked`);return n||(i?w.info(c.name):w.info(`Current bundle for channel ${t} is ${c.name}`)),c.name}async function fq(t,e,r,n=!1){n||oe("Delete channel"),r.apikey=r.apikey||ne();let i=await de();if(e=Pe(e,i?.config),!r.apikey)throw n||w.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!e)throw n||w.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");let s=await pe(r.apikey,r.supaHost,r.supaAnon),o=await De(s,r.apikey,["all"]);if(await mt(s,r.apikey,e,4,n),r.deleteBundle&&!n&&w.info(`Deleting bundle ${e}#${t} from Capgo`),r.deleteBundle){let d=await oM(s,e,t);d?.name&&!n&&w.info(`Deleting bundle ${d.name} from Capgo`),d?.name&&await eE(s,e,d.name)}let{data:a,error:u}=await iM(s,e,t);if(u||!a){if(n||w.error(`Channel ${t} not found`),r.successIfNotFound)return n||w.success(`Channel ${t} not found and successIfNotFound is true`),!0;throw new Error(`Channel ${t} not found`)}let{error:c}=await sM(s,e,a.id);if(c)throw n||w.error(`Cannot delete channel devices: ${W(c)}`),new Error(`Cannot delete channel devices: ${W(c)}`);n||w.info(`Deleting channel ${e}#${t} from Capgo`);let l=await nM(s,t,e,o);if(l.error)throw n||w.error(`Cannot delete Channel \u{1F640} ${W(l.error)}`),new Error(`Cannot delete channel: ${W(l.error)}`);let h=await sn(s,e);return await Ae(r.apikey,{channel:"channel",event:"Delete channel",icon:"\u2705",user_id:h,tags:{"app-id":e,channel:t},notify:!1}).catch(()=>{}),n||(w.success("Channel deleted"),ce("Done \u2705")),!0}async function hq(t,e,r=!1){r||oe("List channels"),e.apikey=e.apikey||ne();let n=await de();if(t=Pe(t,n?.config),!e.apikey)throw r||w.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!t)throw r||w.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");let i=await pe(e.apikey,e.supaHost,e.supaAnon),s=await De(i,e.apikey,["write","all","read","upload"]);await mt(i,e.apikey,t,1,r),r||w.info("Querying available channels in Capgo");let o=await uM(i,t);return r||(w.info(`Active channels in Capgo: ${o?.length??0}`),aM(o)),await Ae(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:s,tags:{"app-id":t},notify:!1}).catch(()=>{}),r||ce("Done \u2705"),o}var dq=["major","minor","metadata","patch","none"];async function pq(t,e,r,n=!1){n||oe("Set channel"),r.apikey=r.apikey||ne();let i=await de();if(e=Pe(e,i?.config),!r.apikey)throw n||w.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!e)throw n||w.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");if(!t)throw n||w.error("Missing argument, you need to provide a channel"),new Error("Missing channel id");let s=await pe(r.apikey,r.supaHost,r.supaAnon),o=await De(s,r.apikey,["write","all"]);await mt(s,r.apikey,e,4,n);let a=await sn(s,e),{bundle:u,state:c,downgrade:l,latest:h,latestRemote:d,ios:f,android:m,selfAssign:g,disableAutoUpdate:b,dev:S,emulator:A}=r;if(h&&u)throw n||w.error("Cannot set latest and bundle at the same time"),new Error("Cannot set both latest and bundle simultaneously");if(d&&u)throw n||w.error("Cannot set latest remote and bundle at the same time"),new Error("Cannot set both latest remote and bundle simultaneously");if(d&&h)throw n||w.error("Cannot set latest remote and latest at the same time"),new Error("Cannot set both latest remote and latest simultaneously");if(u==null&&c==null&&h==null&&d==null&&l==null&&f==null&&m==null&&g==null&&S==null&&A==null&&b==null)throw n||w.error("Missing argument, you need to provide a option to set"),new Error("No channel option provided");await V8(s,a,r.apikey,e);let p={created_by:o,app_id:e,name:t,owner_org:a,version:void 0},{error:D}=await s.from("channels").select().eq("app_id",e).eq("name",t).single();if(D)throw n||w.error(`Cannot find channel ${t}`),new Error(`Cannot find channel ${t}`);let y=h?i?.config?.plugins?.CapacitorUpdater?.version||is("",r.packageJson):u;if(y!=null){let{data:k,error:v}=await s.from("app_versions").select().eq("app_id",e).eq("name",y).eq("user_id",o).eq("deleted",!1).single();if(v||!k)throw n||w.error(`Cannot find version ${y}`),new Error(`Cannot find version ${y}`);if(!r.ignoreMetadataCheck){let{finalCompatibility:R,localDependencies:P}=await Zv(s,e,t,k.native_packages??[]),F=Nn();if(P.length>0&&R.some(j=>!so(j)))throw n||(w.warn(`Bundle NOT compatible with ${t} channel`),w.warn(`You can check compatibility with "${F.runner} @capgo/cli bundle compatibility"`)),new Error(`Bundle is not compatible with ${t} channel`);n||(P.length===0&&R.length>0?w.info(`Ignoring check compatibility with ${t} channel because the bundle does not contain any native packages`):w.info(`Bundle is compatible with ${t} channel`))}n||w.info(`Set ${e} channel: ${t} to @${y}`),p.version=k.id}if(d){let{data:k,error:v}=await s.from("app_versions").select().eq("app_id",e).eq("user_id",o).eq("deleted",!1).order("created_at",{ascending:!1}).single();if(v||!k)throw n||w.error("Cannot find latest remote version"),new Error("Cannot find latest remote version");if(!r.ignoreMetadataCheck){let{finalCompatibility:R}=await Zv(s,e,t,k.native_packages??[]),P=Nn();if(R.some(F=>!so(F)))throw n||(w.warn(`Bundle NOT compatible with ${t} channel`),w.warn(`You can check compatibility with "${P.runner} @capgo/cli bundle compatibility"`)),new Error(`Latest remote bundle is not compatible with ${t} channel`)}n||w.info(`Set ${e} channel: ${t} to @${k.name}`),p.version=k.id}if(c!=null){if(c!=="normal"&&c!=="default")throw n||w.error(`State ${c} is not known. The possible values are: normal, default.`),new Error(`Unknown state ${c}. Expected normal or default`);n||w.info(`Set ${e} channel: ${t} to ${c}`),p.public=c==="default"}if(l!=null&&(n||w.info(`Set ${e} channel: ${t} to ${l?"allow":"disallow"} downgrade`),p.disable_auto_update_under_native=!l),f!=null&&(n||w.info(`Set ${e} channel: ${t} to ${f?"allow":"disallow"} ios update`),p.ios=!!f),m!=null&&(n||w.info(`Set ${e} channel: ${t} to ${m?"allow":"disallow"} android update`),p.android=!!m),g!=null&&(n||w.info(`Set ${e} channel: ${t} to ${g?"allow":"disallow"} self assign to this channel`),p.allow_device_self_set=!!g),S!=null&&(n||w.info(`Set ${e} channel: ${t} to ${S?"allow":"disallow"} dev devices`),p.allow_dev=!!S),A!=null&&(n||w.info(`Set ${e} channel: ${t} to ${A?"allow":"disallow"} emulator devices`),p.allow_emulator=!!A),b!=null){let k=b.toLowerCase();if(!dq.includes(k))throw n||w.error(`Channel strategy ${k} is not known. The possible values are: ${dq.join(", ")}.`),new Error(`Unknown channel strategy ${k}`);k==="metadata"&&(k="version_number"),p.disable_auto_update=k,n||w.info(`Set ${e} channel: ${t} to ${k} disable update strategy to this channel`)}let{error:C}=await $p(s,p);if(C)throw n||w.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),new Error("Upload key is not allowed to set this channel");return await Ae(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:a,tags:{"app-id":e},notify:!1}).catch(()=>{}),n||ce("Done \u2705"),!0}var hr=require("node:fs");function mq(t){return t.plugins??={},t.plugins.extConfig??={},t.plugins.CapacitorUpdater??={},t.plugins.CapacitorUpdater}async function gq(t,e=!1){e||oe("Save keys \u{1F511}");let r=await de(),n=t.key||pi,i=t.keyData||"";if(!(0,hr.existsSync)(n)&&!i)throw e||w.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),new Error("Missing public key");if((0,hr.existsSync)(n)&&(i=(0,hr.readFileSync)(n,"utf8")),!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))throw e||w.error("The public key provided is not a valid RSA Public key"),new Error("Invalid RSA public key");if(r?.config){let s=mq(r.config);s.privateKey&&(delete s.privateKey,e||w.info("Old private key deleted from config file"),(e?t.setupChannel??!1:t.setupChannel??await $r({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"}))&&(s.defaultChannel="encryption_v2")),s.publicKey=i,await Ua(r)}return e||(w.success(`Public key saved into ${r.path} file in local directory`),w.success("Your app will decode the zip archive with this key")),!0}async function yq(t,e=!1){e||oe("Deleting old private key \u{1F5D1}\uFE0F");let r=await de(),n=r?.config?.plugins?.CapacitorUpdater;if(n?.privateKey){if(delete n.privateKey,await Ua(r),(0,hr.existsSync)(Ka))try{(0,hr.unlinkSync)(Ka),e||w.success(`Old private key file deleted: ${Ka}`)}catch(i){e||w.error(`Failed to delete old private key file: ${Ka} (${String(i)})`)}if((0,hr.existsSync)(Pp))try{(0,hr.unlinkSync)(Pp),e||w.success(`Old public key file deleted: ${Pp}`)}catch(i){e||w.error(`Failed to delete old public key file: ${pi} (${String(i)})`)}return e||(w.success(`Old private key deleted from ${r.path} file`),ce("Done \u2705")),!0}return e||w.info("No old private key found in config file"),!1}async function Dq(t,e=!1){e||oe("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=SM();if((0,hr.existsSync)(pi)&&!t.force)throw e||w.error("Public Key already exists, use --force to overwrite"),new Error("Public key already exists");if((0,hr.writeFileSync)(pi,r),(0,hr.existsSync)(Ir)&&!t.force)throw e||w.error("Private Key already exists, use --force to overwrite"),new Error("Private key already exists");(0,hr.writeFileSync)(Ir,n);let i=await de();if(i){let s=mq(i.config);s.privateKey&&(delete s.privateKey,e||w.info("Old private key deleted from config file"),(e?t.setupChannel??!1:t.setupChannel??await $r({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"}))&&(s.defaultChannel="encryption_v2")),s.publicKey=r,await Ua(i)}if(!e){w.success("Your RSA key has been generated"),w.success(`Private key saved in ${Ir}`),w.success("This key will be used to encrypt your bundle before sending it to Capgo"),w.success("Keep it safe"),w.success("Then make it unreadable by Capgo and unmodifiable by anyone"),w.success(`Public key saved in ${i.path}`),w.success("Your app will be the only one having it"),w.success("Only your users can decrypt your update"),w.success("Only you can send them an update");try{await eM(),ce("Done \u2705")}catch(s){if(s instanceof Error&&s.message==="Capacitor sync cancelled")return!0;throw s}}return!0}var mo=require("node:fs"),wq=require("node:os");async function bq(t,e,r=!1){if(r||oe("Login to Capgo"),!t)throw r||w.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");await ze();let{local:n}=e;if(n){if(!(0,mo.existsSync)(".git"))throw r||w.error("To use local you should be in a git repository"),new Error("Not in a git repository");(0,mo.writeFileSync)(".capgo",`${t}
|
|
342
341
|
`),(0,mo.appendFileSync)(".gitignore",`.capgo
|
|
343
342
|
`)}else{let o=(0,wq.homedir)();(0,mo.writeFileSync)(`${o}/.capgo`,`${t}
|
|
344
|
-
`)}let i=await pe(t,e.supaHost,e.supaAnon),s=await De(i,t,["write","all","upload"]);await Ae(t,{channel:"user-login",event:"User CLI login",icon:"\u2705",user_id:s,notify:!1}).catch(),r||(w.success(`login saved into .capgo file in ${n?"local":"home"} directory`),ce("Done \u2705"))}async function vq(t,e=!1){e||oe("Adding organization"),await ze();let r={...t,apikey:t.apikey||ne()};if(!r.apikey)throw e||w.error("Missing API key, you need to provide an API key to add an organization"),new Error("Missing API key");let n=await pe(r.apikey,r.supaHost,r.supaAnon),i=await De(n,r.apikey,["write","all"]),{name:s,email:o}=r;if(!e&&!s){let c=await yo({message:"Organization name:",placeholder:"My Organization"});if(Ot(c))throw w.error("Canceled adding organization"),new Error("Organization creation cancelled");s=c}if(!e&&!o){let c=await yo({message:"Management email:",placeholder:"admin@example.com"});if(Ot(c))throw w.error("Canceled adding organization"),new Error("Organization creation cancelled");o=c}if(!s||!o)throw e||w.error("Missing arguments, you need to provide an organization name and management email"),new Error("Missing organization name or management email");e||w.info(`Adding organization "${s}" to Capgo`);let{data:a,error:u}=await n.from("orgs").insert({name:s,management_email:o,created_by:i}).select().single();if(u)throw e||w.error(`Could not add organization ${W(u)}`),new Error(`Could not add organization: ${W(u)}`);return await Ae(r.apikey,{channel:"organization",event:"Organization Created",icon:"\u{1F3E2}",user_id:a.id,tags:{"org-name":s},notify:!1}).catch(()=>{}),e||(w.success(`Organization "${s}" added to Capgo`),ce("Done \u2705")),a}async function Eq(t,e,r=!1){r||oe("Deleting organization"),await ze();let n={...e,apikey:e.apikey||ne()};if(!n.apikey)throw r||w.error("Missing API key, you need to provide an API key to delete an organization"),new Error("Missing API key");if(!t)throw r||w.error("Missing argument, you need to provide an organization ID"),new Error("Missing organization id");let i=await pe(n.apikey,n.supaHost,n.supaAnon),s=await De(i,n.apikey,["write","all"]),{data:o,error:a}=await i.from("orgs").select("created_by, name").eq("id",t).single();if(a||!o)throw r||w.error(`Cannot get organization details ${W(a)}`),new Error(`Cannot get organization details: ${W(a)}`);if(o.created_by!==s){if(r)throw new Error("Deleting an organization is restricted to the organization owner");w.warn("Deleting an organization is restricted to the organization owner"),w.warn("You are not the owner of this organization"),w.warn("It's strongly recommended that you do not continue!");let c=await Do({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});if(Ot(c)||c==="no")throw w.error("Canceled deleting the organization"),new Error("Organization deletion cancelled")}if(!r&&!n.autoConfirm){let c=await $r({message:`Are you sure you want to delete organization "${o.name}"? This action cannot be undone.`});if(Ot(c)||!c)throw w.error("Canceled deleting the organization"),new Error("Organization deletion cancelled")}r||w.info(`Deleting organization "${o.name}"`);let{error:u}=await i.from("orgs").delete().eq("id",t);if(u)throw r||w.error(`Could not delete organization ${W(u)}`),new Error(`Could not delete organization: ${W(u)}`);return await Ae(n.apikey,{channel:"organization",event:"Organization Deleted",icon:"\u{1F5D1}\uFE0F",user_id:t,tags:{"org-name":o.name},notify:!1}).catch(()=>{}),r||(w.success(`Organization "${o.name}" deleted from Capgo`),ce("Done \u2705")),!0}function _he(t,e){if(e)return;if(!t.length){w.error("No organizations found");return}let r=new Ht;r.headers=["Name","ID","Role","Apps"],r.rows=[];for(let n of t.toReversed())r.rows.push([n.name??"Unknown",n.gid,n.role,n.app_count?.toString()||"0"]);w.success("Organizations"),w.success(r.toString())}async function _q(t,e=!1){e||oe("List organizations"),await ze();let r={...t,apikey:t.apikey||ne()};if(!r.apikey)throw e||w.error("Missing API key, you need to provide an API key to list organizations"),new Error("Missing API key");let n=await pe(r.apikey,r.supaHost,r.supaAnon);await De(n,r.apikey,["read","write","all"]),e||w.info("Getting organizations from Capgo");let{error:i,data:s}=await n.rpc("get_orgs_v6");if(i)throw e||w.error(`Cannot get organizations ${W(i)}`),new Error(`Cannot get organizations: ${W(i)}`);let o=s||[];return e||(w.info(`Organizations found: ${o.length}`),_he(o,e),ce("Done \u2705")),o}async function Cq(t,e,r=!1){r||oe("Updating organization"),await ze();let n={...e,apikey:e.apikey||ne()};if(!n.apikey)throw r||w.error("Missing API key, you need to provide an API key to update an organization"),new Error("Missing API key");if(!t)throw r||w.error("Missing argument, you need to provide an organization ID"),new Error("Missing organization id");let i=await pe(n.apikey,n.supaHost,n.supaAnon);await De(i,n.apikey,["write","all"]);let{data:s,error:o}=await i.from("orgs").select("name, management_email, created_by").eq("id",t).single();if(o||!s)throw r||w.error(`Cannot get organization details ${W(o)}`),new Error(`Cannot get organization details: ${W(o)}`);let{name:a,email:u}=n;if(!r&&!a){let l=await yo({message:"New organization name:",placeholder:s.name||"My Organization"});if(Ot(l))throw w.error("Canceled updating organization"),new Error("Organization update cancelled");a=l}if(!r&&!u){let l=await yo({message:"Management email:",placeholder:s.management_email||"admin@example.com"});if(Ot(l))throw w.error("Canceled updating organization"),new Error("Organization update cancelled");u=l}if(!a||!u)throw r||w.error("Missing arguments, you need to provide an organization name and management email"),new Error("Missing organization name or management email");r||w.info(`Updating organization "${t}"`);let{error:c}=await i.from("orgs").update({name:a,management_email:u}).eq("id",t);if(c)throw r||w.error(`Could not update organization ${W(c)}`),new Error(`Could not update organization: ${W(c)}`);return await Ae(n.apikey,{channel:"organization",event:"Organization Updated",icon:"\u270F\uFE0F",user_id:t,tags:{"org-name":a},notify:!1}).catch(()=>{}),r||(w.success("Organization updated"),ce("Done \u2705")),{orgId:t,name:a,email:u}}async function Sq(t,e=!1){e||oe("Getting user id");let r={...t,apikey:t.apikey||ne()};if(!r.apikey)throw e||w.error("Missing API key, you need to provide an API key to fetch the user id"),new Error("Missing API key");try{let n=await pe(r.apikey,r.supaHost,r.supaAnon),i=await De(n,r.apikey,["read","all","write"]);return e||ce(`Done \u2705: ${i}`),i}catch(n){throw e||w.error(`Error getting user id ${W(n)}`),n instanceof Error?n:new Error(String(n))}}var nt=class{apikey;supaHost;supaAnon;constructor(e){this.apikey=e?.apikey,this.supaHost=e?.supaHost,this.supaAnon=e?.supaAnon}async login(e){try{return await bq(e.apikey,{local:e.local??!1,supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon},!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async doctor(e){try{return{success:!0,data:await gM({packageJson:e?.packageJson},!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async addApp(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,name:e.name,icon:e.icon};return await hM(e.appId,r,void 0,!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async updateApp(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,name:e.name,icon:e.icon,retention:e.retention};return await wM(e.appId,r,!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async deleteApp(e,r=!1){try{let n={apikey:this.apikey||ne(!0),supaHost:this.supaHost,supaAnon:this.supaAnon};return await dM(e,n,!1,r),{success:!0}}catch(n){return{success:!1,error:n instanceof Error?n.message:String(n)}}}async listApps(){try{let e={apikey:this.apikey||ne(!0),supaHost:this.supaHost,supaAnon:this.supaAnon};return{success:!0,data:(await yM(e,!1)).map(i=>({appId:i.app_id,name:i.name||"Unknown",iconUrl:i.icon_url||void 0,createdAt:new Date(i.created_at||"")}))}}catch(e){return{success:!1,error:e instanceof Error?e.message:String(e)}}}async getAccountId(e){try{let r={apikey:e?.apikey||this.apikey||ne(!0),supaHost:e?.supaHost||this.supaHost,supaAnon:e?.supaAnon||this.supaAnon};return{success:!0,data:await Sq(r,!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async checkBundleCompatibility(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),channel:e.channel,text:e.textOutput??!1,packageJson:e.packageJson,nodeModules:e.nodeModules,supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon};return{success:!0,data:(await EM(e.appId,r,!0)).finalCompatibility}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async encryptBundle(e){try{return{success:!0,data:await TM(e.zipPath,e.checksum,{key:e.keyPath,keyData:e.keyData,json:e.json},!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async decryptBundle(e){try{return{success:!0,data:await OM(e.zipPath,e.ivSessionKey,{key:e.keyPath,keyData:e.keyData,checksum:e.checksum},!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async zipBundle(e){try{return{success:!0,data:await uq(e.appId,{apikey:this.apikey||ne(!0),path:e.path,bundle:e.bundle,name:e.name,codeCheck:e.codeCheck,json:e.json,keyV2:e.keyV2,packageJson:e.packageJson},!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async uploadBundle(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,path:e.path,bundle:e.bundle,channel:e.channel,external:e.external,key:e.encrypt!==!1,keyV2:e.encryptionKey,timeout:e.timeout,tus:e.useTus,comment:e.comment,minUpdateVersion:e.minUpdateVersion,autoMinUpdateVersion:e.autoMinUpdateVersion,selfAssign:e.selfAssign,packageJson:e.packageJsonPaths,ignoreMetadataCheck:e.ignoreCompatibilityCheck,codeCheck:!e.disableCodeCheck,zip:e.useZip},n=await iq(e.appId,r,!0);return{success:n.success,bundleId:n.bundle,checksum:n.checksum??null,encryptionMethod:n.encryptionMethod,sessionKey:n.sessionKey,ivSessionKey:n.ivSessionKey,storageProvider:n.storageProvider,skipped:n.skipped,reason:n.reason}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async listBundles(e){try{let r=this.apikey||ne(!0),n=await pe(r,this.supaHost,this.supaAnon);return{success:!0,data:(await Mp(n,e)).map(o=>({id:o.id.toString(),version:o.name,uploadedAt:new Date(o.created_at||""),size:0,encrypted:o.session_key!==null}))}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async deleteBundle(e,r){try{let n={apikey:this.apikey||ne(!0),supaHost:this.supaHost,supaAnon:this.supaAnon,bundle:r};return await xM(r,e,n,!0),{success:!0}}catch(n){return{success:!1,error:n instanceof Error?n.message:String(n)}}}async cleanupBundles(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,bundle:e.bundle||"",version:"",keep:e.keep||4,force:e.force||!1,ignoreChannel:e.ignoreChannel||!1};return{success:!0,data:await vM(e.appId,r,!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async getCurrentBundle(e,r,n){try{let i={apikey:n?.apikey||this.apikey||ne(!0),quiet:!0,supaHost:n?.supaHost||this.supaHost,supaAnon:n?.supaAnon||this.supaAnon};return{success:!0,data:await lq(r,e,i,!0)}}catch(i){return{success:!1,error:i instanceof Error?i.message:String(i)}}}async addChannel(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,default:e.default,selfAssign:e.selfAssign};return await cq(e.channelId,e.appId,r,!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async updateChannel(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,bundle:e.bundle??void 0,state:e.state,downgrade:e.downgrade,ios:e.ios,android:e.android,selfAssign:e.selfAssign,disableAutoUpdate:e.disableAutoUpdate??void 0,dev:e.dev,emulator:e.emulator,latest:!1,latestRemote:!1,packageJson:void 0,ignoreMetadataCheck:!1};return await pq(e.channelId,e.appId,r,!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async deleteChannel(e,r,n=!1){try{let i={apikey:this.apikey||ne(!0),supaHost:this.supaHost,supaAnon:this.supaAnon,deleteBundle:n,successIfNotFound:!1};return await fq(e,r,i,!0),{success:!0}}catch(i){return{success:!1,error:i instanceof Error?i.message:String(i)}}}async listChannels(e){try{let r={apikey:this.apikey||ne(!0),supaHost:this.supaHost,supaAnon:this.supaAnon};return{success:!0,data:await hq(e,r,!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async generateEncryptionKeys(e){try{return await Dq({force:e?.force,setupChannel:e?.setupChannel},!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async saveEncryptionKey(e){try{return await gq({key:e?.keyPath,keyData:e?.keyData,setupChannel:e?.setupChannel},!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async deleteLegacyEncryptionKey(e){try{return{success:!0,data:{deleted:await yq({force:e?.force,setupChannel:e?.setupChannel},!0)}}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async listOrganizations(e){try{let r={apikey:e?.apikey||this.apikey||ne(!0),supaHost:e?.supaHost||this.supaHost,supaAnon:e?.supaAnon||this.supaAnon};return{success:!0,data:(await _q(r,!0)).map(s=>({id:String(s.id??s.gid??""),name:s.name??"Unknown",role:s.role??void 0,appCount:typeof s.app_count=="number"?s.app_count:void 0,email:s.management_email??void 0,createdAt:s.created_at?new Date(s.created_at):void 0}))}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async addOrganization(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,name:e.name,email:e.email},n=await vq(r,!0);return{success:!0,data:{id:String(n.id??n.gid??""),name:n.name??e.name,role:"owner",appCount:0,email:n.management_email??e.email,createdAt:n.created_at?new Date(n.created_at):void 0}}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async updateOrganization(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,name:e.name,email:e.email},n=await Cq(e.orgId,r,!0);return{success:!0,data:{id:n.orgId,name:n.name,email:n.email}}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async deleteOrganization(e,r){try{let n={apikey:r?.apikey||this.apikey||ne(!0),supaHost:r?.supaHost||this.supaHost,supaAnon:r?.supaAnon||this.supaAnon,autoConfirm:r?.autoConfirm??!0};return{success:!0,data:{deleted:await Eq(e,n,!0)}}}catch(n){return{success:!1,error:n instanceof Error?n.message:String(n)}}}async getStats(e){try{let r=e.apikey||this.apikey||ne(!0),n=await wn(),i={appId:e.appId,devicesId:e.deviceIds,search:e.search,order:e.order,rangeStart:e.after||e.rangeStart,rangeEnd:e.rangeEnd,limit:e.limit},s=await fetch(`${n.hostApi}/private/stats`,{method:"POST",headers:{"Content-Type":"application/json",capgkey:r},body:JSON.stringify(i)});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return{success:!0,data:(await s.json()).map(u=>({appId:u.app_id,deviceId:u.device_id,action:u.action,versionId:u.version_id,version:u.version,createdAt:u.created_at}))}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async setAppSetting(e,r){try{return await bM(e,{apikey:r.apikey||this.apikey||ne(!0),bool:r.bool,string:r.string},!0),{success:!0}}catch(n){return{success:!1,error:n instanceof Error?n.message:String(n)}}}};async function Che(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).uploadBundle(t)}async function She(t){return new nt({supaHost:t.supaHost,supaAnon:t.supaAnon}).login(t)}async function Ahe(t){return new nt().doctor(t)}async function Ohe(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).checkBundleCompatibility(t)}async function xhe(t){return new nt().encryptBundle(t)}async function The(t){return new nt().decryptBundle(t)}async function Fhe(t){return new nt().zipBundle(t)}async function Ihe(t){return new nt().generateEncryptionKeys(t)}async function khe(t){return new nt().saveEncryptionKey(t)}async function Phe(t){return new nt().deleteLegacyEncryptionKey(t)}async function Rhe(t,e,r){return new nt({apikey:r?.apikey,supaHost:r?.supaHost,supaAnon:r?.supaAnon}).getCurrentBundle(t,e,r)}async function Nhe(t,e){return new nt({apikey:e.apikey}).setAppSetting(t,e)}async function $he(t){return new nt({apikey:t?.apikey,supaHost:t?.supaHost,supaAnon:t?.supaAnon}).getAccountId(t)}async function Lhe(t){return new nt({apikey:t?.apikey,supaHost:t?.supaHost,supaAnon:t?.supaAnon}).listOrganizations(t)}async function jhe(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).addOrganization(t)}async function Bhe(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).updateOrganization(t)}async function Mhe(t,e){return new nt({apikey:e?.apikey,supaHost:e?.supaHost,supaAnon:e?.supaAnon}).deleteOrganization(t,e)}async function qhe(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).addApp(t)}async function Uhe(t,e){return new nt(e).listBundles(t)}async function Hhe(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).addChannel(t)}async function Vhe(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).getStats(t)}async function zhe(){try{return await de()}catch{return null}}0&&(module.exports={CapgoSDK,addApp,addChannel,addOrganization,checkBundleCompatibility,createSupabaseClient,decryptBundle,deleteLegacyEncryptionKey,deleteOrganization,doctor,encryptBundle,generateEncryptionKeys,getAccountId,getCapacitorConfig,getCurrentBundle,getStats,listBundles,listOrganizations,login,saveEncryptionKey,updateAppSetting,updateOrganization,uploadBundle,zipBundle});
|
|
343
|
+
`)}let i=await pe(t,e.supaHost,e.supaAnon),s=await De(i,t,["write","all","upload"]);await Ae(t,{channel:"user-login",event:"User CLI login",icon:"\u2705",user_id:s,notify:!1}).catch(),r||(w.success(`login saved into .capgo file in ${n?"local":"home"} directory`),ce("Done \u2705"))}async function vq(t,e=!1){e||oe("Adding organization"),await ze();let r={...t,apikey:t.apikey||ne()};if(!r.apikey)throw e||w.error("Missing API key, you need to provide an API key to add an organization"),new Error("Missing API key");let n=await pe(r.apikey,r.supaHost,r.supaAnon),i=await De(n,r.apikey,["write","all"]),{name:s,email:o}=r;if(!e&&!s){let c=await yo({message:"Organization name:",placeholder:"My Organization"});if(Ot(c))throw w.error("Canceled adding organization"),new Error("Organization creation cancelled");s=c}if(!e&&!o){let c=await yo({message:"Management email:",placeholder:"admin@example.com"});if(Ot(c))throw w.error("Canceled adding organization"),new Error("Organization creation cancelled");o=c}if(!s||!o)throw e||w.error("Missing arguments, you need to provide an organization name and management email"),new Error("Missing organization name or management email");e||w.info(`Adding organization "${s}" to Capgo`);let{data:a,error:u}=await n.from("orgs").insert({name:s,management_email:o,created_by:i}).select().single();if(u)throw e||w.error(`Could not add organization ${W(u)}`),new Error(`Could not add organization: ${W(u)}`);return await Ae(r.apikey,{channel:"organization",event:"Organization Created",icon:"\u{1F3E2}",user_id:a.id,tags:{"org-name":s},notify:!1}).catch(()=>{}),e||(w.success(`Organization "${s}" added to Capgo`),ce("Done \u2705")),a}async function Eq(t,e,r=!1){r||oe("Deleting organization"),await ze();let n={...e,apikey:e.apikey||ne()};if(!n.apikey)throw r||w.error("Missing API key, you need to provide an API key to delete an organization"),new Error("Missing API key");if(!t)throw r||w.error("Missing argument, you need to provide an organization ID"),new Error("Missing organization id");let i=await pe(n.apikey,n.supaHost,n.supaAnon),s=await De(i,n.apikey,["write","all"]),{data:o,error:a}=await i.from("orgs").select("created_by, name").eq("id",t).single();if(a||!o)throw r||w.error(`Cannot get organization details ${W(a)}`),new Error(`Cannot get organization details: ${W(a)}`);if(o.created_by!==s){if(r)throw new Error("Deleting an organization is restricted to the organization owner");w.warn("Deleting an organization is restricted to the organization owner"),w.warn("You are not the owner of this organization"),w.warn("It's strongly recommended that you do not continue!");let c=await Do({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});if(Ot(c)||c==="no")throw w.error("Canceled deleting the organization"),new Error("Organization deletion cancelled")}if(!r&&!n.autoConfirm){let c=await $r({message:`Are you sure you want to delete organization "${o.name}"? This action cannot be undone.`});if(Ot(c)||!c)throw w.error("Canceled deleting the organization"),new Error("Organization deletion cancelled")}r||w.info(`Deleting organization "${o.name}"`);let{error:u}=await i.from("orgs").delete().eq("id",t);if(u)throw r||w.error(`Could not delete organization ${W(u)}`),new Error(`Could not delete organization: ${W(u)}`);return await Ae(n.apikey,{channel:"organization",event:"Organization Deleted",icon:"\u{1F5D1}\uFE0F",user_id:t,tags:{"org-name":o.name},notify:!1}).catch(()=>{}),r||(w.success(`Organization "${o.name}" deleted from Capgo`),ce("Done \u2705")),!0}function Ehe(t,e){if(e)return;if(!t.length){w.error("No organizations found");return}let r=new Ht;r.headers=["Name","ID","Role","Apps"],r.rows=[];for(let n of t.toReversed())r.rows.push([n.name??"Unknown",n.gid,n.role,n.app_count?.toString()||"0"]);w.success("Organizations"),w.success(r.toString())}async function _q(t,e=!1){e||oe("List organizations"),await ze();let r={...t,apikey:t.apikey||ne()};if(!r.apikey)throw e||w.error("Missing API key, you need to provide an API key to list organizations"),new Error("Missing API key");let n=await pe(r.apikey,r.supaHost,r.supaAnon);await De(n,r.apikey,["read","write","all"]),e||w.info("Getting organizations from Capgo");let{error:i,data:s}=await n.rpc("get_orgs_v6");if(i)throw e||w.error(`Cannot get organizations ${W(i)}`),new Error(`Cannot get organizations: ${W(i)}`);let o=s||[];return e||(w.info(`Organizations found: ${o.length}`),Ehe(o,e),ce("Done \u2705")),o}async function Cq(t,e,r=!1){r||oe("Updating organization"),await ze();let n={...e,apikey:e.apikey||ne()};if(!n.apikey)throw r||w.error("Missing API key, you need to provide an API key to update an organization"),new Error("Missing API key");if(!t)throw r||w.error("Missing argument, you need to provide an organization ID"),new Error("Missing organization id");let i=await pe(n.apikey,n.supaHost,n.supaAnon);await De(i,n.apikey,["write","all"]);let{data:s,error:o}=await i.from("orgs").select("name, management_email, created_by").eq("id",t).single();if(o||!s)throw r||w.error(`Cannot get organization details ${W(o)}`),new Error(`Cannot get organization details: ${W(o)}`);let{name:a,email:u}=n;if(!r&&!a){let l=await yo({message:"New organization name:",placeholder:s.name||"My Organization"});if(Ot(l))throw w.error("Canceled updating organization"),new Error("Organization update cancelled");a=l}if(!r&&!u){let l=await yo({message:"Management email:",placeholder:s.management_email||"admin@example.com"});if(Ot(l))throw w.error("Canceled updating organization"),new Error("Organization update cancelled");u=l}if(!a||!u)throw r||w.error("Missing arguments, you need to provide an organization name and management email"),new Error("Missing organization name or management email");r||w.info(`Updating organization "${t}"`);let{error:c}=await i.from("orgs").update({name:a,management_email:u}).eq("id",t);if(c)throw r||w.error(`Could not update organization ${W(c)}`),new Error(`Could not update organization: ${W(c)}`);return await Ae(n.apikey,{channel:"organization",event:"Organization Updated",icon:"\u270F\uFE0F",user_id:t,tags:{"org-name":a},notify:!1}).catch(()=>{}),r||(w.success("Organization updated"),ce("Done \u2705")),{orgId:t,name:a,email:u}}async function Sq(t,e=!1){e||oe("Getting user id");let r={...t,apikey:t.apikey||ne()};if(!r.apikey)throw e||w.error("Missing API key, you need to provide an API key to fetch the user id"),new Error("Missing API key");try{let n=await pe(r.apikey,r.supaHost,r.supaAnon),i=await De(n,r.apikey,["read","all","write"]);return e||ce(`Done \u2705: ${i}`),i}catch(n){throw e||w.error(`Error getting user id ${W(n)}`),n instanceof Error?n:new Error(String(n))}}var nt=class{apikey;supaHost;supaAnon;constructor(e){this.apikey=e?.apikey,this.supaHost=e?.supaHost,this.supaAnon=e?.supaAnon}async login(e){try{return await bq(e.apikey,{local:e.local??!1,supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon},!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async doctor(e){try{return{success:!0,data:await gM({packageJson:e?.packageJson},!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async addApp(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,name:e.name,icon:e.icon};return await hM(e.appId,r,void 0,!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async updateApp(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,name:e.name,icon:e.icon,retention:e.retention};return await wM(e.appId,r,!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async deleteApp(e,r=!1){try{let n={apikey:this.apikey||ne(!0),supaHost:this.supaHost,supaAnon:this.supaAnon};return await dM(e,n,!1,r),{success:!0}}catch(n){return{success:!1,error:n instanceof Error?n.message:String(n)}}}async listApps(){try{let e={apikey:this.apikey||ne(!0),supaHost:this.supaHost,supaAnon:this.supaAnon};return{success:!0,data:(await yM(e,!1)).map(i=>({appId:i.app_id,name:i.name||"Unknown",iconUrl:i.icon_url||void 0,createdAt:new Date(i.created_at||"")}))}}catch(e){return{success:!1,error:e instanceof Error?e.message:String(e)}}}async getAccountId(e){try{let r={apikey:e?.apikey||this.apikey||ne(!0),supaHost:e?.supaHost||this.supaHost,supaAnon:e?.supaAnon||this.supaAnon};return{success:!0,data:await Sq(r,!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async checkBundleCompatibility(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),channel:e.channel,text:e.textOutput??!1,packageJson:e.packageJson,nodeModules:e.nodeModules,supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon};return{success:!0,data:(await EM(e.appId,r,!0)).finalCompatibility}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async encryptBundle(e){try{return{success:!0,data:await TM(e.zipPath,e.checksum,{key:e.keyPath,keyData:e.keyData,json:e.json},!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async decryptBundle(e){try{return{success:!0,data:await OM(e.zipPath,e.ivSessionKey,{key:e.keyPath,keyData:e.keyData,checksum:e.checksum},!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async zipBundle(e){try{return{success:!0,data:await uq(e.appId,{apikey:this.apikey||ne(!0),path:e.path,bundle:e.bundle,name:e.name,codeCheck:e.codeCheck,json:e.json,keyV2:e.keyV2,packageJson:e.packageJson},!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async uploadBundle(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,path:e.path,bundle:e.bundle,channel:e.channel,external:e.external,key:e.encrypt!==!1,keyV2:e.encryptionKey,timeout:e.timeout,tus:e.useTus,comment:e.comment,minUpdateVersion:e.minUpdateVersion,autoMinUpdateVersion:e.autoMinUpdateVersion,selfAssign:e.selfAssign,packageJson:e.packageJsonPaths,ignoreMetadataCheck:e.ignoreCompatibilityCheck,codeCheck:!e.disableCodeCheck,zip:e.useZip},n=await iq(e.appId,r,!0);return{success:n.success,bundleId:n.bundle,checksum:n.checksum??null,encryptionMethod:n.encryptionMethod,sessionKey:n.sessionKey,ivSessionKey:n.ivSessionKey,storageProvider:n.storageProvider,skipped:n.skipped,reason:n.reason}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async listBundles(e){try{let r=this.apikey||ne(!0),n=await pe(r,this.supaHost,this.supaAnon);return{success:!0,data:(await Mp(n,e)).map(o=>({id:o.id.toString(),version:o.name,uploadedAt:new Date(o.created_at||""),size:0,encrypted:o.session_key!==null}))}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async deleteBundle(e,r){try{let n={apikey:this.apikey||ne(!0),supaHost:this.supaHost,supaAnon:this.supaAnon,bundle:r};return await xM(r,e,n,!0),{success:!0}}catch(n){return{success:!1,error:n instanceof Error?n.message:String(n)}}}async cleanupBundles(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,bundle:e.bundle||"",version:"",keep:e.keep||4,force:e.force||!1,ignoreChannel:e.ignoreChannel||!1};return{success:!0,data:await vM(e.appId,r,!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async getCurrentBundle(e,r,n){try{let i={apikey:n?.apikey||this.apikey||ne(!0),quiet:!0,supaHost:n?.supaHost||this.supaHost,supaAnon:n?.supaAnon||this.supaAnon};return{success:!0,data:await lq(r,e,i,!0)}}catch(i){return{success:!1,error:i instanceof Error?i.message:String(i)}}}async addChannel(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,default:e.default,selfAssign:e.selfAssign};return await cq(e.channelId,e.appId,r,!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async updateChannel(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,bundle:e.bundle??void 0,state:e.state,downgrade:e.downgrade,ios:e.ios,android:e.android,selfAssign:e.selfAssign,disableAutoUpdate:e.disableAutoUpdate??void 0,dev:e.dev,emulator:e.emulator,latest:!1,latestRemote:!1,packageJson:void 0,ignoreMetadataCheck:!1};return await pq(e.channelId,e.appId,r,!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async deleteChannel(e,r,n=!1){try{let i={apikey:this.apikey||ne(!0),supaHost:this.supaHost,supaAnon:this.supaAnon,deleteBundle:n,successIfNotFound:!1};return await fq(e,r,i,!0),{success:!0}}catch(i){return{success:!1,error:i instanceof Error?i.message:String(i)}}}async listChannels(e){try{let r={apikey:this.apikey||ne(!0),supaHost:this.supaHost,supaAnon:this.supaAnon};return{success:!0,data:await hq(e,r,!0)}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async generateEncryptionKeys(e){try{return await Dq({force:e?.force,setupChannel:e?.setupChannel},!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async saveEncryptionKey(e){try{return await gq({key:e?.keyPath,keyData:e?.keyData,setupChannel:e?.setupChannel},!0),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async deleteLegacyEncryptionKey(e){try{return{success:!0,data:{deleted:await yq({force:e?.force,setupChannel:e?.setupChannel},!0)}}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async listOrganizations(e){try{let r={apikey:e?.apikey||this.apikey||ne(!0),supaHost:e?.supaHost||this.supaHost,supaAnon:e?.supaAnon||this.supaAnon};return{success:!0,data:(await _q(r,!0)).map(s=>({id:String(s.id??s.gid??""),name:s.name??"Unknown",role:s.role??void 0,appCount:typeof s.app_count=="number"?s.app_count:void 0,email:s.management_email??void 0,createdAt:s.created_at?new Date(s.created_at):void 0}))}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async addOrganization(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,name:e.name,email:e.email},n=await vq(r,!0);return{success:!0,data:{id:String(n.id??n.gid??""),name:n.name??e.name,role:"owner",appCount:0,email:n.management_email??e.email,createdAt:n.created_at?new Date(n.created_at):void 0}}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async updateOrganization(e){try{let r={apikey:e.apikey||this.apikey||ne(!0),supaHost:e.supaHost||this.supaHost,supaAnon:e.supaAnon||this.supaAnon,name:e.name,email:e.email},n=await Cq(e.orgId,r,!0);return{success:!0,data:{id:n.orgId,name:n.name,email:n.email}}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async deleteOrganization(e,r){try{let n={apikey:r?.apikey||this.apikey||ne(!0),supaHost:r?.supaHost||this.supaHost,supaAnon:r?.supaAnon||this.supaAnon,autoConfirm:r?.autoConfirm??!0};return{success:!0,data:{deleted:await Eq(e,n,!0)}}}catch(n){return{success:!1,error:n instanceof Error?n.message:String(n)}}}async getStats(e){try{let r=e.apikey||this.apikey||ne(!0),n=await wn(),i={appId:e.appId,devicesId:e.deviceIds,search:e.search,order:e.order,rangeStart:e.after||e.rangeStart,rangeEnd:e.rangeEnd,limit:e.limit},s=await fetch(`${n.hostApi}/private/stats`,{method:"POST",headers:{"Content-Type":"application/json",capgkey:r},body:JSON.stringify(i)});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return{success:!0,data:(await s.json()).map(u=>({appId:u.app_id,deviceId:u.device_id,action:u.action,versionId:u.version_id,version:u.version,createdAt:u.created_at}))}}catch(r){return{success:!1,error:r instanceof Error?r.message:String(r)}}}async setAppSetting(e,r){try{return await bM(e,{apikey:r.apikey||this.apikey||ne(!0),bool:r.bool,string:r.string},!0),{success:!0}}catch(n){return{success:!1,error:n instanceof Error?n.message:String(n)}}}};async function _he(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).uploadBundle(t)}async function Che(t){return new nt({supaHost:t.supaHost,supaAnon:t.supaAnon}).login(t)}async function She(t){return new nt().doctor(t)}async function Ahe(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).checkBundleCompatibility(t)}async function Ohe(t){return new nt().encryptBundle(t)}async function xhe(t){return new nt().decryptBundle(t)}async function The(t){return new nt().zipBundle(t)}async function Fhe(t){return new nt().generateEncryptionKeys(t)}async function Ihe(t){return new nt().saveEncryptionKey(t)}async function khe(t){return new nt().deleteLegacyEncryptionKey(t)}async function Phe(t,e,r){return new nt({apikey:r?.apikey,supaHost:r?.supaHost,supaAnon:r?.supaAnon}).getCurrentBundle(t,e,r)}async function Rhe(t,e){return new nt({apikey:e.apikey}).setAppSetting(t,e)}async function Nhe(t){return new nt({apikey:t?.apikey,supaHost:t?.supaHost,supaAnon:t?.supaAnon}).getAccountId(t)}async function $he(t){return new nt({apikey:t?.apikey,supaHost:t?.supaHost,supaAnon:t?.supaAnon}).listOrganizations(t)}async function Lhe(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).addOrganization(t)}async function jhe(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).updateOrganization(t)}async function Bhe(t,e){return new nt({apikey:e?.apikey,supaHost:e?.supaHost,supaAnon:e?.supaAnon}).deleteOrganization(t,e)}async function Mhe(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).addApp(t)}async function qhe(t,e){return new nt(e).listBundles(t)}async function Uhe(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).addChannel(t)}async function Hhe(t){return new nt({apikey:t.apikey,supaHost:t.supaHost,supaAnon:t.supaAnon}).getStats(t)}async function Vhe(){try{return await de()}catch{return null}}0&&(module.exports={CapgoSDK,addApp,addChannel,addOrganization,checkBundleCompatibility,createSupabaseClient,decryptBundle,deleteLegacyEncryptionKey,deleteOrganization,doctor,encryptBundle,generateEncryptionKeys,getAccountId,getCapacitorConfig,getCurrentBundle,getStats,listBundles,listOrganizations,login,saveEncryptionKey,updateAppSetting,updateOrganization,uploadBundle,zipBundle});
|
|
345
344
|
/*! Bundled license information:
|
|
346
345
|
|
|
347
346
|
tus-js-client/lib.es5/upload.js:
|