itk-wasm
Version:
High-performance spatial analysis in a web browser, Node.js, and reproducible execution across programming languages and hardware architectures.
6 lines • 113 kB
JavaScript
var rr=Object.defineProperty;var or=(A,e)=>{for(var t in e)rr(A,t,{get:e[t],enumerable:!0})};var ir="1.0.0-b.188",nr=ir;var ar={Int8:"int8",UInt8:"uint8",Int16:"int16",UInt16:"uint16",Int32:"int32",UInt32:"uint32",Int64:"int64",UInt64:"uint64",SizeValueType:"uint64",IdentifierType:"uint64",IndexValueType:"int64",OffsetValueType:"int64"},d=ar;var sr={Float32:"float32",Float64:"float64",SpacePrecisionType:"float64"},h=sr;function Ir(A,e){let t=null;switch(A){case d.UInt8:{t=new Uint8Array(e);break}case d.Int8:{t=new Int8Array(e);break}case d.UInt16:{t=new Uint16Array(e);break}case d.Int16:{t=new Int16Array(e);break}case d.UInt32:{t=new Uint32Array(e);break}case d.Int32:{t=new Int32Array(e);break}case d.UInt64:{typeof globalThis.BigUint64Array=="function"?t=new BigUint64Array(e):t=new Uint8Array(e);break}case d.Int64:{typeof globalThis.BigInt64Array=="function"?t=new BigInt64Array(e):t=new Uint8Array(e);break}case h.Float32:{t=new Float32Array(e);break}case h.Float64:{t=new Float64Array(e);break}case"null":{t=null;break}case null:{t=null;break}default:throw new Error("Type is not supported as a TypedArray")}return t}var b=Ir;var gr={Unknown:"Unknown",Scalar:"Scalar",RGB:"RGB",RGBA:"RGBA",Offset:"Offset",Vector:"Vector",Point:"Point",CovariantVector:"CovariantVector",SymmetricSecondRankTensor:"SymmetricSecondRankTensor",DiffusionTensor3D:"DiffusionTensor3D",Complex:"Complex",FixedArray:"FixedArray",Array:"Array",Matrix:"Matrix",VariableLengthVector:"VariableLengthVector",VariableSizeMatrix:"VariableSizeMatrix"},U=gr;var HA=class{dimension;componentType;pixelType;components;constructor(e=2,t=d.UInt8,r=U.Scalar,o=1){this.dimension=e,this.componentType=t,this.pixelType=r,this.components=o}},MA=HA;function Cr(A,e,t,r,o){A[r+t*e]=o}var YA=Cr;var PA=class{imageType;name="Image";origin;spacing;direction;size;metadata;data;constructor(e=new MA){this.imageType=e;let t=e.dimension;this.origin=new Array(t),this.origin.fill(0),this.spacing=new Array(t),this.spacing.fill(1),this.direction=new Float64Array(t*t),this.direction.fill(0);for(let r=0;r<t;r++)YA(this.direction,t,r,r,1);this.size=new Array(t),this.size.fill(0),this.metadata=new Map,this.data=null}},K=PA;function Br(A){let e=new K(A.imageType);if(e.name=A.name,e.origin=Array.from(A.origin),e.spacing=Array.from(A.spacing),e.direction=A.direction.slice(),e.size=Array.from(A.size),A.data!==null){let t=A.data.constructor;e.data=new t(A.data.length),e.data!=null&&e.data.set(A.data,0)}return e}var OA=Br;var Qr=typeof globalThis.SharedArrayBuffer=="function";function Er(A){if(A.data===null)return A;if(Qr){if(A.data.buffer instanceof SharedArrayBuffer)return A;let e=new SharedArrayBuffer(A.data.buffer.byteLength),t=A.data.constructor,r=new t(e);return r!==null&&r.set(A.data,0),A.data=r,A}else return OA(A)}var cr=Er;function lr(A){if(A.length<1)throw Error("At least one images is required.");let e=A[0];if(e.data===null)throw Error("Image data is null.");let t=new K(e.imageType);t.origin=Array.from(e.origin),t.spacing=Array.from(e.spacing);let r=t.imageType.dimension;t.direction=e.direction.slice();let o=r-1;t.size=Array.from(e.size);let i=A.reduce((a,I)=>a+I.size[o],0);t.size[o]=i;let n=t.size.reduce((a,I)=>a*I,1)*t.imageType.components,g=e.data.constructor;t.data=new g(n);let Q=t.imageType.components;for(let a=0;a<t.size.length-1;a++)Q*=t.size[a];let B=0;if(t.data!=null)for(let a=0;a<A.length;a++)t.data.set(A[a].data,Q*B),B+=A[a].size[o];else throw Error("Could not create result image data.");return t}var fr=lr;function ur(A){let e=A.slice((A.lastIndexOf(".")-1>>>0)+2);if(e.toLowerCase()==="gz"){let t=A.slice(0,-3).lastIndexOf(".");e=A.slice((t-1>>>0)+2)}else if(e.toLowerCase()==="cbor"){let t=A.slice(0,-5).lastIndexOf(".");e=A.slice((t-1>>>0)+2)}else if(e.toLowerCase()==="zst"){let t=A.slice(0,-10).lastIndexOf(".");e=A.slice((t-1>>>0)+2)}else if(e.toLowerCase()==="zip"){let t=A.slice(0,-4).lastIndexOf(".");e=A.slice((t-1>>>0)+2)}return e}var dr=ur;function mr(A,e,t,r){return A[r+t*e]}var pr=mr;function yr(A,e){let t={...A.imageType};if(typeof e<"u"&&typeof e.pixelType<"u"&&(t.pixelType=e.pixelType,e.pixelType===U.Scalar&&t.components!==1))throw new Error("Cannot cast multi-component image to a scalar image");typeof e<"u"&&typeof e.componentType<"u"&&e.componentType!==A.imageType.componentType&&(t.componentType=e.componentType);let r=new K(t);if(r.name=A.name,r.origin=Array.from(A.origin),r.spacing=Array.from(A.spacing),r.direction=A.direction.slice(),r.size=Array.from(A.size),r.metadata=new Map(JSON.parse(JSON.stringify(Array.from(A.metadata)))),A.data!==null)if(typeof e<"u"&&typeof e.componentType<"u"&&e.componentType!==A.imageType.componentType)switch(A.imageType.componentType){case d.UInt8:case d.Int8:case d.UInt16:case d.Int16:case d.UInt32:case d.Int32:case h.Float32:case h.Float64:switch(r.imageType.componentType){case d.UInt8:r.data=new Uint8Array(A.data);break;case d.Int8:r.data=new Int8Array(A.data);break;case d.UInt16:r.data=new Uint16Array(A.data);break;case d.Int16:r.data=new Int16Array(A.data);break;case d.UInt32:r.data=new Uint32Array(A.data);break;case d.Int32:r.data=new Int32Array(A.data);break;case h.Float32:r.data=new Float32Array(A.data);break;case h.Float64:r.data=new Float64Array(A.data);break;case d.UInt64:r.data=new BigUint64Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=BigInt.asIntN(64,BigInt(A.data[o]));break;case d.Int64:r.data=new BigInt64Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=BigInt.asUintN(64,BigInt(A.data[o]));break}break;case d.UInt64:case d.Int64:switch(r.imageType.componentType){case d.UInt8:r.data=new Uint8Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case d.Int8:r.data=new Int8Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case d.UInt16:r.data=new Uint16Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case d.Int16:r.data=new Int16Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case d.UInt32:r.data=new Uint32Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case d.Int32:r.data=new Int32Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case h.Float32:r.data=new Float32Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case h.Float64:r.data=new Float64Array(A.data.length);for(let o=0;o<r.data.length;o++)r.data[o]=Number(A.data[o]);break;case d.UInt64:r.data=new BigUint64Array(A.data);break;case d.Int64:r.data=new BigInt64Array(A.data);break}break}else{let o=A.data.constructor;r.data=new o(A.data.length),r.data!=null&&r.data.set(A.data,0)}return r}var hr=yr;var qA=class{fcn;workerQueue;runInfo;constructor(e,t){this.fcn=t,this.workerQueue=new Array(e),this.workerQueue.fill(null),this.runInfo=[]}runTasks(e,t=null){let r={taskQueue:[],results:[],addingTasks:!1,postponed:!1,runningWorkers:0,index:0,completedTasks:0,progressCallback:t,canceled:!1};return this.runInfo.push(r),r.index=this.runInfo.length-1,{promise:new Promise((o,i)=>{r.resolve=o,r.reject=i,r.results=new Array(e.length),r.completedTasks=0,r.addingTasks=!0,e.forEach((n,g)=>{this.addTask(r.index,g,n)}),r.addingTasks=!1}),runId:r.index}}terminateWorkers(){for(let e=0;e<this.workerQueue.length;e++){let t=this.workerQueue[e];t?.terminate(),this.workerQueue[e]=null}}cancel(e){let t=this.runInfo[e];t!=null&&(t.canceled=!0)}addTask(e,t,r){let o=this.runInfo[e];if(o?.canceled===!0){o.reject("Remaining tasks canceled"),this.clearTask(o.index);return}if(this.workerQueue.length>0){let i=this.workerQueue.pop();o.runningWorkers++,r[r.length-1].webWorker=i,this.fcn(...r).then(({webWorker:n,...g})=>{if(this.workerQueue.push(n),this.runInfo[e]!==null){if(o.runningWorkers--,o.results[t]=g,o.completedTasks++,o.progressCallback!=null&&o.progressCallback(o.completedTasks,o.results.length),o.taskQueue.length>0){let Q=o.taskQueue.shift();this.addTask(e,Q[0],Q[1])}else if(!o.addingTasks&&o.runningWorkers===0){let Q=o.results;o.resolve(Q),this.clearTask(o.index)}}}).catch(n=>{o.reject(n),this.clearTask(o.index)})}else o.runningWorkers!==0||o.postponed?o.taskQueue.push([t,r]):(o.postponed=!0,setTimeout(()=>{o.postponed=!1,this.addTask(o.index,t,r)},50))}clearTask(e){this.runInfo[e].results=[],this.runInfo[e].taskQueue=[],this.runInfo[e].progressCallback=null,this.runInfo[e].canceled=null,this.runInfo[e].reject=()=>{},this.runInfo[e].resolve=()=>{}}},Dr=qA;var KA=class{dimension;pointComponentType;pointPixelComponentType;pointPixelType;pointPixelComponents;constructor(e=3,t=h.Float32,r=h.Float32,o=U.Scalar,i=1){this.dimension=e,this.pointComponentType=t,this.pointPixelComponentType=r,this.pointPixelType=o,this.pointPixelComponents=i}},WA=KA;var jA=class{pointSetType;name="PointSet";numberOfPoints;points;numberOfPointPixels;pointData;constructor(e=new WA){this.pointSetType=e,this.name="PointSet",this.numberOfPoints=0,this.points=null,this.numberOfPointPixels=0,this.pointData=null}},wr=jA;var VA=class{dimension;pointComponentType;pointPixelComponentType;pointPixelType;pointPixelComponents;cellComponentType;cellPixelComponentType;cellPixelType;cellPixelComponents;constructor(e=2,t=h.Float32,r=h.Float32,o=U.Scalar,i=1,n=d.Int32,g=h.Float32,Q=U.Scalar,B=1){this.dimension=e,this.pointComponentType=t,this.pointPixelComponentType=r,this.pointPixelType=o,this.pointPixelComponents=i,this.cellComponentType=n,this.cellPixelComponentType=g,this.cellPixelType=Q,this.cellPixelComponents=B}},zA=VA;var ZA=class{meshType;name="Mesh";numberOfPoints;points;numberOfPointPixels;pointData;numberOfCells;cells;cellBufferSize;numberOfCellPixels;cellData;constructor(e=new zA){this.meshType=e,this.name="Mesh",this.numberOfPoints=0,this.points=null,this.numberOfPointPixels=0,this.pointData=null,this.numberOfCells=0,this.cellBufferSize=0,this.cells=null,this.numberOfCellPixels=0,this.cellData=null}},Sr=ZA;var _A=class{pointPixelComponentType;pointPixelType;pointPixelComponents;cellPixelComponentType;cellPixelType;cellPixelComponents;constructor(e=h.Float32,t=U.Scalar,r=1,o=h.Float32,i=U.Scalar,n=1){this.pointPixelComponentType=e,this.pointPixelType=t,this.pointPixelComponents=r,this.cellPixelComponentType=o,this.cellPixelType=i,this.cellPixelComponents=n}},XA=_A;var vA=class{polyDataType;name="PolyData";numberOfPoints;points;verticesBufferSize;vertices;linesBufferSize;lines;polygonsBufferSize;polygons;triangleStripsBufferSize;triangleStrips;numberOfPointPixels;pointData;numberOfCellPixels;cellData;constructor(e=new XA){this.polyDataType=e,this.polyDataType=e,this.name="PolyData",this.numberOfPoints=0,this.points=new Float32Array,this.verticesBufferSize=0,this.vertices=null,this.linesBufferSize=0,this.lines=null,this.polygonsBufferSize=0,this.polygons=null,this.triangleStripsBufferSize=0,this.triangleStrips=null,this.numberOfPointPixels=0,this.pointData=null,this.numberOfCellPixels=0,this.cellData=null}},Fr=vA;var kr={Composite:"Composite",Identity:"Identity",Translation:"Translation",Euler2D:"Euler2D",Euler3D:"Euler3D",Rigid2D:"Rigid2D",Rigid3D:"Rigid3D",Rigid3DPerspective:"Rigid3DPerspective",Versor:"Versor",VersorRigid3D:"VersorRigid3D",Scale:"Scale",ScaleLogarithmic:"ScaleLogarithmic",ScaleSkewVersor3D:"ScaleSkewVersor3D",Similarity2D:"Similarity2D",Similarity3D:"Similarity3D",QuaternionRigid:"QuaternionRigid",Affine:"Affine",ScalableAffine:"ScalableAffine",AzimuthElevationToCartesian:"AzimuthElevationToCartesian",BSpline:"BSpline",BSplineSmoothingOnUpdateDisplacementField:"BSplineSmoothingOnUpdateDisplacementField",ConstantVelocityField:"ConstantVelocityField",DisplacementField:"DisplacementField",GaussianSmoothingOnUpdateDisplacementField:"GaussianSmoothingOnUpdateDisplacementField",GaussianExponentialDiffeomorphic:"GaussianExponentialDiffeomorphic",VelocityField:"VelocityField",TimeVaringVelocityField:"TimeVaringVelocityField",GaussianSmoothingOnUpdateTimeVaringVelocityField:"GaussianSmoothingOnUpdateTimeVaringVelocityField"},$A=kr;var Ae=class{transformParameterization;parametersValueType;inputDimension;outputDimension;constructor(e=$A.Identity,t=h.Float64,r=3,o=3){this.transformParameterization=e,this.parametersValueType=t,this.inputDimension=r,this.outputDimension=o}},ee=Ae;var te=class{transformType;numberOfFixedParameters;numberOfParameters;name="Transform";inputSpaceName;outputSpaceName;parameters;fixedParameters;constructor(e=new ee){this.transformType=e,this.numberOfFixedParameters=0,this.numberOfParameters=0,this.inputSpaceName="",this.outputSpaceName="",this.parameters=new Uint8Array(0),this.fixedParameters=new Uint8Array(0)}},Rr=te;var Ur={TextFile:"TextFile",BinaryFile:"BinaryFile",TextStream:"TextStream",BinaryStream:"BinaryStream",Image:"Image",PointSet:"PointSet",Mesh:"Mesh",PolyData:"PolyData",TransformList:"TransformList",JsonCompatible:"JsonCompatible"},y=Ur;var Ye=Symbol("Comlink.proxy"),Nr=Symbol("Comlink.endpoint"),ie=Symbol("Comlink.releaseProxy"),re=Symbol("Comlink.finalizer"),cA=Symbol("Comlink.thrown"),Pe=A=>typeof A=="object"&&A!==null||typeof A=="function",Gr={canHandle:A=>Pe(A)&&A[Ye],serialize(A){let{port1:e,port2:t}=new MessageChannel;return qe(A,e),[t,[t]]},deserialize(A){return A.start(),ne(A)}},br={canHandle:A=>Pe(A)&&cA in A,serialize({value:A}){let e;return A instanceof Error?e={isError:!0,value:{message:A.message,name:A.name,stack:A.stack}}:e={isError:!1,value:A},[e,[]]},deserialize(A){throw A.isError?Object.assign(new Error(A.value.message),A.value):A.value}},Oe=new Map([["proxy",Gr],["throw",br]]);function Lr(A,e){for(let t of A)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function qe(A,e=globalThis,t=["*"]){e.addEventListener("message",function r(o){if(!o||!o.data)return;if(!Lr(t,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}let{id:i,type:n,path:g}=Object.assign({path:[]},o.data),Q=(o.data.argumentList||[]).map(W),B;try{let a=g.slice(0,-1).reduce((l,C)=>l[C],A),I=g.reduce((l,C)=>l[C],A);switch(n){case"GET":B=I;break;case"SET":a[g.slice(-1)[0]]=W(o.data.value),B=!0;break;case"APPLY":B=I.apply(a,Q);break;case"CONSTRUCT":{let l=new I(...Q);B=Mr(l)}break;case"ENDPOINT":{let{port1:l,port2:C}=new MessageChannel;qe(A,C),B=ae(l,[l])}break;case"RELEASE":B=void 0;break;default:return}}catch(a){B={value:a,[cA]:0}}Promise.resolve(B).catch(a=>({value:a,[cA]:0})).then(a=>{let[I,l]=uA(a);e.postMessage(Object.assign(Object.assign({},I),{id:i}),l),n==="RELEASE"&&(e.removeEventListener("message",r),Ke(e),re in A&&typeof A[re]=="function"&&A[re]())}).catch(a=>{let[I,l]=uA({value:new TypeError("Unserializable return value"),[cA]:0});e.postMessage(Object.assign(Object.assign({},I),{id:i}),l)})}),e.start&&e.start()}function xr(A){return A.constructor.name==="MessagePort"}function Ke(A){xr(A)&&A.close()}function ne(A,e){return oe(A,[],e)}function EA(A){if(A)throw new Error("Proxy has been released and is not useable")}function We(A){return V(A,{type:"RELEASE"}).then(()=>{Ke(A)})}var lA=new WeakMap,fA="FinalizationRegistry"in globalThis&&new FinalizationRegistry(A=>{let e=(lA.get(A)||0)-1;lA.set(A,e),e===0&&We(A)});function Tr(A,e){let t=(lA.get(e)||0)+1;lA.set(e,t),fA&&fA.register(A,e,A)}function Jr(A){fA&&fA.unregister(A)}function oe(A,e=[],t=function(){}){let r=!1,o=new Proxy(t,{get(i,n){if(EA(r),n===ie)return()=>{Jr(o),We(A),r=!0};if(n==="then"){if(e.length===0)return{then:()=>o};let g=V(A,{type:"GET",path:e.map(Q=>Q.toString())}).then(W);return g.then.bind(g)}return oe(A,[...e,n])},set(i,n,g){EA(r);let[Q,B]=uA(g);return V(A,{type:"SET",path:[...e,n].map(a=>a.toString()),value:Q},B).then(W)},apply(i,n,g){EA(r);let Q=e[e.length-1];if(Q===Nr)return V(A,{type:"ENDPOINT"}).then(W);if(Q==="bind")return oe(A,e.slice(0,-1));let[B,a]=Me(g);return V(A,{type:"APPLY",path:e.map(I=>I.toString()),argumentList:B},a).then(W)},construct(i,n){EA(r);let[g,Q]=Me(n);return V(A,{type:"CONSTRUCT",path:e.map(B=>B.toString()),argumentList:g},Q).then(W)}});return Tr(o,A),o}function Hr(A){return Array.prototype.concat.apply([],A)}function Me(A){let e=A.map(uA);return[e.map(t=>t[0]),Hr(e.map(t=>t[1]))]}var je=new WeakMap;function ae(A,e){return je.set(A,e),A}function Mr(A){return Object.assign(A,{[Ye]:!0})}function uA(A){for(let[e,t]of Oe)if(t.canHandle(A)){let[r,o]=t.serialize(A);return[{type:"HANDLER",name:e,value:r},o]}return[{type:"RAW",value:A},je.get(A)||[]]}function W(A){switch(A.type){case"HANDLER":return Oe.get(A.name).deserialize(A.value);case"RAW":return A.value}}function V(A,e,t){return new Promise(r=>{let o=Yr();A.addEventListener("message",function i(n){!n.data||!n.data.id||n.data.id!==o||(A.removeEventListener("message",i),r(n.data))}),A.start&&A.start(),A.postMessage(Object.assign({id:o},e),t)})}function Yr(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function eA(A,e){return function(){return A.apply(e,arguments)}}var{toString:Pr}=Object.prototype,{getPrototypeOf:ge}=Object,mA=(A=>e=>{let t=Pr.call(e);return A[t]||(A[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),L=A=>(A=A.toLowerCase(),e=>mA(e)===A),pA=A=>e=>typeof e===A,{isArray:z}=Array,tA=pA("undefined");function Or(A){return A!==null&&!tA(A)&&A.constructor!==null&&!tA(A.constructor)&&N(A.constructor.isBuffer)&&A.constructor.isBuffer(A)}var _e=L("ArrayBuffer");function qr(A){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(A):e=A&&A.buffer&&_e(A.buffer),e}var Kr=pA("string"),N=pA("function"),Xe=pA("number"),yA=A=>A!==null&&typeof A=="object",Wr=A=>A===!0||A===!1,dA=A=>{if(mA(A)!=="object")return!1;let e=ge(A);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in A)&&!(Symbol.iterator in A)},jr=L("Date"),Vr=L("File"),zr=L("Blob"),Zr=L("FileList"),_r=A=>yA(A)&&N(A.pipe),Xr=A=>{let e;return A&&(typeof FormData=="function"&&A instanceof FormData||N(A.append)&&((e=mA(A))==="formdata"||e==="object"&&N(A.toString)&&A.toString()==="[object FormData]"))},vr=L("URLSearchParams"),[$r,Ao,eo,to]=["ReadableStream","Request","Response","Headers"].map(L),ro=A=>A.trim?A.trim():A.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rA(A,e,{allOwnKeys:t=!1}={}){if(A===null||typeof A>"u")return;let r,o;if(typeof A!="object"&&(A=[A]),z(A))for(r=0,o=A.length;r<o;r++)e.call(null,A[r],r,A);else{let i=t?Object.getOwnPropertyNames(A):Object.keys(A),n=i.length,g;for(r=0;r<n;r++)g=i[r],e.call(null,A[g],g,A)}}function ve(A,e){e=e.toLowerCase();let t=Object.keys(A),r=t.length,o;for(;r-- >0;)if(o=t[r],e===o.toLowerCase())return o;return null}var j=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$e=A=>!tA(A)&&A!==j;function Ie(){let{caseless:A}=$e(this)&&this||{},e={},t=(r,o)=>{let i=A&&ve(e,o)||o;dA(e[i])&&dA(r)?e[i]=Ie(e[i],r):dA(r)?e[i]=Ie({},r):z(r)?e[i]=r.slice():e[i]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&rA(arguments[r],t);return e}var oo=(A,e,t,{allOwnKeys:r}={})=>(rA(e,(o,i)=>{t&&N(o)?A[i]=eA(o,t):A[i]=o},{allOwnKeys:r}),A),io=A=>(A.charCodeAt(0)===65279&&(A=A.slice(1)),A),no=(A,e,t,r)=>{A.prototype=Object.create(e.prototype,r),A.prototype.constructor=A,Object.defineProperty(A,"super",{value:e.prototype}),t&&Object.assign(A.prototype,t)},ao=(A,e,t,r)=>{let o,i,n,g={};if(e=e||{},A==null)return e;do{for(o=Object.getOwnPropertyNames(A),i=o.length;i-- >0;)n=o[i],(!r||r(n,A,e))&&!g[n]&&(e[n]=A[n],g[n]=!0);A=t!==!1&&ge(A)}while(A&&(!t||t(A,e))&&A!==Object.prototype);return e},so=(A,e,t)=>{A=String(A),(t===void 0||t>A.length)&&(t=A.length),t-=e.length;let r=A.indexOf(e,t);return r!==-1&&r===t},Io=A=>{if(!A)return null;if(z(A))return A;let e=A.length;if(!Xe(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=A[e];return t},go=(A=>e=>A&&e instanceof A)(typeof Uint8Array<"u"&&ge(Uint8Array)),Co=(A,e)=>{let r=(A&&A[Symbol.iterator]).call(A),o;for(;(o=r.next())&&!o.done;){let i=o.value;e.call(A,i[0],i[1])}},Bo=(A,e)=>{let t,r=[];for(;(t=A.exec(e))!==null;)r.push(t);return r},Qo=L("HTMLFormElement"),Eo=A=>A.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,o){return r.toUpperCase()+o}),ze=(({hasOwnProperty:A})=>(e,t)=>A.call(e,t))(Object.prototype),co=L("RegExp"),At=(A,e)=>{let t=Object.getOwnPropertyDescriptors(A),r={};rA(t,(o,i)=>{let n;(n=e(o,i,A))!==!1&&(r[i]=n||o)}),Object.defineProperties(A,r)},lo=A=>{At(A,(e,t)=>{if(N(A)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let r=A[t];if(N(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},fo=(A,e)=>{let t={},r=o=>{o.forEach(i=>{t[i]=!0})};return z(A)?r(A):r(String(A).split(e)),t},uo=()=>{},mo=(A,e)=>A!=null&&Number.isFinite(A=+A)?A:e,se="abcdefghijklmnopqrstuvwxyz",Ze="0123456789",et={DIGIT:Ze,ALPHA:se,ALPHA_DIGIT:se+se.toUpperCase()+Ze},po=(A=16,e=et.ALPHA_DIGIT)=>{let t="",{length:r}=e;for(;A--;)t+=e[Math.random()*r|0];return t};function yo(A){return!!(A&&N(A.append)&&A[Symbol.toStringTag]==="FormData"&&A[Symbol.iterator])}var ho=A=>{let e=new Array(10),t=(r,o)=>{if(yA(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;let i=z(r)?[]:{};return rA(r,(n,g)=>{let Q=t(n,o+1);!tA(Q)&&(i[g]=Q)}),e[o]=void 0,i}}return r};return t(A,0)},Do=L("AsyncFunction"),wo=A=>A&&(yA(A)||N(A))&&N(A.then)&&N(A.catch),tt=((A,e)=>A?setImmediate:e?((t,r)=>(j.addEventListener("message",({source:o,data:i})=>{o===j&&i===t&&r.length&&r.shift()()},!1),o=>{r.push(o),j.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",N(j.postMessage)),So=typeof queueMicrotask<"u"?queueMicrotask.bind(j):typeof process<"u"&&process.nextTick||tt,s={isArray:z,isArrayBuffer:_e,isBuffer:Or,isFormData:Xr,isArrayBufferView:qr,isString:Kr,isNumber:Xe,isBoolean:Wr,isObject:yA,isPlainObject:dA,isReadableStream:$r,isRequest:Ao,isResponse:eo,isHeaders:to,isUndefined:tA,isDate:jr,isFile:Vr,isBlob:zr,isRegExp:co,isFunction:N,isStream:_r,isURLSearchParams:vr,isTypedArray:go,isFileList:Zr,forEach:rA,merge:Ie,extend:oo,trim:ro,stripBOM:io,inherits:no,toFlatObject:ao,kindOf:mA,kindOfTest:L,endsWith:so,toArray:Io,forEachEntry:Co,matchAll:Bo,isHTMLForm:Qo,hasOwnProperty:ze,hasOwnProp:ze,reduceDescriptors:At,freezeMethods:lo,toObjectSet:fo,toCamelCase:Eo,noop:uo,toFiniteNumber:mo,findKey:ve,global:j,isContextDefined:$e,ALPHABET:et,generateString:po,isSpecCompliantForm:yo,toJSONObject:ho,isAsyncFn:Do,isThenable:wo,setImmediate:tt,asap:So};function Z(A,e,t,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=A,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),o&&(this.response=o)}s.inherits(Z,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:s.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var rt=Z.prototype,ot={};["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(A=>{ot[A]={value:A}});Object.defineProperties(Z,ot);Object.defineProperty(rt,"isAxiosError",{value:!0});Z.from=(A,e,t,r,o,i)=>{let n=Object.create(rt);return s.toFlatObject(A,n,function(Q){return Q!==Error.prototype},g=>g!=="isAxiosError"),Z.call(n,A.message,e,t,r,o),n.cause=A,n.name=A.name,i&&Object.assign(n,i),n};var u=Z;var hA=null;function Ce(A){return s.isPlainObject(A)||s.isArray(A)}function nt(A){return s.endsWith(A,"[]")?A.slice(0,-2):A}function it(A,e,t){return A?A.concat(e).map(function(o,i){return o=nt(o),!t&&i?"["+o+"]":o}).join(t?".":""):e}function Fo(A){return s.isArray(A)&&!A.some(Ce)}var ko=s.toFlatObject(s,{},null,function(e){return/^is[A-Z]/.test(e)});function Ro(A,e,t){if(!s.isObject(A))throw new TypeError("target must be an object");e=e||new(hA||FormData),t=s.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,E){return!s.isUndefined(E[f])});let r=t.metaTokens,o=t.visitor||a,i=t.dots,n=t.indexes,Q=(t.Blob||typeof Blob<"u"&&Blob)&&s.isSpecCompliantForm(e);if(!s.isFunction(o))throw new TypeError("visitor must be a function");function B(c){if(c===null)return"";if(s.isDate(c))return c.toISOString();if(!Q&&s.isBlob(c))throw new u("Blob is not supported. Use a Buffer instead.");return s.isArrayBuffer(c)||s.isTypedArray(c)?Q&&typeof Blob=="function"?new Blob([c]):Buffer.from(c):c}function a(c,f,E){let p=c;if(c&&!E&&typeof c=="object"){if(s.endsWith(f,"{}"))f=r?f:f.slice(0,-2),c=JSON.stringify(c);else if(s.isArray(c)&&Fo(c)||(s.isFileList(c)||s.endsWith(f,"[]"))&&(p=s.toArray(c)))return f=nt(f),p.forEach(function(m,G){!(s.isUndefined(m)||m===null)&&e.append(n===!0?it([f],G,i):n===null?f:f+"[]",B(m))}),!1}return Ce(c)?!0:(e.append(it(E,f,i),B(c)),!1)}let I=[],l=Object.assign(ko,{defaultVisitor:a,convertValue:B,isVisitable:Ce});function C(c,f){if(!s.isUndefined(c)){if(I.indexOf(c)!==-1)throw Error("Circular reference detected in "+f.join("."));I.push(c),s.forEach(c,function(p,k){(!(s.isUndefined(p)||p===null)&&o.call(e,p,s.isString(k)?k.trim():k,f,l))===!0&&C(p,f?f.concat(k):[k])}),I.pop()}}if(!s.isObject(A))throw new TypeError("data must be an object");return C(A),e}var Y=Ro;function at(A){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(A).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function st(A,e){this._pairs=[],A&&Y(A,this,e)}var It=st.prototype;It.append=function(e,t){this._pairs.push([e,t])};It.toString=function(e){let t=e?function(r){return e.call(this,r,at)}:at;return this._pairs.map(function(o){return t(o[0])+"="+t(o[1])},"").join("&")};var DA=st;function Uo(A){return encodeURIComponent(A).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function oA(A,e,t){if(!e)return A;let r=t&&t.encode||Uo,o=t&&t.serialize,i;if(o?i=o(e,t):i=s.isURLSearchParams(e)?e.toString():new DA(e,t).toString(r),i){let n=A.indexOf("#");n!==-1&&(A=A.slice(0,n)),A+=(A.indexOf("?")===-1?"?":"&")+i}return A}var Be=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){s.forEach(this.handlers,function(r){r!==null&&e(r)})}},Qe=Be;var wA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var gt=typeof URLSearchParams<"u"?URLSearchParams:DA;var Ct=typeof FormData<"u"?FormData:null;var Bt=typeof Blob<"u"?Blob:null;var Qt={isBrowser:!0,classes:{URLSearchParams:gt,FormData:Ct,Blob:Bt},protocols:["http","https","file","blob","url","data"]};var ce={};or(ce,{hasBrowserEnv:()=>Ee,hasStandardBrowserEnv:()=>No,hasStandardBrowserWebWorkerEnv:()=>Go,origin:()=>bo});var Ee=typeof window<"u"&&typeof document<"u",No=(A=>Ee&&["ReactNative","NativeScript","NS"].indexOf(A)<0)(typeof navigator<"u"&&navigator.product),Go=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",bo=Ee&&window.location.href||"http://localhost";var F={...ce,...Qt};function le(A,e){return Y(A,new F.classes.URLSearchParams,Object.assign({visitor:function(t,r,o,i){return F.isNode&&s.isBuffer(t)?(this.append(r,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function Lo(A){return s.matchAll(/\w+|\[(\w*)]/g,A).map(e=>e[0]==="[]"?"":e[1]||e[0])}function xo(A){let e={},t=Object.keys(A),r,o=t.length,i;for(r=0;r<o;r++)i=t[r],e[i]=A[i];return e}function To(A){function e(t,r,o,i){let n=t[i++];if(n==="__proto__")return!0;let g=Number.isFinite(+n),Q=i>=t.length;return n=!n&&s.isArray(o)?o.length:n,Q?(s.hasOwnProp(o,n)?o[n]=[o[n],r]:o[n]=r,!g):((!o[n]||!s.isObject(o[n]))&&(o[n]=[]),e(t,r,o[n],i)&&s.isArray(o[n])&&(o[n]=xo(o[n])),!g)}if(s.isFormData(A)&&s.isFunction(A.entries)){let t={};return s.forEachEntry(A,(r,o)=>{e(Lo(r),o,t,0)}),t}return null}var SA=To;function Jo(A,e,t){if(s.isString(A))try{return(e||JSON.parse)(A),s.trim(A)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(A)}var fe={transitional:wA,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=s.isObject(e);if(i&&s.isHTMLForm(e)&&(e=new FormData(e)),s.isFormData(e))return o?JSON.stringify(SA(e)):e;if(s.isArrayBuffer(e)||s.isBuffer(e)||s.isStream(e)||s.isFile(e)||s.isBlob(e)||s.isReadableStream(e))return e;if(s.isArrayBufferView(e))return e.buffer;if(s.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let g;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return le(e,this.formSerializer).toString();if((g=s.isFileList(e))||r.indexOf("multipart/form-data")>-1){let Q=this.env&&this.env.FormData;return Y(g?{"files[]":e}:e,Q&&new Q,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),Jo(e)):e}],transformResponse:[function(e){let t=this.transitional||fe.transitional,r=t&&t.forcedJSONParsing,o=this.responseType==="json";if(s.isResponse(e)||s.isReadableStream(e))return e;if(e&&s.isString(e)&&(r&&!this.responseType||o)){let n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(g){if(n)throw g.name==="SyntaxError"?u.from(g,u.ERR_BAD_RESPONSE,this,null,this.response):g}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:F.classes.FormData,Blob:F.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};s.forEach(["delete","get","head","post","put","patch"],A=>{fe.headers[A]={}});var _=fe;var Ho=s.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"]),Et=A=>{let e={},t,r,o;return A&&A.split(`
`).forEach(function(n){o=n.indexOf(":"),t=n.substring(0,o).trim().toLowerCase(),r=n.substring(o+1).trim(),!(!t||e[t]&&Ho[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e};var ct=Symbol("internals");function iA(A){return A&&String(A).trim().toLowerCase()}function FA(A){return A===!1||A==null?A:s.isArray(A)?A.map(FA):String(A)}function Mo(A){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=t.exec(A);)e[r[1]]=r[2];return e}var Yo=A=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(A.trim());function ue(A,e,t,r,o){if(s.isFunction(r))return r.call(this,e,t);if(o&&(e=t),!!s.isString(e)){if(s.isString(r))return e.indexOf(r)!==-1;if(s.isRegExp(r))return r.test(e)}}function Po(A){return A.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function Oo(A,e){let t=s.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(A,r+t,{value:function(o,i,n){return this[r].call(this,e,o,i,n)},configurable:!0})})}var X=class{constructor(e){e&&this.set(e)}set(e,t,r){let o=this;function i(g,Q,B){let a=iA(Q);if(!a)throw new Error("header name must be a non-empty string");let I=s.findKey(o,a);(!I||o[I]===void 0||B===!0||B===void 0&&o[I]!==!1)&&(o[I||Q]=FA(g))}let n=(g,Q)=>s.forEach(g,(B,a)=>i(B,a,Q));if(s.isPlainObject(e)||e instanceof this.constructor)n(e,t);else if(s.isString(e)&&(e=e.trim())&&!Yo(e))n(Et(e),t);else if(s.isHeaders(e))for(let[g,Q]of e.entries())i(Q,g,r);else e!=null&&i(t,e,r);return this}get(e,t){if(e=iA(e),e){let r=s.findKey(this,e);if(r){let o=this[r];if(!t)return o;if(t===!0)return Mo(o);if(s.isFunction(t))return t.call(this,o,r);if(s.isRegExp(t))return t.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=iA(e),e){let r=s.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||ue(this,this[r],r,t)))}return!1}delete(e,t){let r=this,o=!1;function i(n){if(n=iA(n),n){let g=s.findKey(r,n);g&&(!t||ue(r,r[g],g,t))&&(delete r[g],o=!0)}}return s.isArray(e)?e.forEach(i):i(e),o}clear(e){let t=Object.keys(this),r=t.length,o=!1;for(;r--;){let i=t[r];(!e||ue(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){let t=this,r={};return s.forEach(this,(o,i)=>{let n=s.findKey(r,i);if(n){t[n]=FA(o),delete t[i];return}let g=e?Po(i):String(i).trim();g!==i&&delete t[i],t[g]=FA(o),r[g]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return s.forEach(this,(r,o)=>{r!=null&&r!==!1&&(t[o]=e&&s.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let r=new this(e);return t.forEach(o=>r.set(o)),r}static accessor(e){let r=(this[ct]=this[ct]={accessors:{}}).accessors,o=this.prototype;function i(n){let g=iA(n);r[g]||(Oo(o,n),r[g]=!0)}return s.isArray(e)?e.forEach(i):i(e),this}};X.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);s.reduceDescriptors(X.prototype,({value:A},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>A,set(r){this[t]=r}}});s.freezeMethods(X);var S=X;function nA(A,e){let t=this||_,r=e||t,o=S.from(r.headers),i=r.data;return s.forEach(A,function(g){i=g.call(t,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function aA(A){return!!(A&&A.__CANCEL__)}function lt(A,e,t){u.call(this,A??"canceled",u.ERR_CANCELED,e,t),this.name="CanceledError"}s.inherits(lt,u,{__CANCEL__:!0});var H=lt;function sA(A,e,t){let r=t.config.validateStatus;!t.status||!r||r(t.status)?A(t):e(new u("Request failed with status code "+t.status,[u.ERR_BAD_REQUEST,u.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function de(A){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(A);return e&&e[1]||""}function qo(A,e){A=A||10;let t=new Array(A),r=new Array(A),o=0,i=0,n;return e=e!==void 0?e:1e3,function(Q){let B=Date.now(),a=r[i];n||(n=B),t[o]=Q,r[o]=B;let I=i,l=0;for(;I!==o;)l+=t[I++],I=I%A;if(o=(o+1)%A,o===i&&(i=(i+1)%A),B-n<e)return;let C=a&&B-a;return C?Math.round(l*1e3/C):void 0}}var ft=qo;function Ko(A,e){let t=0,r=1e3/e,o,i,n=(B,a=Date.now())=>{t=a,o=null,i&&(clearTimeout(i),i=null),A.apply(null,B)};return[(...B)=>{let a=Date.now(),I=a-t;I>=r?n(B,a):(o=B,i||(i=setTimeout(()=>{i=null,n(o)},r-I)))},()=>o&&n(o)]}var ut=Ko;var v=(A,e,t=3)=>{let r=0,o=ft(50,250);return ut(i=>{let n=i.loaded,g=i.lengthComputable?i.total:void 0,Q=n-r,B=o(Q),a=n<=g;r=n;let I={loaded:n,total:g,progress:g?n/g:void 0,bytes:Q,rate:B||void 0,estimated:B&&g&&a?(g-n)/B:void 0,event:i,lengthComputable:g!=null,[e?"download":"upload"]:!0};A(I)},t)},me=(A,e)=>{let t=A!=null;return[r=>e[0]({lengthComputable:t,total:A,loaded:r}),e[1]]},pe=A=>(...e)=>s.asap(()=>A(...e));var dt=F.hasStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),r;function o(i){let n=i;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return r=o(window.location.href),function(n){let g=s.isString(n)?o(n):n;return g.protocol===r.protocol&&g.host===r.host}}():function(){return function(){return!0}}();var mt=F.hasStandardBrowserEnv?{write(A,e,t,r,o,i){let n=[A+"="+encodeURIComponent(e)];s.isNumber(t)&&n.push("expires="+new Date(t).toGMTString()),s.isString(r)&&n.push("path="+r),s.isString(o)&&n.push("domain="+o),i===!0&&n.push("secure"),document.cookie=n.join("; ")},read(A){let e=document.cookie.match(new RegExp("(^|;\\s*)("+A+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(A){this.write(A,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ye(A){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(A)}function he(A,e){return e?A.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):A}function IA(A,e){return A&&!ye(e)?he(A,e):e}var pt=A=>A instanceof S?{...A}:A;function x(A,e){e=e||{};let t={};function r(B,a,I){return s.isPlainObject(B)&&s.isPlainObject(a)?s.merge.call({caseless:I},B,a):s.isPlainObject(a)?s.merge({},a):s.isArray(a)?a.slice():a}function o(B,a,I){if(s.isUndefined(a)){if(!s.isUndefined(B))return r(void 0,B,I)}else return r(B,a,I)}function i(B,a){if(!s.isUndefined(a))return r(void 0,a)}function n(B,a){if(s.isUndefined(a)){if(!s.isUndefined(B))return r(void 0,B)}else return r(void 0,a)}function g(B,a,I){if(I in e)return r(B,a);if(I in A)return r(void 0,B)}let Q={url:i,method:i,data:i,baseURL:n,transformRequest:n,transformResponse:n,paramsSerializer:n,timeout:n,timeoutMessage:n,withCredentials:n,withXSRFToken:n,adapter:n,responseType:n,xsrfCookieName:n,xsrfHeaderName:n,onUploadProgress:n,onDownloadProgress:n,decompress:n,maxContentLength:n,maxBodyLength:n,beforeRedirect:n,transport:n,httpAgent:n,httpsAgent:n,cancelToken:n,socketPath:n,responseEncoding:n,validateStatus:g,headers:(B,a)=>o(pt(B),pt(a),!0)};return s.forEach(Object.keys(Object.assign({},A,e)),function(a){let I=Q[a]||o,l=I(A[a],e[a],a);s.isUndefined(l)&&I!==g||(t[a]=l)}),t}var kA=A=>{let e=x({},A),{data:t,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:n,auth:g}=e;e.headers=n=S.from(n),e.url=oA(IA(e.baseURL,e.url),A.params,A.paramsSerializer),g&&n.set("Authorization","Basic "+btoa((g.username||"")+":"+(g.password?unescape(encodeURIComponent(g.password)):"")));let Q;if(s.isFormData(t)){if(F.hasStandardBrowserEnv||F.hasStandardBrowserWebWorkerEnv)n.setContentType(void 0);else if((Q=n.getContentType())!==!1){let[B,...a]=Q?Q.split(";").map(I=>I.trim()).filter(Boolean):[];n.setContentType([B||"multipart/form-data",...a].join("; "))}}if(F.hasStandardBrowserEnv&&(r&&s.isFunction(r)&&(r=r(e)),r||r!==!1&&dt(e.url))){let B=o&&i&&mt.read(i);B&&n.set(o,B)}return e};var Wo=typeof XMLHttpRequest<"u",yt=Wo&&function(A){return new Promise(function(t,r){let o=kA(A),i=o.data,n=S.from(o.headers).normalize(),{responseType:g,onUploadProgress:Q,onDownloadProgress:B}=o,a,I,l,C,c;function f(){C&&C(),c&&c(),o.cancelToken&&o.cancelToken.unsubscribe(a),o.signal&&o.signal.removeEventListener("abort",a)}let E=new XMLHttpRequest;E.open(o.method.toUpperCase(),o.url,!0),E.timeout=o.timeout;function p(){if(!E)return;let m=S.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),q={data:!g||g==="text"||g==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:m,config:A,request:E};sA(function(J){t(J),f()},function(J){r(J),f()},q),E=null}"onloadend"in E?E.onloadend=p:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(p)},E.onabort=function(){E&&(r(new u("Request aborted",u.ECONNABORTED,A,E)),E=null)},E.onerror=function(){r(new u("Network Error",u.ERR_NETWORK,A,E)),E=null},E.ontimeout=function(){let G=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",q=o.transitional||wA;o.timeoutErrorMessage&&(G=o.timeoutErrorMessage),r(new u(G,q.clarifyTimeoutError?u.ETIMEDOUT:u.ECONNABORTED,A,E)),E=null},i===void 0&&n.setContentType(null),"setRequestHeader"in E&&s.forEach(n.toJSON(),function(G,q){E.setRequestHeader(q,G)}),s.isUndefined(o.withCredentials)||(E.withCredentials=!!o.withCredentials),g&&g!=="json"&&(E.responseType=o.responseType),B&&([l,c]=v(B,!0),E.addEventListener("progress",l)),Q&&E.upload&&([I,C]=v(Q),E.upload.addEventListener("progress",I),E.upload.addEventListener("loadend",C)),(o.cancelToken||o.signal)&&(a=m=>{E&&(r(!m||m.type?new H(null,A,E):m),E.abort(),E=null)},o.cancelToken&&o.cancelToken.subscribe(a),o.signal&&(o.signal.aborted?a():o.signal.addEventListener("abort",a)));let k=de(o.url);if(k&&F.protocols.indexOf(k)===-1){r(new u("Unsupported protocol "+k+":",u.ERR_BAD_REQUEST,A));return}E.send(i||null)})};var jo=(A,e)=>{let t=new AbortController,r,o=function(Q){if(!r){r=!0,n();let B=Q instanceof Error?Q:this.reason;t.abort(B instanceof u?B:new H(B instanceof Error?B.message:B))}},i=e&&setTimeout(()=>{o(new u(`timeout ${e} of ms exceeded`,u.ETIMEDOUT))},e),n=()=>{A&&(i&&clearTimeout(i),i=null,A.forEach(Q=>{Q&&(Q.removeEventListener?Q.removeEventListener("abort",o):Q.unsubscribe(o))}),A=null)};A.forEach(Q=>Q&&Q.addEventListener&&Q.addEventListener("abort",o));let{signal:g}=t;return g.unsubscribe=n,[g,()=>{i&&clearTimeout(i),i=null}]},ht=jo;var Vo=function*(A,e){let t=A.byteLength;if(!e||t<e){yield A;return}let r=0,o;for(;r<t;)o=r+e,yield A.slice(r,o),r=o},zo=async function*(A,e,t){for await(let r of A)yield*Vo(ArrayBuffer.isView(r)?r:await t(String(r)),e)},De=(A,e,t,r,o)=>{let i=zo(A,e,o),n=0,g,Q=B=>{g||(g=!0,r&&r(B))};return new ReadableStream({async pull(B){try{let{done:a,value:I}=await i.next();if(a){Q(),B.close();return}let l=I.byteLength;if(t){let C=n+=l;t(C)}B.enqueue(new Uint8Array(I))}catch(a){throw Q(a),a}},cancel(B){return Q(B),i.return()}},{highWaterMark:2})};var UA=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",wt=UA&&typeof ReadableStream=="function",we=UA&&(typeof TextEncoder=="function"?(A=>e=>A.encode(e))(new TextEncoder):async A=>new Uint8Array(await new Response(A).arrayBuffer())),St=(A,...e)=>{try{return!!A(...e)}catch{return!1}},Zo=wt&&St(()=>{let A=!1,e=new Request(F.origin,{body:new ReadableStream,method:"POST",get duplex(){return A=!0,"half"}}).headers.has("Content-Type");return A&&!e}),Dt=64*1024,Se=wt&&St(()=>s.isReadableStream(new Response("").body)),RA={stream:Se&&(A=>A.body)};UA&&(A=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!RA[e]&&(RA[e]=s.isFunction(A[e])?t=>t[e]():(t,r)=>{throw new u(`Response type '${e}' is not supported`,u.ERR_NOT_SUPPORT,r)})})})(new Response);var _o=async A=>{if(A==null)return 0;if(s.isBlob(A))return A.size;if(s.isSpecCompliantForm(A))return(await new Request(A).arrayBuffer()).byteLength;if(s.isArrayBufferView(A)||s.isArrayBuffer(A))return A.byteLength;if(s.isURLSearchParams(A)&&(A=A+""),s.isString(A))return(await we(A)).byteLength},Xo=async(A,e)=>{let t=s.toFiniteNumber(A.getContentLength());return t??_o(e)},Ft=UA&&(async A=>{let{url:e,method:t,data:r,signal:o,cancelToken:i,timeout:n,onDownloadProgress:g,onUploadProgress:Q,responseType:B,headers:a,withCredentials:I="same-origin",fetchOptions:l}=kA(A);B=B?(B+"").toLowerCase():"text";let[C,c]=o||i||n?ht([o,i],n):[],f,E,p=()=>{!f&&setTimeout(()=>{C&&C.unsubscribe()}),f=!0},k;try{if(Q&&Zo&&t!=="get"&&t!=="head"&&(k=await Xo(a,r))!==0){let T=new Request(e,{method:"POST",body:r,duplex:"half"}),J;if(s.isFormData(r)&&(J=T.headers.get("content-type"))&&a.setContentType(J),T.body){let[JA,QA]=me(k,v(pe(Q)));r=De(T.body,Dt,JA,QA,we)}}s.isString(I)||(I=I?"include":"omit"),E=new Request(e,{...l,signal:C,method:t.toUpperCase(),headers:a.normalize().toJSON(),body:r,duplex:"half",credentials:I});let m=await fetch(E),G=Se&&(B==="stream"||B==="response");if(Se&&(g||G)){let T={};["status","statusText","headers"].forEach(He=>{T[He]=m[He]});let J=s.toFiniteNumber(m.headers.get("content-length")),[JA,QA]=g&&me(J,v(pe(g),!0))||[];m=new Response(De(m.body,Dt,JA,()=>{QA&&QA(),G&&p()},we),T)}B=B||"text";let q=await RA[s.findKey(RA,B)||"text"](m,A);return!G&&p(),c&&c(),await new Promise((T,J)=>{sA(T,J,{data:q,headers:S.from(m.headers),status:m.status,statusText:m.statusText,config:A,request:E})})}catch(m){throw p(),m&&m.name==="TypeError"&&/fetch/i.test(m.message)?Object.assign(new u("Network Error",u.ERR_NETWORK,A,E),{cause:m.cause||m}):u.from(m,m&&m.code,A,E)}});var Fe={http:hA,xhr:yt,fetch:Ft};s.forEach(Fe,(A,e)=>{if(A){try{Object.defineProperty(A,"name",{value:e})}catch{}Object.defineProperty(A,"adapterName",{value:e})}});var kt=A=>`- ${A}`,vo=A=>s.isFunction(A)||A===null||A===!1,NA={getAdapter:A=>{A=s.isArray(A)?A:[A];let{length:e}=A,t,r,o={};for(let i=0;i<e;i++){t=A[i];let n;if(r=t,!vo(t)&&(r=Fe[(n=String(t)).toLowerCase()],r===void 0))throw new u(`Unknown adapter '${n}'`);if(r)break;o[n||"#"+i]=r}if(!r){let i=Object.entries(o).map(([g,Q])=>`adapter ${g} `+(Q===!1?"is not supported by the environment":"is not available in the build")),n=e?i.length>1?`since :
`+i.map(kt).join(`
`):" "+kt(i[0]):"as no adapter specified";throw new u("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r},adapters:Fe};function ke(A){if(A.cancelToken&&A.cancelToken.throwIfRequested(),A.signal&&A.signal.aborted)throw new H(null,A)}function GA(A){return ke(A),A.headers=S.from(A.headers),A.data=nA.call(A,A.transformRequest),["post","put","patch"].indexOf(A.method)!==-1&&A.headers.setContentType("application/x-www-form-urlencoded",!1),NA.getAdapter(A.adapter||_.adapter)(A).then(function(r){return ke(A),r.data=nA.call(A,A.transformResponse,r),r.headers=S.from(r.headers),r},function(r){return aA(r)||(ke(A),r&&r.response&&(r.response.data=nA.call(A,A.transformResponse,r.response),r.response.headers=S.from(r.response.headers))),Promise.reject(r)})}var bA="1.7.4";var Re={};["object","boolean","number","function","string","symbol"].forEach((A,e)=>{Re[A]=function(r){return typeof r===A||"a"+(e<1?"n ":" ")+A}});var Rt={};Re.transitional=function(e,t,r){function o(i,n){return"[Axios v"+bA+"] Transitional option '"+i+"'"+n+(r?". "+r:"")}return(i,n,g)=>{if(e===!1)throw new u(o(n," has been removed"+(t?" in "+t:"")),u.ERR_DEPRECATED);return t&&!Rt[n]&&(Rt[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,n,g):!0}};function $o(A,e,t){if(typeof A!="object")throw new u("options must be an object",u.ERR_BAD_OPTION_VALUE);let r=Object.keys(A),o=r.length;for(;o-- >0;){let i=r[o],n=e[i];if(n){let g=A[i],Q=g===void 0||n(g,i,A);if(Q!==!0)throw new u("option "+i+" must be "+Q,u.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new u("Unknown option "+i,u.ERR_BAD_OPTION)}}var LA={assertOptions:$o,validators:Re};var P=LA.validators,$=class{constructor(e){this.defaults=e,this.interceptors={request:new Qe,response:new Qe}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;let i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+i):r.stack=i}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=x(this.defaults,t);let{transitional:r,paramsSerializer:o,headers:i}=t;r!==void 0&&LA.assertOptions(r,{silentJSONParsing:P.transitional(P.boolean),forcedJSONParsing:P.transitional(P.boolean),clarifyTimeoutError:P.transitional(P.boolean)},!1),o!=null&&(s.isFunction(o)?t.paramsSerializer={serialize:o}:LA.assertOptions(o,{encode:P.function,serialize:P.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let n=i&&s.merge(i.common,i[t.method]);i&&s.forEach(["delete","get","head","post","put","patch","common"],c=>{delete i[c]}),t.headers=S.concat(n,i);let g=[],Q=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(t)===!1||(Q=Q&&f.synchronous,g.unshift(f.fulfilled,f.rejected))});let B=[];this.interceptors.response.forEach(function(f){B.push(f.fulfilled,f.rejected)});let a,I=0,l;if(!Q){let c=[GA.bind(this),void 0];for(c.unshift.apply(c,g),c.push.apply(c,B),l=c.length,a=Promise.resolve(t);I<l;)a=a.then(c[I++],c[I++]);return a}l=g.length;let C=t;for(I=0;I<l;){let c=g[I++],f=g[I++];try{C=c(C)}catch(E){f.call(this,E);break}}try{a=GA.call(this,C)}catch(c){return Promise.reject(c)}for(I=0,l=B.length;I<l;)a=a.then(B[I++],B[I++]);return a}getUri(e){e=x(this.defaults,e);let t=IA(e.baseURL,e.url);return oA(t,e.params,e.paramsSerializer)}};s.forEach(["delete","get","head","options"],function(e){$.prototype[e]=function(t,r){return this.request(x(r||{},{method:e,url:t,data:(r||{}).data}))}});s.forEach(["post","put","patch"],function(e){function t(r){return function(i,n,g){return this.request(x(g||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}$.prototype[e]=t(),$.prototype[e+"Form"]=t(!0)});var gA=$;var Ue=class A{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});let r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i,n=new Promise(g=>{r.subscribe(g),i=g}).then(o);return n.cancel=function(){r.unsubscribe(i)},n},e(function(i,n,g){r.reason||(r.reason=new H(i,n,g),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new A(function(o){e=o}),cancel:e}}},Ut=Ue;function Ne(A){return function(t){return A.apply(null,t)}}function Ge(A){return s.isObject(A)&&A.isAxiosError===!0}var be={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:40