@uxland/primary-shell 7.41.8 → 7.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as s, d as e, x as t, z as r, P as n, b as o, v as l, Q as c, n as g, o as m, p, m as v, c as P, u as E, f as h, q as u, e as R, w as S, g as d, j as y, s as w, l as C, y as M } from "./index-mgf5fUfq.js";
1
+ import { E as s, d as e, x as t, z as r, P as n, b as o, v as l, Q as c, n as g, o as m, p, m as v, c as P, u as E, f as h, q as u, e as R, w as S, g as d, j as y, s as w, l as C, y as M } from "./index-DHrGHdzq.js";
2
2
  export {
3
3
  s as EcapEventManager,
4
4
  e as ExitShell,
@@ -130,7 +130,7 @@
130
130
  const handlerResult = handler(payload);
131
131
  return handlerResult instanceof Promise ? handlerResult : Promise.resolve(handlerResult);
132
132
  }
133
- }`)(J)},createBroker=()=>new Broker,LAST_WORKED_DIAGNOSTICS_KEY="lastWorkedDiagnostics",EVENTS_WITH_DIAGNOSTICS=["PROVES_ORDRES_CLINIQUES_CONSULTAR","RESULT_OC","LABORATORI_SEROTECA_PETICIO_CONSULTA","ORDRE_TRACTAMENT","PRESCRIPCIO_ACTIVA","REV_IT","OC_EXPRES"];class EcapEventManager{}class EcapEventManagerImpl{constructor(W){this.globalStateManager=W}publish(W,X,te){const re=this.createEcapEvent(W,X,te??{});EVENTS_WITH_DIAGNOSTICS.includes(W)&&(re.DIAGNOSTICS=this.globalStateManager.getData(LAST_WORKED_DIAGNOSTICS_KEY)??[]),this.raiseEcapEvent(re)}createEcapEvent(W,X,te){return{TipusEvent:W,Accio:X,...te}}raiseEcapEvent(W){window.parent&&window.parent.postMessage(JSON.stringify(W),"*"),console.log("method",JSON.stringify(W))}}const createEcapEventManager=J=>new EcapEventManagerImpl(J);class ExitGuardManagerImpl{constructor(){this.guards=new Map}register(W,X){this.guards.set(W,X)}unregister(W){this.guards.delete(W)}async canExit(){for(const W of this.guards.values())try{if(!await W())return!1}catch(X){console.error("Exit guard failed:",X)}return!0}}class PrimariaGlobalStateManagerImpl{constructor(W){this.broker=W,this.state={}}setData(W,X){this.state[W]=X,this.broker.publish("data_set",{key:W,value:X})}getData(W){return this.state[W]}clearData(){this.state={}}}const createGlobalStateManager=J=>new PrimariaGlobalStateManagerImpl(J);function bind(J,W){return function(){return J.apply(W,arguments)}}const{toString}=Object.prototype,{getPrototypeOf:getPrototypeOf$1}=Object,{iterator,toStringTag}=Symbol,kindOf=(J=>W=>{const X=toString.call(W);return J[X]||(J[X]=X.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=J=>(J=J.toLowerCase(),W=>kindOf(W)===J),typeOfTest=J=>W=>typeof W===J,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(J){return J!==null&&!isUndefined(J)&&J.constructor!==null&&!isUndefined(J.constructor)&&isFunction$1(J.constructor.isBuffer)&&J.constructor.isBuffer(J)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(J){let W;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?W=ArrayBuffer.isView(J):W=J&&J.buffer&&isArrayBuffer(J.buffer),W}const isString$1=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=J=>J!==null&&typeof J=="object",isBoolean$1=J=>J===!0||J===!1,isPlainObject$2=J=>{if(kindOf(J)!=="object")return!1;const W=getPrototypeOf$1(J);return(W===null||W===Object.prototype||Object.getPrototypeOf(W)===null)&&!(toStringTag in J)&&!(iterator in J)},isEmptyObject=J=>{if(!isObject(J)||isBuffer(J))return!1;try{return Object.keys(J).length===0&&Object.getPrototypeOf(J)===Object.prototype}catch{return!1}},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=J=>isObject(J)&&isFunction$1(J.pipe),isFormData=J=>{let W;return J&&(typeof FormData=="function"&&J instanceof FormData||isFunction$1(J.append)&&((W=kindOf(J))==="formdata"||W==="object"&&isFunction$1(J.toString)&&J.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=J=>J.trim?J.trim():J.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(J,W,{allOwnKeys:X=!1}={}){if(J===null||typeof J>"u")return;let te,re;if(typeof J!="object"&&(J=[J]),isArray(J))for(te=0,re=J.length;te<re;te++)W.call(null,J[te],te,J);else{if(isBuffer(J))return;const oe=X?Object.getOwnPropertyNames(J):Object.keys(J),ne=oe.length;let de;for(te=0;te<ne;te++)de=oe[te],W.call(null,J[de],de,J)}}function findKey$1(J,W){if(isBuffer(J))return null;W=W.toLowerCase();const X=Object.keys(J);let te=X.length,re;for(;te-- >0;)if(re=X[te],W===re.toLowerCase())return re;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=J=>!isUndefined(J)&&J!==_global;function merge(){const{caseless:J,skipUndefined:W}=isContextDefined(this)&&this||{},X={},te=(re,oe)=>{const ne=J&&findKey$1(X,oe)||oe;isPlainObject$2(X[ne])&&isPlainObject$2(re)?X[ne]=merge(X[ne],re):isPlainObject$2(re)?X[ne]=merge({},re):isArray(re)?X[ne]=re.slice():(!W||!isUndefined(re))&&(X[ne]=re)};for(let re=0,oe=arguments.length;re<oe;re++)arguments[re]&&forEach(arguments[re],te);return X}const extend=(J,W,X,{allOwnKeys:te}={})=>(forEach(W,(re,oe)=>{X&&isFunction$1(re)?J[oe]=bind(re,X):J[oe]=re},{allOwnKeys:te}),J),stripBOM=J=>(J.charCodeAt(0)===65279&&(J=J.slice(1)),J),inherits=(J,W,X,te)=>{J.prototype=Object.create(W.prototype,te),J.prototype.constructor=J,Object.defineProperty(J,"super",{value:W.prototype}),X&&Object.assign(J.prototype,X)},toFlatObject=(J,W,X,te)=>{let re,oe,ne;const de={};if(W=W||{},J==null)return W;do{for(re=Object.getOwnPropertyNames(J),oe=re.length;oe-- >0;)ne=re[oe],(!te||te(ne,J,W))&&!de[ne]&&(W[ne]=J[ne],de[ne]=!0);J=X!==!1&&getPrototypeOf$1(J)}while(J&&(!X||X(J,W))&&J!==Object.prototype);return W},endsWith=(J,W,X)=>{J=String(J),(X===void 0||X>J.length)&&(X=J.length),X-=W.length;const te=J.indexOf(W,X);return te!==-1&&te===X},toArray=J=>{if(!J)return null;if(isArray(J))return J;let W=J.length;if(!isNumber(W))return null;const X=new Array(W);for(;W-- >0;)X[W]=J[W];return X},isTypedArray=(J=>W=>J&&W instanceof J)(typeof Uint8Array<"u"&&getPrototypeOf$1(Uint8Array)),forEachEntry=(J,W)=>{const te=(J&&J[iterator]).call(J);let re;for(;(re=te.next())&&!re.done;){const oe=re.value;W.call(J,oe[0],oe[1])}},matchAll=(J,W)=>{let X;const te=[];for(;(X=J.exec(W))!==null;)te.push(X);return te},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=J=>J.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(X,te,re){return te.toUpperCase()+re}),hasOwnProperty=(({hasOwnProperty:J})=>(W,X)=>J.call(W,X))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(J,W)=>{const X=Object.getOwnPropertyDescriptors(J),te={};forEach(X,(re,oe)=>{let ne;(ne=W(re,oe,J))!==!1&&(te[oe]=ne||re)}),Object.defineProperties(J,te)},freezeMethods=J=>{reduceDescriptors(J,(W,X)=>{if(isFunction$1(J)&&["arguments","caller","callee"].indexOf(X)!==-1)return!1;const te=J[X];if(isFunction$1(te)){if(W.enumerable=!1,"writable"in W){W.writable=!1;return}W.set||(W.set=()=>{throw Error("Can not rewrite read-only method '"+X+"'")})}})},toObjectSet=(J,W)=>{const X={},te=re=>{re.forEach(oe=>{X[oe]=!0})};return isArray(J)?te(J):te(String(J).split(W)),X},noop$1=()=>{},toFiniteNumber=(J,W)=>J!=null&&Number.isFinite(J=+J)?J:W;function isSpecCompliantForm(J){return!!(J&&isFunction$1(J.append)&&J[toStringTag]==="FormData"&&J[iterator])}const toJSONObject=J=>{const W=new Array(10),X=(te,re)=>{if(isObject(te)){if(W.indexOf(te)>=0)return;if(isBuffer(te))return te;if(!("toJSON"in te)){W[re]=te;const oe=isArray(te)?[]:{};return forEach(te,(ne,de)=>{const ce=X(ne,re+1);!isUndefined(ce)&&(oe[de]=ce)}),W[re]=void 0,oe}}return te};return X(J,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=J=>J&&(isObject(J)||isFunction$1(J))&&isFunction$1(J.then)&&isFunction$1(J.catch),_setImmediate=((J,W)=>J?setImmediate:W?((X,te)=>(_global.addEventListener("message",({source:re,data:oe})=>{re===_global&&oe===X&&te.length&&te.shift()()},!1),re=>{te.push(re),_global.postMessage(X,"*")}))(`axios@${Math.random()}`,[]):X=>setTimeout(X))(typeof setImmediate=="function",isFunction$1(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,isIterable=J=>J!=null&&isFunction$1(J[iterator]),utils$1={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString:isString$1,isNumber,isBoolean:isBoolean$1,isObject,isPlainObject:isPlainObject$2,isEmptyObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$1,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(J,W,X,te,re){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=J,this.name="AxiosError",W&&(this.code=W),X&&(this.config=X),te&&(this.request=te),re&&(this.response=re,this.status=re.status?re.status:null)}utils$1.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(J=>{descriptors[J]={value:J}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(J,W,X,te,re,oe)=>{const ne=Object.create(prototype$1);utils$1.toFlatObject(J,ne,function(he){return he!==Error.prototype},ue=>ue!=="isAxiosError");const de=J&&J.message?J.message:"Error",ce=W==null&&J?J.code:W;return AxiosError$1.call(ne,de,ce,X,te,re),J&&ne.cause==null&&Object.defineProperty(ne,"cause",{value:J,configurable:!0}),ne.name=J&&J.name||"Error",oe&&Object.assign(ne,oe),ne};const httpAdapter=null;function isVisitable(J){return utils$1.isPlainObject(J)||utils$1.isArray(J)}function removeBrackets(J){return utils$1.endsWith(J,"[]")?J.slice(0,-2):J}function renderKey(J,W,X){return J?J.concat(W).map(function(re,oe){return re=removeBrackets(re),!X&&oe?"["+re+"]":re}).join(X?".":""):W}function isFlatArray(J){return utils$1.isArray(J)&&!J.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(W){return/^is[A-Z]/.test(W)});function toFormData$1(J,W,X){if(!utils$1.isObject(J))throw new TypeError("target must be an object");W=W||new FormData,X=utils$1.toFlatObject(X,{metaTokens:!0,dots:!1,indexes:!1},!1,function(ge,ve){return!utils$1.isUndefined(ve[ge])});const te=X.metaTokens,re=X.visitor||he,oe=X.dots,ne=X.indexes,ce=(X.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(W);if(!utils$1.isFunction(re))throw new TypeError("visitor must be a function");function ue(me){if(me===null)return"";if(utils$1.isDate(me))return me.toISOString();if(utils$1.isBoolean(me))return me.toString();if(!ce&&utils$1.isBlob(me))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(me)||utils$1.isTypedArray(me)?ce&&typeof Blob=="function"?new Blob([me]):Buffer.from(me):me}function he(me,ge,ve){let _e=me;if(me&&!ve&&typeof me=="object"){if(utils$1.endsWith(ge,"{}"))ge=te?ge:ge.slice(0,-2),me=JSON.stringify(me);else if(utils$1.isArray(me)&&isFlatArray(me)||(utils$1.isFileList(me)||utils$1.endsWith(ge,"[]"))&&(_e=utils$1.toArray(me)))return ge=removeBrackets(ge),_e.forEach(function(Se,we){!(utils$1.isUndefined(Se)||Se===null)&&W.append(ne===!0?renderKey([ge],we,oe):ne===null?ge:ge+"[]",ue(Se))}),!1}return isVisitable(me)?!0:(W.append(renderKey(ve,ge,oe),ue(me)),!1)}const pe=[],fe=Object.assign(predicates,{defaultVisitor:he,convertValue:ue,isVisitable});function be(me,ge){if(!utils$1.isUndefined(me)){if(pe.indexOf(me)!==-1)throw Error("Circular reference detected in "+ge.join("."));pe.push(me),utils$1.forEach(me,function(_e,ye){(!(utils$1.isUndefined(_e)||_e===null)&&re.call(W,_e,utils$1.isString(ye)?ye.trim():ye,ge,fe))===!0&&be(_e,ge?ge.concat(ye):[ye])}),pe.pop()}}if(!utils$1.isObject(J))throw new TypeError("data must be an object");return be(J),W}function encode$1(J){const W={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(J).replace(/[!'()~]|%20|%00/g,function(te){return W[te]})}function AxiosURLSearchParams(J,W){this._pairs=[],J&&toFormData$1(J,this,W)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(W,X){this._pairs.push([W,X])},prototype.toString=function(W){const X=W?function(te){return W.call(this,te,encode$1)}:encode$1;return this._pairs.map(function(re){return X(re[0])+"="+X(re[1])},"").join("&")};function encode(J){return encodeURIComponent(J).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function buildURL(J,W,X){if(!W)return J;const te=X&&X.encode||encode;utils$1.isFunction(X)&&(X={serialize:X});const re=X&&X.serialize;let oe;if(re?oe=re(W,X):oe=utils$1.isURLSearchParams(W)?W.toString():new AxiosURLSearchParams(W,X).toString(te),oe){const ne=J.indexOf("#");ne!==-1&&(J=J.slice(0,ne)),J+=(J.indexOf("?")===-1?"?":"&")+oe}return J}class InterceptorManager{constructor(){this.handlers=[]}use(W,X,te){return this.handlers.push({fulfilled:W,rejected:X,synchronous:te?te.synchronous:!1,runWhen:te?te.runWhen:null}),this.handlers.length-1}eject(W){this.handlers[W]&&(this.handlers[W]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(W){utils$1.forEach(this.handlers,function(te){te!==null&&W(te)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(J,W){return toFormData$1(J,new platform.classes.URLSearchParams,{visitor:function(X,te,re,oe){return platform.isNode&&utils$1.isBuffer(X)?(this.append(te,X.toString("base64")),!1):oe.defaultVisitor.apply(this,arguments)},...W})}function parsePropPath(J){return utils$1.matchAll(/\w+|\[(\w*)]/g,J).map(W=>W[0]==="[]"?"":W[1]||W[0])}function arrayToObject(J){const W={},X=Object.keys(J);let te;const re=X.length;let oe;for(te=0;te<re;te++)oe=X[te],W[oe]=J[oe];return W}function formDataToJSON(J){function W(X,te,re,oe){let ne=X[oe++];if(ne==="__proto__")return!0;const de=Number.isFinite(+ne),ce=oe>=X.length;return ne=!ne&&utils$1.isArray(re)?re.length:ne,ce?(utils$1.hasOwnProp(re,ne)?re[ne]=[re[ne],te]:re[ne]=te,!de):((!re[ne]||!utils$1.isObject(re[ne]))&&(re[ne]=[]),W(X,te,re[ne],oe)&&utils$1.isArray(re[ne])&&(re[ne]=arrayToObject(re[ne])),!de)}if(utils$1.isFormData(J)&&utils$1.isFunction(J.entries)){const X={};return utils$1.forEachEntry(J,(te,re)=>{W(parsePropPath(te),re,X,0)}),X}return null}function stringifySafely(J,W,X){if(utils$1.isString(J))try{return(W||JSON.parse)(J),utils$1.trim(J)}catch(te){if(te.name!=="SyntaxError")throw te}return(X||JSON.stringify)(J)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(W,X){const te=X.getContentType()||"",re=te.indexOf("application/json")>-1,oe=utils$1.isObject(W);if(oe&&utils$1.isHTMLForm(W)&&(W=new FormData(W)),utils$1.isFormData(W))return re?JSON.stringify(formDataToJSON(W)):W;if(utils$1.isArrayBuffer(W)||utils$1.isBuffer(W)||utils$1.isStream(W)||utils$1.isFile(W)||utils$1.isBlob(W)||utils$1.isReadableStream(W))return W;if(utils$1.isArrayBufferView(W))return W.buffer;if(utils$1.isURLSearchParams(W))return X.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),W.toString();let de;if(oe){if(te.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(W,this.formSerializer).toString();if((de=utils$1.isFileList(W))||te.indexOf("multipart/form-data")>-1){const ce=this.env&&this.env.FormData;return toFormData$1(de?{"files[]":W}:W,ce&&new ce,this.formSerializer)}}return oe||re?(X.setContentType("application/json",!1),stringifySafely(W)):W}],transformResponse:[function(W){const X=this.transitional||defaults.transitional,te=X&&X.forcedJSONParsing,re=this.responseType==="json";if(utils$1.isResponse(W)||utils$1.isReadableStream(W))return W;if(W&&utils$1.isString(W)&&(te&&!this.responseType||re)){const ne=!(X&&X.silentJSONParsing)&&re;try{return JSON.parse(W,this.parseReviver)}catch(de){if(ne)throw de.name==="SyntaxError"?AxiosError$1.from(de,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):de}}return W}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(W){return W>=200&&W<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],J=>{defaults.headers[J]={}});const ignoreDuplicateOf=utils$1.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=J=>{const W={};let X,te,re;return J&&J.split(`
133
+ }`)(J)},createBroker=()=>new Broker,LAST_WORKED_DIAGNOSTICS_KEY="lastWorkedDiagnostics",EVENTS_WITH_DIAGNOSTICS=["PROVES_ORDRES_CLINIQUES_CONSULTAR","RESULT_OC","LABORATORI_SEROTECA_PETICIO_CONSULTA","LABORATORI","ORDRE_TRACTAMENT","PRESCRIPCIO_ACTIVA","REV_IT","OC_EXPRES"];class EcapEventManager{}class EcapEventManagerImpl{constructor(W){this.globalStateManager=W}publish(W,X,te){const re=this.createEcapEvent(W,X,te??{});EVENTS_WITH_DIAGNOSTICS.includes(W)&&(re.DIAGNOSTICS=this.globalStateManager.getData(LAST_WORKED_DIAGNOSTICS_KEY)??[]),this.raiseEcapEvent(re)}createEcapEvent(W,X,te){return{TipusEvent:W,Accio:X,...te}}raiseEcapEvent(W){window.parent&&window.parent.postMessage(JSON.stringify(W),"*"),console.log("method",JSON.stringify(W))}}const createEcapEventManager=J=>new EcapEventManagerImpl(J);class ExitGuardManagerImpl{constructor(){this.guards=new Map}register(W,X){this.guards.set(W,X)}unregister(W){this.guards.delete(W)}async canExit(){for(const W of this.guards.values())try{if(!await W())return!1}catch(X){console.error("Exit guard failed:",X)}return!0}}class PrimariaGlobalStateManagerImpl{constructor(W){this.broker=W,this.state={}}setData(W,X){this.state[W]=X,this.broker.publish("data_set",{key:W,value:X})}getData(W){return this.state[W]}clearData(){this.state={}}}const createGlobalStateManager=J=>new PrimariaGlobalStateManagerImpl(J);function bind(J,W){return function(){return J.apply(W,arguments)}}const{toString}=Object.prototype,{getPrototypeOf:getPrototypeOf$1}=Object,{iterator,toStringTag}=Symbol,kindOf=(J=>W=>{const X=toString.call(W);return J[X]||(J[X]=X.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=J=>(J=J.toLowerCase(),W=>kindOf(W)===J),typeOfTest=J=>W=>typeof W===J,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(J){return J!==null&&!isUndefined(J)&&J.constructor!==null&&!isUndefined(J.constructor)&&isFunction$1(J.constructor.isBuffer)&&J.constructor.isBuffer(J)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(J){let W;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?W=ArrayBuffer.isView(J):W=J&&J.buffer&&isArrayBuffer(J.buffer),W}const isString$1=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=J=>J!==null&&typeof J=="object",isBoolean$1=J=>J===!0||J===!1,isPlainObject$2=J=>{if(kindOf(J)!=="object")return!1;const W=getPrototypeOf$1(J);return(W===null||W===Object.prototype||Object.getPrototypeOf(W)===null)&&!(toStringTag in J)&&!(iterator in J)},isEmptyObject=J=>{if(!isObject(J)||isBuffer(J))return!1;try{return Object.keys(J).length===0&&Object.getPrototypeOf(J)===Object.prototype}catch{return!1}},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=J=>isObject(J)&&isFunction$1(J.pipe),isFormData=J=>{let W;return J&&(typeof FormData=="function"&&J instanceof FormData||isFunction$1(J.append)&&((W=kindOf(J))==="formdata"||W==="object"&&isFunction$1(J.toString)&&J.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=J=>J.trim?J.trim():J.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(J,W,{allOwnKeys:X=!1}={}){if(J===null||typeof J>"u")return;let te,re;if(typeof J!="object"&&(J=[J]),isArray(J))for(te=0,re=J.length;te<re;te++)W.call(null,J[te],te,J);else{if(isBuffer(J))return;const oe=X?Object.getOwnPropertyNames(J):Object.keys(J),ne=oe.length;let de;for(te=0;te<ne;te++)de=oe[te],W.call(null,J[de],de,J)}}function findKey$1(J,W){if(isBuffer(J))return null;W=W.toLowerCase();const X=Object.keys(J);let te=X.length,re;for(;te-- >0;)if(re=X[te],W===re.toLowerCase())return re;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=J=>!isUndefined(J)&&J!==_global;function merge(){const{caseless:J,skipUndefined:W}=isContextDefined(this)&&this||{},X={},te=(re,oe)=>{const ne=J&&findKey$1(X,oe)||oe;isPlainObject$2(X[ne])&&isPlainObject$2(re)?X[ne]=merge(X[ne],re):isPlainObject$2(re)?X[ne]=merge({},re):isArray(re)?X[ne]=re.slice():(!W||!isUndefined(re))&&(X[ne]=re)};for(let re=0,oe=arguments.length;re<oe;re++)arguments[re]&&forEach(arguments[re],te);return X}const extend=(J,W,X,{allOwnKeys:te}={})=>(forEach(W,(re,oe)=>{X&&isFunction$1(re)?J[oe]=bind(re,X):J[oe]=re},{allOwnKeys:te}),J),stripBOM=J=>(J.charCodeAt(0)===65279&&(J=J.slice(1)),J),inherits=(J,W,X,te)=>{J.prototype=Object.create(W.prototype,te),J.prototype.constructor=J,Object.defineProperty(J,"super",{value:W.prototype}),X&&Object.assign(J.prototype,X)},toFlatObject=(J,W,X,te)=>{let re,oe,ne;const de={};if(W=W||{},J==null)return W;do{for(re=Object.getOwnPropertyNames(J),oe=re.length;oe-- >0;)ne=re[oe],(!te||te(ne,J,W))&&!de[ne]&&(W[ne]=J[ne],de[ne]=!0);J=X!==!1&&getPrototypeOf$1(J)}while(J&&(!X||X(J,W))&&J!==Object.prototype);return W},endsWith=(J,W,X)=>{J=String(J),(X===void 0||X>J.length)&&(X=J.length),X-=W.length;const te=J.indexOf(W,X);return te!==-1&&te===X},toArray=J=>{if(!J)return null;if(isArray(J))return J;let W=J.length;if(!isNumber(W))return null;const X=new Array(W);for(;W-- >0;)X[W]=J[W];return X},isTypedArray=(J=>W=>J&&W instanceof J)(typeof Uint8Array<"u"&&getPrototypeOf$1(Uint8Array)),forEachEntry=(J,W)=>{const te=(J&&J[iterator]).call(J);let re;for(;(re=te.next())&&!re.done;){const oe=re.value;W.call(J,oe[0],oe[1])}},matchAll=(J,W)=>{let X;const te=[];for(;(X=J.exec(W))!==null;)te.push(X);return te},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=J=>J.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(X,te,re){return te.toUpperCase()+re}),hasOwnProperty=(({hasOwnProperty:J})=>(W,X)=>J.call(W,X))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(J,W)=>{const X=Object.getOwnPropertyDescriptors(J),te={};forEach(X,(re,oe)=>{let ne;(ne=W(re,oe,J))!==!1&&(te[oe]=ne||re)}),Object.defineProperties(J,te)},freezeMethods=J=>{reduceDescriptors(J,(W,X)=>{if(isFunction$1(J)&&["arguments","caller","callee"].indexOf(X)!==-1)return!1;const te=J[X];if(isFunction$1(te)){if(W.enumerable=!1,"writable"in W){W.writable=!1;return}W.set||(W.set=()=>{throw Error("Can not rewrite read-only method '"+X+"'")})}})},toObjectSet=(J,W)=>{const X={},te=re=>{re.forEach(oe=>{X[oe]=!0})};return isArray(J)?te(J):te(String(J).split(W)),X},noop$1=()=>{},toFiniteNumber=(J,W)=>J!=null&&Number.isFinite(J=+J)?J:W;function isSpecCompliantForm(J){return!!(J&&isFunction$1(J.append)&&J[toStringTag]==="FormData"&&J[iterator])}const toJSONObject=J=>{const W=new Array(10),X=(te,re)=>{if(isObject(te)){if(W.indexOf(te)>=0)return;if(isBuffer(te))return te;if(!("toJSON"in te)){W[re]=te;const oe=isArray(te)?[]:{};return forEach(te,(ne,de)=>{const ce=X(ne,re+1);!isUndefined(ce)&&(oe[de]=ce)}),W[re]=void 0,oe}}return te};return X(J,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=J=>J&&(isObject(J)||isFunction$1(J))&&isFunction$1(J.then)&&isFunction$1(J.catch),_setImmediate=((J,W)=>J?setImmediate:W?((X,te)=>(_global.addEventListener("message",({source:re,data:oe})=>{re===_global&&oe===X&&te.length&&te.shift()()},!1),re=>{te.push(re),_global.postMessage(X,"*")}))(`axios@${Math.random()}`,[]):X=>setTimeout(X))(typeof setImmediate=="function",isFunction$1(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,isIterable=J=>J!=null&&isFunction$1(J[iterator]),utils$1={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString:isString$1,isNumber,isBoolean:isBoolean$1,isObject,isPlainObject:isPlainObject$2,isEmptyObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$1,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(J,W,X,te,re){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=J,this.name="AxiosError",W&&(this.code=W),X&&(this.config=X),te&&(this.request=te),re&&(this.response=re,this.status=re.status?re.status:null)}utils$1.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(J=>{descriptors[J]={value:J}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(J,W,X,te,re,oe)=>{const ne=Object.create(prototype$1);utils$1.toFlatObject(J,ne,function(he){return he!==Error.prototype},ue=>ue!=="isAxiosError");const de=J&&J.message?J.message:"Error",ce=W==null&&J?J.code:W;return AxiosError$1.call(ne,de,ce,X,te,re),J&&ne.cause==null&&Object.defineProperty(ne,"cause",{value:J,configurable:!0}),ne.name=J&&J.name||"Error",oe&&Object.assign(ne,oe),ne};const httpAdapter=null;function isVisitable(J){return utils$1.isPlainObject(J)||utils$1.isArray(J)}function removeBrackets(J){return utils$1.endsWith(J,"[]")?J.slice(0,-2):J}function renderKey(J,W,X){return J?J.concat(W).map(function(re,oe){return re=removeBrackets(re),!X&&oe?"["+re+"]":re}).join(X?".":""):W}function isFlatArray(J){return utils$1.isArray(J)&&!J.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(W){return/^is[A-Z]/.test(W)});function toFormData$1(J,W,X){if(!utils$1.isObject(J))throw new TypeError("target must be an object");W=W||new FormData,X=utils$1.toFlatObject(X,{metaTokens:!0,dots:!1,indexes:!1},!1,function(ge,ve){return!utils$1.isUndefined(ve[ge])});const te=X.metaTokens,re=X.visitor||he,oe=X.dots,ne=X.indexes,ce=(X.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(W);if(!utils$1.isFunction(re))throw new TypeError("visitor must be a function");function ue(me){if(me===null)return"";if(utils$1.isDate(me))return me.toISOString();if(utils$1.isBoolean(me))return me.toString();if(!ce&&utils$1.isBlob(me))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(me)||utils$1.isTypedArray(me)?ce&&typeof Blob=="function"?new Blob([me]):Buffer.from(me):me}function he(me,ge,ve){let _e=me;if(me&&!ve&&typeof me=="object"){if(utils$1.endsWith(ge,"{}"))ge=te?ge:ge.slice(0,-2),me=JSON.stringify(me);else if(utils$1.isArray(me)&&isFlatArray(me)||(utils$1.isFileList(me)||utils$1.endsWith(ge,"[]"))&&(_e=utils$1.toArray(me)))return ge=removeBrackets(ge),_e.forEach(function(Se,we){!(utils$1.isUndefined(Se)||Se===null)&&W.append(ne===!0?renderKey([ge],we,oe):ne===null?ge:ge+"[]",ue(Se))}),!1}return isVisitable(me)?!0:(W.append(renderKey(ve,ge,oe),ue(me)),!1)}const pe=[],fe=Object.assign(predicates,{defaultVisitor:he,convertValue:ue,isVisitable});function be(me,ge){if(!utils$1.isUndefined(me)){if(pe.indexOf(me)!==-1)throw Error("Circular reference detected in "+ge.join("."));pe.push(me),utils$1.forEach(me,function(_e,ye){(!(utils$1.isUndefined(_e)||_e===null)&&re.call(W,_e,utils$1.isString(ye)?ye.trim():ye,ge,fe))===!0&&be(_e,ge?ge.concat(ye):[ye])}),pe.pop()}}if(!utils$1.isObject(J))throw new TypeError("data must be an object");return be(J),W}function encode$1(J){const W={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(J).replace(/[!'()~]|%20|%00/g,function(te){return W[te]})}function AxiosURLSearchParams(J,W){this._pairs=[],J&&toFormData$1(J,this,W)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(W,X){this._pairs.push([W,X])},prototype.toString=function(W){const X=W?function(te){return W.call(this,te,encode$1)}:encode$1;return this._pairs.map(function(re){return X(re[0])+"="+X(re[1])},"").join("&")};function encode(J){return encodeURIComponent(J).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function buildURL(J,W,X){if(!W)return J;const te=X&&X.encode||encode;utils$1.isFunction(X)&&(X={serialize:X});const re=X&&X.serialize;let oe;if(re?oe=re(W,X):oe=utils$1.isURLSearchParams(W)?W.toString():new AxiosURLSearchParams(W,X).toString(te),oe){const ne=J.indexOf("#");ne!==-1&&(J=J.slice(0,ne)),J+=(J.indexOf("?")===-1?"?":"&")+oe}return J}class InterceptorManager{constructor(){this.handlers=[]}use(W,X,te){return this.handlers.push({fulfilled:W,rejected:X,synchronous:te?te.synchronous:!1,runWhen:te?te.runWhen:null}),this.handlers.length-1}eject(W){this.handlers[W]&&(this.handlers[W]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(W){utils$1.forEach(this.handlers,function(te){te!==null&&W(te)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(J,W){return toFormData$1(J,new platform.classes.URLSearchParams,{visitor:function(X,te,re,oe){return platform.isNode&&utils$1.isBuffer(X)?(this.append(te,X.toString("base64")),!1):oe.defaultVisitor.apply(this,arguments)},...W})}function parsePropPath(J){return utils$1.matchAll(/\w+|\[(\w*)]/g,J).map(W=>W[0]==="[]"?"":W[1]||W[0])}function arrayToObject(J){const W={},X=Object.keys(J);let te;const re=X.length;let oe;for(te=0;te<re;te++)oe=X[te],W[oe]=J[oe];return W}function formDataToJSON(J){function W(X,te,re,oe){let ne=X[oe++];if(ne==="__proto__")return!0;const de=Number.isFinite(+ne),ce=oe>=X.length;return ne=!ne&&utils$1.isArray(re)?re.length:ne,ce?(utils$1.hasOwnProp(re,ne)?re[ne]=[re[ne],te]:re[ne]=te,!de):((!re[ne]||!utils$1.isObject(re[ne]))&&(re[ne]=[]),W(X,te,re[ne],oe)&&utils$1.isArray(re[ne])&&(re[ne]=arrayToObject(re[ne])),!de)}if(utils$1.isFormData(J)&&utils$1.isFunction(J.entries)){const X={};return utils$1.forEachEntry(J,(te,re)=>{W(parsePropPath(te),re,X,0)}),X}return null}function stringifySafely(J,W,X){if(utils$1.isString(J))try{return(W||JSON.parse)(J),utils$1.trim(J)}catch(te){if(te.name!=="SyntaxError")throw te}return(X||JSON.stringify)(J)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(W,X){const te=X.getContentType()||"",re=te.indexOf("application/json")>-1,oe=utils$1.isObject(W);if(oe&&utils$1.isHTMLForm(W)&&(W=new FormData(W)),utils$1.isFormData(W))return re?JSON.stringify(formDataToJSON(W)):W;if(utils$1.isArrayBuffer(W)||utils$1.isBuffer(W)||utils$1.isStream(W)||utils$1.isFile(W)||utils$1.isBlob(W)||utils$1.isReadableStream(W))return W;if(utils$1.isArrayBufferView(W))return W.buffer;if(utils$1.isURLSearchParams(W))return X.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),W.toString();let de;if(oe){if(te.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(W,this.formSerializer).toString();if((de=utils$1.isFileList(W))||te.indexOf("multipart/form-data")>-1){const ce=this.env&&this.env.FormData;return toFormData$1(de?{"files[]":W}:W,ce&&new ce,this.formSerializer)}}return oe||re?(X.setContentType("application/json",!1),stringifySafely(W)):W}],transformResponse:[function(W){const X=this.transitional||defaults.transitional,te=X&&X.forcedJSONParsing,re=this.responseType==="json";if(utils$1.isResponse(W)||utils$1.isReadableStream(W))return W;if(W&&utils$1.isString(W)&&(te&&!this.responseType||re)){const ne=!(X&&X.silentJSONParsing)&&re;try{return JSON.parse(W,this.parseReviver)}catch(de){if(ne)throw de.name==="SyntaxError"?AxiosError$1.from(de,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):de}}return W}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(W){return W>=200&&W<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],J=>{defaults.headers[J]={}});const ignoreDuplicateOf=utils$1.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=J=>{const W={};let X,te,re;return J&&J.split(`
134
134
  `).forEach(function(ne){re=ne.indexOf(":"),X=ne.substring(0,re).trim().toLowerCase(),te=ne.substring(re+1).trim(),!(!X||W[X]&&ignoreDuplicateOf[X])&&(X==="set-cookie"?W[X]?W[X].push(te):W[X]=[te]:W[X]=W[X]?W[X]+", "+te:te)}),W},$internals=Symbol("internals");function normalizeHeader(J){return J&&String(J).trim().toLowerCase()}function normalizeValue(J){return J===!1||J==null?J:utils$1.isArray(J)?J.map(normalizeValue):String(J)}function parseTokens(J){const W=Object.create(null),X=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let te;for(;te=X.exec(J);)W[te[1]]=te[2];return W}const isValidHeaderName=J=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(J.trim());function matchHeaderValue(J,W,X,te,re){if(utils$1.isFunction(te))return te.call(this,W,X);if(re&&(W=X),!!utils$1.isString(W)){if(utils$1.isString(te))return W.indexOf(te)!==-1;if(utils$1.isRegExp(te))return te.test(W)}}function formatHeader(J){return J.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(W,X,te)=>X.toUpperCase()+te)}function buildAccessors(J,W){const X=utils$1.toCamelCase(" "+W);["get","set","has"].forEach(te=>{Object.defineProperty(J,te+X,{value:function(re,oe,ne){return this[te].call(this,W,re,oe,ne)},configurable:!0})})}let AxiosHeaders$1=class{constructor(W){W&&this.set(W)}set(W,X,te){const re=this;function oe(de,ce,ue){const he=normalizeHeader(ce);if(!he)throw new Error("header name must be a non-empty string");const pe=utils$1.findKey(re,he);(!pe||re[pe]===void 0||ue===!0||ue===void 0&&re[pe]!==!1)&&(re[pe||ce]=normalizeValue(de))}const ne=(de,ce)=>utils$1.forEach(de,(ue,he)=>oe(ue,he,ce));if(utils$1.isPlainObject(W)||W instanceof this.constructor)ne(W,X);else if(utils$1.isString(W)&&(W=W.trim())&&!isValidHeaderName(W))ne(parseHeaders(W),X);else if(utils$1.isObject(W)&&utils$1.isIterable(W)){let de={},ce,ue;for(const he of W){if(!utils$1.isArray(he))throw TypeError("Object iterator must return a key-value pair");de[ue=he[0]]=(ce=de[ue])?utils$1.isArray(ce)?[...ce,he[1]]:[ce,he[1]]:he[1]}ne(de,X)}else W!=null&&oe(X,W,te);return this}get(W,X){if(W=normalizeHeader(W),W){const te=utils$1.findKey(this,W);if(te){const re=this[te];if(!X)return re;if(X===!0)return parseTokens(re);if(utils$1.isFunction(X))return X.call(this,re,te);if(utils$1.isRegExp(X))return X.exec(re);throw new TypeError("parser must be boolean|regexp|function")}}}has(W,X){if(W=normalizeHeader(W),W){const te=utils$1.findKey(this,W);return!!(te&&this[te]!==void 0&&(!X||matchHeaderValue(this,this[te],te,X)))}return!1}delete(W,X){const te=this;let re=!1;function oe(ne){if(ne=normalizeHeader(ne),ne){const de=utils$1.findKey(te,ne);de&&(!X||matchHeaderValue(te,te[de],de,X))&&(delete te[de],re=!0)}}return utils$1.isArray(W)?W.forEach(oe):oe(W),re}clear(W){const X=Object.keys(this);let te=X.length,re=!1;for(;te--;){const oe=X[te];(!W||matchHeaderValue(this,this[oe],oe,W,!0))&&(delete this[oe],re=!0)}return re}normalize(W){const X=this,te={};return utils$1.forEach(this,(re,oe)=>{const ne=utils$1.findKey(te,oe);if(ne){X[ne]=normalizeValue(re),delete X[oe];return}const de=W?formatHeader(oe):String(oe).trim();de!==oe&&delete X[oe],X[de]=normalizeValue(re),te[de]=!0}),this}concat(...W){return this.constructor.concat(this,...W)}toJSON(W){const X=Object.create(null);return utils$1.forEach(this,(te,re)=>{te!=null&&te!==!1&&(X[re]=W&&utils$1.isArray(te)?te.join(", "):te)}),X}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([W,X])=>W+": "+X).join(`
135
135
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(W){return W instanceof this?W:new this(W)}static concat(W,...X){const te=new this(W);return X.forEach(re=>te.set(re)),te}static accessor(W){const te=(this[$internals]=this[$internals]={accessors:{}}).accessors,re=this.prototype;function oe(ne){const de=normalizeHeader(ne);te[de]||(buildAccessors(re,ne),te[de]=!0)}return utils$1.isArray(W)?W.forEach(oe):oe(W),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$1.reduceDescriptors(AxiosHeaders$1.prototype,({value:J},W)=>{let X=W[0].toUpperCase()+W.slice(1);return{get:()=>J,set(te){this[X]=te}}}),utils$1.freezeMethods(AxiosHeaders$1);function transformData(J,W){const X=this||defaults,te=W||X,re=AxiosHeaders$1.from(te.headers);let oe=te.data;return utils$1.forEach(J,function(de){oe=de.call(X,oe,re.normalize(),W?W.status:void 0)}),re.normalize(),oe}function isCancel$1(J){return!!(J&&J.__CANCEL__)}function CanceledError$1(J,W,X){AxiosError$1.call(this,J??"canceled",AxiosError$1.ERR_CANCELED,W,X),this.name="CanceledError"}utils$1.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(J,W,X){const te=X.config.validateStatus;!X.status||!te||te(X.status)?J(X):W(new AxiosError$1("Request failed with status code "+X.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(X.status/100)-4],X.config,X.request,X))}function parseProtocol(J){const W=/^([-+\w]{1,25})(:?\/\/|:)/.exec(J);return W&&W[1]||""}function speedometer(J,W){J=J||10;const X=new Array(J),te=new Array(J);let re=0,oe=0,ne;return W=W!==void 0?W:1e3,function(ce){const ue=Date.now(),he=te[oe];ne||(ne=ue),X[re]=ce,te[re]=ue;let pe=oe,fe=0;for(;pe!==re;)fe+=X[pe++],pe=pe%J;if(re=(re+1)%J,re===oe&&(oe=(oe+1)%J),ue-ne<W)return;const be=he&&ue-he;return be?Math.round(fe*1e3/be):void 0}}function throttle(J,W){let X=0,te=1e3/W,re,oe;const ne=(ue,he=Date.now())=>{X=he,re=null,oe&&(clearTimeout(oe),oe=null),J(...ue)};return[(...ue)=>{const he=Date.now(),pe=he-X;pe>=te?ne(ue,he):(re=ue,oe||(oe=setTimeout(()=>{oe=null,ne(re)},te-pe)))},()=>re&&ne(re)]}const progressEventReducer=(J,W,X=3)=>{let te=0;const re=speedometer(50,250);return throttle(oe=>{const ne=oe.loaded,de=oe.lengthComputable?oe.total:void 0,ce=ne-te,ue=re(ce),he=ne<=de;te=ne;const pe={loaded:ne,total:de,progress:de?ne/de:void 0,bytes:ce,rate:ue||void 0,estimated:ue&&de&&he?(de-ne)/ue:void 0,event:oe,lengthComputable:de!=null,[W?"download":"upload"]:!0};J(pe)},X)},progressEventDecorator=(J,W)=>{const X=J!=null;return[te=>W[0]({lengthComputable:X,total:J,loaded:te}),W[1]]},asyncDecorator=J=>(...W)=>utils$1.asap(()=>J(...W)),isURLSameOrigin=platform.hasStandardBrowserEnv?((J,W)=>X=>(X=new URL(X,platform.origin),J.protocol===X.protocol&&J.host===X.host&&(W||J.port===X.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(J,W,X,te,re,oe){const ne=[J+"="+encodeURIComponent(W)];utils$1.isNumber(X)&&ne.push("expires="+new Date(X).toGMTString()),utils$1.isString(te)&&ne.push("path="+te),utils$1.isString(re)&&ne.push("domain="+re),oe===!0&&ne.push("secure"),document.cookie=ne.join("; ")},read(J){const W=document.cookie.match(new RegExp("(^|;\\s*)("+J+")=([^;]*)"));return W?decodeURIComponent(W[3]):null},remove(J){this.write(J,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(J){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(J)}function combineURLs(J,W){return W?J.replace(/\/?\/$/,"")+"/"+W.replace(/^\/+/,""):J}function buildFullPath(J,W,X){let te=!isAbsoluteURL(W);return J&&(te||X==!1)?combineURLs(J,W):W}const headersToObject=J=>J instanceof AxiosHeaders$1?{...J}:J;function mergeConfig$2(J,W){W=W||{};const X={};function te(ue,he,pe,fe){return utils$1.isPlainObject(ue)&&utils$1.isPlainObject(he)?utils$1.merge.call({caseless:fe},ue,he):utils$1.isPlainObject(he)?utils$1.merge({},he):utils$1.isArray(he)?he.slice():he}function re(ue,he,pe,fe){if(utils$1.isUndefined(he)){if(!utils$1.isUndefined(ue))return te(void 0,ue,pe,fe)}else return te(ue,he,pe,fe)}function oe(ue,he){if(!utils$1.isUndefined(he))return te(void 0,he)}function ne(ue,he){if(utils$1.isUndefined(he)){if(!utils$1.isUndefined(ue))return te(void 0,ue)}else return te(void 0,he)}function de(ue,he,pe){if(pe in W)return te(ue,he);if(pe in J)return te(void 0,ue)}const ce={url:oe,method:oe,data:oe,baseURL:ne,transformRequest:ne,transformResponse:ne,paramsSerializer:ne,timeout:ne,timeoutMessage:ne,withCredentials:ne,withXSRFToken:ne,adapter:ne,responseType:ne,xsrfCookieName:ne,xsrfHeaderName:ne,onUploadProgress:ne,onDownloadProgress:ne,decompress:ne,maxContentLength:ne,maxBodyLength:ne,beforeRedirect:ne,transport:ne,httpAgent:ne,httpsAgent:ne,cancelToken:ne,socketPath:ne,responseEncoding:ne,validateStatus:de,headers:(ue,he,pe)=>re(headersToObject(ue),headersToObject(he),pe,!0)};return utils$1.forEach(Object.keys({...J,...W}),function(he){const pe=ce[he]||re,fe=pe(J[he],W[he],he);utils$1.isUndefined(fe)&&pe!==de||(X[he]=fe)}),X}const resolveConfig=J=>{const W=mergeConfig$2({},J);let{data:X,withXSRFToken:te,xsrfHeaderName:re,xsrfCookieName:oe,headers:ne,auth:de}=W;if(W.headers=ne=AxiosHeaders$1.from(ne),W.url=buildURL(buildFullPath(W.baseURL,W.url,W.allowAbsoluteUrls),J.params,J.paramsSerializer),de&&ne.set("Authorization","Basic "+btoa((de.username||"")+":"+(de.password?unescape(encodeURIComponent(de.password)):""))),utils$1.isFormData(X)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)ne.setContentType(void 0);else if(utils$1.isFunction(X.getHeaders)){const ce=X.getHeaders(),ue=["content-type","content-length"];Object.entries(ce).forEach(([he,pe])=>{ue.includes(he.toLowerCase())&&ne.set(he,pe)})}}if(platform.hasStandardBrowserEnv&&(te&&utils$1.isFunction(te)&&(te=te(W)),te||te!==!1&&isURLSameOrigin(W.url))){const ce=re&&oe&&cookies.read(oe);ce&&ne.set(re,ce)}return W},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(J){return new Promise(function(X,te){const re=resolveConfig(J);let oe=re.data;const ne=AxiosHeaders$1.from(re.headers).normalize();let{responseType:de,onUploadProgress:ce,onDownloadProgress:ue}=re,he,pe,fe,be,me;function ge(){be&&be(),me&&me(),re.cancelToken&&re.cancelToken.unsubscribe(he),re.signal&&re.signal.removeEventListener("abort",he)}let ve=new XMLHttpRequest;ve.open(re.method.toUpperCase(),re.url,!0),ve.timeout=re.timeout;function _e(){if(!ve)return;const Se=AxiosHeaders$1.from("getAllResponseHeaders"in ve&&ve.getAllResponseHeaders()),Ce={data:!de||de==="text"||de==="json"?ve.responseText:ve.response,status:ve.status,statusText:ve.statusText,headers:Se,config:J,request:ve};settle(function(De){X(De),ge()},function(De){te(De),ge()},Ce),ve=null}"onloadend"in ve?ve.onloadend=_e:ve.onreadystatechange=function(){!ve||ve.readyState!==4||ve.status===0&&!(ve.responseURL&&ve.responseURL.indexOf("file:")===0)||setTimeout(_e)},ve.onabort=function(){ve&&(te(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,J,ve)),ve=null)},ve.onerror=function(we){const Ce=we&&we.message?we.message:"Network Error",qe=new AxiosError$1(Ce,AxiosError$1.ERR_NETWORK,J,ve);qe.event=we||null,te(qe),ve=null},ve.ontimeout=function(){let we=re.timeout?"timeout of "+re.timeout+"ms exceeded":"timeout exceeded";const Ce=re.transitional||transitionalDefaults;re.timeoutErrorMessage&&(we=re.timeoutErrorMessage),te(new AxiosError$1(we,Ce.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,J,ve)),ve=null},oe===void 0&&ne.setContentType(null),"setRequestHeader"in ve&&utils$1.forEach(ne.toJSON(),function(we,Ce){ve.setRequestHeader(Ce,we)}),utils$1.isUndefined(re.withCredentials)||(ve.withCredentials=!!re.withCredentials),de&&de!=="json"&&(ve.responseType=re.responseType),ue&&([fe,me]=progressEventReducer(ue,!0),ve.addEventListener("progress",fe)),ce&&ve.upload&&([pe,be]=progressEventReducer(ce),ve.upload.addEventListener("progress",pe),ve.upload.addEventListener("loadend",be)),(re.cancelToken||re.signal)&&(he=Se=>{ve&&(te(!Se||Se.type?new CanceledError$1(null,J,ve):Se),ve.abort(),ve=null)},re.cancelToken&&re.cancelToken.subscribe(he),re.signal&&(re.signal.aborted?he():re.signal.addEventListener("abort",he)));const ye=parseProtocol(re.url);if(ye&&platform.protocols.indexOf(ye)===-1){te(new AxiosError$1("Unsupported protocol "+ye+":",AxiosError$1.ERR_BAD_REQUEST,J));return}ve.send(oe||null)})},composeSignals=(J,W)=>{const{length:X}=J=J?J.filter(Boolean):[];if(W||X){let te=new AbortController,re;const oe=function(ue){if(!re){re=!0,de();const he=ue instanceof Error?ue:this.reason;te.abort(he instanceof AxiosError$1?he:new CanceledError$1(he instanceof Error?he.message:he))}};let ne=W&&setTimeout(()=>{ne=null,oe(new AxiosError$1(`timeout ${W} of ms exceeded`,AxiosError$1.ETIMEDOUT))},W);const de=()=>{J&&(ne&&clearTimeout(ne),ne=null,J.forEach(ue=>{ue.unsubscribe?ue.unsubscribe(oe):ue.removeEventListener("abort",oe)}),J=null)};J.forEach(ue=>ue.addEventListener("abort",oe));const{signal:ce}=te;return ce.unsubscribe=()=>utils$1.asap(de),ce}},streamChunk=function*(J,W){let X=J.byteLength;if(X<W){yield J;return}let te=0,re;for(;te<X;)re=te+W,yield J.slice(te,re),te=re},readBytes=async function*(J,W){for await(const X of readStream(J))yield*streamChunk(X,W)},readStream=async function*(J){if(J[Symbol.asyncIterator]){yield*J;return}const W=J.getReader();try{for(;;){const{done:X,value:te}=await W.read();if(X)break;yield te}}finally{await W.cancel()}},trackStream=(J,W,X,te)=>{const re=readBytes(J,W);let oe=0,ne,de=ce=>{ne||(ne=!0,te&&te(ce))};return new ReadableStream({async pull(ce){try{const{done:ue,value:he}=await re.next();if(ue){de(),ce.close();return}let pe=he.byteLength;if(X){let fe=oe+=pe;X(fe)}ce.enqueue(new Uint8Array(he))}catch(ue){throw de(ue),ue}},cancel(ce){return de(ce),re.return()}},{highWaterMark:2})},DEFAULT_CHUNK_SIZE=64*1024,{isFunction}=utils$1,globalFetchAPI=(({Request:J,Response:W})=>({Request:J,Response:W}))(utils$1.global),{ReadableStream:ReadableStream$1,TextEncoder}=utils$1.global,test=(J,...W)=>{try{return!!J(...W)}catch{return!1}},factory=J=>{J=utils$1.merge.call({skipUndefined:!0},globalFetchAPI,J);const{fetch:W,Request:X,Response:te}=J,re=W?isFunction(W):typeof fetch=="function",oe=isFunction(X),ne=isFunction(te);if(!re)return!1;const de=re&&isFunction(ReadableStream$1),ce=re&&(typeof TextEncoder=="function"?(me=>ge=>me.encode(ge))(new TextEncoder):async me=>new Uint8Array(await new X(me).arrayBuffer())),ue=oe&&de&&test(()=>{let me=!1;const ge=new X(platform.origin,{body:new ReadableStream$1,method:"POST",get duplex(){return me=!0,"half"}}).headers.has("Content-Type");return me&&!ge}),he=ne&&de&&test(()=>utils$1.isReadableStream(new te("").body)),pe={stream:he&&(me=>me.body)};re&&["text","arrayBuffer","blob","formData","stream"].forEach(me=>{!pe[me]&&(pe[me]=(ge,ve)=>{let _e=ge&&ge[me];if(_e)return _e.call(ge);throw new AxiosError$1(`Response type '${me}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,ve)})});const fe=async me=>{if(me==null)return 0;if(utils$1.isBlob(me))return me.size;if(utils$1.isSpecCompliantForm(me))return(await new X(platform.origin,{method:"POST",body:me}).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(me)||utils$1.isArrayBuffer(me))return me.byteLength;if(utils$1.isURLSearchParams(me)&&(me=me+""),utils$1.isString(me))return(await ce(me)).byteLength},be=async(me,ge)=>{const ve=utils$1.toFiniteNumber(me.getContentLength());return ve??fe(ge)};return async me=>{let{url:ge,method:ve,data:_e,signal:ye,cancelToken:Se,timeout:we,onDownloadProgress:Ce,onUploadProgress:qe,responseType:De,headers:Pe,withCredentials:He="same-origin",fetchOptions:Ie}=resolveConfig(me),Ae=W||fetch;De=De?(De+"").toLowerCase():"text";let ze=composeSignals([ye,Se&&Se.toAbortSignal()],we),Me=null;const Ne=ze&&ze.unsubscribe&&(()=>{ze.unsubscribe()});let We;try{if(qe&&ue&&ve!=="get"&&ve!=="head"&&(We=await be(Pe,_e))!==0){let Le=new X(ge,{method:"POST",body:_e,duplex:"half"}),Ue;if(utils$1.isFormData(_e)&&(Ue=Le.headers.get("content-type"))&&Pe.setContentType(Ue),Le.body){const[Ve,Qe]=progressEventDecorator(We,progressEventReducer(asyncDecorator(qe)));_e=trackStream(Le.body,DEFAULT_CHUNK_SIZE,Ve,Qe)}}utils$1.isString(He)||(He=He?"include":"omit");const Ge=oe&&"credentials"in X.prototype,Ke={...Ie,signal:ze,method:ve.toUpperCase(),headers:Pe.normalize().toJSON(),body:_e,duplex:"half",credentials:Ge?He:void 0};Me=oe&&new X(ge,Ke);let ft=await(oe?Ae(Me,Ie):Ae(ge,Ke));const Je=he&&(De==="stream"||De==="response");if(he&&(Ce||Je&&Ne)){const Le={};["status","statusText","headers"].forEach(Xe=>{Le[Xe]=ft[Xe]});const Ue=utils$1.toFiniteNumber(ft.headers.get("content-length")),[Ve,Qe]=Ce&&progressEventDecorator(Ue,progressEventReducer(asyncDecorator(Ce),!0))||[];ft=new te(trackStream(ft.body,DEFAULT_CHUNK_SIZE,Ve,()=>{Qe&&Qe(),Ne&&Ne()}),Le)}De=De||"text";let Ze=await pe[utils$1.findKey(pe,De)||"text"](ft,me);return!Je&&Ne&&Ne(),await new Promise((Le,Ue)=>{settle(Le,Ue,{data:Ze,headers:AxiosHeaders$1.from(ft.headers),status:ft.status,statusText:ft.statusText,config:me,request:Me})})}catch(Ge){throw Ne&&Ne(),Ge&&Ge.name==="TypeError"&&/Load failed|fetch/i.test(Ge.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,me,Me),{cause:Ge.cause||Ge}):AxiosError$1.from(Ge,Ge&&Ge.code,me,Me)}}},seedCache=new Map,getFetch=J=>{let W=J?J.env:{};const{fetch:X,Request:te,Response:re}=W,oe=[te,re,X];let ne=oe.length,de=ne,ce,ue,he=seedCache;for(;de--;)ce=oe[de],ue=he.get(ce),ue===void 0&&he.set(ce,ue=de?new Map:factory(W)),he=ue;return ue};getFetch();const knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:{get:getFetch}};utils$1.forEach(knownAdapters,(J,W)=>{if(J){try{Object.defineProperty(J,"name",{value:W})}catch{}Object.defineProperty(J,"adapterName",{value:W})}});const renderReason=J=>`- ${J}`,isResolvedHandle=J=>utils$1.isFunction(J)||J===null||J===!1,adapters={getAdapter:(J,W)=>{J=utils$1.isArray(J)?J:[J];const{length:X}=J;let te,re;const oe={};for(let ne=0;ne<X;ne++){te=J[ne];let de;if(re=te,!isResolvedHandle(te)&&(re=knownAdapters[(de=String(te)).toLowerCase()],re===void 0))throw new AxiosError$1(`Unknown adapter '${de}'`);if(re&&(utils$1.isFunction(re)||(re=re.get(W))))break;oe[de||"#"+ne]=re}if(!re){const ne=Object.entries(oe).map(([ce,ue])=>`adapter ${ce} `+(ue===!1?"is not supported by the environment":"is not available in the build"));let de=X?ne.length>1?`since :
136
136
  `+ne.map(renderReason).join(`