@telia-ace/alliance-cli 1.1.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ import { createRequire as c__createRequire } from 'node:module';
2
+ const require = c__createRequire(import.meta.url);
3
+ import{h as O,i as Ne,l as A}from"./chunk-AEIX73UA.js";var _;(function(t){t.assertEqual=n=>n;function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let i={};for(let s of n)i[s]=s;return i},t.getValidEnumValues=n=>{let i=t.objectKeys(n).filter(d=>typeof n[n[d]]!="number"),s={};for(let d of i)s[d]=n[d];return t.objectValues(s)},t.objectValues=n=>t.objectKeys(n).map(function(i){return n[i]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let i=[];for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&i.push(s);return i},t.find=(n,i)=>{for(let s of n)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function a(n,i=" | "){return n.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=a,t.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(_||(_={}));var Oe;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Oe||(Oe={}));var l=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),I=t=>{switch(typeof t){case"undefined":return l.undefined;case"string":return l.string;case"number":return isNaN(t)?l.nan:l.number;case"boolean":return l.boolean;case"function":return l.function;case"bigint":return l.bigint;case"symbol":return l.symbol;case"object":return Array.isArray(t)?l.array:t===null?l.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?l.promise:typeof Map<"u"&&t instanceof Map?l.map:typeof Set<"u"&&t instanceof Set?l.set:typeof Date<"u"&&t instanceof Date?l.date:l.object;default:return l.unknown}},o=_.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),yt=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Z=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let e=t||function(n){return n.message},r={_errors:[]},a=n=>{for(let i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)r._errors.push(e(i));else{let s=r,d=0;for(;d<i.path.length;){let u=i.path[d];d===i.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(e(i))):s[u]=s[u]||{_errors:[]},s=s[u],d++}}};return a(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){let e={},r=[];for(let a of this.issues)a.path.length>0?(e[a.path[0]]=e[a.path[0]]||[],e[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:e}}get formErrors(){return this.flatten()}};Z.create=t=>new Z(t);var q=(t,e)=>{let r;switch(t.code){case o.invalid_type:t.received===l.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case o.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,_.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:r=`Unrecognized key(s) in object: ${_.joinValues(t.keys,", ")}`;break;case o.invalid_union:r="Invalid input";break;case o.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${_.joinValues(t.options)}`;break;case o.invalid_enum_value:r=`Invalid enum value. Expected ${_.joinValues(t.options)}, received '${t.received}'`;break;case o.invalid_arguments:r="Invalid function arguments";break;case o.invalid_return_type:r="Invalid function return type";break;case o.invalid_date:r="Invalid date";break;case o.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:_.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case o.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case o.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case o.custom:r="Invalid input";break;case o.invalid_intersection_types:r="Intersection results could not be merged";break;case o.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case o.not_finite:r="Number must be finite";break;default:r=e.defaultError,_.assertNever(t)}return{message:r}},Ke=q;function vt(t){Ke=t}function he(){return Ke}var fe=t=>{let{data:e,path:r,errorMaps:a,issueData:n}=t,i=[...r,...n.path||[]],s={...n,path:i},d="",u=a.filter(h=>!!h).slice().reverse();for(let h of u)d=h(s,{data:e,defaultError:d}).message;return{...n,path:i,message:n.message||d}},_t=[];function c(t,e){let r=fe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,he(),q].filter(a=>!!a)});t.common.issues.push(r)}var w=class Be{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let n of r){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let n of r)a.push({key:await n.key,value:await n.value});return Be.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let n of r){let{key:i,value:s}=n;if(i.status==="aborted"||s.status==="aborted")return m;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||n.alwaysSet)&&(a[i.value]=s.value)}return{status:e.value,value:a}}},m=Object.freeze({status:"aborted"}),qe=t=>({status:"dirty",value:t}),b=t=>({status:"valid",value:t}),Ae=t=>t.status==="aborted",Se=t=>t.status==="dirty",J=t=>t.status==="valid",me=t=>typeof Promise<"u"&&t instanceof Promise,p;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(p||(p={}));var C=class{constructor(t,e,r,a){this._cachedPath=[],this.parent=t,this.data=e,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Ve=(t,e)=>{if(J(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Z(t.common.issues);return this._error=r,this._error}}};function g(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:n}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,s)=>i.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:a??s.defaultError}:{message:r??s.defaultError},description:n}}var v=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return I(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:I(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new w,ctx:{common:t.parent.common,data:t.data,parsedType:I(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(me(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let r=this.safeParse(t,e);if(r.success)return r.data;throw r.error}safeParse(t,e){var r;let a={common:{issues:[],async:(r=e?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:I(t)},n=this._parseSync({data:t,path:a.path,parent:a});return Ve(a,n)}async parseAsync(t,e){let r=await this.safeParseAsync(t,e);if(r.success)return r.data;throw r.error}async safeParseAsync(t,e){let r={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:I(t)},a=this._parse({data:t,path:r.path,parent:r}),n=await(me(a)?a:Promise.resolve(a));return Ve(r,n)}refine(t,e){let r=a=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(a):e;return this._refinement((a,n)=>{let i=t(a),s=()=>n.addIssue({code:o.custom,...r(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(d=>d?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(t,e){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof e=="function"?e(r,a):e),!1))}_refinement(t){return new N({schema:this,typeName:f.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return S.create(this,this._def)}nullable(){return M.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return L.create(this,this._def)}promise(){return K.create(this,this._def)}or(t){return te.create([this,t],this._def)}and(t){return re.create(this,t,this._def)}transform(t){return new N({...g(this._def),schema:this,typeName:f.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new se({...g(this._def),innerType:this,defaultValue:e,typeName:f.ZodDefault})}brand(){return new tt({typeName:f.ZodBranded,type:this,...g(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new be({...g(this._def),innerType:this,catchValue:e,typeName:f.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return Le.create(this,t)}readonly(){return we.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},bt=/^c[^\s-]{8,}$/i,xt=/^[a-z][a-z0-9]*$/,wt=/^[0-9A-HJKMNP-TV-Z]{26}$/,kt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Tt=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Zt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ce,Nt=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Ct=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ot=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function At(t,e){return!!((e==="v4"||!e)&&Nt.test(t)||(e==="v6"||!e)&&Ct.test(t))}var V=class B extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==l.string){let n=this._getOrReturnCtx(e);return c(n,{code:o.invalid_type,expected:l.string,received:n.parsedType}),m}let r=new w,a;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:o.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="max")e.data.length>n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:o.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){let i=e.data.length>n.value,s=e.data.length<n.value;(i||s)&&(a=this._getOrReturnCtx(e,a),i?c(a,{code:o.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):s&&c(a,{code:o.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),r.dirty())}else if(n.kind==="email")Tt.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"email",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="emoji")Ce||(Ce=new RegExp(Zt,"u")),Ce.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"emoji",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="uuid")kt.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"uuid",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid")bt.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"cuid",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid2")xt.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"cuid2",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="ulid")wt.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"ulid",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),c(a,{validation:"url",code:o.invalid_string,message:n.message}),r.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"regex",code:o.invalid_string,message:n.message}),r.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(a=this._getOrReturnCtx(e,a),c(a,{code:o.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(a=this._getOrReturnCtx(e,a),c(a,{code:o.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(a=this._getOrReturnCtx(e,a),c(a,{code:o.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()):n.kind==="datetime"?Ot(n).test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{code:o.invalid_string,validation:"datetime",message:n.message}),r.dirty()):n.kind==="ip"?At(e.data,n.version)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"ip",code:o.invalid_string,message:n.message}),r.dirty()):_.assertNever(n);return{status:r.value,value:e.data}}_regex(e,r,a){return this.refinement(n=>e.test(n),{validation:r,code:o.invalid_string,...p.errToObj(a)})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...p.errToObj(e)})}url(e){return this._addCheck({kind:"url",...p.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...p.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...p.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...p.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...p.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...p.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...p.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,...p.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...p.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...p.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...p.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...p.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...p.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...p.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...p.errToObj(r)})}nonempty(e){return this.min(1,p.errToObj(e))}trim(){return new B({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new B({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new B({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};V.create=t=>{var e;return new V({checks:[],typeName:f.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...g(t)})};function St(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,n=r>a?r:a,i=parseInt(t.toFixed(n).replace(".","")),s=parseInt(e.toFixed(n).replace(".",""));return i%s/Math.pow(10,n)}var H=class je extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==l.number){let n=this._getOrReturnCtx(e);return c(n,{code:o.invalid_type,expected:l.number,received:n.parsedType}),m}let r,a=new w;for(let n of this._def.checks)n.kind==="int"?_.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:o.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:o.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:o.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?St(e.data,n.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:o.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:o.not_finite,message:n.message}),a.dirty()):_.assertNever(n);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,p.toString(r))}gt(e,r){return this.setLimit("min",e,!1,p.toString(r))}lte(e,r){return this.setLimit("max",e,!0,p.toString(r))}lt(e,r){return this.setLimit("max",e,!1,p.toString(r))}setLimit(e,r,a,n){return new je({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:p.toString(n)}]})}_addCheck(e){return new je({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:p.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:p.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:p.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:p.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:p.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};H.create=t=>new H({checks:[],typeName:f.ZodNumber,coerce:t?.coerce||!1,...g(t)});var Y=class Ee extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==l.bigint){let n=this._getOrReturnCtx(e);return c(n,{code:o.invalid_type,expected:l.bigint,received:n.parsedType}),m}let r,a=new w;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:o.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:o.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:o.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):_.assertNever(n);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,p.toString(r))}gt(e,r){return this.setLimit("min",e,!1,p.toString(r))}lte(e,r){return this.setLimit("max",e,!0,p.toString(r))}lt(e,r){return this.setLimit("max",e,!1,p.toString(r))}setLimit(e,r,a,n){return new Ee({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:p.toString(n)}]})}_addCheck(e){return new Ee({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:p.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Y.create=t=>{var e;return new Y({checks:[],typeName:f.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...g(t)})};var G=class extends v{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==l.boolean){let e=this._getOrReturnCtx(t);return c(e,{code:o.invalid_type,expected:l.boolean,received:e.parsedType}),m}return b(t.data)}};G.create=t=>new G({typeName:f.ZodBoolean,coerce:t?.coerce||!1,...g(t)});var X=class Je extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==l.date){let n=this._getOrReturnCtx(e);return c(n,{code:o.invalid_type,expected:l.date,received:n.parsedType}),m}if(isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return c(n,{code:o.invalid_date}),m}let r=new w,a;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:o.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:o.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):_.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Je({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:p.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:p.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};X.create=t=>new X({checks:[],coerce:t?.coerce||!1,typeName:f.ZodDate,...g(t)});var ge=class extends v{_parse(t){if(this._getType(t)!==l.symbol){let e=this._getOrReturnCtx(t);return c(e,{code:o.invalid_type,expected:l.symbol,received:e.parsedType}),m}return b(t.data)}};ge.create=t=>new ge({typeName:f.ZodSymbol,...g(t)});var Q=class extends v{_parse(t){if(this._getType(t)!==l.undefined){let e=this._getOrReturnCtx(t);return c(e,{code:o.invalid_type,expected:l.undefined,received:e.parsedType}),m}return b(t.data)}};Q.create=t=>new Q({typeName:f.ZodUndefined,...g(t)});var ee=class extends v{_parse(t){if(this._getType(t)!==l.null){let e=this._getOrReturnCtx(t);return c(e,{code:o.invalid_type,expected:l.null,received:e.parsedType}),m}return b(t.data)}};ee.create=t=>new ee({typeName:f.ZodNull,...g(t)});var W=class extends v{constructor(){super(...arguments),this._any=!0}_parse(t){return b(t.data)}};W.create=t=>new W({typeName:f.ZodAny,...g(t)});var $=class extends v{constructor(){super(...arguments),this._unknown=!0}_parse(t){return b(t.data)}};$.create=t=>new $({typeName:f.ZodUnknown,...g(t)});var j=class extends v{_parse(t){let e=this._getOrReturnCtx(t);return c(e,{code:o.invalid_type,expected:l.never,received:e.parsedType}),m}};j.create=t=>new j({typeName:f.ZodNever,...g(t)});var ye=class extends v{_parse(t){if(this._getType(t)!==l.undefined){let e=this._getOrReturnCtx(t);return c(e,{code:o.invalid_type,expected:l.void,received:e.parsedType}),m}return b(t.data)}};ye.create=t=>new ye({typeName:f.ZodVoid,...g(t)});var L=class le extends v{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),n=this._def;if(r.parsedType!==l.array)return c(r,{code:o.invalid_type,expected:l.array,received:r.parsedType}),m;if(n.exactLength!==null){let s=r.data.length>n.exactLength.value,d=r.data.length<n.exactLength.value;(s||d)&&(c(r,{code:s?o.too_big:o.too_small,minimum:d?n.exactLength.value:void 0,maximum:s?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(c(r,{code:o.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(c(r,{code:o.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((s,d)=>n.type._parseAsync(new C(r,s,r.path,d)))).then(s=>w.mergeArray(a,s));let i=[...r.data].map((s,d)=>n.type._parseSync(new C(r,s,r.path,d)));return w.mergeArray(a,i)}get element(){return this._def.type}min(e,r){return new le({...this._def,minLength:{value:e,message:p.toString(r)}})}max(e,r){return new le({...this._def,maxLength:{value:e,message:p.toString(r)}})}length(e,r){return new le({...this._def,exactLength:{value:e,message:p.toString(r)}})}nonempty(e){return this.min(1,e)}};L.create=(t,e)=>new L({type:t,minLength:null,maxLength:null,exactLength:null,typeName:f.ZodArray,...g(e)});function F(t){if(t instanceof k){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=S.create(F(a))}return new k({...t._def,shape:()=>e})}else return t instanceof L?new L({...t._def,type:F(t.element)}):t instanceof S?S.create(F(t.unwrap())):t instanceof M?M.create(F(t.unwrap())):t instanceof R?R.create(t.items.map(e=>F(e))):t}var k=class T extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=_.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==l.object){let u=this._getOrReturnCtx(e);return c(u,{code:o.invalid_type,expected:l.object,received:u.parsedType}),m}let{status:r,ctx:a}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof j&&this._def.unknownKeys==="strip"))for(let u in a.data)i.includes(u)||s.push(u);let d=[];for(let u of i){let h=n[u],x=a.data[u];d.push({key:{status:"valid",value:u},value:h._parse(new C(a,x,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof j){let u=this._def.unknownKeys;if(u==="passthrough")for(let h of s)d.push({key:{status:"valid",value:h},value:{status:"valid",value:a.data[h]}});else if(u==="strict")s.length>0&&(c(a,{code:o.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let h of s){let x=a.data[h];d.push({key:{status:"valid",value:h},value:u._parse(new C(a,x,a.path,h)),alwaysSet:h in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let u=[];for(let h of d){let x=await h.key;u.push({key:x,value:await h.value,alwaysSet:h.alwaysSet})}return u}).then(u=>w.mergeObjectSync(r,u)):w.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(e){return p.errToObj,new T({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var n,i,s,d;let u=(s=(i=(n=this._def).errorMap)===null||i===void 0?void 0:i.call(n,r,a).message)!==null&&s!==void 0?s:a.defaultError;return r.code==="unrecognized_keys"?{message:(d=p.errToObj(e).message)!==null&&d!==void 0?d:u}:{message:u}}}:{}})}strip(){return new T({...this._def,unknownKeys:"strip"})}passthrough(){return new T({...this._def,unknownKeys:"passthrough"})}extend(e){return new T({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new T({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:f.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new T({...this._def,catchall:e})}pick(e){let r={};return _.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new T({...this._def,shape:()=>r})}omit(e){let r={};return _.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new T({...this._def,shape:()=>r})}deepPartial(){return F(this)}partial(e){let r={};return _.objectKeys(this.shape).forEach(a=>{let n=this.shape[a];e&&!e[a]?r[a]=n:r[a]=n.optional()}),new T({...this._def,shape:()=>r})}required(e){let r={};return _.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let n=this.shape[a];for(;n instanceof S;)n=n._def.innerType;r[a]=n}}),new T({...this._def,shape:()=>r})}keyof(){return et(_.objectKeys(this.shape))}};k.create=(t,e)=>new k({shape:()=>t,unknownKeys:"strip",catchall:j.create(),typeName:f.ZodObject,...g(e)});k.strictCreate=(t,e)=>new k({shape:()=>t,unknownKeys:"strict",catchall:j.create(),typeName:f.ZodObject,...g(e)});k.lazycreate=(t,e)=>new k({shape:t,unknownKeys:"strip",catchall:j.create(),typeName:f.ZodObject,...g(e)});var te=class extends v{_parse(t){let{ctx:e}=this._processInputParams(t),r=this._def.options;function a(n){for(let s of n)if(s.result.status==="valid")return s.result;for(let s of n)if(s.result.status==="dirty")return e.common.issues.push(...s.ctx.common.issues),s.result;let i=n.map(s=>new Z(s.ctx.common.issues));return c(e,{code:o.invalid_union,unionErrors:i}),m}if(e.common.async)return Promise.all(r.map(async n=>{let i={...e,common:{...e.common,issues:[]},parent:null};return{result:await n._parseAsync({data:e.data,path:e.path,parent:i}),ctx:i}})).then(a);{let n,i=[];for(let d of r){let u={...e,common:{...e.common,issues:[]},parent:null},h=d._parseSync({data:e.data,path:e.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!n&&(n={result:h,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(n)return e.common.issues.push(...n.ctx.common.issues),n.result;let s=i.map(d=>new Z(d));return c(e,{code:o.invalid_union,unionErrors:s}),m}}get options(){return this._def.options}};te.create=(t,e)=>new te({options:t,typeName:f.ZodUnion,...g(e)});var ce=t=>t instanceof ae?ce(t.schema):t instanceof N?ce(t.innerType()):t instanceof ne?[t.value]:t instanceof oe?t.options:t instanceof ie?Object.keys(t.enum):t instanceof se?ce(t._def.innerType):t instanceof Q?[void 0]:t instanceof ee?[null]:null,He=class Ye extends v{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==l.object)return c(r,{code:o.invalid_type,expected:l.object,received:r.parsedType}),m;let a=this.discriminator,n=r.data[a],i=this.optionsMap.get(n);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(c(r,{code:o.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let n=new Map;for(let i of r){let s=ce(i.shape[e]);if(!s)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let d of s){if(n.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);n.set(d,i)}}return new Ye({typeName:f.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...g(a)})}};function Pe(t,e){let r=I(t),a=I(e);if(t===e)return{valid:!0,data:t};if(r===l.object&&a===l.object){let n=_.objectKeys(e),i=_.objectKeys(t).filter(d=>n.indexOf(d)!==-1),s={...t,...e};for(let d of i){let u=Pe(t[d],e[d]);if(!u.valid)return{valid:!1};s[d]=u.data}return{valid:!0,data:s}}else if(r===l.array&&a===l.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let i=0;i<t.length;i++){let s=t[i],d=e[i],u=Pe(s,d);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return r===l.date&&a===l.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var re=class extends v{_parse(t){let{status:e,ctx:r}=this._processInputParams(t),a=(n,i)=>{if(Ae(n)||Ae(i))return m;let s=Pe(n.value,i.value);return s.valid?((Se(n)||Se(i))&&e.dirty(),{status:e.value,value:s.data}):(c(r,{code:o.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,i])=>a(n,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};re.create=(t,e,r)=>new re({left:t,right:e,typeName:f.ZodIntersection,...g(r)});var R=class Ge extends v{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==l.array)return c(a,{code:o.invalid_type,expected:l.array,received:a.parsedType}),m;if(a.data.length<this._def.items.length)return c(a,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&a.data.length>this._def.items.length&&(c(a,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let n=[...a.data].map((i,s)=>{let d=this._def.items[s]||this._def.rest;return d?d._parse(new C(a,i,a.path,s)):null}).filter(i=>!!i);return a.common.async?Promise.all(n).then(i=>w.mergeArray(r,i)):w.mergeArray(r,n)}get items(){return this._def.items}rest(e){return new Ge({...this._def,rest:e})}};R.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new R({items:t,typeName:f.ZodTuple,rest:null,...g(e)})};var Xe=class Ie extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==l.object)return c(a,{code:o.invalid_type,expected:l.object,received:a.parsedType}),m;let n=[],i=this._def.keyType,s=this._def.valueType;for(let d in a.data)n.push({key:i._parse(new C(a,d,a.path,d)),value:s._parse(new C(a,a.data[d],a.path,d))});return a.common.async?w.mergeObjectAsync(r,n):w.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof v?new Ie({keyType:e,valueType:r,typeName:f.ZodRecord,...g(a)}):new Ie({keyType:V.create(),valueType:e,typeName:f.ZodRecord,...g(r)})}},ve=class extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==l.map)return c(r,{code:o.invalid_type,expected:l.map,received:r.parsedType}),m;let a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([s,d],u)=>({key:a._parse(new C(r,s,r.path,[u,"key"])),value:n._parse(new C(r,d,r.path,[u,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let d of i){let u=await d.key,h=await d.value;if(u.status==="aborted"||h.status==="aborted")return m;(u.status==="dirty"||h.status==="dirty")&&e.dirty(),s.set(u.value,h.value)}return{status:e.value,value:s}})}else{let s=new Map;for(let d of i){let u=d.key,h=d.value;if(u.status==="aborted"||h.status==="aborted")return m;(u.status==="dirty"||h.status==="dirty")&&e.dirty(),s.set(u.value,h.value)}return{status:e.value,value:s}}}};ve.create=(t,e,r)=>new ve({valueType:e,keyType:t,typeName:f.ZodMap,...g(r)});var _e=class Re extends v{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==l.set)return c(a,{code:o.invalid_type,expected:l.set,received:a.parsedType}),m;let n=this._def;n.minSize!==null&&a.data.size<n.minSize.value&&(c(a,{code:o.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&a.data.size>n.maxSize.value&&(c(a,{code:o.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let i=this._def.valueType;function s(u){let h=new Set;for(let x of u){if(x.status==="aborted")return m;x.status==="dirty"&&r.dirty(),h.add(x.value)}return{status:r.value,value:h}}let d=[...a.data.values()].map((u,h)=>i._parse(new C(a,u,a.path,h)));return a.common.async?Promise.all(d).then(u=>s(u)):s(d)}min(e,r){return new Re({...this._def,minSize:{value:e,message:p.toString(r)}})}max(e,r){return new Re({...this._def,maxSize:{value:e,message:p.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};_e.create=(t,e)=>new _e({valueType:t,minSize:null,maxSize:null,typeName:f.ZodSet,...g(e)});var Qe=class pe extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==l.function)return c(r,{code:o.invalid_type,expected:l.function,received:r.parsedType}),m;function a(d,u){return fe({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,he(),q].filter(h=>!!h),issueData:{code:o.invalid_arguments,argumentsError:u}})}function n(d,u){return fe({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,he(),q].filter(h=>!!h),issueData:{code:o.invalid_return_type,returnTypeError:u}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof K){let d=this;return b(async function(...u){let h=new Z([]),x=await d._def.args.parseAsync(u,i).catch(Ze=>{throw h.addIssue(a(u,Ze)),h}),z=await Reflect.apply(s,this,x);return await d._def.returns._def.type.parseAsync(z,i).catch(Ze=>{throw h.addIssue(n(z,Ze)),h})})}else{let d=this;return b(function(...u){let h=d._def.args.safeParse(u,i);if(!h.success)throw new Z([a(u,h.error)]);let x=Reflect.apply(s,this,h.data),z=d._def.returns.safeParse(x,i);if(!z.success)throw new Z([n(x,z.error)]);return z.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new pe({...this._def,args:R.create(e).rest($.create())})}returns(e){return new pe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new pe({args:e||R.create([]).rest($.create()),returns:r||$.create(),typeName:f.ZodFunction,...g(a)})}},ae=class extends v{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};ae.create=(t,e)=>new ae({getter:t,typeName:f.ZodLazy,...g(e)});var ne=class extends v{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return c(e,{received:e.data,code:o.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:t.data}}get value(){return this._def.value}};ne.create=(t,e)=>new ne({value:t,typeName:f.ZodLiteral,...g(e)});function et(t,e){return new oe({values:t,typeName:f.ZodEnum,...g(e)})}var oe=class $e extends v{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return c(r,{expected:_.joinValues(a),received:r.parsedType,code:o.invalid_type}),m}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),a=this._def.values;return c(r,{received:r.data,code:o.invalid_enum_value,options:a}),m}return b(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return $e.create(e)}exclude(e){return $e.create(this.options.filter(r=>!e.includes(r)))}};oe.create=et;var ie=class extends v{_parse(t){let e=_.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==l.string&&r.parsedType!==l.number){let a=_.objectValues(e);return c(r,{expected:_.joinValues(a),received:r.parsedType,code:o.invalid_type}),m}if(e.indexOf(t.data)===-1){let a=_.objectValues(e);return c(r,{received:r.data,code:o.invalid_enum_value,options:a}),m}return b(t.data)}get enum(){return this._def.values}};ie.create=(t,e)=>new ie({values:t,typeName:f.ZodNativeEnum,...g(e)});var K=class extends v{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==l.promise&&e.common.async===!1)return c(e,{code:o.invalid_type,expected:l.promise,received:e.parsedType}),m;let r=e.parsedType===l.promise?e.data:Promise.resolve(e.data);return b(r.then(a=>this._def.type.parseAsync(a,{path:e.path,errorMap:e.common.contextualErrorMap})))}};K.create=(t,e)=>new K({type:t,typeName:f.ZodPromise,...g(e)});var N=class extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===f.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:r}=this._processInputParams(t),a=this._def.effect||null,n={addIssue:i=>{c(r,i),i.fatal?e.abort():e.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),a.type==="preprocess"){let i=a.transform(r.data,n);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(i).then(s=>this._def.schema._parseAsync({data:s,path:r.path,parent:r})):this._def.schema._parseSync({data:i,path:r.path,parent:r})}if(a.type==="refinement"){let i=s=>{let d=a.refinement(s,n);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?m:(s.status==="dirty"&&e.dirty(),i(s.value),{status:e.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?m:(s.status==="dirty"&&e.dirty(),i(s.value).then(()=>({status:e.value,value:s.value}))))}if(a.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!J(i))return i;let s=a.transform(i.value,n);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>J(i)?Promise.resolve(a.transform(i.value,n)).then(s=>({status:e.value,value:s})):i);_.assertNever(a)}};N.create=(t,e,r)=>new N({schema:t,typeName:f.ZodEffects,effect:e,...g(r)});N.createWithPreprocess=(t,e,r)=>new N({schema:e,effect:{type:"preprocess",transform:t},typeName:f.ZodEffects,...g(r)});var S=class extends v{_parse(t){return this._getType(t)===l.undefined?b(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};S.create=(t,e)=>new S({innerType:t,typeName:f.ZodOptional,...g(e)});var M=class extends v{_parse(t){return this._getType(t)===l.null?b(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};M.create=(t,e)=>new M({innerType:t,typeName:f.ZodNullable,...g(e)});var se=class extends v{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return e.parsedType===l.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};se.create=(t,e)=>new se({innerType:t,typeName:f.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...g(e)});var be=class extends v{_parse(t){let{ctx:e}=this._processInputParams(t),r={...e,common:{...e.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return me(a)?a.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Z(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Z(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};be.create=(t,e)=>new be({innerType:t,typeName:f.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...g(e)});var xe=class extends v{_parse(t){if(this._getType(t)!==l.nan){let e=this._getOrReturnCtx(t);return c(e,{code:o.invalid_type,expected:l.nan,received:e.parsedType}),m}return{status:"valid",value:t.data}}};xe.create=t=>new xe({typeName:f.ZodNaN,...g(t)});var jt=Symbol("zod_brand"),tt=class extends v{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return this._def.type._parse({data:r,path:e.path,parent:e})}unwrap(){return this._def.type}},Le=class rt extends v{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?m:n.status==="dirty"?(r.dirty(),qe(n.value)):this._def.out._parseAsync({data:n.value,path:a.path,parent:a})})();{let n=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?m:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:a.path,parent:a})}}static create(e,r){return new rt({in:e,out:r,typeName:f.ZodPipeline})}},we=class extends v{_parse(t){let e=this._def.innerType._parse(t);return J(e)&&(e.value=Object.freeze(e.value)),e}};we.create=(t,e)=>new we({innerType:t,typeName:f.ZodReadonly,...g(e)});var at=(t,e={},r)=>t?W.create().superRefine((a,n)=>{var i,s;if(!t(a)){let d=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,u=(s=(i=d.fatal)!==null&&i!==void 0?i:r)!==null&&s!==void 0?s:!0,h=typeof d=="string"?{message:d}:d;n.addIssue({code:"custom",...h,fatal:u})}}):W.create(),Et={object:k.lazycreate},f;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(f||(f={}));var Pt=(t,e={message:`Input not instance of ${t.name}`})=>at(r=>r instanceof t,e),nt=V.create,it=H.create,It=xe.create,Rt=Y.create,st=G.create,$t=X.create,Lt=ge.create,Mt=Q.create,Dt=ee.create,Ut=W.create,zt=$.create,Ft=j.create,Vt=ye.create,Wt=L.create,Kt=k.create,Bt=k.strictCreate,qt=te.create,Jt=He.create,Ht=re.create,Yt=R.create,Gt=Xe.create,Xt=ve.create,Qt=_e.create,er=Qe.create,tr=ae.create,rr=ne.create,ar=oe.create,nr=ie.create,ir=K.create,We=N.create,sr=S.create,or=M.create,dr=N.createWithPreprocess,ur=Le.create,lr=()=>nt().optional(),cr=()=>it().optional(),pr=()=>st().optional(),hr={string:t=>V.create({...t,coerce:!0}),number:t=>H.create({...t,coerce:!0}),boolean:t=>G.create({...t,coerce:!0}),bigint:t=>Y.create({...t,coerce:!0}),date:t=>X.create({...t,coerce:!0})},fr=m,y=Object.freeze({__proto__:null,defaultErrorMap:q,setErrorMap:vt,getErrorMap:he,makeIssue:fe,EMPTY_PATH:_t,addIssueToContext:c,ParseStatus:w,INVALID:m,DIRTY:qe,OK:b,isAborted:Ae,isDirty:Se,isValid:J,isAsync:me,get util(){return _},get objectUtil(){return Oe},ZodParsedType:l,getParsedType:I,ZodType:v,ZodString:V,ZodNumber:H,ZodBigInt:Y,ZodBoolean:G,ZodDate:X,ZodSymbol:ge,ZodUndefined:Q,ZodNull:ee,ZodAny:W,ZodUnknown:$,ZodNever:j,ZodVoid:ye,ZodArray:L,ZodObject:k,ZodUnion:te,ZodDiscriminatedUnion:He,ZodIntersection:re,ZodTuple:R,ZodRecord:Xe,ZodMap:ve,ZodSet:_e,ZodFunction:Qe,ZodLazy:ae,ZodLiteral:ne,ZodEnum:oe,ZodNativeEnum:ie,ZodPromise:K,ZodEffects:N,ZodTransformer:N,ZodOptional:S,ZodNullable:M,ZodDefault:se,ZodCatch:be,ZodNaN:xe,BRAND:jt,ZodBranded:tt,ZodPipeline:Le,ZodReadonly:we,custom:at,Schema:v,ZodSchema:v,late:Et,get ZodFirstPartyTypeKind(){return f},coerce:hr,any:Ut,array:Wt,bigint:Rt,boolean:st,date:$t,discriminatedUnion:Jt,effect:We,enum:ar,function:er,instanceof:Pt,intersection:Ht,lazy:tr,literal:rr,map:Xt,nan:It,nativeEnum:nr,never:Ft,null:Dt,nullable:or,number:it,object:Kt,oboolean:pr,onumber:cr,optional:sr,ostring:lr,pipeline:ur,preprocess:dr,promise:ir,record:Gt,set:Qt,strictObject:Bt,string:nt,symbol:Lt,transformer:We,tuple:Yt,undefined:Mt,union:qt,unknown:zt,void:Vt,NEVER:fr,ZodIssueCode:o,quotelessJson:yt,ZodError:Z});var mr=y.object({}),gr=y.object({alias:y.object({}).passthrough().default({}).describe("Equivalent to `vite.resolve.alias`.\n\nhttps://vitejs.dev/config/shared-options.html#resolve-alias"),plugins:y.any().array().default([]).describe("Equivalent to `vite.plugins`.\n\nhttps://vitejs.dev/config/shared-options.html#plugins")}),yr=y.object({server:y.number().default(3e3).describe("The port that the dev server should use."),gateway:y.number().default(3001).describe("The port that the api gateway should use.")}),vr=y.object({apps:y.string().array().default([]).describe(`Additional apps to include.
4
+
5
+ Note: additional apps need to be added as devDependencies.`),ports:yr.default({}).describe("Options for ports."),open:y.boolean().default(!1).describe("Whether the dev server should automatically open in your browser or not."),logging:y.boolean().default(!1).describe("Whether the dev server and browser console should output more log information or not.")}),_r=y.object({mode:y.string().default("production").describe("Which mode to use when building the app. [production | development]"),watch:y.boolean().default(!1).describe("Whether the build should start watching and rebuild when files change or not.")}),br=y.object({app:y.string().default("./src/app.ts").describe("The entry file for the app."),manifest:y.string().default("./src/manifest.json").describe("The entry file for the app manifest.")}),de=y.object({vite:gr.default({}).describe("Options related to Vite."),server:vr.default({}).describe("Options related to the dev server."),entries:br.default({}).describe("Options related to the app entry points."),build:_r.default({}).describe("Options related to app build."),experimental:mr.default({}).describe("Experimental options.")}),xr=y.enum(["build","serve"]),wr=y.object({command:xr,mode:y.string()}),kr=y.function().args(wr).returns(de.or(y.promise(de))),wa=y.function().args(y.union([de,kr]));var Tr=y.enum(["necessary","functional","analytics","marketing"]),Zr=y.object({purpose:y.string().describe("Purpose of the storing the value."),category:Tr.describe("Category of the storage value - necessary, functional, analytics or marketing."),lifespan:y.string().describe("Basic description of how long the value will be stored.")}),Nr=y.record(Zr.describe("Key used when writing to the storage.")),Cr=y.object({value:y.string().describe("The localization token default value."),description:y.string().describe("The localization token description.")}),Or=y.object({localization:y.record(Cr.describe("Key used when getting the localized text.")).default({}).describe("Translateable texts used in the app")}),Ar=y.object({name:y.string().describe("URL friendly name of the app."),endpoints:y.string().array().default([]).describe("Endpoints that should be communicated with using the API gateway."),permissions:y.string().array().default([]).describe("Permissions that can be added to user roles."),resources:Or.default({}).describe("Resources used by the app."),storage:Nr.default({}).describe("Cookies, session storage, and local storage values that are used by the app.")}).passthrough();function ot(t,e){let r=Ar.safeParse(t);return r.success?r.data:dt(r.error.format(),e?[e]:[]).join(`
6
+ `)}function dt(t,e=[],r=""){t._errors?.length&&e.push(`${r} - ${t._errors.join(" + ")}`);for(let[a,n]of Object.entries(t))a==="_errors"||!n||typeof n!="object"||Array.isArray(n)||dt(n,e,r?`${r}.${a}`:a);return e}function De(t,e,r=".",a){if(!Me(e))return De(t,{},r,a);let n=Object.assign({},e);for(let i in t){if(i==="__proto__"||i==="constructor")continue;let s=t[i];s!=null&&(a&&a(n,i,s,r)||(Array.isArray(s)&&Array.isArray(n[i])?n[i]=[...s,...n[i]]:Me(s)&&Me(n[i])?n[i]=De(s,n[i],(r?`${r}.`:"")+i.toString(),a):n[i]=s))}return n}function Me(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Ue(t){return(...e)=>e.reduce((r,a)=>De(r,a,"",t),{})}var ut=Ue(),Na=Ue((t,e,r)=>{if(t[e]!==void 0&&typeof r=="function")return t[e]=r(t[e]),!0}),Ca=Ue((t,e,r)=>{if(Array.isArray(t[e])&&typeof r=="function")return t[e]=r(t[e]),!0});var Sr=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,jr=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Er=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Pr(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){Ir(t);return}return e}function Ir(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function ze(t,e={}){if(typeof t!="string")return t;let r=t.trim();if(t[0]==='"'&&t.at(-1)==='"'&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){let a=r.toLowerCase();if(a==="true")return!0;if(a==="false")return!1;if(a==="undefined")return;if(a==="null")return null;if(a==="nan")return Number.NaN;if(a==="infinity")return Number.POSITIVE_INFINITY;if(a==="-infinity")return Number.NEGATIVE_INFINITY}if(!Er.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(Sr.test(t)||jr.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,Pr)}return JSON.parse(t)}catch(a){if(e.strict)throw a;return t}}import{createServer as Rr}from"node:net";import{networkInterfaces as $r}from"node:os";var Lr=new Set([1,7,9,11,13,15,17,19,20,21,22,23,25,37,42,43,53,69,77,79,87,95,101,102,103,104,109,110,111,113,115,117,119,123,135,137,139,143,161,179,389,427,465,512,513,514,515,526,530,531,532,540,548,554,556,563,587,601,636,989,990,993,995,1719,1720,1723,2049,3659,4045,5060,5061,6e3,6566,6665,6666,6667,6668,6669,6697,10080]);function Mr(t){return Lr.has(t)}function Dr(t){return!Mr(t)}function Ur(t,e){t&&console.log(`[get-port] ${e}`)}function lt(t,e){return new Promise(r=>{let a=Rr();a.unref(),a.on("error",()=>{r(!1)}),a.listen({port:t,host:e},()=>{let{port:n}=a.address();a.close(()=>{r(Dr(n)&&n)})})})}function zr(t){let e=new Set(t);for(let r of Object.values($r()))for(let a of r||[])a.address&&!a.internal&&!a.address.startsWith("fe80::")&&e.add(a.address);return[...e]}function Fr(t){return t?`on host ${JSON.stringify(t)}`:"on any host"}async function Fe(t,e=process.env.HOST,r){if(e||(e=zr([void 0,"0.0.0.0"])),!Array.isArray(e))return lt(t,e);for(let a of e){let n=await lt(t,a);if(n===!1)return t<1024&&r&&Ur(r,`Unable to listen to the priviliged port ${t} ${Fr(a)}`),!1;t===0&&n!==0&&(t=n)}return t}import{existsSync as E,readFileSync as mt}from"node:fs";import{relative as Te,resolve as P}from"node:path";import{loadConfigFromFile as Vr}from"vite";var D=O("yellow"),ke=O("green"),ct=O("red"),pt=O("cyan"),ue=O("bold"),ht=O("underline"),Va=O("italic"),Wa=O("magentaBright"),gt={"arg.build.watch":"Whether the build should start watching and rebuild when files change or not.","arg.config":"The path to the app configuration file.","arg.debug":"Whether to output debug information or not.","arg.entries.app":"The entry file for the app.","arg.entries.manifest":"The entry file for the app manifest.","arg.jwt.app":"Token app name.","arg.jwt.expiration":"Token expiration time compatible with https://npmjs.com/package/ms.","arg.jwt.user.email":"Token user email.","arg.jwt.user.name":"Token user name.","arg.jwt.user.permission":"Token user permission(s).","arg.jwt.user.sub":"Token user object id.","arg.jwt.user.type":"Token user type.","arg.jwt.workspace":"Token workspace name.","arg.mode":"Which mode to use when building the app.","arg.public-key.clean":"Whether to exclude the -----BEGIN PUBLIC KEY----- prefix and -----END PUBLIC KEY----- suffix or not.","arg.public-key.type":"Type of public key.","arg.serve.logging":"Whether the server and browser console should output more log information or not.","arg.serve.open":"Whether the server should automatically open in your browser or not.","arg.serve.ports.gateway":"The port that the gateway should use.","arg.serve.ports.server":"The port that the server should use.","arg.upgrade.next":"Whether or not the CLI should include the 'next' tag when upgrading @telia-ace packages.","changes.upgraded":`Upgraded ${D("'{{pkg}}'")} to ${ke("'{{v}}'")}`,"command.build":"Builds an Alliance app.","command.jwt":"Creates an Alliance JWT.","command.public-key":"Creates a public key used to verify an Alliance JWT.","command.serve":"Starts the Alliance development server.","command.upgrade":"Upgrades Alliance app(s).","errors.invalid-manifest":"Invalid app manifest","errors.no-entry":"Could not find any app and/or manifest entry file at '{{app}}' or '{{manifest}}'","errors.npm-error":"Could not get upgrade information from NPM.","errors.port-busy":"Port {{busy}} is busy","info.gateway-url":`${ue("Gateway:")} ${ht(pt("{{url}}"))}`,"info.header.changes":"Changes","info.header.recommendations":"Recommendations","info.header.warnings":"Warnings","info.next-steps":"Next steps:","info.server-url":`${ue("Server:")} ${ht(pt("{{url}}"))}`,"info.steps.install":`Run ${D("'{{cmd}}'")} to install the changed package versions`,"info.steps.warnings":`Address the ${ct("warnings")} and ${D("recommendations")} detailed above`,"info.stop-server":ue("Press CTRL + C to stop the server."),"info.upgraded":`Upgraded ${D("'{{pkg}}'")} to ${ke("'{{v}}'")}`,"recommendations.upgrade":`Upgrade ${D("'{{pkg}}'")} to ${ke("'{{v}}'")}`,"warnings.change":`Change ${D("'{{property}}'")} from ${ct("'{{current}}'")} to ${ke("'{{new}}'")}`,"warnings.remove":`Remove ${D("'{{property}}'")}{{alt}}`},Ka=Object.keys(gt);function U(t,e={}){return Object.entries(e).reduce((r,[a,n])=>r.replaceAll(`{{${a}}}`,String(n)),gt[t]).trim()}var Ba={type:"string",description:U("arg.config"),required:!1,alias:"c",valueHint:"./alliance.config.ts"},qa={type:"boolean",description:U("arg.debug"),required:!1,default:!1,alias:"d"};function Ja({debug:t,input:e,output:r}){t&&(A.log(ue(Ne("cyan","Input:"))),console.log(JSON.stringify(e,null,2),`
7
+ `),A.log(ue(Ne("cyan","Output:")))),console.log(r,`
8
+ `)}var ft=["./src/app.ts","./src/app.js","./src/app.mts","./src/app.mjs","./src/app.cts","./src/app.cjs"],Wr=["alliance.config.js","alliance.config.mjs","alliance.config.ts","alliance.config.cjs","alliance.config.mts","alliance.config.cts","alliance.config.json"];async function Kr(t,e){let r;if(e?r=P(process.cwd(),e):r=qr(),r&&E(r)){if(r.endsWith(".json"))return ze(mt(r).toString());try{return(await Vr(t,r))?.config||{}}catch(a){A.error(a.message),process.exit(1)}}return{}}function Br(t){let e=P(process.cwd(),t.app);if(t.manifest=P(process.cwd(),t.manifest),!ft.includes(t.app))return t.app=e,t;for(let r of ft){let a=P(process.cwd(),r);if(E(a)){t.app=a;break}}return t}function qr(){let t=Wr.reduce((e,r)=>{if(e.length)return e;let a=P(process.cwd(),r);return E(a)?a:e},"");if(E(t))return t}async function Ha(t,e="",r={}){let a=ut(r,await Kr(t,e));!a.build?.mode&&(a.build?.watch||t.command==="serve")&&(a.build={...a.build,mode:"development"});let n=de.parse(a);return t.command==="serve"&&(await Fe(n.server.ports.server)||(A.error(U("errors.port-busy",{busy:n.server.ports.server})),process.exit(1)),await Fe(n.server.ports.gateway)||(A.error(U("errors.port-busy",{busy:n.server.ports.gateway})),process.exit(1))),{...n,entries:Br(n.entries)}}function Ya(t,e){let r={};if(E(e.entries.manifest)){let a=ze(mt(e.entries.manifest).toString()),n=ot(a,U("errors.invalid-manifest"));typeof n=="string"&&(A.error(n),process.exit(1)),r.ALLIANCE_APP_MANIFEST=n,r.ALLIANCE_APP_NAME=JSON.stringify(n.name)}return t==="build"&&(!E(e.entries.manifest)||!E(e.entries.app))&&(A.error(U("errors.no-entry",{app:Te(process.cwd(),P(e.entries.app)),manifest:Te(process.cwd(),P(e.entries.manifest))})),process.exit(1)),t==="serve"&&(r.ALLIANCE_ENVIRONMENT={logging:e.server.logging}),r}function Ga({entries:t,server:e}){let r=[];E(t.app)&&E(t.manifest)&&r.push({packageName:"entry",appImportPath:t.app,manifestImportPath:t.manifest});for(let a of e.apps)r.push({packageName:a,appImportPath:`${a}/app`,manifestImportPath:`${a}/manifest`});return r.length||(A.error(U("errors.no-entry",{app:Te(process.cwd(),P(t.app)),manifest:Te(process.cwd(),P(t.manifest))})),process.exit(1)),r}export{ze as a,D as b,ke as c,ct as d,pt as e,ue as f,ht as g,Ka as h,U as i,Ba as j,qa as k,Ja as l,Ha as m,Ya as n,Ga as o};
@@ -0,0 +1,25 @@
1
+ import { createRequire as c__createRequire } from 'node:module';
2
+ const require = c__createRequire(import.meta.url);
3
+ var FD=Object.create;var L=Object.defineProperty;var tD=Object.getOwnPropertyDescriptor;var eD=Object.getOwnPropertyNames;var rD=Object.getPrototypeOf,oD=Object.prototype.hasOwnProperty;var HD=(F=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(F,{get:(u,t)=>(typeof require<"u"?require:u)[t]}):F)(function(F){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+F+'" is not supported')});var KD=(F,u)=>()=>(F&&(u=F(F=0)),u);var JD=(F,u)=>()=>(u||F((u={exports:{}}).exports,u),u.exports),jD=(F,u)=>{for(var t in u)L(F,t,{get:u[t],enumerable:!0})},P=(F,u,t,r)=>{if(u&&typeof u=="object"||typeof u=="function")for(let e of eD(u))!oD.call(F,e)&&e!==t&&L(F,e,{get:()=>u[e],enumerable:!(r=tD(u,e))||r.enumerable});return F};var qD=(F,u,t)=>(t=F!=null?FD(rD(F)):{},P(u||!F||!F.__esModule?L(t,"default",{value:F,enumerable:!0}):t,F)),XD=F=>P(L({},"__esModule",{value:!0}),F);var C={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},k={silent:{level:-1},fatal:{level:C.fatal},error:{level:C.error},warn:{level:C.warn},log:{level:C.log},info:{level:C.info},success:{level:C.success},fail:{level:C.fail},ready:{level:C.info},start:{level:C.info},box:{level:C.info},debug:{level:C.debug},trace:{level:C.trace},verbose:{level:C.verbose}};function S(F){return F!==null&&typeof F=="object"}function w(F,u,t=".",r){if(!S(u))return w(F,{},t,r);let e=Object.assign({},u);for(let o in F){if(o==="__proto__"||o==="constructor")continue;let D=F[o];D!=null&&(r&&r(e,o,D,t)||(Array.isArray(D)&&Array.isArray(e[o])?e[o]=[...D,...e[o]]:S(D)&&S(e[o])?e[o]=w(D,e[o],(t?`${t}.`:"")+o.toString(),r):e[o]=D))}return e}function nD(F){return(...u)=>u.reduce((t,r)=>w(t,r,"",F),{})}var sD=nD();function CD(F){return Object.prototype.toString.call(F)==="[object Object]"}function ED(F){return!(!CD(F)||!F.message&&!F.args||F.stack)}var b=!1,U=[],E=class F{constructor(u={}){let t=u.types||k;this.options=sD({...u,defaults:{...u.defaults},level:R(u.level,t),reporters:[...u.reporters||[]]},{types:k,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let r in t){let e={type:r,...this.options.defaults,...t[r]};this[r]=this._wrapLogFn(e),this[r].raw=this._wrapLogFn(e,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(u){this.options.level=R(u,this.options.types,this.options.level)}prompt(u,t){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(u,t)}create(u){let t=new F({...this.options,...u});return this._mockFn&&t.mockTypes(this._mockFn),t}withDefaults(u){return this.create({...this.options,defaults:{...this.options.defaults,...u}})}withTag(u){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+u:u})}addReporter(u){return this.options.reporters.push(u),this}removeReporter(u){if(u){let t=this.options.reporters.indexOf(u);if(t>=0)return this.options.reporters.splice(t,1)}else this.options.reporters.splice(0);return this}setReporters(u){return this.options.reporters=Array.isArray(u)?u:[u],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let u in this.options.types)console["__"+u]||(console["__"+u]=console[u]),console[u]=this[u].raw}restoreConsole(){for(let u in this.options.types)console["__"+u]&&(console[u]=console["__"+u],delete console["__"+u])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(u,t){u&&(u.__write||(u.__write=u.write),u.write=r=>{this[t].raw(String(r).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(u){u&&u.__write&&(u.write=u.__write,delete u.__write)}pauseLogs(){b=!0}resumeLogs(){b=!1;let u=U.splice(0);for(let t of u)t[0]._logFn(t[1],t[2])}mockTypes(u){let t=u||this.options.mockFn;if(this._mockFn=t,typeof t=="function")for(let r in this.options.types)this[r]=t(r,this.options.types[r])||this[r],this[r].raw=this[r]}_wrapLogFn(u,t){return(...r)=>{if(b){U.push([this,u,r,t]);return}return this._logFn(u,r,t)}}_logFn(u,t,r){if((u.level||0)>this.level)return!1;let e={date:new Date,args:[],...u,level:R(u.level,this.options.types)};!r&&t.length===1&&ED(t[0])?Object.assign(e,t[0]):e.args=[...t],e.message&&(e.args.unshift(e.message),delete e.message),e.additional&&(Array.isArray(e.additional)||(e.additional=e.additional.split(`
4
+ `)),e.args.push(`
5
+ `+e.additional.join(`
6
+ `)),delete e.additional),e.type=typeof e.type=="string"?e.type.toLowerCase():"log",e.tag=typeof e.tag=="string"?e.tag:"";let o=(s=!1)=>{let x=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&x>0){let l=[...this._lastLog.object.args];x>1&&l.push(`(repeated ${x} times)`),this._log({...this._lastLog.object,args:l}),this._lastLog.count=1}s&&(this._lastLog.object=e,this._log(e))};clearTimeout(this._lastLog.timeout);let D=this._lastLog.time&&e.date?e.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=e.date,D<this.options.throttle)try{let s=JSON.stringify([e.type,e.tag,e.args]),x=this._lastLog.serialized===s;if(this._lastLog.serialized=s,x&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(o,this.options.throttle);return}}catch{}o(!0)}_log(u){for(let t of this.options.reporters)t.log(u,{options:this.options})}};function R(F,u={},t=3){return F===void 0?t:typeof F=="number"?F:u[F]&&u[F].level!==void 0?u[F].level:t}E.prototype.add=E.prototype.addReporter;E.prototype.remove=E.prototype.removeReporter;E.prototype.clear=E.prototype.removeReporter;E.prototype.withScope=E.prototype.withTag;E.prototype.mock=E.prototype.mockTypes;E.prototype.pause=E.prototype.pauseLogs;E.prototype.resume=E.prototype.resumeLogs;function W(F={}){return new E(F)}import{formatWithOptions as iD}from"node:util";import{sep as xD}from"node:path";function O(F){let u=process.cwd()+xD;return F.split(`
7
+ `).splice(1).map(r=>r.trim().replace("file://","").replace(u,""))}function aD(F,u){return(u.__write||u.write).call(u,F)}var N=F=>F?`[${F}]`:"",m=class{formatStack(u,t){return" "+O(u).join(`
8
+ `)}formatArgs(u,t){let r=u.map(e=>e&&typeof e.stack=="string"?e.message+`
9
+ `+this.formatStack(e.stack,t):e);return iD(t,...r)}formatDate(u,t){return t.date?u.toLocaleTimeString():""}filterAndJoin(u){return u.filter(Boolean).join(" ")}formatLogObj(u,t){let r=this.formatArgs(u.args,t);return u.type==="box"?`
10
+ `+[N(u.tag),u.title&&u.title,...r.split(`
11
+ `)].filter(Boolean).map(e=>" > "+e).join(`
12
+ `)+`
13
+ `:this.filterAndJoin([N(u.type),N(u.tag),r])}log(u,t){let r=this.formatLogObj(u,{columns:t.options.stdout.columns||0,...t.options.formatOptions});return aD(r+`
14
+ `,u.level<2?t.options.stderr||process.stderr:t.options.stdout||process.stdout)}};import*as v from"node:tty";var{env:h={},argv:V=[],platform:lD=""}=typeof process>"u"?{}:process,BD="NO_COLOR"in h||V.includes("--no-color"),cD="FORCE_COLOR"in h||V.includes("--color"),AD=lD==="win32",z=h.TERM==="dumb",fD=v&&v.isatty&&v.isatty(1)&&h.TERM&&!z,pD="CI"in h&&("GITHUB_ACTIONS"in h||"GITLAB_CI"in h||"CIRCLECI"in h),hD=!BD&&(cD||AD&&!z||fD||pD);function Z(F,u,t,r,e=u.slice(0,Math.max(0,F))+r,o=u.slice(Math.max(0,F+t.length)),D=o.indexOf(t)){return e+(D<0?o:Z(D,o,t,r))}function gD(F,u,t,r,e){return F<0?t+u+r:t+Z(F,u,r,e)+r}function dD(F,u,t=F,r=F.length+1){return e=>e||!(e===""||e===void 0)?gD((""+e).indexOf(u,r),e,F,u,t):""}function n(F,u,t){return dD(`\x1B[${F}m`,`\x1B[${u}m`,t)}var G={reset:n(0,0),bold:n(1,22,"\x1B[22m\x1B[1m"),dim:n(2,22,"\x1B[22m\x1B[2m"),italic:n(3,23),underline:n(4,24),inverse:n(7,27),hidden:n(8,28),strikethrough:n(9,29),black:n(30,39),red:n(31,39),green:n(32,39),yellow:n(33,39),blue:n(34,39),magenta:n(35,39),cyan:n(36,39),white:n(37,39),gray:n(90,39),bgBlack:n(40,49),bgRed:n(41,49),bgGreen:n(42,49),bgYellow:n(43,49),bgBlue:n(44,49),bgMagenta:n(45,49),bgCyan:n(46,49),bgWhite:n(47,49),blackBright:n(90,39),redBright:n(91,39),greenBright:n(92,39),yellowBright:n(93,39),blueBright:n(94,39),magentaBright:n(95,39),cyanBright:n(96,39),whiteBright:n(97,39),bgBlackBright:n(100,49),bgRedBright:n(101,49),bgGreenBright:n(102,49),bgYellowBright:n(103,49),bgBlueBright:n(104,49),bgMagentaBright:n(105,49),bgCyanBright:n(106,49),bgWhiteBright:n(107,49)};function mD(F=hD){return F?G:Object.fromEntries(Object.keys(G).map(u=>[u,String]))}var a=mD();function H(F,u="reset"){return a[F]||a[u]}function eu(F,u){return H(F)(u)}var _D=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");function d(F){return F.replace(new RegExp(_D,"g"),"")}var Y={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},yD={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function K(F,u={}){let t={...u,style:{...yD,...u.style}},r=F.split(`
15
+ `),e=[],o=H(t.style.borderColor),D={...typeof t.style.borderStyle=="string"?Y[t.style.borderStyle]||Y.solid:t.style.borderStyle};if(o)for(let i in D)D[i]=o(D[i]);let s=t.style.padding%2===0?t.style.padding:t.style.padding+1,x=r.length+s,l=Math.max(...r.map(i=>i.length))+s,c=l+s,B=t.style.marginLeft>0?" ".repeat(t.style.marginLeft):"";if(t.style.marginTop>0&&e.push("".repeat(t.style.marginTop)),t.title){let i=D.h.repeat(Math.floor((l-d(t.title).length)/2)),g=D.h.repeat(l-d(t.title).length-d(i).length+s);e.push(`${B}${D.tl}${i}${t.title}${g}${D.tr}`)}else e.push(`${B}${D.tl}${D.h.repeat(c)}${D.tr}`);let p=t.style.valign==="center"?Math.floor((x-r.length)/2):t.style.valign==="top"?x-r.length-s:x-r.length;for(let i=0;i<x;i++)if(i<p||i>=p+r.length)e.push(`${B}${D.v}${" ".repeat(c)}${D.v}`);else{let g=r[i-p],DD=" ".repeat(s),uD=" ".repeat(l-d(g).length);e.push(`${B}${D.v}${DD}${g}${uD}${D.v}`)}return e.push(`${B}${D.bl}${D.h.repeat(c)}${D.br}`),t.style.marginBottom>0&&e.push("".repeat(t.style.marginBottom)),e.join(`
16
+ `)}import A from"node:process";var LD=[["APPVEYOR"],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"]];function vD(F){for(let u of LD){let t=u[1]||u[0];if(F[t])return{name:u[0].toLowerCase(),...u[2]}}return F.SHELL&&F.SHELL==="/bin/jsh"?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var T=typeof process<"u"?process:{},_=T.env||{},q=vD(_),ID=typeof process<"u"&&process.env&&process.env.NODE_ENV||"";T.platform;q.name;var X=y(_.CI)||q.ci!==!1,TD=y(T.stdout&&T.stdout.isTTY),SD=y(_.DEBUG),$=ID==="test"||y(_.TEST);y(_.MINIMAL);function y(F){return F?F!=="false":!1}function bD({onlyFirst:F=!1}={}){let u=["[\\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(u,F?void 0:"g")}var RD=bD();function wD(F){if(typeof F!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof F}\``);return F.replace(RD,"")}function ND(F){return F&&F.__esModule&&Object.prototype.hasOwnProperty.call(F,"default")?F.default:F}var Q={exports:{}};(function(F){var u={};F.exports=u,u.eastAsianWidth=function(r){var e=r.charCodeAt(0),o=r.length==2?r.charCodeAt(1):0,D=e;return 55296<=e&&e<=56319&&56320<=o&&o<=57343&&(e&=1023,o&=1023,D=e<<10|o,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"},u.characterLength=function(r){var e=this.eastAsianWidth(r);return e=="F"||e=="W"||e=="A"?2:1};function t(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(r){for(var e=t(r),o=0,D=0;D<e.length;D++)o=o+this.characterLength(e[D]);return o},u.slice=function(r,e,o){textLen=u.length(r),e=e||0,o=o||1,e<0&&(e=textLen+e),o<0&&(o=textLen+o);for(var D="",s=0,x=t(r),l=0;l<x.length;l++){var c=x[l],B=u.length(c);if(s>=e-(B==2?1:0))if(s+B<=o)D+=c;else break;s+=B}return D}})(Q);var OD=Q.exports,MD=ND(OD),$D=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\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]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function PD(F,u){if(typeof F!="string"||F.length===0||(u={ambiguousIsNarrow:!0,countAnsiEscapeCodes:!1,...u},u.countAnsiEscapeCodes||(F=wD(F)),F.length===0))return 0;let t=u.ambiguousIsNarrow?1:2,r=0;for(let{segment:e}of new Intl.Segmenter().segment(F)){let o=e.codePointAt(0);if(o<=31||o>=127&&o<=159||o>=768&&o<=879)continue;if($D().test(e)){r+=2;continue}switch(MD.eastAsianWidth(e)){case"F":case"W":{r+=2;break}case"A":{r+=t;break}default:r+=1}}return r}function kD(){return A.platform!=="win32"?A.env.TERM!=="linux":!!A.env.CI||!!A.env.WT_SESSION||!!A.env.TERMINUS_SUBLIME||A.env.ConEmuTask==="{cmd::Cmder}"||A.env.TERM_PROGRAM==="Terminus-Sublime"||A.env.TERM_PROGRAM==="vscode"||A.env.TERM==="xterm-256color"||A.env.TERM==="alacritty"||A.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var UD={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},WD={0:"red",1:"yellow"},GD=kD(),f=(F,u)=>GD?F:u,J={error:f("\u2716","\xD7"),fatal:f("\u2716","\xD7"),ready:f("\u2714","\u221A"),warn:f("\u26A0","\u203C"),info:f("\u2139","i"),success:f("\u2714","\u221A"),debug:f("\u2699","D"),trace:f("\u2192","\u2192"),fail:f("\u2716","\xD7"),start:f("\u25D0","o"),log:""};function j(F){return Intl.Segmenter?PD(F):d(F).length}var M=class extends m{formatStack(u){return`
17
+ `+O(u).map(t=>" "+t.replace(/^at +/,r=>a.gray(r)).replace(/\((.+)\)/,(r,e)=>`(${a.cyan(e)})`)).join(`
18
+ `)}formatType(u,t,r){let e=UD[u.type]||WD[u.level]||"gray";if(t)return VD(e)(a.black(` ${u.type.toUpperCase()} `));let o=typeof J[u.type]=="string"?J[u.type]:u.icon||u.type;return o?YD(e)(o):""}formatLogObj(u,t){let[r,...e]=this.formatArgs(u.args,t).split(`
19
+ `);if(u.type==="box")return K(I(r+(e.length>0?`
20
+ `+e.join(`
21
+ `):"")),{title:u.title?I(u.title):void 0,style:u.style});let o=this.formatDate(u.date,t),D=o&&a.gray(o),s=u.badge??u.level<2,x=this.formatType(u,s,t),l=u.tag?a.gray(u.tag):"",c,B=this.filterAndJoin([x,I(r)]),p=this.filterAndJoin(t.columns?[l,D]:[l]),i=(t.columns||0)-j(B)-j(p)-2;if(c=i>0&&(t.columns||0)>=80?B+" ".repeat(i)+p:(p?`${a.gray(`[${p}]`)} `:"")+B,c+=I(e.length>0?`
22
+ `+e.join(`
23
+ `):""),u.type==="trace"){let g=new Error("Trace: "+u.message);c+=this.formatStack(g.stack||"")}return s?`
24
+ `+c+`
25
+ `:c}};function I(F){return F.replace(/`([^`]+)`/gm,(u,t)=>a.cyan(t)).replace(/\s+_([^_]+)_\s+/gm,(u,t)=>` ${a.underline(t)} `)}function YD(F="white"){return a[F]||a.white}function VD(F="bgWhite"){return a[`bg${F[0].toUpperCase()}${F.slice(1)}`]||a.bgWhite}function zD(F={}){let u=ZD();return process.env.CONSOLA_LEVEL&&(u=Number.parseInt(process.env.CONSOLA_LEVEL)??u),W({level:u,defaults:{level:u},stdout:process.stdout,stderr:process.stderr,prompt:(...r)=>import("./prompt-KMUWEOPT.js").then(e=>e.prompt(...r)),reporters:F.reporters||[F.fancy??!(X||$)?new M:new m],...F})}function ZD(){return SD?C.debug:$?C.warn:C.info}var Eu=zD();export{HD as a,KD as b,JD as c,jD as d,qD as e,XD as f,a as g,H as h,eu as i,ND as j,kD as k,Eu as l};
@@ -0,0 +1,7 @@
1
+ import { createRequire as c__createRequire } from 'node:module';
2
+ const require = c__createRequire(import.meta.url);
3
+ import{g as p,l as g}from"./chunk-AEIX73UA.js";function j(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function C(e,n=""){let t=[];for(let r of e)for(let[a,o]of r.entries())t[a]=Math.max(t[a]||0,o.length);return e.map(r=>r.map((a,o)=>n+a[o===0?"padStart":"padEnd"](t[o])).join(" ")).join(`
4
+ `)}function m(e){return typeof e=="function"?e():e}var w=class extends Error{constructor(n,t){super(n),this.code=t,this.name="CLIError"}},S=/\d/,E=["-","_","/","."];function L(e=""){if(!S.test(e))return e.toUpperCase()===e}function v(e,n){let t=n??E,r=[];if(!e||typeof e!="string")return r;let a="",o,l;for(let i of e){let s=t.includes(i);if(s===!0){r.push(a),a="",o=void 0;continue}let u=L(i);if(l===!1){if(o===!1&&u===!0){r.push(a),a=i,o=u;continue}if(o===!0&&u===!1&&a.length>1){let c=a[a.length-1];r.push(a.slice(0,Math.max(0,a.length-1))),a=c+i,o=u;continue}}a+=i,o=u,l=s}return r.push(a),r}function R(e){return e?e[0].toUpperCase()+e.slice(1):""}function k(e){return e?e[0].toLowerCase()+e.slice(1):""}function q(e){return e?(Array.isArray(e)?e:v(e)).map(n=>R(n)).join(""):""}function I(e){return k(q(e))}function T(e,n){return e?(Array.isArray(e)?e:v(e)).map(t=>t.toLowerCase()).join(n??"-"):""}function x(e){return e==null?[]:Array.isArray(e)?e:[e]}function P(e,n,t,r){let a,o=e[n],l=~r.string.indexOf(n)?t==null||t===!0?"":String(t):typeof t=="boolean"?t:~r.boolean.indexOf(n)?t==="false"?!1:t==="true"||(e._.push((a=+t,a*0===0?a:t)),!!t):(a=+t,a*0===0?a:t);e[n]=o==null?l:Array.isArray(o)?o.concat(l):[o,l]}function H(e=[],n={}){let t,r,a,o,l,i={_:[]},s=0,u=0,c=0,A=e.length,y=n.alias!==void 0,f=n.unknown!==void 0,d=n.default!==void 0;if(n.alias=n.alias||{},n.string=x(n.string),n.boolean=x(n.boolean),y)for(t in n.alias)for(r=n.alias[t]=x(n.alias[t]),s=0;s<r.length;s++)(n.alias[r[s]]=r.concat(t)).splice(s,1);for(s=n.boolean.length;s-- >0;)for(r=n.alias[n.boolean[s]]||[],u=r.length;u-- >0;)n.boolean.push(r[u]);for(s=n.string.length;s-- >0;)for(r=n.alias[n.string[s]]||[],u=r.length;u-- >0;)n.string.push(r[u]);if(d){for(t in n.default)if(o=typeof n.default[t],r=n.alias[t]=n.alias[t]||[],n[o]!==void 0)for(n[o].push(t),s=0;s<r.length;s++)n[o].push(r[s])}let h=f?Object.keys(n.alias):[];for(s=0;s<A;s++){if(a=e[s],a==="--"){i._=i._.concat(e.slice(++s));break}for(u=0;u<a.length&&a.charCodeAt(u)===45;u++);if(u===0)i._.push(a);else if(a.substring(u,u+3)==="no-"){if(o=a.slice(Math.max(0,u+3)),f&&!~h.indexOf(o))return n.unknown(a);i[o]=!1}else{for(c=u+1;c<a.length&&a.charCodeAt(c)!==61;c++);for(o=a.substring(u,c),l=a.slice(Math.max(0,++c))||s+1===A||(""+e[s+1]).charCodeAt(0)===45||e[++s],r=u===2?[o]:o,c=0;c<r.length;c++){if(o=r[c],f&&!~h.indexOf(o))return n.unknown("-".repeat(u)+o);P(i,o,c+1<r.length||l,n)}}}if(d)for(t in n.default)i[t]===void 0&&(i[t]=n.default[t]);if(y)for(t in i)for(r=n.alias[t]||[];r.length>0;)i[r.shift()]=i[t];return i}function D(e,n){let t={boolean:[],string:[],mixed:[],alias:{},default:{}},r=O(n);for(let i of r)i.type!=="positional"&&(i.type==="string"?t.string.push(i.name):i.type==="boolean"&&t.boolean.push(i.name),i.default!==void 0&&(t.default[i.name]=i.default),i.alias&&(t.alias[i.name]=i.alias));let a=H(e,t),[...o]=a._,l=new Proxy(a,{get(i,s){return i[s]??i[I(s)]??i[T(s)]}});for(let[,i]of r.entries())if(i.type==="positional"){let s=o.shift();if(s!==void 0)l[i.name]=s;else{if(i.default===void 0&&i.required!==!1)throw new w(`Missing required positional argument: ${i.name.toUpperCase()}`,"EARG");l[i.name]=i.default}}else if(i.required&&l[i.name]===void 0)throw new w(`Missing required argument: --${i.name}`,"EARG");return l}function O(e){let n=[];for(let[t,r]of Object.entries(e||{}))n.push({...r,name:t,alias:j(r.alias)});return n}async function N(e,n){let t=await m(e.args||{}),r=D(n.rawArgs,t),a={rawArgs:n.rawArgs,args:r,data:n.data,cmd:e};typeof e.setup=="function"&&await e.setup(a);let o;try{let l=await m(e.subCommands);if(l&&Object.keys(l).length>0){let i=n.rawArgs.findIndex(u=>!u.startsWith("-")),s=n.rawArgs[i];if(s){if(!l[s])throw new w(`Unknown command \`${s}\``,"E_UNKNOWN_COMMAND");let u=await m(l[s]);u&&await N(u,{rawArgs:n.rawArgs.slice(i+1)})}else if(!e.run)throw new w("No command specified.","E_NO_COMMAND")}typeof e.run=="function"&&(o=await e.run(a))}finally{typeof e.cleanup=="function"&&await e.cleanup(a)}return{result:o}}async function $(e,n,t){let r=await m(e.subCommands);if(r&&Object.keys(r).length>0){let a=n.findIndex(i=>!i.startsWith("-")),o=n[a],l=await m(r[o]);if(l)return $(l,n.slice(a+1),e)}return[e,t]}async function G(e,n){try{g.log(await _(e,n)+`
5
+ `)}catch(t){g.error(t)}}async function _(e,n){let t=await m(e.meta||{}),r=O(await m(e.args||{})),a=await m(n?.meta||{}),o=`${a.name?`${a.name} `:""}`+(t.name||process.argv[1]),l=[],i=[],s=[],u=[];for(let f of r)if(f.type==="positional"){let d=f.name.toUpperCase(),h=f.required!==!1&&f.default===void 0,b=f.default?`="${f.default}"`:"";i.push(["`"+d+b+"`",f.description||""]),u.push(h?`<${d}>`:`[${d}]`)}else{let d=f.required===!0&&f.default===void 0,h=(f.type==="boolean"&&f.default===!0?[...(f.alias||[]).map(b=>`--no-${b}`),`--no-${f.name}`].join(", "):[...(f.alias||[]).map(b=>`-${b}`),`--${f.name}`].join(", "))+(f.type==="string"&&(f.valueHint||f.default)?`=${f.valueHint?`<${f.valueHint}>`:`"${f.default||""}"`}`:"");l.push(["`"+h+(d?" (required)":"")+"`",f.description||""]),d&&u.push(h)}if(e.subCommands){let f=[],d=await m(e.subCommands);for(let[h,b]of Object.entries(d)){let M=await m(b),U=await m(M?.meta);s.push([`\`${h}\``,U?.description||""]),f.push(h)}u.push(f.join("|"))}let c=[],A=t.version||a.version;c.push(p.gray(`${t.description} (${o+(A?` v${A}`:"")})`),"");let y=l.length>0||i.length>0;return c.push(`${p.underline(p.bold("USAGE"))} \`${o}${y?" [OPTIONS]":""} ${u.join(" ")}\``,""),i.length>0&&(c.push(p.underline(p.bold("ARGUMENTS")),""),c.push(C(i," ")),c.push("")),l.length>0&&(c.push(p.underline(p.bold("OPTIONS")),""),c.push(C(l," ")),c.push("")),s.length>0&&(c.push(p.underline(p.bold("COMMANDS")),""),c.push(C(s," ")),c.push("",`Use \`${o} <command> --help\` for more information about a command.`)),c.filter(f=>typeof f=="string").join(`
6
+ `)}async function ee(e,n={}){let t=n.rawArgs||process.argv.slice(2),r=n.showUsage||G;try{if(t.includes("--help")||t.includes("-h"))await r(...await $(e,t)),process.exit(0);else if(t.length===1&&t[0]==="--version"){let a=typeof e.meta=="function"?await e.meta():await e.meta;if(!a?.version)throw new w("No version specified","E_NO_VERSION");g.log(a.version)}else await N(e,{rawArgs:t})}catch(a){let o=a instanceof w;o||g.error(a,`
7
+ `),o&&await r(...await $(e,t)),g.error(a.message),process.exit(1)}}export{ee as a};
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as c__createRequire } from 'node:module';
3
+ const require = c__createRequire(import.meta.url);
4
+ import{a}from"./chunk-TTCH5DKE.js";import{i,l as n}from"./chunk-AEIX73UA.js";var l="@telia-ace/alliance-cli",o="1.1.0-next.1",s="CLI used when developing ACE Alliance apps.";try{await a({meta:{name:l,version:o,description:s},subCommands:{build:()=>import("./build-VK4VKE7N.js").then(e=>e.default),serve:()=>import("./serve-3GDWXOJ2.js").then(e=>e.default),jwt:()=>import("./jwt-GLW2HN4D.js").then(e=>e.default),"public-key":()=>import("./public-key-XJHOSPD7.js").then(e=>e.default),upgrade:()=>import("./upgrade-NCZOCD4D.js").then(e=>e.default)}})}catch(e){n.error(i("bold",i("red","Error:")),i("bold",e?.message||"something went wrong"))}
@@ -0,0 +1,3 @@
1
+ import { createRequire as c__createRequire } from 'node:module';
2
+ const require = c__createRequire(import.meta.url);
3
+ import{i as r,k as p,l as a}from"./chunk-2QT2TRN4.js";import"./chunk-TTCH5DKE.js";import"./chunk-AEIX73UA.js";import{createBearerToken as o,getPrivateKey as u,slugify as m,zSharedConfig as d}from"@telia-ace/alliance-internal-node-utilities";var c={meta:{name:"jwt",description:r("command.jwt")},args:{app:{type:"string",description:r("arg.jwt.app"),required:!1,alias:"a",default:"the-app"},workspace:{type:"string",description:r("arg.jwt.workspace"),required:!1,alias:"w",default:"The Workspace"},expiration:{type:"string",description:r("arg.jwt.expiration"),required:!1,alias:"e",default:"1d"},"user.name":{type:"string",description:r("arg.jwt.user.name"),required:!1,default:"John Doe"},"user.type":{type:"string",description:r("arg.jwt.user.type"),required:!1,default:"user",valueHint:"user|system-admin|system"},"user.email":{type:"string",description:r("arg.jwt.user.email"),required:!1,default:"john.doe@mail.com"},"user.permission":{type:"string",description:r("arg.jwt.user.permission"),required:!1,alias:"p"},"user.sub":{type:"string",description:r("arg.jwt.user.sub"),required:!1,alias:"s",default:"2ccaa1b2-5e34-4dd7-bb47-28435e973969"},debug:p},run({args:e}){console.log(e);let i=[];if(Array.isArray(e["user.permission"]))for(let t of e["user.permission"])typeof t=="string"&&i.push(t);else typeof e["user.permission"]=="string"&&i.push(e["user.permission"]);let s={user:{name:e["user.name"],email:e["user.email"],permissions:i,sub:e["user.sub"],type:e["user.type"]},app:e.app,workspace:{name:e.workspace,slug:m(e.workspace)},expiration:e.expiration},n=o({...s,aud:s.app,name:s.user.name,sub:s.user.sub,privateKey:u(d.pick({JWT_PRIVATE_KEY:!0}).parse({}))});a({debug:e.debug,input:s,output:n})}};export{c as default};
@@ -0,0 +1,47 @@
1
+ import { createRequire as c__createRequire } from 'node:module';
2
+ const require = c__createRequire(import.meta.url);
3
+ import{g as i,j as K,k as P}from"./chunk-AEIX73UA.js";import{stdin as FD,stdout as rD}from"node:process";import z from"node:readline";import{WriteStream as iD}from"node:tty";import sD from"tty";var _="\x1B",a=`${_}[`,CD="\x07",k={to(t,u){return u?`${a}${u+1};${t+1}H`:`${a}${t+1}G`},move(t,u){let e="";return t<0?e+=`${a}${-t}D`:t>0&&(e+=`${a}${t}C`),u<0?e+=`${a}${-u}A`:u>0&&(e+=`${a}${u}B`),e},up:(t=1)=>`${a}${t}A`,down:(t=1)=>`${a}${t}B`,forward:(t=1)=>`${a}${t}C`,backward:(t=1)=>`${a}${t}D`,nextLine:(t=1)=>`${a}E`.repeat(t),prevLine:(t=1)=>`${a}F`.repeat(t),left:`${a}G`,hide:`${a}?25l`,show:`${a}?25h`,save:`${_}7`,restore:`${_}8`},nD={up:(t=1)=>`${a}S`.repeat(t),down:(t=1)=>`${a}T`.repeat(t)},ED={screen:`${a}2J`,up:(t=1)=>`${a}1J`.repeat(t),down:(t=1)=>`${a}J`.repeat(t),line:`${a}2K`,lineEnd:`${a}K`,lineStart:`${a}1K`,lines(t){let u="";for(let e=0;e<t;e++)u+=this.line+(e<t-1?k.up():"");return t&&(u+=k.left),u}},A={cursor:k,scroll:nD,erase:ED,beep:CD},I={exports:{}},oD=sD,aD=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||oD.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),E=(t,u,e=t)=>F=>{let r=""+F,s=r.indexOf(u,t.length);return~s?t+Q(r,u,e,s)+u:t+r+u},Q=(t,u,e,F)=>{let r=t.substring(0,F)+e,s=t.substring(F+u.length),D=s.indexOf(u);return~D?r+Q(s,u,e,D):r+s},DD=(t=aD)=>({isColorSupported:t,reset:t?u=>`\x1B[0m${u}\x1B[0m`:String,bold:t?E("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?E("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?E("\x1B[3m","\x1B[23m"):String,underline:t?E("\x1B[4m","\x1B[24m"):String,inverse:t?E("\x1B[7m","\x1B[27m"):String,hidden:t?E("\x1B[8m","\x1B[28m"):String,strikethrough:t?E("\x1B[9m","\x1B[29m"):String,black:t?E("\x1B[30m","\x1B[39m"):String,red:t?E("\x1B[31m","\x1B[39m"):String,green:t?E("\x1B[32m","\x1B[39m"):String,yellow:t?E("\x1B[33m","\x1B[39m"):String,blue:t?E("\x1B[34m","\x1B[39m"):String,magenta:t?E("\x1B[35m","\x1B[39m"):String,cyan:t?E("\x1B[36m","\x1B[39m"):String,white:t?E("\x1B[37m","\x1B[39m"):String,gray:t?E("\x1B[90m","\x1B[39m"):String,bgBlack:t?E("\x1B[40m","\x1B[49m"):String,bgRed:t?E("\x1B[41m","\x1B[49m"):String,bgGreen:t?E("\x1B[42m","\x1B[49m"):String,bgYellow:t?E("\x1B[43m","\x1B[49m"):String,bgBlue:t?E("\x1B[44m","\x1B[49m"):String,bgMagenta:t?E("\x1B[45m","\x1B[49m"):String,bgCyan:t?E("\x1B[46m","\x1B[49m"):String,bgWhite:t?E("\x1B[47m","\x1B[49m"):String});I.exports=DD();I.exports.createColors=DD;var cD=I.exports,w=K(cD);function lD({onlyFirst:t=!1}={}){let u=["[\\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(u,t?void 0:"g")}function uD(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(lD(),"")}var T={},hD={get exports(){return T},set exports(t){T=t}};(function(t){var u={};t.exports=u,u.eastAsianWidth=function(F){var r=F.charCodeAt(0),s=F.length==2?F.charCodeAt(1):0,D=r;return 55296<=r&&r<=56319&&56320<=s&&s<=57343&&(r&=1023,s&=1023,D=r<<10|s,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"},u.characterLength=function(F){var r=this.eastAsianWidth(F);return r=="F"||r=="W"||r=="A"?2:1};function e(F){return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(F){for(var r=e(F),s=0,D=0;D<r.length;D++)s=s+this.characterLength(r[D]);return s},u.slice=function(F,r,s){textLen=u.length(F),r=r||0,s=s||1,r<0&&(r=textLen+r),s<0&&(s=textLen+s);for(var D="",C=0,h=e(F),c=0;c<h.length;c++){var B=h[c],l=u.length(B);if(C>=r-(l==2?1:0))if(C+l<=s)D+=B;else break;C+=l}return D}})(hD);var BD=T,AD=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};function $(t,u={}){if(typeof t!="string"||t.length===0||(u={ambiguousIsNarrow:!0,...u},t=uD(t),t.length===0))return 0;t=t.replace(AD()," ");let e=u.ambiguousIsNarrow?1:2,F=0;for(let r of t){let s=r.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(BD.eastAsianWidth(r)){case"F":case"W":F+=2;break;case"A":F+=e;break;default:F+=1}}return F}var y=10,q=(t=0)=>u=>`\x1B[${u+t}m`,G=(t=0)=>u=>`\x1B[${38+t};5;${u}m`,H=(t=0)=>(u,e,F)=>`\x1B[${38+t};2;${u};${e};${F}m`,o={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(o.modifier);var mD=Object.keys(o.color),gD=Object.keys(o.bgColor);[...mD,...gD];function pD(){let t=new Map;for(let[u,e]of Object.entries(o)){for(let[F,r]of Object.entries(e))o[F]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},e[F]=o[F],t.set(r[0],r[1]);Object.defineProperty(o,u,{value:e,enumerable:!1})}return Object.defineProperty(o,"codes",{value:t,enumerable:!1}),o.color.close="\x1B[39m",o.bgColor.close="\x1B[49m",o.color.ansi=q(),o.color.ansi256=G(),o.color.ansi16m=H(),o.bgColor.ansi=q(y),o.bgColor.ansi256=G(y),o.bgColor.ansi16m=H(y),Object.defineProperties(o,{rgbToAnsi256:{value:(u,e,F)=>u===e&&e===F?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(e/255*5)+Math.round(F/255*5),enumerable:!1},hexToRgb:{value:u=>{let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!e)return[0,0,0];let[F]=e;F.length===3&&(F=[...F].map(s=>s+s).join(""));let r=Number.parseInt(F,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:u=>o.rgbToAnsi256(...o.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let e,F,r;if(u>=232)e=((u-232)*10+8)/255,F=e,r=e;else{u-=16;let C=u%36;e=Math.floor(u/36)/5,F=Math.floor(C/6)/5,r=C%6/5}let s=Math.max(e,F,r)*2;if(s===0)return 30;let D=30+(Math.round(r)<<2|Math.round(F)<<1|Math.round(e));return s===2&&(D+=60),D},enumerable:!1},rgbToAnsi:{value:(u,e,F)=>o.ansi256ToAnsi(o.rgbToAnsi256(u,e,F)),enumerable:!1},hexToAnsi:{value:u=>o.ansi256ToAnsi(o.hexToAnsi256(u)),enumerable:!1}}),o}var dD=pD(),f=new Set(["\x1B","\x9B"]),$D=39,L="\x07",tD="[",bD="]",eD="m",N=`${bD}8;;`,Y=t=>`${f.values().next().value}${tD}${t}${eD}`,Z=t=>`${f.values().next().value}${N}${t}${L}`,vD=t=>t.split(" ").map(u=>$(u)),S=(t,u,e)=>{let F=[...u],r=!1,s=!1,D=$(uD(t[t.length-1]));for(let[C,h]of F.entries()){let c=$(h);if(D+c<=e?t[t.length-1]+=h:(t.push(h),D=0),f.has(h)&&(r=!0,s=F.slice(C+1).join("").startsWith(N)),r){s?h===L&&(r=!1,s=!1):h===eD&&(r=!1);continue}D+=c,D===e&&C<F.length-1&&(t.push(""),D=0)}!D&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},fD=t=>{let u=t.split(" "),e=u.length;for(;e>0&&!($(u[e-1])>0);)e--;return e===u.length?t:u.slice(0,e).join(" ")+u.slice(e).join("")},xD=(t,u,e={})=>{if(e.trim!==!1&&t.trim()==="")return"";let F="",r,s,D=vD(t),C=[""];for(let[c,B]of t.split(" ").entries()){e.trim!==!1&&(C[C.length-1]=C[C.length-1].trimStart());let l=$(C[C.length-1]);if(c!==0&&(l>=u&&(e.wordWrap===!1||e.trim===!1)&&(C.push(""),l=0),(l>0||e.trim===!1)&&(C[C.length-1]+=" ",l++)),e.hard&&D[c]>u){let g=u-l,b=1+Math.floor((D[c]-g-1)/u);Math.floor((D[c]-1)/u)<b&&C.push(""),S(C,B,u);continue}if(l+D[c]>u&&l>0&&D[c]>0){if(e.wordWrap===!1&&l<u){S(C,B,u);continue}C.push("")}if(l+D[c]>u&&e.wordWrap===!1){S(C,B,u);continue}C[C.length-1]+=B}e.trim!==!1&&(C=C.map(c=>fD(c)));let h=[...C.join(`
4
+ `)];for(let[c,B]of h.entries()){if(F+=B,f.has(B)){let{groups:g}=new RegExp(`(?:\\${tD}(?<code>\\d+)m|\\${N}(?<uri>.*)${L})`).exec(h.slice(c).join(""))||{groups:{}};if(g.code!==void 0){let b=Number.parseFloat(g.code);r=b===$D?void 0:b}else g.uri!==void 0&&(s=g.uri.length===0?void 0:g.uri)}let l=dD.codes.get(Number(r));h[c+1]===`
5
+ `?(s&&(F+=Z("")),r&&l&&(F+=Y(l))):B===`
6
+ `&&(r&&l&&(F+=Y(r)),s&&(F+=Z(s)))}return F};function J(t,u,e){return String(t).normalize().replace(/\r\n/g,`
7
+ `).split(`
8
+ `).map(F=>xD(F,u,e)).join(`
9
+ `)}function wD(t,u){if(t===u)return;let e=t.split(`
10
+ `),F=u.split(`
11
+ `),r=[];for(let s=0;s<Math.max(e.length,F.length);s++)e[s]!==F[s]&&r.push(s);return r}var yD=Symbol("clack:cancel");function v(t,u){t.isTTY&&t.setRawMode(u)}var U=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),SD=new Set(["up","down","left","right","space","enter"]),p=class{constructor({render:u,input:e=FD,output:F=rD,...r},s=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=u.bind(this),this._track=s,this.input=e,this.output=F}prompt(){let u=new iD(0);return u._write=(e,F,r)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),r()},this.input.pipe(u),this.rl=z.createInterface({input:this.input,output:u,tabSize:2,prompt:"",escapeCodeTimeout:50}),z.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),v(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((e,F)=>{this.once("submit",()=>{this.output.write(A.cursor.show),this.output.off("resize",this.render),v(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(A.cursor.show),this.output.off("resize",this.render),v(this.input,!1),e(yD)})})}on(u,e){let F=this.subscribers.get(u)??[];F.push({cb:e}),this.subscribers.set(u,F)}once(u,e){let F=this.subscribers.get(u)??[];F.push({cb:e,once:!0}),this.subscribers.set(u,F)}emit(u,...e){let F=this.subscribers.get(u)??[],r=[];for(let s of F)s.cb(...e),s.once&&r.push(()=>F.splice(F.indexOf(s),1));for(let s of r)s()}unsubscribe(){this.subscribers.clear()}onKeypress(u,e){if(this.state==="error"&&(this.state="active"),e?.name&&!this._track&&U.has(e.name)&&this.emit("cursor",U.get(e.name)),e?.name&&SD.has(e.name)&&this.emit("cursor",e.name),u&&(u.toLowerCase()==="y"||u.toLowerCase()==="n")&&this.emit("confirm",u.toLowerCase()==="y"),u&&this.emit("key",u.toLowerCase()),e?.name==="return"){if(this.opts.validate){let F=this.opts.validate(this.value);F&&(this.error=F,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}u===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
12
+ `),v(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let u=J(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
13
+ `).length-1;this.output.write(A.cursor.move(-999,u*-1))}render(){let u=J(this._render(this)??"",process.stdout.columns,{hard:!0});if(u!==this._prevFrame){if(this.state==="initial")this.output.write(A.cursor.hide);else{let e=wD(this._prevFrame,u);if(this.restoreCursor(),e&&e?.length===1){let F=e[0];this.output.write(A.cursor.move(0,F)),this.output.write(A.erase.lines(1));let r=u.split(`
14
+ `);this.output.write(r[F]),this._prevFrame=u,this.output.write(A.cursor.move(0,r.length-F-1));return}else if(e&&e?.length>1){let F=e[0];this.output.write(A.cursor.move(0,F)),this.output.write(A.erase.down());let r=u.split(`
15
+ `).slice(F);this.output.write(r.join(`
16
+ `)),this._prevFrame=u;return}this.output.write(A.erase.down())}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u}}},V=class extends p{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(u){super(u,!1),this.value=!!u.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",e=>{this.output.write(A.cursor.move(0,-1)),this.value=e,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},j=class extends p{constructor(u){super(u,!1),this.cursor=0,this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===u.cursorAt),0),this.on("key",e=>{e==="a"&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let u=this.value.length===this.options.length;this.value=u?[]:this.options.map(e=>e.value)}toggleValue(){let u=this.value.includes(this._value);this.value=u?this.value.filter(e=>e!==this._value):[...this.value,this._value]}},M=class extends p{constructor(u){super(u,!1),this.cursor=0,this.options=u.options,this.cursor=this.options.findIndex(({value:e})=>e===u.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){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}},O=class extends p{constructor(u){super(u),this.valueWithCursor="",this.on("finalize",()=>{this.value||(this.value=u.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${w.inverse(w.hidden("_"))}`;else{let e=this.value.slice(0,this.cursor),F=this.value.slice(this.cursor);this.valueWithCursor=`${e}${w.inverse(F[0])}${F.slice(1)}`}})}get cursor(){return this._cursor}},_D=P(),m=(t,u)=>_D?t:u,kD=m("\u276F",">"),TD=m("\u25A0","x"),VD=m("\u25B2","x"),jD=m("\u2714","\u221A"),n="",d="",W=m("\u25CF",">"),R=m("\u25CB"," "),MD=m("\u25FB","[\u2022]"),X=m("\u25FC","[+]"),OD=m("\u25FB","[ ]"),x=t=>{switch(t){case"initial":case"active":return i.cyan(kD);case"cancel":return i.red(TD);case"error":return i.yellow(VD);case"submit":return i.green(jD)}},WD=t=>new O({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let u=`${i.gray(n)}
17
+ ${x(this.state)} ${t.message}
18
+ `,e=t.placeholder?i.inverse(t.placeholder[0])+i.dim(t.placeholder.slice(1)):i.inverse(i.hidden("_")),F=this.value?this.valueWithCursor:e;switch(this.state){case"error":return`${u.trim()}
19
+ ${i.yellow(n)} ${F}
20
+ ${i.yellow(d)} ${i.yellow(this.error)}
21
+ `;case"submit":return`${u}${i.gray(n)} ${i.dim(this.value||t.placeholder)}`;case"cancel":return`${u}${i.gray(n)} ${i.strikethrough(i.dim(this.value??""))}${this.value?.trim()?`
22
+ `+i.gray(n):""}`;default:return`${u}${i.cyan(n)} ${F}
23
+ ${i.cyan(d)}
24
+ `}}}).prompt(),RD=t=>{let u=t.active??"Yes",e=t.inactive??"No";return new V({active:u,inactive:e,initialValue:t.initialValue??!0,render(){let F=`${i.gray(n)}
25
+ ${x(this.state)} ${t.message}
26
+ `,r=this.value?u:e;switch(this.state){case"submit":return`${F}${i.gray(n)} ${i.dim(r)}`;case"cancel":return`${F}${i.gray(n)} ${i.strikethrough(i.dim(r))}
27
+ ${i.gray(n)}`;default:return`${F}${i.cyan(n)} ${this.value?`${i.green(W)} ${u}`:`${i.dim(R)} ${i.dim(u)}`} ${i.dim("/")} ${this.value?`${i.dim(R)} ${i.dim(e)}`:`${i.green(W)} ${e}`}
28
+ ${i.cyan(d)}
29
+ `}}}).prompt()},ID=t=>{let u=(e,F)=>{let r=e.label??String(e.value);switch(F){case"active":return`${i.green(W)} ${r} ${e.hint?i.dim(`(${e.hint})`):""}`;case"selected":return`${i.dim(r)}`;case"cancelled":return`${i.strikethrough(i.dim(r))}`}return`${i.dim(R)} ${i.dim(r)}`};return new M({options:t.options,initialValue:t.initialValue,render(){let e=`${i.gray(n)}
30
+ ${x(this.state)} ${t.message}
31
+ `;switch(this.state){case"submit":return`${e}${i.gray(n)} ${u(this.options[this.cursor],"selected")}`;case"cancel":return`${e}${i.gray(n)} ${u(this.options[this.cursor],"cancelled")}
32
+ ${i.gray(n)}`;default:return`${e}${i.cyan(n)} ${this.options.map((F,r)=>u(F,r===this.cursor?"active":"inactive")).join(`
33
+ ${i.cyan(n)} `)}
34
+ ${i.cyan(d)}
35
+ `}}}).prompt()},LD=t=>{let u=(e,F)=>{let r=e.label??String(e.value);switch(F){case"active":return`${i.cyan(MD)} ${r} ${e.hint?i.dim(`(${e.hint})`):""}`;case"selected":return`${i.green(X)} ${i.dim(r)}`;case"cancelled":return`${i.strikethrough(i.dim(r))}`;case"active-selected":return`${i.green(X)} ${r} ${e.hint?i.dim(`(${e.hint})`):""}`;case"submitted":return`${i.dim(r)}`}return`${i.dim(OD)} ${i.dim(r)}`};return new j({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(e){if(this.required&&e.length===0)return`Please select at least one option.
36
+ ${i.reset(i.dim(`Press ${i.gray(i.bgWhite(i.inverse(" space ")))} to select, ${i.gray(i.bgWhite(i.inverse(" enter ")))} to submit`))}`},render(){let e=`${i.gray(n)}
37
+ ${x(this.state)} ${t.message}
38
+ `;switch(this.state){case"submit":return`${e}${i.gray(n)} ${this.options.filter(({value:F})=>this.value.includes(F)).map(F=>u(F,"submitted")).join(i.dim(", "))||i.dim("none")}`;case"cancel":{let F=this.options.filter(({value:r})=>this.value.includes(r)).map(r=>u(r,"cancelled")).join(i.dim(", "));return`${e}${i.gray(n)} ${F.trim()?`${F}
39
+ ${i.gray(n)}`:""}`}case"error":{let F=this.error.split(`
40
+ `).map((r,s)=>s===0?`${i.yellow(d)} ${i.yellow(r)}`:` ${r}`).join(`
41
+ `);return e+i.yellow(n)+" "+this.options.map((r,s)=>{let D=this.value.includes(r.value),C=s===this.cursor;return C&&D?u(r,"active-selected"):D?u(r,"selected"):u(r,C?"active":"inactive")}).join(`
42
+ ${i.yellow(n)} `)+`
43
+ `+F+`
44
+ `}default:return`${e}${i.cyan(n)} ${this.options.map((F,r)=>{let s=this.value.includes(F.value),D=r===this.cursor;return D&&s?u(F,"active-selected"):s?u(F,"selected"):u(F,D?"active":"inactive")}).join(`
45
+ ${i.cyan(n)} `)}
46
+ ${i.cyan(d)}
47
+ `}}}).prompt()};async function ZD(t,u={}){if(!u.type||u.type==="text")return await WD({message:t,defaultValue:u.default,placeholder:u.placeholder,initialValue:u.initial});if(u.type==="confirm")return await RD({message:t,initialValue:u.initial});if(u.type==="select")return await ID({message:t,options:u.options.map(e=>typeof e=="string"?{value:e,label:e}:e)});if(u.type==="multiselect")return await LD({message:t,options:u.options.map(e=>typeof e=="string"?{value:e,label:e}:e),required:u.required});throw new Error(`Unknown prompt type: ${u.type}`)}export{ZD as prompt};
@@ -0,0 +1,3 @@
1
+ import { createRequire as c__createRequire } from 'node:module';
2
+ const require = c__createRequire(import.meta.url);
3
+ import{i as t,k as l,l as c}from"./chunk-2QT2TRN4.js";import"./chunk-TTCH5DKE.js";import"./chunk-AEIX73UA.js";import{createPublicKeys as a,getCleanPublicKey as n,zSharedConfig as o}from"@telia-ace/alliance-internal-node-utilities";var r={meta:{name:"public-key",description:t("command.public-key")},args:{type:{type:"string",required:!1,default:"spki",alias:"t",description:t("arg.public-key.type"),valueHint:"pkcs|spki|csp"},clean:{type:"boolean",required:!1,default:!1,alias:"c",description:t("arg.public-key.clean")},debug:l},run({args:i}){let e={clean:i.clean,type:i.type},p=a(o.pick({JWT_PUBLIC_CSP_KEY:!0,JWT_PRIVATE_KEY:!0}).parse({})),u=e.clean?n(e.type,p):p[e.type];c({debug:i.debug,input:e,output:u})}};export{r as default};
@@ -0,0 +1,4 @@
1
+ import { createRequire as c__createRequire } from 'node:module';
2
+ const require = c__createRequire(import.meta.url);
3
+ import{a as p,i as r,j as l,m,n as f,o as c}from"./chunk-2QT2TRN4.js";import"./chunk-TTCH5DKE.js";import{l as s}from"./chunk-AEIX73UA.js";import{start as h}from"@telia-ace/alliance-gateway/dev";import{createIndexHtml as S,getAppManifests as x}from"@telia-ace/alliance-internal-node-utilities";import{existsSync as v,readFileSync as b,rmSync as A}from"node:fs";import{onExit as D}from"signal-exit";import y from"node:dns";import{createServer as g}from"vite";var w=process.env.CI==="true"||process.env.NODE_ENV==="test";async function d(e){let t=f("serve",e);y.setDefaultResultOrder("verbatim");let i=await g({plugins:e.vite.plugins,configFile:!1,mode:e.build.mode,server:{open:e.server.open,port:e.server.ports.server,host:"localhost",proxy:{"/-/":{target:`http://localhost:${e.server.ports.gateway}/`,prependPath:!1,rewrite:o=>o.replace("/-/","/")}},strictPort:!0},clearScreen:!1,resolve:{alias:e.vite.alias},define:t}).then(o=>o.listen());return(w?console.log:s.box)([r("info.server-url",{url:`http://localhost:${e.server.ports.server}`}),r("info.gateway-url",{url:`http://localhost:${e.server.ports.gateway}`}),r("info.stop-server")].join(`
4
+ `)),i}async function u(e){let t,i,o;D(()=>{if(t)try{t.close()}catch(n){s.error(n)}if(i&&v(i))try{A(i,{force:!0})}catch(n){s.error(n)}if(o)try{o.close()}catch(n){s.error(n)}});let a=await x(e.server.apps);v(e.entries.manifest)&&a.unshift(p(b(e.entries.manifest).toString())),t=await h(e,a),i=S(c(e)),o=await d(e)}var _={meta:{name:"serve",description:r("command.serve")},args:{"ports.server":{type:"string",description:r("arg.serve.ports.server"),required:!1},"ports.gateway":{type:"string",description:r("arg.serve.ports.gateway"),required:!1},"entries.app":{type:"string",valueHint:"./src/app.ts",description:r("arg.entries.app"),required:!1},"entries.manifest":{type:"string",valueHint:"./src/manifest.json",description:r("arg.entries.manifest"),required:!1},mode:{type:"string",default:"development",alias:"m",description:r("arg.mode"),required:!1},logging:{type:"boolean",default:!1,alias:"l",description:r("arg.serve.logging"),required:!1},open:{type:"boolean",default:!1,alias:"o",description:r("arg.serve.open"),required:!1},config:l},async run({args:e}){let t=await m({command:"serve",mode:e.mode||"production"},e.config,{build:{mode:e.mode},server:{open:e.open,ports:{gateway:e["ports.gateway"]?Number(e["ports.gateway"]):void 0,server:e["ports.server"]?Number(e["ports.server"]):void 0},logging:e.logging},entries:{app:e["entries.app"],manifest:e["entries.manifest"]}});await u(t)}};export{_ as default};
@@ -0,0 +1,4 @@
1
+ import { createRequire as c__createRequire } from 'node:module';
2
+ const require = c__createRequire(import.meta.url);
3
+ import{a as P,b as I,c as C,d as z,e as M,f as E,g as A,h as F,i as p}from"./chunk-2QT2TRN4.js";import"./chunk-TTCH5DKE.js";import{a as b,c as O,e as fe,l as S}from"./chunk-AEIX73UA.js";var X=O((Ne,B)=>{"use strict";var H=process.platform==="win32",ue=H?"\\\\+":"\\/",T=H?"\\\\":"/",ge="((?:[^/]*(?:/|$))*)",pe="([^/]*)",k=`((?:[^${T}]*(?:${T}|$))*)`,de=`([^${T}]*)`;function me(e,{extended:r=!1,globstar:t=!1,strict:l=!1,filepath:i=!1,flags:s=""}={}){let c="",a="",m={regex:"",segments:[]},w=!1,h=!1,d=[];function o(f,{split:g,last:R,only:$}={}){$!=="path"&&(c+=f),i&&$!=="regex"&&(m.regex+=f==="\\/"?ue:f,g?(R&&(a+=f),a!==""&&(s.includes("g")||(a=`^${a}$`),m.segments.push(new RegExp(a,s))),a=""):a+=f)}let n,u;for(let f=0;f<e.length;f++){if(n=e[f],u=e[f+1],["\\","$","^",".","="].includes(n)){o(`\\${n}`);continue}if(n==="/"){o(`\\${n}`,{split:!0}),u==="/"&&!l&&(c+="?");continue}if(n==="("){if(d.length){o(n);continue}o(`\\${n}`);continue}if(n===")"){if(d.length){o(n);let g=d.pop();o(g==="@"?"{1}":g==="!"?"([^/]*)":g);continue}o(`\\${n}`);continue}if(n==="|"){if(d.length){o(n);continue}o(`\\${n}`);continue}if(n==="+"){if(u==="("&&r){d.push(n);continue}o(`\\${n}`);continue}if(n==="@"&&r&&u==="("){d.push(n);continue}if(n==="!"){if(r){if(h){o("^");continue}if(u==="("){d.push(n),o("(?!"),f++;continue}o(`\\${n}`);continue}o(`\\${n}`);continue}if(n==="?"){if(r){u==="("?d.push(n):o(".");continue}o(`\\${n}`);continue}if(n==="["){if(h&&u===":"){f++;let g="";for(;e[++f]!==":";)g+=e[f];g==="alnum"?o("(\\w|\\d)"):g==="space"?o("\\s"):g==="digit"&&o("\\d"),f++;continue}if(r){h=!0,o(n);continue}o(`\\${n}`);continue}if(n==="]"){if(r){h=!1,o(n);continue}o(`\\${n}`);continue}if(n==="{"){if(r){w=!0,o("(");continue}o(`\\${n}`);continue}if(n==="}"){if(r){w=!1,o(")");continue}o(`\\${n}`);continue}if(n===","){if(w){o("|");continue}o(`\\${n}`);continue}if(n==="*"){if(u==="("&&r){d.push(n);continue}let g=e[f-1],R=1;for(;e[f+1]==="*";)R++,f++;let $=e[f+1];t?R>1&&(g==="/"||g===void 0)&&($==="/"||$===void 0)?(o(ge,{only:"regex"}),o(k,{only:"path",last:!0,split:!0}),f++):(o(pe,{only:"regex"}),o(de,{only:"path"})):o(".*");continue}o(n)}s.includes("g")||(c=`^${c}$`,a=`^${a}$`,i&&(m.regex=`^${m.regex}$`));let y={regex:new RegExp(c,s)};return i&&(m.segments.push(new RegExp(a,s)),m.regex=new RegExp(m.regex,s),m.globstar=new RegExp(s.includes("g")?k:`^${k}$`,s),y.path=m),y}B.exports=me});var V=O((Ge,U)=>{"use strict";var he=b("os"),K=b("path"),ye=he.platform()==="win32",we={"{":"}","(":")","[":"]"},xe=/\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\)|(\\).|([@?!+*]\(.*\)))/,$e=/\\(.)|(^!|[*?{}()[\]]|\(\?)/;function Q(e,{strict:r=!0}={}){if(e==="")return!1;let t,l=r?xe:$e;for(;t=l.exec(e);){if(t[2])return!0;let i=t.index+t[0].length,s=t[1],c=s?we[s]:null;if(s&&c){let a=e.indexOf(c,i);a!==-1&&(i=a+1)}e=e.slice(i)}return!1}function be(e,{strict:r=!1}={}){ye&&e.includes("/")&&(e=e.split("\\").join("/")),/[\{\[].*[\/]*.*[\}\]]$/.test(e)&&(e+="/"),e+="a";do e=K.dirname(e);while(Q(e,{strict:r})||/(^|[^\\])([\{\[]|\([^\)]+$)/.test(e));return e.replace(/\\([\*\?\|\[\]\(\)\{\}])/g,"$1")}function ve(e,r={}){let t=be(e,r),l=Q(e,r),i;return t!="."?(i=e.substr(t.length),i.startsWith("/")&&(i=i.substr(1))):i=e,l||(t=K.dirname(e),i=t!=="."?e.substr(t.length):e),i.startsWith("./")&&(i=i.substr(2)),i.startsWith("/")&&(i=i.substr(1)),{base:t,glob:i,isGlob:l}}U.exports=ve});var ne=O((qe,ee)=>{"use strict";var j=b("fs"),Re=X(),{promisify:Y}=b("util"),Se=V(),{join:_,resolve:D,relative:Ce}=b("path"),Ee=/(^|[\\\/])\.[^\\\/\.]/g,Ae=Y(j.readdir),Oe=Y(j.stat),W={};async function Z(e,r,t,l,i="",s=0){let c=t.segments[s],a=D(l.cwd,r,i),m=await Ae(a),{dot:w,filesOnly:h}=l,d=0,o=m.length,n,u,y,f,g;for(;d<o;d++)if(u=_(a,n=m[d]),y=i?_(i,n):n,!(!w&&Ee.test(y))){if(g=t.regex.test(y),(f=W[y])===void 0&&(W[y]=f=j.lstatSync(u)),!f.isDirectory()){g&&e.push(Ce(l.cwd,u));continue}c&&!c.test(n)||(!h&&g&&e.push(_(r,y)),await Z(e,r,t,l,y,c&&c.toString()!==t.globstar&&s+1))}}ee.exports=async function(e,r={}){if(!e)return[];let t=Se(e);if(r.cwd=r.cwd||".",!t.isGlob)try{let s=D(r.cwd,e),c=await Oe(s);return r.filesOnly&&!c.isFile()?[]:r.absolute?[s]:[e]}catch(s){if(s.code!="ENOENT")throw s;return[]}r.flush&&(W={});let l=[],{path:i}=Re(t.glob,{filepath:!0,globstar:!0,extended:!0});return i.globstar=i.globstar.toString(),await Z(l,t.base,i,r,".",0),r.absolute?l.map(s=>D(r.cwd,s)):l}});var re=fe(ne(),1);import Pe from"detect-indent";import{loadFile as ze}from"magicast";import{getDefaultExportOptions as ke}from"magicast/helpers";import{existsSync as N,readFileSync as J,writeFileSync as Te}from"node:fs";import{dirname as _e,relative as ie,resolve as v,sep as q}from"node:path";import{run as De}from"npm-check-updates";function x(...e){let r=" ";return(t,l)=>e.reduce((i,s)=>typeof s=="number"?`${new Array(s).fill(r).join("")}${i}`:typeof s=="string"?`${s}${i}`:s(i),F.includes(t)?p(t,l):t)}async function oe(e){let r=await De({deep:!0,cwd:process.cwd(),filter:t=>t.startsWith("@telia-ace")||["typescript","vite"].includes(t),target:t=>t.startsWith("@telia-ace")&&e?"newest":"latest"});return r||(S.error(p("errors.npm-error")),process.exit(1)),Promise.all(Object.entries(r).filter(([t])=>{try{return J(v(t)).toString().includes("@telia-ace")}catch{return!1}}).map(async([t,l])=>{let i=v(_e(t)),s=v(i,"tsconfig.json"),c=v(i,"package.json"),[a]=await(0,re.default)(`${te(i)}/alliance.config*`);return{path:te(ie(process.cwd(),i)),packageJson:N(c)?G(c,i):void 0,tsConfigJson:N(s)?G(s,i):void 0,allianceConfig:N(a)?G(a,i):void 0,upgrades:l}}))}async function se({tsConfigJson:e}){if(!e)return;let{warn:r,error:t,output:l}=L(e.relative);try{let i=P(J(e.full).toString());i?.compilerOptions?.moduleResolution?.toLowerCase()!=="bundler"&&r(p("warnings.change",{property:"compilerOptions.moduleResolution",current:i?.compilerOptions?.moduleResolution,new:"bundler"}))}catch(i){t(i)}l()}async function le({allianceConfig:e}){if(!e)return;let{warn:r,error:t,output:l}=L(e.relative,!1);try{let i=await ze(e.full),s=ke(i);typeof s?.experimental?.logging=="boolean"&&r(p("warnings.remove",{property:"experimental.logging",alt:`, use ${C("'server.logging'")} instead`})),typeof s?.server?.mode<"u"&&r(p("warnings.remove",{property:"experimental.mode",alt:", no longer supported"}))}catch(i){t(i)}l()}async function ce({packageJson:e,allianceConfig:r,tsConfigJson:t,upgrades:l}){if(!e)return;let{change:i,warn:s,output:c,error:a,recommend:m}=L(e.relative,!!r||!!t);try{let w=J(e.full).toString(),h=P(w);if(h.alliance?.apps&&s(p("warnings.remove",{property:"alliance.apps",alt:`, use the app config ${C("'server.apps'")} option instead`})),h.scripts){let o=Object.entries(h.scripts).filter(([n,u])=>u.includes("create alliance")||u.includes("create-alliance"));for(let[n,u]of o)try{u.includes("serve")||u.includes("server")?(s(p("warnings.change",{property:`scripts.${n}`,current:u,new:"npx @telia-ace/alliance-cli serve"})),u.includes("--server-mode")&&s(p("warnings.remove",{property:"--server-mode",alt:", no longer supported"}))):u.includes("build")&&s(p("warnings.change",{property:`scripts.${n}`,current:u,new:"npx @telia-ace/alliance-cli build"}))}catch(y){a(y)}}let d=o=>{if(o)for(let n of Object.keys(o))!n.startsWith("@telia-ace")||!l[n]||(o[n]=l[n])};d(h.dependencies),d(h.devDependencies);for(let[o,n]of Object.entries(l))o.startsWith("@telia-ace")?i(p("changes.upgraded",{pkg:o,v:n})):m(p("recommendations.upgrade",{pkg:o,v:n}));Te(e.full,JSON.stringify(h,null,Pe(w).indent))}catch(w){a(w)}c()}function L(e,r=!0){let t=[],l=[],i=[],s=[];return{warn:c=>l.push(c),change:c=>t.push(c),recommend:c=>i.push(c),error:c=>s.push(c),output:()=>{if(!t.length&&!l.length&&!i.length)return;console.log(x(M,1)(e));let c=x("- ",2);if(t.length){console.log(x(2,C)("info.header.changes"));for(let a of t)console.log(c(a))}if(l.length){console.log(x(2,z)("info.header.warnings"));for(let a of l)console.log(c(a))}if(i.length){console.log(x(2,I)("info.header.recommendations"));for(let a of i)console.log(c(a))}if(s.length){console.log(x(2,z)("Errors"));for(let a of s)S.error(c(a))}r&&console.log()}}}function te(e){return e.replaceAll(q,"/")}function G(e,r=process.cwd()){let t=v(process.cwd(),e);return{full:t.replaceAll(q,"/"),relative:ie(r,t).replaceAll(q,"/")}}function ae(){let e=We();return S.log(x(A,E)("info.next-steps")),console.log([p("info.steps.warnings"),p("info.steps.install",{cmd:`${e} install`})].map(r=>x("- ",1)(r)).join(`
4
+ `))}function We(){try{if(!process.env.npm_config_user_agent)return"npm";let r=process.env.npm_config_user_agent.split(" ")[0],t=r.lastIndexOf("/"),l=r.substring(0,t);return l==="npminstall"?"cnpm":l}catch{return"npm"}}var Ye={meta:{name:"upgrade",description:p("command.upgrade")},args:{next:{type:"boolean",description:p("arg.upgrade.next"),default:!1,required:!1,alias:"n"}},async run(e){let r=await oe(e.args.next);for(let t of r)console.log(),console.log(x(A,E)(t.path||"root")),await ce(t),await se(t),await le(t);console.log(),ae(),console.log()}};export{Ye as default};
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@telia-ace/alliance-cli",
3
+ "version": "1.1.0-next.1",
4
+ "description": "CLI used when developing ACE Alliance apps.",
5
+ "license": "SEE LICENSE IN LICENSE.txt",
6
+ "type": "module",
7
+ "bin": {
8
+ "alliance": "./dist/index.js"
9
+ },
10
+ "files": [
11
+ "LICENSE.txt",
12
+ "README.md",
13
+ "dist"
14
+ ],
15
+ "dependencies": {
16
+ "detect-indent": "^7.0.1",
17
+ "magicast": "^0.3.2",
18
+ "npm-check-updates": "^16.14.11",
19
+ "signal-exit": "^4.1.0",
20
+ "vite": "^5.0.7",
21
+ "@telia-ace/alliance-gateway": "^1.1.0-next.0",
22
+ "@telia-ace/alliance-internal-node-utilities": "^1.1.0-next.0"
23
+ },
24
+ "devDependencies": {
25
+ "@telia-ace/alliance-framework": "^1.1.0-next.0"
26
+ },
27
+ "engines": {
28
+ "node": ">=15.0.0"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "scripts": {
34
+ "build:dev": "tsc && tsup",
35
+ "build:prod": "tsc && tsup --minify",
36
+ "dev": "tsup --watch",
37
+ "local": "npm i -g .",
38
+ "test": "vitest"
39
+ }
40
+ }