strapi-plugin-navigation 3.2.4 → 3.2.5

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.
@@ -1,75 +1,75 @@
1
- "use strict";const B=require("lodash"),Qr=require("zod"),R=require("lodash/fp"),Gu=require("crypto"),qu=require("child_process"),Ku=require("lodash/has"),Wu=require("lodash/mapValues"),zu=require("lodash/snakeCase"),Yu=require("lodash/camelCase"),Qu=require("lodash/mapKeys"),Vu=require("os"),Xu=require("path"),Zu=require("fs"),Ju=require("assert"),ec=require("events"),tc=require("buffer"),nc=require("stream"),rc=require("util"),ic=require("constants");require("node:stream");const oc=require("@sindresorhus/slugify"),ac=require("zod/v4"),sc=require("pluralize"),ue=e=>e&&e.__esModule?e:{default:e};function fa(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const me=ue(B),y=fa(Qr),ki=ue(Gu),ln=ue(qu),fn=ue(Ku),pa=ue(Wu),Di=ue(zu),uc=ue(Yu),cc=ue(Qu),Ln=ue(Vu),Se=ue(Xu),We=ue(Zu),da=ue(Ju),lc=ue(ec),fc=ue(tc),kn=ue(nc),it=ue(rc),pc=ue(ic),dc=ue(oc),W=fa(ac),Mi=ue(sc),Vr=y.object({name:y.string({required_error:"requiredError"}).nonempty("requiredError").refine(e=>!e.includes(" "),{message:"noSpaceError"}),label:y.string({required_error:"requiredError"}).nonempty("requiredError"),description:y.string().optional(),placeholder:y.string().optional(),required:y.boolean().optional(),enabled:y.boolean().optional()}),hc=Vr.extend({type:y.literal("select"),multi:y.boolean(),options:y.array(y.string(),{required_error:"requiredError"}).min(1,{message:"requiredError"})}),mc=Vr.extend({type:y.enum(["boolean","string"]),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),gc=Vr.extend({type:y.literal("media"),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),ha=y.discriminatedUnion("type",[mc,gc,hc]),ma=y.union([y.literal("audience"),ha]),yc=y.object({additionalFields:y.array(ma),allowedLevels:y.number(),contentTypes:y.array(y.string()),defaultContentType:y.string().optional(),contentTypesNameFields:y.record(y.string(),y.array(y.string())),contentTypesPopulate:y.record(y.string(),y.array(y.string())),gql:y.object({navigationItemRelated:y.array(y.string())}),pathDefaultFields:y.record(y.string(),y.any()),cascadeMenuAttached:y.boolean(),preferCustomContentTypes:y.boolean(),isCacheEnabled:y.boolean().optional()}),ga=y.object({id:y.number(),documentId:y.string(),name:y.string(),key:y.string()}),vc=y.enum(["INTERNAL","EXTERNAL","WRAPPER"]),Xr=y.object({id:y.number(),documentId:y.string(),title:y.string(),type:vc,path:y.string().or(y.null()).optional(),slug:y.string().or(y.null()).optional(),externalPath:y.string().or(y.null()).optional(),uiRouterKey:y.string(),menuAttached:y.boolean(),order:y.number().int(),collapsed:y.boolean(),related:y.object({documentId:y.string().optional(),__type:y.string()}).catchall(y.unknown()).nullish().optional(),additionalFields:y.record(y.string(),y.unknown()).or(y.null()).optional(),audience:y.array(ga).or(y.null()).optional(),autoSync:y.boolean().or(y.null()).optional()}),Ec=Xr.omit({related:!0}).pick({path:!0,type:!0,uiRouterKey:!0,title:!0,externalPath:!0}).extend({related:y.unknown().optional()}),Lt=Xr.extend({parent:y.lazy(()=>Lt.or(y.null())).optional(),items:y.lazy(()=>Lt.array()).optional(),master:y.lazy(()=>Ve(!1)).optional()}),ji=y.array(Lt),Ve=e=>y.object({id:y.number(),documentId:y.string(),name:y.string(),slug:y.string(),locale:y.string(),visible:y.boolean(),items:e?y.array(Lt):Lt.array().optional()}),wc=Ve(!1).omit({items:!0,id:!0,documentId:!0,slug:!0,locale:!0}).extend({documentId:y.string().optional(),id:y.undefined().optional()}),bc=Xr.omit({id:!0,documentId:!0}).extend({id:y.number().optional(),documentId:y.string().optional(),items:y.lazy(()=>ya).or(y.null()).optional(),updated:y.boolean().optional(),removed:y.boolean().optional()}),ya=y.array(bc),Sc=Ve(!1).extend({items:ya}).partial().required({id:!0,documentId:!0}),xc=y.enum(["collectionType","singleType"]),_c=y.object({singularName:y.string(),pluralName:y.string(),displayName:y.string(),description:y.string().optional(),name:y.string().optional()}),va=y.object({required:y.boolean().optional(),max:y.number().optional(),min:y.number().optional(),minLength:y.number().optional(),maxLength:y.number().optional(),private:y.boolean().optional(),configurable:y.boolean().optional(),default:y.any().optional()}),Ac=y.enum(["string","text","richtext","blocks","email","password","date","time","datetime","timestamp","boolean","integer","biginteger","float","decimal","json","relation","media"]),Tc=va.extend({type:Ac}),Cc=va.extend({type:y.literal("enumeration"),enum:y.string().array()}),Rc=y.object({type:y.literal("component"),component:y.string(),repeatable:y.boolean().optional()}),Fc=y.object({type:y.literal("dynamiczone"),components:y.string().array()}),$c=y.object({type:y.literal("uid")}),Ic=y.object({type:y.literal("media"),allowedTypes:y.enum(["images","videos","audios","files"]).array(),required:y.boolean().optional()}),Oc=y.enum(["oneToOne","oneToMany","manyToOne","manyToMany","morphToMany","manyToMorph"]),Nc=y.object({type:y.literal("relation"),relation:Oc,target:y.string(),mappedBy:y.string().optional(),inversedBy:y.string().optional()}),Pc=y.record(y.string(),y.union([Tc,Cc,Rc,Fc,Nc,Ic,$c])),Tr=y.object({kind:xc,collectionName:y.string(),info:_c,options:y.object({draftAndPublish:y.boolean().optional(),hidden:y.boolean().optional(),templateName:y.string().optional()}).optional(),attributes:Pc,actions:y.record(y.string(),y.any()).optional(),lifecycles:y.record(y.string(),y.any()).optional(),uid:y.string(),apiName:y.string().optional(),associations:y.object({model:y.string(),alias:y.string()}).array().optional(),modelName:y.string().optional(),plugin:y.string().optional(),pluginOptions:y.record(y.string(),y.any()).optional(),isSingle:y.boolean().optional()});Tr.pick({info:!0,kind:!0,attributes:!0,options:!0});const Mt=(e,t)=>n=>{t(n(e()))};let Cr=yc;const Lc=Mt(()=>Cr,e=>{Cr=e});let Rr=ma;const kc=Mt(()=>Rr,e=>{Rr=e});let Fr=ha;const Dc=Mt(()=>Fr,e=>{Fr=e});let $r=wc;const Mc=Mt(()=>$r,e=>{$r=e});let Ir=Sc;const jc=Mt(()=>Ir,e=>{Ir=e}),Re={get configSchema(){return Cr},get navigationItemAdditionalField(){return Rr},get navigationItemCustomField(){return Fr},get createNavigationSchema(){return $r},get updateNavigationSchema(){return Ir}},Hc=/^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,Bc=["beforeCreate","beforeCreateMany","afterCreate","afterCreateMany","beforeUpdate","beforeUpdateMany","afterUpdate","afterUpdateMany","beforeDelete","beforeDeleteMany","afterDelete","afterDeleteMany","beforeCount","afterCount","beforeFindOne","afterFindOne","beforeFindMany","afterFindMany"],Uc="$",Ea=["api::","plugin::"],wa=["admin::","plugin::content-releases","plugin::i18n.locale","plugin::navigation","plugin::review-workflows","plugin::users-permissions","plugin::upload.folder"],Gc=["title","subject","name"],Hi={SINGLE:"singleType"},Bi=["title","type","path","externalPath","uiRouterKey","menuAttached","order","collapsed","related","parent","master","audience","additionalFields"],qc=e=>e.filter(t=>t!=="audience"),ba=e=>{const t=qc(e);if(t.length!==B.uniqBy(t,"name").length)throw new Error("All names of custom fields must be unique.");if(!B.isNil(B.find(t,n=>typeof n=="object"&&B.includes(Bi,n.name))))throw new Error(`Name of custom field cannot be one of: ${Bi.join(", ")}`)},Sa=(e,t)=>{if(e==null)throw t??new Error("Non-empty value expected, empty given")},Kc=(e="")=>{const t=a=>a.split("-").map(o=>B.capitalize(o)).join(""),[n,r,i]=Wc(e);return n==="api"?t(i):`${t(r)}${t(i)}`},Wc=(e="")=>e.split(Hc).filter(t=>t&&t.length>0),zc=(e,t)=>n=>[n,async r=>{await re(t,"common").runLifeCycleHook({contentTypeName:e,hookName:n,event:r})}],xa=(e,t)=>Object.fromEntries(Bc.map(zc(e,t))),Ee=({strapi:e})=>{const t=e.plugin("navigation");return{masterModel:t.contentType("navigation"),itemModel:t.contentType("navigation-item"),relatedModel:t.contentType("navigations-items-related"),audienceModel:t.contentType("audience")}};function re({strapi:e},t){return e.plugin("navigation").service(t)}const Yt=e=>e==="*"?"*":typeof e=="string"?[e]:e===!1?[]:e===!0?"*":e,Yc=(e="")=>{const t=!!Ea.find(r=>e.includes(r)),n=!wa.find(r=>e.includes(r)||e===r);return!!e&&t&&n},Ui=(e="")=>B.last(e)==="s"?e.substr(0,e.length-1):e,_a=async({strapi:e,forceDefault:t=!1})=>{const n=e.store({type:"plugin",name:"navigation"}),r=await e.plugin("navigation").config,i=t?{}:{...Or.default,...await n.get({key:"config"})??Or.default};let a=B.isEmpty(i)?i:Re.configSchema.parse(i);const o=Qc(a,r);return a={additionalFields:o("additionalFields"),contentTypes:o("contentTypes"),contentTypesNameFields:o("contentTypesNameFields"),contentTypesPopulate:o("contentTypesPopulate"),defaultContentType:o("defaultContentType"),allowedLevels:o("allowedLevels"),gql:o("gql"),pathDefaultFields:o("pathDefaultFields"),cascadeMenuAttached:o("cascadeMenuAttached"),preferCustomContentTypes:o("preferCustomContentTypes"),isCacheEnabled:o("isCacheEnabled")},Vc(a,{strapi:e}),ba(a.additionalFields),await n.set({key:"config",value:a}),a},Qc=(e,t)=>n=>{const r=e?.[n]??t(n);return Sa(r,new Error(`[Navigation] Config "${n}" is undefined`)),r},Vc=(e,{strapi:t})=>{const n=e.contentTypes.filter(i=>!t.contentTypes[i]);if(n.length===0)return;const r=n.map(Kc);e.contentTypes=e.contentTypes.filter(i=>!n.includes(i)),e.contentTypesNameFields=Object.fromEntries(Object.entries(e.contentTypesNameFields).filter(([i])=>!n.includes(i))),e.gql.navigationItemRelated=e.gql.navigationItemRelated.filter(i=>!r.includes(i))},Or={default:{additionalFields:[],allowedLevels:2,contentTypes:[],defaultContentType:"",contentTypesNameFields:{},contentTypesPopulate:{},gql:{navigationItemRelated:[]},pathDefaultFields:{},pruneObsoleteI18nNavigations:!1,cascadeMenuAttached:!0,preferCustomContentTypes:!1,isCacheEnabled:!1}},Xc=B.once(e=>({find(t,n){const{audienceModel:{uid:r}}=Ee(e);return e.strapi.query(r).findMany({where:t,limit:n}).then(ga.array().parse)}})),pn=(e,t)=>({findFirst(n,r,i={}){return e.strapi.documents(t).findFirst({populate:Yt(n),status:r,...i})},findById(n,r,i,a={}){return e.strapi.documents(t).findOne({documentId:n,populate:Yt(r),status:i,...a})},findManyById(n,r,i){return e.strapi.documents(t).findMany({where:{documentId:{$in:n}},populate:Yt(r),status:i})},findMany(n,r,i,a){return e.strapi.documents(t).findMany({where:n,populate:Yt(r),status:i,locale:a})},count(n,r){return e.strapi.documents(t).count({where:n,status:r})}}),Le=B.once(e=>({async save({item:t,locale:n}){const{itemModel:r}=Ee(e),{__type:i,documentId:a}=t?.related??{},o=i?pn(e,i):void 0,s=i&&o?a?await o.findById(a,void 0,void 0,{locale:n}):await o.findFirst(void 0,void 0,{locale:n}):void 0;if(typeof t.documentId=="string"){const{documentId:u,...f}=t;return e.strapi.documents(r.uid).update({documentId:t.documentId,data:{...f,related:s?{...s,__type:i}:void 0},locale:n})}else return e.strapi.documents(r.uid).create({data:{...t,related:s?{...s,__type:i}:void 0},locale:n})},find({filters:t,locale:n,limit:r,order:i,populate:a}){const{itemModel:o}=Ee(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:a,orderBy:i}).then(s=>s.map(Nr)).then(ji.parse).then(s=>s.map(dn))},findV4({filters:t,locale:n,limit:r,order:i,populate:a}){const{itemModel:o}=Ee(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:a,orderBy:i})},count(t){const{itemModel:n}=Ee(e);return e.strapi.query(n.uid).count({where:t})},remove(t){const{itemModel:n}=Ee(e);return e.strapi.documents(n.uid).delete({documentId:t.documentId,populate:"*"})},removeForIds(t){const{itemModel:n}=Ee(e);return t.map(r=>e.strapi.documents(n.uid).delete({documentId:r,populate:"*"}))},findForMasterIds(t){const{itemModel:n}=Ee(e);return e.strapi.query(n.uid).findMany({where:{$or:t.map(r=>({master:r}))},limit:Number.MAX_SAFE_INTEGER}).then(ji.parse)}})),Zc=["id","publishedAt","createdAt","updatedAt","locale"],dn=({related:e,items:t=[],...n})=>({...n,items:t.map(dn),related:e?B.omit(e,Zc):void 0}),Nr=({related:e,...t})=>({...t,related:e?.[0]});class St extends Error{constructor(t,n){super(t),this.additionalInfo=n,this.type="NavigationError"}}class rr extends St{constructor(){super(...arguments),this.type="FillNavigationError"}}class Jc extends St{constructor(){super(...arguments),this.type="InvalidParamNavigationError"}}const Gi=e=>e===!0?!0:Array.isArray(e)?e.includes("items"):!1,Ie=B.once(e=>({find({filters:t,locale:n,limit:r,orderBy:i,populate:a}){const{masterModel:o}=Ee(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:a,orderBy:i}).then(s=>s.map(({items:u,...f})=>({...f,items:u?.map(Nr)}))).then(s=>s.map(({items:u,...f})=>({...f,items:u?.map(dn)}))).then(s=>Ve(Gi(a)).array().parse(s))},findOne({locale:t,filters:n,populate:r}){const{masterModel:i}=Ee(e);return e.strapi.documents(i.uid).findOne({documentId:n.documentId,locale:t,populate:r}).then(a=>a&&{...a,items:a.items?.map(Nr)}).then(a=>Ve(Gi(r)).parse(a)).then(a=>({...a,items:a.items?.map(dn)}))},async save(t){const{masterModel:n}=Ee(e),{documentId:r,locale:i,...a}=t;return r?e.strapi.documents(n.uid).update({locale:i,documentId:r,data:B.omit(a,["id","documentId"]),populate:["items"]}).then(Ve(!1).parse):e.strapi.documents(n.uid).create({locale:i,data:{...a,populate:["items"]}}).then(Ve(!1).parse)},remove(t){const{masterModel:n}=Ee(e);if(!t.documentId)throw new St("Document id is required.");return e.strapi.documents(n.uid).delete({documentId:t.documentId})}})),el="Navigation",tl="navigation",nl=async e=>{const t=re(e,"common"),{defaultLocale:n,restLocale:r=[]}=await t.readLocale(),i=Ie(e),a=await i.find({limit:Number.MAX_SAFE_INTEGER,filters:{},locale:"*"});a.length===0&&a.push(await i.save({name:el,visible:!0,locale:n,slug:tl}));const o=a.filter(({locale:s})=>s===n);for(const s of o)for(const u of r)!a.find(({locale:l,documentId:c})=>c===s.documentId&&u===l)&&await i.save({documentId:s.documentId,name:s.name,locale:u,visible:s.visible,slug:s.slug})},he={render:function(e){return`plugin::navigation.${e}`},navigation:{read:"read",update:"update",settings:"settings"}},rl=async({strapi:e})=>{const t=[{section:"plugins",displayName:"Read",uid:he.navigation.read,pluginName:"navigation"},{section:"plugins",displayName:"Update",uid:he.navigation.update,pluginName:"navigation"},{section:"plugins",displayName:"Settings",uid:he.navigation.settings,pluginName:"navigation"}];await e.admin.services.permission.actionProvider.registerMany(t)},il="I18NLocaleCode",ol=({strapi:e,nexus:t})=>{const{nonNull:n,list:r,stringArg:i,booleanArg:a}=t;return{args:{navigationIdOrSlug:n(i()),type:"NavigationRenderType",menuOnly:a(),path:i(),locale:t.arg({type:il})},type:n(r("NavigationItem")),resolve(u,{navigationIdOrSlug:f,type:l,menuOnly:c,path:p,locale:d}){const h=Qr.z.string().parse(f);return re({strapi:e},"client").render({idOrSlug:h,type:l,rootPath:p,locale:d,menuOnly:c,wrapRelated:!0})}}},al=({strapi:e,nexus:t})=>{const{nonNull:n,list:r,stringArg:i,booleanArg:a}=t;return{type:n(r("NavigationItem")),args:{documentId:n(i()),childUiKey:n(i()),type:"NavigationRenderType",menuOnly:a()},resolve(o,s){const{documentId:u,childUIKey:f,type:l,menuOnly:c}=s,p=Qr.z.string().parse(u);return re({strapi:e},"client").renderChildren({idOrSlug:p,childUIKey:f,type:l,menuOnly:c,wrapRelated:!0})}}},sl=e=>{const t={renderNavigationChild:al,renderNavigation:ol};return e.nexus.extendType({type:"Query",definition(n){for(const[r,i]of Object.entries(t)){const a=i(e);n.field(r,a)}}})},ul=()=>({"Query.renderNavigationChild":{auth:!1},"Query.renderNavigation":{auth:!1}}),cl=({nexus:e})=>e.objectType({name:"ContentTypes",definition(t){t.nonNull.string("uid"),t.nonNull.string("name"),t.nonNull.boolean("isSingle"),t.nonNull.string("collectionName"),t.nonNull.string("contentTypeName"),t.nonNull.string("label"),t.nonNull.string("relatedField"),t.nonNull.string("labelSingular"),t.nonNull.string("endpoint"),t.nonNull.boolean("available"),t.nonNull.boolean("visible")}}),ll=({nexus:e,strapi:t})=>e.objectType({name:"ContentTypesNameFields",async definition(n){n.nonNull.list.nonNull.string("default");const i=await re({strapi:t},"common").getPluginStore(),o=Re.configSchema.parse(await i.get({key:"config"})).contentTypesNameFields;Object.keys(o||{}).forEach(s=>n.nonNull.list.string(s))}}),fl=({nexus:e})=>e.inputObjectType({name:"CreateNavigation",definition(t){t.nonNull.string("name"),t.nonNull.list.field("items",{type:"CreateNavigationItem"})}}),pl=({nexus:e})=>e.inputObjectType({name:"CreateNavigationItem",definition(t){t.nonNull.string("title"),t.nonNull.field("type",{type:"NavigationItemType"}),t.string("path"),t.string("externalPath"),t.nonNull.string("uiRouterKey"),t.nonNull.boolean("menuAttached"),t.nonNull.int("order"),t.string("parent"),t.string("master"),t.list.field("items",{type:"CreateNavigationItem"}),t.list.string("audience"),t.field("related",{type:"CreateNavigationRelated"})}}),dl=({nexus:e})=>e.inputObjectType({name:"CreateNavigationRelated",definition(t){t.nonNull.string("ref"),t.nonNull.string("field"),t.nonNull.string("refId")}}),hl=({nexus:e})=>e.objectType({name:"Navigation",definition(t){t.nonNull.string("id"),t.nonNull.string("documentId"),t.nonNull.string("name"),t.nonNull.string("slug"),t.nonNull.boolean("visible")}}),ml=({nexus:e})=>e.objectType({name:"NavigationConfig",definition(t){t.int("allowedLevels"),t.nonNull.list.string("additionalFields"),t.field("contentTypesNameFields",{type:"ContentTypesNameFields"}),t.list.field("contentTypes",{type:"ContentTypes"})}}),gl=({nexus:e})=>e.objectType({name:"NavigationDetails",definition(t){t.nonNull.string("id"),t.nonNull.string("documentId"),t.nonNull.string("name"),t.nonNull.string("slug"),t.nonNull.boolean("visible"),t.nonNull.list.field("items",{type:"NavigationItem"})}}),yl=({nexus:e,config:t})=>e.objectType({name:"NavigationItem",definition(n){n.nonNull.int("id"),n.nonNull.string("documentId"),n.nonNull.string("title"),n.nonNull.field("type",{type:"NavigationItemType"}),n.string("path"),n.string("externalPath"),n.nonNull.string("uiRouterKey"),n.nonNull.boolean("menuAttached"),n.nonNull.int("order"),n.field("parent",{type:"NavigationItem"}),n.string("master"),n.list.field("items",{type:"NavigationItem"}),n.field("related",{type:"NavigationItemRelated"}),t.additionalFields.find(r=>r==="audience")&&n.list.string("audience"),n.field("additionalFields",{type:"NavigationItemAdditionalFields"}),n.string("created_at"),n.string("updated_at"),n.string("created_by"),n.string("updated_by"),n.string("createdAt"),n.string("updatedAt"),n.string("createdBy"),n.string("updatedBy")}}),vl=({nexus:e,config:t})=>e.objectType({name:"NavigationItemAdditionalFields",definition(n){t.additionalFields.forEach(r=>{if(r!=="audience"&&r.enabled)switch(r.type){case"media":n.field(r.name,{type:"UploadFile"});break;case"string":n.string(r.name);break;case"boolean":n.boolean(r.name);break;case"select":r.multi?n.list.string(r.name):n.string(r.name);break;default:throw new Error(`Type "${JSON.stringify(r.type)}" is unsupported by custom fields`)}})}}),El=({strapi:e,nexus:t,config:n})=>{const r=n.gql?.navigationItemRelated,i="NavigationItemRelated";return r?.length?t.unionType({name:i,definition(a){a.members(...r)},resolveType:a=>e.contentTypes[a.__type]?.globalId}):t.objectType({name:i,definition(a){a.int("id"),a.string("documentId"),a.string("title"),a.string("name")}})},wl=({nexus:e})=>e.enumType({name:"NavigationItemType",members:["INTERNAL","EXTERNAL","WRAPPER"]}),bl=({nexus:e})=>e.enumType({name:"NavigationRenderType",members:["FLAT","TREE"]}),Sl=[vl,El,yl,bl,hl,gl,ll,cl,ml,dl,pl,fl,wl],xl=e=>Sl.map(t=>t(e)),_l=async({strapi:e})=>{const t=e.plugin("graphql").service("extension");t.shadowCRUD("plugin::navigation.audience").disable(),t.shadowCRUD("plugin::navigation.navigation").disable(),t.shadowCRUD("plugin::navigation.navigation-item").disable(),t.shadowCRUD("plugin::navigation.navigations-items-related").disable();const r=await re({strapi:e},"common").getPluginStore(),i=Re.configSchema.parse(await r.get({key:"config"}));t.use(({strapi:a,nexus:o})=>{const s=xl({strapi:a,nexus:o,config:i}),u=sl({strapi:a,nexus:o}),f=ul();return{types:[s,u],resolversConfig:f}})},Al=async({strapi:e})=>{!!e.plugin("graphql")&&await _l({strapi:e})},Tl=async e=>{await _a(e),await nl(e),await rl(e),await Al(e),await strapi.service("plugin::navigation.migrate").migrateRelatedIdToDocumentId(),strapi.db.lifecycles.subscribe({models:["plugin::i18n.locale"],async afterCreate(t){await re(e,"admin").refreshNavigationLocale(t.result?.code)}})},Cl=({strapi:e})=>{},Rl=({strapi:e})=>{},Fl={collectionName:"audience",info:{singularName:"audience",pluralName:"audiences",displayName:"Audience",name:"audience"},options:{increments:!0,comment:"Audience"},attributes:{name:{type:"string",required:!0},key:{type:"uid",targetField:"name"}}},$l={schema:Fl},Il=xa("navigation",{strapi}),Ol={collectionName:"navigations",info:{singularName:"navigation",pluralName:"navigations",displayName:"Navigation",name:"navigation"},options:{comment:""},pluginOptions:{"content-manager":{visible:!1},"content-type-builder":{visible:!1},i18n:{localized:!0}},attributes:{name:{type:"text",configurable:!1,required:!0},slug:{type:"uid",target:"name",configurable:!1,required:!0},visible:{type:"boolean",default:!1,configurable:!1},items:{type:"relation",relation:"oneToMany",target:"plugin::navigation.navigation-item",configurable:!1,mappedBy:"master"}}},Nl={schema:Ol,lifecycles:Il},Pl=xa("navigation-item",{strapi}),Ll={collectionName:"navigations_items",info:{singularName:"navigation-item",pluralName:"navigation-items",displayName:"Navigation Item",name:"navigation-item"},options:{increments:!0,timestamps:!0,comment:"Navigation Item"},pluginOptions:{"content-manager":{visible:!1},"content-type-builder":{visible:!1},i18n:{localized:!1}},attributes:{title:{type:"text",configurable:!1,required:!0,pluginOptions:{i18n:{localized:!1}}},type:{type:"enumeration",enum:["INTERNAL","EXTERNAL","WRAPPER"],default:"INTERNAL",configurable:!1},path:{type:"text",targetField:"title",configurable:!1},externalPath:{type:"text",configurable:!1},uiRouterKey:{type:"string",configurable:!1},menuAttached:{type:"boolean",default:!1,configurable:!1},order:{type:"integer",default:0,configurable:!1},collapsed:{type:"boolean",default:!1,configurable:!1},autoSync:{type:"boolean",default:!0,configurable:!1},related:{type:"relation",relation:"morphToMany",required:!0,configurable:!1},parent:{type:"relation",relation:"oneToOne",target:"plugin::navigation.navigation-item",configurable:!1,default:null},master:{type:"relation",relation:"manyToOne",target:"plugin::navigation.navigation",configurable:!1,inversedBy:"items"},audience:{type:"relation",relation:"oneToMany",target:"plugin::navigation.audience"},additionalFields:{type:"json",require:!1,default:{}}}},kl={schema:Ll,lifecycles:Pl},Dl={audience:$l,navigation:Nl,"navigation-item":kl},Aa=y.enum(["true","false"]),Qt=y.string(),Ml=y.object({locale:y.string().optional(),orderBy:y.string().optional(),orderDirection:y.enum(["DESC","ASC"]).optional()}),Ta=y.enum(["FLAT","TREE","RFR"]),Ca=y.enum(["draft","published"]),Ra=y.union([y.boolean(),y.string(),y.string().array(),y.undefined()]),jl=y.object({type:Ta.optional(),menu:Aa.optional(),path:y.string().optional(),locale:y.string().optional(),populate:Ra.optional(),status:Ca.optional()}),Hl=y.object({type:Ta.optional(),menu:Aa.optional(),locale:y.string().optional(),status:Ca.optional()}),Bl=y.object({source:y.string().min(1),target:y.string().min(1),documentId:y.string().min(1)});function Ul(e){return{getAdminService(){return re(e,"admin")},getCommonService(){return re(e,"common")},async get(){return await this.getAdminService().get({})},async post(t){const{auditLog:n}=t;try{return await this.getAdminService().post({payload:Re.createNavigationSchema.parse(t.request.body),auditLog:n})}catch(r){const i=r instanceof Error?{name:r.name,message:r.message}:{};return t.internalServerError("Unable to create",{originalError:i})}},async put(t){const{params:{documentId:n},auditLog:r}=t,i=y.record(y.string(),y.unknown()).parse(t.request.body);try{return await this.getAdminService().put({auditLog:r,payload:Re.updateNavigationSchema.parse({...i,documentId:n})})}catch(a){const o=a instanceof Error?{name:a.name,message:a.message}:{};return t.internalServerError("Unable to update",{originalError:o})}},async delete(t){const{auditLog:n,params:{documentId:r}}=t;return await this.getAdminService().delete({documentId:Qt.parse(r),auditLog:n}),{}},config(){return this.getAdminService().config({viaSettingsPage:!1})},async updateConfig(t){return await this.getAdminService().updateConfig({config:Re.configSchema.parse(t.request.body)}),{}},async restoreConfig(){return await this.getAdminService().restoreConfig(),{}},settingsConfig(){return this.getAdminService().config({viaSettingsPage:!0})},async settingsRestart(){return await this.getAdminService().restart(),{}},getById(t){const{params:{documentId:n}}=t;return this.getAdminService().getById({documentId:Qt.parse(n)})},getContentTypeItems(t){const{params:{model:n},query:r={}}=t;return this.getAdminService().getContentTypeItems({query:y.record(y.string(),y.unknown()).parse(r),uid:y.string().parse(n)})},async fillFromOtherLocale(t){const{params:n,auditLog:r}=t,{source:i,target:a,documentId:o}=Bl.parse(n);return await this.getAdminService().fillFromOtherLocale({source:i,target:a,documentId:o,auditLog:r})},readNavigationItemFromLocale(t){const{params:{source:n,target:r},query:{path:i}}=t;return this.getAdminService().readNavigationItemFromLocale({path:y.string().parse(i),source:Qt.parse(n),target:Qt.parse(r)})},getSlug(t){const{query:{q:n}}=t;return this.getCommonService().getSlug({query:y.string().parse(n)}).then(r=>({slug:r}))},settingsLocale(){return this.getCommonService().readLocale()}}}const Gl=e=>{if(!(!e||e===!0||e==="*")&&typeof e!="object")return Array.isArray(e),e};function ql(e){return{getService(){return re(e,"client")},async readAll(t){try{const{query:n={}}=t,{locale:r,orderBy:i,orderDirection:a}=Ml.parse(n);return await this.getService().readAll({locale:r,orderBy:i,orderDirection:a})}catch(n){if(n instanceof Error)return t.badRequest(n.message);throw n}},async render(t){const{params:n,query:r={}}=t,{type:i,menu:a,path:o,locale:s,populate:u,status:f="published"}=jl.parse(r),l=y.string().parse(n.idOrSlug);return await this.getService().render({idOrSlug:l,type:i,menuOnly:a==="true",rootPath:o,locale:s,populate:Gl(Ra.parse(u==="true"?!0:u==="false"?!1:Array.isArray(u)?u.map(c=>c==="true"?!0:c==="false"?!1:u):u)),status:f})},async renderChild(t){const{params:n,query:r={}}=t,{type:i,menu:a,locale:o,status:s="published"}=Hl.parse(r),u=y.string().parse(n.idOrSlug),f=y.string().parse(n.childUIKey);return await this.getService().renderChildren({idOrSlug:u,childUIKey:f,type:i,menuOnly:a==="true",locale:o,status:s})}}}const Kl={admin:Ul,client:ql},Wl={},zl={},Yl={type:"admin",routes:[{method:"GET",path:"/",handler:"admin.get",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"POST",path:"/",handler:"admin.post",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/config",handler:"admin.config",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"PUT",path:"/config",handler:"admin.updateConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"DELETE",path:"/config",handler:"admin.restoreConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"GET",path:"/slug",handler:"admin.getSlug",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/:documentId",handler:"admin.getById",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"PUT",path:"/:documentId",handler:"admin.put",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"DELETE",path:"/:documentId",handler:"admin.delete",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/content-type-items/:model",handler:"admin.getContentTypeItems",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/settings/locale",handler:"admin.settingsLocale",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/settings/config",handler:"admin.settingsConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"GET",path:"/settings/restart",handler:"admin.settingsRestart",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"PUT",path:"/i18n/copy/:documentId/:source/:target",handler:"admin.fillFromOtherLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/i18n/item/read/:source/:target",handler:"admin.readNavigationItemFromLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}}]},Ql={type:"content-api",routes:[{method:"GET",path:"/render/:idOrSlug",handler:"client.render",config:{policies:[]}},{method:"GET",path:"/render/:idOrSlug/:childUIKey",handler:"client.renderChild",config:{policies:[]}},{method:"GET",path:"/",handler:"client.readAll",config:{policies:[]}}]},Vl={admin:Yl,"content-api":Ql};function Xl(e,t){return me.default.has(process.env,e)?process.env[e]:t}function st(e){return process.env[e]??""}const Zl={int(e,t){return me.default.has(process.env,e)?parseInt(st(e),10):t},float(e,t){return me.default.has(process.env,e)?parseFloat(st(e)):t},bool(e,t){return me.default.has(process.env,e)?st(e)==="true":t},json(e,t){if(!me.default.has(process.env,e))return t;try{return JSON.parse(st(e))}catch(n){throw n instanceof Error?new Error(`Invalid json environment variable ${e}: ${n.message}`):n}},array(e,t){if(!me.default.has(process.env,e))return t;let n=st(e);return n.startsWith("[")&&n.endsWith("]")&&(n=n.substring(1,n.length-1)),n.split(",").map(r=>me.default.trim(me.default.trim(r," "),'"'))},date(e,t){return me.default.has(process.env,e)?new Date(st(e)):t},oneOf(e,t,n){if(!t)throw new Error("env.oneOf requires expectedValues");if(n&&!t.includes(n))throw new Error("env.oneOf requires defaultValue to be included in expectedValues");const r=Jl(e,n);return t.includes(r)?r:n}},Jl=Object.assign(Xl,Zl),ef="id",tf="documentId",nf={ID_ATTRIBUTE:ef,DOC_ID_ATTRIBUTE:tf},rf=e=>R.union(strapi?.config?.get("api.responses.privateAttributes",[])??[],R.getOr([],"options.privateAttributes",e)),of=(e,t)=>e?.attributes?.[t]?.private===!0?!0:rf(e).includes(t),Fa=e=>e&&!["media","component","relation","dynamiczone"].includes(e.type),af=e=>e?.type==="media",$a=e=>e?.type==="relation",sf=e=>!!e&&e.type==="dynamiczone",Ia=e=>!!e&&$a(e)&&e.relation?.startsWith?.("morphTo"),ht=async(e,t,n)=>{const{path:r={raw:null,attribute:null},schema:i,getModel:a}=t;let o=t.parent;const s=async(m,g,b)=>{const T={schema:a(b.__type),path:g,getModel:a,parent:o};return ht(m,T,b)},u=m=>async(g,b,S)=>ht(g,{schema:m,path:b,getModel:a,parent:o},S),f=async(m,g,b)=>{const A={schema:a("plugin::upload.file"),path:g,getModel:a,parent:o};return ht(m,A,b)},l=async(m,g,b,S)=>ht(m,{schema:b,path:g,getModel:a,parent:o},S),c=async(m,g,b)=>{const T={schema:a(b.__component),path:g,getModel:a,parent:o};return ht(m,T,b)};if(!R.isObject(n)||R.isNil(i))return n;const p=R.clone(n),d=uf({data:p}),h=Object.keys(p);for(let m=0;m<h.length;m+=1){const g=h[m],b=i.attributes[g],S={...r};S.raw=R.isNil(r.raw)?g:`${r.raw}.${g}`,R.isNil(b)||(S.attribute=R.isNil(r.attribute)?g:`${r.attribute}.${g}`);const T={data:p,schema:i,key:g,value:p[g],attribute:b,path:S,getModel:a,parent:o};await e(T,d);const A=p[g];if(!(R.isNil(A)||R.isNil(b))){if(o={schema:i,key:g,attribute:b,path:S},$a(b)){const F=b.relation.toLowerCase().startsWith("morph")?s:u(a(b.target));if(R.isArray(A)){const j=new Array(A.length);for(let x=0;x<A.length;x+=1)j[x]=await F(e,S,A[x]);p[g]=j}else p[g]=await F(e,S,A);continue}if(af(b)){if(R.isArray(A)){const C=new Array(A.length);for(let F=0;F<A.length;F+=1)C[F]=await f(e,S,A[F]);p[g]=C}else p[g]=await f(e,S,A);continue}if(b.type==="component"){const C=a(b.component);if(R.isArray(A)){const F=new Array(A.length);for(let j=0;j<A.length;j+=1)F[j]=await l(e,S,C,A[j]);p[g]=F}else p[g]=await l(e,S,C,A);continue}if(b.type==="dynamiczone"&&R.isArray(A)){const C=new Array(A.length);for(let F=0;F<A.length;F+=1)C[F]=await c(e,S,A[F]);p[g]=C;continue}}}return p},uf=({data:e})=>({remove(t){delete e[t]},set(t,n){e[t]=n}});var cf=R.curry(ht),we=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lf={exports:{}};(function(e,t){(function(n,r){e.exports=r(ln.default,ki.default)})(we,function(n,r){return function(i){function a(s){if(o[s])return o[s].exports;var u=o[s]={exports:{},id:s,loaded:!1};return i[s].call(u.exports,u,u.exports,a),u.loaded=!0,u.exports}var o={};return a.m=i,a.c=o,a.p="",a(0)}([function(i,a,o){i.exports=o(34)},function(i,a,o){var s=o(29)("wks"),u=o(33),f=o(2).Symbol,l=typeof f=="function",c=i.exports=function(p){return s[p]||(s[p]=l&&f[p]||(l?f:u)("Symbol."+p))};c.store=s},function(i,a){var o=i.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=o)},function(i,a,o){var s=o(9);i.exports=function(u){if(!s(u))throw TypeError(u+" is not an object!");return u}},function(i,a,o){i.exports=!o(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(i,a,o){var s=o(12),u=o(17);i.exports=o(4)?function(f,l,c){return s.f(f,l,u(1,c))}:function(f,l,c){return f[l]=c,f}},function(i,a){var o=i.exports={version:"2.4.0"};typeof __e=="number"&&(__e=o)},function(i,a,o){var s=o(14);i.exports=function(u,f,l){if(s(u),f===void 0)return u;switch(l){case 1:return function(c){return u.call(f,c)};case 2:return function(c,p){return u.call(f,c,p)};case 3:return function(c,p,d){return u.call(f,c,p,d)}}return function(){return u.apply(f,arguments)}}},function(i,a){var o={}.hasOwnProperty;i.exports=function(s,u){return o.call(s,u)}},function(i,a){i.exports=function(o){return typeof o=="object"?o!==null:typeof o=="function"}},function(i,a){i.exports={}},function(i,a){var o={}.toString;i.exports=function(s){return o.call(s).slice(8,-1)}},function(i,a,o){var s=o(3),u=o(26),f=o(32),l=Object.defineProperty;a.f=o(4)?Object.defineProperty:function(c,p,d){if(s(c),p=f(p,!0),s(d),u)try{return l(c,p,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(c[p]=d.value),c}},function(i,a,o){var s=o(42),u=o(15);i.exports=function(f){return s(u(f))}},function(i,a){i.exports=function(o){if(typeof o!="function")throw TypeError(o+" is not a function!");return o}},function(i,a){i.exports=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o}},function(i,a,o){var s=o(9),u=o(2).document,f=s(u)&&s(u.createElement);i.exports=function(l){return f?u.createElement(l):{}}},function(i,a){i.exports=function(o,s){return{enumerable:!(1&o),configurable:!(2&o),writable:!(4&o),value:s}}},function(i,a,o){var s=o(12).f,u=o(8),f=o(1)("toStringTag");i.exports=function(l,c,p){l&&!u(l=p?l:l.prototype,f)&&s(l,f,{configurable:!0,value:c})}},function(i,a,o){var s=o(29)("keys"),u=o(33);i.exports=function(f){return s[f]||(s[f]=u(f))}},function(i,a){var o=Math.ceil,s=Math.floor;i.exports=function(u){return isNaN(u=+u)?0:(u>0?s:o)(u)}},function(i,a,o){var s=o(11),u=o(1)("toStringTag"),f=s(function(){return arguments}())=="Arguments",l=function(c,p){try{return c[p]}catch{}};i.exports=function(c){var p,d,h;return c===void 0?"Undefined":c===null?"Null":typeof(d=l(p=Object(c),u))=="string"?d:f?s(p):(h=s(p))=="Object"&&typeof p.callee=="function"?"Arguments":h}},function(i,a){i.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(i,a,o){var s=o(2),u=o(6),f=o(7),l=o(5),c="prototype",p=function(d,h,m){var g,b,S,T=d&p.F,A=d&p.G,C=d&p.S,F=d&p.P,j=d&p.B,x=d&p.W,_=A?u:u[h]||(u[h]={}),N=_[c],v=A?s:C?s[h]:(s[h]||{})[c];A&&(m=h);for(g in m)b=!T&&v&&v[g]!==void 0,b&&g in _||(S=b?v[g]:m[g],_[g]=A&&typeof v[g]!="function"?m[g]:j&&b?f(S,s):x&&v[g]==S?function(M){var H=function(K,E,w){if(this instanceof M){switch(arguments.length){case 0:return new M;case 1:return new M(K);case 2:return new M(K,E)}return new M(K,E,w)}return M.apply(this,arguments)};return H[c]=M[c],H}(S):F&&typeof S=="function"?f(Function.call,S):S,F&&((_.virtual||(_.virtual={}))[g]=S,d&p.R&&N&&!N[g]&&l(N,g,S)))};p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128,i.exports=p},function(i,a){i.exports=function(o){try{return!!o()}catch{return!0}}},function(i,a,o){i.exports=o(2).document&&document.documentElement},function(i,a,o){i.exports=!o(4)&&!o(24)(function(){return Object.defineProperty(o(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(i,a,o){var s=o(28),u=o(23),f=o(57),l=o(5),c=o(8),p=o(10),d=o(45),h=o(18),m=o(52),g=o(1)("iterator"),b=!([].keys&&"next"in[].keys()),S="@@iterator",T="keys",A="values",C=function(){return this};i.exports=function(F,j,x,_,N,v,M){d(x,j,_);var H,K,E,w=function(D){if(!b&&D in z)return z[D];switch(D){case T:return function(){return new x(this,D)};case A:return function(){return new x(this,D)}}return function(){return new x(this,D)}},$=j+" Iterator",k=N==A,U=!1,z=F.prototype,V=z[g]||z[S]||N&&z[N],ee=V||w(N),Te=N?k?w("entries"):ee:void 0,I=j=="Array"&&z.entries||V;if(I&&(E=m(I.call(new F)),E!==Object.prototype&&(h(E,$,!0),s||c(E,g)||l(E,g,C))),k&&V&&V.name!==A&&(U=!0,ee=function(){return V.call(this)}),s&&!M||!b&&!U&&z[g]||l(z,g,ee),p[j]=ee,p[$]=C,N)if(H={values:k?ee:w(A),keys:v?ee:w(T),entries:Te},M)for(K in H)K in z||f(z,K,H[K]);else u(u.P+u.F*(b||U),j,H);return H}},function(i,a){i.exports=!0},function(i,a,o){var s=o(2),u="__core-js_shared__",f=s[u]||(s[u]={});i.exports=function(l){return f[l]||(f[l]={})}},function(i,a,o){var s,u,f,l=o(7),c=o(41),p=o(25),d=o(16),h=o(2),m=h.process,g=h.setImmediate,b=h.clearImmediate,S=h.MessageChannel,T=0,A={},C="onreadystatechange",F=function(){var x=+this;if(A.hasOwnProperty(x)){var _=A[x];delete A[x],_()}},j=function(x){F.call(x.data)};g&&b||(g=function(x){for(var _=[],N=1;arguments.length>N;)_.push(arguments[N++]);return A[++T]=function(){c(typeof x=="function"?x:Function(x),_)},s(T),T},b=function(x){delete A[x]},o(11)(m)=="process"?s=function(x){m.nextTick(l(F,x,1))}:S?(u=new S,f=u.port2,u.port1.onmessage=j,s=l(f.postMessage,f,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(s=function(x){h.postMessage(x+"","*")},h.addEventListener("message",j,!1)):s=C in d("script")?function(x){p.appendChild(d("script"))[C]=function(){p.removeChild(this),F.call(x)}}:function(x){setTimeout(l(F,x,1),0)}),i.exports={set:g,clear:b}},function(i,a,o){var s=o(20),u=Math.min;i.exports=function(f){return f>0?u(s(f),9007199254740991):0}},function(i,a,o){var s=o(9);i.exports=function(u,f){if(!s(u))return u;var l,c;if(f&&typeof(l=u.toString)=="function"&&!s(c=l.call(u))||typeof(l=u.valueOf)=="function"&&!s(c=l.call(u))||!f&&typeof(l=u.toString)=="function"&&!s(c=l.call(u)))return c;throw TypeError("Can't convert object to primitive value")}},function(i,a){var o=0,s=Math.random();i.exports=function(u){return"Symbol(".concat(u===void 0?"":u,")_",(++o+s).toString(36))}},function(i,a,o){function s(C){return C&&C.__esModule?C:{default:C}}function u(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function f(C){return(0,g.createHash)("sha256").update(C).digest("hex")}function l(C){switch(S){case"darwin":return C.split("IOPlatformUUID")[1].split(`
2
- `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return C.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return C.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return C.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function c(C){var F=l((0,m.execSync)(A[S]).toString());return C?F:f(F)}function p(C){return new h.default(function(F,j){return(0,m.exec)(A[S],{},function(x,_,N){if(x)return j(new Error("Error while obtaining machine id: "+x.stack));var v=l(_.toString());return F(C?v:f(v))})})}Object.defineProperty(a,"__esModule",{value:!0});var d=o(35),h=s(d);a.machineIdSync=c,a.machineId=p;var m=o(70),g=o(71),b=process,S=b.platform,T={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},A={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:T[u()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(i,a,o){i.exports={default:o(36),__esModule:!0}},function(i,a,o){o(66),o(68),o(69),o(67),i.exports=o(6).Promise},function(i,a){i.exports=function(){}},function(i,a){i.exports=function(o,s,u,f){if(!(o instanceof s)||f!==void 0&&f in o)throw TypeError(u+": incorrect invocation!");return o}},function(i,a,o){var s=o(13),u=o(31),f=o(62);i.exports=function(l){return function(c,p,d){var h,m=s(c),g=u(m.length),b=f(d,g);if(l&&p!=p){for(;g>b;)if(h=m[b++],h!=h)return!0}else for(;g>b;b++)if((l||b in m)&&m[b]===p)return l||b||0;return!l&&-1}}},function(i,m,o){var s=o(7),u=o(44),f=o(43),l=o(3),c=o(31),p=o(64),d={},h={},m=i.exports=function(g,b,S,T,A){var C,F,j,x,_=A?function(){return g}:p(g),N=s(S,T,b?2:1),v=0;if(typeof _!="function")throw TypeError(g+" is not iterable!");if(f(_)){for(C=c(g.length);C>v;v++)if(x=b?N(l(F=g[v])[0],F[1]):N(g[v]),x===d||x===h)return x}else for(j=_.call(g);!(F=j.next()).done;)if(x=u(j,N,F.value,b),x===d||x===h)return x};m.BREAK=d,m.RETURN=h},function(i,a){i.exports=function(o,s,u){var f=u===void 0;switch(s.length){case 0:return f?o():o.call(u);case 1:return f?o(s[0]):o.call(u,s[0]);case 2:return f?o(s[0],s[1]):o.call(u,s[0],s[1]);case 3:return f?o(s[0],s[1],s[2]):o.call(u,s[0],s[1],s[2]);case 4:return f?o(s[0],s[1],s[2],s[3]):o.call(u,s[0],s[1],s[2],s[3])}return o.apply(u,s)}},function(i,a,o){var s=o(11);i.exports=Object("z").propertyIsEnumerable(0)?Object:function(u){return s(u)=="String"?u.split(""):Object(u)}},function(i,a,o){var s=o(10),u=o(1)("iterator"),f=Array.prototype;i.exports=function(l){return l!==void 0&&(s.Array===l||f[u]===l)}},function(i,a,o){var s=o(3);i.exports=function(u,f,l,c){try{return c?f(s(l)[0],l[1]):f(l)}catch(d){var p=u.return;throw p!==void 0&&s(p.call(u)),d}}},function(i,a,o){var s=o(49),u=o(17),f=o(18),l={};o(5)(l,o(1)("iterator"),function(){return this}),i.exports=function(c,p,d){c.prototype=s(l,{next:u(1,d)}),f(c,p+" Iterator")}},function(i,a,o){var s=o(1)("iterator"),u=!1;try{var f=[7][s]();f.return=function(){u=!0},Array.from(f,function(){throw 2})}catch{}i.exports=function(l,c){if(!c&&!u)return!1;var p=!1;try{var d=[7],h=d[s]();h.next=function(){return{done:p=!0}},d[s]=function(){return h},l(d)}catch{}return p}},function(i,a){i.exports=function(o,s){return{value:s,done:!!o}}},function(i,a,o){var s=o(2),u=o(30).set,f=s.MutationObserver||s.WebKitMutationObserver,l=s.process,c=s.Promise,p=o(11)(l)=="process";i.exports=function(){var d,h,m,g=function(){var A,C;for(p&&(A=l.domain)&&A.exit();d;){C=d.fn,d=d.next;try{C()}catch(F){throw d?m():h=void 0,F}}h=void 0,A&&A.enter()};if(p)m=function(){l.nextTick(g)};else if(f){var b=!0,S=document.createTextNode("");new f(g).observe(S,{characterData:!0}),m=function(){S.data=b=!b}}else if(c&&c.resolve){var T=c.resolve();m=function(){T.then(g)}}else m=function(){u.call(s,g)};return function(A){var C={fn:A,next:void 0};h&&(h.next=C),d||(d=C,m()),h=C}}},function(i,a,o){var s=o(3),u=o(50),f=o(22),l=o(19)("IE_PROTO"),c=function(){},p="prototype",d=function(){var h,m=o(16)("iframe"),g=f.length,b=">";for(m.style.display="none",o(25).appendChild(m),m.src="javascript:",h=m.contentWindow.document,h.open(),h.write("<script>document.F=Object<\/script"+b),h.close(),d=h.F;g--;)delete d[p][f[g]];return d()};i.exports=Object.create||function(h,m){var g;return h!==null?(c[p]=s(h),g=new c,c[p]=null,g[l]=h):g=d(),m===void 0?g:u(g,m)}},function(i,a,o){var s=o(12),u=o(3),f=o(54);i.exports=o(4)?Object.defineProperties:function(l,c){u(l);for(var p,d=f(c),h=d.length,m=0;h>m;)s.f(l,p=d[m++],c[p]);return l}},function(i,a,o){var s=o(55),u=o(17),f=o(13),l=o(32),c=o(8),p=o(26),d=Object.getOwnPropertyDescriptor;a.f=o(4)?d:function(h,m){if(h=f(h),m=l(m,!0),p)try{return d(h,m)}catch{}if(c(h,m))return u(!s.f.call(h,m),h[m])}},function(i,a,o){var s=o(8),u=o(63),f=o(19)("IE_PROTO"),l=Object.prototype;i.exports=Object.getPrototypeOf||function(c){return c=u(c),s(c,f)?c[f]:typeof c.constructor=="function"&&c instanceof c.constructor?c.constructor.prototype:c instanceof Object?l:null}},function(i,a,o){var s=o(8),u=o(13),f=o(39)(!1),l=o(19)("IE_PROTO");i.exports=function(c,p){var d,h=u(c),m=0,g=[];for(d in h)d!=l&&s(h,d)&&g.push(d);for(;p.length>m;)s(h,d=p[m++])&&(~f(g,d)||g.push(d));return g}},function(i,a,o){var s=o(53),u=o(22);i.exports=Object.keys||function(f){return s(f,u)}},function(i,a){a.f={}.propertyIsEnumerable},function(i,a,o){var s=o(5);i.exports=function(u,f,l){for(var c in f)l&&u[c]?u[c]=f[c]:s(u,c,f[c]);return u}},function(i,a,o){i.exports=o(5)},function(i,a,o){var s=o(9),u=o(3),f=function(l,c){if(u(l),!s(c)&&c!==null)throw TypeError(c+": can't set as prototype!")};i.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(l,c,p){try{p=o(7)(Function.call,o(51).f(Object.prototype,"__proto__").set,2),p(l,[]),c=!(l instanceof Array)}catch{c=!0}return function(d,h){return f(d,h),c?d.__proto__=h:p(d,h),d}}({},!1):void 0),check:f}},function(i,a,o){var s=o(2),u=o(6),f=o(12),l=o(4),c=o(1)("species");i.exports=function(p){var d=typeof u[p]=="function"?u[p]:s[p];l&&d&&!d[c]&&f.f(d,c,{configurable:!0,get:function(){return this}})}},function(i,a,o){var s=o(3),u=o(14),f=o(1)("species");i.exports=function(l,c){var p,d=s(l).constructor;return d===void 0||(p=s(d)[f])==null?c:u(p)}},function(i,a,o){var s=o(20),u=o(15);i.exports=function(f){return function(l,c){var p,d,h=String(u(l)),m=s(c),g=h.length;return m<0||m>=g?f?"":void 0:(p=h.charCodeAt(m),p<55296||p>56319||m+1===g||(d=h.charCodeAt(m+1))<56320||d>57343?f?h.charAt(m):p:f?h.slice(m,m+2):(p-55296<<10)+(d-56320)+65536)}}},function(i,a,o){var s=o(20),u=Math.max,f=Math.min;i.exports=function(l,c){return l=s(l),l<0?u(l+c,0):f(l,c)}},function(i,a,o){var s=o(15);i.exports=function(u){return Object(s(u))}},function(i,a,o){var s=o(21),u=o(1)("iterator"),f=o(10);i.exports=o(6).getIteratorMethod=function(l){if(l!=null)return l[u]||l["@@iterator"]||f[s(l)]}},function(i,a,o){var s=o(37),u=o(47),f=o(10),l=o(13);i.exports=o(27)(Array,"Array",function(c,p){this._t=l(c),this._i=0,this._k=p},function(){var c=this._t,p=this._k,d=this._i++;return!c||d>=c.length?(this._t=void 0,u(1)):p=="keys"?u(0,d):p=="values"?u(0,c[d]):u(0,[d,c[d]])},"values"),f.Arguments=f.Array,s("keys"),s("values"),s("entries")},function(i,a){},function(i,a,o){var s,u,f,l=o(28),c=o(2),p=o(7),d=o(21),h=o(23),m=o(9),g=(o(3),o(14)),b=o(38),S=o(40),T=(o(58).set,o(60)),A=o(30).set,C=o(48)(),F="Promise",j=c.TypeError,_=c.process,x=c[F],_=c.process,N=d(_)=="process",v=function(){},M=!!function(){try{var I=x.resolve(1),D=(I.constructor={})[o(1)("species")]=function(P){P(v,v)};return(N||typeof PromiseRejectionEvent=="function")&&I.then(v)instanceof D}catch{}}(),H=function(I,D){return I===D||I===x&&D===f},K=function(I){var D;return!(!m(I)||typeof(D=I.then)!="function")&&D},E=function(I){return H(x,I)?new w(I):new u(I)},w=u=function(I){var D,P;this.promise=new I(function(Q,ce){if(D!==void 0||P!==void 0)throw j("Bad Promise constructor");D=Q,P=ce}),this.resolve=g(D),this.reject=g(P)},$=function(I){try{I()}catch(D){return{error:D}}},k=function(I,D){if(!I._n){I._n=!0;var P=I._c;C(function(){for(var Q=I._v,ce=I._s==1,L=0,Y=function(O){var q,X,oe=ce?O.ok:O.fail,Z=O.resolve,Ne=O.reject,je=O.domain;try{oe?(ce||(I._h==2&&V(I),I._h=1),oe===!0?q=Q:(je&&je.enter(),q=oe(Q),je&&je.exit()),q===O.promise?Ne(j("Promise-chain cycle")):(X=K(q))?X.call(q,Z,Ne):Z(q)):Ne(Q)}catch(Uu){Ne(Uu)}};P.length>L;)Y(P[L++]);I._c=[],I._n=!1,D&&!I._h&&U(I)})}},U=function(I){A.call(c,function(){var D,P,Q,ce=I._v;if(z(I)&&(D=$(function(){N?_.emit("unhandledRejection",ce,I):(P=c.onunhandledrejection)?P({promise:I,reason:ce}):(Q=c.console)&&Q.error&&Q.error("Unhandled promise rejection",ce)}),I._h=N||z(I)?2:1),I._a=void 0,D)throw D.error})},z=function(I){if(I._h==1)return!1;for(var D,P=I._a||I._c,Q=0;P.length>Q;)if(D=P[Q++],D.fail||!z(D.promise))return!1;return!0},V=function(I){A.call(c,function(){var D;N?_.emit("rejectionHandled",I):(D=c.onrejectionhandled)&&D({promise:I,reason:I._v})})},ee=function(I){var D=this;D._d||(D._d=!0,D=D._w||D,D._v=I,D._s=2,D._a||(D._a=D._c.slice()),k(D,!0))},Te=function(I){var D,P=this;if(!P._d){P._d=!0,P=P._w||P;try{if(P===I)throw j("Promise can't be resolved itself");(D=K(I))?C(function(){var Q={_w:P,_d:!1};try{D.call(I,p(Te,Q,1),p(ee,Q,1))}catch(ce){ee.call(Q,ce)}}):(P._v=I,P._s=1,k(P,!1))}catch(Q){ee.call({_w:P,_d:!1},Q)}}};M||(x=function(I){b(this,x,F,"_h"),g(I),s.call(this);try{I(p(Te,this,1),p(ee,this,1))}catch(D){ee.call(this,D)}},s=function(I){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},s.prototype=o(56)(x.prototype,{then:function(I,D){var P=E(T(this,x));return P.ok=typeof I!="function"||I,P.fail=typeof D=="function"&&D,P.domain=N?_.domain:void 0,this._c.push(P),this._a&&this._a.push(P),this._s&&k(this,!1),P.promise},catch:function(I){return this.then(void 0,I)}}),w=function(){var I=new s;this.promise=I,this.resolve=p(Te,I,1),this.reject=p(ee,I,1)}),h(h.G+h.W+h.F*!M,{Promise:x}),o(18)(x,F),o(59)(F),f=o(6)[F],h(h.S+h.F*!M,F,{reject:function(I){var D=E(this),P=D.reject;return P(I),D.promise}}),h(h.S+h.F*(l||!M),F,{resolve:function(I){if(I instanceof x&&H(I.constructor,this))return I;var D=E(this),P=D.resolve;return P(I),D.promise}}),h(h.S+h.F*!(M&&o(46)(function(I){x.all(I).catch(v)})),F,{all:function(I){var D=this,P=E(D),Q=P.resolve,ce=P.reject,L=$(function(){var Y=[],O=0,q=1;S(I,!1,function(X){var oe=O++,Z=!1;Y.push(void 0),q++,D.resolve(X).then(function(Ne){Z||(Z=!0,Y[oe]=Ne,--q||Q(Y))},ce)}),--q||Q(Y)});return L&&ce(L.error),P.promise},race:function(I){var D=this,P=E(D),Q=P.reject,ce=$(function(){S(I,!1,function(L){D.resolve(L).then(P.resolve,Q)})});return ce&&Q(ce.error),P.promise}})},function(i,a,o){var s=o(61)(!0);o(27)(String,"String",function(u){this._t=String(u),this._i=0},function(){var u,f=this._t,l=this._i;return l>=f.length?{value:void 0,done:!0}:(u=s(f,l),this._i+=u.length,{value:u,done:!1})})},function(i,a,o){o(65);for(var s=o(2),u=o(5),f=o(10),l=o(1)("toStringTag"),c=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var d=c[p],h=s[d],m=h&&h.prototype;m&&!m[l]&&u(m,l,d),f[d]=f.Array}},function(i,a){i.exports=ln.default},function(i,a){i.exports=ki.default}])})})(lf);var Pr;try{Pr=Map}catch{}var Lr;try{Lr=Set}catch{}function Na(e,t,n){if(!e||typeof e!="object"||typeof e=="function")return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(kr);if(Pr&&e instanceof Pr)return new Map(Array.from(e.entries()));if(Lr&&e instanceof Lr)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);n.push(r);for(var i in e){var a=t.findIndex(function(o){return o===e[i]});r[i]=a>-1?n[a]:Na(e[i],t,n)}return r}return e}function kr(e){return Na(e,[],[])}const ff=Object.prototype.toString,pf=Error.prototype.toString,df=RegExp.prototype.toString,hf=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",mf=/^Symbol\((.*)\)(.*)$/;function gf(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function qi(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return gf(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return hf.call(e).replace(mf,"Symbol($1)");const r=ff.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+pf.call(e)+"]":r==="RegExp"?df.call(e):null}function xt(e,t){let n=qi(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let a=qi(this[r],t);return a!==null?a:i},2)}let Ye={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{let i=r!=null&&r!==n,a=`${e} must be a \`${t}\` type, but the final value was: \`${xt(n,!0)}\``+(i?` (cast from the value \`${xt(r,!0)}\`).`:".");return n===null&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},$e={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},yf={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Dr={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},vf={isValue:"${path} field must be ${value}"},Mr={noUnknown:"${path} field has unspecified keys: ${unknown}"},rn={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};const Ef=Object.assign(Object.create(null),{mixed:Ye,string:$e,number:yf,date:Dr,object:Mr,array:rn,boolean:vf}),Dn=e=>e&&e.__isYupSchema__;class wf{constructor(t,n){if(this.refs=t,this.refs=t,typeof n=="function"){this.fn=n;return}if(!fn.default(n,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:a}=n,o=typeof r=="function"?r:(...s)=>s.every(u=>u===r);this.fn=function(...s){let u=s.pop(),f=s.pop(),l=o(...s)?i:a;if(l)return typeof l=="function"?l(f):f.concat(l.resolve(u))}}resolve(t,n){let r=this.refs.map(a=>a.getValue(n?.value,n?.parent,n?.context)),i=this.fn.apply(t,r.concat(t,n));if(i===void 0||i===t)return t;if(!Dn(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}function Pa(e){return e==null?[]:[].concat(e)}function jr(){return jr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jr.apply(this,arguments)}let bf=/\$\{\s*(\w+)\s*\}/g;class ge extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=jr({},n,{path:r})),typeof t=="string"?t.replace(bf,(i,a)=>xt(n[a])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i){super(),this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],Pa(t).forEach(a=>{ge.isError(a)?(this.errors.push(...a.errors),this.inner=this.inner.concat(a.inner.length?a.inner:a)):this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,ge)}}const Sf=e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}};function hn(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,f=Sf(t),l=r.length;const c=[];if(o=o||[],!l)return o.length?f(new ge(o,a,u)):f(null,a);for(let p=0;p<r.length;p++){const d=r[p];d(i,function(m){if(m){if(!ge.isError(m))return f(m,a);if(n)return m.value=a,f(m,a);c.push(m)}if(--l<=0){if(c.length&&(s&&c.sort(s),o.length&&c.push(...o),o=c),o.length){f(new ge(o,a,u),a);return}f(null,a)}})}}function ot(e){this._maxSize=e,this.clear()}ot.prototype.clear=function(){this._size=0,this._values=Object.create(null)};ot.prototype.get=function(e){return this._values[e]};ot.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var xf=/[^.^\]^[]+|(?=\[\]|\.\.)/g,La=/^\d+$/,_f=/^\d/,Af=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Tf=/^\s*(['"]?)(.*?)(\1)\s*$/,Zr=512,Ki=new ot(Zr),Wi=new ot(Zr),zi=new ot(Zr),Mn={Cache:ot,split:Hr,normalizePath:ir,setter:function(e){var t=ir(e);return Wi.get(e)||Wi.set(e,function(r,i){for(var a=0,o=t.length,s=r;a<o-1;){var u=t[a];if(u==="__proto__"||u==="constructor"||u==="prototype")return r;s=s[t[a++]]}s[t[a]]=i})},getter:function(e,t){var n=ir(e);return zi.get(e)||zi.set(e,function(i){for(var a=0,o=n.length;a<o;)if(i!=null||!t)i=i[n[a++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(Jr(n)||La.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){Cf(Array.isArray(e)?e:Hr(e),t,n)}};function ir(e){return Ki.get(e)||Ki.set(e,Hr(e).map(function(t){return t.replace(Tf,"$2")}))}function Hr(e){return e.match(xf)||[""]}function Cf(e,t,n){var r=e.length,i,a,o,s;for(a=0;a<r;a++)i=e[a],i&&($f(i)&&(i='"'+i+'"'),s=Jr(i),o=!s&&/^\d+$/.test(i),t.call(n,i,s,o,a,e))}function Jr(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function Rf(e){return e.match(_f)&&!e.match(La)}function Ff(e){return Af.test(e)}function $f(e){return!Jr(e)&&(Rf(e)||Ff(e))}const Vt={context:"$",value:"."};class tt{constructor(t,n={}){if(typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Vt.context,this.isValue=this.key[0]===Vt.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Vt.context:this.isValue?Vt.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Mn.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n?.parent,n?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}tt.prototype.__isYupRef=!0;function mn(){return mn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mn.apply(this,arguments)}function If(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Xt(e){function t(n,r){let{value:i,path:a="",label:o,options:s,originalValue:u,sync:f}=n,l=If(n,["value","path","label","options","originalValue","sync"]);const{name:c,test:p,params:d,message:h}=e;let{parent:m,context:g}=s;function b(F){return tt.isRef(F)?F.getValue(i,m,g):F}function S(F={}){const j=pa.default(mn({value:i,originalValue:u,label:o,path:F.path||a},d,F.params),b),x=new ge(ge.formatError(F.message||h,j),i,j.path,F.type||c);return x.params=j,x}let T=mn({path:a,parent:m,type:c,createError:S,resolve:b,options:s,originalValue:u},l);if(!f){try{Promise.resolve(p.call(T,i,T)).then(F=>{ge.isError(F)?r(F):F?r(null,F):r(S())})}catch(F){r(F)}return}let A;try{var C;if(A=p.call(T,i,T),typeof((C=A)==null?void 0:C.then)=="function")throw new Error(`Validation test of type: "${T.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(F){r(F);return}ge.isError(A)?r(A):A?r(null,A):r(S())}return t.OPTIONS=e,t}let Of=e=>e.substr(0,e.length-1).substr(1);function Nf(e,t,n,r=n){let i,a,o;return t?(Mn.forEach(t,(s,u,f)=>{let l=u?Of(s):s;if(e=e.resolve({context:r,parent:i,value:n}),e.innerType){let c=f?parseInt(l,10):0;if(n&&c>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[c],e=e.innerType}if(!f){if(!e.fields||!e.fields[l])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[l],e=e.fields[l]}a=l,o=u?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class gn{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){const t=[];for(const n of this.list)t.push(n);for(const[,n]of this.refs)t.push(n.describe());return t}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(t){tt.isRef(t)?this.refs.set(t.key,t):this.list.add(t)}delete(t){tt.isRef(t)?this.refs.delete(t.key):this.list.delete(t)}has(t,n){if(this.list.has(t))return!0;let r,i=this.refs.values();for(;r=i.next(),!r.done;)if(n(r.value)===t)return!0;return!1}clone(){const t=new gn;return t.list=new Set(this.list),t.refs=new Map(this.refs),t}merge(t,n){const r=this.clone();return t.list.forEach(i=>r.add(i)),t.refs.forEach(i=>r.add(i)),n.list.forEach(i=>r.delete(i)),n.refs.forEach(i=>r.delete(i)),r}}function Ce(){return Ce=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ce.apply(this,arguments)}class ye{constructor(t){this.deps=[],this.conditions=[],this._whitelist=new gn,this._blacklist=new gn,this.exclusiveTests=Object.create(null),this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Ye.notType)}),this.type=t?.type||"mixed",this.spec=Ce({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},t?.spec)}get _type(){return this.type}_typeCheck(t){return!0}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeError=this._typeError,n._whitelistError=this._whitelistError,n._blacklistError=this._blacklistError,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.exclusiveTests=Ce({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=kr(Ce({},this.spec,t)),n}label(t){var n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Ce({},n.spec,r.spec);return r.spec=i,r._typeError||(r._typeError=n._typeError),r._whitelistError||(r._whitelistError=n._whitelistError),r._blacklistError||(r._blacklistError=n._blacklistError),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(a=>{t.tests.forEach(o=>{a.test(o.OPTIONS)})}),r}isType(t){return this.spec.nullable&&t===null?!0:this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,a)=>a.resolve(i,t),n),n=n.resolve(t)}return n}cast(t,n={}){let r=this.resolve(Ce({value:t},n)),i=r._cast(t,n);if(t!==void 0&&n.assert!==!1&&r.isType(i)!==!0){let a=xt(t),o=xt(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r._type}".
1
+ "use strict";const B=require("lodash"),Qr=require("zod"),C=require("lodash/fp"),qu=require("crypto"),Ku=require("child_process"),Wu=require("lodash/has"),zu=require("lodash/mapValues"),Yu=require("lodash/snakeCase"),Qu=require("lodash/camelCase"),Vu=require("lodash/mapKeys"),Xu=require("os"),Zu=require("path"),Ju=require("fs"),ec=require("assert"),tc=require("events"),nc=require("buffer"),rc=require("stream"),ic=require("util"),oc=require("constants");require("node:stream");const ac=require("@sindresorhus/slugify"),sc=require("zod/v4"),uc=require("pluralize"),ue=e=>e&&e.__esModule?e:{default:e};function fa(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const me=ue(B),y=fa(Qr),ki=ue(qu),ln=ue(Ku),fn=ue(Wu),pa=ue(zu),Di=ue(Yu),cc=ue(Qu),lc=ue(Vu),Ln=ue(Xu),Se=ue(Zu),We=ue(Ju),da=ue(ec),fc=ue(tc),pc=ue(nc),kn=ue(rc),it=ue(ic),dc=ue(oc),hc=ue(ac),W=fa(sc),Mi=ue(uc),Vr=y.object({name:y.string({required_error:"requiredError"}).nonempty("requiredError").refine(e=>!e.includes(" "),{message:"noSpaceError"}),label:y.string({required_error:"requiredError"}).nonempty("requiredError"),description:y.string().optional(),placeholder:y.string().optional(),required:y.boolean().optional(),enabled:y.boolean().optional()}),mc=Vr.extend({type:y.literal("select"),multi:y.boolean(),options:y.array(y.string(),{required_error:"requiredError"}).min(1,{message:"requiredError"})}),gc=Vr.extend({type:y.enum(["boolean","string"]),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),yc=Vr.extend({type:y.literal("media"),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),ha=y.discriminatedUnion("type",[gc,yc,mc]),ma=y.union([y.literal("audience"),ha]),vc=y.object({additionalFields:y.array(ma),allowedLevels:y.number(),contentTypes:y.array(y.string()),defaultContentType:y.string().optional(),contentTypesNameFields:y.record(y.string(),y.array(y.string())),contentTypesPopulate:y.record(y.string(),y.array(y.string())),gql:y.object({navigationItemRelated:y.array(y.string())}),pathDefaultFields:y.record(y.string(),y.any()),cascadeMenuAttached:y.boolean(),preferCustomContentTypes:y.boolean(),isCacheEnabled:y.boolean().optional()}),ga=y.object({id:y.number(),documentId:y.string(),name:y.string(),key:y.string()}),wc=y.enum(["INTERNAL","EXTERNAL","WRAPPER"]),Xr=y.object({id:y.number(),documentId:y.string(),title:y.string(),type:wc,path:y.string().or(y.null()).optional(),slug:y.string().or(y.null()).optional(),externalPath:y.string().or(y.null()).optional(),uiRouterKey:y.string(),menuAttached:y.boolean(),order:y.number().int(),collapsed:y.boolean(),related:y.object({documentId:y.string().optional(),__type:y.string()}).catchall(y.unknown()).nullish().optional(),additionalFields:y.record(y.string(),y.unknown()).or(y.null()).optional(),audience:y.array(ga).or(y.null()).optional(),autoSync:y.boolean().or(y.null()).optional()}),Ec=Xr.omit({related:!0}).pick({path:!0,type:!0,uiRouterKey:!0,title:!0,externalPath:!0}).extend({related:y.unknown().optional()}),Lt=Xr.extend({parent:y.lazy(()=>Lt.or(y.null())).optional(),items:y.lazy(()=>Lt.array()).optional(),master:y.lazy(()=>Ve(!1)).optional()}),ji=y.array(Lt),Ve=e=>y.object({id:y.number(),documentId:y.string(),name:y.string(),slug:y.string(),locale:y.string(),visible:y.boolean(),items:e?y.array(Lt):Lt.array().optional()}),bc=Ve(!1).omit({items:!0,id:!0,documentId:!0,slug:!0,locale:!0}).extend({documentId:y.string().optional(),id:y.undefined().optional()}),Sc=Xr.omit({id:!0,documentId:!0}).extend({id:y.number().optional(),documentId:y.string().optional(),items:y.lazy(()=>ya).or(y.null()).optional(),updated:y.boolean().optional(),removed:y.boolean().optional()}),ya=y.array(Sc),xc=Ve(!1).extend({items:ya}).partial().required({id:!0,documentId:!0}),_c=y.enum(["collectionType","singleType"]),Ac=y.object({singularName:y.string(),pluralName:y.string(),displayName:y.string(),description:y.string().optional(),name:y.string().optional()}),va=y.object({required:y.boolean().optional(),max:y.number().optional(),min:y.number().optional(),minLength:y.number().optional(),maxLength:y.number().optional(),private:y.boolean().optional(),configurable:y.boolean().optional(),default:y.any().optional()}),Tc=y.enum(["string","text","richtext","blocks","email","password","date","time","datetime","timestamp","boolean","integer","biginteger","float","decimal","json","relation","media"]),Cc=va.extend({type:Tc}),Rc=va.extend({type:y.literal("enumeration"),enum:y.string().array()}),Fc=y.object({type:y.literal("component"),component:y.string(),repeatable:y.boolean().optional()}),$c=y.object({type:y.literal("dynamiczone"),components:y.string().array()}),Ic=y.object({type:y.literal("uid")}),Oc=y.object({type:y.literal("media"),allowedTypes:y.enum(["images","videos","audios","files"]).array(),required:y.boolean().optional()}),Nc=y.enum(["oneToOne","oneToMany","manyToOne","manyToMany","morphToMany","manyToMorph"]),Pc=y.object({type:y.literal("relation"),relation:Nc,target:y.string(),mappedBy:y.string().optional(),inversedBy:y.string().optional()}),Lc=y.record(y.string(),y.union([Cc,Rc,Fc,$c,Pc,Oc,Ic])),Tr=y.object({kind:_c,collectionName:y.string(),info:Ac,options:y.object({draftAndPublish:y.boolean().optional(),hidden:y.boolean().optional(),templateName:y.string().optional()}).optional(),attributes:Lc,actions:y.record(y.string(),y.any()).optional(),lifecycles:y.record(y.string(),y.any()).optional(),uid:y.string(),apiName:y.string().optional(),associations:y.object({model:y.string(),alias:y.string()}).array().optional(),modelName:y.string().optional(),plugin:y.string().optional(),pluginOptions:y.record(y.string(),y.any()).optional(),isSingle:y.boolean().optional()});Tr.pick({info:!0,kind:!0,attributes:!0,options:!0});const Mt=(e,t)=>n=>{t(n(e()))};let Cr=vc;const kc=Mt(()=>Cr,e=>{Cr=e});let Rr=ma;const Dc=Mt(()=>Rr,e=>{Rr=e});let Fr=ha;const Mc=Mt(()=>Fr,e=>{Fr=e});let $r=bc;const jc=Mt(()=>$r,e=>{$r=e});let Ir=xc;const Hc=Mt(()=>Ir,e=>{Ir=e}),Re={get configSchema(){return Cr},get navigationItemAdditionalField(){return Rr},get navigationItemCustomField(){return Fr},get createNavigationSchema(){return $r},get updateNavigationSchema(){return Ir}},Bc=/^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,Uc=["beforeCreate","beforeCreateMany","afterCreate","afterCreateMany","beforeUpdate","beforeUpdateMany","afterUpdate","afterUpdateMany","beforeDelete","beforeDeleteMany","afterDelete","afterDeleteMany","beforeCount","afterCount","beforeFindOne","afterFindOne","beforeFindMany","afterFindMany"],Gc="$",wa=["api::","plugin::"],Ea=["admin::","plugin::content-releases","plugin::i18n.locale","plugin::navigation","plugin::review-workflows","plugin::users-permissions","plugin::upload.folder"],qc=["title","subject","name"],Hi={SINGLE:"singleType"},Bi=["title","type","path","externalPath","uiRouterKey","menuAttached","order","collapsed","related","parent","master","audience","additionalFields"],Kc=e=>e.filter(t=>t!=="audience"),ba=e=>{const t=Kc(e);if(t.length!==B.uniqBy(t,"name").length)throw new Error("All names of custom fields must be unique.");if(!B.isNil(B.find(t,n=>typeof n=="object"&&B.includes(Bi,n.name))))throw new Error(`Name of custom field cannot be one of: ${Bi.join(", ")}`)},Sa=(e,t)=>{if(e==null)throw t??new Error("Non-empty value expected, empty given")},Wc=(e="")=>{const t=a=>a.split("-").map(o=>B.capitalize(o)).join(""),[n,r,i]=zc(e);return n==="api"?t(i):`${t(r)}${t(i)}`},zc=(e="")=>e.split(Bc).filter(t=>t&&t.length>0),Yc=(e,t)=>n=>[n,async r=>{await re(t,"common").runLifeCycleHook({contentTypeName:e,hookName:n,event:r})}],xa=(e,t)=>Object.fromEntries(Uc.map(Yc(e,t))),we=({strapi:e})=>{const t=e.plugin("navigation");return{masterModel:t.contentType("navigation"),itemModel:t.contentType("navigation-item"),relatedModel:t.contentType("navigations-items-related"),audienceModel:t.contentType("audience")}};function re({strapi:e},t){return e.plugin("navigation").service(t)}const Yt=e=>e==="*"?"*":typeof e=="string"?[e]:e===!1?[]:e===!0?"*":e,Qc=(e="")=>{const t=!!wa.find(r=>e.includes(r)),n=!Ea.find(r=>e.includes(r)||e===r);return!!e&&t&&n},Ui=(e="")=>B.last(e)==="s"?e.substr(0,e.length-1):e,_a=async({strapi:e,forceDefault:t=!1})=>{const n=e.store({type:"plugin",name:"navigation"}),r=await e.plugin("navigation").config,i=t?{}:{...Or.default,...await n.get({key:"config"})??Or.default};let a=B.isEmpty(i)?i:Re.configSchema.parse(i);const o=Vc(a,r);return a={additionalFields:o("additionalFields"),contentTypes:o("contentTypes"),contentTypesNameFields:o("contentTypesNameFields"),contentTypesPopulate:o("contentTypesPopulate"),defaultContentType:o("defaultContentType"),allowedLevels:o("allowedLevels"),gql:o("gql"),pathDefaultFields:o("pathDefaultFields"),cascadeMenuAttached:o("cascadeMenuAttached"),preferCustomContentTypes:o("preferCustomContentTypes"),isCacheEnabled:o("isCacheEnabled")},Xc(a,{strapi:e}),ba(a.additionalFields),await n.set({key:"config",value:a}),a},Vc=(e,t)=>n=>{const r=e?.[n]??t(n);return Sa(r,new Error(`[Navigation] Config "${n}" is undefined`)),r},Xc=(e,{strapi:t})=>{const n=e.contentTypes.filter(i=>!t.contentTypes[i]);if(n.length===0)return;const r=n.map(Wc);e.contentTypes=e.contentTypes.filter(i=>!n.includes(i)),e.contentTypesNameFields=Object.fromEntries(Object.entries(e.contentTypesNameFields).filter(([i])=>!n.includes(i))),e.gql.navigationItemRelated=e.gql.navigationItemRelated.filter(i=>!r.includes(i))},Or={default:{additionalFields:[],allowedLevels:2,contentTypes:[],defaultContentType:"",contentTypesNameFields:{},contentTypesPopulate:{},gql:{navigationItemRelated:[]},pathDefaultFields:{},pruneObsoleteI18nNavigations:!1,cascadeMenuAttached:!0,preferCustomContentTypes:!1,isCacheEnabled:!1}},Zc=B.once(e=>({find(t,n){const{audienceModel:{uid:r}}=we(e);return e.strapi.query(r).findMany({where:t,limit:n}).then(ga.array().parse)}})),pn=(e,t)=>({findFirst(n,r,i={}){return e.strapi.documents(t).findFirst({populate:Yt(n),status:r,...i})},findById(n,r,i,a={}){return e.strapi.documents(t).findOne({documentId:n,populate:Yt(r),status:i,...a})},findManyById(n,r,i){return e.strapi.documents(t).findMany({where:{documentId:{$in:n}},populate:Yt(r),status:i})},findMany(n,r,i,a){return e.strapi.documents(t).findMany({where:n,populate:Yt(r),status:i,locale:a})},count(n,r){return e.strapi.documents(t).count({where:n,status:r})}}),Le=B.once(e=>({async save({item:t,locale:n}){const{itemModel:r}=we(e),{__type:i,documentId:a}=t?.related??{},o=i?pn(e,i):void 0,s=i&&o?a?await o.findById(a,void 0,void 0,{locale:n}):await o.findFirst(void 0,void 0,{locale:n}):void 0;if(typeof t.documentId=="string"){const{documentId:u,...f}=t;return e.strapi.documents(r.uid).update({documentId:t.documentId,data:{...f,related:s?{...s,__type:i}:void 0},locale:n})}else return e.strapi.documents(r.uid).create({data:{...t,related:s?{...s,__type:i}:void 0},locale:n})},find({filters:t,locale:n,limit:r,order:i,populate:a}){const{itemModel:o}=we(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:a,orderBy:i}).then(s=>s.map(Nr)).then(ji.parse).then(s=>s.map(dn))},findV4({filters:t,locale:n,limit:r,order:i,populate:a}){const{itemModel:o}=we(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:a,orderBy:i})},count(t){const{itemModel:n}=we(e);return e.strapi.query(n.uid).count({where:t})},remove(t){const{itemModel:n}=we(e);return e.strapi.documents(n.uid).delete({documentId:t.documentId,populate:"*"})},removeForIds(t){const{itemModel:n}=we(e);return t.map(r=>e.strapi.documents(n.uid).delete({documentId:r,populate:"*"}))},findForMasterIds(t){const{itemModel:n}=we(e);return e.strapi.query(n.uid).findMany({where:{$or:t.map(r=>({master:r}))},limit:Number.MAX_SAFE_INTEGER}).then(ji.parse)}})),Jc=["id","publishedAt","createdAt","updatedAt","locale"],dn=({related:e,items:t=[],...n})=>({...n,items:t.map(dn),related:e?B.omit(e,Jc):void 0}),Nr=({related:e,...t})=>({...t,related:e?.[0]});class St extends Error{constructor(t,n){super(t),this.additionalInfo=n,this.type="NavigationError"}}class rr extends St{constructor(){super(...arguments),this.type="FillNavigationError"}}class el extends St{constructor(){super(...arguments),this.type="InvalidParamNavigationError"}}const Gi=e=>e===!0?!0:Array.isArray(e)?e.includes("items"):!1,Ie=B.once(e=>({find({filters:t,locale:n,limit:r,orderBy:i,populate:a}){const{masterModel:o}=we(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:a,orderBy:i}).then(s=>s.map(({items:u,...f})=>({...f,items:u?.map(Nr)}))).then(s=>s.map(({items:u,...f})=>({...f,items:u?.map(dn)}))).then(s=>Ve(Gi(a)).array().parse(s))},findOne({locale:t,filters:n,populate:r}){const{masterModel:i}=we(e);return e.strapi.documents(i.uid).findOne({documentId:n.documentId,locale:t,populate:r}).then(a=>a&&{...a,items:a.items?.map(Nr)}).then(a=>Ve(Gi(r)).parse(a)).then(a=>({...a,items:a.items?.map(dn)}))},async save(t){const{masterModel:n}=we(e),{documentId:r,locale:i,...a}=t;return r?e.strapi.documents(n.uid).update({locale:i,documentId:r,data:B.omit(a,["id","documentId"]),populate:["items"]}).then(Ve(!1).parse):e.strapi.documents(n.uid).create({locale:i,data:{...a,populate:["items"]}}).then(Ve(!1).parse)},remove(t){const{masterModel:n}=we(e);if(!t.documentId)throw new St("Document id is required.");return e.strapi.documents(n.uid).delete({documentId:t.documentId})}})),tl="Navigation",nl="navigation",rl=async e=>{const t=re(e,"common"),{defaultLocale:n,restLocale:r=[]}=await t.readLocale(),i=Ie(e),a=await i.find({limit:Number.MAX_SAFE_INTEGER,filters:{},locale:"*"});a.length===0&&a.push(await i.save({name:tl,visible:!0,locale:n,slug:nl}));const o=a.filter(({locale:s})=>s===n);for(const s of o)for(const u of r)!a.find(({locale:l,documentId:c})=>c===s.documentId&&u===l)&&await i.save({documentId:s.documentId,name:s.name,locale:u,visible:s.visible,slug:s.slug})},he={render:function(e){return`plugin::navigation.${e}`},navigation:{read:"read",update:"update",settings:"settings"}},il=async({strapi:e})=>{const t=[{section:"plugins",displayName:"Read",uid:he.navigation.read,pluginName:"navigation"},{section:"plugins",displayName:"Update",uid:he.navigation.update,pluginName:"navigation"},{section:"plugins",displayName:"Settings",uid:he.navigation.settings,pluginName:"navigation"}];await e.admin.services.permission.actionProvider.registerMany(t)},ol="I18NLocaleCode",al=({strapi:e,nexus:t})=>{const{nonNull:n,list:r,stringArg:i,booleanArg:a}=t;return{args:{navigationIdOrSlug:n(i()),type:"NavigationRenderType",menuOnly:a(),path:i(),locale:t.arg({type:ol})},type:n(r("NavigationItem")),resolve(u,{navigationIdOrSlug:f,type:l,menuOnly:c,path:p,locale:d}){const h=Qr.z.string().parse(f);return re({strapi:e},"client").render({idOrSlug:h,type:l,rootPath:p,locale:d,menuOnly:c,wrapRelated:!0})}}},sl=({strapi:e,nexus:t})=>{const{nonNull:n,list:r,stringArg:i,booleanArg:a}=t;return{type:n(r("NavigationItem")),args:{documentId:n(i()),childUiKey:n(i()),type:"NavigationRenderType",menuOnly:a()},resolve(o,s){const{documentId:u,childUIKey:f,type:l,menuOnly:c}=s,p=Qr.z.string().parse(u);return re({strapi:e},"client").renderChildren({idOrSlug:p,childUIKey:f,type:l,menuOnly:c,wrapRelated:!0})}}},ul=e=>{const t={renderNavigationChild:sl,renderNavigation:al};return e.nexus.extendType({type:"Query",definition(n){for(const[r,i]of Object.entries(t)){const a=i(e);n.field(r,a)}}})},cl=()=>({"Query.renderNavigationChild":{auth:!1},"Query.renderNavigation":{auth:!1}}),ll=({nexus:e})=>e.objectType({name:"ContentTypes",definition(t){t.nonNull.string("uid"),t.nonNull.string("name"),t.nonNull.boolean("isSingle"),t.nonNull.string("collectionName"),t.nonNull.string("contentTypeName"),t.nonNull.string("label"),t.nonNull.string("relatedField"),t.nonNull.string("labelSingular"),t.nonNull.string("endpoint"),t.nonNull.boolean("available"),t.nonNull.boolean("visible")}}),fl=({nexus:e,strapi:t})=>e.objectType({name:"ContentTypesNameFields",async definition(n){n.nonNull.list.nonNull.string("default");const i=await re({strapi:t},"common").getPluginStore(),o=Re.configSchema.parse(await i.get({key:"config"})).contentTypesNameFields;Object.keys(o||{}).forEach(s=>n.nonNull.list.string(s))}}),pl=({nexus:e})=>e.inputObjectType({name:"CreateNavigation",definition(t){t.nonNull.string("name"),t.nonNull.list.field("items",{type:"CreateNavigationItem"})}}),dl=({nexus:e})=>e.inputObjectType({name:"CreateNavigationItem",definition(t){t.nonNull.string("title"),t.nonNull.field("type",{type:"NavigationItemType"}),t.string("path"),t.string("externalPath"),t.nonNull.string("uiRouterKey"),t.nonNull.boolean("menuAttached"),t.nonNull.int("order"),t.string("parent"),t.string("master"),t.list.field("items",{type:"CreateNavigationItem"}),t.list.string("audience"),t.field("related",{type:"CreateNavigationRelated"})}}),hl=({nexus:e})=>e.inputObjectType({name:"CreateNavigationRelated",definition(t){t.nonNull.string("ref"),t.nonNull.string("field"),t.nonNull.string("refId")}}),ml=({nexus:e})=>e.objectType({name:"Navigation",definition(t){t.nonNull.string("id"),t.nonNull.string("documentId"),t.nonNull.string("name"),t.nonNull.string("slug"),t.nonNull.boolean("visible")}}),gl=({nexus:e})=>e.objectType({name:"NavigationConfig",definition(t){t.int("allowedLevels"),t.nonNull.list.string("additionalFields"),t.field("contentTypesNameFields",{type:"ContentTypesNameFields"}),t.list.field("contentTypes",{type:"ContentTypes"})}}),yl=({nexus:e})=>e.objectType({name:"NavigationDetails",definition(t){t.nonNull.string("id"),t.nonNull.string("documentId"),t.nonNull.string("name"),t.nonNull.string("slug"),t.nonNull.boolean("visible"),t.nonNull.list.field("items",{type:"NavigationItem"})}}),vl=({nexus:e,config:t})=>e.objectType({name:"NavigationItem",definition(n){n.nonNull.int("id"),n.nonNull.string("documentId"),n.nonNull.string("title"),n.nonNull.field("type",{type:"NavigationItemType"}),n.string("path"),n.string("externalPath"),n.nonNull.string("uiRouterKey"),n.nonNull.boolean("menuAttached"),n.nonNull.int("order"),n.field("parent",{type:"NavigationItem"}),n.string("master"),n.list.field("items",{type:"NavigationItem"}),n.field("related",{type:"NavigationItemRelated"}),t.additionalFields.find(r=>r==="audience")&&n.list.string("audience"),n.field("additionalFields",{type:"NavigationItemAdditionalFields"}),n.string("created_at"),n.string("updated_at"),n.string("created_by"),n.string("updated_by"),n.string("createdAt"),n.string("updatedAt"),n.string("createdBy"),n.string("updatedBy")}}),wl=({nexus:e,config:t})=>e.objectType({name:"NavigationItemAdditionalFields",definition(n){t.additionalFields.forEach(r=>{if(r!=="audience"&&r.enabled)switch(r.type){case"media":n.field(r.name,{type:"UploadFile"});break;case"string":n.string(r.name);break;case"boolean":n.boolean(r.name);break;case"select":r.multi?n.list.string(r.name):n.string(r.name);break;default:throw new Error(`Type "${JSON.stringify(r.type)}" is unsupported by custom fields`)}})}}),El=({strapi:e,nexus:t,config:n})=>{const r=n.gql?.navigationItemRelated,i="NavigationItemRelated";return r?.length?t.unionType({name:i,definition(a){a.members(...r)},resolveType:a=>e.contentTypes[a.__type]?.globalId}):t.objectType({name:i,definition(a){a.int("id"),a.string("documentId"),a.string("title"),a.string("name")}})},bl=({nexus:e})=>e.enumType({name:"NavigationItemType",members:["INTERNAL","EXTERNAL","WRAPPER"]}),Sl=({nexus:e})=>e.enumType({name:"NavigationRenderType",members:["FLAT","TREE"]}),xl=[wl,El,vl,Sl,ml,yl,fl,ll,gl,hl,dl,pl,bl],_l=e=>xl.map(t=>t(e)),Al=async({strapi:e})=>{const t=e.plugin("graphql").service("extension");t.shadowCRUD("plugin::navigation.audience").disable(),t.shadowCRUD("plugin::navigation.navigation").disable(),t.shadowCRUD("plugin::navigation.navigation-item").disable(),t.shadowCRUD("plugin::navigation.navigations-items-related").disable();const r=await re({strapi:e},"common").getPluginStore(),i=Re.configSchema.parse(await r.get({key:"config"}));t.use(({strapi:a,nexus:o})=>{const s=_l({strapi:a,nexus:o,config:i}),u=ul({strapi:a,nexus:o}),f=cl();return{types:[s,u],resolversConfig:f}})},Tl=async({strapi:e})=>{!!e.plugin("graphql")&&await Al({strapi:e})},Cl=async e=>{await _a(e),await rl(e),await il(e),await Tl(e),await strapi.service("plugin::navigation.migrate").migrateRelatedIdToDocumentId(),strapi.db.lifecycles.subscribe({models:["plugin::i18n.locale"],async afterCreate(t){await re(e,"admin").refreshNavigationLocale(t.result?.code)}})},Rl=({strapi:e})=>{},Fl=({strapi:e})=>{},$l={collectionName:"audience",info:{singularName:"audience",pluralName:"audiences",displayName:"Audience",name:"audience"},options:{increments:!0,comment:"Audience"},attributes:{name:{type:"string",required:!0},key:{type:"uid",targetField:"name"}}},Il={schema:$l},Ol=xa("navigation",{strapi}),Nl={collectionName:"navigations",info:{singularName:"navigation",pluralName:"navigations",displayName:"Navigation",name:"navigation"},options:{comment:""},pluginOptions:{"content-manager":{visible:!1},"content-type-builder":{visible:!1},i18n:{localized:!0}},attributes:{name:{type:"text",configurable:!1,required:!0},slug:{type:"uid",target:"name",configurable:!1,required:!0},visible:{type:"boolean",default:!1,configurable:!1},items:{type:"relation",relation:"oneToMany",target:"plugin::navigation.navigation-item",configurable:!1,mappedBy:"master"}}},Pl={schema:Nl,lifecycles:Ol},Ll=xa("navigation-item",{strapi}),kl={collectionName:"navigations_items",info:{singularName:"navigation-item",pluralName:"navigation-items",displayName:"Navigation Item",name:"navigation-item"},options:{increments:!0,timestamps:!0,comment:"Navigation Item"},pluginOptions:{"content-manager":{visible:!1},"content-type-builder":{visible:!1},i18n:{localized:!1}},attributes:{title:{type:"text",configurable:!1,required:!0,pluginOptions:{i18n:{localized:!1}}},type:{type:"enumeration",enum:["INTERNAL","EXTERNAL","WRAPPER"],default:"INTERNAL",configurable:!1},path:{type:"text",targetField:"title",configurable:!1},externalPath:{type:"text",configurable:!1},uiRouterKey:{type:"string",configurable:!1},menuAttached:{type:"boolean",default:!1,configurable:!1},order:{type:"integer",default:0,configurable:!1},collapsed:{type:"boolean",default:!1,configurable:!1},autoSync:{type:"boolean",default:!0,configurable:!1},related:{type:"relation",relation:"morphToMany",required:!0,configurable:!1},parent:{type:"relation",relation:"oneToOne",target:"plugin::navigation.navigation-item",configurable:!1,default:null},master:{type:"relation",relation:"manyToOne",target:"plugin::navigation.navigation",configurable:!1,inversedBy:"items"},audience:{type:"relation",relation:"oneToMany",target:"plugin::navigation.audience"},additionalFields:{type:"json",require:!1,default:{}}}},Dl={schema:kl,lifecycles:Ll},Ml={audience:Il,navigation:Pl,"navigation-item":Dl},Aa=y.enum(["true","false"]),Qt=y.string(),jl=y.object({locale:y.string().optional(),orderBy:y.string().optional(),orderDirection:y.enum(["DESC","ASC"]).optional()}),Ta=y.enum(["FLAT","TREE","RFR"]),Ca=y.enum(["draft","published"]),Ra=y.union([y.boolean(),y.string(),y.string().array(),y.undefined()]),Hl=y.object({type:Ta.optional(),menu:Aa.optional(),path:y.string().optional(),locale:y.string().optional(),populate:Ra.optional(),status:Ca.optional()}),Bl=y.object({type:Ta.optional(),menu:Aa.optional(),locale:y.string().optional(),status:Ca.optional()}),Ul=y.object({source:y.string().min(1),target:y.string().min(1),documentId:y.string().min(1)});function Gl(e){return{getAdminService(){return re(e,"admin")},getCommonService(){return re(e,"common")},async get(){return await this.getAdminService().get({})},async post(t){const{auditLog:n}=t;try{return await this.getAdminService().post({payload:Re.createNavigationSchema.parse(t.request.body),auditLog:n})}catch(r){const i=r instanceof Error?{name:r.name,message:r.message}:{};return t.internalServerError("Unable to create",{originalError:i})}},async put(t){const{params:{documentId:n},auditLog:r}=t,i=y.record(y.string(),y.unknown()).parse(t.request.body);try{return await this.getAdminService().put({auditLog:r,payload:Re.updateNavigationSchema.parse({...i,documentId:n})})}catch(a){const o=a instanceof Error?{name:a.name,message:a.message}:{};return t.internalServerError("Unable to update",{originalError:o})}},async delete(t){const{auditLog:n,params:{documentId:r}}=t;return await this.getAdminService().delete({documentId:Qt.parse(r),auditLog:n}),{}},config(){return this.getAdminService().config({viaSettingsPage:!1})},async updateConfig(t){return await this.getAdminService().updateConfig({config:Re.configSchema.parse(t.request.body)}),{}},async restoreConfig(){return await this.getAdminService().restoreConfig(),{}},settingsConfig(){return this.getAdminService().config({viaSettingsPage:!0})},async settingsRestart(){return await this.getAdminService().restart(),{}},getById(t){const{params:{documentId:n}}=t;return this.getAdminService().getById({documentId:Qt.parse(n)})},getContentTypeItems(t){const{params:{model:n},query:r={}}=t;return this.getAdminService().getContentTypeItems({query:y.record(y.string(),y.unknown()).parse(r),uid:y.string().parse(n)})},async fillFromOtherLocale(t){const{params:n,auditLog:r}=t,{source:i,target:a,documentId:o}=Ul.parse(n);return await this.getAdminService().fillFromOtherLocale({source:i,target:a,documentId:o,auditLog:r})},readNavigationItemFromLocale(t){const{params:{source:n,target:r},query:{path:i}}=t;return this.getAdminService().readNavigationItemFromLocale({path:y.string().parse(i),source:Qt.parse(n),target:Qt.parse(r)})},getSlug(t){const{query:{q:n}}=t;return this.getCommonService().getSlug({query:y.string().parse(n)}).then(r=>({slug:r}))},settingsLocale(){return this.getCommonService().readLocale()}}}const ql=e=>{if(!(!e||e===!0||e==="*")&&typeof e!="object")return Array.isArray(e),e};function Kl(e){return{getService(){return re(e,"client")},async readAll(t){try{const{query:n={}}=t,{locale:r,orderBy:i,orderDirection:a}=jl.parse(n);return await this.getService().readAll({locale:r,orderBy:i,orderDirection:a})}catch(n){if(n instanceof Error)return t.badRequest(n.message);throw n}},async render(t){const{params:n,query:r={}}=t,{type:i,menu:a,path:o,locale:s,populate:u,status:f="published"}=Hl.parse(r),l=y.string().parse(n.idOrSlug);return await this.getService().render({idOrSlug:l,type:i,menuOnly:a==="true",rootPath:o,locale:s,populate:ql(Ra.parse(u==="true"?!0:u==="false"?!1:Array.isArray(u)?u.map(c=>c==="true"?!0:c==="false"?!1:u):u)),status:f})},async renderChild(t){const{params:n,query:r={}}=t,{type:i,menu:a,locale:o,status:s="published"}=Bl.parse(r),u=y.string().parse(n.idOrSlug),f=y.string().parse(n.childUIKey);return await this.getService().renderChildren({idOrSlug:u,childUIKey:f,type:i,menuOnly:a==="true",locale:o,status:s})}}}const Wl={admin:Gl,client:Kl},zl={},Yl={},Ql={type:"admin",routes:[{method:"GET",path:"/",handler:"admin.get",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"POST",path:"/",handler:"admin.post",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/config",handler:"admin.config",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"PUT",path:"/config",handler:"admin.updateConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"DELETE",path:"/config",handler:"admin.restoreConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"GET",path:"/slug",handler:"admin.getSlug",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/:documentId",handler:"admin.getById",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"PUT",path:"/:documentId",handler:"admin.put",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"DELETE",path:"/:documentId",handler:"admin.delete",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/content-type-items/:model",handler:"admin.getContentTypeItems",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/settings/locale",handler:"admin.settingsLocale",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/settings/config",handler:"admin.settingsConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"GET",path:"/settings/restart",handler:"admin.settingsRestart",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"PUT",path:"/i18n/copy/:documentId/:source/:target",handler:"admin.fillFromOtherLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/i18n/item/read/:source/:target",handler:"admin.readNavigationItemFromLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}}]},Vl={type:"content-api",routes:[{method:"GET",path:"/render/:idOrSlug",handler:"client.render",config:{policies:[]}},{method:"GET",path:"/render/:idOrSlug/:childUIKey",handler:"client.renderChild",config:{policies:[]}},{method:"GET",path:"/",handler:"client.readAll",config:{policies:[]}}]},Xl={admin:Ql,"content-api":Vl};function Zl(e,t){return me.default.has(process.env,e)?process.env[e]:t}function st(e){return process.env[e]??""}const Jl={int(e,t){return me.default.has(process.env,e)?parseInt(st(e),10):t},float(e,t){return me.default.has(process.env,e)?parseFloat(st(e)):t},bool(e,t){return me.default.has(process.env,e)?st(e)==="true":t},json(e,t){if(!me.default.has(process.env,e))return t;try{return JSON.parse(st(e))}catch(n){throw n instanceof Error?new Error(`Invalid json environment variable ${e}: ${n.message}`):n}},array(e,t){if(!me.default.has(process.env,e))return t;let n=st(e);return n.startsWith("[")&&n.endsWith("]")&&(n=n.substring(1,n.length-1)),n.split(",").map(r=>me.default.trim(me.default.trim(r," "),'"'))},date(e,t){return me.default.has(process.env,e)?new Date(st(e)):t},oneOf(e,t,n){if(!t)throw new Error("env.oneOf requires expectedValues");if(n&&!t.includes(n))throw new Error("env.oneOf requires defaultValue to be included in expectedValues");const r=ef(e,n);return t.includes(r)?r:n}},ef=Object.assign(Zl,Jl),tf="id",nf="documentId",rf={ID_ATTRIBUTE:tf,DOC_ID_ATTRIBUTE:nf},of=e=>C.union(strapi?.config?.get("api.responses.privateAttributes",[])??[],C.getOr([],"options.privateAttributes",e)),af=(e,t)=>e?.attributes?.[t]?.private===!0?!0:of(e).includes(t),Fa=e=>e&&!["media","component","relation","dynamiczone"].includes(e.type),sf=e=>e?.type==="media",$a=e=>e?.type==="relation",uf=e=>!!e&&e.type==="dynamiczone",Ia=e=>!!e&&$a(e)&&e.relation?.startsWith?.("morphTo"),ht=async(e,t,n)=>{const{path:r={raw:null,attribute:null,rawWithIndices:null},schema:i,getModel:a}=t;let o=t.parent;const s=async(m,g,b)=>{const T={schema:a(b.__type),path:g,getModel:a,parent:o};return ht(m,T,b)},u=m=>async(g,b,S)=>ht(g,{schema:m,path:b,getModel:a,parent:o},S),f=async(m,g,b)=>{const A={schema:a("plugin::upload.file"),path:g,getModel:a,parent:o};return ht(m,A,b)},l=async(m,g,b,S)=>ht(m,{schema:b,path:g,getModel:a,parent:o},S),c=async(m,g,b)=>{const T={schema:a(b.__component),path:g,getModel:a,parent:o};return ht(m,T,b)};if(!C.isObject(n)||C.isNil(i))return n;const p=C.clone(n),d=cf({data:p}),h=Object.keys(p);for(let m=0;m<h.length;m+=1){const g=h[m],b=i.attributes[g],S={...r};S.raw=C.isNil(r.raw)?g:`${r.raw}.${g}`,S.rawWithIndices=C.isNil(r.rawWithIndices)?g:`${r.rawWithIndices}.${g}`,C.isNil(b)||(S.attribute=C.isNil(r.attribute)?g:`${r.attribute}.${g}`);const T={data:p,schema:i,key:g,value:p[g],attribute:b,path:S,getModel:a,parent:o};await e(T,d);const A=p[g];if(!(C.isNil(A)||C.isNil(b))){if($a(b)){o={schema:i,key:g,attribute:b,path:S};const F=b.relation.toLowerCase().startsWith("morph")?s:u(a(b.target));if(C.isArray(A)){const D=new Array(A.length);for(let x=0;x<A.length;x+=1){const _={...S,rawWithIndices:C.isNil(S.rawWithIndices)?`${x}`:`${S.rawWithIndices}.${x}`};D[x]=await F(e,_,A[x])}p[g]=D}else p[g]=await F(e,S,A);continue}if(sf(b)){if(o={schema:i,key:g,attribute:b,path:S},C.isArray(A)){const R=new Array(A.length);for(let F=0;F<A.length;F+=1){const D={...S,rawWithIndices:C.isNil(S.rawWithIndices)?`${F}`:`${S.rawWithIndices}.${F}`};R[F]=await f(e,D,A[F])}p[g]=R}else p[g]=await f(e,S,A);continue}if(b.type==="component"){o={schema:i,key:g,attribute:b,path:S};const R=a(b.component);if(C.isArray(A)){const F=new Array(A.length);for(let D=0;D<A.length;D+=1){const x={...S,rawWithIndices:C.isNil(S.rawWithIndices)?`${D}`:`${S.rawWithIndices}.${D}`};F[D]=await l(e,x,R,A[D])}p[g]=F}else p[g]=await l(e,S,R,A);continue}if(b.type==="dynamiczone"&&C.isArray(A)){o={schema:i,key:g,attribute:b,path:S};const R=new Array(A.length);for(let F=0;F<A.length;F+=1){const D={...S,rawWithIndices:C.isNil(S.rawWithIndices)?`${F}`:`${S.rawWithIndices}.${F}`};R[F]=await c(e,D,A[F])}p[g]=R;continue}}}return p},cf=({data:e})=>({remove(t){delete e[t]},set(t,n){e[t]=n}});var lf=C.curry(ht),Ee=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ff={exports:{}};(function(e,t){(function(n,r){e.exports=r(ln.default,ki.default)})(Ee,function(n,r){return(function(i){function a(s){if(o[s])return o[s].exports;var u=o[s]={exports:{},id:s,loaded:!1};return i[s].call(u.exports,u,u.exports,a),u.loaded=!0,u.exports}var o={};return a.m=i,a.c=o,a.p="",a(0)})([function(i,a,o){i.exports=o(34)},function(i,a,o){var s=o(29)("wks"),u=o(33),f=o(2).Symbol,l=typeof f=="function",c=i.exports=function(p){return s[p]||(s[p]=l&&f[p]||(l?f:u)("Symbol."+p))};c.store=s},function(i,a){var o=i.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=o)},function(i,a,o){var s=o(9);i.exports=function(u){if(!s(u))throw TypeError(u+" is not an object!");return u}},function(i,a,o){i.exports=!o(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(i,a,o){var s=o(12),u=o(17);i.exports=o(4)?function(f,l,c){return s.f(f,l,u(1,c))}:function(f,l,c){return f[l]=c,f}},function(i,a){var o=i.exports={version:"2.4.0"};typeof __e=="number"&&(__e=o)},function(i,a,o){var s=o(14);i.exports=function(u,f,l){if(s(u),f===void 0)return u;switch(l){case 1:return function(c){return u.call(f,c)};case 2:return function(c,p){return u.call(f,c,p)};case 3:return function(c,p,d){return u.call(f,c,p,d)}}return function(){return u.apply(f,arguments)}}},function(i,a){var o={}.hasOwnProperty;i.exports=function(s,u){return o.call(s,u)}},function(i,a){i.exports=function(o){return typeof o=="object"?o!==null:typeof o=="function"}},function(i,a){i.exports={}},function(i,a){var o={}.toString;i.exports=function(s){return o.call(s).slice(8,-1)}},function(i,a,o){var s=o(3),u=o(26),f=o(32),l=Object.defineProperty;a.f=o(4)?Object.defineProperty:function(c,p,d){if(s(c),p=f(p,!0),s(d),u)try{return l(c,p,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(c[p]=d.value),c}},function(i,a,o){var s=o(42),u=o(15);i.exports=function(f){return s(u(f))}},function(i,a){i.exports=function(o){if(typeof o!="function")throw TypeError(o+" is not a function!");return o}},function(i,a){i.exports=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o}},function(i,a,o){var s=o(9),u=o(2).document,f=s(u)&&s(u.createElement);i.exports=function(l){return f?u.createElement(l):{}}},function(i,a){i.exports=function(o,s){return{enumerable:!(1&o),configurable:!(2&o),writable:!(4&o),value:s}}},function(i,a,o){var s=o(12).f,u=o(8),f=o(1)("toStringTag");i.exports=function(l,c,p){l&&!u(l=p?l:l.prototype,f)&&s(l,f,{configurable:!0,value:c})}},function(i,a,o){var s=o(29)("keys"),u=o(33);i.exports=function(f){return s[f]||(s[f]=u(f))}},function(i,a){var o=Math.ceil,s=Math.floor;i.exports=function(u){return isNaN(u=+u)?0:(u>0?s:o)(u)}},function(i,a,o){var s=o(11),u=o(1)("toStringTag"),f=s((function(){return arguments})())=="Arguments",l=function(c,p){try{return c[p]}catch{}};i.exports=function(c){var p,d,h;return c===void 0?"Undefined":c===null?"Null":typeof(d=l(p=Object(c),u))=="string"?d:f?s(p):(h=s(p))=="Object"&&typeof p.callee=="function"?"Arguments":h}},function(i,a){i.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(i,a,o){var s=o(2),u=o(6),f=o(7),l=o(5),c="prototype",p=function(d,h,m){var g,b,S,T=d&p.F,A=d&p.G,R=d&p.S,F=d&p.P,D=d&p.B,x=d&p.W,_=A?u:u[h]||(u[h]={}),N=_[c],v=A?s:R?s[h]:(s[h]||{})[c];A&&(m=h);for(g in m)b=!T&&v&&v[g]!==void 0,b&&g in _||(S=b?v[g]:m[g],_[g]=A&&typeof v[g]!="function"?m[g]:D&&b?f(S,s):x&&v[g]==S?(function(j){var H=function(K,w,E){if(this instanceof j){switch(arguments.length){case 0:return new j;case 1:return new j(K);case 2:return new j(K,w)}return new j(K,w,E)}return j.apply(this,arguments)};return H[c]=j[c],H})(S):F&&typeof S=="function"?f(Function.call,S):S,F&&((_.virtual||(_.virtual={}))[g]=S,d&p.R&&N&&!N[g]&&l(N,g,S)))};p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128,i.exports=p},function(i,a){i.exports=function(o){try{return!!o()}catch{return!0}}},function(i,a,o){i.exports=o(2).document&&document.documentElement},function(i,a,o){i.exports=!o(4)&&!o(24)(function(){return Object.defineProperty(o(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(i,a,o){var s=o(28),u=o(23),f=o(57),l=o(5),c=o(8),p=o(10),d=o(45),h=o(18),m=o(52),g=o(1)("iterator"),b=!([].keys&&"next"in[].keys()),S="@@iterator",T="keys",A="values",R=function(){return this};i.exports=function(F,D,x,_,N,v,j){d(x,D,_);var H,K,w,E=function(M){if(!b&&M in z)return z[M];switch(M){case T:return function(){return new x(this,M)};case A:return function(){return new x(this,M)}}return function(){return new x(this,M)}},$=D+" Iterator",k=N==A,U=!1,z=F.prototype,V=z[g]||z[S]||N&&z[N],ee=V||E(N),Te=N?k?E("entries"):ee:void 0,I=D=="Array"&&z.entries||V;if(I&&(w=m(I.call(new F)),w!==Object.prototype&&(h(w,$,!0),s||c(w,g)||l(w,g,R))),k&&V&&V.name!==A&&(U=!0,ee=function(){return V.call(this)}),s&&!j||!b&&!U&&z[g]||l(z,g,ee),p[D]=ee,p[$]=R,N)if(H={values:k?ee:E(A),keys:v?ee:E(T),entries:Te},j)for(K in H)K in z||f(z,K,H[K]);else u(u.P+u.F*(b||U),D,H);return H}},function(i,a){i.exports=!0},function(i,a,o){var s=o(2),u="__core-js_shared__",f=s[u]||(s[u]={});i.exports=function(l){return f[l]||(f[l]={})}},function(i,a,o){var s,u,f,l=o(7),c=o(41),p=o(25),d=o(16),h=o(2),m=h.process,g=h.setImmediate,b=h.clearImmediate,S=h.MessageChannel,T=0,A={},R="onreadystatechange",F=function(){var x=+this;if(A.hasOwnProperty(x)){var _=A[x];delete A[x],_()}},D=function(x){F.call(x.data)};g&&b||(g=function(x){for(var _=[],N=1;arguments.length>N;)_.push(arguments[N++]);return A[++T]=function(){c(typeof x=="function"?x:Function(x),_)},s(T),T},b=function(x){delete A[x]},o(11)(m)=="process"?s=function(x){m.nextTick(l(F,x,1))}:S?(u=new S,f=u.port2,u.port1.onmessage=D,s=l(f.postMessage,f,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(s=function(x){h.postMessage(x+"","*")},h.addEventListener("message",D,!1)):s=R in d("script")?function(x){p.appendChild(d("script"))[R]=function(){p.removeChild(this),F.call(x)}}:function(x){setTimeout(l(F,x,1),0)}),i.exports={set:g,clear:b}},function(i,a,o){var s=o(20),u=Math.min;i.exports=function(f){return f>0?u(s(f),9007199254740991):0}},function(i,a,o){var s=o(9);i.exports=function(u,f){if(!s(u))return u;var l,c;if(f&&typeof(l=u.toString)=="function"&&!s(c=l.call(u))||typeof(l=u.valueOf)=="function"&&!s(c=l.call(u))||!f&&typeof(l=u.toString)=="function"&&!s(c=l.call(u)))return c;throw TypeError("Can't convert object to primitive value")}},function(i,a){var o=0,s=Math.random();i.exports=function(u){return"Symbol(".concat(u===void 0?"":u,")_",(++o+s).toString(36))}},function(i,a,o){function s(R){return R&&R.__esModule?R:{default:R}}function u(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function f(R){return(0,g.createHash)("sha256").update(R).digest("hex")}function l(R){switch(S){case"darwin":return R.split("IOPlatformUUID")[1].split(`
2
+ `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return R.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return R.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return R.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function c(R){var F=l((0,m.execSync)(A[S]).toString());return R?F:f(F)}function p(R){return new h.default(function(F,D){return(0,m.exec)(A[S],{},function(x,_,N){if(x)return D(new Error("Error while obtaining machine id: "+x.stack));var v=l(_.toString());return F(R?v:f(v))})})}Object.defineProperty(a,"__esModule",{value:!0});var d=o(35),h=s(d);a.machineIdSync=c,a.machineId=p;var m=o(70),g=o(71),b=process,S=b.platform,T={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},A={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:T[u()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(i,a,o){i.exports={default:o(36),__esModule:!0}},function(i,a,o){o(66),o(68),o(69),o(67),i.exports=o(6).Promise},function(i,a){i.exports=function(){}},function(i,a){i.exports=function(o,s,u,f){if(!(o instanceof s)||f!==void 0&&f in o)throw TypeError(u+": incorrect invocation!");return o}},function(i,a,o){var s=o(13),u=o(31),f=o(62);i.exports=function(l){return function(c,p,d){var h,m=s(c),g=u(m.length),b=f(d,g);if(l&&p!=p){for(;g>b;)if(h=m[b++],h!=h)return!0}else for(;g>b;b++)if((l||b in m)&&m[b]===p)return l||b||0;return!l&&-1}}},function(i,m,o){var s=o(7),u=o(44),f=o(43),l=o(3),c=o(31),p=o(64),d={},h={},m=i.exports=function(g,b,S,T,A){var R,F,D,x,_=A?function(){return g}:p(g),N=s(S,T,b?2:1),v=0;if(typeof _!="function")throw TypeError(g+" is not iterable!");if(f(_)){for(R=c(g.length);R>v;v++)if(x=b?N(l(F=g[v])[0],F[1]):N(g[v]),x===d||x===h)return x}else for(D=_.call(g);!(F=D.next()).done;)if(x=u(D,N,F.value,b),x===d||x===h)return x};m.BREAK=d,m.RETURN=h},function(i,a){i.exports=function(o,s,u){var f=u===void 0;switch(s.length){case 0:return f?o():o.call(u);case 1:return f?o(s[0]):o.call(u,s[0]);case 2:return f?o(s[0],s[1]):o.call(u,s[0],s[1]);case 3:return f?o(s[0],s[1],s[2]):o.call(u,s[0],s[1],s[2]);case 4:return f?o(s[0],s[1],s[2],s[3]):o.call(u,s[0],s[1],s[2],s[3])}return o.apply(u,s)}},function(i,a,o){var s=o(11);i.exports=Object("z").propertyIsEnumerable(0)?Object:function(u){return s(u)=="String"?u.split(""):Object(u)}},function(i,a,o){var s=o(10),u=o(1)("iterator"),f=Array.prototype;i.exports=function(l){return l!==void 0&&(s.Array===l||f[u]===l)}},function(i,a,o){var s=o(3);i.exports=function(u,f,l,c){try{return c?f(s(l)[0],l[1]):f(l)}catch(d){var p=u.return;throw p!==void 0&&s(p.call(u)),d}}},function(i,a,o){var s=o(49),u=o(17),f=o(18),l={};o(5)(l,o(1)("iterator"),function(){return this}),i.exports=function(c,p,d){c.prototype=s(l,{next:u(1,d)}),f(c,p+" Iterator")}},function(i,a,o){var s=o(1)("iterator"),u=!1;try{var f=[7][s]();f.return=function(){u=!0},Array.from(f,function(){throw 2})}catch{}i.exports=function(l,c){if(!c&&!u)return!1;var p=!1;try{var d=[7],h=d[s]();h.next=function(){return{done:p=!0}},d[s]=function(){return h},l(d)}catch{}return p}},function(i,a){i.exports=function(o,s){return{value:s,done:!!o}}},function(i,a,o){var s=o(2),u=o(30).set,f=s.MutationObserver||s.WebKitMutationObserver,l=s.process,c=s.Promise,p=o(11)(l)=="process";i.exports=function(){var d,h,m,g=function(){var A,R;for(p&&(A=l.domain)&&A.exit();d;){R=d.fn,d=d.next;try{R()}catch(F){throw d?m():h=void 0,F}}h=void 0,A&&A.enter()};if(p)m=function(){l.nextTick(g)};else if(f){var b=!0,S=document.createTextNode("");new f(g).observe(S,{characterData:!0}),m=function(){S.data=b=!b}}else if(c&&c.resolve){var T=c.resolve();m=function(){T.then(g)}}else m=function(){u.call(s,g)};return function(A){var R={fn:A,next:void 0};h&&(h.next=R),d||(d=R,m()),h=R}}},function(i,a,o){var s=o(3),u=o(50),f=o(22),l=o(19)("IE_PROTO"),c=function(){},p="prototype",d=function(){var h,m=o(16)("iframe"),g=f.length,b=">";for(m.style.display="none",o(25).appendChild(m),m.src="javascript:",h=m.contentWindow.document,h.open(),h.write("<script>document.F=Object<\/script"+b),h.close(),d=h.F;g--;)delete d[p][f[g]];return d()};i.exports=Object.create||function(h,m){var g;return h!==null?(c[p]=s(h),g=new c,c[p]=null,g[l]=h):g=d(),m===void 0?g:u(g,m)}},function(i,a,o){var s=o(12),u=o(3),f=o(54);i.exports=o(4)?Object.defineProperties:function(l,c){u(l);for(var p,d=f(c),h=d.length,m=0;h>m;)s.f(l,p=d[m++],c[p]);return l}},function(i,a,o){var s=o(55),u=o(17),f=o(13),l=o(32),c=o(8),p=o(26),d=Object.getOwnPropertyDescriptor;a.f=o(4)?d:function(h,m){if(h=f(h),m=l(m,!0),p)try{return d(h,m)}catch{}if(c(h,m))return u(!s.f.call(h,m),h[m])}},function(i,a,o){var s=o(8),u=o(63),f=o(19)("IE_PROTO"),l=Object.prototype;i.exports=Object.getPrototypeOf||function(c){return c=u(c),s(c,f)?c[f]:typeof c.constructor=="function"&&c instanceof c.constructor?c.constructor.prototype:c instanceof Object?l:null}},function(i,a,o){var s=o(8),u=o(13),f=o(39)(!1),l=o(19)("IE_PROTO");i.exports=function(c,p){var d,h=u(c),m=0,g=[];for(d in h)d!=l&&s(h,d)&&g.push(d);for(;p.length>m;)s(h,d=p[m++])&&(~f(g,d)||g.push(d));return g}},function(i,a,o){var s=o(53),u=o(22);i.exports=Object.keys||function(f){return s(f,u)}},function(i,a){a.f={}.propertyIsEnumerable},function(i,a,o){var s=o(5);i.exports=function(u,f,l){for(var c in f)l&&u[c]?u[c]=f[c]:s(u,c,f[c]);return u}},function(i,a,o){i.exports=o(5)},function(i,a,o){var s=o(9),u=o(3),f=function(l,c){if(u(l),!s(c)&&c!==null)throw TypeError(c+": can't set as prototype!")};i.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(l,c,p){try{p=o(7)(Function.call,o(51).f(Object.prototype,"__proto__").set,2),p(l,[]),c=!(l instanceof Array)}catch{c=!0}return function(d,h){return f(d,h),c?d.__proto__=h:p(d,h),d}})({},!1):void 0),check:f}},function(i,a,o){var s=o(2),u=o(6),f=o(12),l=o(4),c=o(1)("species");i.exports=function(p){var d=typeof u[p]=="function"?u[p]:s[p];l&&d&&!d[c]&&f.f(d,c,{configurable:!0,get:function(){return this}})}},function(i,a,o){var s=o(3),u=o(14),f=o(1)("species");i.exports=function(l,c){var p,d=s(l).constructor;return d===void 0||(p=s(d)[f])==null?c:u(p)}},function(i,a,o){var s=o(20),u=o(15);i.exports=function(f){return function(l,c){var p,d,h=String(u(l)),m=s(c),g=h.length;return m<0||m>=g?f?"":void 0:(p=h.charCodeAt(m),p<55296||p>56319||m+1===g||(d=h.charCodeAt(m+1))<56320||d>57343?f?h.charAt(m):p:f?h.slice(m,m+2):(p-55296<<10)+(d-56320)+65536)}}},function(i,a,o){var s=o(20),u=Math.max,f=Math.min;i.exports=function(l,c){return l=s(l),l<0?u(l+c,0):f(l,c)}},function(i,a,o){var s=o(15);i.exports=function(u){return Object(s(u))}},function(i,a,o){var s=o(21),u=o(1)("iterator"),f=o(10);i.exports=o(6).getIteratorMethod=function(l){if(l!=null)return l[u]||l["@@iterator"]||f[s(l)]}},function(i,a,o){var s=o(37),u=o(47),f=o(10),l=o(13);i.exports=o(27)(Array,"Array",function(c,p){this._t=l(c),this._i=0,this._k=p},function(){var c=this._t,p=this._k,d=this._i++;return!c||d>=c.length?(this._t=void 0,u(1)):p=="keys"?u(0,d):p=="values"?u(0,c[d]):u(0,[d,c[d]])},"values"),f.Arguments=f.Array,s("keys"),s("values"),s("entries")},function(i,a){},function(i,a,o){var s,u,f,l=o(28),c=o(2),p=o(7),d=o(21),h=o(23),m=o(9),g=(o(3),o(14)),b=o(38),S=o(40),T=(o(58).set,o(60)),A=o(30).set,R=o(48)(),F="Promise",D=c.TypeError,_=c.process,x=c[F],_=c.process,N=d(_)=="process",v=function(){},j=!!(function(){try{var I=x.resolve(1),M=(I.constructor={})[o(1)("species")]=function(P){P(v,v)};return(N||typeof PromiseRejectionEvent=="function")&&I.then(v)instanceof M}catch{}})(),H=function(I,M){return I===M||I===x&&M===f},K=function(I){var M;return!(!m(I)||typeof(M=I.then)!="function")&&M},w=function(I){return H(x,I)?new E(I):new u(I)},E=u=function(I){var M,P;this.promise=new I(function(Q,ce){if(M!==void 0||P!==void 0)throw D("Bad Promise constructor");M=Q,P=ce}),this.resolve=g(M),this.reject=g(P)},$=function(I){try{I()}catch(M){return{error:M}}},k=function(I,M){if(!I._n){I._n=!0;var P=I._c;R(function(){for(var Q=I._v,ce=I._s==1,L=0,Y=function(O){var q,X,oe=ce?O.ok:O.fail,Z=O.resolve,Ne=O.reject,je=O.domain;try{oe?(ce||(I._h==2&&V(I),I._h=1),oe===!0?q=Q:(je&&je.enter(),q=oe(Q),je&&je.exit()),q===O.promise?Ne(D("Promise-chain cycle")):(X=K(q))?X.call(q,Z,Ne):Z(q)):Ne(Q)}catch(Gu){Ne(Gu)}};P.length>L;)Y(P[L++]);I._c=[],I._n=!1,M&&!I._h&&U(I)})}},U=function(I){A.call(c,function(){var M,P,Q,ce=I._v;if(z(I)&&(M=$(function(){N?_.emit("unhandledRejection",ce,I):(P=c.onunhandledrejection)?P({promise:I,reason:ce}):(Q=c.console)&&Q.error&&Q.error("Unhandled promise rejection",ce)}),I._h=N||z(I)?2:1),I._a=void 0,M)throw M.error})},z=function(I){if(I._h==1)return!1;for(var M,P=I._a||I._c,Q=0;P.length>Q;)if(M=P[Q++],M.fail||!z(M.promise))return!1;return!0},V=function(I){A.call(c,function(){var M;N?_.emit("rejectionHandled",I):(M=c.onrejectionhandled)&&M({promise:I,reason:I._v})})},ee=function(I){var M=this;M._d||(M._d=!0,M=M._w||M,M._v=I,M._s=2,M._a||(M._a=M._c.slice()),k(M,!0))},Te=function(I){var M,P=this;if(!P._d){P._d=!0,P=P._w||P;try{if(P===I)throw D("Promise can't be resolved itself");(M=K(I))?R(function(){var Q={_w:P,_d:!1};try{M.call(I,p(Te,Q,1),p(ee,Q,1))}catch(ce){ee.call(Q,ce)}}):(P._v=I,P._s=1,k(P,!1))}catch(Q){ee.call({_w:P,_d:!1},Q)}}};j||(x=function(I){b(this,x,F,"_h"),g(I),s.call(this);try{I(p(Te,this,1),p(ee,this,1))}catch(M){ee.call(this,M)}},s=function(I){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},s.prototype=o(56)(x.prototype,{then:function(I,M){var P=w(T(this,x));return P.ok=typeof I!="function"||I,P.fail=typeof M=="function"&&M,P.domain=N?_.domain:void 0,this._c.push(P),this._a&&this._a.push(P),this._s&&k(this,!1),P.promise},catch:function(I){return this.then(void 0,I)}}),E=function(){var I=new s;this.promise=I,this.resolve=p(Te,I,1),this.reject=p(ee,I,1)}),h(h.G+h.W+h.F*!j,{Promise:x}),o(18)(x,F),o(59)(F),f=o(6)[F],h(h.S+h.F*!j,F,{reject:function(I){var M=w(this),P=M.reject;return P(I),M.promise}}),h(h.S+h.F*(l||!j),F,{resolve:function(I){if(I instanceof x&&H(I.constructor,this))return I;var M=w(this),P=M.resolve;return P(I),M.promise}}),h(h.S+h.F*!(j&&o(46)(function(I){x.all(I).catch(v)})),F,{all:function(I){var M=this,P=w(M),Q=P.resolve,ce=P.reject,L=$(function(){var Y=[],O=0,q=1;S(I,!1,function(X){var oe=O++,Z=!1;Y.push(void 0),q++,M.resolve(X).then(function(Ne){Z||(Z=!0,Y[oe]=Ne,--q||Q(Y))},ce)}),--q||Q(Y)});return L&&ce(L.error),P.promise},race:function(I){var M=this,P=w(M),Q=P.reject,ce=$(function(){S(I,!1,function(L){M.resolve(L).then(P.resolve,Q)})});return ce&&Q(ce.error),P.promise}})},function(i,a,o){var s=o(61)(!0);o(27)(String,"String",function(u){this._t=String(u),this._i=0},function(){var u,f=this._t,l=this._i;return l>=f.length?{value:void 0,done:!0}:(u=s(f,l),this._i+=u.length,{value:u,done:!1})})},function(i,a,o){o(65);for(var s=o(2),u=o(5),f=o(10),l=o(1)("toStringTag"),c=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var d=c[p],h=s[d],m=h&&h.prototype;m&&!m[l]&&u(m,l,d),f[d]=f.Array}},function(i,a){i.exports=ln.default},function(i,a){i.exports=ki.default}])})})(ff);var Pr;try{Pr=Map}catch{}var Lr;try{Lr=Set}catch{}function Na(e,t,n){if(!e||typeof e!="object"||typeof e=="function")return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(kr);if(Pr&&e instanceof Pr)return new Map(Array.from(e.entries()));if(Lr&&e instanceof Lr)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);n.push(r);for(var i in e){var a=t.findIndex(function(o){return o===e[i]});r[i]=a>-1?n[a]:Na(e[i],t,n)}return r}return e}function kr(e){return Na(e,[],[])}const pf=Object.prototype.toString,df=Error.prototype.toString,hf=RegExp.prototype.toString,mf=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",gf=/^Symbol\((.*)\)(.*)$/;function yf(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function qi(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return yf(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return mf.call(e).replace(gf,"Symbol($1)");const r=pf.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+df.call(e)+"]":r==="RegExp"?hf.call(e):null}function xt(e,t){let n=qi(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let a=qi(this[r],t);return a!==null?a:i},2)}let Ye={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{let i=r!=null&&r!==n,a=`${e} must be a \`${t}\` type, but the final value was: \`${xt(n,!0)}\``+(i?` (cast from the value \`${xt(r,!0)}\`).`:".");return n===null&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},$e={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},vf={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Dr={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},wf={isValue:"${path} field must be ${value}"},Mr={noUnknown:"${path} field has unspecified keys: ${unknown}"},rn={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};const Ef=Object.assign(Object.create(null),{mixed:Ye,string:$e,number:vf,date:Dr,object:Mr,array:rn,boolean:wf}),Dn=(e=>e&&e.__isYupSchema__);class bf{constructor(t,n){if(this.refs=t,this.refs=t,typeof n=="function"){this.fn=n;return}if(!fn.default(n,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:a}=n,o=typeof r=="function"?r:(...s)=>s.every(u=>u===r);this.fn=function(...s){let u=s.pop(),f=s.pop(),l=o(...s)?i:a;if(l)return typeof l=="function"?l(f):f.concat(l.resolve(u))}}resolve(t,n){let r=this.refs.map(a=>a.getValue(n?.value,n?.parent,n?.context)),i=this.fn.apply(t,r.concat(t,n));if(i===void 0||i===t)return t;if(!Dn(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}function Pa(e){return e==null?[]:[].concat(e)}function jr(){return jr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jr.apply(this,arguments)}let Sf=/\$\{\s*(\w+)\s*\}/g;class ge extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=jr({},n,{path:r})),typeof t=="string"?t.replace(Sf,(i,a)=>xt(n[a])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i){super(),this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],Pa(t).forEach(a=>{ge.isError(a)?(this.errors.push(...a.errors),this.inner=this.inner.concat(a.inner.length?a.inner:a)):this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,ge)}}const xf=e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}};function hn(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,f=xf(t),l=r.length;const c=[];if(o=o||[],!l)return o.length?f(new ge(o,a,u)):f(null,a);for(let p=0;p<r.length;p++){const d=r[p];d(i,function(m){if(m){if(!ge.isError(m))return f(m,a);if(n)return m.value=a,f(m,a);c.push(m)}if(--l<=0){if(c.length&&(s&&c.sort(s),o.length&&c.push(...o),o=c),o.length){f(new ge(o,a,u),a);return}f(null,a)}})}}function ot(e){this._maxSize=e,this.clear()}ot.prototype.clear=function(){this._size=0,this._values=Object.create(null)};ot.prototype.get=function(e){return this._values[e]};ot.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var _f=/[^.^\]^[]+|(?=\[\]|\.\.)/g,La=/^\d+$/,Af=/^\d/,Tf=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Cf=/^\s*(['"]?)(.*?)(\1)\s*$/,Zr=512,Ki=new ot(Zr),Wi=new ot(Zr),zi=new ot(Zr),Mn={Cache:ot,split:Hr,normalizePath:ir,setter:function(e){var t=ir(e);return Wi.get(e)||Wi.set(e,function(r,i){for(var a=0,o=t.length,s=r;a<o-1;){var u=t[a];if(u==="__proto__"||u==="constructor"||u==="prototype")return r;s=s[t[a++]]}s[t[a]]=i})},getter:function(e,t){var n=ir(e);return zi.get(e)||zi.set(e,function(i){for(var a=0,o=n.length;a<o;)if(i!=null||!t)i=i[n[a++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(Jr(n)||La.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){Rf(Array.isArray(e)?e:Hr(e),t,n)}};function ir(e){return Ki.get(e)||Ki.set(e,Hr(e).map(function(t){return t.replace(Cf,"$2")}))}function Hr(e){return e.match(_f)||[""]}function Rf(e,t,n){var r=e.length,i,a,o,s;for(a=0;a<r;a++)i=e[a],i&&(If(i)&&(i='"'+i+'"'),s=Jr(i),o=!s&&/^\d+$/.test(i),t.call(n,i,s,o,a,e))}function Jr(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function Ff(e){return e.match(Af)&&!e.match(La)}function $f(e){return Tf.test(e)}function If(e){return!Jr(e)&&(Ff(e)||$f(e))}const Vt={context:"$",value:"."};class tt{constructor(t,n={}){if(typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Vt.context,this.isValue=this.key[0]===Vt.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Vt.context:this.isValue?Vt.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Mn.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n?.parent,n?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}tt.prototype.__isYupRef=!0;function mn(){return mn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mn.apply(this,arguments)}function Of(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Xt(e){function t(n,r){let{value:i,path:a="",label:o,options:s,originalValue:u,sync:f}=n,l=Of(n,["value","path","label","options","originalValue","sync"]);const{name:c,test:p,params:d,message:h}=e;let{parent:m,context:g}=s;function b(F){return tt.isRef(F)?F.getValue(i,m,g):F}function S(F={}){const D=pa.default(mn({value:i,originalValue:u,label:o,path:F.path||a},d,F.params),b),x=new ge(ge.formatError(F.message||h,D),i,D.path,F.type||c);return x.params=D,x}let T=mn({path:a,parent:m,type:c,createError:S,resolve:b,options:s,originalValue:u},l);if(!f){try{Promise.resolve(p.call(T,i,T)).then(F=>{ge.isError(F)?r(F):F?r(null,F):r(S())})}catch(F){r(F)}return}let A;try{var R;if(A=p.call(T,i,T),typeof((R=A)==null?void 0:R.then)=="function")throw new Error(`Validation test of type: "${T.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(F){r(F);return}ge.isError(A)?r(A):A?r(null,A):r(S())}return t.OPTIONS=e,t}let Nf=e=>e.substr(0,e.length-1).substr(1);function Pf(e,t,n,r=n){let i,a,o;return t?(Mn.forEach(t,(s,u,f)=>{let l=u?Nf(s):s;if(e=e.resolve({context:r,parent:i,value:n}),e.innerType){let c=f?parseInt(l,10):0;if(n&&c>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[c],e=e.innerType}if(!f){if(!e.fields||!e.fields[l])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[l],e=e.fields[l]}a=l,o=u?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class gn{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){const t=[];for(const n of this.list)t.push(n);for(const[,n]of this.refs)t.push(n.describe());return t}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(t){tt.isRef(t)?this.refs.set(t.key,t):this.list.add(t)}delete(t){tt.isRef(t)?this.refs.delete(t.key):this.list.delete(t)}has(t,n){if(this.list.has(t))return!0;let r,i=this.refs.values();for(;r=i.next(),!r.done;)if(n(r.value)===t)return!0;return!1}clone(){const t=new gn;return t.list=new Set(this.list),t.refs=new Map(this.refs),t}merge(t,n){const r=this.clone();return t.list.forEach(i=>r.add(i)),t.refs.forEach(i=>r.add(i)),n.list.forEach(i=>r.delete(i)),n.refs.forEach(i=>r.delete(i)),r}}function Ce(){return Ce=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ce.apply(this,arguments)}class ye{constructor(t){this.deps=[],this.conditions=[],this._whitelist=new gn,this._blacklist=new gn,this.exclusiveTests=Object.create(null),this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Ye.notType)}),this.type=t?.type||"mixed",this.spec=Ce({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},t?.spec)}get _type(){return this.type}_typeCheck(t){return!0}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeError=this._typeError,n._whitelistError=this._whitelistError,n._blacklistError=this._blacklistError,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.exclusiveTests=Ce({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=kr(Ce({},this.spec,t)),n}label(t){var n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Ce({},n.spec,r.spec);return r.spec=i,r._typeError||(r._typeError=n._typeError),r._whitelistError||(r._whitelistError=n._whitelistError),r._blacklistError||(r._blacklistError=n._blacklistError),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(a=>{t.tests.forEach(o=>{a.test(o.OPTIONS)})}),r}isType(t){return this.spec.nullable&&t===null?!0:this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,a)=>a.resolve(i,t),n),n=n.resolve(t)}return n}cast(t,n={}){let r=this.resolve(Ce({value:t},n)),i=r._cast(t,n);if(t!==void 0&&n.assert!==!1&&r.isType(i)!==!0){let a=xt(t),o=xt(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r._type}".
3
3
 
4
4
  attempted value: ${a}
5
- `+(o!==a?`result of cast: ${o}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,a)=>a.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault()),r}_validate(t,n={},r){let{sync:i,path:a,from:o=[],originalValue:s=t,strict:u=this.spec.strict,abortEarly:f=this.spec.abortEarly}=n,l=t;u||(l=this._cast(l,Ce({assert:!1},n)));let c={value:l,path:a,options:n,originalValue:s,schema:this,label:this.spec.label,sync:i,from:o},p=[];this._typeError&&p.push(this._typeError),this._whitelistError&&p.push(this._whitelistError),this._blacklistError&&p.push(this._blacklistError),hn({args:c,value:l,path:a,tests:p,endEarly:f},d=>{if(d)return void r(d,l);hn({tests:this.tests,args:c,path:a,sync:i,value:l,endEarly:f},r)})}validate(t,n,r){let i=this.resolve(Ce({},n,{value:t}));return typeof r=="function"?i._validate(t,n,r):new Promise((a,o)=>i._validate(t,n,(s,u)=>{s?o(s):a(u)}))}validateSync(t,n){let r=this.resolve(Ce({},n,{value:t})),i;return r._validate(t,Ce({},n,{sync:!0}),(a,o)=>{if(a)throw a;i=o}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(ge.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(ge.isError(r))return!1;throw r}}_getDefault(){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this):kr(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){var n=this.clone();return n.spec.strict=t,n}_isPresent(t){return t!=null}defined(t=Ye.defined){return this.test({message:t,name:"defined",exclusive:!0,test(n){return n!==void 0}})}required(t=Ye.required){return this.clone({presence:"required"}).withMutation(n=>n.test({message:t,name:"required",exclusive:!0,test(r){return this.schema._isPresent(r)}}))}notRequired(){var t=this.clone({presence:"optional"});return t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t}nullable(t=!0){var n=this.clone({nullable:t!==!1});return n}transform(t){var n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Ye.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=Xt(n),a=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(a||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=Pa(t).map(a=>new tt(a));return i.forEach(a=>{a.isSibling&&r.deps.push(a.key)}),r.conditions.push(new wf(i,n)),r}typeError(t){var n=this.clone();return n._typeError=Xt({message:t,name:"typeError",test(r){return r!==void 0&&!this.schema.isType(r)?this.createError({params:{type:this.schema._type}}):!0}}),n}oneOf(t,n=Ye.oneOf){var r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r._whitelistError=Xt({message:n,name:"oneOf",test(i){if(i===void 0)return!0;let a=this.schema._whitelist;return a.has(i,this.resolve)?!0:this.createError({params:{values:a.toArray().join(", ")}})}}),r}notOneOf(t,n=Ye.notOneOf){var r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r._blacklistError=Xt({message:n,name:"notOneOf",test(i){let a=this.schema._blacklist;return a.has(i,this.resolve)?this.createError({params:{values:a.toArray().join(", ")}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(){const t=this.clone(),{label:n,meta:r}=t.spec;return{meta:r,label:n,type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(a=>({name:a.OPTIONS.name,params:a.OPTIONS.params})).filter((a,o,s)=>s.findIndex(u=>u.name===a.name)===o)}}}ye.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ye.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:a,schema:o}=Nf(this,t,n,r.context);return o[e](i&&i[a],Ce({},r,{parent:i,path:t}))};for(const e of["equals","is"])ye.prototype[e]=ye.prototype.oneOf;for(const e of["not","nope"])ye.prototype[e]=ye.prototype.notOneOf;ye.prototype.optional=ye.prototype.notRequired;const ka=ye;function jn(){return new ka}jn.prototype=ka.prototype;const ve=e=>e==null;let Pf=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,Lf=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,kf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Df=e=>ve(e)||e===e.trim(),Mf={}.toString();function ei(){return new Da}class Da extends ye{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(t){if(this.isType(t)||Array.isArray(t))return t;const n=t!=null&&t.toString?t.toString():t;return n===Mf?t:n})})}_typeCheck(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}_isPresent(t){return super._isPresent(t)&&!!t.length}length(t,n=$e.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},test(r){return ve(r)||r.length===this.resolve(t)}})}min(t,n=$e.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(r){return ve(r)||r.length>=this.resolve(t)}})}max(t,n=$e.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},test(r){return ve(r)||r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,a;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:a}=n:i=n),this.test({name:a||"matches",message:i||$e.matches,params:{regex:t},test:o=>ve(o)||o===""&&r||o.search(t)!==-1})}email(t=$e.email){return this.matches(Pf,{name:"email",message:t,excludeEmptyString:!0})}url(t=$e.url){return this.matches(Lf,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=$e.uuid){return this.matches(kf,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=$e.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:Df})}lowercase(t=$e.lowercase){return this.transform(n=>ve(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,test:n=>ve(n)||n===n.toLowerCase()})}uppercase(t=$e.uppercase){return this.transform(n=>ve(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,test:n=>ve(n)||n===n.toUpperCase()})}}ei.prototype=Da.prototype;var jf=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function Hf(e){var t=[1,4,5,6,7,10,11],n=0,r,i;if(i=jf.exec(e)){for(var a=0,o;o=t[a];++a)i[o]=+i[o]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,i[7]=i[7]?String(i[7]).substr(0,3):0,(i[8]===void 0||i[8]==="")&&(i[9]===void 0||i[9]==="")?r=+new Date(i[1],i[2],i[3],i[4],i[5],i[6],i[7]):(i[8]!=="Z"&&i[9]!==void 0&&(n=i[10]*60+i[11],i[9]==="+"&&(n=0-n)),r=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let Ma=new Date(""),Bf=e=>Object.prototype.toString.call(e)==="[object Date]";class Uf extends ye{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(t){return this.isType(t)?t:(t=Hf(t),isNaN(t)?Ma:new Date(t))})})}_typeCheck(t){return Bf(t)&&!isNaN(t.getTime())}prepareParam(t,n){let r;if(tt.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Dr.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(i){return ve(i)||i>=this.resolve(r)}})}max(t,n=Dr.max){var r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},test(i){return ve(i)||i<=this.resolve(r)}})}}Uf.INVALID_DATE=Ma;var ti={exports:{}};ti.exports=function(e){return ja(Gf(e),e)};ti.exports.array=ja;function ja(e,t){var n=e.length,r=new Array(n),i={},a=n,o=qf(t),s=Kf(e);for(t.forEach(function(f){if(!s.has(f[0])||!s.has(f[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});a--;)i[a]||u(e[a],a,new Set);return r;function u(f,l,c){if(c.has(f)){var p;try{p=", node was:"+JSON.stringify(f)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!s.has(f))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(f));if(!i[l]){i[l]=!0;var d=o.get(f)||new Set;if(d=Array.from(d),l=d.length){c.add(f);do{var h=d[--l];u(h,s.get(h),c)}while(l);c.delete(f)}r[--n]=f}}}function Gf(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function qf(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function Kf(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var Wf=ti.exports;const zf=Oa(Wf);function Yf(e,t=[]){let n=[],r=[];function i(a,o){var s=Mn.split(a)[0];~r.indexOf(s)||r.push(s),~t.indexOf(`${o}-${s}`)||n.push([o,s])}for(const a in e)if(fn.default(e,a)){let o=e[a];~r.indexOf(a)||r.push(a),tt.isRef(o)&&o.isSibling?i(o.path,a):Dn(o)&&"deps"in o&&o.deps.forEach(s=>i(s,a))}return zf.array(r,n).reverse()}function Yi(e,t){let n=1/0;return e.some((r,i)=>{var a;if(((a=t.path)==null?void 0:a.indexOf(r))!==-1)return n=i,!0}),n}function Ha(e){return(t,n)=>Yi(e,t)-Yi(e,n)}function yt(){return yt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yt.apply(this,arguments)}let Qi=e=>Object.prototype.toString.call(e)==="[object Object]";function Qf(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const Vf=Ha([]);class Ba extends ye{constructor(t){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=Vf,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(r){if(typeof r=="string")try{r=JSON.parse(r)}catch{r=null}return this.isType(r)?r:null}),t&&this.shape(t)})}_typeCheck(t){return Qi(t)||typeof t=="function"}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault();if(!this._typeCheck(i))return i;let a=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=this._nodes.concat(Object.keys(i).filter(c=>this._nodes.indexOf(c)===-1)),u={},f=yt({},n,{parent:u,__validating:n.__validating||!1}),l=!1;for(const c of s){let p=a[c],d=fn.default(i,c);if(p){let h,m=i[c];f.path=(n.path?`${n.path}.`:"")+c,p=p.resolve({value:m,context:n.context,parent:u});let g="spec"in p?p.spec:void 0,b=g?.strict;if(g?.strip){l=l||c in i;continue}h=!n.__validating||!b?p.cast(i[c],f):i[c],h!==void 0&&(u[c]=h)}else d&&!o&&(u[c]=i[c]);u[c]!==i[c]&&(l=!0)}return l?u:i}_validate(t,n={},r){let i=[],{sync:a,from:o=[],originalValue:s=t,abortEarly:u=this.spec.abortEarly,recursive:f=this.spec.recursive}=n;o=[{schema:this,value:s},...o],n.__validating=!0,n.originalValue=s,n.from=o,super._validate(t,n,(l,c)=>{if(l){if(!ge.isError(l)||u)return void r(l,c);i.push(l)}if(!f||!Qi(c)){r(i[0]||null,c);return}s=s||c;let p=this._nodes.map(d=>(h,m)=>{let g=d.indexOf(".")===-1?(n.path?`${n.path}.`:"")+d:`${n.path||""}["${d}"]`,b=this.fields[d];if(b&&"validate"in b){b.validate(c[d],yt({},n,{path:g,from:o,strict:!0,parent:c,originalValue:s[d]}),m);return}m(null)});hn({tests:p,value:c,errors:i,endEarly:u,sort:this._sortErrors,path:n.path},r)})}clone(t){const n=super.clone(t);return n.fields=yt({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,a]of Object.entries(this.fields)){const o=r[i];o===void 0?r[i]=a:o instanceof ye&&a instanceof ye&&(r[i]=a.concat(o))}return n.withMutation(()=>n.shape(r))}getDefaultFromShape(){let t={};return this._nodes.forEach(n=>{const r=this.fields[n];t[n]="default"in r?r.getDefault():void 0}),t}_getDefault(){if("default"in this.spec)return super._getDefault();if(this._nodes.length)return this.getDefaultFromShape()}shape(t,n=[]){let r=this.clone(),i=Object.assign(r.fields,t);if(r.fields=i,r._sortErrors=Ha(Object.keys(i)),n.length){Array.isArray(n[0])||(n=[n]);let a=n.map(([o,s])=>`${o}-${s}`);r._excludedEdges=r._excludedEdges.concat(a)}return r._nodes=Yf(i,r._excludedEdges),r}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.clone().withMutation(r=>(r.fields={},r.shape(n)))}omit(t){const n=this.clone(),r=n.fields;n.fields={};for(const i of t)delete r[i];return n.withMutation(()=>n.shape(r))}from(t,n,r){let i=Mn.getter(t,!0);return this.transform(a=>{if(a==null)return a;let o=a;return fn.default(a,t)&&(o=yt({},a),r||delete o[t],o[n]=i(a)),o})}noUnknown(t=!0,n=Mr.noUnknown){typeof t=="string"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const a=Qf(this.schema,i);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=Mr.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>n&&cc.default(n,(r,i)=>t(i)))}camelCase(){return this.transformKeys(uc.default)}snakeCase(){return this.transformKeys(Di.default)}constantCase(){return this.transformKeys(t=>Di.default(t).toUpperCase())}describe(){let t=super.describe();return t.fields=pa.default(this.fields,n=>n.describe()),t}}function Ua(e){return new Ba(e)}Ua.prototype=Ba.prototype;function yn(){return yn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yn.apply(this,arguments)}function Ga(e){return new qa(e)}class qa extends ye{constructor(t){super({type:"array"}),this.innerType=t,this.withMutation(()=>{this.transform(function(n){if(typeof n=="string")try{n=JSON.parse(n)}catch{n=null}return this.isType(n)?n:null})})}_typeCheck(t){return Array.isArray(t)}get _subType(){return this.innerType}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let i=!1;const a=r.map((o,s)=>{const u=this.innerType.cast(o,yn({},n,{path:`${n.path||""}[${s}]`}));return u!==o&&(i=!0),u});return i?a:r}_validate(t,n={},r){var i,a;let o=[];n.sync;let s=n.path,u=this.innerType,f=(i=n.abortEarly)!=null?i:this.spec.abortEarly,l=(a=n.recursive)!=null?a:this.spec.recursive,c=n.originalValue!=null?n.originalValue:t;super._validate(t,n,(p,d)=>{if(p){if(!ge.isError(p)||f)return void r(p,d);o.push(p)}if(!l||!u||!this._typeCheck(d)){r(o[0]||null,d);return}c=c||d;let h=new Array(d.length);for(let m=0;m<d.length;m++){let g=d[m],b=`${n.path||""}[${m}]`,S=yn({},n,{path:b,strict:!0,parent:d,index:m,originalValue:c[m]});h[m]=(T,A)=>u.validate(g,S,A)}hn({path:s,value:d,errors:o,endEarly:f,tests:h},r)})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!Dn(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+xt(t));return n.innerType=t,n}length(t,n=rn.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},test(r){return ve(r)||r.length===this.resolve(t)}})}min(t,n){return n=n||rn.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(r){return ve(r)||r.length>=this.resolve(t)}})}max(t,n){return n=n||rn.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},test(r){return ve(r)||r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,i,a)=>!t(r,i,a):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(){let t=super.describe();return this.innerType&&(t.innerType=this.innerType.describe()),t}nullable(t=!0){return super.nullable(t)}defined(){return super.defined()}required(t){return super.required(t)}}Ga.prototype=qa.prototype;function Xf(e){Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(n=>{Ef[t][n]=e[t][n]})})}function at(e,t,n){if(!e||!Dn(e.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof t!="string")throw new TypeError("A Method name must be provided");if(typeof n!="function")throw new TypeError("Method function must be provided");e.prototype[t]=n}var Zf={exports:{}};/*!
5
+ `+(o!==a?`result of cast: ${o}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,a)=>a.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault()),r}_validate(t,n={},r){let{sync:i,path:a,from:o=[],originalValue:s=t,strict:u=this.spec.strict,abortEarly:f=this.spec.abortEarly}=n,l=t;u||(l=this._cast(l,Ce({assert:!1},n)));let c={value:l,path:a,options:n,originalValue:s,schema:this,label:this.spec.label,sync:i,from:o},p=[];this._typeError&&p.push(this._typeError),this._whitelistError&&p.push(this._whitelistError),this._blacklistError&&p.push(this._blacklistError),hn({args:c,value:l,path:a,tests:p,endEarly:f},d=>{if(d)return void r(d,l);hn({tests:this.tests,args:c,path:a,sync:i,value:l,endEarly:f},r)})}validate(t,n,r){let i=this.resolve(Ce({},n,{value:t}));return typeof r=="function"?i._validate(t,n,r):new Promise((a,o)=>i._validate(t,n,(s,u)=>{s?o(s):a(u)}))}validateSync(t,n){let r=this.resolve(Ce({},n,{value:t})),i;return r._validate(t,Ce({},n,{sync:!0}),(a,o)=>{if(a)throw a;i=o}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(ge.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(ge.isError(r))return!1;throw r}}_getDefault(){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this):kr(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){var n=this.clone();return n.spec.strict=t,n}_isPresent(t){return t!=null}defined(t=Ye.defined){return this.test({message:t,name:"defined",exclusive:!0,test(n){return n!==void 0}})}required(t=Ye.required){return this.clone({presence:"required"}).withMutation(n=>n.test({message:t,name:"required",exclusive:!0,test(r){return this.schema._isPresent(r)}}))}notRequired(){var t=this.clone({presence:"optional"});return t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t}nullable(t=!0){var n=this.clone({nullable:t!==!1});return n}transform(t){var n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Ye.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=Xt(n),a=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(a||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=Pa(t).map(a=>new tt(a));return i.forEach(a=>{a.isSibling&&r.deps.push(a.key)}),r.conditions.push(new bf(i,n)),r}typeError(t){var n=this.clone();return n._typeError=Xt({message:t,name:"typeError",test(r){return r!==void 0&&!this.schema.isType(r)?this.createError({params:{type:this.schema._type}}):!0}}),n}oneOf(t,n=Ye.oneOf){var r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r._whitelistError=Xt({message:n,name:"oneOf",test(i){if(i===void 0)return!0;let a=this.schema._whitelist;return a.has(i,this.resolve)?!0:this.createError({params:{values:a.toArray().join(", ")}})}}),r}notOneOf(t,n=Ye.notOneOf){var r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r._blacklistError=Xt({message:n,name:"notOneOf",test(i){let a=this.schema._blacklist;return a.has(i,this.resolve)?this.createError({params:{values:a.toArray().join(", ")}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(){const t=this.clone(),{label:n,meta:r}=t.spec;return{meta:r,label:n,type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(a=>({name:a.OPTIONS.name,params:a.OPTIONS.params})).filter((a,o,s)=>s.findIndex(u=>u.name===a.name)===o)}}}ye.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ye.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:a,schema:o}=Pf(this,t,n,r.context);return o[e](i&&i[a],Ce({},r,{parent:i,path:t}))};for(const e of["equals","is"])ye.prototype[e]=ye.prototype.oneOf;for(const e of["not","nope"])ye.prototype[e]=ye.prototype.notOneOf;ye.prototype.optional=ye.prototype.notRequired;const ka=ye;function jn(){return new ka}jn.prototype=ka.prototype;const ve=(e=>e==null);let Lf=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,kf=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Df=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Mf=e=>ve(e)||e===e.trim(),jf={}.toString();function ei(){return new Da}class Da extends ye{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(t){if(this.isType(t)||Array.isArray(t))return t;const n=t!=null&&t.toString?t.toString():t;return n===jf?t:n})})}_typeCheck(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}_isPresent(t){return super._isPresent(t)&&!!t.length}length(t,n=$e.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},test(r){return ve(r)||r.length===this.resolve(t)}})}min(t,n=$e.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(r){return ve(r)||r.length>=this.resolve(t)}})}max(t,n=$e.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},test(r){return ve(r)||r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,a;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:a}=n:i=n),this.test({name:a||"matches",message:i||$e.matches,params:{regex:t},test:o=>ve(o)||o===""&&r||o.search(t)!==-1})}email(t=$e.email){return this.matches(Lf,{name:"email",message:t,excludeEmptyString:!0})}url(t=$e.url){return this.matches(kf,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=$e.uuid){return this.matches(Df,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=$e.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:Mf})}lowercase(t=$e.lowercase){return this.transform(n=>ve(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,test:n=>ve(n)||n===n.toLowerCase()})}uppercase(t=$e.uppercase){return this.transform(n=>ve(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,test:n=>ve(n)||n===n.toUpperCase()})}}ei.prototype=Da.prototype;var Hf=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function Bf(e){var t=[1,4,5,6,7,10,11],n=0,r,i;if(i=Hf.exec(e)){for(var a=0,o;o=t[a];++a)i[o]=+i[o]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,i[7]=i[7]?String(i[7]).substr(0,3):0,(i[8]===void 0||i[8]==="")&&(i[9]===void 0||i[9]==="")?r=+new Date(i[1],i[2],i[3],i[4],i[5],i[6],i[7]):(i[8]!=="Z"&&i[9]!==void 0&&(n=i[10]*60+i[11],i[9]==="+"&&(n=0-n)),r=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let Ma=new Date(""),Uf=e=>Object.prototype.toString.call(e)==="[object Date]";class Gf extends ye{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(t){return this.isType(t)?t:(t=Bf(t),isNaN(t)?Ma:new Date(t))})})}_typeCheck(t){return Uf(t)&&!isNaN(t.getTime())}prepareParam(t,n){let r;if(tt.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Dr.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(i){return ve(i)||i>=this.resolve(r)}})}max(t,n=Dr.max){var r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},test(i){return ve(i)||i<=this.resolve(r)}})}}Gf.INVALID_DATE=Ma;var ti={exports:{}};ti.exports=function(e){return ja(qf(e),e)};ti.exports.array=ja;function ja(e,t){var n=e.length,r=new Array(n),i={},a=n,o=Kf(t),s=Wf(e);for(t.forEach(function(f){if(!s.has(f[0])||!s.has(f[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});a--;)i[a]||u(e[a],a,new Set);return r;function u(f,l,c){if(c.has(f)){var p;try{p=", node was:"+JSON.stringify(f)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!s.has(f))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(f));if(!i[l]){i[l]=!0;var d=o.get(f)||new Set;if(d=Array.from(d),l=d.length){c.add(f);do{var h=d[--l];u(h,s.get(h),c)}while(l);c.delete(f)}r[--n]=f}}}function qf(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function Kf(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function Wf(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var zf=ti.exports;const Yf=Oa(zf);function Qf(e,t=[]){let n=[],r=[];function i(a,o){var s=Mn.split(a)[0];~r.indexOf(s)||r.push(s),~t.indexOf(`${o}-${s}`)||n.push([o,s])}for(const a in e)if(fn.default(e,a)){let o=e[a];~r.indexOf(a)||r.push(a),tt.isRef(o)&&o.isSibling?i(o.path,a):Dn(o)&&"deps"in o&&o.deps.forEach(s=>i(s,a))}return Yf.array(r,n).reverse()}function Yi(e,t){let n=1/0;return e.some((r,i)=>{var a;if(((a=t.path)==null?void 0:a.indexOf(r))!==-1)return n=i,!0}),n}function Ha(e){return(t,n)=>Yi(e,t)-Yi(e,n)}function yt(){return yt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yt.apply(this,arguments)}let Qi=e=>Object.prototype.toString.call(e)==="[object Object]";function Vf(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const Xf=Ha([]);class Ba extends ye{constructor(t){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=Xf,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(r){if(typeof r=="string")try{r=JSON.parse(r)}catch{r=null}return this.isType(r)?r:null}),t&&this.shape(t)})}_typeCheck(t){return Qi(t)||typeof t=="function"}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault();if(!this._typeCheck(i))return i;let a=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=this._nodes.concat(Object.keys(i).filter(c=>this._nodes.indexOf(c)===-1)),u={},f=yt({},n,{parent:u,__validating:n.__validating||!1}),l=!1;for(const c of s){let p=a[c],d=fn.default(i,c);if(p){let h,m=i[c];f.path=(n.path?`${n.path}.`:"")+c,p=p.resolve({value:m,context:n.context,parent:u});let g="spec"in p?p.spec:void 0,b=g?.strict;if(g?.strip){l=l||c in i;continue}h=!n.__validating||!b?p.cast(i[c],f):i[c],h!==void 0&&(u[c]=h)}else d&&!o&&(u[c]=i[c]);u[c]!==i[c]&&(l=!0)}return l?u:i}_validate(t,n={},r){let i=[],{sync:a,from:o=[],originalValue:s=t,abortEarly:u=this.spec.abortEarly,recursive:f=this.spec.recursive}=n;o=[{schema:this,value:s},...o],n.__validating=!0,n.originalValue=s,n.from=o,super._validate(t,n,(l,c)=>{if(l){if(!ge.isError(l)||u)return void r(l,c);i.push(l)}if(!f||!Qi(c)){r(i[0]||null,c);return}s=s||c;let p=this._nodes.map(d=>(h,m)=>{let g=d.indexOf(".")===-1?(n.path?`${n.path}.`:"")+d:`${n.path||""}["${d}"]`,b=this.fields[d];if(b&&"validate"in b){b.validate(c[d],yt({},n,{path:g,from:o,strict:!0,parent:c,originalValue:s[d]}),m);return}m(null)});hn({tests:p,value:c,errors:i,endEarly:u,sort:this._sortErrors,path:n.path},r)})}clone(t){const n=super.clone(t);return n.fields=yt({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,a]of Object.entries(this.fields)){const o=r[i];o===void 0?r[i]=a:o instanceof ye&&a instanceof ye&&(r[i]=a.concat(o))}return n.withMutation(()=>n.shape(r))}getDefaultFromShape(){let t={};return this._nodes.forEach(n=>{const r=this.fields[n];t[n]="default"in r?r.getDefault():void 0}),t}_getDefault(){if("default"in this.spec)return super._getDefault();if(this._nodes.length)return this.getDefaultFromShape()}shape(t,n=[]){let r=this.clone(),i=Object.assign(r.fields,t);if(r.fields=i,r._sortErrors=Ha(Object.keys(i)),n.length){Array.isArray(n[0])||(n=[n]);let a=n.map(([o,s])=>`${o}-${s}`);r._excludedEdges=r._excludedEdges.concat(a)}return r._nodes=Qf(i,r._excludedEdges),r}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.clone().withMutation(r=>(r.fields={},r.shape(n)))}omit(t){const n=this.clone(),r=n.fields;n.fields={};for(const i of t)delete r[i];return n.withMutation(()=>n.shape(r))}from(t,n,r){let i=Mn.getter(t,!0);return this.transform(a=>{if(a==null)return a;let o=a;return fn.default(a,t)&&(o=yt({},a),r||delete o[t],o[n]=i(a)),o})}noUnknown(t=!0,n=Mr.noUnknown){typeof t=="string"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const a=Vf(this.schema,i);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=Mr.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>n&&lc.default(n,(r,i)=>t(i)))}camelCase(){return this.transformKeys(cc.default)}snakeCase(){return this.transformKeys(Di.default)}constantCase(){return this.transformKeys(t=>Di.default(t).toUpperCase())}describe(){let t=super.describe();return t.fields=pa.default(this.fields,n=>n.describe()),t}}function Ua(e){return new Ba(e)}Ua.prototype=Ba.prototype;function yn(){return yn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yn.apply(this,arguments)}function Ga(e){return new qa(e)}class qa extends ye{constructor(t){super({type:"array"}),this.innerType=t,this.withMutation(()=>{this.transform(function(n){if(typeof n=="string")try{n=JSON.parse(n)}catch{n=null}return this.isType(n)?n:null})})}_typeCheck(t){return Array.isArray(t)}get _subType(){return this.innerType}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let i=!1;const a=r.map((o,s)=>{const u=this.innerType.cast(o,yn({},n,{path:`${n.path||""}[${s}]`}));return u!==o&&(i=!0),u});return i?a:r}_validate(t,n={},r){var i,a;let o=[];n.sync;let s=n.path,u=this.innerType,f=(i=n.abortEarly)!=null?i:this.spec.abortEarly,l=(a=n.recursive)!=null?a:this.spec.recursive,c=n.originalValue!=null?n.originalValue:t;super._validate(t,n,(p,d)=>{if(p){if(!ge.isError(p)||f)return void r(p,d);o.push(p)}if(!l||!u||!this._typeCheck(d)){r(o[0]||null,d);return}c=c||d;let h=new Array(d.length);for(let m=0;m<d.length;m++){let g=d[m],b=`${n.path||""}[${m}]`,S=yn({},n,{path:b,strict:!0,parent:d,index:m,originalValue:c[m]});h[m]=(T,A)=>u.validate(g,S,A)}hn({path:s,value:d,errors:o,endEarly:f,tests:h},r)})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!Dn(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+xt(t));return n.innerType=t,n}length(t,n=rn.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},test(r){return ve(r)||r.length===this.resolve(t)}})}min(t,n){return n=n||rn.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(r){return ve(r)||r.length>=this.resolve(t)}})}max(t,n){return n=n||rn.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},test(r){return ve(r)||r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,i,a)=>!t(r,i,a):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(){let t=super.describe();return this.innerType&&(t.innerType=this.innerType.describe()),t}nullable(t=!0){return super.nullable(t)}defined(){return super.defined()}required(t){return super.required(t)}}Ga.prototype=qa.prototype;function Zf(e){Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(n=>{Ef[t][n]=e[t][n]})})}function at(e,t,n){if(!e||!Dn(e.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof t!="string")throw new TypeError("A Method name must be provided");if(typeof n!="function")throw new TypeError("Method function must be provided");e.prototype[t]=n}var Jf={exports:{}};/*!
6
6
  * depd
7
7
  * Copyright(c) 2015 Douglas Christopher Wilson
8
8
  * MIT Licensed
9
- */var Jf=ep;function ep(e){if(!e)throw new TypeError("argument namespace is required");function t(n){}return t._file=void 0,t._ignored=!0,t._namespace=e,t._traced=!1,t._warned=Object.create(null),t.function=tp,t.property=np,t}function tp(e,t){if(typeof e!="function")throw new TypeError("argument fn must be a function");return e}function np(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var r=Object.getOwnPropertyDescriptor(e,t);if(!r)throw new TypeError("must call property on owner object");if(!r.configurable)throw new TypeError("property must be configurable")}var rp=Object.setPrototypeOf||({__proto__:[]}instanceof Array?ip:op);function ip(e,t){return e.__proto__=t,e}function op(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n]);return e}const ap={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};/*!
9
+ */var ep=tp;function tp(e){if(!e)throw new TypeError("argument namespace is required");function t(n){}return t._file=void 0,t._ignored=!0,t._namespace=e,t._traced=!1,t._warned=Object.create(null),t.function=np,t.property=rp,t}function np(e,t){if(typeof e!="function")throw new TypeError("argument fn must be a function");return e}function rp(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var r=Object.getOwnPropertyDescriptor(e,t);if(!r)throw new TypeError("must call property on owner object");if(!r.configurable)throw new TypeError("property must be configurable")}var ip=Object.setPrototypeOf||({__proto__:[]}instanceof Array?op:ap);function op(e,t){return e.__proto__=t,e}function ap(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n]);return e}const sp={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};/*!
10
10
  * statuses
11
11
  * Copyright(c) 2014 Jonathan Ong
12
12
  * Copyright(c) 2016 Douglas Christopher Wilson
13
13
  * MIT Licensed
14
- */var ni=ap,sp=Oe;Oe.message=ni;Oe.code=up(ni);Oe.codes=cp(ni);Oe.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};Oe.empty={204:!0,205:!0,304:!0};Oe.retry={502:!0,503:!0,504:!0};function up(e){var t={};return Object.keys(e).forEach(function(r){var i=e[r],a=Number(r);t[i.toLowerCase()]=a}),t}function cp(e){return Object.keys(e).map(function(n){return Number(n)})}function lp(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(Oe.code,t))throw new Error('invalid status message: "'+e+'"');return Oe.code[t]}function Vi(e){if(!Object.prototype.hasOwnProperty.call(Oe.message,e))throw new Error("invalid status code: "+e);return Oe.message[e]}function Oe(e){if(typeof e=="number")return Vi(e);if(typeof e!="string")throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?lp(e):Vi(t)}var Br={exports:{}};typeof Object.create=="function"?Br.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Br.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}};var fp=Br.exports;/*!
14
+ */var ni=sp,up=Oe;Oe.message=ni;Oe.code=cp(ni);Oe.codes=lp(ni);Oe.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};Oe.empty={204:!0,205:!0,304:!0};Oe.retry={502:!0,503:!0,504:!0};function cp(e){var t={};return Object.keys(e).forEach(function(r){var i=e[r],a=Number(r);t[i.toLowerCase()]=a}),t}function lp(e){return Object.keys(e).map(function(n){return Number(n)})}function fp(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(Oe.code,t))throw new Error('invalid status message: "'+e+'"');return Oe.code[t]}function Vi(e){if(!Object.prototype.hasOwnProperty.call(Oe.message,e))throw new Error("invalid status code: "+e);return Oe.message[e]}function Oe(e){if(typeof e=="number")return Vi(e);if(typeof e!="string")throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?fp(e):Vi(t)}var Br={exports:{}};typeof Object.create=="function"?Br.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Br.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}};var pp=Br.exports;/*!
15
15
  * toidentifier
16
16
  * Copyright(c) 2016 Douglas Christopher Wilson
17
17
  * MIT Licensed
18
- */var pp=dp;function dp(e){return e.split(" ").map(function(t){return t.slice(0,1).toUpperCase()+t.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}/*!
18
+ */var dp=hp;function hp(e){return e.split(" ").map(function(t){return t.slice(0,1).toUpperCase()+t.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}/*!
19
19
  * http-errors
20
20
  * Copyright(c) 2014 Jonathan Ong
21
21
  * Copyright(c) 2016 Douglas Christopher Wilson
22
22
  * MIT Licensed
23
- */(function(e){Jf("http-errors");var t=rp,n=sp,r=fp,i=pp;e.exports=o,e.exports.HttpError=s(),e.exports.isHttpError=f(e.exports.HttpError),p(e.exports,n.codes,e.exports.HttpError);function a(h){return+(String(h).charAt(0)+"00")}function o(){for(var h,m,g=500,b={},S=0;S<arguments.length;S++){var T=arguments[S],A=typeof T;if(A==="object"&&T instanceof Error)h=T,g=h.status||h.statusCode||g;else if(A==="number"&&S===0)g=T;else if(A==="string")m=T;else if(A==="object")b=T;else throw new TypeError("argument #"+(S+1)+" unsupported type "+A)}(typeof g!="number"||!n.message[g]&&(g<400||g>=600))&&(g=500);var C=o[g]||o[a(g)];h||(h=C?new C(m):new Error(m||n.message[g]),Error.captureStackTrace(h,o)),(!C||!(h instanceof C)||h.status!==g)&&(h.expose=g<500,h.status=h.statusCode=g);for(var F in b)F!=="status"&&F!=="statusCode"&&(h[F]=b[F]);return h}function s(){function h(){throw new TypeError("cannot construct abstract class")}return r(h,Error),h}function u(h,m,g){var b=d(m);function S(T){var A=T??n.message[g],C=new Error(A);return Error.captureStackTrace(C,S),t(C,S.prototype),Object.defineProperty(C,"message",{enumerable:!0,configurable:!0,value:A,writable:!0}),Object.defineProperty(C,"name",{enumerable:!1,configurable:!0,value:b,writable:!0}),C}return r(S,h),c(S,b),S.prototype.status=g,S.prototype.statusCode=g,S.prototype.expose=!0,S}function f(h){return function(g){return!g||typeof g!="object"?!1:g instanceof h?!0:g instanceof Error&&typeof g.expose=="boolean"&&typeof g.statusCode=="number"&&g.status===g.statusCode}}function l(h,m,g){var b=d(m);function S(T){var A=T??n.message[g],C=new Error(A);return Error.captureStackTrace(C,S),t(C,S.prototype),Object.defineProperty(C,"message",{enumerable:!0,configurable:!0,value:A,writable:!0}),Object.defineProperty(C,"name",{enumerable:!1,configurable:!0,value:b,writable:!0}),C}return r(S,h),c(S,b),S.prototype.status=g,S.prototype.statusCode=g,S.prototype.expose=!1,S}function c(h,m){var g=Object.getOwnPropertyDescriptor(h,"name");g&&g.configurable&&(g.value=m,Object.defineProperty(h,"name",g))}function p(h,m,g){m.forEach(function(S){var T,A=i(n.message[S]);switch(a(S)){case 400:T=u(g,A,S);break;case 500:T=l(g,A,S);break}T&&(h[S]=T,h[A]=T)})}function d(h){return h.substr(-5)!=="Error"?h+"Error":h}})(Zf);class hp extends Error{constructor(t="An application error occured",n={}){super(),this.name="ApplicationError",this.message=t,this.details=n}}class It extends hp{constructor(t="Entity not found",n){super(t,n),this.name="NotFoundError",this.message=t}}const mp=["$and","$or"],gp=["$not","$in","$notIn","$eq","$eqi","$ne","$nei","$gt","$gte","$lt","$lte","$null","$notNull","$between","$startsWith","$endsWith","$startsWithi","$endsWithi","$contains","$notContains","$containsi","$notContainsi","$jsonSupersetOf"],yp=["$not","$in","$notIn","$eq","$ne","$gt","$gte","$lt","$lte","$between"],vp=["$in","$notIn","$between"],vn={where:gp,cast:yp,group:mp,array:vp},Ep=Object.fromEntries(Object.entries(vn).map(([e,t])=>[e,t.map(n=>n.toLowerCase())])),wp=(e,t)=>e in t,bp=(e,t,n=!1)=>n?Ep[e]?.includes(t.toLowerCase())??!1:wp(e,vn)?vn[e]?.includes(t)??!1:!1,Sp=(e,t=!1)=>Object.keys(vn).some(n=>bp(n,e,t));var xp=(e,t=1,n)=>{if(n={indent:" ",includeEmptyLines:!1,...n},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof n.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``);if(t===0)return e;const r=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(r,n.indent.repeat(t))};const Xi=Ln.default,Zi=/\s+at.*(?:\(|\s)(.*)\)?/,_p=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,Ap=typeof Xi.homedir>"u"?"":Xi.homedir();var Tp=(e,t)=>(t=Object.assign({pretty:!1},t),e.replace(/\\/g,"/").split(`
24
- `).filter(n=>{const r=n.match(Zi);if(r===null||!r[1])return!0;const i=r[1];return i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")?!1:!_p.test(i)}).filter(n=>n.trim()!=="").map(n=>t.pretty?n.replace(Zi,(r,i)=>r.replace(i,i.replace(Ap,"~"))):n).join(`
25
- `));const Cp=xp,Rp=Tp,Fp=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");let $p=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=[...t].map(r=>r instanceof Error?r:r!==null&&typeof r=="object"?Object.assign(new Error(r.message),r):new Error(r));let n=t.map(r=>typeof r.stack=="string"?Fp(Rp(r.stack)):String(r)).join(`
23
+ */(function(e){ep("http-errors");var t=ip,n=up,r=pp,i=dp;e.exports=o,e.exports.HttpError=s(),e.exports.isHttpError=f(e.exports.HttpError),p(e.exports,n.codes,e.exports.HttpError);function a(h){return+(String(h).charAt(0)+"00")}function o(){for(var h,m,g=500,b={},S=0;S<arguments.length;S++){var T=arguments[S],A=typeof T;if(A==="object"&&T instanceof Error)h=T,g=h.status||h.statusCode||g;else if(A==="number"&&S===0)g=T;else if(A==="string")m=T;else if(A==="object")b=T;else throw new TypeError("argument #"+(S+1)+" unsupported type "+A)}(typeof g!="number"||!n.message[g]&&(g<400||g>=600))&&(g=500);var R=o[g]||o[a(g)];h||(h=R?new R(m):new Error(m||n.message[g]),Error.captureStackTrace(h,o)),(!R||!(h instanceof R)||h.status!==g)&&(h.expose=g<500,h.status=h.statusCode=g);for(var F in b)F!=="status"&&F!=="statusCode"&&(h[F]=b[F]);return h}function s(){function h(){throw new TypeError("cannot construct abstract class")}return r(h,Error),h}function u(h,m,g){var b=d(m);function S(T){var A=T??n.message[g],R=new Error(A);return Error.captureStackTrace(R,S),t(R,S.prototype),Object.defineProperty(R,"message",{enumerable:!0,configurable:!0,value:A,writable:!0}),Object.defineProperty(R,"name",{enumerable:!1,configurable:!0,value:b,writable:!0}),R}return r(S,h),c(S,b),S.prototype.status=g,S.prototype.statusCode=g,S.prototype.expose=!0,S}function f(h){return function(g){return!g||typeof g!="object"?!1:g instanceof h?!0:g instanceof Error&&typeof g.expose=="boolean"&&typeof g.statusCode=="number"&&g.status===g.statusCode}}function l(h,m,g){var b=d(m);function S(T){var A=T??n.message[g],R=new Error(A);return Error.captureStackTrace(R,S),t(R,S.prototype),Object.defineProperty(R,"message",{enumerable:!0,configurable:!0,value:A,writable:!0}),Object.defineProperty(R,"name",{enumerable:!1,configurable:!0,value:b,writable:!0}),R}return r(S,h),c(S,b),S.prototype.status=g,S.prototype.statusCode=g,S.prototype.expose=!1,S}function c(h,m){var g=Object.getOwnPropertyDescriptor(h,"name");g&&g.configurable&&(g.value=m,Object.defineProperty(h,"name",g))}function p(h,m,g){m.forEach(function(S){var T,A=i(n.message[S]);switch(a(S)){case 400:T=u(g,A,S);break;case 500:T=l(g,A,S);break}T&&(h[S]=T,h[A]=T)})}function d(h){return h.substr(-5)!=="Error"?h+"Error":h}})(Jf);class mp extends Error{constructor(t="An application error occurred",n={}){super(),this.name="ApplicationError",this.message=t,this.details=n}}class It extends mp{constructor(t="Entity not found",n){super(t,n),this.name="NotFoundError",this.message=t}}const gp=["$and","$or"],yp=["$not","$in","$notIn","$eq","$eqi","$ne","$nei","$gt","$gte","$lt","$lte","$null","$notNull","$between","$startsWith","$endsWith","$startsWithi","$endsWithi","$contains","$notContains","$containsi","$notContainsi","$jsonSupersetOf"],vp=["$not","$in","$notIn","$eq","$ne","$gt","$gte","$lt","$lte","$between"],wp=["$in","$notIn","$between"],vn={where:yp,cast:vp,group:gp,array:wp},Ep=Object.fromEntries(Object.entries(vn).map(([e,t])=>[e,t.map(n=>n.toLowerCase())])),bp=(e,t)=>e in t,Sp=(e,t,n=!1)=>n?Ep[e]?.includes(t.toLowerCase())??!1:bp(e,vn)?vn[e]?.includes(t)??!1:!1,xp=(e,t=!1)=>Object.keys(vn).some(n=>Sp(n,e,t));var _p=(e,t=1,n)=>{if(n={indent:" ",includeEmptyLines:!1,...n},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof n.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``);if(t===0)return e;const r=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(r,n.indent.repeat(t))};const Xi=Ln.default,Zi=/\s+at.*(?:\(|\s)(.*)\)?/,Ap=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,Tp=typeof Xi.homedir>"u"?"":Xi.homedir();var Cp=(e,t)=>(t=Object.assign({pretty:!1},t),e.replace(/\\/g,"/").split(`
24
+ `).filter(n=>{const r=n.match(Zi);if(r===null||!r[1])return!0;const i=r[1];return i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")?!1:!Ap.test(i)}).filter(n=>n.trim()!=="").map(n=>t.pretty?n.replace(Zi,(r,i)=>r.replace(i,i.replace(Tp,"~"))):n).join(`
25
+ `));const Rp=_p,Fp=Cp,$p=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");let Ip=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=[...t].map(r=>r instanceof Error?r:r!==null&&typeof r=="object"?Object.assign(new Error(r.message),r):new Error(r));let n=t.map(r=>typeof r.stack=="string"?$p(Fp(r.stack)):String(r)).join(`
26
26
  `);n=`
27
- `+Cp(n,4),super(n),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:t})}*[Symbol.iterator](){for(const t of this._errors)yield t}};var Ip=$p;const Op=Ip;var Np=async(e,t,{concurrency:n=1/0,stopOnError:r=!0}={})=>new Promise((i,a)=>{if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(n)||n===1/0)&&n>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);const o=[],s=[],u=e[Symbol.iterator]();let f=!1,l=!1,c=0,p=0;const d=()=>{if(f)return;const h=u.next(),m=p;if(p++,h.done){l=!0,c===0&&(!r&&s.length!==0?a(new Op(s)):i(o));return}c++,(async()=>{try{const g=await h.value;o[m]=await t(g,m),c--,d()}catch(g){r?(f=!0,a(g)):(s.push(g),c--,d())}})()};for(let h=0;h<n&&(d(),!l);h++);});const Pp=Oa(Np);function Hn(...e){const[t,...n]=e;return async(...r)=>{let i=await t.apply(t,r);for(let a=0;a<n.length;a+=1)i=await n[a](i);return i}}R.curry(Pp);const Bn=({key:e,attribute:t},{remove:n})=>{t?.type==="password"&&n(e)},jt=({schema:e,key:t,attribute:n},{remove:r})=>{if(!n)return;(n.private===!0||of(e,t))&&r(t)},Ka=({key:e,attribute:t},{remove:n})=>{Ia(t)&&n(e)},Wa=({key:e,attribute:t},{remove:n})=>{sf(t)&&n(e)},Lp=({schema:e,key:t,value:n},{set:r})=>{if(t===""&&n==="*"){const{attributes:i}=e,a=Object.entries(i).filter(([,o])=>["relation","component","media","dynamiczone"].includes(o.type)).reduce((o,[s])=>({...o,[s]:!0}),{});r("",a)}},kp={raw:null,attribute:null};var Un=()=>{const e={parsers:[],interceptors:[],ignore:[],handlers:{attributes:[],common:[]}},t=async(n,r,i)=>{const{path:a=kp,parent:o,schema:s,getModel:u}=r??{};for(const{predicate:d,handler:h}of e.interceptors)if(d(i))return h(n,r,i,{recurse:t});const f=e.parsers.find(d=>d.predicate(i))?.parser,l=f?.(i);if(!l)return i;let c=l.transform(i);const p=l.keys(c);for(const d of p){const h=s?.attributes?.[d],m={...a};m.raw=R.isNil(a.raw)?d:`${a.raw}.${d}`,R.isNil(h)||(m.attribute=R.isNil(a.attribute)?d:`${a.attribute}.${d}`);const g={key:d,value:l.get(d,c),attribute:h,schema:s,path:m,data:c,getModel:u,parent:o},b={remove(j){c=l.remove(j,c)},set(j,x){c=l.set(j,x,c)},recurse:t};await n(g,R.pick(["remove","set"],b));const S=l.get(d,c),T=()=>({key:d,value:S,attribute:h,schema:s,path:m,data:c,visitor:n,getModel:u,parent:o}),A=T();if(e.ignore.some(j=>j(A)))continue;const F=[...e.handlers.common,...e.handlers.attributes];for await(const j of F){const x=T();await j.predicate(x)&&await j.handler(x,R.pick(["recurse","set"],b))}}return c};return{traverse:t,intercept(n,r){return e.interceptors.push({predicate:n,handler:r}),this},parse(n,r){return e.parsers.push({predicate:n,parser:r}),this},ignore(n){return e.ignore.push(n),this},on(n,r){return e.handlers.common.push({predicate:n,handler:r}),this},onAttribute(n,r){return e.handlers.attributes.push({predicate:n,handler:r}),this},onRelation(n){return this.onAttribute(({attribute:r})=>r?.type==="relation",n)},onMedia(n){return this.onAttribute(({attribute:r})=>r?.type==="media",n)},onComponent(n){return this.onAttribute(({attribute:r})=>r?.type==="component",n)},onDynamicZone(n){return this.onAttribute(({attribute:r})=>r?.type==="dynamiczone",n)}}};const Dp=e=>R.isObject(e),Mp=Un().intercept(R.isArray,async(e,t,n,{recurse:r})=>Promise.all(n.map((i,a)=>{const o=t.path?{...t.path,raw:`${t.path.raw}[${a}]`}:t.path;return r(e,{...t,path:o},i)})).then(i=>i.filter(a=>!(R.isObject(a)&&R.isEmpty(a))))).intercept(e=>!R.isObject(e),(e,t,n)=>n).parse(Dp,()=>({transform:R.cloneDeep,remove(e,t){return R.omit(e,t)},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).ignore(({value:e})=>R.isNil(e)).on(({attribute:e})=>R.isNil(e),async({key:e,visitor:t,path:n,value:r,schema:i,getModel:a,attribute:o},{set:s,recurse:u})=>{s(e,await u(t,{schema:i,path:n,getModel:a,parent:{key:e,path:n,schema:i,attribute:o}},r))}).onRelation(async({key:e,attribute:t,visitor:n,path:r,value:i,schema:a,getModel:o},{set:s,recurse:u})=>{if(t.relation.toLowerCase().startsWith("morph"))return;const l={key:e,path:r,schema:a,attribute:t},c=t.target,p=o(c),d=await u(n,{schema:p,path:r,getModel:o,parent:l},i);s(e,d)}).onComponent(async({key:e,attribute:t,visitor:n,path:r,schema:i,value:a,getModel:o},{set:s,recurse:u})=>{const f={key:e,path:r,schema:i,attribute:t},l=o(t.component),c=await u(n,{schema:l,path:r,getModel:o,parent:f},a);s(e,c)}).onMedia(async({key:e,visitor:t,path:n,schema:r,attribute:i,value:a,getModel:o},{set:s,recurse:u})=>{const f={key:e,path:n,schema:r,attribute:i},c=o("plugin::upload.file"),p=await u(t,{schema:c,path:n,getModel:o,parent:f},a);s(e,p)});var ut=R.curry(Mp.traverse);const jp={asc:"asc",desc:"desc"},Hp=Object.values(jp),Bp=e=>Hp.includes(e.toLowerCase()),Up=e=>Array.isArray(e)&&e.every(R.isString),Gp=e=>Array.isArray(e)&&e.every(R.isObject),qp=e=>R.isString(e)&&e.split(",").length>1,Kp=e=>R.isObject(e),Wp=Un().intercept(qp,async(e,t,n,{recurse:r})=>Promise.all(n.split(",").map(R.trim).map(i=>r(e,t,i))).then(i=>i.filter(a=>!R.isEmpty(a)).join(","))).intercept(Up,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i))).then(i=>i.filter(a=>!R.isEmpty(a)))).intercept(Gp,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i))).then(i=>i.filter(a=>!R.isEmpty(a)))).parse(R.isString,()=>{const e=R.pipe(R.split("."),R.map(R.split(":")),R.flatten),t=n=>{if(n.length!==0)return n.reduce((r,i)=>R.isEmpty(i)?r:r===""?i:Bp(i)?`${r}:${i}`:`${r}.${i}`,"")};return{transform:R.trim,remove(n,r){const[i]=e(r);return i===n?void 0:r},set(n,r,i){const[a]=e(i);return a!==n?i:R.isNil(r)?a:`${a}.${r}`},keys(n){const r=R.first(e(n));return r?[r]:[]},get(n,r){const[i,...a]=e(r);return n===i?t(a):void 0}}}).parse(Kp,()=>({transform:R.cloneDeep,remove(e,t){const{[e]:n,...r}=t;return r},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).onRelation(async({key:e,value:t,attribute:n,visitor:r,path:i,getModel:a,schema:o},{set:s,recurse:u})=>{if(n.relation.toLowerCase().startsWith("morph"))return;const l={key:e,path:i,schema:o,attribute:n},c=n.target,p=a(c),d=await u(r,{schema:p,path:i,getModel:a,parent:l},t);s(e,d)}).onMedia(async({key:e,path:t,schema:n,attribute:r,visitor:i,value:a,getModel:o},{recurse:s,set:u})=>{const f={key:e,path:t,schema:n,attribute:r},c=o("plugin::upload.file"),p=await s(i,{schema:c,path:t,getModel:o,parent:f},a);u(e,p)}).onComponent(async({key:e,value:t,visitor:n,path:r,schema:i,attribute:a,getModel:o},{recurse:s,set:u})=>{const f={key:e,path:r,schema:i,attribute:a},l=o(a.component),c=await s(n,{schema:l,path:r,getModel:o,parent:f},t);u(e,c)});var ct=R.curry(Wp.traverse);const Ji=e=>({key:t,attribute:n})=>!n&&e===t,za=e=>e==="*",zp=e=>R.isString(e)&&!za(e),Yp=e=>R.isArray(e)&&e.every(R.isString),eo=e=>R.isObject(e),Qp=Un().intercept(zp,async(e,t,n,{recurse:r})=>{const i=Xp([n]),a=await r(e,t,i),[o]=Vp(a);return o}).intercept(Yp,async(e,t,n,{recurse:r})=>(await Promise.all(n.map(a=>r(e,t,a)))).filter(a=>!R.isNil(a))).parse(za,()=>({transform:R.identity,get:(e,t)=>t,set:(e,t)=>t,keys:R.constant([""]),remove:R.constant(void 0)})).parse(R.isString,()=>{const e=R.split("."),t=R.join(".");return{transform:R.trim,remove(n,r){const[i]=e(r);return i===n?void 0:r},set(n,r,i){const[a]=e(i);return a!==n?i:R.isNil(r)||R.isEmpty(r)?a:`${a}.${r}`},keys(n){const r=R.first(e(n));return r?[r]:[]},get(n,r){const[i,...a]=e(r);return n===i?t(a):void 0}}}).parse(eo,()=>({transform:R.cloneDeep,remove(e,t){const{[e]:n,...r}=t;return r},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).ignore(({key:e,attribute:t})=>["sort","filters","fields"].includes(e)&&!t).on(Ji("populate"),async({key:e,visitor:t,path:n,value:r,schema:i,getModel:a,attribute:o},{set:s,recurse:u})=>{const l=await u(t,{schema:i,path:n,getModel:a,parent:{key:e,path:n,schema:i,attribute:o}},r);s(e,l)}).on(Ji("on"),async({key:e,visitor:t,path:n,value:r,getModel:i,parent:a},{set:o,recurse:s})=>{const u={};if(eo(r)){for(const[f,l]of Object.entries(r)){const c=i(f),p={...n,raw:`${n.raw}[${f}]`};u[f]=await s(t,{schema:c,path:p,getModel:i,parent:a},l)}o(e,u)}}).onRelation(async({key:e,value:t,attribute:n,visitor:r,path:i,schema:a,getModel:o},{set:s,recurse:u})=>{if(R.isNil(t))return;const f={key:e,path:i,schema:a,attribute:n};if(Ia(n)){if(!R.isObject(t)||!("on"in t&&R.isObject(t?.on)))return;const d=await u(r,{schema:a,path:i,getModel:o,parent:f},{on:t?.on});s(e,d);return}const l=n.target,c=o(l),p=await u(r,{schema:c,path:i,getModel:o,parent:f},t);s(e,p)}).onMedia(async({key:e,path:t,schema:n,attribute:r,visitor:i,value:a,getModel:o},{recurse:s,set:u})=>{if(R.isNil(a))return;const f={key:e,path:t,schema:n,attribute:r},c=o("plugin::upload.file"),p=await s(i,{schema:c,path:t,getModel:o,parent:f},a);u(e,p)}).onComponent(async({key:e,value:t,schema:n,visitor:r,path:i,attribute:a,getModel:o},{recurse:s,set:u})=>{if(R.isNil(t))return;const f={key:e,path:i,schema:n,attribute:a},l=o(a.component),c=await s(r,{schema:l,path:i,getModel:o,parent:f},t);u(e,c)}).onDynamicZone(async({key:e,value:t,schema:n,visitor:r,path:i,attribute:a,getModel:o},{set:s,recurse:u})=>{if(R.isNil(t)||!R.isObject(t))return;const f={key:e,path:i,schema:n,attribute:a};if("on"in t&&t.on){const l=await u(r,{schema:n,path:i,getModel:o,parent:f},{on:t.on});s(e,l)}});var or=R.curry(Qp.traverse);const Vp=e=>{const t=[];function n(r,i){for(const[a,o]of Object.entries(r)){const s=i?`${i}.${a}`:a;o===!0?t.push(s):n(o.populate,s)}}return n(e,""),t},Xp=e=>{const t={};function n(r,i){const[a,...o]=i;o.length===0?r[a]=!0:((!r[a]||typeof r[a]=="boolean")&&(r[a]={populate:{}}),n(r[a].populate,o))}return e.forEach(r=>n(t,r.split("."))),t},Zp=e=>R.isArray(e)&&e.every(R.isString),Jp=Un().intercept(Zp,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i)))).intercept(e=>R.isString(e)&&e.includes(","),(e,t,n,{recurse:r})=>Promise.all(n.split(",").map(i=>r(e,t,i)))).intercept(e=>R.eq("*",e),R.constant("*")).parse(R.isString,()=>({transform:R.trim,remove(e,t){return t===e?void 0:t},set(e,t,n){return n},keys(e){return[e]},get(e,t){return e===t?t:void 0}}));var ar=R.curry(Jp.traverse);const{ID_ATTRIBUTE:En,DOC_ID_ATTRIBUTE:wn}=nf,ed=async(e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeOutput");return cf((...n)=>{Bn(...n),jt(...n)},e,t)},td=R.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeFilters");return Hn(ut(({key:n,attribute:r},{remove:i})=>{const a=!!r;[En,wn].includes(n)||!a&&!Sp(n)&&i(n)},e),ut(Wa,e),ut(Ka,e),ut(Bn,e),ut(jt,e),ut(({key:n,value:r},{remove:i})=>{R.isObject(r)&&R.isEmpty(r)&&i(n)},e))(t)}),nd=R.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeSort");return Hn(ct(({key:n,attribute:r},{remove:i})=>{[En,wn].includes(n)||r||i(n)},e),ct(Wa,e),ct(Ka,e),ct(jt,e),ct(Bn,e),ct(({key:n,attribute:r,value:i},{remove:a})=>{[En,wn].includes(n)||!Fa(r)&&R.isEmpty(i)&&a(n)},e))(t)}),rd=R.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeFields");return Hn(ar(({key:n,attribute:r},{remove:i})=>{[En,wn].includes(n)||(R.isNil(r)||!Fa(r))&&i(n)},e),ar(jt,e),ar(Bn,e),n=>R.isArray(n)?n.filter(r=>!R.isNil(r)):n)(t)}),id=R.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizePopulate");return Hn(or(Lp,e),or(async({key:n,value:r,schema:i,attribute:a,getModel:o,path:s},{set:u})=>{if(a)return;const f={key:n,path:s,schema:i,attribute:a};n==="sort"&&u(n,await nd({schema:i,getModel:o,parent:f},r)),n==="filters"&&u(n,await td({schema:i,getModel:o,parent:f},r)),n==="fields"&&u(n,await rd({schema:i,getModel:o,parent:f},r)),n==="populate"&&u(n,await id({schema:i,getModel:o,parent:f},r))},e),or(jt,e))(t)});var Ht={exports:{}},Ct={exports:{}},sr,to;function od(){if(to)return sr;to=1,sr=r,r.sync=i;var e=We.default;function t(a,o){var s=o.pathExt!==void 0?o.pathExt:process.env.PATHEXT;if(!s||(s=s.split(";"),s.indexOf("")!==-1))return!0;for(var u=0;u<s.length;u++){var f=s[u].toLowerCase();if(f&&a.substr(-f.length).toLowerCase()===f)return!0}return!1}function n(a,o,s){return!a.isSymbolicLink()&&!a.isFile()?!1:t(o,s)}function r(a,o,s){e.stat(a,function(u,f){s(u,u?!1:n(f,a,o))})}function i(a,o){return n(e.statSync(a),a,o)}return sr}var ur,no;function ad(){if(no)return ur;no=1,ur=t,t.sync=n;var e=We.default;function t(a,o,s){e.stat(a,function(u,f){s(u,u?!1:r(f,o))})}function n(a,o){return r(e.statSync(a),o)}function r(a,o){return a.isFile()&&i(a,o)}function i(a,o){var s=a.mode,u=a.uid,f=a.gid,l=o.uid!==void 0?o.uid:process.getuid&&process.getuid(),c=o.gid!==void 0?o.gid:process.getgid&&process.getgid(),p=parseInt("100",8),d=parseInt("010",8),h=parseInt("001",8),m=p|d,g=s&h||s&d&&f===c||s&p&&u===l||s&m&&l===0;return g}return ur}var bn;process.platform==="win32"||we.TESTING_WINDOWS?bn=od():bn=ad();var sd=ri;ri.sync=ud;function ri(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,i){ri(e,t||{},function(a,o){a?i(a):r(o)})})}bn(e,t||{},function(r,i){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,i=!1),n(r,i)})}function ud(e,t){try{return bn.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const mt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ya=Se.default,cd=mt?";":":",Qa=sd,Va=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Xa=(e,t)=>{const n=t.colon||cd,r=e.match(/\//)||mt&&e.match(/\\/)?[""]:[...mt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],i=mt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=mt?i.split(n):[""];return mt&&e.indexOf(".")!==-1&&a[0]!==""&&a.unshift(""),{pathEnv:r,pathExt:a,pathExtExe:i}},Za=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:r,pathExt:i,pathExtExe:a}=Xa(e,t),o=[],s=f=>new Promise((l,c)=>{if(f===r.length)return t.all&&o.length?l(o):c(Va(e));const p=r[f],d=/^".*"$/.test(p)?p.slice(1,-1):p,h=Ya.join(d,e),m=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;l(u(m,f,0))}),u=(f,l,c)=>new Promise((p,d)=>{if(c===i.length)return p(s(l+1));const h=i[c];Qa(f+h,{pathExt:a},(m,g)=>{if(!m&&g)if(t.all)o.push(f+h);else return p(f+h);return p(u(f,l,c+1))})});return n?s(0).then(f=>n(null,f),n):s(0)},ld=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:r,pathExtExe:i}=Xa(e,t),a=[];for(let o=0;o<n.length;o++){const s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,f=Ya.join(u,e),l=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;for(let c=0;c<r.length;c++){const p=l+r[c];try{if(Qa.sync(p,{pathExt:i}))if(t.all)a.push(p);else return p}catch{}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw Va(e)};var fd=Za;Za.sync=ld;var ii={exports:{}};const Ja=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};ii.exports=Ja;ii.exports.default=Ja;var es=ii.exports;const ro=Se.default,pd=fd,dd=es;function io(e,t){const n=e.options.env||process.env,r=process.cwd(),i=e.options.cwd!=null,a=i&&process.chdir!==void 0&&!process.chdir.disabled;if(a)try{process.chdir(e.options.cwd)}catch{}let o;try{o=pd.sync(e.command,{path:n[dd({env:n})],pathExt:t?ro.delimiter:void 0})}catch{}finally{a&&process.chdir(r)}return o&&(o=ro.resolve(i?e.options.cwd:"",o)),o}function hd(e){return io(e)||io(e,!0)}var md=hd,oi={};const Ur=/([()\][%!^"`<>&|;, *?])/g;function gd(e){return e=e.replace(Ur,"^$1"),e}function yd(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Ur,"^$1"),t&&(e=e.replace(Ur,"^$1")),e}oi.command=gd;oi.argument=yd;var vd=/^#!(.*)/;const Ed=vd;var wd=(e="")=>{const t=e.match(Ed);if(!t)return null;const[n,r]=t[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return i==="env"?r:r?`${i} ${r}`:i};const cr=We.default,bd=wd;function Sd(e){const n=Buffer.alloc(150);let r;try{r=cr.openSync(e,"r"),cr.readSync(r,n,0,150,0),cr.closeSync(r)}catch{}return bd(n.toString())}var xd=Sd;const _d=Se.default,oo=md,ao=oi,Ad=xd,Td=process.platform==="win32",Cd=/\.(?:com|exe)$/i,Rd=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Fd(e){e.file=oo(e);const t=e.file&&Ad(e.file);return t?(e.args.unshift(e.file),e.command=t,oo(e)):e.file}function $d(e){if(!Td)return e;const t=Fd(e),n=!Cd.test(t);if(e.options.forceShell||n){const r=Rd.test(t);e.command=_d.normalize(e.command),e.command=ao.command(e.command),e.args=e.args.map(a=>ao.argument(a,r));const i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Id(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);const r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:$d(r)}var Od=Id;const ai=process.platform==="win32";function si(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Nd(e,t){if(!ai)return;const n=e.emit;e.emit=function(r,i){if(r==="exit"){const a=ts(i,t);if(a)return n.call(e,"error",a)}return n.apply(e,arguments)}}function ts(e,t){return ai&&e===1&&!t.file?si(t.original,"spawn"):null}function Pd(e,t){return ai&&e===1&&!t.file?si(t.original,"spawnSync"):null}var Ld={hookChildProcess:Nd,verifyENOENT:ts,verifyENOENTSync:Pd,notFoundError:si};const ns=ln.default,ui=Od,ci=Ld;function rs(e,t,n){const r=ui(e,t,n),i=ns.spawn(r.command,r.args,r.options);return ci.hookChildProcess(i,r),i}function kd(e,t,n){const r=ui(e,t,n),i=ns.spawnSync(r.command,r.args,r.options);return i.error=i.error||ci.verifyENOENTSync(i.status,r),i}Ct.exports=rs;Ct.exports.spawn=rs;Ct.exports.sync=kd;Ct.exports._parse=ui;Ct.exports._enoent=ci;var Dd=Ct.exports,Md=e=>{const t=typeof e=="string"?`
28
- `:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e},li={exports:{}};li.exports;(function(e){const t=Se.default,n=es,r=i=>{i={cwd:process.cwd(),path:process.env[n()],execPath:process.execPath,...i};let a,o=t.resolve(i.cwd);const s=[];for(;a!==o;)s.push(t.join(o,"node_modules/.bin")),a=o,o=t.resolve(o,"..");const u=t.resolve(i.cwd,i.execPath,"..");return s.push(u),s.concat(i.path).join(t.delimiter)};e.exports=r,e.exports.default=r,e.exports.env=i=>{i={env:process.env,...i};const a={...i.env},o=n({env:a});return i.path=a[o],a[o]=e.exports(i),a}})(li);var jd=li.exports,Gn={exports:{}},fi={exports:{}};const is=(e,t)=>{for(const n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};fi.exports=is;fi.exports.default=is;var Hd=fi.exports;const Bd=Hd,Sn=new WeakMap,os=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0;const i=e.displayName||e.name||"<anonymous>",a=function(...o){if(Sn.set(a,++r),r===1)n=e.apply(this,o),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return Bd(a,e),Sn.set(a,r),a};Gn.exports=os;Gn.exports.default=os;Gn.exports.callCount=e=>{if(!Sn.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Sn.get(e)};var Ud=Gn.exports,_t={},qn={},Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.SIGNALS=void 0;const Gd=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];Kn.SIGNALS=Gd;var nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.SIGRTMAX=nt.getRealtimeSignals=void 0;const qd=function(){const e=ss-as+1;return Array.from({length:e},Kd)};nt.getRealtimeSignals=qd;const Kd=function(e,t){return{name:`SIGRT${t+1}`,number:as+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},as=34,ss=64;nt.SIGRTMAX=ss;Object.defineProperty(qn,"__esModule",{value:!0});qn.getSignals=void 0;var Wd=Ln.default,zd=Kn,Yd=nt;const Qd=function(){const e=(0,Yd.getRealtimeSignals)();return[...zd.SIGNALS,...e].map(Vd)};qn.getSignals=Qd;const Vd=function({name:e,number:t,description:n,action:r,forced:i=!1,standard:a}){const{signals:{[e]:o}}=Wd.constants,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}};Object.defineProperty(_t,"__esModule",{value:!0});_t.signalsByNumber=_t.signalsByName=void 0;var Xd=Ln.default,us=qn,Zd=nt;const Jd=function(){return(0,us.getSignals)().reduce(eh,{})},eh=function(e,{name:t,number:n,description:r,supported:i,action:a,forced:o,standard:s}){return{...e,[t]:{name:t,number:n,description:r,supported:i,action:a,forced:o,standard:s}}},th=Jd();_t.signalsByName=th;const nh=function(){const e=(0,us.getSignals)(),t=Zd.SIGRTMAX+1,n=Array.from({length:t},(r,i)=>rh(i,e));return Object.assign({},...n)},rh=function(e,t){const n=ih(e,t);if(n===void 0)return{};const{name:r,description:i,supported:a,action:o,forced:s,standard:u}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:u}}},ih=function(e,t){const n=t.find(({name:r})=>Xd.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},oh=nh();_t.signalsByNumber=oh;const{signalsByName:ah}=_t,sh=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${i})`:a!==void 0?`failed with exit code ${a}`:"failed",uh=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:a,command:o,escapedCommand:s,timedOut:u,isCanceled:f,killed:l,parsed:{options:{timeout:c}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;const p=i===void 0?void 0:ah[i].description,d=r&&r.code,m=`Command ${sh({timedOut:u,timeout:c,errorCode:d,signal:i,signalDescription:p,exitCode:a,isCanceled:f})}: ${o}`,g=Object.prototype.toString.call(r)==="[object Error]",b=g?`${m}
27
+ `+Rp(n,4),super(n),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:t})}*[Symbol.iterator](){for(const t of this._errors)yield t}};var Op=Ip;const Np=Op;var Pp=async(e,t,{concurrency:n=1/0,stopOnError:r=!0}={})=>new Promise((i,a)=>{if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(n)||n===1/0)&&n>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);const o=[],s=[],u=e[Symbol.iterator]();let f=!1,l=!1,c=0,p=0;const d=()=>{if(f)return;const h=u.next(),m=p;if(p++,h.done){l=!0,c===0&&(!r&&s.length!==0?a(new Np(s)):i(o));return}c++,(async()=>{try{const g=await h.value;o[m]=await t(g,m),c--,d()}catch(g){r?(f=!0,a(g)):(s.push(g),c--,d())}})()};for(let h=0;h<n&&(d(),!l);h++);});const Lp=Oa(Pp);function Hn(...e){const[t,...n]=e;return async(...r)=>{let i=await t.apply(t,r);for(let a=0;a<n.length;a+=1)i=await n[a](i);return i}}C.curry(Lp);const Bn=({key:e,attribute:t},{remove:n})=>{t?.type==="password"&&n(e)},jt=({schema:e,key:t,attribute:n},{remove:r})=>{if(!n)return;(n.private===!0||af(e,t))&&r(t)},Ka=({key:e,attribute:t},{remove:n})=>{Ia(t)&&n(e)},Wa=({key:e,attribute:t},{remove:n})=>{uf(t)&&n(e)},kp=({schema:e,key:t,value:n},{set:r})=>{if(t===""&&n==="*"){const{attributes:i}=e,a=Object.entries(i).filter(([,o])=>["relation","component","media","dynamiczone"].includes(o.type)).reduce((o,[s])=>({...o,[s]:!0}),{});r("",a)}},Dp={raw:null,attribute:null};var Un=(()=>{const e={parsers:[],interceptors:[],ignore:[],handlers:{attributes:[],common:[]}},t=async(n,r,i)=>{const{path:a=Dp,parent:o,schema:s,getModel:u}=r??{};for(const{predicate:d,handler:h}of e.interceptors)if(d(i))return h(n,r,i,{recurse:t});const f=e.parsers.find(d=>d.predicate(i))?.parser,l=f?.(i);if(!l)return i;let c=l.transform(i);const p=l.keys(c);for(const d of p){const h=s?.attributes?.[d],m={...a};m.raw=C.isNil(a.raw)?d:`${a.raw}.${d}`,C.isNil(h)||(m.attribute=C.isNil(a.attribute)?d:`${a.attribute}.${d}`);const g={key:d,value:l.get(d,c),attribute:h,schema:s,path:m,data:c,getModel:u,parent:o},b={remove(D){c=l.remove(D,c)},set(D,x){c=l.set(D,x,c)},recurse:t};await n(g,C.pick(["remove","set"],b));const S=l.get(d,c),T=()=>({key:d,value:S,attribute:h,schema:s,path:m,data:c,visitor:n,getModel:u,parent:o}),A=T();if(e.ignore.some(D=>D(A)))continue;const F=[...e.handlers.common,...e.handlers.attributes];for await(const D of F){const x=T();await D.predicate(x)&&await D.handler(x,C.pick(["recurse","set"],b))}}return c};return{traverse:t,intercept(n,r){return e.interceptors.push({predicate:n,handler:r}),this},parse(n,r){return e.parsers.push({predicate:n,parser:r}),this},ignore(n){return e.ignore.push(n),this},on(n,r){return e.handlers.common.push({predicate:n,handler:r}),this},onAttribute(n,r){return e.handlers.attributes.push({predicate:n,handler:r}),this},onRelation(n){return this.onAttribute(({attribute:r})=>r?.type==="relation",n)},onMedia(n){return this.onAttribute(({attribute:r})=>r?.type==="media",n)},onComponent(n){return this.onAttribute(({attribute:r})=>r?.type==="component",n)},onDynamicZone(n){return this.onAttribute(({attribute:r})=>r?.type==="dynamiczone",n)}}});const Mp=e=>C.isObject(e),jp=Un().intercept(C.isArray,async(e,t,n,{recurse:r})=>Promise.all(n.map((i,a)=>{const o=t.path?{...t.path,raw:`${t.path.raw}[${a}]`}:t.path;return r(e,{...t,path:o},i)})).then(i=>i.filter(a=>!(C.isObject(a)&&C.isEmpty(a))))).intercept(e=>!C.isObject(e),(e,t,n)=>n).parse(Mp,()=>({transform:C.cloneDeep,remove(e,t){return C.omit(e,t)},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).ignore(({value:e})=>C.isNil(e)).on(({attribute:e})=>C.isNil(e),async({key:e,visitor:t,path:n,value:r,schema:i,getModel:a,attribute:o},{set:s,recurse:u})=>{s(e,await u(t,{schema:i,path:n,getModel:a,parent:{key:e,path:n,schema:i,attribute:o}},r))}).onRelation(async({key:e,attribute:t,visitor:n,path:r,value:i,schema:a,getModel:o},{set:s,recurse:u})=>{if(t.relation.toLowerCase().startsWith("morph"))return;const l={key:e,path:r,schema:a,attribute:t},c=t.target,p=o(c),d=await u(n,{schema:p,path:r,getModel:o,parent:l},i);s(e,d)}).onComponent(async({key:e,attribute:t,visitor:n,path:r,schema:i,value:a,getModel:o},{set:s,recurse:u})=>{const f={key:e,path:r,schema:i,attribute:t},l=o(t.component),c=await u(n,{schema:l,path:r,getModel:o,parent:f},a);s(e,c)}).onMedia(async({key:e,visitor:t,path:n,schema:r,attribute:i,value:a,getModel:o},{set:s,recurse:u})=>{const f={key:e,path:n,schema:r,attribute:i},c=o("plugin::upload.file"),p=await u(t,{schema:c,path:n,getModel:o,parent:f},a);s(e,p)});var ut=C.curry(jp.traverse);const Hp={asc:"asc",desc:"desc"},Bp=Object.values(Hp),Up=e=>Bp.includes(e.toLowerCase()),Gp=e=>Array.isArray(e)&&e.every(C.isString),qp=e=>Array.isArray(e)&&e.every(C.isObject),Kp=e=>C.isString(e)&&e.split(",").length>1,Wp=e=>C.isObject(e),zp=Un().intercept(Kp,async(e,t,n,{recurse:r})=>Promise.all(n.split(",").map(C.trim).map(i=>r(e,t,i))).then(i=>i.filter(a=>!C.isEmpty(a)).join(","))).intercept(Gp,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i))).then(i=>i.filter(a=>!C.isEmpty(a)))).intercept(qp,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i))).then(i=>i.filter(a=>!C.isEmpty(a)))).parse(C.isString,()=>{const e=C.pipe(C.split("."),C.map(C.split(":")),C.flatten),t=n=>{if(n.length!==0)return n.reduce((r,i)=>C.isEmpty(i)?r:r===""?i:Up(i)?`${r}:${i}`:`${r}.${i}`,"")};return{transform:C.trim,remove(n,r){const[i]=e(r);return i===n?void 0:r},set(n,r,i){const[a]=e(i);return a!==n?i:C.isNil(r)?a:`${a}.${r}`},keys(n){const r=C.first(e(n));return r?[r]:[]},get(n,r){const[i,...a]=e(r);return n===i?t(a):void 0}}}).parse(Wp,()=>({transform:C.cloneDeep,remove(e,t){const{[e]:n,...r}=t;return r},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).onRelation(async({key:e,value:t,attribute:n,visitor:r,path:i,getModel:a,schema:o},{set:s,recurse:u})=>{if(n.relation.toLowerCase().startsWith("morph"))return;const l={key:e,path:i,schema:o,attribute:n},c=n.target,p=a(c),d=await u(r,{schema:p,path:i,getModel:a,parent:l},t);s(e,d)}).onMedia(async({key:e,path:t,schema:n,attribute:r,visitor:i,value:a,getModel:o},{recurse:s,set:u})=>{const f={key:e,path:t,schema:n,attribute:r},c=o("plugin::upload.file"),p=await s(i,{schema:c,path:t,getModel:o,parent:f},a);u(e,p)}).onComponent(async({key:e,value:t,visitor:n,path:r,schema:i,attribute:a,getModel:o},{recurse:s,set:u})=>{const f={key:e,path:r,schema:i,attribute:a},l=o(a.component),c=await s(n,{schema:l,path:r,getModel:o,parent:f},t);u(e,c)});var ct=C.curry(zp.traverse);const Ji=e=>({key:t,attribute:n})=>!n&&e===t,za=e=>e==="*",Yp=e=>C.isString(e)&&!za(e),Qp=e=>C.isArray(e)&&e.every(C.isString),eo=e=>C.isObject(e),Vp=Un().intercept(Yp,async(e,t,n,{recurse:r})=>{const i=Zp([n]),a=await r(e,t,i),[o]=Xp(a);return o}).intercept(Qp,async(e,t,n,{recurse:r})=>(await Promise.all(n.map(a=>r(e,t,a)))).filter(a=>!C.isNil(a))).parse(za,()=>({transform:C.identity,get:(e,t)=>t,set:(e,t)=>t,keys:C.constant([""]),remove:C.constant(void 0)})).parse(C.isString,()=>{const e=C.split("."),t=C.join(".");return{transform:C.trim,remove(n,r){const[i]=e(r);return i===n?void 0:r},set(n,r,i){const[a]=e(i);return a!==n?i:C.isNil(r)||C.isEmpty(r)?a:`${a}.${r}`},keys(n){const r=C.first(e(n));return r?[r]:[]},get(n,r){const[i,...a]=e(r);return n===i?t(a):void 0}}}).parse(eo,()=>({transform:C.cloneDeep,remove(e,t){const{[e]:n,...r}=t;return r},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).ignore(({key:e,attribute:t})=>["sort","filters","fields"].includes(e)&&!t).on(Ji("populate"),async({key:e,visitor:t,path:n,value:r,schema:i,getModel:a,attribute:o},{set:s,recurse:u})=>{const l=await u(t,{schema:i,path:n,getModel:a,parent:{key:e,path:n,schema:i,attribute:o}},r);s(e,l)}).on(Ji("on"),async({key:e,visitor:t,path:n,value:r,getModel:i,parent:a},{set:o,recurse:s})=>{const u={};if(eo(r)){for(const[f,l]of Object.entries(r)){const c=i(f),p={...n,raw:`${n.raw}[${f}]`};u[f]=await s(t,{schema:c,path:p,getModel:i,parent:a},l)}o(e,u)}}).onRelation(async({key:e,value:t,attribute:n,visitor:r,path:i,schema:a,getModel:o},{set:s,recurse:u})=>{if(C.isNil(t))return;const f={key:e,path:i,schema:a,attribute:n};if(Ia(n)){if(!C.isObject(t)||!("on"in t&&C.isObject(t?.on)))return;const d=await u(r,{schema:a,path:i,getModel:o,parent:f},{on:t?.on});s(e,d);return}const l=n.target,c=o(l),p=await u(r,{schema:c,path:i,getModel:o,parent:f},t);s(e,p)}).onMedia(async({key:e,path:t,schema:n,attribute:r,visitor:i,value:a,getModel:o},{recurse:s,set:u})=>{if(C.isNil(a))return;const f={key:e,path:t,schema:n,attribute:r},c=o("plugin::upload.file"),p=await s(i,{schema:c,path:t,getModel:o,parent:f},a);u(e,p)}).onComponent(async({key:e,value:t,schema:n,visitor:r,path:i,attribute:a,getModel:o},{recurse:s,set:u})=>{if(C.isNil(t))return;const f={key:e,path:i,schema:n,attribute:a},l=o(a.component),c=await s(r,{schema:l,path:i,getModel:o,parent:f},t);u(e,c)}).onDynamicZone(async({key:e,value:t,schema:n,visitor:r,path:i,attribute:a,getModel:o},{set:s,recurse:u})=>{if(C.isNil(t)||!C.isObject(t))return;const f={key:e,path:i,schema:n,attribute:a};if("on"in t&&t.on){const l=await u(r,{schema:n,path:i,getModel:o,parent:f},{on:t.on});s(e,l)}});var or=C.curry(Vp.traverse);const Xp=e=>{const t=[];function n(r,i){for(const[a,o]of Object.entries(r)){const s=i?`${i}.${a}`:a;o===!0?t.push(s):n(o.populate,s)}}return n(e,""),t},Zp=e=>{const t={};function n(r,i){const[a,...o]=i;o.length===0?r[a]=!0:((!r[a]||typeof r[a]=="boolean")&&(r[a]={populate:{}}),n(r[a].populate,o))}return e.forEach(r=>n(t,r.split("."))),t},Jp=e=>C.isArray(e)&&e.every(C.isString),ed=Un().intercept(Jp,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i)))).intercept(e=>C.isString(e)&&e.includes(","),(e,t,n,{recurse:r})=>Promise.all(n.split(",").map(i=>r(e,t,i)))).intercept(e=>C.eq("*",e),C.constant("*")).parse(C.isString,()=>({transform:C.trim,remove(e,t){return t===e?void 0:t},set(e,t,n){return n},keys(e){return[e]},get(e,t){return e===t?t:void 0}}));var ar=C.curry(ed.traverse);const{ID_ATTRIBUTE:wn,DOC_ID_ATTRIBUTE:En}=rf,td=async(e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeOutput");return lf((...n)=>{Bn(...n),jt(...n)},e,t)},nd=C.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeFilters");return Hn(ut(({key:n,attribute:r},{remove:i})=>{const a=!!r;[wn,En].includes(n)||!a&&!xp(n)&&i(n)},e),ut(Wa,e),ut(Ka,e),ut(Bn,e),ut(jt,e),ut(({key:n,value:r},{remove:i})=>{C.isObject(r)&&C.isEmpty(r)&&i(n)},e))(t)}),rd=C.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeSort");return Hn(ct(({key:n,attribute:r},{remove:i})=>{[wn,En].includes(n)||r||i(n)},e),ct(Wa,e),ct(Ka,e),ct(jt,e),ct(Bn,e),ct(({key:n,attribute:r,value:i},{remove:a})=>{[wn,En].includes(n)||!Fa(r)&&C.isEmpty(i)&&a(n)},e))(t)}),id=C.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeFields");return Hn(ar(({key:n,attribute:r},{remove:i})=>{[wn,En].includes(n)||(C.isNil(r)||!Fa(r))&&i(n)},e),ar(jt,e),ar(Bn,e),n=>C.isArray(n)?n.filter(r=>!C.isNil(r)):n)(t)}),od=C.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizePopulate");return Hn(or(kp,e),or(async({key:n,value:r,schema:i,attribute:a,getModel:o,path:s},{set:u})=>{if(a)return;const f={key:n,path:s,schema:i,attribute:a};n==="sort"&&u(n,await rd({schema:i,getModel:o,parent:f},r)),n==="filters"&&u(n,await nd({schema:i,getModel:o,parent:f},r)),n==="fields"&&u(n,await id({schema:i,getModel:o,parent:f},r)),n==="populate"&&u(n,await od({schema:i,getModel:o,parent:f},r))},e),or(jt,e))(t)});var Ht={exports:{}},Ct={exports:{}},sr,to;function ad(){if(to)return sr;to=1,sr=r,r.sync=i;var e=We.default;function t(a,o){var s=o.pathExt!==void 0?o.pathExt:process.env.PATHEXT;if(!s||(s=s.split(";"),s.indexOf("")!==-1))return!0;for(var u=0;u<s.length;u++){var f=s[u].toLowerCase();if(f&&a.substr(-f.length).toLowerCase()===f)return!0}return!1}function n(a,o,s){return!a.isSymbolicLink()&&!a.isFile()?!1:t(o,s)}function r(a,o,s){e.stat(a,function(u,f){s(u,u?!1:n(f,a,o))})}function i(a,o){return n(e.statSync(a),a,o)}return sr}var ur,no;function sd(){if(no)return ur;no=1,ur=t,t.sync=n;var e=We.default;function t(a,o,s){e.stat(a,function(u,f){s(u,u?!1:r(f,o))})}function n(a,o){return r(e.statSync(a),o)}function r(a,o){return a.isFile()&&i(a,o)}function i(a,o){var s=a.mode,u=a.uid,f=a.gid,l=o.uid!==void 0?o.uid:process.getuid&&process.getuid(),c=o.gid!==void 0?o.gid:process.getgid&&process.getgid(),p=parseInt("100",8),d=parseInt("010",8),h=parseInt("001",8),m=p|d,g=s&h||s&d&&f===c||s&p&&u===l||s&m&&l===0;return g}return ur}var bn;process.platform==="win32"||Ee.TESTING_WINDOWS?bn=ad():bn=sd();var ud=ri;ri.sync=cd;function ri(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,i){ri(e,t||{},function(a,o){a?i(a):r(o)})})}bn(e,t||{},function(r,i){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,i=!1),n(r,i)})}function cd(e,t){try{return bn.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const mt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ya=Se.default,ld=mt?";":":",Qa=ud,Va=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Xa=(e,t)=>{const n=t.colon||ld,r=e.match(/\//)||mt&&e.match(/\\/)?[""]:[...mt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],i=mt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=mt?i.split(n):[""];return mt&&e.indexOf(".")!==-1&&a[0]!==""&&a.unshift(""),{pathEnv:r,pathExt:a,pathExtExe:i}},Za=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:r,pathExt:i,pathExtExe:a}=Xa(e,t),o=[],s=f=>new Promise((l,c)=>{if(f===r.length)return t.all&&o.length?l(o):c(Va(e));const p=r[f],d=/^".*"$/.test(p)?p.slice(1,-1):p,h=Ya.join(d,e),m=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;l(u(m,f,0))}),u=(f,l,c)=>new Promise((p,d)=>{if(c===i.length)return p(s(l+1));const h=i[c];Qa(f+h,{pathExt:a},(m,g)=>{if(!m&&g)if(t.all)o.push(f+h);else return p(f+h);return p(u(f,l,c+1))})});return n?s(0).then(f=>n(null,f),n):s(0)},fd=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:r,pathExtExe:i}=Xa(e,t),a=[];for(let o=0;o<n.length;o++){const s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,f=Ya.join(u,e),l=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;for(let c=0;c<r.length;c++){const p=l+r[c];try{if(Qa.sync(p,{pathExt:i}))if(t.all)a.push(p);else return p}catch{}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw Va(e)};var pd=Za;Za.sync=fd;var ii={exports:{}};const Ja=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};ii.exports=Ja;ii.exports.default=Ja;var es=ii.exports;const ro=Se.default,dd=pd,hd=es;function io(e,t){const n=e.options.env||process.env,r=process.cwd(),i=e.options.cwd!=null,a=i&&process.chdir!==void 0&&!process.chdir.disabled;if(a)try{process.chdir(e.options.cwd)}catch{}let o;try{o=dd.sync(e.command,{path:n[hd({env:n})],pathExt:t?ro.delimiter:void 0})}catch{}finally{a&&process.chdir(r)}return o&&(o=ro.resolve(i?e.options.cwd:"",o)),o}function md(e){return io(e)||io(e,!0)}var gd=md,oi={};const Ur=/([()\][%!^"`<>&|;, *?])/g;function yd(e){return e=e.replace(Ur,"^$1"),e}function vd(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Ur,"^$1"),t&&(e=e.replace(Ur,"^$1")),e}oi.command=yd;oi.argument=vd;var wd=/^#!(.*)/;const Ed=wd;var bd=(e="")=>{const t=e.match(Ed);if(!t)return null;const[n,r]=t[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return i==="env"?r:r?`${i} ${r}`:i};const cr=We.default,Sd=bd;function xd(e){const n=Buffer.alloc(150);let r;try{r=cr.openSync(e,"r"),cr.readSync(r,n,0,150,0),cr.closeSync(r)}catch{}return Sd(n.toString())}var _d=xd;const Ad=Se.default,oo=gd,ao=oi,Td=_d,Cd=process.platform==="win32",Rd=/\.(?:com|exe)$/i,Fd=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function $d(e){e.file=oo(e);const t=e.file&&Td(e.file);return t?(e.args.unshift(e.file),e.command=t,oo(e)):e.file}function Id(e){if(!Cd)return e;const t=$d(e),n=!Rd.test(t);if(e.options.forceShell||n){const r=Fd.test(t);e.command=Ad.normalize(e.command),e.command=ao.command(e.command),e.args=e.args.map(a=>ao.argument(a,r));const i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Od(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);const r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Id(r)}var Nd=Od;const ai=process.platform==="win32";function si(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Pd(e,t){if(!ai)return;const n=e.emit;e.emit=function(r,i){if(r==="exit"){const a=ts(i,t);if(a)return n.call(e,"error",a)}return n.apply(e,arguments)}}function ts(e,t){return ai&&e===1&&!t.file?si(t.original,"spawn"):null}function Ld(e,t){return ai&&e===1&&!t.file?si(t.original,"spawnSync"):null}var kd={hookChildProcess:Pd,verifyENOENT:ts,verifyENOENTSync:Ld,notFoundError:si};const ns=ln.default,ui=Nd,ci=kd;function rs(e,t,n){const r=ui(e,t,n),i=ns.spawn(r.command,r.args,r.options);return ci.hookChildProcess(i,r),i}function Dd(e,t,n){const r=ui(e,t,n),i=ns.spawnSync(r.command,r.args,r.options);return i.error=i.error||ci.verifyENOENTSync(i.status,r),i}Ct.exports=rs;Ct.exports.spawn=rs;Ct.exports.sync=Dd;Ct.exports._parse=ui;Ct.exports._enoent=ci;var Md=Ct.exports,jd=e=>{const t=typeof e=="string"?`
28
+ `:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e},li={exports:{}};li.exports;(function(e){const t=Se.default,n=es,r=i=>{i={cwd:process.cwd(),path:process.env[n()],execPath:process.execPath,...i};let a,o=t.resolve(i.cwd);const s=[];for(;a!==o;)s.push(t.join(o,"node_modules/.bin")),a=o,o=t.resolve(o,"..");const u=t.resolve(i.cwd,i.execPath,"..");return s.push(u),s.concat(i.path).join(t.delimiter)};e.exports=r,e.exports.default=r,e.exports.env=i=>{i={env:process.env,...i};const a={...i.env},o=n({env:a});return i.path=a[o],a[o]=e.exports(i),a}})(li);var Hd=li.exports,Gn={exports:{}},fi={exports:{}};const is=(e,t)=>{for(const n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};fi.exports=is;fi.exports.default=is;var Bd=fi.exports;const Ud=Bd,Sn=new WeakMap,os=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0;const i=e.displayName||e.name||"<anonymous>",a=function(...o){if(Sn.set(a,++r),r===1)n=e.apply(this,o),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return Ud(a,e),Sn.set(a,r),a};Gn.exports=os;Gn.exports.default=os;Gn.exports.callCount=e=>{if(!Sn.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Sn.get(e)};var Gd=Gn.exports,_t={},qn={},Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.SIGNALS=void 0;const qd=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];Kn.SIGNALS=qd;var nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.SIGRTMAX=nt.getRealtimeSignals=void 0;const Kd=function(){const e=ss-as+1;return Array.from({length:e},Wd)};nt.getRealtimeSignals=Kd;const Wd=function(e,t){return{name:`SIGRT${t+1}`,number:as+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},as=34,ss=64;nt.SIGRTMAX=ss;Object.defineProperty(qn,"__esModule",{value:!0});qn.getSignals=void 0;var zd=Ln.default,Yd=Kn,Qd=nt;const Vd=function(){const e=(0,Qd.getRealtimeSignals)();return[...Yd.SIGNALS,...e].map(Xd)};qn.getSignals=Vd;const Xd=function({name:e,number:t,description:n,action:r,forced:i=!1,standard:a}){const{signals:{[e]:o}}=zd.constants,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}};Object.defineProperty(_t,"__esModule",{value:!0});_t.signalsByNumber=_t.signalsByName=void 0;var Zd=Ln.default,us=qn,Jd=nt;const eh=function(){return(0,us.getSignals)().reduce(th,{})},th=function(e,{name:t,number:n,description:r,supported:i,action:a,forced:o,standard:s}){return{...e,[t]:{name:t,number:n,description:r,supported:i,action:a,forced:o,standard:s}}},nh=eh();_t.signalsByName=nh;const rh=function(){const e=(0,us.getSignals)(),t=Jd.SIGRTMAX+1,n=Array.from({length:t},(r,i)=>ih(i,e));return Object.assign({},...n)},ih=function(e,t){const n=oh(e,t);if(n===void 0)return{};const{name:r,description:i,supported:a,action:o,forced:s,standard:u}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:u}}},oh=function(e,t){const n=t.find(({name:r})=>Zd.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},ah=rh();_t.signalsByNumber=ah;const{signalsByName:sh}=_t,uh=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${i})`:a!==void 0?`failed with exit code ${a}`:"failed",ch=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:a,command:o,escapedCommand:s,timedOut:u,isCanceled:f,killed:l,parsed:{options:{timeout:c}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;const p=i===void 0?void 0:sh[i].description,d=r&&r.code,m=`Command ${uh({timedOut:u,timeout:c,errorCode:d,signal:i,signalDescription:p,exitCode:a,isCanceled:f})}: ${o}`,g=Object.prototype.toString.call(r)==="[object Error]",b=g?`${m}
29
29
  ${r.message}`:m,S=[b,t,e].filter(Boolean).join(`
30
- `);return g?(r.originalMessage=r.message,r.message=S):r=new Error(S),r.shortMessage=b,r.command=o,r.escapedCommand=s,r.exitCode=a,r.signal=i,r.signalDescription=p,r.stdout=e,r.stderr=t,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!u,r.isCanceled=f,r.killed=l&&!u,r};var ch=uh,pi={exports:{}};const on=["stdin","stdout","stderr"],lh=e=>on.some(t=>e[t]!==void 0),cs=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return on.map(r=>e[r]);if(lh(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${on.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,on.length);return Array.from({length:n},(r,i)=>t[i])};pi.exports=cs;pi.exports.node=e=>{const t=cs(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]};var fh=pi.exports,gt={exports:{}},lr={exports:{}},so;function ph(){return so||(so=1,function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}(lr)),lr.exports}var te=we.process;const ze=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};if(!ze(te))gt.exports=function(){return function(){}};else{var dh=da.default,Ft=ph(),hh=/^win/i.test(te.platform),Zt=lc.default;typeof Zt!="function"&&(Zt=Zt.EventEmitter);var fe;te.__signal_exit_emitter__?fe=te.__signal_exit_emitter__:(fe=te.__signal_exit_emitter__=new Zt,fe.count=0,fe.emitted={}),fe.infinite||(fe.setMaxListeners(1/0),fe.infinite=!0),gt.exports=function(e,t){if(!ze(we.process))return function(){};dh.equal(typeof e,"function","a callback must be provided for exit handler"),$t===!1&&uo();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){fe.removeListener(n,e),fe.listeners("exit").length===0&&fe.listeners("afterexit").length===0&&fr()};return fe.on(n,e),r};var fr=function(){!$t||!ze(we.process)||($t=!1,Ft.forEach(function(t){try{te.removeListener(t,pr[t])}catch{}}),te.emit=dr,te.reallyExit=co,fe.count-=1)};gt.exports.unload=fr;var lt=function(t,n,r){fe.emitted[t]||(fe.emitted[t]=!0,fe.emit(t,n,r))},pr={};Ft.forEach(function(e){pr[e]=function(){if(ze(we.process)){var n=te.listeners(e);n.length===fe.count&&(fr(),lt("exit",null,e),lt("afterexit",null,e),hh&&e==="SIGHUP"&&(e="SIGINT"),te.kill(te.pid,e))}}}),gt.exports.signals=function(){return Ft};var $t=!1,uo=function(){$t||!ze(we.process)||($t=!0,fe.count+=1,Ft=Ft.filter(function(t){try{return te.on(t,pr[t]),!0}catch{return!1}}),te.emit=gh,te.reallyExit=mh)};gt.exports.load=uo;var co=te.reallyExit,mh=function(t){ze(we.process)&&(te.exitCode=t||0,lt("exit",te.exitCode,null),lt("afterexit",te.exitCode,null),co.call(te,te.exitCode))},dr=te.emit,gh=function(t,n){if(t==="exit"&&ze(we.process)){n!==void 0&&(te.exitCode=n);var r=dr.apply(this,arguments);return lt("exit",te.exitCode,null),lt("afterexit",te.exitCode,null),r}else return dr.apply(this,arguments)}}var yh=gt.exports;const vh=Ln.default,Eh=yh,wh=1e3*5,bh=(e,t="SIGTERM",n={})=>{const r=e(t);return Sh(e,t,n,r),r},Sh=(e,t,n,r)=>{if(!xh(t,n,r))return;const i=Ah(n),a=setTimeout(()=>{e("SIGKILL")},i);a.unref&&a.unref()},xh=(e,{forceKillAfterTimeout:t},n)=>_h(e)&&t!==!1&&n,_h=e=>e===vh.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Ah=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return wh;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Th=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Ch=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Rh=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let i;const a=new Promise((s,u)=>{i=setTimeout(()=>{Ch(e,n,u)},t)}),o=r.finally(()=>{clearTimeout(i)});return Promise.race([a,o])},Fh=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},$h=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;const i=Eh(()=>{e.kill()});return r.finally(()=>{i()})};var Ih={spawnedKill:bh,spawnedCancel:Th,setupTimeout:Rh,validateTimeout:Fh,setExitHandler:$h};const ke=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";ke.writable=e=>ke(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";ke.readable=e=>ke(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";ke.duplex=e=>ke.writable(e)&&ke.readable(e);ke.transform=e=>ke.duplex(e)&&typeof e._transform=="function";var Oh=ke,Bt={exports:{}};const{PassThrough:Nh}=kn.default;var Ph=e=>{e={...e};const{array:t}=e;let{encoding:n}=e;const r=n==="buffer";let i=!1;t?i=!(n||r):n=n||"utf8",r&&(n=null);const a=new Nh({objectMode:i});n&&a.setEncoding(n);let o=0;const s=[];return a.on("data",u=>{s.push(u),i?o=s.length:o+=u.length}),a.getBufferedValue=()=>t?s:r?Buffer.concat(s,o):s.join(""),a.getBufferedLength=()=>o,a};const{constants:Lh}=fc.default,kh=kn.default,{promisify:Dh}=it.default,Mh=Ph,jh=Dh(kh.pipeline);class ls extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function di(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:n}=t,r=Mh(t);return await new Promise((i,a)=>{const o=s=>{s&&r.getBufferedLength()<=Lh.MAX_LENGTH&&(s.bufferedData=r.getBufferedValue()),a(s)};(async()=>{try{await jh(e,r),i()}catch(s){o(s)}})(),r.on("data",()=>{r.getBufferedLength()>n&&o(new ls)})}),r.getBufferedValue()}Bt.exports=di;Bt.exports.buffer=(e,t)=>di(e,{...t,encoding:"buffer"});Bt.exports.array=(e,t)=>di(e,{...t,array:!0});Bt.exports.MaxBufferError=ls;var Hh=Bt.exports;const{PassThrough:Bh}=kn.default;var Uh=function(){var e=[],t=new Bh({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(n),t;function n(a){return Array.isArray(a)?(a.forEach(n),this):(e.push(a),a.once("end",i.bind(null,a)),a.once("error",t.emit.bind(t,"error")),a.pipe(t,{end:!1}),this)}function r(){return e.length==0}function i(a){e=e.filter(function(o){return o!==a}),!e.length&&t.readable&&t.end()}};const fs=Oh,lo=Hh,Gh=Uh,qh=(e,t)=>{t===void 0||e.stdin===void 0||(fs(t)?t.pipe(e.stdin):e.stdin.end(t))},Kh=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const n=Gh();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},hr=async(e,t)=>{if(e){e.destroy();try{return await t}catch(n){return n.bufferedData}}},mr=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?lo(e,{encoding:t,maxBuffer:r}):lo.buffer(e,{maxBuffer:r})},Wh=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},o)=>{const s=mr(e,{encoding:r,buffer:i,maxBuffer:a}),u=mr(t,{encoding:r,buffer:i,maxBuffer:a}),f=mr(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([o,s,u,f])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},hr(e,s),hr(t,u),hr(n,f)])}},zh=({input:e})=>{if(fs(e))throw new TypeError("The `input` option cannot be a stream in sync mode")};var Yh={handleInput:qh,makeAllStream:Kh,getSpawnedResult:Wh,validateInputSync:zh};const Qh=(async()=>{})().constructor.prototype,Vh=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Qh,e)]),Xh=(e,t)=>{for(const[n,r]of Vh){const i=typeof t=="function"?(...a)=>Reflect.apply(r.value,t(),a):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}return e},Zh=e=>new Promise((t,n)=>{e.on("exit",(r,i)=>{t({exitCode:r,signal:i})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});var Jh={mergePromise:Xh,getSpawnedPromise:Zh};const ps=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],em=/^[\w.-]+$/,tm=/"/g,nm=e=>typeof e!="string"||em.test(e)?e:`"${e.replace(tm,'\\"')}"`,rm=(e,t)=>ps(e,t).join(" "),im=(e,t)=>ps(e,t).map(n=>nm(n)).join(" "),om=/ +/g,am=e=>{const t=[];for(const n of e.trim().split(om)){const r=t[t.length-1];r&&r.endsWith("\\")?t[t.length-1]=`${r.slice(0,-1)} ${n}`:t.push(n)}return t};var sm={joinCommand:rm,getEscapedCommand:im,parseCommand:am};const um=Se.default,Gr=ln.default,cm=Dd,lm=Md,fm=jd,pm=Ud,xn=ch,ds=fh,{spawnedKill:dm,spawnedCancel:hm,setupTimeout:mm,validateTimeout:gm,setExitHandler:ym}=Ih,{handleInput:vm,getSpawnedResult:Em,makeAllStream:wm,validateInputSync:bm}=Yh,{mergePromise:fo,getSpawnedPromise:Sm}=Jh,{joinCommand:hs,parseCommand:ms,getEscapedCommand:gs}=sm,xm=1e3*1e3*100,_m=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{const a=t?{...process.env,...e}:e;return n?fm.env({env:a,cwd:r,execPath:i}):a},ys=(e,t,n={})=>{const r=cm._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:xm,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...n},n.env=_m(n),n.stdio=ds(n),process.platform==="win32"&&um.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},Nt=(e,t,n)=>typeof t!="string"&&!Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?lm(t):t,Wn=(e,t,n)=>{const r=ys(e,t,n),i=hs(e,t),a=gs(e,t);gm(r.options);let o;try{o=Gr.spawn(r.file,r.args,r.options)}catch(d){const h=new Gr.ChildProcess,m=Promise.reject(xn({error:d,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return fo(h,m)}const s=Sm(o),u=mm(o,r.options,s),f=ym(o,r.options,u),l={isCanceled:!1};o.kill=dm.bind(null,o.kill.bind(o)),o.cancel=hm.bind(null,o,l);const p=pm(async()=>{const[{error:d,exitCode:h,signal:m,timedOut:g},b,S,T]=await Em(o,r.options,f),A=Nt(r.options,b),C=Nt(r.options,S),F=Nt(r.options,T);if(d||h!==0||m!==null){const j=xn({error:d,exitCode:h,signal:m,stdout:A,stderr:C,all:F,command:i,escapedCommand:a,parsed:r,timedOut:g,isCanceled:l.isCanceled,killed:o.killed});if(!r.options.reject)return j;throw j}return{command:i,escapedCommand:a,exitCode:0,stdout:A,stderr:C,all:F,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return vm(o,r.options.input),o.all=wm(o,r.options),fo(o,p)};Ht.exports=Wn;Ht.exports.sync=(e,t,n)=>{const r=ys(e,t,n),i=hs(e,t),a=gs(e,t);bm(r.options);let o;try{o=Gr.spawnSync(r.file,r.args,r.options)}catch(f){throw xn({error:f,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}const s=Nt(r.options,o.stdout,o.error),u=Nt(r.options,o.stderr,o.error);if(o.error||o.status!==0||o.signal!==null){const f=xn({stdout:s,stderr:u,error:o.error,signal:o.signal,exitCode:o.status,command:i,escapedCommand:a,parsed:r,timedOut:o.error&&o.error.code==="ETIMEDOUT",isCanceled:!1,killed:o.signal!==null});if(!r.options.reject)return f;throw f}return{command:i,escapedCommand:a,exitCode:0,stdout:s,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};Ht.exports.command=(e,t)=>{const[n,...r]=ms(e);return Wn(n,r,t)};Ht.exports.commandSync=(e,t)=>{const[n,...r]=ms(e);return Wn.sync(n,r,t)};Ht.exports.node=(e,t,n={})=>{t&&!Array.isArray(t)&&typeof t=="object"&&(n=t,t=[]);const r=ds.node(n),i=process.execArgv.filter(s=>!s.startsWith("--inspect")),{nodePath:a=process.execPath,nodeOptions:o=i}=n;return Wn(a,[...o,e,...Array.isArray(t)?t:[]],{...n,stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1})};var _e={},zn={exports:{}},vs={exports:{}},hi={exports:{}},mi={exports:{}},gi={exports:{}},yi={exports:{}};const Es=(e,...t)=>new Promise(n=>{n(e(...t))});yi.exports=Es;yi.exports.default=Es;var Am=yi.exports;const Tm=Am,ws=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));const t=[];let n=0;const r=()=>{n--,t.length>0&&t.shift()()},i=(s,u,...f)=>{n++;const l=Tm(s,...f);u(l),l.then(r,r)},a=(s,u,...f)=>{n<e?i(s,u,...f):t.push(i.bind(null,s,u,...f))},o=(s,...u)=>new Promise(f=>a(s,f,...u));return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}}),o};gi.exports=ws;gi.exports.default=ws;var Cm=gi.exports;const po=Cm;let bs=class extends Error{constructor(t){super(),this.value=t}};const Rm=async(e,t)=>t(await e),Fm=async e=>{const t=await Promise.all(e);if(t[1]===!0)throw new bs(t[0]);return!1},Ss=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};const r=po(n.concurrency),i=[...e].map(o=>[o,r(Rm,o,t)]),a=po(n.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>a(Fm,o)))}catch(o){if(o instanceof bs)return o.value;throw o}};mi.exports=Ss;mi.exports.default=Ss;var $m=mi.exports;const xs=Se.default,_n=We.default,{promisify:_s}=it.default,Im=$m,Om=_s(_n.stat),Nm=_s(_n.lstat),As={directory:"isDirectory",file:"isFile"};function Ts({type:e}){if(!(e in As))throw new Error(`Invalid type specified: ${e}`)}const Cs=(e,t)=>e===void 0||t[As[e]]();hi.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},Ts(t);const n=t.allowSymlinks?Om:Nm;return Im(e,async r=>{try{const i=await n(xs.resolve(t.cwd,r));return Cs(t.type,i)}catch{return!1}},t)};hi.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},Ts(t);const n=t.allowSymlinks?_n.statSync:_n.lstatSync;for(const r of e)try{const i=n(xs.resolve(t.cwd,r));if(Cs(t.type,i))return r}catch{}};var Pm=hi.exports,vi={exports:{}};const Rs=We.default,{promisify:Lm}=it.default,km=Lm(Rs.access);vi.exports=async e=>{try{return await km(e),!0}catch{return!1}};vi.exports.sync=e=>{try{return Rs.accessSync(e),!0}catch{return!1}};var Fs=vi.exports;(function(e){const t=Se.default,n=Pm,r=Fs,i=Symbol("findUp.stop");e.exports=async(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),l=async c=>{if(typeof a!="function")return n(f,c);const p=await a(c.cwd);return typeof p=="string"?n([p],c):p};for(;;){const c=await l({...o,cwd:s});if(c===i)return;if(c)return t.resolve(s,c);if(s===u)return;s=t.dirname(s)}},e.exports.sync=(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),l=c=>{if(typeof a!="function")return n.sync(f,c);const p=a(c.cwd);return typeof p=="string"?n.sync([p],c):p};for(;;){const c=l({...o,cwd:s});if(c===i)return;if(c)return t.resolve(s,c);if(s===u)return;s=t.dirname(s)}},e.exports.exists=r,e.exports.sync.exists=r.sync,e.exports.stop=i})(vs);var Dm=vs.exports;const $s=Se.default,Is=Dm,Os=async e=>{const t=await Is("package.json",{cwd:e});return t&&$s.dirname(t)};zn.exports=Os;zn.exports.default=Os;zn.exports.sync=e=>{const t=Is.sync("package.json",{cwd:e});return t&&$s.dirname(t)};var Mm=zn.exports,Yn={};(function(e){e.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1,e.find=(t,n)=>t.nodes.find(r=>r.type===n),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(t,n=0,r)=>{const i=t.nodes[n];i&&(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},e.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0),e.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1,e.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0,e.reduce=t=>t.reduce((n,r)=>(r.type==="text"&&n.push(r.value),r.type==="range"&&(r.type="text"),n),[]),e.flatten=(...t)=>{const n=[],r=i=>{for(let a=0;a<i.length;a++){const o=i[a];if(Array.isArray(o)){r(o);continue}o!==void 0&&n.push(o)}return n};return r(t),n}})(Yn);const ho=Yn;var Ei=(e,t={})=>{const n=(r,i={})=>{const a=t.escapeInvalid&&ho.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0;let s="";if(r.value)return(a||o)&&ho.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(const u of r.nodes)s+=n(u);return s};return n(e)};/*!
30
+ `);return g?(r.originalMessage=r.message,r.message=S):r=new Error(S),r.shortMessage=b,r.command=o,r.escapedCommand=s,r.exitCode=a,r.signal=i,r.signalDescription=p,r.stdout=e,r.stderr=t,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!u,r.isCanceled=f,r.killed=l&&!u,r};var lh=ch,pi={exports:{}};const on=["stdin","stdout","stderr"],fh=e=>on.some(t=>e[t]!==void 0),cs=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return on.map(r=>e[r]);if(fh(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${on.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,on.length);return Array.from({length:n},(r,i)=>t[i])};pi.exports=cs;pi.exports.node=e=>{const t=cs(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]};var ph=pi.exports,gt={exports:{}},lr={exports:{}},so;function dh(){return so||(so=1,(function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")})(lr)),lr.exports}var te=Ee.process;const ze=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};if(!ze(te))gt.exports=function(){return function(){}};else{var hh=da.default,Ft=dh(),mh=/^win/i.test(te.platform),Zt=fc.default;typeof Zt!="function"&&(Zt=Zt.EventEmitter);var fe;te.__signal_exit_emitter__?fe=te.__signal_exit_emitter__:(fe=te.__signal_exit_emitter__=new Zt,fe.count=0,fe.emitted={}),fe.infinite||(fe.setMaxListeners(1/0),fe.infinite=!0),gt.exports=function(e,t){if(!ze(Ee.process))return function(){};hh.equal(typeof e,"function","a callback must be provided for exit handler"),$t===!1&&uo();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){fe.removeListener(n,e),fe.listeners("exit").length===0&&fe.listeners("afterexit").length===0&&fr()};return fe.on(n,e),r};var fr=function(){!$t||!ze(Ee.process)||($t=!1,Ft.forEach(function(t){try{te.removeListener(t,pr[t])}catch{}}),te.emit=dr,te.reallyExit=co,fe.count-=1)};gt.exports.unload=fr;var lt=function(t,n,r){fe.emitted[t]||(fe.emitted[t]=!0,fe.emit(t,n,r))},pr={};Ft.forEach(function(e){pr[e]=function(){if(ze(Ee.process)){var n=te.listeners(e);n.length===fe.count&&(fr(),lt("exit",null,e),lt("afterexit",null,e),mh&&e==="SIGHUP"&&(e="SIGINT"),te.kill(te.pid,e))}}}),gt.exports.signals=function(){return Ft};var $t=!1,uo=function(){$t||!ze(Ee.process)||($t=!0,fe.count+=1,Ft=Ft.filter(function(t){try{return te.on(t,pr[t]),!0}catch{return!1}}),te.emit=yh,te.reallyExit=gh)};gt.exports.load=uo;var co=te.reallyExit,gh=function(t){ze(Ee.process)&&(te.exitCode=t||0,lt("exit",te.exitCode,null),lt("afterexit",te.exitCode,null),co.call(te,te.exitCode))},dr=te.emit,yh=function(t,n){if(t==="exit"&&ze(Ee.process)){n!==void 0&&(te.exitCode=n);var r=dr.apply(this,arguments);return lt("exit",te.exitCode,null),lt("afterexit",te.exitCode,null),r}else return dr.apply(this,arguments)}}var vh=gt.exports;const wh=Ln.default,Eh=vh,bh=1e3*5,Sh=(e,t="SIGTERM",n={})=>{const r=e(t);return xh(e,t,n,r),r},xh=(e,t,n,r)=>{if(!_h(t,n,r))return;const i=Th(n),a=setTimeout(()=>{e("SIGKILL")},i);a.unref&&a.unref()},_h=(e,{forceKillAfterTimeout:t},n)=>Ah(e)&&t!==!1&&n,Ah=e=>e===wh.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Th=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return bh;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Ch=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Rh=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Fh=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let i;const a=new Promise((s,u)=>{i=setTimeout(()=>{Rh(e,n,u)},t)}),o=r.finally(()=>{clearTimeout(i)});return Promise.race([a,o])},$h=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Ih=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;const i=Eh(()=>{e.kill()});return r.finally(()=>{i()})};var Oh={spawnedKill:Sh,spawnedCancel:Ch,setupTimeout:Fh,validateTimeout:$h,setExitHandler:Ih};const ke=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";ke.writable=e=>ke(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";ke.readable=e=>ke(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";ke.duplex=e=>ke.writable(e)&&ke.readable(e);ke.transform=e=>ke.duplex(e)&&typeof e._transform=="function";var Nh=ke,Bt={exports:{}};const{PassThrough:Ph}=kn.default;var Lh=e=>{e={...e};const{array:t}=e;let{encoding:n}=e;const r=n==="buffer";let i=!1;t?i=!(n||r):n=n||"utf8",r&&(n=null);const a=new Ph({objectMode:i});n&&a.setEncoding(n);let o=0;const s=[];return a.on("data",u=>{s.push(u),i?o=s.length:o+=u.length}),a.getBufferedValue=()=>t?s:r?Buffer.concat(s,o):s.join(""),a.getBufferedLength=()=>o,a};const{constants:kh}=pc.default,Dh=kn.default,{promisify:Mh}=it.default,jh=Lh,Hh=Mh(Dh.pipeline);class ls extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function di(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:n}=t,r=jh(t);return await new Promise((i,a)=>{const o=s=>{s&&r.getBufferedLength()<=kh.MAX_LENGTH&&(s.bufferedData=r.getBufferedValue()),a(s)};(async()=>{try{await Hh(e,r),i()}catch(s){o(s)}})(),r.on("data",()=>{r.getBufferedLength()>n&&o(new ls)})}),r.getBufferedValue()}Bt.exports=di;Bt.exports.buffer=(e,t)=>di(e,{...t,encoding:"buffer"});Bt.exports.array=(e,t)=>di(e,{...t,array:!0});Bt.exports.MaxBufferError=ls;var Bh=Bt.exports;const{PassThrough:Uh}=kn.default;var Gh=function(){var e=[],t=new Uh({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(n),t;function n(a){return Array.isArray(a)?(a.forEach(n),this):(e.push(a),a.once("end",i.bind(null,a)),a.once("error",t.emit.bind(t,"error")),a.pipe(t,{end:!1}),this)}function r(){return e.length==0}function i(a){e=e.filter(function(o){return o!==a}),!e.length&&t.readable&&t.end()}};const fs=Nh,lo=Bh,qh=Gh,Kh=(e,t)=>{t===void 0||e.stdin===void 0||(fs(t)?t.pipe(e.stdin):e.stdin.end(t))},Wh=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const n=qh();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},hr=async(e,t)=>{if(e){e.destroy();try{return await t}catch(n){return n.bufferedData}}},mr=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?lo(e,{encoding:t,maxBuffer:r}):lo.buffer(e,{maxBuffer:r})},zh=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},o)=>{const s=mr(e,{encoding:r,buffer:i,maxBuffer:a}),u=mr(t,{encoding:r,buffer:i,maxBuffer:a}),f=mr(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([o,s,u,f])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},hr(e,s),hr(t,u),hr(n,f)])}},Yh=({input:e})=>{if(fs(e))throw new TypeError("The `input` option cannot be a stream in sync mode")};var Qh={handleInput:Kh,makeAllStream:Wh,getSpawnedResult:zh,validateInputSync:Yh};const Vh=(async()=>{})().constructor.prototype,Xh=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Vh,e)]),Zh=(e,t)=>{for(const[n,r]of Xh){const i=typeof t=="function"?(...a)=>Reflect.apply(r.value,t(),a):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}return e},Jh=e=>new Promise((t,n)=>{e.on("exit",(r,i)=>{t({exitCode:r,signal:i})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});var em={mergePromise:Zh,getSpawnedPromise:Jh};const ps=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],tm=/^[\w.-]+$/,nm=/"/g,rm=e=>typeof e!="string"||tm.test(e)?e:`"${e.replace(nm,'\\"')}"`,im=(e,t)=>ps(e,t).join(" "),om=(e,t)=>ps(e,t).map(n=>rm(n)).join(" "),am=/ +/g,sm=e=>{const t=[];for(const n of e.trim().split(am)){const r=t[t.length-1];r&&r.endsWith("\\")?t[t.length-1]=`${r.slice(0,-1)} ${n}`:t.push(n)}return t};var um={joinCommand:im,getEscapedCommand:om,parseCommand:sm};const cm=Se.default,Gr=ln.default,lm=Md,fm=jd,pm=Hd,dm=Gd,xn=lh,ds=ph,{spawnedKill:hm,spawnedCancel:mm,setupTimeout:gm,validateTimeout:ym,setExitHandler:vm}=Oh,{handleInput:wm,getSpawnedResult:Em,makeAllStream:bm,validateInputSync:Sm}=Qh,{mergePromise:fo,getSpawnedPromise:xm}=em,{joinCommand:hs,parseCommand:ms,getEscapedCommand:gs}=um,_m=1e3*1e3*100,Am=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{const a=t?{...process.env,...e}:e;return n?pm.env({env:a,cwd:r,execPath:i}):a},ys=(e,t,n={})=>{const r=lm._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:_m,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...n},n.env=Am(n),n.stdio=ds(n),process.platform==="win32"&&cm.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},Nt=(e,t,n)=>typeof t!="string"&&!Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?fm(t):t,Wn=(e,t,n)=>{const r=ys(e,t,n),i=hs(e,t),a=gs(e,t);ym(r.options);let o;try{o=Gr.spawn(r.file,r.args,r.options)}catch(d){const h=new Gr.ChildProcess,m=Promise.reject(xn({error:d,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return fo(h,m)}const s=xm(o),u=gm(o,r.options,s),f=vm(o,r.options,u),l={isCanceled:!1};o.kill=hm.bind(null,o.kill.bind(o)),o.cancel=mm.bind(null,o,l);const p=dm(async()=>{const[{error:d,exitCode:h,signal:m,timedOut:g},b,S,T]=await Em(o,r.options,f),A=Nt(r.options,b),R=Nt(r.options,S),F=Nt(r.options,T);if(d||h!==0||m!==null){const D=xn({error:d,exitCode:h,signal:m,stdout:A,stderr:R,all:F,command:i,escapedCommand:a,parsed:r,timedOut:g,isCanceled:l.isCanceled,killed:o.killed});if(!r.options.reject)return D;throw D}return{command:i,escapedCommand:a,exitCode:0,stdout:A,stderr:R,all:F,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return wm(o,r.options.input),o.all=bm(o,r.options),fo(o,p)};Ht.exports=Wn;Ht.exports.sync=(e,t,n)=>{const r=ys(e,t,n),i=hs(e,t),a=gs(e,t);Sm(r.options);let o;try{o=Gr.spawnSync(r.file,r.args,r.options)}catch(f){throw xn({error:f,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}const s=Nt(r.options,o.stdout,o.error),u=Nt(r.options,o.stderr,o.error);if(o.error||o.status!==0||o.signal!==null){const f=xn({stdout:s,stderr:u,error:o.error,signal:o.signal,exitCode:o.status,command:i,escapedCommand:a,parsed:r,timedOut:o.error&&o.error.code==="ETIMEDOUT",isCanceled:!1,killed:o.signal!==null});if(!r.options.reject)return f;throw f}return{command:i,escapedCommand:a,exitCode:0,stdout:s,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};Ht.exports.command=(e,t)=>{const[n,...r]=ms(e);return Wn(n,r,t)};Ht.exports.commandSync=(e,t)=>{const[n,...r]=ms(e);return Wn.sync(n,r,t)};Ht.exports.node=(e,t,n={})=>{t&&!Array.isArray(t)&&typeof t=="object"&&(n=t,t=[]);const r=ds.node(n),i=process.execArgv.filter(s=>!s.startsWith("--inspect")),{nodePath:a=process.execPath,nodeOptions:o=i}=n;return Wn(a,[...o,e,...Array.isArray(t)?t:[]],{...n,stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1})};var _e={},zn={exports:{}},vs={exports:{}},hi={exports:{}},mi={exports:{}},gi={exports:{}},yi={exports:{}};const ws=(e,...t)=>new Promise(n=>{n(e(...t))});yi.exports=ws;yi.exports.default=ws;var Tm=yi.exports;const Cm=Tm,Es=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));const t=[];let n=0;const r=()=>{n--,t.length>0&&t.shift()()},i=(s,u,...f)=>{n++;const l=Cm(s,...f);u(l),l.then(r,r)},a=(s,u,...f)=>{n<e?i(s,u,...f):t.push(i.bind(null,s,u,...f))},o=(s,...u)=>new Promise(f=>a(s,f,...u));return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}}),o};gi.exports=Es;gi.exports.default=Es;var Rm=gi.exports;const po=Rm;let bs=class extends Error{constructor(t){super(),this.value=t}};const Fm=async(e,t)=>t(await e),$m=async e=>{const t=await Promise.all(e);if(t[1]===!0)throw new bs(t[0]);return!1},Ss=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};const r=po(n.concurrency),i=[...e].map(o=>[o,r(Fm,o,t)]),a=po(n.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>a($m,o)))}catch(o){if(o instanceof bs)return o.value;throw o}};mi.exports=Ss;mi.exports.default=Ss;var Im=mi.exports;const xs=Se.default,_n=We.default,{promisify:_s}=it.default,Om=Im,Nm=_s(_n.stat),Pm=_s(_n.lstat),As={directory:"isDirectory",file:"isFile"};function Ts({type:e}){if(!(e in As))throw new Error(`Invalid type specified: ${e}`)}const Cs=(e,t)=>e===void 0||t[As[e]]();hi.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},Ts(t);const n=t.allowSymlinks?Nm:Pm;return Om(e,async r=>{try{const i=await n(xs.resolve(t.cwd,r));return Cs(t.type,i)}catch{return!1}},t)};hi.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},Ts(t);const n=t.allowSymlinks?_n.statSync:_n.lstatSync;for(const r of e)try{const i=n(xs.resolve(t.cwd,r));if(Cs(t.type,i))return r}catch{}};var Lm=hi.exports,vi={exports:{}};const Rs=We.default,{promisify:km}=it.default,Dm=km(Rs.access);vi.exports=async e=>{try{return await Dm(e),!0}catch{return!1}};vi.exports.sync=e=>{try{return Rs.accessSync(e),!0}catch{return!1}};var Fs=vi.exports;(function(e){const t=Se.default,n=Lm,r=Fs,i=Symbol("findUp.stop");e.exports=async(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),l=async c=>{if(typeof a!="function")return n(f,c);const p=await a(c.cwd);return typeof p=="string"?n([p],c):p};for(;;){const c=await l({...o,cwd:s});if(c===i)return;if(c)return t.resolve(s,c);if(s===u)return;s=t.dirname(s)}},e.exports.sync=(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),l=c=>{if(typeof a!="function")return n.sync(f,c);const p=a(c.cwd);return typeof p=="string"?n.sync([p],c):p};for(;;){const c=l({...o,cwd:s});if(c===i)return;if(c)return t.resolve(s,c);if(s===u)return;s=t.dirname(s)}},e.exports.exists=r,e.exports.sync.exists=r.sync,e.exports.stop=i})(vs);var Mm=vs.exports;const $s=Se.default,Is=Mm,Os=async e=>{const t=await Is("package.json",{cwd:e});return t&&$s.dirname(t)};zn.exports=Os;zn.exports.default=Os;zn.exports.sync=e=>{const t=Is.sync("package.json",{cwd:e});return t&&$s.dirname(t)};var jm=zn.exports,Yn={};(function(e){e.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1,e.find=(t,n)=>t.nodes.find(r=>r.type===n),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(t,n=0,r)=>{const i=t.nodes[n];i&&(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},e.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1,e.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1,e.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0,e.reduce=t=>t.reduce((n,r)=>(r.type==="text"&&n.push(r.value),r.type==="range"&&(r.type="text"),n),[]),e.flatten=(...t)=>{const n=[],r=i=>{for(let a=0;a<i.length;a++){const o=i[a];if(Array.isArray(o)){r(o);continue}o!==void 0&&n.push(o)}return n};return r(t),n}})(Yn);const ho=Yn;var wi=(e,t={})=>{const n=(r,i={})=>{const a=t.escapeInvalid&&ho.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0;let s="";if(r.value)return(a||o)&&ho.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(const u of r.nodes)s+=n(u);return s};return n(e)};/*!
31
31
  * is-number <https://github.com/jonschlinkert/is-number>
32
32
  *
33
33
  * Copyright (c) 2014-present, Jon Schlinkert.
34
34
  * Released under the MIT License.
35
- */var jm=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1};/*!
35
+ */var Hm=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1};/*!
36
36
  * to-regex-range <https://github.com/micromatch/to-regex-range>
37
37
  *
38
38
  * Copyright (c) 2015-present, Jon Schlinkert.
39
39
  * Released under the MIT License.
40
- */const mo=jm,Ze=(e,t,n)=>{if(mo(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(mo(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...n};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let i=String(r.relaxZeros),a=String(r.shorthand),o=String(r.capture),s=String(r.wrap),u=e+":"+t+"="+i+a+o+s;if(Ze.cache.hasOwnProperty(u))return Ze.cache[u].result;let f=Math.min(e,t),l=Math.max(e,t);if(Math.abs(f-l)===1){let m=e+"|"+t;return r.capture?`(${m})`:r.wrap===!1?m:`(?:${m})`}let c=bo(e)||bo(t),p={min:e,max:t,a:f,b:l},d=[],h=[];if(c&&(p.isPadded=c,p.maxLen=String(p.max).length),f<0){let m=l<0?Math.abs(l):1;h=go(m,Math.abs(f),p,r),f=p.a=0}return l>=0&&(d=go(f,l,p,r)),p.negatives=h,p.positives=d,p.result=Hm(h,d),r.capture===!0?p.result=`(${p.result})`:r.wrap!==!1&&d.length+h.length>1&&(p.result=`(?:${p.result})`),Ze.cache[u]=p,p.result};function Hm(e,t,n){let r=gr(e,t,"-",!1)||[],i=gr(t,e,"",!1)||[],a=gr(e,t,"-?",!0)||[];return r.concat(a).concat(i).join("|")}function Bm(e,t){let n=1,r=1,i=vo(e,n),a=new Set([t]);for(;e<=i&&i<=t;)a.add(i),n+=1,i=vo(e,n);for(i=Eo(t+1,r)-1;e<i&&i<=t;)a.add(i),r+=1,i=Eo(t+1,r)-1;return a=[...a],a.sort(qm),a}function Um(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=Gm(e,t),i=r.length,a="",o=0;for(let s=0;s<i;s++){let[u,f]=r[s];u===f?a+=u:u!=="0"||f!=="9"?a+=Km(u,f):o++}return o&&(a+=n.shorthand===!0?"\\d":"[0-9]"),{pattern:a,count:[o],digits:i}}function go(e,t,n,r){let i=Bm(e,t),a=[],o=e,s;for(let u=0;u<i.length;u++){let f=i[u],l=Um(String(o),String(f),r),c="";if(!n.isPadded&&s&&s.pattern===l.pattern){s.count.length>1&&s.count.pop(),s.count.push(l.count[0]),s.string=s.pattern+wo(s.count),o=f+1;continue}n.isPadded&&(c=Wm(f,n,r)),l.string=c+l.pattern+wo(l.count),a.push(l),o=f+1,s=l}return a}function gr(e,t,n,r,i){let a=[];for(let o of e){let{string:s}=o;!r&&!yo(t,"string",s)&&a.push(n+s),r&&yo(t,"string",s)&&a.push(n+s)}return a}function Gm(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function qm(e,t){return e>t?1:t>e?-1:0}function yo(e,t,n){return e.some(r=>r[t]===n)}function vo(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Eo(e,t){return e-e%Math.pow(10,t)}function wo(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function Km(e,t,n){return`[${e}${t-e===1?"":"-"}${t}]`}function bo(e){return/^-?(0+)\d/.test(e)}function Wm(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${r}}`:`0{${r}}`}}Ze.cache={};Ze.clearCache=()=>Ze.cache={};var zm=Ze;/*!
40
+ */const mo=Hm,Ze=(e,t,n)=>{if(mo(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(mo(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...n};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let i=String(r.relaxZeros),a=String(r.shorthand),o=String(r.capture),s=String(r.wrap),u=e+":"+t+"="+i+a+o+s;if(Ze.cache.hasOwnProperty(u))return Ze.cache[u].result;let f=Math.min(e,t),l=Math.max(e,t);if(Math.abs(f-l)===1){let m=e+"|"+t;return r.capture?`(${m})`:r.wrap===!1?m:`(?:${m})`}let c=bo(e)||bo(t),p={min:e,max:t,a:f,b:l},d=[],h=[];if(c&&(p.isPadded=c,p.maxLen=String(p.max).length),f<0){let m=l<0?Math.abs(l):1;h=go(m,Math.abs(f),p,r),f=p.a=0}return l>=0&&(d=go(f,l,p,r)),p.negatives=h,p.positives=d,p.result=Bm(h,d),r.capture===!0?p.result=`(${p.result})`:r.wrap!==!1&&d.length+h.length>1&&(p.result=`(?:${p.result})`),Ze.cache[u]=p,p.result};function Bm(e,t,n){let r=gr(e,t,"-",!1)||[],i=gr(t,e,"",!1)||[],a=gr(e,t,"-?",!0)||[];return r.concat(a).concat(i).join("|")}function Um(e,t){let n=1,r=1,i=vo(e,n),a=new Set([t]);for(;e<=i&&i<=t;)a.add(i),n+=1,i=vo(e,n);for(i=wo(t+1,r)-1;e<i&&i<=t;)a.add(i),r+=1,i=wo(t+1,r)-1;return a=[...a],a.sort(Km),a}function Gm(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=qm(e,t),i=r.length,a="",o=0;for(let s=0;s<i;s++){let[u,f]=r[s];u===f?a+=u:u!=="0"||f!=="9"?a+=Wm(u,f):o++}return o&&(a+=n.shorthand===!0?"\\d":"[0-9]"),{pattern:a,count:[o],digits:i}}function go(e,t,n,r){let i=Um(e,t),a=[],o=e,s;for(let u=0;u<i.length;u++){let f=i[u],l=Gm(String(o),String(f),r),c="";if(!n.isPadded&&s&&s.pattern===l.pattern){s.count.length>1&&s.count.pop(),s.count.push(l.count[0]),s.string=s.pattern+Eo(s.count),o=f+1;continue}n.isPadded&&(c=zm(f,n,r)),l.string=c+l.pattern+Eo(l.count),a.push(l),o=f+1,s=l}return a}function gr(e,t,n,r,i){let a=[];for(let o of e){let{string:s}=o;!r&&!yo(t,"string",s)&&a.push(n+s),r&&yo(t,"string",s)&&a.push(n+s)}return a}function qm(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function Km(e,t){return e>t?1:t>e?-1:0}function yo(e,t,n){return e.some(r=>r[t]===n)}function vo(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function wo(e,t){return e-e%Math.pow(10,t)}function Eo(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function Wm(e,t,n){return`[${e}${t-e===1?"":"-"}${t}]`}function bo(e){return/^-?(0+)\d/.test(e)}function zm(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${r}}`:`0{${r}}`}}Ze.cache={};Ze.clearCache=()=>Ze.cache={};var Ym=Ze;/*!
41
41
  * fill-range <https://github.com/jonschlinkert/fill-range>
42
42
  *
43
43
  * Copyright (c) 2014-present, Jon Schlinkert.
44
44
  * Licensed under the MIT License.
45
- */const Ym=it.default,Ns=zm,So=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Qm=e=>t=>e===!0?Number(t):String(t),yr=e=>typeof e=="number"||typeof e=="string"&&e!=="",Pt=e=>Number.isInteger(+e),vr=e=>{let t=`${e}`,n=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++n]==="0";);return n>0},Vm=(e,t,n)=>typeof e=="string"||typeof t=="string"?!0:n.stringify===!0,Xm=(e,t,n)=>{if(t>0){let r=e[0]==="-"?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return n===!1?String(e):e},An=(e,t)=>{let n=e[0]==="-"?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},Zm=(e,t,n)=>{e.negatives.sort((s,u)=>s<u?-1:s>u?1:0),e.positives.sort((s,u)=>s<u?-1:s>u?1:0);let r=t.capture?"":"?:",i="",a="",o;return e.positives.length&&(i=e.positives.map(s=>An(String(s),n)).join("|")),e.negatives.length&&(a=`-(${r}${e.negatives.map(s=>An(String(s),n)).join("|")})`),i&&a?o=`${i}|${a}`:o=i||a,t.wrap?`(${r}${o})`:o},Ps=(e,t,n,r)=>{if(n)return Ns(e,t,{wrap:!1,...r});let i=String.fromCharCode(e);if(e===t)return i;let a=String.fromCharCode(t);return`[${i}-${a}]`},Ls=(e,t,n)=>{if(Array.isArray(e)){let r=n.wrap===!0,i=n.capture?"":"?:";return r?`(${i}${e.join("|")})`:e.join("|")}return Ns(e,t,n)},ks=(...e)=>new RangeError("Invalid range arguments: "+Ym.inspect(...e)),Ds=(e,t,n)=>{if(n.strictRanges===!0)throw ks([e,t]);return[]},Jm=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},eg=(e,t,n=1,r={})=>{let i=Number(e),a=Number(t);if(!Number.isInteger(i)||!Number.isInteger(a)){if(r.strictRanges===!0)throw ks([e,t]);return[]}i===0&&(i=0),a===0&&(a=0);let o=i>a,s=String(e),u=String(t),f=String(n);n=Math.max(Math.abs(n),1);let l=vr(s)||vr(u)||vr(f),c=l?Math.max(s.length,u.length,f.length):0,p=l===!1&&Vm(e,t,r)===!1,d=r.transform||Qm(p);if(r.toRegex&&n===1)return Ps(An(e,c),An(t,c),!0,r);let h={negatives:[],positives:[]},m=S=>h[S<0?"negatives":"positives"].push(Math.abs(S)),g=[],b=0;for(;o?i>=a:i<=a;)r.toRegex===!0&&n>1?m(i):g.push(Xm(d(i,b),c,p)),i=o?i-n:i+n,b++;return r.toRegex===!0?n>1?Zm(h,r,c):Ls(g,null,{wrap:!1,...r}):g},tg=(e,t,n=1,r={})=>{if(!Pt(e)&&e.length>1||!Pt(t)&&t.length>1)return Ds(e,t,r);let i=r.transform||(p=>String.fromCharCode(p)),a=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),s=a>o,u=Math.min(a,o),f=Math.max(a,o);if(r.toRegex&&n===1)return Ps(u,f,!1,r);let l=[],c=0;for(;s?a>=o:a<=o;)l.push(i(a,c)),a=s?a-n:a+n,c++;return r.toRegex===!0?Ls(l,null,{wrap:!1,options:r}):l},an=(e,t,n,r={})=>{if(t==null&&yr(e))return[e];if(!yr(e)||!yr(t))return Ds(e,t,r);if(typeof n=="function")return an(e,t,1,{transform:n});if(So(n))return an(e,t,0,n);let i={...r};return i.capture===!0&&(i.wrap=!0),n=n||i.step||1,Pt(n)?Pt(e)&&Pt(t)?eg(e,t,n,i):tg(e,t,Math.max(Math.abs(n),1),i):n!=null&&!So(n)?Jm(n,i):an(e,t,1,n)};var Ms=an;const ng=Ms,xo=Yn,rg=(e,t={})=>{const n=(r,i={})=>{const a=xo.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0,s=a===!0||o===!0,u=t.escapeInvalid===!0?"\\":"";let f="";if(r.isOpen===!0)return u+r.value;if(r.isClose===!0)return console.log("node.isClose",u,r.value),u+r.value;if(r.type==="open")return s?u+r.value:"(";if(r.type==="close")return s?u+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":s?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){const l=xo.reduce(r.nodes),c=ng(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(c.length!==0)return l.length>1&&c.length>1?`(${c})`:c}if(r.nodes)for(const l of r.nodes)f+=n(l,r);return f};return n(e)};var ig=rg;const og=Ms,_o=Ei,vt=Yn,Qe=(e="",t="",n=!1)=>{const r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?vt.flatten(t).map(i=>`{${i}}`):t;for(const i of e)if(Array.isArray(i))for(const a of i)r.push(Qe(a,t,n));else for(let a of t)n===!0&&typeof a=="string"&&(a=`{${a}}`),r.push(Array.isArray(a)?Qe(i,a,n):i+a);return vt.flatten(r)},ag=(e,t={})=>{const n=t.rangeLimit===void 0?1e3:t.rangeLimit,r=(i,a={})=>{i.queue=[];let o=a,s=a.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,s=o.queue;if(i.invalid||i.dollar){s.push(Qe(s.pop(),_o(i,t)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){s.push(Qe(s.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){const c=vt.reduce(i.nodes);if(vt.exceedsLimit(...c,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let p=og(...c,t);p.length===0&&(p=_o(i,t)),s.push(Qe(s.pop(),p)),i.nodes=[];return}const u=vt.encloseBrace(i);let f=i.queue,l=i;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,f=l.queue;for(let c=0;c<i.nodes.length;c++){const p=i.nodes[c];if(p.type==="comma"&&i.type==="brace"){c===1&&f.push(""),f.push("");continue}if(p.type==="close"){s.push(Qe(s.pop(),f,u));continue}if(p.value&&p.type!=="open"){f.push(Qe(f.pop(),p.value));continue}p.nodes&&r(p,i)}return f};return vt.flatten(r(e))};var sg=ag,ug={MAX_LENGTH:1e4,CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_COMMA:",",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_NO_BREAK_SPACE:" ",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SINGLE_QUOTE:"'",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const cg=Ei,{MAX_LENGTH:Ao,CHAR_BACKSLASH:Er,CHAR_BACKTICK:lg,CHAR_COMMA:fg,CHAR_DOT:pg,CHAR_LEFT_PARENTHESES:dg,CHAR_RIGHT_PARENTHESES:hg,CHAR_LEFT_CURLY_BRACE:mg,CHAR_RIGHT_CURLY_BRACE:gg,CHAR_LEFT_SQUARE_BRACKET:To,CHAR_RIGHT_SQUARE_BRACKET:Co,CHAR_DOUBLE_QUOTE:yg,CHAR_SINGLE_QUOTE:vg,CHAR_NO_BREAK_SPACE:Eg,CHAR_ZERO_WIDTH_NOBREAK_SPACE:wg}=ug,bg=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");const n=t||{},r=typeof n.maxLength=="number"?Math.min(Ao,n.maxLength):Ao;if(e.length>r)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${r})`);const i={type:"root",input:e,nodes:[]},a=[i];let o=i,s=i,u=0;const f=e.length;let l=0,c=0,p;const d=()=>e[l++],h=m=>{if(m.type==="text"&&s.type==="dot"&&(s.type="text"),s&&s.type==="text"&&m.type==="text"){s.value+=m.value;return}return o.nodes.push(m),m.parent=o,m.prev=s,s=m,m};for(h({type:"bos"});l<f;)if(o=a[a.length-1],p=d(),!(p===wg||p===Eg)){if(p===Er){h({type:"text",value:(t.keepEscaping?p:"")+d()});continue}if(p===Co){h({type:"text",value:"\\"+p});continue}if(p===To){u++;let m;for(;l<f&&(m=d());){if(p+=m,m===To){u++;continue}if(m===Er){p+=d();continue}if(m===Co&&(u--,u===0))break}h({type:"text",value:p});continue}if(p===dg){o=h({type:"paren",nodes:[]}),a.push(o),h({type:"text",value:p});continue}if(p===hg){if(o.type!=="paren"){h({type:"text",value:p});continue}o=a.pop(),h({type:"text",value:p}),o=a[a.length-1];continue}if(p===yg||p===vg||p===lg){const m=p;let g;for(t.keepQuotes!==!0&&(p="");l<f&&(g=d());){if(g===Er){p+=g+d();continue}if(g===m){t.keepQuotes===!0&&(p+=g);break}p+=g}h({type:"text",value:p});continue}if(p===mg){c++;const g={type:"brace",open:!0,close:!1,dollar:s.value&&s.value.slice(-1)==="$"||o.dollar===!0,depth:c,commas:0,ranges:0,nodes:[]};o=h(g),a.push(o),h({type:"open",value:p});continue}if(p===gg){if(o.type!=="brace"){h({type:"text",value:p});continue}const m="close";o=a.pop(),o.close=!0,h({type:m,value:p}),c--,o=a[a.length-1];continue}if(p===fg&&c>0){if(o.ranges>0){o.ranges=0;const m=o.nodes.shift();o.nodes=[m,{type:"text",value:cg(o)}]}h({type:"comma",value:p}),o.commas++;continue}if(p===pg&&c>0&&o.commas===0){const m=o.nodes;if(c===0||m.length===0){h({type:"text",value:p});continue}if(s.type==="dot"){if(o.range=[],s.value+=p,s.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,s.type="text";continue}o.ranges++,o.args=[];continue}if(s.type==="range"){m.pop();const g=m[m.length-1];g.value+=s.value+p,s=g,o.ranges--;continue}h({type:"dot",value:p});continue}h({type:"text",value:p})}do if(o=a.pop(),o.type!=="root"){o.nodes.forEach(b=>{b.nodes||(b.type==="open"&&(b.isOpen=!0),b.type==="close"&&(b.isClose=!0),b.nodes||(b.type="text"),b.invalid=!0)});const m=a[a.length-1],g=m.nodes.indexOf(o);m.nodes.splice(g,1,...o.nodes)}while(a.length>0);return h({type:"eos"}),i};var Sg=bg;const Ro=Ei,xg=ig,_g=sg,Ag=Sg,Ae=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const i=Ae.create(r,t);Array.isArray(i)?n.push(...i):n.push(i)}else n=[].concat(Ae.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};Ae.parse=(e,t={})=>Ag(e,t);Ae.stringify=(e,t={})=>Ro(typeof e=="string"?Ae.parse(e,t):e,t);Ae.compile=(e,t={})=>(typeof e=="string"&&(e=Ae.parse(e,t)),xg(e,t));Ae.expand=(e,t={})=>{typeof e=="string"&&(e=Ae.parse(e,t));let n=_g(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n};Ae.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Ae.compile(e,t):Ae.expand(e,t);var Tg=Ae,Ut={};const Cg=Se.default,Pe="\\\\/",Fo=`[^${Pe}]`,He="\\.",Rg="\\+",Fg="\\?",Qn="\\/",$g="(?=.)",js="[^/]",wi=`(?:${Qn}|$)`,Hs=`(?:^|${Qn})`,bi=`${He}{1,2}${wi}`,Ig=`(?!${He})`,Og=`(?!${Hs}${bi})`,Ng=`(?!${He}{0,1}${wi})`,Pg=`(?!${bi})`,Lg=`[^.${Qn}]`,kg=`${js}*?`,Bs={DOT_LITERAL:He,PLUS_LITERAL:Rg,QMARK_LITERAL:Fg,SLASH_LITERAL:Qn,ONE_CHAR:$g,QMARK:js,END_ANCHOR:wi,DOTS_SLASH:bi,NO_DOT:Ig,NO_DOTS:Og,NO_DOT_SLASH:Ng,NO_DOTS_SLASH:Pg,QMARK_NO_DOT:Lg,STAR:kg,START_ANCHOR:Hs},Dg={...Bs,SLASH_LITERAL:`[${Pe}]`,QMARK:Fo,STAR:`${Fo}*?`,DOTS_SLASH:`${He}{1,2}(?:[${Pe}]|$)`,NO_DOT:`(?!${He})`,NO_DOTS:`(?!(?:^|[${Pe}])${He}{1,2}(?:[${Pe}]|$))`,NO_DOT_SLASH:`(?!${He}{0,1}(?:[${Pe}]|$))`,NO_DOTS_SLASH:`(?!${He}{1,2}(?:[${Pe}]|$))`,QMARK_NO_DOT:`[^.${Pe}]`,START_ANCHOR:`(?:^|[${Pe}])`,END_ANCHOR:`(?:[${Pe}]|$)`},Mg={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};var Vn={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Mg,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Cg.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Dg:Bs}};(function(e){const t=Se.default,n=process.platform==="win32",{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:o}=Vn;e.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),e.hasRegexChars=s=>a.test(s),e.isRegexChar=s=>s.length===1&&e.hasRegexChars(s),e.escapeRegex=s=>s.replace(o,"\\$1"),e.toPosixSlashes=s=>s.replace(r,"/"),e.removeBackslashes=s=>s.replace(i,u=>u==="\\"?"":u),e.supportsLookbehinds=()=>{const s=process.version.slice(1).split(".").map(Number);return s.length===3&&s[0]>=9||s[0]===8&&s[1]>=10},e.isWindows=s=>s&&typeof s.windows=="boolean"?s.windows:n===!0||t.sep==="\\",e.escapeLast=(s,u,f)=>{const l=s.lastIndexOf(u,f);return l===-1?s:s[l-1]==="\\"?e.escapeLast(s,u,l-1):`${s.slice(0,l)}\\${s.slice(l)}`},e.removePrefix=(s,u={})=>{let f=s;return f.startsWith("./")&&(f=f.slice(2),u.prefix="./"),f},e.wrapOutput=(s,u={},f={})=>{const l=f.contains?"":"^",c=f.contains?"":"$";let p=`${l}(?:${s})${c}`;return u.negated===!0&&(p=`(?:^(?!${p}).*$)`),p}})(Ut);const $o=Ut,{CHAR_ASTERISK:wr,CHAR_AT:jg,CHAR_BACKWARD_SLASH:Ot,CHAR_COMMA:Hg,CHAR_DOT:br,CHAR_EXCLAMATION_MARK:Sr,CHAR_FORWARD_SLASH:Us,CHAR_LEFT_CURLY_BRACE:xr,CHAR_LEFT_PARENTHESES:_r,CHAR_LEFT_SQUARE_BRACKET:Bg,CHAR_PLUS:Ug,CHAR_QUESTION_MARK:Io,CHAR_RIGHT_CURLY_BRACE:Gg,CHAR_RIGHT_PARENTHESES:Oo,CHAR_RIGHT_SQUARE_BRACKET:qg}=Vn,No=e=>e===Us||e===Ot,Po=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},Kg=(e,t)=>{const n=t||{},r=e.length-1,i=n.parts===!0||n.scanToEnd===!0,a=[],o=[],s=[];let u=e,f=-1,l=0,c=0,p=!1,d=!1,h=!1,m=!1,g=!1,b=!1,S=!1,T=!1,A=!1,C=!1,F=0,j,x,_={value:"",depth:0,isGlob:!1};const N=()=>f>=r,v=()=>u.charCodeAt(f+1),M=()=>(j=x,u.charCodeAt(++f));for(;f<r;){x=M();let $;if(x===Ot){S=_.backslashes=!0,x=M(),x===xr&&(b=!0);continue}if(b===!0||x===xr){for(F++;N()!==!0&&(x=M());){if(x===Ot){S=_.backslashes=!0,M();continue}if(x===xr){F++;continue}if(b!==!0&&x===br&&(x=M())===br){if(p=_.isBrace=!0,h=_.isGlob=!0,C=!0,i===!0)continue;break}if(b!==!0&&x===Hg){if(p=_.isBrace=!0,h=_.isGlob=!0,C=!0,i===!0)continue;break}if(x===Gg&&(F--,F===0)){b=!1,p=_.isBrace=!0,C=!0;break}}if(i===!0)continue;break}if(x===Us){if(a.push(f),o.push(_),_={value:"",depth:0,isGlob:!1},C===!0)continue;if(j===br&&f===l+1){l+=2;continue}c=f+1;continue}if(n.noext!==!0&&(x===Ug||x===jg||x===wr||x===Io||x===Sr)===!0&&v()===_r){if(h=_.isGlob=!0,m=_.isExtglob=!0,C=!0,x===Sr&&f===l&&(A=!0),i===!0){for(;N()!==!0&&(x=M());){if(x===Ot){S=_.backslashes=!0,x=M();continue}if(x===Oo){h=_.isGlob=!0,C=!0;break}}continue}break}if(x===wr){if(j===wr&&(g=_.isGlobstar=!0),h=_.isGlob=!0,C=!0,i===!0)continue;break}if(x===Io){if(h=_.isGlob=!0,C=!0,i===!0)continue;break}if(x===Bg){for(;N()!==!0&&($=M());){if($===Ot){S=_.backslashes=!0,M();continue}if($===qg){d=_.isBracket=!0,h=_.isGlob=!0,C=!0;break}}if(i===!0)continue;break}if(n.nonegate!==!0&&x===Sr&&f===l){T=_.negated=!0,l++;continue}if(n.noparen!==!0&&x===_r){if(h=_.isGlob=!0,i===!0){for(;N()!==!0&&(x=M());){if(x===_r){S=_.backslashes=!0,x=M();continue}if(x===Oo){C=!0;break}}continue}break}if(h===!0){if(C=!0,i===!0)continue;break}}n.noext===!0&&(m=!1,h=!1);let H=u,K="",E="";l>0&&(K=u.slice(0,l),u=u.slice(l),c-=l),H&&h===!0&&c>0?(H=u.slice(0,c),E=u.slice(c)):h===!0?(H="",E=u):H=u,H&&H!==""&&H!=="/"&&H!==u&&No(H.charCodeAt(H.length-1))&&(H=H.slice(0,-1)),n.unescape===!0&&(E&&(E=$o.removeBackslashes(E)),H&&S===!0&&(H=$o.removeBackslashes(H)));const w={prefix:K,input:e,start:l,base:H,glob:E,isBrace:p,isBracket:d,isGlob:h,isExtglob:m,isGlobstar:g,negated:T,negatedExtglob:A};if(n.tokens===!0&&(w.maxDepth=0,No(x)||o.push(_),w.tokens=o),n.parts===!0||n.tokens===!0){let $;for(let k=0;k<a.length;k++){const U=$?$+1:l,z=a[k],V=e.slice(U,z);n.tokens&&(k===0&&l!==0?(o[k].isPrefix=!0,o[k].value=K):o[k].value=V,Po(o[k]),w.maxDepth+=o[k].depth),(k!==0||V!=="")&&s.push(V),$=z}if($&&$+1<e.length){const k=e.slice($+1);s.push(k),n.tokens&&(o[o.length-1].value=k,Po(o[o.length-1]),w.maxDepth+=o[o.length-1].depth)}w.slashes=a,w.parts=s}return w};var Wg=Kg;const Tn=Vn,xe=Ut,{MAX_LENGTH:Cn,POSIX_REGEX_SOURCE:zg,REGEX_NON_SPECIAL_CHARS:Yg,REGEX_SPECIAL_CHARS_BACKREF:Qg,REPLACEMENTS:Gs}=Tn,Vg=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch{return e.map(i=>xe.escapeRegex(i)).join("..")}return n},ft=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Si=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=Gs[e]||e;const n={...t},r=typeof n.maxLength=="number"?Math.min(Cn,n.maxLength):Cn;let i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);const a={type:"bos",value:"",output:n.prepend||""},o=[a],s=n.capture?"":"?:",u=xe.isWindows(t),f=Tn.globChars(u),l=Tn.extglobChars(f),{DOT_LITERAL:c,PLUS_LITERAL:p,SLASH_LITERAL:d,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:b,NO_DOTS_SLASH:S,QMARK:T,QMARK_NO_DOT:A,STAR:C,START_ANCHOR:F}=f,j=L=>`(${s}(?:(?!${F}${L.dot?m:c}).)*?)`,x=n.dot?"":g,_=n.dot?T:A;let N=n.bash===!0?j(n):C;n.capture&&(N=`(${N})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);const v={input:e,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=xe.removePrefix(e,v),i=e.length;const M=[],H=[],K=[];let E=a,w;const $=()=>v.index===i-1,k=v.peek=(L=1)=>e[v.index+L],U=v.advance=()=>e[++v.index]||"",z=()=>e.slice(v.index+1),V=(L="",Y=0)=>{v.consumed+=L,v.index+=Y},ee=L=>{v.output+=L.output!=null?L.output:L.value,V(L.value)},Te=()=>{let L=1;for(;k()==="!"&&(k(2)!=="("||k(3)==="?");)U(),v.start++,L++;return L%2===0?!1:(v.negated=!0,v.start++,!0)},I=L=>{v[L]++,K.push(L)},D=L=>{v[L]--,K.pop()},P=L=>{if(E.type==="globstar"){const Y=v.braces>0&&(L.type==="comma"||L.type==="brace"),O=L.extglob===!0||M.length&&(L.type==="pipe"||L.type==="paren");L.type!=="slash"&&L.type!=="paren"&&!Y&&!O&&(v.output=v.output.slice(0,-E.output.length),E.type="star",E.value="*",E.output=N,v.output+=E.output)}if(M.length&&L.type!=="paren"&&(M[M.length-1].inner+=L.value),(L.value||L.output)&&ee(L),E&&E.type==="text"&&L.type==="text"){E.value+=L.value,E.output=(E.output||"")+L.value;return}L.prev=E,o.push(L),E=L},Q=(L,Y)=>{const O={...l[Y],conditions:1,inner:""};O.prev=E,O.parens=v.parens,O.output=v.output;const q=(n.capture?"(":"")+O.open;I("parens"),P({type:L,value:Y,output:v.output?"":h}),P({type:"paren",extglob:!0,value:U(),output:q}),M.push(O)},ce=L=>{let Y=L.close+(n.capture?")":""),O;if(L.type==="negate"){let q=N;if(L.inner&&L.inner.length>1&&L.inner.includes("/")&&(q=j(n)),(q!==N||$()||/^\)+$/.test(z()))&&(Y=L.close=`)$))${q}`),L.inner.includes("*")&&(O=z())&&/^\.[^\\/.]+$/.test(O)){const X=Si(O,{...t,fastpaths:!1}).output;Y=L.close=`)${X})${q})`}L.prev.type==="bos"&&(v.negatedExtglob=!0)}P({type:"paren",extglob:!0,value:w,output:Y}),D("parens")};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let L=!1,Y=e.replace(Qg,(O,q,X,oe,Z,Ne)=>oe==="\\"?(L=!0,O):oe==="?"?q?q+oe+(Z?T.repeat(Z.length):""):Ne===0?_+(Z?T.repeat(Z.length):""):T.repeat(X.length):oe==="."?c.repeat(X.length):oe==="*"?q?q+oe+(Z?N:""):N:q?O:`\\${O}`);return L===!0&&(n.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,O=>O.length%2===0?"\\\\":O?"\\":"")),Y===e&&n.contains===!0?(v.output=e,v):(v.output=xe.wrapOutput(Y,v,t),v)}for(;!$();){if(w=U(),w==="\0")continue;if(w==="\\"){const O=k();if(O==="/"&&n.bash!==!0||O==="."||O===";")continue;if(!O){w+="\\",P({type:"text",value:w});continue}const q=/^\\+/.exec(z());let X=0;if(q&&q[0].length>2&&(X=q[0].length,v.index+=X,X%2!==0&&(w+="\\")),n.unescape===!0?w=U():w+=U(),v.brackets===0){P({type:"text",value:w});continue}}if(v.brackets>0&&(w!=="]"||E.value==="["||E.value==="[^")){if(n.posix!==!1&&w===":"){const O=E.value.slice(1);if(O.includes("[")&&(E.posix=!0,O.includes(":"))){const q=E.value.lastIndexOf("["),X=E.value.slice(0,q),oe=E.value.slice(q+2),Z=zg[oe];if(Z){E.value=X+Z,v.backtrack=!0,U(),!a.output&&o.indexOf(E)===1&&(a.output=h);continue}}}(w==="["&&k()!==":"||w==="-"&&k()==="]")&&(w=`\\${w}`),w==="]"&&(E.value==="["||E.value==="[^")&&(w=`\\${w}`),n.posix===!0&&w==="!"&&E.value==="["&&(w="^"),E.value+=w,ee({value:w});continue}if(v.quotes===1&&w!=='"'){w=xe.escapeRegex(w),E.value+=w,ee({value:w});continue}if(w==='"'){v.quotes=v.quotes===1?0:1,n.keepQuotes===!0&&P({type:"text",value:w});continue}if(w==="("){I("parens"),P({type:"paren",value:w});continue}if(w===")"){if(v.parens===0&&n.strictBrackets===!0)throw new SyntaxError(ft("opening","("));const O=M[M.length-1];if(O&&v.parens===O.parens+1){ce(M.pop());continue}P({type:"paren",value:w,output:v.parens?")":"\\)"}),D("parens");continue}if(w==="["){if(n.nobracket===!0||!z().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(ft("closing","]"));w=`\\${w}`}else I("brackets");P({type:"bracket",value:w});continue}if(w==="]"){if(n.nobracket===!0||E&&E.type==="bracket"&&E.value.length===1){P({type:"text",value:w,output:`\\${w}`});continue}if(v.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(ft("opening","["));P({type:"text",value:w,output:`\\${w}`});continue}D("brackets");const O=E.value.slice(1);if(E.posix!==!0&&O[0]==="^"&&!O.includes("/")&&(w=`/${w}`),E.value+=w,ee({value:w}),n.literalBrackets===!1||xe.hasRegexChars(O))continue;const q=xe.escapeRegex(E.value);if(v.output=v.output.slice(0,-E.value.length),n.literalBrackets===!0){v.output+=q,E.value=q;continue}E.value=`(${s}${q}|${E.value})`,v.output+=E.value;continue}if(w==="{"&&n.nobrace!==!0){I("braces");const O={type:"brace",value:w,output:"(",outputIndex:v.output.length,tokensIndex:v.tokens.length};H.push(O),P(O);continue}if(w==="}"){const O=H[H.length-1];if(n.nobrace===!0||!O){P({type:"text",value:w,output:w});continue}let q=")";if(O.dots===!0){const X=o.slice(),oe=[];for(let Z=X.length-1;Z>=0&&(o.pop(),X[Z].type!=="brace");Z--)X[Z].type!=="dots"&&oe.unshift(X[Z].value);q=Vg(oe,n),v.backtrack=!0}if(O.comma!==!0&&O.dots!==!0){const X=v.output.slice(0,O.outputIndex),oe=v.tokens.slice(O.tokensIndex);O.value=O.output="\\{",w=q="\\}",v.output=X;for(const Z of oe)v.output+=Z.output||Z.value}P({type:"brace",value:w,output:q}),D("braces"),H.pop();continue}if(w==="|"){M.length>0&&M[M.length-1].conditions++,P({type:"text",value:w});continue}if(w===","){let O=w;const q=H[H.length-1];q&&K[K.length-1]==="braces"&&(q.comma=!0,O="|"),P({type:"comma",value:w,output:O});continue}if(w==="/"){if(E.type==="dot"&&v.index===v.start+1){v.start=v.index+1,v.consumed="",v.output="",o.pop(),E=a;continue}P({type:"slash",value:w,output:d});continue}if(w==="."){if(v.braces>0&&E.type==="dot"){E.value==="."&&(E.output=c);const O=H[H.length-1];E.type="dots",E.output+=w,E.value+=w,O.dots=!0;continue}if(v.braces+v.parens===0&&E.type!=="bos"&&E.type!=="slash"){P({type:"text",value:w,output:c});continue}P({type:"dot",value:w,output:c});continue}if(w==="?"){if(!(E&&E.value==="(")&&n.noextglob!==!0&&k()==="("&&k(2)!=="?"){Q("qmark",w);continue}if(E&&E.type==="paren"){const q=k();let X=w;if(q==="<"&&!xe.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(E.value==="("&&!/[!=<:]/.test(q)||q==="<"&&!/<([!=]|\w+>)/.test(z()))&&(X=`\\${w}`),P({type:"text",value:w,output:X});continue}if(n.dot!==!0&&(E.type==="slash"||E.type==="bos")){P({type:"qmark",value:w,output:A});continue}P({type:"qmark",value:w,output:T});continue}if(w==="!"){if(n.noextglob!==!0&&k()==="("&&(k(2)!=="?"||!/[!=<:]/.test(k(3)))){Q("negate",w);continue}if(n.nonegate!==!0&&v.index===0){Te();continue}}if(w==="+"){if(n.noextglob!==!0&&k()==="("&&k(2)!=="?"){Q("plus",w);continue}if(E&&E.value==="("||n.regex===!1){P({type:"plus",value:w,output:p});continue}if(E&&(E.type==="bracket"||E.type==="paren"||E.type==="brace")||v.parens>0){P({type:"plus",value:w});continue}P({type:"plus",value:p});continue}if(w==="@"){if(n.noextglob!==!0&&k()==="("&&k(2)!=="?"){P({type:"at",extglob:!0,value:w,output:""});continue}P({type:"text",value:w});continue}if(w!=="*"){(w==="$"||w==="^")&&(w=`\\${w}`);const O=Yg.exec(z());O&&(w+=O[0],v.index+=O[0].length),P({type:"text",value:w});continue}if(E&&(E.type==="globstar"||E.star===!0)){E.type="star",E.star=!0,E.value+=w,E.output=N,v.backtrack=!0,v.globstar=!0,V(w);continue}let L=z();if(n.noextglob!==!0&&/^\([^?]/.test(L)){Q("star",w);continue}if(E.type==="star"){if(n.noglobstar===!0){V(w);continue}const O=E.prev,q=O.prev,X=O.type==="slash"||O.type==="bos",oe=q&&(q.type==="star"||q.type==="globstar");if(n.bash===!0&&(!X||L[0]&&L[0]!=="/")){P({type:"star",value:w,output:""});continue}const Z=v.braces>0&&(O.type==="comma"||O.type==="brace"),Ne=M.length&&(O.type==="pipe"||O.type==="paren");if(!X&&O.type!=="paren"&&!Z&&!Ne){P({type:"star",value:w,output:""});continue}for(;L.slice(0,3)==="/**";){const je=e[v.index+4];if(je&&je!=="/")break;L=L.slice(3),V("/**",3)}if(O.type==="bos"&&$()){E.type="globstar",E.value+=w,E.output=j(n),v.output=E.output,v.globstar=!0,V(w);continue}if(O.type==="slash"&&O.prev.type!=="bos"&&!oe&&$()){v.output=v.output.slice(0,-(O.output+E.output).length),O.output=`(?:${O.output}`,E.type="globstar",E.output=j(n)+(n.strictSlashes?")":"|$)"),E.value+=w,v.globstar=!0,v.output+=O.output+E.output,V(w);continue}if(O.type==="slash"&&O.prev.type!=="bos"&&L[0]==="/"){const je=L[1]!==void 0?"|$":"";v.output=v.output.slice(0,-(O.output+E.output).length),O.output=`(?:${O.output}`,E.type="globstar",E.output=`${j(n)}${d}|${d}${je})`,E.value+=w,v.output+=O.output+E.output,v.globstar=!0,V(w+U()),P({type:"slash",value:"/",output:""});continue}if(O.type==="bos"&&L[0]==="/"){E.type="globstar",E.value+=w,E.output=`(?:^|${d}|${j(n)}${d})`,v.output=E.output,v.globstar=!0,V(w+U()),P({type:"slash",value:"/",output:""});continue}v.output=v.output.slice(0,-E.output.length),E.type="globstar",E.output=j(n),E.value+=w,v.output+=E.output,v.globstar=!0,V(w);continue}const Y={type:"star",value:w,output:N};if(n.bash===!0){Y.output=".*?",(E.type==="bos"||E.type==="slash")&&(Y.output=x+Y.output),P(Y);continue}if(E&&(E.type==="bracket"||E.type==="paren")&&n.regex===!0){Y.output=w,P(Y);continue}(v.index===v.start||E.type==="slash"||E.type==="dot")&&(E.type==="dot"?(v.output+=b,E.output+=b):n.dot===!0?(v.output+=S,E.output+=S):(v.output+=x,E.output+=x),k()!=="*"&&(v.output+=h,E.output+=h)),P(Y)}for(;v.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(ft("closing","]"));v.output=xe.escapeLast(v.output,"["),D("brackets")}for(;v.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(ft("closing",")"));v.output=xe.escapeLast(v.output,"("),D("parens")}for(;v.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(ft("closing","}"));v.output=xe.escapeLast(v.output,"{"),D("braces")}if(n.strictSlashes!==!0&&(E.type==="star"||E.type==="bracket")&&P({type:"maybe_slash",value:"",output:`${d}?`}),v.backtrack===!0){v.output="";for(const L of v.tokens)v.output+=L.output!=null?L.output:L.value,L.suffix&&(v.output+=L.suffix)}return v};Si.fastpaths=(e,t)=>{const n={...t},r=typeof n.maxLength=="number"?Math.min(Cn,n.maxLength):Cn,i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);e=Gs[e]||e;const a=xe.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:u,DOTS_SLASH:f,NO_DOT:l,NO_DOTS:c,NO_DOTS_SLASH:p,STAR:d,START_ANCHOR:h}=Tn.globChars(a),m=n.dot?c:l,g=n.dot?p:l,b=n.capture?"":"?:",S={negated:!1,prefix:""};let T=n.bash===!0?".*?":d;n.capture&&(T=`(${T})`);const A=x=>x.noglobstar===!0?T:`(${b}(?:(?!${h}${x.dot?f:o}).)*?)`,C=x=>{switch(x){case"*":return`${m}${u}${T}`;case".*":return`${o}${u}${T}`;case"*.*":return`${m}${T}${o}${u}${T}`;case"*/*":return`${m}${T}${s}${u}${g}${T}`;case"**":return m+A(n);case"**/*":return`(?:${m}${A(n)}${s})?${g}${u}${T}`;case"**/*.*":return`(?:${m}${A(n)}${s})?${g}${T}${o}${u}${T}`;case"**/.*":return`(?:${m}${A(n)}${s})?${o}${u}${T}`;default:{const _=/^(.*?)\.(\w+)$/.exec(x);if(!_)return;const N=C(_[1]);return N?N+o+_[2]:void 0}}},F=xe.removePrefix(e,S);let j=C(F);return j&&n.strictSlashes!==!0&&(j+=`${s}?`),j};var Xg=Si;const Zg=Se.default,Jg=Wg,qr=Xg,xi=Ut,ey=Vn,ty=e=>e&&typeof e=="object"&&!Array.isArray(e),ae=(e,t,n=!1)=>{if(Array.isArray(e)){const l=e.map(p=>ae(p,t,n));return p=>{for(const d of l){const h=d(p);if(h)return h}return!1}}const r=ty(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},a=xi.isWindows(t),o=r?ae.compileRe(e,t):ae.makeRe(e,t,!1,!0),s=o.state;delete o.state;let u=()=>!1;if(i.ignore){const l={...t,ignore:null,onMatch:null,onResult:null};u=ae(i.ignore,l,n)}const f=(l,c=!1)=>{const{isMatch:p,match:d,output:h}=ae.test(l,o,t,{glob:e,posix:a}),m={glob:e,state:s,regex:o,posix:a,input:l,output:h,match:d,isMatch:p};return typeof i.onResult=="function"&&i.onResult(m),p===!1?(m.isMatch=!1,c?m:!1):u(l)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,c?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),c?m:!0)};return n&&(f.state=s),f};ae.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};const a=n||{},o=a.format||(i?xi.toPosixSlashes:null);let s=e===r,u=s&&o?o(e):e;return s===!1&&(u=o?o(e):e,s=u===r),(s===!1||a.capture===!0)&&(a.matchBase===!0||a.basename===!0?s=ae.matchBase(e,t,n,i):s=t.exec(u)),{isMatch:!!s,match:s,output:u}};ae.matchBase=(e,t,n,r=xi.isWindows(n))=>(t instanceof RegExp?t:ae.makeRe(t,n)).test(Zg.basename(e));ae.isMatch=(e,t,n)=>ae(t,n)(e);ae.parse=(e,t)=>Array.isArray(e)?e.map(n=>ae.parse(n,t)):qr(e,{...t,fastpaths:!1});ae.scan=(e,t)=>Jg(e,t);ae.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;const i=t||{},a=i.contains?"":"^",o=i.contains?"":"$";let s=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(s=`^(?!${s}).*$`);const u=ae.toRegex(s,t);return r===!0&&(u.state=e),u};ae.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(i.output=qr.fastpaths(e,t)),i.output||(i=qr(e,t)),ae.compileRe(i,t,n,r)};ae.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(n){if(t&&t.debug===!0)throw n;return/$^/}};ae.constants=ey;var ny=ae,ry=ny;const qs=it.default,Ks=Tg,Me=ry,Kr=Ut,Lo=e=>e===""||e==="./",Ws=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},J=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,i=new Set,a=new Set,o=0,s=l=>{a.add(l.output),n&&n.onResult&&n.onResult(l)};for(let l=0;l<t.length;l++){let c=Me(String(t[l]),{...n,onResult:s},!0),p=c.state.negated||c.state.negatedExtglob;p&&o++;for(let d of e){let h=c(d,!0);(p?!h.isMatch:h.isMatch)&&(p?r.add(h.output):(r.delete(h.output),i.add(h.output)))}}let f=(o===t.length?[...a]:[...i]).filter(l=>!r.has(l));if(n&&f.length===0){if(n.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(l=>l.replace(/\\/g,"")):t}return f};J.match=J;J.matcher=(e,t)=>Me(e,t);J.isMatch=(e,t,n)=>Me(t,n)(e);J.any=J.isMatch;J.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],a=s=>{n.onResult&&n.onResult(s),i.push(s.output)},o=new Set(J(e,t,{...n,onResult:a}));for(let s of i)o.has(s)||r.add(s);return[...r]};J.contains=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${qs.inspect(e)}"`);if(Array.isArray(t))return t.some(r=>J.contains(e,r,n));if(typeof t=="string"){if(Lo(e)||Lo(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return J.isMatch(e,t,{...n,contains:!0})};J.matchKeys=(e,t,n)=>{if(!Kr.isObject(e))throw new TypeError("Expected the first argument to be an object");let r=J(Object.keys(e),t,n),i={};for(let a of r)i[a]=e[a];return i};J.some=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let a=Me(String(i),n);if(r.some(o=>a(o)))return!0}return!1};J.every=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let a=Me(String(i),n);if(!r.every(o=>a(o)))return!1}return!0};J.all=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${qs.inspect(e)}"`);return[].concat(t).every(r=>Me(r,n)(e))};J.capture=(e,t,n)=>{let r=Kr.isWindows(n),a=Me.makeRe(String(e),{...n,capture:!0}).exec(r?Kr.toPosixSlashes(t):t);if(a)return a.slice(1).map(o=>o===void 0?"":o)};J.makeRe=(...e)=>Me.makeRe(...e);J.scan=(...e)=>Me.scan(...e);J.parse=(e,t)=>{let n=[];for(let r of[].concat(e||[]))for(let i of Ks(String(r),t))n.push(Me.parse(i,t));return n};J.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Ws(e)?[e]:Ks(e,t)};J.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return J.braces(e,{...t,expand:!0})};J.hasBraces=Ws;var iy=J,_i=we&&we.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_e,"__esModule",{value:!0});_e.readPackageJSON=_e.extractWorkspaces=_e.isMatchWorkspaces=_e.checkWorkspaces=_e.findWorkspaceRoot=void 0;const Rn=_i(Se.default),oy=_i(Mm),ko=We.default,ay=_i(iy);function Ue(e){e||(e=process.cwd());let t=oy.default.sync(e);if(!t)return null;e=Rn.default.normalize(t);let n=null,r=e;do{const i=Zn(r);Xn(i);let{done:a,found:o}=zs(r,e);if(a)return o;n=r,r=Rn.default.dirname(r)}while(r!==n);return null}_e.findWorkspaceRoot=Ue;function zs(e,t){const n=Zn(e),r=Xn(n);let i=!1,a,o;return r&&(i=!0,o=Rn.default.relative(e,t),o===""||Ai(o,r)?a=e:a=null),{done:i,found:a,relativePath:o}}_e.checkWorkspaces=zs;function Ai(e,t){return ay.default([e],t).length>0}_e.isMatchWorkspaces=Ai;function Xn(e){const t=(e||{}).workspaces;return t&&t.packages||(Array.isArray(t)?t:null)}_e.extractWorkspaces=Xn;function Zn(e){const t=Rn.default.join(e,"package.json");return ko.existsSync(t)?JSON.parse(ko.readFileSync(t,"utf8")):null}_e.readPackageJSON=Zn;Ue.findWorkspaceRoot=Ue;Ue.readPackageJSON=Zn;Ue.extractWorkspaces=Xn;Ue.isMatchWorkspaces=Ai;Ue.default=Ue;_e.default=Ue;const sy=_e;sy.findWorkspaceRoot;var uy={exports:{}},Ti={exports:{}};class cy{constructor(t){this.value=t,this.next=void 0}}let ly=class{constructor(){this.clear()}enqueue(t){const n=new cy(t);this._head?(this._tail.next=n,this._tail=n):(this._head=n,this._tail=n),this._size++}dequeue(){const t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};var fy=ly;const py=fy,dy=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");const t=new py;let n=0;const r=()=>{n--,t.size>0&&t.dequeue()()},i=async(s,u,...f)=>{n++;const l=(async()=>s(...f))();u(l);try{await l}catch{}r()},a=(s,u,...f)=>{t.enqueue(i.bind(null,s,u,...f)),(async()=>(await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()))()},o=(s,...u)=>new Promise(f=>{a(s,f,...u)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),o};var hy=dy;const Do=hy;class Ys extends Error{constructor(t){super(),this.value=t}}const my=async(e,t)=>t(await e),gy=async e=>{const t=await Promise.all(e);if(t[1]===!0)throw new Ys(t[0]);return!1},yy=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};const r=Do(n.concurrency),i=[...e].map(o=>[o,r(my,o,t)]),a=Do(n.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>a(gy,o)))}catch(o){if(o instanceof Ys)return o.value;throw o}};var vy=yy;const Qs=Se.default,Fn=We.default,{promisify:Vs}=it.default,Ey=vy,wy=Vs(Fn.stat),by=Vs(Fn.lstat),Xs={directory:"isDirectory",file:"isFile"};function Zs({type:e}){if(!(e in Xs))throw new Error(`Invalid type specified: ${e}`)}const Js=(e,t)=>e===void 0||t[Xs[e]]();Ti.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},Zs(t);const n=t.allowSymlinks?wy:by;return Ey(e,async r=>{try{const i=await n(Qs.resolve(t.cwd,r));return Js(t.type,i)}catch{return!1}},t)};Ti.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},Zs(t);const n=t.allowSymlinks?Fn.statSync:Fn.lstatSync;for(const r of e)try{const i=n(Qs.resolve(t.cwd,r));if(Js(t.type,i))return r}catch{}};var Sy=Ti.exports;(function(e){const t=Se.default,n=Sy,r=Fs,i=Symbol("findUp.stop");e.exports=async(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),l=async c=>{if(typeof a!="function")return n(f,c);const p=await a(c.cwd);return typeof p=="string"?n([p],c):p};for(;;){const c=await l({...o,cwd:s});if(c===i)return;if(c)return t.resolve(s,c);if(s===u)return;s=t.dirname(s)}},e.exports.sync=(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),l=c=>{if(typeof a!="function")return n.sync(f,c);const p=a(c.cwd);return typeof p=="string"?n.sync([p],c):p};for(;;){const c=l({...o,cwd:s});if(c===i)return;if(c)return t.resolve(s,c);if(s===u)return;s=t.dirname(s)}},e.exports.exists=r,e.exports.sync.exists=r.sync,e.exports.stop=i})(uy);var eu={exports:{}},Ge=pc.default,xy=process.cwd,sn=null,_y=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return sn||(sn=xy.call(process)),sn};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var Mo=process.chdir;process.chdir=function(e){sn=null,Mo.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Mo)}var Ay=Ty;function Ty(e){Ge.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=a(e.chown),e.fchown=a(e.fchown),e.lchown=a(e.lchown),e.chmod=r(e.chmod),e.fchmod=r(e.fchmod),e.lchmod=r(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=i(e.chmodSync),e.fchmodSync=i(e.fchmodSync),e.lchmodSync=i(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(l,c,p){p&&process.nextTick(p)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(l,c,p,d){d&&process.nextTick(d)},e.lchownSync=function(){}),_y==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(l){function c(p,d,h){var m=Date.now(),g=0;l(p,d,function b(S){if(S&&(S.code==="EACCES"||S.code==="EPERM"||S.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){e.stat(d,function(T,A){T&&T.code==="ENOENT"?l(p,d,b):h(S)})},g),g<100&&(g+=10);return}h&&h(S)})}return Object.setPrototypeOf&&Object.setPrototypeOf(c,l),c}(e.rename)),e.read=typeof e.read!="function"?e.read:function(l){function c(p,d,h,m,g,b){var S;if(b&&typeof b=="function"){var T=0;S=function(A,C,F){if(A&&A.code==="EAGAIN"&&T<10)return T++,l.call(e,p,d,h,m,g,S);b.apply(this,arguments)}}return l.call(e,p,d,h,m,g,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(c,l),c}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(l){return function(c,p,d,h,m){for(var g=0;;)try{return l.call(e,c,p,d,h,m)}catch(b){if(b.code==="EAGAIN"&&g<10){g++;continue}throw b}}}(e.readSync);function t(l){l.lchmod=function(c,p,d){l.open(c,Ge.O_WRONLY|Ge.O_SYMLINK,p,function(h,m){if(h){d&&d(h);return}l.fchmod(m,p,function(g){l.close(m,function(b){d&&d(g||b)})})})},l.lchmodSync=function(c,p){var d=l.openSync(c,Ge.O_WRONLY|Ge.O_SYMLINK,p),h=!0,m;try{m=l.fchmodSync(d,p),h=!1}finally{if(h)try{l.closeSync(d)}catch{}else l.closeSync(d)}return m}}function n(l){Ge.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(c,p,d,h){l.open(c,Ge.O_SYMLINK,function(m,g){if(m){h&&h(m);return}l.futimes(g,p,d,function(b){l.close(g,function(S){h&&h(b||S)})})})},l.lutimesSync=function(c,p,d){var h=l.openSync(c,Ge.O_SYMLINK),m,g=!0;try{m=l.futimesSync(h,p,d),g=!1}finally{if(g)try{l.closeSync(h)}catch{}else l.closeSync(h)}return m}):l.futimes&&(l.lutimes=function(c,p,d,h){h&&process.nextTick(h)},l.lutimesSync=function(){})}function r(l){return l&&function(c,p,d){return l.call(e,c,p,function(h){f(h)&&(h=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(c,p){try{return l.call(e,c,p)}catch(d){if(!f(d))throw d}}}function a(l){return l&&function(c,p,d,h){return l.call(e,c,p,d,function(m){f(m)&&(m=null),h&&h.apply(this,arguments)})}}function o(l){return l&&function(c,p,d){try{return l.call(e,c,p,d)}catch(h){if(!f(h))throw h}}}function s(l){return l&&function(c,p,d){typeof p=="function"&&(d=p,p=null);function h(m,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return p?l.call(e,c,p,h):l.call(e,c,h)}}function u(l){return l&&function(c,p){var d=p?l.call(e,c,p):l.call(e,c);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function f(l){if(!l||l.code==="ENOSYS")return!0;var c=!process.getuid||process.getuid()!==0;return!!(c&&(l.code==="EINVAL"||l.code==="EPERM"))}}var jo=kn.default.Stream,Cy=Ry;function Ry(e){return{ReadStream:t,WriteStream:n};function t(r,i){if(!(this instanceof t))return new t(r,i);jo.call(this);var a=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),s=0,u=o.length;s<u;s++){var f=o[s];this[f]=i[f]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){a._read()});return}e.open(this.path,this.flags,this.mode,function(l,c){if(l){a.emit("error",l),a.readable=!1;return}a.fd=c,a.emit("open",c),a._read()})}function n(r,i){if(!(this instanceof n))return new n(r,i);jo.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var a=Object.keys(i),o=0,s=a.length;o<s;o++){var u=a[o];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}var Fy=Iy,$y=Object.getPrototypeOf||function(e){return e.__proto__};function Iy(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:$y(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}var ne=We.default,Oy=Ay,Ny=Cy,Py=Fy,Jt=it.default,pe,$n;typeof Symbol=="function"&&typeof Symbol.for=="function"?(pe=Symbol.for("graceful-fs.queue"),$n=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",$n="___graceful-fs.previous");function Ly(){}function tu(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}var Je=Ly;Jt.debuglog?Je=Jt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Je=function(){var e=Jt.format.apply(Jt,arguments);e="GFS4: "+e.split(/\n/).join(`
46
- GFS4: `),console.error(e)});if(!ne[pe]){var ky=we[pe]||[];tu(ne,ky),ne.close=function(e){function t(n,r){return e.call(ne,n,function(i){i||Ho(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(t,$n,{value:e}),t}(ne.close),ne.closeSync=function(e){function t(n){e.apply(ne,arguments),Ho()}return Object.defineProperty(t,$n,{value:e}),t}(ne.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Je(ne[pe]),da.default.equal(ne[pe].length,0)})}we[pe]||tu(we,ne[pe]);var nu=Ci(Py(ne));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ne.__patched&&(nu=Ci(ne),ne.__patched=!0);function Ci(e){Oy(e),e.gracefulify=Ci,e.createReadStream=C,e.createWriteStream=F;var t=e.readFile;e.readFile=n;function n(_,N,v){return typeof N=="function"&&(v=N,N=null),M(_,N,v);function M(H,K,E,w){return t(H,K,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?pt([M,[H,K,E],$,w||Date.now(),Date.now()]):typeof E=="function"&&E.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=i;function i(_,N,v,M){return typeof v=="function"&&(M=v,v=null),H(_,N,v,M);function H(K,E,w,$,k){return r(K,E,w,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pt([H,[K,E,w,$],U,k||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var a=e.appendFile;a&&(e.appendFile=o);function o(_,N,v,M){return typeof v=="function"&&(M=v,v=null),H(_,N,v,M);function H(K,E,w,$,k){return a(K,E,w,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pt([H,[K,E,w,$],U,k||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=u);function u(_,N,v,M){return typeof v=="function"&&(M=v,v=0),H(_,N,v,M);function H(K,E,w,$,k){return s(K,E,w,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pt([H,[K,E,w,$],U,k||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var f=e.readdir;e.readdir=c;var l=/^v[0-5]\./;function c(_,N,v){typeof N=="function"&&(v=N,N=null);var M=l.test(process.version)?function(E,w,$,k){return f(E,H(E,w,$,k))}:function(E,w,$,k){return f(E,w,H(E,w,$,k))};return M(_,N,v);function H(K,E,w,$){return function(k,U){k&&(k.code==="EMFILE"||k.code==="ENFILE")?pt([M,[K,E,w],k,$||Date.now(),Date.now()]):(U&&U.sort&&U.sort(),typeof w=="function"&&w.call(this,k,U))}}}if(process.version.substr(0,4)==="v0.8"){var p=Ny(e);b=p.ReadStream,T=p.WriteStream}var d=e.ReadStream;d&&(b.prototype=Object.create(d.prototype),b.prototype.open=S);var h=e.WriteStream;h&&(T.prototype=Object.create(h.prototype),T.prototype.open=A),Object.defineProperty(e,"ReadStream",{get:function(){return b},set:function(_){b=_},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return T},set:function(_){T=_},enumerable:!0,configurable:!0});var m=b;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(_){m=_},enumerable:!0,configurable:!0});var g=T;Object.defineProperty(e,"FileWriteStream",{get:function(){return g},set:function(_){g=_},enumerable:!0,configurable:!0});function b(_,N){return this instanceof b?(d.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function S(){var _=this;x(_.path,_.flags,_.mode,function(N,v){N?(_.autoClose&&_.destroy(),_.emit("error",N)):(_.fd=v,_.emit("open",v),_.read())})}function T(_,N){return this instanceof T?(h.apply(this,arguments),this):T.apply(Object.create(T.prototype),arguments)}function A(){var _=this;x(_.path,_.flags,_.mode,function(N,v){N?(_.destroy(),_.emit("error",N)):(_.fd=v,_.emit("open",v))})}function C(_,N){return new e.ReadStream(_,N)}function F(_,N){return new e.WriteStream(_,N)}var j=e.open;e.open=x;function x(_,N,v,M){return typeof v=="function"&&(M=v,v=null),H(_,N,v,M);function H(K,E,w,$,k){return j(K,E,w,function(U,z){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pt([H,[K,E,w,$],U,k||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}return e}function pt(e){Je("ENQUEUE",e[0].name,e[1]),ne[pe].push(e),Ri()}var en;function Ho(){for(var e=Date.now(),t=0;t<ne[pe].length;++t)ne[pe][t].length>2&&(ne[pe][t][3]=e,ne[pe][t][4]=e);Ri()}function Ri(){if(clearTimeout(en),en=void 0,ne[pe].length!==0){var e=ne[pe].shift(),t=e[0],n=e[1],r=e[2],i=e[3],a=e[4];if(i===void 0)Je("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-i>=6e4){Je("TIMEOUT",t.name,n);var o=n.pop();typeof o=="function"&&o.call(null,r)}else{var s=Date.now()-a,u=Math.max(a-i,1),f=Math.min(u*1.2,100);s>=f?(Je("RETRY",t.name,n),t.apply(null,n.concat([i]))):ne[pe].push(e)}en===void 0&&(en=setTimeout(Ri,0))}}const Bo=(e,t)=>function(...n){const r=t.promiseModule;return new r((i,a)=>{t.multiArgs?n.push((...o)=>{t.errorFirst?o[0]?a(o):(o.shift(),i(o)):i(o)}):t.errorFirst?n.push((o,s)=>{o?a(o):i(s)}):n.push(i),e.apply(this,n)})};var Dy=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const n=typeof e;if(!(e!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":n}\``);const r=a=>{const o=s=>typeof s=="string"?a===s:s.test(a);return t.include?t.include.some(o):!t.exclude.some(o)};let i;n==="function"?i=function(...a){return t.excludeMain?e(...a):Bo(e,t).apply(this,a)}:i=Object.create(Object.getPrototypeOf(e));for(const a in e){const o=e[a];i[a]=typeof o=="function"&&r(a)?Bo(o,t):o}return i},My=e=>{if(typeof e!="string")throw new TypeError("Expected a string, got "+typeof e);return e.charCodeAt(0)===65279?e.slice(1):e},ie={},Gt={},Fe={};function ru(e){return typeof e>"u"||e===null}function jy(e){return typeof e=="object"&&e!==null}function Hy(e){return Array.isArray(e)?e:ru(e)?[]:[e]}function By(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function Uy(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function Gy(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}Fe.isNothing=ru;Fe.isObject=jy;Fe.toArray=Hy;Fe.repeat=Uy;Fe.isNegativeZero=Gy;Fe.extend=By;function kt(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}kt.prototype=Object.create(Error.prototype);kt.prototype.constructor=kt;kt.prototype.toString=function(t){var n=this.name+": ";return n+=this.reason||"(unknown reason)",!t&&this.mark&&(n+=" "+this.mark.toString()),n};var qt=kt,Uo=Fe;function Fi(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}Fi.prototype.getSnippet=function(t,n){var r,i,a,o,s;if(!this.buffer)return null;for(t=t||4,n=n||75,r="",i=this.position;i>0&&`\0\r
45
+ */const Qm=it.default,Ns=Ym,So=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Vm=e=>t=>e===!0?Number(t):String(t),yr=e=>typeof e=="number"||typeof e=="string"&&e!=="",Pt=e=>Number.isInteger(+e),vr=e=>{let t=`${e}`,n=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++n]==="0";);return n>0},Xm=(e,t,n)=>typeof e=="string"||typeof t=="string"?!0:n.stringify===!0,Zm=(e,t,n)=>{if(t>0){let r=e[0]==="-"?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return n===!1?String(e):e},An=(e,t)=>{let n=e[0]==="-"?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},Jm=(e,t,n)=>{e.negatives.sort((s,u)=>s<u?-1:s>u?1:0),e.positives.sort((s,u)=>s<u?-1:s>u?1:0);let r=t.capture?"":"?:",i="",a="",o;return e.positives.length&&(i=e.positives.map(s=>An(String(s),n)).join("|")),e.negatives.length&&(a=`-(${r}${e.negatives.map(s=>An(String(s),n)).join("|")})`),i&&a?o=`${i}|${a}`:o=i||a,t.wrap?`(${r}${o})`:o},Ps=(e,t,n,r)=>{if(n)return Ns(e,t,{wrap:!1,...r});let i=String.fromCharCode(e);if(e===t)return i;let a=String.fromCharCode(t);return`[${i}-${a}]`},Ls=(e,t,n)=>{if(Array.isArray(e)){let r=n.wrap===!0,i=n.capture?"":"?:";return r?`(${i}${e.join("|")})`:e.join("|")}return Ns(e,t,n)},ks=(...e)=>new RangeError("Invalid range arguments: "+Qm.inspect(...e)),Ds=(e,t,n)=>{if(n.strictRanges===!0)throw ks([e,t]);return[]},eg=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},tg=(e,t,n=1,r={})=>{let i=Number(e),a=Number(t);if(!Number.isInteger(i)||!Number.isInteger(a)){if(r.strictRanges===!0)throw ks([e,t]);return[]}i===0&&(i=0),a===0&&(a=0);let o=i>a,s=String(e),u=String(t),f=String(n);n=Math.max(Math.abs(n),1);let l=vr(s)||vr(u)||vr(f),c=l?Math.max(s.length,u.length,f.length):0,p=l===!1&&Xm(e,t,r)===!1,d=r.transform||Vm(p);if(r.toRegex&&n===1)return Ps(An(e,c),An(t,c),!0,r);let h={negatives:[],positives:[]},m=S=>h[S<0?"negatives":"positives"].push(Math.abs(S)),g=[],b=0;for(;o?i>=a:i<=a;)r.toRegex===!0&&n>1?m(i):g.push(Zm(d(i,b),c,p)),i=o?i-n:i+n,b++;return r.toRegex===!0?n>1?Jm(h,r,c):Ls(g,null,{wrap:!1,...r}):g},ng=(e,t,n=1,r={})=>{if(!Pt(e)&&e.length>1||!Pt(t)&&t.length>1)return Ds(e,t,r);let i=r.transform||(p=>String.fromCharCode(p)),a=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),s=a>o,u=Math.min(a,o),f=Math.max(a,o);if(r.toRegex&&n===1)return Ps(u,f,!1,r);let l=[],c=0;for(;s?a>=o:a<=o;)l.push(i(a,c)),a=s?a-n:a+n,c++;return r.toRegex===!0?Ls(l,null,{wrap:!1,options:r}):l},an=(e,t,n,r={})=>{if(t==null&&yr(e))return[e];if(!yr(e)||!yr(t))return Ds(e,t,r);if(typeof n=="function")return an(e,t,1,{transform:n});if(So(n))return an(e,t,0,n);let i={...r};return i.capture===!0&&(i.wrap=!0),n=n||i.step||1,Pt(n)?Pt(e)&&Pt(t)?tg(e,t,n,i):ng(e,t,Math.max(Math.abs(n),1),i):n!=null&&!So(n)?eg(n,i):an(e,t,1,n)};var Ms=an;const rg=Ms,xo=Yn,ig=(e,t={})=>{const n=(r,i={})=>{const a=xo.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0,s=a===!0||o===!0,u=t.escapeInvalid===!0?"\\":"";let f="";if(r.isOpen===!0)return u+r.value;if(r.isClose===!0)return console.log("node.isClose",u,r.value),u+r.value;if(r.type==="open")return s?u+r.value:"(";if(r.type==="close")return s?u+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":s?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){const l=xo.reduce(r.nodes),c=rg(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(c.length!==0)return l.length>1&&c.length>1?`(${c})`:c}if(r.nodes)for(const l of r.nodes)f+=n(l,r);return f};return n(e)};var og=ig;const ag=Ms,_o=wi,vt=Yn,Qe=(e="",t="",n=!1)=>{const r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?vt.flatten(t).map(i=>`{${i}}`):t;for(const i of e)if(Array.isArray(i))for(const a of i)r.push(Qe(a,t,n));else for(let a of t)n===!0&&typeof a=="string"&&(a=`{${a}}`),r.push(Array.isArray(a)?Qe(i,a,n):i+a);return vt.flatten(r)},sg=(e,t={})=>{const n=t.rangeLimit===void 0?1e3:t.rangeLimit,r=(i,a={})=>{i.queue=[];let o=a,s=a.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,s=o.queue;if(i.invalid||i.dollar){s.push(Qe(s.pop(),_o(i,t)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){s.push(Qe(s.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){const c=vt.reduce(i.nodes);if(vt.exceedsLimit(...c,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let p=ag(...c,t);p.length===0&&(p=_o(i,t)),s.push(Qe(s.pop(),p)),i.nodes=[];return}const u=vt.encloseBrace(i);let f=i.queue,l=i;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,f=l.queue;for(let c=0;c<i.nodes.length;c++){const p=i.nodes[c];if(p.type==="comma"&&i.type==="brace"){c===1&&f.push(""),f.push("");continue}if(p.type==="close"){s.push(Qe(s.pop(),f,u));continue}if(p.value&&p.type!=="open"){f.push(Qe(f.pop(),p.value));continue}p.nodes&&r(p,i)}return f};return vt.flatten(r(e))};var ug=sg,cg={MAX_LENGTH:1e4,CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_COMMA:",",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_NO_BREAK_SPACE:" ",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SINGLE_QUOTE:"'",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const lg=wi,{MAX_LENGTH:Ao,CHAR_BACKSLASH:wr,CHAR_BACKTICK:fg,CHAR_COMMA:pg,CHAR_DOT:dg,CHAR_LEFT_PARENTHESES:hg,CHAR_RIGHT_PARENTHESES:mg,CHAR_LEFT_CURLY_BRACE:gg,CHAR_RIGHT_CURLY_BRACE:yg,CHAR_LEFT_SQUARE_BRACKET:To,CHAR_RIGHT_SQUARE_BRACKET:Co,CHAR_DOUBLE_QUOTE:vg,CHAR_SINGLE_QUOTE:wg,CHAR_NO_BREAK_SPACE:Eg,CHAR_ZERO_WIDTH_NOBREAK_SPACE:bg}=cg,Sg=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");const n=t||{},r=typeof n.maxLength=="number"?Math.min(Ao,n.maxLength):Ao;if(e.length>r)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${r})`);const i={type:"root",input:e,nodes:[]},a=[i];let o=i,s=i,u=0;const f=e.length;let l=0,c=0,p;const d=()=>e[l++],h=m=>{if(m.type==="text"&&s.type==="dot"&&(s.type="text"),s&&s.type==="text"&&m.type==="text"){s.value+=m.value;return}return o.nodes.push(m),m.parent=o,m.prev=s,s=m,m};for(h({type:"bos"});l<f;)if(o=a[a.length-1],p=d(),!(p===bg||p===Eg)){if(p===wr){h({type:"text",value:(t.keepEscaping?p:"")+d()});continue}if(p===Co){h({type:"text",value:"\\"+p});continue}if(p===To){u++;let m;for(;l<f&&(m=d());){if(p+=m,m===To){u++;continue}if(m===wr){p+=d();continue}if(m===Co&&(u--,u===0))break}h({type:"text",value:p});continue}if(p===hg){o=h({type:"paren",nodes:[]}),a.push(o),h({type:"text",value:p});continue}if(p===mg){if(o.type!=="paren"){h({type:"text",value:p});continue}o=a.pop(),h({type:"text",value:p}),o=a[a.length-1];continue}if(p===vg||p===wg||p===fg){const m=p;let g;for(t.keepQuotes!==!0&&(p="");l<f&&(g=d());){if(g===wr){p+=g+d();continue}if(g===m){t.keepQuotes===!0&&(p+=g);break}p+=g}h({type:"text",value:p});continue}if(p===gg){c++;const g={type:"brace",open:!0,close:!1,dollar:s.value&&s.value.slice(-1)==="$"||o.dollar===!0,depth:c,commas:0,ranges:0,nodes:[]};o=h(g),a.push(o),h({type:"open",value:p});continue}if(p===yg){if(o.type!=="brace"){h({type:"text",value:p});continue}const m="close";o=a.pop(),o.close=!0,h({type:m,value:p}),c--,o=a[a.length-1];continue}if(p===pg&&c>0){if(o.ranges>0){o.ranges=0;const m=o.nodes.shift();o.nodes=[m,{type:"text",value:lg(o)}]}h({type:"comma",value:p}),o.commas++;continue}if(p===dg&&c>0&&o.commas===0){const m=o.nodes;if(c===0||m.length===0){h({type:"text",value:p});continue}if(s.type==="dot"){if(o.range=[],s.value+=p,s.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,s.type="text";continue}o.ranges++,o.args=[];continue}if(s.type==="range"){m.pop();const g=m[m.length-1];g.value+=s.value+p,s=g,o.ranges--;continue}h({type:"dot",value:p});continue}h({type:"text",value:p})}do if(o=a.pop(),o.type!=="root"){o.nodes.forEach(b=>{b.nodes||(b.type==="open"&&(b.isOpen=!0),b.type==="close"&&(b.isClose=!0),b.nodes||(b.type="text"),b.invalid=!0)});const m=a[a.length-1],g=m.nodes.indexOf(o);m.nodes.splice(g,1,...o.nodes)}while(a.length>0);return h({type:"eos"}),i};var xg=Sg;const Ro=wi,_g=og,Ag=ug,Tg=xg,Ae=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const i=Ae.create(r,t);Array.isArray(i)?n.push(...i):n.push(i)}else n=[].concat(Ae.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};Ae.parse=(e,t={})=>Tg(e,t);Ae.stringify=(e,t={})=>Ro(typeof e=="string"?Ae.parse(e,t):e,t);Ae.compile=(e,t={})=>(typeof e=="string"&&(e=Ae.parse(e,t)),_g(e,t));Ae.expand=(e,t={})=>{typeof e=="string"&&(e=Ae.parse(e,t));let n=Ag(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n};Ae.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Ae.compile(e,t):Ae.expand(e,t);var Cg=Ae,Ut={};const Rg=Se.default,Pe="\\\\/",Fo=`[^${Pe}]`,He="\\.",Fg="\\+",$g="\\?",Qn="\\/",Ig="(?=.)",js="[^/]",Ei=`(?:${Qn}|$)`,Hs=`(?:^|${Qn})`,bi=`${He}{1,2}${Ei}`,Og=`(?!${He})`,Ng=`(?!${Hs}${bi})`,Pg=`(?!${He}{0,1}${Ei})`,Lg=`(?!${bi})`,kg=`[^.${Qn}]`,Dg=`${js}*?`,Bs={DOT_LITERAL:He,PLUS_LITERAL:Fg,QMARK_LITERAL:$g,SLASH_LITERAL:Qn,ONE_CHAR:Ig,QMARK:js,END_ANCHOR:Ei,DOTS_SLASH:bi,NO_DOT:Og,NO_DOTS:Ng,NO_DOT_SLASH:Pg,NO_DOTS_SLASH:Lg,QMARK_NO_DOT:kg,STAR:Dg,START_ANCHOR:Hs},Mg={...Bs,SLASH_LITERAL:`[${Pe}]`,QMARK:Fo,STAR:`${Fo}*?`,DOTS_SLASH:`${He}{1,2}(?:[${Pe}]|$)`,NO_DOT:`(?!${He})`,NO_DOTS:`(?!(?:^|[${Pe}])${He}{1,2}(?:[${Pe}]|$))`,NO_DOT_SLASH:`(?!${He}{0,1}(?:[${Pe}]|$))`,NO_DOTS_SLASH:`(?!${He}{1,2}(?:[${Pe}]|$))`,QMARK_NO_DOT:`[^.${Pe}]`,START_ANCHOR:`(?:^|[${Pe}])`,END_ANCHOR:`(?:[${Pe}]|$)`},jg={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};var Vn={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:jg,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Rg.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Mg:Bs}};(function(e){const t=Se.default,n=process.platform==="win32",{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:o}=Vn;e.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),e.hasRegexChars=s=>a.test(s),e.isRegexChar=s=>s.length===1&&e.hasRegexChars(s),e.escapeRegex=s=>s.replace(o,"\\$1"),e.toPosixSlashes=s=>s.replace(r,"/"),e.removeBackslashes=s=>s.replace(i,u=>u==="\\"?"":u),e.supportsLookbehinds=()=>{const s=process.version.slice(1).split(".").map(Number);return s.length===3&&s[0]>=9||s[0]===8&&s[1]>=10},e.isWindows=s=>s&&typeof s.windows=="boolean"?s.windows:n===!0||t.sep==="\\",e.escapeLast=(s,u,f)=>{const l=s.lastIndexOf(u,f);return l===-1?s:s[l-1]==="\\"?e.escapeLast(s,u,l-1):`${s.slice(0,l)}\\${s.slice(l)}`},e.removePrefix=(s,u={})=>{let f=s;return f.startsWith("./")&&(f=f.slice(2),u.prefix="./"),f},e.wrapOutput=(s,u={},f={})=>{const l=f.contains?"":"^",c=f.contains?"":"$";let p=`${l}(?:${s})${c}`;return u.negated===!0&&(p=`(?:^(?!${p}).*$)`),p}})(Ut);const $o=Ut,{CHAR_ASTERISK:Er,CHAR_AT:Hg,CHAR_BACKWARD_SLASH:Ot,CHAR_COMMA:Bg,CHAR_DOT:br,CHAR_EXCLAMATION_MARK:Sr,CHAR_FORWARD_SLASH:Us,CHAR_LEFT_CURLY_BRACE:xr,CHAR_LEFT_PARENTHESES:_r,CHAR_LEFT_SQUARE_BRACKET:Ug,CHAR_PLUS:Gg,CHAR_QUESTION_MARK:Io,CHAR_RIGHT_CURLY_BRACE:qg,CHAR_RIGHT_PARENTHESES:Oo,CHAR_RIGHT_SQUARE_BRACKET:Kg}=Vn,No=e=>e===Us||e===Ot,Po=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},Wg=(e,t)=>{const n=t||{},r=e.length-1,i=n.parts===!0||n.scanToEnd===!0,a=[],o=[],s=[];let u=e,f=-1,l=0,c=0,p=!1,d=!1,h=!1,m=!1,g=!1,b=!1,S=!1,T=!1,A=!1,R=!1,F=0,D,x,_={value:"",depth:0,isGlob:!1};const N=()=>f>=r,v=()=>u.charCodeAt(f+1),j=()=>(D=x,u.charCodeAt(++f));for(;f<r;){x=j();let $;if(x===Ot){S=_.backslashes=!0,x=j(),x===xr&&(b=!0);continue}if(b===!0||x===xr){for(F++;N()!==!0&&(x=j());){if(x===Ot){S=_.backslashes=!0,j();continue}if(x===xr){F++;continue}if(b!==!0&&x===br&&(x=j())===br){if(p=_.isBrace=!0,h=_.isGlob=!0,R=!0,i===!0)continue;break}if(b!==!0&&x===Bg){if(p=_.isBrace=!0,h=_.isGlob=!0,R=!0,i===!0)continue;break}if(x===qg&&(F--,F===0)){b=!1,p=_.isBrace=!0,R=!0;break}}if(i===!0)continue;break}if(x===Us){if(a.push(f),o.push(_),_={value:"",depth:0,isGlob:!1},R===!0)continue;if(D===br&&f===l+1){l+=2;continue}c=f+1;continue}if(n.noext!==!0&&(x===Gg||x===Hg||x===Er||x===Io||x===Sr)===!0&&v()===_r){if(h=_.isGlob=!0,m=_.isExtglob=!0,R=!0,x===Sr&&f===l&&(A=!0),i===!0){for(;N()!==!0&&(x=j());){if(x===Ot){S=_.backslashes=!0,x=j();continue}if(x===Oo){h=_.isGlob=!0,R=!0;break}}continue}break}if(x===Er){if(D===Er&&(g=_.isGlobstar=!0),h=_.isGlob=!0,R=!0,i===!0)continue;break}if(x===Io){if(h=_.isGlob=!0,R=!0,i===!0)continue;break}if(x===Ug){for(;N()!==!0&&($=j());){if($===Ot){S=_.backslashes=!0,j();continue}if($===Kg){d=_.isBracket=!0,h=_.isGlob=!0,R=!0;break}}if(i===!0)continue;break}if(n.nonegate!==!0&&x===Sr&&f===l){T=_.negated=!0,l++;continue}if(n.noparen!==!0&&x===_r){if(h=_.isGlob=!0,i===!0){for(;N()!==!0&&(x=j());){if(x===_r){S=_.backslashes=!0,x=j();continue}if(x===Oo){R=!0;break}}continue}break}if(h===!0){if(R=!0,i===!0)continue;break}}n.noext===!0&&(m=!1,h=!1);let H=u,K="",w="";l>0&&(K=u.slice(0,l),u=u.slice(l),c-=l),H&&h===!0&&c>0?(H=u.slice(0,c),w=u.slice(c)):h===!0?(H="",w=u):H=u,H&&H!==""&&H!=="/"&&H!==u&&No(H.charCodeAt(H.length-1))&&(H=H.slice(0,-1)),n.unescape===!0&&(w&&(w=$o.removeBackslashes(w)),H&&S===!0&&(H=$o.removeBackslashes(H)));const E={prefix:K,input:e,start:l,base:H,glob:w,isBrace:p,isBracket:d,isGlob:h,isExtglob:m,isGlobstar:g,negated:T,negatedExtglob:A};if(n.tokens===!0&&(E.maxDepth=0,No(x)||o.push(_),E.tokens=o),n.parts===!0||n.tokens===!0){let $;for(let k=0;k<a.length;k++){const U=$?$+1:l,z=a[k],V=e.slice(U,z);n.tokens&&(k===0&&l!==0?(o[k].isPrefix=!0,o[k].value=K):o[k].value=V,Po(o[k]),E.maxDepth+=o[k].depth),(k!==0||V!=="")&&s.push(V),$=z}if($&&$+1<e.length){const k=e.slice($+1);s.push(k),n.tokens&&(o[o.length-1].value=k,Po(o[o.length-1]),E.maxDepth+=o[o.length-1].depth)}E.slashes=a,E.parts=s}return E};var zg=Wg;const Tn=Vn,xe=Ut,{MAX_LENGTH:Cn,POSIX_REGEX_SOURCE:Yg,REGEX_NON_SPECIAL_CHARS:Qg,REGEX_SPECIAL_CHARS_BACKREF:Vg,REPLACEMENTS:Gs}=Tn,Xg=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch{return e.map(i=>xe.escapeRegex(i)).join("..")}return n},ft=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Si=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=Gs[e]||e;const n={...t},r=typeof n.maxLength=="number"?Math.min(Cn,n.maxLength):Cn;let i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);const a={type:"bos",value:"",output:n.prepend||""},o=[a],s=n.capture?"":"?:",u=xe.isWindows(t),f=Tn.globChars(u),l=Tn.extglobChars(f),{DOT_LITERAL:c,PLUS_LITERAL:p,SLASH_LITERAL:d,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:b,NO_DOTS_SLASH:S,QMARK:T,QMARK_NO_DOT:A,STAR:R,START_ANCHOR:F}=f,D=L=>`(${s}(?:(?!${F}${L.dot?m:c}).)*?)`,x=n.dot?"":g,_=n.dot?T:A;let N=n.bash===!0?D(n):R;n.capture&&(N=`(${N})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);const v={input:e,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=xe.removePrefix(e,v),i=e.length;const j=[],H=[],K=[];let w=a,E;const $=()=>v.index===i-1,k=v.peek=(L=1)=>e[v.index+L],U=v.advance=()=>e[++v.index]||"",z=()=>e.slice(v.index+1),V=(L="",Y=0)=>{v.consumed+=L,v.index+=Y},ee=L=>{v.output+=L.output!=null?L.output:L.value,V(L.value)},Te=()=>{let L=1;for(;k()==="!"&&(k(2)!=="("||k(3)==="?");)U(),v.start++,L++;return L%2===0?!1:(v.negated=!0,v.start++,!0)},I=L=>{v[L]++,K.push(L)},M=L=>{v[L]--,K.pop()},P=L=>{if(w.type==="globstar"){const Y=v.braces>0&&(L.type==="comma"||L.type==="brace"),O=L.extglob===!0||j.length&&(L.type==="pipe"||L.type==="paren");L.type!=="slash"&&L.type!=="paren"&&!Y&&!O&&(v.output=v.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=N,v.output+=w.output)}if(j.length&&L.type!=="paren"&&(j[j.length-1].inner+=L.value),(L.value||L.output)&&ee(L),w&&w.type==="text"&&L.type==="text"){w.value+=L.value,w.output=(w.output||"")+L.value;return}L.prev=w,o.push(L),w=L},Q=(L,Y)=>{const O={...l[Y],conditions:1,inner:""};O.prev=w,O.parens=v.parens,O.output=v.output;const q=(n.capture?"(":"")+O.open;I("parens"),P({type:L,value:Y,output:v.output?"":h}),P({type:"paren",extglob:!0,value:U(),output:q}),j.push(O)},ce=L=>{let Y=L.close+(n.capture?")":""),O;if(L.type==="negate"){let q=N;if(L.inner&&L.inner.length>1&&L.inner.includes("/")&&(q=D(n)),(q!==N||$()||/^\)+$/.test(z()))&&(Y=L.close=`)$))${q}`),L.inner.includes("*")&&(O=z())&&/^\.[^\\/.]+$/.test(O)){const X=Si(O,{...t,fastpaths:!1}).output;Y=L.close=`)${X})${q})`}L.prev.type==="bos"&&(v.negatedExtglob=!0)}P({type:"paren",extglob:!0,value:E,output:Y}),M("parens")};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let L=!1,Y=e.replace(Vg,(O,q,X,oe,Z,Ne)=>oe==="\\"?(L=!0,O):oe==="?"?q?q+oe+(Z?T.repeat(Z.length):""):Ne===0?_+(Z?T.repeat(Z.length):""):T.repeat(X.length):oe==="."?c.repeat(X.length):oe==="*"?q?q+oe+(Z?N:""):N:q?O:`\\${O}`);return L===!0&&(n.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,O=>O.length%2===0?"\\\\":O?"\\":"")),Y===e&&n.contains===!0?(v.output=e,v):(v.output=xe.wrapOutput(Y,v,t),v)}for(;!$();){if(E=U(),E==="\0")continue;if(E==="\\"){const O=k();if(O==="/"&&n.bash!==!0||O==="."||O===";")continue;if(!O){E+="\\",P({type:"text",value:E});continue}const q=/^\\+/.exec(z());let X=0;if(q&&q[0].length>2&&(X=q[0].length,v.index+=X,X%2!==0&&(E+="\\")),n.unescape===!0?E=U():E+=U(),v.brackets===0){P({type:"text",value:E});continue}}if(v.brackets>0&&(E!=="]"||w.value==="["||w.value==="[^")){if(n.posix!==!1&&E===":"){const O=w.value.slice(1);if(O.includes("[")&&(w.posix=!0,O.includes(":"))){const q=w.value.lastIndexOf("["),X=w.value.slice(0,q),oe=w.value.slice(q+2),Z=Yg[oe];if(Z){w.value=X+Z,v.backtrack=!0,U(),!a.output&&o.indexOf(w)===1&&(a.output=h);continue}}}(E==="["&&k()!==":"||E==="-"&&k()==="]")&&(E=`\\${E}`),E==="]"&&(w.value==="["||w.value==="[^")&&(E=`\\${E}`),n.posix===!0&&E==="!"&&w.value==="["&&(E="^"),w.value+=E,ee({value:E});continue}if(v.quotes===1&&E!=='"'){E=xe.escapeRegex(E),w.value+=E,ee({value:E});continue}if(E==='"'){v.quotes=v.quotes===1?0:1,n.keepQuotes===!0&&P({type:"text",value:E});continue}if(E==="("){I("parens"),P({type:"paren",value:E});continue}if(E===")"){if(v.parens===0&&n.strictBrackets===!0)throw new SyntaxError(ft("opening","("));const O=j[j.length-1];if(O&&v.parens===O.parens+1){ce(j.pop());continue}P({type:"paren",value:E,output:v.parens?")":"\\)"}),M("parens");continue}if(E==="["){if(n.nobracket===!0||!z().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(ft("closing","]"));E=`\\${E}`}else I("brackets");P({type:"bracket",value:E});continue}if(E==="]"){if(n.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){P({type:"text",value:E,output:`\\${E}`});continue}if(v.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(ft("opening","["));P({type:"text",value:E,output:`\\${E}`});continue}M("brackets");const O=w.value.slice(1);if(w.posix!==!0&&O[0]==="^"&&!O.includes("/")&&(E=`/${E}`),w.value+=E,ee({value:E}),n.literalBrackets===!1||xe.hasRegexChars(O))continue;const q=xe.escapeRegex(w.value);if(v.output=v.output.slice(0,-w.value.length),n.literalBrackets===!0){v.output+=q,w.value=q;continue}w.value=`(${s}${q}|${w.value})`,v.output+=w.value;continue}if(E==="{"&&n.nobrace!==!0){I("braces");const O={type:"brace",value:E,output:"(",outputIndex:v.output.length,tokensIndex:v.tokens.length};H.push(O),P(O);continue}if(E==="}"){const O=H[H.length-1];if(n.nobrace===!0||!O){P({type:"text",value:E,output:E});continue}let q=")";if(O.dots===!0){const X=o.slice(),oe=[];for(let Z=X.length-1;Z>=0&&(o.pop(),X[Z].type!=="brace");Z--)X[Z].type!=="dots"&&oe.unshift(X[Z].value);q=Xg(oe,n),v.backtrack=!0}if(O.comma!==!0&&O.dots!==!0){const X=v.output.slice(0,O.outputIndex),oe=v.tokens.slice(O.tokensIndex);O.value=O.output="\\{",E=q="\\}",v.output=X;for(const Z of oe)v.output+=Z.output||Z.value}P({type:"brace",value:E,output:q}),M("braces"),H.pop();continue}if(E==="|"){j.length>0&&j[j.length-1].conditions++,P({type:"text",value:E});continue}if(E===","){let O=E;const q=H[H.length-1];q&&K[K.length-1]==="braces"&&(q.comma=!0,O="|"),P({type:"comma",value:E,output:O});continue}if(E==="/"){if(w.type==="dot"&&v.index===v.start+1){v.start=v.index+1,v.consumed="",v.output="",o.pop(),w=a;continue}P({type:"slash",value:E,output:d});continue}if(E==="."){if(v.braces>0&&w.type==="dot"){w.value==="."&&(w.output=c);const O=H[H.length-1];w.type="dots",w.output+=E,w.value+=E,O.dots=!0;continue}if(v.braces+v.parens===0&&w.type!=="bos"&&w.type!=="slash"){P({type:"text",value:E,output:c});continue}P({type:"dot",value:E,output:c});continue}if(E==="?"){if(!(w&&w.value==="(")&&n.noextglob!==!0&&k()==="("&&k(2)!=="?"){Q("qmark",E);continue}if(w&&w.type==="paren"){const q=k();let X=E;if(q==="<"&&!xe.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(w.value==="("&&!/[!=<:]/.test(q)||q==="<"&&!/<([!=]|\w+>)/.test(z()))&&(X=`\\${E}`),P({type:"text",value:E,output:X});continue}if(n.dot!==!0&&(w.type==="slash"||w.type==="bos")){P({type:"qmark",value:E,output:A});continue}P({type:"qmark",value:E,output:T});continue}if(E==="!"){if(n.noextglob!==!0&&k()==="("&&(k(2)!=="?"||!/[!=<:]/.test(k(3)))){Q("negate",E);continue}if(n.nonegate!==!0&&v.index===0){Te();continue}}if(E==="+"){if(n.noextglob!==!0&&k()==="("&&k(2)!=="?"){Q("plus",E);continue}if(w&&w.value==="("||n.regex===!1){P({type:"plus",value:E,output:p});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||v.parens>0){P({type:"plus",value:E});continue}P({type:"plus",value:p});continue}if(E==="@"){if(n.noextglob!==!0&&k()==="("&&k(2)!=="?"){P({type:"at",extglob:!0,value:E,output:""});continue}P({type:"text",value:E});continue}if(E!=="*"){(E==="$"||E==="^")&&(E=`\\${E}`);const O=Qg.exec(z());O&&(E+=O[0],v.index+=O[0].length),P({type:"text",value:E});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=E,w.output=N,v.backtrack=!0,v.globstar=!0,V(E);continue}let L=z();if(n.noextglob!==!0&&/^\([^?]/.test(L)){Q("star",E);continue}if(w.type==="star"){if(n.noglobstar===!0){V(E);continue}const O=w.prev,q=O.prev,X=O.type==="slash"||O.type==="bos",oe=q&&(q.type==="star"||q.type==="globstar");if(n.bash===!0&&(!X||L[0]&&L[0]!=="/")){P({type:"star",value:E,output:""});continue}const Z=v.braces>0&&(O.type==="comma"||O.type==="brace"),Ne=j.length&&(O.type==="pipe"||O.type==="paren");if(!X&&O.type!=="paren"&&!Z&&!Ne){P({type:"star",value:E,output:""});continue}for(;L.slice(0,3)==="/**";){const je=e[v.index+4];if(je&&je!=="/")break;L=L.slice(3),V("/**",3)}if(O.type==="bos"&&$()){w.type="globstar",w.value+=E,w.output=D(n),v.output=w.output,v.globstar=!0,V(E);continue}if(O.type==="slash"&&O.prev.type!=="bos"&&!oe&&$()){v.output=v.output.slice(0,-(O.output+w.output).length),O.output=`(?:${O.output}`,w.type="globstar",w.output=D(n)+(n.strictSlashes?")":"|$)"),w.value+=E,v.globstar=!0,v.output+=O.output+w.output,V(E);continue}if(O.type==="slash"&&O.prev.type!=="bos"&&L[0]==="/"){const je=L[1]!==void 0?"|$":"";v.output=v.output.slice(0,-(O.output+w.output).length),O.output=`(?:${O.output}`,w.type="globstar",w.output=`${D(n)}${d}|${d}${je})`,w.value+=E,v.output+=O.output+w.output,v.globstar=!0,V(E+U()),P({type:"slash",value:"/",output:""});continue}if(O.type==="bos"&&L[0]==="/"){w.type="globstar",w.value+=E,w.output=`(?:^|${d}|${D(n)}${d})`,v.output=w.output,v.globstar=!0,V(E+U()),P({type:"slash",value:"/",output:""});continue}v.output=v.output.slice(0,-w.output.length),w.type="globstar",w.output=D(n),w.value+=E,v.output+=w.output,v.globstar=!0,V(E);continue}const Y={type:"star",value:E,output:N};if(n.bash===!0){Y.output=".*?",(w.type==="bos"||w.type==="slash")&&(Y.output=x+Y.output),P(Y);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&n.regex===!0){Y.output=E,P(Y);continue}(v.index===v.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?(v.output+=b,w.output+=b):n.dot===!0?(v.output+=S,w.output+=S):(v.output+=x,w.output+=x),k()!=="*"&&(v.output+=h,w.output+=h)),P(Y)}for(;v.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(ft("closing","]"));v.output=xe.escapeLast(v.output,"["),M("brackets")}for(;v.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(ft("closing",")"));v.output=xe.escapeLast(v.output,"("),M("parens")}for(;v.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(ft("closing","}"));v.output=xe.escapeLast(v.output,"{"),M("braces")}if(n.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&P({type:"maybe_slash",value:"",output:`${d}?`}),v.backtrack===!0){v.output="";for(const L of v.tokens)v.output+=L.output!=null?L.output:L.value,L.suffix&&(v.output+=L.suffix)}return v};Si.fastpaths=(e,t)=>{const n={...t},r=typeof n.maxLength=="number"?Math.min(Cn,n.maxLength):Cn,i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);e=Gs[e]||e;const a=xe.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:u,DOTS_SLASH:f,NO_DOT:l,NO_DOTS:c,NO_DOTS_SLASH:p,STAR:d,START_ANCHOR:h}=Tn.globChars(a),m=n.dot?c:l,g=n.dot?p:l,b=n.capture?"":"?:",S={negated:!1,prefix:""};let T=n.bash===!0?".*?":d;n.capture&&(T=`(${T})`);const A=x=>x.noglobstar===!0?T:`(${b}(?:(?!${h}${x.dot?f:o}).)*?)`,R=x=>{switch(x){case"*":return`${m}${u}${T}`;case".*":return`${o}${u}${T}`;case"*.*":return`${m}${T}${o}${u}${T}`;case"*/*":return`${m}${T}${s}${u}${g}${T}`;case"**":return m+A(n);case"**/*":return`(?:${m}${A(n)}${s})?${g}${u}${T}`;case"**/*.*":return`(?:${m}${A(n)}${s})?${g}${T}${o}${u}${T}`;case"**/.*":return`(?:${m}${A(n)}${s})?${o}${u}${T}`;default:{const _=/^(.*?)\.(\w+)$/.exec(x);if(!_)return;const N=R(_[1]);return N?N+o+_[2]:void 0}}},F=xe.removePrefix(e,S);let D=R(F);return D&&n.strictSlashes!==!0&&(D+=`${s}?`),D};var Zg=Si;const Jg=Se.default,ey=zg,qr=Zg,xi=Ut,ty=Vn,ny=e=>e&&typeof e=="object"&&!Array.isArray(e),ae=(e,t,n=!1)=>{if(Array.isArray(e)){const l=e.map(p=>ae(p,t,n));return p=>{for(const d of l){const h=d(p);if(h)return h}return!1}}const r=ny(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},a=xi.isWindows(t),o=r?ae.compileRe(e,t):ae.makeRe(e,t,!1,!0),s=o.state;delete o.state;let u=()=>!1;if(i.ignore){const l={...t,ignore:null,onMatch:null,onResult:null};u=ae(i.ignore,l,n)}const f=(l,c=!1)=>{const{isMatch:p,match:d,output:h}=ae.test(l,o,t,{glob:e,posix:a}),m={glob:e,state:s,regex:o,posix:a,input:l,output:h,match:d,isMatch:p};return typeof i.onResult=="function"&&i.onResult(m),p===!1?(m.isMatch=!1,c?m:!1):u(l)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,c?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),c?m:!0)};return n&&(f.state=s),f};ae.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};const a=n||{},o=a.format||(i?xi.toPosixSlashes:null);let s=e===r,u=s&&o?o(e):e;return s===!1&&(u=o?o(e):e,s=u===r),(s===!1||a.capture===!0)&&(a.matchBase===!0||a.basename===!0?s=ae.matchBase(e,t,n,i):s=t.exec(u)),{isMatch:!!s,match:s,output:u}};ae.matchBase=(e,t,n,r=xi.isWindows(n))=>(t instanceof RegExp?t:ae.makeRe(t,n)).test(Jg.basename(e));ae.isMatch=(e,t,n)=>ae(t,n)(e);ae.parse=(e,t)=>Array.isArray(e)?e.map(n=>ae.parse(n,t)):qr(e,{...t,fastpaths:!1});ae.scan=(e,t)=>ey(e,t);ae.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;const i=t||{},a=i.contains?"":"^",o=i.contains?"":"$";let s=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(s=`^(?!${s}).*$`);const u=ae.toRegex(s,t);return r===!0&&(u.state=e),u};ae.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(i.output=qr.fastpaths(e,t)),i.output||(i=qr(e,t)),ae.compileRe(i,t,n,r)};ae.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(n){if(t&&t.debug===!0)throw n;return/$^/}};ae.constants=ty;var ry=ae,iy=ry;const qs=it.default,Ks=Cg,Me=iy,Kr=Ut,Lo=e=>e===""||e==="./",Ws=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},J=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,i=new Set,a=new Set,o=0,s=l=>{a.add(l.output),n&&n.onResult&&n.onResult(l)};for(let l=0;l<t.length;l++){let c=Me(String(t[l]),{...n,onResult:s},!0),p=c.state.negated||c.state.negatedExtglob;p&&o++;for(let d of e){let h=c(d,!0);(p?!h.isMatch:h.isMatch)&&(p?r.add(h.output):(r.delete(h.output),i.add(h.output)))}}let f=(o===t.length?[...a]:[...i]).filter(l=>!r.has(l));if(n&&f.length===0){if(n.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(l=>l.replace(/\\/g,"")):t}return f};J.match=J;J.matcher=(e,t)=>Me(e,t);J.isMatch=(e,t,n)=>Me(t,n)(e);J.any=J.isMatch;J.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],a=s=>{n.onResult&&n.onResult(s),i.push(s.output)},o=new Set(J(e,t,{...n,onResult:a}));for(let s of i)o.has(s)||r.add(s);return[...r]};J.contains=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${qs.inspect(e)}"`);if(Array.isArray(t))return t.some(r=>J.contains(e,r,n));if(typeof t=="string"){if(Lo(e)||Lo(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return J.isMatch(e,t,{...n,contains:!0})};J.matchKeys=(e,t,n)=>{if(!Kr.isObject(e))throw new TypeError("Expected the first argument to be an object");let r=J(Object.keys(e),t,n),i={};for(let a of r)i[a]=e[a];return i};J.some=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let a=Me(String(i),n);if(r.some(o=>a(o)))return!0}return!1};J.every=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let a=Me(String(i),n);if(!r.every(o=>a(o)))return!1}return!0};J.all=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${qs.inspect(e)}"`);return[].concat(t).every(r=>Me(r,n)(e))};J.capture=(e,t,n)=>{let r=Kr.isWindows(n),a=Me.makeRe(String(e),{...n,capture:!0}).exec(r?Kr.toPosixSlashes(t):t);if(a)return a.slice(1).map(o=>o===void 0?"":o)};J.makeRe=(...e)=>Me.makeRe(...e);J.scan=(...e)=>Me.scan(...e);J.parse=(e,t)=>{let n=[];for(let r of[].concat(e||[]))for(let i of Ks(String(r),t))n.push(Me.parse(i,t));return n};J.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Ws(e)?[e]:Ks(e,t)};J.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return J.braces(e,{...t,expand:!0})};J.hasBraces=Ws;var oy=J,_i=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_e,"__esModule",{value:!0});_e.readPackageJSON=_e.extractWorkspaces=_e.isMatchWorkspaces=_e.checkWorkspaces=_e.findWorkspaceRoot=void 0;const Rn=_i(Se.default),ay=_i(jm),ko=We.default,sy=_i(oy);function Ue(e){e||(e=process.cwd());let t=ay.default.sync(e);if(!t)return null;e=Rn.default.normalize(t);let n=null,r=e;do{const i=Zn(r);Xn(i);let{done:a,found:o}=zs(r,e);if(a)return o;n=r,r=Rn.default.dirname(r)}while(r!==n);return null}_e.findWorkspaceRoot=Ue;function zs(e,t){const n=Zn(e),r=Xn(n);let i=!1,a,o;return r&&(i=!0,o=Rn.default.relative(e,t),o===""||Ai(o,r)?a=e:a=null),{done:i,found:a,relativePath:o}}_e.checkWorkspaces=zs;function Ai(e,t){return sy.default([e],t).length>0}_e.isMatchWorkspaces=Ai;function Xn(e){const t=(e||{}).workspaces;return t&&t.packages||(Array.isArray(t)?t:null)}_e.extractWorkspaces=Xn;function Zn(e){const t=Rn.default.join(e,"package.json");return ko.existsSync(t)?JSON.parse(ko.readFileSync(t,"utf8")):null}_e.readPackageJSON=Zn;Ue.findWorkspaceRoot=Ue;Ue.readPackageJSON=Zn;Ue.extractWorkspaces=Xn;Ue.isMatchWorkspaces=Ai;Ue.default=Ue;_e.default=Ue;const uy=_e;uy.findWorkspaceRoot;var cy={exports:{}},Ti={exports:{}};class ly{constructor(t){this.value=t,this.next=void 0}}let fy=class{constructor(){this.clear()}enqueue(t){const n=new ly(t);this._head?(this._tail.next=n,this._tail=n):(this._head=n,this._tail=n),this._size++}dequeue(){const t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};var py=fy;const dy=py,hy=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");const t=new dy;let n=0;const r=()=>{n--,t.size>0&&t.dequeue()()},i=async(s,u,...f)=>{n++;const l=(async()=>s(...f))();u(l);try{await l}catch{}r()},a=(s,u,...f)=>{t.enqueue(i.bind(null,s,u,...f)),(async()=>(await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()))()},o=(s,...u)=>new Promise(f=>{a(s,f,...u)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),o};var my=hy;const Do=my;class Ys extends Error{constructor(t){super(),this.value=t}}const gy=async(e,t)=>t(await e),yy=async e=>{const t=await Promise.all(e);if(t[1]===!0)throw new Ys(t[0]);return!1},vy=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};const r=Do(n.concurrency),i=[...e].map(o=>[o,r(gy,o,t)]),a=Do(n.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>a(yy,o)))}catch(o){if(o instanceof Ys)return o.value;throw o}};var wy=vy;const Qs=Se.default,Fn=We.default,{promisify:Vs}=it.default,Ey=wy,by=Vs(Fn.stat),Sy=Vs(Fn.lstat),Xs={directory:"isDirectory",file:"isFile"};function Zs({type:e}){if(!(e in Xs))throw new Error(`Invalid type specified: ${e}`)}const Js=(e,t)=>e===void 0||t[Xs[e]]();Ti.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},Zs(t);const n=t.allowSymlinks?by:Sy;return Ey(e,async r=>{try{const i=await n(Qs.resolve(t.cwd,r));return Js(t.type,i)}catch{return!1}},t)};Ti.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},Zs(t);const n=t.allowSymlinks?Fn.statSync:Fn.lstatSync;for(const r of e)try{const i=n(Qs.resolve(t.cwd,r));if(Js(t.type,i))return r}catch{}};var xy=Ti.exports;(function(e){const t=Se.default,n=xy,r=Fs,i=Symbol("findUp.stop");e.exports=async(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),l=async c=>{if(typeof a!="function")return n(f,c);const p=await a(c.cwd);return typeof p=="string"?n([p],c):p};for(;;){const c=await l({...o,cwd:s});if(c===i)return;if(c)return t.resolve(s,c);if(s===u)return;s=t.dirname(s)}},e.exports.sync=(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),l=c=>{if(typeof a!="function")return n.sync(f,c);const p=a(c.cwd);return typeof p=="string"?n.sync([p],c):p};for(;;){const c=l({...o,cwd:s});if(c===i)return;if(c)return t.resolve(s,c);if(s===u)return;s=t.dirname(s)}},e.exports.exists=r,e.exports.sync.exists=r.sync,e.exports.stop=i})(cy);var eu={exports:{}},Ge=dc.default,_y=process.cwd,sn=null,Ay=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return sn||(sn=_y.call(process)),sn};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var Mo=process.chdir;process.chdir=function(e){sn=null,Mo.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Mo)}var Ty=Cy;function Cy(e){Ge.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=a(e.chown),e.fchown=a(e.fchown),e.lchown=a(e.lchown),e.chmod=r(e.chmod),e.fchmod=r(e.fchmod),e.lchmod=r(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=i(e.chmodSync),e.fchmodSync=i(e.fchmodSync),e.lchmodSync=i(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(l,c,p){p&&process.nextTick(p)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(l,c,p,d){d&&process.nextTick(d)},e.lchownSync=function(){}),Ay==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(l){function c(p,d,h){var m=Date.now(),g=0;l(p,d,function b(S){if(S&&(S.code==="EACCES"||S.code==="EPERM"||S.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){e.stat(d,function(T,A){T&&T.code==="ENOENT"?l(p,d,b):h(S)})},g),g<100&&(g+=10);return}h&&h(S)})}return Object.setPrototypeOf&&Object.setPrototypeOf(c,l),c})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(l){function c(p,d,h,m,g,b){var S;if(b&&typeof b=="function"){var T=0;S=function(A,R,F){if(A&&A.code==="EAGAIN"&&T<10)return T++,l.call(e,p,d,h,m,g,S);b.apply(this,arguments)}}return l.call(e,p,d,h,m,g,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(c,l),c})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(l){return function(c,p,d,h,m){for(var g=0;;)try{return l.call(e,c,p,d,h,m)}catch(b){if(b.code==="EAGAIN"&&g<10){g++;continue}throw b}}})(e.readSync);function t(l){l.lchmod=function(c,p,d){l.open(c,Ge.O_WRONLY|Ge.O_SYMLINK,p,function(h,m){if(h){d&&d(h);return}l.fchmod(m,p,function(g){l.close(m,function(b){d&&d(g||b)})})})},l.lchmodSync=function(c,p){var d=l.openSync(c,Ge.O_WRONLY|Ge.O_SYMLINK,p),h=!0,m;try{m=l.fchmodSync(d,p),h=!1}finally{if(h)try{l.closeSync(d)}catch{}else l.closeSync(d)}return m}}function n(l){Ge.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(c,p,d,h){l.open(c,Ge.O_SYMLINK,function(m,g){if(m){h&&h(m);return}l.futimes(g,p,d,function(b){l.close(g,function(S){h&&h(b||S)})})})},l.lutimesSync=function(c,p,d){var h=l.openSync(c,Ge.O_SYMLINK),m,g=!0;try{m=l.futimesSync(h,p,d),g=!1}finally{if(g)try{l.closeSync(h)}catch{}else l.closeSync(h)}return m}):l.futimes&&(l.lutimes=function(c,p,d,h){h&&process.nextTick(h)},l.lutimesSync=function(){})}function r(l){return l&&function(c,p,d){return l.call(e,c,p,function(h){f(h)&&(h=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(c,p){try{return l.call(e,c,p)}catch(d){if(!f(d))throw d}}}function a(l){return l&&function(c,p,d,h){return l.call(e,c,p,d,function(m){f(m)&&(m=null),h&&h.apply(this,arguments)})}}function o(l){return l&&function(c,p,d){try{return l.call(e,c,p,d)}catch(h){if(!f(h))throw h}}}function s(l){return l&&function(c,p,d){typeof p=="function"&&(d=p,p=null);function h(m,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return p?l.call(e,c,p,h):l.call(e,c,h)}}function u(l){return l&&function(c,p){var d=p?l.call(e,c,p):l.call(e,c);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function f(l){if(!l||l.code==="ENOSYS")return!0;var c=!process.getuid||process.getuid()!==0;return!!(c&&(l.code==="EINVAL"||l.code==="EPERM"))}}var jo=kn.default.Stream,Ry=Fy;function Fy(e){return{ReadStream:t,WriteStream:n};function t(r,i){if(!(this instanceof t))return new t(r,i);jo.call(this);var a=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),s=0,u=o.length;s<u;s++){var f=o[s];this[f]=i[f]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){a._read()});return}e.open(this.path,this.flags,this.mode,function(l,c){if(l){a.emit("error",l),a.readable=!1;return}a.fd=c,a.emit("open",c),a._read()})}function n(r,i){if(!(this instanceof n))return new n(r,i);jo.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var a=Object.keys(i),o=0,s=a.length;o<s;o++){var u=a[o];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}var $y=Oy,Iy=Object.getPrototypeOf||function(e){return e.__proto__};function Oy(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Iy(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}var ne=We.default,Ny=Ty,Py=Ry,Ly=$y,Jt=it.default,pe,$n;typeof Symbol=="function"&&typeof Symbol.for=="function"?(pe=Symbol.for("graceful-fs.queue"),$n=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",$n="___graceful-fs.previous");function ky(){}function tu(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}var Je=ky;Jt.debuglog?Je=Jt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Je=function(){var e=Jt.format.apply(Jt,arguments);e="GFS4: "+e.split(/\n/).join(`
46
+ GFS4: `),console.error(e)});if(!ne[pe]){var Dy=Ee[pe]||[];tu(ne,Dy),ne.close=(function(e){function t(n,r){return e.call(ne,n,function(i){i||Ho(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(t,$n,{value:e}),t})(ne.close),ne.closeSync=(function(e){function t(n){e.apply(ne,arguments),Ho()}return Object.defineProperty(t,$n,{value:e}),t})(ne.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Je(ne[pe]),da.default.equal(ne[pe].length,0)})}Ee[pe]||tu(Ee,ne[pe]);var nu=Ci(Ly(ne));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ne.__patched&&(nu=Ci(ne),ne.__patched=!0);function Ci(e){Ny(e),e.gracefulify=Ci,e.createReadStream=R,e.createWriteStream=F;var t=e.readFile;e.readFile=n;function n(_,N,v){return typeof N=="function"&&(v=N,N=null),j(_,N,v);function j(H,K,w,E){return t(H,K,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?pt([j,[H,K,w],$,E||Date.now(),Date.now()]):typeof w=="function"&&w.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=i;function i(_,N,v,j){return typeof v=="function"&&(j=v,v=null),H(_,N,v,j);function H(K,w,E,$,k){return r(K,w,E,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pt([H,[K,w,E,$],U,k||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var a=e.appendFile;a&&(e.appendFile=o);function o(_,N,v,j){return typeof v=="function"&&(j=v,v=null),H(_,N,v,j);function H(K,w,E,$,k){return a(K,w,E,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pt([H,[K,w,E,$],U,k||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=u);function u(_,N,v,j){return typeof v=="function"&&(j=v,v=0),H(_,N,v,j);function H(K,w,E,$,k){return s(K,w,E,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pt([H,[K,w,E,$],U,k||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var f=e.readdir;e.readdir=c;var l=/^v[0-5]\./;function c(_,N,v){typeof N=="function"&&(v=N,N=null);var j=l.test(process.version)?function(w,E,$,k){return f(w,H(w,E,$,k))}:function(w,E,$,k){return f(w,E,H(w,E,$,k))};return j(_,N,v);function H(K,w,E,$){return function(k,U){k&&(k.code==="EMFILE"||k.code==="ENFILE")?pt([j,[K,w,E],k,$||Date.now(),Date.now()]):(U&&U.sort&&U.sort(),typeof E=="function"&&E.call(this,k,U))}}}if(process.version.substr(0,4)==="v0.8"){var p=Py(e);b=p.ReadStream,T=p.WriteStream}var d=e.ReadStream;d&&(b.prototype=Object.create(d.prototype),b.prototype.open=S);var h=e.WriteStream;h&&(T.prototype=Object.create(h.prototype),T.prototype.open=A),Object.defineProperty(e,"ReadStream",{get:function(){return b},set:function(_){b=_},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return T},set:function(_){T=_},enumerable:!0,configurable:!0});var m=b;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(_){m=_},enumerable:!0,configurable:!0});var g=T;Object.defineProperty(e,"FileWriteStream",{get:function(){return g},set:function(_){g=_},enumerable:!0,configurable:!0});function b(_,N){return this instanceof b?(d.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function S(){var _=this;x(_.path,_.flags,_.mode,function(N,v){N?(_.autoClose&&_.destroy(),_.emit("error",N)):(_.fd=v,_.emit("open",v),_.read())})}function T(_,N){return this instanceof T?(h.apply(this,arguments),this):T.apply(Object.create(T.prototype),arguments)}function A(){var _=this;x(_.path,_.flags,_.mode,function(N,v){N?(_.destroy(),_.emit("error",N)):(_.fd=v,_.emit("open",v))})}function R(_,N){return new e.ReadStream(_,N)}function F(_,N){return new e.WriteStream(_,N)}var D=e.open;e.open=x;function x(_,N,v,j){return typeof v=="function"&&(j=v,v=null),H(_,N,v,j);function H(K,w,E,$,k){return D(K,w,E,function(U,z){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pt([H,[K,w,E,$],U,k||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}return e}function pt(e){Je("ENQUEUE",e[0].name,e[1]),ne[pe].push(e),Ri()}var en;function Ho(){for(var e=Date.now(),t=0;t<ne[pe].length;++t)ne[pe][t].length>2&&(ne[pe][t][3]=e,ne[pe][t][4]=e);Ri()}function Ri(){if(clearTimeout(en),en=void 0,ne[pe].length!==0){var e=ne[pe].shift(),t=e[0],n=e[1],r=e[2],i=e[3],a=e[4];if(i===void 0)Je("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-i>=6e4){Je("TIMEOUT",t.name,n);var o=n.pop();typeof o=="function"&&o.call(null,r)}else{var s=Date.now()-a,u=Math.max(a-i,1),f=Math.min(u*1.2,100);s>=f?(Je("RETRY",t.name,n),t.apply(null,n.concat([i]))):ne[pe].push(e)}en===void 0&&(en=setTimeout(Ri,0))}}const Bo=(e,t)=>function(...n){const r=t.promiseModule;return new r((i,a)=>{t.multiArgs?n.push((...o)=>{t.errorFirst?o[0]?a(o):(o.shift(),i(o)):i(o)}):t.errorFirst?n.push((o,s)=>{o?a(o):i(s)}):n.push(i),e.apply(this,n)})};var My=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const n=typeof e;if(!(e!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":n}\``);const r=a=>{const o=s=>typeof s=="string"?a===s:s.test(a);return t.include?t.include.some(o):!t.exclude.some(o)};let i;n==="function"?i=function(...a){return t.excludeMain?e(...a):Bo(e,t).apply(this,a)}:i=Object.create(Object.getPrototypeOf(e));for(const a in e){const o=e[a];i[a]=typeof o=="function"&&r(a)?Bo(o,t):o}return i},jy=e=>{if(typeof e!="string")throw new TypeError("Expected a string, got "+typeof e);return e.charCodeAt(0)===65279?e.slice(1):e},ie={},Gt={},Fe={};function ru(e){return typeof e>"u"||e===null}function Hy(e){return typeof e=="object"&&e!==null}function By(e){return Array.isArray(e)?e:ru(e)?[]:[e]}function Uy(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function Gy(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function qy(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}Fe.isNothing=ru;Fe.isObject=Hy;Fe.toArray=By;Fe.repeat=Gy;Fe.isNegativeZero=qy;Fe.extend=Uy;function kt(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}kt.prototype=Object.create(Error.prototype);kt.prototype.constructor=kt;kt.prototype.toString=function(t){var n=this.name+": ";return n+=this.reason||"(unknown reason)",!t&&this.mark&&(n+=" "+this.mark.toString()),n};var qt=kt,Uo=Fe;function Fi(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}Fi.prototype.getSnippet=function(t,n){var r,i,a,o,s;if(!this.buffer)return null;for(t=t||4,n=n||75,r="",i=this.position;i>0&&`\0\r
47
47
  …\u2028\u2029`.indexOf(this.buffer.charAt(i-1))===-1;)if(i-=1,this.position-i>n/2-1){r=" ... ",i+=5;break}for(a="",o=this.position;o<this.buffer.length&&`\0\r
48
48
  …\u2028\u2029`.indexOf(this.buffer.charAt(o))===-1;)if(o+=1,o-this.position>n/2-1){a=" ... ",o-=5;break}return s=this.buffer.slice(i,o),Uo.repeat(" ",t)+r+s+a+`
49
49
  `+Uo.repeat(" ",t+this.position-i+r.length)+"^"};Fi.prototype.toString=function(t){var n,r="";return this.name&&(r+='in "'+this.name+'" '),r+="at line "+(this.line+1)+", column "+(this.column+1),t||(n=this.getSnippet(),n&&(r+=`:
50
- `+n)),r};var qy=Fi,Go=qt,Ky=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],Wy=["scalar","sequence","mapping"];function zy(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Yy(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Ky.indexOf(n)===-1)throw new Go('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=zy(t.styleAliases||null),Wy.indexOf(this.kind)===-1)throw new Go('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var le=Yy,qo=Fe,un=qt,Qy=le;function Wr(e,t,n){var r=[];return e.include.forEach(function(i){n=Wr(i,t,n)}),e[t].forEach(function(i){n.forEach(function(a,o){a.tag===i.tag&&a.kind===i.kind&&r.push(o)}),n.push(i)}),n.filter(function(i,a){return r.indexOf(a)===-1})}function Vy(){var e={scalar:{},sequence:{},mapping:{},fallback:{}},t,n;function r(i){e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function Et(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&t.loadKind!=="scalar")throw new un("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=Wr(this,"implicit",[]),this.compiledExplicit=Wr(this,"explicit",[]),this.compiledTypeMap=Vy(this.compiledImplicit,this.compiledExplicit)}Et.DEFAULT=null;Et.create=function(){var t,n;switch(arguments.length){case 1:t=Et.DEFAULT,n=arguments[0];break;case 2:t=arguments[0],n=arguments[1];break;default:throw new un("Wrong number of arguments for Schema.create function")}if(t=qo.toArray(t),n=qo.toArray(n),!t.every(function(r){return r instanceof Et}))throw new un("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!n.every(function(r){return r instanceof Qy}))throw new un("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new Et({include:t,explicit:n})};var Rt=Et,Xy=le,Zy=new Xy("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Jy=le,ev=new Jy("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),tv=le,nv=new tv("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),rv=Rt,$i=new rv({explicit:[Zy,ev,nv]}),iv=le;function ov(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function av(){return null}function sv(e){return e===null}var uv=new iv("tag:yaml.org,2002:null",{kind:"scalar",resolve:ov,construct:av,predicate:sv,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"}),cv=le;function lv(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function fv(e){return e==="true"||e==="True"||e==="TRUE"}function pv(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var dv=new cv("tag:yaml.org,2002:bool",{kind:"scalar",resolve:lv,construct:fv,predicate:pv,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"}),hv=Fe,mv=le;function gv(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function yv(e){return 48<=e&&e<=55}function vv(e){return 48<=e&&e<=57}function Ev(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!gv(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}for(;n<t;n++)if(i=e[n],i!=="_"){if(!yv(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(i===":")break;if(!vv(e.charCodeAt(n)))return!1;r=!0}return!r||i==="_"?!1:i!==":"?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(n))}function wv(e){var t=e,n=1,r,i,a=[];return t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0"?0:r==="0"?t[1]==="b"?n*parseInt(t.slice(2),2):t[1]==="x"?n*parseInt(t,16):n*parseInt(t,8):t.indexOf(":")!==-1?(t.split(":").forEach(function(o){a.unshift(parseInt(o,10))}),t=0,i=1,a.forEach(function(o){t+=o*i,i*=60}),n*t):n*parseInt(t,10)}function bv(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!hv.isNegativeZero(e)}var Sv=new mv("tag:yaml.org,2002:int",{kind:"scalar",resolve:Ev,construct:wv,predicate:bv,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),iu=Fe,xv=le,_v=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Av(e){return!(e===null||!_v.test(e)||e[e.length-1]==="_")}function Tv(e){var t,n,r,i;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,i=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(a){i.unshift(parseFloat(a,10))}),t=0,r=1,i.forEach(function(a){t+=a*r,r*=60}),n*t):n*parseFloat(t,10)}var Cv=/^[-+]?[0-9]+e/;function Rv(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(iu.isNegativeZero(e))return"-0.0";return n=e.toString(10),Cv.test(n)?n.replace("e",".e"):n}function Fv(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||iu.isNegativeZero(e))}var $v=new xv("tag:yaml.org,2002:float",{kind:"scalar",resolve:Av,construct:Tv,predicate:Fv,represent:Rv,defaultStyle:"lowercase"}),Iv=Rt,ou=new Iv({include:[$i],implicit:[uv,dv,Sv,$v]}),Ov=Rt,au=new Ov({include:[ou]}),Nv=le,su=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),uu=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Pv(e){return e===null?!1:su.exec(e)!==null||uu.exec(e)!==null}function Lv(e){var t,n,r,i,a,o,s,u=0,f=null,l,c,p;if(t=su.exec(e),t===null&&(t=uu.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(l=+t[10],c=+(t[11]||0),f=(l*60+c)*6e4,t[9]==="-"&&(f=-f)),p=new Date(Date.UTC(n,r,i,a,o,s,u)),f&&p.setTime(p.getTime()-f),p}function kv(e){return e.toISOString()}var Dv=new Nv("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Pv,construct:Lv,instanceOf:Date,represent:kv}),Mv=le;function jv(e){return e==="<<"||e===null}var Hv=new Mv("tag:yaml.org,2002:merge",{kind:"scalar",resolve:jv});function cu(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xe;try{var Bv=cu;Xe=Bv("buffer").Buffer}catch{}var Uv=le,Ii=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
51
- \r`;function Gv(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=Ii;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function qv(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=Ii,o=0,s=[];for(t=0;t<i;t++)t%4===0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),Xe?Xe.from?Xe.from(s):new Xe(s):s}function Kv(e){var t="",n=0,r,i,a=e.length,o=Ii;for(r=0;r<a;r++)r%3===0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function Wv(e){return Xe&&Xe.isBuffer(e)}var zv=new Uv("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Gv,construct:qv,predicate:Wv,represent:Kv}),Yv=le,Qv=Object.prototype.hasOwnProperty,Vv=Object.prototype.toString;function Xv(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,Vv.call(i)!=="[object Object]")return!1;for(a in i)if(Qv.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function Zv(e){return e!==null?e:[]}var Jv=new Yv("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Xv,construct:Zv}),e0=le,t0=Object.prototype.toString;function n0(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],t0.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}function r0(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var i0=new e0("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:n0,construct:r0}),o0=le,a0=Object.prototype.hasOwnProperty;function s0(e){if(e===null)return!0;var t,n=e;for(t in n)if(a0.call(n,t)&&n[t]!==null)return!1;return!0}function u0(e){return e!==null?e:{}}var c0=new o0("tag:yaml.org,2002:set",{kind:"mapping",resolve:s0,construct:u0}),l0=Rt,Kt=new l0({include:[au],implicit:[Dv,Hv],explicit:[zv,Jv,i0,c0]}),f0=le;function p0(){return!0}function d0(){}function h0(){return""}function m0(e){return typeof e>"u"}var g0=new f0("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:p0,construct:d0,predicate:m0,represent:h0}),y0=le;function v0(e){if(e===null||e.length===0)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";return!(t[0]==="/"&&(n&&(r=n[1]),r.length>3||t[t.length-r.length-1]!=="/"))}function E0(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return t[0]==="/"&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)}function w0(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function b0(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var S0=new y0("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:v0,construct:E0,predicate:b0,represent:w0}),In;try{var x0=cu;In=x0("esprima")}catch{typeof window<"u"&&(In=window.esprima)}var _0=le;function A0(e){if(e===null)return!1;try{var t="("+e+")",n=In.parse(t,{range:!0});return!(n.type!=="Program"||n.body.length!==1||n.body[0].type!=="ExpressionStatement"||n.body[0].expression.type!=="ArrowFunctionExpression"&&n.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function T0(e){var t="("+e+")",n=In.parse(t,{range:!0}),r=[],i;if(n.type!=="Program"||n.body.length!==1||n.body[0].type!=="ExpressionStatement"||n.body[0].expression.type!=="ArrowFunctionExpression"&&n.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach(function(a){r.push(a.name)}),i=n.body[0].expression.body.range,n.body[0].expression.body.type==="BlockStatement"?new Function(r,t.slice(i[0]+1,i[1]-1)):new Function(r,"return "+t.slice(i[0],i[1]))}function C0(e){return e.toString()}function R0(e){return Object.prototype.toString.call(e)==="[object Function]"}var F0=new _0("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:A0,construct:T0,predicate:R0,represent:C0}),Ko=Rt,Jn=Ko.DEFAULT=new Ko({include:[Kt],explicit:[g0,S0,F0]}),Be=Fe,lu=qt,$0=qy,fu=Kt,I0=Jn,Ke=Object.prototype.hasOwnProperty,On=1,pu=2,du=3,Nn=4,Ar=1,O0=2,Wo=3,N0=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,P0=/[\x85\u2028\u2029]/,L0=/[,\[\]\{\}]/,hu=/^(?:!|!!|![a-z\-]+!)$/i,mu=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function zo(e){return Object.prototype.toString.call(e)}function De(e){return e===10||e===13}function et(e){return e===9||e===32}function be(e){return e===9||e===32||e===10||e===13}function wt(e){return e===44||e===91||e===93||e===123||e===125}function k0(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function D0(e){return e===120?2:e===117?4:e===85?8:0}function M0(e){return 48<=e&&e<=57?e-48:-1}function Yo(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
52
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function j0(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var gu=new Array(256),yu=new Array(256);for(var dt=0;dt<256;dt++)gu[dt]=Yo(dt)?1:0,yu[dt]=Yo(dt);function H0(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||I0,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function vu(e,t){return new lu(t,new $0(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function G(e,t){throw vu(e,t)}function Pn(e,t){e.onWarning&&e.onWarning.call(null,vu(e,t))}var Qo={YAML:function(t,n,r){var i,a,o;t.version!==null&&G(t,"duplication of %YAML directive"),r.length!==1&&G(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&G(t,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),o=parseInt(i[2],10),a!==1&&G(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Pn(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,a;r.length!==2&&G(t,"TAG directive accepts exactly two arguments"),i=r[0],a=r[1],hu.test(i)||G(t,"ill-formed tag handle (first argument) of the TAG directive"),Ke.call(t.tagMap,i)&&G(t,'there is a previously declared suffix for "'+i+'" tag handle'),mu.test(a)||G(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[i]=a}};function qe(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||G(e,"expected valid JSON character");else N0.test(s)&&G(e,"the stream contains non-printable characters");e.result+=s}}function Vo(e,t,n,r){var i,a,o,s;for(Be.isObject(n)||G(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,s=i.length;o<s;o+=1)a=i[o],Ke.call(t,a)||(t[a]=n[a],r[a]=!0)}function bt(e,t,n,r,i,a,o,s){var u,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&G(e,"nested arrays are not supported inside keys"),typeof i=="object"&&zo(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&zo(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(u=0,f=a.length;u<f;u+=1)Vo(e,t,a[u],n);else Vo(e,t,a,n);else!e.json&&!Ke.call(n,i)&&Ke.call(t,i)&&(e.line=o||e.line,e.position=s||e.position,G(e,"duplicated mapping key")),t[i]=a,delete n[i];return t}function Oi(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):G(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function se(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;et(i);)i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(De(i))for(Oi(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Pn(e,"deficient indentation"),r}function er(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||be(n)))}function Ni(e,t){t===1?e.result+=" ":t>1&&(e.result+=Be.repeat(`
53
- `,t-1))}function B0(e,t,n){var r,i,a,o,s,u,f,l,c=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),be(d)||wt(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=e.input.charCodeAt(e.position+1),be(i)||n&&wt(i)))return!1;for(e.kind="scalar",e.result="",a=o=e.position,s=!1;d!==0;){if(d===58){if(i=e.input.charCodeAt(e.position+1),be(i)||n&&wt(i))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),be(r))break}else{if(e.position===e.lineStart&&er(e)||n&&wt(d))break;if(De(d))if(u=e.line,f=e.lineStart,l=e.lineIndent,se(e,!1,-1),e.lineIndent>=t){s=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=u,e.lineStart=f,e.lineIndent=l;break}}s&&(qe(e,a,o,!1),Ni(e,e.line-u),a=o=e.position,s=!1),et(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return qe(e,a,o,!1),e.result?!0:(e.kind=c,e.result=p,!1)}function U0(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(qe(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else De(n)?(qe(e,r,i,!0),Ni(e,se(e,!1,t)),r=i=e.position):e.position===e.lineStart&&er(e)?G(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);G(e,"unexpected end of the stream within a single quoted scalar")}function G0(e,t){var n,r,i,a,o,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return qe(e,n,e.position,!0),e.position++,!0;if(s===92){if(qe(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),De(s))se(e,!1,t);else if(s<256&&gu[s])e.result+=yu[s],e.position++;else if((o=D0(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=k0(s))>=0?a=(a<<4)+o:G(e,"expected hexadecimal character");e.result+=j0(a),e.position++}else G(e,"unknown escape sequence");n=r=e.position}else De(s)?(qe(e,n,r,!0),Ni(e,se(e,!1,t)),n=r=e.position):e.position===e.lineStart&&er(e)?G(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}G(e,"unexpected end of the stream within a double quoted scalar")}function q0(e,t){var n=!0,r,i=e.tag,a,o=e.anchor,s,u,f,l,c,p={},d,h,m,g;if(g=e.input.charCodeAt(e.position),g===91)u=93,c=!1,a=[];else if(g===123)u=125,c=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),g=e.input.charCodeAt(++e.position);g!==0;){if(se(e,!0,t),g=e.input.charCodeAt(e.position),g===u)return e.position++,e.tag=i,e.anchor=o,e.kind=c?"mapping":"sequence",e.result=a,!0;n||G(e,"missed comma between flow collection entries"),h=d=m=null,f=l=!1,g===63&&(s=e.input.charCodeAt(e.position+1),be(s)&&(f=l=!0,e.position++,se(e,!0,t))),r=e.line,At(e,t,On,!1,!0),h=e.tag,d=e.result,se(e,!0,t),g=e.input.charCodeAt(e.position),(l||e.line===r)&&g===58&&(f=!0,g=e.input.charCodeAt(++e.position),se(e,!0,t),At(e,t,On,!1,!0),m=e.result),c?bt(e,a,p,h,d,m):f?a.push(bt(e,null,p,h,d,m)):a.push(d),se(e,!0,t),g=e.input.charCodeAt(e.position),g===44?(n=!0,g=e.input.charCodeAt(++e.position)):n=!1}G(e,"unexpected end of the stream within a flow collection")}function K0(e,t){var n,r,i=Ar,a=!1,o=!1,s=t,u=0,f=!1,l,c;if(c=e.input.charCodeAt(e.position),c===124)r=!1;else if(c===62)r=!0;else return!1;for(e.kind="scalar",e.result="";c!==0;)if(c=e.input.charCodeAt(++e.position),c===43||c===45)Ar===i?i=c===43?Wo:O0:G(e,"repeat of a chomping mode identifier");else if((l=M0(c))>=0)l===0?G(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?G(e,"repeat of an indentation width identifier"):(s=t+l-1,o=!0);else break;if(et(c)){do c=e.input.charCodeAt(++e.position);while(et(c));if(c===35)do c=e.input.charCodeAt(++e.position);while(!De(c)&&c!==0)}for(;c!==0;){for(Oi(e),e.lineIndent=0,c=e.input.charCodeAt(e.position);(!o||e.lineIndent<s)&&c===32;)e.lineIndent++,c=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>s&&(s=e.lineIndent),De(c)){u++;continue}if(e.lineIndent<s){i===Wo?e.result+=Be.repeat(`
50
+ `+n)),r};var Ky=Fi,Go=qt,Wy=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],zy=["scalar","sequence","mapping"];function Yy(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Qy(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Wy.indexOf(n)===-1)throw new Go('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=Yy(t.styleAliases||null),zy.indexOf(this.kind)===-1)throw new Go('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var le=Qy,qo=Fe,un=qt,Vy=le;function Wr(e,t,n){var r=[];return e.include.forEach(function(i){n=Wr(i,t,n)}),e[t].forEach(function(i){n.forEach(function(a,o){a.tag===i.tag&&a.kind===i.kind&&r.push(o)}),n.push(i)}),n.filter(function(i,a){return r.indexOf(a)===-1})}function Xy(){var e={scalar:{},sequence:{},mapping:{},fallback:{}},t,n;function r(i){e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function wt(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&t.loadKind!=="scalar")throw new un("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=Wr(this,"implicit",[]),this.compiledExplicit=Wr(this,"explicit",[]),this.compiledTypeMap=Xy(this.compiledImplicit,this.compiledExplicit)}wt.DEFAULT=null;wt.create=function(){var t,n;switch(arguments.length){case 1:t=wt.DEFAULT,n=arguments[0];break;case 2:t=arguments[0],n=arguments[1];break;default:throw new un("Wrong number of arguments for Schema.create function")}if(t=qo.toArray(t),n=qo.toArray(n),!t.every(function(r){return r instanceof wt}))throw new un("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!n.every(function(r){return r instanceof Vy}))throw new un("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new wt({include:t,explicit:n})};var Rt=wt,Zy=le,Jy=new Zy("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),ev=le,tv=new ev("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),nv=le,rv=new nv("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),iv=Rt,$i=new iv({explicit:[Jy,tv,rv]}),ov=le;function av(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function sv(){return null}function uv(e){return e===null}var cv=new ov("tag:yaml.org,2002:null",{kind:"scalar",resolve:av,construct:sv,predicate:uv,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"}),lv=le;function fv(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function pv(e){return e==="true"||e==="True"||e==="TRUE"}function dv(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var hv=new lv("tag:yaml.org,2002:bool",{kind:"scalar",resolve:fv,construct:pv,predicate:dv,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"}),mv=Fe,gv=le;function yv(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function vv(e){return 48<=e&&e<=55}function wv(e){return 48<=e&&e<=57}function Ev(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!yv(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}for(;n<t;n++)if(i=e[n],i!=="_"){if(!vv(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(i===":")break;if(!wv(e.charCodeAt(n)))return!1;r=!0}return!r||i==="_"?!1:i!==":"?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(n))}function bv(e){var t=e,n=1,r,i,a=[];return t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0"?0:r==="0"?t[1]==="b"?n*parseInt(t.slice(2),2):t[1]==="x"?n*parseInt(t,16):n*parseInt(t,8):t.indexOf(":")!==-1?(t.split(":").forEach(function(o){a.unshift(parseInt(o,10))}),t=0,i=1,a.forEach(function(o){t+=o*i,i*=60}),n*t):n*parseInt(t,10)}function Sv(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!mv.isNegativeZero(e)}var xv=new gv("tag:yaml.org,2002:int",{kind:"scalar",resolve:Ev,construct:bv,predicate:Sv,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),iu=Fe,_v=le,Av=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Tv(e){return!(e===null||!Av.test(e)||e[e.length-1]==="_")}function Cv(e){var t,n,r,i;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,i=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(a){i.unshift(parseFloat(a,10))}),t=0,r=1,i.forEach(function(a){t+=a*r,r*=60}),n*t):n*parseFloat(t,10)}var Rv=/^[-+]?[0-9]+e/;function Fv(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(iu.isNegativeZero(e))return"-0.0";return n=e.toString(10),Rv.test(n)?n.replace("e",".e"):n}function $v(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||iu.isNegativeZero(e))}var Iv=new _v("tag:yaml.org,2002:float",{kind:"scalar",resolve:Tv,construct:Cv,predicate:$v,represent:Fv,defaultStyle:"lowercase"}),Ov=Rt,ou=new Ov({include:[$i],implicit:[cv,hv,xv,Iv]}),Nv=Rt,au=new Nv({include:[ou]}),Pv=le,su=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),uu=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Lv(e){return e===null?!1:su.exec(e)!==null||uu.exec(e)!==null}function kv(e){var t,n,r,i,a,o,s,u=0,f=null,l,c,p;if(t=su.exec(e),t===null&&(t=uu.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(l=+t[10],c=+(t[11]||0),f=(l*60+c)*6e4,t[9]==="-"&&(f=-f)),p=new Date(Date.UTC(n,r,i,a,o,s,u)),f&&p.setTime(p.getTime()-f),p}function Dv(e){return e.toISOString()}var Mv=new Pv("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Lv,construct:kv,instanceOf:Date,represent:Dv}),jv=le;function Hv(e){return e==="<<"||e===null}var Bv=new jv("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Hv});function cu(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xe;try{var Uv=cu;Xe=Uv("buffer").Buffer}catch{}var Gv=le,Ii=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
51
+ \r`;function qv(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=Ii;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function Kv(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=Ii,o=0,s=[];for(t=0;t<i;t++)t%4===0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),Xe?Xe.from?Xe.from(s):new Xe(s):s}function Wv(e){var t="",n=0,r,i,a=e.length,o=Ii;for(r=0;r<a;r++)r%3===0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function zv(e){return Xe&&Xe.isBuffer(e)}var Yv=new Gv("tag:yaml.org,2002:binary",{kind:"scalar",resolve:qv,construct:Kv,predicate:zv,represent:Wv}),Qv=le,Vv=Object.prototype.hasOwnProperty,Xv=Object.prototype.toString;function Zv(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,Xv.call(i)!=="[object Object]")return!1;for(a in i)if(Vv.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function Jv(e){return e!==null?e:[]}var e0=new Qv("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Zv,construct:Jv}),t0=le,n0=Object.prototype.toString;function r0(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],n0.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}function i0(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var o0=new t0("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r0,construct:i0}),a0=le,s0=Object.prototype.hasOwnProperty;function u0(e){if(e===null)return!0;var t,n=e;for(t in n)if(s0.call(n,t)&&n[t]!==null)return!1;return!0}function c0(e){return e!==null?e:{}}var l0=new a0("tag:yaml.org,2002:set",{kind:"mapping",resolve:u0,construct:c0}),f0=Rt,Kt=new f0({include:[au],implicit:[Mv,Bv],explicit:[Yv,e0,o0,l0]}),p0=le;function d0(){return!0}function h0(){}function m0(){return""}function g0(e){return typeof e>"u"}var y0=new p0("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:d0,construct:h0,predicate:g0,represent:m0}),v0=le;function w0(e){if(e===null||e.length===0)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";return!(t[0]==="/"&&(n&&(r=n[1]),r.length>3||t[t.length-r.length-1]!=="/"))}function E0(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return t[0]==="/"&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)}function b0(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function S0(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var x0=new v0("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:w0,construct:E0,predicate:S0,represent:b0}),In;try{var _0=cu;In=_0("esprima")}catch{typeof window<"u"&&(In=window.esprima)}var A0=le;function T0(e){if(e===null)return!1;try{var t="("+e+")",n=In.parse(t,{range:!0});return!(n.type!=="Program"||n.body.length!==1||n.body[0].type!=="ExpressionStatement"||n.body[0].expression.type!=="ArrowFunctionExpression"&&n.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function C0(e){var t="("+e+")",n=In.parse(t,{range:!0}),r=[],i;if(n.type!=="Program"||n.body.length!==1||n.body[0].type!=="ExpressionStatement"||n.body[0].expression.type!=="ArrowFunctionExpression"&&n.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach(function(a){r.push(a.name)}),i=n.body[0].expression.body.range,n.body[0].expression.body.type==="BlockStatement"?new Function(r,t.slice(i[0]+1,i[1]-1)):new Function(r,"return "+t.slice(i[0],i[1]))}function R0(e){return e.toString()}function F0(e){return Object.prototype.toString.call(e)==="[object Function]"}var $0=new A0("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:T0,construct:C0,predicate:F0,represent:R0}),Ko=Rt,Jn=Ko.DEFAULT=new Ko({include:[Kt],explicit:[y0,x0,$0]}),Be=Fe,lu=qt,I0=Ky,fu=Kt,O0=Jn,Ke=Object.prototype.hasOwnProperty,On=1,pu=2,du=3,Nn=4,Ar=1,N0=2,Wo=3,P0=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,L0=/[\x85\u2028\u2029]/,k0=/[,\[\]\{\}]/,hu=/^(?:!|!!|![a-z\-]+!)$/i,mu=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function zo(e){return Object.prototype.toString.call(e)}function De(e){return e===10||e===13}function et(e){return e===9||e===32}function be(e){return e===9||e===32||e===10||e===13}function Et(e){return e===44||e===91||e===93||e===123||e===125}function D0(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function M0(e){return e===120?2:e===117?4:e===85?8:0}function j0(e){return 48<=e&&e<=57?e-48:-1}function Yo(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
52
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function H0(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function gu(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var yu=new Array(256),vu=new Array(256);for(var dt=0;dt<256;dt++)yu[dt]=Yo(dt)?1:0,vu[dt]=Yo(dt);function B0(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||O0,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function wu(e,t){return new lu(t,new I0(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function G(e,t){throw wu(e,t)}function Pn(e,t){e.onWarning&&e.onWarning.call(null,wu(e,t))}var Qo={YAML:function(t,n,r){var i,a,o;t.version!==null&&G(t,"duplication of %YAML directive"),r.length!==1&&G(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&G(t,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),o=parseInt(i[2],10),a!==1&&G(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Pn(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,a;r.length!==2&&G(t,"TAG directive accepts exactly two arguments"),i=r[0],a=r[1],hu.test(i)||G(t,"ill-formed tag handle (first argument) of the TAG directive"),Ke.call(t.tagMap,i)&&G(t,'there is a previously declared suffix for "'+i+'" tag handle'),mu.test(a)||G(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[i]=a}};function qe(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||G(e,"expected valid JSON character");else P0.test(s)&&G(e,"the stream contains non-printable characters");e.result+=s}}function Vo(e,t,n,r){var i,a,o,s;for(Be.isObject(n)||G(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,s=i.length;o<s;o+=1)a=i[o],Ke.call(t,a)||(gu(t,a,n[a]),r[a]=!0)}function bt(e,t,n,r,i,a,o,s){var u,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&G(e,"nested arrays are not supported inside keys"),typeof i=="object"&&zo(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&zo(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(u=0,f=a.length;u<f;u+=1)Vo(e,t,a[u],n);else Vo(e,t,a,n);else!e.json&&!Ke.call(n,i)&&Ke.call(t,i)&&(e.line=o||e.line,e.position=s||e.position,G(e,"duplicated mapping key")),gu(t,i,a),delete n[i];return t}function Oi(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):G(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function se(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;et(i);)i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(De(i))for(Oi(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Pn(e,"deficient indentation"),r}function er(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||be(n)))}function Ni(e,t){t===1?e.result+=" ":t>1&&(e.result+=Be.repeat(`
53
+ `,t-1))}function U0(e,t,n){var r,i,a,o,s,u,f,l,c=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),be(d)||Et(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=e.input.charCodeAt(e.position+1),be(i)||n&&Et(i)))return!1;for(e.kind="scalar",e.result="",a=o=e.position,s=!1;d!==0;){if(d===58){if(i=e.input.charCodeAt(e.position+1),be(i)||n&&Et(i))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),be(r))break}else{if(e.position===e.lineStart&&er(e)||n&&Et(d))break;if(De(d))if(u=e.line,f=e.lineStart,l=e.lineIndent,se(e,!1,-1),e.lineIndent>=t){s=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=u,e.lineStart=f,e.lineIndent=l;break}}s&&(qe(e,a,o,!1),Ni(e,e.line-u),a=o=e.position,s=!1),et(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return qe(e,a,o,!1),e.result?!0:(e.kind=c,e.result=p,!1)}function G0(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(qe(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else De(n)?(qe(e,r,i,!0),Ni(e,se(e,!1,t)),r=i=e.position):e.position===e.lineStart&&er(e)?G(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);G(e,"unexpected end of the stream within a single quoted scalar")}function q0(e,t){var n,r,i,a,o,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return qe(e,n,e.position,!0),e.position++,!0;if(s===92){if(qe(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),De(s))se(e,!1,t);else if(s<256&&yu[s])e.result+=vu[s],e.position++;else if((o=M0(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=D0(s))>=0?a=(a<<4)+o:G(e,"expected hexadecimal character");e.result+=H0(a),e.position++}else G(e,"unknown escape sequence");n=r=e.position}else De(s)?(qe(e,n,r,!0),Ni(e,se(e,!1,t)),n=r=e.position):e.position===e.lineStart&&er(e)?G(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}G(e,"unexpected end of the stream within a double quoted scalar")}function K0(e,t){var n=!0,r,i=e.tag,a,o=e.anchor,s,u,f,l,c,p={},d,h,m,g;if(g=e.input.charCodeAt(e.position),g===91)u=93,c=!1,a=[];else if(g===123)u=125,c=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),g=e.input.charCodeAt(++e.position);g!==0;){if(se(e,!0,t),g=e.input.charCodeAt(e.position),g===u)return e.position++,e.tag=i,e.anchor=o,e.kind=c?"mapping":"sequence",e.result=a,!0;n||G(e,"missed comma between flow collection entries"),h=d=m=null,f=l=!1,g===63&&(s=e.input.charCodeAt(e.position+1),be(s)&&(f=l=!0,e.position++,se(e,!0,t))),r=e.line,At(e,t,On,!1,!0),h=e.tag,d=e.result,se(e,!0,t),g=e.input.charCodeAt(e.position),(l||e.line===r)&&g===58&&(f=!0,g=e.input.charCodeAt(++e.position),se(e,!0,t),At(e,t,On,!1,!0),m=e.result),c?bt(e,a,p,h,d,m):f?a.push(bt(e,null,p,h,d,m)):a.push(d),se(e,!0,t),g=e.input.charCodeAt(e.position),g===44?(n=!0,g=e.input.charCodeAt(++e.position)):n=!1}G(e,"unexpected end of the stream within a flow collection")}function W0(e,t){var n,r,i=Ar,a=!1,o=!1,s=t,u=0,f=!1,l,c;if(c=e.input.charCodeAt(e.position),c===124)r=!1;else if(c===62)r=!0;else return!1;for(e.kind="scalar",e.result="";c!==0;)if(c=e.input.charCodeAt(++e.position),c===43||c===45)Ar===i?i=c===43?Wo:N0:G(e,"repeat of a chomping mode identifier");else if((l=j0(c))>=0)l===0?G(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?G(e,"repeat of an indentation width identifier"):(s=t+l-1,o=!0);else break;if(et(c)){do c=e.input.charCodeAt(++e.position);while(et(c));if(c===35)do c=e.input.charCodeAt(++e.position);while(!De(c)&&c!==0)}for(;c!==0;){for(Oi(e),e.lineIndent=0,c=e.input.charCodeAt(e.position);(!o||e.lineIndent<s)&&c===32;)e.lineIndent++,c=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>s&&(s=e.lineIndent),De(c)){u++;continue}if(e.lineIndent<s){i===Wo?e.result+=Be.repeat(`
54
54
  `,a?1+u:u):i===Ar&&a&&(e.result+=`
55
55
  `);break}for(r?et(c)?(f=!0,e.result+=Be.repeat(`
56
56
  `,a?1+u:u)):f?(f=!1,e.result+=Be.repeat(`
57
57
  `,u+1)):u===0?a&&(e.result+=" "):e.result+=Be.repeat(`
58
58
  `,u):e.result+=Be.repeat(`
59
- `,a?1+u:u),a=!0,o=!0,u=0,n=e.position;!De(c)&&c!==0;)c=e.input.charCodeAt(++e.position);qe(e,n,e.position,!1)}return!0}function Xo(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,u;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),u=e.input.charCodeAt(e.position);u!==0&&!(u!==45||(o=e.input.charCodeAt(e.position+1),!be(o)));){if(s=!0,e.position++,se(e,!0,-1)&&e.lineIndent<=t){a.push(null),u=e.input.charCodeAt(e.position);continue}if(n=e.line,At(e,t,du,!1,!0),a.push(e.result),se(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&u!==0)G(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=a,!0):!1}function W0(e,t,n){var r,i,a,o,s=e.tag,u=e.anchor,f={},l={},c=null,p=null,d=null,h=!1,m=!1,g;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),g=e.input.charCodeAt(e.position);g!==0;){if(r=e.input.charCodeAt(e.position+1),a=e.line,o=e.position,(g===63||g===58)&&be(r))g===63?(h&&(bt(e,f,l,c,p,null),c=p=d=null),m=!0,h=!0,i=!0):h?(h=!1,i=!0):G(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,g=r;else if(At(e,n,pu,!1,!0))if(e.line===a){for(g=e.input.charCodeAt(e.position);et(g);)g=e.input.charCodeAt(++e.position);if(g===58)g=e.input.charCodeAt(++e.position),be(g)||G(e,"a whitespace character is expected after the key-value separator within a block mapping"),h&&(bt(e,f,l,c,p,null),c=p=d=null),m=!0,h=!1,i=!1,c=e.tag,p=e.result;else if(m)G(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=s,e.anchor=u,!0}else if(m)G(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=s,e.anchor=u,!0;else break;if((e.line===a||e.lineIndent>t)&&(At(e,t,Nn,!0,i)&&(h?p=e.result:d=e.result),h||(bt(e,f,l,c,p,d,a,o),c=p=d=null),se(e,!0,-1),g=e.input.charCodeAt(e.position)),e.lineIndent>t&&g!==0)G(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return h&&bt(e,f,l,c,p,null),m&&(e.tag=s,e.anchor=u,e.kind="mapping",e.result=f),m}function z0(e){var t,n=!1,r=!1,i,a,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&G(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):G(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!be(o);)o===33&&(r?G(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),hu.test(i)||G(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),L0.test(a)&&G(e,"tag suffix cannot contain flow indicator characters")}return a&&!mu.test(a)&&G(e,"tag name cannot contain such characters: "+a),n?e.tag=a:Ke.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i==="!"?e.tag="!"+a:i==="!!"?e.tag="tag:yaml.org,2002:"+a:G(e,'undeclared tag handle "'+i+'"'),!0}function Y0(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&G(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!be(n)&&!wt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Q0(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!be(r)&&!wt(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Ke.call(e.anchorMap,n)||G(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],se(e,!0,-1),!0}function At(e,t,n,r,i){var a,o,s,u=1,f=!1,l=!1,c,p,d,h,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=Nn===n||du===n,r&&se(e,!0,-1)&&(f=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;z0(e)||Y0(e);)se(e,!0,-1)?(f=!0,s=a,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)):s=!1;if(s&&(s=f||i),(u===1||Nn===n)&&(On===n||pu===n?h=t:h=t+1,m=e.position-e.lineStart,u===1?s&&(Xo(e,m)||W0(e,m,h))||q0(e,h)?l=!0:(o&&K0(e,h)||U0(e,h)||G0(e,h)?l=!0:Q0(e)?(l=!0,(e.tag!==null||e.anchor!==null)&&G(e,"alias node should not have any properties")):B0(e,h,On===n)&&(l=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(l=s&&Xo(e,m))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&G(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,p=e.implicitTypes.length;c<p;c+=1)if(d=e.implicitTypes[c],d.resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else Ke.call(e.typeMap[e.kind||"fallback"],e.tag)?(d=e.typeMap[e.kind||"fallback"][e.tag],e.result!==null&&d.kind!==e.kind&&G(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result)?(e.result=d.construct(e.result),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):G(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):G(e,"unknown tag !<"+e.tag+">");return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||l}function V0(e){var t=e.position,n,r,i,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};(o=e.input.charCodeAt(e.position))!==0&&(se(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!be(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&G(e,"directive name must not be less than one character in length");o!==0;){for(;et(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!De(o));break}if(De(o))break;for(n=e.position;o!==0&&!be(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&Oi(e),Ke.call(Qo,r)?Qo[r](e,r,i):Pn(e,'unknown document directive "'+r+'"')}if(se(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,se(e,!0,-1)):a&&G(e,"directives end mark is expected"),At(e,e.lineIndent-1,Nn,!1,!0),se(e,!0,-1),e.checkLineBreaks&&P0.test(e.input.slice(t,e.position))&&Pn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&er(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,se(e,!0,-1));return}if(e.position<e.length-1)G(e,"end of the stream or a document separator is expected");else return}function Eu(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
60
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new H0(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,G(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)V0(n);return n.documents}function wu(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=Eu(e,n);if(typeof t!="function")return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}function bu(e,t){var n=Eu(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new lu("expected a single document in the stream, but found more")}}function X0(e,t,n){return typeof t=="object"&&t!==null&&typeof n>"u"&&(n=t,t=null),wu(e,t,Be.extend({schema:fu},n))}function Z0(e,t){return bu(e,Be.extend({schema:fu},t))}Gt.loadAll=wu;Gt.load=bu;Gt.safeLoadAll=X0;Gt.safeLoad=Z0;var Pi={},Wt=Fe,zt=qt,J0=Jn,eE=Kt,Su=Object.prototype.toString,xu=Object.prototype.hasOwnProperty,tE=9,Dt=10,nE=13,rE=32,iE=33,oE=34,_u=35,aE=37,sE=38,uE=39,cE=42,Au=44,lE=45,Tu=58,fE=61,pE=62,dE=63,hE=64,Cu=91,Ru=93,mE=96,Fu=123,gE=124,$u=125,de={};de[0]="\\0";de[7]="\\a";de[8]="\\b";de[9]="\\t";de[10]="\\n";de[11]="\\v";de[12]="\\f";de[13]="\\r";de[27]="\\e";de[34]='\\"';de[92]="\\\\";de[133]="\\N";de[160]="\\_";de[8232]="\\L";de[8233]="\\P";var yE=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function vE(e,t){var n,r,i,a,o,s,u;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),u=e.compiledTypeMap.fallback[o],u&&xu.call(u.styleAliases,s)&&(s=u.styleAliases[s]),n[o]=s;return n}function Zo(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new zt("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+Wt.repeat("0",r-t.length)+t}function EE(e){this.schema=e.schema||J0,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Wt.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=vE(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Jo(e,t){for(var n=Wt.repeat(" ",t),r=0,i=-1,a="",o,s=e.length;r<s;)i=e.indexOf(`
59
+ `,a?1+u:u),a=!0,o=!0,u=0,n=e.position;!De(c)&&c!==0;)c=e.input.charCodeAt(++e.position);qe(e,n,e.position,!1)}return!0}function Xo(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,u;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),u=e.input.charCodeAt(e.position);u!==0&&!(u!==45||(o=e.input.charCodeAt(e.position+1),!be(o)));){if(s=!0,e.position++,se(e,!0,-1)&&e.lineIndent<=t){a.push(null),u=e.input.charCodeAt(e.position);continue}if(n=e.line,At(e,t,du,!1,!0),a.push(e.result),se(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&u!==0)G(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=a,!0):!1}function z0(e,t,n){var r,i,a,o,s=e.tag,u=e.anchor,f={},l={},c=null,p=null,d=null,h=!1,m=!1,g;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),g=e.input.charCodeAt(e.position);g!==0;){if(r=e.input.charCodeAt(e.position+1),a=e.line,o=e.position,(g===63||g===58)&&be(r))g===63?(h&&(bt(e,f,l,c,p,null),c=p=d=null),m=!0,h=!0,i=!0):h?(h=!1,i=!0):G(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,g=r;else if(At(e,n,pu,!1,!0))if(e.line===a){for(g=e.input.charCodeAt(e.position);et(g);)g=e.input.charCodeAt(++e.position);if(g===58)g=e.input.charCodeAt(++e.position),be(g)||G(e,"a whitespace character is expected after the key-value separator within a block mapping"),h&&(bt(e,f,l,c,p,null),c=p=d=null),m=!0,h=!1,i=!1,c=e.tag,p=e.result;else if(m)G(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=s,e.anchor=u,!0}else if(m)G(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=s,e.anchor=u,!0;else break;if((e.line===a||e.lineIndent>t)&&(At(e,t,Nn,!0,i)&&(h?p=e.result:d=e.result),h||(bt(e,f,l,c,p,d,a,o),c=p=d=null),se(e,!0,-1),g=e.input.charCodeAt(e.position)),e.lineIndent>t&&g!==0)G(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return h&&bt(e,f,l,c,p,null),m&&(e.tag=s,e.anchor=u,e.kind="mapping",e.result=f),m}function Y0(e){var t,n=!1,r=!1,i,a,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&G(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):G(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!be(o);)o===33&&(r?G(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),hu.test(i)||G(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),k0.test(a)&&G(e,"tag suffix cannot contain flow indicator characters")}return a&&!mu.test(a)&&G(e,"tag name cannot contain such characters: "+a),n?e.tag=a:Ke.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i==="!"?e.tag="!"+a:i==="!!"?e.tag="tag:yaml.org,2002:"+a:G(e,'undeclared tag handle "'+i+'"'),!0}function Q0(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&G(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!be(n)&&!Et(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function V0(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!be(r)&&!Et(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Ke.call(e.anchorMap,n)||G(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],se(e,!0,-1),!0}function At(e,t,n,r,i){var a,o,s,u=1,f=!1,l=!1,c,p,d,h,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=Nn===n||du===n,r&&se(e,!0,-1)&&(f=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;Y0(e)||Q0(e);)se(e,!0,-1)?(f=!0,s=a,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)):s=!1;if(s&&(s=f||i),(u===1||Nn===n)&&(On===n||pu===n?h=t:h=t+1,m=e.position-e.lineStart,u===1?s&&(Xo(e,m)||z0(e,m,h))||K0(e,h)?l=!0:(o&&W0(e,h)||G0(e,h)||q0(e,h)?l=!0:V0(e)?(l=!0,(e.tag!==null||e.anchor!==null)&&G(e,"alias node should not have any properties")):U0(e,h,On===n)&&(l=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(l=s&&Xo(e,m))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&G(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,p=e.implicitTypes.length;c<p;c+=1)if(d=e.implicitTypes[c],d.resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else Ke.call(e.typeMap[e.kind||"fallback"],e.tag)?(d=e.typeMap[e.kind||"fallback"][e.tag],e.result!==null&&d.kind!==e.kind&&G(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result)?(e.result=d.construct(e.result),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):G(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):G(e,"unknown tag !<"+e.tag+">");return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||l}function X0(e){var t=e.position,n,r,i,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};(o=e.input.charCodeAt(e.position))!==0&&(se(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!be(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&G(e,"directive name must not be less than one character in length");o!==0;){for(;et(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!De(o));break}if(De(o))break;for(n=e.position;o!==0&&!be(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&Oi(e),Ke.call(Qo,r)?Qo[r](e,r,i):Pn(e,'unknown document directive "'+r+'"')}if(se(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,se(e,!0,-1)):a&&G(e,"directives end mark is expected"),At(e,e.lineIndent-1,Nn,!1,!0),se(e,!0,-1),e.checkLineBreaks&&L0.test(e.input.slice(t,e.position))&&Pn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&er(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,se(e,!0,-1));return}if(e.position<e.length-1)G(e,"end of the stream or a document separator is expected");else return}function Eu(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
60
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new B0(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,G(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)X0(n);return n.documents}function bu(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=Eu(e,n);if(typeof t!="function")return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}function Su(e,t){var n=Eu(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new lu("expected a single document in the stream, but found more")}}function Z0(e,t,n){return typeof t=="object"&&t!==null&&typeof n>"u"&&(n=t,t=null),bu(e,t,Be.extend({schema:fu},n))}function J0(e,t){return Su(e,Be.extend({schema:fu},t))}Gt.loadAll=bu;Gt.load=Su;Gt.safeLoadAll=Z0;Gt.safeLoad=J0;var Pi={},Wt=Fe,zt=qt,ew=Jn,tw=Kt,xu=Object.prototype.toString,_u=Object.prototype.hasOwnProperty,nw=9,Dt=10,rw=13,iw=32,ow=33,aw=34,Au=35,sw=37,uw=38,cw=39,lw=42,Tu=44,fw=45,Cu=58,pw=61,dw=62,hw=63,mw=64,Ru=91,Fu=93,gw=96,$u=123,yw=124,Iu=125,de={};de[0]="\\0";de[7]="\\a";de[8]="\\b";de[9]="\\t";de[10]="\\n";de[11]="\\v";de[12]="\\f";de[13]="\\r";de[27]="\\e";de[34]='\\"';de[92]="\\\\";de[133]="\\N";de[160]="\\_";de[8232]="\\L";de[8233]="\\P";var vw=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function ww(e,t){var n,r,i,a,o,s,u;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),u=e.compiledTypeMap.fallback[o],u&&_u.call(u.styleAliases,s)&&(s=u.styleAliases[s]),n[o]=s;return n}function Zo(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new zt("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+Wt.repeat("0",r-t.length)+t}function Ew(e){this.schema=e.schema||ew,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Wt.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ww(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Jo(e,t){for(var n=Wt.repeat(" ",t),r=0,i=-1,a="",o,s=e.length;r<s;)i=e.indexOf(`
61
61
  `,r),i===-1?(o=e.slice(r),r=s):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
62
62
  `&&(a+=n),a+=o;return a}function zr(e,t){return`
63
- `+Wt.repeat(" ",e.indent*t)}function wE(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Li(e){return e===rE||e===tE}function Tt(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==65279||65536<=e&&e<=1114111}function bE(e){return Tt(e)&&!Li(e)&&e!==65279&&e!==nE&&e!==Dt}function ea(e,t){return Tt(e)&&e!==65279&&e!==Au&&e!==Cu&&e!==Ru&&e!==Fu&&e!==$u&&e!==Tu&&(e!==_u||t&&bE(t))}function SE(e){return Tt(e)&&e!==65279&&!Li(e)&&e!==lE&&e!==dE&&e!==Tu&&e!==Au&&e!==Cu&&e!==Ru&&e!==Fu&&e!==$u&&e!==_u&&e!==sE&&e!==cE&&e!==iE&&e!==gE&&e!==fE&&e!==pE&&e!==uE&&e!==oE&&e!==aE&&e!==hE&&e!==mE}function Iu(e){var t=/^\n* /;return t.test(e)}var Ou=1,Nu=2,Pu=3,Lu=4,cn=5;function xE(e,t,n,r,i){var a,o,s,u=!1,f=!1,l=r!==-1,c=-1,p=SE(e.charCodeAt(0))&&!Li(e.charCodeAt(e.length-1));if(t)for(a=0;a<e.length;a++){if(o=e.charCodeAt(a),!Tt(o))return cn;s=a>0?e.charCodeAt(a-1):null,p=p&&ea(o,s)}else{for(a=0;a<e.length;a++){if(o=e.charCodeAt(a),o===Dt)u=!0,l&&(f=f||a-c-1>r&&e[c+1]!==" ",c=a);else if(!Tt(o))return cn;s=a>0?e.charCodeAt(a-1):null,p=p&&ea(o,s)}f=f||l&&a-c-1>r&&e[c+1]!==" "}return!u&&!f?p&&!i(e)?Ou:Nu:n>9&&Iu(e)?cn:f?Lu:Pu}function _E(e,t,n,r){e.dump=function(){if(t.length===0)return"''";if(!e.noCompatMode&&yE.indexOf(t)!==-1)return"'"+t+"'";var i=e.indent*Math.max(1,n),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),o=r||e.flowLevel>-1&&n>=e.flowLevel;function s(u){return wE(e,u)}switch(xE(t,o,e.indent,a,s)){case Ou:return t;case Nu:return"'"+t.replace(/'/g,"''")+"'";case Pu:return"|"+ta(t,e.indent)+na(Jo(t,i));case Lu:return">"+ta(t,e.indent)+na(Jo(AE(t,a),i));case cn:return'"'+TE(t)+'"';default:throw new zt("impossible error: invalid scalar style")}}()}function ta(e,t){var n=Iu(e)?String(t):"",r=e[e.length-1]===`
63
+ `+Wt.repeat(" ",e.indent*t)}function bw(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Li(e){return e===iw||e===nw}function Tt(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==65279||65536<=e&&e<=1114111}function Sw(e){return Tt(e)&&!Li(e)&&e!==65279&&e!==rw&&e!==Dt}function ea(e,t){return Tt(e)&&e!==65279&&e!==Tu&&e!==Ru&&e!==Fu&&e!==$u&&e!==Iu&&e!==Cu&&(e!==Au||t&&Sw(t))}function xw(e){return Tt(e)&&e!==65279&&!Li(e)&&e!==fw&&e!==hw&&e!==Cu&&e!==Tu&&e!==Ru&&e!==Fu&&e!==$u&&e!==Iu&&e!==Au&&e!==uw&&e!==lw&&e!==ow&&e!==yw&&e!==pw&&e!==dw&&e!==cw&&e!==aw&&e!==sw&&e!==mw&&e!==gw}function Ou(e){var t=/^\n* /;return t.test(e)}var Nu=1,Pu=2,Lu=3,ku=4,cn=5;function _w(e,t,n,r,i){var a,o,s,u=!1,f=!1,l=r!==-1,c=-1,p=xw(e.charCodeAt(0))&&!Li(e.charCodeAt(e.length-1));if(t)for(a=0;a<e.length;a++){if(o=e.charCodeAt(a),!Tt(o))return cn;s=a>0?e.charCodeAt(a-1):null,p=p&&ea(o,s)}else{for(a=0;a<e.length;a++){if(o=e.charCodeAt(a),o===Dt)u=!0,l&&(f=f||a-c-1>r&&e[c+1]!==" ",c=a);else if(!Tt(o))return cn;s=a>0?e.charCodeAt(a-1):null,p=p&&ea(o,s)}f=f||l&&a-c-1>r&&e[c+1]!==" "}return!u&&!f?p&&!i(e)?Nu:Pu:n>9&&Ou(e)?cn:f?ku:Lu}function Aw(e,t,n,r){e.dump=(function(){if(t.length===0)return"''";if(!e.noCompatMode&&vw.indexOf(t)!==-1)return"'"+t+"'";var i=e.indent*Math.max(1,n),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),o=r||e.flowLevel>-1&&n>=e.flowLevel;function s(u){return bw(e,u)}switch(_w(t,o,e.indent,a,s)){case Nu:return t;case Pu:return"'"+t.replace(/'/g,"''")+"'";case Lu:return"|"+ta(t,e.indent)+na(Jo(t,i));case ku:return">"+ta(t,e.indent)+na(Jo(Tw(t,a),i));case cn:return'"'+Cw(t)+'"';default:throw new zt("impossible error: invalid scalar style")}})()}function ta(e,t){var n=Ou(e)?String(t):"",r=e[e.length-1]===`
64
64
  `,i=r&&(e[e.length-2]===`
65
65
  `||e===`
66
66
  `),a=i?"+":r?"":"-";return n+a+`
67
67
  `}function na(e){return e[e.length-1]===`
68
- `?e.slice(0,-1):e}function AE(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var f=e.indexOf(`
69
- `);return f=f!==-1?f:e.length,n.lastIndex=f,ra(e.slice(0,f),t)}(),i=e[0]===`
68
+ `?e.slice(0,-1):e}function Tw(e,t){for(var n=/(\n+)([^\n]*)/g,r=(function(){var f=e.indexOf(`
69
+ `);return f=f!==-1?f:e.length,n.lastIndex=f,ra(e.slice(0,f),t)})(),i=e[0]===`
70
70
  `||e[0]===" ",a,o;o=n.exec(e);){var s=o[1],u=o[2];a=u[0]===" ",r+=s+(!i&&!a&&u!==""?`
71
71
  `:"")+ra(u,t),i=a}return r}function ra(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,a,o=0,s=0,u="";r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,u+=`
72
72
  `+e.slice(i,a),i=a+1),o=s;return u+=`
73
73
  `,e.length-i>t&&o>i?u+=e.slice(i,o)+`
74
- `+e.slice(o+1):u+=e.slice(i),u.slice(1)}function TE(e){for(var t="",n,r,i,a=0;a<e.length;a++){if(n=e.charCodeAt(a),n>=55296&&n<=56319&&(r=e.charCodeAt(a+1),r>=56320&&r<=57343)){t+=Zo((n-55296)*1024+r-56320+65536),a++;continue}i=de[n],t+=!i&&Tt(n)?e[a]:i||Zo(n)}return t}function CE(e,t,n){var r="",i=e.tag,a,o;for(a=0,o=n.length;a<o;a+=1)rt(e,t,n[a],!1,!1)&&(a!==0&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function RE(e,t,n,r){var i="",a=e.tag,o,s;for(o=0,s=n.length;o<s;o+=1)rt(e,t+1,n[o],!0,!0)&&((!r||o!==0)&&(i+=zr(e,t)),e.dump&&Dt===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=a,e.dump=i||"[]"}function FE(e,t,n){var r="",i=e.tag,a=Object.keys(n),o,s,u,f,l;for(o=0,s=a.length;o<s;o+=1)l="",o!==0&&(l+=", "),e.condenseFlow&&(l+='"'),u=a[o],f=n[u],rt(e,t,u,!1,!1)&&(e.dump.length>1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),rt(e,t,f,!1,!1)&&(l+=e.dump,r+=l));e.tag=i,e.dump="{"+r+"}"}function $E(e,t,n,r){var i="",a=e.tag,o=Object.keys(n),s,u,f,l,c,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new zt("sortKeys must be a boolean or a function");for(s=0,u=o.length;s<u;s+=1)p="",(!r||s!==0)&&(p+=zr(e,t)),f=o[s],l=n[f],rt(e,t+1,f,!0,!0,!0)&&(c=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,c&&(e.dump&&Dt===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,c&&(p+=zr(e,t)),rt(e,t+1,l,!0,c)&&(e.dump&&Dt===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,i+=p));e.tag=a,e.dump=i||"{}"}function ia(e,t,n){var r,i,a,o,s,u;for(i=n?e.explicitTypes:e.implicitTypes,a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t=="object"&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(u=e.styleMap[s.tag]||s.defaultStyle,Su.call(s.represent)==="[object Function]")r=s.represent(t,u);else if(xu.call(s.represent,u))r=s.represent[u](t,u);else throw new zt("!<"+s.tag+'> tag resolver accepts not "'+u+'" style');e.dump=r}return!0}return!1}function rt(e,t,n,r,i,a){e.tag=null,e.dump=n,ia(e,n,!1)||ia(e,n,!0);var o=Su.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var s=o==="[object Object]"||o==="[object Array]",u,f;if(s&&(u=e.duplicates.indexOf(n),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(s&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),o==="[object Object]")r&&Object.keys(e.dump).length!==0?($E(e,t,e.dump,i),f&&(e.dump="&ref_"+u+e.dump)):(FE(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(o==="[object Array]"){var l=e.noArrayIndent&&t>0?t-1:t;r&&e.dump.length!==0?(RE(e,l,e.dump,i),f&&(e.dump="&ref_"+u+e.dump)):(CE(e,l,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump))}else if(o==="[object String]")e.tag!=="?"&&_E(e,e.dump,t,a);else{if(e.skipInvalid)return!1;throw new zt("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function IE(e,t){var n=[],r=[],i,a;for(Yr(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(a)}function Yr(e,t,n){var r,i,a;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)Yr(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)Yr(e[r[i]],t,n)}function ku(e,t){t=t||{};var n=new EE(t);return n.noRefs||IE(e,n),rt(n,0,e,!0,!0)?n.dump+`
75
- `:""}function OE(e,t){return ku(e,Wt.extend({schema:eE},t))}Pi.dump=ku;Pi.safeDump=OE;var tr=Gt,Du=Pi;function nr(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}ie.Type=le;ie.Schema=Rt;ie.FAILSAFE_SCHEMA=$i;ie.JSON_SCHEMA=ou;ie.CORE_SCHEMA=au;ie.DEFAULT_SAFE_SCHEMA=Kt;ie.DEFAULT_FULL_SCHEMA=Jn;ie.load=tr.load;ie.loadAll=tr.loadAll;ie.safeLoad=tr.safeLoad;ie.safeLoadAll=tr.safeLoadAll;ie.dump=Du.dump;ie.safeDump=Du.safeDump;ie.YAMLException=qt;ie.MINIMAL_SCHEMA=$i;ie.SAFE_SCHEMA=Kt;ie.DEFAULT_SCHEMA=Jn;ie.scan=nr("scan");ie.parse=nr("parse");ie.compose=nr("compose");ie.addConstructor=nr("addConstructor");var NE=ie,PE=NE;const Mu=nu,LE=Dy,kE=My,DE=PE,ju=e=>DE.safeLoad(kE(e));eu.exports=e=>LE(Mu.readFile)(e,"utf8").then(t=>ju(t));eu.exports.sync=e=>ju(Mu.readFileSync(e,"utf8"));const ME=e=>/^[a-z][a-zA-Z0-9]+$/.test(e),jE=e=>/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.test(e),{toString:HE}=Object.prototype,BE=Error.prototype.toString,UE=RegExp.prototype.toString,GE=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",qE=/^Symbol\((.*)\)(.*)$/;function KE(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":`${e}`}function oa(e,t=!1){if(e==null||e===!0||e===!1)return`${e}`;if(typeof e=="number")return KE(e);if(typeof e=="string")return t?`"${e}"`:e;if(typeof e=="function")return`[Function ${e.name||"anonymous"}]`;if(typeof e=="symbol")return GE.call(e).replace(qE,"Symbol($1)");const n=HE.call(e).slice(8,-1);if(n==="Date"){const r=e;return Number.isNaN(r.getTime())?`${r}`:r.toISOString()}return n==="Error"||e instanceof Error?`[${BE.call(e)}]`:n==="RegExp"?UE.call(e):null}function aa(e,t){const n=oa(e,t);return n!==null?n:JSON.stringify(e,function(i,a){const o=oa(this[i],t);return o!==null?o:a},2)}const WE=e=>!me.default.isNil(e),zE=e=>!me.default.isNull(e);at(jn,"notNil",function(t="${path} must be defined."){return this.test("defined",t,WE)});at(jn,"notNull",function(t="${path} cannot be null."){return this.test("defined",t,zE)});at(jn,"isFunction",function(t="${path} is not a function"){return this.test("is a function",t,n=>me.default.isUndefined(n)||me.default.isFunction(n))});at(ei,"isCamelCase",function(t="${path} is not in camel case (anExampleOfCamelCase)"){return this.test("is in camelCase",t,n=>n?ME(n):!0)});at(ei,"isKebabCase",function(t="${path} is not in kebab case (an-example-of-kebab-case)"){return this.test("is in kebab-case",t,n=>n?jE(n):!0)});at(Ua,"onlyContainsFunctions",function(t="${path} contains values that are not functions"){return this.test("only contains functions",t,n=>me.default.isUndefined(n)||n&&Object.values(n).every(me.default.isFunction))});at(Ga,"uniqueProperty",function(t,n){return this.test("unique",n,function(i){const a=[];if(i?.forEach((o,s)=>{i.filter(f=>R.get(t,f)===R.get(t,o)).length>1&&a.push(this.createError({path:`${this.path}[${s}].${t}`,message:n}))}),a.length)throw new ge(a);return!0})});Xf({mixed:{notType(e){const{path:t,type:n,value:r,originalValue:i}=e,a=i!=null&&i!==r;return`${t} must be a \`${n}\` type, but the final value was: \`${aa(r,!0)}\`${a?` (cast from the value \`${aa(i,!0)}\`).`:"."}`}}});W.union([W.string(),W.array(W.string())]).describe("Select specific fields to return in the response");W.union([W.literal("*"),W.string(),W.array(W.string()),W.record(W.string(),W.any())]).describe("Specify which relations to populate in the response");W.union([W.string(),W.array(W.string()),W.record(W.string(),W.enum(["asc","desc"])),W.array(W.record(W.string(),W.enum(["asc","desc"])))]).describe("Sort the results by specified fields");W.intersection(W.object({withCount:W.boolean().optional().describe("Include total count in response")}),W.union([W.object({page:W.number().int().positive().describe("Page number (1-based)"),pageSize:W.number().int().positive().describe("Number of entries per page")}).describe("Page-based pagination"),W.object({start:W.number().int().min(0).describe("Number of entries to skip"),limit:W.number().int().positive().describe("Maximum number of entries to return")}).describe("Offset-based pagination")])).describe("Pagination parameters");W.record(W.string(),W.any()).describe("Apply filters to the query");W.string().describe("Specify the locale for localized content");W.enum(["draft","published"]).describe("Filter by publication status");W.string().describe("Search query string");const tn=(e,t,n)=>{e&&e.emit&&e.emit(t,n)},YE=e=>[...new Set(e.filter(t=>!!t).flatMap(({remove:t,create:n,update:r})=>[n?"CREATE":"",r?"UPDATE":"",t?"REMOVE":""].filter(i=>!!i)))].join("_"),Hu=e=>async t=>({title:t.title,path:t.path,audience:t.audience,type:t.type,uiRouterKey:t.uiRouterKey,order:t.order,collapsed:t.collapsed,menuAttached:t.menuAttached,removed:!1,updated:!0,externalPath:t.externalPath,items:t.items?await Promise.all(t.items.map(Hu(e))):[],master:e.master,parent:void 0,related:t.related,additionalFields:t.additionalFields}),QE=(e,t)=>t.slice(1).reduce((n,r)=>n.concat([e,r]),t.slice(0,1)),VE=async({strapi:e})=>{const n=!!e.plugin("rest-cache"),r=e.store({type:"plugin",name:"navigation"}),i=Re.configSchema.parse(await r.get({key:"config"}));return n?{hasCachePlugin:n,enabled:!!i.isCacheEnabled}:{hasCachePlugin:n,enabled:!1}},XE=e=>({async config({viaSettingsPage:t=!1}){const n=re(e,"common"),r=await VE(e),a=await(await n.getPluginStore()).get({key:"config"}).then(Re.configSchema.parse),{additionalFields:o,cascadeMenuAttached:s,contentTypesPopulate:u,contentTypesNameFields:f,defaultContentType:l,pathDefaultFields:c,allowedLevels:p,preferCustomContentTypes:d}=a,h=!!strapi.plugin("graphql");let m={allowedContentTypes:Ea,restrictedContentTypes:wa,availableAudience:[]};const g=await this.configContentTypes({}),b={contentTypes:await this.configContentTypes({viaSettingsPage:t}),contentTypesNameFields:{default:Gc,...B.isObject(f)?f:{}},contentTypesPopulate:B.isObject(u)?u:{},defaultContentType:l,pathDefaultFields:B.isObject(c)?c:{},allowedLevels:p,additionalFields:t?o:o.filter(S=>typeof S=="string"||!!S.enabled),gql:{navigationItemRelated:g.map(({labelSingular:S})=>S.replace(/\s+/g,""))},isGQLPluginEnabled:t?h:void 0,cascadeMenuAttached:s,preferCustomContentTypes:d};if(o.includes("audience")){const S=await Xc(e).find({},Number.MAX_SAFE_INTEGER);m={...m,availableAudience:S}}return{...b,...m,isCacheEnabled:r.enabled,isCachePluginEnabled:r.hasCachePlugin}},async configContentTypes({viaSettingsPage:t=!1}){const i=await(await re(e,"common").getPluginStore()).get({key:"config"}).then(Re.configSchema.parse);return(await Promise.all(i.contentTypes.filter(o=>!!e.strapi.contentTypes[o]&&Yc(o)).map(async o=>{const s=Tr.parse(strapi.contentTypes[o]),{kind:u,options:f,uid:l}=s,c=f?.draftAndPublish,p=u===Hi.SINGLE,d=p&&c,h=m=>({key:o,available:m});if(p){const m=pn(e,l);if(d){const b=d?await m.count({},"published"):!0;return h(b!==0)}return await m.count({})!==0?h(!0):t?h(!1):void 0}return h(!0)}))).reduce((o,s)=>{if(!s?.key)return o;const{key:u,available:f}=s,l=Tr.parse(e.strapi.contentTypes[u]),c=(l.associations||[]).find(({model:k})=>k==="navigationitem"),{uid:p,options:d,info:h,collectionName:m,modelName:g,apiName:b,plugin:S,kind:T,pluginOptions:A={}}=l,C=f&&!d?.hidden;if(!C)return o;const{visible:F=!0}=A["content-manager"]||{},{name:j="",description:x=""}=h,_=B.find(B.get(e.strapi.api,`[${g}].config.routes`,[]),k=>k.handler.includes(".find")),N=_&&_.path.split("/")[1],v=N&&N!==b?N:b||g,M=T===Hi.SINGLE,H=M?v:Mi.default(v),K=Ui(g),E=typeof p=="string"?B.last(p.split(".")).split("-"):[],w=E.length>1?E.reduce((k,U)=>`${k}${B.upperFirst(U)}`,""):B.upperFirst(g),$=j||B.upperFirst(E.length>1?E.join(" "):K);return o.push({uid:p,name:K,draftAndPublish:d?.draftAndPublish,isSingle:M,description:x,collectionName:m,contentTypeName:w,label:M?$:Mi.default(j||$),relatedField:c?c.alias:void 0,labelSingular:Ui($),endpoint:H,plugin:S,available:C,visible:F,templateName:d?.templateName}),o},[])},async get({ids:t,locale:n}){let r={};t&&t.length&&(r.id={$in:t});const i=await Ie(e).find({filters:r,locale:n||"*",limit:Number.MAX_SAFE_INTEGER,populate:["items","items.parent","items.audience","items.related"]}),a=({allItems:o,item:s,parent:u})=>{const f=o.filter(l=>l.parent?.documentId===s.documentId);return{...s,parent:u,items:f.map(l=>a({parent:s,item:l,allItems:o})).sort((l,c)=>l.order-c.order)}};return i.map(o=>({...o,items:o.items?.filter(s=>!s.parent).map(s=>a({allItems:o.items??[],item:s})).sort((s,u)=>s.order-u.order)}))},async getById({documentId:t,locale:n,populate:r=[]}){const i=re(e,"common"),{defaultLocale:a}=await i.readLocale(),o={documentId:t},s=await Ie(e).findOne({filters:o,locale:n||a}),u=await Le(e).find({filters:{master:s.id},locale:n||a,limit:Number.MAX_SAFE_INTEGER,order:[{order:"asc"}],populate:["parent","audience",...r]});return{...s,items:i.buildNestedStructure({navigationItems:u}).filter(({parent:f})=>!f)}},async post({auditLog:t,payload:n}){const{masterModel:r}=Ee(e),i=re(e,"common"),{defaultLocale:a,restLocale:o}=await i.readLocale(),s=Ie(e),u=[],{name:f,visible:l}=n,c=await i.getSlug({query:f}),p=await s.save({name:f,visible:l,locale:a,slug:c});u.push(await this.getById({documentId:p.documentId}));for(const d of o){const h=await s.save({name:f,visible:l,locale:d,slug:c,documentId:p.documentId});u.push(await this.getById({documentId:h.documentId}))}return u.map(d=>{tn(t,"onChangeNavigation",{actionType:"CREATE",oldEntity:d,newEntity:d})}),await i.emitEvent({entity:p,event:"entry.create",uid:r.uid}),{...p,items:[]}},async put({auditLog:t,payload:n}){const{masterModel:r}=Ee(e),i=re(e,"common"),{defaultLocale:a,restLocale:o}=await i.readLocale(),s=Ie(e),{name:u,visible:f,items:l}=n,c=await s.findOne({filters:{documentId:n.documentId},locale:n.locale,populate:"*"}),p=await this.getById({documentId:n.documentId,locale:n.locale});if(c.name!==u||c.visible!==f){const h=u?await i.getSlug({query:u}):c.slug,m=await Promise.all([a,...o].map(g=>s.findOne({filters:{documentId:c.documentId},locale:g})));for(const g of m)await s.save({documentId:g.documentId,id:g.id,slug:h,locale:g.locale,name:u,visible:f})}return await i.analyzeBranch({navigationItems:l??[],masterEntity:c,prevAction:{}}).then(YE).then(async h=>{const m=await this.getById({documentId:c.documentId});tn(t,"onChangeNavigation",{actionType:h,oldEntity:p,newEntity:m})}),await i.emitEvent({entity:await s.findOne({filters:{documentId:n.documentId},populate:"*"}),event:"entry.update",uid:r.uid}),await this.getById({documentId:n.documentId,locale:n.locale,populate:["related"]})},async delete({auditLog:t,documentId:n}){const r=Ie(e),i=Le(e),a=await this.getById({documentId:n}),o=async f=>{f.length<1||await i.removeForIds(await i.findForMasterIds(f).then(l=>l.reduce((c,{documentId:p})=>(p&&c.push(p),c),[])))},s=await r.findOne({filters:{documentId:n},populate:"*"}),u=await r.find({filters:{documentId:s.documentId},populate:"*"});await o(u.map(({id:f})=>f)),await r.remove({documentId:s.documentId}),tn(t,"onNavigationDeletion",{entity:a,actionType:"DELETE"})},async restart(){e.strapi.reload.isWatching=!1,setImmediate(()=>e.strapi.reload())},async restoreConfig(){console.log("restore");const t=re(e,"common");await(await t.getPluginStore()).delete({key:"config"}),await t.setDefaultConfig()},async refreshNavigationLocale(t){if(!t)return;const n=re(e,"common"),{defaultLocale:r}=await n.readLocale(),i=Ie(e),a=await i.find({limit:Number.MAX_SAFE_INTEGER,locale:r});await Promise.all(a.map(({name:o,visible:s,slug:u,documentId:f})=>i.save({name:o,visible:s,locale:t,slug:u,documentId:f})))},async updateConfig({config:t}){const n=re(e,"common"),r=await n.getPluginStore(),i=await r.get({key:"config"}).then(Re.configSchema.parse);ba(t.additionalFields),await r.set({key:"config",value:t});const a=B.differenceBy(i.additionalFields,t.additionalFields,"name").reduce((o,s)=>(typeof s=="string"||o.push(s),o),[]);B.isEmpty(a)||await n.pruneCustomFields({removedFields:a})},async fillFromOtherLocale({auditLog:t,source:n,target:r,documentId:i}){const a=await this.getById({documentId:i,locale:r});return await this.i18nNavigationContentsCopy({source:await this.getById({documentId:i,locale:n,populate:["related"]}),target:a}).then(()=>this.getById({documentId:i,locale:r,populate:["related"]})).then(o=>(tn(t,"onChangeNavigation",{actionType:"UPDATE",oldEntity:a,newEntity:o}),o))},async i18nNavigationContentsCopy({source:t,target:n}){const r=re(e,"common"),i=t.items??[],a=Ie(e);if(n.items?.length)throw new rr("Current navigation is non-empty");if(!n.locale)throw new rr("Current navigation does not have specified locale");if(!i.length)throw new rr("Source navigation is empty");const o=Hu({master:n,locale:n.locale,strapi});await r.createBranch({action:{create:!0},masterEntity:await a.findOne({filters:{documentId:n.documentId},locale:n.locale,populate:"*"}),navigationItems:await Promise.all(i.map(o)),parentItem:void 0})},async readNavigationItemFromLocale({path:t,source:n,target:r}){const i=await this.getById({documentId:n}),a=await this.getById({documentId:r});if(!i)throw new It("Unable to find source navigation for specified query");if(!a)throw new It("Unable to find target navigation for specified query");const o=["path","related","type","uiRouterKey","title","externalPath"],s=t.split(".").map(f=>parseInt(f,10));(!s.some(Number.isNaN)||!s.length)&&new Jc("Path is invalid");let u=B.get(i.items,QE("items",s.map(B.toString)));if(!u)throw new It("Unable to find navigation item");return Ec.parse(B.pick(u,o))},async getContentTypeItems({query:t,uid:n}){const a=await(await re(e,"common").getPluginStore()).get({key:"config"}).then(Re.configSchema.parse),o={publishedAt:{$notNull:!0}},s=B.get(e.strapi.contentTypes,n),{draftAndPublish:u}=s.options,{localized:f=!1}=s?.pluginOptions?.i18n||{};f&&t.locale&&(o.locale=t.locale);const l=pn(e,n);try{return await l.findMany(o,a.contentTypesPopulate[n]||[],u?"published":void 0)}catch(c){return console.error(c),[]}},async purgeNavigationCache(t,n){const r=Ie(e),i=await r.findOne({filters:{documentId:t}});if(!i)throw new It("Navigation is not defined");const a=f=>new RegExp(`/api/navigation/render/${f}`);let o=[a(i.documentId)];n&&(o=(await r.find({filters:{documentId:i.documentId}})).map(({documentId:l})=>a(l)));const u=strapi.plugin("rest-cache").service("cacheStore");return o.push(a(t)),await u.clearByRegexp(o),{success:!0}},async purgeNavigationsCache(){const n=strapi.plugin("rest-cache").service("cacheStore"),r=new RegExp("/api/navigation/render(.*)");return await n.clearByRegexp([r]),{success:!0}}}),sa=(e,t={},n=[])=>{const{title:r,related:i}=e,a=B.isArray(i)?B.last(i):i;if(r)return B.isString(r)&&!B.isEmpty(r)?r:void 0;if(a){const o=ZE(a,t,n);return B.isString(o)&&!B.isEmpty(o)?o:void 0}},ZE=(e,t={},n=[])=>{const{__contentType:r}=e,i=B.find(n,o=>o.contentTypeName===r),{default:a=[]}=t;return B.get(t,`${i?i.collectionName:""}`,a).map(o=>e[o]).filter(o=>o)[0]||""},ua=(e,t)=>{const n=Bu(e),r=t?n.filter(({path:a})=>a.includes(t)):n,i=r.find(({path:a})=>a===t);return{root:i,items:B.isNil(i)?[]:e.filter(({documentId:a})=>r.find(o=>o.documentId===a))}},Bu=(e,t,n=null)=>e.filter(r=>!r.parent==null&&!t?!0:r.parent?.documentId===t).reduce((r,i)=>{const a=`${n||""}/${i.path}`.replace("//","/");return[{documentId:i.documentId,parent:n&&i.parent?.documentId?{id:i.parent?.id,documentId:i.parent?.documentId,path:n}:void 0,path:a},...Bu(e,i.documentId,a),...r]},[]),JE=(e,t)=>{const n=B.zipWith(e,t,(r,i)=>B.isNil(r)?-1:B.isNil(i)?1:r-i);return B.find(n,r=>r!==0)||0},ew=e=>({async readAll({locale:t,orderBy:n="createdAt",orderDirection:r="DESC"}){return Ie(e).find({locale:t,orderBy:{[n]:r}})},renderRFRNavigationItem({item:t}){const{uiRouterKey:n,title:r,path:i,type:a,audience:o,additionalFields:s}=t,u={label:r,type:a,audience:o?.map(({key:f})=>f),additionalFields:s};if(a==="WRAPPER")return{...u};if(a==="EXTERNAL")return Sa(i,new St("External navigation item's path is undefined",t)),{...u,url:i};if(a==="INTERNAL")return{...u,page:n};if(a==="WRAPPER")return{...u};throw new St("Unknown item type",t)},renderRFRPage({item:t,parent:n,enabledCustomFieldsNames:r}){const{documentId:i,uiRouterKey:a,title:o,path:s,related:u,type:f,audience:l,menuAttached:c,additionalFields:p}=t,d=r.reduce((h,m)=>({...h,[m]:p?.[m]}),{});return{id:a,documentId:i,title:o,related:f==="INTERNAL"&&u?.documentId&&u?.__type?{contentType:u.__type,documentId:u.documentId}:void 0,path:s,parent:n,audience:l,menuAttached:c,additionalFields:d}},renderRFR({items:t,parent:n,parentNavItem:r,contentTypes:i=[],enabledCustomFieldsNames:a}){const o=[];let s={},u={};return t.forEach(f=>{const{items:l,...c}=f,p=this.renderRFRNavigationItem({item:c}),d=this.renderRFRPage({item:c,parent:n,enabledCustomFieldsNames:a});if(f.type!=="EXTERNAL"&&(u={...u,[d.documentId]:{...d}}),f.menuAttached&&o.push(p),!n)s={...s,root:o};else{const h=o.filter(m=>m.type);B.isEmpty(h)||(s={...s,[n]:h.concat(r||[])})}if(!B.isEmpty(l)){const{nav:h}=this.renderRFR({items:l??[],parent:d.documentId,parentNavItem:p,contentTypes:i,enabledCustomFieldsNames:a}),{pages:m}=this.renderRFR({items:l||[],parent:d.documentId,parentNavItem:p,contentTypes:i,enabledCustomFieldsNames:a});u={...u,...m},s={...s,...h}}}),{pages:u,nav:s}},renderTree({items:t=[],documentId:n,path:r="",itemParser:i=a=>Promise.resolve(a)}){return Promise.all(t.reduce((a,o)=>(o.parent?.documentId===n&&a.push(i(B.cloneDeep(o),r)),a),[])).then(a=>a.sort((o,s)=>o.order!==void 0&&s.order!==void 0?o.order-s.order:0))},getCustomFields(t){return t.reduce((n,r)=>(r!=="audience"&&n.push(r),n),[])},async renderType({criteria:t={},filter:n,itemCriteria:r={},locale:i,populate:a,rootPath:o,type:s="FLAT",wrapRelated:u,status:f="published"}){const l=re(e,"admin"),c=re(e,"common"),p={...t,visible:!0},d=Ie(e),h=Le(e);let m;if(i?m=await d.find({filters:{...p},locale:i,limit:1}):m=await d.find({filters:p,limit:1}),B.isArray(m)&&(m=B.first(m)),m&&m.documentId){const g=await h.find({filters:{master:B.pick(m,["slug","id"]),...r},locale:i,limit:Number.MAX_SAFE_INTEGER,order:[{order:"asc"}],populate:["audience","parent","related"]}),b=await c.mapToNavigationItemDTO({locale:i,master:m,navigationItems:g,populate:a,status:f}),{contentTypes:S,contentTypesNameFields:T,additionalFields:A}=await l.config({viaSettingsPage:!1}),C=this.getCustomFields(A).reduce((_,N)=>N.enabled?[..._,N.name]:_,[]),F=_=>u&&_?{documentId:_.documentId,..._}:_,j=A.filter(_=>typeof _!="string"),x=_=>(N,v)=>{const M=j.find(({name:K})=>K===v);let H=_.additionalFields?.[v];if(H)switch(M?.type){case"media":H=JSON.parse(H);break;case"boolean":H=H==="true";break}return{...N,[v]:H}};switch(s){case"TREE":case"RFR":const _=async($,k="")=>{const U=$.type==="EXTERNAL",z=U?void 0:`${k==="/"?"":k}/${B.first($.path)==="/"?$.path.substring(1):$.path}`,V=typeof z=="string"?await c.getSlug({query:(B.first(z)==="/"?z.substring(1):z).replace(/\//g,"-")}):void 0,ee=B.isArray($.related)?B.last($.related):$.related,Te=F(ee),I=C.reduce(x($),{});return{id:$.id,documentId:$.documentId,title:sa($,T,S)??"Title missing",menuAttached:$.menuAttached,order:$.order,path:(U?$.externalPath:z)??"Path is missing",type:$.type,uiRouterKey:$.uiRouterKey,slug:!V&&$.uiRouterKey?await c.getSlug({query:$.uiRouterKey}):V,related:U||!ee?void 0:{...Te},audience:B.isEmpty($.audience)?void 0:$.audience,items:await this.renderTree({itemParser:_,path:z,documentId:$.documentId,items:b}),collapsed:$.collapsed,additionalFields:I||{}}},{items:N,root:v}=ua(b,o),M=await this.renderTree({itemParser:_,items:B.isNil(o)?b:N,path:v?.parent?.path,documentId:v?.parent?.documentId}),H=n?M.filter($=>$.uiRouterKey===n):M;return s==="RFR"?this.renderRFR({items:H,contentTypes:S.map($=>$.contentTypeName),enabledCustomFieldsNames:C}):H;default:const K=B.isNil(o)?b:ua(b,o).items,E=new Map,w=($,k=E)=>{const U=k.get($);if(!B.isNil(U))return U;const z=K.find(I=>I.documentId===$);if(B.isNil(z))return[];const{order:V,parent:ee}=z,Te=ee?w(ee.documentId,k).concat(V):[V];return k.set($,Te),Te};return K.map($=>{const k=C.reduce(x($),{});return{...$,audience:$.audience?.map(U=>U.key),title:sa($,T,S)||"",related:F($.related),items:null,additionalFields:k}}).sort(($,k)=>JE(w($.documentId),w(k.documentId)))}}throw new It},renderChildren({childUIKey:t,idOrSlug:n,locale:r,menuOnly:i,type:a="FLAT",wrapRelated:o,status:s}){const u={$or:[{documentId:n},{slug:n}]},f=a==="FLAT"?void 0:t,l={...i&&{menuAttached:!0},...a==="FLAT"?{uiRouterKey:t}:{}};return this.renderType({type:a,criteria:u,itemCriteria:l,filter:f,wrapRelated:o,locale:r,status:s})},render({idOrSlug:t,locale:n,menuOnly:r,populate:i,rootPath:a,type:o="FLAT",wrapRelated:s,status:u}){const f={$or:[{documentId:t},{slug:t}]},l=r?{menuAttached:!0}:{};return this.renderType({type:o,criteria:f,itemCriteria:l,rootPath:a,wrapRelated:s,locale:n,populate:i,status:u})}}),tw=({checkData:e,parentItem:t})=>new Promise((n,r)=>{if(t&&t.items){for(let i of e)for(let a of t.items)if(a.path===i.path&&a.id!==i.id&&i.type==="INTERNAL"&&!a.removed)return r(new St(`Duplicate path:${i.path} in parent: ${t.title||"root"} for ${i.title} and ${a.title} items`,{parentTitle:t.title,parentId:t.id,path:i.path,errorTitles:[i.title,a.title]}))}return n()}),nn={navigation:{},"navigation-item":{}},nw=e=>({async getPluginStore(){return await strapi.store({type:"plugin",name:"navigation"})},async mapToNavigationItemDTO({locale:t,master:n,navigationItems:r,parent:i,populate:a,status:o="published"}){const s=[],f=await(await this.getPluginStore()).get({key:"config"}).then(Re.configSchema.parse),l=await Promise.all(r.map(async c=>{if(!c.related?.__type||!c.related.documentId)return c;const p=f.contentTypesPopulate[c.related.__type],h=await pn({strapi},c.related.__type).findById(c.related.documentId,p,o,{locale:t});return{...c,related:{...h,__type:c.related.__type,documentId:c.related.documentId}}}));for(const c of l){const{items:p=[],...d}=c;s.push({...d,parent:i??d.parent,items:await this.mapToNavigationItemDTO({navigationItems:p,populate:a,master:n,parent:d,locale:t,status:o})})}return s},setDefaultConfig(){return _a({strapi,forceDefault:!0})},getBranchName({item:t}){const n=!!t.documentId,r=t.removed;if(n&&!r)return"toUpdate";if(n&&r)return"toRemove";if(!n&&!r)return"toCreate"},async analyzeBranch({masterEntity:t,navigationItems:n=[],parentItem:r,prevAction:i={}}){const{toCreate:a,toRemove:o,toUpdate:s}=n.reduce((l,c)=>{const p=this.getBranchName({item:c});return p?{...l,[p]:[...l[p],c]}:l},{toRemove:[],toCreate:[],toUpdate:[]}),u={create:i.create||a.length>0,update:i.update||s.length>0,remove:i.remove||o.length>0},f=[...a,...s];return await tw({checkData:f,parentItem:r}),Promise.all([this.createBranch({action:u,masterEntity:t,navigationItems:a,parentItem:r}),this.removeBranch({navigationItems:o,action:u}),this.updateBranch({action:u,masterEntity:t,navigationItems:s,parentItem:r})]).then(([l,c,p])=>[...l,...c,...p])},async removeBranch({navigationItems:t=[],action:n={}}){const r=[];for(const i of t)i.documentId&&(n.remove=!0,await Le(e).remove(i),r.push(n),i.items?.length&&(await this.removeBranch({navigationItems:i.items})).forEach(o=>{r.push(o)}));return r},async createBranch({action:t,masterEntity:n,navigationItems:r,parentItem:i}){let a=[];for(const o of r){t.create=!0;const{parent:s,master:u,items:f,documentId:l,id:c,...p}=o,d=l&&c?{...p,documentId:l,id:c,master:n?n.id:void 0,parent:i?i.id:void 0}:{...p,documentId:void 0,id:void 0,master:n?n.id:void 0,parent:i?i.id:void 0},h=await Le(e).save({item:d,locale:n?.locale});if(o.items?.length){const m=await this.createBranch({action:{},masterEntity:n,navigationItems:o.items,parentItem:h});a=a.concat(m).concat([t])}else a.push(t)}return a},async updateBranch({masterEntity:t,navigationItems:n,action:r,parentItem:i}){const a=[];for(const o of n){r.update=!0;const{documentId:s,updated:u,parent:f,master:l,items:c,...p}=o;let d;u?d=await Le(e).save({item:{documentId:s,...p},locale:t?.locale}):d=o,c?.length?(await this.analyzeBranch({navigationItems:c,prevAction:{},masterEntity:t,parentItem:d})).forEach(m=>{a.push(m)}):a.push(r)}return a},async emitEvent({entity:t,event:n,uid:r}){const i=strapi.getModel(r),a=await ed({...i,schema:i.__schema__,getModel:()=>i},t);strapi.webhookRunner?strapi.webhookRunner.eventHub.emit(n,{model:i.modelName,entry:a}):console.warn("Webhook runner not present. Contact with Strapi Navigation Plugin team.")},async pruneCustomFields({removedFields:t}){const n=t.map(({name:o})=>`additionalFields.${o}`),r=t.map(({name:o})=>o),a=(await Le(e).find({filters:{additionalFields:{$contains:[r]}}})).map(o=>B.omit(o,n));for(const o of a)await Le(e).save({item:{documentId:o.documentId,additionalFields:o.additionalFields}})},async getSlug({query:t}){let n=dc.default(t);if(n){const r=await Le(e).count({$or:[{uiRouterKey:{$startsWith:n}},{uiRouterKey:n}]});r&&(n=`${n}-${r}`)}return n.toLowerCase()},registerLifeCycleHook({callback:t,contentTypeName:n,hookName:r}){nn[n][r]||(nn[n][r]=[]),nn[n][r]?.push(t)},async runLifeCycleHook({contentTypeName:t,event:n,hookName:r}){const i=nn[t][r]??[];for(const a of i)await a(n)},buildNestedStructure({navigationItems:t,id:n}){return t?.reduce((r,i)=>(n&&i.parent?.id!==n||r.push({...B.omit(i,["related","items"]),related:i.related,items:this.buildNestedStructure({navigationItems:t,id:i.id})}),r),[])??[]},async readLocale(){const t=strapi.plugin("i18n").service("locales");let n=await t.getDefaultLocale(),r=(await t.find({})).map(({code:i})=>i).filter(i=>i!==n);return n||(n=r[0],r=r.slice(1)),{defaultLocale:n,restLocale:r}},updateConfigSchema:Lc,updateCreateNavigationSchema:Mc,updateNavigationItemAdditionalField:kc,updateNavigationItemCustomField:Dc,updateUpdateNavigationSchema:jc}),ca="navigations_items",la="related",rw=e=>({async migrateRelatedIdToDocumentId(){if(!await strapi.db.connection.schema.hasColumn(ca,la))return;console.log("Navigation plugin :: Migrations :: Related id to document id - START");const n=Le(e),r=await n.findV4({filters:{},limit:Number.MAX_SAFE_INTEGER});await Promise.all(r.map(async i=>{const a=i.related;if(a&&typeof a=="string"){const[o,s]=a.split(Uc);if(!B.isNaN(parseInt(s,10))){const u=await e.strapi.query(o).findOne({where:{id:s}});u&&await n.save({item:{documentId:i.documentId,related:{__type:o,documentId:u.documentId}}})}}})),await strapi.db.connection.schema.alterTable(ca,i=>{i.dropColumn(la)}),console.log("Navigation plugin :: Migrations :: Related id to document id - DONE")}}),iw={admin:XE,common:nw,client:ew,migrate:rw},ow={bootstrap:Tl,destroy:Cl,register:Rl,config:Or,controllers:Kl,contentTypes:Dl,middlewares:Wl,policies:zl,routes:Vl,services:iw};module.exports=ow;
74
+ `+e.slice(o+1):u+=e.slice(i),u.slice(1)}function Cw(e){for(var t="",n,r,i,a=0;a<e.length;a++){if(n=e.charCodeAt(a),n>=55296&&n<=56319&&(r=e.charCodeAt(a+1),r>=56320&&r<=57343)){t+=Zo((n-55296)*1024+r-56320+65536),a++;continue}i=de[n],t+=!i&&Tt(n)?e[a]:i||Zo(n)}return t}function Rw(e,t,n){var r="",i=e.tag,a,o;for(a=0,o=n.length;a<o;a+=1)rt(e,t,n[a],!1,!1)&&(a!==0&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function Fw(e,t,n,r){var i="",a=e.tag,o,s;for(o=0,s=n.length;o<s;o+=1)rt(e,t+1,n[o],!0,!0)&&((!r||o!==0)&&(i+=zr(e,t)),e.dump&&Dt===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=a,e.dump=i||"[]"}function $w(e,t,n){var r="",i=e.tag,a=Object.keys(n),o,s,u,f,l;for(o=0,s=a.length;o<s;o+=1)l="",o!==0&&(l+=", "),e.condenseFlow&&(l+='"'),u=a[o],f=n[u],rt(e,t,u,!1,!1)&&(e.dump.length>1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),rt(e,t,f,!1,!1)&&(l+=e.dump,r+=l));e.tag=i,e.dump="{"+r+"}"}function Iw(e,t,n,r){var i="",a=e.tag,o=Object.keys(n),s,u,f,l,c,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new zt("sortKeys must be a boolean or a function");for(s=0,u=o.length;s<u;s+=1)p="",(!r||s!==0)&&(p+=zr(e,t)),f=o[s],l=n[f],rt(e,t+1,f,!0,!0,!0)&&(c=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,c&&(e.dump&&Dt===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,c&&(p+=zr(e,t)),rt(e,t+1,l,!0,c)&&(e.dump&&Dt===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,i+=p));e.tag=a,e.dump=i||"{}"}function ia(e,t,n){var r,i,a,o,s,u;for(i=n?e.explicitTypes:e.implicitTypes,a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t=="object"&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(u=e.styleMap[s.tag]||s.defaultStyle,xu.call(s.represent)==="[object Function]")r=s.represent(t,u);else if(_u.call(s.represent,u))r=s.represent[u](t,u);else throw new zt("!<"+s.tag+'> tag resolver accepts not "'+u+'" style');e.dump=r}return!0}return!1}function rt(e,t,n,r,i,a){e.tag=null,e.dump=n,ia(e,n,!1)||ia(e,n,!0);var o=xu.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var s=o==="[object Object]"||o==="[object Array]",u,f;if(s&&(u=e.duplicates.indexOf(n),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(s&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),o==="[object Object]")r&&Object.keys(e.dump).length!==0?(Iw(e,t,e.dump,i),f&&(e.dump="&ref_"+u+e.dump)):($w(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(o==="[object Array]"){var l=e.noArrayIndent&&t>0?t-1:t;r&&e.dump.length!==0?(Fw(e,l,e.dump,i),f&&(e.dump="&ref_"+u+e.dump)):(Rw(e,l,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump))}else if(o==="[object String]")e.tag!=="?"&&Aw(e,e.dump,t,a);else{if(e.skipInvalid)return!1;throw new zt("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function Ow(e,t){var n=[],r=[],i,a;for(Yr(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(a)}function Yr(e,t,n){var r,i,a;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)Yr(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)Yr(e[r[i]],t,n)}function Du(e,t){t=t||{};var n=new Ew(t);return n.noRefs||Ow(e,n),rt(n,0,e,!0,!0)?n.dump+`
75
+ `:""}function Nw(e,t){return Du(e,Wt.extend({schema:tw},t))}Pi.dump=Du;Pi.safeDump=Nw;var tr=Gt,Mu=Pi;function nr(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}ie.Type=le;ie.Schema=Rt;ie.FAILSAFE_SCHEMA=$i;ie.JSON_SCHEMA=ou;ie.CORE_SCHEMA=au;ie.DEFAULT_SAFE_SCHEMA=Kt;ie.DEFAULT_FULL_SCHEMA=Jn;ie.load=tr.load;ie.loadAll=tr.loadAll;ie.safeLoad=tr.safeLoad;ie.safeLoadAll=tr.safeLoadAll;ie.dump=Mu.dump;ie.safeDump=Mu.safeDump;ie.YAMLException=qt;ie.MINIMAL_SCHEMA=$i;ie.SAFE_SCHEMA=Kt;ie.DEFAULT_SCHEMA=Jn;ie.scan=nr("scan");ie.parse=nr("parse");ie.compose=nr("compose");ie.addConstructor=nr("addConstructor");var Pw=ie,Lw=Pw;const ju=nu,kw=My,Dw=jy,Mw=Lw,Hu=e=>Mw.safeLoad(Dw(e));eu.exports=e=>kw(ju.readFile)(e,"utf8").then(t=>Hu(t));eu.exports.sync=e=>Hu(ju.readFileSync(e,"utf8"));const jw=e=>/^[a-z][a-zA-Z0-9]+$/.test(e),Hw=e=>/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.test(e),{toString:Bw}=Object.prototype,Uw=Error.prototype.toString,Gw=RegExp.prototype.toString,qw=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Kw=/^Symbol\((.*)\)(.*)$/;function Ww(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":`${e}`}function oa(e,t=!1){if(e==null||e===!0||e===!1)return`${e}`;if(typeof e=="number")return Ww(e);if(typeof e=="string")return t?`"${e}"`:e;if(typeof e=="function")return`[Function ${e.name||"anonymous"}]`;if(typeof e=="symbol")return qw.call(e).replace(Kw,"Symbol($1)");const n=Bw.call(e).slice(8,-1);if(n==="Date"){const r=e;return Number.isNaN(r.getTime())?`${r}`:r.toISOString()}return n==="Error"||e instanceof Error?`[${Uw.call(e)}]`:n==="RegExp"?Gw.call(e):null}function aa(e,t){const n=oa(e,t);return n!==null?n:JSON.stringify(e,function(i,a){const o=oa(this[i],t);return o!==null?o:a},2)}const zw=e=>!me.default.isNil(e),Yw=e=>!me.default.isNull(e);at(jn,"notNil",function(t="${path} must be defined."){return this.test("defined",t,zw)});at(jn,"notNull",function(t="${path} cannot be null."){return this.test("defined",t,Yw)});at(jn,"isFunction",function(t="${path} is not a function"){return this.test("is a function",t,n=>me.default.isUndefined(n)||me.default.isFunction(n))});at(ei,"isCamelCase",function(t="${path} is not in camel case (anExampleOfCamelCase)"){return this.test("is in camelCase",t,n=>n?jw(n):!0)});at(ei,"isKebabCase",function(t="${path} is not in kebab case (an-example-of-kebab-case)"){return this.test("is in kebab-case",t,n=>n?Hw(n):!0)});at(Ua,"onlyContainsFunctions",function(t="${path} contains values that are not functions"){return this.test("only contains functions",t,n=>me.default.isUndefined(n)||n&&Object.values(n).every(me.default.isFunction))});at(Ga,"uniqueProperty",function(t,n){return this.test("unique",n,function(i){const a=[];if(i?.forEach((o,s)=>{i.filter(f=>C.get(t,f)===C.get(t,o)).length>1&&a.push(this.createError({path:`${this.path}[${s}].${t}`,message:n}))}),a.length)throw new ge(a);return!0})});Zf({mixed:{notType(e){const{path:t,type:n,value:r,originalValue:i}=e,a=i!=null&&i!==r;return`${t} must be a \`${n}\` type, but the final value was: \`${aa(r,!0)}\`${a?` (cast from the value \`${aa(i,!0)}\`).`:"."}`}}});W.union([W.string(),W.array(W.string())]).describe("Select specific fields to return in the response");W.union([W.literal("*"),W.string(),W.array(W.string()),W.record(W.string(),W.any())]).describe("Specify which relations to populate in the response");W.union([W.string(),W.array(W.string()),W.record(W.string(),W.enum(["asc","desc"])),W.array(W.record(W.string(),W.enum(["asc","desc"])))]).describe("Sort the results by specified fields");W.intersection(W.object({withCount:W.boolean().optional().describe("Include total count in response")}),W.union([W.object({page:W.number().int().positive().describe("Page number (1-based)"),pageSize:W.number().int().positive().describe("Number of entries per page")}).describe("Page-based pagination"),W.object({start:W.number().int().min(0).describe("Number of entries to skip"),limit:W.number().int().positive().describe("Maximum number of entries to return")}).describe("Offset-based pagination")])).describe("Pagination parameters");W.record(W.string(),W.any()).describe("Apply filters to the query");W.string().describe("Specify the locale for localized content");W.enum(["draft","published"]).describe("Filter by publication status");W.string().describe("Search query string");const tn=(e,t,n)=>{e&&e.emit&&e.emit(t,n)},Qw=e=>[...new Set(e.filter(t=>!!t).flatMap(({remove:t,create:n,update:r})=>[n?"CREATE":"",r?"UPDATE":"",t?"REMOVE":""].filter(i=>!!i)))].join("_"),Bu=e=>async t=>({title:t.title,path:t.path,audience:t.audience,type:t.type,uiRouterKey:t.uiRouterKey,order:t.order,collapsed:t.collapsed,menuAttached:t.menuAttached,removed:!1,updated:!0,externalPath:t.externalPath,items:t.items?await Promise.all(t.items.map(Bu(e))):[],master:e.master,parent:void 0,related:t.related,additionalFields:t.additionalFields}),Vw=(e,t)=>t.slice(1).reduce((n,r)=>n.concat([e,r]),t.slice(0,1)),Xw=async({strapi:e})=>{const n=!!e.plugin("rest-cache"),r=e.store({type:"plugin",name:"navigation"}),i=Re.configSchema.parse(await r.get({key:"config"}));return n?{hasCachePlugin:n,enabled:!!i.isCacheEnabled}:{hasCachePlugin:n,enabled:!1}},Zw=e=>({async config({viaSettingsPage:t=!1}){const n=re(e,"common"),r=await Xw(e),a=await(await n.getPluginStore()).get({key:"config"}).then(Re.configSchema.parse),{additionalFields:o,cascadeMenuAttached:s,contentTypesPopulate:u,contentTypesNameFields:f,defaultContentType:l,pathDefaultFields:c,allowedLevels:p,preferCustomContentTypes:d}=a,h=!!strapi.plugin("graphql");let m={allowedContentTypes:wa,restrictedContentTypes:Ea,availableAudience:[]};const g=await this.configContentTypes({}),b={contentTypes:await this.configContentTypes({viaSettingsPage:t}),contentTypesNameFields:{default:qc,...B.isObject(f)?f:{}},contentTypesPopulate:B.isObject(u)?u:{},defaultContentType:l,pathDefaultFields:B.isObject(c)?c:{},allowedLevels:p,additionalFields:t?o:o.filter(S=>typeof S=="string"||!!S.enabled),gql:{navigationItemRelated:g.map(({labelSingular:S})=>S.replace(/\s+/g,""))},isGQLPluginEnabled:t?h:void 0,cascadeMenuAttached:s,preferCustomContentTypes:d};if(o.includes("audience")){const S=await Zc(e).find({},Number.MAX_SAFE_INTEGER);m={...m,availableAudience:S}}return{...b,...m,isCacheEnabled:r.enabled,isCachePluginEnabled:r.hasCachePlugin}},async configContentTypes({viaSettingsPage:t=!1}){const i=await(await re(e,"common").getPluginStore()).get({key:"config"}).then(Re.configSchema.parse);return(await Promise.all(i.contentTypes.filter(o=>!!e.strapi.contentTypes[o]&&Qc(o)).map(async o=>{const s=Tr.parse(strapi.contentTypes[o]),{kind:u,options:f,uid:l}=s,c=f?.draftAndPublish,p=u===Hi.SINGLE,d=p&&c,h=m=>({key:o,available:m});if(p){const m=pn(e,l);if(d){const b=d?await m.count({},"published"):!0;return h(b!==0)}return await m.count({})!==0?h(!0):t?h(!1):void 0}return h(!0)}))).reduce((o,s)=>{if(!s?.key)return o;const{key:u,available:f}=s,l=Tr.parse(e.strapi.contentTypes[u]),c=(l.associations||[]).find(({model:k})=>k==="navigationitem"),{uid:p,options:d,info:h,collectionName:m,modelName:g,apiName:b,plugin:S,kind:T,pluginOptions:A={}}=l,R=f&&!d?.hidden;if(!R)return o;const{visible:F=!0}=A["content-manager"]||{},{name:D="",description:x=""}=h,_=B.find(B.get(e.strapi.api,`[${g}].config.routes`,[]),k=>k.handler.includes(".find")),N=_&&_.path.split("/")[1],v=N&&N!==b?N:b||g,j=T===Hi.SINGLE,H=j?v:Mi.default(v),K=Ui(g),w=typeof p=="string"?B.last(p.split(".")).split("-"):[],E=w.length>1?w.reduce((k,U)=>`${k}${B.upperFirst(U)}`,""):B.upperFirst(g),$=D||B.upperFirst(w.length>1?w.join(" "):K);return o.push({uid:p,name:K,draftAndPublish:d?.draftAndPublish,isSingle:j,description:x,collectionName:m,contentTypeName:E,label:j?$:Mi.default(D||$),relatedField:c?c.alias:void 0,labelSingular:Ui($),endpoint:H,plugin:S,available:R,visible:F,templateName:d?.templateName}),o},[])},async get({ids:t,locale:n}){let r={};t&&t.length&&(r.id={$in:t});const i=await Ie(e).find({filters:r,locale:n||"*",limit:Number.MAX_SAFE_INTEGER,populate:["items","items.parent","items.audience","items.related"]}),a=({allItems:o,item:s,parent:u})=>{const f=o.filter(l=>l.parent?.documentId===s.documentId);return{...s,parent:u,items:f.map(l=>a({parent:s,item:l,allItems:o})).sort((l,c)=>l.order-c.order)}};return i.map(o=>({...o,items:o.items?.filter(s=>!s.parent).map(s=>a({allItems:o.items??[],item:s})).sort((s,u)=>s.order-u.order)}))},async getById({documentId:t,locale:n,populate:r=[]}){const i=re(e,"common"),{defaultLocale:a}=await i.readLocale(),o={documentId:t},s=await Ie(e).findOne({filters:o,locale:n||a}),u=await Le(e).find({filters:{master:s.id},locale:n||a,limit:Number.MAX_SAFE_INTEGER,order:[{order:"asc"}],populate:["parent","audience",...r]});return{...s,items:i.buildNestedStructure({navigationItems:u}).filter(({parent:f})=>!f)}},async post({auditLog:t,payload:n}){const{masterModel:r}=we(e),i=re(e,"common"),{defaultLocale:a,restLocale:o}=await i.readLocale(),s=Ie(e),u=[],{name:f,visible:l}=n,c=await i.getSlug({query:f}),p=await s.save({name:f,visible:l,locale:a,slug:c});u.push(await this.getById({documentId:p.documentId}));for(const d of o){const h=await s.save({name:f,visible:l,locale:d,slug:c,documentId:p.documentId});u.push(await this.getById({documentId:h.documentId}))}return u.map(d=>{tn(t,"onChangeNavigation",{actionType:"CREATE",oldEntity:d,newEntity:d})}),await i.emitEvent({entity:p,event:"entry.create",uid:r.uid}),{...p,items:[]}},async put({auditLog:t,payload:n}){const{masterModel:r}=we(e),i=re(e,"common"),{defaultLocale:a,restLocale:o}=await i.readLocale(),s=Ie(e),{name:u,visible:f,items:l}=n,c=await s.findOne({filters:{documentId:n.documentId},locale:n.locale,populate:"*"}),p=await this.getById({documentId:n.documentId,locale:n.locale});if(c.name!==u||c.visible!==f){const h=u?await i.getSlug({query:u}):c.slug,m=await Promise.all([a,...o].map(g=>s.findOne({filters:{documentId:c.documentId},locale:g})));for(const g of m)await s.save({documentId:g.documentId,id:g.id,slug:h,locale:g.locale,name:u,visible:f})}return await i.analyzeBranch({navigationItems:l??[],masterEntity:c,prevAction:{}}).then(Qw).then(async h=>{const m=await this.getById({documentId:c.documentId});tn(t,"onChangeNavigation",{actionType:h,oldEntity:p,newEntity:m})}),await i.emitEvent({entity:await s.findOne({filters:{documentId:n.documentId},populate:"*"}),event:"entry.update",uid:r.uid}),await this.getById({documentId:n.documentId,locale:n.locale,populate:["related"]})},async delete({auditLog:t,documentId:n}){const r=Ie(e),i=Le(e),a=await this.getById({documentId:n}),o=async f=>{f.length<1||await i.removeForIds(await i.findForMasterIds(f).then(l=>l.reduce((c,{documentId:p})=>(p&&c.push(p),c),[])))},s=await r.findOne({filters:{documentId:n},populate:"*"}),u=await r.find({filters:{documentId:s.documentId},populate:"*"});await o(u.map(({id:f})=>f)),await r.remove({documentId:s.documentId}),tn(t,"onNavigationDeletion",{entity:a,actionType:"DELETE"})},async restart(){e.strapi.reload.isWatching=!1,setImmediate(()=>e.strapi.reload())},async restoreConfig(){console.log("restore");const t=re(e,"common");await(await t.getPluginStore()).delete({key:"config"}),await t.setDefaultConfig()},async refreshNavigationLocale(t){if(!t)return;const n=re(e,"common"),{defaultLocale:r}=await n.readLocale(),i=Ie(e),a=await i.find({limit:Number.MAX_SAFE_INTEGER,locale:r});await Promise.all(a.map(({name:o,visible:s,slug:u,documentId:f})=>i.save({name:o,visible:s,locale:t,slug:u,documentId:f})))},async updateConfig({config:t}){const n=re(e,"common"),r=await n.getPluginStore(),i=await r.get({key:"config"}).then(Re.configSchema.parse);ba(t.additionalFields),await r.set({key:"config",value:t});const a=B.differenceBy(i.additionalFields,t.additionalFields,"name").reduce((o,s)=>(typeof s=="string"||o.push(s),o),[]);B.isEmpty(a)||await n.pruneCustomFields({removedFields:a})},async fillFromOtherLocale({auditLog:t,source:n,target:r,documentId:i}){const a=await this.getById({documentId:i,locale:r});return await this.i18nNavigationContentsCopy({source:await this.getById({documentId:i,locale:n,populate:["related"]}),target:a}).then(()=>this.getById({documentId:i,locale:r,populate:["related"]})).then(o=>(tn(t,"onChangeNavigation",{actionType:"UPDATE",oldEntity:a,newEntity:o}),o))},async i18nNavigationContentsCopy({source:t,target:n}){const r=re(e,"common"),i=t.items??[],a=Ie(e);if(n.items?.length)throw new rr("Current navigation is non-empty");if(!n.locale)throw new rr("Current navigation does not have specified locale");if(!i.length)throw new rr("Source navigation is empty");const o=Bu({master:n,locale:n.locale,strapi});await r.createBranch({action:{create:!0},masterEntity:await a.findOne({filters:{documentId:n.documentId},locale:n.locale,populate:"*"}),navigationItems:await Promise.all(i.map(o)),parentItem:void 0})},async readNavigationItemFromLocale({path:t,source:n,target:r}){const i=await this.getById({documentId:n}),a=await this.getById({documentId:r});if(!i)throw new It("Unable to find source navigation for specified query");if(!a)throw new It("Unable to find target navigation for specified query");const o=["path","related","type","uiRouterKey","title","externalPath"],s=t.split(".").map(f=>parseInt(f,10));(!s.some(Number.isNaN)||!s.length)&&new el("Path is invalid");let u=B.get(i.items,Vw("items",s.map(B.toString)));if(!u)throw new It("Unable to find navigation item");return Ec.parse(B.pick(u,o))},async getContentTypeItems({query:t,uid:n}){const a=await(await re(e,"common").getPluginStore()).get({key:"config"}).then(Re.configSchema.parse),o={publishedAt:{$notNull:!0}},s=B.get(e.strapi.contentTypes,n),{draftAndPublish:u}=s.options,{localized:f=!1}=s?.pluginOptions?.i18n||{};f&&t.locale&&(o.locale=t.locale);const l=pn(e,n);try{return await l.findMany(o,a.contentTypesPopulate[n]||[],u?"published":void 0)}catch(c){return console.error(c),[]}},async purgeNavigationCache(t,n){const r=Ie(e),i=await r.findOne({filters:{documentId:t}});if(!i)throw new It("Navigation is not defined");const a=f=>new RegExp(`/api/navigation/render/${f}`);let o=[a(i.documentId)];n&&(o=(await r.find({filters:{documentId:i.documentId}})).map(({documentId:l})=>a(l)));const u=strapi.plugin("rest-cache").service("cacheStore");return o.push(a(t)),await u.clearByRegexp(o),{success:!0}},async purgeNavigationsCache(){const n=strapi.plugin("rest-cache").service("cacheStore"),r=new RegExp("/api/navigation/render(.*)");return await n.clearByRegexp([r]),{success:!0}}}),sa=(e,t={},n=[])=>{const{title:r,related:i}=e,a=B.isArray(i)?B.last(i):i;if(r)return B.isString(r)&&!B.isEmpty(r)?r:void 0;if(a){const o=Jw(a,t,n);return B.isString(o)&&!B.isEmpty(o)?o:void 0}},Jw=(e,t={},n=[])=>{const{__contentType:r}=e,i=B.find(n,o=>o.contentTypeName===r),{default:a=[]}=t;return B.get(t,`${i?i.collectionName:""}`,a).map(o=>e[o]).filter(o=>o)[0]||""},ua=(e,t)=>{const n=Uu(e),r=t?n.filter(({path:a})=>a.includes(t)):n,i=r.find(({path:a})=>a===t);return{root:i,items:B.isNil(i)?[]:e.filter(({documentId:a})=>r.find(o=>o.documentId===a))}},Uu=(e,t,n=null)=>e.filter(r=>!r.parent==null&&!t?!0:r.parent?.documentId===t).reduce((r,i)=>{const a=`${n||""}/${i.path}`.replace("//","/");return[{documentId:i.documentId,parent:n&&i.parent?.documentId?{id:i.parent?.id,documentId:i.parent?.documentId,path:n}:void 0,path:a},...Uu(e,i.documentId,a),...r]},[]),eE=(e,t)=>{const n=B.zipWith(e,t,(r,i)=>B.isNil(r)?-1:B.isNil(i)?1:r-i);return B.find(n,r=>r!==0)||0},tE=e=>({async readAll({locale:t,orderBy:n="createdAt",orderDirection:r="DESC"}){return Ie(e).find({locale:t,orderBy:{[n]:r}})},renderRFRNavigationItem({item:t}){const{uiRouterKey:n,title:r,path:i,type:a,audience:o,additionalFields:s}=t,u={label:r,type:a,audience:o?.map(({key:f})=>f),additionalFields:s};if(a==="WRAPPER")return{...u};if(a==="EXTERNAL")return Sa(i,new St("External navigation item's path is undefined",t)),{...u,url:i};if(a==="INTERNAL")return{...u,page:n};if(a==="WRAPPER")return{...u};throw new St("Unknown item type",t)},renderRFRPage({item:t,parent:n,enabledCustomFieldsNames:r}){const{documentId:i,uiRouterKey:a,title:o,path:s,related:u,type:f,audience:l,menuAttached:c,additionalFields:p}=t,d=r.reduce((h,m)=>({...h,[m]:p?.[m]}),{});return{id:a,documentId:i,title:o,related:f==="INTERNAL"&&u?.documentId&&u?.__type?{contentType:u.__type,documentId:u.documentId}:void 0,path:s,parent:n,audience:l,menuAttached:c,additionalFields:d}},renderRFR({items:t,parent:n,parentNavItem:r,contentTypes:i=[],enabledCustomFieldsNames:a}){const o=[];let s={},u={};return t.forEach(f=>{const{items:l,...c}=f,p=this.renderRFRNavigationItem({item:c}),d=this.renderRFRPage({item:c,parent:n,enabledCustomFieldsNames:a});if(f.type!=="EXTERNAL"&&(u={...u,[d.documentId]:{...d}}),f.menuAttached&&o.push(p),!n)s={...s,root:o};else{const h=o.filter(m=>m.type);B.isEmpty(h)||(s={...s,[n]:h.concat(r||[])})}if(!B.isEmpty(l)){const{nav:h}=this.renderRFR({items:l??[],parent:d.documentId,parentNavItem:p,contentTypes:i,enabledCustomFieldsNames:a}),{pages:m}=this.renderRFR({items:l||[],parent:d.documentId,parentNavItem:p,contentTypes:i,enabledCustomFieldsNames:a});u={...u,...m},s={...s,...h}}}),{pages:u,nav:s}},renderTree({items:t=[],documentId:n,path:r="",itemParser:i=a=>Promise.resolve(a)}){return Promise.all(t.reduce((a,o)=>(o.parent?.documentId===n&&a.push(i(B.cloneDeep(o),r)),a),[])).then(a=>a.sort((o,s)=>o.order!==void 0&&s.order!==void 0?o.order-s.order:0))},getCustomFields(t){return t.reduce((n,r)=>(r!=="audience"&&n.push(r),n),[])},async renderType({criteria:t={},filter:n,itemCriteria:r={},locale:i,populate:a,rootPath:o,type:s="FLAT",wrapRelated:u,status:f="published"}){const l=re(e,"admin"),c=re(e,"common"),p={...t,visible:!0},d=Ie(e),h=Le(e);let m;if(i?m=await d.find({filters:{...p},locale:i,limit:1}):m=await d.find({filters:p,limit:1}),B.isArray(m)&&(m=B.first(m)),m&&m.documentId){const g=await h.find({filters:{master:B.pick(m,["slug","id"]),...r},locale:i,limit:Number.MAX_SAFE_INTEGER,order:[{order:"asc"}],populate:["audience","parent","related"]}),b=await c.mapToNavigationItemDTO({locale:i,master:m,navigationItems:g,populate:a,status:f}),{contentTypes:S,contentTypesNameFields:T,additionalFields:A}=await l.config({viaSettingsPage:!1}),R=this.getCustomFields(A).reduce((_,N)=>N.enabled?[..._,N.name]:_,[]),F=_=>u&&_?{documentId:_.documentId,..._}:_,D=A.filter(_=>typeof _!="string"),x=_=>(N,v)=>{const j=D.find(({name:K})=>K===v);let H=_.additionalFields?.[v];if(H)switch(j?.type){case"media":H=JSON.parse(H);break;case"boolean":H=H==="true";break}return{...N,[v]:H}};switch(s){case"TREE":case"RFR":const _=async($,k="")=>{const U=$.type==="EXTERNAL",z=U?void 0:`${k==="/"?"":k}/${B.first($.path)==="/"?$.path.substring(1):$.path}`,V=typeof z=="string"?await c.getSlug({query:(B.first(z)==="/"?z.substring(1):z).replace(/\//g,"-")}):void 0,ee=B.isArray($.related)?B.last($.related):$.related,Te=F(ee),I=R.reduce(x($),{});return{id:$.id,documentId:$.documentId,title:sa($,T,S)??"Title missing",menuAttached:$.menuAttached,order:$.order,path:(U?$.externalPath:z)??"Path is missing",type:$.type,uiRouterKey:$.uiRouterKey,slug:!V&&$.uiRouterKey?await c.getSlug({query:$.uiRouterKey}):V,related:U||!ee?void 0:{...Te},audience:B.isEmpty($.audience)?void 0:$.audience,items:await this.renderTree({itemParser:_,path:z,documentId:$.documentId,items:b}),collapsed:$.collapsed,additionalFields:I||{}}},{items:N,root:v}=ua(b,o),j=await this.renderTree({itemParser:_,items:B.isNil(o)?b:N,path:v?.parent?.path,documentId:v?.parent?.documentId}),H=n?j.filter($=>$.uiRouterKey===n):j;return s==="RFR"?this.renderRFR({items:H,contentTypes:S.map($=>$.contentTypeName),enabledCustomFieldsNames:R}):H;default:const K=B.isNil(o)?b:ua(b,o).items,w=new Map,E=($,k=w)=>{const U=k.get($);if(!B.isNil(U))return U;const z=K.find(I=>I.documentId===$);if(B.isNil(z))return[];const{order:V,parent:ee}=z,Te=ee?E(ee.documentId,k).concat(V):[V];return k.set($,Te),Te};return K.map($=>{const k=R.reduce(x($),{});return{...$,audience:$.audience?.map(U=>U.key),title:sa($,T,S)||"",related:F($.related),items:null,additionalFields:k}}).sort(($,k)=>eE(E($.documentId),E(k.documentId)))}}throw new It},renderChildren({childUIKey:t,idOrSlug:n,locale:r,menuOnly:i,type:a="FLAT",wrapRelated:o,status:s}){const u={$or:[{documentId:n},{slug:n}]},f=a==="FLAT"?void 0:t,l={...i&&{menuAttached:!0},...a==="FLAT"?{uiRouterKey:t}:{}};return this.renderType({type:a,criteria:u,itemCriteria:l,filter:f,wrapRelated:o,locale:r,status:s})},render({idOrSlug:t,locale:n,menuOnly:r,populate:i,rootPath:a,type:o="FLAT",wrapRelated:s,status:u}){const f={$or:[{documentId:t},{slug:t}]},l=r?{menuAttached:!0}:{};return this.renderType({type:o,criteria:f,itemCriteria:l,rootPath:a,wrapRelated:s,locale:n,populate:i,status:u})}}),nE=({checkData:e,parentItem:t})=>new Promise((n,r)=>{if(t&&t.items){for(let i of e)for(let a of t.items)if(a.path===i.path&&a.id!==i.id&&i.type==="INTERNAL"&&!a.removed)return r(new St(`Duplicate path:${i.path} in parent: ${t.title||"root"} for ${i.title} and ${a.title} items`,{parentTitle:t.title,parentId:t.id,path:i.path,errorTitles:[i.title,a.title]}))}return n()}),nn={navigation:{},"navigation-item":{}},rE=e=>({async getPluginStore(){return await strapi.store({type:"plugin",name:"navigation"})},async mapToNavigationItemDTO({locale:t,master:n,navigationItems:r,parent:i,populate:a,status:o="published"}){const s=[],f=await(await this.getPluginStore()).get({key:"config"}).then(Re.configSchema.parse),l=await Promise.all(r.map(async c=>{if(!c.related?.__type||!c.related.documentId)return c;const p=f.contentTypesPopulate[c.related.__type],h=await pn({strapi},c.related.__type).findById(c.related.documentId,p,o,{locale:t});return{...c,related:{...h,__type:c.related.__type,documentId:c.related.documentId}}}));for(const c of l){const{items:p=[],...d}=c;s.push({...d,parent:i??d.parent,items:await this.mapToNavigationItemDTO({navigationItems:p,populate:a,master:n,parent:d,locale:t,status:o})})}return s},setDefaultConfig(){return _a({strapi,forceDefault:!0})},getBranchName({item:t}){const n=!!t.documentId,r=t.removed;if(n&&!r)return"toUpdate";if(n&&r)return"toRemove";if(!n&&!r)return"toCreate"},async analyzeBranch({masterEntity:t,navigationItems:n=[],parentItem:r,prevAction:i={}}){const{toCreate:a,toRemove:o,toUpdate:s}=n.reduce((l,c)=>{const p=this.getBranchName({item:c});return p?{...l,[p]:[...l[p],c]}:l},{toRemove:[],toCreate:[],toUpdate:[]}),u={create:i.create||a.length>0,update:i.update||s.length>0,remove:i.remove||o.length>0},f=[...a,...s];return await nE({checkData:f,parentItem:r}),Promise.all([this.createBranch({action:u,masterEntity:t,navigationItems:a,parentItem:r}),this.removeBranch({navigationItems:o,action:u}),this.updateBranch({action:u,masterEntity:t,navigationItems:s,parentItem:r})]).then(([l,c,p])=>[...l,...c,...p])},async removeBranch({navigationItems:t=[],action:n={}}){const r=[];for(const i of t)i.documentId&&(n.remove=!0,await Le(e).remove(i),r.push(n),i.items?.length&&(await this.removeBranch({navigationItems:i.items})).forEach(o=>{r.push(o)}));return r},async createBranch({action:t,masterEntity:n,navigationItems:r,parentItem:i}){let a=[];for(const o of r){t.create=!0;const{parent:s,master:u,items:f,documentId:l,id:c,...p}=o,d=l&&c?{...p,documentId:l,id:c,master:n?n.id:void 0,parent:i?i.id:void 0}:{...p,documentId:void 0,id:void 0,master:n?n.id:void 0,parent:i?i.id:void 0},h=await Le(e).save({item:d,locale:n?.locale});if(o.items?.length){const m=await this.createBranch({action:{},masterEntity:n,navigationItems:o.items,parentItem:h});a=a.concat(m).concat([t])}else a.push(t)}return a},async updateBranch({masterEntity:t,navigationItems:n,action:r,parentItem:i}){const a=[];for(const o of n){r.update=!0;const{documentId:s,updated:u,parent:f,master:l,items:c,...p}=o;let d;u?d=await Le(e).save({item:{documentId:s,...p},locale:t?.locale}):d=o,c?.length?(await this.analyzeBranch({navigationItems:c,prevAction:{},masterEntity:t,parentItem:d})).forEach(m=>{a.push(m)}):a.push(r)}return a},async emitEvent({entity:t,event:n,uid:r}){const i=strapi.getModel(r),a=await td({...i,schema:i.__schema__,getModel:()=>i},t);strapi.webhookRunner?strapi.webhookRunner.eventHub.emit(n,{model:i.modelName,entry:a}):console.warn("Webhook runner not present. Contact with Strapi Navigation Plugin team.")},async pruneCustomFields({removedFields:t}){const n=t.map(({name:o})=>`additionalFields.${o}`),r=t.map(({name:o})=>o),a=(await Le(e).find({filters:{additionalFields:{$contains:[r]}}})).map(o=>B.omit(o,n));for(const o of a)await Le(e).save({item:{documentId:o.documentId,additionalFields:o.additionalFields}})},async getSlug({query:t}){let n=hc.default(t);if(n){const r=await Le(e).count({$or:[{uiRouterKey:{$startsWith:n}},{uiRouterKey:n}]});r&&(n=`${n}-${r}`)}return n.toLowerCase()},registerLifeCycleHook({callback:t,contentTypeName:n,hookName:r}){nn[n][r]||(nn[n][r]=[]),nn[n][r]?.push(t)},async runLifeCycleHook({contentTypeName:t,event:n,hookName:r}){const i=nn[t][r]??[];for(const a of i)await a(n)},buildNestedStructure({navigationItems:t,id:n}){return t?.reduce((r,i)=>(n&&i.parent?.id!==n||r.push({...B.omit(i,["related","items"]),related:i.related,items:this.buildNestedStructure({navigationItems:t,id:i.id})}),r),[])??[]},async readLocale(){const t=strapi.plugin("i18n").service("locales");let n=await t.getDefaultLocale(),r=(await t.find({})).map(({code:i})=>i).filter(i=>i!==n);return n||(n=r[0],r=r.slice(1)),{defaultLocale:n,restLocale:r}},updateConfigSchema:kc,updateCreateNavigationSchema:jc,updateNavigationItemAdditionalField:Dc,updateNavigationItemCustomField:Mc,updateUpdateNavigationSchema:Hc}),ca="navigations_items",la="related",iE=e=>({async migrateRelatedIdToDocumentId(){if(!await strapi.db.connection.schema.hasColumn(ca,la))return;console.log("Navigation plugin :: Migrations :: Related id to document id - START");const n=Le(e),r=await n.findV4({filters:{},limit:Number.MAX_SAFE_INTEGER});await Promise.all(r.map(async i=>{const a=i.related;if(a&&typeof a=="string"){const[o,s]=a.split(Gc);if(!B.isNaN(parseInt(s,10))){const u=await e.strapi.query(o).findOne({where:{id:s}});u&&await n.save({item:{documentId:i.documentId,related:{__type:o,documentId:u.documentId}}})}}})),await strapi.db.connection.schema.alterTable(ca,i=>{i.dropColumn(la)}),console.log("Navigation plugin :: Migrations :: Related id to document id - DONE")}}),oE={admin:Zw,common:rE,client:tE,migrate:iE},aE={bootstrap:Cl,destroy:Rl,register:Fl,config:Or,controllers:Wl,contentTypes:Ml,middlewares:zl,policies:Yl,routes:Xl,services:oE};module.exports=aE;