From 64c45e909bd1a3aefa904df7cb9f1c1e8c240922 Mon Sep 17 00:00:00 2001 From: Demis Bellot Date: Mon, 20 Nov 2023 13:04:30 +0800 Subject: [PATCH] add lib --- .gitignore | 1 - .../lib/mjs/servicestack-client.min.mjs | 1 + MyApp/wwwroot/lib/mjs/servicestack-client.mjs | 2898 +++ MyApp/wwwroot/lib/mjs/vue.min.mjs | 6 + MyApp/wwwroot/lib/mjs/vue.mjs | 15444 ++++++++++++++++ 5 files changed, 18349 insertions(+), 1 deletion(-) create mode 100644 MyApp/wwwroot/lib/mjs/servicestack-client.min.mjs create mode 100644 MyApp/wwwroot/lib/mjs/servicestack-client.mjs create mode 100644 MyApp/wwwroot/lib/mjs/vue.min.mjs create mode 100644 MyApp/wwwroot/lib/mjs/vue.mjs diff --git a/.gitignore b/.gitignore index 8f37bdb..1e910b8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ # Custom #dist/ coverage/ -lib/ App_Data/ # User-specific files diff --git a/MyApp/wwwroot/lib/mjs/servicestack-client.min.mjs b/MyApp/wwwroot/lib/mjs/servicestack-client.min.mjs new file mode 100644 index 0000000..0b2fc10 --- /dev/null +++ b/MyApp/wwwroot/lib/mjs/servicestack-client.min.mjs @@ -0,0 +1 @@ +class ResponseStatus{constructor(e){Object.assign(this,e)}errorCode;message;stackTrace;errors;meta}class ResponseError{constructor(e){Object.assign(this,e)}errorCode;fieldName;message;meta}class ErrorResponse{constructor(e){Object.assign(this,e)}type;responseStatus}class EmptyResponse{constructor(e){Object.assign(this,e)}responseStatus}class NavItem{label;href;exact;id;className;iconClass;show;hide;children;meta;constructor(e){Object.assign(this,e)}}class GetNavItems{constructor(e){Object.assign(this,e)}createResponse(){return new GetNavItemsResponse}getTypeName(){return"GetNavItems"}getMethod(){return"GET"}}class GetNavItemsResponse{baseUrl;results;navItemsMap;meta;responseStatus;constructor(e){Object.assign(this,e)}}class MetadataTypesConfig{baseUrl;defaultNamespaces;defaultImports;includeTypes;excludeTypes;treatTypesAsStrings;globalNamespace;ignoreTypes;exportTypes;exportAttributes;ignoreTypesInNamespaces;constructor(e){Object.assign(this,e)}}class MetadataRoute{path;verbs;notes;summary;constructor(e){Object.assign(this,e)}}class MetadataOperationType{request;response;actions;returnsVoid;returnType;routes;dataModel;viewModel;requiresAuth;requiredRoles;requiresAnyRole;requiredPermissions;requiresAnyPermission;tags;constructor(e){Object.assign(this,e)}}class MetadataTypes{config;namespaces;types;operations;constructor(e){Object.assign(this,e)}}class MetadataTypeName{name;namespace;genericArgs;constructor(e){Object.assign(this,e)}}class MetadataDataContract{name;namespace;constructor(e){Object.assign(this,e)}}class MetadataDataMember{name;order;isRequired;emitDefaultValue;constructor(e){Object.assign(this,e)}}class MetadataAttribute{name;constructorArgs;args;constructor(e){Object.assign(this,e)}}class MetadataPropertyType{name;type;isValueType;isSystemType;isEnum;isPrimaryKey;typeNamespace;genericArgs;value;description;dataMember;readOnly;paramType;displayType;isRequired;allowableValues;allowableMin;allowableMax;attributes;constructor(e){Object.assign(this,e)}}class MetadataType{name;namespace;genericArgs;inherits;implements;displayType;description;isNested;isEnum;isEnumInt;isInterface;isAbstract;dataContract;properties;attributes;innerTypes;enumNames;enumValues;enumMemberValues;enumDescriptions;meta;constructor(e){Object.assign(this,e)}}class NewInstanceResolver{tryResolve(e){return new e}}class SingletonInstanceResolver{tryResolve(e){return e.instance||(e.instance=new e)}}function eventMessageType(e){switch(e){case"onConnect":return"ServerEventConnect";case"onHeartbeat":return"ServerEventHeartbeat";case"onJoin":return"ServerEventJoin";case"onLeave":return"ServerEventLeave";case"onUpdate":return"ServerEventUpdate"}return null}var ReadyState,Types;!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"}(ReadyState=ReadyState||{});class ServerEventsClient{channels;options;eventSource;static UnknownChannel="*";eventStreamUri;updateSubscriberUrl;connectionInfo;serviceClient;stopped;resolver;listeners;EventSource;withCredentials;constructor(e,t,r={},s=null){if(this.channels=t,this.options=r,this.eventSource=s,0===this.channels.length)throw"at least 1 channel is required";this.resolver=this.options.resolver||new NewInstanceResolver,this.eventStreamUri=combinePaths(e,"event-stream")+"?",this.updateChannels(t),this.serviceClient=new JsonServiceClient(e),this.listeners={},this.withCredentials=!0,this.options.handlers||(this.options.handlers={})}onMessage=e=>{if("undefined"==typeof document){var t,r,s,n=e.data?e.data.indexOf("\n"):-1;if(0<=n)return t=e.data,s=e.lastEventId,r=Object.assign({},{lastEventId:s,data:t.substring(0,n)}),s=Object.assign({},{lastEventId:s,data:t.substring(n+1)}),this._onMessage(r),void this._onMessage(s)}this._onMessage(e)};_onMessage=a=>{if(!this.stopped){let n=this.options;void 0===o&&(o={querySelectorAll:e=>[]});var o,i=splitOnFirst(a.data," ");let e=null,t=i[0];var l=splitOnFirst(t,"@"),l=(1{if(this.eventSource.readyState===EventSource.CLOSED)clearInterval(n.heartbeat),null!=(e=n.handlers.onStop)&&e.apply(this.eventSource),this.reconnectServerEvents({error:new Error("EventSource is CLOSED")});else{var e=new Request(n.heartbeatUrl,{method:"POST",mode:"cors",headers:s,credentials:this.serviceClient.credentials});try{var t,r=await fetch(e);r.ok?await r.text():(t=new Error(r.status+" - "+r.statusText),this.reconnectServerEvents({error:t}))}catch(e){this.reconnectServerEvents({error:e})}}},this.connectionInfo&&this.connectionInfo.heartbeatIntervalMs||n.heartbeatIntervalMs||1e4)),n.unRegisterUrl&&"undefined"!=typeof window&&(window.onunload=()=>{navigator.sendBeacon?(this.stopped=!0,this.eventSource&&this.eventSource.close(),navigator.sendBeacon(n.unRegisterUrl)):this.stop()}),this.updateSubscriberUrl=n.updateSubscriberUrl,this.updateChannels((n.channels||"").split(","))}else{p="onJoin"==h||"onLeave"==h||"onUpdate"==h;let e=n.handlers[h];e?p?e.call(f||o.body,l):e.call(f||o.body,r,a):p||(c=n.receivers&&n.receivers.cmd,this.invokeReceiver(c,h,f,a,"cmd")),p&&(e=n.handlers.onCommand)&&e.call(f||o.body,l)}else"trigger"===u?this.raiseEvent(i,a):"css"===u&&css(d||$$("body"),h,r);c=n.receivers&&n.receivers[u];this.invokeReceiver(c,h,f,a,u),eventMessageType(h)||(p=n.handlers.onMessage)&&p.call(f||o.body,l),n.onTick&&n.onTick()}}};onError=e=>{var t;this.stopped||(e=e||event,null!=(t=this.options.onException)&&t.call(this.eventSource,e),this.options.onTick&&this.options.onTick())};getEventSourceOptions(){return{withCredentials:this.withCredentials}}reconnectServerEvents(t={}){if(!this.stopped){t.error&&this.onError(t.error);const n=this.eventSource;let e=t.url||this.eventStreamUri||n.url;null!=this.options.resolveStreamUrl&&(e=this.options.resolveStreamUrl(e));var r=new(this.EventSource||EventSource)(e,this.getEventSourceOptions()),s=(r.addEventListener("error",e=>(t.onerror||n.onerror||this.onError)(e)),r.addEventListener("message",t.onmessage||n.onmessage||this.onMessage),this.options.onReconnect);return null!=s&&s.call(r,t.error),n.removeEventListener&&(n.removeEventListener("error",this.onError),n.removeEventListener("message",this.onMessage)),n.close(),this.eventSource=r}}start(){if(this.stopped=!1,null==this.eventSource||this.eventSource.readyState===EventSource.CLOSED){let e=this.eventStreamUri;null!=this.options.resolveStreamUrl&&(e=this.options.resolveStreamUrl(e)),this.eventSource=new(this.EventSource||EventSource)(e,this.getEventSourceOptions()),this.eventSource.addEventListener("error",this.onError),this.eventSource.addEventListener("message",e=>this.onMessage(e))}return this}stop(){this.stopped=!0,this.eventSource&&this.eventSource.close();var e=this.options,e=(e&&e.heartbeat&&clearInterval(e.heartbeat),this.connectionInfo);return null==e||null==e.unRegisterUrl?new Promise((e,t)=>e()):(this.connectionInfo=null,fetch(new Request(e.unRegisterUrl,{method:"POST",mode:"cors",credentials:this.serviceClient.credentials})).then(e=>{if(!e.ok)throw new Error(e.status+" - "+e.statusText)}).catch(this.onError))}invokeReceiver(r,e,s,n,t){if(r)if("function"==typeof r&&(r=this.resolver.tryResolve(r)),e=e.replace("-",""),r.client=this,r.request=n,"function"==typeof r[e])r[e].call(s||r,n.body,n);else if(e in r)r[e]=n.body;else{var a=Object.getOwnPropertyDescriptor(r,e);if(null!=a)a.set?a.set(n.body):a.writable&&(r[e]=n.body);else{let t=e.toLowerCase();getAllMembers(r).forEach(e=>{e.toLowerCase()==t&&("function"==typeof r[e]?r[e].call(s||r,n.body,n):r[e]=n.body)});a=r.noSuchMethod;"function"==typeof a&&a.call(s||r,n.target,n)}}}hasConnected(){return null!=this.connectionInfo}registerHandler(e,t){return this.options.handlers||(this.options.handlers={}),this.options.handlers[e]=t,this}setResolver(e){return this.options.resolver=e,this}registerReceiver(e){return this.registerNamedReceiver("cmd",e)}registerNamedReceiver(e,t){return this.options.receivers||(this.options.receivers={}),this.options.receivers[e]=t,this}unregisterReceiver(e="cmd"){return this.options.receivers&&delete this.options.receivers[e],this}updateChannels(e){this.channels=e;var t=null!=this.eventSource?this.eventSource.url:this.eventStreamUri;this.eventStreamUri=t.substring(0,Math.min(t.indexOf("?"),t.length))+"?channels="+e.join(",")+"&t="+(new Date).getTime()}update(e,t){var r,s="string"==typeof e?e.split(","):e,n="string"==typeof t?t.split(","):t,a=[];for(r in this.channels){var o=this.channels[r];null!=n&&-1!==n.indexOf(o)||a.push(o)}if(s)for(var i in s){i=s[i];-1===a.indexOf(i)&&a.push(i)}this.updateChannels(a)}addListener(e,t){return(this.listeners[e]||(this.listeners[e]=[])).push(t),this}removeListener(e,t){e=this.listeners[e];return e&&0<=(t=e.indexOf(t))&&e.splice(t,1),this}raiseEvent(e,t){e=this.listeners[e];e&&e.forEach(e=>{try{e(t)}catch(e){this.onError(e)}})}getConnectionInfo(){if(null==this.connectionInfo)throw"Not Connected";return this.connectionInfo}getSubscriptionId(){return this.getConnectionInfo().id}updateSubscriber(t){return null==t.id&&(t.id=this.getSubscriptionId()),this.serviceClient.post(t).then(e=>{this.update(t.subscribeChannels,t.unsubscribeChannels)}).catch(this.onError)}subscribeToChannels(...t){var e=new UpdateEventSubscriber;return e.id=this.getSubscriptionId(),e.subscribeChannels=t,this.serviceClient.post(e).then(e=>{this.update(t,null)}).catch(this.onError)}unsubscribeFromChannels(...t){var e=new UpdateEventSubscriber;return e.id=this.getSubscriptionId(),e.unsubscribeChannels=t,this.serviceClient.post(e).then(e=>{this.update(null,t)}).catch(this.onError)}getChannelSubscribers(){var e=new GetEventSubscribers;return e.channels=this.channels,this.serviceClient.get(e).then(e=>e.map(e=>this.toServerEventUser(e))).catch(e=>(this.onError(e),[]))}toServerEventUser(e){var t,r=e.channels,s=new ServerEventUser;for(t in s.userId=e.userId,s.displayName=e.displayName,s.profileUrl=e.profileUrl,s.channels=r?r.split(","):null,e)"userId"!=t&&"displayName"!=t&&"profileUrl"!=t&&"channels"!=t&&(null==s.meta&&(s.meta={}),s.meta[t]=e[t]);return s}}function getAllMembers(e){let s=[];do{var t=Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e).map(e=>e.toString())).sort().filter((e,t,r)=>"constructor"!==e&&(0==t||e!==r[t-1])&&-1===s.indexOf(e));s=s.concat(t)}while((e=Object.getPrototypeOf(e))&&Object.getPrototypeOf(e));return s}class ServerEventReceiver{client;request;noSuchMethod(e,t){}}class UpdateEventSubscriber{id;subscribeChannels;unsubscribeChannels;createResponse(){return new UpdateEventSubscriberResponse}getTypeName(){return"UpdateEventSubscriber"}}class UpdateEventSubscriberResponse{responseStatus}class GetEventSubscribers{channels;createResponse(){return[]}getTypeName(){return"GetEventSubscribers"}}class ServerEventUser{userId;displayName;profileUrl;channels;meta}class HttpMethods{static Get="GET";static Post="POST";static Put="PUT";static Delete="DELETE";static Patch="PATCH";static Head="HEAD";static Options="OPTIONS";static hasRequestBody=e=>!("GET"===e||"DELETE"===e||"HEAD"===e||"OPTIONS"===e)}class GetAccessToken{constructor(e){Object.assign(this,e)}refreshToken;useTokenCookie;createResponse(){return new GetAccessTokenResponse}getTypeName(){return"GetAccessToken"}getMethod(){return"POST"}}class GetAccessTokenResponse{accessToken;responseStatus}class JsonServiceClient{baseUrl;replyBaseUrl;oneWayBaseUrl;mode;credentials;headers;userName;password;bearerToken;refreshToken;refreshTokenUri;useTokenCookie;enableAutoRefreshToken;requestFilter;static globalRequestFilter;responseFilter;static globalResponseFilter;exceptionFilter;urlFilter;onAuthenticationRequired;manageCookies;cookies;parseJson;static toBase64;constructor(e="/"){this.baseUrl=e,this.replyBaseUrl=combinePaths(e,"json","reply")+"/",this.oneWayBaseUrl=combinePaths(e,"json","oneway")+"/",this.mode="cors",this.credentials="include",this.headers=new Headers,this.headers.set("Content-Type","application/json"),this.manageCookies="undefined"==typeof document,this.cookies={},this.enableAutoRefreshToken=!0}setCredentials(e,t){this.userName=e,this.password=t}useBasePath(e){return this.basePath=e,this}set basePath(e){e?("/"!=e[0]&&(e="/"+e),this.replyBaseUrl=combinePaths(this.baseUrl,e)+"/",this.oneWayBaseUrl=combinePaths(this.baseUrl,e)+"/"):(this.replyBaseUrl=combinePaths(this.baseUrl,"json","reply")+"/",this.oneWayBaseUrl=combinePaths(this.baseUrl,"json","oneway")+"/")}apply(e){return e(this),this}get(e,t){return"string"!=typeof e?this.fetch(HttpMethods.Get,e,t):this.fetch(HttpMethods.Get,null,t,this.toAbsoluteUrl(e))}delete(e,t){return"string"!=typeof e?this.fetch(HttpMethods.Delete,e,t):this.fetch(HttpMethods.Delete,null,t,this.toAbsoluteUrl(e))}post(e,t){return this.fetch(HttpMethods.Post,e,t)}postToUrl(e,t,r){return this.fetch(HttpMethods.Post,t,r,this.toAbsoluteUrl(e))}postBody(e,t,r){return this.fetchBody(HttpMethods.Post,e,t,r)}put(e,t){return this.fetch(HttpMethods.Put,e,t)}putToUrl(e,t,r){return this.fetch(HttpMethods.Put,t,r,this.toAbsoluteUrl(e))}putBody(e,t,r){return this.fetchBody(HttpMethods.Put,e,t,r)}patch(e,t){return this.fetch(HttpMethods.Patch,e,t)}patchToUrl(e,t,r){return this.fetch(HttpMethods.Patch,t,r,this.toAbsoluteUrl(e))}patchBody(e,t,r){return this.fetchBody(HttpMethods.Patch,e,t,r)}publish(e,t){return this.sendOneWay(e,t)}sendOneWay(e,t){var r=combinePaths(this.oneWayBaseUrl,nameOf(e));return this.fetch(HttpMethods.Post,e,null,r)}sendAll(e){var t;return 0==e.length?Promise.resolve([]):(t=combinePaths(this.replyBaseUrl,nameOf(e[0])+"[]"),this.fetch(HttpMethods.Post,e,null,t))}sendAllOneWay(e){var t;return 0==e.length?Promise.resolve(void 0):(t=combinePaths(this.oneWayBaseUrl,nameOf(e[0])+"[]"),this.fetch(HttpMethods.Post,e,null,t).then(e=>{}))}createUrlFromDto(e,t){let r=combinePaths(this.replyBaseUrl,nameOf(t));e=HttpMethods.hasRequestBody(e);return r=e?r:appendQueryString(r,t)}toAbsoluteUrl(e){return e.startsWith("http://")||e.startsWith("https://")?e:combinePaths(this.baseUrl,e)}deleteCookie(e){this.manageCookies?delete this.cookies[e]:document&&(document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/")}createRequest({method:e,request:t,url:r,args:s,body:n}){r=r||this.createUrlFromDto(e,t),s&&(r=appendQueryString(r,s)),null!=this.bearerToken?this.headers.set("Authorization","Bearer "+this.bearerToken):null!=this.userName&&this.headers.set("Authorization","Basic "+JsonServiceClient.toBase64(this.userName+":"+this.password)),this.manageCookies&&(0<(s=Object.keys(this.cookies).map(e=>{e=this.cookies[e];return e.expires&&e.expires0{"set-cookie"===t.toLowerCase()&&e.split(",").forEach(e=>r.push(e))}),r.forEach(e=>{e=parseCookie(e);e&&(this.cookies[e.name]=e)})}e.headers.forEach((e,t)=>{"x-cookies"===t.toLowerCase()&&0<=e.split(",").indexOf("ss-reftok")&&(this.useTokenCookie=!0)}),this.applyResponseFilters(e);let r=t&&"string"!=typeof t&&"function"==typeof t.createResponse?t.createResponse():null;if("string"==typeof r)return e.text().then(e=>e);t=e.headers.get("content-type"),t=t&&-1!==t.indexOf("application/json");if(t)return this.json(e).then(e=>e);if("undefined"!=typeof Uint8Array&&r instanceof Uint8Array){if("function"!=typeof e.arrayBuffer)throw new Error("This fetch polyfill does not implement 'arrayBuffer'");return e.arrayBuffer().then(e=>new Uint8Array(e))}if("function"==typeof Blob&&r instanceof Blob){if("function"!=typeof e.blob)throw new Error("This fetch polyfill does not implement 'blob'");return e.blob().then(e=>e)}var s=e.headers.get("content-length");return"0"===s||null==s&&!t?e.text().then(e=>r):this.json(e).then(e=>e)}handleError(e,r,t=null){if(r instanceof Error)throw this.raiseError(e,r);if(r.bodyUsed)throw this.raiseError(r,createErrorResponse(r.status,r.statusText,t));return void 0===r.json&&r.responseStatus?new Promise((e,t)=>t(this.raiseError(null,r))):this.json(r).then(e=>{e=sanitize(e);if(e.responseStatus)throw null!=t&&(e.type=t),e;throw createErrorResponse(r.status,r.statusText,t)}).catch(e=>{if(e instanceof Error||"undefined"!=typeof window&&window.DOMException&&e instanceof window.DOMException)throw this.raiseError(r,createErrorResponse(r.status,r.statusText,t));throw this.raiseError(r,e)})}fetch(e,t,r,s){return this.sendRequest({method:e,request:t,args:r,url:s})}fetchBody(e,t,r,s){var n=combinePaths(this.replyBaseUrl,nameOf(t));return this.sendRequest({method:e,request:r,body:"string"==typeof r||isFormData(r)?r:JSON.stringify(r),url:appendQueryString(n,t),args:s,returns:t})}sendRequest(t){var e=this.createRequest(t);const r=t.returns||t.request;let n=null;const a=()=>{var e=this.createRequest(t);return this.urlFilter&&this.urlFilter(e.url),fetch(e.url,e).then(e=>this.createResponse(e,r)).catch(e=>this.handleError(n,e))};return this.urlFilter&&this.urlFilter(e.url),fetch(e.url,e).then(e=>{return n=e,this.createResponse(e,r)}).catch(e=>{if(401===e.status){if(this.enableAutoRefreshToken&&(this.refreshToken||this.useTokenCookie||null!=this.cookies["ss-reftok"])){const s=new GetAccessToken({refreshToken:this.refreshToken,useTokenCookie:!!this.useTokenCookie});var t=this.refreshTokenUri||this.createUrlFromDto(HttpMethods.Post,s),r=(this.useTokenCookie&&(this.bearerToken=null,this.headers.delete("Authorization")),this.createRequest({method:HttpMethods.Post,request:s,args:null,url:t}));return fetch(t,r).then(e=>this.createResponse(e,s).then(e=>(this.bearerToken=e?.accessToken||null,a()))).catch(e=>this.onAuthenticationRequired?this.onAuthenticationRequired().then(a).catch(e=>this.handleError(n,e,"RefreshTokenException")):this.handleError(n,e,"RefreshTokenException"))}if(this.onAuthenticationRequired)return this.onAuthenticationRequired().then(a)}return this.handleError(n,e)})}raiseError(e,t){return null!=this.exceptionFilter&&this.exceptionFilter(e,t),t}send(e,t,r){return this.sendRequest({method:getMethod(e),request:e,args:t,url:r})}sendVoid(e,t,r){return this.sendRequest({method:getMethod(e),request:e,args:t,url:r})}async api(e,t,r){try{var s=await this.fetch(getMethod(e,r),e,t);return new ApiResult({response:s})}catch(e){return new ApiResult({error:getResponseStatus(e)})}}async apiVoid(e,t,r){try{var s=await this.fetch(getMethod(e,r),e,t);return new ApiResult({response:s??new EmptyResponse})}catch(e){return new ApiResult({error:getResponseStatus(e)})}}async apiForm(e,t,r,s){try{var n=await this.fetchBody(getMethod(e,s),e,t,r);return new ApiResult({response:n})}catch(e){return new ApiResult({error:getResponseStatus(e)})}}async apiFormVoid(e,t,r,s){try{var n=await this.fetchBody(getMethod(e,s),e,t,r);return new ApiResult({response:n??new EmptyResponse})}catch(e){return new ApiResult({error:getResponseStatus(e)})}}}class JsonApiClient{static create(e="/",t){return new JsonServiceClient(e).apply(e=>{e.basePath="/api",e.headers=new Headers,e.enableAutoRefreshToken=!1,t&&t(e)})}}function getMethod(e,t){return t??("function"==typeof e.getMethod?e.getMethod():HttpMethods.Post)}function getResponseStatus(e){return e.responseStatus??e.ResponseStatus??(e.errorCode?e:e.message?createErrorStatus(e.message,e.errorCode):null)}class ApiResult{response;error;constructor(e){Object.assign(this,e)}get completed(){return null!=this.response||null!=this.error}get failed(){return null!=this.error?.errorCode||null!=this.error?.message}get succeeded(){return!this.failed&&null!=this.response}get errorMessage(){return this.error?.message}get errorCode(){return this.error?.errorCode}get errors(){return this.error?.errors??[]}get errorSummary(){return null!=this.error&&0==this.errors.length?this.errorMessage:null}fieldError(e){let t=e.toLowerCase();return this.errors?.find(e=>e.fieldName.toLowerCase()==t)}fieldErrorMessage(e){return this.fieldError(e)?.message}hasFieldError(e){return null!=this.fieldError(e)}showSummary(e=[]){return!!this.failed&&e.every(e=>!this.hasFieldError(e))}summaryMessage(e=[]){if(this.showSummary(e)){let t=e.map(e=>e.toLowerCase());return t.find(e=>-1==t.indexOf(e.toLowerCase()))??this.errorMessage}}addFieldError(e,t,r="Exception"){this.error||(this.error=new ResponseStatus);var s=this.fieldError(e);null!=s?(s.errorCode=r,s.message=t):this.error.errors.push(new ResponseError({fieldName:e,errorCode:r,message:t}))}}function createErrorStatus(e,t="Exception"){return new ResponseStatus({errorCode:t,message:e})}function createFieldError(e,t,r="Exception"){return new ResponseStatus({errors:[new ResponseError({fieldName:e,errorCode:r,message:t})]})}function isFormData(e){return"undefined"!=typeof window&&e instanceof FormData}function createErrorResponse(t,r,s=null){return apply(new ErrorResponse,e=>{null!=s&&(e.type=s),e.responseStatus=apply(new ResponseStatus,e=>{e.errorCode=t&&t.toString(),e.message=r})})}function createError(e,t,r){return new ErrorResponse({responseStatus:new ResponseStatus({errorCode:e,message:t,errors:r?[new ResponseError({errorCode:e,message:t,fieldName:r})]:void 0})})}function toCamelCase(e){return e&&e.charAt(0).toLowerCase()+e.substring(1)}function toPascalCase(e){return e&&e.charAt(0).toUpperCase()+e.substring(1)}function toKebabCase(e){return(e||"").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function map(e,t){return null==e?null:t(e)}function camelCaseAny(e){if(!e||!(e instanceof Object)||Array.isArray(e))return e;var t,r,s,n={};for(t in e)e.hasOwnProperty(t)&&(r=toCamelCase(t),s=e[t],Array.isArray(s)?n[r]=s.map(e=>camelCaseAny(e)):s instanceof Object?n[r]=camelCaseAny(s):n[r]=s);return n}function sanitize(e){return sanitize&&(e.responseStatus||e.errors?e:camelCaseAny(e))}function nameOf(e){if(!e)return"null";if("function"==typeof e.getTypeName)return e.getTypeName();var t=e&&e.constructor;if(null==t)throw e+" doesn't have constructor";return t.name||(e=t.toString()).substring(9,e.indexOf("("))}function log(e,t="LOG"){return console.log(t,e),e}function css(e,t,r){var s="string"==typeof e?document.querySelectorAll(e):e;for(let e=0;er[e]=t[e]),r}function splitCase(e){return"string"!=typeof e?e:e.replace(/([A-Z]|[0-9]+)/g," $1").replace(/_/g," ").trim()}function humanize(e){return!e||0<=e.indexOf(" ")?e:splitCase(toPascalCase(e))}const ucFirst=e=>e.charAt(0).toUpperCase()+e.substring(1),isUpper=e=>"A"<=e&&e<="Z",isLower=e=>"a"<=e&&e<="z",isDigit=e=>"0"<=e&&e<="9",upperOrDigit=e=>isUpper(e)||isDigit(e);function splitTitleCase(t){var r=[];if("string"!=typeof t)return r;let s=0;for(let e=0;e!!e)}function humanify(e){return!e||0<=e.indexOf(" ")?e:ucFirst(splitTitleCase(e).join(" "))}function queryString(e){if(!e||-1===e.indexOf("?"))return{};var t=rightPart(e,"?").split("&"),r={};for(let e=0;e>>e&24),2!=e&&n.length-s!=1||(a+=String.fromCharCode(uint6ToB64(r>>>18&63),uint6ToB64(r>>>12&63),uint6ToB64(r>>>6&63),uint6ToB64(63&r)),r=0);return 0==e?a:a.substring(0,a.length-e)+(1==e?"=":"==")}function uint6ToB64(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65}function _btoa(e){return"function"==typeof btoa?btoa(e):Buffer.from(e).toString("base64")}function _atob(e){return"function"==typeof atob?atob(e):Buffer.from(e,"base64").toString()}function stripQuotes(e){return e&&'"'==e[0]&&'"'==e[e.length]?e.slice(1,-1):e}function tryDecode(t){try{return decodeURIComponent(t)}catch(e){return t}}function parseCookie(e){if(!e)return null;let t=null;var r=e.split(/; */);for(let e=0;enormalizeKey(e)===normalizeKey(t))[0]||""]}function parseResponseStatus(t,r=null){try{var e=JSON.parse(t);return sanitize(e.ResponseStatus||e.responseStatus)}catch(e){return{message:r||e.message||e,__error:{error:e,json:t}}}}function toFormData(e){if("undefined"!=typeof window){var t,r=new FormData;for(t in e)r.append(t,e[t]);return r}}function toObject(e){const t={};if(e){if("object"!=typeof e)throw new Error("keys must be an Array of object keys");Array.prototype.slice.call(e).forEach(e=>{this[e]&&(t[e]=this[e])})}return t}function errorResponseSummary(){var e=this.responseStatus||this.ResponseStatus;return null==e||(e=e.ErrorCode?sanitize(e):e).errors&&0!=e.errors.length?void 0:e.message||e.errorCode}function errorResponseExcept(e){var t=this.responseStatus||this.ResponseStatus;if(null!=t){t=t.ErrorCode?sanitize(t):t,e=toVarNames(e);if(e&&null!=t.errors&&0!=t.errors.length){var r,s,n=e.map(e=>(e||"").toLowerCase());for(r of t.errors)if(-1!==n.indexOf((r.fieldName||"").toLowerCase()))return;for(s of t.errors)if(-1===n.indexOf((s.fieldName||"").toLowerCase()))return s.message||s.errorCode}return t.message||t.errorCode||void 0}}function errorResponse(t){var e;return null==t?errorResponseSummary.call(this):null!=(e=this.responseStatus||this.ResponseStatus)&&null!=(e=e.ErrorCode?sanitize(e):e).errors&&0!=e.errors.length&&(e=e.errors.find(e=>(e.fieldName||"").toLowerCase()==t.toLowerCase()))?e.message||e.errorCode:void 0}function isDate(e){return e&&"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e)}function toDate(e){return e?isDate(e)?e:"/"==e[0]?new Date(parseFloat(/Date\(([^)]+)\)/.exec(e)[1])):new Date(e):null}function toDateFmt(e){return dateFmt(toDate(e))}function padInt(e){return e<10?"0"+e:e}function dateFmt(e=new Date){return e.getFullYear()+"/"+padInt(e.getMonth()+1)+"/"+padInt(e.getDate())}function dateFmtHM(e=new Date){return e.getFullYear()+"/"+padInt(e.getMonth()+1)+"/"+padInt(e.getDate())+" "+padInt(e.getHours())+":"+padInt(e.getMinutes())}function timeFmt12(e=new Date){return padInt((e.getHours()+24)%12||12)+":"+padInt(e.getMinutes())+":"+padInt(e.getSeconds())+" "+(12'+e+""}function attr(e,t){return e.getAttribute(t)}function sattr(e,t,r){return e.setAttribute(t,r)}function rattr(e,t){return e.removeAttribute(t)}function createElement(e,t){var r={className:"class",htmlFor:"for"},s=document.createElement(e);if(t?.attrs)for(const n in t.attrs)sattr(s,r[n]||n,t.attrs[n]);return t?.events&&on(s,t.events),t&&t.insertAfter&&t.insertAfter.parentNode.insertBefore(s,t.insertAfter.nextSibling),s}function showInvalidInputs(){var e,t,r,s=attr(this,"data-invalid");s&&(e=(r="checkbox"===this.type||"radio"===this.type||hasClass(this,"form-check"))?parent(this,"form-check"):null,r?addClass(e||this.parentElement,"is-invalid form-control"):addClass(this,"is-invalid"),(null!=(r=!(t=this.nextElementSibling)||attr(t,"for")!==this.id&&"SMALL"!==t.tagName?this:r?e||t.parentElement:t)&&r.nextElementSibling&&hasClass(r.nextElementSibling,"invalid-feedback")?r.nextElementSibling:createElement("div",{insertAfter:r,attrs:{className:"invalid-feedback"}})).innerHTML=s)}function parent(e,t){for(;null!=e&&!hasClass(e,t);)e=e.parentElement;return e}function hasClass(e,t){return!!e&&(e.classList?e.classList.contains(t):-1<(" "+e.className+" ").replace(/[\n\t\r]/g," ").indexOf(" "+t+" "))}function addClass(e,t){return e?e.classList?e.classList.add(...t.split(" ")):hasClass(e,t)?null:e.className=(e.className+" "+t).trim():null}function remClass(e,t){return e?e.classList?e.classList.remove(t):hasClass(e,t)?e.className=e.className.replace(/(\s|^)someclass(\s|$)/," "):null:null}function isElement(e){return"undefined"!=typeof window&&(e instanceof window.Element||e==window.document)}function $1(e,t){return"string"==typeof e?(t||document).querySelector(e):e||null}function $$(e,t){return"string"==typeof e?Array.from((t||document).querySelectorAll(e)):Array.isArray(e)?e.flatMap(e=>$$(e,t)):[e]}function on(e,s){return $$(e).forEach(r=>{Object.keys(s).forEach(function(e){var t=s[e];"string"==typeof e&&"function"==typeof t&&r.addEventListener(e,s[e]=t.bind(r))})}),s}function addScript(r){return new Promise((e,t)=>{document.body.appendChild(createElement("script",{attrs:{src:r},events:{load:e,error:t}}))})}function delaySet(e,t){t=t&&t.duration||300;let r=setTimeout(()=>e(!0),t);return()=>{clearTimeout(r),e(!1)}}function bootstrap(e){var t=(e||document).querySelectorAll("[data-invalid]");for(let e=0;ehandleEvent(t,r,e)):["click","dblclick","change","focus","blur","focusin","focusout","select","keydown","keypress","keyup","hover","toggle","input"].forEach(e=>{r.querySelector(`[data-${e}]`)&&handleEvent(t,r,e)})}function bootstrapForm(t,r){t&&(r.model&&populateForm(t,r.model),t.onsubmit=function(e){return e.preventDefault(),r.type="bootstrap-v4",ajaxSubmit(t,r)})}function applyErrors(e,r,t){var s={overrideMessages:!1,messages:{NotEmpty:"Required",NotNull:"Required",Email:"Invalid email",AlreadyExists:"Already exists"},errorFilter:function(e,t,r){return this.overrideMessages?this.messages[t]||e||splitCase(t):e||splitCase(t)}};if(clearErrors(e),r){r=sanitize(r),addClass(e,"has-errors");const h=t&&"bootstrap-v4"===t.type;var s={...s,...t},o=(t.messages&&(s.overrideMessages=!0),s.errorFilter.bind(s)),t=r.errors;if(t&&t.length){let n={},a={};$$("input,textarea,select,button").forEach(e=>{var t=e.previousElementSibling,r=e.nextElementSibling,s=("radio"===e.type||"checkbox"===e.type?null:e.id)||attr(e,"name");s&&(s=s.toLowerCase(),n[s]=e,h||(hasClass(t,"help-inline")||hasClass(t,"help-block")?a[s]=t:(hasClass(r,"help-inline")||hasClass(r,"help-block"))&&(a[s]=r)))}),$$(".help-inline[data-for],.help-block[data-for]").forEach(e=>{var t=attr(e,"data-for").toLowerCase();a[t]=e});for(var i of t){var l=(i.fieldName||"").toLowerCase(),u=n[l],c=(u&&(h?("radio"!==(c=attr(u,"type"))&&"checkbox"!==c&&addClass(u,"is-invalid"),sattr(u,"data-invalid",o(i.message,i.errorCode,"field"))):(addClass(u,"error"),addClass(u.parentElement,"has-error"))),a[l]);c&&(addClass(c,"error"),c.innerHTML=o(i.message,i.errorCode,"field"),c.style.display="block")}$$("[data-validation-summary]").forEach(e=>{var t=attr(e,"data-validation-summary").split(","),t=errorResponseExcept.call(r,t);t&&(e.innerHTML=bsAlert(t))})}else{const n=o(r.message||splitCase(r.errorCode),r.errorCode,"summary");h?$$("[data-validation-summary]").forEach(e=>e.innerHTML="<"===n[0]?n:bsAlert(n)):$$(".error-summary").forEach(e=>{e.innerHTML=n(e).style.display="block"})}return e}}function clearErrors(e){remClass(e,"has-errors"),$$(".error-summary").forEach(e=>{e.innerHTML="",e.style.display="none"}),$$("[data-validation-summary]").forEach(e=>{e.innerHTML=""}),$$(".error").forEach(e=>remClass(e,"error")),$$(".form-check.is-invalid [data-invalid]").forEach(e=>{rattr(e,"data-invalid")}),$$(".form-check.is-invalid").forEach(e=>remClass(e,"form-control")),$$(".is-invalid").forEach(e=>{remClass(e,"is-invalid"),rattr(e,"data-invalid")}),$$(".is-valid").forEach(e=>remClass(e,"is-valid"))}function toVarNames(e){return e?isArray(e)?e:e.split(",").map(e=>e.trim()):[]}function formSubmit(e={}){const r=this;var t=attr(r,"enctype")||Types.UrlEncoded;if(t==Types.MultiPart&&void 0===window.FormData)throw new Error(`FormData Type is needed to send '${Types.MultiPart}' Content Types`);let s;try{s=serializeForm(r,t)}catch(e){throw new Error(""+(e.message||e))}var n=new Headers,t=(n.set("Accept",Types.Json),n.set("Content-Type",t),{method:attr(r,"method")||"POST",credentials:"include",mode:"cors",headers:n,body:s});return e.requestFilter&&e.requestFilter(t),fetch(new Request(e.url||attr(r,"action"),t)).catch(e=>{throw new Error(`Network is unreachable (${e.message||e})`)}).then(t=>(e.responseFilter&&e.responseFilter(t),t.ok?(handleHeaderBehaviors(r,t),fromResponse(t)):t.json().catch(e=>{throw new Error("The request failed with "+(t.statusText||t.status))}).then(e=>{throw Object.assign(new ErrorResponse,sanitize(e))})))}function handleHeaderBehaviors(e,t){var r=t.headers.get("X-Location"),r=(r&&(location.href=r),t.headers.get("X-Trigger"));r&&triggerEvent(e,0<=(t=r.indexOf(":"))?r.substring(0,t):r,(e=0<=t?r.substring(t+1):null)?[e]:[])}function ajaxSubmit(s,n={}){const a="bootstrap-v4"===n.type;clearErrors(s);try{if(n.validate&&!1===n.validate.call(s))return!1}catch(e){return!1}addClass(s,"loading");const e=null==n.onSubmitDisable?"[type=submit]":n.onSubmitDisable,t=null!=e&&""!=e;function r(e,t=null){var r;t?applyErrors(s,t.ResponseStatus||t.responseStatus,{...n}):e&&(addClass(s,"has-errors"),(r=$$(".error-summary")[0])&&(r.innerHTML=e),a)&&(r=$$("[data-validation-summary]")[0])&&(r.innerHTML=bsAlert(e)),n.error&&n.error.call(s,t),a&&$$("[data-invalid]").forEach(e=>showInvalidInputs.call(e))}return t&&$$(e).forEach(e=>{sattr(e,"disabled","disabled")}),(n.submit||formSubmit).call(s,n).then(e=>(n.success&&n.success.call(s,e),!1)).catch(e=>{e.responseStatus?r(null,e):r(""+(e.message||e),null)}).finally(()=>{remClass(s,"loading"),t&&$$(e).forEach(e=>{rattr(e,"disabled")}),n.complete&&n.complete.call(s)})}function fromResponse(e){var t,r=e.headers.get("content-type"),r=r&&-1!==r.indexOf(Types.Json);return!r&&("0"===(t=e.headers.get("content-length"))||null==t&&!r)?null:e.json()}function serializeForm(e,t=null){return t===Types.MultiPart?new FormData(e):t==Types.Json?JSON.stringify(serializeToObject(e)):serializeToUrlEncoded(e)}function formEntries(e,r,s){var n,a=e,o=a.elements.length;for(let t=0;te[t]=r)}function serializeToUrlEncoded(e){return formEntries(e,[],(e,t,r)=>"string"==typeof r?e.push(encodeURIComponent(t)+"="+encodeURIComponent(r)):null).join("&").replace(/%20/g,"+")}function serializeToFormData(e){return formEntries(e,new FormData,(e,t,r)=>e.append(t,r))}function sanitizeFormData(e){for(var[t,r]of e)"object"==typeof r&&0===r.size&&e.delete(t);return e}function triggerEvent(e,t,r=null){var s;document.createEvent?((s=document.createEvent("click"==t||t.startsWith("mouse")?"MouseEvents":"HTMLEvents")).initEvent(t,!0,!0),s.data=r,e.dispatchEvent(s)):(r=document.createEventObject(),e.fireEvent("on"+t,r))}function populateForm(r,s){if(s){var n;for(let e in s){let t=s[e];void 0!==t&&null!==t||(t="");var a=r.elements.namedItem(e)||r.elements.namedItem((n=e)&&(n[0]===n[0].toUpperCase()?toCamelCase(n):n[0]===n[0].toLowerCase()?toPascalCase(n):n)),o=a;if(a)switch(o.type||a[0].type){case"radio":case"checkbox":var i=a.length;for(let e=0;e(r(e,t),e),t||{})}function resolve(e,t){e="function"==typeof e?e():e;return"function"==typeof t?t(e):e}function mapGet(e,r){if(!e||!r)return null;var s=e[r];if(s)return s;if("object"!=typeof e)return null;{let t=r.toLowerCase();s=Object.keys(e).find(e=>e.toLowerCase()===t);return s?e[s]:null}}function apiValue(e){return null==e?"":"string"==typeof e?"/Date("===e.substring(0,6)?toDate(e):e.trim():e}function apiValueFmt(e){e=apiValue(e);return(null!=e?isDate(e)?dateFmt(e):e:null)||""}function activeClassNav(e,t){return null!=e.href&&(e.exact||t.length<=1?trimEnd(t,"/").toLowerCase()===trimEnd(e.href,"/").toLowerCase():trimEnd(t,"/").toLowerCase().startsWith(trimEnd(e.href,"/").toLowerCase()))?"active":null}function activeClass(e,t,r){return null!=e&&(r||t.length<=1?trimEnd(t,"/").toLowerCase()===trimEnd(e,"/").toLowerCase():trimEnd(t,"/").toLowerCase().startsWith(trimEnd(e,"/").toLowerCase()))?"active":null}function bootstrapColors(){return["primary","secondary","success","info","warning","danger","light","dark"]}JsonServiceClient.toBase64=e=>_btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(new Number("0x"+t).valueOf()))),"undefined"!=typeof window&&void 0!==window.Element&&(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){let t=this;do{if(t.matches(e))return t}while(null!==(t=t.parentElement||t.parentNode)&&1===t.nodeType);return null})),function(e){e.MultiPart="multipart/form-data",e.UrlEncoded="application/x-www-form-urlencoded",e.Json="application/json"}(Types=Types||{});const BootstrapColors=bootstrapColors();function btnColorClass(e){for(const t of bootstrapColors()){if(e[t])return"btn-"+t;if(e["outline-"+t])return"btn-outline-"+t}return null}function bootstrapSizes(){return["xs","sm","md","lg"]}const BootstrapSizes=bootstrapSizes();function btnSizeClass(e){for(const t of bootstrapSizes())if(e[t])return"btn-"+t;return null}function btnClasses(e){var t=[],r=btnColorClass(e),r=(r&&t.push(r),btnSizeClass(e));return r&&t.push(r),e.block&&t.push("btn-block"),t}class NavDefaults{static navClass="nav";static navItemClass="nav-item";static navLinkClass="nav-link";static childNavItemClass="nav-item dropdown";static childNavLinkClass="nav-link dropdown-toggle";static childNavMenuClass="dropdown-menu";static childNavMenuItemClass="dropdown-item";static create(){return new NavOptions}static forNav(e){return e||NavDefaults.create()}static overrideDefaults(e,t){return null==e?t:((e=Object.assign({},e)).navClass===NavDefaults.navClass&&null!=t.navClass&&(e.navClass=t.navClass),e.navItemClass===NavDefaults.navItemClass&&null!=t.navItemClass&&(e.navItemClass=t.navItemClass),e.navLinkClass===NavDefaults.navLinkClass&&null!=t.navLinkClass&&(e.navLinkClass=t.navLinkClass),e.childNavItemClass===NavDefaults.childNavItemClass&&null!=t.childNavItemClass&&(e.childNavItemClass=t.childNavItemClass),e.childNavLinkClass===NavDefaults.childNavLinkClass&&null!=t.childNavLinkClass&&(e.childNavLinkClass=t.childNavLinkClass),e.childNavMenuClass===NavDefaults.childNavMenuClass&&null!=t.childNavMenuClass&&(e.childNavMenuClass=t.childNavMenuClass),e.childNavMenuItemClass===NavDefaults.childNavMenuItemClass&&null!=t.childNavMenuItemClass&&(e.childNavMenuItemClass=t.childNavMenuItemClass),e)}static showNav(e,t){return null==t||0===t.length?null==e.show:!(null!=e.show&&t.indexOf(e.show)<0||null!=e.hide&&0<=t.indexOf(e.hide))}}class NavLinkDefaults{static forNavLink(e){return e||NavDefaults.create()}}class NavbarDefaults{static navClass="navbar-nav";static create(){return new NavOptions({navClass:NavbarDefaults.navClass})}static forNavbar(e){return NavDefaults.overrideDefaults(e,NavbarDefaults.create())}}class NavButtonGroupDefaults{static navClass="btn-group";static navItemClass="btn btn-primary";static create(){return new NavOptions({navClass:NavButtonGroupDefaults.navClass,navItemClass:NavButtonGroupDefaults.navItemClass})}static forNavButtonGroup(e){return NavDefaults.overrideDefaults(e,NavButtonGroupDefaults.create())}}class LinkButtonDefaults{static navItemClass="btn";static create(){return new NavOptions({navItemClass:LinkButtonDefaults.navItemClass})}static forLinkButton(e){return NavDefaults.overrideDefaults(e||null,LinkButtonDefaults.create())}}class UserAttributes{static fromSession(e){var t=[];return null!=e&&(t.push("auth"),e.roles&&t.push(...e.roles.map(e=>"role:"+e)),e.permissions)&&t.push(...e.permissions.map(e=>"perm:"+e)),t}}class NavOptions{static fromSession(e,t){return(t=t||new NavOptions).attributes=UserAttributes.fromSession(e),t}attributes;activePath;baseHref;navClass;navItemClass;navLinkClass;childNavItemClass;childNavLinkClass;childNavMenuClass;childNavMenuItemClass;constructor(e){this.attributes=[],this.navClass=NavDefaults.navClass,this.navItemClass=NavDefaults.navItemClass,this.navLinkClass=NavDefaults.navLinkClass,this.childNavItemClass=NavDefaults.childNavItemClass,this.childNavLinkClass=NavDefaults.childNavLinkClass,this.childNavMenuClass=NavDefaults.childNavMenuClass,this.childNavMenuItemClass=NavDefaults.childNavMenuItemClass,Object.assign(this,e)}}function classNames(...t){var r=[];for(let e=0;ee.concat(r(t)),[])}function uniq(e){return Array.from(new Set(e)).sort((e,t)=>t/g,">").replace(/'/g,"'").replace(/"/g,"""):""+e}function htmlAttrs(t){let r=[];return Object.keys(t).forEach(e=>{0Object.keys(e).forEach(e=>{-1===t.indexOf(e)&&t.push(e)})),t}function alignLeft(e,t,r=" "){return t<0?"":t+1-e.length<=0?e:r+e+r.repeat(t+1-e.length)}function alignCenter(e,t,r=" "){var s,n;return t<0?"":(n=(e=e||"").length,s=Math.floor(t/2-n/2),n=Math.abs(n%2-t%2),r.repeat(s+1)+e+r.repeat(s+1+n))}function alignRight(e,t,r=" "){return t<0?"":t+1-e.length<=0?e:r.repeat(t+1-e.length)+e+r}function alignAuto(e,t,r=" "){var s=""+e;return s.length<=t?("number"==typeof e?alignRight:alignLeft)(s,t,r):s}function EventBus(){var{subscribe:e,publish:t}=createBus();this.subscribe=e,this.publish=t}function createBus(){let s={};return{subscribe:function(e,t){let r=Symbol("id");return s[e]||(s[e]={}),s[e][r]=t,{unsubscribe:function(){delete s[e][r],0===Object.getOwnPropertySymbols(s[e]).length&&delete s[e]}}},publish:function(t,r){s[t]&&Object.getOwnPropertySymbols(s[t]).forEach(e=>s[t][e](r))}}}class Inspect{static async vars(n){if("object"==typeof process){let s=process.env.INSPECT_VARS;if(s&&n){const e=e=>"node:"+e;await import(e("fs")).then(async r=>{await import(e("path")).then(e=>{var t=s.replace(/\\/g,"/");0<=t.indexOf("/")&&(e=e.dirname(t),r.existsSync(e)||r.mkdirSync(e)),r.writeFileSync(t,JSON.stringify(n))})})}}}static dump(e){return JSON.stringify(e,null,4).replace(/"/g,"")}static printDump(e){console.log(Inspect.dump(e))}static dumpTable(e){let s=e,n=uniqueKeys(s),a={};n.forEach(t=>{let r=t.length;s.forEach(e=>{var e=e[t];null!=e&&(e=(""+e).length)>r&&(r=e)}),a[t]=r});e=Object.keys(a).length,e=Object.keys(a).map(e=>a[e]).reduce((e,t)=>e+t,0)+2*e+(e+1);let o=[],t=(o.push(`+${"-".repeat(e-2)}+`),"|");return n.forEach(e=>t+=alignCenter(e,a[e])+"|"),o.push(t),o.push(`|${"-".repeat(e-2)}|`),s.forEach(t=>{let r="|";n.forEach(e=>r+=alignAuto(t[e],a[e])+"|"),o.push(r)}),o.push(`+${"-".repeat(e-2)}+`),o.join("\n")}static printDumpTable(e){console.log(Inspect.dumpTable(e))}}export{ResponseStatus,ResponseError,ErrorResponse,EmptyResponse,NavItem,GetNavItems,GetNavItemsResponse,MetadataTypesConfig,MetadataRoute,MetadataOperationType,MetadataTypes,MetadataTypeName,MetadataDataContract,MetadataDataMember,MetadataAttribute,MetadataPropertyType,MetadataType,NewInstanceResolver,SingletonInstanceResolver,ReadyState,ServerEventsClient,getAllMembers,ServerEventReceiver,UpdateEventSubscriber,UpdateEventSubscriberResponse,GetEventSubscribers,ServerEventUser,HttpMethods,GetAccessTokenResponse,JsonServiceClient,JsonApiClient,getMethod,getResponseStatus,ApiResult,createErrorStatus,createFieldError,isFormData,createError,toCamelCase,toPascalCase,toKebabCase,map,camelCaseAny,sanitize,nameOf,css,splitOnFirst,splitOnLast,leftPart,rightPart,lastLeftPart,lastRightPart,chop,onlyProps,humanize,ucFirst,isUpper,isLower,isDigit,splitTitleCase,humanify,queryString,combinePaths,createPath,createUrl,appendQueryString,setQueryString,bytesToBase64,stripQuotes,tryDecode,parseCookie,normalizeKey,normalize,getField,parseResponseStatus,toFormData,toObject,errorResponseSummary,errorResponseExcept,errorResponse,isDate,toDate,toDateFmt,padInt,dateFmt,dateFmtHM,timeFmt12,toLocalISOString,toTime,msToTime,padStart,createElement,isElement,$1,$$,on,addScript,delaySet,bootstrap,bindHandlers,bootstrapForm,toVarNames,formSubmit,ajaxSubmit,serializeForm,serializeToObject,serializeToUrlEncoded,serializeToFormData,sanitizeFormData,triggerEvent,populateForm,trimEnd,safeVarName,pick,omit,omitEmpty,apply,each,resolve,mapGet,apiValue,apiValueFmt,activeClassNav,activeClass,BootstrapColors,btnColorClass,BootstrapSizes,btnSizeClass,btnClasses,NavDefaults,NavLinkDefaults,NavbarDefaults,NavButtonGroupDefaults,LinkButtonDefaults,UserAttributes,NavOptions,classNames,fromXsdDuration,toXsdDuration,toTimeSpanFmt,flatMap,uniq,enc,htmlAttrs,indexOfAny,isNullOrEmpty,fromDateTime,toDateTime,fromTimeSpan,toTimeSpan,fromGuid,toGuid,fromByteArray,toByteArray,toBase64String,StringBuffer,JSV,uniqueKeys,alignLeft,alignCenter,alignRight,alignAuto,EventBus,createBus,Inspect}; \ No newline at end of file diff --git a/MyApp/wwwroot/lib/mjs/servicestack-client.mjs b/MyApp/wwwroot/lib/mjs/servicestack-client.mjs new file mode 100644 index 0000000..662ec63 --- /dev/null +++ b/MyApp/wwwroot/lib/mjs/servicestack-client.mjs @@ -0,0 +1,2898 @@ +export class ResponseStatus { + constructor(init) { Object.assign(this, init); } + errorCode; + message; + stackTrace; + errors; + meta; +} +export class ResponseError { + constructor(init) { Object.assign(this, init); } + errorCode; + fieldName; + message; + meta; +} +export class ErrorResponse { + constructor(init) { Object.assign(this, init); } + type; + responseStatus; +} +export class EmptyResponse { + constructor(init) { Object.assign(this, init); } + responseStatus; +} +export class NavItem { + label; + href; + exact; + id; + className; + iconClass; + show; + hide; + children; + meta; + constructor(init) { Object.assign(this, init); } +} +export class GetNavItems { + constructor(init) { Object.assign(this, init); } + createResponse() { return new GetNavItemsResponse(); } + getTypeName() { return 'GetNavItems'; } + getMethod() { return 'GET'; } +} +export class GetNavItemsResponse { + baseUrl; + results; + navItemsMap; + meta; + responseStatus; + constructor(init) { Object.assign(this, init); } +} +export class MetadataTypesConfig { + baseUrl; + defaultNamespaces; + defaultImports; + includeTypes; + excludeTypes; + treatTypesAsStrings; + globalNamespace; + ignoreTypes; + exportTypes; + exportAttributes; + ignoreTypesInNamespaces; + constructor(init) { Object.assign(this, init); } +} +export class MetadataRoute { + path; + verbs; + notes; + summary; + constructor(init) { Object.assign(this, init); } +} +export class MetadataOperationType { + request; + response; + actions; + returnsVoid; + returnType; + routes; + dataModel; + viewModel; + requiresAuth; + requiredRoles; + requiresAnyRole; + requiredPermissions; + requiresAnyPermission; + tags; + constructor(init) { Object.assign(this, init); } +} +export class MetadataTypes { + config; + namespaces; + types; + operations; + constructor(init) { Object.assign(this, init); } +} +export class MetadataTypeName { + name; + namespace; + genericArgs; + constructor(init) { Object.assign(this, init); } +} +export class MetadataDataContract { + name; + namespace; + constructor(init) { Object.assign(this, init); } +} +export class MetadataDataMember { + name; + order; + isRequired; + emitDefaultValue; + constructor(init) { Object.assign(this, init); } +} +export class MetadataAttribute { + name; + constructorArgs; + args; + constructor(init) { Object.assign(this, init); } +} +export class MetadataPropertyType { + name; + type; + isValueType; + isSystemType; + isEnum; + isPrimaryKey; + typeNamespace; + genericArgs; + value; + description; + dataMember; + readOnly; + paramType; + displayType; + isRequired; + allowableValues; + allowableMin; + allowableMax; + attributes; + constructor(init) { Object.assign(this, init); } +} +export class MetadataType { + name; + namespace; + genericArgs; + inherits; + implements; + displayType; + description; + isNested; + isEnum; + isEnumInt; + isInterface; + isAbstract; + dataContract; + properties; + attributes; + innerTypes; + enumNames; + enumValues; + enumMemberValues; + enumDescriptions; + meta; + constructor(init) { Object.assign(this, init); } +} +export class NewInstanceResolver { + tryResolve(ctor) { + return new ctor(); + } +} +export class SingletonInstanceResolver { + tryResolve(ctor) { + return ctor.instance + || (ctor.instance = new ctor()); + } +} +function eventMessageType(evt) { + switch (evt) { + case 'onConnect': + return 'ServerEventConnect'; + case 'onHeartbeat': + return 'ServerEventHeartbeat'; + case 'onJoin': + return 'ServerEventJoin'; + case 'onLeave': + return 'ServerEventLeave'; + case 'onUpdate': + return 'ServerEventUpdate'; + } + return null; +} +/** + * EventSource + */ +export var ReadyState; +(function (ReadyState) { + ReadyState[ReadyState["CONNECTING"] = 0] = "CONNECTING"; + ReadyState[ReadyState["OPEN"] = 1] = "OPEN"; + ReadyState[ReadyState["CLOSED"] = 2] = "CLOSED"; +})(ReadyState || (ReadyState = {})); +export class ServerEventsClient { + channels; + options; + eventSource; + static UnknownChannel = "*"; + eventStreamUri; + updateSubscriberUrl; + connectionInfo; + serviceClient; + stopped; + resolver; + listeners; + EventSource; + withCredentials; + constructor(baseUrl, channels, options = {}, eventSource = null) { + this.channels = channels; + this.options = options; + this.eventSource = eventSource; + if (this.channels.length === 0) + throw "at least 1 channel is required"; + this.resolver = this.options.resolver || new NewInstanceResolver(); + this.eventStreamUri = combinePaths(baseUrl, "event-stream") + "?"; + this.updateChannels(channels); + this.serviceClient = new JsonServiceClient(baseUrl); + this.listeners = {}; + this.withCredentials = true; + if (!this.options.handlers) + this.options.handlers = {}; + } + onMessage = (e) => { + if (typeof document == "undefined") { //node + //latest node-fetch + eventsource doesn't split SSE messages properly + let requireSplitPos = e.data ? e.data.indexOf('\n') : -1; + if (requireSplitPos >= 0) { + let data = e.data; + let lastEventId = e.lastEventId; + let e1 = Object.assign({}, { lastEventId, data: data.substring(0, requireSplitPos) }), e2 = Object.assign({}, { lastEventId, data: data.substring(requireSplitPos + 1) }); + this._onMessage(e1); + this._onMessage(e2); + return; + } + } + this._onMessage(e); + }; + _onMessage = (e) => { + if (this.stopped) + return; + let opt = this.options; + if (typeof document == "undefined") { + var document = { + querySelectorAll: sel => [] + }; + } + let parts = splitOnFirst(e.data, " "); + let channel = null; + let selector = parts[0]; + let selParts = splitOnFirst(selector, "@"); + if (selParts.length > 1) { + channel = selParts[0]; + selector = selParts[1]; + } + const json = parts[1]; + let body = null; + try { + body = json ? JSON.parse(json) : null; + } + catch (ignore) { } + parts = splitOnFirst(selector, "."); + if (parts.length <= 1) + throw "invalid selector format: " + selector; + let op = parts[0], target = parts[1].replace(new RegExp("%20", "g"), " "); + const tokens = splitOnFirst(target, "$"); + const [cmd, cssSelector] = tokens; + const els = cssSelector && $$(cssSelector); + const el = els && els[0]; + const eventId = parseInt(e.lastEventId); + const data = e.data; + const type = eventMessageType(cmd) || "ServerEventMessage"; + const request = { eventId, data, type, + channel, selector, json, body, op, target: tokens[0], cssSelector, meta: {} }; + const mergedBody = typeof body == "object" + ? Object.assign({}, request, body) + : request; + if (opt.validate && opt.validate(request) === false) + return; + let headers = new Headers(); + headers.set("Content-Type", "text/plain"); + if (op === "cmd") { + if (cmd === "onConnect") { + this.connectionInfo = mergedBody; + if (typeof body.heartbeatIntervalMs == "string") + this.connectionInfo.heartbeatIntervalMs = parseInt(body.heartbeatIntervalMs); + if (typeof body.idleTimeoutMs == "string") + this.connectionInfo.idleTimeoutMs = parseInt(body.idleTimeoutMs); + Object.assign(opt, body); + let fn = opt.handlers["onConnect"]; + if (fn) { + fn.call(el || document.body, this.connectionInfo, request); + if (this.stopped) + return; + } + if (opt.heartbeatUrl) { + if (opt.heartbeat) { + clearInterval(opt.heartbeat); + } + opt.heartbeat = setInterval(async () => { + if (this.eventSource.readyState === EventSource.CLOSED) { + clearInterval(opt.heartbeat); + const stopFn = opt.handlers["onStop"]; + if (stopFn != null) + stopFn.apply(this.eventSource); + this.reconnectServerEvents({ error: new Error("EventSource is CLOSED") }); + return; + } + const reqHeartbeat = new Request(opt.heartbeatUrl, { + method: "POST", mode: "cors", headers: headers, credentials: this.serviceClient.credentials + }); + try { + let res = await fetch(reqHeartbeat); + if (!res.ok) { + const error = new Error(`${res.status} - ${res.statusText}`); + this.reconnectServerEvents({ error }); + } + else { + await res.text(); + } + } + catch (error) { + this.reconnectServerEvents({ error }); + } + }, (this.connectionInfo && this.connectionInfo.heartbeatIntervalMs) || opt.heartbeatIntervalMs || 10000); + } + if (opt.unRegisterUrl) { + if (typeof window != "undefined") { + window.onunload = () => { + if (navigator.sendBeacon) { // Chrome https://developers.google.com/web/updates/2019/12/chrome-80-deps-rems + this.stopped = true; + if (this.eventSource) + this.eventSource.close(); + navigator.sendBeacon(opt.unRegisterUrl); + } + else { + this.stop(); + } + }; + } + } + this.updateSubscriberUrl = opt.updateSubscriberUrl; + this.updateChannels((opt.channels || "").split(",")); + } + else { + let isCmdMsg = cmd == "onJoin" || cmd == "onLeave" || cmd == "onUpdate"; + let fn = opt.handlers[cmd]; + if (fn) { + if (isCmdMsg) { + fn.call(el || document.body, mergedBody); + } + else { + fn.call(el || document.body, body, request); + } + } + else { + if (!isCmdMsg) { //global receiver + let r = opt.receivers && opt.receivers["cmd"]; + this.invokeReceiver(r, cmd, el, request, "cmd"); + } + } + if (isCmdMsg) { + fn = opt.handlers["onCommand"]; + if (fn) { + fn.call(el || document.body, mergedBody); + } + } + } + } + else if (op === "trigger") { + this.raiseEvent(target, request); + } + else if (op === "css") { + css(els || $$("body"), cmd, body); + } + //Named Receiver + let r = opt.receivers && opt.receivers[op]; + this.invokeReceiver(r, cmd, el, request, op); + if (!eventMessageType(cmd)) { + let fn = opt.handlers["onMessage"]; + if (fn) { + fn.call(el || document.body, mergedBody); + } + } + if (opt.onTick) + opt.onTick(); + }; + onError = (error) => { + if (this.stopped) + return; + if (!error) + error = event; + let fn = this.options.onException; + if (fn != null) + fn.call(this.eventSource, error); + if (this.options.onTick) + this.options.onTick(); + }; + getEventSourceOptions() { + return { withCredentials: this.withCredentials }; + } + reconnectServerEvents(opt = {}) { + if (this.stopped) + return; + if (opt.error) + this.onError(opt.error); + const hold = this.eventSource; + let url = opt.url || this.eventStreamUri || hold.url; + if (this.options.resolveStreamUrl != null) { + url = this.options.resolveStreamUrl(url); + } + const es = this.EventSource + ? new this.EventSource(url, this.getEventSourceOptions()) + : new EventSource(url, this.getEventSourceOptions()); + es.addEventListener('error', e => (opt.onerror || hold.onerror || this.onError)(e)); + es.addEventListener('message', opt.onmessage || hold.onmessage || this.onMessage); + let fn = this.options.onReconnect; + if (fn != null) + fn.call(es, opt.error); + if (hold.removeEventListener) { + hold.removeEventListener('error', this.onError); + hold.removeEventListener('message', this.onMessage); + } + hold.close(); + return this.eventSource = es; + } + start() { + this.stopped = false; + if (this.eventSource == null || this.eventSource.readyState === EventSource.CLOSED) { + let url = this.eventStreamUri; + if (this.options.resolveStreamUrl != null) { + url = this.options.resolveStreamUrl(url); + } + this.eventSource = this.EventSource + ? new this.EventSource(url, this.getEventSourceOptions()) + : new EventSource(url, this.getEventSourceOptions()); + this.eventSource.addEventListener('error', this.onError); + this.eventSource.addEventListener('message', e => this.onMessage(e)); + } + return this; + } + stop() { + this.stopped = true; + if (this.eventSource) { + this.eventSource.close(); + } + let opt = this.options; + if (opt && opt.heartbeat) { + clearInterval(opt.heartbeat); + } + let hold = this.connectionInfo; + if (hold == null || hold.unRegisterUrl == null) + return new Promise((resolve, reject) => resolve()); + this.connectionInfo = null; + return fetch(new Request(hold.unRegisterUrl, { method: "POST", mode: "cors", credentials: this.serviceClient.credentials })) + .then(res => { if (!res.ok) + throw new Error(`${res.status} - ${res.statusText}`); }) + .catch(this.onError); + } + invokeReceiver(r, cmd, el, request, name) { + if (r) { + if (typeof r == "function") { + r = this.resolver.tryResolve(r); + } + cmd = cmd.replace("-", ""); + r.client = this; + r.request = request; + if (typeof (r[cmd]) == "function") { + r[cmd].call(el || r, request.body, request); + } + else if (cmd in r) { + r[cmd] = request.body; + } + else { + let metaProp = Object.getOwnPropertyDescriptor(r, cmd); + if (metaProp != null) { + if (metaProp.set) { + metaProp.set(request.body); + } + else if (metaProp.writable) { + r[cmd] = request.body; + } + return; + } + let cmdLower = cmd.toLowerCase(); + getAllMembers(r).forEach(k => { + if (k.toLowerCase() == cmdLower) { + if (typeof r[k] == "function") { + r[k].call(el || r, request.body, request); + } + else { + r[k] = request.body; + } + return; + } + }); + let noSuchMethod = r["noSuchMethod"]; + if (typeof noSuchMethod == "function") { + noSuchMethod.call(el || r, request.target, request); + } + } + } + } + hasConnected() { + return this.connectionInfo != null; + } + registerHandler(name, fn) { + if (!this.options.handlers) + this.options.handlers = {}; + this.options.handlers[name] = fn; + return this; + } + setResolver(resolver) { + this.options.resolver = resolver; + return this; + } + registerReceiver(receiver) { + return this.registerNamedReceiver("cmd", receiver); + } + registerNamedReceiver(name, receiver) { + if (!this.options.receivers) + this.options.receivers = {}; + this.options.receivers[name] = receiver; + return this; + } + unregisterReceiver(name = "cmd") { + if (this.options.receivers) { + delete this.options.receivers[name]; + } + return this; + } + updateChannels(channels) { + this.channels = channels; + const url = this.eventSource != null + ? this.eventSource.url + : this.eventStreamUri; + this.eventStreamUri = url.substring(0, Math.min(url.indexOf("?"), url.length)) + "?channels=" + channels.join(",") + "&t=" + new Date().getTime(); + } + update(subscribe, unsubscribe) { + let sub = typeof subscribe == "string" ? subscribe.split(',') : subscribe; + let unsub = typeof unsubscribe == "string" ? unsubscribe.split(',') : unsubscribe; + let channels = []; + for (let i in this.channels) { + let c = this.channels[i]; + if (unsub == null || unsub.indexOf(c) === -1) { + channels.push(c); + } + } + if (sub) { + for (let i in sub) { + let c = sub[i]; + if (channels.indexOf(c) === -1) { + channels.push(c); + } + } + } + this.updateChannels(channels); + } + addListener(eventName, handler) { + let handlers = this.listeners[eventName] || (this.listeners[eventName] = []); + handlers.push(handler); + return this; + } + removeListener(eventName, handler) { + let handlers = this.listeners[eventName]; + if (handlers) { + let pos = handlers.indexOf(handler); + if (pos >= 0) { + handlers.splice(pos, 1); + } + } + return this; + } + raiseEvent(eventName, msg) { + let handlers = this.listeners[eventName]; + if (handlers) { + handlers.forEach(x => { + try { + x(msg); + } + catch (e) { + this.onError(e); + } + }); + } + } + getConnectionInfo() { + if (this.connectionInfo == null) + throw "Not Connected"; + return this.connectionInfo; + } + getSubscriptionId() { + return this.getConnectionInfo().id; + } + updateSubscriber(request) { + if (request.id == null) + request.id = this.getSubscriptionId(); + return this.serviceClient.post(request) + .then(x => { + this.update(request.subscribeChannels, request.unsubscribeChannels); + }).catch(this.onError); + } + subscribeToChannels(...channels) { + let request = new UpdateEventSubscriber(); + request.id = this.getSubscriptionId(); + request.subscribeChannels = channels; + return this.serviceClient.post(request) + .then(x => { + this.update(channels, null); + }).catch(this.onError); + } + unsubscribeFromChannels(...channels) { + let request = new UpdateEventSubscriber(); + request.id = this.getSubscriptionId(); + request.unsubscribeChannels = channels; + return this.serviceClient.post(request) + .then(x => { + this.update(null, channels); + }).catch(this.onError); + } + getChannelSubscribers() { + let request = new GetEventSubscribers(); + request.channels = this.channels; + return this.serviceClient.get(request) + .then(r => r.map(x => this.toServerEventUser(x))) + .catch(e => { + this.onError(e); + return []; + }); + } + toServerEventUser(map) { + let channels = map["channels"]; + let to = new ServerEventUser(); + to.userId = map["userId"]; + to.displayName = map["displayName"]; + to.profileUrl = map["profileUrl"]; + to.channels = channels ? channels.split(',') : null; + for (let k in map) { + if (k == "userId" || k == "displayName" || + k == "profileUrl" || k == "channels") + continue; + if (to.meta == null) + to.meta = {}; + to.meta[k] = map[k]; + } + return to; + } +} +export function getAllMembers(o) { + let props = []; + do { + const l = Object.getOwnPropertyNames(o) + .concat(Object.getOwnPropertySymbols(o).map(s => s.toString())) + .sort() + .filter((p, i, arr) => p !== 'constructor' && //not the constructor + (i == 0 || p !== arr[i - 1]) && //not overriding in this prototype + props.indexOf(p) === -1 //not overridden in a child + ); + props = props.concat(l); + } while ((o = Object.getPrototypeOf(o)) && //walk-up the prototype chain + Object.getPrototypeOf(o) //not the the Object prototype methods (hasOwnProperty, etc...) + ); + return props; +} +export class ServerEventReceiver { + client; + request; + noSuchMethod(selector, message) { } +} +export class UpdateEventSubscriber { + id; + subscribeChannels; + unsubscribeChannels; + createResponse() { return new UpdateEventSubscriberResponse(); } + getTypeName() { return "UpdateEventSubscriber"; } +} +export class UpdateEventSubscriberResponse { + responseStatus; +} +export class GetEventSubscribers { + channels; + createResponse() { return []; } + getTypeName() { return "GetEventSubscribers"; } +} +export class ServerEventUser { + userId; + displayName; + profileUrl; + channels; + meta; +} +export class HttpMethods { + static Get = "GET"; + static Post = "POST"; + static Put = "PUT"; + static Delete = "DELETE"; + static Patch = "PATCH"; + static Head = "HEAD"; + static Options = "OPTIONS"; + static hasRequestBody = (method) => !(method === "GET" || method === "DELETE" || method === "HEAD" || method === "OPTIONS"); +} +class GetAccessToken { + constructor(init) { Object.assign(this, init); } + refreshToken; + useTokenCookie; + createResponse() { return new GetAccessTokenResponse(); } + getTypeName() { return 'GetAccessToken'; } + getMethod() { return 'POST'; } +} +export class GetAccessTokenResponse { + accessToken; + responseStatus; +} +export class JsonServiceClient { + baseUrl; + replyBaseUrl; + oneWayBaseUrl; + mode; + credentials; + headers; + userName; + password; + bearerToken; + refreshToken; + refreshTokenUri; + useTokenCookie; + enableAutoRefreshToken; + requestFilter; + static globalRequestFilter; + responseFilter; + static globalResponseFilter; + exceptionFilter; + urlFilter; + onAuthenticationRequired; + manageCookies; + cookies; + parseJson; + static toBase64; + constructor(baseUrl = "/") { + this.baseUrl = baseUrl; + this.replyBaseUrl = combinePaths(baseUrl, "json", "reply") + "/"; + this.oneWayBaseUrl = combinePaths(baseUrl, "json", "oneway") + "/"; + this.mode = "cors"; + this.credentials = "include"; + this.headers = new Headers(); + this.headers.set("Content-Type", "application/json"); + this.manageCookies = typeof document == "undefined"; //because node-fetch doesn't + this.cookies = {}; + this.enableAutoRefreshToken = true; + } + setCredentials(userName, password) { + this.userName = userName; + this.password = password; + } + useBasePath(path) { + this.basePath = path; + return this; + } + set basePath(path) { + if (!path) { + this.replyBaseUrl = combinePaths(this.baseUrl, "json", "reply") + "/"; + this.oneWayBaseUrl = combinePaths(this.baseUrl, "json", "oneway") + "/"; + } + else { + if (path[0] != '/') { + path = '/' + path; + } + this.replyBaseUrl = combinePaths(this.baseUrl, path) + "/"; + this.oneWayBaseUrl = combinePaths(this.baseUrl, path) + "/"; + } + } + apply(f) { + f(this); + return this; + } + get(request, args) { + return typeof request != "string" + ? this.fetch(HttpMethods.Get, request, args) + : this.fetch(HttpMethods.Get, null, args, this.toAbsoluteUrl(request)); + } + delete(request, args) { + return typeof request != "string" + ? this.fetch(HttpMethods.Delete, request, args) + : this.fetch(HttpMethods.Delete, null, args, this.toAbsoluteUrl(request)); + } + post(request, args) { + return this.fetch(HttpMethods.Post, request, args); + } + postToUrl(url, request, args) { + return this.fetch(HttpMethods.Post, request, args, this.toAbsoluteUrl(url)); + } + postBody(request, body, args) { + return this.fetchBody(HttpMethods.Post, request, body, args); + } + put(request, args) { + return this.fetch(HttpMethods.Put, request, args); + } + putToUrl(url, request, args) { + return this.fetch(HttpMethods.Put, request, args, this.toAbsoluteUrl(url)); + } + putBody(request, body, args) { + return this.fetchBody(HttpMethods.Put, request, body, args); + } + patch(request, args) { + return this.fetch(HttpMethods.Patch, request, args); + } + patchToUrl(url, request, args) { + return this.fetch(HttpMethods.Patch, request, args, this.toAbsoluteUrl(url)); + } + patchBody(request, body, args) { + return this.fetchBody(HttpMethods.Patch, request, body, args); + } + publish(request, args) { + return this.sendOneWay(request, args); + } + sendOneWay(request, args) { + const url = combinePaths(this.oneWayBaseUrl, nameOf(request)); + return this.fetch(HttpMethods.Post, request, null, url); + } + sendAll(requests) { + if (requests.length == 0) + return Promise.resolve([]); + const url = combinePaths(this.replyBaseUrl, nameOf(requests[0]) + "[]"); + return this.fetch(HttpMethods.Post, requests, null, url); + } + sendAllOneWay(requests) { + if (requests.length == 0) + return Promise.resolve(void 0); + const url = combinePaths(this.oneWayBaseUrl, nameOf(requests[0]) + "[]"); + return this.fetch(HttpMethods.Post, requests, null, url) + .then(r => void 0); + } + createUrlFromDto(method, request) { + let url = combinePaths(this.replyBaseUrl, nameOf(request)); + const hasRequestBody = HttpMethods.hasRequestBody(method); + if (!hasRequestBody) + url = appendQueryString(url, request); + return url; + } + toAbsoluteUrl(relativeOrAbsoluteUrl) { + return relativeOrAbsoluteUrl.startsWith("http://") || + relativeOrAbsoluteUrl.startsWith("https://") + ? relativeOrAbsoluteUrl + : combinePaths(this.baseUrl, relativeOrAbsoluteUrl); + } + deleteCookie(name) { + if (this.manageCookies) { + delete this.cookies[name]; + } + else { + if (document) { + document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/'; + } + } + } + createRequest({ method, request, url, args, body }) { + if (!url) + url = this.createUrlFromDto(method, request); + if (args) + url = appendQueryString(url, args); + if (this.bearerToken != null) { + this.headers.set("Authorization", "Bearer " + this.bearerToken); + } + else if (this.userName != null) { + this.headers.set('Authorization', 'Basic ' + JsonServiceClient.toBase64(`${this.userName}:${this.password}`)); + } + if (this.manageCookies) { + let cookies = Object.keys(this.cookies) + .map(x => { + let c = this.cookies[x]; + return c.expires && c.expires < new Date() + ? null + : `${c.name}=${encodeURIComponent(c.value)}`; + }) + .filter(x => !!x); + if (cookies.length > 0) + this.headers.set("Cookie", cookies.join("; ")); + else + this.headers.delete("Cookie"); + } + let headers = new Headers(this.headers); + let hasRequestBody = HttpMethods.hasRequestBody(method); + let reqInit = { + url, + method: method, + mode: this.mode, + credentials: this.credentials, + headers, + compress: false, // https://github.com/bitinn/node-fetch/issues/93#issuecomment-200791658 + }; + if (hasRequestBody) { + reqInit.body = body || JSON.stringify(request); + if (isFormData(body)) { + reqInit.body = sanitizeFormData(body); + headers.delete('Content-Type'); //set by FormData + } + } + if (this.requestFilter != null) + this.requestFilter(reqInit); + if (JsonServiceClient.globalRequestFilter != null) + JsonServiceClient.globalRequestFilter(reqInit); + return reqInit; + } + json(res) { + if (this.parseJson) + return this.parseJson(res); + return res.text().then(txt => { + return txt.length > 0 ? JSON.parse(txt) : null; + }); + } + applyResponseFilters(res) { + if (this.responseFilter != null) + this.responseFilter(res); + if (JsonServiceClient.globalResponseFilter != null) + JsonServiceClient.globalResponseFilter(res); + } + createResponse(res, request) { + if (!res.ok) { + this.applyResponseFilters(res); + throw res; + } + if (this.manageCookies) { + let setCookies = []; + res.headers.forEach((v, k) => { + switch (k.toLowerCase()) { + case "set-cookie": + let cookies = v.split(','); + cookies.forEach(c => setCookies.push(c)); + break; + } + }); + setCookies.forEach(x => { + let cookie = parseCookie(x); + if (cookie) + this.cookies[cookie.name] = cookie; + }); + } + res.headers.forEach((v, k) => { + switch (k.toLowerCase()) { + case "x-cookies": + if (v.split(',').indexOf('ss-reftok') >= 0) + this.useTokenCookie = true; + break; + } + }); + this.applyResponseFilters(res); + let x = request && typeof request != "string" && typeof request.createResponse == 'function' + ? request.createResponse() + : null; + if (typeof x === 'string') + return res.text().then(o => o); + let contentType = res.headers.get("content-type"); + let isJson = contentType && contentType.indexOf("application/json") !== -1; + if (isJson) { + return this.json(res).then(o => o); + } + if (typeof Uint8Array != "undefined" && x instanceof Uint8Array) { + if (typeof res.arrayBuffer != 'function') + throw new Error("This fetch polyfill does not implement 'arrayBuffer'"); + return res.arrayBuffer().then(o => new Uint8Array(o)); + } + else if (typeof Blob == "function" && x instanceof Blob) { + if (typeof res.blob != 'function') + throw new Error("This fetch polyfill does not implement 'blob'"); + return res.blob().then(o => o); + } + let contentLength = res.headers.get("content-length"); + if (contentLength === "0" || (contentLength == null && !isJson)) { + return res.text().then(_ => x); + } + return this.json(res).then(o => o); //fallback + } + handleError(holdRes, res, type = null) { + if (res instanceof Error) + throw this.raiseError(holdRes, res); + // res.json can only be called once. + if (res.bodyUsed) + throw this.raiseError(res, createErrorResponse(res.status, res.statusText, type)); + let isErrorResponse = typeof res.json == "undefined" && res.responseStatus; + if (isErrorResponse) { + return new Promise((resolve, reject) => reject(this.raiseError(null, res))); + } + return this.json(res).then(o => { + let errorDto = sanitize(o); + if (!errorDto.responseStatus) + throw createErrorResponse(res.status, res.statusText, type); + if (type != null) + errorDto.type = type; + throw errorDto; + }).catch(error => { + // No responseStatus body, set from `res` Body object + if (error instanceof Error + || (typeof window != "undefined" && window.DOMException && error instanceof window.DOMException /*MS Edge*/)) { + throw this.raiseError(res, createErrorResponse(res.status, res.statusText, type)); + } + throw this.raiseError(res, error); + }); + } + fetch(method, request, args, url) { + return this.sendRequest({ method, request, args, url }); + } + fetchBody(method, request, body, args) { + let url = combinePaths(this.replyBaseUrl, nameOf(request)); + return this.sendRequest({ + method, + request: body, + body: typeof body == "string" + ? body + : isFormData(body) + ? body + : JSON.stringify(body), + url: appendQueryString(url, request), + args, + returns: request + }); + } + sendRequest(info) { + const req = this.createRequest(info); + const returns = info.returns || info.request; + let holdRes = null; + const resendRequest = () => { + const req = this.createRequest(info); + if (this.urlFilter) + this.urlFilter(req.url); + return fetch(req.url, req) + .then(res => this.createResponse(res, returns)) + .catch(res => this.handleError(holdRes, res)); + }; + if (this.urlFilter) + this.urlFilter(req.url); + return fetch(req.url, req) + .then(res => { + holdRes = res; + const response = this.createResponse(res, returns); + return response; + }) + .catch(res => { + if (res.status === 401) { + if (this.enableAutoRefreshToken && (this.refreshToken || this.useTokenCookie || this.cookies['ss-reftok'] != null)) { + const jwtReq = new GetAccessToken({ refreshToken: this.refreshToken, useTokenCookie: !!this.useTokenCookie }); + let url = this.refreshTokenUri || this.createUrlFromDto(HttpMethods.Post, jwtReq); + if (this.useTokenCookie) { + this.bearerToken = null; + this.headers.delete("Authorization"); + } + let jwtRequest = this.createRequest({ method: HttpMethods.Post, request: jwtReq, args: null, url }); + return fetch(url, jwtRequest) + .then(r => this.createResponse(r, jwtReq).then(jwtResponse => { + this.bearerToken = jwtResponse?.accessToken || null; + return resendRequest(); + })) + .catch(res => { + if (this.onAuthenticationRequired) { + return this.onAuthenticationRequired() + .then(resendRequest) + .catch(resHandler => { + return this.handleError(holdRes, resHandler, "RefreshTokenException"); + }); + } + else { + return this.handleError(holdRes, res, "RefreshTokenException"); + } + }); + } + else { + if (this.onAuthenticationRequired) { + return this.onAuthenticationRequired().then(resendRequest); + } + } + } + return this.handleError(holdRes, res); + }); + } + raiseError(res, error) { + if (this.exceptionFilter != null) { + this.exceptionFilter(res, error); + } + return error; + } + // Generic send that uses APIs preferred HTTP Method (requires v5.13+ DTOs) + send(request, args, url) { + return this.sendRequest({ method: getMethod(request), request, args, url }); + } + // Generic send IReturnVoid that uses APIs preferred HTTP Method (requires v5.13+ DTOs) + sendVoid(request, args, url) { + return this.sendRequest({ method: getMethod(request), request, args, url }); + } + async api(request, args, method) { + try { + const result = await this.fetch(getMethod(request, method), request, args); + return new ApiResult({ response: result }); + } + catch (e) { + return new ApiResult({ error: getResponseStatus(e) }); + } + } + async apiVoid(request, args, method) { + try { + const result = await this.fetch(getMethod(request, method), request, args); + return new ApiResult({ response: result ?? new EmptyResponse() }); + } + catch (e) { + return new ApiResult({ error: getResponseStatus(e) }); + } + } + async apiForm(request, body, args, method) { + try { + const result = await this.fetchBody(getMethod(request, method), request, body, args); + return new ApiResult({ response: result }); + } + catch (e) { + return new ApiResult({ error: getResponseStatus(e) }); + } + } + async apiFormVoid(request, body, args, method) { + try { + const result = await this.fetchBody(getMethod(request, method), request, body, args); + return new ApiResult({ response: result ?? new EmptyResponse() }); + } + catch (e) { + return new ApiResult({ error: getResponseStatus(e) }); + } + } +} +export class JsonApiClient { + static create(baseUrl = "/", f) { + let client = new JsonServiceClient(baseUrl).apply(c => { + c.basePath = "/api"; + c.headers = new Headers(); //avoid pre-flight CORS requests + c.enableAutoRefreshToken = false; // Use JWT Cookies by default + if (f) { + f(c); + } + }); + return client; + } +} +export function getMethod(request, method) { + return method ?? (typeof request.getMethod == "function" + ? request.getMethod() + : HttpMethods.Post); +} +export function getResponseStatus(e) { + return e.responseStatus ?? e.ResponseStatus ?? + (e.errorCode + ? e + : (e.message ? createErrorStatus(e.message, e.errorCode) : null)); +} +export class ApiResult { + response; + error; + constructor(init) { Object.assign(this, init); } + get completed() { return this.response != null || this.error != null; } + get failed() { return this.error?.errorCode != null || this.error?.message != null; } + get succeeded() { return !this.failed && this.response != null; } + get errorMessage() { return this.error?.message; } + get errorCode() { return this.error?.errorCode; } + get errors() { return this.error?.errors ?? []; } + get errorSummary() { return this.error != null && this.errors.length == 0 ? this.errorMessage : null; } + fieldError(fieldName) { + let matchField = fieldName.toLowerCase(); + return this.errors?.find(x => x.fieldName.toLowerCase() == matchField); + } + fieldErrorMessage(fieldName) { return this.fieldError(fieldName)?.message; } + hasFieldError(fieldName) { return this.fieldError(fieldName) != null; } + showSummary(exceptFields = []) { + if (!this.failed) + return false; + return exceptFields.every(x => !this.hasFieldError(x)); + } + summaryMessage(exceptFields = []) { + if (this.showSummary(exceptFields)) { + // Return first field error that's not visible + let fieldSet = exceptFields.map(x => x.toLowerCase()); + let fieldError = fieldSet.find(x => fieldSet.indexOf(x.toLowerCase()) == -1); + return fieldError ?? this.errorMessage; + } + } + addFieldError(fieldName, message, errorCode = 'Exception') { + if (!this.error) + this.error = new ResponseStatus(); + const fieldError = this.fieldError(fieldName); + if (fieldError != null) { + fieldError.errorCode = errorCode; + fieldError.message = message; + } + else { + this.error.errors.push(new ResponseError({ fieldName, errorCode, message })); + } + } +} +export function createErrorStatus(message, errorCode = 'Exception') { + return new ResponseStatus({ errorCode, message }); +} +export function createFieldError(fieldName, message, errorCode = 'Exception') { + return new ResponseStatus({ errors: [new ResponseError({ fieldName, errorCode, message })] }); +} +export function isFormData(body) { return typeof window != "undefined" && body instanceof FormData; } +function createErrorResponse(errorCode, message, type = null) { + const error = apply(new ErrorResponse(), e => { + if (type != null) + e.type = type; + e.responseStatus = apply(new ResponseStatus(), status => { + status.errorCode = errorCode && errorCode.toString(); + status.message = message; + }); + }); + return error; +} +export function createError(errorCode, message, fieldName) { + return new ErrorResponse({ + responseStatus: new ResponseStatus({ + errorCode, + message, + errors: fieldName ? [new ResponseError({ errorCode, message, fieldName })] : undefined + }) + }); +} +export function toCamelCase(s) { return !s ? s : s.charAt(0).toLowerCase() + s.substring(1); } +export function toPascalCase(s) { return !s ? s : s.charAt(0).toUpperCase() + s.substring(1); } +export function toKebabCase(s) { return (s || '').replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); } +export function map(o, f) { return o == null ? null : f(o); } +export function camelCaseAny(o) { + if (!o || !(o instanceof Object) || Array.isArray(o)) + return o; + let to = {}; + for (let k in o) { + if (o.hasOwnProperty(k)) { + const key = toCamelCase(k); + const val = o[k]; + if (Array.isArray(val)) + to[key] = val.map(x => camelCaseAny(x)); + else if (val instanceof Object) + to[key] = camelCaseAny(val); + else + to[key] = val; + } + } + return to; +} +export function sanitize(status) { + if (!sanitize) + return sanitize; + if (status.responseStatus) + return status; + if (status.errors) + return status; + let to = camelCaseAny(status); + return to; +} +export function nameOf(o) { + if (!o) + return "null"; + if (typeof o.getTypeName == "function") + return o.getTypeName(); + let ctor = o && o.constructor; + if (ctor == null) + throw `${o} doesn't have constructor`; + if (ctor.name) + return ctor.name; + let str = ctor.toString(); + return str.substring(9, str.indexOf("(")); //"function ".length == 9 +} +/* utils */ +function log(o, prefix = "LOG") { + console.log(prefix, o); + return o; +} +export function css(selector, name, value) { + const els = typeof selector == "string" + ? document.querySelectorAll(selector) + : selector; + for (let i = 0; i < els.length; i++) { + const el = els[i]; + if (el != null && el.style != null) { + el.style[name] = value; + } + } +} +export function splitOnFirst(s, c) { + if (!s) + return [s]; + let pos = s.indexOf(c); + return pos >= 0 ? [s.substring(0, pos), s.substring(pos + 1)] : [s]; +} +export function splitOnLast(s, c) { + if (!s) + return [s]; + let pos = s.lastIndexOf(c); + return pos >= 0 + ? [s.substring(0, pos), s.substring(pos + 1)] + : [s]; +} +export function leftPart(s, needle) { + if (s == null) + return null; + let pos = s.indexOf(needle); + return pos == -1 + ? s + : s.substring(0, pos); +} +export function rightPart(s, needle) { + if (s == null) + return null; + let pos = s.indexOf(needle); + return pos == -1 + ? s + : s.substring(pos + needle.length); +} +export function lastLeftPart(s, needle) { + if (s == null) + return null; + let pos = s.lastIndexOf(needle); + return pos == -1 + ? s + : s.substring(0, pos); +} +export function lastRightPart(s, needle) { + if (s == null) + return null; + let pos = s.lastIndexOf(needle); + return pos == -1 + ? s + : s.substring(pos + needle.length); +} +export function chop(str, len = 1) { + len = Math.abs(len); + return str ? len < str.length ? str.substring(0, str.length - len) : '' : str; +} +export function onlyProps(obj, keys) { + let to = {}; + keys.forEach(key => to[key] = obj[key]); + return to; +} +function splitCase(t) { + return typeof t != 'string' ? t : t.replace(/([A-Z]|[0-9]+)/g, ' $1').replace(/_/g, ' ').trim(); +} +export function humanize(s) { return (!s || s.indexOf(' ') >= 0 ? s : splitCase(toPascalCase(s))); } +export const ucFirst = (s) => s.charAt(0).toUpperCase() + s.substring(1); +export const isUpper = (c) => c >= 'A' && c <= 'Z'; +export const isLower = (c) => c >= 'a' && c <= 'z'; +export const isDigit = (c) => c >= '0' && c <= '9'; +const upperOrDigit = (c) => isUpper(c) || isDigit(c); +export function splitTitleCase(s) { + let to = []; + if (typeof s != 'string') + return to; + let lastSplit = 0; + for (let i = 0; i < s.length; i++) { + let c = s[i]; + let prev = i > 0 ? s[i - 1] : null; + let next = i + 1 < s.length ? s[i + 1] : null; + if (upperOrDigit(c) && (!upperOrDigit(prev) || !upperOrDigit(next))) { + to.push(s.substring(lastSplit, i)); + lastSplit = i; + } + } + to.push(s.substring(lastSplit, s.length)); + return to.filter(x => !!x); +} +export function humanify(s) { return !s || s.indexOf(' ') >= 0 ? s : ucFirst(splitTitleCase(s).join(' ')); } +export function queryString(url) { + if (!url || url.indexOf('?') === -1) + return {}; + let pairs = rightPart(url, '?').split('&'); + let map = {}; + for (let i = 0; i < pairs.length; ++i) { + let p = pairs[i].split('='); + map[p[0]] = p.length > 1 + ? decodeURIComponent(p[1].replace(/\+/g, ' ')) + : null; + } + return map; +} +export function combinePaths(...paths) { + let parts = [], i, l; + for (i = 0, l = paths.length; i < l; i++) { + let arg = paths[i]; + parts = arg.indexOf("://") === -1 + ? parts.concat(arg.split("/")) + : parts.concat(arg.lastIndexOf("/") === arg.length - 1 ? arg.substring(0, arg.length - 1) : arg); + } + let combinedPaths = []; + for (i = 0, l = parts.length; i < l; i++) { + let part = parts[i]; + if (!part || part === ".") + continue; + if (part === "..") + combinedPaths.pop(); + else + combinedPaths.push(part); + } + if (parts[0] === "") + combinedPaths.unshift(""); + return combinedPaths.join("/") || (combinedPaths.length ? "/" : "."); +} +export function createPath(route, args) { + let argKeys = {}; + for (let k in args) { + argKeys[k.toLowerCase()] = k; + } + let parts = route.split("/"); + let url = ""; + for (let i = 0; i < parts.length; i++) { + let p = parts[i]; + if (p == null) + p = ""; + if (p[0] === "{" && p[p.length - 1] === "}") { + const key = argKeys[p.substring(1, p.length - 1).toLowerCase()]; + if (key) { + p = args[key]; + delete args[key]; + } + } + if (url.length > 0) + url += "/"; + url += p; + } + return url; +} +export function createUrl(route, args) { + let url = createPath(route, args); + return appendQueryString(url, args); +} +export function appendQueryString(url, args) { + for (let k in args) { + if (args.hasOwnProperty(k)) { + let val = args[k]; + if (typeof val == 'undefined' || typeof val == 'function' || typeof val == 'symbol') + continue; + url += url.indexOf("?") >= 0 ? "&" : "?"; + url += k + (val === null ? '' : "=" + qsValue(val)); + } + } + return url; +} +export function setQueryString(url, args) { + const baseUrl = leftPart(url, '?'); + const qs = Object.assign(queryString(url), args); + return appendQueryString(baseUrl, qs); +} +function qsValue(arg) { + if (arg == null) + return ""; + if (typeof Uint8Array != "undefined" && arg instanceof Uint8Array) + return bytesToBase64(arg); + return encodeURIComponent(arg) || ""; +} +//from: https://github.com/madmurphy/stringview.js/blob/master/stringview.js +export function bytesToBase64(aBytes) { + let eqLen = (3 - (aBytes.length % 3)) % 3, sB64Enc = ""; + for (let nMod3, nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) { + nMod3 = nIdx % 3; + nUint24 |= aBytes[nIdx] << (16 >>> nMod3 & 24); + if (nMod3 === 2 || aBytes.length - nIdx === 1) { + sB64Enc += String.fromCharCode(uint6ToB64(nUint24 >>> 18 & 63), uint6ToB64(nUint24 >>> 12 & 63), uint6ToB64(nUint24 >>> 6 & 63), uint6ToB64(nUint24 & 63)); + nUint24 = 0; + } + } + return eqLen === 0 + ? sB64Enc + : sB64Enc.substring(0, sB64Enc.length - eqLen) + (eqLen === 1 ? "=" : "=="); +} +function uint6ToB64(nUint6) { + return nUint6 < 26 ? + nUint6 + 65 + : nUint6 < 52 ? + nUint6 + 71 + : nUint6 < 62 ? + nUint6 - 4 + : nUint6 === 62 ? 43 + : nUint6 === 63 ? 47 : 65; +} +function _btoa(base64) { + return typeof btoa == 'function' + ? btoa(base64) + : Buffer.from(base64).toString('base64'); +} +function _atob(base64) { + return typeof atob == 'function' + ? atob(base64) + : Buffer.from(base64, 'base64').toString(); +} +//from: http://stackoverflow.com/a/30106551/85785 +JsonServiceClient.toBase64 = (str) => _btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) => String.fromCharCode(new Number('0x' + p1).valueOf()))); +export function stripQuotes(s) { return s && s[0] == '"' && s[s.length] == '"' ? s.slice(1, -1) : s; } +export function tryDecode(s) { + try { + return decodeURIComponent(s); + } + catch (e) { + return s; + } +} +export function parseCookie(setCookie) { + if (!setCookie) + return null; + let to = null; + let pairs = setCookie.split(/; */); + for (let i = 0; i < pairs.length; i++) { + let pair = pairs[i]; + let parts = splitOnFirst(pair, '='); + let name = parts[0].trim(); + let value = parts.length > 1 ? tryDecode(stripQuotes(parts[1].trim())) : null; + if (i == 0) { + to = { name, value, path: "/" }; + } + else { + let lower = name.toLowerCase(); + if (lower == "httponly") { + to.httpOnly = true; + } + else if (lower == "secure") { + to.secure = true; + } + else if (lower == "expires") { + to.expires = new Date(value); + // MS Edge returns Invalid Date when using '-' in "12-Mar-2037" + if (to.expires.toString() === "Invalid Date") { + to.expires = new Date(value.replace(/-/g, " ")); + } + } + else { + to[name] = value; + } + } + } + return to; +} +export function normalizeKey(key) { return key.toLowerCase().replace(/_/g, ''); } +function isArray(o) { return Object.prototype.toString.call(o) === '[object Array]'; } +export function normalize(dto, deep) { + if (isArray(dto)) { + if (!deep) + return dto; + const to = []; + for (let i = 0; i < dto.length; i++) { + to[i] = normalize(dto[i], deep); + } + return to; + } + if (typeof dto != "object") + return dto; + let o = {}; + for (let k in dto) { + o[normalizeKey(k)] = deep ? normalize(dto[k], deep) : dto[k]; + } + return o; +} +export function getField(o, name) { + return o == null || name == null ? null : + o[name] || + o[Object.keys(o).filter(k => normalizeKey(k) === normalizeKey(name))[0] || '']; +} +export function parseResponseStatus(json, defaultMsg = null) { + try { + let err = JSON.parse(json); + return sanitize(err.ResponseStatus || err.responseStatus); + } + catch (e) { + return { + message: defaultMsg || e.message || e, + __error: { error: e, json: json } + }; + } +} +export function toFormData(o) { + if (typeof window == "undefined") + return; + let formData = new FormData(); + for (let name in o) { + formData.append(name, o[name]); + } + return formData; +} +export function toObject(keys) { + const to = {}; + if (!keys) + return to; + if (typeof keys != "object") + throw new Error("keys must be an Array of object keys"); + const arr = Array.prototype.slice.call(keys); + arr.forEach(key => { + if (this[key]) { + to[key] = this[key]; + } + }); + return to; +} +export function errorResponseSummary() { + const responseStatus = this.responseStatus || this.ResponseStatus; + if (responseStatus == null) + return undefined; + const status = responseStatus.ErrorCode ? sanitize(responseStatus) : responseStatus; + return !status.errors || status.errors.length == 0 + ? status.message || status.errorCode + : undefined; +} +export function errorResponseExcept(fieldNames) { + const responseStatus = this.responseStatus || this.ResponseStatus; + if (responseStatus == null) + return undefined; + const status = responseStatus.ErrorCode ? sanitize(responseStatus) : responseStatus; + const names = toVarNames(fieldNames); + if (names && !(status.errors == null || status.errors.length == 0)) { + const lowerFieldsNames = names.map(x => (x || '').toLowerCase()); + for (let field of status.errors) { + if (lowerFieldsNames.indexOf((field.fieldName || '').toLowerCase()) !== -1) { + return undefined; + } + } + for (let field of status.errors) { + if (lowerFieldsNames.indexOf((field.fieldName || '').toLowerCase()) === -1) { + return field.message || field.errorCode; + } + } + } + return status.message || status.errorCode || undefined; +} +export function errorResponse(fieldName) { + if (fieldName == null) + return errorResponseSummary.call(this); + const responseStatus = this.responseStatus || this.ResponseStatus; + if (responseStatus == null) + return undefined; + const status = responseStatus.ErrorCode ? sanitize(responseStatus) : responseStatus; + if (status.errors == null || status.errors.length == 0) + return undefined; + const field = status.errors.find(x => (x.fieldName || '').toLowerCase() == fieldName.toLowerCase()); + return field + ? field.message || field.errorCode + : undefined; +} +export function isDate(d) { return d && Object.prototype.toString.call(d) === "[object Date]" && !isNaN(d); } +export function toDate(s) { + return !s ? null + : isDate(s) + ? s + : s[0] == '/' + ? new Date(parseFloat(/Date\(([^)]+)\)/.exec(s)[1])) + : new Date(s); +} +export function toDateFmt(s) { return dateFmt(toDate(s)); } +export function padInt(n) { return n < 10 ? '0' + n : n; } +export function dateFmt(d = new Date()) { return d.getFullYear() + '/' + padInt(d.getMonth() + 1) + '/' + padInt(d.getDate()); } +export function dateFmtHM(d = new Date()) { return d.getFullYear() + '/' + padInt(d.getMonth() + 1) + '/' + padInt(d.getDate()) + ' ' + padInt(d.getHours()) + ":" + padInt(d.getMinutes()); } +export function timeFmt12(d = new Date()) { return padInt((d.getHours() + 24) % 12 || 12) + ":" + padInt(d.getMinutes()) + ":" + padInt(d.getSeconds()) + " " + (d.getHours() > 12 ? "PM" : "AM"); } +export function toLocalISOString(d = new Date()) { + return `${d.getFullYear()}-${padInt(d.getMonth() + 1)}-${padInt(d.getDate())}T${padInt(d.getHours())}:${padInt(d.getMinutes())}:${padInt(d.getSeconds())}`; +} +export function toTime(s) { + if (typeof s == 'string' && s.indexOf(':') >= 0) + return s; + const ms = s instanceof Date + ? s.getTime() + : typeof s == 'string' + ? fromXsdDuration(s) * 1000 + : s; + return msToTime(ms); +} +export function msToTime(s) { + const ms = s % 1000; + s = (s - ms) / 1000; + const secs = s % 60; + s = (s - secs) / 60; + const mins = s % 60; + const hrs = (s - mins) / 60; + let t = padInt(hrs) + ':' + padInt(mins) + ':' + padInt(secs); + return ms > 0 + ? t + '.' + padStart(`${ms}`, 3, '0').substring(0, 3) + : t; +} +export function padStart(s, len, pad) { + len = Math.floor(len) || 0; + if (len < s.length) + return s; + pad = pad ? String(pad) : ' '; + let p = ''; + let l = len - s.length; + let i = 0; + while (p.length < l) { + if (!pad[i]) + i = 0; + p += pad[i]; + i++; + } + return p + s.slice(0); +} +function bsAlert(msg) { return '
' + msg + '
'; } +function attr(e, name) { return e.getAttribute(name); } +function sattr(e, name, value) { return e.setAttribute(name, value); } +function rattr(e, name) { return e.removeAttribute(name); } +export function createElement(tagName, options) { + const keyAliases = { className: 'class', htmlFor: 'for' }; + const el = document.createElement(tagName); + if (options?.attrs) { + for (const key in options.attrs) { + sattr(el, keyAliases[key] || key, options.attrs[key]); + } + } + if (options?.events) { + on(el, options.events); + } + if (options && options.insertAfter) { + options.insertAfter.parentNode.insertBefore(el, options.insertAfter.nextSibling); + } + return el; +} +function showInvalidInputs() { + let errorMsg = attr(this, 'data-invalid'); + if (errorMsg) { + //[data-invalid] can either be on input control or .form-check container containing group of radio/checkbox + const isCheck = this.type === "checkbox" || this.type === "radio" || hasClass(this, 'form-check'); + const elFormCheck = isCheck ? parent(this, 'form-check') : null; + if (!isCheck) + addClass(this, 'is-invalid'); + else + addClass(elFormCheck || this.parentElement, 'is-invalid form-control'); + const elNext = this.nextElementSibling; + const elLast = elNext && (attr(elNext, 'for') === this.id || elNext.tagName === "SMALL") + ? (isCheck ? elFormCheck || elNext.parentElement : elNext) + : this; + const elError = elLast != null && elLast.nextElementSibling && hasClass(elLast.nextElementSibling, 'invalid-feedback') + ? elLast.nextElementSibling + : createElement("div", { insertAfter: elLast, attrs: { className: 'invalid-feedback' } }); + elError.innerHTML = errorMsg; + } +} +function parent(el, cls) { + while (el != null && !hasClass(el, cls)) + el = el.parentElement; + return el; +} +function hasClass(el, cls) { + return !el ? false + : el.classList + ? el.classList.contains(cls) + : (" " + el.className + " ").replace(/[\n\t\r]/g, " ").indexOf(" " + cls + " ") > -1; +} +function addClass(el, cls) { + return !el ? null + : el.classList + ? el.classList.add(...cls.split(' ')) + : !hasClass(el, cls) + ? el.className = (el.className + " " + cls).trim() : null; +} +function remClass(el, cls) { + return !el ? null + : el.classList + ? el.classList.remove(cls) + : hasClass(el, cls) + ? el.className = el.className.replace(/(\s|^)someclass(\s|$)/, ' ') + : null; +} +export function isElement(el) { + return typeof window != "undefined" && (el instanceof window.Element || el == window.document); +} +export function $1(sel, el) { + return typeof sel === "string" ? (el || document).querySelector(sel) : sel || null; +} +export function $$(sel, el) { + if (typeof sel === "string") + return Array.from((el || document).querySelectorAll(sel)); + if (Array.isArray(sel)) + return sel.flatMap(x => $$(x, el)); + return [sel]; +} +export function on(sel, handlers) { + $$(sel).forEach(e => { + Object.keys(handlers).forEach(function (evt) { + let fn = handlers[evt]; + if (typeof evt === 'string' && typeof fn === 'function') { + e.addEventListener(evt, handlers[evt] = fn.bind(e)); + } + }); + }); + return handlers; +} +export function addScript(src) { + return new Promise((resolve, reject) => { + document.body.appendChild(createElement('script', { + attrs: { src }, + events: { + load: resolve, + error: reject, + } + })); + }); +} +export function delaySet(f, opt) { + let duration = opt && opt.duration || 300; + let timeout = setTimeout(() => f(true), duration); + return () => { clearTimeout(timeout); f(false); }; +} +// init generic behavior to bootstrap elements +export function bootstrap(el) { + const els = (el || document).querySelectorAll('[data-invalid]'); + for (let i = 0; i < els.length; i++) { + showInvalidInputs.call(els[i]); + } +} +if (typeof window != "undefined" && window.Element !== undefined) { // polyfill IE9+ + if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector || + Element.prototype.webkitMatchesSelector; + } + if (!Element.prototype.closest) { + Element.prototype.closest = function (s) { + let el = this; + do { + if (el.matches(s)) + return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + return null; + }; + } +} +function handleEvent(handlers, el = document, type) { + el.addEventListener(type, function (evt) { + const evtData = `data-${type}`; + let el = evt.target; + let x = attr(el, evtData); + if (!x) { + let elParent = el.closest(`[${evtData}]`); + if (elParent) { + x = attr(elParent, evtData); + el = elParent; + } + } + if (!x) + return; + let pos = x.indexOf(':'); + if (pos >= 0) { + const cmd = x.substring(0, pos); + const data = x.substring(pos + 1); + const fn = handlers[cmd]; + if (fn) { + fn.apply(el, data.split(',')); + } + } + else { + const fn = handlers[x]; + if (fn) { + fn.apply(el, [].slice.call(arguments)); + } + } + }); +} +export function bindHandlers(handlers, el = document, opt = null) { + if (opt && opt.events) { + opt.events.forEach(evt => handleEvent(handlers, el, evt)); + } + else { + ['click', 'dblclick', 'change', 'focus', 'blur', 'focusin', 'focusout', 'select', 'keydown', 'keypress', 'keyup', 'hover', 'toggle', 'input'] + .forEach(evt => { + if (el.querySelector(`[data-${evt}]`)) { + handleEvent(handlers, el, evt); + } + }); + } +} +export function bootstrapForm(form, options) { + if (!form) + return; + if (options.model) + populateForm(form, options.model); + form.onsubmit = function (evt) { + evt.preventDefault(); + options.type = "bootstrap-v4"; + return ajaxSubmit(form, options); + }; +} +function applyErrors(f, status, opt) { + const validation = { + overrideMessages: false, + messages: { + NotEmpty: "Required", + NotNull: "Required", + Email: "Invalid email", + AlreadyExists: "Already exists" + }, + errorFilter: function (errorMsg, errorCode, type) { + return this.overrideMessages + ? this.messages[errorCode] || errorMsg || splitCase(errorCode) + : errorMsg || splitCase(errorCode); + } + }; + clearErrors(f); + if (!status) + return; + status = sanitize(status); + addClass(f, "has-errors"); + const bs4 = opt && opt.type === "bootstrap-v4"; + const v = { ...validation, ...opt }; + if (opt.messages) { + v.overrideMessages = true; + } + const filter = v.errorFilter.bind(v); + const errors = status.errors; + if (errors && errors.length) { + let fieldMap = {}, fieldLabelMap = {}; + $$("input,textarea,select,button").forEach(x => { + const el = x; + const prev = el.previousElementSibling; + const next = el.nextElementSibling; + const isCheck = el.type === "radio" || el.type === "checkbox"; + const fieldId = (!isCheck ? el.id : null) || attr(el, "name"); + if (!fieldId) + return; + const key = fieldId.toLowerCase(); + fieldMap[key] = el; + if (!bs4) { + if (hasClass(prev, "help-inline") || hasClass(prev, "help-block")) { + fieldLabelMap[key] = prev; + } + else if (hasClass(next, "help-inline") || hasClass(next, "help-block")) { + fieldLabelMap[key] = next; + } + } + }); + $$(".help-inline[data-for],.help-block[data-for]").forEach(el => { + const key = attr(el, "data-for").toLowerCase(); + fieldLabelMap[key] = el; + }); + for (let error of errors) { + const key = (error.fieldName || "").toLowerCase(); + const field = fieldMap[key]; + if (field) { + if (!bs4) { + addClass(field, "error"); + addClass(field.parentElement, "has-error"); + } + else { + const type = attr(field, 'type'), isCheck = type === "radio" || type === "checkbox"; + if (!isCheck) + addClass(field, "is-invalid"); + sattr(field, "data-invalid", filter(error.message, error.errorCode, "field")); + } + } + const lblErr = fieldLabelMap[key]; + if (!lblErr) + continue; + addClass(lblErr, "error"); + lblErr.innerHTML = filter(error.message, error.errorCode, "field"); + lblErr.style.display = 'block'; + } + $$("[data-validation-summary]").forEach(el => { + const fields = attr(el, 'data-validation-summary').split(','); + const summaryMsg = errorResponseExcept.call(status, fields); + if (summaryMsg) + el.innerHTML = bsAlert(summaryMsg); + }); + } + else { + const htmlSummary = filter(status.message || splitCase(status.errorCode), status.errorCode, "summary"); + if (!bs4) { + $$(".error-summary").forEach(el => { + el.innerHTML = htmlSummary(el).style.display = 'block'; + }); + } + else { + $$('[data-validation-summary]').forEach(el => el.innerHTML = htmlSummary[0] === "<" ? htmlSummary : bsAlert(htmlSummary)); + } + } + return f; +} +function clearErrors(f) { + remClass(f, 'has-errors'); + $$('.error-summary').forEach(el => { + el.innerHTML = ""; + el.style.display = "none"; + }); + $$('[data-validation-summary]').forEach(el => { + el.innerHTML = ""; + }); + $$('.error').forEach(el => remClass(el, 'error')); + $$('.form-check.is-invalid [data-invalid]').forEach(el => { + rattr(el, 'data-invalid'); + }); + $$('.form-check.is-invalid').forEach(el => remClass(el, 'form-control')); + $$('.is-invalid').forEach(el => { + remClass(el, 'is-invalid'); + rattr(el, 'data-invalid'); + }); + $$('.is-valid').forEach(el => remClass(el, 'is-valid')); +} +var Types; +(function (Types) { + Types["MultiPart"] = "multipart/form-data"; + Types["UrlEncoded"] = "application/x-www-form-urlencoded"; + Types["Json"] = "application/json"; +})(Types || (Types = {})); +export function toVarNames(names) { + return !names ? [] : + isArray(names) + ? names + : names.split(',').map(s => s.trim()); +} +export function formSubmit(options = {}) { + const f = this; + const contentType = attr(f, 'enctype') || Types.UrlEncoded; + if (contentType == Types.MultiPart && window.FormData === undefined) + throw new Error(`FormData Type is needed to send '${Types.MultiPart}' Content Types`); + let body; + try { + body = serializeForm(f, contentType); + } + catch (e) { + throw new Error(`${e.message || e}`); + } + const headers = new Headers(); + headers.set("Accept", Types.Json); + headers.set("Content-Type", contentType); + const req = { + method: attr(f, 'method') || 'POST', + credentials: 'include', + mode: 'cors', + headers, + body, + }; + if (options.requestFilter) + options.requestFilter(req); + return fetch(new Request(options.url || attr(f, 'action'), req)) + .catch(e => { throw new Error(`Network is unreachable (${e.message || e})`); }) + .then(r => { + if (options.responseFilter) + options.responseFilter(r); + if (!r.ok) { + return r.json() + .catch(e => { throw new Error("The request failed with " + (r.statusText || r.status)); }) + .then(o => { throw Object.assign(new ErrorResponse(), sanitize(o)); }); + } + handleHeaderBehaviors(f, r); + return fromResponse(r); + }); +} +function handleHeaderBehaviors(f, r) { + const loc = r.headers.get('X-Location'); + if (loc) { + location.href = loc; + } + const evt = r.headers.get('X-Trigger'); + if (evt) { + const pos = evt.indexOf(':'); + const cmd = pos >= 0 ? evt.substring(0, pos) : evt; + const data = pos >= 0 ? evt.substring(pos + 1) : null; + triggerEvent(f, cmd, data ? [data] : []); + } +} +export function ajaxSubmit(f, options = {}) { + const type = options.type; + const bs4 = type === "bootstrap-v4"; + clearErrors(f); + try { + if (options.validate && options.validate.call(f) === false) + return false; + } + catch (e) { + return false; + } + addClass(f, 'loading'); + const disableSel = options.onSubmitDisable == null + ? "[type=submit]" + : options.onSubmitDisable; + const disable = disableSel != null && disableSel != ""; + if (disable) { + $$(disableSel).forEach(el => { + sattr(el, 'disabled', 'disabled'); + }); + } + function handleError(errMsg, err = null) { + if (err) { + applyErrors(f, err.ResponseStatus || err.responseStatus, { ...options }); + } + else if (errMsg) { + addClass(f, "has-errors"); + const errorSummary = $$(".error-summary")[0]; + if (errorSummary) { + errorSummary.innerHTML = errMsg; + } + if (bs4) { + const elSummary = $$('[data-validation-summary]')[0]; + if (elSummary) { + elSummary.innerHTML = bsAlert(errMsg); + } + } + } + if (options.error) { + options.error.call(f, err); + } + if (bs4) { + $$('[data-invalid]').forEach(el => showInvalidInputs.call(el)); + } + } + const submitFn = options.submit || formSubmit; + return submitFn.call(f, options) + .then(obj => { + if (options.success) + options.success.call(f, obj); + return false; + }) + .catch(e => { + if (e.responseStatus) + handleError(null, e); + else + handleError(`${e.message || e}`, null); + }) + .finally(() => { + remClass(f, 'loading'); + if (disable) { + $$(disableSel).forEach(el => { + rattr(el, 'disabled'); + }); + } + if (options.complete) { + options.complete.call(f); + } + }); +} +function fromResponse(r) { + const contentType = r.headers.get("content-type"); + const isJson = contentType && contentType.indexOf(Types.Json) !== -1; + if (isJson) + return r.json(); + let len = r.headers.get("content-length"); + if (len === "0" || (len == null && !isJson)) + return null; + return r.json(); +} +export function serializeForm(form, contentType = null) { + return contentType === Types.MultiPart + ? new FormData(form) + : contentType == Types.Json + ? JSON.stringify(serializeToObject(form)) + : serializeToUrlEncoded(form); +} +function formEntries(form, state, fn) { + let field, f = form; + let len = f.elements.length; + for (let i = 0; i < len; i++) { + field = f.elements[i]; + if (field.name && !field.disabled && field.type != 'file' && field.type != 'reset' && field.type != 'submit' && field.type != 'button') { + if (field.type == 'select-multiple') { + for (let j = f.elements[i].options.length - 1; j >= 0; j--) { + if (field.options[j].selected) + fn(state, field.name, field.options[j].value); + } + } + else if ((field.type != 'checkbox' && field.type != 'radio') || field.checked) { + fn(state, field.name, field.value); + } + } + } + return state; +} +export function serializeToObject(form) { + return formEntries(form, {}, (to, name, value) => to[name] = value); +} +export function serializeToUrlEncoded(form) { + const to = formEntries(form, [], (s, name, value) => typeof value == 'string' + ? s.push(encodeURIComponent(name) + "=" + encodeURIComponent(value)) + : null); + return to.join('&').replace(/%20/g, '+'); +} +export function serializeToFormData(form) { + return formEntries(form, new FormData(), (to, name, value) => to.append(name, value)); +} +export function sanitizeFormData(formData) { + // @ts-ignore + for (let [key, value] of formData) { + // Remove 0 length files + if (typeof value == 'object' && value.size === 0) { + formData.delete(key); + } + } + return formData; +} +export function triggerEvent(el, name, data = null) { + if (document.createEvent) { + let evt = document.createEvent(name == 'click' || name.startsWith('mouse') ? 'MouseEvents' : 'HTMLEvents'); + evt.initEvent(name, true, true); + evt.data = data; + el.dispatchEvent(evt); + } + else { + let evt = document.createEventObject(); + el.fireEvent("on" + name, evt); + } +} +export function populateForm(form, model) { + if (!model) + return; + const toggleCase = (s) => !s ? s : + s[0] === s[0].toUpperCase() ? toCamelCase(s) : s[0] === s[0].toLowerCase() ? toPascalCase(s) : s; + for (let key in model) { + let val = model[key]; + if (typeof val == 'undefined' || val === null) + val = ''; + const el = form.elements.namedItem(key) || form.elements.namedItem(toggleCase(key)); + const input = el; + if (!el) + continue; + const type = input.type || el[0].type; + switch (type) { + case 'radio': + case 'checkbox': + const len = el.length; + for (let i = 0; i < len; i++) { + el[i].checked = (val.indexOf(el[i].value) > -1); + } + break; + case 'select-multiple': + const values = isArray(val) ? val : [val]; + const select = el; + for (let i = 0; i < select.options.length; i++) { + select.options[i].selected = (values.indexOf(select.options[i].value) > -1); + } + break; + case 'select': + case 'select-one': + input.value = val.toString() || val; + break; + case 'date': + const d = toDate(val); + if (d) + input.value = d.toISOString().split('T')[0]; + break; + default: + input.value = val; + break; + } + } +} +export function trimEnd(s, c) { + let end = s.length; + while (end > 0 && s[end - 1] === c) { + --end; + } + return (end < s.length) ? s.substring(0, end) : s; +} +export function safeVarName(s) { + return s.replace(/[\W]+/g, ''); +} +export function pick(o, keys) { + const to = {}; + for (const k in o) { + if (o.hasOwnProperty(k) && keys.indexOf(k) >= 0) { + to[k] = o[k]; + } + } + return to; +} +export function omit(o, keys) { + const to = {}; + for (const k in o) { + if (o.hasOwnProperty(k) && keys.indexOf(k) < 0) { + to[k] = o[k]; + } + } + return to; +} +export function omitEmpty(o) { + const to = {}; + for (const k in o) { + const v = o[k]; + if (v != null && v !== '') { + to[k] = v; + } + } + return to; +} +export function apply(x, fn) { + fn(x); + return x; +} +export function each(xs, f, o) { + return xs.reduce((acc, x) => { f(acc, x); return acc; }, o || {}); +} +export function resolve(o, f) { + let ret = typeof o == 'function' ? o() : o; + return typeof f == 'function' ? f(ret) : ret; +} +export function mapGet(o, name) { + if (!o || !name) + return null; + let ret = o[name]; + if (ret) + return ret; + if (typeof o == 'object') { + let nameLower = name.toLowerCase(); + let match = Object.keys(o).find(k => k.toLowerCase() === nameLower); + return match ? o[match] : null; + } + return null; +} +export function apiValue(o) { + if (o == null) + return ''; + if (typeof o == 'string') + return o.substring(0, 6) === '/Date(' + ? toDate(o) + : o.trim(); + return o; +} +export function apiValueFmt(o) { + let ret = apiValue(o); + return (ret != null + ? isDate(ret) + ? dateFmt(ret) + : ret + : null) || ''; +} +/* NAV */ +export function activeClassNav(x, activePath) { + return x.href != null && (x.exact || activePath.length <= 1 + ? trimEnd(activePath, '/').toLowerCase() === trimEnd((x.href), '/').toLowerCase() + : trimEnd(activePath, '/').toLowerCase().startsWith(trimEnd((x.href), '/').toLowerCase())) + ? 'active' + : null; +} +export function activeClass(href, activePath, exact) { + return href != null && (exact || activePath.length <= 1 + ? trimEnd(activePath, '/').toLowerCase() === trimEnd(href, '/').toLowerCase() + : trimEnd(activePath, '/').toLowerCase().startsWith(trimEnd(href, '/').toLowerCase())) + ? 'active' + : null; +} +function bootstrapColors() { return ['primary', 'secondary', 'success', 'info', 'warning', 'danger', 'light', 'dark']; } +export const BootstrapColors = bootstrapColors(); +export function btnColorClass(props) { + for (const color of bootstrapColors()) { + if (props[color]) { + return 'btn-' + color; + } + if (props['outline-' + color]) { + return 'btn-outline-' + color; + } + } + return null; +} +function bootstrapSizes() { return ['xs', 'sm', 'md', 'lg']; } +export const BootstrapSizes = bootstrapSizes(); +export function btnSizeClass(props) { + for (const size of bootstrapSizes()) { + if (props[size]) { + return 'btn-' + size; + } + } + return null; +} +export function btnClasses(props) { + const to = []; + const color = btnColorClass(props); + if (color) { + to.push(color); + } + const size = btnSizeClass(props); + if (size) { + to.push(size); + } + if (props.block) { + to.push('btn-block'); + } + return to; +} +export class NavDefaults { + static navClass = 'nav'; + static navItemClass = 'nav-item'; + static navLinkClass = 'nav-link'; + static childNavItemClass = 'nav-item dropdown'; + static childNavLinkClass = 'nav-link dropdown-toggle'; + static childNavMenuClass = 'dropdown-menu'; + static childNavMenuItemClass = 'dropdown-item'; + static create() { return new NavOptions(); } + static forNav(options) { return options || NavDefaults.create(); } + static overrideDefaults(targets, source) { + if (targets == null) { + return source; + } + targets = Object.assign({}, targets); // clone + if (targets.navClass === NavDefaults.navClass && source.navClass != null) { + targets.navClass = source.navClass; + } + if (targets.navItemClass === NavDefaults.navItemClass && source.navItemClass != null) { + targets.navItemClass = source.navItemClass; + } + if (targets.navLinkClass === NavDefaults.navLinkClass && source.navLinkClass != null) { + targets.navLinkClass = source.navLinkClass; + } + if (targets.childNavItemClass === NavDefaults.childNavItemClass && source.childNavItemClass != null) { + targets.childNavItemClass = source.childNavItemClass; + } + if (targets.childNavLinkClass === NavDefaults.childNavLinkClass && source.childNavLinkClass != null) { + targets.childNavLinkClass = source.childNavLinkClass; + } + if (targets.childNavMenuClass === NavDefaults.childNavMenuClass && source.childNavMenuClass != null) { + targets.childNavMenuClass = source.childNavMenuClass; + } + if (targets.childNavMenuItemClass === NavDefaults.childNavMenuItemClass && source.childNavMenuItemClass != null) { + targets.childNavMenuItemClass = source.childNavMenuItemClass; + } + return targets; + } + static showNav(navItem, attributes) { + if (attributes == null || attributes.length === 0) { + return navItem.show == null; + } + if (navItem.show != null && attributes.indexOf(navItem.show) < 0) { + return false; + } + if (navItem.hide != null && attributes.indexOf(navItem.hide) >= 0) { + return false; + } + return true; + } +} +export class NavLinkDefaults { + static forNavLink(options) { return options || NavDefaults.create(); } +} +export class NavbarDefaults { + static navClass = 'navbar-nav'; + static create() { return new NavOptions({ navClass: NavbarDefaults.navClass }); } + static forNavbar(options) { return NavDefaults.overrideDefaults(options, NavbarDefaults.create()); } +} +export class NavButtonGroupDefaults { + static navClass = 'btn-group'; + static navItemClass = 'btn btn-primary'; + static create() { return new NavOptions({ navClass: NavButtonGroupDefaults.navClass, navItemClass: NavButtonGroupDefaults.navItemClass }); } + static forNavButtonGroup(options) { return NavDefaults.overrideDefaults(options, NavButtonGroupDefaults.create()); } +} +export class LinkButtonDefaults { + static navItemClass = 'btn'; + static create() { return new NavOptions({ navItemClass: LinkButtonDefaults.navItemClass }); } + static forLinkButton(options) { return NavDefaults.overrideDefaults(options || null, LinkButtonDefaults.create()); } +} +export class UserAttributes { + static fromSession(session) { + const to = []; + if (session != null) { + to.push('auth'); + if (session.roles) { + to.push(...session.roles.map(x => 'role:' + x)); + } + if (session.permissions) { + to.push(...session.permissions.map(x => 'perm:' + x)); + } + } + return to; + } +} +export class NavOptions { + static fromSession(session, to) { + to = to || new NavOptions(); + to.attributes = UserAttributes.fromSession(session); + return to; + } + attributes; + activePath; + baseHref; + navClass; + navItemClass; + navLinkClass; + childNavItemClass; + childNavLinkClass; + childNavMenuClass; + childNavMenuItemClass; + constructor(init) { + this.attributes = []; + this.navClass = NavDefaults.navClass; + this.navItemClass = NavDefaults.navItemClass; + this.navLinkClass = NavDefaults.navLinkClass; + this.childNavItemClass = NavDefaults.childNavItemClass; + this.childNavLinkClass = NavDefaults.childNavLinkClass; + this.childNavMenuClass = NavDefaults.childNavMenuClass; + this.childNavMenuItemClass = NavDefaults.childNavMenuItemClass; + Object.assign(this, init); + } +} +export function classNames(...args) { + const classes = []; + for (let i = 0; i < args.length; i++) { + const arg = args[i]; + if (!arg) + continue; + const argType = typeof arg; + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } + else if (Array.isArray(arg) && arg.length) { + const inner = classNames.apply(null, arg); + if (inner) { + classes.push(inner); + } + } + else if (argType === 'object') { + for (let key of Object.keys(arg)) { + if (arg[key]) { + classes.push(key); + } + } + } + } + return classes.join(' '); +} +export function fromXsdDuration(xsd) { + let days = 0; + let hours = 0; + let minutes = 0; + let seconds = 0; + let ms = 0.0; + let t = splitOnFirst(xsd.substring(1), 'T'); + let hasTime = t.length == 2; + let d = splitOnFirst(t[0], 'D'); + if (d.length == 2) { + days = parseInt(d[0], 10) || 0; + } + if (hasTime) { + let h = splitOnFirst(t[1], 'H'); + if (h.length == 2) { + hours = parseInt(h[0], 10) || 0; + } + let m = splitOnFirst(h[h.length - 1], 'M'); + if (m.length == 2) { + minutes = parseInt(m[0], 10) || 0; + } + let s = splitOnFirst(m[m.length - 1], 'S'); + if (s.length == 2) { + ms = parseFloat(s[0]); + } + seconds = ms | 0; + ms -= seconds; + } + let totalSecs = (days * 24 * 60 * 60) + (hours * 60 * 60) + (minutes * 60) + seconds; + return totalSecs + ms; +} +function timeFmt(time, asXsd) { + let totalSeconds = time; + let wholeSeconds = time | 0; + let seconds = wholeSeconds; + let sec = (seconds >= 60 ? seconds % 60 : seconds); + seconds = (seconds / 60); + let min = seconds >= 60 ? seconds % 60 : seconds; + seconds = (seconds / 60); + let hours = seconds >= 24 ? seconds % 24 : seconds; + let days = seconds / 24; + let remainingSecs = sec + (totalSeconds - wholeSeconds); + let sb = asXsd ? 'P' : ''; + if (asXsd) { + if ((days | 0) > 0) { + sb += `${days | 0}D`; + } + if (days == 0 || (hours + min + sec) + remainingSecs > 0) { + sb += "T"; + if ((hours | 0) > 0) { + sb += `${hours | 0}H`; + } + if ((min | 0) > 0) { + sb += `${min | 0}M`; + } + if (remainingSecs > 0) { + let secFmt = remainingSecs.toFixed(7); + secFmt = trimEnd(trimEnd(secFmt, '0'), '.'); + sb += `${secFmt}S`; + } + else if (sb.length == 2) { + sb += '0S'; + } + } + } + else { + if ((days | 0) > 0) { + sb += `${days | 0}:`; + } + sb += `${padInt(hours | 0)}:${padInt(min | 0)}:`; + if (remainingSecs > 0) { + let secFmt = remainingSecs.toFixed(7); + secFmt = trimEnd(trimEnd(secFmt, '0'), '.'); + sb += remainingSecs >= 10 ? `${secFmt}` : `0${secFmt}`; + } + else { + sb += '00'; + } + } + return sb; +} +export function toXsdDuration(time) { return timeFmt(time, true); } +export function toTimeSpanFmt(time) { return timeFmt(time, false); } +export function flatMap(f, xs) { return xs.reduce((r, x) => r.concat(f(x)), []); } +export function uniq(xs) { return Array.from(new Set(xs)).sort((x, y) => x > y ? 1 : -1); } +export function enc(o) { + return o == null ? null : typeof o == 'string' + ? o.replace(/&/g, '&').replace(//g, '>').replace(/'/g, ''').replace(/"/g, '"') + : `${o}`; +} +export function htmlAttrs(o) { + let sb = []; + Object.keys(o).forEach(k => { + if (sb.length > 0) + sb.push(' '); + sb.push(k); + sb.push('="'); + sb.push(enc(o[k])); + sb.push('"'); + }); + return sb.join(''); +} +export function indexOfAny(str, needles) { + for (let i = 0, len = needles.length; i < len; i++) { + let pos = str.indexOf(needles[i]); + if (pos >= 0) + return pos; + } + return -1; +} +export function isNullOrEmpty(o) { + return (o === null || o === undefined || o === ""); +} +// From .NET DateTime (WCF JSON or ISO Date) to JS Date +export function fromDateTime(dateTime) { + return toDate(dateTime); +} +// From JS Date to .NET DateTime (WCF JSON Date) +export function toDateTime(date) { + return `\/Date(${date.getTime()})\/`; +} +// From .NET TimeSpan (XSD Duration) to JS String +export function fromTimeSpan(xsdDuration) { + return xsdDuration; +} +// From JS String to .NET TimeSpan (XSD Duration) +export function toTimeSpan(xsdDuration) { + return xsdDuration; +} +// From .NET Guid to JS String +export function fromGuid(xsdDuration) { + return xsdDuration; +} +// From JS String to .NET Guid +export function toGuid(xsdDuration) { + return xsdDuration; +} +// From .NET byte[] (Base64 String) to JVM signed byte[] +export function fromByteArray(base64) { + let binaryStr = _atob(base64); + let len = binaryStr.length; + let bytes = new Uint8Array(len); + for (let i = 0; i < len; i++) { + bytes[i] = binaryStr.charCodeAt(i); + } + return bytes; +} +// From JS Uint8Array to .NET byte[] (Base64 String) +export function toByteArray(bytes) { + let str = String.fromCharCode.apply(null, bytes); + return _btoa(str); +} +// From JS String to Base64 String +export function toBase64String(source) { + return JsonServiceClient.toBase64(source); +} +export class StringBuffer { + buffer_ = ''; + constructor(opt_a1, ...var_args) { + if (opt_a1 != null) + this.append.apply(this, arguments); + } + set(s) { + this.buffer_ = '' + s; + } + append(a1, opt_a2, ...var_args) { + this.buffer_ += String(a1); + if (opt_a2 != null) { + for (let i = 1; i < arguments.length; i++) { + this.buffer_ += arguments[i]; + } + } + return this; + } + clear() { this.buffer_ = ''; } + getLength() { return this.buffer_.length; } + toString() { return this.buffer_; } +} +export class JSV { + static ESCAPE_CHARS = ['"', ':', ',', '{', '}', '[', ']', '\r', '\n']; + static encodeString(str) { + if (str == null) + return null; + if (str === '') + return '""'; + if (str.indexOf('"')) + str = str.replace(/"/g, '""'); + return indexOfAny(str, JSV.ESCAPE_CHARS) >= 0 + ? '"' + str + '"' + : str; + } + static encodeArray(array) { + let value, sb = new StringBuffer(); + for (let i = 0, len = array.length; i < len; i++) { + value = array[i]; + if (isNullOrEmpty(value) || typeof value === 'function') + continue; + if (sb.getLength() > 0) + sb.append(','); + sb.append(JSV.stringify(value)); + } + return `[${sb.toString()}]`; + } + static encodeObject(obj) { + let value, sb = new StringBuffer(); + for (let key in obj) { + value = obj[key]; + if (!obj.hasOwnProperty(key) || isNullOrEmpty(value) || typeof value === 'function') + continue; + if (sb.getLength() > 0) + sb.append(','); + sb.append(JSV.encodeString(key)); + sb.append(':'); + sb.append(JSV.stringify(value)); + } + return `{${sb.toString()}}`; + } + static stringify(obj) { + if (obj === null || obj === undefined) + return null; + let typeOf = typeof (obj); + if (typeOf === 'function' || typeOf === 'symbol') + return null; + if (typeOf === 'object') { + let ctorStr = obj.constructor.toString().toLowerCase(); + if (ctorStr.indexOf('string') >= 0) + return JSV.encodeString(obj); + if (ctorStr.indexOf('boolean') >= 0) + return obj ? 'true' : 'false'; + if (ctorStr.indexOf('number') >= 0) + return obj; + if (ctorStr.indexOf('date') >= 0) + return JSV.encodeString(toLocalISOString(obj)); + if (ctorStr.indexOf('array') >= 0) + return JSV.encodeArray(obj); + return JSV.encodeObject(obj); + } + switch (typeOf) { + case 'string': + return JSV.encodeString(obj); + case 'boolean': + return obj ? 'true' : 'false'; + case 'number': + default: + return obj; + } + } +} +export function uniqueKeys(rows) { + let to = []; + rows.forEach(o => Object.keys(o).forEach(k => { + if (to.indexOf(k) === -1) { + to.push(k); + } + })); + return to; +} +export function alignLeft(str, len, pad = ' ') { + if (len < 0) + return ''; + let aLen = len + 1 - str.length; + if (aLen <= 0) + return str; + return pad + str + pad.repeat(len + 1 - str.length); +} +export function alignCenter(str, len, pad = ' ') { + if (len < 0) + return ''; + if (!str) + str = ''; + let nLen = str.length; + let half = Math.floor(len / 2 - nLen / 2); + let odds = Math.abs((nLen % 2) - (len % 2)); + return pad.repeat(half + 1) + str + pad.repeat(half + 1 + odds); +} +export function alignRight(str, len, pad = ' ') { + if (len < 0) + return ''; + let aLen = len + 1 - str.length; + if (aLen <= 0) + return str; + return pad.repeat(len + 1 - str.length) + str + pad; +} +export function alignAuto(obj, len, pad = ' ') { + let str = `${obj}`; + if (str.length <= len) { + return typeof obj === "number" + ? alignRight(str, len, pad) + : alignLeft(str, len, pad); + } + return str; +} +export function EventBus() { + let { subscribe, publish } = createBus(); + this.subscribe = subscribe; + this.publish = publish; +} +export function createBus() { + let subscriptions = {}; + function subscribe(type, callback) { + let id = Symbol('id'); + if (!subscriptions[type]) + subscriptions[type] = {}; + subscriptions[type][id] = callback; + return { + unsubscribe: function () { + delete subscriptions[type][id]; + if (Object.getOwnPropertySymbols(subscriptions[type]).length === 0) { + delete subscriptions[type]; + } + } + }; + } + function publish(eventType, arg) { + if (!subscriptions[eventType]) + return; + Object.getOwnPropertySymbols(subscriptions[eventType]) + .forEach(key => subscriptions[eventType][key](arg)); + } + return { subscribe, publish }; +} +export class Inspect { + static async vars(obj) { + if (typeof process != 'object') + return; + let inspectVarsPath = process.env.INSPECT_VARS; + if (!inspectVarsPath || !obj) + return; + // resolve dynamic path to prevent ng webpack static analysis + const nodeModule = (m) => 'no' + 'de:' + `${m}`; + await import(nodeModule('fs')).then(async (fs) => { + await import(nodeModule('path')).then(path => { + let varsPath = inspectVarsPath.replace(/\\/g, '/'); + if (varsPath.indexOf('/') >= 0) { + let dir = path.dirname(varsPath); + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir); + } + } + fs.writeFileSync(varsPath, JSON.stringify(obj)); + }); + }); + } + static dump(obj) { + let to = JSON.stringify(obj, null, 4); + return to.replace(/"/g, ''); + } + static printDump(obj) { console.log(Inspect.dump(obj)); } + static dumpTable(rows) { + let mapRows = rows; + let keys = uniqueKeys(mapRows); + let colSizes = {}; + keys.forEach(k => { + let max = k.length; + mapRows.forEach(row => { + let col = row[k]; + if (col != null) { + let valSize = `${col}`.length; + if (valSize > max) { + max = valSize; + } + } + }); + colSizes[k] = max; + }); + // sum + ' padding ' + | + let colSizesLength = Object.keys(colSizes).length; + let rowWidth = Object.keys(colSizes).map(k => colSizes[k]).reduce((p, c) => p + c, 0) + + (colSizesLength * 2) + + (colSizesLength + 1); + let sb = []; + sb.push(`+${'-'.repeat(rowWidth - 2)}+`); + let head = '|'; + keys.forEach(k => head += alignCenter(k, colSizes[k]) + '|'); + sb.push(head); + sb.push(`|${'-'.repeat(rowWidth - 2)}|`); + mapRows.forEach(row => { + let to = '|'; + keys.forEach(k => to += '' + alignAuto(row[k], colSizes[k]) + '|'); + sb.push(to); + }); + sb.push(`+${'-'.repeat(rowWidth - 2)}+`); + return sb.join('\n'); + } + static printDumpTable(rows) { console.log(Inspect.dumpTable(rows)); } +} diff --git a/MyApp/wwwroot/lib/mjs/vue.min.mjs b/MyApp/wwwroot/lib/mjs/vue.min.mjs new file mode 100644 index 0000000..3affb9d --- /dev/null +++ b/MyApp/wwwroot/lib/mjs/vue.min.mjs @@ -0,0 +1,6 @@ +function e(e,t){const n=Object.create(null),o=e.split(",");for(let r=0;r!!n[e.toLowerCase()]:e=>!!n[e]}const t={},n=[],o=()=>{},r=()=>!1,s=/^on[^a-z]/,i=e=>s.test(e),l=e=>e.startsWith("onUpdate:"),c=Object.assign,a=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},u=Object.prototype.hasOwnProperty,p=(e,t)=>u.call(e,t),f=Array.isArray,d=e=>"[object Map]"===x(e),h=e=>"[object Set]"===x(e),m=e=>"[object Date]"===x(e),g=e=>"function"==typeof e,v=e=>"string"==typeof e,y=e=>"symbol"==typeof e,b=e=>null!==e&&"object"==typeof e,_=e=>(b(e)||g(e))&&g(e.then)&&g(e.catch),S=Object.prototype.toString,x=e=>S.call(e),C=e=>x(e).slice(8,-1),k=e=>"[object Object]"===x(e),w=e=>v(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,T=e(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),E=e("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),N=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},O=/-(\w)/g,$=N((e=>e.replace(O,((e,t)=>t?t.toUpperCase():"")))),P=/\B([A-Z])/g,R=N((e=>e.replace(P,"-$1").toLowerCase())),A=N((e=>e.charAt(0).toUpperCase()+e.slice(1))),F=N((e=>e?`on${A(e)}`:"")),M=(e,t)=>!Object.is(e,t),V=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},B=e=>{const t=parseFloat(e);return isNaN(t)?e:t},L=e=>{const t=v(e)?Number(e):NaN;return isNaN(t)?e:t};let j;const U=()=>j||(j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),D=e("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console");function H(e){if(f(e)){const t={};for(let n=0;n{if(e){const n=e.split(z);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function q(e){let t="";if(v(e))t=e;else if(f(e))for(let n=0;nte(e,t)))}const oe=e=>v(e)?e:null==e?"":f(e)||b(e)&&(e.toString===S||!g(e.toString))?JSON.stringify(e,re,2):String(e),re=(e,t)=>t&&t.__v_isRef?re(e,t.value):d(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n])=>(e[`${t} =>`]=n,e)),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()]}:!b(t)||f(t)||k(t)?t:String(t);let se;class ie{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=se,!e&&se&&(this.index=(se.scopes||(se.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=se;try{return se=this,e()}finally{se=t}}}on(){se=this}off(){se=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t{const t=new Set(e);return t.w=0,t.n=0,t},fe=e=>(e.w&ge)>0,de=e=>(e.n&ge)>0,he=new WeakMap;let me=0,ge=1;const ve=30;let ye;const be=Symbol(""),_e=Symbol("");class Se{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,ce(this,n)}run(){if(!this.active)return this.fn();let e=ye,t=we;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=ye,ye=this,we=!0,ge=1<<++me,me<=ve?(({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let o=0;o{("length"===n||!y(n)&&n>=e)&&l.push(t)}))}else switch(void 0!==n&&l.push(i.get(n)),t){case"add":f(e)?w(n)&&l.push(i.get("length")):(l.push(i.get(be)),d(e)&&l.push(i.get(_e)));break;case"delete":f(e)||(l.push(i.get(be)),d(e)&&l.push(i.get(_e)));break;case"set":d(e)&&l.push(i.get(be))}if(1===l.length)l[0]&&Re(l[0]);else{const e=[];for(const t of l)t&&e.push(...t);Re(pe(e))}}function Re(e,t){const n=f(e)?e:[...e];for(const o of n)o.computed&&Ae(o);for(const o of n)o.computed||Ae(o)}function Ae(e,t){(e!==ye||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const Fe=e("__proto__,__v_isRef,__isVue"),Me=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(y)),Ve=Ie();function Ie(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=Et(this);for(let t=0,r=this.length;t{e[t]=function(...e){Ee();const n=Et(this)[t].apply(this,e);return Ne(),n}})),e}function Be(e){const t=Et(this);return Oe(t,0,e),t.hasOwnProperty(e)}class Le{constructor(e=!1,t=!1){this._isReadonly=e,this._shallow=t}get(e,t,n){const o=this._isReadonly,r=this._shallow;if("__v_isReactive"===t)return!o;if("__v_isReadonly"===t)return o;if("__v_isShallow"===t)return r;if("__v_raw"===t&&n===(o?r?vt:gt:r?mt:ht).get(e))return e;const s=f(e);if(!o){if(s&&p(Ve,t))return Reflect.get(Ve,t,n);if("hasOwnProperty"===t)return Be}const i=Reflect.get(e,t,n);return(y(t)?Me.has(t):Fe(t))?i:(o||Oe(e,0,t),r?i:At(i)?s&&w(t)?i:i.value:b(i)?o?_t(i):yt(i):i)}}class je extends Le{constructor(e=!1){super(!1,e)}set(e,t,n,o){let r=e[t];if(kt(r)&&At(r)&&!At(n))return!1;if(!this._shallow&&(wt(n)||kt(n)||(r=Et(r),n=Et(n)),!f(e)&&At(r)&&!At(n)))return r.value=n,!0;const s=f(e)&&w(t)?Number(t)e,Ge=e=>Reflect.getPrototypeOf(e);function qe(e,t,n=!1,o=!1){const r=Et(e=e.__v_raw),s=Et(t);n||(M(t,s)&&Oe(r,0,t),Oe(r,0,s));const{has:i}=Ge(r),l=o?Ke:n?$t:Ot;return i.call(r,t)?l(e.get(t)):i.call(r,s)?l(e.get(s)):void(e!==r&&e.get(t))}function Je(e,t=!1){const n=this.__v_raw,o=Et(n),r=Et(e);return t||(M(e,r)&&Oe(o,0,e),Oe(o,0,r)),e===r?n.has(e):n.has(e)||n.has(r)}function Ze(e,t=!1){return e=e.__v_raw,!t&&Oe(Et(e),0,be),Reflect.get(e,"size",e)}function Ye(e){e=Et(e);const t=Et(this);return Ge(t).has.call(t,e)||(t.add(e),Pe(t,"add",e,e)),this}function Qe(e,t){t=Et(t);const n=Et(this),{has:o,get:r}=Ge(n);let s=o.call(n,e);s||(e=Et(e),s=o.call(n,e));const i=r.call(n,e);return n.set(e,t),s?M(t,i)&&Pe(n,"set",e,t):Pe(n,"add",e,t),this}function Xe(e){const t=Et(this),{has:n,get:o}=Ge(t);let r=n.call(t,e);r||(e=Et(e),r=n.call(t,e)),o&&o.call(t,e);const s=t.delete(e);return r&&Pe(t,"delete",e,void 0),s}function et(){const e=Et(this),t=0!==e.size,n=e.clear();return t&&Pe(e,"clear",void 0,void 0),n}function tt(e,t){return function(n,o){const r=this,s=r.__v_raw,i=Et(s),l=t?Ke:e?$t:Ot;return!e&&Oe(i,0,be),s.forEach(((e,t)=>n.call(o,l(e),l(t),r)))}}function nt(e,t,n){return function(...o){const r=this.__v_raw,s=Et(r),i=d(s),l="entries"===e||e===Symbol.iterator&&i,c="keys"===e&&i,a=r[e](...o),u=n?Ke:t?$t:Ot;return!t&&Oe(s,0,c?_e:be),{next(){const{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:l?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function ot(e){return function(...t){return"delete"!==e&&this}}function rt(){const e={get(e){return qe(this,e)},get size(){return Ze(this)},has:Je,add:Ye,set:Qe,delete:Xe,clear:et,forEach:tt(!1,!1)},t={get(e){return qe(this,e,!1,!0)},get size(){return Ze(this)},has:Je,add:Ye,set:Qe,delete:Xe,clear:et,forEach:tt(!1,!0)},n={get(e){return qe(this,e,!0)},get size(){return Ze(this,!0)},has(e){return Je.call(this,e,!0)},add:ot("add"),set:ot("set"),delete:ot("delete"),clear:ot("clear"),forEach:tt(!0,!1)},o={get(e){return qe(this,e,!0,!0)},get size(){return Ze(this,!0)},has(e){return Je.call(this,e,!0)},add:ot("add"),set:ot("set"),delete:ot("delete"),clear:ot("clear"),forEach:tt(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((r=>{e[r]=nt(r,!1,!1),n[r]=nt(r,!0,!1),t[r]=nt(r,!1,!0),o[r]=nt(r,!0,!0)})),[e,n,t,o]}const[st,it,lt,ct]=rt();function at(e,t){const n=t?e?ct:lt:e?it:st;return(t,o,r)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(p(n,o)&&o in t?n:t,o,r)}const ut={get:at(!1,!1)},pt={get:at(!1,!0)},ft={get:at(!0,!1)},dt={get:at(!0,!0)},ht=new WeakMap,mt=new WeakMap,gt=new WeakMap,vt=new WeakMap;function yt(e){return kt(e)?e:xt(e,!1,De,ut,ht)}function bt(e){return xt(e,!1,We,pt,mt)}function _t(e){return xt(e,!0,He,ft,gt)}function St(e){return xt(e,!0,ze,dt,vt)}function xt(e,t,n,o,r){if(!b(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=r.get(e);if(s)return s;const i=(l=e).__v_skip||!Object.isExtensible(l)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(C(l));var l;if(0===i)return e;const c=new Proxy(e,2===i?o:n);return r.set(e,c),c}function Ct(e){return kt(e)?Ct(e.__v_raw):!(!e||!e.__v_isReactive)}function kt(e){return!(!e||!e.__v_isReadonly)}function wt(e){return!(!e||!e.__v_isShallow)}function Tt(e){return Ct(e)||kt(e)}function Et(e){const t=e&&e.__v_raw;return t?Et(t):e}function Nt(e){return I(e,"__v_skip",!0),e}const Ot=e=>b(e)?yt(e):e,$t=e=>b(e)?_t(e):e;function Pt(e){we&&ye&&$e((e=Et(e)).dep||(e.dep=pe()))}function Rt(e,t){const n=(e=Et(e)).dep;n&&Re(n)}function At(e){return!(!e||!0!==e.__v_isRef)}function Ft(e){return Vt(e,!1)}function Mt(e){return Vt(e,!0)}function Vt(e,t){return At(e)?e:new It(e,t)}class It{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:Et(e),this._value=t?e:Ot(e)}get value(){return Pt(this),this._value}set value(e){const t=this.__v_isShallow||wt(e)||kt(e);e=t?e:Et(e),M(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:Ot(e),Rt(this))}}function Bt(e){Rt(e)}function Lt(e){return At(e)?e.value:e}function jt(e){return g(e)?e():Lt(e)}const Ut={get:(e,t,n)=>Lt(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return At(r)&&!At(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Dt(e){return Ct(e)?e:new Proxy(e,Ut)}class Ht{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:t,set:n}=e((()=>Pt(this)),(()=>Rt(this)));this._get=t,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}function Wt(e){return new Ht(e)}function zt(e){const t=f(e)?new Array(e.length):{};for(const n in e)t[n]=Jt(e,n);return t}class Kt{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=Et(this._object),t=this._key,null==(n=he.get(e))?void 0:n.get(t);var e,t,n}}class Gt{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function qt(e,t,n){return At(e)?e:g(e)?new Gt(e):b(e)&&arguments.length>1?Jt(e,t,n):Ft(e)}function Jt(e,t,n){const o=e[t];return At(o)?o:new Kt(e,t,n)}class Zt{constructor(e,t,n,o){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new Se(e,(()=>{this._dirty||(this._dirty=!0,Rt(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=Et(this);return Pt(e),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function Yt(e,...t){}function Qt(e,t){}function Xt(e,t,n,o){let r;try{r=o?e(...o):e()}catch(s){tn(s,t,n)}return r}function en(e,t,n,o){if(g(e)){const r=Xt(e,t,n,o);return r&&_(r)&&r.catch((e=>{tn(e,t,n)})),r}const r=[];for(let s=0;s>>1,r=rn[o],s=yn(r);syn(e)-yn(t))),an=0;annull==e.id?1/0:e.id,bn=(e,t)=>{const n=yn(e)-yn(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function _n(e){on=!1,nn=!0,rn.sort(bn);try{for(sn=0;snSn.emit(e,...t))),xn=[];else if("undefined"!=typeof window&&window.HTMLElement&&!(null==(o=null==(n=window.navigator)?void 0:n.userAgent)?void 0:o.includes("jsdom"))){(t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push((e=>{Cn(e,t)})),setTimeout((()=>{Sn||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,xn=[])}),3e3)}else xn=[]}function kn(e,n,...o){if(e.isUnmounted)return;const r=e.vnode.props||t;let s=o;const i=n.startsWith("update:"),l=i&&n.slice(7);if(l&&l in r){const e=`${"modelValue"===l?"model":l}Modifiers`,{number:n,trim:i}=r[e]||t;i&&(s=o.map((e=>v(e)?e.trim():e))),n&&(s=o.map(B))}let c,a=r[c=F(n)]||r[c=F($(n))];!a&&i&&(a=r[c=F(R(n))]),a&&en(a,e,6,s);const u=r[c+"Once"];if(u){if(e.emitted){if(e.emitted[c])return}else e.emitted={};e.emitted[c]=!0,en(u,e,6,s)}}function wn(e,t,n=!1){const o=t.emitsCache,r=o.get(e);if(void 0!==r)return r;const s=e.emits;let i={},l=!1;if(!g(e)){const o=e=>{const n=wn(e,t,!0);n&&(l=!0,c(i,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return s||l?(f(s)?s.forEach((e=>i[e]=null)):c(i,s),b(e)&&o.set(e,i),i):(b(e)&&o.set(e,null),null)}function Tn(e,t){return!(!e||!i(t))&&(t=t.slice(2).replace(/Once$/,""),p(e,t[0].toLowerCase()+t.slice(1))||p(e,R(t))||p(e,t))}let En=null,Nn=null;function On(e){const t=En;return En=e,Nn=e&&e.type.__scopeId||null,t}function $n(e){Nn=e}function Pn(){Nn=null}const Rn=e=>An;function An(e,t=En,n){if(!t)return e;if(e._n)return e;const o=(...n)=>{o._d&&Ts(-1);const r=On(t);let s;try{s=e(...n)}finally{On(r),o._d&&Ts(1)}return s};return o._n=!0,o._c=!0,o._d=!0,o}function Fn(e){const{type:t,vnode:n,proxy:o,withProxy:r,props:s,propsOptions:[i],slots:c,attrs:a,emit:u,render:p,renderCache:f,data:d,setupState:h,ctx:m,inheritAttrs:g}=e;let v,y;const b=On(e);try{if(4&n.shapeFlag){const e=r||o;v=Hs(p.call(e,e,f,s,h,d,m)),y=a}else{const e=t;0,v=Hs(e(s,e.length>1?{attrs:a,slots:c,emit:u}:null)),y=t.props?a:Mn(a)}}catch(S){Ss.length=0,tn(S,e,1),v=Is(bs)}let _=v;if(y&&!1!==g){const e=Object.keys(y),{shapeFlag:t}=_;e.length&&7&t&&(i&&e.some(l)&&(y=Vn(y,i)),_=Ls(_,y))}return n.dirs&&(_=Ls(_),_.dirs=_.dirs?_.dirs.concat(n.dirs):n.dirs),n.transition&&(_.transition=n.transition),v=_,On(b),v}const Mn=e=>{let t;for(const n in e)("class"===n||"style"===n||i(n))&&((t||(t={}))[n]=e[n]);return t},Vn=(e,t)=>{const n={};for(const o in e)l(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function In(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;re.__isSuspense,Gn={name:"Suspense",__isSuspense:!0,process(e,t,n,o,r,s,i,l,c,a){null==e?function(e,t,n,o,r,s,i,l,c){const{p:a,o:{createElement:u}}=c,p=u("div"),f=e.suspense=Jn(e,r,o,t,p,n,s,i,l,c);a(null,f.pendingBranch=e.ssContent,p,null,o,f,s,i),f.deps>0?(qn(e,"onPending"),qn(e,"onFallback"),a(null,e.ssFallback,t,n,o,null,s,i),Qn(f,e.ssFallback)):f.resolve(!1,!0)}(t,n,o,r,s,i,l,c,a):function(e,t,n,o,r,s,i,l,{p:c,um:a,o:{createElement:u}}){const p=t.suspense=e.suspense;p.vnode=t,t.el=e.el;const f=t.ssContent,d=t.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:g,isHydrating:v}=p;if(m)p.pendingBranch=f,Ps(f,m)?(c(m,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0?p.resolve():g&&(c(h,d,n,o,r,null,s,i,l),Qn(p,d))):(p.pendingId++,v?(p.isHydrating=!1,p.activeBranch=m):a(m,r,p),p.deps=0,p.effects.length=0,p.hiddenContainer=u("div"),g?(c(null,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0?p.resolve():(c(h,d,n,o,r,null,s,i,l),Qn(p,d))):h&&Ps(f,h)?(c(h,f,n,o,r,p,s,i,l),p.resolve(!0)):(c(null,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0&&p.resolve()));else if(h&&Ps(f,h))c(h,f,n,o,r,p,s,i,l),Qn(p,f);else if(qn(t,"onPending"),p.pendingBranch=f,p.pendingId++,c(null,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0)p.resolve();else{const{timeout:e,pendingId:t}=p;e>0?setTimeout((()=>{p.pendingId===t&&p.fallback(d)}),e):0===e&&p.fallback(d)}}(e,t,n,o,r,i,l,c,a)},hydrate:function(e,t,n,o,r,s,i,l,c){const a=t.suspense=Jn(t,o,n,e.parentNode,document.createElement("div"),null,r,s,i,l,!0),u=c(e,a.pendingBranch=t.ssContent,n,a,s,i);0===a.deps&&a.resolve(!1,!0);return u},create:Jn,normalize:function(e){const{shapeFlag:t,children:n}=e,o=32&t;e.ssContent=Zn(o?n.default:n),e.ssFallback=o?Zn(n.fallback):Is(bs)}};function qn(e,t){const n=e.props&&e.props[t];g(n)&&n()}function Jn(e,t,n,o,r,s,i,l,c,a,u=!1){const{p:p,m:f,um:d,n:h,o:{parentNode:m,remove:g}}=a;let v;const y=function(e){var t;return null!=(null==(t=e.props)?void 0:t.suspensible)&&!1!==e.props.suspensible}(e);y&&(null==t?void 0:t.pendingBranch)&&(v=t.pendingId,t.deps++);const b=e.props?L(e.props.timeout):void 0,_={vnode:e,parent:t,parentComponent:n,isSVG:i,container:o,hiddenContainer:r,anchor:s,deps:0,pendingId:0,timeout:"number"==typeof b?b:-1,activeBranch:null,pendingBranch:null,isInFallback:!0,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){const{vnode:o,activeBranch:r,pendingBranch:s,pendingId:i,effects:l,parentComponent:c,container:a}=_;let u=!1;if(_.isHydrating)_.isHydrating=!1;else if(!e){u=r&&s.transition&&"out-in"===s.transition.mode,u&&(r.transition.afterLeave=()=>{i===_.pendingId&&(f(s,a,e,0),mn(l))});let{anchor:e}=_;r&&(e=h(r),d(r,c,_,!0)),u||f(s,a,e,0)}Qn(_,s),_.pendingBranch=null,_.isInFallback=!1;let p=_.parent,m=!1;for(;p;){if(p.pendingBranch){p.effects.push(...l),m=!0;break}p=p.parent}m||u||mn(l),_.effects=[],y&&t&&t.pendingBranch&&v===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),qn(o,"onResolve")},fallback(e){if(!_.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:o,container:r,isSVG:s}=_;qn(t,"onFallback");const i=h(n),a=()=>{_.isInFallback&&(p(null,e,r,i,o,null,s,l,c),Qn(_,e))},u=e.transition&&"out-in"===e.transition.mode;u&&(n.transition.afterLeave=a),_.isInFallback=!0,d(n,o,null,!0),u||a()},move(e,t,n){_.activeBranch&&f(_.activeBranch,e,t,n),_.container=e},next:()=>_.activeBranch&&h(_.activeBranch),registerDep(e,t){const n=!!_.pendingBranch;n&&_.deps++;const o=e.vnode.el;e.asyncDep.catch((t=>{tn(t,e,0)})).then((r=>{if(e.isUnmounted||_.isUnmounted||_.pendingId!==e.suspenseId)return;e.asyncResolved=!0;const{vnode:s}=e;si(e,r,!1),o&&(s.el=o);const l=!o&&e.subTree.el;t(e,s,m(o||e.subTree.el),o?null:h(e.subTree),_,i,c),l&&g(l),Bn(e,s.el),n&&0==--_.deps&&_.resolve()}))},unmount(e,t){_.isUnmounted=!0,_.activeBranch&&d(_.activeBranch,n,e,t),_.pendingBranch&&d(_.pendingBranch,n,e,t)}};return _}function Zn(e){let t;if(g(e)){const n=ws&&e._c;n&&(e._d=!1,Cs()),e=e(),n&&(e._d=!0,t=xs,ks())}if(f(e)){const t=function(e){let t;for(let n=0;nt!==e))),e}function Yn(e,t){t&&t.pendingBranch?f(e)?t.effects.push(...e):t.effects.push(e):mn(e)}function Qn(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e,r=n.el=t.el;o&&o.subTree===n&&(o.vnode.el=r,Bn(o,r))}function Xn(e,t){return ro(e,null,t)}function eo(e,t){return ro(e,null,{flush:"post"})}function to(e,t){return ro(e,null,{flush:"sync"})}const no={};function oo(e,t,n){return ro(e,t,n)}function ro(e,n,{immediate:r,deep:s,flush:i}=t){var l;const c=ae()===(null==(l=Zs)?void 0:l.scope)?Zs:null;let u,p,d=!1,h=!1;if(At(e)?(u=()=>e.value,d=wt(e)):Ct(e)?(u=()=>e,s=!0):f(e)?(h=!0,d=e.some((e=>Ct(e)||wt(e))),u=()=>e.map((e=>At(e)?e.value:Ct(e)?lo(e):g(e)?Xt(e,c,2):void 0))):u=g(e)?n?()=>Xt(e,c,2):()=>{if(!c||!c.isUnmounted)return p&&p(),en(e,c,3,[m])}:o,n&&s){const e=u;u=()=>lo(e())}let m=e=>{p=_.onStop=()=>{Xt(e,c,4)}},v=h?new Array(e.length).fill(no):no;const y=()=>{if(_.active)if(n){const e=_.run();(s||d||(h?e.some(((e,t)=>M(e,v[t]))):M(e,v)))&&(p&&p(),en(n,c,3,[e,v===no?void 0:h&&v[0]===no?[]:v,m]),v=e)}else _.run()};let b;y.allowRecurse=!!n,"sync"===i?b=y:"post"===i?b=()=>rs(y,c&&c.suspense):(y.pre=!0,c&&(y.id=c.uid),b=()=>dn(y));const _=new Se(u,b);n?r?y():v=_.run():"post"===i?rs(_.run.bind(_),c&&c.suspense):_.run();return()=>{_.stop(),c&&c.scope&&a(c.scope.effects,_)}}function so(e,t,n){const o=this.proxy,r=v(e)?e.includes(".")?io(o,e):()=>o[e]:e.bind(o,o);let s;g(t)?s=t:(s=t.handler,n=t);const i=Zs;Xs(this);const l=ro(r,s.bind(o),n);return i?Xs(i):ei(),l}function io(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{lo(e,t)}));else if(k(e))for(const n in e)lo(e[n],t);return e}function co(e,n){const o=En;if(null===o)return e;const r=ui(o)||o.proxy,s=e.dirs||(e.dirs=[]);for(let i=0;i{e.isMounted=!0})),Do((()=>{e.isUnmounting=!0})),e}const ho=[Function,Array],mo={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ho,onEnter:ho,onAfterEnter:ho,onEnterCancelled:ho,onBeforeLeave:ho,onLeave:ho,onAfterLeave:ho,onLeaveCancelled:ho,onBeforeAppear:ho,onAppear:ho,onAfterAppear:ho,onAppearCancelled:ho},go={name:"BaseTransition",props:mo,setup(e,{slots:t}){const n=Ys(),o=fo();let r;return()=>{const s=t.default&&xo(t.default(),!0);if(!s||!s.length)return;let i=s[0];if(s.length>1)for(const e of s)if(e.type!==bs){i=e;break}const l=Et(e),{mode:c}=l;if(o.isLeaving)return bo(i);const a=_o(i);if(!a)return bo(i);const u=yo(a,l,o,n);So(a,u);const p=n.subTree,f=p&&_o(p);let d=!1;const{getTransitionKey:h}=a.type;if(h){const e=h();void 0===r?r=e:e!==r&&(r=e,d=!0)}if(f&&f.type!==bs&&(!Ps(a,f)||d)){const e=yo(f,l,o,n);if(So(f,e),"out-in"===c)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,!1!==n.update.active&&n.update()},bo(i);"in-out"===c&&a.type!==bs&&(e.delayLeave=(e,t,n)=>{vo(o,f)[String(f.key)]=f,e[uo]=()=>{t(),e[uo]=void 0,delete u.delayedLeave},u.delayedLeave=n})}return i}}};function vo(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function yo(e,t,n,o){const{appear:r,mode:s,persisted:i=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:a,onEnterCancelled:u,onBeforeLeave:p,onLeave:d,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:g,onAppear:v,onAfterAppear:y,onAppearCancelled:b}=t,_=String(e.key),S=vo(n,e),x=(e,t)=>{e&&en(e,o,9,t)},C=(e,t)=>{const n=t[1];x(e,t),f(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},k={mode:s,persisted:i,beforeEnter(t){let o=l;if(!n.isMounted){if(!r)return;o=g||l}t[uo]&&t[uo](!0);const s=S[_];s&&Ps(e,s)&&s.el[uo]&&s.el[uo](),x(o,[t])},enter(e){let t=c,o=a,s=u;if(!n.isMounted){if(!r)return;t=v||c,o=y||a,s=b||u}let i=!1;const l=e[po]=t=>{i||(i=!0,x(t?s:o,[e]),k.delayedLeave&&k.delayedLeave(),e[po]=void 0)};t?C(t,[e,l]):l()},leave(t,o){const r=String(e.key);if(t[po]&&t[po](!0),n.isUnmounting)return o();x(p,[t]);let s=!1;const i=t[uo]=n=>{s||(s=!0,o(),x(n?m:h,[t]),t[uo]=void 0,S[r]===e&&delete S[r])};S[r]=e,d?C(d,[t,i]):i()},clone:e=>yo(e,t,n,o)};return k}function bo(e){if(Eo(e))return(e=Ls(e)).children=null,e}function _o(e){return Eo(e)?e.children?e.children[0]:void 0:e}function So(e,t){6&e.shapeFlag&&e.component?So(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function xo(e,t=!1,n){let o=[],r=0;for(let s=0;s1)for(let s=0;sc({name:e.name},t,{setup:e}))():e}const ko=e=>!!e.type.__asyncLoader +/*! #__NO_SIDE_EFFECTS__ */;function wo(e){g(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:r=200,timeout:s,suspensible:i=!0,onError:l}=e;let c,a=null,u=0;const p=()=>{let e;return a||(e=a=t().catch((e=>{if(e=e instanceof Error?e:new Error(String(e)),l)return new Promise(((t,n)=>{l(e,(()=>t((u++,a=null,p()))),(()=>n(e)),u+1)}));throw e})).then((t=>e!==a&&a?a:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),c=t,t))))};return Co({name:"AsyncComponentWrapper",__asyncLoader:p,get __asyncResolved(){return c},setup(){const e=Zs;if(c)return()=>To(c,e);const t=t=>{a=null,tn(t,e,13,!o)};if(i&&e.suspense)return p().then((t=>()=>To(t,e))).catch((e=>(t(e),()=>o?Is(o,{error:e}):null)));const l=Ft(!1),u=Ft(),f=Ft(!!r);return r&&setTimeout((()=>{f.value=!1}),r),null!=s&&setTimeout((()=>{if(!l.value&&!u.value){const e=new Error(`Async component timed out after ${s}ms.`);t(e),u.value=e}}),s),p().then((()=>{l.value=!0,e.parent&&Eo(e.parent.vnode)&&dn(e.parent.update)})).catch((e=>{t(e),u.value=e})),()=>l.value&&c?To(c,e):u.value&&o?Is(o,{error:u.value}):n&&!f.value?Is(n):void 0}})}function To(e,t){const{ref:n,props:o,children:r,ce:s}=t.vnode,i=Is(e,o,r);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const Eo=e=>e.type.__isKeepAlive,No={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Ys(),o=n.ctx,r=new Map,s=new Set;let i=null;const l=n.suspense,{renderer:{p:c,m:a,um:u,o:{createElement:p}}}=o,f=p("div");function d(e){Fo(e),u(e,n,l,!0)}function h(e){r.forEach(((t,n)=>{const o=pi(t.type);!o||e&&e(o)||m(n)}))}function m(e){const t=r.get(e);i&&Ps(t,i)?i&&Fo(i):d(t),r.delete(e),s.delete(e)}o.activate=(e,t,n,o,r)=>{const s=e.component;a(e,t,n,0,l),c(s.vnode,e,t,n,s,l,o,e.slotScopeIds,r),rs((()=>{s.isDeactivated=!1,s.a&&V(s.a);const t=e.props&&e.props.onVnodeMounted;t&&Gs(t,s.parent,e)}),l)},o.deactivate=e=>{const t=e.component;a(e,f,null,1,l),rs((()=>{t.da&&V(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&Gs(n,t.parent,e),t.isDeactivated=!0}),l)},oo((()=>[e.include,e.exclude]),(([e,t])=>{e&&h((t=>Oo(e,t))),t&&h((e=>!Oo(t,e)))}),{flush:"post",deep:!0});let g=null;const v=()=>{null!=g&&r.set(g,Mo(n.subTree))};return Lo(v),Uo(v),Do((()=>{r.forEach((e=>{const{subTree:t,suspense:o}=n,r=Mo(t);if(e.type!==r.type||e.key!==r.key)d(e);else{Fo(r);const e=r.component.da;e&&rs(e,o)}}))})),()=>{if(g=null,!t.default)return null;const n=t.default(),o=n[0];if(n.length>1)return i=null,n;if(!($s(o)&&(4&o.shapeFlag||128&o.shapeFlag)))return i=null,o;let l=Mo(o);const c=l.type,a=pi(ko(l)?l.type.__asyncResolved||{}:c),{include:u,exclude:p,max:f}=e;if(u&&(!a||!Oo(u,a))||p&&a&&Oo(p,a))return i=l,o;const d=null==l.key?c:l.key,h=r.get(d);return l.el&&(l=Ls(l),128&o.shapeFlag&&(o.ssContent=l)),g=d,h?(l.el=h.el,l.component=h.component,l.transition&&So(l,l.transition),l.shapeFlag|=512,s.delete(d),s.add(d)):(s.add(d),f&&s.size>parseInt(f,10)&&m(s.values().next().value)),l.shapeFlag|=256,i=l,Kn(o.type)?o:l}}};function Oo(e,t){return f(e)?e.some((e=>Oo(e,t))):v(e)?e.split(",").includes(t):"[object RegExp]"===x(e)&&e.test(t)}function $o(e,t){Ro(e,"a",t)}function Po(e,t){Ro(e,"da",t)}function Ro(e,t,n=Zs){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Vo(t,o,n),n){let e=n.parent;for(;e&&e.parent;)Eo(e.parent.vnode)&&Ao(o,t,n,e),e=e.parent}}function Ao(e,t,n,o){const r=Vo(t,e,o,!0);Ho((()=>{a(o[t],r)}),n)}function Fo(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Mo(e){return 128&e.shapeFlag?e.ssContent:e}function Vo(e,t,n=Zs,o=!1){if(n){const r=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;Ee(),Xs(n);const r=en(t,n,e,o);return ei(),Ne(),r});return o?r.unshift(s):r.push(s),s}}const Io=e=>(t,n=Zs)=>(!ri||"sp"===e)&&Vo(e,((...e)=>t(...e)),n),Bo=Io("bm"),Lo=Io("m"),jo=Io("bu"),Uo=Io("u"),Do=Io("bum"),Ho=Io("um"),Wo=Io("sp"),zo=Io("rtg"),Ko=Io("rtc");function Go(e,t=Zs){Vo("ec",e,t)}function qo(e,t,n,o){let r;const s=n&&n[o];if(f(e)||v(e)){r=new Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,s&&s[n])));else{const n=Object.keys(e);r=new Array(n.length);for(let o=0,i=n.length;o{const t=o.fn(...e);return t&&(t.key=o.key),t}:o.fn)}return e}function Zo(e,t,n={},o,r){if(En.isCE||En.parent&&ko(En.parent)&&En.parent.isCE)return"default"!==t&&(n.name=t),Is("slot",n,o&&o());let s=e[t];s&&s._c&&(s._d=!1),Cs();const i=s&&Yo(s(n)),l=Os(vs,{key:n.key||i&&i.key||`_${t}`},i||(o?o():[]),i&&1===e._?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function Yo(e){return e.some((e=>!$s(e)||e.type!==bs&&!(e.type===vs&&!Yo(e.children))))?e:null}function Qo(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:F(o)]=e[o];return n}const Xo=e=>e?ti(e)?ui(e)||e.proxy:Xo(e.parent):null,er=c(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Xo(e.parent),$root:e=>Xo(e.root),$emit:e=>e.emit,$options:e=>kr(e),$forceUpdate:e=>e.f||(e.f=()=>dn(e.update)),$nextTick:e=>e.n||(e.n=fn.bind(e.proxy)),$watch:e=>so.bind(e)}),tr=(e,n)=>e!==t&&!e.__isScriptSetup&&p(e,n),nr={get({_:e},n){const{ctx:o,setupState:r,data:s,props:i,accessCache:l,type:c,appContext:a}=e;let u;if("$"!==n[0]){const c=l[n];if(void 0!==c)switch(c){case 1:return r[n];case 2:return s[n];case 4:return o[n];case 3:return i[n]}else{if(tr(r,n))return l[n]=1,r[n];if(s!==t&&p(s,n))return l[n]=2,s[n];if((u=e.propsOptions[0])&&p(u,n))return l[n]=3,i[n];if(o!==t&&p(o,n))return l[n]=4,o[n];_r&&(l[n]=0)}}const f=er[n];let d,h;return f?("$attrs"===n&&Oe(e,0,n),f(e)):(d=c.__cssModules)&&(d=d[n])?d:o!==t&&p(o,n)?(l[n]=4,o[n]):(h=a.config.globalProperties,p(h,n)?h[n]:void 0)},set({_:e},n,o){const{data:r,setupState:s,ctx:i}=e;return tr(s,n)?(s[n]=o,!0):r!==t&&p(r,n)?(r[n]=o,!0):!p(e.props,n)&&(("$"!==n[0]||!(n.slice(1)in e))&&(i[n]=o,!0))},has({_:{data:e,setupState:n,accessCache:o,ctx:r,appContext:s,propsOptions:i}},l){let c;return!!o[l]||e!==t&&p(e,l)||tr(n,l)||(c=i[0])&&p(c,l)||p(r,l)||p(er,l)||p(s.config.globalProperties,l)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:p(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},or=c({},nr,{get(e,t){if(t!==Symbol.unscopables)return nr.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!D(t)});function rr(){return null}function sr(){return null}function ir(e){}function lr(e){}function cr(){return null}function ar(){}function ur(e,t){return null}function pr(){return hr().slots}function fr(){return hr().attrs}function dr(e,t,n){const o=Ys();if(n&&n.local){const n=Ft(e[t]);return oo((()=>e[t]),(e=>n.value=e)),oo(n,(n=>{n!==e[t]&&o.emit(`update:${t}`,n)})),n}return{__v_isRef:!0,get value(){return e[t]},set value(e){o.emit(`update:${t}`,e)}}}function hr(){const e=Ys();return e.setupContext||(e.setupContext=ai(e))}function mr(e){return f(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}function gr(e,t){const n=mr(e);for(const o in t){if(o.startsWith("__skip"))continue;let e=n[o];e?f(e)||g(e)?e=n[o]={type:e,default:t[o]}:e.default=t[o]:null===e&&(e=n[o]={default:t[o]}),e&&t[`__skip_${o}`]&&(e.skipFactory=!0)}return n}function vr(e,t){return e&&t?f(e)&&f(t)?e.concat(t):c({},mr(e),mr(t)):e||t}function yr(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function br(e){const t=Ys();let n=e();return ei(),_(n)&&(n=n.catch((e=>{throw Xs(t),e}))),[n,()=>Xs(t)]}let _r=!0;function Sr(e){const t=kr(e),n=e.proxy,r=e.ctx;_r=!1,t.beforeCreate&&xr(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:l,watch:c,provide:a,inject:u,created:p,beforeMount:d,mounted:h,beforeUpdate:m,updated:v,activated:y,deactivated:_,beforeUnmount:S,unmounted:x,render:C,renderTracked:k,renderTriggered:w,errorCaptured:T,serverPrefetch:E,expose:N,inheritAttrs:O,components:$,directives:P}=t;if(u&&function(e,t,n=o){f(e)&&(e=Nr(e));for(const o in e){const n=e[o];let r;r=b(n)?"default"in n?Ir(n.from||o,n.default,!0):Ir(n.from||o):Ir(n),At(r)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[o]=r}}(u,r,null),l)for(const o in l){const e=l[o];g(e)&&(r[o]=e.bind(n))}if(s){const t=s.call(n,n);b(t)&&(e.data=yt(t))}if(_r=!0,i)for(const f in i){const e=i[f],t=g(e)?e.bind(n,n):g(e.get)?e.get.bind(n,n):o,s=!g(e)&&g(e.set)?e.set.bind(n):o,l=fi({get:t,set:s});Object.defineProperty(r,f,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e})}if(c)for(const o in c)Cr(c[o],r,n,o);if(a){const e=g(a)?a.call(n):a;Reflect.ownKeys(e).forEach((t=>{Vr(t,e[t])}))}function R(e,t){f(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(p&&xr(p,e,"c"),R(Bo,d),R(Lo,h),R(jo,m),R(Uo,v),R($o,y),R(Po,_),R(Go,T),R(Ko,k),R(zo,w),R(Do,S),R(Ho,x),R(Wo,E),f(N))if(N.length){const t=e.exposed||(e.exposed={});N.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});C&&e.render===o&&(e.render=C),null!=O&&(e.inheritAttrs=O),$&&(e.components=$),P&&(e.directives=P)}function xr(e,t,n){en(f(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function Cr(e,t,n,o){const r=o.includes(".")?io(n,o):()=>n[o];if(v(e)){const n=t[e];g(n)&&oo(r,n)}else if(g(e))oo(r,e.bind(n));else if(b(e))if(f(e))e.forEach((e=>Cr(e,t,n,o)));else{const o=g(e.handler)?e.handler.bind(n):t[e.handler];g(o)&&oo(r,o,e)}}function kr(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,l=s.get(t);let c;return l?c=l:r.length||n||o?(c={},r.length&&r.forEach((e=>wr(c,e,i,!0))),wr(c,t,i)):c=t,b(t)&&s.set(t,c),c}function wr(e,t,n,o=!1){const{mixins:r,extends:s}=t;s&&wr(e,s,n,!0),r&&r.forEach((t=>wr(e,t,n,!0)));for(const i in t)if(o&&"expose"===i);else{const o=Tr[i]||n&&n[i];e[i]=o?o(e[i],t[i]):t[i]}return e}const Tr={data:Er,props:Pr,emits:Pr,methods:$r,computed:$r,beforeCreate:Or,created:Or,beforeMount:Or,mounted:Or,beforeUpdate:Or,updated:Or,beforeDestroy:Or,beforeUnmount:Or,destroyed:Or,unmounted:Or,activated:Or,deactivated:Or,errorCaptured:Or,serverPrefetch:Or,components:$r,directives:$r,watch:function(e,t){if(!e)return t;if(!t)return e;const n=c(Object.create(null),e);for(const o in t)n[o]=Or(e[o],t[o]);return n},provide:Er,inject:function(e,t){return $r(Nr(e),Nr(t))}};function Er(e,t){return t?e?function(){return c(g(e)?e.call(this,this):e,g(t)?t.call(this,this):t)}:t:e}function Nr(e){if(f(e)){const t={};for(let n=0;n(s.has(e)||(e&&g(e.install)?(s.add(e),e.install(l,...t)):g(e)&&(s.add(e),e(l,...t))),l),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),l),component:(e,t)=>t?(r.components[e]=t,l):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,l):r.directives[e],mount(s,c,a){if(!i){const u=Is(n,o);return u.appContext=r,c&&t?t(u,s):e(u,s,a),i=!0,l._container=s,s.__vue_app__=l,ui(u.component)||u.component.proxy}},unmount(){i&&(e(null,l._container),delete l._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,l),runWithContext(e){Mr=l;try{return e()}finally{Mr=null}}};return l}}let Mr=null;function Vr(e,t){if(Zs){let n=Zs.provides;const o=Zs.parent&&Zs.parent.provides;o===n&&(n=Zs.provides=Object.create(o)),n[e]=t}else;}function Ir(e,t,n=!1){const o=Zs||En;if(o||Mr){const r=o?null==o.parent?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:Mr._context.provides;if(r&&e in r)return r[e];if(arguments.length>1)return n&&g(t)?t.call(o&&o.proxy):t}}function Br(){return!!(Zs||En||Mr)}function Lr(e,n,o,r){const[s,i]=e.propsOptions;let l,c=!1;if(n)for(let t in n){if(T(t))continue;const a=n[t];let u;s&&p(s,u=$(t))?i&&i.includes(u)?(l||(l={}))[u]=a:o[u]=a:Tn(e.emitsOptions,t)||t in r&&a===r[t]||(r[t]=a,c=!0)}if(i){const n=Et(o),r=l||t;for(let t=0;t{d=!0;const[t,n]=Ur(e,o,!0);c(a,t),n&&u.push(...n)};!r&&o.mixins.length&&o.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!l&&!d)return b(e)&&s.set(e,n),n;if(f(l))for(let n=0;n-1,o[1]=n<0||t-1||p(o,"default"))&&u.push(e)}}}const h=[a,u];return b(e)&&s.set(e,h),h}function Dr(e){return"$"!==e[0]}function Hr(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:null===e?"null":""}function Wr(e,t){return Hr(e)===Hr(t)}function zr(e,t){return f(t)?t.findIndex((t=>Wr(t,e))):g(t)&&Wr(t,e)?0:-1}const Kr=e=>"_"===e[0]||"$stable"===e,Gr=e=>f(e)?e.map(Hs):[Hs(e)],qr=(e,t,n)=>{if(t._n)return t;const o=An(((...e)=>Gr(t(...e))),n);return o._c=!1,o},Jr=(e,t,n)=>{const o=e._ctx;for(const r in e){if(Kr(r))continue;const n=e[r];if(g(n))t[r]=qr(0,n,o);else if(null!=n){const e=Gr(n);t[r]=()=>e}}},Zr=(e,t)=>{const n=Gr(t);e.slots.default=()=>n},Yr=(e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=Et(t),I(t,"_",n)):Jr(t,e.slots={})}else e.slots={},t&&Zr(e,t);I(e.slots,As,1)},Qr=(e,n,o)=>{const{vnode:r,slots:s}=e;let i=!0,l=t;if(32&r.shapeFlag){const e=n._;e?o&&1===e?i=!1:(c(s,n),o||1!==e||delete s._):(i=!n.$stable,Jr(n,s)),l=n}else n&&(Zr(e,n),l={default:1});if(i)for(const t in s)Kr(t)||null!=l[t]||delete s[t]};function Xr(e,n,o,r,s=!1){if(f(e))return void e.forEach(((e,t)=>Xr(e,n&&(f(n)?n[t]:n),o,r,s)));if(ko(r)&&!s)return;const i=4&r.shapeFlag?ui(r.component)||r.component.proxy:r.el,l=s?null:i,{i:c,r:u}=e,d=n&&n.r,h=c.refs===t?c.refs={}:c.refs,m=c.setupState;if(null!=d&&d!==u&&(v(d)?(h[d]=null,p(m,d)&&(m[d]=null)):At(d)&&(d.value=null)),g(u))Xt(u,c,12,[l,h]);else{const t=v(u),n=At(u);if(t||n){const r=()=>{if(e.f){const n=t?p(m,u)?m[u]:h[u]:u.value;s?f(n)&&a(n,i):f(n)?n.includes(i)||n.push(i):t?(h[u]=[i],p(m,u)&&(m[u]=h[u])):(u.value=[i],e.k&&(h[e.k]=u.value))}else t?(h[u]=l,p(m,u)&&(m[u]=l)):n&&(u.value=l,e.k&&(h[e.k]=l))};l?(r.id=-1,rs(r,o)):r()}}}let es=!1;const ts=e=>/svg/.test(e.namespaceURI)&&"foreignObject"!==e.tagName,ns=e=>8===e.nodeType;function os(e){const{mt:t,p:n,o:{patchProp:o,createText:r,nextSibling:s,parentNode:l,remove:c,insert:a,createComment:u}}=e,p=(n,o,i,c,u,b=!1)=>{const _=ns(n)&&"["===n.data,S=()=>m(n,o,i,c,u,_),{type:x,ref:C,shapeFlag:k,patchFlag:w}=o;let T=n.nodeType;o.el=n,-2===w&&(b=!1,o.dynamicChildren=null);let E=null;switch(x){case ys:3!==T?""===o.children?(a(o.el=r(""),l(n),n),E=n):E=S():(n.data!==o.children&&(es=!0,n.data=o.children),E=s(n));break;case bs:y(n)?(E=s(n),v(o.el=n.content.firstChild,n,i)):E=8!==T||_?S():s(n);break;case _s:if(_&&(T=(n=s(n)).nodeType),1===T||3===T){E=n;const e=!o.children.length;for(let t=0;t{l=l||!!t.dynamicChildren;const{type:a,props:u,patchFlag:p,shapeFlag:f,dirs:h,transition:m}=t,g="input"===a&&h||"option"===a;if(g||-1!==p){if(h&&ao(t,null,n,"created"),u)if(g||!l||48&p)for(const t in u)(g&&t.endsWith("value")||i(t)&&!T(t))&&o(e,t,null,u[t],!1,void 0,n);else u.onClick&&o(e,"onClick",null,u.onClick,!1,void 0,n);let a;(a=u&&u.onVnodeBeforeMount)&&Gs(a,n,t);let b=!1;if(y(e)){b=as(r,m)&&n&&n.vnode.props&&n.vnode.props.appear;const o=e.content.firstChild;b&&m.beforeEnter(o),v(o,e,n),t.el=e=o}if(h&&ao(t,null,n,"beforeMount"),((a=u&&u.onVnodeMounted)||h||b)&&Yn((()=>{a&&Gs(a,n,t),b&&m.enter(e),h&&ao(t,null,n,"mounted")}),r),16&f&&(!u||!u.innerHTML&&!u.textContent)){let o=d(e.firstChild,t,e,n,r,s,l);for(;o;){es=!0;const e=o;o=o.nextSibling,c(e)}}else 8&f&&e.textContent!==t.children&&(es=!0,e.textContent=t.children)}return e.nextSibling},d=(e,t,o,r,s,i,l)=>{l=l||!!t.dynamicChildren;const c=t.children,a=c.length;for(let u=0;u{const{slotScopeIds:c}=t;c&&(r=r?r.concat(c):c);const p=l(e),f=d(s(e),t,p,n,o,r,i);return f&&ns(f)&&"]"===f.data?s(t.anchor=f):(es=!0,a(t.anchor=u("]"),p,f),f)},m=(e,t,o,r,i,a)=>{if(es=!0,t.el=null,a){const t=g(e);for(;;){const n=s(e);if(!n||n===t)break;c(n)}}const u=s(e),p=l(e);return c(e),n(null,t,p,u,o,r,ts(p),i),u},g=(e,t="[",n="]")=>{let o=0;for(;e;)if((e=s(e))&&ns(e)&&(e.data===t&&o++,e.data===n)){if(0===o)return s(e);o--}return e},v=(e,t,n)=>{const o=t.parentNode;o&&o.replaceChild(e,t);let r=n;for(;r;)r.vnode.el===t&&(r.vnode.el=r.subTree.el=e),r=r.parent},y=e=>1===e.nodeType&&"template"===e.tagName.toLowerCase();return[(e,t)=>{if(!t.hasChildNodes())return n(null,e,t),vn(),void(t._vnode=e);es=!1,p(t.firstChild,e,null,null,null),vn(),t._vnode=e,es&&console.error("Hydration completed but contains mismatches.")},p]}const rs=Yn;function ss(e){return ls(e)}function is(e){return ls(e,os)}function ls(e,r){U().__VUE__=!0;const{insert:s,remove:i,patchProp:l,createElement:c,createText:a,createComment:u,setText:f,setElementText:d,parentNode:h,nextSibling:m,setScopeId:g=o,insertStaticContent:v}=e,y=(e,t,n,o=null,r=null,s=null,i=!1,l=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Ps(e,t)&&(o=Y(e),K(e,r,s,!0),e=null),-2===t.patchFlag&&(c=!1,t.dynamicChildren=null);const{type:a,ref:u,shapeFlag:p}=t;switch(a){case ys:b(e,t,n,o);break;case bs:S(e,t,n,o);break;case _s:null==e&&x(t,n,o,i);break;case vs:A(e,t,n,o,r,s,i,l,c);break;default:1&p?C(e,t,n,o,r,s,i,l,c):6&p?F(e,t,n,o,r,s,i,l,c):(64&p||128&p)&&a.process(e,t,n,o,r,s,i,l,c,X)}null!=u&&r&&Xr(u,e&&e.ref,s,t||e,!t)},b=(e,t,n,o)=>{if(null==e)s(t.el=a(t.children),n,o);else{const n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},S=(e,t,n,o)=>{null==e?s(t.el=u(t.children||""),n,o):t.el=e.el},x=(e,t,n,o)=>{[e.el,e.anchor]=v(e.children,t,n,o,e.el,e.anchor)},C=(e,t,n,o,r,s,i,l,c)=>{i=i||"svg"===t.type,null==e?k(t,n,o,r,s,i,l,c):N(e,t,r,s,i,l,c)},k=(e,t,n,o,r,i,a,u)=>{let p,f;const{type:h,props:m,shapeFlag:g,transition:v,dirs:y}=e;if(p=e.el=c(e.type,i,m&&m.is,m),8&g?d(p,e.children):16&g&&E(e.children,p,null,o,r,i&&"foreignObject"!==h,a,u),y&&ao(e,null,o,"created"),w(p,e,e.scopeId,a,o),m){for(const t in m)"value"===t||T(t)||l(p,t,null,m[t],i,e.children,o,r,Z);"value"in m&&l(p,"value",null,m.value),(f=m.onVnodeBeforeMount)&&Gs(f,o,e)}y&&ao(e,null,o,"beforeMount");const b=as(r,v);b&&v.beforeEnter(p),s(p,t,n),((f=m&&m.onVnodeMounted)||b||y)&&rs((()=>{f&&Gs(f,o,e),b&&v.enter(p),y&&ao(e,null,o,"mounted")}),r)},w=(e,t,n,o,r)=>{if(n&&g(e,n),o)for(let s=0;s{for(let a=c;a{const a=n.el=e.el;let{patchFlag:u,dynamicChildren:p,dirs:f}=n;u|=16&e.patchFlag;const h=e.props||t,m=n.props||t;let g;o&&cs(o,!1),(g=m.onVnodeBeforeUpdate)&&Gs(g,o,n,e),f&&ao(n,e,o,"beforeUpdate"),o&&cs(o,!0);const v=s&&"foreignObject"!==n.type;if(p?O(e.dynamicChildren,p,a,o,r,v,i):c||D(e,n,a,null,o,r,v,i,!1),u>0){if(16&u)P(a,n,h,m,o,r,s);else if(2&u&&h.class!==m.class&&l(a,"class",null,m.class,s),4&u&&l(a,"style",h.style,m.style,s),8&u){const t=n.dynamicProps;for(let n=0;n{g&&Gs(g,o,n,e),f&&ao(n,e,o,"updated")}),r)},O=(e,t,n,o,r,s,i)=>{for(let l=0;l{if(o!==r){if(o!==t)for(const t in o)T(t)||t in r||l(e,t,o[t],null,c,n.children,s,i,Z);for(const t in r){if(T(t))continue;const a=r[t],u=o[t];a!==u&&"value"!==t&&l(e,t,u,a,c,n.children,s,i,Z)}"value"in r&&l(e,"value",o.value,r.value)}},A=(e,t,n,o,r,i,l,c,u)=>{const p=t.el=e?e.el:a(""),f=t.anchor=e?e.anchor:a("");let{patchFlag:d,dynamicChildren:h,slotScopeIds:m}=t;m&&(c=c?c.concat(m):m),null==e?(s(p,n,o),s(f,n,o),E(t.children,n,f,r,i,l,c,u)):d>0&&64&d&&h&&e.dynamicChildren?(O(e.dynamicChildren,h,n,r,i,l,c),(null!=t.key||r&&t===r.subTree)&&us(e,t,!0)):D(e,t,n,f,r,i,l,c,u)},F=(e,t,n,o,r,s,i,l,c)=>{t.slotScopeIds=l,null==e?512&t.shapeFlag?r.ctx.activate(t,n,o,i,c):M(t,n,o,r,s,i,c):B(e,t,c)},M=(e,n,o,r,s,i,l)=>{const c=e.component=function(e,n,o){const r=e.type,s=(n?n.appContext:e.appContext)||qs,i={uid:Js++,vnode:e,type:r,parent:n,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,scope:new ie(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(s.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ur(r,s),emitsOptions:wn(r,s),emit:null,emitted:null,propsDefaults:t,inheritAttrs:r.inheritAttrs,ctx:t,data:t,props:t,attrs:t,slots:t,refs:t,setupState:t,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:o,suspenseId:o?o.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};i.ctx={_:i},i.root=n?n.root:i,i.emit=kn.bind(null,i),e.ce&&e.ce(i);return i}(e,r,s);if(Eo(e)&&(c.ctx.renderer=X),function(e,t=!1){ri=t;const{props:n,children:o}=e.vnode,r=ti(e);(function(e,t,n,o=!1){const r={},s={};I(s,As,1),e.propsDefaults=Object.create(null),Lr(e,t,r,s);for(const i in e.propsOptions[0])i in r||(r[i]=void 0);e.props=n?o?r:bt(r):e.type.props?r:s,e.attrs=s})(e,n,r,t),Yr(e,o);const s=r?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Nt(new Proxy(e.ctx,nr));const{setup:o}=n;if(o){const n=e.setupContext=o.length>1?ai(e):null;Xs(e),Ee();const r=Xt(o,e,0,[e.props,n]);if(Ne(),ei(),_(r)){if(r.then(ei,ei),t)return r.then((n=>{si(e,n,t)})).catch((t=>{tn(t,e,0)}));e.asyncDep=r}else si(e,r,t)}else ci(e,t)}(e,t):void 0;ri=!1}(c),c.asyncDep){if(s&&s.registerDep(c,L),!e.el){const e=c.subTree=Is(bs);S(null,e,n,o)}}else L(c,e,n,o,s,i,l)},B=(e,t,n)=>{const o=t.component=e.component;if(function(e,t,n){const{props:o,children:r,component:s}=e,{props:i,children:l,patchFlag:c}=t,a=s.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&c>=0))return!(!r&&!l||l&&l.$stable)||o!==i&&(o?!i||In(o,i,a):!!i);if(1024&c)return!0;if(16&c)return o?In(o,i,a):!!i;if(8&c){const e=t.dynamicProps;for(let t=0;tsn&&rn.splice(t,1)}(o.update),o.update()}else t.el=e.el,o.vnode=t},L=(e,t,n,o,r,s,i)=>{const l=e.effect=new Se((()=>{if(e.isMounted){let t,{next:n,bu:o,u:l,parent:c,vnode:a}=e,u=n;cs(e,!1),n?(n.el=a.el,j(e,n,i)):n=a,o&&V(o),(t=n.props&&n.props.onVnodeBeforeUpdate)&&Gs(t,c,n,a),cs(e,!0);const p=Fn(e),f=e.subTree;e.subTree=p,y(f,p,h(f.el),Y(f),e,r,s),n.el=p.el,null===u&&Bn(e,p.el),l&&rs(l,r),(t=n.props&&n.props.onVnodeUpdated)&&rs((()=>Gs(t,c,n,a)),r)}else{let i;const{el:l,props:c}=t,{bm:a,m:u,parent:p}=e,f=ko(t);if(cs(e,!1),a&&V(a),!f&&(i=c&&c.onVnodeBeforeMount)&&Gs(i,p,t),cs(e,!0),l&&te){const n=()=>{e.subTree=Fn(e),te(l,e.subTree,e,r,null)};f?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const i=e.subTree=Fn(e);y(null,i,n,o,e,r,s),t.el=i.el}if(u&&rs(u,r),!f&&(i=c&&c.onVnodeMounted)){const e=t;rs((()=>Gs(i,p,e)),r)}(256&t.shapeFlag||p&&ko(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&rs(e.a,r),e.isMounted=!0,t=n=o=null}}),(()=>dn(c)),e.scope),c=e.update=()=>l.run();c.id=e.uid,cs(e,!0),c()},j=(e,t,n)=>{t.component=e;const o=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,o){const{props:r,attrs:s,vnode:{patchFlag:i}}=e,l=Et(r),[c]=e.propsOptions;let a=!1;if(!(o||i>0)||16&i){let o;Lr(e,t,r,s)&&(a=!0);for(const s in l)t&&(p(t,s)||(o=R(s))!==s&&p(t,o))||(c?!n||void 0===n[s]&&void 0===n[o]||(r[s]=jr(c,l,s,void 0,e,!0)):delete r[s]);if(s!==l)for(const e in s)t&&p(t,e)||(delete s[e],a=!0)}else if(8&i){const n=e.vnode.dynamicProps;for(let o=0;o{const a=e&&e.children,u=e?e.shapeFlag:0,p=t.children,{patchFlag:f,shapeFlag:h}=t;if(f>0){if(128&f)return void W(a,p,n,o,r,s,i,l,c);if(256&f)return void H(a,p,n,o,r,s,i,l,c)}8&h?(16&u&&Z(a,r,s),p!==a&&d(n,p)):16&u?16&h?W(a,p,n,o,r,s,i,l,c):Z(a,r,s,!0):(8&u&&d(n,""),16&h&&E(p,n,o,r,s,i,l,c))},H=(e,t,o,r,s,i,l,c,a)=>{const u=(e=e||n).length,p=(t=t||n).length,f=Math.min(u,p);let d;for(d=0;dp?Z(e,s,i,!0,!1,f):E(t,o,r,s,i,l,c,a,f)},W=(e,t,o,r,s,i,l,c,a)=>{let u=0;const p=t.length;let f=e.length-1,d=p-1;for(;u<=f&&u<=d;){const n=e[u],r=t[u]=a?Ws(t[u]):Hs(t[u]);if(!Ps(n,r))break;y(n,r,o,null,s,i,l,c,a),u++}for(;u<=f&&u<=d;){const n=e[f],r=t[d]=a?Ws(t[d]):Hs(t[d]);if(!Ps(n,r))break;y(n,r,o,null,s,i,l,c,a),f--,d--}if(u>f){if(u<=d){const e=d+1,n=ed)for(;u<=f;)K(e[u],s,i,!0),u++;else{const h=u,m=u,g=new Map;for(u=m;u<=d;u++){const e=t[u]=a?Ws(t[u]):Hs(t[u]);null!=e.key&&g.set(e.key,u)}let v,b=0;const _=d-m+1;let S=!1,x=0;const C=new Array(_);for(u=0;u<_;u++)C[u]=0;for(u=h;u<=f;u++){const n=e[u];if(b>=_){K(n,s,i,!0);continue}let r;if(null!=n.key)r=g.get(n.key);else for(v=m;v<=d;v++)if(0===C[v-m]&&Ps(n,t[v])){r=v;break}void 0===r?K(n,s,i,!0):(C[r-m]=u+1,r>=x?x=r:S=!0,y(n,t[r],o,null,s,i,l,c,a),b++)}const k=S?function(e){const t=e.slice(),n=[0];let o,r,s,i,l;const c=e.length;for(o=0;o>1,e[n[l]]0&&(t[o]=n[s-1]),n[s]=o)}}s=n.length,i=n[s-1];for(;s-- >0;)n[s]=i,i=t[i];return n}(C):n;for(v=k.length-1,u=_-1;u>=0;u--){const e=m+u,n=t[e],f=e+1{const{el:i,type:l,transition:c,children:a,shapeFlag:u}=e;if(6&u)return void z(e.component.subTree,t,n,o);if(128&u)return void e.suspense.move(t,n,o);if(64&u)return void l.move(e,t,n,X);if(l===vs){s(i,t,n);for(let e=0;e{let r;for(;e&&e!==t;)r=m(e),s(e,n,o),e=r;s(t,n,o)})(e,t,n);if(2!==o&&1&u&&c)if(0===o)c.beforeEnter(i),s(i,t,n),rs((()=>c.enter(i)),r);else{const{leave:e,delayLeave:o,afterLeave:r}=c,l=()=>s(i,t,n),a=()=>{e(i,(()=>{l(),r&&r()}))};o?o(i,l,a):a()}else s(i,t,n)},K=(e,t,n,o=!1,r=!1)=>{const{type:s,props:i,ref:l,children:c,dynamicChildren:a,shapeFlag:u,patchFlag:p,dirs:f}=e;if(null!=l&&Xr(l,null,n,e,!0),256&u)return void t.ctx.deactivate(e);const d=1&u&&f,h=!ko(e);let m;if(h&&(m=i&&i.onVnodeBeforeUnmount)&&Gs(m,t,e),6&u)J(e.component,n,o);else{if(128&u)return void e.suspense.unmount(n,o);d&&ao(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,r,X,o):a&&(s!==vs||p>0&&64&p)?Z(a,t,n,!1,!0):(s===vs&&384&p||!r&&16&u)&&Z(c,t,n),o&&G(e)}(h&&(m=i&&i.onVnodeUnmounted)||d)&&rs((()=>{m&&Gs(m,t,e),d&&ao(e,null,t,"unmounted")}),n)},G=e=>{const{type:t,el:n,anchor:o,transition:r}=e;if(t===vs)return void q(n,o);if(t===_s)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=m(e),i(e),e=n;i(t)})(e);const s=()=>{i(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){const{leave:t,delayLeave:o}=r,i=()=>t(n,s);o?o(e.el,s,i):i()}else s()},q=(e,t)=>{let n;for(;e!==t;)n=m(e),i(e),e=n;i(t)},J=(e,t,n)=>{const{bum:o,scope:r,update:s,subTree:i,um:l}=e;o&&V(o),r.stop(),s&&(s.active=!1,K(i,e,t,n)),l&&rs(l,t),rs((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},Z=(e,t,n,o=!1,r=!1,s=0)=>{for(let i=s;i6&e.shapeFlag?Y(e.component.subTree):128&e.shapeFlag?e.suspense.next():m(e.anchor||e.el),Q=(e,t,n)=>{null==e?t._vnode&&K(t._vnode,null,null,!0):y(t._vnode||null,e,t,null,null,null,n),gn(),vn(),t._vnode=e},X={p:y,um:K,m:z,r:G,mt:M,mc:E,pc:D,pbc:O,n:Y,o:e};let ee,te;return r&&([ee,te]=r(X)),{render:Q,hydrate:ee,createApp:Fr(Q,ee)}}function cs({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function as(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function us(e,t,n=!1){const o=e.children,r=t.children;if(f(o)&&f(r))for(let s=0;se&&(e.disabled||""===e.disabled),fs=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,ds=(e,t)=>{const n=e&&e.to;if(v(n)){if(t){return t(n)}return null}return n};function hs(e,t,n,{o:{insert:o},m:r},s=2){0===s&&o(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:c,children:a,props:u}=e,p=2===s;if(p&&o(i,t,n),(!p||ps(u))&&16&c)for(let f=0;f{16&v&&u(y,e,t,r,s,i,l,c)};g?b(n,a):p&&b(p,f)}else{t.el=e.el;const o=t.anchor=e.anchor,u=t.target=e.target,d=t.targetAnchor=e.targetAnchor,m=ps(e.props),v=m?n:u,y=m?o:d;if(i=i||fs(u),b?(f(e.dynamicChildren,b,v,r,s,i,l),us(e,t,!0)):c||p(e,t,v,y,r,s,i,l,!1),g)m?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):hs(t,n,o,a,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=ds(t.props,h);e&&hs(t,e,null,a,0)}else m&&hs(t,u,d,a,1)}gs(t)},remove(e,t,n,o,{um:r,o:{remove:s}},i){const{shapeFlag:l,children:c,anchor:a,targetAnchor:u,target:p,props:f}=e;if(p&&s(u),i&&s(a),16&l){const e=i||!ps(f);for(let o=0;o0?xs||n:null,ks(),ws>0&&xs&&xs.push(e),e}function Ns(e,t,n,o,r,s){return Es(Vs(e,t,n,o,r,s,!0))}function Os(e,t,n,o,r){return Es(Is(e,t,n,o,r,!0))}function $s(e){return!!e&&!0===e.__v_isVNode}function Ps(e,t){return e.type===t.type&&e.key===t.key}function Rs(e){}const As="__vInternal",Fs=({key:e})=>null!=e?e:null,Ms=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?v(e)||At(e)||g(e)?{i:En,r:e,k:t,f:!!n}:e:null);function Vs(e,t=null,n=null,o=0,r=null,s=(e===vs?0:1),i=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Fs(t),ref:t&&Ms(t),scopeId:Nn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:En};return l?(zs(c,n),128&s&&e.normalize(c)):n&&(c.shapeFlag|=v(n)?8:16),ws>0&&!i&&xs&&(c.patchFlag>0||6&s)&&32!==c.patchFlag&&xs.push(c),c}const Is=function(e,t=null,n=null,o=0,r=null,s=!1){e&&e!==Un||(e=bs);if($s(e)){const o=Ls(e,t,!0);return n&&zs(o,n),ws>0&&!s&&xs&&(6&o.shapeFlag?xs[xs.indexOf(e)]=o:xs.push(o)),o.patchFlag|=-2,o}i=e,g(i)&&"__vccOpts"in i&&(e=e.__vccOpts);var i;if(t){t=Bs(t);let{class:e,style:n}=t;e&&!v(e)&&(t.class=q(e)),b(n)&&(Tt(n)&&!f(n)&&(n=c({},n)),t.style=H(n))}const l=v(e)?1:Kn(e)?128:(e=>e.__isTeleport)(e)?64:b(e)?4:g(e)?2:0;return Vs(e,t,n,o,r,l,s,!0)};function Bs(e){return e?Tt(e)||As in e?c({},e):e:null}function Ls(e,t,n=!1){const{props:o,ref:r,patchFlag:s,children:i}=e,l=t?Ks(o||{},t):o;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Fs(l),ref:t&&t.ref?n&&r?f(r)?r.concat(Ms(t)):[r,Ms(t)]:Ms(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==vs?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ls(e.ssContent),ssFallback:e.ssFallback&&Ls(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function js(e=" ",t=0){return Is(ys,null,e,t)}function Us(e,t){const n=Is(_s,null,e);return n.staticCount=t,n}function Ds(e="",t=!1){return t?(Cs(),Os(bs,null,e)):Is(bs,null,e)}function Hs(e){return null==e||"boolean"==typeof e?Is(bs):f(e)?Is(vs,null,e.slice()):"object"==typeof e?Ws(e):Is(ys,null,String(e))}function Ws(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Ls(e)}function zs(e,t){let n=0;const{shapeFlag:o}=e;if(null==t)t=null;else if(f(t))n=16;else if("object"==typeof t){if(65&o){const n=t.default;return void(n&&(n._c&&(n._d=!1),zs(e,n()),n._c&&(n._d=!0)))}{n=32;const o=t._;o||As in t?3===o&&En&&(1===En.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=En}}else g(t)?(t={default:t,_ctx:En},n=32):(t=String(t),64&o?(n=16,t=[js(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ks(...e){const t={};for(let n=0;nZs||En;let Qs;Qs=e=>{Zs=e};const Xs=e=>{Qs(e),e.scope.on()},ei=()=>{Zs&&Zs.scope.off(),Qs(null)};function ti(e){return 4&e.vnode.shapeFlag}let ni,oi,ri=!1;function si(e,t,n){g(t)?e.render=t:b(t)&&(e.setupState=Dt(t)),ci(e,n)}function ii(e){ni=e,oi=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,or))}}const li=()=>!ni;function ci(e,t,n){const r=e.type;if(!e.render){if(!t&&ni&&!r.render){const t=r.template||kr(e).template;if(t){const{isCustomElement:n,compilerOptions:o}=e.appContext.config,{delimiters:s,compilerOptions:i}=r,l=c(c({isCustomElement:n,delimiters:s},o),i);r.render=ni(t,l)}}e.render=r.render||o,oi&&oi(e)}Xs(e),Ee();try{Sr(e)}finally{Ne(),ei()}}function ai(e){const t=t=>{e.exposed=t||{}};return{get attrs(){return function(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get:(t,n)=>(Oe(e,0,"$attrs"),t[n])}))}(e)},slots:e.slots,emit:e.emit,expose:t}}function ui(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Dt(Nt(e.exposed)),{get:(t,n)=>n in t?t[n]:n in er?er[n](e):void 0,has:(e,t)=>t in e||t in er}))}function pi(e,t=!0){return g(e)?e.displayName||e.name:e.name||t&&e.__name}const fi=(e,t)=>function(e,t,n=!1){let r,s;const i=g(e);return i?(r=e,s=o):(r=e.get,s=e.set),new Zt(r,s,i||!s,n)}(e,0,ri);function di(e,t,n){const o=arguments.length;return 2===o?b(t)&&!f(t)?$s(t)?Is(e,null,[t]):Is(e,t):Is(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&$s(n)&&(n=[n]),Is(e,t,n))}const hi=Symbol.for("v-scx"),mi=()=>Ir(hi);function gi(){}function vi(e,t,n,o){const r=n[o];if(r&&yi(r,e))return r;const s=t();return s.memo=e.slice(),n[o]=s}function yi(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o0&&xs&&xs.push(e),!0}const bi="3.3.8",_i=null,Si=null,xi=null,Ci="undefined"!=typeof document?document:null,ki=Ci&&Ci.createElement("template"),wi={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r=t?Ci.createElementNS("http://www.w3.org/2000/svg",e):Ci.createElement(e,n?{is:n}:void 0);return"select"===e&&o&&null!=o.multiple&&r.setAttribute("multiple",o.multiple),r},createText:e=>Ci.createTextNode(e),createComment:e=>Ci.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ci.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,r,s){const i=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==s&&(r=r.nextSibling););else{ki.innerHTML=o?`${e}`:e;const r=ki.content;if(o){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ti="transition",Ei="animation",Ni=Symbol("_vtc"),Oi=(e,{slots:t})=>di(go,Fi(e),t);Oi.displayName="Transition";const $i={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Pi=Oi.props=c({},mo,$i),Ri=(e,t=[])=>{f(e)?e.forEach((e=>e(...t))):e&&e(...t)},Ai=e=>!!e&&(f(e)?e.some((e=>e.length>1)):e.length>1);function Fi(e){const t={};for(const c in e)c in $i||(t[c]=e[c]);if(!1===e.css)return t;const{name:n="v",type:o,duration:r,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=s,appearActiveClass:u=i,appearToClass:p=l,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:d=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,m=function(e){if(null==e)return null;if(b(e))return[Mi(e.enter),Mi(e.leave)];{const t=Mi(e);return[t,t]}}(r),g=m&&m[0],v=m&&m[1],{onBeforeEnter:y,onEnter:_,onEnterCancelled:S,onLeave:x,onLeaveCancelled:C,onBeforeAppear:k=y,onAppear:w=_,onAppearCancelled:T=S}=t,E=(e,t,n)=>{Ii(e,t?p:l),Ii(e,t?u:i),n&&n()},N=(e,t)=>{e._isLeaving=!1,Ii(e,f),Ii(e,h),Ii(e,d),t&&t()},O=e=>(t,n)=>{const r=e?w:_,i=()=>E(t,e,n);Ri(r,[t,i]),Bi((()=>{Ii(t,e?a:s),Vi(t,e?p:l),Ai(r)||ji(t,o,g,i)}))};return c(t,{onBeforeEnter(e){Ri(y,[e]),Vi(e,s),Vi(e,i)},onBeforeAppear(e){Ri(k,[e]),Vi(e,a),Vi(e,u)},onEnter:O(!1),onAppear:O(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>N(e,t);Vi(e,f),Wi(),Vi(e,d),Bi((()=>{e._isLeaving&&(Ii(e,f),Vi(e,h),Ai(x)||ji(e,o,v,n))})),Ri(x,[e,n])},onEnterCancelled(e){E(e,!1),Ri(S,[e])},onAppearCancelled(e){E(e,!0),Ri(T,[e])},onLeaveCancelled(e){N(e),Ri(C,[e])}})}function Mi(e){return L(e)}function Vi(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e[Ni]||(e[Ni]=new Set)).add(t)}function Ii(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const n=e[Ni];n&&(n.delete(t),n.size||(e[Ni]=void 0))}function Bi(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let Li=0;function ji(e,t,n,o){const r=e._endId=++Li,s=()=>{r===e._endId&&o()};if(n)return setTimeout(s,n);const{type:i,timeout:l,propCount:c}=Ui(e,t);if(!i)return o();const a=i+"end";let u=0;const p=()=>{e.removeEventListener(a,f),s()},f=t=>{t.target===e&&++u>=c&&p()};setTimeout((()=>{u(n[e]||"").split(", "),r=o(`${Ti}Delay`),s=o(`${Ti}Duration`),i=Di(r,s),l=o(`${Ei}Delay`),c=o(`${Ei}Duration`),a=Di(l,c);let u=null,p=0,f=0;t===Ti?i>0&&(u=Ti,p=i,f=s.length):t===Ei?a>0&&(u=Ei,p=a,f=c.length):(p=Math.max(i,a),u=p>0?i>a?Ti:Ei:null,f=u?u===Ti?s.length:c.length:0);return{type:u,timeout:p,propCount:f,hasTransform:u===Ti&&/\b(transform|all)(,|$)/.test(o(`${Ti}Property`).toString())}}function Di(e,t){for(;e.lengthHi(t)+Hi(e[n]))))}function Hi(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function Wi(){return document.body.offsetHeight}const zi=Symbol("_vod"),Ki={beforeMount(e,{value:t},{transition:n}){e[zi]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):Gi(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Gi(e,!0),o.enter(e)):o.leave(e,(()=>{Gi(e,!1)})):Gi(e,t))},beforeUnmount(e,{value:t}){Gi(e,t)}};function Gi(e,t){e.style.display=t?e[zi]:"none"}const qi=/\s*!important$/;function Ji(e,t,n){if(f(n))n.forEach((n=>Ji(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=Yi[t];if(n)return n;let o=$(t);if("filter"!==o&&o in e)return Yi[t]=o;o=A(o);for(let r=0;r{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();en(function(e,t){if(f(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=sl(),n}(o,r);Xi(e,n,i,l)}else i&&(!function(e,t,n,o){e.removeEventListener(t,n,o)}(e,n,i,l),s[t]=void 0)}}const nl=/(?:Once|Passive|Capture)$/;let ol=0;const rl=Promise.resolve(),sl=()=>ol||(rl.then((()=>ol=0)),ol=Date.now());const il=/^on[a-z]/; +/*! #__NO_SIDE_EFFECTS__ */ +function ll(e,t){const n=Co(e);class o extends ul{constructor(e){super(n,e,t)}}return o.def=n,o} +/*! #__NO_SIDE_EFFECTS__ */const cl=e=>ll(e,Jl),al="undefined"!=typeof HTMLElement?HTMLElement:class{};class ul extends al{constructor(e,t={},n){super(),this._def=e,this._props=t,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this._ob=null,this.shadowRoot&&n?n(this._createVNode(),this.shadowRoot):(this.attachShadow({mode:"open"}),this._def.__asyncLoader||this._resolveProps(this._def))}connectedCallback(){this._connected=!0,this._instance||(this._resolved?this._update():this._resolveDef())}disconnectedCallback(){this._connected=!1,this._ob&&(this._ob.disconnect(),this._ob=null),fn((()=>{this._connected||(ql(null,this.shadowRoot),this._instance=null)}))}_resolveDef(){this._resolved=!0;for(let n=0;n{for(const t of e)this._setAttr(t.attributeName)})),this._ob.observe(this,{attributes:!0});const e=(e,t=!1)=>{const{props:n,styles:o}=e;let r;if(n&&!f(n))for(const s in n){const e=n[s];(e===Number||e&&e.type===Number)&&(s in this._props&&(this._props[s]=L(this._props[s])),(r||(r=Object.create(null)))[$(s)]=!0)}this._numberProps=r,t&&this._resolveProps(e),this._applyStyles(o),this._update()},t=this._def.__asyncLoader;t?t().then((t=>e(t,!0))):e(this._def)}_resolveProps(e){const{props:t}=e,n=f(t)?t:Object.keys(t||{});for(const o of Object.keys(this))"_"!==o[0]&&n.includes(o)&&this._setProp(o,this[o],!0,!1);for(const o of n.map($))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(e){this._setProp(o,e)}})}_setAttr(e){let t=this.getAttribute(e);const n=$(e);this._numberProps&&this._numberProps[n]&&(t=L(t)),this._setProp(n,t,!1)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,o=!0){t!==this._props[e]&&(this._props[e]=t,o&&this._instance&&this._update(),n&&(!0===t?this.setAttribute(R(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(R(e),t+""):t||this.removeAttribute(R(e))))}_update(){ql(this._createVNode(),this.shadowRoot)}_createVNode(){const e=Is(this._def,c({},this._props));return this._instance||(e.ce=e=>{this._instance=e,e.isCE=!0;const t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,{detail:t}))};e.emit=(e,...n)=>{t(e,n),R(e)!==e&&t(R(e),n)};let n=this;for(;n=n&&(n.parentNode||n.host);)if(n instanceof ul){e.parent=n._instance,e.provides=n._instance.provides;break}}),e}_applyStyles(e){e&&e.forEach((e=>{const t=document.createElement("style");t.textContent=e,this.shadowRoot.appendChild(t)}))}}function pl(e="$style"){{const n=Ys();if(!n)return t;const o=n.type.__cssModules;if(!o)return t;const r=o[e];return r||t}}function fl(e){const t=Ys();if(!t)return;const n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach((e=>hl(e,n)))},o=()=>{const o=e(t.proxy);dl(t.subTree,o),n(o)};eo(o),Lo((()=>{const e=new MutationObserver(o);e.observe(t.subTree.el.parentNode,{childList:!0}),Ho((()=>e.disconnect()))}))}function dl(e,t){if(128&e.shapeFlag){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push((()=>{dl(n.activeBranch,t)}))}for(;e.component;)e=e.component.subTree;if(1&e.shapeFlag&&e.el)hl(e.el,t);else if(e.type===vs)e.children.forEach((e=>dl(e,t)));else if(e.type===_s){let{el:n,anchor:o}=e;for(;n&&(hl(n,t),n!==o);)n=n.nextSibling}}function hl(e,t){if(1===e.nodeType){const n=e.style;for(const e in t)n.setProperty(`--${e}`,t[e])}}const ml=new WeakMap,gl=new WeakMap,vl=Symbol("_moveCb"),yl=Symbol("_enterCb"),bl={name:"TransitionGroup",props:c({},Pi,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Ys(),o=fo();let r,s;return Uo((()=>{if(!r.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const o=e.cloneNode(),r=e[Ni];r&&r.forEach((e=>{e.split(/\s+/).forEach((e=>e&&o.classList.remove(e)))}));n.split(/\s+/).forEach((e=>e&&o.classList.add(e))),o.style.display="none";const s=1===t.nodeType?t:t.parentNode;s.appendChild(o);const{hasTransform:i}=Ui(o);return s.removeChild(o),i}(r[0].el,n.vnode.el,t))return;r.forEach(Sl),r.forEach(xl);const o=r.filter(Cl);Wi(),o.forEach((e=>{const n=e.el,o=n.style;Vi(n,t),o.transform=o.webkitTransform=o.transitionDuration="";const r=n[vl]=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",r),n[vl]=null,Ii(n,t))};n.addEventListener("transitionend",r)}))})),()=>{const i=Et(e),l=Fi(i);let c=i.tag||vs;r=s,s=t.default?xo(t.default()):[];for(let e=0;e{const t=e.props["onUpdate:modelValue"]||!1;return f(t)?e=>V(t,e):t};function wl(e){e.target.composing=!0}function Tl(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const El=Symbol("_assign"),Nl={created(e,{modifiers:{lazy:t,trim:n,number:o}},r){e[El]=kl(r);const s=o||r.props&&"number"===r.props.type;Xi(e,t?"change":"input",(t=>{if(t.target.composing)return;let o=e.value;n&&(o=o.trim()),s&&(o=B(o)),e[El](o)})),n&&Xi(e,"change",(()=>{e.value=e.value.trim()})),t||(Xi(e,"compositionstart",wl),Xi(e,"compositionend",Tl),Xi(e,"change",Tl))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:o,number:r}},s){if(e[El]=kl(s),e.composing)return;if(document.activeElement===e&&"range"!==e.type){if(n)return;if(o&&e.value.trim()===t)return;if((r||"number"===e.type)&&B(e.value)===t)return}const i=null==t?"":t;e.value!==i&&(e.value=i)}},Ol={deep:!0,created(e,t,n){e[El]=kl(n),Xi(e,"change",(()=>{const t=e._modelValue,n=Fl(e),o=e.checked,r=e[El];if(f(t)){const e=ne(t,n),s=-1!==e;if(o&&!s)r(t.concat(n));else if(!o&&s){const n=[...t];n.splice(e,1),r(n)}}else if(h(t)){const e=new Set(t);o?e.add(n):e.delete(n),r(e)}else r(Ml(e,o))}))},mounted:$l,beforeUpdate(e,t,n){e[El]=kl(n),$l(e,t,n)}};function $l(e,{value:t,oldValue:n},o){e._modelValue=t,f(t)?e.checked=ne(t,o.props.value)>-1:h(t)?e.checked=t.has(o.props.value):t!==n&&(e.checked=te(t,Ml(e,!0)))}const Pl={created(e,{value:t},n){e.checked=te(t,n.props.value),e[El]=kl(n),Xi(e,"change",(()=>{e[El](Fl(e))}))},beforeUpdate(e,{value:t,oldValue:n},o){e[El]=kl(o),t!==n&&(e.checked=te(t,o.props.value))}},Rl={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const r=h(t);Xi(e,"change",(()=>{const t=Array.prototype.filter.call(e.options,(e=>e.selected)).map((e=>n?B(Fl(e)):Fl(e)));e[El](e.multiple?r?new Set(t):t:t[0])})),e[El]=kl(o)},mounted(e,{value:t}){Al(e,t)},beforeUpdate(e,t,n){e[El]=kl(n)},updated(e,{value:t}){Al(e,t)}};function Al(e,t){const n=e.multiple;if(!n||f(t)||h(t)){for(let o=0,r=e.options.length;o-1:t.has(s);else if(te(Fl(r),t))return void(e.selectedIndex!==o&&(e.selectedIndex=o))}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function Fl(e){return"_value"in e?e._value:e.value}function Ml(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Vl={created(e,t,n){Il(e,t,n,null,"created")},mounted(e,t,n){Il(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Il(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Il(e,t,n,o,"updated")}};function Il(e,t,n,o,r){const s=function(e,t){switch(e){case"SELECT":return Rl;case"TEXTAREA":return Nl;default:switch(t){case"checkbox":return Ol;case"radio":return Pl;default:return Nl}}}(e.tagName,n.props&&n.props.type)[r];s&&s(e,t,n,o)}const Bl=["ctrl","shift","alt","meta"],Ll={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Bl.some((n=>e[`${n}Key`]&&!t.includes(n)))},jl=(e,t)=>(n,...o)=>{for(let e=0;en=>{if(!("key"in n))return;const o=R(n.key);return t.some((e=>e===o||Ul[e]===o))?e(n):void 0},Hl=c({patchProp:(e,t,n,o,r=!1,s,c,a,u)=>{"class"===t?function(e,t,n){const o=e[Ni];o&&(t=(t?[t,...o]:[...o]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,o,r):"style"===t?function(e,t,n){const o=e.style,r=v(n);if(n&&!r){if(t&&!v(t))for(const e in t)null==n[e]&&Ji(o,e,"");for(const e in n)Ji(o,e,n[e])}else{const s=o.display;r?t!==n&&(o.cssText=n):t&&e.removeAttribute("style"),zi in e&&(o.display=s)}}(e,n,o):i(t)?l(t)||tl(e,t,0,o,c):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,o){if(o)return"innerHTML"===t||"textContent"===t||!!(t in e&&il.test(t)&&g(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if(il.test(t)&&v(n))return!1;return t in e}(e,t,o,r))?function(e,t,n,o,r,s,i){if("innerHTML"===t||"textContent"===t)return o&&i(o,r,s),void(e[t]=null==n?"":n);const l=e.tagName;if("value"===t&&"PROGRESS"!==l&&!l.includes("-")){e._value=n;const o=null==n?"":n;return("OPTION"===l?e.getAttribute("value"):e.value)!==o&&(e.value=o),void(null==n&&e.removeAttribute(t))}let c=!1;if(""===n||null==n){const o=typeof e[t];"boolean"===o?n=ee(n):null==n&&"string"===o?(n="",c=!0):"number"===o&&(n=0,c=!0)}try{e[t]=n}catch(a){}c&&e.removeAttribute(t)}(e,t,o,s,c,a,u):("true-value"===t?e._trueValue=o:"false-value"===t&&(e._falseValue=o),function(e,t,n,o,r){if(o&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(Qi,t.slice(6,t.length)):e.setAttributeNS(Qi,t,n);else{const o=X(t);null==n||o&&!ee(n)?e.removeAttribute(t):e.setAttribute(t,o?"":n)}}(e,t,o,r))}},wi);let Wl,zl=!1;function Kl(){return Wl||(Wl=ss(Hl))}function Gl(){return Wl=zl?Wl:is(Hl),zl=!0,Wl}const ql=(...e)=>{Kl().render(...e)},Jl=(...e)=>{Gl().hydrate(...e)},Zl=(...e)=>{const t=Kl().createApp(...e),{mount:n}=t;return t.mount=e=>{const o=Ql(e);if(!o)return;const r=t._component;g(r)||r.render||r.template||(r.template=o.innerHTML),o.innerHTML="";const s=n(o,!1,o instanceof SVGElement);return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),s},t},Yl=(...e)=>{const t=Gl().createApp(...e),{mount:n}=t;return t.mount=e=>{const t=Ql(e);if(t)return n(t,!0,t instanceof SVGElement)},t};function Ql(e){if(v(e)){return document.querySelector(e)}return e}const Xl=o;var ec=Object.freeze({__proto__:null,BaseTransition:go,BaseTransitionPropsValidators:mo,Comment:bs,EffectScope:ie,Fragment:vs,KeepAlive:No,ReactiveEffect:Se,Static:_s,Suspense:Gn,Teleport:ms,Text:ys,Transition:Oi,TransitionGroup:_l,VueElement:ul,assertNumber:Qt,callWithAsyncErrorHandling:en,callWithErrorHandling:Xt,camelize:$,capitalize:A,cloneVNode:Ls,compatUtils:null,computed:fi,createApp:Zl,createBlock:Os,createCommentVNode:Ds,createElementBlock:Ns,createElementVNode:Vs,createHydrationRenderer:is,createPropsRestProxy:yr,createRenderer:ss,createSSRApp:Yl,createSlots:Jo,createStaticVNode:Us,createTextVNode:js,createVNode:Is,customRef:Wt,defineAsyncComponent:wo,defineComponent:Co,defineCustomElement:ll,defineEmits:sr,defineExpose:ir,defineModel:ar,defineOptions:lr,defineProps:rr,defineSSRCustomElement:cl,defineSlots:cr,get devtools(){return Sn},effect:Ce,effectScope:le,getCurrentInstance:Ys,getCurrentScope:ae,getTransitionRawChildren:xo,guardReactiveProps:Bs,h:di,handleError:tn,hasInjectionContext:Br,hydrate:Jl,initCustomFormatter:gi,initDirectivesForSSR:Xl,inject:Ir,isMemoSame:yi,isProxy:Tt,isReactive:Ct,isReadonly:kt,isRef:At,isRuntimeOnly:li,isShallow:wt,isVNode:$s,markRaw:Nt,mergeDefaults:gr,mergeModels:vr,mergeProps:Ks,nextTick:fn,normalizeClass:q,normalizeProps:J,normalizeStyle:H,onActivated:$o,onBeforeMount:Bo,onBeforeUnmount:Do,onBeforeUpdate:jo,onDeactivated:Po,onErrorCaptured:Go,onMounted:Lo,onRenderTracked:Ko,onRenderTriggered:zo,onScopeDispose:ue,onServerPrefetch:Wo,onUnmounted:Ho,onUpdated:Uo,openBlock:Cs,popScopeId:Pn,provide:Vr,proxyRefs:Dt,pushScopeId:$n,queuePostFlushCb:mn,reactive:yt,readonly:_t,ref:Ft,registerRuntimeCompiler:ii,render:ql,renderList:qo,renderSlot:Zo,resolveComponent:jn,resolveDirective:Hn,resolveDynamicComponent:Dn,resolveFilter:null,resolveTransitionHooks:yo,setBlockTracking:Ts,setDevtoolsHook:Cn,setTransitionHooks:So,shallowReactive:bt,shallowReadonly:St,shallowRef:Mt,ssrContextKey:hi,ssrUtils:null,stop:ke,toDisplayString:oe,toHandlerKey:F,toHandlers:Qo,toRaw:Et,toRef:qt,toRefs:zt,toValue:jt,transformVNodeArgs:Rs,triggerRef:Bt,unref:Lt,useAttrs:fr,useCssModule:pl,useCssVars:fl,useModel:dr,useSSRContext:mi,useSlots:pr,useTransitionState:fo,vModelCheckbox:Ol,vModelDynamic:Vl,vModelRadio:Pl,vModelSelect:Rl,vModelText:Nl,vShow:Ki,version:bi,warn:Yt,watch:oo,watchEffect:Xn,watchPostEffect:eo,watchSyncEffect:to,withAsyncContext:br,withCtx:An,withDefaults:ur,withDirectives:co,withKeys:Dl,withMemo:vi,withModifiers:jl,withScopeId:Rn});function tc(e){throw e}function nc(e){}function oc(e,t,n,o){const r=new SyntaxError(String(e));return r.code=e,r.loc=t,r}const rc=Symbol(""),sc=Symbol(""),ic=Symbol(""),lc=Symbol(""),cc=Symbol(""),ac=Symbol(""),uc=Symbol(""),pc=Symbol(""),fc=Symbol(""),dc=Symbol(""),hc=Symbol(""),mc=Symbol(""),gc=Symbol(""),vc=Symbol(""),yc=Symbol(""),bc=Symbol(""),_c=Symbol(""),Sc=Symbol(""),xc=Symbol(""),Cc=Symbol(""),kc=Symbol(""),wc=Symbol(""),Tc=Symbol(""),Ec=Symbol(""),Nc=Symbol(""),Oc=Symbol(""),$c=Symbol(""),Pc=Symbol(""),Rc=Symbol(""),Ac=Symbol(""),Fc=Symbol(""),Mc=Symbol(""),Vc=Symbol(""),Ic=Symbol(""),Bc=Symbol(""),Lc=Symbol(""),jc=Symbol(""),Uc=Symbol(""),Dc=Symbol(""),Hc={[rc]:"Fragment",[sc]:"Teleport",[ic]:"Suspense",[lc]:"KeepAlive",[cc]:"BaseTransition",[ac]:"openBlock",[uc]:"createBlock",[pc]:"createElementBlock",[fc]:"createVNode",[dc]:"createElementVNode",[hc]:"createCommentVNode",[mc]:"createTextVNode",[gc]:"createStaticVNode",[vc]:"resolveComponent",[yc]:"resolveDynamicComponent",[bc]:"resolveDirective",[_c]:"resolveFilter",[Sc]:"withDirectives",[xc]:"renderList",[Cc]:"renderSlot",[kc]:"createSlots",[wc]:"toDisplayString",[Tc]:"mergeProps",[Ec]:"normalizeClass",[Nc]:"normalizeStyle",[Oc]:"normalizeProps",[$c]:"guardReactiveProps",[Pc]:"toHandlers",[Rc]:"camelize",[Ac]:"capitalize",[Fc]:"toHandlerKey",[Mc]:"setBlockTracking",[Vc]:"pushScopeId",[Ic]:"popScopeId",[Bc]:"withCtx",[Lc]:"unref",[jc]:"isRef",[Uc]:"withMemo",[Dc]:"isMemoSame"};const Wc={source:"",start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function zc(e,t,n,o,r,s,i,l=!1,c=!1,a=!1,u=Wc){return e&&(l?(e.helper(ac),e.helper(ta(e.inSSR,a))):e.helper(ea(e.inSSR,a)),i&&e.helper(Sc)),{type:13,tag:t,props:n,children:o,patchFlag:r,dynamicProps:s,directives:i,isBlock:l,disableTracking:c,isComponent:a,loc:u}}function Kc(e,t=Wc){return{type:17,loc:t,elements:e}}function Gc(e,t=Wc){return{type:15,loc:t,properties:e}}function qc(e,t){return{type:16,loc:Wc,key:v(e)?Jc(e,!0):e,value:t}}function Jc(e,t=!1,n=Wc,o=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:o}}function Zc(e,t=Wc){return{type:8,loc:t,children:e}}function Yc(e,t=[],n=Wc){return{type:14,loc:n,callee:e,arguments:t}}function Qc(e,t=void 0,n=!1,o=!1,r=Wc){return{type:18,params:e,returns:t,newline:n,isSlot:o,loc:r}}function Xc(e,t,n,o=!0){return{type:19,test:e,consequent:t,alternate:n,newline:o,loc:Wc}}function ea(e,t){return e||t?fc:dc}function ta(e,t){return e||t?uc:pc}function na(e,{helper:t,removeHelper:n,inSSR:o}){e.isBlock||(e.isBlock=!0,n(ea(o,e.isComponent)),t(ac),t(ta(o,e.isComponent)))}const oa=e=>4===e.type&&e.isStatic,ra=(e,t)=>e===t||e===R(t);function sa(e){return ra(e,"Teleport")?sc:ra(e,"Suspense")?ic:ra(e,"KeepAlive")?lc:ra(e,"BaseTransition")?cc:void 0}const ia=/^\d|[^\$\w]/,la=e=>!ia.test(e),ca=/[A-Za-z_$\xA0-\uFFFF]/,aa=/[\.\?\w$\xA0-\uFFFF]/,ua=/\s+[.[]\s*|\s*[.[]\s+/g,pa=e=>{e=e.trim().replace(ua,(e=>e.trim()));let t=0,n=[],o=0,r=0,s=null;for(let i=0;i4===e.key.type&&e.key.content===o))}return n}function Ta(e,t){return`_${t}_${e.replace(/[^\w]/g,((t,n)=>"-"===t?"_":e.charCodeAt(n).toString()))}`}const Ea=/&(gt|lt|amp|apos|quot);/g,Na={gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},Oa={delimiters:["{{","}}"],getNamespace:()=>0,getTextMode:()=>0,isVoidTag:r,isPreTag:r,isCustomElement:r,decodeEntities:e=>e.replace(Ea,((e,t)=>Na[t])),onError:tc,onWarn:nc,comments:!1};function $a(e,t={}){const n=function(e,t){const n=c({},Oa);let o;for(o in t)n[o]=void 0===t[o]?Oa[o]:t[o];return{options:n,column:1,line:1,offset:0,originalSource:e,source:e,inPre:!1,inVPre:!1,onWarn:n.onWarn}}(e,t),o=Wa(n);return function(e,t=Wc){return{type:0,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:t}}(Pa(n,0,[]),za(n,o))}function Pa(e,t,n){const o=Ka(n),r=o?o.ns:0,s=[];for(;!Qa(e,t,n);){const i=e.source;let l;if(0===t||1===t)if(!e.inVPre&&Ga(i,e.options.delimiters[0]))l=Ua(e,t);else if(0===t&&"<"===i[0])if(1===i.length);else if("!"===i[1])l=Ga(i,"\x3c!--")?Fa(e):Ga(i,""===i[2]){qa(e,3);continue}if(/[a-z]/i.test(i[2])){Ba(e,1,o);continue}Ya(e,12,2),l=Ma(e)}else/[a-z]/i.test(i[1])?l=Va(e,n):"?"===i[1]&&(Ya(e,21,1),l=Ma(e));if(l||(l=Da(e,t)),f(l))for(let e=0;e/.exec(e.source);if(o){n=e.source.slice(4,o.index);const t=e.source.slice(0,o.index);let r=1,s=0;for(;-1!==(s=t.indexOf("\x3c!--",r));)qa(e,s-r+1),r=s+1;qa(e,o.index+o[0].length-r+1)}else n=e.source.slice(4),qa(e,e.source.length);return{type:3,content:n,loc:za(e,t)}}function Ma(e){const t=Wa(e),n="?"===e.source[1]?1:2;let o;const r=e.source.indexOf(">");return-1===r?(o=e.source.slice(n),qa(e,e.source.length)):(o=e.source.slice(n,r),qa(e,r+1)),{type:3,content:o,loc:za(e,t)}}function Va(e,t){const n=e.inPre,o=e.inVPre,r=Ka(t),s=Ba(e,0,r),i=e.inPre&&!n,l=e.inVPre&&!o;if(s.isSelfClosing||e.options.isVoidTag(s.tag))return i&&(e.inPre=!1),l&&(e.inVPre=!1),s;t.push(s);const c=e.options.getTextMode(s,r),a=Pa(e,c,t);if(t.pop(),s.children=a,Xa(e.source,s.tag))Ba(e,1,r);else if(0===e.source.length&&"script"===s.tag.toLowerCase()){const e=a[0];e&&Ga(e.loc.source,"\x3c!--")}return s.loc=za(e,s.loc.start),i&&(e.inPre=!1),l&&(e.inVPre=!1),s}const Ia=e("if,else,else-if,for,slot");function Ba(e,t,n){const o=Wa(e),r=/^<\/?([a-z][^\t\r\n\f />]*)/i.exec(e.source),s=r[1],i=e.options.getNamespace(s,n);qa(e,r[0].length),Ja(e);const l=Wa(e),a=e.source;e.options.isPreTag(s)&&(e.inPre=!0);let u=La(e,t);0===t&&!e.inVPre&&u.some((e=>7===e.type&&"pre"===e.name))&&(e.inVPre=!0,c(e,l),e.source=a,u=La(e,t).filter((e=>"v-pre"!==e.name)));let p=!1;if(0===e.source.length||(p=Ga(e.source,"/>"),qa(e,p?2:1)),1===t)return;let f=0;return e.inVPre||("slot"===s?f=2:"template"===s?u.some((e=>7===e.type&&Ia(e.name)))&&(f=3):function(e,t,n){const o=n.options;if(o.isCustomElement(e))return!1;if("component"===e||/^[A-Z]/.test(e)||sa(e)||o.isBuiltInComponent&&o.isBuiltInComponent(e)||o.isNativeTag&&!o.isNativeTag(e))return!0;for(let r=0;r0&&!Ga(e.source,">")&&!Ga(e.source,"/>");){if(Ga(e.source,"/")){qa(e,1),Ja(e);continue}const r=ja(e,o);6===r.type&&r.value&&"class"===r.name&&(r.value.content=r.value.content.replace(/\s+/g," ").trim()),0===t&&n.push(r),/^[^\t\r\n\f />]/.test(e.source),Ja(e)}return n}function ja(e,t){var n;const o=Wa(e),r=/^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(e.source)[0];t.has(r),t.add(r);{const t=/["'<]/g;let n;for(;n=t.exec(r);)Ya(e,17,n.index)}let s;qa(e,r.length),/^[\t\r\n\f ]*=/.test(e.source)&&(Ja(e),qa(e,1),Ja(e),s=function(e){const t=Wa(e);let n;const o=e.source[0],r='"'===o||"'"===o;if(r){qa(e,1);const t=e.source.indexOf(o);-1===t?n=Ha(e,e.source.length,4):(n=Ha(e,t,4),qa(e,1))}else{const t=/^[^\t\r\n\f >]+/.exec(e.source);if(!t)return;const o=/["'<=`]/g;let r;for(;r=o.exec(t[0]);)Ya(e,18,r.index);n=Ha(e,t[0].length,4)}return{content:n,isQuoted:r,loc:za(e,t)}}(e));const i=za(e,o);if(!e.inVPre&&/^(v-[A-Za-z0-9-]|:|\.|@|#)/.test(r)){const t=/(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(r);let l,c=Ga(r,"."),a=t[1]||(c||Ga(r,":")?"bind":Ga(r,"@")?"on":"slot");if(t[2]){const s="slot"===a,i=r.lastIndexOf(t[2],r.length-((null==(n=t[3])?void 0:n.length)||0)),c=za(e,Za(e,o,i),Za(e,o,i+t[2].length+(s&&t[3]||"").length));let u=t[2],p=!0;u.startsWith("[")?(p=!1,u.endsWith("]")?u=u.slice(1,u.length-1):(Ya(e,27),u=u.slice(1))):s&&(u+=t[3]||""),l={type:4,content:u,isStatic:p,constType:p?3:0,loc:c}}if(s&&s.isQuoted){const e=s.loc;e.start.offset++,e.start.column++,e.end=da(e.start,s.content),e.source=e.source.slice(1,-1)}const u=t[3]?t[3].slice(1).split("."):[];return c&&u.push("prop"),{type:7,name:a,exp:s&&{type:4,content:s.content,isStatic:!1,constType:0,loc:s.loc},arg:l,modifiers:u,loc:i}}return!e.inVPre&&Ga(r,"v-"),{type:6,name:r,value:s&&{type:2,content:s.content,loc:s.loc},loc:i}}function Ua(e,t){const[n,o]=e.options.delimiters,r=e.source.indexOf(o,n.length);if(-1===r)return;const s=Wa(e);qa(e,n.length);const i=Wa(e),l=Wa(e),c=r-n.length,a=e.source.slice(0,c),u=Ha(e,c,t),p=u.trim(),f=u.indexOf(p);f>0&&ha(i,a,f);return ha(l,a,c-(u.length-p.length-f)),qa(e,o.length),{type:5,content:{type:4,isStatic:!1,constType:0,content:p,loc:za(e,i,l)},loc:za(e,s)}}function Da(e,t){const n=3===t?["]]>"]:["<",e.options.delimiters[0]];let o=e.source.length;for(let s=0;st&&(o=t)}const r=Wa(e);return{type:2,content:Ha(e,o,t),loc:za(e,r)}}function Ha(e,t,n){const o=e.source.slice(0,t);return qa(e,t),2!==n&&3!==n&&o.includes("&")?e.options.decodeEntities(o,4===n):o}function Wa(e){const{column:t,line:n,offset:o}=e;return{column:t,line:n,offset:o}}function za(e,t,n){return{start:t,end:n=n||Wa(e),source:e.originalSource.slice(t.offset,n.offset)}}function Ka(e){return e[e.length-1]}function Ga(e,t){return e.startsWith(t)}function qa(e,t){const{source:n}=e;ha(e,n,t),e.source=n.slice(t)}function Ja(e){const t=/^[\t\r\n\f ]+/.exec(e.source);t&&qa(e,t[0].length)}function Za(e,t,n){return da(t,e.originalSource.slice(t.offset,n),n)}function Ya(e,t,n,o=Wa(e)){n&&(o.offset+=n,o.column+=n),e.options.onError(oc(t,{start:o,end:o,source:""}))}function Qa(e,t,n){const o=e.source;switch(t){case 0:if(Ga(o,"=0;--e)if(Xa(o,n[e].tag))return!0;break;case 1:case 2:{const e=Ka(n);if(e&&Xa(o,e.tag))return!0;break}case 3:if(Ga(o,"]]>"))return!0}return!o}function Xa(e,t){return Ga(e,"]/.test(e[2+t.length]||">")}function eu(e,t){nu(e,t,tu(e,e.children[0]))}function tu(e,t){const{children:n}=e;return 1===n.length&&1===t.type&&!Sa(t)}function nu(e,t,n=!1){const{children:o}=e,r=o.length;let s=0;for(let i=0;i0){if(o>=2){e.codegenNode.patchFlag="-1",e.codegenNode=t.hoist(e.codegenNode),s++;continue}}else{const n=e.codegenNode;if(13===n.type){const o=cu(n);if((!o||512===o||1===o)&&iu(e,t)>=2){const o=lu(e);o&&(n.props=t.hoist(o))}n.dynamicProps&&(n.dynamicProps=t.hoist(n.dynamicProps))}}}if(1===e.type){const n=1===e.tagType;n&&t.scopes.vSlot++,nu(e,t),n&&t.scopes.vSlot--}else if(11===e.type)nu(e,t,1===e.children.length);else if(9===e.type)for(let n=0;n1)for(let r=0;r`_${Hc[E.helper(e)]}`,replaceNode(e){E.parent.children[E.childIndex]=E.currentNode=e},removeNode(e){const t=e?E.parent.children.indexOf(e):E.currentNode?E.childIndex:-1;e&&e!==E.currentNode?E.childIndex>t&&(E.childIndex--,E.onNodeRemoved()):(E.currentNode=null,E.onNodeRemoved()),E.parent.children.splice(t,1)},onNodeRemoved:()=>{},addIdentifiers(e){},removeIdentifiers(e){},hoist(e){v(e)&&(e=Jc(e)),E.hoists.push(e);const t=Jc(`_hoisted_${E.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache:(e,t=!1)=>function(e,t,n=!1){return{type:20,index:e,value:t,isVNode:n,loc:Wc}}(E.cached++,e,t)};return E}function uu(e,t){const n=au(e,t);pu(e,n),t.hoistStatic&&eu(e,n),t.ssr||function(e,t){const{helper:n}=t,{children:o}=e;if(1===o.length){const n=o[0];if(tu(e,n)&&n.codegenNode){const o=n.codegenNode;13===o.type&&na(o,t),e.codegenNode=o}else e.codegenNode=n}else if(o.length>1){let o=64;e.codegenNode=zc(t,n(rc),void 0,e.children,o+"",void 0,void 0,!0,void 0,!1)}}(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached}function pu(e,t){t.currentNode=e;const{nodeTransforms:n}=t,o=[];for(let s=0;s{n--};for(;nt===e:t=>e.test(t);return(e,o)=>{if(1===e.type){const{props:r}=e;if(3===e.tagType&&r.some(ba))return;const s=[];for(let i=0;i`${Hc[e]}: _${Hc[e]}`;function mu(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:o=!1,filename:r="template.vue.html",scopeId:s=null,optimizeImports:i=!1,runtimeGlobalName:l="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:a="vue/server-renderer",ssr:u=!1,isTS:p=!1,inSSR:f=!1}){const d={mode:t,prefixIdentifiers:n,sourceMap:o,filename:r,scopeId:s,optimizeImports:i,runtimeGlobalName:l,runtimeModuleName:c,ssrRuntimeModuleName:a,ssr:u,isTS:p,inSSR:f,source:e.loc.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper:e=>`_${Hc[e]}`,push(e,t){d.code+=e},indent(){h(++d.indentLevel)},deindent(e=!1){e?--d.indentLevel:h(--d.indentLevel)},newline(){h(d.indentLevel)}};function h(e){d.push("\n"+" ".repeat(e))}return d}function gu(e,t={}){const n=mu(e,t);t.onContextCreated&&t.onContextCreated(n);const{mode:o,push:r,prefixIdentifiers:s,indent:i,deindent:l,newline:c,ssr:a}=n,u=Array.from(e.helpers),p=u.length>0,f=!s&&"module"!==o,d=n;!function(e,t){const{push:n,newline:o,runtimeGlobalName:r}=t,s=r,i=Array.from(e.helpers);if(i.length>0&&(n(`const _Vue = ${s}\n`),e.hoists.length)){n(`const { ${[fc,dc,hc,mc,gc].filter((e=>i.includes(e))).map(hu).join(", ")} } = _Vue\n`)}(function(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:o}=t;o();for(let r=0;r0)&&c()),e.directives.length&&(vu(e.directives,"directive",n),e.temps>0&&c()),e.temps>0){r("let ");for(let t=0;t0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(r("\n"),c()),a||r("return "),e.codegenNode?_u(e.codegenNode,n):r("null"),f&&(l(),r("}")),l(),r("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function vu(e,t,{helper:n,push:o,newline:r,isTS:s}){const i=n("component"===t?vc:bc);for(let l=0;l3||!1;t.push("["),n&&t.indent(),bu(e,t,n),n&&t.deindent(),t.push("]")}function bu(e,t,n=!1,o=!0){const{push:r,newline:s}=t;for(let i=0;ie||"null"))}([s,i,l,c,a]),t),n(")"),p&&n(")");u&&(n(", "),_u(u,t),n(")"))}(e,t);break;case 14:!function(e,t){const{push:n,helper:o,pure:r}=t,s=v(e.callee)?e.callee:o(e.callee);r&&n(du);n(s+"(",e),bu(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){const{push:n,indent:o,deindent:r,newline:s}=t,{properties:i}=e;if(!i.length)return void n("{}",e);const l=i.length>1||!1;n(l?"{":"{ "),l&&o();for(let c=0;c "),(c||l)&&(n("{"),o());i?(c&&n("return "),f(i)?yu(i,t):_u(i,t)):l&&_u(l,t);(c||l)&&(r(),n("}"));a&&n(")")}(e,t);break;case 19:!function(e,t){const{test:n,consequent:o,alternate:r,newline:s}=e,{push:i,indent:l,deindent:c,newline:a}=t;if(4===n.type){const e=!la(n.content);e&&i("("),Su(n,t),e&&i(")")}else i("("),_u(n,t),i(")");s&&l(),t.indentLevel++,s||i(" "),i("? "),_u(o,t),t.indentLevel--,s&&a(),s||i(" "),i(": ");const u=19===r.type;u||t.indentLevel++;_u(r,t),u||t.indentLevel--;s&&c(!0)}(e,t);break;case 20:!function(e,t){const{push:n,helper:o,indent:r,deindent:s,newline:i}=t;n(`_cache[${e.index}] || (`),e.isVNode&&(r(),n(`${o(Mc)}(-1),`),i());n(`_cache[${e.index}] = `),_u(e.value,t),e.isVNode&&(n(","),i(),n(`${o(Mc)}(1),`),i(),n(`_cache[${e.index}]`),s());n(")")}(e,t);break;case 21:bu(e.body,t,!0,!1)}}function Su(e,t){const{content:n,isStatic:o}=e;t.push(o?JSON.stringify(n):n,e)}function xu(e,t){for(let n=0;nfunction(e,t,n,o){if(!("else"===t.name||t.exp&&t.exp.content.trim())){const o=t.exp?t.exp.loc:e.loc;n.onError(oc(28,t.loc)),t.exp=Jc("true",!1,o)}if("if"===t.name){const r=wu(e,t),s={type:9,loc:e.loc,branches:[r]};if(n.replaceNode(s),o)return o(s,r,!0)}else{const r=n.parent.children;let s=r.indexOf(e);for(;s-- >=-1;){const i=r[s];if(i&&3===i.type)n.removeNode(i);else{if(!i||2!==i.type||i.content.trim().length){if(i&&9===i.type){"else-if"===t.name&&void 0===i.branches[i.branches.length-1].condition&&n.onError(oc(30,e.loc)),n.removeNode();const r=wu(e,t);i.branches.push(r);const s=o&&o(i,r,!1);pu(r,n),s&&s(),n.currentNode=null}else n.onError(oc(30,e.loc));break}n.removeNode(i)}}}}(e,t,n,((e,t,o)=>{const r=n.parent.children;let s=r.indexOf(e),i=0;for(;s-- >=0;){const e=r[s];e&&9===e.type&&(i+=e.branches.length)}return()=>{if(o)e.codegenNode=Tu(t,i,n);else{const o=function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode);o.alternate=Tu(t,i+e.branches.length-1,n)}}}))));function wu(e,t){const n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!ma(e,"for")?e.children:[e],userKey:ga(e,"key"),isTemplateIf:n}}function Tu(e,t,n){return e.condition?Xc(e.condition,Eu(e,t,n),Yc(n.helper(hc),['""',"true"])):Eu(e,t,n)}function Eu(e,t,n){const{helper:o}=n,r=qc("key",Jc(`${t}`,!1,Wc,2)),{children:s}=e,i=s[0];if(1!==s.length||1!==i.type){if(1===s.length&&11===i.type){const e=i.codegenNode;return ka(e,r,n),e}{let t=64;return zc(n,o(rc),Gc([r]),s,t+"",void 0,void 0,!0,!1,!1,e.loc)}}{const e=i.codegenNode,t=14===(l=e).type&&l.callee===Uc?l.arguments[1].returns:l;return 13===t.type&&na(t,n),ka(t,r,n),e}var l}const Nu=fu("for",((e,t,n)=>{const{helper:o,removeHelper:r}=n;return function(e,t,n,o){if(!t.exp)return void n.onError(oc(31,t.loc));const r=Ru(t.exp);if(!r)return void n.onError(oc(32,t.loc));const{scopes:s}=n,{source:i,value:l,key:c,index:a}=r,u={type:11,loc:t.loc,source:i,valueAlias:l,keyAlias:c,objectIndexAlias:a,parseResult:r,children:_a(e)?e.children:[e]};n.replaceNode(u),s.vFor++;const p=o&&o(u);return()=>{s.vFor--,p&&p()}}(e,t,n,(t=>{const s=Yc(o(xc),[t.source]),i=_a(e),l=ma(e,"memo"),c=ga(e,"key"),a=c&&(6===c.type?Jc(c.value.content,!0):c.exp),u=c?qc("key",a):null,p=4===t.source.type&&t.source.constType>0,f=p?64:c?128:256;return t.codegenNode=zc(n,o(rc),void 0,s,f+"",void 0,void 0,!0,!p,!1,e.loc),()=>{let c;const{children:f}=t,d=1!==f.length||1!==f[0].type,h=Sa(e)?e:i&&1===e.children.length&&Sa(e.children[0])?e.children[0]:null;if(h?(c=h.codegenNode,i&&u&&ka(c,u,n)):d?c=zc(n,o(rc),u?Gc([u]):void 0,e.children,"64",void 0,void 0,!0,void 0,!1):(c=f[0].codegenNode,i&&u&&ka(c,u,n),c.isBlock!==!p&&(c.isBlock?(r(ac),r(ta(n.inSSR,c.isComponent))):r(ea(n.inSSR,c.isComponent))),c.isBlock=!p,c.isBlock?(o(ac),o(ta(n.inSSR,c.isComponent))):o(ea(n.inSSR,c.isComponent))),l){const e=Qc(Fu(t.parseResult,[Jc("_cached")]));e.body={type:21,body:[Zc(["const _memo = (",l.exp,")"]),Zc(["if (_cached",...a?[" && _cached.key === ",a]:[],` && ${n.helperString(Dc)}(_cached, _memo)) return _cached`]),Zc(["const _item = ",c]),Jc("_item.memo = _memo"),Jc("return _item")],loc:Wc},s.arguments.push(e,Jc("_cache"),Jc(String(n.cached++)))}else s.arguments.push(Qc(Fu(t.parseResult),c,!0))}}))}));const Ou=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,$u=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Pu=/^\(|\)$/g;function Ru(e,t){const n=e.loc,o=e.content,r=o.match(Ou);if(!r)return;const[,s,i]=r,l={source:Au(n,i.trim(),o.indexOf(i,s.length)),value:void 0,key:void 0,index:void 0};let c=s.trim().replace(Pu,"").trim();const a=s.indexOf(c),u=c.match($u);if(u){c=c.replace($u,"").trim();const e=u[1].trim();let t;if(e&&(t=o.indexOf(e,a+c.length),l.key=Au(n,e,t)),u[2]){const r=u[2].trim();r&&(l.index=Au(n,r,o.indexOf(r,l.key?t+e.length:a+c.length)))}}return c&&(l.value=Au(n,c,a)),l}function Au(e,t,n){return Jc(t,!1,fa(e,n,t.length))}function Fu({value:e,key:t,index:n},o=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map(((e,t)=>e||Jc("_".repeat(t+1),!1)))}([e,t,n,...o])}const Mu=Jc("undefined",!1),Vu=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){const n=ma(e,"slot");if(n)return t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},Iu=(e,t,n,o)=>Qc(e,n,!1,!0,n.length?n[0].loc:o);function Bu(e,t,n=Iu){t.helper(Bc);const{children:o,loc:r}=e,s=[],i=[];let l=t.scopes.vSlot>0||t.scopes.vFor>0;const c=ma(e,"slot",!0);if(c){const{arg:e,exp:t}=c;e&&!oa(e)&&(l=!0),s.push(qc(e||Jc("default",!0),n(t,void 0,o,r)))}let a=!1,u=!1;const p=[],f=new Set;let d=0;for(let g=0;gqc("default",n(e,void 0,t,r));a?p.length&&p.some((e=>Uu(e)))&&(u?t.onError(oc(39,p[0].loc)):s.push(e(void 0,p))):s.push(e(void 0,o))}const h=l?2:ju(e.children)?3:1;let m=Gc(s.concat(qc("_",Jc(h+"",!1))),r);return i.length&&(m=Yc(t.helper(kc),[m,Kc(i)])),{slots:m,hasDynamicSlots:l}}function Lu(e,t,n){const o=[qc("name",e),qc("fn",t)];return null!=n&&o.push(qc("key",Jc(String(n),!0))),Gc(o)}function ju(e){for(let t=0;tfunction(){if(1!==(e=t.currentNode).type||0!==e.tagType&&1!==e.tagType)return;const{tag:n,props:o}=e,r=1===e.tagType;let s=r?function(e,t,n=!1){let{tag:o}=e;const r=Gu(o),s=ga(e,"is");if(s)if(r){const e=6===s.type?s.value&&Jc(s.value.content,!0):s.exp;if(e)return Yc(t.helper(yc),[e])}else 6===s.type&&s.value.content.startsWith("vue:")&&(o=s.value.content.slice(4));const i=!r&&ma(e,"is");if(i&&i.exp)return Yc(t.helper(yc),[i.exp]);const l=sa(o)||t.isBuiltInComponent(o);if(l)return n||t.helper(l),l;return t.helper(vc),t.components.add(o),Ta(o,"component")}(e,t):`"${n}"`;const i=b(s)&&s.callee===yc;let l,c,a,u,p,f,d=0,h=i||s===sc||s===ic||!r&&("svg"===n||"foreignObject"===n);if(o.length>0){const n=Wu(e,t,void 0,r,i);l=n.props,d=n.patchFlag,p=n.dynamicPropNames;const o=n.directives;f=o&&o.length?Kc(o.map((e=>function(e,t){const n=[],o=Du.get(e);o?n.push(t.helperString(o)):(t.helper(bc),t.directives.add(e.name),n.push(Ta(e.name,"directive")));const{loc:r}=e;e.exp&&n.push(e.exp);e.arg&&(e.exp||n.push("void 0"),n.push(e.arg));if(Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));const t=Jc("true",!1,r);n.push(Gc(e.modifiers.map((e=>qc(e,t))),r))}return Kc(n,e.loc)}(e,t)))):void 0,n.shouldUseBlock&&(h=!0)}if(e.children.length>0){s===lc&&(h=!0,d|=1024);if(r&&s!==sc&&s!==lc){const{slots:n,hasDynamicSlots:o}=Bu(e,t);c=n,o&&(d|=1024)}else if(1===e.children.length&&s!==sc){const n=e.children[0],o=n.type,r=5===o||8===o;r&&0===ou(n,t)&&(d|=1),c=r||2===o?n:e.children}else c=e.children}0!==d&&(a=String(d),p&&p.length&&(u=function(e){let t="[";for(let n=0,o=e.length;n0;let h=!1,m=0,g=!1,v=!1,b=!1,_=!1,S=!1,x=!1;const C=[],k=e=>{u.length&&(p.push(Gc(zu(u),c)),u=[]),e&&p.push(e)},w=({key:e,value:n})=>{if(oa(e)){const s=e.content,l=i(s);if(!l||o&&!r||"onclick"===s.toLowerCase()||"onUpdate:modelValue"===s||T(s)||(_=!0),l&&T(s)&&(x=!0),20===n.type||(4===n.type||8===n.type)&&ou(n,t)>0)return;"ref"===s?g=!0:"class"===s?v=!0:"style"===s?b=!0:"key"===s||C.includes(s)||C.push(s),!o||"class"!==s&&"style"!==s||C.includes(s)||C.push(s)}else S=!0};for(let i=0;i0&&u.push(qc(Jc("ref_for",!0),Jc("true")))),"is"===n&&(Gu(l)||o&&o.content.startsWith("vue:")))continue;u.push(qc(Jc(n,!0,fa(e,0,n.length)),Jc(o?o.content:"",s,o?o.loc:e)))}else{const{name:n,arg:i,exp:a,loc:m}=r,g="bind"===n,v="on"===n;if("slot"===n){o||t.onError(oc(40,m));continue}if("once"===n||"memo"===n)continue;if("is"===n||g&&va(i,"is")&&Gu(l))continue;if(v&&s)continue;if((g&&va(i,"key")||v&&d&&va(i,"vue:before-update"))&&(h=!0),g&&va(i,"ref")&&t.scopes.vFor>0&&u.push(qc(Jc("ref_for",!0),Jc("true"))),!i&&(g||v)){S=!0,a?g?(k(),p.push(a)):k({type:14,loc:m,callee:t.helper(Pc),arguments:o?[a]:[a,"true"]}):t.onError(oc(g?34:35,m));continue}const b=t.directiveTransforms[n];if(b){const{props:n,needRuntime:o}=b(r,e,t);!s&&n.forEach(w),v&&i&&!oa(i)?k(Gc(n,c)):u.push(...n),o&&(f.push(r),y(o)&&Du.set(r,o))}else E(n)||(f.push(r),d&&(h=!0))}}let N;if(p.length?(k(),N=p.length>1?Yc(t.helper(Tc),p,c):p[0]):u.length&&(N=Gc(zu(u),c)),S?m|=16:(v&&!o&&(m|=2),b&&!o&&(m|=4),C.length&&(m|=8),_&&(m|=32)),h||0!==m&&32!==m||!(g||x||f.length>0)||(m|=512),!t.inSSR&&N)switch(N.type){case 15:let e=-1,n=-1,o=!1;for(let t=0;t{if(Sa(e)){const{children:n,loc:o}=e,{slotName:r,slotProps:s}=function(e,t){let n,o='"default"';const r=[];for(let s=0;s0){const{props:o,directives:s}=Wu(e,t,r,!1,!1);n=o,s.length&&t.onError(oc(36,s[0].loc))}return{slotName:o,slotProps:n}}(e,t),i=[t.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let l=2;s&&(i[2]=s,l=3),n.length&&(i[3]=Qc([],n,!1,!1,o),l=4),t.scopeId&&!t.slotted&&(l=5),i.splice(l),e.codegenNode=Yc(t.helper(Cc),i,o)}};const Ju=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,Zu=(e,t,n,o)=>{const{loc:r,modifiers:s,arg:i}=e;let l;if(4===i.type)if(i.isStatic){let e=i.content;e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`);l=Jc(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?F($(e)):`on:${e}`,!0,i.loc)}else l=Zc([`${n.helperString(Fc)}(`,i,")"]);else l=i,l.children.unshift(`${n.helperString(Fc)}(`),l.children.push(")");let c=e.exp;c&&!c.content.trim()&&(c=void 0);let a=n.cacheHandlers&&!c&&!n.inVOnce;if(c){const e=pa(c.content),t=!(e||Ju.test(c.content)),n=c.content.includes(";");(t||a&&e)&&(c=Zc([`${t?"$event":"(...args)"} => ${n?"{":"("}`,c,n?"}":")"]))}let u={props:[qc(l,c||Jc("() => {}",!1,r))]};return o&&(u=o(u)),a&&(u.props[0].value=n.cache(u.props[0].value)),u.props.forEach((e=>e.key.isHandlerKey=!0)),u},Yu=(e,t,n)=>{const{exp:o,modifiers:r,loc:s}=e,i=e.arg;return 4!==i.type?(i.children.unshift("("),i.children.push(') || ""')):i.isStatic||(i.content=`${i.content} || ""`),r.includes("camel")&&(4===i.type?i.content=i.isStatic?$(i.content):`${n.helperString(Rc)}(${i.content})`:(i.children.unshift(`${n.helperString(Rc)}(`),i.children.push(")"))),n.inSSR||(r.includes("prop")&&Qu(i,"."),r.includes("attr")&&Qu(i,"^")),!o||4===o.type&&!o.content.trim()?{props:[qc(i,Jc("",!0,s))]}:{props:[qc(i,o)]}},Qu=(e,t)=>{4===e.type?e.content=e.isStatic?t+e.content:`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},Xu=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{const n=e.children;let o,r=!1;for(let e=0;e7===e.type&&!t.directiveTransforms[e.name])))))for(let e=0;e{if(1===e.type&&ma(e,"once",!0)){if(ep.has(e)||t.inVOnce||t.inSSR)return;return ep.add(e),t.inVOnce=!0,t.helper(Mc),()=>{t.inVOnce=!1;const e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0))}}},np=(e,t,n)=>{const{exp:o,arg:r}=e;if(!o)return n.onError(oc(41,e.loc)),op();const s=o.loc.source,i=4===o.type?o.content:s,l=n.bindingMetadata[s];if("props"===l||"props-aliased"===l)return op();if(!i.trim()||!pa(i))return n.onError(oc(42,o.loc)),op();const c=r||Jc("modelValue",!0),a=r?oa(r)?`onUpdate:${$(r.content)}`:Zc(['"onUpdate:" + ',r]):"onUpdate:modelValue";let u;u=Zc([`${n.isTS?"($event: any)":"$event"} => ((`,o,") = $event)"]);const p=[qc(c,e.exp),qc(a,u)];if(e.modifiers.length&&1===t.tagType){const t=e.modifiers.map((e=>(la(e)?e:JSON.stringify(e))+": true")).join(", "),n=r?oa(r)?`${r.content}Modifiers`:Zc([r,' + "Modifiers"']):"modelModifiers";p.push(qc(n,Jc(`{ ${t} }`,!1,e.loc,2)))}return op(p)};function op(e=[]){return{props:e}}const rp=new WeakSet,sp=(e,t)=>{if(1===e.type){const n=ma(e,"memo");if(!n||rp.has(e))return;return rp.add(e),()=>{const o=e.codegenNode||t.currentNode.codegenNode;o&&13===o.type&&(1!==e.tagType&&na(o,t),e.codegenNode=Yc(t.helper(Uc),[n.exp,Qc(void 0,o),"_cache",String(t.cached++)]))}}};function ip(e,t={}){const n=t.onError||tc,o="module"===t.mode;!0===t.prefixIdentifiers?n(oc(47)):o&&n(oc(48));t.cacheHandlers&&n(oc(49)),t.scopeId&&!o&&n(oc(50));const r=v(e)?$a(e,t):e,[s,i]=[[tp,ku,sp,Nu,qu,Hu,Vu,Xu],{on:Zu,bind:Yu,model:np}];return uu(r,c({},t,{prefixIdentifiers:false,nodeTransforms:[...s,...t.nodeTransforms||[]],directiveTransforms:c({},i,t.directiveTransforms||{})})),gu(r,c({},t,{prefixIdentifiers:false}))}const lp=Symbol(""),cp=Symbol(""),ap=Symbol(""),up=Symbol(""),pp=Symbol(""),fp=Symbol(""),dp=Symbol(""),hp=Symbol(""),mp=Symbol(""),gp=Symbol("");var vp;let yp;vp={[lp]:"vModelRadio",[cp]:"vModelCheckbox",[ap]:"vModelText",[up]:"vModelSelect",[pp]:"vModelDynamic",[fp]:"withModifiers",[dp]:"withKeys",[hp]:"vShow",[mp]:"Transition",[gp]:"TransitionGroup"},Object.getOwnPropertySymbols(vp).forEach((e=>{Hc[e]=vp[e]}));const bp=e("style,iframe,script,noscript",!0),_p={isVoidTag:Q,isNativeTag:e=>Z(e)||Y(e),isPreTag:e=>"pre"===e,decodeEntities:function(e,t=!1){return yp||(yp=document.createElement("div")),t?(yp.innerHTML=`
`,yp.children[0].getAttribute("foo")):(yp.innerHTML=e,yp.textContent)},isBuiltInComponent:e=>ra(e,"Transition")?mp:ra(e,"TransitionGroup")?gp:void 0,getNamespace(e,t){let n=t?t.ns:0;if(t&&2===n)if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some((e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content)))&&(n=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(n=0);else t&&1===n&&("foreignObject"!==t.tag&&"desc"!==t.tag&&"title"!==t.tag||(n=0));if(0===n){if("svg"===e)return 1;if("math"===e)return 2}return n},getTextMode({tag:e,ns:t}){if(0===t){if("textarea"===e||"title"===e)return 1;if(bp(e))return 2}return 0}},Sp=(e,t)=>{const n=G(e);return Jc(JSON.stringify(n),!1,t,3)};function xp(e,t){return oc(e,t)}const Cp=e("passive,once,capture"),kp=e("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),wp=e("left,right"),Tp=e("onkeyup,onkeydown,onkeypress",!0),Ep=(e,t)=>oa(e)&&"onclick"===e.content.toLowerCase()?Jc(t,!0):4!==e.type?Zc(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,Np=(e,t)=>{1!==e.type||0!==e.tagType||"script"!==e.tag&&"style"!==e.tag||t.removeNode()},Op=[e=>{1===e.type&&e.props.forEach(((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:Jc("style",!0,t.loc),exp:Sp(t.value.content,t.loc),modifiers:[],loc:t.loc})}))}],$p={cloak:()=>({props:[]}),html:(e,t,n)=>{const{exp:o,loc:r}=e;return o||n.onError(xp(53,r)),t.children.length&&(n.onError(xp(54,r)),t.children.length=0),{props:[qc(Jc("innerHTML",!0,r),o||Jc("",!0))]}},text:(e,t,n)=>{const{exp:o,loc:r}=e;return o||n.onError(xp(55,r)),t.children.length&&(n.onError(xp(56,r)),t.children.length=0),{props:[qc(Jc("textContent",!0),o?ou(o,n)>0?o:Yc(n.helperString(wc),[o],r):Jc("",!0))]}},model:(e,t,n)=>{const o=np(e,t,n);if(!o.props.length||1===t.tagType)return o;e.arg&&n.onError(xp(58,e.arg.loc));const{tag:r}=t,s=n.isCustomElement(r);if("input"===r||"textarea"===r||"select"===r||s){let i=ap,l=!1;if("input"===r||s){const o=ga(t,"type");if(o){if(7===o.type)i=pp;else if(o.value)switch(o.value.content){case"radio":i=lp;break;case"checkbox":i=cp;break;case"file":l=!0,n.onError(xp(59,e.loc))}}else(function(e){return e.props.some((e=>!(7!==e.type||"bind"!==e.name||e.arg&&4===e.arg.type&&e.arg.isStatic)))})(t)&&(i=pp)}else"select"===r&&(i=up);l||(o.needRuntime=n.helper(i))}else n.onError(xp(57,e.loc));return o.props=o.props.filter((e=>!(4===e.key.type&&"modelValue"===e.key.content))),o},on:(e,t,n)=>Zu(e,t,n,(t=>{const{modifiers:o}=e;if(!o.length)return t;let{key:r,value:s}=t.props[0];const{keyModifiers:i,nonKeyModifiers:l,eventOptionModifiers:c}=((e,t,n,o)=>{const r=[],s=[],i=[];for(let l=0;l{const{exp:o,loc:r}=e;return o||n.onError(xp(61,r)),{props:[],needRuntime:n.helper(hp)}}};const Pp=Object.create(null);function Rp(e,t){if(!v(e)){if(!e.nodeType)return o;e=e.innerHTML}const n=e,r=Pp[n];if(r)return r;if("#"===e[0]){const t=document.querySelector(e);e=t?t.innerHTML:""}const s=c({hoistStatic:!0,onError:void 0,onWarn:o},t);s.isCustomElement||"undefined"==typeof customElements||(s.isCustomElement=e=>!!customElements.get(e));const{code:i}=function(e,t={}){return ip(e,c({},_p,t,{nodeTransforms:[Np,...Op,...t.nodeTransforms||[]],directiveTransforms:c({},$p,t.directiveTransforms||{}),transformHoist:null}))}(e,s),l=new Function("Vue",i)(ec);return l._rc=!0,Pp[n]=l}ii(Rp);export{go as BaseTransition,mo as BaseTransitionPropsValidators,bs as Comment,ie as EffectScope,vs as Fragment,No as KeepAlive,Se as ReactiveEffect,_s as Static,Gn as Suspense,ms as Teleport,ys as Text,Oi as Transition,_l as TransitionGroup,ul as VueElement,Qt as assertNumber,en as callWithAsyncErrorHandling,Xt as callWithErrorHandling,$ as camelize,A as capitalize,Ls as cloneVNode,xi as compatUtils,Rp as compile,fi as computed,Zl as createApp,Os as createBlock,Ds as createCommentVNode,Ns as createElementBlock,Vs as createElementVNode,is as createHydrationRenderer,yr as createPropsRestProxy,ss as createRenderer,Yl as createSSRApp,Jo as createSlots,Us as createStaticVNode,js as createTextVNode,Is as createVNode,Wt as customRef,wo as defineAsyncComponent,Co as defineComponent,ll as defineCustomElement,sr as defineEmits,ir as defineExpose,ar as defineModel,lr as defineOptions,rr as defineProps,cl as defineSSRCustomElement,cr as defineSlots,Sn as devtools,Ce as effect,le as effectScope,Ys as getCurrentInstance,ae as getCurrentScope,xo as getTransitionRawChildren,Bs as guardReactiveProps,di as h,tn as handleError,Br as hasInjectionContext,Jl as hydrate,gi as initCustomFormatter,Xl as initDirectivesForSSR,Ir as inject,yi as isMemoSame,Tt as isProxy,Ct as isReactive,kt as isReadonly,At as isRef,li as isRuntimeOnly,wt as isShallow,$s as isVNode,Nt as markRaw,gr as mergeDefaults,vr as mergeModels,Ks as mergeProps,fn as nextTick,q as normalizeClass,J as normalizeProps,H as normalizeStyle,$o as onActivated,Bo as onBeforeMount,Do as onBeforeUnmount,jo as onBeforeUpdate,Po as onDeactivated,Go as onErrorCaptured,Lo as onMounted,Ko as onRenderTracked,zo as onRenderTriggered,ue as onScopeDispose,Wo as onServerPrefetch,Ho as onUnmounted,Uo as onUpdated,Cs as openBlock,Pn as popScopeId,Vr as provide,Dt as proxyRefs,$n as pushScopeId,mn as queuePostFlushCb,yt as reactive,_t as readonly,Ft as ref,ii as registerRuntimeCompiler,ql as render,qo as renderList,Zo as renderSlot,jn as resolveComponent,Hn as resolveDirective,Dn as resolveDynamicComponent,Si as resolveFilter,yo as resolveTransitionHooks,Ts as setBlockTracking,Cn as setDevtoolsHook,So as setTransitionHooks,bt as shallowReactive,St as shallowReadonly,Mt as shallowRef,hi as ssrContextKey,_i as ssrUtils,ke as stop,oe as toDisplayString,F as toHandlerKey,Qo as toHandlers,Et as toRaw,qt as toRef,zt as toRefs,jt as toValue,Rs as transformVNodeArgs,Bt as triggerRef,Lt as unref,fr as useAttrs,pl as useCssModule,fl as useCssVars,dr as useModel,mi as useSSRContext,pr as useSlots,fo as useTransitionState,Ol as vModelCheckbox,Vl as vModelDynamic,Pl as vModelRadio,Rl as vModelSelect,Nl as vModelText,Ki as vShow,bi as version,Yt as warn,oo as watch,Xn as watchEffect,eo as watchPostEffect,to as watchSyncEffect,br as withAsyncContext,An as withCtx,ur as withDefaults,co as withDirectives,Dl as withKeys,vi as withMemo,jl as withModifiers,Rn as withScopeId}; diff --git a/MyApp/wwwroot/lib/mjs/vue.mjs b/MyApp/wwwroot/lib/mjs/vue.mjs new file mode 100644 index 0000000..9f4aecc --- /dev/null +++ b/MyApp/wwwroot/lib/mjs/vue.mjs @@ -0,0 +1,15444 @@ +function makeMap(str, expectsLowerCase) { + const map = /* @__PURE__ */ Object.create(null); + const list = str.split(","); + for (let i = 0; i < list.length; i++) { + map[list[i]] = true; + } + return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val]; +} + +const EMPTY_OBJ = Object.freeze({}) ; +const EMPTY_ARR = Object.freeze([]) ; +const NOOP = () => { +}; +const NO = () => false; +const onRE = /^on[^a-z]/; +const isOn = (key) => onRE.test(key); +const isModelListener = (key) => key.startsWith("onUpdate:"); +const extend = Object.assign; +const remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } +}; +const hasOwnProperty$1 = Object.prototype.hasOwnProperty; +const hasOwn = (val, key) => hasOwnProperty$1.call(val, key); +const isArray = Array.isArray; +const isMap = (val) => toTypeString(val) === "[object Map]"; +const isSet = (val) => toTypeString(val) === "[object Set]"; +const isDate = (val) => toTypeString(val) === "[object Date]"; +const isRegExp = (val) => toTypeString(val) === "[object RegExp]"; +const isFunction = (val) => typeof val === "function"; +const isString = (val) => typeof val === "string"; +const isSymbol = (val) => typeof val === "symbol"; +const isObject = (val) => val !== null && typeof val === "object"; +const isPromise = (val) => { + return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); +}; +const objectToString = Object.prototype.toString; +const toTypeString = (value) => objectToString.call(value); +const toRawType = (value) => { + return toTypeString(value).slice(8, -1); +}; +const isPlainObject = (val) => toTypeString(val) === "[object Object]"; +const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; +const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +const isBuiltInDirective = /* @__PURE__ */ makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" +); +const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +const camelizeRE = /-(\w)/g; +const camelize = cacheStringFunction((str) => { + return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); +}); +const hyphenateRE = /\B([A-Z])/g; +const hyphenate = cacheStringFunction( + (str) => str.replace(hyphenateRE, "-$1").toLowerCase() +); +const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +const toHandlerKey = cacheStringFunction((str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; +}); +const hasChanged = (value, oldValue) => !Object.is(value, oldValue); +const invokeArrayFns = (fns, arg) => { + for (let i = 0; i < fns.length; i++) { + fns[i](arg); + } +}; +const def = (obj, key, value) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + value + }); +}; +const looseToNumber = (val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; +}; +const toNumber = (val) => { + const n = isString(val) ? Number(val) : NaN; + return isNaN(n) ? val : n; +}; +let _globalThis; +const getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); +}; + +const PatchFlagNames = { + [1]: `TEXT`, + [2]: `CLASS`, + [4]: `STYLE`, + [8]: `PROPS`, + [16]: `FULL_PROPS`, + [32]: `HYDRATE_EVENTS`, + [64]: `STABLE_FRAGMENT`, + [128]: `KEYED_FRAGMENT`, + [256]: `UNKEYED_FRAGMENT`, + [512]: `NEED_PATCH`, + [1024]: `DYNAMIC_SLOTS`, + [2048]: `DEV_ROOT_FRAGMENT`, + [-1]: `HOISTED`, + [-2]: `BAIL` +}; + +const slotFlagsText = { + [1]: "STABLE", + [2]: "DYNAMIC", + [3]: "FORWARDED" +}; + +const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console"; +const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED); + +const range = 2; +function generateCodeFrame(source, start = 0, end = source.length) { + let lines = source.split(/(\r?\n)/); + const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); + lines = lines.filter((_, idx) => idx % 2 === 0); + let count = 0; + const res = []; + for (let i = 0; i < lines.length; i++) { + count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); + if (count >= start) { + for (let j = i - range; j <= i + range || end > count; j++) { + if (j < 0 || j >= lines.length) + continue; + const line = j + 1; + res.push( + `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` + ); + const lineLength = lines[j].length; + const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; + if (j === i) { + const pad = start - (count - (lineLength + newLineSeqLength)); + const length = Math.max( + 1, + end > count ? lineLength - pad : end - start + ); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j > i) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } + } + break; + } + } + return res.join("\n"); +} + +function normalizeStyle(value) { + if (isArray(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString(value) || isObject(value)) { + return value; + } +} +const listDelimiterRE = /;(?![^(]*\))/g; +const propertyDelimiterRE = /:([^]+)/; +const styleCommentRE = /\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} +function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); +} +function normalizeProps(props) { + if (!props) + return null; + let { class: klass, style } = props; + if (klass && !isString(klass)) { + props.class = normalizeClass(klass); + } + if (style) { + props.style = normalizeStyle(style); + } + return props; +} + +const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; +const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; +const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; +const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); +const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); +const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); + +const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); +function includeBooleanAttr(value) { + return !!value || value === ""; +} + +function looseCompareArrays(a, b) { + if (a.length !== b.length) + return false; + let equal = true; + for (let i = 0; equal && i < a.length; i++) { + equal = looseEqual(a[i], b[i]); + } + return equal; +} +function looseEqual(a, b) { + if (a === b) + return true; + let aValidType = isDate(a); + let bValidType = isDate(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? a.getTime() === b.getTime() : false; + } + aValidType = isSymbol(a); + bValidType = isSymbol(b); + if (aValidType || bValidType) { + return a === b; + } + aValidType = isArray(a); + bValidType = isArray(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareArrays(a, b) : false; + } + aValidType = isObject(a); + bValidType = isObject(b); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; + } + const aKeysCount = Object.keys(a).length; + const bKeysCount = Object.keys(b).length; + if (aKeysCount !== bKeysCount) { + return false; + } + for (const key in a) { + const aHasKey = a.hasOwnProperty(key); + const bHasKey = b.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { + return false; + } + } + } + return String(a) === String(b); +} +function looseIndexOf(arr, val) { + return arr.findIndex((item) => looseEqual(item, val)); +} + +const toDisplayString = (val) => { + return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val); +}; +const replacer = (_key, val) => { + if (val && val.__v_isRef) { + return replacer(_key, val.value); + } else if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => { + entries[`${key} =>`] = val2; + return entries; + }, {}) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()] + }; + } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { + return String(val); + } + return val; +}; + +function warn$1(msg, ...args) { + console.warn(`[Vue warn] ${msg}`, ...args); +} + +let activeEffectScope; +class EffectScope { + constructor(detached = false) { + this.detached = detached; + /** + * @internal + */ + this._active = true; + /** + * @internal + */ + this.effects = []; + /** + * @internal + */ + this.cleanups = []; + this.parent = activeEffectScope; + if (!detached && activeEffectScope) { + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } + } + get active() { + return this._active; + } + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } else { + warn$1(`cannot run an inactive effect scope.`); + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + activeEffectScope = this; + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + activeEffectScope = this.parent; + } + stop(fromParent) { + if (this._active) { + let i, l; + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].stop(); + } + for (i = 0, l = this.cleanups.length; i < l; i++) { + this.cleanups[i](); + } + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].stop(true); + } + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + this._active = false; + } + } +} +function effectScope(detached) { + return new EffectScope(detached); +} +function recordEffectScope(effect, scope = activeEffectScope) { + if (scope && scope.active) { + scope.effects.push(effect); + } +} +function getCurrentScope() { + return activeEffectScope; +} +function onScopeDispose(fn) { + if (activeEffectScope) { + activeEffectScope.cleanups.push(fn); + } else { + warn$1( + `onScopeDispose() is called when there is no active effect scope to be associated with.` + ); + } +} + +const createDep = (effects) => { + const dep = new Set(effects); + dep.w = 0; + dep.n = 0; + return dep; +}; +const wasTracked = (dep) => (dep.w & trackOpBit) > 0; +const newTracked = (dep) => (dep.n & trackOpBit) > 0; +const initDepMarkers = ({ deps }) => { + if (deps.length) { + for (let i = 0; i < deps.length; i++) { + deps[i].w |= trackOpBit; + } + } +}; +const finalizeDepMarkers = (effect) => { + const { deps } = effect; + if (deps.length) { + let ptr = 0; + for (let i = 0; i < deps.length; i++) { + const dep = deps[i]; + if (wasTracked(dep) && !newTracked(dep)) { + dep.delete(effect); + } else { + deps[ptr++] = dep; + } + dep.w &= ~trackOpBit; + dep.n &= ~trackOpBit; + } + deps.length = ptr; + } +}; + +const targetMap = /* @__PURE__ */ new WeakMap(); +let effectTrackDepth = 0; +let trackOpBit = 1; +const maxMarkerBits = 30; +let activeEffect; +const ITERATE_KEY = Symbol("iterate" ); +const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" ); +class ReactiveEffect { + constructor(fn, scheduler = null, scope) { + this.fn = fn; + this.scheduler = scheduler; + this.active = true; + this.deps = []; + this.parent = void 0; + recordEffectScope(this, scope); + } + run() { + if (!this.active) { + return this.fn(); + } + let parent = activeEffect; + let lastShouldTrack = shouldTrack; + while (parent) { + if (parent === this) { + return; + } + parent = parent.parent; + } + try { + this.parent = activeEffect; + activeEffect = this; + shouldTrack = true; + trackOpBit = 1 << ++effectTrackDepth; + if (effectTrackDepth <= maxMarkerBits) { + initDepMarkers(this); + } else { + cleanupEffect(this); + } + return this.fn(); + } finally { + if (effectTrackDepth <= maxMarkerBits) { + finalizeDepMarkers(this); + } + trackOpBit = 1 << --effectTrackDepth; + activeEffect = this.parent; + shouldTrack = lastShouldTrack; + this.parent = void 0; + if (this.deferStop) { + this.stop(); + } + } + } + stop() { + if (activeEffect === this) { + this.deferStop = true; + } else if (this.active) { + cleanupEffect(this); + if (this.onStop) { + this.onStop(); + } + this.active = false; + } + } +} +function cleanupEffect(effect2) { + const { deps } = effect2; + if (deps.length) { + for (let i = 0; i < deps.length; i++) { + deps[i].delete(effect2); + } + deps.length = 0; + } +} +function effect(fn, options) { + if (fn.effect instanceof ReactiveEffect) { + fn = fn.effect.fn; + } + const _effect = new ReactiveEffect(fn); + if (options) { + extend(_effect, options); + if (options.scope) + recordEffectScope(_effect, options.scope); + } + if (!options || !options.lazy) { + _effect.run(); + } + const runner = _effect.run.bind(_effect); + runner.effect = _effect; + return runner; +} +function stop(runner) { + runner.effect.stop(); +} +let shouldTrack = true; +const trackStack = []; +function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; +} +function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; +} +function track(target, type, key) { + if (shouldTrack && activeEffect) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = createDep()); + } + const eventInfo = { effect: activeEffect, target, type, key } ; + trackEffects(dep, eventInfo); + } +} +function trackEffects(dep, debuggerEventExtraInfo) { + let shouldTrack2 = false; + if (effectTrackDepth <= maxMarkerBits) { + if (!newTracked(dep)) { + dep.n |= trackOpBit; + shouldTrack2 = !wasTracked(dep); + } + } else { + shouldTrack2 = !dep.has(activeEffect); + } + if (shouldTrack2) { + dep.add(activeEffect); + activeEffect.deps.push(dep); + if (activeEffect.onTrack) { + activeEffect.onTrack( + extend( + { + effect: activeEffect + }, + debuggerEventExtraInfo + ) + ); + } + } +} +function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + return; + } + let deps = []; + if (type === "clear") { + deps = [...depsMap.values()]; + } else if (key === "length" && isArray(target)) { + const newLength = Number(newValue); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) { + deps.push(dep); + } + }); + } else { + if (key !== void 0) { + deps.push(depsMap.get(key)); + } + switch (type) { + case "add": + if (!isArray(target)) { + deps.push(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (isIntegerKey(key)) { + deps.push(depsMap.get("length")); + } + break; + case "delete": + if (!isArray(target)) { + deps.push(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (isMap(target)) { + deps.push(depsMap.get(ITERATE_KEY)); + } + break; + } + } + const eventInfo = { target, type, key, newValue, oldValue, oldTarget } ; + if (deps.length === 1) { + if (deps[0]) { + { + triggerEffects(deps[0], eventInfo); + } + } + } else { + const effects = []; + for (const dep of deps) { + if (dep) { + effects.push(...dep); + } + } + { + triggerEffects(createDep(effects), eventInfo); + } + } +} +function triggerEffects(dep, debuggerEventExtraInfo) { + const effects = isArray(dep) ? dep : [...dep]; + for (const effect2 of effects) { + if (effect2.computed) { + triggerEffect(effect2, debuggerEventExtraInfo); + } + } + for (const effect2 of effects) { + if (!effect2.computed) { + triggerEffect(effect2, debuggerEventExtraInfo); + } + } +} +function triggerEffect(effect2, debuggerEventExtraInfo) { + if (effect2 !== activeEffect || effect2.allowRecurse) { + if (effect2.onTrigger) { + effect2.onTrigger(extend({ effect: effect2 }, debuggerEventExtraInfo)); + } + if (effect2.scheduler) { + effect2.scheduler(); + } else { + effect2.run(); + } + } +} +function getDepFromReactive(object, key) { + var _a; + return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key); +} + +const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); +const builtInSymbols = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) +); +const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); +function createArrayInstrumentations() { + const instrumentations = {}; + ["includes", "indexOf", "lastIndexOf"].forEach((key) => { + instrumentations[key] = function(...args) { + const arr = toRaw(this); + for (let i = 0, l = this.length; i < l; i++) { + track(arr, "get", i + ""); + } + const res = arr[key](...args); + if (res === -1 || res === false) { + return arr[key](...args.map(toRaw)); + } else { + return res; + } + }; + }); + ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { + instrumentations[key] = function(...args) { + pauseTracking(); + const res = toRaw(this)[key].apply(this, args); + resetTracking(); + return res; + }; + }); + return instrumentations; +} +function hasOwnProperty(key) { + const obj = toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); +} +class BaseReactiveHandler { + constructor(_isReadonly = false, _shallow = false) { + this._isReadonly = _isReadonly; + this._shallow = _shallow; + } + get(target, key, receiver) { + const isReadonly2 = this._isReadonly, shallow = this._shallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return shallow; + } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) { + return target; + } + const targetIsArray = isArray(target); + if (!isReadonly2) { + if (targetIsArray && hasOwn(arrayInstrumentations, key)) { + return Reflect.get(arrayInstrumentations, key, receiver); + } + if (key === "hasOwnProperty") { + return hasOwnProperty; + } + } + const res = Reflect.get(target, key, receiver); + if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (shallow) { + return res; + } + if (isRef(res)) { + return targetIsArray && isIntegerKey(key) ? res : res.value; + } + if (isObject(res)) { + return isReadonly2 ? readonly(res) : reactive(res); + } + return res; + } +} +class MutableReactiveHandler extends BaseReactiveHandler { + constructor(shallow = false) { + super(false, shallow); + } + set(target, key, value, receiver) { + let oldValue = target[key]; + if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) { + return false; + } + if (!this._shallow) { + if (!isShallow(value) && !isReadonly(value)) { + oldValue = toRaw(oldValue); + value = toRaw(value); + } + if (!isArray(target) && isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } + } + const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); + const result = Reflect.set(target, key, value, receiver); + if (target === toRaw(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + } + return result; + } + deleteProperty(target, key) { + const hadKey = hasOwn(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + } + has(target, key) { + const result = Reflect.has(target, key); + if (!isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + ownKeys(target) { + track( + target, + "iterate", + isArray(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); + } +} +class ReadonlyReactiveHandler extends BaseReactiveHandler { + constructor(shallow = false) { + super(true, shallow); + } + set(target, key) { + { + warn$1( + `Set operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } + deleteProperty(target, key) { + { + warn$1( + `Delete operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } +} +const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); +const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); +const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler( + true +); +const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); + +const toShallow = (value) => value; +const getProto = (v) => Reflect.getPrototypeOf(v); +function get(target, key, isReadonly = false, isShallow = false) { + target = target["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!isReadonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "get", key); + } + track(rawTarget, "get", rawKey); + } + const { has: has2 } = getProto(rawTarget); + const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; + if (has2.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has2.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } +} +function has(key, isReadonly = false) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!isReadonly) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); + } + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); +} +function size(target, isReadonly = false) { + target = target["__v_raw"]; + !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); +} +function add(value) { + value = toRaw(value); + const target = toRaw(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger(target, "add", value, value); + } + return this; +} +function set(key, value) { + value = toRaw(value); + const target = toRaw(this); + const { has: has2, get: get2 } = getProto(target); + let hadKey = has2.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has2.call(target, key); + } else { + checkIdentityKeys(target, has2, key); + } + const oldValue = get2.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + return this; +} +function deleteEntry(key) { + const target = toRaw(this); + const { has: has2, get: get2 } = getProto(target); + let hadKey = has2.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has2.call(target, key); + } else { + checkIdentityKeys(target, has2, key); + } + const oldValue = get2 ? get2.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; +} +function clear() { + const target = toRaw(this); + const hadItems = target.size !== 0; + const oldTarget = isMap(target) ? new Map(target) : new Set(target) ; + const result = target.clear(); + if (hadItems) { + trigger(target, "clear", void 0, void 0, oldTarget); + } + return result; +} +function createForEach(isReadonly, isShallow) { + return function forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw(target); + const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; + !isReadonly && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + }; +} +function createIterableMethod(method, isReadonly, isShallow) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const targetIsMap = isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; + !isReadonly && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; +} +function createReadonlyMethod(type) { + return function(...args) { + { + const key = args[0] ? `on key "${args[0]}" ` : ``; + console.warn( + `${capitalize(type)} operation ${key}failed: target is readonly.`, + toRaw(this) + ); + } + return type === "delete" ? false : this; + }; +} +function createInstrumentations() { + const mutableInstrumentations2 = { + get(key) { + return get(this, key); + }, + get size() { + return size(this); + }, + has, + add, + set, + delete: deleteEntry, + clear, + forEach: createForEach(false, false) + }; + const shallowInstrumentations2 = { + get(key) { + return get(this, key, false, true); + }, + get size() { + return size(this); + }, + has, + add, + set, + delete: deleteEntry, + clear, + forEach: createForEach(false, true) + }; + const readonlyInstrumentations2 = { + get(key) { + return get(this, key, true); + }, + get size() { + return size(this, true); + }, + has(key) { + return has.call(this, key, true); + }, + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear"), + forEach: createForEach(true, false) + }; + const shallowReadonlyInstrumentations2 = { + get(key) { + return get(this, key, true, true); + }, + get size() { + return size(this, true); + }, + has(key) { + return has.call(this, key, true); + }, + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear"), + forEach: createForEach(true, true) + }; + const iteratorMethods = ["keys", "values", "entries", Symbol.iterator]; + iteratorMethods.forEach((method) => { + mutableInstrumentations2[method] = createIterableMethod( + method, + false, + false + ); + readonlyInstrumentations2[method] = createIterableMethod( + method, + true, + false + ); + shallowInstrumentations2[method] = createIterableMethod( + method, + false, + true + ); + shallowReadonlyInstrumentations2[method] = createIterableMethod( + method, + true, + true + ); + }); + return [ + mutableInstrumentations2, + readonlyInstrumentations2, + shallowInstrumentations2, + shallowReadonlyInstrumentations2 + ]; +} +const [ + mutableInstrumentations, + readonlyInstrumentations, + shallowInstrumentations, + shallowReadonlyInstrumentations +] = /* @__PURE__ */ createInstrumentations(); +function createInstrumentationGetter(isReadonly, shallow) { + const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations; + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly; + } else if (key === "__v_isReadonly") { + return isReadonly; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + hasOwn(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; +} +const mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) +}; +const shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) +}; +const readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) +}; +const shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) +}; +function checkIdentityKeys(target, has2, key) { + const rawKey = toRaw(key); + if (rawKey !== key && has2.call(target, rawKey)) { + const type = toRawType(target); + console.warn( + `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` + ); + } +} + +const reactiveMap = /* @__PURE__ */ new WeakMap(); +const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); +const readonlyMap = /* @__PURE__ */ new WeakMap(); +const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); +function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1 /* COMMON */; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2 /* COLLECTION */; + default: + return 0 /* INVALID */; + } +} +function getTargetType(value) { + return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value)); +} +function reactive(target) { + if (isReadonly(target)) { + return target; + } + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); +} +function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); +} +function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); +} +function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); +} +function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!isObject(target)) { + { + console.warn(`value cannot be made reactive: ${String(target)}`); + } + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = getTargetType(target); + if (targetType === 0 /* INVALID */) { + return target; + } + const proxy = new Proxy( + target, + targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; +} +function isReactive(value) { + if (isReadonly(value)) { + return isReactive(value["__v_raw"]); + } + return !!(value && value["__v_isReactive"]); +} +function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); +} +function isShallow(value) { + return !!(value && value["__v_isShallow"]); +} +function isProxy(value) { + return isReactive(value) || isReadonly(value); +} +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; +} +function markRaw(value) { + def(value, "__v_skip", true); + return value; +} +const toReactive = (value) => isObject(value) ? reactive(value) : value; +const toReadonly = (value) => isObject(value) ? readonly(value) : value; + +function trackRefValue(ref2) { + if (shouldTrack && activeEffect) { + ref2 = toRaw(ref2); + { + trackEffects(ref2.dep || (ref2.dep = createDep()), { + target: ref2, + type: "get", + key: "value" + }); + } + } +} +function triggerRefValue(ref2, newVal) { + ref2 = toRaw(ref2); + const dep = ref2.dep; + if (dep) { + { + triggerEffects(dep, { + target: ref2, + type: "set", + key: "value", + newValue: newVal + }); + } + } +} +function isRef(r) { + return !!(r && r.__v_isRef === true); +} +function ref(value) { + return createRef(value, false); +} +function shallowRef(value) { + return createRef(value, true); +} +function createRef(rawValue, shallow) { + if (isRef(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); +} +class RefImpl { + constructor(value, __v_isShallow) { + this.__v_isShallow = __v_isShallow; + this.dep = void 0; + this.__v_isRef = true; + this._rawValue = __v_isShallow ? value : toRaw(value); + this._value = __v_isShallow ? value : toReactive(value); + } + get value() { + trackRefValue(this); + return this._value; + } + set value(newVal) { + const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal); + newVal = useDirectValue ? newVal : toRaw(newVal); + if (hasChanged(newVal, this._rawValue)) { + this._rawValue = newVal; + this._value = useDirectValue ? newVal : toReactive(newVal); + triggerRefValue(this, newVal); + } + } +} +function triggerRef(ref2) { + triggerRefValue(ref2, ref2.value ); +} +function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; +} +function toValue(source) { + return isFunction(source) ? source() : unref(source); +} +const shallowUnwrapHandlers = { + get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } +}; +function proxyRefs(objectWithRefs) { + return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); +} +class CustomRefImpl { + constructor(factory) { + this.dep = void 0; + this.__v_isRef = true; + const { get, set } = factory( + () => trackRefValue(this), + () => triggerRefValue(this) + ); + this._get = get; + this._set = set; + } + get value() { + return this._get(); + } + set value(newVal) { + this._set(newVal); + } +} +function customRef(factory) { + return new CustomRefImpl(factory); +} +function toRefs(object) { + if (!isProxy(object)) { + console.warn(`toRefs() expects a reactive object but received a plain one.`); + } + const ret = isArray(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = propertyToRef(object, key); + } + return ret; +} +class ObjectRefImpl { + constructor(_object, _key, _defaultValue) { + this._object = _object; + this._key = _key; + this._defaultValue = _defaultValue; + this.__v_isRef = true; + } + get value() { + const val = this._object[this._key]; + return val === void 0 ? this._defaultValue : val; + } + set value(newVal) { + this._object[this._key] = newVal; + } + get dep() { + return getDepFromReactive(toRaw(this._object), this._key); + } +} +class GetterRefImpl { + constructor(_getter) { + this._getter = _getter; + this.__v_isRef = true; + this.__v_isReadonly = true; + } + get value() { + return this._getter(); + } +} +function toRef(source, key, defaultValue) { + if (isRef(source)) { + return source; + } else if (isFunction(source)) { + return new GetterRefImpl(source); + } else if (isObject(source) && arguments.length > 1) { + return propertyToRef(source, key, defaultValue); + } else { + return ref(source); + } +} +function propertyToRef(source, key, defaultValue) { + const val = source[key]; + return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); +} + +class ComputedRefImpl { + constructor(getter, _setter, isReadonly, isSSR) { + this._setter = _setter; + this.dep = void 0; + this.__v_isRef = true; + this["__v_isReadonly"] = false; + this._dirty = true; + this.effect = new ReactiveEffect(getter, () => { + if (!this._dirty) { + this._dirty = true; + triggerRefValue(this); + } + }); + this.effect.computed = this; + this.effect.active = this._cacheable = !isSSR; + this["__v_isReadonly"] = isReadonly; + } + get value() { + const self = toRaw(this); + trackRefValue(self); + if (self._dirty || !self._cacheable) { + self._dirty = false; + self._value = self.effect.run(); + } + return self._value; + } + set value(newValue) { + this._setter(newValue); + } +} +function computed$1(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + const onlyGetter = isFunction(getterOrOptions); + if (onlyGetter) { + getter = getterOrOptions; + setter = () => { + console.warn("Write operation failed: computed value is readonly"); + } ; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR); + if (debugOptions && !isSSR) { + cRef.effect.onTrack = debugOptions.onTrack; + cRef.effect.onTrigger = debugOptions.onTrigger; + } + return cRef; +} + +const stack = []; +function pushWarningContext(vnode) { + stack.push(vnode); +} +function popWarningContext() { + stack.pop(); +} +function warn(msg, ...args) { + pauseTracking(); + const instance = stack.length ? stack[stack.length - 1].component : null; + const appWarnHandler = instance && instance.appContext.config.warnHandler; + const trace = getComponentTrace(); + if (appWarnHandler) { + callWithErrorHandling( + appWarnHandler, + instance, + 11, + [ + msg + args.join(""), + instance && instance.proxy, + trace.map( + ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` + ).join("\n"), + trace + ] + ); + } else { + const warnArgs = [`[Vue warn]: ${msg}`, ...args]; + if (trace.length && // avoid spamming console during tests + true) { + warnArgs.push(` +`, ...formatTrace(trace)); + } + console.warn(...warnArgs); + } + resetTracking(); +} +function getComponentTrace() { + let currentVNode = stack[stack.length - 1]; + if (!currentVNode) { + return []; + } + const normalizedStack = []; + while (currentVNode) { + const last = normalizedStack[0]; + if (last && last.vnode === currentVNode) { + last.recurseCount++; + } else { + normalizedStack.push({ + vnode: currentVNode, + recurseCount: 0 + }); + } + const parentInstance = currentVNode.component && currentVNode.component.parent; + currentVNode = parentInstance && parentInstance.vnode; + } + return normalizedStack; +} +function formatTrace(trace) { + const logs = []; + trace.forEach((entry, i) => { + logs.push(...i === 0 ? [] : [` +`], ...formatTraceEntry(entry)); + }); + return logs; +} +function formatTraceEntry({ vnode, recurseCount }) { + const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; + const isRoot = vnode.component ? vnode.component.parent == null : false; + const open = ` at <${formatComponentName( + vnode.component, + vnode.type, + isRoot + )}`; + const close = `>` + postfix; + return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; +} +function formatProps(props) { + const res = []; + const keys = Object.keys(props); + keys.slice(0, 3).forEach((key) => { + res.push(...formatProp(key, props[key])); + }); + if (keys.length > 3) { + res.push(` ...`); + } + return res; +} +function formatProp(key, value, raw) { + if (isString(value)) { + value = JSON.stringify(value); + return raw ? value : [`${key}=${value}`]; + } else if (typeof value === "number" || typeof value === "boolean" || value == null) { + return raw ? value : [`${key}=${value}`]; + } else if (isRef(value)) { + value = formatProp(key, toRaw(value.value), true); + return raw ? value : [`${key}=Ref<`, value, `>`]; + } else if (isFunction(value)) { + return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; + } else { + value = toRaw(value); + return raw ? value : [`${key}=`, value]; + } +} +function assertNumber(val, type) { + if (val === void 0) { + return; + } else if (typeof val !== "number") { + warn(`${type} is not a valid number - got ${JSON.stringify(val)}.`); + } else if (isNaN(val)) { + warn(`${type} is NaN - the duration expression might be incorrect.`); + } +} + +const ErrorTypeStrings = { + ["sp"]: "serverPrefetch hook", + ["bc"]: "beforeCreate hook", + ["c"]: "created hook", + ["bm"]: "beforeMount hook", + ["m"]: "mounted hook", + ["bu"]: "beforeUpdate hook", + ["u"]: "updated", + ["bum"]: "beforeUnmount hook", + ["um"]: "unmounted hook", + ["a"]: "activated hook", + ["da"]: "deactivated hook", + ["ec"]: "errorCaptured hook", + ["rtc"]: "renderTracked hook", + ["rtg"]: "renderTriggered hook", + [0]: "setup function", + [1]: "render function", + [2]: "watcher getter", + [3]: "watcher callback", + [4]: "watcher cleanup function", + [5]: "native event handler", + [6]: "component event handler", + [7]: "vnode hook", + [8]: "directive hook", + [9]: "transition hook", + [10]: "app errorHandler", + [11]: "app warnHandler", + [12]: "ref function", + [13]: "async component loader", + [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core" +}; +function callWithErrorHandling(fn, instance, type, args) { + let res; + try { + res = args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); + } + return res; +} +function callWithAsyncErrorHandling(fn, instance, type, args) { + if (isFunction(fn)) { + const res = callWithErrorHandling(fn, instance, type, args); + if (res && isPromise(res)) { + res.catch((err) => { + handleError(err, instance, type); + }); + } + return res; + } + const values = []; + for (let i = 0; i < fn.length; i++) { + values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); + } + return values; +} +function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = ErrorTypeStrings[type] ; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i = 0; i < errorCapturedHooks.length; i++) { + if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { + return; + } + } + } + cur = cur.parent; + } + const appErrorHandler = instance.appContext.config.errorHandler; + if (appErrorHandler) { + callWithErrorHandling( + appErrorHandler, + null, + 10, + [err, exposedInstance, errorInfo] + ); + return; + } + } + logError(err, type, contextVNode, throwInDev); +} +function logError(err, type, contextVNode, throwInDev = true) { + { + const info = ErrorTypeStrings[type]; + if (contextVNode) { + pushWarningContext(contextVNode); + } + warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`); + if (contextVNode) { + popWarningContext(); + } + if (throwInDev) { + throw err; + } else { + console.error(err); + } + } +} + +let isFlushing = false; +let isFlushPending = false; +const queue = []; +let flushIndex = 0; +const pendingPostFlushCbs = []; +let activePostFlushCbs = null; +let postFlushIndex = 0; +const resolvedPromise = /* @__PURE__ */ Promise.resolve(); +let currentFlushPromise = null; +const RECURSION_LIMIT = 100; +function nextTick(fn) { + const p = currentFlushPromise || resolvedPromise; + return fn ? p.then(this ? fn.bind(this) : fn) : p; +} +function findInsertionIndex(id) { + let start = flushIndex + 1; + let end = queue.length; + while (start < end) { + const middle = start + end >>> 1; + const middleJob = queue[middle]; + const middleJobId = getId(middleJob); + if (middleJobId < id || middleJobId === id && middleJob.pre) { + start = middle + 1; + } else { + end = middle; + } + } + return start; +} +function queueJob(job) { + if (!queue.length || !queue.includes( + job, + isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex + )) { + if (job.id == null) { + queue.push(job); + } else { + queue.splice(findInsertionIndex(job.id), 0, job); + } + queueFlush(); + } +} +function queueFlush() { + if (!isFlushing && !isFlushPending) { + isFlushPending = true; + currentFlushPromise = resolvedPromise.then(flushJobs); + } +} +function invalidateJob(job) { + const i = queue.indexOf(job); + if (i > flushIndex) { + queue.splice(i, 1); + } +} +function queuePostFlushCb(cb) { + if (!isArray(cb)) { + if (!activePostFlushCbs || !activePostFlushCbs.includes( + cb, + cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex + )) { + pendingPostFlushCbs.push(cb); + } + } else { + pendingPostFlushCbs.push(...cb); + } + queueFlush(); +} +function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) { + { + seen = seen || /* @__PURE__ */ new Map(); + } + for (; i < queue.length; i++) { + const cb = queue[i]; + if (cb && cb.pre) { + if (checkRecursiveUpdates(seen, cb)) { + continue; + } + queue.splice(i, 1); + i--; + cb(); + } + } +} +function flushPostFlushCbs(seen) { + if (pendingPostFlushCbs.length) { + const deduped = [...new Set(pendingPostFlushCbs)]; + pendingPostFlushCbs.length = 0; + if (activePostFlushCbs) { + activePostFlushCbs.push(...deduped); + return; + } + activePostFlushCbs = deduped; + { + seen = seen || /* @__PURE__ */ new Map(); + } + activePostFlushCbs.sort((a, b) => getId(a) - getId(b)); + for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { + if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) { + continue; + } + activePostFlushCbs[postFlushIndex](); + } + activePostFlushCbs = null; + postFlushIndex = 0; + } +} +const getId = (job) => job.id == null ? Infinity : job.id; +const comparator = (a, b) => { + const diff = getId(a) - getId(b); + if (diff === 0) { + if (a.pre && !b.pre) + return -1; + if (b.pre && !a.pre) + return 1; + } + return diff; +}; +function flushJobs(seen) { + isFlushPending = false; + isFlushing = true; + { + seen = seen || /* @__PURE__ */ new Map(); + } + queue.sort(comparator); + const check = (job) => checkRecursiveUpdates(seen, job) ; + try { + for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job && job.active !== false) { + if (check(job)) { + continue; + } + callWithErrorHandling(job, null, 14); + } + } + } finally { + flushIndex = 0; + queue.length = 0; + flushPostFlushCbs(seen); + isFlushing = false; + currentFlushPromise = null; + if (queue.length || pendingPostFlushCbs.length) { + flushJobs(seen); + } + } +} +function checkRecursiveUpdates(seen, fn) { + if (!seen.has(fn)) { + seen.set(fn, 1); + } else { + const count = seen.get(fn); + if (count > RECURSION_LIMIT) { + const instance = fn.ownerInstance; + const componentName = instance && getComponentName(instance.type); + warn( + `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.` + ); + return true; + } else { + seen.set(fn, count + 1); + } + } +} + +let isHmrUpdating = false; +const hmrDirtyComponents = /* @__PURE__ */ new Set(); +{ + getGlobalThis().__VUE_HMR_RUNTIME__ = { + createRecord: tryWrap(createRecord), + rerender: tryWrap(rerender), + reload: tryWrap(reload) + }; +} +const map = /* @__PURE__ */ new Map(); +function registerHMR(instance) { + const id = instance.type.__hmrId; + let record = map.get(id); + if (!record) { + createRecord(id, instance.type); + record = map.get(id); + } + record.instances.add(instance); +} +function unregisterHMR(instance) { + map.get(instance.type.__hmrId).instances.delete(instance); +} +function createRecord(id, initialDef) { + if (map.has(id)) { + return false; + } + map.set(id, { + initialDef: normalizeClassComponent(initialDef), + instances: /* @__PURE__ */ new Set() + }); + return true; +} +function normalizeClassComponent(component) { + return isClassComponent(component) ? component.__vccOpts : component; +} +function rerender(id, newRender) { + const record = map.get(id); + if (!record) { + return; + } + record.initialDef.render = newRender; + [...record.instances].forEach((instance) => { + if (newRender) { + instance.render = newRender; + normalizeClassComponent(instance.type).render = newRender; + } + instance.renderCache = []; + isHmrUpdating = true; + instance.update(); + isHmrUpdating = false; + }); +} +function reload(id, newComp) { + const record = map.get(id); + if (!record) + return; + newComp = normalizeClassComponent(newComp); + updateComponentDef(record.initialDef, newComp); + const instances = [...record.instances]; + for (const instance of instances) { + const oldComp = normalizeClassComponent(instance.type); + if (!hmrDirtyComponents.has(oldComp)) { + if (oldComp !== record.initialDef) { + updateComponentDef(oldComp, newComp); + } + hmrDirtyComponents.add(oldComp); + } + instance.appContext.propsCache.delete(instance.type); + instance.appContext.emitsCache.delete(instance.type); + instance.appContext.optionsCache.delete(instance.type); + if (instance.ceReload) { + hmrDirtyComponents.add(oldComp); + instance.ceReload(newComp.styles); + hmrDirtyComponents.delete(oldComp); + } else if (instance.parent) { + queueJob(instance.parent.update); + } else if (instance.appContext.reload) { + instance.appContext.reload(); + } else if (typeof window !== "undefined") { + window.location.reload(); + } else { + console.warn( + "[HMR] Root or manually mounted instance modified. Full reload required." + ); + } + } + queuePostFlushCb(() => { + for (const instance of instances) { + hmrDirtyComponents.delete( + normalizeClassComponent(instance.type) + ); + } + }); +} +function updateComponentDef(oldComp, newComp) { + extend(oldComp, newComp); + for (const key in oldComp) { + if (key !== "__file" && !(key in newComp)) { + delete oldComp[key]; + } + } +} +function tryWrap(fn) { + return (id, arg) => { + try { + return fn(id, arg); + } catch (e) { + console.error(e); + console.warn( + `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` + ); + } + }; +} + +let devtools; +let buffer = []; +let devtoolsNotInstalled = false; +function emit$1(event, ...args) { + if (devtools) { + devtools.emit(event, ...args); + } else if (!devtoolsNotInstalled) { + buffer.push({ event, args }); + } +} +function setDevtoolsHook(hook, target) { + var _a, _b; + devtools = hook; + if (devtools) { + devtools.enabled = true; + buffer.forEach(({ event, args }) => devtools.emit(event, ...args)); + buffer = []; + } else if ( + // handle late devtools injection - only do this if we are in an actual + // browser environment to avoid the timer handle stalling test runner exit + // (#4815) + typeof window !== "undefined" && // some envs mock window but not fully + window.HTMLElement && // also exclude jsdom + !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) + ) { + const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; + replay.push((newHook) => { + setDevtoolsHook(newHook, target); + }); + setTimeout(() => { + if (!devtools) { + target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; + devtoolsNotInstalled = true; + buffer = []; + } + }, 3e3); + } else { + devtoolsNotInstalled = true; + buffer = []; + } +} +function devtoolsInitApp(app, version) { + emit$1("app:init" /* APP_INIT */, app, version, { + Fragment, + Text, + Comment, + Static + }); +} +function devtoolsUnmountApp(app) { + emit$1("app:unmount" /* APP_UNMOUNT */, app); +} +const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook( + "component:added" /* COMPONENT_ADDED */ +); +const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */); +const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( + "component:removed" /* COMPONENT_REMOVED */ +); +const devtoolsComponentRemoved = (component) => { + if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered + !devtools.cleanupBuffer(component)) { + _devtoolsComponentRemoved(component); + } +}; +function createDevtoolsComponentHook(hook) { + return (component) => { + emit$1( + hook, + component.appContext.app, + component.uid, + component.parent ? component.parent.uid : void 0, + component + ); + }; +} +const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook( + "perf:start" /* PERFORMANCE_START */ +); +const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook( + "perf:end" /* PERFORMANCE_END */ +); +function createDevtoolsPerformanceHook(hook) { + return (component, type, time) => { + emit$1(hook, component.appContext.app, component.uid, component, type, time); + }; +} +function devtoolsComponentEmit(component, event, params) { + emit$1( + "component:emit" /* COMPONENT_EMIT */, + component.appContext.app, + component, + event, + params + ); +} + +function emit(instance, event, ...rawArgs) { + if (instance.isUnmounted) + return; + const props = instance.vnode.props || EMPTY_OBJ; + { + const { + emitsOptions, + propsOptions: [propsOptions] + } = instance; + if (emitsOptions) { + if (!(event in emitsOptions) && true) { + if (!propsOptions || !(toHandlerKey(event) in propsOptions)) { + warn( + `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.` + ); + } + } else { + const validator = emitsOptions[event]; + if (isFunction(validator)) { + const isValid = validator(...rawArgs); + if (!isValid) { + warn( + `Invalid event arguments: event validation failed for event "${event}".` + ); + } + } + } + } + } + let args = rawArgs; + const isModelListener = event.startsWith("update:"); + const modelArg = isModelListener && event.slice(7); + if (modelArg && modelArg in props) { + const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`; + const { number, trim } = props[modifiersKey] || EMPTY_OBJ; + if (trim) { + args = rawArgs.map((a) => isString(a) ? a.trim() : a); + } + if (number) { + args = rawArgs.map(looseToNumber); + } + } + { + devtoolsComponentEmit(instance, event, args); + } + { + const lowerCaseEvent = event.toLowerCase(); + if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) { + warn( + `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( + instance, + instance.type + )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(event)}" instead of "${event}".` + ); + } + } + let handlerName; + let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) + props[handlerName = toHandlerKey(camelize(event))]; + if (!handler && isModelListener) { + handler = props[handlerName = toHandlerKey(hyphenate(event))]; + } + if (handler) { + callWithAsyncErrorHandling( + handler, + instance, + 6, + args + ); + } + const onceHandler = props[handlerName + `Once`]; + if (onceHandler) { + if (!instance.emitted) { + instance.emitted = {}; + } else if (instance.emitted[handlerName]) { + return; + } + instance.emitted[handlerName] = true; + callWithAsyncErrorHandling( + onceHandler, + instance, + 6, + args + ); + } +} +function normalizeEmitsOptions(comp, appContext, asMixin = false) { + const cache = appContext.emitsCache; + const cached = cache.get(comp); + if (cached !== void 0) { + return cached; + } + const raw = comp.emits; + let normalized = {}; + let hasExtends = false; + if (!isFunction(comp)) { + const extendEmits = (raw2) => { + const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); + if (normalizedFromExtend) { + hasExtends = true; + extend(normalized, normalizedFromExtend); + } + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendEmits); + } + if (comp.extends) { + extendEmits(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendEmits); + } + } + if (!raw && !hasExtends) { + if (isObject(comp)) { + cache.set(comp, null); + } + return null; + } + if (isArray(raw)) { + raw.forEach((key) => normalized[key] = null); + } else { + extend(normalized, raw); + } + if (isObject(comp)) { + cache.set(comp, normalized); + } + return normalized; +} +function isEmitListener(options, key) { + if (!options || !isOn(key)) { + return false; + } + key = key.slice(2).replace(/Once$/, ""); + return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key); +} + +let currentRenderingInstance = null; +let currentScopeId = null; +function setCurrentRenderingInstance(instance) { + const prev = currentRenderingInstance; + currentRenderingInstance = instance; + currentScopeId = instance && instance.type.__scopeId || null; + return prev; +} +function pushScopeId(id) { + currentScopeId = id; +} +function popScopeId() { + currentScopeId = null; +} +const withScopeId = (_id) => withCtx; +function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { + if (!ctx) + return fn; + if (fn._n) { + return fn; + } + const renderFnWithContext = (...args) => { + if (renderFnWithContext._d) { + setBlockTracking(-1); + } + const prevInstance = setCurrentRenderingInstance(ctx); + let res; + try { + res = fn(...args); + } finally { + setCurrentRenderingInstance(prevInstance); + if (renderFnWithContext._d) { + setBlockTracking(1); + } + } + { + devtoolsComponentUpdated(ctx); + } + return res; + }; + renderFnWithContext._n = true; + renderFnWithContext._c = true; + renderFnWithContext._d = true; + return renderFnWithContext; +} + +let accessedAttrs = false; +function markAttrsAccessed() { + accessedAttrs = true; +} +function renderComponentRoot(instance) { + const { + type: Component, + vnode, + proxy, + withProxy, + props, + propsOptions: [propsOptions], + slots, + attrs, + emit, + render, + renderCache, + data, + setupState, + ctx, + inheritAttrs + } = instance; + let result; + let fallthroughAttrs; + const prev = setCurrentRenderingInstance(instance); + { + accessedAttrs = false; + } + try { + if (vnode.shapeFlag & 4) { + const proxyToUse = withProxy || proxy; + result = normalizeVNode( + render.call( + proxyToUse, + proxyToUse, + renderCache, + props, + setupState, + data, + ctx + ) + ); + fallthroughAttrs = attrs; + } else { + const render2 = Component; + if (attrs === props) { + markAttrsAccessed(); + } + result = normalizeVNode( + render2.length > 1 ? render2( + props, + true ? { + get attrs() { + markAttrsAccessed(); + return attrs; + }, + slots, + emit + } : { attrs, slots, emit } + ) : render2( + props, + null + /* we know it doesn't need it */ + ) + ); + fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); + } + } catch (err) { + blockStack.length = 0; + handleError(err, instance, 1); + result = createVNode(Comment); + } + let root = result; + let setRoot = void 0; + if (result.patchFlag > 0 && result.patchFlag & 2048) { + [root, setRoot] = getChildRoot(result); + } + if (fallthroughAttrs && inheritAttrs !== false) { + const keys = Object.keys(fallthroughAttrs); + const { shapeFlag } = root; + if (keys.length) { + if (shapeFlag & (1 | 6)) { + if (propsOptions && keys.some(isModelListener)) { + fallthroughAttrs = filterModelListeners( + fallthroughAttrs, + propsOptions + ); + } + root = cloneVNode(root, fallthroughAttrs); + } else if (!accessedAttrs && root.type !== Comment) { + const allAttrs = Object.keys(attrs); + const eventAttrs = []; + const extraAttrs = []; + for (let i = 0, l = allAttrs.length; i < l; i++) { + const key = allAttrs[i]; + if (isOn(key)) { + if (!isModelListener(key)) { + eventAttrs.push(key[2].toLowerCase() + key.slice(3)); + } + } else { + extraAttrs.push(key); + } + } + if (extraAttrs.length) { + warn( + `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.` + ); + } + if (eventAttrs.length) { + warn( + `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` + ); + } + } + } + } + if (vnode.dirs) { + if (!isElementRoot(root)) { + warn( + `Runtime directive used on component with non-element root node. The directives will not function as intended.` + ); + } + root = cloneVNode(root); + root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; + } + if (vnode.transition) { + if (!isElementRoot(root)) { + warn( + `Component inside renders non-element root node that cannot be animated.` + ); + } + root.transition = vnode.transition; + } + if (setRoot) { + setRoot(root); + } else { + result = root; + } + setCurrentRenderingInstance(prev); + return result; +} +const getChildRoot = (vnode) => { + const rawChildren = vnode.children; + const dynamicChildren = vnode.dynamicChildren; + const childRoot = filterSingleRoot(rawChildren); + if (!childRoot) { + return [vnode, void 0]; + } + const index = rawChildren.indexOf(childRoot); + const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; + const setRoot = (updatedRoot) => { + rawChildren[index] = updatedRoot; + if (dynamicChildren) { + if (dynamicIndex > -1) { + dynamicChildren[dynamicIndex] = updatedRoot; + } else if (updatedRoot.patchFlag > 0) { + vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; + } + } + }; + return [normalizeVNode(childRoot), setRoot]; +}; +function filterSingleRoot(children) { + let singleRoot; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (isVNode(child)) { + if (child.type !== Comment || child.children === "v-if") { + if (singleRoot) { + return; + } else { + singleRoot = child; + } + } + } else { + return; + } + } + return singleRoot; +} +const getFunctionalFallthrough = (attrs) => { + let res; + for (const key in attrs) { + if (key === "class" || key === "style" || isOn(key)) { + (res || (res = {}))[key] = attrs[key]; + } + } + return res; +}; +const filterModelListeners = (attrs, props) => { + const res = {}; + for (const key in attrs) { + if (!isModelListener(key) || !(key.slice(9) in props)) { + res[key] = attrs[key]; + } + } + return res; +}; +const isElementRoot = (vnode) => { + return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; +}; +function shouldUpdateComponent(prevVNode, nextVNode, optimized) { + const { props: prevProps, children: prevChildren, component } = prevVNode; + const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; + const emits = component.emitsOptions; + if ((prevChildren || nextChildren) && isHmrUpdating) { + return true; + } + if (nextVNode.dirs || nextVNode.transition) { + return true; + } + if (optimized && patchFlag >= 0) { + if (patchFlag & 1024) { + return true; + } + if (patchFlag & 16) { + if (!prevProps) { + return !!nextProps; + } + return hasPropsChanged(prevProps, nextProps, emits); + } else if (patchFlag & 8) { + const dynamicProps = nextVNode.dynamicProps; + for (let i = 0; i < dynamicProps.length; i++) { + const key = dynamicProps[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { + return true; + } + } + } + } else { + if (prevChildren || nextChildren) { + if (!nextChildren || !nextChildren.$stable) { + return true; + } + } + if (prevProps === nextProps) { + return false; + } + if (!prevProps) { + return !!nextProps; + } + if (!nextProps) { + return true; + } + return hasPropsChanged(prevProps, nextProps, emits); + } + return false; +} +function hasPropsChanged(prevProps, nextProps, emitsOptions) { + const nextKeys = Object.keys(nextProps); + if (nextKeys.length !== Object.keys(prevProps).length) { + return true; + } + for (let i = 0; i < nextKeys.length; i++) { + const key = nextKeys[i]; + if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { + return true; + } + } + return false; +} +function updateHOCHostEl({ vnode, parent }, el) { + while (parent && parent.subTree === vnode) { + (vnode = parent.vnode).el = el; + parent = parent.parent; + } +} + +const COMPONENTS = "components"; +const DIRECTIVES = "directives"; +function resolveComponent(name, maybeSelfReference) { + return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; +} +const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); +function resolveDynamicComponent(component) { + if (isString(component)) { + return resolveAsset(COMPONENTS, component, false) || component; + } else { + return component || NULL_DYNAMIC_COMPONENT; + } +} +function resolveDirective(name) { + return resolveAsset(DIRECTIVES, name); +} +function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { + const instance = currentRenderingInstance || currentInstance; + if (instance) { + const Component = instance.type; + if (type === COMPONENTS) { + const selfName = getComponentName( + Component, + false + /* do not include inferred name to avoid breaking existing code */ + ); + if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) { + return Component; + } + } + const res = ( + // local registration + // check instance[type] first which is resolved for options API + resolve(instance[type] || Component[type], name) || // global registration + resolve(instance.appContext[type], name) + ); + if (!res && maybeSelfReference) { + return Component; + } + if (warnMissing && !res) { + const extra = type === COMPONENTS ? ` +If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; + warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); + } + return res; + } else { + warn( + `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().` + ); + } +} +function resolve(registry, name) { + return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); +} + +const isSuspense = (type) => type.__isSuspense; +const SuspenseImpl = { + name: "Suspense", + // In order to make Suspense tree-shakable, we need to avoid importing it + // directly in the renderer. The renderer checks for the __isSuspense flag + // on a vnode's type and calls the `process` method, passing in renderer + // internals. + __isSuspense: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) { + if (n1 == null) { + mountSuspense( + n2, + container, + anchor, + parentComponent, + parentSuspense, + isSVG, + slotScopeIds, + optimized, + rendererInternals + ); + } else { + patchSuspense( + n1, + n2, + container, + anchor, + parentComponent, + isSVG, + slotScopeIds, + optimized, + rendererInternals + ); + } + }, + hydrate: hydrateSuspense, + create: createSuspenseBoundary, + normalize: normalizeSuspenseChildren +}; +const Suspense = SuspenseImpl ; +function triggerEvent(vnode, name) { + const eventListener = vnode.props && vnode.props[name]; + if (isFunction(eventListener)) { + eventListener(); + } +} +function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) { + const { + p: patch, + o: { createElement } + } = rendererInternals; + const hiddenContainer = createElement("div"); + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + container, + hiddenContainer, + anchor, + isSVG, + slotScopeIds, + optimized, + rendererInternals + ); + patch( + null, + suspense.pendingBranch = vnode.ssContent, + hiddenContainer, + null, + parentComponent, + suspense, + isSVG, + slotScopeIds + ); + if (suspense.deps > 0) { + triggerEvent(vnode, "onPending"); + triggerEvent(vnode, "onFallback"); + patch( + null, + vnode.ssFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + isSVG, + slotScopeIds + ); + setActiveBranch(suspense, vnode.ssFallback); + } else { + suspense.resolve(false, true); + } +} +function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { + const suspense = n2.suspense = n1.suspense; + suspense.vnode = n2; + n2.el = n1.el; + const newBranch = n2.ssContent; + const newFallback = n2.ssFallback; + const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; + if (pendingBranch) { + suspense.pendingBranch = newBranch; + if (isSameVNodeType(newBranch, pendingBranch)) { + patch( + pendingBranch, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + isSVG, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else if (isInFallback) { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + isSVG, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } else { + suspense.pendingId++; + if (isHydrating) { + suspense.isHydrating = false; + suspense.activeBranch = pendingBranch; + } else { + unmount(pendingBranch, parentComponent, suspense); + } + suspense.deps = 0; + suspense.effects.length = 0; + suspense.hiddenContainer = createElement("div"); + if (isInFallback) { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + isSVG, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + patch( + activeBranch, + newFallback, + container, + anchor, + parentComponent, + null, + // fallback tree will not have suspense context + isSVG, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newFallback); + } + } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + isSVG, + slotScopeIds, + optimized + ); + suspense.resolve(true); + } else { + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + isSVG, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } + } + } + } else { + if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { + patch( + activeBranch, + newBranch, + container, + anchor, + parentComponent, + suspense, + isSVG, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, newBranch); + } else { + triggerEvent(n2, "onPending"); + suspense.pendingBranch = newBranch; + suspense.pendingId++; + patch( + null, + newBranch, + suspense.hiddenContainer, + null, + parentComponent, + suspense, + isSVG, + slotScopeIds, + optimized + ); + if (suspense.deps <= 0) { + suspense.resolve(); + } else { + const { timeout, pendingId } = suspense; + if (timeout > 0) { + setTimeout(() => { + if (suspense.pendingId === pendingId) { + suspense.fallback(newFallback); + } + }, timeout); + } else if (timeout === 0) { + suspense.fallback(newFallback); + } + } + } + } +} +let hasWarned = false; +function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) { + if (!hasWarned) { + hasWarned = true; + console[console.info ? "info" : "log"]( + ` is an experimental feature and its API will likely change.` + ); + } + const { + p: patch, + m: move, + um: unmount, + n: next, + o: { parentNode, remove } + } = rendererInternals; + let parentSuspenseId; + const isSuspensible = isVNodeSuspensible(vnode); + if (isSuspensible) { + if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) { + parentSuspenseId = parentSuspense.pendingId; + parentSuspense.deps++; + } + } + const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0; + { + assertNumber(timeout, `Suspense timeout`); + } + const suspense = { + vnode, + parent: parentSuspense, + parentComponent, + isSVG, + container, + hiddenContainer, + anchor, + deps: 0, + pendingId: 0, + timeout: typeof timeout === "number" ? timeout : -1, + activeBranch: null, + pendingBranch: null, + isInFallback: true, + isHydrating, + isUnmounted: false, + effects: [], + resolve(resume = false, sync = false) { + { + if (!resume && !suspense.pendingBranch) { + throw new Error( + `suspense.resolve() is called without a pending branch.` + ); + } + if (suspense.isUnmounted) { + throw new Error( + `suspense.resolve() is called on an already unmounted suspense boundary.` + ); + } + } + const { + vnode: vnode2, + activeBranch, + pendingBranch, + pendingId, + effects, + parentComponent: parentComponent2, + container: container2 + } = suspense; + let delayEnter = false; + if (suspense.isHydrating) { + suspense.isHydrating = false; + } else if (!resume) { + delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = () => { + if (pendingId === suspense.pendingId) { + move(pendingBranch, container2, anchor2, 0); + queuePostFlushCb(effects); + } + }; + } + let { anchor: anchor2 } = suspense; + if (activeBranch) { + anchor2 = next(activeBranch); + unmount(activeBranch, parentComponent2, suspense, true); + } + if (!delayEnter) { + move(pendingBranch, container2, anchor2, 0); + } + } + setActiveBranch(suspense, pendingBranch); + suspense.pendingBranch = null; + suspense.isInFallback = false; + let parent = suspense.parent; + let hasUnresolvedAncestor = false; + while (parent) { + if (parent.pendingBranch) { + parent.effects.push(...effects); + hasUnresolvedAncestor = true; + break; + } + parent = parent.parent; + } + if (!hasUnresolvedAncestor && !delayEnter) { + queuePostFlushCb(effects); + } + suspense.effects = []; + if (isSuspensible) { + if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { + parentSuspense.deps--; + if (parentSuspense.deps === 0 && !sync) { + parentSuspense.resolve(); + } + } + } + triggerEvent(vnode2, "onResolve"); + }, + fallback(fallbackVNode) { + if (!suspense.pendingBranch) { + return; + } + const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense; + triggerEvent(vnode2, "onFallback"); + const anchor2 = next(activeBranch); + const mountFallback = () => { + if (!suspense.isInFallback) { + return; + } + patch( + null, + fallbackVNode, + container2, + anchor2, + parentComponent2, + null, + // fallback tree will not have suspense context + isSVG2, + slotScopeIds, + optimized + ); + setActiveBranch(suspense, fallbackVNode); + }; + const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; + if (delayEnter) { + activeBranch.transition.afterLeave = mountFallback; + } + suspense.isInFallback = true; + unmount( + activeBranch, + parentComponent2, + null, + // no suspense so unmount hooks fire now + true + // shouldRemove + ); + if (!delayEnter) { + mountFallback(); + } + }, + move(container2, anchor2, type) { + suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); + suspense.container = container2; + }, + next() { + return suspense.activeBranch && next(suspense.activeBranch); + }, + registerDep(instance, setupRenderEffect) { + const isInPendingSuspense = !!suspense.pendingBranch; + if (isInPendingSuspense) { + suspense.deps++; + } + const hydratedEl = instance.vnode.el; + instance.asyncDep.catch((err) => { + handleError(err, instance, 0); + }).then((asyncSetupResult) => { + if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { + return; + } + instance.asyncResolved = true; + const { vnode: vnode2 } = instance; + { + pushWarningContext(vnode2); + } + handleSetupResult(instance, asyncSetupResult, false); + if (hydratedEl) { + vnode2.el = hydratedEl; + } + const placeholder = !hydratedEl && instance.subTree.el; + setupRenderEffect( + instance, + vnode2, + // component may have been moved before resolve. + // if this is not a hydration, instance.subTree will be the comment + // placeholder. + parentNode(hydratedEl || instance.subTree.el), + // anchor will not be used if this is hydration, so only need to + // consider the comment placeholder case. + hydratedEl ? null : next(instance.subTree), + suspense, + isSVG, + optimized + ); + if (placeholder) { + remove(placeholder); + } + updateHOCHostEl(instance, vnode2.el); + { + popWarningContext(); + } + if (isInPendingSuspense && --suspense.deps === 0) { + suspense.resolve(); + } + }); + }, + unmount(parentSuspense2, doRemove) { + suspense.isUnmounted = true; + if (suspense.activeBranch) { + unmount( + suspense.activeBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + if (suspense.pendingBranch) { + unmount( + suspense.pendingBranch, + parentComponent, + parentSuspense2, + doRemove + ); + } + } + }; + return suspense; +} +function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) { + const suspense = vnode.suspense = createSuspenseBoundary( + vnode, + parentSuspense, + parentComponent, + node.parentNode, + document.createElement("div"), + null, + isSVG, + slotScopeIds, + optimized, + rendererInternals, + true + /* hydrating */ + ); + const result = hydrateNode( + node, + suspense.pendingBranch = vnode.ssContent, + parentComponent, + suspense, + slotScopeIds, + optimized + ); + if (suspense.deps === 0) { + suspense.resolve(false, true); + } + return result; +} +function normalizeSuspenseChildren(vnode) { + const { shapeFlag, children } = vnode; + const isSlotChildren = shapeFlag & 32; + vnode.ssContent = normalizeSuspenseSlot( + isSlotChildren ? children.default : children + ); + vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); +} +function normalizeSuspenseSlot(s) { + let block; + if (isFunction(s)) { + const trackBlock = isBlockTreeEnabled && s._c; + if (trackBlock) { + s._d = false; + openBlock(); + } + s = s(); + if (trackBlock) { + s._d = true; + block = currentBlock; + closeBlock(); + } + } + if (isArray(s)) { + const singleChild = filterSingleRoot(s); + if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) { + warn(` slots expect a single root node.`); + } + s = singleChild; + } + s = normalizeVNode(s); + if (block && !s.dynamicChildren) { + s.dynamicChildren = block.filter((c) => c !== s); + } + return s; +} +function queueEffectWithSuspense(fn, suspense) { + if (suspense && suspense.pendingBranch) { + if (isArray(fn)) { + suspense.effects.push(...fn); + } else { + suspense.effects.push(fn); + } + } else { + queuePostFlushCb(fn); + } +} +function setActiveBranch(suspense, branch) { + suspense.activeBranch = branch; + const { vnode, parentComponent } = suspense; + const el = vnode.el = branch.el; + if (parentComponent && parentComponent.subTree === vnode) { + parentComponent.vnode.el = el; + updateHOCHostEl(parentComponent, el); + } +} +function isVNodeSuspensible(vnode) { + var _a; + return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false; +} + +function watchEffect(effect, options) { + return doWatch(effect, null, options); +} +function watchPostEffect(effect, options) { + return doWatch( + effect, + null, + extend({}, options, { flush: "post" }) + ); +} +function watchSyncEffect(effect, options) { + return doWatch( + effect, + null, + extend({}, options, { flush: "sync" }) + ); +} +const INITIAL_WATCHER_VALUE = {}; +function watch(source, cb, options) { + if (!isFunction(cb)) { + warn( + `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` + ); + } + return doWatch(source, cb, options); +} +function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) { + var _a; + if (!cb) { + if (immediate !== void 0) { + warn( + `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (deep !== void 0) { + warn( + `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + } + const warnInvalidSource = (s) => { + warn( + `Invalid watch source: `, + s, + `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` + ); + }; + const instance = getCurrentScope() === ((_a = currentInstance) == null ? void 0 : _a.scope) ? currentInstance : null; + let getter; + let forceTrigger = false; + let isMultiSource = false; + if (isRef(source)) { + getter = () => source.value; + forceTrigger = isShallow(source); + } else if (isReactive(source)) { + getter = () => source; + deep = true; + } else if (isArray(source)) { + isMultiSource = true; + forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); + getter = () => source.map((s) => { + if (isRef(s)) { + return s.value; + } else if (isReactive(s)) { + return traverse(s); + } else if (isFunction(s)) { + return callWithErrorHandling(s, instance, 2); + } else { + warnInvalidSource(s); + } + }); + } else if (isFunction(source)) { + if (cb) { + getter = () => callWithErrorHandling(source, instance, 2); + } else { + getter = () => { + if (instance && instance.isUnmounted) { + return; + } + if (cleanup) { + cleanup(); + } + return callWithAsyncErrorHandling( + source, + instance, + 3, + [onCleanup] + ); + }; + } + } else { + getter = NOOP; + warnInvalidSource(source); + } + if (cb && deep) { + const baseGetter = getter; + getter = () => traverse(baseGetter()); + } + let cleanup; + let onCleanup = (fn) => { + cleanup = effect.onStop = () => { + callWithErrorHandling(fn, instance, 4); + }; + }; + let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; + const job = () => { + if (!effect.active) { + return; + } + if (cb) { + const newValue = effect.run(); + if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) { + if (cleanup) { + cleanup(); + } + callWithAsyncErrorHandling(cb, instance, 3, [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, + onCleanup + ]); + oldValue = newValue; + } + } else { + effect.run(); + } + }; + job.allowRecurse = !!cb; + let scheduler; + if (flush === "sync") { + scheduler = job; + } else if (flush === "post") { + scheduler = () => queuePostRenderEffect(job, instance && instance.suspense); + } else { + job.pre = true; + if (instance) + job.id = instance.uid; + scheduler = () => queueJob(job); + } + const effect = new ReactiveEffect(getter, scheduler); + { + effect.onTrack = onTrack; + effect.onTrigger = onTrigger; + } + if (cb) { + if (immediate) { + job(); + } else { + oldValue = effect.run(); + } + } else if (flush === "post") { + queuePostRenderEffect( + effect.run.bind(effect), + instance && instance.suspense + ); + } else { + effect.run(); + } + const unwatch = () => { + effect.stop(); + if (instance && instance.scope) { + remove(instance.scope.effects, effect); + } + }; + return unwatch; +} +function instanceWatch(source, value, options) { + const publicThis = this.proxy; + const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); + let cb; + if (isFunction(value)) { + cb = value; + } else { + cb = value.handler; + options = value; + } + const cur = currentInstance; + setCurrentInstance(this); + const res = doWatch(getter, cb.bind(publicThis), options); + if (cur) { + setCurrentInstance(cur); + } else { + unsetCurrentInstance(); + } + return res; +} +function createPathGetter(ctx, path) { + const segments = path.split("."); + return () => { + let cur = ctx; + for (let i = 0; i < segments.length && cur; i++) { + cur = cur[segments[i]]; + } + return cur; + }; +} +function traverse(value, seen) { + if (!isObject(value) || value["__v_skip"]) { + return value; + } + seen = seen || /* @__PURE__ */ new Set(); + if (seen.has(value)) { + return value; + } + seen.add(value); + if (isRef(value)) { + traverse(value.value, seen); + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], seen); + } + } else if (isSet(value) || isMap(value)) { + value.forEach((v) => { + traverse(v, seen); + }); + } else if (isPlainObject(value)) { + for (const key in value) { + traverse(value[key], seen); + } + } + return value; +} + +function validateDirectiveName(name) { + if (isBuiltInDirective(name)) { + warn("Do not use built-in directive ids as custom directive id: " + name); + } +} +function withDirectives(vnode, directives) { + const internalInstance = currentRenderingInstance; + if (internalInstance === null) { + warn(`withDirectives can only be used inside render functions.`); + return vnode; + } + const instance = getExposeProxy(internalInstance) || internalInstance.proxy; + const bindings = vnode.dirs || (vnode.dirs = []); + for (let i = 0; i < directives.length; i++) { + let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]; + if (dir) { + if (isFunction(dir)) { + dir = { + mounted: dir, + updated: dir + }; + } + if (dir.deep) { + traverse(value); + } + bindings.push({ + dir, + instance, + value, + oldValue: void 0, + arg, + modifiers + }); + } + } + return vnode; +} +function invokeDirectiveHook(vnode, prevVNode, instance, name) { + const bindings = vnode.dirs; + const oldBindings = prevVNode && prevVNode.dirs; + for (let i = 0; i < bindings.length; i++) { + const binding = bindings[i]; + if (oldBindings) { + binding.oldValue = oldBindings[i].value; + } + let hook = binding.dir[name]; + if (hook) { + pauseTracking(); + callWithAsyncErrorHandling(hook, instance, 8, [ + vnode.el, + binding, + vnode, + prevVNode + ]); + resetTracking(); + } + } +} + +const leaveCbKey = Symbol("_leaveCb"); +const enterCbKey$1 = Symbol("_enterCb"); +function useTransitionState() { + const state = { + isMounted: false, + isLeaving: false, + isUnmounting: false, + leavingVNodes: /* @__PURE__ */ new Map() + }; + onMounted(() => { + state.isMounted = true; + }); + onBeforeUnmount(() => { + state.isUnmounting = true; + }); + return state; +} +const TransitionHookValidator = [Function, Array]; +const BaseTransitionPropsValidators = { + mode: String, + appear: Boolean, + persisted: Boolean, + // enter + onBeforeEnter: TransitionHookValidator, + onEnter: TransitionHookValidator, + onAfterEnter: TransitionHookValidator, + onEnterCancelled: TransitionHookValidator, + // leave + onBeforeLeave: TransitionHookValidator, + onLeave: TransitionHookValidator, + onAfterLeave: TransitionHookValidator, + onLeaveCancelled: TransitionHookValidator, + // appear + onBeforeAppear: TransitionHookValidator, + onAppear: TransitionHookValidator, + onAfterAppear: TransitionHookValidator, + onAppearCancelled: TransitionHookValidator +}; +const BaseTransitionImpl = { + name: `BaseTransition`, + props: BaseTransitionPropsValidators, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const state = useTransitionState(); + let prevTransitionKey; + return () => { + const children = slots.default && getTransitionRawChildren(slots.default(), true); + if (!children || !children.length) { + return; + } + let child = children[0]; + if (children.length > 1) { + let hasFound = false; + for (const c of children) { + if (c.type !== Comment) { + if (hasFound) { + warn( + " can only be used on a single element or component. Use for lists." + ); + break; + } + child = c; + hasFound = true; + } + } + } + const rawProps = toRaw(props); + const { mode } = rawProps; + if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") { + warn(`invalid mode: ${mode}`); + } + if (state.isLeaving) { + return emptyPlaceholder(child); + } + const innerChild = getKeepAliveChild(child); + if (!innerChild) { + return emptyPlaceholder(child); + } + const enterHooks = resolveTransitionHooks( + innerChild, + rawProps, + state, + instance + ); + setTransitionHooks(innerChild, enterHooks); + const oldChild = instance.subTree; + const oldInnerChild = oldChild && getKeepAliveChild(oldChild); + let transitionKeyChanged = false; + const { getTransitionKey } = innerChild.type; + if (getTransitionKey) { + const key = getTransitionKey(); + if (prevTransitionKey === void 0) { + prevTransitionKey = key; + } else if (key !== prevTransitionKey) { + prevTransitionKey = key; + transitionKeyChanged = true; + } + } + if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) { + const leavingHooks = resolveTransitionHooks( + oldInnerChild, + rawProps, + state, + instance + ); + setTransitionHooks(oldInnerChild, leavingHooks); + if (mode === "out-in") { + state.isLeaving = true; + leavingHooks.afterLeave = () => { + state.isLeaving = false; + if (instance.update.active !== false) { + instance.update(); + } + }; + return emptyPlaceholder(child); + } else if (mode === "in-out" && innerChild.type !== Comment) { + leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { + const leavingVNodesCache = getLeavingNodesForType( + state, + oldInnerChild + ); + leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; + el[leaveCbKey] = () => { + earlyRemove(); + el[leaveCbKey] = void 0; + delete enterHooks.delayedLeave; + }; + enterHooks.delayedLeave = delayedLeave; + }; + } + } + return child; + }; + } +}; +const BaseTransition = BaseTransitionImpl; +function getLeavingNodesForType(state, vnode) { + const { leavingVNodes } = state; + let leavingVNodesCache = leavingVNodes.get(vnode.type); + if (!leavingVNodesCache) { + leavingVNodesCache = /* @__PURE__ */ Object.create(null); + leavingVNodes.set(vnode.type, leavingVNodesCache); + } + return leavingVNodesCache; +} +function resolveTransitionHooks(vnode, props, state, instance) { + const { + appear, + mode, + persisted = false, + onBeforeEnter, + onEnter, + onAfterEnter, + onEnterCancelled, + onBeforeLeave, + onLeave, + onAfterLeave, + onLeaveCancelled, + onBeforeAppear, + onAppear, + onAfterAppear, + onAppearCancelled + } = props; + const key = String(vnode.key); + const leavingVNodesCache = getLeavingNodesForType(state, vnode); + const callHook = (hook, args) => { + hook && callWithAsyncErrorHandling( + hook, + instance, + 9, + args + ); + }; + const callAsyncHook = (hook, args) => { + const done = args[1]; + callHook(hook, args); + if (isArray(hook)) { + if (hook.every((hook2) => hook2.length <= 1)) + done(); + } else if (hook.length <= 1) { + done(); + } + }; + const hooks = { + mode, + persisted, + beforeEnter(el) { + let hook = onBeforeEnter; + if (!state.isMounted) { + if (appear) { + hook = onBeforeAppear || onBeforeEnter; + } else { + return; + } + } + if (el[leaveCbKey]) { + el[leaveCbKey]( + true + /* cancelled */ + ); + } + const leavingVNode = leavingVNodesCache[key]; + if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { + leavingVNode.el[leaveCbKey](); + } + callHook(hook, [el]); + }, + enter(el) { + let hook = onEnter; + let afterHook = onAfterEnter; + let cancelHook = onEnterCancelled; + if (!state.isMounted) { + if (appear) { + hook = onAppear || onEnter; + afterHook = onAfterAppear || onAfterEnter; + cancelHook = onAppearCancelled || onEnterCancelled; + } else { + return; + } + } + let called = false; + const done = el[enterCbKey$1] = (cancelled) => { + if (called) + return; + called = true; + if (cancelled) { + callHook(cancelHook, [el]); + } else { + callHook(afterHook, [el]); + } + if (hooks.delayedLeave) { + hooks.delayedLeave(); + } + el[enterCbKey$1] = void 0; + }; + if (hook) { + callAsyncHook(hook, [el, done]); + } else { + done(); + } + }, + leave(el, remove) { + const key2 = String(vnode.key); + if (el[enterCbKey$1]) { + el[enterCbKey$1]( + true + /* cancelled */ + ); + } + if (state.isUnmounting) { + return remove(); + } + callHook(onBeforeLeave, [el]); + let called = false; + const done = el[leaveCbKey] = (cancelled) => { + if (called) + return; + called = true; + remove(); + if (cancelled) { + callHook(onLeaveCancelled, [el]); + } else { + callHook(onAfterLeave, [el]); + } + el[leaveCbKey] = void 0; + if (leavingVNodesCache[key2] === vnode) { + delete leavingVNodesCache[key2]; + } + }; + leavingVNodesCache[key2] = vnode; + if (onLeave) { + callAsyncHook(onLeave, [el, done]); + } else { + done(); + } + }, + clone(vnode2) { + return resolveTransitionHooks(vnode2, props, state, instance); + } + }; + return hooks; +} +function emptyPlaceholder(vnode) { + if (isKeepAlive(vnode)) { + vnode = cloneVNode(vnode); + vnode.children = null; + return vnode; + } +} +function getKeepAliveChild(vnode) { + return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : void 0 : vnode; +} +function setTransitionHooks(vnode, hooks) { + if (vnode.shapeFlag & 6 && vnode.component) { + setTransitionHooks(vnode.component.subTree, hooks); + } else if (vnode.shapeFlag & 128) { + vnode.ssContent.transition = hooks.clone(vnode.ssContent); + vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); + } else { + vnode.transition = hooks; + } +} +function getTransitionRawChildren(children, keepComment = false, parentKey) { + let ret = []; + let keyedFragmentCount = 0; + for (let i = 0; i < children.length; i++) { + let child = children[i]; + const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); + if (child.type === Fragment) { + if (child.patchFlag & 128) + keyedFragmentCount++; + ret = ret.concat( + getTransitionRawChildren(child.children, keepComment, key) + ); + } else if (keepComment || child.type !== Comment) { + ret.push(key != null ? cloneVNode(child, { key }) : child); + } + } + if (keyedFragmentCount > 1) { + for (let i = 0; i < ret.length; i++) { + ret[i].patchFlag = -2; + } + } + return ret; +} + +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineComponent(options, extraOptions) { + return isFunction(options) ? ( + // #8326: extend call and options.name access are considered side-effects + // by Rollup, so we have to wrap it in a pure-annotated IIFE. + /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))() + ) : options; +} + +const isAsyncWrapper = (i) => !!i.type.__asyncLoader; +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function defineAsyncComponent(source) { + if (isFunction(source)) { + source = { loader: source }; + } + const { + loader, + loadingComponent, + errorComponent, + delay = 200, + timeout, + // undefined = never times out + suspensible = true, + onError: userOnError + } = source; + let pendingRequest = null; + let resolvedComp; + let retries = 0; + const retry = () => { + retries++; + pendingRequest = null; + return load(); + }; + const load = () => { + let thisRequest; + return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { + err = err instanceof Error ? err : new Error(String(err)); + if (userOnError) { + return new Promise((resolve, reject) => { + const userRetry = () => resolve(retry()); + const userFail = () => reject(err); + userOnError(err, userRetry, userFail, retries + 1); + }); + } else { + throw err; + } + }).then((comp) => { + if (thisRequest !== pendingRequest && pendingRequest) { + return pendingRequest; + } + if (!comp) { + warn( + `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` + ); + } + if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { + comp = comp.default; + } + if (comp && !isObject(comp) && !isFunction(comp)) { + throw new Error(`Invalid async component load result: ${comp}`); + } + resolvedComp = comp; + return comp; + })); + }; + return defineComponent({ + name: "AsyncComponentWrapper", + __asyncLoader: load, + get __asyncResolved() { + return resolvedComp; + }, + setup() { + const instance = currentInstance; + if (resolvedComp) { + return () => createInnerComp(resolvedComp, instance); + } + const onError = (err) => { + pendingRequest = null; + handleError( + err, + instance, + 13, + !errorComponent + /* do not throw in dev if user provided error component */ + ); + }; + if (suspensible && instance.suspense || false) { + return load().then((comp) => { + return () => createInnerComp(comp, instance); + }).catch((err) => { + onError(err); + return () => errorComponent ? createVNode(errorComponent, { + error: err + }) : null; + }); + } + const loaded = ref(false); + const error = ref(); + const delayed = ref(!!delay); + if (delay) { + setTimeout(() => { + delayed.value = false; + }, delay); + } + if (timeout != null) { + setTimeout(() => { + if (!loaded.value && !error.value) { + const err = new Error( + `Async component timed out after ${timeout}ms.` + ); + onError(err); + error.value = err; + } + }, timeout); + } + load().then(() => { + loaded.value = true; + if (instance.parent && isKeepAlive(instance.parent.vnode)) { + queueJob(instance.parent.update); + } + }).catch((err) => { + onError(err); + error.value = err; + }); + return () => { + if (loaded.value && resolvedComp) { + return createInnerComp(resolvedComp, instance); + } else if (error.value && errorComponent) { + return createVNode(errorComponent, { + error: error.value + }); + } else if (loadingComponent && !delayed.value) { + return createVNode(loadingComponent); + } + }; + } + }); +} +function createInnerComp(comp, parent) { + const { ref: ref2, props, children, ce } = parent.vnode; + const vnode = createVNode(comp, props, children); + vnode.ref = ref2; + vnode.ce = ce; + delete parent.vnode.ce; + return vnode; +} + +const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; +const KeepAliveImpl = { + name: `KeepAlive`, + // Marker for special handling inside the renderer. We are not using a === + // check directly on KeepAlive in the renderer, because importing it directly + // would prevent it from being tree-shaken. + __isKeepAlive: true, + props: { + include: [String, RegExp, Array], + exclude: [String, RegExp, Array], + max: [String, Number] + }, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const sharedContext = instance.ctx; + const cache = /* @__PURE__ */ new Map(); + const keys = /* @__PURE__ */ new Set(); + let current = null; + { + instance.__v_cache = cache; + } + const parentSuspense = instance.suspense; + const { + renderer: { + p: patch, + m: move, + um: _unmount, + o: { createElement } + } + } = sharedContext; + const storageContainer = createElement("div"); + sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => { + const instance2 = vnode.component; + move(vnode, container, anchor, 0, parentSuspense); + patch( + instance2.vnode, + vnode, + container, + anchor, + instance2, + parentSuspense, + isSVG, + vnode.slotScopeIds, + optimized + ); + queuePostRenderEffect(() => { + instance2.isDeactivated = false; + if (instance2.a) { + invokeArrayFns(instance2.a); + } + const vnodeHook = vnode.props && vnode.props.onVnodeMounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + }, parentSuspense); + { + devtoolsComponentAdded(instance2); + } + }; + sharedContext.deactivate = (vnode) => { + const instance2 = vnode.component; + move(vnode, storageContainer, null, 1, parentSuspense); + queuePostRenderEffect(() => { + if (instance2.da) { + invokeArrayFns(instance2.da); + } + const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + instance2.isDeactivated = true; + }, parentSuspense); + { + devtoolsComponentAdded(instance2); + } + }; + function unmount(vnode) { + resetShapeFlag(vnode); + _unmount(vnode, instance, parentSuspense, true); + } + function pruneCache(filter) { + cache.forEach((vnode, key) => { + const name = getComponentName(vnode.type); + if (name && (!filter || !filter(name))) { + pruneCacheEntry(key); + } + }); + } + function pruneCacheEntry(key) { + const cached = cache.get(key); + if (!current || !isSameVNodeType(cached, current)) { + unmount(cached); + } else if (current) { + resetShapeFlag(current); + } + cache.delete(key); + keys.delete(key); + } + watch( + () => [props.include, props.exclude], + ([include, exclude]) => { + include && pruneCache((name) => matches(include, name)); + exclude && pruneCache((name) => !matches(exclude, name)); + }, + // prune post-render after `current` has been updated + { flush: "post", deep: true } + ); + let pendingCacheKey = null; + const cacheSubtree = () => { + if (pendingCacheKey != null) { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + } + }; + onMounted(cacheSubtree); + onUpdated(cacheSubtree); + onBeforeUnmount(() => { + cache.forEach((cached) => { + const { subTree, suspense } = instance; + const vnode = getInnerChild(subTree); + if (cached.type === vnode.type && cached.key === vnode.key) { + resetShapeFlag(vnode); + const da = vnode.component.da; + da && queuePostRenderEffect(da, suspense); + return; + } + unmount(cached); + }); + }); + return () => { + pendingCacheKey = null; + if (!slots.default) { + return null; + } + const children = slots.default(); + const rawVNode = children[0]; + if (children.length > 1) { + { + warn(`KeepAlive should contain exactly one component child.`); + } + current = null; + return children; + } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { + current = null; + return rawVNode; + } + let vnode = getInnerChild(rawVNode); + const comp = vnode.type; + const name = getComponentName( + isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp + ); + const { include, exclude, max } = props; + if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { + current = vnode; + return rawVNode; + } + const key = vnode.key == null ? comp : vnode.key; + const cachedVNode = cache.get(key); + if (vnode.el) { + vnode = cloneVNode(vnode); + if (rawVNode.shapeFlag & 128) { + rawVNode.ssContent = vnode; + } + } + pendingCacheKey = key; + if (cachedVNode) { + vnode.el = cachedVNode.el; + vnode.component = cachedVNode.component; + if (vnode.transition) { + setTransitionHooks(vnode, vnode.transition); + } + vnode.shapeFlag |= 512; + keys.delete(key); + keys.add(key); + } else { + keys.add(key); + if (max && keys.size > parseInt(max, 10)) { + pruneCacheEntry(keys.values().next().value); + } + } + vnode.shapeFlag |= 256; + current = vnode; + return isSuspense(rawVNode.type) ? rawVNode : vnode; + }; + } +}; +const KeepAlive = KeepAliveImpl; +function matches(pattern, name) { + if (isArray(pattern)) { + return pattern.some((p) => matches(p, name)); + } else if (isString(pattern)) { + return pattern.split(",").includes(name); + } else if (isRegExp(pattern)) { + return pattern.test(name); + } + return false; +} +function onActivated(hook, target) { + registerKeepAliveHook(hook, "a", target); +} +function onDeactivated(hook, target) { + registerKeepAliveHook(hook, "da", target); +} +function registerKeepAliveHook(hook, type, target = currentInstance) { + const wrappedHook = hook.__wdc || (hook.__wdc = () => { + let current = target; + while (current) { + if (current.isDeactivated) { + return; + } + current = current.parent; + } + return hook(); + }); + injectHook(type, wrappedHook, target); + if (target) { + let current = target.parent; + while (current && current.parent) { + if (isKeepAlive(current.parent.vnode)) { + injectToKeepAliveRoot(wrappedHook, type, target, current); + } + current = current.parent; + } + } +} +function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { + const injected = injectHook( + type, + hook, + keepAliveRoot, + true + /* prepend */ + ); + onUnmounted(() => { + remove(keepAliveRoot[type], injected); + }, target); +} +function resetShapeFlag(vnode) { + vnode.shapeFlag &= ~256; + vnode.shapeFlag &= ~512; +} +function getInnerChild(vnode) { + return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; +} + +function injectHook(type, hook, target = currentInstance, prepend = false) { + if (target) { + const hooks = target[type] || (target[type] = []); + const wrappedHook = hook.__weh || (hook.__weh = (...args) => { + if (target.isUnmounted) { + return; + } + pauseTracking(); + setCurrentInstance(target); + const res = callWithAsyncErrorHandling(hook, target, type, args); + unsetCurrentInstance(); + resetTracking(); + return res; + }); + if (prepend) { + hooks.unshift(wrappedHook); + } else { + hooks.push(wrappedHook); + } + return wrappedHook; + } else { + const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, "")); + warn( + `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` ) + ); + } +} +const createHook = (lifecycle) => (hook, target = currentInstance) => ( + // post-create lifecycle registrations are noops during SSR (except for serverPrefetch) + (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target) +); +const onBeforeMount = createHook("bm"); +const onMounted = createHook("m"); +const onBeforeUpdate = createHook("bu"); +const onUpdated = createHook("u"); +const onBeforeUnmount = createHook("bum"); +const onUnmounted = createHook("um"); +const onServerPrefetch = createHook("sp"); +const onRenderTriggered = createHook( + "rtg" +); +const onRenderTracked = createHook( + "rtc" +); +function onErrorCaptured(hook, target = currentInstance) { + injectHook("ec", hook, target); +} + +function renderList(source, renderItem, cache, index) { + let ret; + const cached = cache && cache[index]; + if (isArray(source) || isString(source)) { + ret = new Array(source.length); + for (let i = 0, l = source.length; i < l; i++) { + ret[i] = renderItem(source[i], i, void 0, cached && cached[i]); + } + } else if (typeof source === "number") { + if (!Number.isInteger(source)) { + warn(`The v-for range expect an integer value but got ${source}.`); + } + ret = new Array(source); + for (let i = 0; i < source; i++) { + ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); + } + } else if (isObject(source)) { + if (source[Symbol.iterator]) { + ret = Array.from( + source, + (item, i) => renderItem(item, i, void 0, cached && cached[i]) + ); + } else { + const keys = Object.keys(source); + ret = new Array(keys.length); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + ret[i] = renderItem(source[key], key, i, cached && cached[i]); + } + } + } else { + ret = []; + } + if (cache) { + cache[index] = ret; + } + return ret; +} + +function createSlots(slots, dynamicSlots) { + for (let i = 0; i < dynamicSlots.length; i++) { + const slot = dynamicSlots[i]; + if (isArray(slot)) { + for (let j = 0; j < slot.length; j++) { + slots[slot[j].name] = slot[j].fn; + } + } else if (slot) { + slots[slot.name] = slot.key ? (...args) => { + const res = slot.fn(...args); + if (res) + res.key = slot.key; + return res; + } : slot.fn; + } + } + return slots; +} + +function renderSlot(slots, name, props = {}, fallback, noSlotted) { + if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) { + if (name !== "default") + props.name = name; + return createVNode("slot", props, fallback && fallback()); + } + let slot = slots[name]; + if (slot && slot.length > 1) { + warn( + `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.` + ); + slot = () => []; + } + if (slot && slot._c) { + slot._d = false; + } + openBlock(); + const validSlotContent = slot && ensureValidVNode(slot(props)); + const rendered = createBlock( + Fragment, + { + key: props.key || // slot content array of a dynamic conditional slot may have a branch + // key attached in the `createSlots` helper, respect that + validSlotContent && validSlotContent.key || `_${name}` + }, + validSlotContent || (fallback ? fallback() : []), + validSlotContent && slots._ === 1 ? 64 : -2 + ); + if (!noSlotted && rendered.scopeId) { + rendered.slotScopeIds = [rendered.scopeId + "-s"]; + } + if (slot && slot._c) { + slot._d = true; + } + return rendered; +} +function ensureValidVNode(vnodes) { + return vnodes.some((child) => { + if (!isVNode(child)) + return true; + if (child.type === Comment) + return false; + if (child.type === Fragment && !ensureValidVNode(child.children)) + return false; + return true; + }) ? vnodes : null; +} + +function toHandlers(obj, preserveCaseIfNecessary) { + const ret = {}; + if (!isObject(obj)) { + warn(`v-on with no argument expects an object value.`); + return ret; + } + for (const key in obj) { + ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key]; + } + return ret; +} + +const getPublicInstance = (i) => { + if (!i) + return null; + if (isStatefulComponent(i)) + return getExposeProxy(i) || i.proxy; + return getPublicInstance(i.parent); +}; +const publicPropertiesMap = ( + // Move PURE marker to new line to workaround compiler discarding it + // due to type annotation + /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), { + $: (i) => i, + $el: (i) => i.vnode.el, + $data: (i) => i.data, + $props: (i) => shallowReadonly(i.props) , + $attrs: (i) => shallowReadonly(i.attrs) , + $slots: (i) => shallowReadonly(i.slots) , + $refs: (i) => shallowReadonly(i.refs) , + $parent: (i) => getPublicInstance(i.parent), + $root: (i) => getPublicInstance(i.root), + $emit: (i) => i.emit, + $options: (i) => resolveMergedOptions(i) , + $forceUpdate: (i) => i.f || (i.f = () => queueJob(i.update)), + $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), + $watch: (i) => instanceWatch.bind(i) + }) +); +const isReservedPrefix = (key) => key === "_" || key === "$"; +const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key); +const PublicInstanceProxyHandlers = { + get({ _: instance }, key) { + const { ctx, setupState, data, props, accessCache, type, appContext } = instance; + if (key === "__isVue") { + return true; + } + let normalizedProps; + if (key[0] !== "$") { + const n = accessCache[key]; + if (n !== void 0) { + switch (n) { + case 1 /* SETUP */: + return setupState[key]; + case 2 /* DATA */: + return data[key]; + case 4 /* CONTEXT */: + return ctx[key]; + case 3 /* PROPS */: + return props[key]; + } + } else if (hasSetupBinding(setupState, key)) { + accessCache[key] = 1 /* SETUP */; + return setupState[key]; + } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { + accessCache[key] = 2 /* DATA */; + return data[key]; + } else if ( + // only cache other properties when instance has declared (thus stable) + // props + (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key) + ) { + accessCache[key] = 3 /* PROPS */; + return props[key]; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if (shouldCacheAccess) { + accessCache[key] = 0 /* OTHER */; + } + } + const publicGetter = publicPropertiesMap[key]; + let cssModule, globalProperties; + if (publicGetter) { + if (key === "$attrs") { + track(instance, "get", key); + markAttrsAccessed(); + } else if (key === "$slots") { + track(instance, "get", key); + } + return publicGetter(instance); + } else if ( + // css module (injected by vue-loader) + (cssModule = type.__cssModules) && (cssModule = cssModule[key]) + ) { + return cssModule; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4 /* CONTEXT */; + return ctx[key]; + } else if ( + // global properties + globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key) + ) { + { + return globalProperties[key]; + } + } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading + // to infinite warning loop + key.indexOf("__v") !== 0)) { + if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) { + warn( + `Property ${JSON.stringify( + key + )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` + ); + } else if (instance === currentRenderingInstance) { + warn( + `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` + ); + } + } + }, + set({ _: instance }, key, value) { + const { data, setupState, ctx } = instance; + if (hasSetupBinding(setupState, key)) { + setupState[key] = value; + return true; + } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) { + warn(`Cannot mutate