@zyzgroup/core-web 0.0.79 → 0.0.80
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/zyzgroup_core_web.iife.js +14 -14
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +962 -995
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +14 -14
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/types/animate/Clock.d.ts.map +1 -1
- package/types/animate/Timeline.d.ts +7 -5
- package/types/animate/Timeline.d.ts.map +1 -1
- package/types/dom/DOMEventBus.d.ts +1 -1
- package/types/dom/DOMEventBus.d.ts.map +1 -1
- package/types/theme.d.ts.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(m,me){typeof exports=="object"&&typeof module<"u"?me(exports):typeof define=="function"&&define.amd?define(["exports"],me):(m=typeof globalThis<"u"?globalThis:m||self,me(m.ZYZGroupCoreWeb={}))})(this,function(m){"use strict";function me(){return typeof window<"u"?window:typeof global<"u"?global:this||{}}const
|
|
1
|
+
(function(m,me){typeof exports=="object"&&typeof module<"u"?me(exports):typeof define=="function"&&define.amd?define(["exports"],me):(m=typeof globalThis<"u"?globalThis:m||self,me(m.ZYZGroupCoreWeb={}))})(this,function(m){"use strict";function me(){return typeof window<"u"?window:typeof global<"u"?global:this||{}}const sn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Ze(i){this.message=i}Ze.prototype=new Error,Ze.prototype.name="InvalidCharacterError";function La(i){const t=String(i);let e="";for(let s,n,r=0,a=sn;t.charAt(r|0)||(a="=",r%1);e+=a.charAt(63&s>>8-r%1*8)){if(n=t.charCodeAt(r+=3/4),n>255)throw new Ze("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");s=s<<8|n}return e}function Ra(i){const t=String(i).replace(/[=]+$/,"");if(t.length%4===1)throw new Ze("'atob' failed: The string to be decoded is not correctly encoded.");let e="";for(let s=0,n,r,a=0;r=t.charAt(a++);~r&&(n=s%4?n*64+r:r,s++%4)?e+=String.fromCharCode(255&n>>(-2*s&6)):0)r=sn.indexOf(r);return e}class Ke{maps=new Map;mapsAddedDuringUpdate=new Map;constructor(){}entries(){return Array.from(this.maps.entries())}keys(){return Array.from(this.maps.keys())}values(){return Array.from(this.maps.values())}get length(){return this.entries().length}set(t,e){this.maps.set(t,e),this.mapsAddedDuringUpdate.set(t,e)}get(t){return this.maps.get(t)}shift(){const t=this.entries();if(t.length){const[e,s]=t[0];return this.delete(e),[e,s]}}delete(t){return this.mapsAddedDuringUpdate.delete(t),this.maps.delete(t)}deleteAll(){this.maps=new Map,this.mapsAddedDuringUpdate=new Map}filter(t){let e=Array.from(this.maps.entries());for(;e.length>0;){this.mapsAddedDuringUpdate=new Map;for(let s=0,n=e.length;s<n;s++){const[r,a]=e[s];t(r,a)===!1&&this.delete(r)}e=Array.from(this.mapsAddedDuringUpdate.entries())}}}const pe=new Ke,Qe=i=>{let t=null;switch(i){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/;break;case"oct":t=/^(0o)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"ascii":t=/^[\x00-\xFF]+$/i;break;case"int":t=/^[-+]?[0-9]+$/;break;case"number":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;break;case"number-single":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/i;break;case"split":t=/\s*,\s*/gi;break;case"regexp":t=/[\\^$.*+?()[\]{}|]/g;break;case"regexp-flags":t=/\w*$/;break;case"native-method":t=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(Qe("regexp"),"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^\+[1-9]{1}[0-9]{10}$/g;break;case"phone-number":t=/^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/gi;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+\@[A-Za-z0-9._-]+\.[A-Za-z0-9]+$/gm;break;case"ip":t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;break;case"url":t=/^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;break;case"date":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})$/;break;case"time":t=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"datetime":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"whitespace":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]/g;break;case"commaSpaces":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/;break;case"trim":t=/^\s+|\s+$/g;break;case"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i;break;case"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;break;case"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;break;case"hex-color":t=/^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;break;case"color":t=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i;break;case"bezier":t=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/;break;case"chinese-name":t=/^(?:[\u4e00-\u9fa5·]{2,16})$/;break;case"chinese":t=new RegExp(String.raw`
|
|
2
2
|
[\u{FA0E}\u{FA0F}\u{FA11}\u{FA13}\u{FA14}\u{FA1F}\u{FA21}\u{FA23}\u{FA24}\u{FA27}-\u{FA29}]
|
|
3
3
|
|[\u{4E00}-\u{9FCC}]
|
|
4
4
|
|[\u{3400}-\u{4DB5}]
|
|
@@ -7,40 +7,40 @@
|
|
|
7
7
|
|[\u{2B740}-\u{2B81D}]
|
|
8
8
|
|[\u{2B820}-\u{2CEAF}]
|
|
9
9
|
|[\u{2CEB0}-\u{2EBEF}]
|
|
10
|
-
`.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},Ot=(i,t)=>(typeof i=="string"&&(i=Qe(i)||new RegExp(i)),i.test(t)),sn=(i,t)=>{if(typeof i=="string"&&(i=Qe(i)||new RegExp(i)),!t)return null;const e=t.match(i);return e?i.flags.toLowerCase().indexOf("g")>=0?e.map(s=>({matchIndex:-1,fullMatch:s,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},nn=(i,t)=>{typeof i=="string"&&(i=Qe(i)||new RegExp(i));const e=[],s=t.matchAll(i);for(const n of s)e.push({matchIndex:typeof n.index=="number"?n.index:-1,fullMatch:n[0],groupMatchs:n.slice(1)});return e};function rn(i){const t=i.match(/[\s\S]/gu);return t?t.length:0}function an(i,t){const e=i.codePointAt(t);return e?String.fromCodePoint(e):void 0}const Q=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function zs(){const i=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(Q[i&255]+Q[i>>8&255]+Q[i>>16&255]+Q[i>>24&255]+"-"+Q[t&255]+Q[t>>8&255]+"-"+Q[t>>16&15|64]+Q[t>>24&255]+"-"+Q[e&63|128]+Q[e>>8&255]+"-"+Q[e>>16&255]+Q[e>>24&255]+Q[s&255]+Q[s>>8&255]+Q[s>>16&255]+Q[s>>24&255]).toLowerCase()}function Ra(i){const t=pe.get(i);if(t)return t;const e=i.replace(/(^\w)/g,function(s){return s.toLowerCase()});return pe.set(i,e),e}const ct=(i,t="-")=>{const e=pe.get(i);if(e)return e;let s=i.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return s=s.replace(new RegExp(`^${t}`),""),pe.set(i,s),s};function qs(i){const t=pe.get(i);if(t)return t;const e=i.replace(/(^\w|[_-]\w)/g,function(s){return s.slice(-1).toUpperCase()});return pe.set(i,e),e}function on(i){return Ra(qs(i))}function Oa(i,t,e="0",s="left"){const n=rn(i);if(t>n){const r=t-n;let a,o;switch(s){case"left":i=Array(r+1).join(e)+i;break;case"right":i=i+Array(r+1).join(e);break;default:a=Math.ceil(r/2),o=r-a,i=Array(o+1).join(e)+i+Array(a+1).join(e);break}}return i}function hn(i){let t="";for(let e=0,s=i.length;e<s;e++){const n=i.charCodeAt(e);n>=1&&n<=127?t+=i.charAt(e):n>2047?(t+=String.fromCharCode(224|n>>12&15),t+=String.fromCharCode(128|n>>6&63),t+=String.fromCharCode(128|n>>0&63)):(t+=String.fromCharCode(192|n>>6&31),t+=String.fromCharCode(128|n>>0&63))}return t}var Nt=(i=>(i.UNKNOWN="",i.HTML="text/html",i.CSS="text/css",i.TEXT="text/plain",i.MD="text/plain",i.JPEG="image/jpeg",i.PNG="image/png",i.GIF="image/gif",i.WEBP="image/webp",i.SVG="image/svg+xml",i.ICO="image/x-icon",i.MPEG="audio/mpeg",i.MP3="audio/mpeg",i.OGG="audio/ogg",i.WAV="audio/wav",i.MP4="video/mp4",i.WEBM="video/webm",i.JSON="application/json",i.XWWW="application/x-www-form-urlencoded",i.XHTML="application/xhtml+xml",i.XML="application/xml",i.XML_TEXT="text/xml",i.JAVASCRIPT="application/javascript",i.ECMASCRIPT="application/ecmascript",i.DOC="application/msword",i.CSV="application/x-csv",i.EXCEL="application/vnb.ms-excel",i.PDF="application/pdf",i.ZIP="application/zip",i.TGZ="application/x-gtar",i.TAR_GZ="application/x-gzip",i.EOT="appliaction/vnd.ms-fontobject",i.TTF="aplication/font-sfnt",i))(Nt||{});const Na=(i,t=16)=>i.toString(t),ae=(i,t=16)=>{let e=i.toLowerCase();const s=e.indexOf("0b")==0,n=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||n||r)&&(e=e.slice(2));const a=parseInt(e,t);if(isNaN(a))throw new Error(`radixStringToNumber(${i}, ${t}) 无法解析!`);return a};function ts(i,t){if(i instanceof ArrayBuffer)return Array.from(new Uint8Array(i));let e=[];if(Array.isArray(i))return i.forEach(s=>{typeof s=="number"?e.push(s):e=e.concat(ts(s,t))}),e;if(typeof i=="number")for(;i>0;){const s=i&255;e.unshift(s),i=(i-s)/256}if(typeof i=="string")if(t){let s=i.toLowerCase();switch(t){case 16:default:s.indexOf("0x")==0&&(s=s.slice(2));for(let n=0,r=s.length;n<r;n+=2)e.push(ae(s.slice(n,n+2),t));break}}else for(const s of i){const n=s.codePointAt(0);n&&e.push(n)}return e}function Fa(i,t){if(i instanceof ArrayBuffer)return i;const e=ts(i,t);return new Uint8Array(e).buffer}function Ba(i,t){const e=ts(i,t);return String.fromCodePoint.apply(null,e)}function Xa(i,t){const e=ts(i,t);let s="";for(let n=0,r=e.length;n<r;n++)s+=Na(e[n],16).padStart(2,"0");return s}function Ya(){const i=Uint32Array.of(305419896),t=new Uint8Array(i.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const cn=i=>{let t=Nt.UNKNOWN;switch(new DataView(i).getUint32(0,Ya()).toString(16).toUpperCase()){case"FFD8FFDB":t=Nt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Nt.JPEG;break;case"89504E47":t=Nt.PNG;break;case"47494638":t=Nt.GIF;break;case"52494646":t=Nt.WEBP;break;case"25504446":t=Nt.PDF;break;case"504B0304":t=Nt.ZIP;break}return t};let Ee;class Ua{subscribers;constructor(){this.subscribers=new Set}add(){Ee&&!this.subscribers.has(Ee)&&this.subscribers.add(Ee)}notify(){this.subscribers.forEach(t=>t())}}const ln=new WeakMap;function un(i,t){let e=ln.get(i);e||(e=new Map,ln.set(i,e));let s=e.get(t);return s||(s=new Ua,e.set(t,s)),s}function Hs(i){Ee=i,i(),Ee=null}const Ga=Symbol("isProxy");function Va(i){return new Proxy(i,{get(t,e,s){return e===Ga?!0:(un(i,e).add(),Reflect.get(t,e,s))},set(t,e,s,n){const r=un(i,e);return i[e]!=s&&(i[e]=s,r.notify()),Reflect.set(t,e,s,n)}})}const za=Va,qa="[object Object]";function Ha(i){return Object.prototype.toString.call(i)}function ja(i){return i!=null}function dn(i){return Ha(i)===qa}function Wa(i,...t){return new i.constructor(...t)}function fn(i,t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(dn(t[e])?(typeof i[e]>"u"&&(i[e]={}),fn(i[e],t[e])):typeof i[e]>"u"&&(i[e]=t[e]));return i}function mn(i,t){for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&!t(e,i[e])&&delete i[e];return i}function Te(i,t){const e=i.findIndex(s=>s===t);return e>=0&&i.splice(e,1),i}let pn;try{pn=Map}catch{pn=function(){}}let gn;try{gn=Set}catch{gn=function(){}}function jt(i,t){if(i=parseFloat(i),isNaN(i)){if(typeof t=="number")return t;throw new Error(`parseNumber(${i}) isNaN!`)}return i}function es(i,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(i-t)<e}const yt=(i,t,e)=>i<t?t:i>e?e:i,$a=(i,t,e)=>s=>{const n=Math.min(Math.max(i,s),t);return t-n<e?t:Math.round(n/e)*e};function Ja(i,t=12){return jt(i).toFixed(t)}function Et(i,t=12){return+Ja(i,t)}function js(i,t){const e=sn("number-single",String(i));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):ja(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?i.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?i.substring(e.matchIndex+e.fullMatch.length):""}}function yn(i){const t=sn("number",i);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}Za();function Za(){const i=new ArrayBuffer(4),t=new Float32Array(i),e=new Uint32Array(i),s=new Uint32Array(512),n=new Uint32Array(512);for(let h=0;h<256;++h){const c=h-127;c<-27?(s[h]=0,s[h|256]=32768,n[h]=24,n[h|256]=24):c<-14?(s[h]=1024>>-c-14,s[h|256]=1024>>-c-14|32768,n[h]=-c-1,n[h|256]=-c-1):c<=15?(s[h]=c+15<<10,s[h|256]=c+15<<10|32768,n[h]=13,n[h|256]=13):c<128?(s[h]=31744,s[h|256]=64512,n[h]=24,n[h|256]=24):(s[h]=31744,s[h|256]=64512,n[h]=13,n[h|256]=13)}const r=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let h=1;h<1024;++h){let c=h<<13,l=0;for(;!(c&8388608);)c<<=1,l-=8388608;c&=-8388609,l+=947912704,r[h]=c|l}for(let h=1024;h<2048;++h)r[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)a[h]=h<<23;a[31]=1199570944,a[32]=2147483648;for(let h=33;h<63;++h)a[h]=2147483648+(h-32<<23);a[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(o[h]=1024);return{floatView:t,uint32View:e,baseTable:s,shiftTable:n,mantissaTable:r,exponentTable:a,offsetTable:o}}function j(){return(performance||Date).now()}function Ka(i,t){let e;return function(...s){clearTimeout(e),e=setTimeout(()=>{i.apply(this,s)},t)}}class ss{events;constructor(){this.events={}}on(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].push(e),this}addListener(t,e){return this.on(t,e),this}prependListener(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(e),this}removeListener(t,e){if(this.events[t])return this.events[t]=this.events[t].filter(s=>s!==e),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].forEach(s=>{Reflect.apply(s,this,e)}),this}once(t,e){const n=(()=>{let r=!1;return(...a)=>{r||(r=!0,Reflect.apply(e,this,a),this.off(t,n))}})();return this.on(t,n),this}}class Qa extends ss{results=[];queue=[];rs;controller;concurrency;activeTaskCount=0;constructor(t=1){super(),this.concurrency=t,this.rs=new ReadableStream({start:async e=>{this.controller=e}})}get stream(){return this.rs}clearUnstartTasks(){this.queue=[]}addTask(t){Array.isArray(t)?this.queue.push(...t):this.queue.push(t),this.activeTaskCount<this.concurrency&&this.queue.length>0&&this.runTasks()}async runTasks(){for(;this.activeTaskCount<this.concurrency&&this.queue.length>0;){const t=this.queue.splice(0,this.concurrency-this.activeTaskCount);this.activeTaskCount+=t.length;const e=await Promise.allSettled(t.map(n=>n())),s=this.results.length;e.forEach((n,r)=>{if(n.status=="fulfilled"){const a=n.value;this.results.push(a),this.controller?.enqueue(a),this.emit("success",s+r,a)}else if(n.status=="rejected"){const a=new Error(n.reason);this.results.push(a),this.controller?.enqueue(a),this.emit("error",s+r,a)}}),this.activeTaskCount-=e.length}}}function to(i,t=(e,s)=>e<=s){const e=i.length;let s=Math.floor(e/2);for(;s>0;){for(let n=s;n<e;n++){const r=i[n];let a=n;for(;a>=s&&!t(i[a-s],r);)i[a]=i[a-s],a-=s;i[a]=r}s=Math.floor(s/2)}}var wn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function eo(i,t={}){var e=1,s=1;function n(_){var A=_.match(/\n/g);A&&(e+=A.length);var N=_.lastIndexOf(`
|
|
11
|
-
`);s=~N?_.length-N:s+_.length}function r(){var _={line:e,column:s};return function(A){return A.position=new a(_),p(),A}}function a(_){this.start=_,this.end={line:e,column:s},this.source=t.source}a.prototype.content=i;var o=[];function h(_){var A=new Error(t.source+":"+e+":"+s+": "+_);if(A.reason=_,A.filename=t.source,A.line=e,A.column=s,A.source=i,t.silent)o.push(A);else throw A}function c(){var _=g();return{type:"stylesheet",stylesheet:{source:t.source,rules:_,parsingErrors:o}}}function l(){return y(/^{\s*/)}function d(){return y(/^}/)}function g(){var _,A=[];for(p(),x(A);i.length&&i.charAt(0)!="}"&&(_=le()||Se());)_!==!1&&(A.push(_),x(A));return A}function y(_){var A=_.exec(i);if(A){var N=A[0];return n(N),i=i.slice(N.length),A}}function p(){y(/^\s*/)}function x(_){var A;for(_=_||[];A=b();)A!==!1&&_.push(A);return _}function b(){var _=r();if(!(i.charAt(0)!="/"||i.charAt(1)!="*")){for(var A=2;i.charAt(A)!=""&&(i.charAt(A)!="*"||i.charAt(A+1)!="/");)++A;if(A+=2,i.charAt(A-1)==="")return h("End of comment missing");var N=i.slice(2,A-2);return s+=2,n(N),i=i.slice(A),s+=2,_({type:"comment",comment:N})}}function S(){var _=y(/^([^{]+)/);if(_)return Ft(_[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(A){return A.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(A){return A.replace(/\u200C/g,",")})}function C(){var _=r(),A=y(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(A){if(A=Ft(A[0]),!y(/^:\s*/))return h("property missing ':'");var N=y(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),P=_({type:"declaration",property:A.replace(wn,""),value:N?Ft(N[0]).replace(wn,""):""});return y(/^[;\s]*/),P}}function L(){var _=[];if(!l())return h("missing '{'");x(_);for(var A;A=C();)A!==!1&&(_.push(A),x(_));return d()?_:h("missing '}'")}function R(){for(var _,A=[],N=r();_=y(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)A.push(_[1]),y(/^,\s*/);if(A.length)return N({type:"keyframe",values:A,declarations:L()})}function Y(){var _=r(),A=y(/^@([-\w]+)?keyframes\s*/);if(A){var N=A[1];if(A=y(/^([-\w]+)\s*/),!A)return h("@keyframes missing name");var P=A[1];if(!l())return h("@keyframes missing '{'");for(var vt,ne=x();vt=R();)ne.push(vt),ne=ne.concat(x());return d()?_({type:"keyframes",name:P,vendor:N,keyframes:ne}):h("@keyframes missing '}'")}}function X(){var _=r(),A=y(/^@supports *([^{]+)/);if(A){var N=Ft(A[1]);if(!l())return h("@supports missing '{'");var P=x().concat(g());return d()?_({type:"supports",supports:N,rules:P}):h("@supports missing '}'")}}function V(){var _=r(),A=y(/^@host\s*/);if(A){if(!l())return h("@host missing '{'");var N=x().concat(g());return d()?_({type:"host",rules:N}):h("@host missing '}'")}}function it(){var _=r(),A=y(/^@media *([^{]+)/);if(A){var N=Ft(A[1]);if(!l())return h("@media missing '{'");var P=x().concat(g());return d()?_({type:"media",media:N,rules:P}):h("@media missing '}'")}}function W(){var _=r(),A=y(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(A)return _({type:"custom-media",name:Ft(A[1]),media:Ft(A[2])})}function $(){var _=r(),A=y(/^@page */);if(A){var N=S()||[];if(!l())return h("@page missing '{'");for(var P=x(),vt;vt=C();)P.push(vt),P=P.concat(x());return d()?_({type:"page",selectors:N,declarations:P}):h("@page missing '}'")}}function z(){var _=r(),A=y(/^@([-\w]+)?document *([^{]+)/);if(A){var N=Ft(A[1]),P=Ft(A[2]);if(!l())return h("@document missing '{'");var vt=x().concat(g());return d()?_({type:"document",document:P,vendor:N,rules:vt}):h("@document missing '}'")}}function nt(){var _=r(),A=y(/^@font-face\s*/);if(A){if(!l())return h("@font-face missing '{'");for(var N=x(),P;P=C();)N.push(P),N=N.concat(x());return d()?_({type:"font-face",declarations:N}):h("@font-face missing '}'")}}var bt=ie("import"),dt=ie("charset"),ve=ie("namespace");function ie(_){var A=new RegExp("^@"+_+"\\s*([^;]+);");return function(){var N=r(),P=y(A);if(P){var vt={type:_};return vt[_]=P[1].trim(),N(vt)}}}function le(){if(i[0]=="@")return Y()||it()||W()||X()||bt()||dt()||ve()||z()||$()||V()||nt()}function Se(){var _=r(),A=S();return A?(x(),_({type:"rule",selectors:A,declarations:L()})):h("selector missing")}return Ws(c())}function Ft(i){return i?i.replace(/^\s+|\s+$/g,""):""}function Ws(i,t){var e=i&&typeof i.type=="string",s=e?i:t;for(var n in i){var r=i[n];Array.isArray(r)?r.forEach(function(a){Ws(a,s)}):r&&typeof r=="object"&&Ws(r,s)}return e&&Object.defineProperty(i,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),i}const $s=(i,t="image/svg+xml",e="utf-8")=>e==="base64"?new Blob([i],{type:`${t};${e}`}):new Blob([i],{type:`${t};charset=${e}`}),Js=i=>new XMLSerializer().serializeToString(i),so=(i,t="text/html")=>new DOMParser().parseFromString(i,t),xn=(i,t="image/svg+xml",e="utf-8")=>$s(Js(i),t,e),Zs=(i,t)=>new Promise(e=>{const s=document.createElement("a");s.style.visibility="hidden",document.body.appendChild(s),s.download=t,typeof i=="string"?s.href=i:s.href=window.URL.createObjectURL(i),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(s.href),e()});function bn(i=["*"],t){return new Promise((e,s)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return s(new Error("This is not a browser environment"));const n=globalThis.document.createElement("input");n.setAttribute("type","file"),n.setAttribute("visibility","hidden"),Array.isArray(i)&&i.length>0&&n.setAttribute("accept",i.join(",")),t&&n.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!n.files||n.files?.length===0)&&s(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(n.removeEventListener("change",r),!n.files||n.files?.length===0)s(new Error("Cancel select"));else{const a=Array.from(n.files);!i.includes("*")&&a.some(o=>!i.includes(`.${vn(o)}`))&&s(new Error(`Please select files in ${i} format`)),n.remove(),e(a)}};n.addEventListener("change",r),n.click()})}function is(i,t="text",e){return new Promise((s,n)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{s(a.target?.result)}),r.addEventListener("error",a=>{n(a)}),t){case"dataURL":r.readAsDataURL(i);break;case"binaryString":r.readAsBinaryString(i);break;case"arrayBuffer":r.readAsArrayBuffer(i);break;case"text":default:r.readAsText(i)}})}async function io(i){const t=await is(i,"arrayBuffer");return cn(t)}const vn=i=>{let t;return i instanceof File?t=i.name:t=i,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Wt(i,t={},e=[],s){return{tag:i,props:t,children:e,el:s}}function ge(i,t){if(i.el)return i.el;if(i.el=document.createElement(i.tag),i.props)for(const e in i.props){const s=i.props[e];e.startsWith("on")?i.el.addEventListener(e.slice(2).toLowerCase(),s):i.el.setAttribute(e,s)}return i.children&&(typeof i.children=="string"?i.el.textContent=i.children:i.children.forEach(e=>{ge(e,i.el)})),t?.appendChild(i.el),i.el}function ns(i,t){if(!i.el)return;if(i.tag!==t.tag){(i.el.parentElement||document.body).replaceChild(ge(t),i.el);return}const e=t.el=i.el,s=i.props,n=t.props;for(const o in s)o in n||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),s[o]):e.removeAttribute(o));for(const o in n){const h=s[o],c=n[o];if(c!=h)if(o.startsWith("on")){const l=o.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else o==="style"?Object.keys(c||{}).forEach(l=>{const d=String(c[l]).toLowerCase().includes("!important")?"important":"";e.style.setProperty(ct(l),String(c[l]).replace(/!important/i,""),d)}):e.setAttribute(o,c)}const r=i.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{ge(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)ns(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{ge(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}function Sn(i,t){if(!i.isEqualNode(t)){if(i.nodeName!==t.nodeName){(i.parentElement||document.body).replaceChild(t,i);return}if(i.nodeType===Node.TEXT_NODE){i.textContent!==t.textContent&&(i.textContent=t.textContent);return}for(let e=i.attributes.length-1;e>=0;e--){const s=i.attributes[e].name;!t.hasAttribute(s)&&s!=="open"&&i.removeAttribute(s)}for(let e=0;e<t.attributes.length;e++){const s=t.attributes[e].name,n=t.attributes[e].value;i.setAttribute(s,n)}for(let e=0;e<t.childNodes.length;e++)i.childNodes[e]?Sn(i.childNodes[e],t.childNodes[e]):i.appendChild(t.childNodes[e].cloneNode(!0));for(;i.childNodes.length>t.childNodes.length;)i.lastChild&&i.removeChild(i.lastChild)}}class no{url;socket;waitingResponse={};sendMessageQueue=[];constructor(t){this.url=t,this.createSocket()}createSocket(){console.log("Socket Create Attempted"),this.socket=new WebSocket(this.url),this.socket.onopen=()=>{this.sendMessageQueue.forEach(t=>this.socket?.send(t)),this.sendMessageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:s,wasClean:n}=t;console.log(`ws closed : ${e} ${s} ${n}`)},this.socket.onerror=t=>{console.log(`ws error : ${t.type}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Socket Recreate Attempted"),this.sendMessageQueue.push(t),this.createSocket()}closeSocket(){this.socket&&(this.socket.close(),console.log("Socket closed"))}openSocket(){this.createSocket(),console.log("Socket opened manually")}sendWithRetry(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):this.recreateSocket(t)}async processMessage(t){if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const s=this.waitingResponse[e.requestid];s?s.resolve?.(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(`Received String : ${t.data}`)}else t.data instanceof ArrayBuffer?console.log(`Received ArrayBuffer : ${t.data}`):t.data instanceof Blob&&console.log(`Received Blob : ${t.data}`)}async sendPayload(t){const e=+new Date,s=this.waitingResponse[e]={requestid:e};try{let n;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?n=t:n=JSON.stringify({...s,...t});const r=await new Promise((a,o)=>{s.resolve=a,this.sendWithRetry(n),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-s.requestid)/1e3),r}catch(n){return Promise.reject(n)}finally{delete this.waitingResponse[e]}}async send(t,e,s=n=>{console.log(n)}){this.sendPayload(t).then(e,s)}}function ro(){const i=window.screen;return{screenWidth:i.width,screenHeight:i.height,screenX:window.screenX,screenY:window.screenY}}function Pe(){const i=document.documentElement;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function ao(){const i=document.body;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function oo(){return typeof window.innerWidth=="number"?{width:window.innerWidth,height:window.innerHeight}:document.compatMode==="CSS1Compat"?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function ho(){const{scrollWidth:i,scrollHeight:t}=Pe();return{width:i,height:t}}function Cn(i){const{top:t,left:e,width:s,height:n}=i.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=Pe();return{x:e+r,y:t+a,width:s,height:n}}function co(i){let t=0,e=0;i&&(t=i.offsetWidth,e=i.offsetHeight);let s=0,n=0;for(;i!==null;)s+=i.offsetLeft,n+=i.offsetTop,i.offsetParent instanceof HTMLElement?i=i.offsetParent:i=null;return{x:s,y:n,width:t,height:e}}function En(i){return i.getBoundingClientRect()}function lo(i){const t=i.getBoundingClientRect();return{x:i.offsetLeft,y:i.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function uo(){const{clientHeight:i,scrollTop:t,scrollHeight:e}=Pe(),s=e-i;return s<=0?0:t/s*100}function fo(i){if("center"in i){const t=i.center,e=En(i.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:i.clientX,y:i.clientY}}function Tn(i){if("center"in i)return i.center;if(typeof i.pageX=="number"&&typeof i.pageY=="number")return{x:i.pageX,y:i.pageY};const{scrollLeft:t,scrollTop:e}=Pe();return{x:i.clientX+t,y:i.clientY+e}}function Mt(i,t){if(!t&&"offsetX"in i)return{x:i.offsetX,y:i.offsetY};const e=Tn(i),s=Cn(t||i.target);return{x:e.x-s.x,y:e.y-s.y}}const rs=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(i)?t="macOS":/win/i.test(i)?t="Windows":/android/i.test(i)?t="Android":/iphone|ipad|ipod/i.test(i)?t="iOS":/linux/i.test(i)?t="Linux":/bsd/i.test(i)&&(t="BSD"),t.toLowerCase()},mo=()=>{const i=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(i)){const e=i.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(i)){const e=i.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(i)){const e=i.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(i)){const e=i.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},Ks=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(i)||/opera/i.test(i)?t="Opera":/chrome/i.test(i)?t="Chrome":/firefox/i.test(i)?t="Firefox":/safari/i.test(i)?t="Safari":/edge/i.test(i)?t="Edge":/msie|trident/i.test(i)?t="IE":/MicroMessenger/i.test(i)?t="Wechat":/alipay/i.test(i)&&(t="Ali"),t.toLowerCase()},po=()=>{const i=navigator.userAgent;let t="Unknown";if(/Chrome/.test(i)){const e=i.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(i)){const e=i.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(i)){const e=i.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(i)){const e=i.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(i)){const e=i.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},go=()=>"geolocation"in navigator?new Promise((i,t)=>{navigator.geolocation.getCurrentPosition(e=>{const s=e.coords.latitude,n=e.coords.longitude;i({latitude:s,longitude:n})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function yo(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function wo(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Qs(){return rs()==="ios"}function ti(){return rs()==="macos"}function xo(){return Qs()|ti()}function Pn(){return rs()==="android"}function bo(){return Qs()||Pn()}function vo(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function Mn(){const i=window.navigator.userAgent,t=i.indexOf("MSIE ");if(t>0)return parseInt(i.substring(t+5,i.indexOf(".",t)),10);if(i.indexOf("Trident/")>0){const n=i.indexOf("rv:");return parseInt(i.substring(n+3,i.indexOf(".",n)),10)}const s=i.indexOf("Edge/");return s>0?parseInt(i.substring(s+5,i.indexOf(".",s)),10):-1}const So=Mn()!==-1;function Co(){const i=document.documentMode;return i&&(i===9||i===10)}function An(){return Ks()==="wechat"}function kn(){return Ks()==="ali"}function Eo(){return An()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function To(){return kn()&&navigator.userAgent.match(/miniprogram/i)}const Po=typeof document<"u",In=typeof window<"u",Mo=typeof history<"u",Ao=In&&window.File&&window.FileReader&&window.FileList&&window.Blob,Dn=(()=>{const i=me();return!!(i.Worker&&i.Blob&&i.Promise&&i.OffscreenCanvas&&i.OffscreenCanvasRenderingContext2D&&i.HTMLCanvasElement&&i.HTMLCanvasElement.prototype.transferControlToOffscreen&&i.URL&&i.URL.createObjectURL)})(),ko=typeof Path2D=="function"&&typeof DOMMatrix=="function",_n=function(){if(!me().OffscreenCanvas)return!1;const t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);const s=t.transferToImageBitmap();try{e.createPattern(s,"no-repeat")}catch{return!1}return!0}(),Io=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},Do="webkit moz ms o".split(" ");function as(i){return typeof i=="function"&&/native code/.test(i.toString())}function _o(i){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const n=function(){const r=Math.min(t.clientWidth,i);t.dataset.width=r,t.dataset.rem=s=Math.round(100*(r/i)),t.style.fontSize=s+"px"};n(),window.rem2px=function(r){return r=parseFloat(r),r*s},window.px2rem=function(r){return r=parseFloat(r),r/s},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",n,!1)}function O(i){return i*Math.PI/180}function tt(i){return i*180/Math.PI}function os(i,t,e=0){return Math.sqrt(i*i+t*t+e*e)}function hs(i,t,e,s){return os(e-i,s-t)}function cs(i,t,e,s){const n=e-i,r=s-t;return n*n+r*r}function $t(i,t,e,s){let n=Math.atan2(s-t,e-i);return n<0&&(n+=Math.PI*2),n}function At(i,t){return{dx:Math.cos(i)*t,dy:Math.sin(i)*t}}function Lo(i,t,e){if(typeof e=="number"){const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2)+Math.pow(e,2));return{x:i/=s,y:t/=s,z:e/=s}}else{const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2));return{x:i/=s,y:t/=s}}}function Ro(i,t,e,s,n=10){if(Math.abs(e-i)<n&&Math.abs(s-t)<n)return"no";const r=tt($t(i,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const Ln=Oo("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function Oo(i,t=10){const e={},s=i.split(",");for(let n=0;n<s.length;n+=2){const r="&"+s[n+1]+";",a=parseInt(s[n],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function rt(i,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)i=i.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return i}function ls(i){let t,e;if(!i)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(i[t]);return t}function No(i){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[i]||t.start}function Fo(i){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[i]||t.alphabetic}const Me={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class us{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(s.setAttribute("stop-color",rt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}}class ei{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Ae{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=s),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Me);for(let e=0,s=t.length;e<s;e++){const n=t[e];this[n]=Me[n].canvas}}__getStyleState(){const t={},e=Object.keys(Me);for(let s=0,n=e.length;s<n;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,n=e.length;s<n;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const n=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];n.setAttribute(o,e[o])}return n}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const n=Object.keys(Me);for(let r=0;r<n.length;r++){const a=Me[n[r]],o=this[n[r]];if(a.apply){if(o instanceof ei){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const h=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,rt("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof us)e.setAttribute(a.apply,rt("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);if(c){e.setAttribute(a.svgAttr,rt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const d=this.globalAlpha;d!=null&&(l*=d),e.setAttribute(a.svgAttr+"-opacity",""+l)}}else{let h=a.svgAttr;if(n[r]==="globalAlpha"&&(h=t+"-"+a.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const n=Object.keys(Ln);for(let r=0,a=n.length;r<a;r++){const o=n[r],h=Ln[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(rt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(rt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(rt("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,n,r,a){this.__addTransform(rt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:n,e:r,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(rt("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(rt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(rt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,n,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(rt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:n,x:r,y:a}))}quadraticCurveTo(t,e,s,n){this.__currentPosition={x:s,y:n},this.__addPathCommand(rt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:n}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,n,r){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(a===t&&o===e||t===s&&e===n||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,n-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],d=Math.acos(Math.abs(l)),g=this.normalize([h[0]+c[0],h[1]+c[1]]),y=r/Math.sin(d/2),p=t+y*g[0],x=e+y*g[1],b=[-h[1],h[0]],S=[c[1],-c[0]],C=function(Y){const X=Y[0];return Y[1]>=0?Math.acos(X):-Math.acos(X)},L=C(b),R=C(S);this.lineTo(p+b[0]*r,x+b[1]*r),this.arc(p,x,r,L,R)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,s,n){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],n=s.childNodes;for(let r=n.length-1;r>=0;r--)n[r]&&s.removeChild(n[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,n){if(t===0&&e===0&&s===this.width&&n===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:n,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,n){const r=this.__createElement("linearGradient",{id:ls(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new us(r,this)}createRadialGradient(t,e,s,n,r,a){const o=this.__createElement("radialGradient",{id:ls(this.__ids),cx:n+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new us(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),s={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,n){const r=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:s,"text-anchor":No(this.textAlign),"dominant-baseline":Fo(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,n,r,a){if(n===r)return;n=n%(2*Math.PI),r=r%(2*Math.PI),n===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(n),l=e+s*Math.sin(n),d=a?0:1;let g=0,y=r-n;y<0&&(y+=2*Math.PI),a?g=y>Math.PI?0:1:g=y>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(rt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:g,sweepFlag:d,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=ls(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",rt("url(#{id})",{id:s})),t.appendChild(n),this.__currentElement=n}drawImage(...t){let e=t[0],s,n,r,a,o=0,h=0,c,l,d,g,y,p,x,b;if(t.length===3)s=t[1],n=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],n=t[2],r=t[3],a=t[4],c=e.width,l=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],l=t[4],s=t[5],n=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const S=this.__closestGroupOrSvg();this.__currentElement;const C="translate("+s+", "+n+")";if(e instanceof Ae){if(d=e.getSvg().cloneNode(!0),d.childNodes&&d.childNodes.length>1){for(g=d.childNodes[0];g.childNodes.length;)b=g.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(g.childNodes[0]);if(y=d.childNodes[1],y){const L=y.getAttribute("transform");let R;L?R=L+" "+C:R=C,y.setAttribute("transform",R),S.appendChild(y)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",a),p.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(x=this.__document.createElement("canvas"),x.width=r,x.height=a,x.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=x),p.setAttribute("transform",C),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),S.appendChild(p))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),n=ls(this.__ids);let r;return s.setAttribute("id",n),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof Ae&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new ei(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class ds{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,n=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),n&&(this.customContext=new Ae({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,n){return this.context.fillRect(t,e,s,n),this.customContext&&this.customContext.fillRect(t,e,s,n),this}fillText(t,e,s,n){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,n),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,n){return this.context.strokeText(t,e,s,n),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,n){return this.context.strokeRect(t,e,s,n),this.customContext&&this.customContext.strokeRect(t,e,s,n),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,n=this.canvas.height){return this.context.clearRect(t,e,s,n),this.customContext&&this.customContext.clearRect(t,e,s,n),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-n),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,n,r,a){return this.context.arc(t,e,s,n,r,a),this.customContext&&this.customContext.arc(t,e,s,n,r,a?-1:1),this.currentPath2D.arc(t,e,s,n,r,a),this}arcTo(t,e,s,n,r){return this.context.arcTo(t,e,s,n,r),this.customContext&&this.customContext.arcTo(t,e,s,n,r),this.currentPath2D.arcTo(t,e,s,n,r),this}ellipse(t,e,s,n,r,a,o,h){return this.context.ellipse(t,e,s,n,r,a,o,h),this.currentPath2D.ellipse(t,e,s,n,r,a,o,h),this}quadraticCurveTo(t,e,s,n){return this.context.quadraticCurveTo(t,e,s,n),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,n),this.currentPath2D.quadraticCurveTo(t,e,s,n),this}bezierCurveTo(t,e,s,n,r,a){return this.context.bezierCurveTo(t,e,s,n,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,n,r,a),this.currentPath2D.bezierCurveTo(t,e,s,n,r,a),this}rect(t,e,s,n){return this.context.rect(t,e,s,n),this.customContext&&this.customContext.rect(t,e,s,n),this.currentPath2D.rect(t,e,s,n),this}createLinearGradient(t,e,s,n,r){const a=this.context.createLinearGradient(t,e,s,n);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,n,r,a,o){const h=this.context.createRadialGradient(t,e,s,n,r,a);return o&&Object.entries(o).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],n=e[1];this.context.drawImage(t,s,n)}else if(e.length===4){const s=e[0],n=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,n,r,a)}else if(e.length===8){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,n,r,a,o,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,n=this.canvas.height,r){return this.context.getImageData(t,e,s,n,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class fs{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=$t(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),s=Math.min(this.y,this.toY),n=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:n-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),n=s*this.x-e*this.y,r=s*this.toX-e*this.toY,a=s*this.y+e*this.x,o=s*this.toY+e*this.toX;return{x:Math.min(n,r),y:Math.min(a,o),width:Math.max(n,r)-Math.min(n,r),height:Math.max(a,o)-Math.min(a,o)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,n=t.toX,r=t.toY,a=this.toX-e,o=t.x-n;if(!a&&!o)return null;const h=(this.toY-s)/a,c=(t.y-r)/o;if(a){if(!o)return{x:n,y:h*(n-e)+s}}else return{x:e,y:c*(e-n)+r};const l=(-c*n+r+h*e-s)/(h-c),d=h*(l-e)+s;return isNaN(l)||isNaN(d)?null:{x:l,y:d}}}const Rn=fs;class si extends fs{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,n,r,a,o,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,n,r,a,o,h,!this.sweepFlag)}convert(t,e,s,n,r,a,o,h,c){const l=o/180*Math.PI,d=(t-s)/2,g=(e-n)/2,y=Math.cos(l)*d+Math.sin(l)*g,p=-Math.sin(l)*d+Math.cos(l)*g,x=y*y/(r*r)+p*p/(a*a);if(x>1){const z=Math.sqrt(x);throw r=z*r,a=z*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const b=Math.sqrt((r*r*a*a-r*r*p*p-a*a*y*y)/(r*r*p*p+a*a*y*y)),S=h!=c?1:-1,C=S*b*r*p/a,L=S*b*-a*y/r,R=(t+s)/2,Y=(e+n)/2,X=Math.cos(l)*C-Math.sin(l)*L+R,V=Math.sin(l)*C+Math.cos(l)*L+Y,it=(z,nt,bt,dt)=>(z*dt>=nt*bt?1:-1)*Math.acos((z*bt+nt*dt)/(Math.sqrt(z*z+nt*nt)*Math.sqrt(bt*bt+dt*dt))),W=it(1,0,t-X,e-V)-l,$=it(t-X,e-V,s-X,n-V);return[X,V,r,a,l,W,W+$]}}class Bo extends fs{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let s,n,r,a;for(let c=0;c<2;++c)s=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,n=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(s)>1e-12&&(a=-n/(2*s),0<a&&a<1&&[t,e][c].push(s*a*a+n*a+r));const o={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},h={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:o.x,y:o.y,width:h.x-o.x,height:h.y-o.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}}const Xo=Bo;class lt extends fs{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),s=this.x-this.c1x,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t;const a=[this.y,this.toY],o=[this.x,this.toX];let h;const c=[];Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),s=this.y-this.c1y,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y}));let l=[],d=c.length;for(let p=0;p<d;p++){for(let x=p+1;x<d;x++)c[p].X===c[x].X&&c[p].Y===c[x].Y&&(x=++p);l.push({X:c[p].X,Y:c[p].Y})}const g={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},y={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:g.x,y:g.y,width:y.x-g.x,height:y.y-g.y,dots:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}static base3(t,e,s,n,r){const a=-3*e+9*s-9*n+3*r,o=t*a+6*e-12*s+6*n;return t*o-3*e+3*s}static bezlen(t,e,s,n,r,a,o,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,d=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],g=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let y=0;for(let p=0;p<12;p++){const x=l*d[p]+l,b=this.base3(x,t,s,r,o),S=this.base3(x,e,n,a,h);y+=g[p]*Math.sqrt(b*b+S*S)}return l*y}length(t=1){return lt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,s=this.y,n=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.toX,c=this.toY;if(t<0||lt.bezlen(e,s,n,r,a,o,h,c)<t)return 0;let l=1,d=l/2,g=l-d,y=lt.bezlen(e,s,n,r,a,o,h,c,g);for(;Math.abs(y-t)>.01;)d/=2,g+=(y<t?1:-1)*d,y=lt.bezlen(e,s,n,r,a,o,h,c,g);return g}getPointAtSegmentLength(t){const e=this.getTatLen(t);let s=1-e,n=Math.pow(s,3),r=Math.pow(s,2),a=e*e,o=a*e,h=n*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+o*this.toX,c=n*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+o*this.toY,l=this.x+2*e*(this.c1x-this.x)+a*(this.c2x-2*this.c1x+this.x),d=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),g=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),y=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),p=s*this.x+e*this.c1x,x=s*this.y+e*this.c1y,b=s*this.c2x+e*this.toX,S=s*this.c2y+e*this.toY,C=90-Math.atan2(l-g,d-y)*180/Math.PI;return{x:h,y:c,m:{x:l,y:d},n:{x:g,y},start:{x:p,y:x},end:{x:b,y:S},alpha:C}}}const ke=Math.PI*2;function On(i,t,e,s){const n=i*s-t*e<0?-1:1;let r=i*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),n*Math.acos(r)}function Yo(i,t,e,s,n,r,a,o,h,c){const l=c*(i-e)/2+h*(t-s)/2,d=-h*(i-e)/2+c*(t-s)/2,g=a*a,y=o*o,p=l*l,x=d*d;let b=g*y-g*x-y*p;b<0&&(b=0),b/=g*x+y*p,b=Math.sqrt(b)*(n===r?-1:1);const S=b*a/o*d,C=b*-o/a*l,L=c*S-h*C+(i+e)/2,R=h*S+c*C+(t+s)/2,Y=(l-S)/a,X=(d-C)/o,V=(-l-S)/a,it=(-d-C)/o,W=On(1,0,Y,X);let $=On(Y,X,V,it);return r===0&&$>0&&($-=ke),r===1&&$<0&&($+=ke),[L,R,W,$]}function Uo(i,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(i),n=Math.sin(i),r=Math.cos(i+t),a=Math.sin(i+t);return[s,n,s-n*e,n+s*e,r+a*e,a-r*e,r,a]}function Nn(i,t,e,s,n,r,a,o,h){const c=Math.sin(h*ke/360),l=Math.cos(h*ke/360),d=l*(i-e)/2+c*(t-s)/2,g=-c*(i-e)/2+l*(t-s)/2;if(d===0&&g===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const y=d*d/(a*a)+g*g/(o*o);y>1&&(a*=Math.sqrt(y),o*=Math.sqrt(y));const p=Yo(i,t,e,s,n,r,a,o,c,l),x=[];let b=p[2],S=p[3];const C=Math.max(Math.ceil(Math.abs(S)/(ke/4)),1);S/=C;for(let L=0;L<C;L++)x.push(Uo(b,S)),b+=S;return x.map(L=>{for(let R=0;R<L.length;R+=2){let Y=L[R+0],X=L[R+1];Y*=a,X*=o;const V=l*Y-c*X,it=c*Y+l*X;L[R+0]=V+p[0],L[R+1]=it+p[1]}return L})}function ii(i,t,e,s,n,r){return[i/3+2/3*e,t/3+2/3*s,n/3+2/3*e,r/3+2/3*s,n,r]}function Ie(i,t,e,s){return[i,t,e,s,e,s]}const De={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class oe{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&k.attribute(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||zs()})}static downloadFromSVGElement(t,e="shape"){return Zs(xn(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Zs($s(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return Js(t)}static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t))}static SVGPathDataToD(t){return t.map(e=>{if(!e[0])return"";switch(e[0].toLowerCase()){case"a":return`${e[0]} ${e[1]},${e[2]} ${e[3]} ${e[4]},${e[5]} ${e[6]},${e[7]}`;case"c":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`;case"s":case"q":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]}`;default:return e[0]+" "+e.slice(1).join(",")}}).join(" ")}static parseSVGPath(t){const e=[];return oe.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,n,r)=>{let a=n.toLowerCase();const o=yn(r);for(a=="m"&&o.length>De[a]&&(e.push([n,...o.splice(0,De[a])]),a="l",n=n=="m"?"l":"L");o.length;){if(o.length<De[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${n} } args:{ ${o} }`);e.push([n,...o.splice(0,De[a])])}return a=="z"&&e.push([n]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toUpperCase();if(o!=h)switch(a[0]=h,o){case"a":a[6]+=n,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=n;break;default:for(let c=1;c<a.length;)a[c++]+=n,a[c++]+=r}switch(h){case"Z":n=e,r=s;break;case"H":n=a[1];break;case"V":r=a[1];break;case"M":n=e=a[1],r=s=a[2];break;default:n=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toLowerCase();if(o!=h)switch(a[0]=h,o){case"A":a[6]-=n,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=n;break;default:for(let c=1;c<a.length;)a[c++]-=n,a[c++]-=r}switch(h){case"z":n=e,r=s;break;case"h":n+=a[1];break;case"v":r+=a[1];break;case"m":n+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:n+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){const e=[];let s=0,n=0,r=0,a=0,o=0,h=0,c=0,l=0,d;for(let g=0,y=t.length;g<y;g++){let p=t[g];const x=p[0];switch(x){case"M":s=p[1],n=p[2];break;case"A":const b=Nn(r,a,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!b.length)continue;b.forEach((L,R)=>{const[Y,X,V,it,W,$,z,nt]=L;p=["C",V,it,W,$,z,nt],R<b.length-1&&e.push(p)});break;case"S":let S=r,C=a;(d=="C"||d=="S")&&(S+=S-c,C+=C-l),p=["C",S,C,p[1],p[2],p[3],p[4]];break;case"T":d=="Q"||d=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),p=["C",...ii(r,a,o,h,p[1],p[2])];break;case"Q":o=p[1],h=p[2],p=["C",...ii(r,a,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...Ie(r,a,p[1],p[2])];break;case"H":p=["C",...Ie(r,a,p[1],a)];break;case"V":p=["C",...Ie(r,a,r,p[1])];break;case"Z":p=["C",...Ie(r,a,s,n)];break}d=x,r=p[p.length-2],a=p[p.length-1],p.length>4?(c=p[p.length-4],l=p[p.length-3]):(c=r,l=a),e.push(p)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,n=t.length;n-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:n-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}];const a=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y])}return e}static zvhToLSVGPath(t){const e=[];let s=["L",0,0],n;for(let r=0,a=t.length;r<a;r++){const o=t[r];switch(o[0]){case"M":s=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(s);break;case"H":n=e[e.length-1]||["L",0,0],e.push(["L",o[1],n[n.length-1]]);break;case"V":n=e[e.length-1]||["L",0,0],e.push(["L",n[n.length-2],o[1]]);break;default:e.push(o)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let s,n=0,r=0;for(let a=0,o=t.length;a<o;a++){const h=t[a],c=e[h[0]];c&&(h[0]=c.to,s&&(s[0]===c.to?(n=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(n=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,n,r)),s=h}return t}}const mt=oe;class pt{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(mt.parseSVGPath(t),e):t instanceof pt?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=mt.normalizeSVGPath(mt.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let n=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];if(o[0]=="M"){n||(n=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2];continue}this.appendLine(new lt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new pt;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,n=t.length;s+5<n;s+=6)e.appendLine(new lt({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],toX:t[s+4],toY:t[s+5]}));return e}static fromLines(t){const e=new pt;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,n=t.length;s<n;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof si){Nn(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,d,g,y,p,x,b,S]=c;this.normalizedLines.push(new lt({x:this.prevPathX,y:this.prevPathY,c1x:g,c1y:y,c2x:p,c2y:x,toX:b,toY:S})),this.prevPathX=b,this.prevPathY=S});return}let e,s,n,r,a,o;t instanceof lt?(e=t.c1x,s=t.c1y,n=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof Xo?[e,s,n,r,a,o]=ii(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,n,r,a,o]=Ie(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new lt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:n,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),n=[];n.push(["M",t,e]);for(let r=0,a=s.length;r<a;r++)n.push(...s[r].toSVGPathData());return n}toSVGPathD(){return mt.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform();t.beginPath(),t.moveTo(e,s),n.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],s=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const n=Math.min.apply(0,e),r=Math.min.apply(0,s),a=Math.max.apply(0,e),o=Math.max.apply(0,s);return{x:n,y:r,width:a-n,height:o-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new at;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,s=this.startPathY;({x:e,y:s}=t.transformPoint({x:e,y:s}));const n=[];return this.normalizedLines.forEach(r=>{let a=r.x,o=r.y,h=r.c1x,c=r.c1y,l=r.c2x,d=r.c2y,g=r.toX,y=r.toY;({x:a,y:o}=t.transformPoint({x:a,y:o})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:l,y:d}=t.transformPoint({x:l,y:d}),{x:g,y}=t.transformPoint({x:g,y}),n.push(new lt({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:d,toX:g,toY:y}))}),{startPathX:e,startPathY:s,normalizedLines:n}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,s)=>e+=s.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let s=0;const n=e.length;for(let r=0;r<n;r++){const a=e[r],o=a.length();if(s+o>=t)return a.getPointAtSegmentLength(t-s);s+=o}return e[n-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform(),r=n.length;if(r===0)return{x:e,y:s};if(r===1)return n[0].interpolate(t);{let a=t*r,o=n[0];if(a--,a>1)for(let h=1;h<r&&(o=n[h],a>1);h++)a-=1;return o.interpolate(a)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const s=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(s,t):s}}getSubpathsAtLength(t,e,s){const{startPathX:n,startPathY:r,normalizedLines:a}=t.updateTransform();let o=null,h=0;const c=new pt;c.prevPathX=c.startPathX=n,c.prevPathY=c.startPathY=r;for(let l=0,d=a.length;l<d;l++){const g=a[l],y=g.length();if(h+y>e&&!o){const p=g.getPointAtSegmentLength(e-h);if(c.appendLine(new lt({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),s)return c;o=c,c.appendLine(new lt({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:g.x,toY:g.y})),h+=y;continue}h+=y,c.appendLine(g)}return c}closestPoint(t,e){const s=this.getTotalLength();let n={x:t,y:e},r=0,a=1/0,o=8;for(let c=0;c<=s;c+=o){let l=this.getPointAtLength(c),d=cs(l.x,l.y,t,e);d<a&&(n=l,r=c,a=d)}for(o/=2;o>.5;){let c=r-o,l=this.getPointAtLength(c),d=cs(l.x,l.y,t,e),g=r+o,y=this.getPointAtLength(g),p=cs(y.x,y.y,t,e);c>=0&&d<a?(n=l,r=c,a=d):g<=s&&p<a?(n=y,r=g,a=p):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:n,rotation:r>=s?$t(h.x,h.y,n.x,n.y):$t(n.x,n.y,h.x,h.y),distance:Math.sqrt(a)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform();return[t,e].concat(s.reduce((n,r)=>n.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],n=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=hs(t[a],t[a+1],s,n),s=t[a],n=t[a+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let n=t-s;const r=Math.ceil(t/s),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=s-1;){const h=e[o++],c=e[o++],l=e[o++],d=e[o++],g=e[o++],y=e[o++];a.push(["C",h,c,l,d,g,y]);let p=0;for(;p<r&&n>0;)a.push(["C",g,y,g,y,g,y]),n-=6,p++}return a}static mixPoints(t,e,s){const n=t.length,r=new Array(n);for(let a=0;a<n;a++)r[a]=Et(t[a]+(e[a]-t[a])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t:Math.abs(s-1)<Number.EPSILON?e:pt.fromPolymorphPoints(pt.mixPoints(new pt({d:t}).polymorphPoints,new pt({d:e}).polymorphPoints,s)).toSVGPathData()}}const Go=pt;(function(){if(!window.requestAnimationFrame){let i=j();window.requestAnimationFrame=function(t){const e=j(),s=Math.max(0,16-(e-i)),n=window.setTimeout(function(){t(e+s)},s);return i=e+s,n}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(i){clearTimeout(i)})})();const ni=i=>{let t=!1;return window.requestAnimationFrame(function e(s){!t&&i(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}};function ri(i,t=0){if(t==0)return i(j()),()=>{};{const e=j();return ni(s=>s-e>=t?(i(s),!1):!0)}}function Vo(i,t=0){let e=!1,s=0,n=j();const r=a=>{if(e)return;s++;const o=a-n-s*t;i(a,s,t-o<=0),ri(r,Math.max(0,t-o))};return ri(r,t),()=>{e=!0}}function zo(i,t=20){const e=1e3/t;let s=0,n;return()=>(j()-s>=e&&(s=j(),n=i()),n)}const Jt=new Ke;let ai=!1;function Fn(i,t,e){i&&t&&Jt.set(i,t),!ai&&(ai=!0,requestIdleCallback(s=>{for(ai=!1;s.timeRemaining()>0&&Jt.length>0;){const n=Jt.shift();n&&n[1]()}Jt.length>0&&Fn()},{timeout:e}))}let oi=!1;function hi(i,t,e){if(i&&t&&Jt.set(i,t),oi)return;oi=!0;const s=j();Xn(n=>{for(oi=!1;(n.timeRemaining()>0||e&&j()-s>=e)&&Jt.length>0;){const r=Jt.shift();r&&r[1]()}Jt.length>0&&hi()})}let ms=0,he=33,Zt=33,ci;const Bn=new MessageChannel,qo=Bn.port2;Bn.port1.onmessage=i=>{ci!==null&&ci({didTimeout:ms<=j(),timeRemaining:()=>Math.max(0,ms-j())})};function Xn(i){return ci=i,requestAnimationFrame(t=>{let e=t-ms+Zt;e<Zt&&he<Zt?(e<8&&(e=8),Zt=e<he?he:e):e>Zt&&he>Zt?Zt=e<he?he:e:he=e,ms=t+Zt,qo.postMessage(null)})}function Ho(i){return cancelAnimationFrame(i)}function jo(i){if(typeof setImmediate<"u"&&as(setImmediate))setImmediate(i);else if(typeof MessageChannel<"u"&&(as(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=i,t.postMessage(null)}else typeof Promise<"u"&&as(Promise)?Promise.resolve().then(i):setTimeout(i,0)}function Wo(i){typeof queueMicrotask=="function"?queueMicrotask(i):Promise.resolve().then(i).catch(t=>setTimeout(()=>{throw t}))}class _e{static _nextId=0;static nextId(){return _e._nextId++}}const I={Linear:{None:function(i){return i}},Ease:{In:function(i){return Math.pow(i,1.7)}},Quadratic:{In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}},Cubic:{In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}},Quartic:{In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}},Quintic:{In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}},Sinusoidal:{In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}},Exponential:{In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}},Circular:{In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}},Elastic:{In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}},Back:{In:function(i){return i===1?1:i*i*((1.70158+1)*i-1.70158)},Out:function(i){return i===0?0:--i*i*((1.70158+1)*i+1.70158)+1},InOut:function(i){const t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}},Bounce:{In:function(i){return 1-I.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?I.Bounce.In(i*2)*.5:I.Bounce.Out(i*2-1)*.5+.5}},generatePow:function(i=4){return i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return t**i},Out:function(t){return 1-(1-t)**i},InOut:function(t){return t<.5?(t*2)**i/2:(1-(2-t*2)**i)/2+.5}}},random:function(i){return Math.random()},createStep:function(i){return function(t){return Math.floor(t*i)/i}},createNoisyEasing:function(i,t=.1){const e=1-t;return function(s){return t*Math.random()+e*i(s)}},swing:function(i){return i+Math.sin(i*Math.PI*2)/2},causeSeizures:function(i){return i+.2*Math.random()-.1}};function Yn(i){switch(i){case I.Quadratic.In:return I.Quadratic.Out;case I.Quadratic.Out:return I.Quadratic.In;case I.Quadratic.InOut:return I.Quadratic.InOut;case I.Cubic.In:return I.Cubic.Out;case I.Cubic.Out:return I.Cubic.In;case I.Cubic.InOut:return I.Cubic.InOut;case I.Quartic.In:return I.Quartic.Out;case I.Quartic.Out:return I.Quartic.In;case I.Quartic.InOut:return I.Quartic.InOut;case I.Quintic.In:return I.Quintic.Out;case I.Quintic.Out:return I.Quintic.In;case I.Quintic.InOut:return I.Quintic.InOut;case I.Sinusoidal.In:return I.Sinusoidal.Out;case I.Sinusoidal.Out:return I.Sinusoidal.In;case I.Sinusoidal.InOut:return I.Sinusoidal.InOut;case I.Exponential.In:return I.Exponential.Out;case I.Exponential.Out:return I.Exponential.In;case I.Exponential.InOut:return I.Exponential.InOut;case I.Circular.In:return I.Circular.Out;case I.Circular.Out:return I.Circular.In;case I.Circular.InOut:return I.Circular.InOut;case I.Elastic.In:return I.Elastic.Out;case I.Elastic.Out:return I.Elastic.In;case I.Elastic.InOut:return I.Elastic.InOut;case I.Back.In:return I.Back.Out;case I.Back.Out:return I.Back.In;case I.Back.InOut:return I.Back.InOut;case I.Bounce.In:return I.Bounce.Out;case I.Bounce.Out:return I.Bounce.In;case I.Bounce.InOut:return I.Bounce.InOut;default:return i}}const $o=4,Jo=.001,Zo=1e-7,Ko=10,Le=11,ps=1/(Le-1),Qo=typeof Float32Array=="function";function Un(i,t){return 1-3*t+3*i}function Gn(i,t){return 3*t-6*i}function Vn(i){return 3*i}function gs(i,t,e){return((Un(t,e)*i+Gn(t,e))*i+Vn(t))*i}function zn(i,t,e){return 3*Un(t,e)*i*i+2*Gn(t,e)*i+Vn(t)}function th(i,t,e,s,n){let r,a,o=0;do a=t+(e-t)/2,r=gs(a,s,n)-i,r>0?e=a:t=a;while(Math.abs(r)>Zo&&++o<Ko);return a}function eh(i,t,e,s){for(let n=0;n<$o;++n){const r=zn(t,e,s);if(r===0)return t;const a=gs(t,e,s)-i;t-=a/r}return t}function sh(i){return i}function li(i,t,e,s){if(!(0<=i&&i<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(i===t&&e===s)return sh;const n=Qo?new Float32Array(Le):new Array(Le);for(let a=0;a<Le;++a)n[a]=gs(a*ps,i,e);function r(a){let o=0,h=1;const c=Le-1;for(;h!==c&&n[h]<=a;++h)o+=ps;--h;const l=(a-n[h])/(n[h+1]-n[h]),d=o+l*ps,g=zn(d,i,e);return g>=Jo?eh(a,d,i,e):g===0?d:th(a,o,o+ps,i,e)}return a=>a===0||a===1?a:gs(r(a),t,s)}function ui(i){switch(i){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function qn(i){const[t,e,s,n]=ui(i);return[1-s,1-n,1-t,1-e]}function ih(i){return li(...ui(i))}function nh(i){return li(...qn(i))}const Bt={Utils:{Linear:function(i,t,e){return(t-i)*e+i},Factorial:function(){const i=[1];return function(t){let e=1;if(i[t])return i[t];for(let s=t;s>1;s--)e*=s;return i[t]=e,e}}(),Bernstein:function(i,t){const e=Bt.Utils.Factorial;return e(i)/e(t)/e(i-t)},CatmullRom:function(i,t,e,s,n){const r=(e-i)*.5,a=(s-t)*.5,o=n*n,h=n*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*n+t},QuadraticBezier:(i,t,e,s)=>{const n=1-s;return n*n*i+2*n*s*t+s*s*e},CubicBezier:(i,t,e,s,n)=>{const r=1-n;return r*r*r*i+3*r*r*n*t+3*r*n*n*e+n*n*n*s}},Linear:function(i,t){const e=i.length-1,s=e*t,n=Math.floor(s),r=Bt.Utils.Linear;return t<0?r(i[0],i[1],s):t>1?r(i[e],i[e-1],e-s):r(i[n],i[n+1>e?e:n+1],s-n)},Bezier:function(i,t){let e=0;const s=i.length-1,n=Math.pow,r=Bt.Utils.Bernstein;for(let a=0;a<=s;a++)e+=n(1-t,s-a)*n(t,a)*i[a]*r(s,a);return e},CatmullRom:function(i,t){const e=i.length-1;let s=e*t,n=Math.floor(s);const r=Bt.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(n=Math.floor(s=e*(1+t))),r(i[(n-1+e)%e],i[n],i[(n+1)%e],i[(n+2)%e],s-n)):t<0?i[0]-(r(i[0],i[0],i[1],i[1],-s)-i[0]):t>1?i[e]-(r(i[e],i[e],i[e-1],i[e-1],s-e)-i[e]):r(i[n?n-1:0],i[n],i[e<n+1?e:n+1],i[e<n+2?e:n+2],s-n)}};class Hn{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=j(),e=!1){const s=Object.keys(this._tweens);for(let n=0;n<s.length;n++){const r=this._tweens[s[n]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[n]]}return!!Object.keys(this._tweens).length}}const wt=new Hn;class di{constructor(t,e=wt){this._object=t,this._group=e}_id=_e.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=I.Linear.None;_interpolationFunction=Bt.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=j()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,s,n){for(const r in s){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),s[r]=[a].concat(l)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];n[r]=o?[]:{},this._setupProperties(a,e[r],s[r],n[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?n[r]=s[r].slice().reverse():n[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=j()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=j()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=wt){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=I.Linear.None){return this._easingFunction=t,this}interpolation(t=Bt.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=j(),e=!0){if(this._isPaused)return!0;let s,n;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),n=(t-this._startTime)/this._durationTime,n=this._durationTime===0||n>1?1:n;const a=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),n===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,h=this._chainedTweens.length;o<h;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,s,n){for(const r in s){if(e[r]===void 0)continue;const a=e[r]||0;let o=s[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?t[r]=this._interpolationFunction(o,n):typeof o=="object"&&o?this._updateProperties(t[r],a,o,n):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*n))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const rh=_e.nextId,ah=wt.getAll.bind(wt),oh=wt.removeAll.bind(wt),hh=wt.add.bind(wt),ch=wt.remove.bind(wt),lh=wt.update.bind(wt),uh={now:j,Sequence:_e,Easing:I,Interpolation:Bt,Group:Hn,Tween:di,nextId:rh,getAll:ah,removeAll:oh,add:hh,remove:ch,update:lh};class ys{tweens=[];taskQueue=new Qa(1);isKill=!1;frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){to(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const n={...s};delete n.tween,n.toValues={...n.toValues},n.fromValues={...n.fromValues},e.push(n)}),e}addTween(t,e,s){const n={fromValues:t,toValues:e,frames:typeof s?.frames=="number"?s.frames:1,delay:typeof s?.delay=="number"?s.delay:this.tweens.length,easeFunction:s?.easeFunction||I.Linear.None,interpolationFunction:s?.interpolationFunction||Bt.Linear,repeat:typeof s?.repeat=="number"?s.repeat:0,yoyo:s?.yoyo||!1,onStart:s?.onStart||(()=>{}),onUpdate:s?.onUpdate||(()=>{}),onComplete:s?.onComplete||(()=>{})};return this.tweens.push(n),this}runTweens(t){return new Promise(e=>{this.onGroupStart?.();let s=0;ni(n=>{s==0&&(s=n);const r=n-s;t.filter(o=>o.delay*this.frameDuration<=r).forEach(o=>{o.tween||(o.tween=new di({...o.fromValues}).to({...o.toValues},o.frames*this.frameDuration).easing(o.easeFunction).interpolation(o.interpolationFunction).repeat(o.repeat).yoyo(o.yoyo).onStart(o.onStart).onUpdate(o.onUpdate).onComplete(o.onComplete),o.tween.start(n)),(o.delay+o.frames*(o.repeat+1))*this.frameDuration>r?o.tween.update(n):(o.tween.isPlaying()&&o.tween.end(),Te(t,o))});const a=!!t.length;return a||(this.onGroupComplete?.(),e()),a})})}play(t=this.cloneTweens(this.tweens)){this.taskQueue.addTask(()=>this.runTweens(t))}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(s=>{e=Math.max(e,s.delay+s.frames),s.easeFunction=Yn(s.easeFunction);const n={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...n}}),t.forEach(s=>{s.delay=e-s.frames}),this.play(t)}pause(){}resume(){}}class dh{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=j(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=j();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class U extends ss{id;originD;originMatrix;independentTransformInGroup;forceCXY=!1;cX;cY;x;y;degree;scalarX;scalarY;diffXInGroup;diffYInGroup;diffDegreeInGroup;diffScalarXInGroup;diffScalarYInGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;strokeArmyAnts;strokeArmyAntsOffset=0;strokeDashTotalLength=0;isShow=!0;el;pathd;usePathDtoCanvasContext=!1;parent;shapes=[];constructor(t){if(super(),this.id=zs(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const s=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",s),this.strokeDashTotalLength=yn(s).reduce((n,r)=>n+r,0)}return za(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new pt,Hs(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(s=>{const n=s.originMatrix?s.originMatrix.clone():new at;n.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=n});const e=this.originMatrix?this.originMatrix.clone():new at;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof ds)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(n);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,s){if(s instanceof ds)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(n):!1}clone(){return Wa(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,n])=>[ct(s),n]))):e&&(this.attrs[ct(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[ct(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[ct(t)]}distance(t){return hs(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=tt($t(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:n}=At(O(this.degree),e);this.vx=s,this.vy=n,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:n}=At(O(this.degree),e);this.ax=s,this.ay=n,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,n=e*e+s*s,r=Math.sqrt(n),a=this.mass*t.mass/n,o=a*e/r,h=a*s/r;this.vx+=o/this.mass,this.vy+=h/this.mass,t.vx-=o/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=jt(t?.gravity,0);this.vy+=e;const s=jt(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=jt(e?.easing,.05),n=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=n*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=jt(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(n=>{const r=n.x-this.cX-this.x,a=n.y-this.cY-this.y,o=r*s,h=a*s;this.vx+=o,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const s=jt(e?.springLength,100),n=jt(e?.spring,1e-4),r=t.x-this.x,a=t.y-this.y,o=Math.sqrt(r*r+a*a);if(o<s){const h=r*n,c=a*n;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-o/s}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const s=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*s),this.getPointAtLength(e*s)}strokeDashTween(t=1e3,e){const s=this.initPathD(),n=Et(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const r=e?.onUpdate,a=new ys({frameDuration:t});a.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,h)=>{this.setAttr("strokeDashoffset",""+Et(o.offset,2)),r?.(o,h)}})),a.play()}}class Re extends U{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["M",this.getScreenX(),this.getScreenY()]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=Tt(O(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Tt(O(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Tt(O(t),this.x,this.y))}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return os(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,n=t.z-this.z;return Math.sqrt(e*e+s*s+n*n)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,n=this.z;return{x:s*t.z-n*t.y,y:n*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}const jn=[1,0,0,1,0,0],Wn=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class at{value;_m13=0;_m23=0;_m33=1;matrix3d;constructor(t=jn){this.value=Array.from(t),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D()}static fromString(t){const e=new at,s=nn("number",t);return s.length===6&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this._m13}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this._m23}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this._m33}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this._m13=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this._m23=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this._m33=t}toMatrix3D(t=this.matrix3d){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new ut(e)}identity(){return this.value=Array.from(jn),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D(),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.scalar(1/t)}transformPoint(t){const e=t.z||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31,y:t.x*this.m12+t.y*this.m22+e*this.m32,z:t.x*this.m13+t.y*this.m23+e*this.m33}}clone(){return new at([...this.value])}multiply(t){const e=this.clone(),s=t instanceof at?t:new at(t);return this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,s=this.m13,n=this.m21,r=this.m22,a=this.m23,o=this.m31,h=this.m32,c=this.m33,l=c*r-a*h,d=-c*n+a*o,g=h*n-r*o;let y=t*l+e*d+s*g;return y?(y=1/y,this.m11=l*y,this.m12=(-c*e+s*h)*y,this.m13=(a*e-s*r)*y,this.m21=d*y,this.m22=(c*t-s*o)*y,this.m23=(-a*t+s*n)*y,this.m31=g*y,this.m32=(-h*t+e*o)*y,this.m33=(r*t-e*n)*y,this):null}adjugate(){const t=new at;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=tt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,degree:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:tt(Math.atan2(-this.m21,this.m22)),skewY:tt(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],n=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],d=t.value[3],g=t.value[4],y=t.value[5],p=h*d,x=c*l,b=(l*s-e*d)/(x-p),S=(h*s-e*c)/(p-x),C=(l*r-n*d)/(x-p),L=(h*r-n*c)/(p-x),R=(l*(o-y)+d*(g-a))/(x-p),Y=(h*(o-y)+c*(g-a))/(p-x),X=[b,S,C,L,R,Y];return new at(X)}toString(t=6){return this.matrix3d.is2D()?`matrix(${this.value.map(e=>Et(e,t)).join(",")})`:this.matrix3d.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix3D(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.matrix3d.translate(0,0,t),this.matrix3d.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix3d.m43),this}translate3d(t,e,s){return this.matrix3d.translate(t,e,s),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,s-this.matrix3d.m43),this}rotate(t,e=0,s=0){const n=O(t),r=Math.cos(n),a=Math.sin(n);return this.translate(e,s),this.multiply([r,a,-a,r,0,0]),this.translate(-e,-s),this.toMatrix3D(),this}rotateTo(t,e=0,s=0){const{degree:n}=this.split();return this.rotate(t-n,e,s),this}rotateX(t){return this.matrix3d.rotateX(t),this.matrix3d.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix3d.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix3d.rotateY(t),this.matrix3d.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix3d.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix3d.rotateZ(t),this.matrix3d.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix3d.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix3d.rotateX(t).rotateY(e).rotateZ(s),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:n,degreeY:r,degreeZ:a}=this.matrix3d.split();return this.rotate3d(t-n,e-r,s-a),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.multiply([t,0,0,e,0,0]),this.translate(-s,-n),this.toMatrix3D(),this}scaleTo(t,e=t,s=0,n=0){return this.scale(t/this.m11,e/this.m22,s,n)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix3d.scale(1,1,t),this.matrix3d.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix3d.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix3d.scale(t,e,s),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:n,scalarY:r,scalarZ:a}=this.matrix3d.split();return this.scale3d(t/n,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(O(e)),Math.sin(O(e)),-Math.sin(O(t)),Math.cos(O(t)),0,0]),this.toMatrix3D(),this}skewTo(t,e=t){const{skewX:s,skewY:n}=this.split();return this.skew(t-s,e-n)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix3d.perspective(t),this.matrix3d.toMatrix(this),this}}class ut{value;is3dSpecial=!1;constructor(t=Wn){this.value=Array.from(t)}static fromString(t){const e=new ut,s=nn("number",t);return s.length===16&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from(Wn),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}clone(){return new ut([...this.value])}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this.m41*=t,this.m42*=t,this.m43*=t,this.m44*=t,this}normalize(){return this.scalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,s=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+s*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+s*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+s*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+s*this.m44}}toMatrix(t){const{scalarX:e,scalarY:s,skewX:n,skewY:r,x:a,y:o}=this.split(),h=[e,r,n,s,a,o];return t?(t.value=h,t):new at(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>Et(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),n=tt(yt(Math.asin(-this.m13),-1,1));let r=tt(Math.atan2(this.m23,this.m33));Math.cos(O(n))===0&&(r=tt(Math.atan2(-this.m31,this.m22)));let a=tt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(a+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:s,degreeX:r,degreeY:n,degreeZ:a,skewX:tt(this.m14),skewY:tt(this.m24),skewZ:tt(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}inverse(){const t=[],e=this.m11,s=this.m12,n=this.m13,r=this.m14,a=this.m21,o=this.m22,h=this.m23,c=this.m24,l=this.m31,d=this.m32,g=this.m33,y=this.m34,p=this.m41,x=this.m42,b=this.m43,S=this.m44;t[0]=h*y*x-c*g*x+c*d*b-o*y*b-h*d*S+o*g*S,t[1]=r*g*x-n*y*x-r*d*b+s*y*b+n*d*S-s*g*S,t[2]=n*c*x-r*h*x+r*o*b-s*c*b-n*o*S+s*h*S,t[3]=r*h*d-n*c*d-r*o*g+s*c*g+n*o*y-s*h*y;const C=e*t[0]+a*t[1]+l*t[2]+p*t[3];if(C==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=c*g*p-h*y*p-c*l*b+a*y*b+h*l*S-a*g*S,t[5]=n*y*p-r*g*p+r*l*b-e*y*b-n*l*S+e*g*S,t[6]=r*h*p-n*c*p-r*a*b+e*c*b+n*a*S-e*h*S,t[7]=n*c*l-r*h*l+r*a*g-e*c*g-n*a*y+e*h*y,t[8]=o*y*p-c*d*p+c*l*x-a*y*x-o*l*S+a*d*S,t[9]=r*d*p-s*y*p-r*l*x+e*y*x+s*l*S-e*d*S,t[10]=s*c*p-r*o*p+r*a*x-e*c*x-s*a*S+e*o*S,t[11]=r*o*l-s*c*l-r*a*d+e*c*d+s*a*y-e*o*y,t[12]=h*d*p-o*g*p-h*l*x+a*g*x+o*l*b-a*d*b,t[13]=s*g*p-n*d*p+n*l*x-e*g*x-s*l*b+e*d*b,t[14]=n*o*p-s*h*p-n*a*x+e*h*x+s*a*b-e*o*b,t[15]=s*h*l-n*o*l+n*a*d-e*h*d-s*a*g+e*o*g,this.value=t,this.scalar(1/C)}multiply(t){const e=this.clone();return this.m11=t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.m41,this.m12=t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.m42,this.m13=t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.m43,this.m14=t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,this.m21=t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.m41,this.m22=t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.m42,this.m23=t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.m43,this.m24=t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,this.m31=t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.m41,this.m32=t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.m42,this.m33=t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.m43,this.m34=t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,this.m41=t.m41*e.m11+t.m42*e.m21+t.m43*e.m31+t.m44*e.m41,this.m42=t.m41*e.m12+t.m42*e.m22+t.m43*e.m32+t.m44*e.m42,this.m43=t.m41*e.m13+t.m42*e.m23+t.m43*e.m33+t.m44*e.m43,this.m44=t.m41*e.m14+t.m42*e.m24+t.m43*e.m34+t.m44*e.m44,this}translate(t=0,e=0,s=0){return this.multiply(new ut([1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1]))}scale(t=1,e=1,s=1){return this.multiply(new ut([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}rotateX(t){const e=O(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new ut([1,0,0,0,0,s,n,0,0,-n,s,0,0,0,0,1]))}rotateY(t){const e=O(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new ut([s,0,-n,0,0,1,0,0,n,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=O(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new ut([s,n,0,0,-n,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new ut([1,0,0,O(t),0,1,0,O(e),0,0,1,O(s),0,0,0,1]))}perspective(t){return this.multiply(new ut([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,n=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,a=e+this.m31,o=s+this.m32,h=n+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,n/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-n;if(l==0)return{x:e,y:s,z:n,mass:r};const d=-n/l;return e+=d*(a-e),s+=d*(o-s),{x:e,y:s,z:n,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,n=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,n/=r,r<0&&(s-=this.m41,n-=this.m42,s*=1/r,n*=1/r,s+=this.m41,n+=this.m42),{x:s,y:n,z:e,mass:r}}bounds(t,e,s,n){const r=new Re({x:t,y:e}),a=new Re({x:t+s,y:e}),o=new Re({x:t+s,y:e+n}),h=new Re({x:t,y:e+n});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,a.x,o.x,h.x),l=Math.min(r.y,a.y,o.y,h.y),d=Math.max(r.x,a.x,o.x,h.x)-c,g=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:d,height:g}}}function fi(i){const t=new at;return i.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,n){n.indexOf(",")>=0?n=n.split(/\s*,\s*/):n=n.split(/\s+/);const r=[];for(let a=0,o=n.length;a<o;a++)n[a].trim()&&r.push(parseFloat(""+n[a]));switch(s.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix3D();break;case"matrix3d":t.matrix3d.multiply(new ut(r)),t.matrix3d.toMatrix(t);break}return""}),t}function Tt(i,t,e){const s=new at;return s.rotate(tt(i)),s.transformPoint({x:t,y:e})}function mi(i){const t=typeof i?.x=="number"?i?.x:0,e=typeof i?.y=="number"?i?.y:0,s=typeof i?.degree=="number"?i?.degree:0,n=typeof i?.scalarX=="number"?i?.scalarX:1,r=typeof i?.scalarY=="number"?i?.scalarY:1,a=O(s),o=Math.cos(a),h=Math.sin(a),c=new DOMMatrix([o*n,h*n,-h*r,o*r,t,e]);return c.multiplySelf(new DOMMatrix(i?.originMatrix||"")),c}function fh(i,t){const e=new Path2D(i),s=new Path2D;return s.addPath(e,mi(t)),s}function $n(i,t){const e={x:t.m11,y:t.m12,z:t.m13},s={x:t.m21,y:t.m22,z:t.m23},n={x:t.m31,y:t.m32,z:t.m33},r=i.transformPoint(e),a=i.transformPoint(s),o=i.transformPoint(n),h=new at;return h.m11=r.x,h.m12=r.y,h.m13=r.z,h.m21=a.x,h.m22=a.y,h.m23=a.z,h.m31=o.x,h.m32=o.y,h.m33=o.z,h}function Jn(i,t){const e={x:t.m11,y:t.m12,z:t.m13,w:t.m14},s={x:t.m21,y:t.m22,z:t.m23,w:t.m24},n={x:t.m31,y:t.m32,z:t.m33,w:t.m34},r={x:t.m41,y:t.m42,z:t.m43,w:t.m44},a=i.transformPoint(e),o=i.transformPoint(s),h=i.transformPoint(n),c=i.transformPoint(r);return new ut([a.x,a.y,a.z,a.w,o.x,o.y,o.z,o.w,h.x,h.y,h.z,h.w,c.x,c.y,c.z,c.w])}function mh(i){let t=i[0];for(let e=1,s=i.length;e<s;e++)t=$n(t,i[e]);return t}function ph(i){let t=i[0];for(let e=1,s=i.length;e<s;e++)t=Jn(t,i[e]);return t}class k{static createElementNS(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}static origins=new Ke;static updates=new Ke;static patchDom=()=>{this.origins.filter((t,e)=>{const s=this.updates.get(t);return s&&ns(e,s),this.updates.delete(t),!1})};static getVNode(t,e){let s=t.getAttribute("id")||"";s||(s=e||zs(),t.setAttribute("id",s)),this.origins.get(s)||this.origins.set(s,Wt(t.tagName,{},[],t));const n=this.updates.get(s)||Wt(t.tagName,{},[],t);return{vnode:n,immediate:()=>{this.updates.set(s,n),k.patchDom()},schedule:()=>{this.updates.set(s,n),hi("FLUSH_DOM_ACTIONS",k.patchDom,50)}}}static getElement(t){const e=t.style?t.ownerDocument:t.document||t;return{el:t,document:e,window:e.defaultView,isRootNode:/(html|body)/i.test(t.tagName)||t===document}}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static add3DSupport(t,e="1000px"){if(t.parentElement){const s=k.getStyle(t.parentElement,"position");k.setStyle(t.parentElement,{position:s=="static"?"relative":s,perspective:e})}k.setStyle(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,s={}){Object.prototype.hasOwnProperty.call(s,"transform")||Object.assign(s,{transform:k.getStyle(t,"transform")||""});const n=fi(s.transform),r={};for(const a in e){const o=e[a];switch(a){case"transform":break;case"translate":n.translate(o[0]||0,o[1]||0);break;case"translateTo":n.translateTo(o[0]||0,o[1]||0);break;case"translateX":n.translateX(o||0);break;case"translateXTo":n.translateXTo(o||0);break;case"translateY":n.translateY(o||0);break;case"translateYTo":n.translateYTo(o||0);break;case"translateZ":n.translateZ(o||0);break;case"translateZTo":n.translateZTo(o||0);break;case"translate3d":n.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":n.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?n.rotate(o||0):n.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?n.rotateTo(o||0):n.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":n.rotateX(o||0);break;case"rotateXTo":n.rotateXTo(o||0);break;case"rotateY":n.rotateY(o||0);break;case"rotateYTo":n.rotateYTo(o||0);break;case"rotateZ":n.rotateZ(o||0);break;case"rotateZTo":n.rotateZTo(o||0);break;case"rotate3d":n.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":n.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?n.scale(o||1):n.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?n.scaleTo(o||1):n.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":n.scaleX(o||1);break;case"scaleXTo":n.scaleXTo(o||1);break;case"scaleY":n.scaleY(o||1);break;case"scaleYTo":n.scaleYTo(o||1);break;case"scaleZ":n.scaleZ(o||1);break;case"scaleZTo":n.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?n.scale3d(o||1):n.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?n.scale3dTo(o||1):n.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?n.skew(o||0):n.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?n.skewTo(o||0):n.skewTo(o[0]||0,o[1]||0);break;case"skewX":n.skewX(o||0);break;case"skewXTo":n.skewXTo(o||0);break;case"skewY":n.skewY(o||0);break;case"skewYTo":n.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":n.perspective(o||0);break;default:Object.prototype.hasOwnProperty.call(s,a)||(s[a]=k.getStyle(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:n.toString()}),r}static attrsToCanvas(t,e){for(const s in e){const n=e[s];switch(s){case"fill":n!=="none"&&(t.fillStyle=n);break;case"stroke":n!=="none"&&(t.strokeStyle=n);break;case"stroke-width":case"strokeWidth":t.lineWidth=Number(n);break;case"stroke-linecap":case"strokeLinecap":t.lineCap=n;break;case"stroke-linejoin":case"strokeLinejoin":switch(n){case"round":case"bevel":case"miter":t.lineJoin=n;break;default:t.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":t.miterLimit=Number(n);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":t.lineDashOffset=Number(n);break;case"stroke-dasharray":case"strokeDasharray":typeof n=="string"&&t.setLineDash(n.split(/\s+/).map(r=>Number(r)));break;case"cursor":break;case"font":typeof n=="string"&&(t.font=n);break;case"font-size":case"fontSize":t.font+=` ${n}`;break;case"font-family":case"fontFamily":t.font+=` ${n}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(n){case"middle":t.textAlign="center";break;case"end":t.textAlign="end";break;case"start":t.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(n){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":t.textBaseline=n;break;default:t.textBaseline="alphabetic";break}break}}}static getStyle(t,e,s){const n=t;if(getComputedStyle)if(e){e=ct(e);const r=getComputedStyle(n,s).getPropertyPriority(e);return getComputedStyle(n,s).getPropertyValue(e).trim()+(r?"!"+r:"")}else{const r=[],a=getComputedStyle(n,"");for(let o=0;o<a.length;o++)r.push(a[o]+":"+a.getPropertyValue(a[o]));return r.push(...(n.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}else if(t.currentStyle){if(e)return e=on(e),t.currentStyle[e];{const r=[],a=n.currentStyle;for(const o in a)r.push(o+":"+a[o]);return r.push(...(n.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}}}static setStyle(t,e,s){typeof e=="string"&&s?t.style.setProperty(ct(e),s.replace(/!important/i,""),String(s).toLowerCase().includes("!important")?"important":""):e instanceof Object&&Object.keys(e).forEach(n=>{t.style.setProperty(ct(n),String(e[n]).replace(/!important/i,""),String(e[n]).toLowerCase().includes("!important")?"important":"")})}static setStyleSheet(t,e){let s;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?s=r:s=document.querySelector(e)}else s=e;const n=document.createElement("style");if(n.innerHTML=t,s)return s.appendChild(n),()=>{(s instanceof HTMLElement||s instanceof ShadowRoot)&&s.removeChild(n)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static toggleClass(t,e,s="toggle"){e.split(/[,\s]+/).forEach(n=>{n.trim()!==""&&t.classList[s](n.trim())})}static addClass(t,e){this.toggleClass(t,e,"add")}static removeClass(t,e){this.toggleClass(t,e,"remove")}static hasClass(t,e){return e.split(/[,\s]+/).every(s=>s.trim()!==""?Array.from(t.classList||[]).includes(s.trim()):!0)}static toggleDisplay(t,e){this.getStyle(t,"display")=="none"&&e===void 0||e===!0?t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block"):t.style.setProperty("display","none")}static show(t){t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block")}static hide(t){t.style.setProperty("display","none")}static attribute(t,e,s){let n={};if(e===void 0&&s===void 0){for(let o=0,h=t.attributes,c=h.length;o<c;o++){const l=h[o];l.nodeName&&l.nodeValue&&(n[l.nodeName]=l.nodeValue)}return n}if(typeof e=="string"&&s===void 0)return t.getAttribute(ct(e));typeof e=="object"?n=e:typeof e=="string"&&s!==void 0&&(n[e]=s);const{vnode:r,schedule:a}=this.getVNode(t,n.id);Object.entries(n).forEach(([o,h])=>{r.props[ct(o)]=h}),a()}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&t.removeAttribute(s.trim())})}static fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static prop(t,e,s){if(s===void 0&&typeof e=="string")return t[e];{let n={};typeof e=="object"?n=e:typeof e=="string"&&s!==void 0&&(n[e]=s),Object.entries(n).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t[this.fixProp(s.trim())]})}static data(t,e,s){if(typeof e=="string"&&(e=on(e)),(typeof e=="string"||e===void 0)&&s===void 0){const n=Object.assign({},t.dataset);return Object.keys(n).forEach(r=>{if(n[r]?.startsWith("[")||n[r]?.startsWith("{"))try{n[r]=JSON.parse(n[r]||"")}catch{}}),typeof e=="string"?n[e]:n}else{let n={};typeof e=="object"?n=e:typeof e=="string"&&(n[e]=s),Object.entries(n).forEach(([r,a])=>{a!=null?t.dataset[r]=a instanceof Object?JSON.stringify(a):a:delete t.dataset[r]})}}static removeData(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t.dataset[s.trim()]})}static empty(t){this.html(t,"")}static html(t,e){e instanceof HTMLElement||e instanceof SVGElement?this.insert(t,e,"replaceWith"):this.prop(t,"innerHTML",e)}static text(t,e){return this.prop(t,"textContent",e)}static value(t,e){return this.prop(t,"value",e)}static dispatchEvent(t,e,s){let n;const r=["click","dblclick","mousedown","mouseup","mousemove"],a=["keydown","keyup","keypress"];typeof e=="string"?r.includes(e)?n=new MouseEvent(e,s):a.includes(e)?n=new KeyboardEvent(e,s):n=new Event(e,s):n=e,t.dispatchEvent(n)}static scriptConvert(t){const e=s=>{const r=s.ownerDocument.createElement("script");r.text=s.text;const a=s.attributes;for(let o=0;o<a.length;o++)r.setAttribute(a[o].name,a[o].value);return r};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(s=>{s.parentNode?.replaceChild(e(s),s)}),t}static insert(t,e,s="append"){return typeof e=="string"?t[s](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[s](e),this}static createElement(t){return document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}static fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(s=>{const n=this.scriptConvert(s);n!=s&&e.content.replaceChild(n,s)}),e.content}static remove(t){return t.remove()}static siblings=t=>Array.prototype.slice.call(t.parentElement?.children).filter(e=>e!==t);static nextElementSibling(t){return t.nextElementSibling}static previousElementSibling(t){return t.previousElementSibling}static closest(t,e){return t.closest(e)}static shadowRoot(t){return t.shadowRoot}static parentElement=t=>t.parentElement;static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const s=t.options;for(let n=0,r=s.length;n<r;n++)s[n].value==e?s[n].selected=!0:s[n].selected=!1}}static changeRadioChecked(t,e){t instanceof HTMLInputElement&&(t.value==e?t.checked=!0:t.checked=!1)}static entity2text(t){const e={lt:60,"lt;":60,"AMP;":38,AMP:38,"GT;":62,GT:62,"QUOT;":34,QUOT:34,"apos;":39,"bull;":8226,"bullet;":8226,"copy;":169,copy:169,"deg;":176,deg:176};let s;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?s=parseInt(t.substring(2),16):s=parseInt(t.substring(1),10):s=e[t],s?String.fromCharCode(s):"&"+t}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let s=document.styleSheets.length||0;const n=()=>s>=e.length?(t(),!0):!1;n()||e.forEach(r=>{r.onload=()=>{s+=1,n()}})});static loadScript(t,e=()=>{},s=(n,r,a,o,h)=>{}){const n=document.createElement("script");n.type="text/javascript",n.src=t,n.async=!1,n.onload=e,n.onerror=s,document.body.appendChild(n)}static runInSafe(t){const e=new Proxy(window,{get(s,n,r){if(typeof n=="string"&&["open","location","document"].includes(n))throw new Error(`禁止访问 key: ${n}`);return n==="window"?e:Reflect.get(s,n,r)},set(s,n,r,a){return Reflect.set(s,n,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(s={},...n){const r=document.createElement(e);for(const a of Object.keys(s))r.setAttribute(a,s[a]);for(const a of n)typeof a=="string"?r.appendChild(document.createTextNode(a)):r.appendChild(a);return r}}});static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
|
|
10
|
+
`.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},Ot=(i,t)=>(typeof i=="string"&&(i=Qe(i)||new RegExp(i)),i.test(t)),nn=(i,t)=>{if(typeof i=="string"&&(i=Qe(i)||new RegExp(i)),!t)return null;const e=t.match(i);return e?i.flags.toLowerCase().indexOf("g")>=0?e.map(s=>({matchIndex:-1,fullMatch:s,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},rn=(i,t)=>{typeof i=="string"&&(i=Qe(i)||new RegExp(i));const e=[],s=t.matchAll(i);for(const n of s)e.push({matchIndex:typeof n.index=="number"?n.index:-1,fullMatch:n[0],groupMatchs:n.slice(1)});return e};function an(i){const t=i.match(/[\s\S]/gu);return t?t.length:0}function on(i,t){const e=i.codePointAt(t);return e?String.fromCodePoint(e):void 0}const Q=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function Vs(){const i=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(Q[i&255]+Q[i>>8&255]+Q[i>>16&255]+Q[i>>24&255]+"-"+Q[t&255]+Q[t>>8&255]+"-"+Q[t>>16&15|64]+Q[t>>24&255]+"-"+Q[e&63|128]+Q[e>>8&255]+"-"+Q[e>>16&255]+Q[e>>24&255]+Q[s&255]+Q[s>>8&255]+Q[s>>16&255]+Q[s>>24&255]).toLowerCase()}function Oa(i){const t=pe.get(i);if(t)return t;const e=i.replace(/(^\w)/g,function(s){return s.toLowerCase()});return pe.set(i,e),e}const ct=(i,t="-")=>{const e=pe.get(i);if(e)return e;let s=i.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return s=s.replace(new RegExp(`^${t}`),""),pe.set(i,s),s};function zs(i){const t=pe.get(i);if(t)return t;const e=i.replace(/(^\w|[_-]\w)/g,function(s){return s.slice(-1).toUpperCase()});return pe.set(i,e),e}function hn(i){return Oa(zs(i))}function Na(i,t,e="0",s="left"){const n=an(i);if(t>n){const r=t-n;let a,o;switch(s){case"left":i=Array(r+1).join(e)+i;break;case"right":i=i+Array(r+1).join(e);break;default:a=Math.ceil(r/2),o=r-a,i=Array(o+1).join(e)+i+Array(a+1).join(e);break}}return i}function cn(i){let t="";for(let e=0,s=i.length;e<s;e++){const n=i.charCodeAt(e);n>=1&&n<=127?t+=i.charAt(e):n>2047?(t+=String.fromCharCode(224|n>>12&15),t+=String.fromCharCode(128|n>>6&63),t+=String.fromCharCode(128|n>>0&63)):(t+=String.fromCharCode(192|n>>6&31),t+=String.fromCharCode(128|n>>0&63))}return t}var Nt=(i=>(i.UNKNOWN="",i.HTML="text/html",i.CSS="text/css",i.TEXT="text/plain",i.MD="text/plain",i.JPEG="image/jpeg",i.PNG="image/png",i.GIF="image/gif",i.WEBP="image/webp",i.SVG="image/svg+xml",i.ICO="image/x-icon",i.MPEG="audio/mpeg",i.MP3="audio/mpeg",i.OGG="audio/ogg",i.WAV="audio/wav",i.MP4="video/mp4",i.WEBM="video/webm",i.JSON="application/json",i.XWWW="application/x-www-form-urlencoded",i.XHTML="application/xhtml+xml",i.XML="application/xml",i.XML_TEXT="text/xml",i.JAVASCRIPT="application/javascript",i.ECMASCRIPT="application/ecmascript",i.DOC="application/msword",i.CSV="application/x-csv",i.EXCEL="application/vnb.ms-excel",i.PDF="application/pdf",i.ZIP="application/zip",i.TGZ="application/x-gtar",i.TAR_GZ="application/x-gzip",i.EOT="appliaction/vnd.ms-fontobject",i.TTF="aplication/font-sfnt",i))(Nt||{});const Fa=(i,t=16)=>i.toString(t),ae=(i,t=16)=>{let e=i.toLowerCase();const s=e.indexOf("0b")==0,n=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||n||r)&&(e=e.slice(2));const a=parseInt(e,t);if(isNaN(a))throw new Error(`radixStringToNumber(${i}, ${t}) 无法解析!`);return a};function ts(i,t){if(i instanceof ArrayBuffer)return Array.from(new Uint8Array(i));let e=[];if(Array.isArray(i))return i.forEach(s=>{typeof s=="number"?e.push(s):e=e.concat(ts(s,t))}),e;if(typeof i=="number")for(;i>0;){const s=i&255;e.unshift(s),i=(i-s)/256}if(typeof i=="string")if(t){let s=i.toLowerCase();switch(t){case 16:default:s.indexOf("0x")==0&&(s=s.slice(2));for(let n=0,r=s.length;n<r;n+=2)e.push(ae(s.slice(n,n+2),t));break}}else for(const s of i){const n=s.codePointAt(0);n&&e.push(n)}return e}function Ba(i,t){if(i instanceof ArrayBuffer)return i;const e=ts(i,t);return new Uint8Array(e).buffer}function Xa(i,t){const e=ts(i,t);return String.fromCodePoint.apply(null,e)}function Ya(i,t){const e=ts(i,t);let s="";for(let n=0,r=e.length;n<r;n++)s+=Fa(e[n],16).padStart(2,"0");return s}function Ua(){const i=Uint32Array.of(305419896),t=new Uint8Array(i.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const ln=i=>{let t=Nt.UNKNOWN;switch(new DataView(i).getUint32(0,Ua()).toString(16).toUpperCase()){case"FFD8FFDB":t=Nt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Nt.JPEG;break;case"89504E47":t=Nt.PNG;break;case"47494638":t=Nt.GIF;break;case"52494646":t=Nt.WEBP;break;case"25504446":t=Nt.PDF;break;case"504B0304":t=Nt.ZIP;break}return t};let Ee;class Ga{subscribers;constructor(){this.subscribers=new Set}add(){Ee&&!this.subscribers.has(Ee)&&this.subscribers.add(Ee)}notify(){this.subscribers.forEach(t=>t())}}const un=new WeakMap;function dn(i,t){let e=un.get(i);e||(e=new Map,un.set(i,e));let s=e.get(t);return s||(s=new Ga,e.set(t,s)),s}function qs(i){Ee=i,i(),Ee=null}const Va=Symbol("isProxy");function za(i){return new Proxy(i,{get(t,e,s){return e===Va?!0:(dn(i,e).add(),Reflect.get(t,e,s))},set(t,e,s,n){const r=dn(i,e);return i[e]!=s&&(i[e]=s,r.notify()),Reflect.set(t,e,s,n)}})}const qa=za,Ha="[object Object]";function ja(i){return Object.prototype.toString.call(i)}function Wa(i){return i!=null}function fn(i){return ja(i)===Ha}function $a(i,...t){return new i.constructor(...t)}function mn(i,t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(fn(t[e])?(typeof i[e]>"u"&&(i[e]={}),mn(i[e],t[e])):typeof i[e]>"u"&&(i[e]=t[e]));return i}function pn(i,t){for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&!t(e,i[e])&&delete i[e];return i}function Te(i,t){const e=i.findIndex(s=>s===t);return e>=0&&i.splice(e,1),i}let gn;try{gn=Map}catch{gn=function(){}}let yn;try{yn=Set}catch{yn=function(){}}function jt(i,t){if(i=parseFloat(i),isNaN(i)){if(typeof t=="number")return t;throw new Error(`parseNumber(${i}) isNaN!`)}return i}function es(i,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(i-t)<e}const yt=(i,t,e)=>i<t?t:i>e?e:i,Ja=(i,t,e)=>s=>{const n=Math.min(Math.max(i,s),t);return t-n<e?t:Math.round(n/e)*e};function Za(i,t=12){return jt(i).toFixed(t)}function Et(i,t=12){return+Za(i,t)}function Hs(i,t){const e=nn("number-single",String(i));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):Wa(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?i.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?i.substring(e.matchIndex+e.fullMatch.length):""}}function wn(i){const t=nn("number",i);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}Ka();function Ka(){const i=new ArrayBuffer(4),t=new Float32Array(i),e=new Uint32Array(i),s=new Uint32Array(512),n=new Uint32Array(512);for(let h=0;h<256;++h){const c=h-127;c<-27?(s[h]=0,s[h|256]=32768,n[h]=24,n[h|256]=24):c<-14?(s[h]=1024>>-c-14,s[h|256]=1024>>-c-14|32768,n[h]=-c-1,n[h|256]=-c-1):c<=15?(s[h]=c+15<<10,s[h|256]=c+15<<10|32768,n[h]=13,n[h|256]=13):c<128?(s[h]=31744,s[h|256]=64512,n[h]=24,n[h|256]=24):(s[h]=31744,s[h|256]=64512,n[h]=13,n[h|256]=13)}const r=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let h=1;h<1024;++h){let c=h<<13,l=0;for(;!(c&8388608);)c<<=1,l-=8388608;c&=-8388609,l+=947912704,r[h]=c|l}for(let h=1024;h<2048;++h)r[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)a[h]=h<<23;a[31]=1199570944,a[32]=2147483648;for(let h=33;h<63;++h)a[h]=2147483648+(h-32<<23);a[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(o[h]=1024);return{floatView:t,uint32View:e,baseTable:s,shiftTable:n,mantissaTable:r,exponentTable:a,offsetTable:o}}function j(){return(performance||Date).now()}function Qa(i,t){let e;return function(...s){clearTimeout(e),e=setTimeout(()=>{i.apply(this,s)},t)}}class js{events;constructor(){this.events={}}on(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].push(e),this}addListener(t,e){return this.on(t,e),this}prependListener(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(e),this}removeListener(t,e){if(this.events[t])return this.events[t]=this.events[t].filter(s=>s!==e),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].forEach(s=>{Reflect.apply(s,this,e)}),this}once(t,e){const n=(()=>{let r=!1;return(...a)=>{r||(r=!0,Reflect.apply(e,this,a),this.off(t,n))}})();return this.on(t,n),this}}function to(i,t=(e,s)=>e<=s){const e=i.length;let s=Math.floor(e/2);for(;s>0;){for(let n=s;n<e;n++){const r=i[n];let a=n;for(;a>=s&&!t(i[a-s],r);)i[a]=i[a-s],a-=s;i[a]=r}s=Math.floor(s/2)}}var xn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function eo(i,t={}){var e=1,s=1;function n(_){var A=_.match(/\n/g);A&&(e+=A.length);var N=_.lastIndexOf(`
|
|
11
|
+
`);s=~N?_.length-N:s+_.length}function r(){var _={line:e,column:s};return function(A){return A.position=new a(_),p(),A}}function a(_){this.start=_,this.end={line:e,column:s},this.source=t.source}a.prototype.content=i;var o=[];function h(_){var A=new Error(t.source+":"+e+":"+s+": "+_);if(A.reason=_,A.filename=t.source,A.line=e,A.column=s,A.source=i,t.silent)o.push(A);else throw A}function c(){var _=g();return{type:"stylesheet",stylesheet:{source:t.source,rules:_,parsingErrors:o}}}function l(){return y(/^{\s*/)}function d(){return y(/^}/)}function g(){var _,A=[];for(p(),x(A);i.length&&i.charAt(0)!="}"&&(_=le()||Se());)_!==!1&&(A.push(_),x(A));return A}function y(_){var A=_.exec(i);if(A){var N=A[0];return n(N),i=i.slice(N.length),A}}function p(){y(/^\s*/)}function x(_){var A;for(_=_||[];A=b();)A!==!1&&_.push(A);return _}function b(){var _=r();if(!(i.charAt(0)!="/"||i.charAt(1)!="*")){for(var A=2;i.charAt(A)!=""&&(i.charAt(A)!="*"||i.charAt(A+1)!="/");)++A;if(A+=2,i.charAt(A-1)==="")return h("End of comment missing");var N=i.slice(2,A-2);return s+=2,n(N),i=i.slice(A),s+=2,_({type:"comment",comment:N})}}function S(){var _=y(/^([^{]+)/);if(_)return Ft(_[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(A){return A.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(A){return A.replace(/\u200C/g,",")})}function C(){var _=r(),A=y(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(A){if(A=Ft(A[0]),!y(/^:\s*/))return h("property missing ':'");var N=y(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),P=_({type:"declaration",property:A.replace(xn,""),value:N?Ft(N[0]).replace(xn,""):""});return y(/^[;\s]*/),P}}function L(){var _=[];if(!l())return h("missing '{'");x(_);for(var A;A=C();)A!==!1&&(_.push(A),x(_));return d()?_:h("missing '}'")}function R(){for(var _,A=[],N=r();_=y(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)A.push(_[1]),y(/^,\s*/);if(A.length)return N({type:"keyframe",values:A,declarations:L()})}function Y(){var _=r(),A=y(/^@([-\w]+)?keyframes\s*/);if(A){var N=A[1];if(A=y(/^([-\w]+)\s*/),!A)return h("@keyframes missing name");var P=A[1];if(!l())return h("@keyframes missing '{'");for(var vt,ne=x();vt=R();)ne.push(vt),ne=ne.concat(x());return d()?_({type:"keyframes",name:P,vendor:N,keyframes:ne}):h("@keyframes missing '}'")}}function X(){var _=r(),A=y(/^@supports *([^{]+)/);if(A){var N=Ft(A[1]);if(!l())return h("@supports missing '{'");var P=x().concat(g());return d()?_({type:"supports",supports:N,rules:P}):h("@supports missing '}'")}}function V(){var _=r(),A=y(/^@host\s*/);if(A){if(!l())return h("@host missing '{'");var N=x().concat(g());return d()?_({type:"host",rules:N}):h("@host missing '}'")}}function it(){var _=r(),A=y(/^@media *([^{]+)/);if(A){var N=Ft(A[1]);if(!l())return h("@media missing '{'");var P=x().concat(g());return d()?_({type:"media",media:N,rules:P}):h("@media missing '}'")}}function W(){var _=r(),A=y(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(A)return _({type:"custom-media",name:Ft(A[1]),media:Ft(A[2])})}function $(){var _=r(),A=y(/^@page */);if(A){var N=S()||[];if(!l())return h("@page missing '{'");for(var P=x(),vt;vt=C();)P.push(vt),P=P.concat(x());return d()?_({type:"page",selectors:N,declarations:P}):h("@page missing '}'")}}function z(){var _=r(),A=y(/^@([-\w]+)?document *([^{]+)/);if(A){var N=Ft(A[1]),P=Ft(A[2]);if(!l())return h("@document missing '{'");var vt=x().concat(g());return d()?_({type:"document",document:P,vendor:N,rules:vt}):h("@document missing '}'")}}function nt(){var _=r(),A=y(/^@font-face\s*/);if(A){if(!l())return h("@font-face missing '{'");for(var N=x(),P;P=C();)N.push(P),N=N.concat(x());return d()?_({type:"font-face",declarations:N}):h("@font-face missing '}'")}}var bt=ie("import"),dt=ie("charset"),ve=ie("namespace");function ie(_){var A=new RegExp("^@"+_+"\\s*([^;]+);");return function(){var N=r(),P=y(A);if(P){var vt={type:_};return vt[_]=P[1].trim(),N(vt)}}}function le(){if(i[0]=="@")return Y()||it()||W()||X()||bt()||dt()||ve()||z()||$()||V()||nt()}function Se(){var _=r(),A=S();return A?(x(),_({type:"rule",selectors:A,declarations:L()})):h("selector missing")}return Ws(c())}function Ft(i){return i?i.replace(/^\s+|\s+$/g,""):""}function Ws(i,t){var e=i&&typeof i.type=="string",s=e?i:t;for(var n in i){var r=i[n];Array.isArray(r)?r.forEach(function(a){Ws(a,s)}):r&&typeof r=="object"&&Ws(r,s)}return e&&Object.defineProperty(i,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),i}const $s=(i,t="image/svg+xml",e="utf-8")=>e==="base64"?new Blob([i],{type:`${t};${e}`}):new Blob([i],{type:`${t};charset=${e}`}),Js=i=>new XMLSerializer().serializeToString(i),so=(i,t="text/html")=>new DOMParser().parseFromString(i,t),bn=(i,t="image/svg+xml",e="utf-8")=>$s(Js(i),t,e),Zs=(i,t)=>new Promise(e=>{const s=document.createElement("a");s.style.visibility="hidden",document.body.appendChild(s),s.download=t,typeof i=="string"?s.href=i:s.href=window.URL.createObjectURL(i),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(s.href),e()});function vn(i=["*"],t){return new Promise((e,s)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return s(new Error("This is not a browser environment"));const n=globalThis.document.createElement("input");n.setAttribute("type","file"),n.setAttribute("visibility","hidden"),Array.isArray(i)&&i.length>0&&n.setAttribute("accept",i.join(",")),t&&n.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!n.files||n.files?.length===0)&&s(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(n.removeEventListener("change",r),!n.files||n.files?.length===0)s(new Error("Cancel select"));else{const a=Array.from(n.files);!i.includes("*")&&a.some(o=>!i.includes(`.${Sn(o)}`))&&s(new Error(`Please select files in ${i} format`)),n.remove(),e(a)}};n.addEventListener("change",r),n.click()})}function ss(i,t="text",e){return new Promise((s,n)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{s(a.target?.result)}),r.addEventListener("error",a=>{n(a)}),t){case"dataURL":r.readAsDataURL(i);break;case"binaryString":r.readAsBinaryString(i);break;case"arrayBuffer":r.readAsArrayBuffer(i);break;case"text":default:r.readAsText(i)}})}async function io(i){const t=await ss(i,"arrayBuffer");return ln(t)}const Sn=i=>{let t;return i instanceof File?t=i.name:t=i,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Wt(i,t={},e=[],s){return{tag:i,props:t,children:e,el:s}}function ge(i,t){if(i.el)return i.el;if(i.el=document.createElement(i.tag),i.props)for(const e in i.props){const s=i.props[e];e.startsWith("on")?i.el.addEventListener(e.slice(2).toLowerCase(),s):i.el.setAttribute(e,s)}return i.children&&(typeof i.children=="string"?i.el.textContent=i.children:i.children.forEach(e=>{ge(e,i.el)})),t?.appendChild(i.el),i.el}function is(i,t){if(!i.el)return;if(i.tag!==t.tag){(i.el.parentElement||document.body).replaceChild(ge(t),i.el);return}const e=t.el=i.el,s=i.props,n=t.props;for(const o in s)o in n||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),s[o]):e.removeAttribute(o));for(const o in n){const h=s[o],c=n[o];if(c!=h)if(o.startsWith("on")){const l=o.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else o==="style"?Object.keys(c||{}).forEach(l=>{const d=String(c[l]).toLowerCase().includes("!important")?"important":"";e.style.setProperty(ct(l),String(c[l]).replace(/!important/i,""),d)}):e.setAttribute(o,c)}const r=i.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{ge(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)is(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{ge(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}function Cn(i,t){if(!i.isEqualNode(t)){if(i.nodeName!==t.nodeName){(i.parentElement||document.body).replaceChild(t,i);return}if(i.nodeType===Node.TEXT_NODE){i.textContent!==t.textContent&&(i.textContent=t.textContent);return}for(let e=i.attributes.length-1;e>=0;e--){const s=i.attributes[e].name;!t.hasAttribute(s)&&s!=="open"&&i.removeAttribute(s)}for(let e=0;e<t.attributes.length;e++){const s=t.attributes[e].name,n=t.attributes[e].value;i.setAttribute(s,n)}for(let e=0;e<t.childNodes.length;e++)i.childNodes[e]?Cn(i.childNodes[e],t.childNodes[e]):i.appendChild(t.childNodes[e].cloneNode(!0));for(;i.childNodes.length>t.childNodes.length;)i.lastChild&&i.removeChild(i.lastChild)}}class no{url;socket;waitingResponse={};sendMessageQueue=[];constructor(t){this.url=t,this.createSocket()}createSocket(){console.log("Socket Create Attempted"),this.socket=new WebSocket(this.url),this.socket.onopen=()=>{this.sendMessageQueue.forEach(t=>this.socket?.send(t)),this.sendMessageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:s,wasClean:n}=t;console.log(`ws closed : ${e} ${s} ${n}`)},this.socket.onerror=t=>{console.log(`ws error : ${t.type}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Socket Recreate Attempted"),this.sendMessageQueue.push(t),this.createSocket()}closeSocket(){this.socket&&(this.socket.close(),console.log("Socket closed"))}openSocket(){this.createSocket(),console.log("Socket opened manually")}sendWithRetry(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):this.recreateSocket(t)}async processMessage(t){if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const s=this.waitingResponse[e.requestid];s?s.resolve?.(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(`Received String : ${t.data}`)}else t.data instanceof ArrayBuffer?console.log(`Received ArrayBuffer : ${t.data}`):t.data instanceof Blob&&console.log(`Received Blob : ${t.data}`)}async sendPayload(t){const e=+new Date,s=this.waitingResponse[e]={requestid:e};try{let n;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?n=t:n=JSON.stringify({...s,...t});const r=await new Promise((a,o)=>{s.resolve=a,this.sendWithRetry(n),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-s.requestid)/1e3),r}catch(n){return Promise.reject(n)}finally{delete this.waitingResponse[e]}}async send(t,e,s=n=>{console.log(n)}){this.sendPayload(t).then(e,s)}}function ro(){const i=window.screen;return{screenWidth:i.width,screenHeight:i.height,screenX:window.screenX,screenY:window.screenY}}function Pe(){const i=document.documentElement;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function ao(){const i=document.body;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function oo(){return typeof window.innerWidth=="number"?{width:window.innerWidth,height:window.innerHeight}:document.compatMode==="CSS1Compat"?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function ho(){const{scrollWidth:i,scrollHeight:t}=Pe();return{width:i,height:t}}function En(i){const{top:t,left:e,width:s,height:n}=i.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=Pe();return{x:e+r,y:t+a,width:s,height:n}}function co(i){let t=0,e=0;i&&(t=i.offsetWidth,e=i.offsetHeight);let s=0,n=0;for(;i!==null;)s+=i.offsetLeft,n+=i.offsetTop,i.offsetParent instanceof HTMLElement?i=i.offsetParent:i=null;return{x:s,y:n,width:t,height:e}}function Tn(i){return i.getBoundingClientRect()}function lo(i){const t=i.getBoundingClientRect();return{x:i.offsetLeft,y:i.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function uo(){const{clientHeight:i,scrollTop:t,scrollHeight:e}=Pe(),s=e-i;return s<=0?0:t/s*100}function fo(i){if("center"in i){const t=i.center,e=Tn(i.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:i.clientX,y:i.clientY}}function Pn(i){if("center"in i)return i.center;if(typeof i.pageX=="number"&&typeof i.pageY=="number")return{x:i.pageX,y:i.pageY};const{scrollLeft:t,scrollTop:e}=Pe();return{x:i.clientX+t,y:i.clientY+e}}function Mt(i,t){if(!t&&"offsetX"in i)return{x:i.offsetX,y:i.offsetY};const e=Pn(i),s=En(t||i.target);return{x:e.x-s.x,y:e.y-s.y}}const ns=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(i)?t="macOS":/win/i.test(i)?t="Windows":/android/i.test(i)?t="Android":/iphone|ipad|ipod/i.test(i)?t="iOS":/linux/i.test(i)?t="Linux":/bsd/i.test(i)&&(t="BSD"),t.toLowerCase()},mo=()=>{const i=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(i)){const e=i.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(i)){const e=i.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(i)){const e=i.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(i)){const e=i.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},Ks=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(i)||/opera/i.test(i)?t="Opera":/chrome/i.test(i)?t="Chrome":/firefox/i.test(i)?t="Firefox":/safari/i.test(i)?t="Safari":/edge/i.test(i)?t="Edge":/msie|trident/i.test(i)?t="IE":/MicroMessenger/i.test(i)?t="Wechat":/alipay/i.test(i)&&(t="Ali"),t.toLowerCase()},po=()=>{const i=navigator.userAgent;let t="Unknown";if(/Chrome/.test(i)){const e=i.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(i)){const e=i.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(i)){const e=i.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(i)){const e=i.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(i)){const e=i.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},go=()=>"geolocation"in navigator?new Promise((i,t)=>{navigator.geolocation.getCurrentPosition(e=>{const s=e.coords.latitude,n=e.coords.longitude;i({latitude:s,longitude:n})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function yo(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function wo(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Qs(){return ns()==="ios"}function ti(){return ns()==="macos"}function xo(){return Qs()|ti()}function Mn(){return ns()==="android"}function bo(){return Qs()||Mn()}function vo(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function An(){const i=window.navigator.userAgent,t=i.indexOf("MSIE ");if(t>0)return parseInt(i.substring(t+5,i.indexOf(".",t)),10);if(i.indexOf("Trident/")>0){const n=i.indexOf("rv:");return parseInt(i.substring(n+3,i.indexOf(".",n)),10)}const s=i.indexOf("Edge/");return s>0?parseInt(i.substring(s+5,i.indexOf(".",s)),10):-1}const So=An()!==-1;function Co(){const i=document.documentMode;return i&&(i===9||i===10)}function In(){return Ks()==="wechat"}function Dn(){return Ks()==="ali"}function Eo(){return In()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function To(){return Dn()&&navigator.userAgent.match(/miniprogram/i)}const Po=typeof document<"u",kn=typeof window<"u",Mo=typeof history<"u",Ao=kn&&window.File&&window.FileReader&&window.FileList&&window.Blob,_n=(()=>{const i=me();return!!(i.Worker&&i.Blob&&i.Promise&&i.OffscreenCanvas&&i.OffscreenCanvasRenderingContext2D&&i.HTMLCanvasElement&&i.HTMLCanvasElement.prototype.transferControlToOffscreen&&i.URL&&i.URL.createObjectURL)})(),Io=typeof Path2D=="function"&&typeof DOMMatrix=="function",Ln=function(){if(!me().OffscreenCanvas)return!1;const t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);const s=t.transferToImageBitmap();try{e.createPattern(s,"no-repeat")}catch{return!1}return!0}(),Do=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},ko="webkit moz ms o".split(" ");function rs(i){return typeof i=="function"&&/native code/.test(i.toString())}function _o(i){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const n=function(){const r=Math.min(t.clientWidth,i);t.dataset.width=r,t.dataset.rem=s=Math.round(100*(r/i)),t.style.fontSize=s+"px"};n(),window.rem2px=function(r){return r=parseFloat(r),r*s},window.px2rem=function(r){return r=parseFloat(r),r/s},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",n,!1)}function O(i){return i*Math.PI/180}function tt(i){return i*180/Math.PI}function as(i,t,e=0){return Math.sqrt(i*i+t*t+e*e)}function os(i,t,e,s){return as(e-i,s-t)}function hs(i,t,e,s){const n=e-i,r=s-t;return n*n+r*r}function $t(i,t,e,s){let n=Math.atan2(s-t,e-i);return n<0&&(n+=Math.PI*2),n}function At(i,t){return{dx:Math.cos(i)*t,dy:Math.sin(i)*t}}function Lo(i,t,e){if(typeof e=="number"){const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2)+Math.pow(e,2));return{x:i/=s,y:t/=s,z:e/=s}}else{const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2));return{x:i/=s,y:t/=s}}}function Ro(i,t,e,s,n=10){if(Math.abs(e-i)<n&&Math.abs(s-t)<n)return"no";const r=tt($t(i,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const Rn=Oo("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function Oo(i,t=10){const e={},s=i.split(",");for(let n=0;n<s.length;n+=2){const r="&"+s[n+1]+";",a=parseInt(s[n],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function rt(i,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)i=i.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return i}function cs(i){let t,e;if(!i)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(i[t]);return t}function No(i){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[i]||t.start}function Fo(i){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[i]||t.alphabetic}const Me={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class ls{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(s.setAttribute("stop-color",rt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}}class ei{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Ae{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=s),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Me);for(let e=0,s=t.length;e<s;e++){const n=t[e];this[n]=Me[n].canvas}}__getStyleState(){const t={},e=Object.keys(Me);for(let s=0,n=e.length;s<n;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,n=e.length;s<n;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const n=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];n.setAttribute(o,e[o])}return n}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const n=Object.keys(Me);for(let r=0;r<n.length;r++){const a=Me[n[r]],o=this[n[r]];if(a.apply){if(o instanceof ei){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const h=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,rt("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof ls)e.setAttribute(a.apply,rt("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);if(c){e.setAttribute(a.svgAttr,rt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const d=this.globalAlpha;d!=null&&(l*=d),e.setAttribute(a.svgAttr+"-opacity",""+l)}}else{let h=a.svgAttr;if(n[r]==="globalAlpha"&&(h=t+"-"+a.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const n=Object.keys(Rn);for(let r=0,a=n.length;r<a;r++){const o=n[r],h=Rn[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(rt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(rt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(rt("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,n,r,a){this.__addTransform(rt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:n,e:r,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(rt("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(rt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(rt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,n,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(rt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:n,x:r,y:a}))}quadraticCurveTo(t,e,s,n){this.__currentPosition={x:s,y:n},this.__addPathCommand(rt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:n}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,n,r){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(a===t&&o===e||t===s&&e===n||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,n-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],d=Math.acos(Math.abs(l)),g=this.normalize([h[0]+c[0],h[1]+c[1]]),y=r/Math.sin(d/2),p=t+y*g[0],x=e+y*g[1],b=[-h[1],h[0]],S=[c[1],-c[0]],C=function(Y){const X=Y[0];return Y[1]>=0?Math.acos(X):-Math.acos(X)},L=C(b),R=C(S);this.lineTo(p+b[0]*r,x+b[1]*r),this.arc(p,x,r,L,R)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,s,n){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],n=s.childNodes;for(let r=n.length-1;r>=0;r--)n[r]&&s.removeChild(n[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,n){if(t===0&&e===0&&s===this.width&&n===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:n,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,n){const r=this.__createElement("linearGradient",{id:cs(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new ls(r,this)}createRadialGradient(t,e,s,n,r,a){const o=this.__createElement("radialGradient",{id:cs(this.__ids),cx:n+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new ls(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),s={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,n){const r=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:s,"text-anchor":No(this.textAlign),"dominant-baseline":Fo(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,n,r,a){if(n===r)return;n=n%(2*Math.PI),r=r%(2*Math.PI),n===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(n),l=e+s*Math.sin(n),d=a?0:1;let g=0,y=r-n;y<0&&(y+=2*Math.PI),a?g=y>Math.PI?0:1:g=y>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(rt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:g,sweepFlag:d,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=cs(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",rt("url(#{id})",{id:s})),t.appendChild(n),this.__currentElement=n}drawImage(...t){let e=t[0],s,n,r,a,o=0,h=0,c,l,d,g,y,p,x,b;if(t.length===3)s=t[1],n=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],n=t[2],r=t[3],a=t[4],c=e.width,l=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],l=t[4],s=t[5],n=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const S=this.__closestGroupOrSvg();this.__currentElement;const C="translate("+s+", "+n+")";if(e instanceof Ae){if(d=e.getSvg().cloneNode(!0),d.childNodes&&d.childNodes.length>1){for(g=d.childNodes[0];g.childNodes.length;)b=g.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(g.childNodes[0]);if(y=d.childNodes[1],y){const L=y.getAttribute("transform");let R;L?R=L+" "+C:R=C,y.setAttribute("transform",R),S.appendChild(y)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",a),p.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(x=this.__document.createElement("canvas"),x.width=r,x.height=a,x.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=x),p.setAttribute("transform",C),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),S.appendChild(p))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),n=cs(this.__ids);let r;return s.setAttribute("id",n),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof Ae&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new ei(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class us{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,n=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),n&&(this.customContext=new Ae({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,n){return this.context.fillRect(t,e,s,n),this.customContext&&this.customContext.fillRect(t,e,s,n),this}fillText(t,e,s,n){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,n),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,n){return this.context.strokeText(t,e,s,n),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,n){return this.context.strokeRect(t,e,s,n),this.customContext&&this.customContext.strokeRect(t,e,s,n),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,n=this.canvas.height){return this.context.clearRect(t,e,s,n),this.customContext&&this.customContext.clearRect(t,e,s,n),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-n),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,n,r,a){return this.context.arc(t,e,s,n,r,a),this.customContext&&this.customContext.arc(t,e,s,n,r,a?-1:1),this.currentPath2D.arc(t,e,s,n,r,a),this}arcTo(t,e,s,n,r){return this.context.arcTo(t,e,s,n,r),this.customContext&&this.customContext.arcTo(t,e,s,n,r),this.currentPath2D.arcTo(t,e,s,n,r),this}ellipse(t,e,s,n,r,a,o,h){return this.context.ellipse(t,e,s,n,r,a,o,h),this.currentPath2D.ellipse(t,e,s,n,r,a,o,h),this}quadraticCurveTo(t,e,s,n){return this.context.quadraticCurveTo(t,e,s,n),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,n),this.currentPath2D.quadraticCurveTo(t,e,s,n),this}bezierCurveTo(t,e,s,n,r,a){return this.context.bezierCurveTo(t,e,s,n,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,n,r,a),this.currentPath2D.bezierCurveTo(t,e,s,n,r,a),this}rect(t,e,s,n){return this.context.rect(t,e,s,n),this.customContext&&this.customContext.rect(t,e,s,n),this.currentPath2D.rect(t,e,s,n),this}createLinearGradient(t,e,s,n,r){const a=this.context.createLinearGradient(t,e,s,n);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,n,r,a,o){const h=this.context.createRadialGradient(t,e,s,n,r,a);return o&&Object.entries(o).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],n=e[1];this.context.drawImage(t,s,n)}else if(e.length===4){const s=e[0],n=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,n,r,a)}else if(e.length===8){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,n,r,a,o,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,n=this.canvas.height,r){return this.context.getImageData(t,e,s,n,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class ds{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=$t(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),s=Math.min(this.y,this.toY),n=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:n-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),n=s*this.x-e*this.y,r=s*this.toX-e*this.toY,a=s*this.y+e*this.x,o=s*this.toY+e*this.toX;return{x:Math.min(n,r),y:Math.min(a,o),width:Math.max(n,r)-Math.min(n,r),height:Math.max(a,o)-Math.min(a,o)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,n=t.toX,r=t.toY,a=this.toX-e,o=t.x-n;if(!a&&!o)return null;const h=(this.toY-s)/a,c=(t.y-r)/o;if(a){if(!o)return{x:n,y:h*(n-e)+s}}else return{x:e,y:c*(e-n)+r};const l=(-c*n+r+h*e-s)/(h-c),d=h*(l-e)+s;return isNaN(l)||isNaN(d)?null:{x:l,y:d}}}const On=ds;class si extends ds{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,n,r,a,o,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,n,r,a,o,h,!this.sweepFlag)}convert(t,e,s,n,r,a,o,h,c){const l=o/180*Math.PI,d=(t-s)/2,g=(e-n)/2,y=Math.cos(l)*d+Math.sin(l)*g,p=-Math.sin(l)*d+Math.cos(l)*g,x=y*y/(r*r)+p*p/(a*a);if(x>1){const z=Math.sqrt(x);throw r=z*r,a=z*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const b=Math.sqrt((r*r*a*a-r*r*p*p-a*a*y*y)/(r*r*p*p+a*a*y*y)),S=h!=c?1:-1,C=S*b*r*p/a,L=S*b*-a*y/r,R=(t+s)/2,Y=(e+n)/2,X=Math.cos(l)*C-Math.sin(l)*L+R,V=Math.sin(l)*C+Math.cos(l)*L+Y,it=(z,nt,bt,dt)=>(z*dt>=nt*bt?1:-1)*Math.acos((z*bt+nt*dt)/(Math.sqrt(z*z+nt*nt)*Math.sqrt(bt*bt+dt*dt))),W=it(1,0,t-X,e-V)-l,$=it(t-X,e-V,s-X,n-V);return[X,V,r,a,l,W,W+$]}}class Bo extends ds{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let s,n,r,a;for(let c=0;c<2;++c)s=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,n=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(s)>1e-12&&(a=-n/(2*s),0<a&&a<1&&[t,e][c].push(s*a*a+n*a+r));const o={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},h={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:o.x,y:o.y,width:h.x-o.x,height:h.y-o.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}}const Xo=Bo;class lt extends ds{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),s=this.x-this.c1x,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t;const a=[this.y,this.toY],o=[this.x,this.toX];let h;const c=[];Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),s=this.y-this.c1y,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y}));let l=[],d=c.length;for(let p=0;p<d;p++){for(let x=p+1;x<d;x++)c[p].X===c[x].X&&c[p].Y===c[x].Y&&(x=++p);l.push({X:c[p].X,Y:c[p].Y})}const g={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},y={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:g.x,y:g.y,width:y.x-g.x,height:y.y-g.y,dots:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}static base3(t,e,s,n,r){const a=-3*e+9*s-9*n+3*r,o=t*a+6*e-12*s+6*n;return t*o-3*e+3*s}static bezlen(t,e,s,n,r,a,o,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,d=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],g=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let y=0;for(let p=0;p<12;p++){const x=l*d[p]+l,b=this.base3(x,t,s,r,o),S=this.base3(x,e,n,a,h);y+=g[p]*Math.sqrt(b*b+S*S)}return l*y}length(t=1){return lt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,s=this.y,n=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.toX,c=this.toY;if(t<0||lt.bezlen(e,s,n,r,a,o,h,c)<t)return 0;let l=1,d=l/2,g=l-d,y=lt.bezlen(e,s,n,r,a,o,h,c,g);for(;Math.abs(y-t)>.01;)d/=2,g+=(y<t?1:-1)*d,y=lt.bezlen(e,s,n,r,a,o,h,c,g);return g}getPointAtSegmentLength(t){const e=this.getTatLen(t);let s=1-e,n=Math.pow(s,3),r=Math.pow(s,2),a=e*e,o=a*e,h=n*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+o*this.toX,c=n*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+o*this.toY,l=this.x+2*e*(this.c1x-this.x)+a*(this.c2x-2*this.c1x+this.x),d=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),g=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),y=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),p=s*this.x+e*this.c1x,x=s*this.y+e*this.c1y,b=s*this.c2x+e*this.toX,S=s*this.c2y+e*this.toY,C=90-Math.atan2(l-g,d-y)*180/Math.PI;return{x:h,y:c,m:{x:l,y:d},n:{x:g,y},start:{x:p,y:x},end:{x:b,y:S},alpha:C}}}const Ie=Math.PI*2;function Nn(i,t,e,s){const n=i*s-t*e<0?-1:1;let r=i*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),n*Math.acos(r)}function Yo(i,t,e,s,n,r,a,o,h,c){const l=c*(i-e)/2+h*(t-s)/2,d=-h*(i-e)/2+c*(t-s)/2,g=a*a,y=o*o,p=l*l,x=d*d;let b=g*y-g*x-y*p;b<0&&(b=0),b/=g*x+y*p,b=Math.sqrt(b)*(n===r?-1:1);const S=b*a/o*d,C=b*-o/a*l,L=c*S-h*C+(i+e)/2,R=h*S+c*C+(t+s)/2,Y=(l-S)/a,X=(d-C)/o,V=(-l-S)/a,it=(-d-C)/o,W=Nn(1,0,Y,X);let $=Nn(Y,X,V,it);return r===0&&$>0&&($-=Ie),r===1&&$<0&&($+=Ie),[L,R,W,$]}function Uo(i,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(i),n=Math.sin(i),r=Math.cos(i+t),a=Math.sin(i+t);return[s,n,s-n*e,n+s*e,r+a*e,a-r*e,r,a]}function Fn(i,t,e,s,n,r,a,o,h){const c=Math.sin(h*Ie/360),l=Math.cos(h*Ie/360),d=l*(i-e)/2+c*(t-s)/2,g=-c*(i-e)/2+l*(t-s)/2;if(d===0&&g===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const y=d*d/(a*a)+g*g/(o*o);y>1&&(a*=Math.sqrt(y),o*=Math.sqrt(y));const p=Yo(i,t,e,s,n,r,a,o,c,l),x=[];let b=p[2],S=p[3];const C=Math.max(Math.ceil(Math.abs(S)/(Ie/4)),1);S/=C;for(let L=0;L<C;L++)x.push(Uo(b,S)),b+=S;return x.map(L=>{for(let R=0;R<L.length;R+=2){let Y=L[R+0],X=L[R+1];Y*=a,X*=o;const V=l*Y-c*X,it=c*Y+l*X;L[R+0]=V+p[0],L[R+1]=it+p[1]}return L})}function ii(i,t,e,s,n,r){return[i/3+2/3*e,t/3+2/3*s,n/3+2/3*e,r/3+2/3*s,n,r]}function De(i,t,e,s){return[i,t,e,s,e,s]}const ke={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class oe{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&I.attribute(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||Vs()})}static downloadFromSVGElement(t,e="shape"){return Zs(bn(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Zs($s(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return Js(t)}static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t))}static SVGPathDataToD(t){return t.map(e=>{if(!e[0])return"";switch(e[0].toLowerCase()){case"a":return`${e[0]} ${e[1]},${e[2]} ${e[3]} ${e[4]},${e[5]} ${e[6]},${e[7]}`;case"c":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`;case"s":case"q":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]}`;default:return e[0]+" "+e.slice(1).join(",")}}).join(" ")}static parseSVGPath(t){const e=[];return oe.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,n,r)=>{let a=n.toLowerCase();const o=wn(r);for(a=="m"&&o.length>ke[a]&&(e.push([n,...o.splice(0,ke[a])]),a="l",n=n=="m"?"l":"L");o.length;){if(o.length<ke[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${n} } args:{ ${o} }`);e.push([n,...o.splice(0,ke[a])])}return a=="z"&&e.push([n]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toUpperCase();if(o!=h)switch(a[0]=h,o){case"a":a[6]+=n,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=n;break;default:for(let c=1;c<a.length;)a[c++]+=n,a[c++]+=r}switch(h){case"Z":n=e,r=s;break;case"H":n=a[1];break;case"V":r=a[1];break;case"M":n=e=a[1],r=s=a[2];break;default:n=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toLowerCase();if(o!=h)switch(a[0]=h,o){case"A":a[6]-=n,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=n;break;default:for(let c=1;c<a.length;)a[c++]-=n,a[c++]-=r}switch(h){case"z":n=e,r=s;break;case"h":n+=a[1];break;case"v":r+=a[1];break;case"m":n+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:n+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){const e=[];let s=0,n=0,r=0,a=0,o=0,h=0,c=0,l=0,d;for(let g=0,y=t.length;g<y;g++){let p=t[g];const x=p[0];switch(x){case"M":s=p[1],n=p[2];break;case"A":const b=Fn(r,a,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!b.length)continue;b.forEach((L,R)=>{const[Y,X,V,it,W,$,z,nt]=L;p=["C",V,it,W,$,z,nt],R<b.length-1&&e.push(p)});break;case"S":let S=r,C=a;(d=="C"||d=="S")&&(S+=S-c,C+=C-l),p=["C",S,C,p[1],p[2],p[3],p[4]];break;case"T":d=="Q"||d=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),p=["C",...ii(r,a,o,h,p[1],p[2])];break;case"Q":o=p[1],h=p[2],p=["C",...ii(r,a,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...De(r,a,p[1],p[2])];break;case"H":p=["C",...De(r,a,p[1],a)];break;case"V":p=["C",...De(r,a,r,p[1])];break;case"Z":p=["C",...De(r,a,s,n)];break}d=x,r=p[p.length-2],a=p[p.length-1],p.length>4?(c=p[p.length-4],l=p[p.length-3]):(c=r,l=a),e.push(p)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,n=t.length;n-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:n-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}];const a=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y])}return e}static zvhToLSVGPath(t){const e=[];let s=["L",0,0],n;for(let r=0,a=t.length;r<a;r++){const o=t[r];switch(o[0]){case"M":s=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(s);break;case"H":n=e[e.length-1]||["L",0,0],e.push(["L",o[1],n[n.length-1]]);break;case"V":n=e[e.length-1]||["L",0,0],e.push(["L",n[n.length-2],o[1]]);break;default:e.push(o)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let s,n=0,r=0;for(let a=0,o=t.length;a<o;a++){const h=t[a],c=e[h[0]];c&&(h[0]=c.to,s&&(s[0]===c.to?(n=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(n=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,n,r)),s=h}return t}}const mt=oe;class pt{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(mt.parseSVGPath(t),e):t instanceof pt?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=mt.normalizeSVGPath(mt.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let n=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];if(o[0]=="M"){n||(n=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2];continue}this.appendLine(new lt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new pt;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,n=t.length;s+5<n;s+=6)e.appendLine(new lt({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],toX:t[s+4],toY:t[s+5]}));return e}static fromLines(t){const e=new pt;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,n=t.length;s<n;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof si){Fn(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,d,g,y,p,x,b,S]=c;this.normalizedLines.push(new lt({x:this.prevPathX,y:this.prevPathY,c1x:g,c1y:y,c2x:p,c2y:x,toX:b,toY:S})),this.prevPathX=b,this.prevPathY=S});return}let e,s,n,r,a,o;t instanceof lt?(e=t.c1x,s=t.c1y,n=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof Xo?[e,s,n,r,a,o]=ii(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,n,r,a,o]=De(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new lt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:n,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),n=[];n.push(["M",t,e]);for(let r=0,a=s.length;r<a;r++)n.push(...s[r].toSVGPathData());return n}toSVGPathD(){return mt.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform();t.beginPath(),t.moveTo(e,s),n.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],s=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const n=Math.min.apply(0,e),r=Math.min.apply(0,s),a=Math.max.apply(0,e),o=Math.max.apply(0,s);return{x:n,y:r,width:a-n,height:o-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new at;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,s=this.startPathY;({x:e,y:s}=t.transformPoint({x:e,y:s}));const n=[];return this.normalizedLines.forEach(r=>{let a=r.x,o=r.y,h=r.c1x,c=r.c1y,l=r.c2x,d=r.c2y,g=r.toX,y=r.toY;({x:a,y:o}=t.transformPoint({x:a,y:o})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:l,y:d}=t.transformPoint({x:l,y:d}),{x:g,y}=t.transformPoint({x:g,y}),n.push(new lt({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:d,toX:g,toY:y}))}),{startPathX:e,startPathY:s,normalizedLines:n}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,s)=>e+=s.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let s=0;const n=e.length;for(let r=0;r<n;r++){const a=e[r],o=a.length();if(s+o>=t)return a.getPointAtSegmentLength(t-s);s+=o}return e[n-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform(),r=n.length;if(r===0)return{x:e,y:s};if(r===1)return n[0].interpolate(t);{let a=t*r,o=n[0];if(a--,a>1)for(let h=1;h<r&&(o=n[h],a>1);h++)a-=1;return o.interpolate(a)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const s=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(s,t):s}}getSubpathsAtLength(t,e,s){const{startPathX:n,startPathY:r,normalizedLines:a}=t.updateTransform();let o=null,h=0;const c=new pt;c.prevPathX=c.startPathX=n,c.prevPathY=c.startPathY=r;for(let l=0,d=a.length;l<d;l++){const g=a[l],y=g.length();if(h+y>e&&!o){const p=g.getPointAtSegmentLength(e-h);if(c.appendLine(new lt({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),s)return c;o=c,c.appendLine(new lt({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:g.x,toY:g.y})),h+=y;continue}h+=y,c.appendLine(g)}return c}closestPoint(t,e){const s=this.getTotalLength();let n={x:t,y:e},r=0,a=1/0,o=8;for(let c=0;c<=s;c+=o){let l=this.getPointAtLength(c),d=hs(l.x,l.y,t,e);d<a&&(n=l,r=c,a=d)}for(o/=2;o>.5;){let c=r-o,l=this.getPointAtLength(c),d=hs(l.x,l.y,t,e),g=r+o,y=this.getPointAtLength(g),p=hs(y.x,y.y,t,e);c>=0&&d<a?(n=l,r=c,a=d):g<=s&&p<a?(n=y,r=g,a=p):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:n,rotation:r>=s?$t(h.x,h.y,n.x,n.y):$t(n.x,n.y,h.x,h.y),distance:Math.sqrt(a)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform();return[t,e].concat(s.reduce((n,r)=>n.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],n=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=os(t[a],t[a+1],s,n),s=t[a],n=t[a+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let n=t-s;const r=Math.ceil(t/s),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=s-1;){const h=e[o++],c=e[o++],l=e[o++],d=e[o++],g=e[o++],y=e[o++];a.push(["C",h,c,l,d,g,y]);let p=0;for(;p<r&&n>0;)a.push(["C",g,y,g,y,g,y]),n-=6,p++}return a}static mixPoints(t,e,s){const n=t.length,r=new Array(n);for(let a=0;a<n;a++)r[a]=Et(t[a]+(e[a]-t[a])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t:Math.abs(s-1)<Number.EPSILON?e:pt.fromPolymorphPoints(pt.mixPoints(new pt({d:t}).polymorphPoints,new pt({d:e}).polymorphPoints,s)).toSVGPathData()}}const Go=pt;(function(){if(!window.requestAnimationFrame){let i=j();window.requestAnimationFrame=function(t){const e=j(),s=Math.max(0,16-(e-i)),n=window.setTimeout(function(){t(e+s)},s);return i=e+s,n}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(i){clearTimeout(i)})})();const ni=i=>{let t=!1;return window.requestAnimationFrame(function e(s){!t&&i(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}};function ri(i,t=0){if(t==0)return i(j()),()=>{};{const e=j();return ni(s=>s-e>=t?(i(s),!1):!0)}}function Vo(i,t=0){let e=!1,s=0,n=j();const r=a=>{if(e)return;s++;const o=a-n-s*t;i(a,s,t-o<=0),ri(r,Math.max(0,t-o))};return ri(r,t),()=>{e=!0}}function zo(i,t=20){const e=1e3/t;let s=0,n;return()=>(j()-s>=e&&(s=j(),n=i()),n)}const Jt=new Ke;let ai=!1;function Bn(i,t,e){i&&t&&Jt.set(i,t),!ai&&(ai=!0,requestIdleCallback(s=>{for(ai=!1;s.timeRemaining()>0&&Jt.length>0;){const n=Jt.shift();n&&n[1]()}Jt.length>0&&Bn()},{timeout:e}))}let oi=!1;function hi(i,t,e){if(i&&t&&Jt.set(i,t),oi)return;oi=!0;const s=j();Yn(n=>{for(oi=!1;(n.timeRemaining()>0||e&&j()-s>=e)&&Jt.length>0;){const r=Jt.shift();r&&r[1]()}Jt.length>0&&hi()})}let fs=0,he=33,Zt=33,ci;const Xn=new MessageChannel,qo=Xn.port2;Xn.port1.onmessage=i=>{ci!==null&&ci({didTimeout:fs<=j(),timeRemaining:()=>Math.max(0,fs-j())})};function Yn(i){return ci=i,requestAnimationFrame(t=>{let e=t-fs+Zt;e<Zt&&he<Zt?(e<8&&(e=8),Zt=e<he?he:e):e>Zt&&he>Zt?Zt=e<he?he:e:he=e,fs=t+Zt,qo.postMessage(null)})}function Ho(i){return cancelAnimationFrame(i)}function jo(i){if(typeof setImmediate<"u"&&rs(setImmediate))setImmediate(i);else if(typeof MessageChannel<"u"&&(rs(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=i,t.postMessage(null)}else typeof Promise<"u"&&rs(Promise)?Promise.resolve().then(i):setTimeout(i,0)}function Wo(i){typeof queueMicrotask=="function"?queueMicrotask(i):Promise.resolve().then(i).catch(t=>setTimeout(()=>{throw t}))}class _e{static _nextId=0;static nextId(){return _e._nextId++}}const D={Linear:{None:function(i){return i}},Ease:{In:function(i){return Math.pow(i,1.7)}},Quadratic:{In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}},Cubic:{In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}},Quartic:{In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}},Quintic:{In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}},Sinusoidal:{In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}},Exponential:{In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}},Circular:{In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}},Elastic:{In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}},Back:{In:function(i){return i===1?1:i*i*((1.70158+1)*i-1.70158)},Out:function(i){return i===0?0:--i*i*((1.70158+1)*i+1.70158)+1},InOut:function(i){const t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}},Bounce:{In:function(i){return 1-D.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?D.Bounce.In(i*2)*.5:D.Bounce.Out(i*2-1)*.5+.5}},generatePow:function(i=4){return i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return t**i},Out:function(t){return 1-(1-t)**i},InOut:function(t){return t<.5?(t*2)**i/2:(1-(2-t*2)**i)/2+.5}}},random:function(i){return Math.random()},createStep:function(i){return function(t){return Math.floor(t*i)/i}},createNoisyEasing:function(i,t=.1){const e=1-t;return function(s){return t*Math.random()+e*i(s)}},swing:function(i){return i+Math.sin(i*Math.PI*2)/2},causeSeizures:function(i){return i+.2*Math.random()-.1}};function Un(i){switch(i){case D.Quadratic.In:return D.Quadratic.Out;case D.Quadratic.Out:return D.Quadratic.In;case D.Quadratic.InOut:return D.Quadratic.InOut;case D.Cubic.In:return D.Cubic.Out;case D.Cubic.Out:return D.Cubic.In;case D.Cubic.InOut:return D.Cubic.InOut;case D.Quartic.In:return D.Quartic.Out;case D.Quartic.Out:return D.Quartic.In;case D.Quartic.InOut:return D.Quartic.InOut;case D.Quintic.In:return D.Quintic.Out;case D.Quintic.Out:return D.Quintic.In;case D.Quintic.InOut:return D.Quintic.InOut;case D.Sinusoidal.In:return D.Sinusoidal.Out;case D.Sinusoidal.Out:return D.Sinusoidal.In;case D.Sinusoidal.InOut:return D.Sinusoidal.InOut;case D.Exponential.In:return D.Exponential.Out;case D.Exponential.Out:return D.Exponential.In;case D.Exponential.InOut:return D.Exponential.InOut;case D.Circular.In:return D.Circular.Out;case D.Circular.Out:return D.Circular.In;case D.Circular.InOut:return D.Circular.InOut;case D.Elastic.In:return D.Elastic.Out;case D.Elastic.Out:return D.Elastic.In;case D.Elastic.InOut:return D.Elastic.InOut;case D.Back.In:return D.Back.Out;case D.Back.Out:return D.Back.In;case D.Back.InOut:return D.Back.InOut;case D.Bounce.In:return D.Bounce.Out;case D.Bounce.Out:return D.Bounce.In;case D.Bounce.InOut:return D.Bounce.InOut;default:return i}}const $o=4,Jo=.001,Zo=1e-7,Ko=10,Le=11,ms=1/(Le-1),Qo=typeof Float32Array=="function";function Gn(i,t){return 1-3*t+3*i}function Vn(i,t){return 3*t-6*i}function zn(i){return 3*i}function ps(i,t,e){return((Gn(t,e)*i+Vn(t,e))*i+zn(t))*i}function qn(i,t,e){return 3*Gn(t,e)*i*i+2*Vn(t,e)*i+zn(t)}function th(i,t,e,s,n){let r,a,o=0;do a=t+(e-t)/2,r=ps(a,s,n)-i,r>0?e=a:t=a;while(Math.abs(r)>Zo&&++o<Ko);return a}function eh(i,t,e,s){for(let n=0;n<$o;++n){const r=qn(t,e,s);if(r===0)return t;const a=ps(t,e,s)-i;t-=a/r}return t}function sh(i){return i}function li(i,t,e,s){if(!(0<=i&&i<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(i===t&&e===s)return sh;const n=Qo?new Float32Array(Le):new Array(Le);for(let a=0;a<Le;++a)n[a]=ps(a*ms,i,e);function r(a){let o=0,h=1;const c=Le-1;for(;h!==c&&n[h]<=a;++h)o+=ms;--h;const l=(a-n[h])/(n[h+1]-n[h]),d=o+l*ms,g=qn(d,i,e);return g>=Jo?eh(a,d,i,e):g===0?d:th(a,o,o+ms,i,e)}return a=>a===0||a===1?a:ps(r(a),t,s)}function ui(i){switch(i){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function Hn(i){const[t,e,s,n]=ui(i);return[1-s,1-n,1-t,1-e]}function ih(i){return li(...ui(i))}function nh(i){return li(...Hn(i))}const Bt={Utils:{Linear:function(i,t,e){return(t-i)*e+i},Factorial:function(){const i=[1];return function(t){let e=1;if(i[t])return i[t];for(let s=t;s>1;s--)e*=s;return i[t]=e,e}}(),Bernstein:function(i,t){const e=Bt.Utils.Factorial;return e(i)/e(t)/e(i-t)},CatmullRom:function(i,t,e,s,n){const r=(e-i)*.5,a=(s-t)*.5,o=n*n,h=n*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*n+t},QuadraticBezier:(i,t,e,s)=>{const n=1-s;return n*n*i+2*n*s*t+s*s*e},CubicBezier:(i,t,e,s,n)=>{const r=1-n;return r*r*r*i+3*r*r*n*t+3*r*n*n*e+n*n*n*s}},Linear:function(i,t){const e=i.length-1,s=e*t,n=Math.floor(s),r=Bt.Utils.Linear;return t<0?r(i[0],i[1],s):t>1?r(i[e],i[e-1],e-s):r(i[n],i[n+1>e?e:n+1],s-n)},Bezier:function(i,t){let e=0;const s=i.length-1,n=Math.pow,r=Bt.Utils.Bernstein;for(let a=0;a<=s;a++)e+=n(1-t,s-a)*n(t,a)*i[a]*r(s,a);return e},CatmullRom:function(i,t){const e=i.length-1;let s=e*t,n=Math.floor(s);const r=Bt.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(n=Math.floor(s=e*(1+t))),r(i[(n-1+e)%e],i[n],i[(n+1)%e],i[(n+2)%e],s-n)):t<0?i[0]-(r(i[0],i[0],i[1],i[1],-s)-i[0]):t>1?i[e]-(r(i[e],i[e],i[e-1],i[e-1],s-e)-i[e]):r(i[n?n-1:0],i[n],i[e<n+1?e:n+1],i[e<n+2?e:n+2],s-n)}};class jn{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=j(),e=!1){const s=Object.keys(this._tweens);for(let n=0;n<s.length;n++){const r=this._tweens[s[n]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[n]]}return!!Object.keys(this._tweens).length}}const wt=new jn;class di{constructor(t,e=wt){this._object=t,this._group=e}_id=_e.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=D.Linear.None;_interpolationFunction=Bt.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=j()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,s,n){for(const r in s){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),s[r]=[a].concat(l)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];n[r]=o?[]:{},this._setupProperties(a,e[r],s[r],n[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?n[r]=s[r].slice().reverse():n[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=j()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=j()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=wt){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=D.Linear.None){return this._easingFunction=t,this}interpolation(t=Bt.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=j(),e=!0){if(this._isPaused)return!0;let s,n;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),n=(t-this._startTime)/this._durationTime,n=this._durationTime===0||n>1?1:n;const a=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),n===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,h=this._chainedTweens.length;o<h;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,s,n){for(const r in s){if(e[r]===void 0)continue;const a=e[r]||0;let o=s[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?t[r]=this._interpolationFunction(o,n):typeof o=="object"&&o?this._updateProperties(t[r],a,o,n):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*n))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const rh=_e.nextId,ah=wt.getAll.bind(wt),oh=wt.removeAll.bind(wt),hh=wt.add.bind(wt),ch=wt.remove.bind(wt),lh=wt.update.bind(wt),uh={now:j,Sequence:_e,Easing:D,Interpolation:Bt,Group:jn,Tween:di,nextId:rh,getAll:ah,removeAll:oh,add:hh,remove:ch,update:lh};class fi{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=j(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=j();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class gs{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){to(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const n={...s};delete n.tween,n.fromValues={...n.fromValues},n.toValues={...n.toValues},e.push(n)}),e}addTween(t,e,s){const n={fromValues:t,toValues:e,frames:typeof s?.frames=="number"?s.frames:1,delay:typeof s?.delay=="number"?s.delay:this.tweens.length,easeFunction:s?.easeFunction||D.Linear.None,interpolationFunction:s?.interpolationFunction||Bt.Linear,repeat:typeof s?.repeat=="number"?s.repeat:0,yoyo:s?.yoyo||!1,onStart:s?.onStart||(()=>{}),onUpdate:s?.onUpdate||(()=>{}),onComplete:s?.onComplete||(()=>{})};return this.tweens.push(n),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new fi,s=this.frameDuration;return new Promise(n=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=ni(r=>{if(!this.isPaused){const o=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*s<=h).forEach(c=>{c.tween||(c.tween=new di({...c.fromValues}).to({...c.toValues},c.frames*s).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(o)),(c.delay+c.frames*(c.repeat+1))*s>h?c.tween.update(o):(c.tween.isPlaying()&&c.tween.end(),Te(t,c))})}const a=!!t.length;return a||(this.onGroupComplete?.(),n()),a})})}isPaused=!1;pausedClock=new fi;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(s=>{e=Math.max(e,s.delay+s.frames),s.easeFunction=Un(s.easeFunction);const n={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...n}}),t.forEach(s=>{s.delay=e-s.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}class U extends js{id;originD;originMatrix;independentTransformInGroup;forceCXY=!1;cX;cY;x;y;degree;scalarX;scalarY;diffXInGroup;diffYInGroup;diffDegreeInGroup;diffScalarXInGroup;diffScalarYInGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;strokeArmyAnts;strokeArmyAntsOffset=0;strokeDashTotalLength=0;isShow=!0;el;pathd;usePathDtoCanvasContext=!1;parent;shapes=[];constructor(t){if(super(),this.id=Vs(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const s=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",s),this.strokeDashTotalLength=wn(s).reduce((n,r)=>n+r,0)}return qa(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new pt,qs(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(s=>{const n=s.originMatrix?s.originMatrix.clone():new at;n.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=n});const e=this.originMatrix?this.originMatrix.clone():new at;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof us)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(n);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,s){if(s instanceof us)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(n):!1}clone(){return $a(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,n])=>[ct(s),n]))):e&&(this.attrs[ct(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[ct(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[ct(t)]}distance(t){return os(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=tt($t(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:n}=At(O(this.degree),e);this.vx=s,this.vy=n,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:n}=At(O(this.degree),e);this.ax=s,this.ay=n,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,n=e*e+s*s,r=Math.sqrt(n),a=this.mass*t.mass/n,o=a*e/r,h=a*s/r;this.vx+=o/this.mass,this.vy+=h/this.mass,t.vx-=o/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=jt(t?.gravity,0);this.vy+=e;const s=jt(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=jt(e?.easing,.05),n=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=n*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=jt(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(n=>{const r=n.x-this.cX-this.x,a=n.y-this.cY-this.y,o=r*s,h=a*s;this.vx+=o,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const s=jt(e?.springLength,100),n=jt(e?.spring,1e-4),r=t.x-this.x,a=t.y-this.y,o=Math.sqrt(r*r+a*a);if(o<s){const h=r*n,c=a*n;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-o/s}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const s=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*s),this.getPointAtLength(e*s)}strokeDashTween(t=1e3,e){const s=this.initPathD(),n=Et(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const r=e?.onUpdate,a=new gs({frameDuration:t});a.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,h)=>{this.setAttr("strokeDashoffset",""+Et(o.offset,2)),r?.(o,h)}})),a.play()}}class Re extends U{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["M",this.getScreenX(),this.getScreenY()]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=Tt(O(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Tt(O(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Tt(O(t),this.x,this.y))}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return as(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,n=t.z-this.z;return Math.sqrt(e*e+s*s+n*n)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,n=this.z;return{x:s*t.z-n*t.y,y:n*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}const Wn=[1,0,0,1,0,0],$n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class at{value;_m13=0;_m23=0;_m33=1;matrix3d;constructor(t=Wn){this.value=Array.from(t),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D()}static fromString(t){const e=new at,s=rn("number",t);return s.length===6&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this._m13}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this._m23}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this._m33}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this._m13=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this._m23=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this._m33=t}toMatrix3D(t=this.matrix3d){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new ut(e)}identity(){return this.value=Array.from(Wn),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D(),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.scalar(1/t)}transformPoint(t){const e=t.z||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31,y:t.x*this.m12+t.y*this.m22+e*this.m32,z:t.x*this.m13+t.y*this.m23+e*this.m33}}clone(){return new at([...this.value])}multiply(t){const e=this.clone(),s=t instanceof at?t:new at(t);return this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,s=this.m13,n=this.m21,r=this.m22,a=this.m23,o=this.m31,h=this.m32,c=this.m33,l=c*r-a*h,d=-c*n+a*o,g=h*n-r*o;let y=t*l+e*d+s*g;return y?(y=1/y,this.m11=l*y,this.m12=(-c*e+s*h)*y,this.m13=(a*e-s*r)*y,this.m21=d*y,this.m22=(c*t-s*o)*y,this.m23=(-a*t+s*n)*y,this.m31=g*y,this.m32=(-h*t+e*o)*y,this.m33=(r*t-e*n)*y,this):null}adjugate(){const t=new at;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=tt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,degree:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:tt(Math.atan2(-this.m21,this.m22)),skewY:tt(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],n=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],d=t.value[3],g=t.value[4],y=t.value[5],p=h*d,x=c*l,b=(l*s-e*d)/(x-p),S=(h*s-e*c)/(p-x),C=(l*r-n*d)/(x-p),L=(h*r-n*c)/(p-x),R=(l*(o-y)+d*(g-a))/(x-p),Y=(h*(o-y)+c*(g-a))/(p-x),X=[b,S,C,L,R,Y];return new at(X)}toString(t=6){return this.matrix3d.is2D()?`matrix(${this.value.map(e=>Et(e,t)).join(",")})`:this.matrix3d.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix3D(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.matrix3d.translate(0,0,t),this.matrix3d.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix3d.m43),this}translate3d(t,e,s){return this.matrix3d.translate(t,e,s),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,s-this.matrix3d.m43),this}rotate(t,e=0,s=0){const n=O(t),r=Math.cos(n),a=Math.sin(n);return this.translate(e,s),this.multiply([r,a,-a,r,0,0]),this.translate(-e,-s),this.toMatrix3D(),this}rotateTo(t,e=0,s=0){const{degree:n}=this.split();return this.rotate(t-n,e,s),this}rotateX(t){return this.matrix3d.rotateX(t),this.matrix3d.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix3d.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix3d.rotateY(t),this.matrix3d.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix3d.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix3d.rotateZ(t),this.matrix3d.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix3d.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix3d.rotateX(t).rotateY(e).rotateZ(s),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:n,degreeY:r,degreeZ:a}=this.matrix3d.split();return this.rotate3d(t-n,e-r,s-a),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.multiply([t,0,0,e,0,0]),this.translate(-s,-n),this.toMatrix3D(),this}scaleTo(t,e=t,s=0,n=0){return this.scale(t/this.m11,e/this.m22,s,n)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix3d.scale(1,1,t),this.matrix3d.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix3d.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix3d.scale(t,e,s),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:n,scalarY:r,scalarZ:a}=this.matrix3d.split();return this.scale3d(t/n,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(O(e)),Math.sin(O(e)),-Math.sin(O(t)),Math.cos(O(t)),0,0]),this.toMatrix3D(),this}skewTo(t,e=t){const{skewX:s,skewY:n}=this.split();return this.skew(t-s,e-n)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix3d.perspective(t),this.matrix3d.toMatrix(this),this}}class ut{value;is3dSpecial=!1;constructor(t=$n){this.value=Array.from(t)}static fromString(t){const e=new ut,s=rn("number",t);return s.length===16&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from($n),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}clone(){return new ut([...this.value])}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this.m41*=t,this.m42*=t,this.m43*=t,this.m44*=t,this}normalize(){return this.scalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,s=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+s*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+s*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+s*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+s*this.m44}}toMatrix(t){const{scalarX:e,scalarY:s,skewX:n,skewY:r,x:a,y:o}=this.split(),h=[e,r,n,s,a,o];return t?(t.value=h,t):new at(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>Et(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),n=tt(yt(Math.asin(-this.m13),-1,1));let r=tt(Math.atan2(this.m23,this.m33));Math.cos(O(n))===0&&(r=tt(Math.atan2(-this.m31,this.m22)));let a=tt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(a+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:s,degreeX:r,degreeY:n,degreeZ:a,skewX:tt(this.m14),skewY:tt(this.m24),skewZ:tt(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}inverse(){const t=[],e=this.m11,s=this.m12,n=this.m13,r=this.m14,a=this.m21,o=this.m22,h=this.m23,c=this.m24,l=this.m31,d=this.m32,g=this.m33,y=this.m34,p=this.m41,x=this.m42,b=this.m43,S=this.m44;t[0]=h*y*x-c*g*x+c*d*b-o*y*b-h*d*S+o*g*S,t[1]=r*g*x-n*y*x-r*d*b+s*y*b+n*d*S-s*g*S,t[2]=n*c*x-r*h*x+r*o*b-s*c*b-n*o*S+s*h*S,t[3]=r*h*d-n*c*d-r*o*g+s*c*g+n*o*y-s*h*y;const C=e*t[0]+a*t[1]+l*t[2]+p*t[3];if(C==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=c*g*p-h*y*p-c*l*b+a*y*b+h*l*S-a*g*S,t[5]=n*y*p-r*g*p+r*l*b-e*y*b-n*l*S+e*g*S,t[6]=r*h*p-n*c*p-r*a*b+e*c*b+n*a*S-e*h*S,t[7]=n*c*l-r*h*l+r*a*g-e*c*g-n*a*y+e*h*y,t[8]=o*y*p-c*d*p+c*l*x-a*y*x-o*l*S+a*d*S,t[9]=r*d*p-s*y*p-r*l*x+e*y*x+s*l*S-e*d*S,t[10]=s*c*p-r*o*p+r*a*x-e*c*x-s*a*S+e*o*S,t[11]=r*o*l-s*c*l-r*a*d+e*c*d+s*a*y-e*o*y,t[12]=h*d*p-o*g*p-h*l*x+a*g*x+o*l*b-a*d*b,t[13]=s*g*p-n*d*p+n*l*x-e*g*x-s*l*b+e*d*b,t[14]=n*o*p-s*h*p-n*a*x+e*h*x+s*a*b-e*o*b,t[15]=s*h*l-n*o*l+n*a*d-e*h*d-s*a*g+e*o*g,this.value=t,this.scalar(1/C)}multiply(t){const e=this.clone();return this.m11=t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.m41,this.m12=t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.m42,this.m13=t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.m43,this.m14=t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,this.m21=t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.m41,this.m22=t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.m42,this.m23=t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.m43,this.m24=t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,this.m31=t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.m41,this.m32=t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.m42,this.m33=t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.m43,this.m34=t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,this.m41=t.m41*e.m11+t.m42*e.m21+t.m43*e.m31+t.m44*e.m41,this.m42=t.m41*e.m12+t.m42*e.m22+t.m43*e.m32+t.m44*e.m42,this.m43=t.m41*e.m13+t.m42*e.m23+t.m43*e.m33+t.m44*e.m43,this.m44=t.m41*e.m14+t.m42*e.m24+t.m43*e.m34+t.m44*e.m44,this}translate(t=0,e=0,s=0){return this.multiply(new ut([1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1]))}scale(t=1,e=1,s=1){return this.multiply(new ut([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}rotateX(t){const e=O(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new ut([1,0,0,0,0,s,n,0,0,-n,s,0,0,0,0,1]))}rotateY(t){const e=O(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new ut([s,0,-n,0,0,1,0,0,n,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=O(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new ut([s,n,0,0,-n,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new ut([1,0,0,O(t),0,1,0,O(e),0,0,1,O(s),0,0,0,1]))}perspective(t){return this.multiply(new ut([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,n=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,a=e+this.m31,o=s+this.m32,h=n+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,n/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-n;if(l==0)return{x:e,y:s,z:n,mass:r};const d=-n/l;return e+=d*(a-e),s+=d*(o-s),{x:e,y:s,z:n,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,n=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,n/=r,r<0&&(s-=this.m41,n-=this.m42,s*=1/r,n*=1/r,s+=this.m41,n+=this.m42),{x:s,y:n,z:e,mass:r}}bounds(t,e,s,n){const r=new Re({x:t,y:e}),a=new Re({x:t+s,y:e}),o=new Re({x:t+s,y:e+n}),h=new Re({x:t,y:e+n});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,a.x,o.x,h.x),l=Math.min(r.y,a.y,o.y,h.y),d=Math.max(r.x,a.x,o.x,h.x)-c,g=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:d,height:g}}}function mi(i){const t=new at;return i.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,n){n.indexOf(",")>=0?n=n.split(/\s*,\s*/):n=n.split(/\s+/);const r=[];for(let a=0,o=n.length;a<o;a++)n[a].trim()&&r.push(parseFloat(""+n[a]));switch(s.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix3D();break;case"matrix3d":t.matrix3d.multiply(new ut(r)),t.matrix3d.toMatrix(t);break}return""}),t}function Tt(i,t,e){const s=new at;return s.rotate(tt(i)),s.transformPoint({x:t,y:e})}function pi(i){const t=typeof i?.x=="number"?i?.x:0,e=typeof i?.y=="number"?i?.y:0,s=typeof i?.degree=="number"?i?.degree:0,n=typeof i?.scalarX=="number"?i?.scalarX:1,r=typeof i?.scalarY=="number"?i?.scalarY:1,a=O(s),o=Math.cos(a),h=Math.sin(a),c=new DOMMatrix([o*n,h*n,-h*r,o*r,t,e]);return c.multiplySelf(new DOMMatrix(i?.originMatrix||"")),c}function dh(i,t){const e=new Path2D(i),s=new Path2D;return s.addPath(e,pi(t)),s}function Jn(i,t){const e={x:t.m11,y:t.m12,z:t.m13},s={x:t.m21,y:t.m22,z:t.m23},n={x:t.m31,y:t.m32,z:t.m33},r=i.transformPoint(e),a=i.transformPoint(s),o=i.transformPoint(n),h=new at;return h.m11=r.x,h.m12=r.y,h.m13=r.z,h.m21=a.x,h.m22=a.y,h.m23=a.z,h.m31=o.x,h.m32=o.y,h.m33=o.z,h}function Zn(i,t){const e={x:t.m11,y:t.m12,z:t.m13,w:t.m14},s={x:t.m21,y:t.m22,z:t.m23,w:t.m24},n={x:t.m31,y:t.m32,z:t.m33,w:t.m34},r={x:t.m41,y:t.m42,z:t.m43,w:t.m44},a=i.transformPoint(e),o=i.transformPoint(s),h=i.transformPoint(n),c=i.transformPoint(r);return new ut([a.x,a.y,a.z,a.w,o.x,o.y,o.z,o.w,h.x,h.y,h.z,h.w,c.x,c.y,c.z,c.w])}function fh(i){let t=i[0];for(let e=1,s=i.length;e<s;e++)t=Jn(t,i[e]);return t}function mh(i){let t=i[0];for(let e=1,s=i.length;e<s;e++)t=Zn(t,i[e]);return t}class I{static createElementNS(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}static origins=new Ke;static updates=new Ke;static patchDom=()=>{this.origins.filter((t,e)=>{const s=this.updates.get(t);return s&&is(e,s),this.updates.delete(t),!1})};static getVNode(t,e){let s=t.getAttribute("id")||"";s||(s=e||Vs(),t.setAttribute("id",s)),this.origins.get(s)||this.origins.set(s,Wt(t.tagName,{},[],t));const n=this.updates.get(s)||Wt(t.tagName,{},[],t);return{vnode:n,immediate:()=>{this.updates.set(s,n),I.patchDom()},schedule:()=>{this.updates.set(s,n),hi("FLUSH_DOM_ACTIONS",I.patchDom,50)}}}static getElement(t){const e=t.style?t.ownerDocument:t.document||t;return{el:t,document:e,window:e.defaultView,isRootNode:/(html|body)/i.test(t.tagName)||t===document}}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static add3DSupport(t,e="1000px"){if(t.parentElement){const s=I.getStyle(t.parentElement,"position");I.setStyle(t.parentElement,{position:s=="static"?"relative":s,perspective:e})}I.setStyle(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,s={}){Object.prototype.hasOwnProperty.call(s,"transform")||Object.assign(s,{transform:I.getStyle(t,"transform")||""});const n=mi(s.transform),r={};for(const a in e){const o=e[a];switch(a){case"transform":break;case"translate":n.translate(o[0]||0,o[1]||0);break;case"translateTo":n.translateTo(o[0]||0,o[1]||0);break;case"translateX":n.translateX(o||0);break;case"translateXTo":n.translateXTo(o||0);break;case"translateY":n.translateY(o||0);break;case"translateYTo":n.translateYTo(o||0);break;case"translateZ":n.translateZ(o||0);break;case"translateZTo":n.translateZTo(o||0);break;case"translate3d":n.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":n.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?n.rotate(o||0):n.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?n.rotateTo(o||0):n.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":n.rotateX(o||0);break;case"rotateXTo":n.rotateXTo(o||0);break;case"rotateY":n.rotateY(o||0);break;case"rotateYTo":n.rotateYTo(o||0);break;case"rotateZ":n.rotateZ(o||0);break;case"rotateZTo":n.rotateZTo(o||0);break;case"rotate3d":n.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":n.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?n.scale(o||1):n.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?n.scaleTo(o||1):n.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":n.scaleX(o||1);break;case"scaleXTo":n.scaleXTo(o||1);break;case"scaleY":n.scaleY(o||1);break;case"scaleYTo":n.scaleYTo(o||1);break;case"scaleZ":n.scaleZ(o||1);break;case"scaleZTo":n.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?n.scale3d(o||1):n.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?n.scale3dTo(o||1):n.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?n.skew(o||0):n.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?n.skewTo(o||0):n.skewTo(o[0]||0,o[1]||0);break;case"skewX":n.skewX(o||0);break;case"skewXTo":n.skewXTo(o||0);break;case"skewY":n.skewY(o||0);break;case"skewYTo":n.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":n.perspective(o||0);break;default:Object.prototype.hasOwnProperty.call(s,a)||(s[a]=I.getStyle(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:n.toString()}),r}static attrsToCanvas(t,e){for(const s in e){const n=e[s];switch(s){case"fill":n!=="none"&&(t.fillStyle=n);break;case"stroke":n!=="none"&&(t.strokeStyle=n);break;case"stroke-width":case"strokeWidth":t.lineWidth=Number(n);break;case"stroke-linecap":case"strokeLinecap":t.lineCap=n;break;case"stroke-linejoin":case"strokeLinejoin":switch(n){case"round":case"bevel":case"miter":t.lineJoin=n;break;default:t.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":t.miterLimit=Number(n);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":t.lineDashOffset=Number(n);break;case"stroke-dasharray":case"strokeDasharray":typeof n=="string"&&t.setLineDash(n.split(/\s+/).map(r=>Number(r)));break;case"cursor":break;case"font":typeof n=="string"&&(t.font=n);break;case"font-size":case"fontSize":t.font+=` ${n}`;break;case"font-family":case"fontFamily":t.font+=` ${n}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(n){case"middle":t.textAlign="center";break;case"end":t.textAlign="end";break;case"start":t.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(n){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":t.textBaseline=n;break;default:t.textBaseline="alphabetic";break}break}}}static getStyle(t,e,s){const n=t;if(getComputedStyle)if(e){e=ct(e);const r=getComputedStyle(n,s).getPropertyPriority(e);return getComputedStyle(n,s).getPropertyValue(e).trim()+(r?"!"+r:"")}else{const r=[],a=getComputedStyle(n,"");for(let o=0;o<a.length;o++)r.push(a[o]+":"+a.getPropertyValue(a[o]));return r.push(...(n.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}else if(t.currentStyle){if(e)return e=hn(e),t.currentStyle[e];{const r=[],a=n.currentStyle;for(const o in a)r.push(o+":"+a[o]);return r.push(...(n.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}}}static setStyle(t,e,s){typeof e=="string"&&s?t.style.setProperty(ct(e),s.replace(/!important/i,""),String(s).toLowerCase().includes("!important")?"important":""):e instanceof Object&&Object.keys(e).forEach(n=>{t.style.setProperty(ct(n),String(e[n]).replace(/!important/i,""),String(e[n]).toLowerCase().includes("!important")?"important":"")})}static setStyleSheet(t,e){let s;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?s=r:s=document.querySelector(e)}else s=e;const n=document.createElement("style");if(n.innerHTML=t,s)return s.appendChild(n),()=>{(s instanceof HTMLElement||s instanceof ShadowRoot)&&s.removeChild(n)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static toggleClass(t,e,s="toggle"){e.split(/[,\s]+/).forEach(n=>{n.trim()!==""&&t.classList[s](n.trim())})}static addClass(t,e){this.toggleClass(t,e,"add")}static removeClass(t,e){this.toggleClass(t,e,"remove")}static hasClass(t,e){return e.split(/[,\s]+/).every(s=>s.trim()!==""?Array.from(t.classList||[]).includes(s.trim()):!0)}static toggleDisplay(t,e){this.getStyle(t,"display")=="none"&&e===void 0||e===!0?t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block"):t.style.setProperty("display","none")}static show(t){t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block")}static hide(t){t.style.setProperty("display","none")}static attribute(t,e,s){let n={};if(e===void 0&&s===void 0){for(let o=0,h=t.attributes,c=h.length;o<c;o++){const l=h[o];l.nodeName&&l.nodeValue&&(n[l.nodeName]=l.nodeValue)}return n}if(typeof e=="string"&&s===void 0)return t.getAttribute(ct(e));typeof e=="object"?n=e:typeof e=="string"&&s!==void 0&&(n[e]=s);const{vnode:r,schedule:a}=this.getVNode(t,n.id);Object.entries(n).forEach(([o,h])=>{r.props[ct(o)]=h}),a()}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&t.removeAttribute(s.trim())})}static fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static prop(t,e,s){if(s===void 0&&typeof e=="string")return t[e];{let n={};typeof e=="object"?n=e:typeof e=="string"&&s!==void 0&&(n[e]=s),Object.entries(n).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t[this.fixProp(s.trim())]})}static data(t,e,s){if(typeof e=="string"&&(e=hn(e)),(typeof e=="string"||e===void 0)&&s===void 0){const n=Object.assign({},t.dataset);return Object.keys(n).forEach(r=>{if(n[r]?.startsWith("[")||n[r]?.startsWith("{"))try{n[r]=JSON.parse(n[r]||"")}catch{}}),typeof e=="string"?n[e]:n}else{let n={};typeof e=="object"?n=e:typeof e=="string"&&(n[e]=s),Object.entries(n).forEach(([r,a])=>{a!=null?t.dataset[r]=a instanceof Object?JSON.stringify(a):a:delete t.dataset[r]})}}static removeData(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t.dataset[s.trim()]})}static empty(t){this.html(t,"")}static html(t,e){e instanceof HTMLElement||e instanceof SVGElement?this.insert(t,e,"replaceWith"):this.prop(t,"innerHTML",e)}static text(t,e){return this.prop(t,"textContent",e)}static value(t,e){return this.prop(t,"value",e)}static dispatchEvent(t,e,s){let n;const r=["click","dblclick","mousedown","mouseup","mousemove"],a=["keydown","keyup","keypress"];typeof e=="string"?r.includes(e)?n=new MouseEvent(e,s):a.includes(e)?n=new KeyboardEvent(e,s):n=new Event(e,s):n=e,t.dispatchEvent(n)}static scriptConvert(t){const e=s=>{const r=s.ownerDocument.createElement("script");r.text=s.text;const a=s.attributes;for(let o=0;o<a.length;o++)r.setAttribute(a[o].name,a[o].value);return r};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(s=>{s.parentNode?.replaceChild(e(s),s)}),t}static insert(t,e,s="append"){return typeof e=="string"?t[s](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[s](e),this}static createElement(t){return document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}static fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(s=>{const n=this.scriptConvert(s);n!=s&&e.content.replaceChild(n,s)}),e.content}static remove(t){return t.remove()}static siblings=t=>Array.prototype.slice.call(t.parentElement?.children).filter(e=>e!==t);static nextElementSibling(t){return t.nextElementSibling}static previousElementSibling(t){return t.previousElementSibling}static closest(t,e){return t.closest(e)}static shadowRoot(t){return t.shadowRoot}static parentElement=t=>t.parentElement;static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const s=t.options;for(let n=0,r=s.length;n<r;n++)s[n].value==e?s[n].selected=!0:s[n].selected=!1}}static changeRadioChecked(t,e){t instanceof HTMLInputElement&&(t.value==e?t.checked=!0:t.checked=!1)}static entity2text(t){const e={lt:60,"lt;":60,"AMP;":38,AMP:38,"GT;":62,GT:62,"QUOT;":34,QUOT:34,"apos;":39,"bull;":8226,"bullet;":8226,"copy;":169,copy:169,"deg;":176,deg:176};let s;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?s=parseInt(t.substring(2),16):s=parseInt(t.substring(1),10):s=e[t],s?String.fromCharCode(s):"&"+t}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let s=document.styleSheets.length||0;const n=()=>s>=e.length?(t(),!0):!1;n()||e.forEach(r=>{r.onload=()=>{s+=1,n()}})});static loadScript(t,e=()=>{},s=(n,r,a,o,h)=>{}){const n=document.createElement("script");n.type="text/javascript",n.src=t,n.async=!1,n.onload=e,n.onerror=s,document.body.appendChild(n)}static runInSafe(t){const e=new Proxy(window,{get(s,n,r){if(typeof n=="string"&&["open","location","document"].includes(n))throw new Error(`禁止访问 key: ${n}`);return n==="window"?e:Reflect.get(s,n,r)},set(s,n,r,a){return Reflect.set(s,n,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(s={},...n){const r=document.createElement(e);for(const a of Object.keys(s))r.setAttribute(a,s[a]);for(const a of n)typeof a=="string"?r.appendChild(document.createTextNode(a)):r.appendChild(a);return r}}});static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
|
|
12
12
|
let output = "";
|
|
13
13
|
function echo(html){
|
|
14
14
|
output += html;
|
|
15
15
|
}
|
|
16
16
|
${t}
|
|
17
17
|
return output;
|
|
18
|
-
})`}static escape(t,e="encode"){const s={"&":"&","<":"<",">":">",'"':""","'":"'"};for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t=t.replace(new RegExp(e=="encode"?n:s[n],"g"),e=="encode"?s[n]:n));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const s=t.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!e&&n<=s.length-1;)"innerText"in s[n]&&(e=s[n].innerText),n++}return e};static copyToClipboard=t=>new Promise((e,s)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(s);else{const n=document.createElement("textarea");n.value=t,n.style.opacity="0",n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy")?e():s()}catch(r){s(r)}document.body.removeChild(n)}});static scrollTo=(t,e)=>window.scrollTo(t,e);static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(s=>{t(s.coords)}):e("Geolocation is not supported by this browser")})}static vibrate(t=200){"vibrate"in navigator?window.navigator.vibrate(t):console.error("Your device is not support vibrate on this browser.")}static getSelectedText=()=>window.getSelection()?.toString();static isElementFocus=t=>t===document.activeElement;static isTabInView=()=>!document.hidden;static navigateBack=()=>history.back();static navigateBack2=()=>history.go(-1);static iframePostMessage(t,e="http://test.com/localstorage.html"){const s=document.createElement("iframe");s.src=e,document.body.append(s),setTimeout(function(){s.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){s.remove()},6e3)}static measureText=(t,e=12,s=400)=>{const n=document.createElement("span");n.style.visibility="hidden",n.style.margin="0",n.style.padding="0",n.style.inset="0",n.style.whiteSpace="nowrap",n.style.overflow="visible",n.style.fontSize=e+"px",n.style.fontWeight=s.toString(),n.innerText=t,document.body.appendChild(n);const r=n.offsetWidth,a=n.offsetHeight;return document.body.removeChild(n),{width:r,height:a}};static getFixedWidthText=(t,e,s=12,n=400,r=!0)=>{let a="";if(!t||e<s)return a;const o=t.split(""),h="...";let c=r?
|
|
18
|
+
})`}static escape(t,e="encode"){const s={"&":"&","<":"<",">":">",'"':""","'":"'"};for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t=t.replace(new RegExp(e=="encode"?n:s[n],"g"),e=="encode"?s[n]:n));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const s=t.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!e&&n<=s.length-1;)"innerText"in s[n]&&(e=s[n].innerText),n++}return e};static copyToClipboard=t=>new Promise((e,s)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(s);else{const n=document.createElement("textarea");n.value=t,n.style.opacity="0",n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy")?e():s()}catch(r){s(r)}document.body.removeChild(n)}});static scrollTo=(t,e)=>window.scrollTo(t,e);static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(s=>{t(s.coords)}):e("Geolocation is not supported by this browser")})}static vibrate(t=200){"vibrate"in navigator?window.navigator.vibrate(t):console.error("Your device is not support vibrate on this browser.")}static getSelectedText=()=>window.getSelection()?.toString();static isElementFocus=t=>t===document.activeElement;static isTabInView=()=>!document.hidden;static navigateBack=()=>history.back();static navigateBack2=()=>history.go(-1);static iframePostMessage(t,e="http://test.com/localstorage.html"){const s=document.createElement("iframe");s.src=e,document.body.append(s),setTimeout(function(){s.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){s.remove()},6e3)}static measureText=(t,e=12,s=400)=>{const n=document.createElement("span");n.style.visibility="hidden",n.style.margin="0",n.style.padding="0",n.style.inset="0",n.style.whiteSpace="nowrap",n.style.overflow="visible",n.style.fontSize=e+"px",n.style.fontWeight=s.toString(),n.innerText=t,document.body.appendChild(n);const r=n.offsetWidth,a=n.offsetHeight;return document.body.removeChild(n),{width:r,height:a}};static getFixedWidthText=(t,e,s=12,n=400,r=!0)=>{let a="";if(!t||e<s)return a;const o=t.split(""),h="...";let c=r?I.measureText(h,s,n).width:0;for(let l=0,d=o.length;l<d;l++)if(c+=I.measureText(o[l],s,n).width,c>e){r&&(a+=h);break}else a+=o[l];return a};static getMouseButton(t){if(document.implementation.hasFeature("MouseEvents","2.0"))return t.button;switch(t.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}}function ph(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Kn={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
19
19
|
* http://hammerjs.github.io/
|
|
20
20
|
*
|
|
21
21
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
22
22
|
* Licensed under the MIT license */(function(i){(function(t,e,s,n){var r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",h=Math.round,c=Math.abs,l=Date.now;function d(u,f,w){return setTimeout(L(u,w),f)}function g(u,f,w){return Array.isArray(u)?(y(u,w[f],w),!0):!1}function y(u,f,w){var v;if(u)if(u.forEach)u.forEach(f,w);else if(u.length!==n)for(v=0;v<u.length;)f.call(w,u[v],v,u),v++;else for(v in u)u.hasOwnProperty(v)&&f.call(w,u[v],v,u)}function p(u,f,w){var v="DEPRECATED METHOD: "+f+`
|
|
23
23
|
`+w+` AT
|
|
24
|
-
`;return function(){var M=new Error("get-stack-trace"),D=M&&M.stack?M.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",F=t.console&&(t.console.warn||t.console.log);return F&&F.call(t.console,v,D),u.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(f){if(f===n||f===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(f),v=1;v<arguments.length;v++){var M=arguments[v];if(M!==n&&M!==null)for(var D in M)M.hasOwnProperty(D)&&(w[D]=M[D])}return w}:x=Object.assign;var b=p(function(f,w,v){for(var M=Object.keys(w),D=0;D<M.length;)(!v||v&&f[M[D]]===n)&&(f[M[D]]=w[M[D]]),D++;return f},"extend","Use `assign`."),S=p(function(f,w){return b(f,w,!0)},"merge","Use `assign`.");function C(u,f,w){var v=f.prototype,M;M=u.prototype=Object.create(v),M.constructor=u,M._super=v,w&&x(M,w)}function L(u,f){return function(){return u.apply(f,arguments)}}function R(u,f){return typeof u==o?u.apply(f&&f[0]||n,f):u}function Y(u,f){return u===n?f:u}function X(u,f,w){y($(f),function(v){u.addEventListener(v,w,!1)})}function V(u,f,w){y($(f),function(v){u.removeEventListener(v,w,!1)})}function it(u,f){for(;u;){if(u==f)return!0;u=u.parentNode}return!1}function W(u,f){return u.indexOf(f)>-1}function $(u){return u.trim().split(/\s+/g)}function z(u,f,w){if(u.indexOf&&!w)return u.indexOf(f);for(var v=0;v<u.length;){if(w&&u[v][w]==f||!w&&u[v]===f)return v;v++}return-1}function nt(u){return Array.prototype.slice.call(u,0)}function bt(u,f,w){for(var v=[],M=[],D=0;D<u.length;){var F=f?u[D][f]:u[D];z(M,F)<0&&v.push(u[D]),M[D]=F,D++}return w&&(f?v=v.sort(function(K,ht){return K[f]>ht[f]}):v=v.sort()),v}function dt(u,f){for(var w,v,M=f[0].toUpperCase()+f.slice(1),D=0;D<r.length;){if(w=r[D],v=w?w+M:f,v in u)return v;D++}return n}var ve=1;function ie(){return ve++}function le(u){var f=u.ownerDocument||u;return f.defaultView||f.parentWindow||t}var Se=/mobile|tablet|ip(ad|hone|od)|android/i,_="ontouchstart"in t,A=dt(t,"PointerEvent")!==n,N=_&&Se.test(navigator.userAgent),P="touch",vt="pen",ne="mouse",fd="kinect",md=25,ot=1,ue=2,H=4,ft=8,Rs=1,ze=2,qe=4,He=8,je=16,_t=ze|qe,de=He|je,fa=_t|de,ma=["x","y"],Os=["clientX","clientY"];function St(u,f){var w=this;this.manager=u,this.callback=f,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(v){R(u.options.enable,[u])&&w.handler(v)},this.init()}St.prototype={handler:function(){},init:function(){this.evEl&&X(this.element,this.evEl,this.domHandler),this.evTarget&&X(this.target,this.evTarget,this.domHandler),this.evWin&&X(le(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&V(this.element,this.evEl,this.domHandler),this.evTarget&&V(this.target,this.evTarget,this.domHandler),this.evWin&&V(le(this.element),this.evWin,this.domHandler)}};function pd(u){var f,w=u.options.inputClass;return w?f=w:A?f=Hi:N?f=Bs:_?f=ji:f=Fs,new f(u,gd)}function gd(u,f,w){var v=w.pointers.length,M=w.changedPointers.length,D=f&ot&&v-M===0,F=f&(H|ft)&&v-M===0;w.isFirst=!!D,w.isFinal=!!F,D&&(u.session={}),w.eventType=f,yd(u,w),u.emit("hammer.input",w),u.recognize(w),u.session.prevInput=w}function yd(u,f){var w=u.session,v=f.pointers,M=v.length;w.firstInput||(w.firstInput=pa(f)),M>1&&!w.firstMultiple?w.firstMultiple=pa(f):M===1&&(w.firstMultiple=!1);var D=w.firstInput,F=w.firstMultiple,Z=F?F.center:D.center,K=f.center=ga(v);f.timeStamp=l(),f.deltaTime=f.timeStamp-D.timeStamp,f.angle=qi(Z,K),f.distance=Ns(Z,K),wd(w,f),f.offsetDirection=wa(f.deltaX,f.deltaY);var ht=ya(f.deltaTime,f.deltaX,f.deltaY);f.overallVelocityX=ht.x,f.overallVelocityY=ht.y,f.overallVelocity=c(ht.x)>c(ht.y)?ht.x:ht.y,f.scale=F?vd(F.pointers,v):1,f.rotation=F?bd(F.pointers,v):0,f.maxPointers=w.prevInput?f.pointers.length>w.prevInput.maxPointers?f.pointers.length:w.prevInput.maxPointers:f.pointers.length,xd(w,f);var Rt=u.element;it(f.srcEvent.target,Rt)&&(Rt=f.srcEvent.target),f.target=Rt}function wd(u,f){var w=f.center,v=u.offsetDelta||{},M=u.prevDelta||{},D=u.prevInput||{};(f.eventType===ot||D.eventType===H)&&(M=u.prevDelta={x:D.deltaX||0,y:D.deltaY||0},v=u.offsetDelta={x:w.x,y:w.y}),f.deltaX=M.x+(w.x-v.x),f.deltaY=M.y+(w.y-v.y)}function xd(u,f){var w=u.lastInterval||f,v=f.timeStamp-w.timeStamp,M,D,F,Z;if(f.eventType!=ft&&(v>md||w.velocity===n)){var K=f.deltaX-w.deltaX,ht=f.deltaY-w.deltaY,Rt=ya(v,K,ht);D=Rt.x,F=Rt.y,M=c(Rt.x)>c(Rt.y)?Rt.x:Rt.y,Z=wa(K,ht),u.lastInterval=f}else M=w.velocity,D=w.velocityX,F=w.velocityY,Z=w.direction;f.velocity=M,f.velocityX=D,f.velocityY=F,f.direction=Z}function pa(u){for(var f=[],w=0;w<u.pointers.length;)f[w]={clientX:h(u.pointers[w].clientX),clientY:h(u.pointers[w].clientY)},w++;return{timeStamp:l(),pointers:f,center:ga(f),deltaX:u.deltaX,deltaY:u.deltaY}}function ga(u){var f=u.length;if(f===1)return{x:h(u[0].clientX),y:h(u[0].clientY)};for(var w=0,v=0,M=0;M<f;)w+=u[M].clientX,v+=u[M].clientY,M++;return{x:h(w/f),y:h(v/f)}}function ya(u,f,w){return{x:f/u||0,y:w/u||0}}function wa(u,f){return u===f?Rs:c(u)>=c(f)?u<0?ze:qe:f<0?He:je}function Ns(u,f,w){w||(w=ma);var v=f[w[0]]-u[w[0]],M=f[w[1]]-u[w[1]];return Math.sqrt(v*v+M*M)}function qi(u,f,w){w||(w=ma);var v=f[w[0]]-u[w[0]],M=f[w[1]]-u[w[1]];return Math.atan2(M,v)*180/Math.PI}function bd(u,f){return qi(f[1],f[0],Os)+qi(u[1],u[0],Os)}function vd(u,f){return Ns(f[0],f[1],Os)/Ns(u[0],u[1],Os)}var Sd={mousedown:ot,mousemove:ue,mouseup:H},Cd="mousedown",Ed="mousemove mouseup";function Fs(){this.evEl=Cd,this.evWin=Ed,this.pressed=!1,St.apply(this,arguments)}C(Fs,St,{handler:function(f){var w=Sd[f.type];w&ot&&f.button===0&&(this.pressed=!0),w&ue&&f.which!==1&&(w=H),this.pressed&&(w&H&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[f],changedPointers:[f],pointerType:ne,srcEvent:f}))}});var Td={pointerdown:ot,pointermove:ue,pointerup:H,pointercancel:ft,pointerout:ft},Pd={2:P,3:vt,4:ne,5:fd},xa="pointerdown",ba="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(xa="MSPointerDown",ba="MSPointerMove MSPointerUp MSPointerCancel");function Hi(){this.evEl=xa,this.evWin=ba,St.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}C(Hi,St,{handler:function(f){var w=this.store,v=!1,M=f.type.toLowerCase().replace("ms",""),D=Td[M],F=Pd[f.pointerType]||f.pointerType,Z=F==P,K=z(w,f.pointerId,"pointerId");D&ot&&(f.button===0||Z)?K<0&&(w.push(f),K=w.length-1):D&(H|ft)&&(v=!0),!(K<0)&&(w[K]=f,this.callback(this.manager,D,{pointers:w,changedPointers:[f],pointerType:F,srcEvent:f}),v&&w.splice(K,1))}});var Md={touchstart:ot,touchmove:ue,touchend:H,touchcancel:ft},Ad="touchstart",kd="touchstart touchmove touchend touchcancel";function va(){this.evTarget=Ad,this.evWin=kd,this.started=!1,St.apply(this,arguments)}C(va,St,{handler:function(f){var w=Md[f.type];if(w===ot&&(this.started=!0),!!this.started){var v=Id.call(this,f,w);w&(H|ft)&&v[0].length-v[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:v[0],changedPointers:v[1],pointerType:P,srcEvent:f})}}});function Id(u,f){var w=nt(u.touches),v=nt(u.changedTouches);return f&(H|ft)&&(w=bt(w.concat(v),"identifier",!0)),[w,v]}var Dd={touchstart:ot,touchmove:ue,touchend:H,touchcancel:ft},_d="touchstart touchmove touchend touchcancel";function Bs(){this.evTarget=_d,this.targetIds={},St.apply(this,arguments)}C(Bs,St,{handler:function(f){var w=Dd[f.type],v=Ld.call(this,f,w);v&&this.callback(this.manager,w,{pointers:v[0],changedPointers:v[1],pointerType:P,srcEvent:f})}});function Ld(u,f){var w=nt(u.touches),v=this.targetIds;if(f&(ot|ue)&&w.length===1)return v[w[0].identifier]=!0,[w,w];var M,D,F=nt(u.changedTouches),Z=[],K=this.target;if(D=w.filter(function(ht){return it(ht.target,K)}),f===ot)for(M=0;M<D.length;)v[D[M].identifier]=!0,M++;for(M=0;M<F.length;)v[F[M].identifier]&&Z.push(F[M]),f&(H|ft)&&delete v[F[M].identifier],M++;if(Z.length)return[bt(D.concat(Z),"identifier",!0),Z]}var Rd=2500,Sa=25;function ji(){St.apply(this,arguments);var u=L(this.handler,this);this.touch=new Bs(this.manager,u),this.mouse=new Fs(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}C(ji,St,{handler:function(f,w,v){var M=v.pointerType==P,D=v.pointerType==ne;if(!(D&&v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents)){if(M)Od.call(this,w,v);else if(D&&Nd.call(this,v))return;this.callback(f,w,v)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Od(u,f){u&ot?(this.primaryTouch=f.changedPointers[0].identifier,Ca.call(this,f)):u&(H|ft)&&Ca.call(this,f)}function Ca(u){var f=u.changedPointers[0];if(f.identifier===this.primaryTouch){var w={x:f.clientX,y:f.clientY};this.lastTouches.push(w);var v=this.lastTouches,M=function(){var D=v.indexOf(w);D>-1&&v.splice(D,1)};setTimeout(M,Rd)}}function Nd(u){for(var f=u.srcEvent.clientX,w=u.srcEvent.clientY,v=0;v<this.lastTouches.length;v++){var M=this.lastTouches[v],D=Math.abs(f-M.x),F=Math.abs(w-M.y);if(D<=Sa&&F<=Sa)return!0}return!1}var Ea=dt(a.style,"touchAction"),Ta=Ea!==n,Pa="compute",Ma="auto",Wi="manipulation",fe="none",We="pan-x",$e="pan-y",Xs=Bd();function $i(u,f){this.manager=u,this.set(f)}$i.prototype={set:function(u){u==Pa&&(u=this.compute()),Ta&&this.manager.element.style&&Xs[u]&&(this.manager.element.style[Ea]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return y(this.manager.recognizers,function(f){R(f.options.enable,[f])&&(u=u.concat(f.getTouchAction()))}),Fd(u.join(" "))},preventDefaults:function(u){var f=u.srcEvent,w=u.offsetDirection;if(this.manager.session.prevented){f.preventDefault();return}var v=this.actions,M=W(v,fe)&&!Xs[fe],D=W(v,$e)&&!Xs[$e],F=W(v,We)&&!Xs[We];if(M){var Z=u.pointers.length===1,K=u.distance<2,ht=u.deltaTime<250;if(Z&&K&&ht)return}if(!(F&&D)&&(M||D&&w&_t||F&&w&de))return this.preventSrc(f)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function Fd(u){if(W(u,fe))return fe;var f=W(u,We),w=W(u,$e);return f&&w?fe:f||w?f?We:$e:W(u,Wi)?Wi:Ma}function Bd(){if(!Ta)return!1;var u={},f=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){u[w]=f?t.CSS.supports("touch-action",w):!0}),u}var Ys=1,Ct=2,Ce=4,re=8,zt=re,Je=16,Lt=32;function qt(u){this.options=x({},this.defaults,u||{}),this.id=ie(),this.manager=null,this.options.enable=Y(this.options.enable,!0),this.state=Ys,this.simultaneous={},this.requireFail=[]}qt.prototype={defaults:{},set:function(u){return x(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(g(u,"recognizeWith",this))return this;var f=this.simultaneous;return u=Us(u,this),f[u.id]||(f[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return g(u,"dropRecognizeWith",this)?this:(u=Us(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(g(u,"requireFailure",this))return this;var f=this.requireFail;return u=Us(u,this),z(f,u)===-1&&(f.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(g(u,"dropRequireFailure",this))return this;u=Us(u,this);var f=z(this.requireFail,u);return f>-1&&this.requireFail.splice(f,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var f=this,w=this.state;function v(M){f.manager.emit(M,u)}w<re&&v(f.options.event+Aa(w)),v(f.options.event),u.additionalEvent&&v(u.additionalEvent),w>=re&&v(f.options.event+Aa(w))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=Lt},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(Lt|Ys)))return!1;u++}return!0},recognize:function(u){var f=x({},u);if(!R(this.options.enable,[this,f])){this.reset(),this.state=Lt;return}this.state&(zt|Je|Lt)&&(this.state=Ys),this.state=this.process(f),this.state&(Ct|Ce|re|Je)&&this.tryEmit(f)},process:function(u){},getTouchAction:function(){},reset:function(){}};function Aa(u){return u&Je?"cancel":u&re?"end":u&Ce?"move":u&Ct?"start":""}function ka(u){return u==je?"down":u==He?"up":u==ze?"left":u==qe?"right":""}function Us(u,f){var w=f.manager;return w?w.get(u):u}function Pt(){qt.apply(this,arguments)}C(Pt,qt,{defaults:{pointers:1},attrTest:function(u){var f=this.options.pointers;return f===0||u.pointers.length===f},process:function(u){var f=this.state,w=u.eventType,v=f&(Ct|Ce),M=this.attrTest(u);return v&&(w&ft||!M)?f|Je:v||M?w&H?f|re:f&Ct?f|Ce:Ct:Lt}});function Gs(){Pt.apply(this,arguments),this.pX=null,this.pY=null}C(Gs,Pt,{defaults:{event:"pan",threshold:10,pointers:1,direction:fa},getTouchAction:function(){var u=this.options.direction,f=[];return u&_t&&f.push($e),u&de&&f.push(We),f},directionTest:function(u){var f=this.options,w=!0,v=u.distance,M=u.direction,D=u.deltaX,F=u.deltaY;return M&f.direction||(f.direction&_t?(M=D===0?Rs:D<0?ze:qe,w=D!=this.pX,v=Math.abs(u.deltaX)):(M=F===0?Rs:F<0?He:je,w=F!=this.pY,v=Math.abs(u.deltaY))),u.direction=M,w&&v>f.threshold&&M&f.direction},attrTest:function(u){return Pt.prototype.attrTest.call(this,u)&&(this.state&Ct||!(this.state&Ct)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var f=ka(u.direction);f&&(u.additionalEvent=this.options.event+f),this._super.emit.call(this,u)}});function Ji(){Pt.apply(this,arguments)}C(Ji,Pt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[fe]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&Ct)},emit:function(u){if(u.scale!==1){var f=u.scale<1?"in":"out";u.additionalEvent=this.options.event+f}this._super.emit.call(this,u)}});function Zi(){qt.apply(this,arguments),this._timer=null,this._input=null}C(Zi,qt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ma]},process:function(u){var f=this.options,w=u.pointers.length===f.pointers,v=u.distance<f.threshold,M=u.deltaTime>f.time;if(this._input=u,!v||!w||u.eventType&(H|ft)&&!M)this.reset();else if(u.eventType&ot)this.reset(),this._timer=d(function(){this.state=zt,this.tryEmit()},f.time,this);else if(u.eventType&H)return zt;return Lt},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===zt&&(u&&u.eventType&H?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Ki(){Pt.apply(this,arguments)}C(Ki,Pt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[fe]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&Ct)}});function Qi(){Pt.apply(this,arguments)}C(Qi,Pt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:_t|de,pointers:1},getTouchAction:function(){return Gs.prototype.getTouchAction.call(this)},attrTest:function(u){var f=this.options.direction,w;return f&(_t|de)?w=u.overallVelocity:f&_t?w=u.overallVelocityX:f&de&&(w=u.overallVelocityY),this._super.attrTest.call(this,u)&&f&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&c(w)>this.options.velocity&&u.eventType&H},emit:function(u){var f=ka(u.offsetDirection);f&&this.manager.emit(this.options.event+f,u),this.manager.emit(this.options.event,u)}});function Vs(){qt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}C(Vs,qt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Wi]},process:function(u){var f=this.options,w=u.pointers.length===f.pointers,v=u.distance<f.threshold,M=u.deltaTime<f.time;if(this.reset(),u.eventType&ot&&this.count===0)return this.failTimeout();if(v&&M&&w){if(u.eventType!=H)return this.failTimeout();var D=this.pTime?u.timeStamp-this.pTime<f.interval:!0,F=!this.pCenter||Ns(this.pCenter,u.center)<f.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!F||!D?this.count=1:this.count+=1,this._input=u;var Z=this.count%f.taps;if(Z===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=zt,this.tryEmit()},f.interval,this),Ct):zt}return Lt},failTimeout:function(){return this._timer=d(function(){this.state=Lt},this.options.interval,this),Lt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==zt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ht(u,f){return f=f||{},f.recognizers=Y(f.recognizers,Ht.defaults.preset),new tn(u,f)}Ht.VERSION="2.0.7",Ht.defaults={domEvents:!1,touchAction:Pa,enable:!0,inputTarget:null,inputClass:null,preset:[[Ki,{enable:!1}],[Ji,{enable:!1},["rotate"]],[Qi,{direction:_t}],[Gs,{direction:_t},["swipe"]],[Vs],[Vs,{event:"doubletap",taps:2},["tap"]],[Zi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Xd=1,Ia=2;function tn(u,f){this.options=x({},Ht.defaults,f||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=pd(this),this.touchAction=new $i(this,this.options.touchAction),Da(this,!0),y(this.options.recognizers,function(w){var v=this.add(new w[0](w[1]));w[2]&&v.recognizeWith(w[2]),w[3]&&v.requireFailure(w[3])},this)}tn.prototype={set:function(u){return x(this.options,u),u.touchAction&&this.touchAction.update(),u.inputTarget&&(this.input.destroy(),this.input.target=u.inputTarget,this.input.init()),this},stop:function(u){this.session.stopped=u?Ia:Xd},recognize:function(u){var f=this.session;if(!f.stopped){this.touchAction.preventDefaults(u);var w,v=this.recognizers,M=f.curRecognizer;(!M||M&&M.state&zt)&&(M=f.curRecognizer=null);for(var D=0;D<v.length;)w=v[D],f.stopped!==Ia&&(!M||w==M||w.canRecognizeWith(M))?w.recognize(u):w.reset(),!M&&w.state&(Ct|Ce|re)&&(M=f.curRecognizer=w),D++}},get:function(u){if(u instanceof qt)return u;for(var f=this.recognizers,w=0;w<f.length;w++)if(f[w].options.event==u)return f[w];return null},add:function(u){if(g(u,"add",this))return this;var f=this.get(u.options.event);return f&&this.remove(f),this.recognizers.push(u),u.manager=this,this.touchAction.update(),u},remove:function(u){if(g(u,"remove",this))return this;if(u=this.get(u),u){var f=this.recognizers,w=z(f,u);w!==-1&&(f.splice(w,1),this.touchAction.update())}return this},on:function(u,f){if(u!==n&&f!==n){var w=this.handlers;return y($(u),function(v){w[v]=w[v]||[],w[v].push(f)}),this}},off:function(u,f){if(u!==n){var w=this.handlers;return y($(u),function(v){f?w[v]&&w[v].splice(z(w[v],f),1):delete w[v]}),this}},emit:function(u,f){this.options.domEvents&&Yd(u,f);var w=this.handlers[u]&&this.handlers[u].slice();if(!(!w||!w.length)){f.type=u,f.preventDefault=function(){f.srcEvent.preventDefault()};for(var v=0;v<w.length;)w[v](f),v++}},destroy:function(){this.element&&Da(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Da(u,f){var w=u.element;if(w.style){var v;y(u.options.cssProps,function(M,D){v=dt(w.style,D),f?(u.oldCssProps[v]=w.style[v],w.style[v]=M):w.style[v]=u.oldCssProps[v]||""}),f||(u.oldCssProps={})}}function Yd(u,f){var w=e.createEvent("Event");w.initEvent(u,!0,!0),w.gesture=f,f.target.dispatchEvent(w)}x(Ht,{INPUT_START:ot,INPUT_MOVE:ue,INPUT_END:H,INPUT_CANCEL:ft,STATE_POSSIBLE:Ys,STATE_BEGAN:Ct,STATE_CHANGED:Ce,STATE_ENDED:re,STATE_RECOGNIZED:zt,STATE_CANCELLED:Je,STATE_FAILED:Lt,DIRECTION_NONE:Rs,DIRECTION_LEFT:ze,DIRECTION_RIGHT:qe,DIRECTION_UP:He,DIRECTION_DOWN:je,DIRECTION_HORIZONTAL:_t,DIRECTION_VERTICAL:de,DIRECTION_ALL:fa,Manager:tn,Input:St,TouchAction:$i,TouchInput:Bs,MouseInput:Fs,PointerEventInput:Hi,TouchMouseInput:ji,SingleTouchInput:va,Recognizer:qt,AttrRecognizer:Pt,Tap:Vs,Pan:Gs,Swipe:Qi,Pinch:Ji,Rotate:Ki,Press:Zi,on:X,off:V,each:y,merge:S,extend:b,assign:x,inherit:C,bindFn:L,prefixed:dt});var Ud=typeof t<"u"?t:typeof self<"u"?self:{};Ud.Hammer=Ht,typeof n=="function"&&n.amd?n(function(){return Ht}):i.exports?i.exports=Ht:t[s]=Ht})(window,document,"Hammer")})(Zn);var yh=Zn.exports;const wh=gh(yh);class Kn{constructor(){}static getFormatKeyNames(t){const e=ti(),s=[];return t.ctrl&&s.push(e?"Cmd":"Ctrl"),t.shift&&s.push("Shift"),t.alt&&s.push("Alt"),typeof t.key=="string"?s.push(qs(t.key)):Array.isArray(t.key)&&(t.key.map(n=>qs(n)),s.push(...t.key)),s}static matchKeyScheme(t,e){const s=t.ctrl??!1,n=t.shift??!1,r=t.alt??!1;if(t.exact)return(s===e.metaKey||s===e.ctrlKey)&&n===e.shiftKey&&r===e.altKey;const a=[];return s&&a.push(s===e.metaKey||s===e.ctrlKey),n&&a.push(n===e.shiftKey),r&&a.push(r===e.altKey),a.every(o=>o)}static on(t,e){if(t?.key===void 0||t?.key===null)return e;const s=t?.target??window;let n=!1;const r=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!n&&o.key!=="Control"&&o.key!=="Meta"&&o.key!=="Shift"&&o.key!=="Option"&&o.key!=="Alt"&&r.find(h=>h.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const h=e(o);if(typeof h!="function")return;const c=l=>{l.preventDefault(),h(l),s.removeEventListener("keyup",c)};s.addEventListener("keyup",c)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>n=!0,e.restart=()=>n=!1,e.removeListener=()=>s.removeEventListener("keydown",a),s.addEventListener("keydown",a),e}}const xh={BACKSPACE:8,TAB:9,COMMA:188,DELETE:46,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,UP:38,DOWN:40,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32};class Qn extends ss{container;width;height;mousePoint;hammer;removes=[];constructor(t=document.documentElement,e=!0,s){super(),this.container=t,this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.hammer=new wh(this.container),this.mousePoint={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0},e&&this.start(s)}emitDebounce=Ka((t,...e)=>super.emit(t,...e),50);emit(t,...e){switch(t){case"panLeft":case"panRight":this.emitDebounce(t,...e);break;default:super.emit(t,...e);break}return this}start(t){this.registerMouseEventListeners(),this.registerInputEventListeners(),this.registerTransitionEventListeners(),this.registerAnimationEventListeners(),this.registerResizeObserver(),this.registerElementDisplayInParent(),t&&t.forEach(e=>{this.addRemoves(e())}),this.captureMove()}destroy(){this.removes.forEach(t=>t()),this.removes=[],this.removeAllListeners()}restart(){this.destroy(),this.start()}addRemoves(t){this.removes.push(t)}registerMouseEventListeners(){const t=P=>{this.emit("mouseDown",P)},e=P=>{this.emit("mouseUp",P)},s=P=>{this.emit("mouseMove",P)},n=P=>{this.emit("mouseOver",P)},r=P=>{this.emit("mouseOut",P)},a=P=>{this.emit("mouseClick",P)},o=P=>{this.emit("mouseDoubleClick",P)},h=P=>{this.emit("mouseWheel",P)},c=P=>{this.emit("mouseContextMenu",P)},l=P=>{this.emit("touchStart",P)},d=P=>{this.emit("touchEnd",P)},g=P=>{this.emit("touchCancel",P)},y=P=>{this.emit("touchMove",P)},p=P=>{this.emit("pointerDown",P)},x=P=>{this.emit("pointerUp",P)},b=P=>{this.emit("pointerCancel",P)},S=P=>{this.emit("pointerMove",P)},C=P=>{this.emit("pan",P)},L=P=>{this.emit("panStart",P)},R=P=>{this.emit("panMove",P)},Y=P=>{this.emit("panEnd",P)},X=P=>{this.emit("panCancel",P)},V=P=>{this.emit("panLeft",P)},it=P=>{this.emit("panRight",P)},W=P=>{this.emit("panUp",P)},$=P=>{this.emit("panDown",P)},z=P=>{this.emit("pinch",P)},nt=P=>{this.emit("press",P)},bt=P=>{this.emit("rotate",P)},dt=P=>{this.emit("swipe",P)},ve=P=>{this.emit("swipeLeft",P)},ie=P=>{this.emit("swipeRight",P)},le=P=>{this.emit("swipeUp",P)},Se=P=>{this.emit("swipeDown",P)},_=P=>{this.emit("tap",P)},A=P=>{!P.target||this.container==P.target||this.container.contains(P.target)||this.emit("tapOutSide",P)};this.container.addEventListener("mousedown",t),this.container.addEventListener("mouseup",e),this.container.addEventListener("mousemove",s),this.container.addEventListener("mouseover",n),this.container.addEventListener("mouseout",r),this.container.addEventListener("click",a),this.container.addEventListener("dblclick",o),this.container.addEventListener("wheel",h),this.container.addEventListener("contextmenu",c),this.container.addEventListener("touchstart",l),this.container.addEventListener("touchend",d),this.container.addEventListener("touchcancel",g),this.container.addEventListener("touchmove",y),this.container.addEventListener("pointerdown",p),this.container.addEventListener("pointerup",x),this.container.addEventListener("pointercancel",b),this.container.addEventListener("pointermove",S),this.hammer.on("pan",C),this.hammer.on("panstart",L),this.hammer.on("panmove",R),this.hammer.on("panend",Y),this.hammer.on("pancancel",X),this.hammer.on("panleft",V),this.hammer.on("panright",it),this.hammer.on("panup",W),this.hammer.on("pandown",$),this.hammer.on("pinch",z),this.hammer.on("press",nt),this.hammer.on("rotate",bt),this.hammer.on("swipe",dt),this.hammer.on("swipeleft",ve),this.hammer.on("swiperight",ie),this.hammer.on("swipeup",le),this.hammer.on("swipedown",Se),this.hammer.on("tap",_),document.addEventListener("pointerdown",A,!1);const N=()=>{this.container.removeEventListener("mousedown",t),this.container.removeEventListener("mouseup",e),this.container.removeEventListener("mousemove",s),this.container.removeEventListener("mouseover",n),this.container.removeEventListener("mouseout",r),this.container.removeEventListener("click",a),this.container.removeEventListener("dblclick",o),this.container.removeEventListener("wheel",h),this.container.removeEventListener("contextmenu",c),this.container.removeEventListener("touchstart",l),this.container.removeEventListener("touchend",d),this.container.removeEventListener("touchcancel",g),this.container.removeEventListener("touchmove",y),this.container.removeEventListener("pointerdown",p),this.container.removeEventListener("pointerup",x),this.container.removeEventListener("pointercancel",b),this.container.removeEventListener("pointermove",S),this.hammer.off("pan",C),this.hammer.off("panstart",L),this.hammer.off("panmove",R),this.hammer.off("panend",Y),this.hammer.off("pancancel",X),this.hammer.off("panleft",V),this.hammer.off("panright",it),this.hammer.off("panup",W),this.hammer.off("pandown",$),this.hammer.off("pinch",z),this.hammer.off("press",nt),this.hammer.off("rotate",bt),this.hammer.off("swipe",dt),this.hammer.off("swipeleft",ve),this.hammer.off("swiperight",ie),this.hammer.off("swipeup",le),this.hammer.off("swipedown",Se),this.hammer.off("tap",_),document.removeEventListener("pointerdown",A,!1),document.removeEventListener("touchstart",A,!1),document.removeEventListener("mousedown",A,!1)};return this.addRemoves(N),N}registerInputEventListeners(){const t=h=>{this.emit("inputChange",h,this.container.files)},e=h=>{this.emit("dragstart",h)},s=h=>{h.dataTransfer&&(h.dataTransfer.dropEffect="copy"),this.emit("dragover",h)},n=h=>{this.emit("dragenter",h)},r=h=>{this.emit("dragend",h)},a=h=>{h.dataTransfer,this.emit("drop",h,h.dataTransfer?.files)};this.container instanceof HTMLInputElement&&this.container.addEventListener("change",t,!1),this.container.addEventListener("dragstart",e,!1),this.container.addEventListener("dragover",s,!1),this.container.addEventListener("dragenter",n,!1),this.container.addEventListener("dragend",r,!1),this.container.addEventListener("drop",a,!1);const o=()=>{this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",t,!1),this.container.removeEventListener("dragstart",e,!1),this.container.removeEventListener("dragover",s,!1),this.container.removeEventListener("dragenter",n,!1),this.container.removeEventListener("dragend",r,!1),this.container.removeEventListener("drop",a,!1)};return this.addRemoves(o),o}registerTransitionEventListeners(){const t=n=>{this.emit("transitionstart",n)},e=n=>{this.emit("transitionend",n)};this.container.addEventListener("transitionstart",t),this.container.addEventListener("transitionend",e);const s=()=>{this.container.removeEventListener("transitionstart",t),this.container.removeEventListener("transitionend",e)};return this.addRemoves(s),s}registerAnimationEventListeners(){const t=n=>{this.emit("animationstart",n)},e=n=>{this.emit("animationend",n)};this.container.addEventListener("animationstart",t),this.container.addEventListener("animationend",e);const s=()=>{this.container.removeEventListener("animationstart",t),this.container.removeEventListener("animationend",e)};return this.addRemoves(s),s}registerKeyDown(t,e,s){const n=Kn.on(t,a=>(e(a,n.formatedKeyNames,n.pause,n.restart),s)),r=()=>{n.removeListener?.()};return this.addRemoves(r),r}registerResizeObserver(){const t=new ResizeObserver(s=>{const{width:n,height:r}=s[0].contentRect;this.width=n,this.height=r,this.emit("resize",n,r)});t.observe(this.container);const e=()=>{t.unobserve(this.container)};return this.addRemoves(e),e}registerElementDisplayInParent(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},s=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const c=r.find(l=>l.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);s.observe(this.container);const n=()=>{s.unobserve(this.container)};return this.addRemoves(n),n}registerPullDownRefresh(t){const e=t?.distance||50;return this.captureMove({move:(s,n)=>{n.dStartY>0&&n.dStartY<e&&this.emit("pullDowning",n.dStartY)},end:(s,n)=>{n.dStartY>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;return this.captureMove({move:(s,n)=>{n.dStartY>0&&n.dStartY<e&&this.emit("pullUping",n.dStartY)},end:(s,n)=>{n.dStartY>=e&&this.emit("pullUp")}})}static isTouchEnabled(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}isRunningSingletonCaptureMove=!1;captureMoveStarts=[];captureMoveMoves=[];captureMoveEnds=[];captureMove(t){const e=t?.start||(()=>{}),s=t?.move||(()=>{}),n=t?.end||(()=>{});return this.captureMoveStarts.push(e),this.captureMoveMoves.push(s),this.captureMoveEnds.push(n),this.isRunningSingletonCaptureMove||(this.isRunningSingletonCaptureMove=!0,this.captureMoveUsePointer(),this.addRemoves(()=>{this.captureMoveStarts=[],this.captureMoveMoves=[],this.captureMoveEnds=[]})),()=>{this.captureMoveStarts=this.captureMoveStarts.filter(r=>r!=e),this.captureMoveMoves=this.captureMoveMoves.filter(r=>r!=s),this.captureMoveEnds=this.captureMoveEnds.filter(r=>r!=n)}}setMousePoint(t){this.mousePoint.x=t.x,this.mousePoint.y=t.y,this.mousePoint.dx=typeof t.dx=="number"?t.dx:0,this.mousePoint.dy=typeof t.dy=="number"?t.dy:0,this.mousePoint.dStartX=typeof t.dStartX=="number"?t.dStartX:0,this.mousePoint.dStartY=typeof t.dStartY=="number"?t.dStartY:0}captureMoveUsePointer(){let t,e;const s=o=>{e=Mt(o);const h={...e};t=h,this.setMousePoint(h),this.captureMoveStarts.forEach(c=>{c(o,h)})},n=o=>{e=Mt(o);const h={...e,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(h),this.captureMoveEnds.forEach(c=>{c(o,h)}),t=null},r=o=>{const h={...e};e=Mt(o);const c={...e,dx:e.x-h.x,dy:e.y-h.y,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(c),this.captureMoveMoves.forEach(l=>{l(o,c)})};this.on("pointerDown",s),this.on("pointerUp",n),this.on("pointerCancel",n),this.on("pointerMove",r);const a=()=>{this.off("pointerDown",s),this.off("pointerUp",n),this.off("pointerCancel",n),this.off("pointerMove",r)};return this.addRemoves(a),a}captureMoveUseMouse(){let t,e;const s=o=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",n,!1),e=Mt(o);const h={...e};t=h,this.setMousePoint(h),this.captureMoveStarts.forEach(c=>{c(o,h)})},n=o=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",n,!1),e=Mt(o);const h={...e,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(h),this.captureMoveEnds.forEach(c=>{c(o,h)}),t=null},r=o=>{const h={...e};e=Mt(o);const c={...e,dx:e.x-h.x,dy:e.y-h.y,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(c),this.captureMoveMoves.forEach(l=>{l(o,c)})};this.on("mouseDown",s);const a=()=>{this.off("mouseDown",s)};return this.addRemoves(a),a}captureMoveUseTouch(){let t,e;const s=o=>{const h=o.changedTouches[0];e=Mt(h);const c={...e};t=c,this.setMousePoint(c),this.captureMoveStarts.forEach(l=>{l(h,c)})},n=o=>{const h=o.changedTouches[0];e=Mt(h);const c={...e,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(c),this.captureMoveEnds.forEach(l=>{l(h,c)}),t=null},r=o=>{const h=o.changedTouches[0],c={...e};e=Mt(h);const l={...e,dx:e.x-c.x,dy:e.y-c.y,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(l),this.captureMoveMoves.forEach(d=>{d(h,l)})};this.on("touchStart",s),this.on("touchEnd",n),this.on("touchCancel",n),this.on("touchMove",r);const a=()=>{this.off("touchStart",s),this.off("touchEnd",n),this.off("touchCancel",n),this.off("touchMove",r)};return this.addRemoves(a),a}simulateMouseEvent(t,e){if(t.touches.length>1)return;const s=t.changedTouches[0],n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:s.screenX,screenY:s.screenY,clientX:s.clientX,clientY:s.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});t.target?.dispatchEvent(n)}}const et=new Qn(document.documentElement,!0,[()=>bh("(prefers-color-scheme: dark)"),vh,Ch,Sh]);et.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{bn().then(i=>is(i[0])).then(i=>{et.emit("openFile",i)}).catch(i=>{et.emit("openFileError",i)})});function bh(i){let t="";switch(i){case"(prefers-color-scheme: dark)":t="matchMediaChangePrefersColorSchemeDark";break;default:t=i;break}const e=s=>{et.emit(t,s.matches)};return window.matchMedia(i).addEventListener("change",e),()=>{window.matchMedia(i).removeEventListener("change",e)}}function vh(){let i="";const t=new MutationObserver(n=>{location.href!==i&&(i=location.href,et.emit("urlchange",location.href))});t.observe(document,{attributes:!0,childList:!0,subtree:!0});const e=()=>{et.emit("hashchange",location.hash)};window.addEventListener("hashchange",e);const s=()=>{et.emit("popstate")};return window.addEventListener("popstate",s),()=>{t.disconnect(),window.removeEventListener("hashchange",e),window.removeEventListener("popstate",s)}}function Sh(){const i=r=>{et.emit("beforeunload",r)};window.addEventListener("beforeunload",i);const t=r=>{et.emit("pagehide",r)};window.addEventListener("pagehide",t);const e=r=>{et.emit("windowFocus",r)};window.addEventListener("focus",e);const s=r=>{et.emit("windowBlur",r)};window.addEventListener("blur",s);const n=r=>{document.hidden?et.emit("windowVisibilityChangeHide",r):et.emit("windowVisibilityChangeShow",r)};return document.addEventListener("visibilitychange",n),()=>{window.removeEventListener("beforeunload",i),window.removeEventListener("pagehide",t),window.removeEventListener("focus",e),window.removeEventListener("blur",s),document.removeEventListener("visibilitychange",n)}}function Ch(){const i=t=>{et.emit("scroll",t)};return document.addEventListener("scroll",i),()=>{document.removeEventListener("scroll",i)}}const Eh=i=>{let t=!1;function e(){if(document.readyState!=="loading"){if(t){document.removeEventListener("DOMContentLoaded",e);return}t=!0,document.removeEventListener("DOMContentLoaded",e),i()}}document.addEventListener("DOMContentLoaded",e),e()};class Oe{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),s=document.createElement("video"),n=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),n.src=URL.createObjectURL(r),n.media="(min-width:10px)",s.append(n),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(s),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{Oe.setAutoPlayWhenClick(t),e(!1)})})}static setAutoPlayWhenClick(t){function e(){t.autoplay=!0,t.play(),document.removeEventListener("click",e),document.removeEventListener("touchend",e)}document.addEventListener("click",e),document.addEventListener("touchend",e)}}class tr extends ss{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=rn(this.source);if(t===0){this.emit("finish");return}let e,s,n=an(this.source,0);for(let r=1;r<t;r++)e=s,s=n,n=an(this.source,r),this.raw+=s,s&&this.step(s,n,e);n&&this.step(n,void 0,s),this.emit("finish")}step(t,e,s){t==`
|
|
25
|
-
`&&this.emit("newline"),this.act(t,e,s)}act(t,e,s){switch(this.mode){case"text":switch(t){case"<":case"eof":this.nodename="",this.attrs={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.emit("text",this.textchunk),this.raw+=t,this.textchunk="";break;case"&":this.mode="entity",this.entity="";break;default:this.textchunk+=t;break}break;case"entity":Ot("whitespace",t)?(this.textchunk+=k.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=k.entity2text(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(s=="!"&&t=="-"&&e=="-"){this.mode="comment start";break}if(this.textchunk=="[CDATA"&&t=="["){this.mode="cdata",this.textchunk="";break}if(t==">"||t=="eof"){this.emit("special",this.textchunk),this.mode="text",this.textchunk="";break}this.textchunk+=t;break;case"cdata":if(s=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,s)),this.textchunk+=t;break;case"cdata end":this.emit("cdata",this.textchunk),this.textchunk="",this.mode="text";break;case"comment start":e==">"||t=="eof"?(this.emit("comment",""),this.mode="skip"):this.mode="comment";break;case"skip":this.mode="text";break;case"comment":t=="-"&&s=="-"&&e==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):t=="eof"?this.emit("comment",this.textchunk):this.textchunk+=t;break;case"comment end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"declaration":if(t=="?"&&e==">"){this.mode="declaration end";break}t=="eof"&&this.emit("comment",this.textchunk),this.textchunk+=t;break;case"declaration end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"tag name start":if(t=="eof"){this.emit("text","<");break}if(!Ot("whitespace",t)){if(this.mode="tag name",t=="/"){this.mode="close tag name start";break}else if(t=="!"){this.mode="special",this.textchunk="";break}else if(t=="?"){this.mode="declaration";break}this.act(t,e,s)}break;case"close tag name start":Ot("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(Ot("whitespace",t))this.tagname=this.nodename;else switch(t){case">":this.emit("/tag",this.tagname||this.nodename,this.attrs),this.mode="text";break;default:!this.tagname&&(this.nodename+=t);break}break;case"tag name":if(Ot("whitespace",t))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(t){case">":this.emit("tag",this.nodename,this.attrs),this.mode="text";break;case"/":this.raw+=e,this.emit("tag",this.nodename,this.attrs),this.emit("/tag",this.nodename,this.attrs),this.mode="skip";break;default:this.nodename+=t;break}break;case"attr start":Ot("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(Ot("whitespace",t)||t=="=")this.attrs[this.nodename]="",this.mode="attr value start";else switch(t){case">":this.nodename=="/"?(delete this.attrs["/"],this.emit("tag",this.tagname,this.attrs),this.emit("/tag",this.tagname,this.attrs)):(this.nodename&&(this.attrs[this.nodename]=""),this.emit("tag",this.tagname,this.attrs)),this.mode="text";break;default:this.nodename+=t;break}break;case"attr value start":if(!Ot("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,s)}break;case"attr value":if(Ot("whitespace",t)&&!this.quote)this.mode="attr start";else if(t==">"&&!this.quote)this.emit("tag",this.tagname,this.attrs),this.mode="text";else switch(t){case'"':case"'":this.quote==t&&s!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function pi(i,t,e){if(typeof t<"u")window.localStorage.setItem(i,JSON.stringify({value:t,expires:typeof e=="number"?e:-1}));else{const s=window.localStorage.getItem(i);try{const n=JSON.parse(s||"");return"expires"in n&&parseInt(n.expires)>=0&&new Date().getTime()>parseInt(n.expires)?void 0:n.value||void 0}catch{return s||void 0}}}function Th(i,t,e){const s=new Date;s.setTime(s.getTime()+e*24*60*60*1e3);const n="expires="+s.toUTCString();document.cookie=i+"="+t+"; "+n}function Ph(i){const t=i+"=",e=document.cookie.split(";");for(let s=0,n=e.length;s<n;s++){const r=e[s].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const Mh=()=>document.cookie.split(";").map(i=>i.split("=")).reduce((i,[t,e])=>(i[t.trim().replace('"',"")]=e,i),{}),Ah=()=>document.cookie.split(";").forEach(i=>document.cookie=i.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));et.on("matchMediaChangePrefersColorSchemeDark",i=>{ws(i?"dark":"light")}),er();function ws(i){pi("colorScheme",i),document.documentElement.classList.toggle("dark",i=="dark")}function er(){const i=pi("colorScheme");if(i=="dark"||i=="light")return ws(i),i;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return ws(t),t}}const gi={safeAreaTop:k.getCSSVar("--safe-area-inset-top"),safeAreaRight:k.getCSSVar("--safe-area-inset-right"),safeAreaBottom:k.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:k.getCSSVar("--safe-area-inset-left"),colorPrimary:k.getCSSVar("--color-primary")||"#5078f0",colorRed:k.getCSSVar("--color-red")||"#ff5050",colorOrange:k.getCSSVar("--color-orange")||"#fa8c00",colorYellow:k.getCSSVar("--color-yellow")||"#fadc32",colorGreen:k.getCSSVar("--color-green")||"#00c878",colorBlue:k.getCSSVar("--color-blue")||"#00b4fa",colorPurple:k.getCSSVar("--color-purple")||"#6464fa",colorBlack:k.getCSSVar("--color-black")||"#001428",colorGray00:k.getCSSVar("--color-gray-00")||"#000000",colorGray33:k.getCSSVar("--color-gray-33")||"#333333",colorGray66:k.getCSSVar("--color-gray-66")||"#666666",colorGray99:k.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:k.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:k.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:k.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:k.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:k.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:k.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:k.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:k.getCSSVar("--font-line-height")||"1,4",fontSize32:k.getCSSVar("--font-size-32")||"32px",fontSize24:k.getCSSVar("--font-size-24")||"24px",fontSize20:k.getCSSVar("--font-size-20")||"20px",fontSize18:k.getCSSVar("--font-size-18")||"18px",fontSize16:k.getCSSVar("--font-size-16")||"16px",fontSize14:k.getCSSVar("--font-size-14")||"14px",fontSize12:k.getCSSVar("--font-size-12")||"12px",fontSize11:k.getCSSVar("--font-size-11")||"11px",gap4:k.getCSSVar("--gap-4")||"4px",gap8:k.getCSSVar("--gap-8")||"8px",gap12:k.getCSSVar("--gap-12")||"12px",gap16:k.getCSSVar("--gap-16")||"16px",gap20:k.getCSSVar("--gap-20")||"20px",gap40:k.getCSSVar("--gap-40")||"40px",height44:k.getCSSVar("--height-44")||"44px",height32:k.getCSSVar("--height-32")||"32px",borderRadius:k.getCSSVar("--border-radius")||"4px"},sr=["#0ac2d2","#7bb7fa","#60d7a9","#fdc162","#fd6a62","#f68dbb","#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff","#dc4916","#6871b1","#d1b935","#1bbc9b","#FF7F50","#4BBFC3","#ff9900"];function kt(i,t){if(Object.prototype.hasOwnProperty.call(i,"r")&&Object.prototype.hasOwnProperty.call(i,"g")&&Object.prototype.hasOwnProperty.call(i,"b"))return i.r=Math.round(yt(i.r,0,255)),i.g=Math.round(yt(i.g,0,255)),i.b=Math.round(yt(i.b,0,255)),Object.prototype.hasOwnProperty.call(i,"a")?i.a=typeof t=="number"?t:i.a:i.a=typeof t=="number"?t:1,i.a=yt(i.a,0,1),i;const e={r:0,g:0,b:0,a:1};let s=-1;if(typeof i=="number")s=i;else if(typeof i=="string")if(i[0].toLowerCase()==="r"){const n=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(i);n&&(s=(parseInt(n[1])<<16)+(parseInt(n[2])<<8)+parseInt(n[3]),n[4]&&(e.a=Et(parseFloat(n[4]),2)))}else if(i[0]==="#")s=parseInt(i.slice(1,7),16),i.length>7&&(e.a=Et(parseInt(i.slice(7,9),16)/255,2));else throw new Error("getColor 不支持的颜色解析:"+i);return s>=0&&(e.r=s>>16&255,e.g=s>>8&255,e.b=s&255),typeof t=="number"&&(e.a=t),e.a=yt(e.a,0,1),e}function yi(i,t=!1,e="#000000",s="#ffffff"){let n=kt(i);return t?n=kt(n.r*.299+n.g*.587+n.b*.114>186?e:s):(n.r=255-n.r,n.g=255-n.g,n.b=255-n.b),n}function wi(i,t){const e=kt(i,t);return e.a===1?`rgb(${e.r},${e.g},${e.b})`:`rgba(${e.r},${e.g},${e.b},${e.a})`}function kh(i,t=!1,e="#000000",s="#ffffff"){return wi(yi(i,t,e,s))}function xs(i){return Oa(i.toString(16),2,"0","left")}function ye(i,t){const e=kt(i,t),s=`#${xs(e.r)}${xs(e.g)}${xs(e.b)}`;return e.a===1?s:s+`${xs(Math.ceil(e.a*255))}`}function ir(i,t=!1,e="#000000",s="#ffffff"){return ye(yi(i,t,e,s))}const nr=()=>Math.random()*16777215,Ih=()=>ye(nr());function Dh(i,t){const e=kt(i);return e.r==0&&(e.r=32),e.g==0&&(e.g=32),e.b==0&&(e.b=32),e.r=e.r*(100+t)/100,e.g=e.g*(100+t)/100,e.b=e.b*(100+t)/100,e.r=Math.round(yt(e.r,0,255)),e.g=Math.round(yt(e.g,0,255)),e.b=Math.round(yt(e.b,0,255)),ye(e)}function xi(i,t,e){try{const s=kt(i),n=kt(t);return ye({r:(n.r-s.r)*e+s.r,g:(n.g-s.g)*e+s.g,b:(n.b-s.b)*e+s.b,a:(n.a-s.a)*e+s.a})}catch{return t}}function _h(i,t,e,s){let n,r,a;i=i/360,t=t/100,e=e/100;const o=Math.floor(i*6),h=i*6-o,c=e*(1-t),l=e*(1-h*t),d=e*(1-(1-h)*t);switch(o%6){case 0:n=e,r=d,a=c;break;case 1:n=l,r=e,a=c;break;case 2:n=c,r=e,a=d;break;case 3:n=c,r=l,a=e;break;case 4:n=d,r=c,a=e;break;case 5:default:n=e,r=c,a=l;break}return{r:Math.round(n*255),g:Math.round(r*255),b:Math.round(a*255),opacity:s??1}}function Lh(i,t,e,s){i*=360;let n,r,a;i=i%360/60;const o=e*t,h=o*(1-Math.abs(i%2-1));return n=r=a=e-o,i=~~i,n+=[o,h,0,0,h,o][i],r+=[h,o,o,h,0,0][i],a+=[0,0,h,o,o,h][i],{r:n,g:r,b:a,opacity:s??1}}function Rh(i,t,e,s){(i>1||t>1||e>1)&&(i/=360,t/=100,e/=100),i*=360;let n,r,a;i=i%360/60;const o=2*t*(e<.5?e:1-e),h=o*(1-Math.abs(i%2-1));return n=r=a=e-o/2,i=~~i,n+=[o,h,0,0,h,o][i],r+=[h,o,o,h,0,0][i],a+=[0,0,h,o,o,h][i],{r:n,g:r,b:a,opacity:s??1}}function Oh(i,t,e,s){const n=Math.max(i,t,e),r=Math.min(i,t,e),a=n-r,o=n===0?0:a/n,h=n/255;let c;switch(n){case r:c=0;break;case i:c=t-e+a*(t<e?6:0),c/=6*a;break;case t:c=e-i+a*2,c/=6*a;break;case e:default:c=i-t+a*4,c/=6*a;break}return{h:Math.round(c*360),s:Math.round(o*100),v:Math.round(h*100),opacity:s??1}}function Nh(i,t,e){const s=Math.max(i,t,e),n=s-Math.min(i,t,e);let r=n==0?0:s==i?(t-e)/n:s==t?(e-i)/n+2:(i-t)/n+4;r=(r+360)%6*60/360;const a=n==0?0:n/s;return{h:r,s:a,b:s}}function Fh(i,t,e){const s=Math.max(i,t,e),n=Math.min(i,t,e),r=s-n;let a=r==0?0:s==i?(t-e)/r:s==t?(e-i)/r+2:(i-t)/r+4;a=(a+360)%6*60/360;const o=(s+n)/2,h=r==0?0:o<.5?r/(2*o):r/(2-2*o);return{h:a,s:h,l:o}}function bs(i=window.location.href){return dn(URL)?new URL(i):rr(i)}function rr(i=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",s="(?<pathname>(?:\\/[^/#?]+)*\\/?)",n="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${s}${n}${r}$`).exec(i);return{href:i,protocol:o?.groups?.protocol??"",host:o?.groups?.host??"",hostname:o?.groups?.hostname??"",port:o?.groups?.port??"",pathname:o?.groups?.pathname??"",search:o?.groups?.search??"",hash:o?.groups?.hash??""}}function Bh(i){const t=bs(i);return t.protocol==="http:"||t.protocol==="https:"}function ar(i=window.location.href){const t=bs(i),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Xh(i=bs().search){i=decodeURIComponent(i).replace(/^[#?&]/,"");const t={};if(!i)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let s=e.exec(i);for(;s;)t[s[1]]=s[2],s=e.exec(i);return t}function or(i){return"?"+Object.entries(i).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function hr(i){return"?"+[...i.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function Yh(i,t){return i.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function cr(i,t){return i+t.replace(/^[&?]/,i.indexOf("?")>=0?"&":"?")}class Uh{worker;cbs={};constructor(t){if(Dn)try{this.worker=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){throw typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),e}else throw new Error("Your environment do not support Worker !")}postMessage(t,e=[]){this.worker.postMessage(t,e)}onmessage(t){this.worker.addEventListener("message",t)}offmessage(t){this.worker.removeEventListener("message",t)}onmessageerror(t){this.worker.addEventListener("messageerror",t)}offmessageerror(t){this.worker.removeEventListener("messageerror",t)}postCanvas(t){const e=t.transferControlToOffscreen();this.worker.postMessage({canvas:e},[e])}postPort(t){this.worker.postMessage({port:t},[t])}postReset(){this.worker.postMessage({reset:!0});for(const t in this.cbs)this.cbs[t](),delete this.cbs[t]}fire(t,e){return new Promise(s=>{if(e){const n=Math.random().toString(36).slice(2),r=a=>{a.data.id===n&&(this.worker.removeEventListener("message",r),delete this.cbs[n],e(),s())};this.cbs[n]=r.bind(this,{data:{id:n}}),this.worker.addEventListener("message",r),this.worker.postMessage({...t,id:n})}else this.worker.postMessage(t),s()})}}class Gh{port1;port2;port1MessageCbs=[];port2MessageCbs=[];port1MessageErrorCbs=[];port2MessageErrorCbs=[];constructor(){const{port1:t,port2:e}=new MessageChannel;this.port1=t,this.port2=e,this.port1.addEventListener("message",s=>{this.port1MessageCbs.forEach(n=>n(this.port1,s))}),this.port1.addEventListener("messageerror",s=>{this.port1MessageErrorCbs.forEach(n=>n(this.port1,s))}),this.port1.start(),this.port2.addEventListener("message",s=>{this.port2MessageCbs.forEach(n=>n(this.port2,s))}),this.port2.addEventListener("messageerror",s=>{this.port2MessageErrorCbs.forEach(n=>n(this.port2,s))}),this.port2.start()}close(){this.port1.close(),this.port2.close()}onPort1Message(t){this.port1MessageCbs.push(t)}onPort1MessageError(t){this.port1MessageErrorCbs.push(t)}offPort1Message(t){Te(this.port1MessageCbs,t)}offPort1MessageError(t){Te(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){Te(this.port2MessageCbs,t)}offPort2MessageError(t){Te(this.port2MessageErrorCbs,t)}}function lr(){let i=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0;e<t.length;e++)try{i=new window.ActiveXObject(t[e]);break}catch{continue}}else i=new XMLHttpRequest;return i}function Vh(i,t){return new Promise((e,s)=>{const{method:n="GET",data:r={},segments:a=[],headers:o={},withCredentials:h=!1,responseType:c="json",timeout:l=3e4}=t||{},d=lr();d.timeout=l,d.responseType=c,d.onreadystatechange=function(C){d.readyState===4&&(d.status===200?e(d.response):s(d.statusText))},d.ontimeout=function(){s(`${i} is timed out for ${l}ms.`)},d.addEventListener("error",function(C){s(C)},!1),d.addEventListener("progress",function(C){if(C.lengthComputable){const L=Math.round(C.loaded*100/C.total);t?.progress?.(L,d)}},!1),d.addEventListener("load",function(C){t?.load?.(C,d)},!1),d.addEventListener("loadstart",function(C){t?.loadstart?.(C,d)},!1),d.addEventListener("loadend",function(C){t?.loadend?.(C,d)},!1),d.addEventListener("abort",function(C){t?.abort?.(C,d)},!1);const g=n.toUpperCase();Object.assign(o,{Accept:"*/*"});const y="---------------------------"+Date.now().toString(16);let p=!1,x=!1,b=!1;function S(){h&&(d.withCredentials=!0);for(const C in o)ct(C).toLowerCase()=="content-type"&&o[C].toLowerCase()=="multipart/form-data"?(p=!0,d.setRequestHeader("Content-Type","multipart/form-data; boundary="+y)):(ct(C).toLowerCase()=="content-type"&&(o[C].toLowerCase().indexOf("text/plain")>=0?x=!0:o[C].toLowerCase().indexOf("application/json")>=0&&(b=!0)),d.setRequestHeader(C,o[C]))}switch(g){case"GET":let C="";r instanceof FormData?C=hr(r):C=or(r),d.open("GET",cr(i,C),!0),S(),d.send(null);break;case"POST":default:d.open(g,i,!0),S(),p&&a.length?d.sendAsBinary("--"+y+`\r
|
|
24
|
+
`;return function(){var M=new Error("get-stack-trace"),k=M&&M.stack?M.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",F=t.console&&(t.console.warn||t.console.log);return F&&F.call(t.console,v,k),u.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(f){if(f===n||f===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(f),v=1;v<arguments.length;v++){var M=arguments[v];if(M!==n&&M!==null)for(var k in M)M.hasOwnProperty(k)&&(w[k]=M[k])}return w}:x=Object.assign;var b=p(function(f,w,v){for(var M=Object.keys(w),k=0;k<M.length;)(!v||v&&f[M[k]]===n)&&(f[M[k]]=w[M[k]]),k++;return f},"extend","Use `assign`."),S=p(function(f,w){return b(f,w,!0)},"merge","Use `assign`.");function C(u,f,w){var v=f.prototype,M;M=u.prototype=Object.create(v),M.constructor=u,M._super=v,w&&x(M,w)}function L(u,f){return function(){return u.apply(f,arguments)}}function R(u,f){return typeof u==o?u.apply(f&&f[0]||n,f):u}function Y(u,f){return u===n?f:u}function X(u,f,w){y($(f),function(v){u.addEventListener(v,w,!1)})}function V(u,f,w){y($(f),function(v){u.removeEventListener(v,w,!1)})}function it(u,f){for(;u;){if(u==f)return!0;u=u.parentNode}return!1}function W(u,f){return u.indexOf(f)>-1}function $(u){return u.trim().split(/\s+/g)}function z(u,f,w){if(u.indexOf&&!w)return u.indexOf(f);for(var v=0;v<u.length;){if(w&&u[v][w]==f||!w&&u[v]===f)return v;v++}return-1}function nt(u){return Array.prototype.slice.call(u,0)}function bt(u,f,w){for(var v=[],M=[],k=0;k<u.length;){var F=f?u[k][f]:u[k];z(M,F)<0&&v.push(u[k]),M[k]=F,k++}return w&&(f?v=v.sort(function(K,ht){return K[f]>ht[f]}):v=v.sort()),v}function dt(u,f){for(var w,v,M=f[0].toUpperCase()+f.slice(1),k=0;k<r.length;){if(w=r[k],v=w?w+M:f,v in u)return v;k++}return n}var ve=1;function ie(){return ve++}function le(u){var f=u.ownerDocument||u;return f.defaultView||f.parentWindow||t}var Se=/mobile|tablet|ip(ad|hone|od)|android/i,_="ontouchstart"in t,A=dt(t,"PointerEvent")!==n,N=_&&Se.test(navigator.userAgent),P="touch",vt="pen",ne="mouse",dd="kinect",fd=25,ot=1,ue=2,H=4,ft=8,Ls=1,ze=2,qe=4,He=8,je=16,_t=ze|qe,de=He|je,ma=_t|de,pa=["x","y"],Rs=["clientX","clientY"];function St(u,f){var w=this;this.manager=u,this.callback=f,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(v){R(u.options.enable,[u])&&w.handler(v)},this.init()}St.prototype={handler:function(){},init:function(){this.evEl&&X(this.element,this.evEl,this.domHandler),this.evTarget&&X(this.target,this.evTarget,this.domHandler),this.evWin&&X(le(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&V(this.element,this.evEl,this.domHandler),this.evTarget&&V(this.target,this.evTarget,this.domHandler),this.evWin&&V(le(this.element),this.evWin,this.domHandler)}};function md(u){var f,w=u.options.inputClass;return w?f=w:A?f=ji:N?f=Fs:_?f=Wi:f=Ns,new f(u,pd)}function pd(u,f,w){var v=w.pointers.length,M=w.changedPointers.length,k=f&ot&&v-M===0,F=f&(H|ft)&&v-M===0;w.isFirst=!!k,w.isFinal=!!F,k&&(u.session={}),w.eventType=f,gd(u,w),u.emit("hammer.input",w),u.recognize(w),u.session.prevInput=w}function gd(u,f){var w=u.session,v=f.pointers,M=v.length;w.firstInput||(w.firstInput=ga(f)),M>1&&!w.firstMultiple?w.firstMultiple=ga(f):M===1&&(w.firstMultiple=!1);var k=w.firstInput,F=w.firstMultiple,Z=F?F.center:k.center,K=f.center=ya(v);f.timeStamp=l(),f.deltaTime=f.timeStamp-k.timeStamp,f.angle=Hi(Z,K),f.distance=Os(Z,K),yd(w,f),f.offsetDirection=xa(f.deltaX,f.deltaY);var ht=wa(f.deltaTime,f.deltaX,f.deltaY);f.overallVelocityX=ht.x,f.overallVelocityY=ht.y,f.overallVelocity=c(ht.x)>c(ht.y)?ht.x:ht.y,f.scale=F?bd(F.pointers,v):1,f.rotation=F?xd(F.pointers,v):0,f.maxPointers=w.prevInput?f.pointers.length>w.prevInput.maxPointers?f.pointers.length:w.prevInput.maxPointers:f.pointers.length,wd(w,f);var Rt=u.element;it(f.srcEvent.target,Rt)&&(Rt=f.srcEvent.target),f.target=Rt}function yd(u,f){var w=f.center,v=u.offsetDelta||{},M=u.prevDelta||{},k=u.prevInput||{};(f.eventType===ot||k.eventType===H)&&(M=u.prevDelta={x:k.deltaX||0,y:k.deltaY||0},v=u.offsetDelta={x:w.x,y:w.y}),f.deltaX=M.x+(w.x-v.x),f.deltaY=M.y+(w.y-v.y)}function wd(u,f){var w=u.lastInterval||f,v=f.timeStamp-w.timeStamp,M,k,F,Z;if(f.eventType!=ft&&(v>fd||w.velocity===n)){var K=f.deltaX-w.deltaX,ht=f.deltaY-w.deltaY,Rt=wa(v,K,ht);k=Rt.x,F=Rt.y,M=c(Rt.x)>c(Rt.y)?Rt.x:Rt.y,Z=xa(K,ht),u.lastInterval=f}else M=w.velocity,k=w.velocityX,F=w.velocityY,Z=w.direction;f.velocity=M,f.velocityX=k,f.velocityY=F,f.direction=Z}function ga(u){for(var f=[],w=0;w<u.pointers.length;)f[w]={clientX:h(u.pointers[w].clientX),clientY:h(u.pointers[w].clientY)},w++;return{timeStamp:l(),pointers:f,center:ya(f),deltaX:u.deltaX,deltaY:u.deltaY}}function ya(u){var f=u.length;if(f===1)return{x:h(u[0].clientX),y:h(u[0].clientY)};for(var w=0,v=0,M=0;M<f;)w+=u[M].clientX,v+=u[M].clientY,M++;return{x:h(w/f),y:h(v/f)}}function wa(u,f,w){return{x:f/u||0,y:w/u||0}}function xa(u,f){return u===f?Ls:c(u)>=c(f)?u<0?ze:qe:f<0?He:je}function Os(u,f,w){w||(w=pa);var v=f[w[0]]-u[w[0]],M=f[w[1]]-u[w[1]];return Math.sqrt(v*v+M*M)}function Hi(u,f,w){w||(w=pa);var v=f[w[0]]-u[w[0]],M=f[w[1]]-u[w[1]];return Math.atan2(M,v)*180/Math.PI}function xd(u,f){return Hi(f[1],f[0],Rs)+Hi(u[1],u[0],Rs)}function bd(u,f){return Os(f[0],f[1],Rs)/Os(u[0],u[1],Rs)}var vd={mousedown:ot,mousemove:ue,mouseup:H},Sd="mousedown",Cd="mousemove mouseup";function Ns(){this.evEl=Sd,this.evWin=Cd,this.pressed=!1,St.apply(this,arguments)}C(Ns,St,{handler:function(f){var w=vd[f.type];w&ot&&f.button===0&&(this.pressed=!0),w&ue&&f.which!==1&&(w=H),this.pressed&&(w&H&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[f],changedPointers:[f],pointerType:ne,srcEvent:f}))}});var Ed={pointerdown:ot,pointermove:ue,pointerup:H,pointercancel:ft,pointerout:ft},Td={2:P,3:vt,4:ne,5:dd},ba="pointerdown",va="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(ba="MSPointerDown",va="MSPointerMove MSPointerUp MSPointerCancel");function ji(){this.evEl=ba,this.evWin=va,St.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}C(ji,St,{handler:function(f){var w=this.store,v=!1,M=f.type.toLowerCase().replace("ms",""),k=Ed[M],F=Td[f.pointerType]||f.pointerType,Z=F==P,K=z(w,f.pointerId,"pointerId");k&ot&&(f.button===0||Z)?K<0&&(w.push(f),K=w.length-1):k&(H|ft)&&(v=!0),!(K<0)&&(w[K]=f,this.callback(this.manager,k,{pointers:w,changedPointers:[f],pointerType:F,srcEvent:f}),v&&w.splice(K,1))}});var Pd={touchstart:ot,touchmove:ue,touchend:H,touchcancel:ft},Md="touchstart",Ad="touchstart touchmove touchend touchcancel";function Sa(){this.evTarget=Md,this.evWin=Ad,this.started=!1,St.apply(this,arguments)}C(Sa,St,{handler:function(f){var w=Pd[f.type];if(w===ot&&(this.started=!0),!!this.started){var v=Id.call(this,f,w);w&(H|ft)&&v[0].length-v[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:v[0],changedPointers:v[1],pointerType:P,srcEvent:f})}}});function Id(u,f){var w=nt(u.touches),v=nt(u.changedTouches);return f&(H|ft)&&(w=bt(w.concat(v),"identifier",!0)),[w,v]}var Dd={touchstart:ot,touchmove:ue,touchend:H,touchcancel:ft},kd="touchstart touchmove touchend touchcancel";function Fs(){this.evTarget=kd,this.targetIds={},St.apply(this,arguments)}C(Fs,St,{handler:function(f){var w=Dd[f.type],v=_d.call(this,f,w);v&&this.callback(this.manager,w,{pointers:v[0],changedPointers:v[1],pointerType:P,srcEvent:f})}});function _d(u,f){var w=nt(u.touches),v=this.targetIds;if(f&(ot|ue)&&w.length===1)return v[w[0].identifier]=!0,[w,w];var M,k,F=nt(u.changedTouches),Z=[],K=this.target;if(k=w.filter(function(ht){return it(ht.target,K)}),f===ot)for(M=0;M<k.length;)v[k[M].identifier]=!0,M++;for(M=0;M<F.length;)v[F[M].identifier]&&Z.push(F[M]),f&(H|ft)&&delete v[F[M].identifier],M++;if(Z.length)return[bt(k.concat(Z),"identifier",!0),Z]}var Ld=2500,Ca=25;function Wi(){St.apply(this,arguments);var u=L(this.handler,this);this.touch=new Fs(this.manager,u),this.mouse=new Ns(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}C(Wi,St,{handler:function(f,w,v){var M=v.pointerType==P,k=v.pointerType==ne;if(!(k&&v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents)){if(M)Rd.call(this,w,v);else if(k&&Od.call(this,v))return;this.callback(f,w,v)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Rd(u,f){u&ot?(this.primaryTouch=f.changedPointers[0].identifier,Ea.call(this,f)):u&(H|ft)&&Ea.call(this,f)}function Ea(u){var f=u.changedPointers[0];if(f.identifier===this.primaryTouch){var w={x:f.clientX,y:f.clientY};this.lastTouches.push(w);var v=this.lastTouches,M=function(){var k=v.indexOf(w);k>-1&&v.splice(k,1)};setTimeout(M,Ld)}}function Od(u){for(var f=u.srcEvent.clientX,w=u.srcEvent.clientY,v=0;v<this.lastTouches.length;v++){var M=this.lastTouches[v],k=Math.abs(f-M.x),F=Math.abs(w-M.y);if(k<=Ca&&F<=Ca)return!0}return!1}var Ta=dt(a.style,"touchAction"),Pa=Ta!==n,Ma="compute",Aa="auto",$i="manipulation",fe="none",We="pan-x",$e="pan-y",Bs=Fd();function Ji(u,f){this.manager=u,this.set(f)}Ji.prototype={set:function(u){u==Ma&&(u=this.compute()),Pa&&this.manager.element.style&&Bs[u]&&(this.manager.element.style[Ta]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return y(this.manager.recognizers,function(f){R(f.options.enable,[f])&&(u=u.concat(f.getTouchAction()))}),Nd(u.join(" "))},preventDefaults:function(u){var f=u.srcEvent,w=u.offsetDirection;if(this.manager.session.prevented){f.preventDefault();return}var v=this.actions,M=W(v,fe)&&!Bs[fe],k=W(v,$e)&&!Bs[$e],F=W(v,We)&&!Bs[We];if(M){var Z=u.pointers.length===1,K=u.distance<2,ht=u.deltaTime<250;if(Z&&K&&ht)return}if(!(F&&k)&&(M||k&&w&_t||F&&w&de))return this.preventSrc(f)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function Nd(u){if(W(u,fe))return fe;var f=W(u,We),w=W(u,$e);return f&&w?fe:f||w?f?We:$e:W(u,$i)?$i:Aa}function Fd(){if(!Pa)return!1;var u={},f=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){u[w]=f?t.CSS.supports("touch-action",w):!0}),u}var Xs=1,Ct=2,Ce=4,re=8,zt=re,Je=16,Lt=32;function qt(u){this.options=x({},this.defaults,u||{}),this.id=ie(),this.manager=null,this.options.enable=Y(this.options.enable,!0),this.state=Xs,this.simultaneous={},this.requireFail=[]}qt.prototype={defaults:{},set:function(u){return x(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(g(u,"recognizeWith",this))return this;var f=this.simultaneous;return u=Ys(u,this),f[u.id]||(f[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return g(u,"dropRecognizeWith",this)?this:(u=Ys(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(g(u,"requireFailure",this))return this;var f=this.requireFail;return u=Ys(u,this),z(f,u)===-1&&(f.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(g(u,"dropRequireFailure",this))return this;u=Ys(u,this);var f=z(this.requireFail,u);return f>-1&&this.requireFail.splice(f,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var f=this,w=this.state;function v(M){f.manager.emit(M,u)}w<re&&v(f.options.event+Ia(w)),v(f.options.event),u.additionalEvent&&v(u.additionalEvent),w>=re&&v(f.options.event+Ia(w))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=Lt},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(Lt|Xs)))return!1;u++}return!0},recognize:function(u){var f=x({},u);if(!R(this.options.enable,[this,f])){this.reset(),this.state=Lt;return}this.state&(zt|Je|Lt)&&(this.state=Xs),this.state=this.process(f),this.state&(Ct|Ce|re|Je)&&this.tryEmit(f)},process:function(u){},getTouchAction:function(){},reset:function(){}};function Ia(u){return u&Je?"cancel":u&re?"end":u&Ce?"move":u&Ct?"start":""}function Da(u){return u==je?"down":u==He?"up":u==ze?"left":u==qe?"right":""}function Ys(u,f){var w=f.manager;return w?w.get(u):u}function Pt(){qt.apply(this,arguments)}C(Pt,qt,{defaults:{pointers:1},attrTest:function(u){var f=this.options.pointers;return f===0||u.pointers.length===f},process:function(u){var f=this.state,w=u.eventType,v=f&(Ct|Ce),M=this.attrTest(u);return v&&(w&ft||!M)?f|Je:v||M?w&H?f|re:f&Ct?f|Ce:Ct:Lt}});function Us(){Pt.apply(this,arguments),this.pX=null,this.pY=null}C(Us,Pt,{defaults:{event:"pan",threshold:10,pointers:1,direction:ma},getTouchAction:function(){var u=this.options.direction,f=[];return u&_t&&f.push($e),u&de&&f.push(We),f},directionTest:function(u){var f=this.options,w=!0,v=u.distance,M=u.direction,k=u.deltaX,F=u.deltaY;return M&f.direction||(f.direction&_t?(M=k===0?Ls:k<0?ze:qe,w=k!=this.pX,v=Math.abs(u.deltaX)):(M=F===0?Ls:F<0?He:je,w=F!=this.pY,v=Math.abs(u.deltaY))),u.direction=M,w&&v>f.threshold&&M&f.direction},attrTest:function(u){return Pt.prototype.attrTest.call(this,u)&&(this.state&Ct||!(this.state&Ct)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var f=Da(u.direction);f&&(u.additionalEvent=this.options.event+f),this._super.emit.call(this,u)}});function Zi(){Pt.apply(this,arguments)}C(Zi,Pt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[fe]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&Ct)},emit:function(u){if(u.scale!==1){var f=u.scale<1?"in":"out";u.additionalEvent=this.options.event+f}this._super.emit.call(this,u)}});function Ki(){qt.apply(this,arguments),this._timer=null,this._input=null}C(Ki,qt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Aa]},process:function(u){var f=this.options,w=u.pointers.length===f.pointers,v=u.distance<f.threshold,M=u.deltaTime>f.time;if(this._input=u,!v||!w||u.eventType&(H|ft)&&!M)this.reset();else if(u.eventType&ot)this.reset(),this._timer=d(function(){this.state=zt,this.tryEmit()},f.time,this);else if(u.eventType&H)return zt;return Lt},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===zt&&(u&&u.eventType&H?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Qi(){Pt.apply(this,arguments)}C(Qi,Pt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[fe]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&Ct)}});function tn(){Pt.apply(this,arguments)}C(tn,Pt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:_t|de,pointers:1},getTouchAction:function(){return Us.prototype.getTouchAction.call(this)},attrTest:function(u){var f=this.options.direction,w;return f&(_t|de)?w=u.overallVelocity:f&_t?w=u.overallVelocityX:f&de&&(w=u.overallVelocityY),this._super.attrTest.call(this,u)&&f&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&c(w)>this.options.velocity&&u.eventType&H},emit:function(u){var f=Da(u.offsetDirection);f&&this.manager.emit(this.options.event+f,u),this.manager.emit(this.options.event,u)}});function Gs(){qt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}C(Gs,qt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[$i]},process:function(u){var f=this.options,w=u.pointers.length===f.pointers,v=u.distance<f.threshold,M=u.deltaTime<f.time;if(this.reset(),u.eventType&ot&&this.count===0)return this.failTimeout();if(v&&M&&w){if(u.eventType!=H)return this.failTimeout();var k=this.pTime?u.timeStamp-this.pTime<f.interval:!0,F=!this.pCenter||Os(this.pCenter,u.center)<f.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!F||!k?this.count=1:this.count+=1,this._input=u;var Z=this.count%f.taps;if(Z===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=zt,this.tryEmit()},f.interval,this),Ct):zt}return Lt},failTimeout:function(){return this._timer=d(function(){this.state=Lt},this.options.interval,this),Lt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==zt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ht(u,f){return f=f||{},f.recognizers=Y(f.recognizers,Ht.defaults.preset),new en(u,f)}Ht.VERSION="2.0.7",Ht.defaults={domEvents:!1,touchAction:Ma,enable:!0,inputTarget:null,inputClass:null,preset:[[Qi,{enable:!1}],[Zi,{enable:!1},["rotate"]],[tn,{direction:_t}],[Us,{direction:_t},["swipe"]],[Gs],[Gs,{event:"doubletap",taps:2},["tap"]],[Ki]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Bd=1,ka=2;function en(u,f){this.options=x({},Ht.defaults,f||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=md(this),this.touchAction=new Ji(this,this.options.touchAction),_a(this,!0),y(this.options.recognizers,function(w){var v=this.add(new w[0](w[1]));w[2]&&v.recognizeWith(w[2]),w[3]&&v.requireFailure(w[3])},this)}en.prototype={set:function(u){return x(this.options,u),u.touchAction&&this.touchAction.update(),u.inputTarget&&(this.input.destroy(),this.input.target=u.inputTarget,this.input.init()),this},stop:function(u){this.session.stopped=u?ka:Bd},recognize:function(u){var f=this.session;if(!f.stopped){this.touchAction.preventDefaults(u);var w,v=this.recognizers,M=f.curRecognizer;(!M||M&&M.state&zt)&&(M=f.curRecognizer=null);for(var k=0;k<v.length;)w=v[k],f.stopped!==ka&&(!M||w==M||w.canRecognizeWith(M))?w.recognize(u):w.reset(),!M&&w.state&(Ct|Ce|re)&&(M=f.curRecognizer=w),k++}},get:function(u){if(u instanceof qt)return u;for(var f=this.recognizers,w=0;w<f.length;w++)if(f[w].options.event==u)return f[w];return null},add:function(u){if(g(u,"add",this))return this;var f=this.get(u.options.event);return f&&this.remove(f),this.recognizers.push(u),u.manager=this,this.touchAction.update(),u},remove:function(u){if(g(u,"remove",this))return this;if(u=this.get(u),u){var f=this.recognizers,w=z(f,u);w!==-1&&(f.splice(w,1),this.touchAction.update())}return this},on:function(u,f){if(u!==n&&f!==n){var w=this.handlers;return y($(u),function(v){w[v]=w[v]||[],w[v].push(f)}),this}},off:function(u,f){if(u!==n){var w=this.handlers;return y($(u),function(v){f?w[v]&&w[v].splice(z(w[v],f),1):delete w[v]}),this}},emit:function(u,f){this.options.domEvents&&Xd(u,f);var w=this.handlers[u]&&this.handlers[u].slice();if(!(!w||!w.length)){f.type=u,f.preventDefault=function(){f.srcEvent.preventDefault()};for(var v=0;v<w.length;)w[v](f),v++}},destroy:function(){this.element&&_a(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function _a(u,f){var w=u.element;if(w.style){var v;y(u.options.cssProps,function(M,k){v=dt(w.style,k),f?(u.oldCssProps[v]=w.style[v],w.style[v]=M):w.style[v]=u.oldCssProps[v]||""}),f||(u.oldCssProps={})}}function Xd(u,f){var w=e.createEvent("Event");w.initEvent(u,!0,!0),w.gesture=f,f.target.dispatchEvent(w)}x(Ht,{INPUT_START:ot,INPUT_MOVE:ue,INPUT_END:H,INPUT_CANCEL:ft,STATE_POSSIBLE:Xs,STATE_BEGAN:Ct,STATE_CHANGED:Ce,STATE_ENDED:re,STATE_RECOGNIZED:zt,STATE_CANCELLED:Je,STATE_FAILED:Lt,DIRECTION_NONE:Ls,DIRECTION_LEFT:ze,DIRECTION_RIGHT:qe,DIRECTION_UP:He,DIRECTION_DOWN:je,DIRECTION_HORIZONTAL:_t,DIRECTION_VERTICAL:de,DIRECTION_ALL:ma,Manager:en,Input:St,TouchAction:Ji,TouchInput:Fs,MouseInput:Ns,PointerEventInput:ji,TouchMouseInput:Wi,SingleTouchInput:Sa,Recognizer:qt,AttrRecognizer:Pt,Tap:Gs,Pan:Us,Swipe:tn,Pinch:Zi,Rotate:Qi,Press:Ki,on:X,off:V,each:y,merge:S,extend:b,assign:x,inherit:C,bindFn:L,prefixed:dt});var Yd=typeof t<"u"?t:typeof self<"u"?self:{};Yd.Hammer=Ht,typeof n=="function"&&n.amd?n(function(){return Ht}):i.exports?i.exports=Ht:t[s]=Ht})(window,document,"Hammer")})(Kn);var gh=Kn.exports;const yh=ph(gh);class Qn{constructor(){}static getFormatKeyNames(t){const e=ti(),s=[];return t.ctrl&&s.push(e?"Cmd":"Ctrl"),t.shift&&s.push("Shift"),t.alt&&s.push("Alt"),typeof t.key=="string"?s.push(zs(t.key)):Array.isArray(t.key)&&(t.key.map(n=>zs(n)),s.push(...t.key)),s}static matchKeyScheme(t,e){const s=t.ctrl??!1,n=t.shift??!1,r=t.alt??!1;if(t.exact)return(s===e.metaKey||s===e.ctrlKey)&&n===e.shiftKey&&r===e.altKey;const a=[];return s&&a.push(s===e.metaKey||s===e.ctrlKey),n&&a.push(n===e.shiftKey),r&&a.push(r===e.altKey),a.every(o=>o)}static on(t,e){if(t?.key===void 0||t?.key===null)return e;const s=t?.target??window;let n=!1;const r=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!n&&o.key!=="Control"&&o.key!=="Meta"&&o.key!=="Shift"&&o.key!=="Option"&&o.key!=="Alt"&&r.find(h=>h.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const h=e(o);if(typeof h!="function")return;const c=l=>{l.preventDefault(),h(l),s.removeEventListener("keyup",c)};s.addEventListener("keyup",c)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>n=!0,e.restart=()=>n=!1,e.removeListener=()=>s.removeEventListener("keydown",a),s.addEventListener("keydown",a),e}}const wh={BACKSPACE:8,TAB:9,COMMA:188,DELETE:46,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,UP:38,DOWN:40,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32};class tr extends js{container;width;height;mousePoint;hammer;removes=[];constructor(t=document.documentElement,e=!0,s){super(),this.container=t,this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.hammer=new yh(this.container),this.mousePoint={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0},e&&this.start(s)}emitDebounce=Qa((t,...e)=>super.emit(t,...e),50);emit(t,...e){switch(t){case"panLeft":case"panRight":this.emitDebounce(t,...e);break;default:super.emit(t,...e);break}return this}start(t){this.registerMouseEventListeners(),this.registerInputEventListeners(),this.registerTransitionEventListeners(),this.registerAnimationEventListeners(),this.registerResizeObserver(),this.registerElementDisplayInParent(),t&&t.forEach(e=>{this.addRemoves(e())}),this.captureMove()}destroy(){this.removes.forEach(t=>t()),this.removes=[],this.removeAllListeners()}restart(){this.destroy(),this.start()}addRemoves(t){this.removes.push(t)}registerMouseEventListeners(){const t=P=>{this.emit("mouseDown",P)},e=P=>{this.emit("mouseUp",P)},s=P=>{this.emit("mouseMove",P)},n=P=>{this.emit("mouseOver",P)},r=P=>{this.emit("mouseOut",P)},a=P=>{this.emit("mouseClick",P)},o=P=>{this.emit("mouseDoubleClick",P)},h=P=>{this.emit("mouseWheel",P)},c=P=>{this.emit("mouseContextMenu",P)},l=P=>{this.emit("touchStart",P)},d=P=>{this.emit("touchEnd",P)},g=P=>{this.emit("touchCancel",P)},y=P=>{this.emit("touchMove",P)},p=P=>{this.emit("pointerDown",P)},x=P=>{this.emit("pointerUp",P)},b=P=>{this.emit("pointerCancel",P)},S=P=>{this.emit("pointerMove",P)},C=P=>{this.emit("pan",P)},L=P=>{this.emit("panStart",P)},R=P=>{this.emit("panMove",P)},Y=P=>{this.emit("panEnd",P)},X=P=>{this.emit("panCancel",P)},V=P=>{this.emit("panLeft",P)},it=P=>{this.emit("panRight",P)},W=P=>{this.emit("panUp",P)},$=P=>{this.emit("panDown",P)},z=P=>{this.emit("pinch",P)},nt=P=>{this.emit("press",P)},bt=P=>{this.emit("rotate",P)},dt=P=>{this.emit("swipe",P)},ve=P=>{this.emit("swipeLeft",P)},ie=P=>{this.emit("swipeRight",P)},le=P=>{this.emit("swipeUp",P)},Se=P=>{this.emit("swipeDown",P)},_=P=>{this.emit("tap",P)},A=P=>{!P.target||this.container==P.target||this.container.contains(P.target)||this.emit("tapOutSide",P)};this.container.addEventListener("mousedown",t),this.container.addEventListener("mouseup",e),this.container.addEventListener("mousemove",s),this.container.addEventListener("mouseover",n),this.container.addEventListener("mouseout",r),this.container.addEventListener("click",a),this.container.addEventListener("dblclick",o),this.container.addEventListener("wheel",h),this.container.addEventListener("contextmenu",c),this.container.addEventListener("touchstart",l),this.container.addEventListener("touchend",d),this.container.addEventListener("touchcancel",g),this.container.addEventListener("touchmove",y),this.container.addEventListener("pointerdown",p),this.container.addEventListener("pointerup",x),this.container.addEventListener("pointercancel",b),this.container.addEventListener("pointermove",S),this.hammer.on("pan",C),this.hammer.on("panstart",L),this.hammer.on("panmove",R),this.hammer.on("panend",Y),this.hammer.on("pancancel",X),this.hammer.on("panleft",V),this.hammer.on("panright",it),this.hammer.on("panup",W),this.hammer.on("pandown",$),this.hammer.on("pinch",z),this.hammer.on("press",nt),this.hammer.on("rotate",bt),this.hammer.on("swipe",dt),this.hammer.on("swipeleft",ve),this.hammer.on("swiperight",ie),this.hammer.on("swipeup",le),this.hammer.on("swipedown",Se),this.hammer.on("tap",_),document.addEventListener("pointerdown",A,!1);const N=()=>{this.container.removeEventListener("mousedown",t),this.container.removeEventListener("mouseup",e),this.container.removeEventListener("mousemove",s),this.container.removeEventListener("mouseover",n),this.container.removeEventListener("mouseout",r),this.container.removeEventListener("click",a),this.container.removeEventListener("dblclick",o),this.container.removeEventListener("wheel",h),this.container.removeEventListener("contextmenu",c),this.container.removeEventListener("touchstart",l),this.container.removeEventListener("touchend",d),this.container.removeEventListener("touchcancel",g),this.container.removeEventListener("touchmove",y),this.container.removeEventListener("pointerdown",p),this.container.removeEventListener("pointerup",x),this.container.removeEventListener("pointercancel",b),this.container.removeEventListener("pointermove",S),this.hammer.off("pan",C),this.hammer.off("panstart",L),this.hammer.off("panmove",R),this.hammer.off("panend",Y),this.hammer.off("pancancel",X),this.hammer.off("panleft",V),this.hammer.off("panright",it),this.hammer.off("panup",W),this.hammer.off("pandown",$),this.hammer.off("pinch",z),this.hammer.off("press",nt),this.hammer.off("rotate",bt),this.hammer.off("swipe",dt),this.hammer.off("swipeleft",ve),this.hammer.off("swiperight",ie),this.hammer.off("swipeup",le),this.hammer.off("swipedown",Se),this.hammer.off("tap",_),document.removeEventListener("pointerdown",A,!1),document.removeEventListener("touchstart",A,!1),document.removeEventListener("mousedown",A,!1)};return this.addRemoves(N),N}registerInputEventListeners(){const t=h=>{this.emit("inputChange",h,this.container.files)},e=h=>{this.emit("dragstart",h)},s=h=>{h.dataTransfer&&(h.dataTransfer.dropEffect="copy"),this.emit("dragover",h)},n=h=>{this.emit("dragenter",h)},r=h=>{this.emit("dragend",h)},a=h=>{h.dataTransfer,this.emit("drop",h,h.dataTransfer?.files)};this.container instanceof HTMLInputElement&&this.container.addEventListener("change",t,!1),this.container.addEventListener("dragstart",e,!1),this.container.addEventListener("dragover",s,!1),this.container.addEventListener("dragenter",n,!1),this.container.addEventListener("dragend",r,!1),this.container.addEventListener("drop",a,!1);const o=()=>{this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",t,!1),this.container.removeEventListener("dragstart",e,!1),this.container.removeEventListener("dragover",s,!1),this.container.removeEventListener("dragenter",n,!1),this.container.removeEventListener("dragend",r,!1),this.container.removeEventListener("drop",a,!1)};return this.addRemoves(o),o}registerTransitionEventListeners(){const t=n=>{this.emit("transitionstart",n)},e=n=>{this.emit("transitionend",n)};this.container.addEventListener("transitionstart",t),this.container.addEventListener("transitionend",e);const s=()=>{this.container.removeEventListener("transitionstart",t),this.container.removeEventListener("transitionend",e)};return this.addRemoves(s),s}registerAnimationEventListeners(){const t=n=>{this.emit("animationstart",n)},e=n=>{this.emit("animationend",n)};this.container.addEventListener("animationstart",t),this.container.addEventListener("animationend",e);const s=()=>{this.container.removeEventListener("animationstart",t),this.container.removeEventListener("animationend",e)};return this.addRemoves(s),s}registerKeyDown(t,e,s){const n=Qn.on(t,a=>(e(a,n.formatedKeyNames,n.pause,n.restart),s)),r=()=>{n.removeListener?.()};return this.addRemoves(r),r}registerResizeObserver(){let t;if(typeof ResizeObserver<"u"){const e=new ResizeObserver(s=>{const{width:n,height:r}=s[0].contentRect;this.width=n,this.height=r,this.emit("resize",n,r)});e.observe(this.container),t=()=>{e.unobserve(this.container)}}else{const e="orientationchange"in window?"orientationchange":"resize",s=n=>{const r=n.target.innerWidth,a=n.target.innerHeight;this.emit("resize",r,a)};window.addEventListener(e,s),t=()=>{window.removeEventListener(e,s)}}return this.addRemoves(t),t}registerElementDisplayInParent(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},s=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const c=r.find(l=>l.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);s.observe(this.container);const n=()=>{s.unobserve(this.container)};return this.addRemoves(n),n}registerPullDownRefresh(t){const e=t?.distance||50;return this.captureMove({move:(s,n)=>{n.dStartY>0&&n.dStartY<e&&this.emit("pullDowning",n.dStartY)},end:(s,n)=>{n.dStartY>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;return this.captureMove({move:(s,n)=>{n.dStartY>0&&n.dStartY<e&&this.emit("pullUping",n.dStartY)},end:(s,n)=>{n.dStartY>=e&&this.emit("pullUp")}})}static isTouchEnabled(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}isRunningSingletonCaptureMove=!1;captureMoveStarts=[];captureMoveMoves=[];captureMoveEnds=[];captureMove(t){const e=t?.start||(()=>{}),s=t?.move||(()=>{}),n=t?.end||(()=>{});return this.captureMoveStarts.push(e),this.captureMoveMoves.push(s),this.captureMoveEnds.push(n),this.isRunningSingletonCaptureMove||(this.isRunningSingletonCaptureMove=!0,this.captureMoveUsePointer(),this.addRemoves(()=>{this.captureMoveStarts=[],this.captureMoveMoves=[],this.captureMoveEnds=[]})),()=>{this.captureMoveStarts=this.captureMoveStarts.filter(r=>r!=e),this.captureMoveMoves=this.captureMoveMoves.filter(r=>r!=s),this.captureMoveEnds=this.captureMoveEnds.filter(r=>r!=n)}}setMousePoint(t){this.mousePoint.x=t.x,this.mousePoint.y=t.y,this.mousePoint.dx=typeof t.dx=="number"?t.dx:0,this.mousePoint.dy=typeof t.dy=="number"?t.dy:0,this.mousePoint.dStartX=typeof t.dStartX=="number"?t.dStartX:0,this.mousePoint.dStartY=typeof t.dStartY=="number"?t.dStartY:0}captureMoveUsePointer(){let t,e;const s=o=>{e=Mt(o);const h={...e};t=h,this.setMousePoint(h),this.captureMoveStarts.forEach(c=>{c(o,h)})},n=o=>{e=Mt(o);const h={...e,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(h),this.captureMoveEnds.forEach(c=>{c(o,h)}),t=null},r=o=>{const h={...e};e=Mt(o);const c={...e,dx:e.x-h.x,dy:e.y-h.y,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(c),this.captureMoveMoves.forEach(l=>{l(o,c)})};this.on("pointerDown",s),this.on("pointerUp",n),this.on("pointerCancel",n),this.on("pointerMove",r);const a=()=>{this.off("pointerDown",s),this.off("pointerUp",n),this.off("pointerCancel",n),this.off("pointerMove",r)};return this.addRemoves(a),a}captureMoveUseMouse(){let t,e;const s=o=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",n,!1),e=Mt(o);const h={...e};t=h,this.setMousePoint(h),this.captureMoveStarts.forEach(c=>{c(o,h)})},n=o=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",n,!1),e=Mt(o);const h={...e,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(h),this.captureMoveEnds.forEach(c=>{c(o,h)}),t=null},r=o=>{const h={...e};e=Mt(o);const c={...e,dx:e.x-h.x,dy:e.y-h.y,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(c),this.captureMoveMoves.forEach(l=>{l(o,c)})};this.on("mouseDown",s);const a=()=>{this.off("mouseDown",s)};return this.addRemoves(a),a}captureMoveUseTouch(){let t,e;const s=o=>{const h=o.changedTouches[0];e=Mt(h);const c={...e};t=c,this.setMousePoint(c),this.captureMoveStarts.forEach(l=>{l(h,c)})},n=o=>{const h=o.changedTouches[0];e=Mt(h);const c={...e,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(c),this.captureMoveEnds.forEach(l=>{l(h,c)}),t=null},r=o=>{const h=o.changedTouches[0],c={...e};e=Mt(h);const l={...e,dx:e.x-c.x,dy:e.y-c.y,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(l),this.captureMoveMoves.forEach(d=>{d(h,l)})};this.on("touchStart",s),this.on("touchEnd",n),this.on("touchCancel",n),this.on("touchMove",r);const a=()=>{this.off("touchStart",s),this.off("touchEnd",n),this.off("touchCancel",n),this.off("touchMove",r)};return this.addRemoves(a),a}simulateMouseEvent(t,e){if(t.touches.length>1)return;const s=t.changedTouches[0],n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:s.screenX,screenY:s.screenY,clientX:s.clientX,clientY:s.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});t.target?.dispatchEvent(n)}}const et=new tr(document.documentElement,!0,[()=>xh("(prefers-color-scheme: dark)"),bh,Sh,vh]);et.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{vn().then(i=>ss(i[0])).then(i=>{et.emit("openFile",i)}).catch(i=>{et.emit("openFileError",i)})});function xh(i){let t="";switch(i){case"(prefers-color-scheme: dark)":t="matchMediaChangePrefersColorSchemeDark";break;default:t=i;break}const e=s=>{et.emit(t,s.matches)};return window.matchMedia(i).addEventListener("change",e),()=>{window.matchMedia(i).removeEventListener("change",e)}}function bh(){let i="";const t=new MutationObserver(n=>{location.href!==i&&(i=location.href,et.emit("urlchange",location.href))});t.observe(document,{attributes:!0,childList:!0,subtree:!0});const e=()=>{et.emit("hashchange",location.hash)};window.addEventListener("hashchange",e);const s=()=>{et.emit("popstate")};return window.addEventListener("popstate",s),()=>{t.disconnect(),window.removeEventListener("hashchange",e),window.removeEventListener("popstate",s)}}function vh(){const i=r=>{et.emit("beforeunload",r)};window.addEventListener("beforeunload",i);const t=r=>{et.emit("pagehide",r)};window.addEventListener("pagehide",t);const e=r=>{et.emit("windowFocus",r)};window.addEventListener("focus",e);const s=r=>{et.emit("windowBlur",r)};window.addEventListener("blur",s);const n=r=>{document.hidden?et.emit("windowVisibilityChangeHide",r):et.emit("windowVisibilityChangeShow",r)};return document.addEventListener("visibilitychange",n),()=>{window.removeEventListener("beforeunload",i),window.removeEventListener("pagehide",t),window.removeEventListener("focus",e),window.removeEventListener("blur",s),document.removeEventListener("visibilitychange",n)}}function Sh(){const i=t=>{et.emit("scroll",t)};return document.addEventListener("scroll",i),()=>{document.removeEventListener("scroll",i)}}const Ch=i=>{let t=!1;function e(){if(document.readyState!=="loading"){if(t){document.removeEventListener("DOMContentLoaded",e);return}t=!0,document.removeEventListener("DOMContentLoaded",e),i()}}document.addEventListener("DOMContentLoaded",e),e()};class Oe{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),s=document.createElement("video"),n=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),n.src=URL.createObjectURL(r),n.media="(min-width:10px)",s.append(n),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(s),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{Oe.setAutoPlayWhenClick(t),e(!1)})})}static setAutoPlayWhenClick(t){function e(){t.autoplay=!0,t.play(),document.removeEventListener("click",e),document.removeEventListener("touchend",e)}document.addEventListener("click",e),document.addEventListener("touchend",e)}}class er extends js{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=an(this.source);if(t===0){this.emit("finish");return}let e,s,n=on(this.source,0);for(let r=1;r<t;r++)e=s,s=n,n=on(this.source,r),this.raw+=s,s&&this.step(s,n,e);n&&this.step(n,void 0,s),this.emit("finish")}step(t,e,s){t==`
|
|
25
|
+
`&&this.emit("newline"),this.act(t,e,s)}act(t,e,s){switch(this.mode){case"text":switch(t){case"<":case"eof":this.nodename="",this.attrs={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.emit("text",this.textchunk),this.raw+=t,this.textchunk="";break;case"&":this.mode="entity",this.entity="";break;default:this.textchunk+=t;break}break;case"entity":Ot("whitespace",t)?(this.textchunk+=I.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=I.entity2text(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(s=="!"&&t=="-"&&e=="-"){this.mode="comment start";break}if(this.textchunk=="[CDATA"&&t=="["){this.mode="cdata",this.textchunk="";break}if(t==">"||t=="eof"){this.emit("special",this.textchunk),this.mode="text",this.textchunk="";break}this.textchunk+=t;break;case"cdata":if(s=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,s)),this.textchunk+=t;break;case"cdata end":this.emit("cdata",this.textchunk),this.textchunk="",this.mode="text";break;case"comment start":e==">"||t=="eof"?(this.emit("comment",""),this.mode="skip"):this.mode="comment";break;case"skip":this.mode="text";break;case"comment":t=="-"&&s=="-"&&e==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):t=="eof"?this.emit("comment",this.textchunk):this.textchunk+=t;break;case"comment end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"declaration":if(t=="?"&&e==">"){this.mode="declaration end";break}t=="eof"&&this.emit("comment",this.textchunk),this.textchunk+=t;break;case"declaration end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"tag name start":if(t=="eof"){this.emit("text","<");break}if(!Ot("whitespace",t)){if(this.mode="tag name",t=="/"){this.mode="close tag name start";break}else if(t=="!"){this.mode="special",this.textchunk="";break}else if(t=="?"){this.mode="declaration";break}this.act(t,e,s)}break;case"close tag name start":Ot("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(Ot("whitespace",t))this.tagname=this.nodename;else switch(t){case">":this.emit("/tag",this.tagname||this.nodename,this.attrs),this.mode="text";break;default:!this.tagname&&(this.nodename+=t);break}break;case"tag name":if(Ot("whitespace",t))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(t){case">":this.emit("tag",this.nodename,this.attrs),this.mode="text";break;case"/":this.raw+=e,this.emit("tag",this.nodename,this.attrs),this.emit("/tag",this.nodename,this.attrs),this.mode="skip";break;default:this.nodename+=t;break}break;case"attr start":Ot("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(Ot("whitespace",t)||t=="=")this.attrs[this.nodename]="",this.mode="attr value start";else switch(t){case">":this.nodename=="/"?(delete this.attrs["/"],this.emit("tag",this.tagname,this.attrs),this.emit("/tag",this.tagname,this.attrs)):(this.nodename&&(this.attrs[this.nodename]=""),this.emit("tag",this.tagname,this.attrs)),this.mode="text";break;default:this.nodename+=t;break}break;case"attr value start":if(!Ot("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,s)}break;case"attr value":if(Ot("whitespace",t)&&!this.quote)this.mode="attr start";else if(t==">"&&!this.quote)this.emit("tag",this.tagname,this.attrs),this.mode="text";else switch(t){case'"':case"'":this.quote==t&&s!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function gi(i,t,e){if(typeof t<"u")window.localStorage.setItem(i,JSON.stringify({value:t,expires:typeof e=="number"?e:-1}));else{const s=window.localStorage.getItem(i);try{const n=JSON.parse(s||"");return"expires"in n&&parseInt(n.expires)>=0&&new Date().getTime()>parseInt(n.expires)?void 0:n.value||void 0}catch{return s||void 0}}}function Eh(i,t,e){const s=new Date;s.setTime(s.getTime()+e*24*60*60*1e3);const n="expires="+s.toUTCString();document.cookie=i+"="+t+"; "+n}function Th(i){const t=i+"=",e=document.cookie.split(";");for(let s=0,n=e.length;s<n;s++){const r=e[s].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const Ph=()=>document.cookie.split(";").map(i=>i.split("=")).reduce((i,[t,e])=>(i[t.trim().replace('"',"")]=e,i),{}),Mh=()=>document.cookie.split(";").forEach(i=>document.cookie=i.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));et.on("matchMediaChangePrefersColorSchemeDark",i=>{ys(i?"dark":"light")}),sr();function ys(i){gi("colorScheme",i),document.documentElement.classList.toggle("dark",i=="dark")}function sr(){const i=gi("colorScheme");if(i=="dark"||i=="light")return ys(i),i;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return ys(t),t}}const yi={safeAreaTop:I.getCSSVar("--safe-area-inset-top"),safeAreaRight:I.getCSSVar("--safe-area-inset-right"),safeAreaBottom:I.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:I.getCSSVar("--safe-area-inset-left"),colorPrimary:I.getCSSVar("--color-primary")||"#5078f0",colorRed:I.getCSSVar("--color-red")||"#ff5050",colorOrange:I.getCSSVar("--color-orange")||"#fa8c00",colorYellow:I.getCSSVar("--color-yellow")||"#fadc32",colorGreen:I.getCSSVar("--color-green")||"#00c878",colorBlue:I.getCSSVar("--color-blue")||"#00b4fa",colorPurple:I.getCSSVar("--color-purple")||"#6464fa",colorBlack:I.getCSSVar("--color-black")||"#001428",colorGray00:I.getCSSVar("--color-gray-00")||"#000000",colorGray33:I.getCSSVar("--color-gray-33")||"#333333",colorGray66:I.getCSSVar("--color-gray-66")||"#666666",colorGray99:I.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:I.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:I.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:I.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:I.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:I.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:I.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:I.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:I.getCSSVar("--font-line-height")||"1,4",fontSize32:I.getCSSVar("--font-size-32")||"32px",fontSize24:I.getCSSVar("--font-size-24")||"24px",fontSize20:I.getCSSVar("--font-size-20")||"20px",fontSize18:I.getCSSVar("--font-size-18")||"18px",fontSize16:I.getCSSVar("--font-size-16")||"16px",fontSize14:I.getCSSVar("--font-size-14")||"14px",fontSize12:I.getCSSVar("--font-size-12")||"12px",fontSize11:I.getCSSVar("--font-size-11")||"11px",gap4:I.getCSSVar("--gap-4")||"4px",gap8:I.getCSSVar("--gap-8")||"8px",gap12:I.getCSSVar("--gap-12")||"12px",gap16:I.getCSSVar("--gap-16")||"16px",gap20:I.getCSSVar("--gap-20")||"20px",gap40:I.getCSSVar("--gap-40")||"40px",height44:I.getCSSVar("--height-44")||"44px",height32:I.getCSSVar("--height-32")||"32px",borderRadius:I.getCSSVar("--border-radius")||"4px"},ir=["#0ac2d2","#7bb7fa","#60d7a9","#fdc162","#fd6a62","#f68dbb","#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff","#dc4916","#6871b1","#d1b935","#1bbc9b","#FF7F50","#4BBFC3","#ff9900"];function It(i,t){if(Object.prototype.hasOwnProperty.call(i,"r")&&Object.prototype.hasOwnProperty.call(i,"g")&&Object.prototype.hasOwnProperty.call(i,"b"))return i.r=Math.round(yt(i.r,0,255)),i.g=Math.round(yt(i.g,0,255)),i.b=Math.round(yt(i.b,0,255)),Object.prototype.hasOwnProperty.call(i,"a")?i.a=typeof t=="number"?t:i.a:i.a=typeof t=="number"?t:1,i.a=yt(i.a,0,1),i;const e={r:0,g:0,b:0,a:1};let s=-1;if(typeof i=="number")s=i;else if(typeof i=="string")if(i[0].toLowerCase()==="r"){const n=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(i);n&&(s=(parseInt(n[1])<<16)+(parseInt(n[2])<<8)+parseInt(n[3]),n[4]&&(e.a=Et(parseFloat(n[4]),2)))}else if(i[0]==="#")s=parseInt(i.slice(1,7),16),i.length>7&&(e.a=Et(parseInt(i.slice(7,9),16)/255,2));else throw new Error("getColor 不支持的颜色解析:"+i);return s>=0&&(e.r=s>>16&255,e.g=s>>8&255,e.b=s&255),typeof t=="number"&&(e.a=t),e.a=yt(e.a,0,1),e}function wi(i,t=!1,e="#000000",s="#ffffff"){let n=It(i);return t?n=It(n.r*.299+n.g*.587+n.b*.114>186?e:s):(n.r=255-n.r,n.g=255-n.g,n.b=255-n.b),n}function xi(i,t){const e=It(i,t);return e.a===1?`rgb(${e.r},${e.g},${e.b})`:`rgba(${e.r},${e.g},${e.b},${e.a})`}function Ah(i,t=!1,e="#000000",s="#ffffff"){return xi(wi(i,t,e,s))}function ws(i){return Na(i.toString(16),2,"0","left")}function ye(i,t){const e=It(i,t),s=`#${ws(e.r)}${ws(e.g)}${ws(e.b)}`;return e.a===1?s:s+`${ws(Math.ceil(e.a*255))}`}function nr(i,t=!1,e="#000000",s="#ffffff"){return ye(wi(i,t,e,s))}const rr=()=>Math.random()*16777215,Ih=()=>ye(rr());function Dh(i,t){const e=It(i);return e.r==0&&(e.r=32),e.g==0&&(e.g=32),e.b==0&&(e.b=32),e.r=e.r*(100+t)/100,e.g=e.g*(100+t)/100,e.b=e.b*(100+t)/100,e.r=Math.round(yt(e.r,0,255)),e.g=Math.round(yt(e.g,0,255)),e.b=Math.round(yt(e.b,0,255)),ye(e)}function bi(i,t,e){try{const s=It(i),n=It(t);return ye({r:(n.r-s.r)*e+s.r,g:(n.g-s.g)*e+s.g,b:(n.b-s.b)*e+s.b,a:(n.a-s.a)*e+s.a})}catch{return t}}function kh(i,t,e,s){let n,r,a;i=i/360,t=t/100,e=e/100;const o=Math.floor(i*6),h=i*6-o,c=e*(1-t),l=e*(1-h*t),d=e*(1-(1-h)*t);switch(o%6){case 0:n=e,r=d,a=c;break;case 1:n=l,r=e,a=c;break;case 2:n=c,r=e,a=d;break;case 3:n=c,r=l,a=e;break;case 4:n=d,r=c,a=e;break;case 5:default:n=e,r=c,a=l;break}return{r:Math.round(n*255),g:Math.round(r*255),b:Math.round(a*255),opacity:s??1}}function _h(i,t,e,s){i*=360;let n,r,a;i=i%360/60;const o=e*t,h=o*(1-Math.abs(i%2-1));return n=r=a=e-o,i=~~i,n+=[o,h,0,0,h,o][i],r+=[h,o,o,h,0,0][i],a+=[0,0,h,o,o,h][i],{r:n,g:r,b:a,opacity:s??1}}function Lh(i,t,e,s){(i>1||t>1||e>1)&&(i/=360,t/=100,e/=100),i*=360;let n,r,a;i=i%360/60;const o=2*t*(e<.5?e:1-e),h=o*(1-Math.abs(i%2-1));return n=r=a=e-o/2,i=~~i,n+=[o,h,0,0,h,o][i],r+=[h,o,o,h,0,0][i],a+=[0,0,h,o,o,h][i],{r:n,g:r,b:a,opacity:s??1}}function Rh(i,t,e,s){const n=Math.max(i,t,e),r=Math.min(i,t,e),a=n-r,o=n===0?0:a/n,h=n/255;let c;switch(n){case r:c=0;break;case i:c=t-e+a*(t<e?6:0),c/=6*a;break;case t:c=e-i+a*2,c/=6*a;break;case e:default:c=i-t+a*4,c/=6*a;break}return{h:Math.round(c*360),s:Math.round(o*100),v:Math.round(h*100),opacity:s??1}}function Oh(i,t,e){const s=Math.max(i,t,e),n=s-Math.min(i,t,e);let r=n==0?0:s==i?(t-e)/n:s==t?(e-i)/n+2:(i-t)/n+4;r=(r+360)%6*60/360;const a=n==0?0:n/s;return{h:r,s:a,b:s}}function Nh(i,t,e){const s=Math.max(i,t,e),n=Math.min(i,t,e),r=s-n;let a=r==0?0:s==i?(t-e)/r:s==t?(e-i)/r+2:(i-t)/r+4;a=(a+360)%6*60/360;const o=(s+n)/2,h=r==0?0:o<.5?r/(2*o):r/(2-2*o);return{h:a,s:h,l:o}}function xs(i=window.location.href){return fn(URL)?new URL(i):ar(i)}function ar(i=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",s="(?<pathname>(?:\\/[^/#?]+)*\\/?)",n="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${s}${n}${r}$`).exec(i);return{href:i,protocol:o?.groups?.protocol??"",host:o?.groups?.host??"",hostname:o?.groups?.hostname??"",port:o?.groups?.port??"",pathname:o?.groups?.pathname??"",search:o?.groups?.search??"",hash:o?.groups?.hash??""}}function Fh(i){const t=xs(i);return t.protocol==="http:"||t.protocol==="https:"}function or(i=window.location.href){const t=xs(i),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Bh(i=xs().search){i=decodeURIComponent(i).replace(/^[#?&]/,"");const t={};if(!i)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let s=e.exec(i);for(;s;)t[s[1]]=s[2],s=e.exec(i);return t}function hr(i){return"?"+Object.entries(i).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function cr(i){return"?"+[...i.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function Xh(i,t){return i.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function lr(i,t){return i+t.replace(/^[&?]/,i.indexOf("?")>=0?"&":"?")}class Yh{worker;cbs={};constructor(t){if(_n)try{this.worker=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){throw typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),e}else throw new Error("Your environment do not support Worker !")}postMessage(t,e=[]){this.worker.postMessage(t,e)}onmessage(t){this.worker.addEventListener("message",t)}offmessage(t){this.worker.removeEventListener("message",t)}onmessageerror(t){this.worker.addEventListener("messageerror",t)}offmessageerror(t){this.worker.removeEventListener("messageerror",t)}postCanvas(t){const e=t.transferControlToOffscreen();this.worker.postMessage({canvas:e},[e])}postPort(t){this.worker.postMessage({port:t},[t])}postReset(){this.worker.postMessage({reset:!0});for(const t in this.cbs)this.cbs[t](),delete this.cbs[t]}fire(t,e){return new Promise(s=>{if(e){const n=Math.random().toString(36).slice(2),r=a=>{a.data.id===n&&(this.worker.removeEventListener("message",r),delete this.cbs[n],e(),s())};this.cbs[n]=r.bind(this,{data:{id:n}}),this.worker.addEventListener("message",r),this.worker.postMessage({...t,id:n})}else this.worker.postMessage(t),s()})}}class Uh{port1;port2;port1MessageCbs=[];port2MessageCbs=[];port1MessageErrorCbs=[];port2MessageErrorCbs=[];constructor(){const{port1:t,port2:e}=new MessageChannel;this.port1=t,this.port2=e,this.port1.addEventListener("message",s=>{this.port1MessageCbs.forEach(n=>n(this.port1,s))}),this.port1.addEventListener("messageerror",s=>{this.port1MessageErrorCbs.forEach(n=>n(this.port1,s))}),this.port1.start(),this.port2.addEventListener("message",s=>{this.port2MessageCbs.forEach(n=>n(this.port2,s))}),this.port2.addEventListener("messageerror",s=>{this.port2MessageErrorCbs.forEach(n=>n(this.port2,s))}),this.port2.start()}close(){this.port1.close(),this.port2.close()}onPort1Message(t){this.port1MessageCbs.push(t)}onPort1MessageError(t){this.port1MessageErrorCbs.push(t)}offPort1Message(t){Te(this.port1MessageCbs,t)}offPort1MessageError(t){Te(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){Te(this.port2MessageCbs,t)}offPort2MessageError(t){Te(this.port2MessageErrorCbs,t)}}function ur(){let i=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0;e<t.length;e++)try{i=new window.ActiveXObject(t[e]);break}catch{continue}}else i=new XMLHttpRequest;return i}function Gh(i,t){return new Promise((e,s)=>{const{method:n="GET",data:r={},segments:a=[],headers:o={},withCredentials:h=!1,responseType:c="json",timeout:l=3e4}=t||{},d=ur();d.timeout=l,d.responseType=c,d.onreadystatechange=function(C){d.readyState===4&&(d.status===200?e(d.response):s(d.statusText))},d.ontimeout=function(){s(`${i} is timed out for ${l}ms.`)},d.addEventListener("error",function(C){s(C)},!1),d.addEventListener("progress",function(C){if(C.lengthComputable){const L=Math.round(C.loaded*100/C.total);t?.progress?.(L,d)}},!1),d.addEventListener("load",function(C){t?.load?.(C,d)},!1),d.addEventListener("loadstart",function(C){t?.loadstart?.(C,d)},!1),d.addEventListener("loadend",function(C){t?.loadend?.(C,d)},!1),d.addEventListener("abort",function(C){t?.abort?.(C,d)},!1);const g=n.toUpperCase();Object.assign(o,{Accept:"*/*"});const y="---------------------------"+Date.now().toString(16);let p=!1,x=!1,b=!1;function S(){h&&(d.withCredentials=!0);for(const C in o)ct(C).toLowerCase()=="content-type"&&o[C].toLowerCase()=="multipart/form-data"?(p=!0,d.setRequestHeader("Content-Type","multipart/form-data; boundary="+y)):(ct(C).toLowerCase()=="content-type"&&(o[C].toLowerCase().indexOf("text/plain")>=0?x=!0:o[C].toLowerCase().indexOf("application/json")>=0&&(b=!0)),d.setRequestHeader(C,o[C]))}switch(g){case"GET":let C="";r instanceof FormData?C=cr(r):C=hr(r),d.open("GET",lr(i,C),!0),S(),d.send(null);break;case"POST":default:d.open(g,i,!0),S(),p&&a.length?d.sendAsBinary("--"+y+`\r
|
|
26
26
|
`+a.join("--"+y+`\r
|
|
27
27
|
`)+"--"+y+`--\r
|
|
28
28
|
`):b?d.send(JSON.stringify(r)):d.send(Object.entries(r).map(([L,R])=>`${encodeURIComponent(L)}=${encodeURIComponent(R)}`).join(x?`\r
|
|
29
|
-
`:"&"));break}})}async function
|
|
29
|
+
`:"&"));break}})}async function Vh(i){const t={url:"",data:{},segments:[],contentType:""};if(!i.action)return t;t.url=i.action;const e=i.method.toLowerCase()==="post";t.contentType=e&&i.enctype?i.enctype:"application/x-www-form-urlencoded";const s=t.contentType=="multipart/form-data";for(let n=0;n<i.elements.length;n++){const r=i.elements[n];if(!r.hasAttribute("name"))continue;const a=r.nodeName.toUpperCase()==="INPUT"&&r.getAttribute("type")?r.getAttribute("type").toUpperCase():"";if(a==="FILE"){const o=r.files?r.files.length:0;if(o==0)continue;if(s)for(let h=0;h<o;h++){const c=r.files[h],l=await ss(c,"binaryString");t.segments.push('Content-Disposition: form-data; name="'+r.name+'"; filename="'+c.name+`"\r
|
|
30
30
|
Content-Type: `+c.type+`\r
|
|
31
31
|
\r
|
|
32
32
|
`+l+`\r
|
|
33
33
|
`)}else for(let h=0;h<o;h++)t.data[r.name]=r.files[h].name}else(a!=="RADIO"&&a!=="CHECKBOX"||(a=="RADIO"||a=="CHECKBOX")&&r.checked)&&(s?t.segments.push('Content-Disposition: form-data; name="'+r.name+`"\r
|
|
34
34
|
\r
|
|
35
35
|
`+r.value+`\r
|
|
36
|
-
`):t.data[r.name]=r.value)}return t}function ur(i,t){return function(){return i.apply(t,arguments)}}const{toString:qh}=Object.prototype,{getPrototypeOf:bi}=Object,vs=(i=>t=>{const e=qh.call(t);return i[e]||(i[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),It=i=>(i=i.toLowerCase(),t=>vs(t)===i),Ss=i=>t=>typeof t===i,{isArray:we}=Array,Ne=Ss("undefined");function Hh(i){return i!==null&&!Ne(i)&&i.constructor!==null&&!Ne(i.constructor)&&xt(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const dr=It("ArrayBuffer");function jh(i){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(i):t=i&&i.buffer&&dr(i.buffer),t}const Wh=Ss("string"),xt=Ss("function"),fr=Ss("number"),Cs=i=>i!==null&&typeof i=="object",$h=i=>i===!0||i===!1,Es=i=>{if(vs(i)!=="object")return!1;const t=bi(i);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},Jh=It("Date"),Zh=It("File"),Kh=It("Blob"),Qh=It("FileList"),tc=i=>Cs(i)&&xt(i.pipe),ec=i=>{let t;return i&&(typeof FormData=="function"&&i instanceof FormData||xt(i.append)&&((t=vs(i))==="formdata"||t==="object"&&xt(i.toString)&&i.toString()==="[object FormData]"))},sc=It("URLSearchParams"),ic=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Fe(i,t,{allOwnKeys:e=!1}={}){if(i===null||typeof i>"u")return;let s,n;if(typeof i!="object"&&(i=[i]),we(i))for(s=0,n=i.length;s<n;s++)t.call(null,i[s],s,i);else{const r=e?Object.getOwnPropertyNames(i):Object.keys(i),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,i[o],o,i)}}function mr(i,t){t=t.toLowerCase();const e=Object.keys(i);let s=e.length,n;for(;s-- >0;)if(n=e[s],t===n.toLowerCase())return n;return null}const pr=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),gr=i=>!Ne(i)&&i!==pr;function vi(){const{caseless:i}=gr(this)&&this||{},t={},e=(s,n)=>{const r=i&&mr(t,n)||n;Es(t[r])&&Es(s)?t[r]=vi(t[r],s):Es(s)?t[r]=vi({},s):we(s)?t[r]=s.slice():t[r]=s};for(let s=0,n=arguments.length;s<n;s++)arguments[s]&&Fe(arguments[s],e);return t}const nc=(i,t,e,{allOwnKeys:s}={})=>(Fe(t,(n,r)=>{e&&xt(n)?i[r]=ur(n,e):i[r]=n},{allOwnKeys:s}),i),rc=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),ac=(i,t,e,s)=>{i.prototype=Object.create(t.prototype,s),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:t.prototype}),e&&Object.assign(i.prototype,e)},oc=(i,t,e,s)=>{let n,r,a;const o={};if(t=t||{},i==null)return t;do{for(n=Object.getOwnPropertyNames(i),r=n.length;r-- >0;)a=n[r],(!s||s(a,i,t))&&!o[a]&&(t[a]=i[a],o[a]=!0);i=e!==!1&&bi(i)}while(i&&(!e||e(i,t))&&i!==Object.prototype);return t},hc=(i,t,e)=>{i=String(i),(e===void 0||e>i.length)&&(e=i.length),e-=t.length;const s=i.indexOf(t,e);return s!==-1&&s===e},cc=i=>{if(!i)return null;if(we(i))return i;let t=i.length;if(!fr(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=i[t];return e},lc=(i=>t=>i&&t instanceof i)(typeof Uint8Array<"u"&&bi(Uint8Array)),uc=(i,t)=>{const s=(i&&i[Symbol.iterator]).call(i);let n;for(;(n=s.next())&&!n.done;){const r=n.value;t.call(i,r[0],r[1])}},dc=(i,t)=>{let e;const s=[];for(;(e=i.exec(t))!==null;)s.push(e);return s},fc=It("HTMLFormElement"),mc=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,n){return s.toUpperCase()+n}),yr=(({hasOwnProperty:i})=>(t,e)=>i.call(t,e))(Object.prototype),pc=It("RegExp"),wr=(i,t)=>{const e=Object.getOwnPropertyDescriptors(i),s={};Fe(e,(n,r)=>{let a;(a=t(n,r,i))!==!1&&(s[r]=a||n)}),Object.defineProperties(i,s)},gc=i=>{wr(i,(t,e)=>{if(xt(i)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=i[e];if(xt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},yc=(i,t)=>{const e={},s=n=>{n.forEach(r=>{e[r]=!0})};return we(i)?s(i):s(String(i).split(t)),e},wc=()=>{},xc=(i,t)=>(i=+i,Number.isFinite(i)?i:t),Si="abcdefghijklmnopqrstuvwxyz",xr="0123456789",br={DIGIT:xr,ALPHA:Si,ALPHA_DIGIT:Si+Si.toUpperCase()+xr},bc=(i=16,t=br.ALPHA_DIGIT)=>{let e="";const{length:s}=t;for(;i--;)e+=t[Math.random()*s|0];return e};function vc(i){return!!(i&&xt(i.append)&&i[Symbol.toStringTag]==="FormData"&&i[Symbol.iterator])}const Sc=i=>{const t=new Array(10),e=(s,n)=>{if(Cs(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[n]=s;const r=we(s)?[]:{};return Fe(s,(a,o)=>{const h=e(a,n+1);!Ne(h)&&(r[o]=h)}),t[n]=void 0,r}}return s};return e(i,0)},Cc=It("AsyncFunction"),E={isArray:we,isArrayBuffer:dr,isBuffer:Hh,isFormData:ec,isArrayBufferView:jh,isString:Wh,isNumber:fr,isBoolean:$h,isObject:Cs,isPlainObject:Es,isUndefined:Ne,isDate:Jh,isFile:Zh,isBlob:Kh,isRegExp:pc,isFunction:xt,isStream:tc,isURLSearchParams:sc,isTypedArray:lc,isFileList:Qh,forEach:Fe,merge:vi,extend:nc,trim:ic,stripBOM:rc,inherits:ac,toFlatObject:oc,kindOf:vs,kindOfTest:It,endsWith:hc,toArray:cc,forEachEntry:uc,matchAll:dc,isHTMLForm:fc,hasOwnProperty:yr,hasOwnProp:yr,reduceDescriptors:wr,freezeMethods:gc,toObjectSet:yc,toCamelCase:mc,noop:wc,toFiniteNumber:xc,findKey:mr,global:pr,isContextDefined:gr,ALPHABET:br,generateString:bc,isSpecCompliantForm:vc,toJSONObject:Sc,isAsyncFn:Cc,isThenable:i=>i&&(Cs(i)||xt(i))&&xt(i.then)&&xt(i.catch)};function B(i,t,e,s,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),n&&(this.response=n)}E.inherits(B,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:E.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const vr=B.prototype,Sr={};["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(i=>{Sr[i]={value:i}}),Object.defineProperties(B,Sr),Object.defineProperty(vr,"isAxiosError",{value:!0}),B.from=(i,t,e,s,n,r)=>{const a=Object.create(vr);return E.toFlatObject(i,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),B.call(a,i.message,t,e,s,n),a.cause=i,a.name=i.name,r&&Object.assign(a,r),a};const Ec=null;function Ci(i){return E.isPlainObject(i)||E.isArray(i)}function Cr(i){return E.endsWith(i,"[]")?i.slice(0,-2):i}function Er(i,t,e){return i?i.concat(t).map(function(n,r){return n=Cr(n),!e&&r?"["+n+"]":n}).join(e?".":""):t}function Tc(i){return E.isArray(i)&&!i.some(Ci)}const Pc=E.toFlatObject(E,{},null,function(t){return/^is[A-Z]/.test(t)});function Ts(i,t,e){if(!E.isObject(i))throw new TypeError("target must be an object");t=t||new FormData,e=E.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,b){return!E.isUndefined(b[x])});const s=e.metaTokens,n=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(t);if(!E.isFunction(n))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(E.isDate(p))return p.toISOString();if(!h&&E.isBlob(p))throw new B("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(p)||E.isTypedArray(p)?h&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,x,b){let S=p;if(p&&!b&&typeof p=="object"){if(E.endsWith(x,"{}"))x=s?x:x.slice(0,-2),p=JSON.stringify(p);else if(E.isArray(p)&&Tc(p)||(E.isFileList(p)||E.endsWith(x,"[]"))&&(S=E.toArray(p)))return x=Cr(x),S.forEach(function(L,R){!(E.isUndefined(L)||L===null)&&t.append(a===!0?Er([x],R,r):a===null?x:x+"[]",c(L))}),!1}return Ci(p)?!0:(t.append(Er(b,x,r),c(p)),!1)}const d=[],g=Object.assign(Pc,{defaultVisitor:l,convertValue:c,isVisitable:Ci});function y(p,x){if(!E.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+x.join("."));d.push(p),E.forEach(p,function(S,C){(!(E.isUndefined(S)||S===null)&&n.call(t,S,E.isString(C)?C.trim():C,x,g))===!0&&y(S,x?x.concat(C):[C])}),d.pop()}}if(!E.isObject(i))throw new TypeError("data must be an object");return y(i),t}function Tr(i){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Ei(i,t){this._pairs=[],i&&Ts(i,this,t)}const Pr=Ei.prototype;Pr.append=function(t,e){this._pairs.push([t,e])},Pr.toString=function(t){const e=t?function(s){return t.call(this,s,Tr)}:Tr;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function Mc(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Mr(i,t,e){if(!t)return i;const s=e&&e.encode||Mc,n=e&&e.serialize;let r;if(n?r=n(t,e):r=E.isURLSearchParams(t)?t.toString():new Ei(t,e).toString(s),r){const a=i.indexOf("#");a!==-1&&(i=i.slice(0,a)),i+=(i.indexOf("?")===-1?"?":"&")+r}return i}class Ac{constructor(){this.handlers=[]}use(t,e,s){return this.handlers.push({fulfilled:t,rejected:e,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){E.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Ar=Ac,kr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kc=typeof URLSearchParams<"u"?URLSearchParams:Ei,Ic=typeof FormData<"u"?FormData:null,Dc=typeof Blob<"u"?Blob:null,_c=(()=>{let i;return typeof navigator<"u"&&((i=navigator.product)==="ReactNative"||i==="NativeScript"||i==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Lc=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Dt={isBrowser:!0,classes:{URLSearchParams:kc,FormData:Ic,Blob:Dc},isStandardBrowserEnv:_c,isStandardBrowserWebWorkerEnv:Lc,protocols:["http","https","file","blob","url","data"]};function Rc(i,t){return Ts(i,new Dt.classes.URLSearchParams,Object.assign({visitor:function(e,s,n,r){return Dt.isNode&&E.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Oc(i){return E.matchAll(/\w+|\[(\w*)]/g,i).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Nc(i){const t={},e=Object.keys(i);let s;const n=e.length;let r;for(s=0;s<n;s++)r=e[s],t[r]=i[r];return t}function Ir(i){function t(e,s,n,r){let a=e[r++];const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&E.isArray(n)?n.length:a,h?(E.hasOwnProp(n,a)?n[a]=[n[a],s]:n[a]=s,!o):((!n[a]||!E.isObject(n[a]))&&(n[a]=[]),t(e,s,n[a],r)&&E.isArray(n[a])&&(n[a]=Nc(n[a])),!o)}if(E.isFormData(i)&&E.isFunction(i.entries)){const e={};return E.forEachEntry(i,(s,n)=>{t(Oc(s),n,e,0)}),e}return null}function Fc(i,t,e){if(E.isString(i))try{return(t||JSON.parse)(i),E.trim(i)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(i)}const Ti={transitional:kr,adapter:["xhr","http"],transformRequest:[function(t,e){const s=e.getContentType()||"",n=s.indexOf("application/json")>-1,r=E.isObject(t);if(r&&E.isHTMLForm(t)&&(t=new FormData(t)),E.isFormData(t))return n&&n?JSON.stringify(Ir(t)):t;if(E.isArrayBuffer(t)||E.isBuffer(t)||E.isStream(t)||E.isFile(t)||E.isBlob(t))return t;if(E.isArrayBufferView(t))return t.buffer;if(E.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Rc(t,this.formSerializer).toString();if((o=E.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Ts(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||n?(e.setContentType("application/json",!1),Fc(t)):t}],transformResponse:[function(t){const e=this.transitional||Ti.transitional,s=e&&e.forcedJSONParsing,n=this.responseType==="json";if(t&&E.isString(t)&&(s&&!this.responseType||n)){const a=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?B.from(o,B.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dt.classes.FormData,Blob:Dt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],i=>{Ti.headers[i]={}});const Pi=Ti,Bc=E.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"]),Xc=i=>{const t={};let e,s,n;return i&&i.split(`
|
|
37
|
-
`).forEach(function(a){n=a.indexOf(":"),e=a.substring(0,n).trim().toLowerCase(),s=a.substring(n+1).trim(),!(!e||t[e]&&
|
|
38
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(n=>s.set(n)),s}static accessor(t){const s=(this[
|
|
39
|
-
`+r.map(
|
|
40
|
-
`):" "+Or(r[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:ki};function Ii(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new Xe(null,i)}function Fr(i){return Ii(i),i.headers=Xt.from(i.headers),i.data=Ai.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),Nr.getAdapter(i.adapter||Pi.adapter)(i).then(function(s){return Ii(i),s.data=Ai.call(i,i.transformResponse,s),s.headers=Xt.from(s.headers),s},function(s){return _r(s)||(Ii(i),s&&s.response&&(s.response.data=Ai.call(i,i.transformResponse,s.response),s.response.headers=Xt.from(s.response.headers))),Promise.reject(s)})}const Br=i=>i instanceof Xt?i.toJSON():i;function xe(i,t){t=t||{};const e={};function s(c,l,d){return E.isPlainObject(c)&&E.isPlainObject(l)?E.merge.call({caseless:d},c,l):E.isPlainObject(l)?E.merge({},l):E.isArray(l)?l.slice():l}function n(c,l,d){if(E.isUndefined(l)){if(!E.isUndefined(c))return s(void 0,c,d)}else return s(c,l,d)}function r(c,l){if(!E.isUndefined(l))return s(void 0,l)}function a(c,l){if(E.isUndefined(l)){if(!E.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,d){if(d in t)return s(c,l);if(d in i)return s(void 0,c)}const h={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(c,l)=>n(Br(c),Br(l),!0)};return E.forEach(Object.keys(Object.assign({},i,t)),function(l){const d=h[l]||n,g=d(i[l],t[l],l);E.isUndefined(g)&&d!==o||(e[l]=g)}),e}const Xr="1.5.1",Di={};["object","boolean","number","function","string","symbol"].forEach((i,t)=>{Di[i]=function(s){return typeof s===i||"a"+(t<1?"n ":" ")+i}});const Yr={};Di.transitional=function(t,e,s){function n(r,a){return"[Axios v"+Xr+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new B(n(a," has been removed"+(e?" in "+e:"")),B.ERR_DEPRECATED);return e&&!Yr[a]&&(Yr[a]=!0,console.warn(n(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}};function Kc(i,t,e){if(typeof i!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const s=Object.keys(i);let n=s.length;for(;n-- >0;){const r=s[n],a=t[r];if(a){const o=i[r],h=o===void 0||a(o,r,i);if(h!==!0)throw new B("option "+r+" must be "+h,B.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new B("Unknown option "+r,B.ERR_BAD_OPTION)}}const _i={assertOptions:Kc,validators:Di},Kt=_i.validators;class As{constructor(t){this.defaults=t,this.interceptors={request:new Ar,response:new Ar}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=xe(this.defaults,e);const{transitional:s,paramsSerializer:n,headers:r}=e;s!==void 0&&_i.assertOptions(s,{silentJSONParsing:Kt.transitional(Kt.boolean),forcedJSONParsing:Kt.transitional(Kt.boolean),clarifyTimeoutError:Kt.transitional(Kt.boolean)},!1),n!=null&&(E.isFunction(n)?e.paramsSerializer={serialize:n}:_i.assertOptions(n,{encode:Kt.function,serialize:Kt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&E.merge(r.common,r[e.method]);r&&E.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=Xt.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(e)===!1||(h=h&&x.synchronous,o.unshift(x.fulfilled,x.rejected))});const c=[];this.interceptors.response.forEach(function(x){c.push(x.fulfilled,x.rejected)});let l,d=0,g;if(!h){const p=[Fr.bind(this),void 0];for(p.unshift.apply(p,o),p.push.apply(p,c),g=p.length,l=Promise.resolve(e);d<g;)l=l.then(p[d++],p[d++]);return l}g=o.length;let y=e;for(d=0;d<g;){const p=o[d++],x=o[d++];try{y=p(y)}catch(b){x.call(this,b);break}}try{l=Fr.call(this,y)}catch(p){return Promise.reject(p)}for(d=0,g=c.length;d<g;)l=l.then(c[d++],c[d++]);return l}getUri(t){t=xe(this.defaults,t);const e=Lr(t.baseURL,t.url);return Mr(e,t.params,t.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(t){As.prototype[t]=function(e,s){return this.request(xe(s||{},{method:t,url:e,data:(s||{}).data}))}}),E.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(xe(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}As.prototype[t]=e(),As.prototype[t+"Form"]=e(!0)});const ks=As;class Li{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const s=this;this.promise.then(n=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](n);s._listeners=null}),this.promise.then=n=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(n);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Xe(r,a,o),e(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new Li(function(n){t=n}),cancel:t}}}const Qc=Li;function tl(i){return function(e){return i.apply(null,e)}}function el(i){return E.isObject(i)&&i.isAxiosError===!0}const Ri={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:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ri).forEach(([i,t])=>{Ri[t]=i});const sl=Ri;function Ur(i){const t=new ks(i),e=ur(ks.prototype.request,t);return E.extend(e,ks.prototype,t,{allOwnKeys:!0}),E.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return Ur(xe(i,n))},e}const q=Ur(Pi);q.Axios=ks,q.CanceledError=Xe,q.CancelToken=Qc,q.isCancel=_r,q.VERSION=Xr,q.toFormData=Ts,q.AxiosError=B,q.Cancel=q.CanceledError,q.all=function(t){return Promise.all(t)},q.spread=tl,q.isAxiosError=el,q.mergeConfig=xe,q.AxiosHeaders=Xt,q.formToJSON=i=>Ir(E.isHTMLForm(i)?new FormData(i):i),q.getAdapter=Nr.getAdapter,q.HttpStatusCode=sl,q.default=q;const il=q,Qt=window.crypto.subtle;Qt||console.warn("Crypto API not supported");function Gr(i){return _a(encodeURIComponent(i)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function Vr(i){let t=i.replaceAll("*","+").replaceAll("-","/");const e=t.length%4;return e&&(t=t.padEnd(t.length+(4-e),"=")),decodeURIComponent(La(t))}function nl(i){return Gr(Ba(i))}function rl(i){return Fa(Vr(i))}function Is(i){return new TextEncoder().encode(i)}function zr(i,t="utf-8"){return new TextDecoder(t).decode(i)}async function al(i,t="AES-GCM"){const e=crypto.getRandomValues(new Uint8Array(12)),s=await Qt.generateKey({name:t,length:256},!1,["encrypt","decrypt"]),n=await Qt.encrypt({name:t,iv:e},s,Is(i));return{algorithm:t,iv:e,key:s,encryptedData:n}}async function ol(i){const t=await Qt.decrypt({name:i.algorithm,iv:i.iv},i.key,i.encryptedData);return zr(t)}async function hl(i,t="ECDSA",e="SHA-384"){const{privateKey:s,publicKey:n}=await Qt.generateKey({name:t,namedCurve:"P-384"},!1,["sign","verify"]),r=Is(JSON.stringify(i)),a=await Qt.sign({name:t,hash:{name:e}},s,r);return{algorithm:t,hash:e,publicKey:n,signature:a,encodedData:r}}async function cl(i){return await Qt.verify({name:i.algorithm,hash:{name:i.hash}},i.publicKey,i.signature,i.encodedData)}async function qr(i,t="SHA-256"){const e=await Qt.digest(t,Is(i));return Xa(e)}async function Hr(i,t="SHA-256"){const e=JSON.stringify(i);return qr(e,t)}class ll{instance;interceptors;requestCanceler;constructor(t){this.instance=il.create(t),this.interceptors=t?.interceptors,this.requestCanceler=new jr,this.instance.interceptors.request.use(e=>(this.requestCanceler.pendingRequest(e),e),e=>(this.requestCanceler.cancelRequest(e.config),e)),this.instance.interceptors.request.use(this.interceptors?.requestInterceptor,this.interceptors?.requestInterceptorCatch),this.instance.interceptors.response.use(this.interceptors?.responseInterceptor,this.interceptors?.responseInterceptorCatch),this.instance.interceptors.response.use(e=>new Promise((s,n)=>{this.requestCanceler.confirmRequest(e.config),e.status===200?s(e.data):n(e.data)}),async e=>{const{code:s="",config:n}=e;return!n||!n.retry||!n.retryStatus?.includes(s)||(n.retryCounted=n.retryCounted??0,n.retryCounted>=n.retry)?Promise.reject(e):(n.retryCounted++,await new Promise(r=>{setTimeout(()=>{r(void 0)},n.retryDelay)}),await this.request(n))})}request(t){return new Promise((e,s)=>{try{t.interceptors?.requestInterceptor&&(t=t.interceptors?.requestInterceptor(t)),this.instance.request(t).then(n=>{t.interceptors?.responseInterceptor&&(n=t.interceptors.responseInterceptor(n)),e(n)}).catch(n=>{t.interceptors?.responseInterceptorCatch&&(n=t.interceptors?.responseInterceptorCatch(n)),s(n)})}catch(n){t.interceptors?.requestInterceptorCatch&&t.interceptors.requestInterceptorCatch(n)}})}get(t,e){return this.request({...e,method:"get",url:t})}delete(t,e){return this.request({...e,method:"delete",url:t})}head(t,e){return this.request({...e,method:"head",url:t})}options(t,e){return this.request({...e,method:"options",url:t})}post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class jr{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async pendingRequest(t){const e=await this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const s=new AbortController;t.signal=s.signal,this.pendingRequestMap.set(e,s)}}async confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}async cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}async cancelAllRequest(){for(const t of this.pendingRequestMap.values())t.abort();this.pendingRequestMap.clear()}async getRequestId(t){const{url:e,method:s,params:n,data:r}=t;return await Hr({url:e,method:s,params:n,data:r})}}function ul(i,t,e,s,n){const r=t/e;let a=0,o=0;switch(i){case"aspectFit":r>=1?(a=s,o=a/r,o>n&&(o=n,a=o*r)):(o=n,a=o*r,a>s&&(a=s,o=a/r));break;case"aspectFill":r>=1?(o=n,a=o*r):(a=s,o=a/r);break;case"widthFix":a=s,o=a/r;break;case"heightFix":o=n,a=o*r;break;case"scaleToFill":default:a=s,o=n;break}return{width:a,height:o}}const Ds=new Map;async function dl(i){return new Promise((t,e)=>{_s(i,(s,n)=>s?e(s):t({width:n.width,height:n.height,aspectRatio:n.width/n.height}))})}const _s=(i,t)=>{if(Ds.has(i))return t(null,Ds.get(i));const e=new Image;e.onload=function(){Ds.set(i,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,Ds.get(i))},e.onerror=function(s){t(s,null)},e.src=i},fl=(i,t)=>{for(let e=0,s=i.length;e<s;e++){const n=i[e],{type:r}=n;if(r.split("/")[0]!=="image")continue;const a=new FileReader;a.onload=function(o){if(!o.target)return t("no reader target",null);const h=o.target.result,c=cn(h),l=new Blob([h]);Oi(l,(d,g)=>{if(!g)return t(d,null);_s(g,(y,p)=>{if(!p)return t(y,null);Wr(g,(x,b)=>{if(!b)return t(x,null);const S={name:n.name,fileType:c,size:n.size,width:p.width,height:p.height,imgUrl:g,imageData:b,blob:l};return t(null,S)})})})},a.readAsArrayBuffer(n)}},Wr=(i,t)=>{_s(i,(e,s)=>{if(!s)return t(e,null);const n=document.createElement("canvas"),r=n.getContext("2d");n.width=s.width,n.height=s.height,r.drawImage(s.element,0,0,n.width,n.height);const a=r.getImageData(0,0,n.width,n.height);return t(null,a)})},ml=(i,t=0,e=0)=>{const s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.drawImage(i,0,0,t,e),n.getImageData(0,0,t,e)},pl=(i,t=0,e=0)=>{const s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.drawImage(i,0,0,t,e),n.getImageData(0,0,t,e)},gl=i=>{const t=i.width,e=i.height,s=t*e*3,n=s+54,r=[66,77,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,s&255,s>>8&255,s>>16&255,s>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,h=i.data;let c="";const l=t<<2;let d=e;const g=String.fromCharCode;do{const p=l*(d-1);let x="";for(let b=0;b<t;b++){const S=b<<2;x+=g(h[p+S+2])+g(h[p+S+1])+g(h[p+S])}for(let b=0;b<o;b++)x+=String.fromCharCode(0);c+=x}while(--d);function y(p){if(!window.btoa)throw"btoa undefined";let x="";if(typeof p=="string")x=p;else for(let b=0;b<p.length;b++)x+=String.fromCharCode(p[b]);return btoa(x)}return y(r.concat(a))+y(c)},yl=i=>{const{width:t,height:e}=i,s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.putImageData(i,0,0,0,0,t,e),s.toDataURL("image/png")},wl=(i,t,e)=>{const{width:s,height:n}=i,r=document.createElement("canvas"),a=r.getContext("2d");r.width=s,r.height=n,a.putImageData(i,0,0,0,0,s,n);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)},Oi=(i,t)=>{const e=new FileReader;e.onload=function(s){s.target?t(null,s.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(i)},xl=(i,t)=>{Oi(i,function(e,s){if(s){const n=new Image;n.src=s}else t(e)})};function bl(i){const t=[],e=[],s=[];let n=0;for(let h=0,c=i.data.length;h<c;h+=4)t[n]=i.data[h],e[n]=i.data[h+1],s[n]=i.data[h+2],n+=1;const r=Ni(t),a=Ni(e),o=Ni(s);return"rgb("+r+","+a+","+o+")"}function Ni(i){const t={},e=[],s=[];for(let o=0;o<i.length;o++)t[i[o]]?e.push(i[o]):t[i[o]]=1;let n=0;for(let o=0;o<e.length;o++){n=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(n+=1),s[o]=n}const r=Math.max.apply(null,s);let a=0;for(;a<s.length;a++)if(s[a]===r)return;return e[a]}const vl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[(a*e+e-o-1)*4],n[h+1]=t[(a*e+e-o-1)*4+1],n[h+2]=t[(a*e+e-o-1)*4+2],n[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(n,e,s)},Sl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[((s-a-1)*e+o)*4],n[h+1]=t[((s-a-1)*e+o)*4+1],n[h+2]=t[((s-a-1)*e+o)*4+2],n[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(n,e,s)},Cl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;n[h]=t[(o*e+e-a-1)*4],n[h+1]=t[(o*e+e-a-1)*4+1],n[h+2]=t[(o*e+e-a-1)*4+2],n[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(n,s,e)},El=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;n[h]=t[((s-o-1)*e+a)*4],n[h+1]=t[((s-o-1)*e+a)*4+1],n[h+2]=t[((s-o-1)*e+a)*4+2],n[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(n,s,e)},Tl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3;n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Pl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Ml=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1]+t[h+2])/3>127?255:0;n[h]=l,n[h+1]=l,n[h+2]=l,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Al=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=255-t[h],n[h+1]=255-t[h+1],n[h+2]=255-t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},kl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Il=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Dl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=0,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},_l=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Ll=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Rl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Ol=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h+1]+t[h+2])/2;n[h]=t[h],n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Nl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+2])/2;n[h]=c,n[h+1]=t[h+1],n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Fl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1])/2;n[h]=c,n[h+1]=c,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Bl=i=>$r(i,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Xl=i=>$r(i,[-1,-1,-1,-1,8,-1,-1,-1,-1]),Yl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=t[h+2],n[h+3]=255}return new ImageData(n,e,s)},Ul=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)n[h]=255,n[h+1]=255,n[h+2]=255,n[h+3]=255;else{const c=Jr([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);n[h]=c[0],n[h+1]=c[1],n[h+2]=c[2],n[h+3]=c[3]}}return new ImageData(n,e,s)},Gl=(i,t,e,s,n,r=!1,a)=>{const{data:o,width:h,height:c}=i;let l=n,d=s,g=t,y=e;if(l<0?l=0:l>h&&(l=h),d<0?d=0:d>c&&(d=c),g<1?g=1:g>h&&(g=h),y<1?y=1:y>c&&(y=c),l+g>h&&(g=h-l),d+y>c&&(y=c-d),r){const p=new Uint8ClampedArray(o.length);for(let b=0;b<c;b++)for(let S=0;S<h;S++){const C=(b*h+S)*4;S>=l&&S<=l+g&&b>=d&&b<=d+y?(p[C]=o[C],p[C+1]=o[C+1],p[C+2]=o[C+2],p[C+3]=o[C+3]):(p[C]=255,p[C+1]=255,p[C+2]=255,p[C+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(p,h,c)}else{const p=new Uint8ClampedArray(g*y*4);for(let b=d;b<=d+y;b++)for(let S=l;S<=l+g;S++){const C=((b-d)*g+S-l)*4,L=(b*h+S)*4;p[C]=o[L],p[C+1]=o[L+1],p[C+2]=o[L+2],p[C+3]=o[L+3]}return new ImageData(p,g,y)}},Vl=(i,t,e,s)=>{const{data:n,width:r,height:a}=i;let o=t;o>Math.floor(r/2)&&(o=Math.floor(r/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const h=new Uint8ClampedArray(n.length);for(let l=0;l<a;l++)for(let d=0;d<r;d++){const g=(l*r+d)*4;let y=-1;d<o?l<o?y=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(l-(a-o),2))):d>r-o-1&&(l<o?y=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(y)>o?(h[g]=255,h[g+1]=255,h[g+2]=255,h[g+3]=s||e.toUpperCase()==="PNG"?0:255):(h[g]=n[g],h[g+1]=n[g+1],h[g+2]=n[g+2],h[g+3]=s||e.toUpperCase()==="PNG"?n[g+3]:255)}return new ImageData(h,r,a)},zl=(i,t,e,s,n,r=1e4)=>{const a=new Image;a.src=i;const o=document.createElement("canvas"),h=o.getContext("2d");return o.width=r,o.height=r,h.drawImage(a,0,0,t,e,0,0,s,n),h.getImageData(0,0,s,n)},ql=(i,t)=>{const{data:e,width:s,height:n}=i,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;r[c]=Math.max(Math.min(e[c]+t,255),0),r[c+1]=Math.max(Math.min(e[c+1]+t,255),0),r[c+2]=Math.max(Math.min(e[c+2]+t,255),0),r[c+3]=e[c+3]}return new ImageData(r,s,n)},Hl=(i,t,e=!1)=>{const{data:s,width:n,height:r}=i,a=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<n;c++){const l=(h*n+c)*4;s[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=s[l],a[l+1]=s[l+1],a[l+2]=s[l+2]);let d=s[l+3];e?d=Math.max(Math.min(Math.floor(255*t),255),0):d=Math.max(Math.min(Math.floor(d+255*t),255),0),a[l+3]=d}return new ImageData(a,n,r)},jl=(i,t,e,s)=>{const{data:n,width:r,height:a}=i,{data:o,width:h,height:c}=t;let l=e,d=s;e+c>a&&(l=a-c),s+h>r&&(d=r-h);const g=new Uint8ClampedArray(n.length);for(let p=0;p<a;p++)for(let x=0;x<r;x++){const b=(p*r+x)*4;if(x<d||x>d+h||p<=l||p>=l+c)g[b]=n[b],g[b+1]=n[b+1],g[b+2]=n[b+2],g[b+3]=n[b+3];else{const S=(p*r+x-((l+1)*r+(p-(l+1))*(r-h))+h-d-1)*4,C=[o[S],o[S+1],o[S+2],o[S+3]],L=[n[b],n[b+1],n[b+2],n[b+3]],R=Jr(C,L);g[b]=R[0],g[b+1]=R[1],g[b+2]=R[2],g[b+3]=R[3]}}return new ImageData(g,r,a)},Wl=(i,t,e,s,n,r=10)=>{const{data:a,width:o,height:h}=i;let c=n,l=s,d=t,g=e;c<0?c=0:c>o&&(c=o),l<0?l=0:l>h&&(l=h),d<1?d=1:d>o&&(d=o),g<1?g=1:g>h&&(g=h),c+d>o&&(d=o-c),l+g>h&&(g=h-l);const y=new Uint8ClampedArray(a.length);for(let x=0;x<h;x++)for(let b=0;b<o;b++){const S=(x*o+b)*4;if(b>=c&&b<=c+d&&x>=l&&x<=l+g){const C=Math.floor((b-c)/r),L=Math.floor((x-l)/r);let R=Math.floor(r*(C+1)-r/2+c),Y=Math.floor(r*(L+1)-r/2+l);R>o-1&&(R=o-1),Y>h-1&&(Y=h-1);const X=(Y*o+R)*4;y[S]=a[X],y[S+1]=a[X+1],y[S+2]=a[X+2],y[S+3]=a[X+3]}else y[S]=a[S],y[S+1]=a[S+1],y[S+2]=a[S+2],y[S+3]=a[S+3]}return new ImageData(y,o,h)},$l=(i,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:s,width:n,height:r}=i,{data:a}=t,o=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let d=0;d<r;d++)for(let g=0;g<n;g++){const y=(d*n+g)*4,p=a[y],x=a[y+1],b=a[y+2],S=a[y+3];p===h.r&&x===h.g&&b===h.b&&S===h.a&&c.a!==0?(o[y]=c.r,o[y+1]=c.g,o[y+2]=c.b,o[y+3]=c.a):(o[y]=s[y],o[y+1]=s[y+1],o[y+2]=s[y+2],o[y+3]=s[y+3])}return new ImageData(o,n,r)}return i},$r=(i,t)=>{const{data:e,width:s,height:n}=i,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;for(let l=0;l<3;l++){const d=c+l;h===0||h===s-1||o===0||o===n-1?r[d]=e[d]:r[d]=t[0]*e[d-s*4-4]+t[1]*e[d-s*4]+t[2]*e[d-s*4+4]+t[3]*e[d-4]+t[4]*e[d]+t[5]*e[d+4]+t[6]*e[d+s*4-4]+t[7]*e[d+s*4]+t[8]*e[d+s*4+4]}r[c+3]=e[c+3]}return new ImageData(r,s,n)},Jr=(i,t)=>{if(i&&i.length===4&&t&&t.length===4){const e=i[3],s=t[3];if(e===255||s===0)return i;if(e===0)return t;{const n=e/255,r=s/255,a=Math.max(Math.min(Math.floor(i[0]*n+t[0]*r*(1-n)),255),0),o=Math.max(Math.min(Math.floor(i[1]*n+t[1]*r*(1-n)),255),0),h=Math.max(Math.min(Math.floor(i[2]*n+t[2]*r*(1-n)),255),0),c=Math.max(Math.min(Math.floor((n+r*(1-n))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},Fi=function(){const i=[];return{writeByte(t){i.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let n=0;n<s;n++)this.writeByte(t[n+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return i},toString(){let t="[";for(let e=0,s=i.length;e<s;e++)e>0&&(t+=","),t+=i[e];return t+="]",t}}},Zr=function(){let i=0,t=0,e=0,s="";const n=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)},r=function(a){s+=String.fromCharCode(n(a&63))};return{writeByte(a){for(i=i<<8|a&255,t+=8,e+=1;t>=6;)r(i>>>t-6),t-=6},flush(){if(t>0&&(r(i<<6-t),i=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)s+="="}},toString(){return s}}},Kr=function(i,t,e){const s=new Array(i*i),n=function(o){const h=o;let c=0,l=0;return{write(d,g){if(d>>>g)throw new Error("length over");for(;c+g>=8;)h.writeByte(255&(d<<c|l)),g-=8-c,d>>>=8-c,l=0,c=0;l=d<<c|l,c=c+g},flush(){c>0&&h.writeByte(l)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let l=o+1;const d=a();for(let b=0;b<h;b++)d.add(String.fromCharCode(b));d.add(String.fromCharCode(h)),d.add(String.fromCharCode(c));const g=Fi(),y=n(g);y.write(h,l);let p=0,x=String.fromCharCode(s[p]);for(p+=1;p<s.length;){const b=String.fromCharCode(s[p]);p+=1,d.contains(x+b)?x=x+b:(y.write(d.indexOf(x),l),d.size()<4095&&(d.size()==1<<l&&(l+=1),d.add(x+b)),x=b)}return y.write(d.indexOf(x),l),y.write(c,l),y.flush(),g.toByteArray()},a=function(){const o={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);o[c]=h,h+=1},size(){return h},indexOf(c){return o[c]},contains(c){return typeof o[c]<"u"}}};return{setPixel(o,h,c){s[h*i+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(i),o.writeShort(i),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(ae("0x"+t[1]+t[2])),o.writeByte(ae("0x"+t[3]+t[4])),o.writeByte(ae("0x"+t[5]+t[6])),o.writeByte(ae("0x"+e[1]+e[2])),o.writeByte(ae("0x"+e[3]+e[4])),o.writeByte(ae("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(i),o.writeShort(i),o.writeByte(0);const h=2,c=r(h);o.writeByte(h);let l=0;for(;c.length-l>255;)o.writeByte(255),o.writeBytes(c,l,255),l+=255;o.writeByte(c.length-l),o.writeBytes(c,l,c.length-l),o.writeByte(0),o.writeString(";")}}},Qr=function(i,t,e,s){const n=Kr(i,t,e);for(let c=0;c<i;c++)for(let l=0;l<i;l++)n.setPixel(l,c,s(l,c));const r=Fi();n.write(r);const a=Zr(),o=r.toByteArray();for(let c=0,l=o.length;c<l;c++)a.writeByte(o[c]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},gt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ye={M:0,L:1,H:2,Q:3},te={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},J={glog:function(i){if(i<1)throw new Error("glog("+i+")");return J.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return J.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let i=0;i<8;i++)J.EXP_TABLE[i]=1<<i;for(let i=8;i<256;i++)J.EXP_TABLE[i]=J.EXP_TABLE[i-4]^J.EXP_TABLE[i-5]^J.EXP_TABLE[i-6]^J.EXP_TABLE[i-8];for(let i=0;i<255;i++)J.LOG_TABLE[J.EXP_TABLE[i]]=i;const G={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(i){let t=i<<10;for(;G.getBCHDigit(t)-G.getBCHDigit(G.G15)>=0;)t^=G.G15<<G.getBCHDigit(t)-G.getBCHDigit(G.G15);return(i<<10|t)^G.G15_MASK},getBCHTypeNumber:function(i){let t=i<<12;for(;G.getBCHDigit(t)-G.getBCHDigit(G.G18)>=0;)t^=G.G18<<G.getBCHDigit(t)-G.getBCHDigit(G.G18);return i<<12|t},getBCHDigit:function(i){let t=0;for(;i!=0;)t++,i>>>=1;return t},getPatternPosition:function(i){return G.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,t,e){switch(i){case te.PATTERN000:return(t+e)%2==0;case te.PATTERN001:return t%2==0;case te.PATTERN010:return e%3==0;case te.PATTERN011:return(t+e)%3==0;case te.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case te.PATTERN101:return t*e%2+t*e%3==0;case te.PATTERN110:return(t*e%2+t*e%3)%2==0;case te.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){let t=new be([1],0);for(let e=0;e<i;e++)t=t.multiply(new be([1,J.gexp(e)],0));return t},getLengthInBits:function(i,t){if(1<=t&&t<10)switch(i){case gt.MODE_NUMBER:return 10;case gt.MODE_ALPHA_NUM:return 9;case gt.MODE_8BIT_BYTE:return 8;case gt.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(t<27)switch(i){case gt.MODE_NUMBER:return 12;case gt.MODE_ALPHA_NUM:return 11;case gt.MODE_8BIT_BYTE:return 16;case gt.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(t<41)switch(i){case gt.MODE_NUMBER:return 14;case gt.MODE_ALPHA_NUM:return 13;case gt.MODE_8BIT_BYTE:return 16;case gt.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+t)},getLostPoint:function(i){const t=i.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=i.isDark(r,a);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let l=-1;l<=1;l++)a+l<0||t<=a+l||c==0&&l==0||h==i.isDark(r+c,a+l)&&o++;o>5&&(e+=3+o-5)}for(let r=0;r<t-1;r++)for(let a=0;a<t-1;a++){let o=0;i.isDark(r,a)&&o++,i.isDark(r+1,a)&&o++,i.isDark(r,a+1)&&o++,i.isDark(r+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)i.isDark(r,a)&&!i.isDark(r,a+1)&&i.isDark(r,a+2)&&i.isDark(r,a+3)&&i.isDark(r,a+4)&&!i.isDark(r,a+5)&&i.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)i.isDark(a,r)&&!i.isDark(a+1,r)&&i.isDark(a+2,r)&&i.isDark(a+3,r)&&i.isDark(a+4,r)&&!i.isDark(a+5,r)&&i.isDark(a+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)i.isDark(a,r)&&s++;const n=Math.abs(100*s/t/t-50)/5;return e+=n*10,e}};class be{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let s=0;for(;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+e);for(let n=0;n<t.length-s;n++)this.num[n]=t[n+s]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let s=0;s<this.getLength();s++)for(let n=0;n<t.getLength();n++)e[s+n]^=J.gexp(J.glog(this.get(s))+J.glog(t.get(n)));return new be(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=J.glog(this.get(0))-J.glog(t.get(0)),s=new Array(this.getLength());for(let n=0;n<this.getLength();n++)s[n]=this.get(n);for(let n=0;n<t.getLength();n++)s[n]^=J.gexp(J.glog(t.get(n))+e);return new be(s,0).mod(t)}}class Yt{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const s=Yt.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const n=s.length/3,r=[];for(let a=0;a<n;a++){const o=s[a*3+0],h=s[a*3+1],c=s[a*3+2];for(let l=0;l<o;l++)r.push(new Yt(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Ye.L:return Yt.RS_BLOCK_TABLE[(t-1)*4+0];case Ye.M:return Yt.RS_BLOCK_TABLE[(t-1)*4+1];case Ye.Q:return Yt.RS_BLOCK_TABLE[(t-1)*4+2];case Ye.H:return Yt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class ta{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let s=0;s<e;s++)this.putBit((t>>>e-s-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class Jl{mode;data;constructor(t){this.mode=gt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,s=this.data.length;e<s;e++)t.put(this.data.charCodeAt(e),8)}}class ee{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Ye[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Jl(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let t=1;for(t=1;t<40;t++){const e=Yt.getRSBlocks(t,this.errorCorrectLevel),s=new ta;let n=0;for(let r=0;r<e.length;r++)n+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];s.put(a.mode,4),s.put(a.getLength(),G.getLengthInBits(a.mode,t)),a.write(s)}if(s.getLengthInBits()<=n*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++)this.modules[s][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=ee.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(let n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=s&&s<=6&&(n==0||n==6)||0<=n&&n<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=n&&n<=4?this.modules[t+s][e+n]=!0:this.modules[t+s][e+n]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const n=G.getLostPoint(this);(s==0||t>n)&&(t=n,e=s)}return e}createMovieClip(t,e,s){const n=t.createEmptyMovieClip(e,s),r=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*r;for(let h=0;h<this.modules[a].length;h++){const c=h*r;this.modules[a][h]&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+r,o),n.lineTo(c+r,o+r),n.lineTo(c,o+r),n.endFill())}}return n}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=G.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let s=0;s<t.length;s++){const n=t[e],r=t[s];if(this.modules[n][r]==null)for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a==-2||a==2||o==-2||o==2||a==0&&o==0?this.modules[n+a][r+o]=!0:this.modules[n+a][r+o]=!1}}setupTypeNumber(t){const e=G.getBCHTypeNumber(this.typeNumber);for(let s=0;s<18;s++){const n=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=n}for(let s=0;s<18;s++){const n=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=n}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,n=G.getBCHTypeInfo(s);for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<6?this.modules[r][8]=a:r<8?this.modules[r+1][8]=a:this.modules[this.moduleCount-15+r][8]=a}for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=a:r<9?this.modules[8][15-r-1+1]=a:this.modules[8][15-r-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let s=-1,n=this.moduleCount-1,r=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let h=0;h<2;h++)if(this.modules[n][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),G.getMask(e,n,o-h)&&(c=!c),this.modules[n][o-h]=c,r--,r==-1&&(a++,r=7)}if(n+=s,n<0||this.moduleCount<=n){n-=s,s=-s;break}}}static createData(t,e,s){const n=Yt.getRSBlocks(t,e),r=new ta;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),G.getLengthInBits(h.mode,t)),h.write(r)}let a=0;for(let o=0;o<n.length;o++)a+=n[o].dataCount;if(r.getLengthInBits()>a*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+a*8+")");for(r.getLengthInBits()+4<=a*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=a*8||(r.put(ee.PAD0,8),r.getLengthInBits()>=a*8));)r.put(ee.PAD1,8);return ee.createBytes(r,n)}static createBytes(t,e){let s=0,n=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let d=0;d<e.length;d++){const g=e[d].dataCount,y=e[d].totalCount-g;n=Math.max(n,g),r=Math.max(r,y),a[d]=new Array(g);for(let S=0;S<a[d].length;S++)a[d][S]=255&t.buffer[S+s];s+=g;const p=G.getErrorCorrectPolynomial(y),b=new be(a[d],p.getLength()-1).mod(p);o[d]=new Array(p.getLength()-1);for(let S=0;S<o[d].length;S++){const C=S+b.getLength()-o[d].length;o[d][S]=C>=0?b.get(C):0}}let h=0;for(let d=0;d<e.length;d++)h+=e[d].totalCount;const c=new Array(h);let l=0;for(let d=0;d<n;d++)for(let g=0;g<e.length;g++)d<a[g].length&&(c[l++]=a[g][d]);for(let d=0;d<r;d++)for(let g=0;g<e.length;g++)d<o[g].length&&(c[l++]=o[g][d]);return c}}const ea=Math.ceil,Ue=Math.floor,sa=Math.round;function Zl(i,t){const e=hn(i),s=t?.ecc||"H",n=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new ee(r,s);c.addData(e),c.make();const l=c.getModuleCount(),d=(n-a*2)/l,g=a,y=n-a;return Qr(n,o,h,function(p,x){if(g<=p&&p<y&&g<=x&&x<y){const b=Ue((p-g)/d),S=Ue((x-g)/d);return c.isDark(S,b)?0:1}else return 1})}function Kl(i,t){const e=t.x||0,s=t.y||0,n=hn(i),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Ue(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",d=t.background||"#ffffff",g=new ee(c,a);g.addData(n),g.make();const y=g.getModuleCount(),p=(o-h*2)/y;r.fillStyle=d,r.fillRect(e,s,o,o);for(let x=0;x<y;x++)for(let b=0;b<y;b++){const S=ea((b+1)*p)-Ue(b*p),C=ea((x+1)*p)-Ue(x*p);r.fillStyle=g.isDark(x,b)?l:d,r.fillRect(e+sa(b*p)+h,s+sa(x*p)+h,S,C)}}class st extends U{shapesCountChange=!1;constructor(t){super(t)}shapeInit(){}frameStart(t){return this.shapesCountChange&&(this.shapesCountChange=!1,this.shapes.forEach(e=>{e.parent=this,e.initPathD()}),this.pathd=this.initPathD(),this.shapes.forEach(e=>{!e.forceCXY&&!e.independentTransformInGroup&&(e.cX=this.cX-e.diffXInGroup,e.cY=this.cY-e.diffYInGroup)})),super.frameStart(t)}frameUpdate(t,e){this.shapes.forEach(s=>{!s.independentTransformInGroup&&!s.isDragging&&(s.x=this.x+s.diffXInGroup,s.y=this.y+s.diffYInGroup,s.degree=this.degree+s.diffDegreeInGroup,s.scalarX=this.scalarX*s.diffScalarXInGroup,s.scalarY=this.scalarY*s.diffScalarYInGroup)}),super.frameUpdate(t,e)}addShape(t){(Array.isArray(t)?t:[t]).forEach(e=>{this.shapes.findIndex(s=>s.id==e.id)==-1&&(e.on("draging",(s,n)=>{this.enableDrag&&(this.x+=s,this.y+=n,this.emit("draging",s,n,e))}),this.shapes.push(e),this.shapesCountChange=!0)})}getBoundingClientRect(){const t=[],e=[];this.shapes.forEach(h=>{const c=h.getBoundingClientRect();c&&(t.push(c.x,c.x+c.width),e.push(c.y,c.y+c.height))});const s=this.pathd?.getBoundingClientRect();if(s&&(s.width||s.height)&&(t.push(s.x,s.x+s.width),e.push(s.y,s.y+s.height)),t.length==0||e.length==0)return null;const n=Math.min.apply(0,t),r=Math.min.apply(0,e),a=Math.max.apply(0,t),o=Math.max.apply(0,e);return{x:n,y:r,width:a-n,height:o-r}}setAttrs(t,e){typeof t!="string"?(super.setAttr(t),this.shapes.forEach(s=>{s.setAttr(t)})):e&&(super.setAttr(t,e),this.shapes.forEach(s=>{s.setAttr(t,e)}))}sortPathD(){this.shapes=this.shapes.map(t=>{const e=t.initPathD();return{shape:t,perimeter:e.perimeterPoints()}}).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendFill(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.expendFill(this);for(let n=s;n<e;n++){const a=t.shapes[n].initPathD().polymorphPoints,o=a[0],h=a[1],c=[["M",o,h]];for(let l=2;l+5<a.length;l+=6)c.push(["C",o,h,o,h,o,h]);this.addShape(new U({attrs:{...t.shapes[n].getAttrs()},d:c}))}}strokeDashTween(t,e){switch(e?.type){case"sequence":const s=this.shapes.length-1;this.shapes.forEach((o,h)=>{o.strokeDashTween(t,{...e,delay:h,onStart:()=>{h==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{h==s&&e?.onGroupComplete?.()}})});break;case"parallel":default:const n=new ys({frameDuration:t}),r={},a={};this.shapes.forEach((o,h)=>{const c=Et(o.getTotalLength(),0);r[`offset_${h}`]=c,a[`offset_${h}`]=0,o.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),n.addTween(r,a,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,h)=>{for(let c in o){const l=js(c).number;this.shapes[l].setAttr("strokeDashoffset",""+Et(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),n.play();break}}}class ce extends U{toX;toY;constructor(t){super(t),this.toX=t?.toX||0,this.toY=t?.toY||0;let e=this.toX-this.x,s=this.toY-this.y;return new Proxy(this,{set(n,r,a,o){switch(r){case"x":n.toX=a+e;break;case"y":n.toY=a+s;break;case"toX":e=a-n.x;break;case"toY":s=a-n.y;break}return Reflect.set(n,r,a,o)}})}toSVGPathData(){return[["m",0,0],["l",this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.lineTo(this.toX-this.x,this.toY-this.y)}intersection(t){const e=new Rn({x:this.x,y:this.y,toX:this.toX,toY:this.toY}),s=new Rn({x:t.x,y:t.y,toX:t.toX,toY:t.toY});return e.intersection(s)}}class Ql extends U{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["m",0,0],["q",t-this.x,e-this.y,this.toX-this.x,this.toY-this.y]]}else return[["m",0,0],["q",this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e-this.x,s-this.y,this.toX-this.x,this.toY-this.y)}else t.quadraticCurveTo(this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y)}}class ia extends tr{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,s)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,s)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const s=eo(e);for(let n of s.stylesheet.rules)for(let r of n.declarations)for(let a of n.selectors)this.globalStyles[a]=this.globalStyles[a]||[],this.globalStyles[a].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,s)=>{let n=this.groups.length;for(;n--;)if(this.groups[n]!=this.currentItem){let r="",a="";for(let o in this.groups[n])o=="transform"?r=this.groups[n].transform:o=="class"&&this.globalStyles["."+this.groups[n][o]]?a=this.globalStyles["."+this.groups[n][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[n][o]]?a=this.globalStyles["#"+this.groups[n][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[n][o]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=a:this.currentItem.style=a+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),Xi(this.currentItem.style,this.currentItem,Yi)}switch(this.processAttrs(e,s),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let s=[],n;switch(t){case"svg":let r="",a="";if(e.width&&e.height)r=e.width,a=e.height;else if(e.viewBox){const o=e.viewBox.split(/\s+/gi);o.length==4&&(r=String(parseFloat(o[2])-parseFloat(o[0])),a=String(parseFloat(o[3])-parseFloat(o[1])))}r&&a&&this.items.push({type:"viewbox",width:r,height:a});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":n={},e.style&&Xi(e.style,n),n.offset=n.offset||e.offset,n.color=n["stop-color"]||e["stop-color"],n.opacity=n["stop-opacity"]||e["stop-opacity"],~(n.offset+"").indexOf("%")?n.offset=parseFloat(n.offset):n.offset=parseFloat(n.offset)*100,n.offset=+n.offset.toFixed(2),this.grad.stops.push(n);break;case"linearGradient":this.grad.angle=(360+Bi(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?s.push(n.color+":"+n.offset):s.push(n.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?s.push(n.color+":"+n.offset):s.push(n.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break}for(let r in e){const a=e[r];if(Yi.includes(r)&&(this.currentItem[r]=a),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&Xi(a,this.currentItem,Yi),r==="transform"&&(this.currentItem.transform=a+(this.currentItem.transform||" ")),r==="fill"){const o=a.match(/url\(#([^)]+)\)/);if(o){const h=o[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+a+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=a),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=a)}}addToItems(){this.items.push(this.currentItem)}}function Bi(i,t,e,s,n,r){if(typeof n>"u"||typeof r>"u"){const a=i-e,o=t-s;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return Bi(i,t,n,r)-Bi(e,s,n,r)}function Xi(i,t,e){const s=(i+"").split(";"),n=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){let o=s[r].split(":"),h=o[0].replace(n,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(n,""))}}const Yi=["id","class","viewBox","width","height","x","y","cx","cy","r","rx","ry","cursor","opacity","src","fill","fill-opacity","stroke","stroke-dasharray","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","font","font-family","font-size","font-style","font-weight","letter-spacing"];class tu{app;rootEl;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e,s){this.app=t,this.rootEl=mt.createSVGElement("svg"),k.empty(this.app.container),k.insert(this.app.container,this.rootEl),e&&s?this.setSize(e,s):(this.setSize(this.app.width,this.app.height),this.app.on("resize",()=>{this.setSize(this.app.width,this.app.height)})),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(n,r)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=r.dx,this.dragDy+=r.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let n of this.shapes)if(this.currentMouseInShape==n){n.emit("clicked");let r=n.parent;for(;r;)r.emit("clicked",n),r=r.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}setSize(t,e){return k.attribute(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return mt.downloadFromSVGElement(this.rootEl)}_addDrawShape(t){this.shapes.findIndex(e=>e.id==t.id)===-1&&(this.shapes.push(t),t instanceof st&&t.shapes.forEach(e=>{this._addDrawShape(e)}))}path(t){(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow){e.el&&(k.remove(e.el),delete e.el);continue}if(e.frameStart(this.app.mousePoint),e.el||(e instanceof Ge?e.el=this.text(e.text,e.x,e.y,mn(e.getAttrs(),(n,r)=>typeof r=="string")):(e.el=mt.createSvgPath(e.toSVGPathD(),e.id),k.insert(this.rootEl,e.el))),e.followMouse&&(!es(e.x,this.app.mousePoint.x,5)||!es(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const n=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,n||r){if(e.x+=n,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",n,r)}}else e.isDragging=!1;e instanceof Ge&&(e.setAttr("x",String(e.x)),e.setAttr("y",String(e.y))),e.frameUpdate(this.app.mousePoint);const s=e.toSVGPathD();if(this.attr(e,mn(e.getAttrs(),(n,r)=>typeof r=="string")),this.attr(e,"d",s),!this.currentMouseInShape){const n=e.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||e.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||!1;e.isMouseIn=n,n&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint)}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}delete(t){(Array.isArray(t)?t:[t]).forEach(e=>{e.el&&k.remove(e.el),delete e.el,this.shapes=this.shapes.filter(s=>s.id!==e.id)})}clear(){this.shapes.forEach(t=>{t.el&&k.remove(t.el),delete t.el}),k.empty(this.rootEl),this.shapes=[]}attr(t,e,s){const n=t.el||t;return n instanceof SVGElement?e===void 0&&s===void 0?k.attribute(n):typeof e=="string"&&s===void 0?k.attribute(n,ct(e))||"":(typeof e=="object"?k.attribute(n,e):typeof e=="string"&&s!==void 0&&k.attribute(n,ct(e),s),this):this}circle(t,e,s){return this.path(new Ut({x:t,y:e,radius:s}))}circleEl(t,e,s){const n=mt.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(s)});return k.insert(this.rootEl,n),n}ellipse(t,e,s,n){return this.path(new ra({x:t,y:e,rx:s,ry:n}))}ellipseEl(t,e,s,n){const r=mt.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(s),ry:String(n)});return k.insert(this.rootEl,r),r}rect(t,e,s,n){return this.path(new Gt({x:t,y:e,width:s,height:n}))}rectEl(t,e,s,n){const r=mt.createSVGElement("rect",{x:String(t),y:String(e),width:String(s),height:String(n)});return k.insert(this.rootEl,r),r}image(t,e,s,n,r){}text(t,e,s,n){const r=mt.createSVGElement("text",{x:String(e),y:String(s)});return k.html(r,t),this.attr(r,Object.assign({"alignment-baseline":"middle"},n)),k.insert(this.rootEl,r),r}textWithTspan(t,e,s,n){const r=n?.["line-height"]||"1.2em",a=mt.createSVGElement("text",{x:String(e),y:String(s)});return t.split(`
|
|
41
|
-
`).forEach((o,h)=>{if(o.trim()){const c=mt.createSVGElement("tspan",{x:String(e),dy:h>0?r:"0"});k.html(c,o),k.insert(a,c),this.attr(c,Object.assign({"alignment-baseline":"middle"},n))}}),k.insert(this.rootEl,a),a}}class eu extends st{svgWidth=0;svgHeight=0;width=0;height=0;constructor(t){super(t);const e=new ia(t.svg).parse();for(let s=0,n=e.length;s<n;s++){const r=e[s];if(r.type=="viewbox"&&r.width&&r.height){if(this.svgWidth=parseFloat(r.width),this.svgHeight=parseFloat(r.height),t.width){const l=this.svgWidth/this.svgHeight;this.width=t.width,this.height=this.width/l}else this.width=this.svgWidth,this.height=this.svgHeight;continue}if(r.type!="path"||!oe.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=oe.absolutizeSVGPath(oe.parseSVGPath(r.path)),h=[];let c=[];for(let l=0,d=o.length;l<d;l++){const g=o[l];c.push(g),g[0].toLowerCase()=="z"&&(h.push(c),c=[])}c.length&&h.push(c),h.forEach(l=>{const d=fi(r.transform??"");d.scale(this.width&&this.svgWidth?this.width/this.svgWidth:1),this.addShape(new U({...t,attrs:{...a,...t?.attrs||{}},d:l,originMatrix:d}))})}}shapeInit(){this.trim()}}class Ut extends U{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return{x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2}}toSVGPathData(){return this.radius?[["m",0,-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["m",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius&&this.mass===t.mass}midPointBtw(t){return{x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2}}length(){return os(this.x,this.y)}scalar(t){return this.x*=t,this.y*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y;return{x:s*t.x-e*t.y,y:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y}}div(t){return{x:this.x/t.x,y:this.y/t.y}}add(t){return{x:this.x+t.x,y:this.y+t.y}}sub(t){return{x:this.x-t.x,y:this.y-t.y}}dot(t){return this.x*t.x+this.y*t.y}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y}}checkCollision(t){const e=t.x-this.x,s=t.y-this.y;if(Math.sqrt(e*e+s*s)<this.radius+t.radius){const r=Math.atan2(s,e),a={x:0,y:0},o=Tt(-r,e,s),h=Tt(-r,this.vx,this.vy),c=Tt(-r,t.vx,t.vy),l=h.x-c.x;h.x=((this.mass-t.mass)*h.x+2*t.mass*c.x)/(this.mass+t.mass),c.x=l+h.x;const d=Math.abs(h.x)+Math.abs(c.x),g=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/d*g,o.x+=c.x/d*g;const y=Tt(r,a.x,a.y),p=Tt(r,o.x,o.y);t.x=this.x+p.x,t.y=this.y+p.y,this.x=this.x+y.x,this.y=this.y+y.y;const x=Tt(r,h.x,h.y),b=Tt(r,c.x,c.y);this.vx=x.x,this.vy=x.y,t.vx=b.x,t.vy=b.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,s=t.wall.x,n=t.wall.y,r=t.wall.x+t.wall.width,a=t.wall.y+t.wall.height;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=e):this.x-this.radius<s&&(this.x=s+this.radius,this.vx*=e),this.y+this.radius>a?(this.y=a-this.radius,this.vy*=e):this.y-this.radius<n&&(this.y=n+this.radius,this.vy*=e)}}class na extends U{points;isStraight;constructor(t){if(super(t),this.points=t.points,this.points.length<3)throw new Error("points length must >= 3");this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0}toSVGPathData(){const t=[],e=this.points.length;if(this.isStraight){t.push(["M",this.points[0].x,this.points[0].y]);for(let s=1;s<=e-1;s++)t.push(["L",this.points[s].x,this.points[s].y]);t.push(["Z"])}else{const s=(this.points[0].x+this.points[e-1].x)/2,n=(this.points[0].y+this.points[e-1].y)/2;t.push(["M",s,n]);for(let r=0;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.push(["Q",this.points[r].x,this.points[r].y,a,o])}t.push(["Q",this.points[e-1].x,this.points[e-1].y,s,n])}return t}toCanvasContext(t){t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let s=1;s<=e-1;s++)t.lineTo(this.points[s].x,this.points[s].y);t.closePath()}else{const s=(this.points[0].x+this.points[e-1].x)/2,n=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(s,n);for(let r=0;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.quadraticCurveTo(this.points[r].x,this.points[r].y,a,o)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,s,n)}}isContainPoint(t,e){const s=this.points.length;let n=!1;const r=2e-10;for(let a=0,o=s-1;a<s;o=a,a++){const h=this.points[a].x,c=this.points[a].y,l=this.points[o].x,d=this.points[o].y;if(h===t&&c===e||l===t&&d===e||e===c&&e===d)return!0;if(e>=c&&e<d||e<c&&e>=d){const g=(l-h)/(d-c),y=h+g*(e-c);if(y===t||Math.abs(y-t)<r)return!0;y>t&&(n=!n)}}return n}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}}class Gt extends U{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromCubicBezier(t,e,s,n,r,a,o,h){const c=new lt({x:t,y:e,c1x:s,c1y:n,c2x:r,c2y:a,toX:o,toY:h});return new Gt(c.getBoundingClientRect())}getBoundingClientRect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toSVGPathData(){return this.borderRadius?[["m",this.borderRadius,0],["l",this.width-this.borderRadius*2,0],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,this.borderRadius],["l",0,this.height-this.borderRadius*2],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,this.borderRadius],["l",this.borderRadius*2-this.width,0],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,-this.borderRadius],["l",0,this.borderRadius*2-this.height],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,-this.borderRadius],["z"]]:[["m",0,0],["l",this.width,0],["l",0,this.height],["l",-this.width,0],["z"]]}toCanvasContext(t){t.beginPath(),this.borderRadius<=0?t.rect(0,0,this.width,this.height):(t.moveTo(0,this.borderRadius),t.lineTo(0,this.height-this.borderRadius),t.quadraticCurveTo(0,this.height,this.borderRadius,this.height),t.lineTo(this.width-this.borderRadius,this.height),t.quadraticCurveTo(this.width,this.height,this.width,this.height-this.borderRadius),t.lineTo(this.width,this.borderRadius),t.quadraticCurveTo(this.width,0,this.width-this.borderRadius,0),t.lineTo(this.borderRadius,0),t.quadraticCurveTo(0,0,0,this.borderRadius)),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height&&this.borderRadius===t.borderRadius}isIntersectRect(t){return!(this.x+this.width<t.x||t.x+t.width<this.x||this.y+this.height<t.y||t.y+t.height<this.y)}isContainPoint(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}}class ra extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return{x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2}}toSVGPathData(){return[["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class su extends U{constructor(t){super(t)}toSVGPathData(){return[["m",-50,-25],["l",50,0],["l",0,-25],["l",50,50],["l",-50,50],["l",0,-25],["l",-50,0],["l",0,-50],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(-50,-25),t.lineTo(0,-25),t.lineTo(0,-50),t.lineTo(50,0),t.lineTo(0,50),t.lineTo(0,25),t.lineTo(-50,25),t.lineTo(-50,-25),t.closePath()}}class iu extends U{constructor(t){super(t)}toSVGPathData(){return[["m",4,24],["l",4,-8],["l",6,-6],["l",1,-10],["l",-6,-10],["l",-7,10],["l",-4,0],["l",-7,-10],["l",-6,10],["l",1,10],["l",6,6],["l",4,8],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(4,24),t.lineTo(8,16),t.lineTo(14,10),t.lineTo(15,0),t.lineTo(9,-10),t.lineTo(2,0),t.lineTo(-2,0),t.lineTo(-9,-10),t.lineTo(-15,0),t.lineTo(-14,10),t.lineTo(-8,16),t.lineTo(-4,24),t.closePath()}}class nu extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx||10,this.ry=t?.ry||10}toSVGPathData(){return[["m",0,0],["l",this.rx*2.4,-this.ry*3.14],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,-this.ry*1.5],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,this.ry*1.5],["l",this.rx*2.4,this.ry*3.14],["z"]]}}class ru extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx??50,this.ry=t?.ry??50}toSVGPathData(){return[["m",0,0+this.ry*.3],["C",0,0,0-this.rx/2,0,0-this.rx/2,0+this.ry*.3],["C",0-this.rx/2,0+(this.ry+this.ry*.3)/2,0,0+(this.ry+this.ry*.3)/1.4,0,0+this.ry],["C",0,0+(this.ry+this.ry*.3)/1.8,0+this.rx/2,0+(this.ry+this.ry*.3)/2,0+this.rx/2,0+this.ry*.3],["C",0+this.rx/2,0,0,0,0,0+this.ry*.3],["z"]]}}class au extends U{r;constructor(t){super(t),this.r=t?.r||20}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const s=288+e*144,n=this.r*Math.cos(O(s)),r=this.r*Math.sin(O(s));t.push(["l",n,r])}return t}}class ou extends U{constructor(t){super(t)}toSVGPathData(){return[["M",0,0],["C",15,0,15,-40,5,-30],["L",0,0],["C",-15,0,-15,-40,-5,-30],["L",0,0],["a",15,15,0,1,1,0,2*15],["a",15,15,0,1,1,0,-2*15]]}}class hu extends U{constructor(t){super(t),this.originD="m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z"}}class cu extends st{constructor(t){super(t);const e=new ce({...t,x:this.x,y:this.y,toX:this.x,toY:this.y-140-Math.random()*20}),s=30+Math.random()*30,n=new ce({...t,x:this.x,y:this.y-s,diffYInGroup:-s,toX:this.x+Math.random()*80-40,toY:this.y-100-Math.random()*40}),r=60+Math.random()*40,a=new ce({...t,x:this.x,y:this.y-r,diffYInGroup:-r,toX:this.x+Math.random()*60-30,toY:this.y-110-Math.random()*20});this.addShape([e,n,a])}}class Ge extends U{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.getAttrs()});const e=js(this.getAttr("fontSize"),10).number,s=js(this.getAttr("fontWeight"),400).number,n=k.measureText(this.text,e,s);this.width=n.width,this.height=n.height}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class aa extends st{text;bg;padding;offset;isShow;textShape;bgShape;constructor(t){super(t),this.text=t.text,this.bg=t.bg||"rgba(0,0,0,0.5)",this.padding=t.padding||4,this.offset=t.offset||20,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!1,this.textShape=new Ge({...t,x:this.x+this.offset,y:this.y+this.offset,text:this.text,attrs:{...this.getAttrs(),fill:ir(this.bg,!0),textAnchor:"start"}}),this.bgShape=new Gt({...t,x:this.textShape.x-this.padding,y:this.textShape.y-this.textShape.height/2-this.padding,width:this.textShape.width+this.padding*2,height:this.textShape.height+this.padding*2,attrs:{...this.getAttrs(),fill:this.bg}}),this.addShape([this.bgShape,this.textShape])}shapeInit(){Hs(()=>{this.textShape.x=this.x+this.offset,this.textShape.y=this.y+this.offset,this.textShape.text=this.text,this.textShape.isShow=this.isShow,this.bgShape.x=this.textShape.x-this.padding,this.bgShape.y=this.textShape.y-this.textShape.height/2-this.padding,this.bgShape.width=this.textShape.width+this.padding*2,this.bgShape.height=this.textShape.height+this.padding*2,this.bgShape.isShow=this.isShow})}}class lu extends st{radius;expandRaidus;startDegree;endDegree;text="";defaultShowText;tip="";p1=new Ut;p1Offset=10;p2=new Ut;p2Offset=40;p3=new Ut;p3Offset=10;p4=new Ut;p4Offset=10;direction=1;sectorArc;line12;line23;textShape;tipShape;constructor(t){super(t),this.radius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!!this.text,this.tip=t.tip||"",this.sectorArc=new oa({x:this.x,y:this.y,radius:this.radius,expandRaidus:this.expandRaidus,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.getAttrs()},{strokeWidth:"0"})}),this.addShape(this.sectorArc);const e=Object.assign({...this.getAttrs()},{fill:"none"});this.line12=new ce({x:this.p1.x,y:this.p1.y,toX:this.p2.x,toY:this.p2.y,attrs:{...e},isShow:this.defaultShowText}),this.line23=new ce({x:this.p2.x,y:this.p2.y,toX:this.p3.x,toY:this.p3.y,attrs:{...e},isShow:this.defaultShowText}),this.textShape=new Ge({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{stroke:e.stroke,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText}),this.text&&(this.addShape(this.line12),this.addShape(this.line23),this.addShape(this.textShape)),this.tipShape=new aa({x:0,y:0,text:this.tip,isShow:!1}),this.tip&&this.addShape(this.tipShape)}frameUpdate(t){this.text&&!this.defaultShowText&&(this.line12.isShow=this.sectorArc.isMouseIn,this.line23.isShow=this.sectorArc.isMouseIn,this.textShape.isShow=this.sectorArc.isMouseIn);const e=this.startDegree+(this.endDegree-this.startDegree)/2,{dx:s,dy:n}=At(O(e),this.sectorArc.radius+this.p1Offset);this.p1.x=this.x+s,this.p1.y=this.y+n;const{dx:r,dy:a}=At(O(e),this.sectorArc.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+r,this.p2.y=this.y+a,this.line12.x=this.p1.x,this.line12.y=this.p1.y,this.line12.toX=this.p2.x,this.line12.toY=this.p2.y,this.direction=this.p1.x>this.x?1:-1,this.p3.x=this.p2.x+this.direction*this.p3Offset,this.p3.y=this.p2.y,this.p4.x=this.p3.x+this.direction*this.p4Offset,this.p4.y=this.p3.y,this.line23.x=this.p2.x,this.line23.y=this.p2.y,this.line23.toX=this.p3.x,this.line23.toY=this.p3.y,this.textShape.x=this.p4.x,this.textShape.y=this.p4.y,this.textShape.setAttr("textAnchor",this.direction==1?"start":"end"),this.sectorArc.isMouseIn?(this.tipShape.isShow=!0,this.tipShape.x=t.x,this.tipShape.y=t.y):(this.tipShape.isShow=!1,this.tipShape.x=t.x,this.tipShape.y=t.y)}}class oa extends U{radius;realRadius;expandRaidus;startDegree;endDegree;vr;ar;bounce;durationTime;status;constructor(t){super(t),this.radius=0,this.realRadius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.vr=0,this.ar=.03,this.bounce=.6,this.durationTime=1e3/120,this.status=0}frameUpdate(){this.status==0&&this.radius<this.realRadius?(this.expand(this.realRadius),this.radius>=this.realRadius&&(this.status=1)):this.isMouseIn?this.expand(this.realRadius+this.expandRaidus):this.shrink(this.realRadius)}expand(t){this.vr+=this.ar,this.radius+=this.vr*this.durationTime,this.radius>t&&(this.radius=t,this.vr*=-this.bounce)}shrink(t){this.vr-=this.ar,this.radius+=this.vr*this.durationTime,this.radius<t&&(this.radius=t,this.vr*=-this.bounce)}toSVGPathData(){const{dx:t,dy:e}=At(O(this.startDegree),this.radius),{dx:s,dy:n}=At(O(this.endDegree),this.radius);return[["m",0,0],["l",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,n-e],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,O(this.startDegree),O(this.endDegree),!1),t.closePath()}containPoint(t,e){const s=hs(this.x,this.y,t,e),n=tt($t(this.x,this.y,t,e));return s<=this.radius&&n>=this.startDegree&&n<=this.endDegree}}class uu extends st{showFlame;ship;flame;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t.showFlame:!1,this.ship=new U({...t,d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]}),this.addShape(this.ship),this.flame=new U({...t,isShow:this.showFlame,d:[["m",-10,-5],["l",-7.5,5],["l",7.5,5],["z"]]}),this.addShape(this.flame)}shapeInit(){Hs(()=>{this.ship.x=this.x,this.ship.y=this.y,this.flame.x=this.x,this.flame.y=this.y,this.flame.isShow=this.showFlame})}}class du extends st{value;backgroundRect;occupyRect;handle;constructor(t){super(t);const e=t?.min||0,s=t?.max||100,n=t?.step||1,r=$a(e,s,n);this.value=r(typeof t?.defaultValue=="number"?yt(t.defaultValue,e,s):e);const a=this.value/(s-e),o=t?.barWidth||100,h=t?.barHeight||4,c=t?.handleRadius||10,l=h*.5,d=t?.barColor||gi.colorGrayF5,g=t?.handleColor||gi.colorPrimary;this.backgroundRect=new Gt({x:this.x,y:this.y,width:o,height:h,borderRadius:l,attrs:{fill:d},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.backgroundRect),this.occupyRect=new Gt({x:this.x,y:this.y,width:o*a,height:h,borderRadius:l,attrs:{fill:g},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.occupyRect),this.handle=new Ut({x:this.x+o*a,y:this.y+l,diffXInGroup:o*a,diffYInGroup:l,radius:c,alongPath:new Go({x:this.x,y:this.y+l,d:[["m",0,0],["l",o,0]]}),attrs:{fill:g},enableDrag:!0,independentTransformInGroup:!0}),this.addShape(this.handle),this.handle.on("draging",y=>{this.occupyRect.width=yt(this.occupyRect.width+y,0,o),this.value=r((this.handle.x-this.x)/o*(s-e)+e),this.emit("change",this.value)})}}class fu extends st{width;height;cornerRadius;controlPoint;mainRect;rightPoint;constructor(t){super(t),this.width=t.width,this.height=t.height,this.cornerRadius=this.height/2,this.controlPoint=new Ut({...t,x:this.x,y:this.y,radius:2}),this.forceSetCXY(this.controlPoint.cX,this.controlPoint.cY),this.mainRect=new Gt({...t,x:this.x-this.cornerRadius,y:this.y-this.cornerRadius,diffXInGroup:-this.cornerRadius,diffYInGroup:-this.cornerRadius,width:this.width+this.cornerRadius*2,height:this.height,borderRadius:this.cornerRadius}),this.rightPoint=new Ut({...t,x:this.x+this.width,y:this.y,diffXInGroup:this.width,radius:2}),this.addShape([this.mainRect,this.controlPoint,this.rightPoint])}getPin(){return{x:this.controlPoint.x+Math.cos(O(this.controlPoint.degree))*this.width,y:this.controlPoint.y+Math.sin(O(this.controlPoint.degree))*this.width}}}class Ui extends U{extendDegree;radius;startDegree;endDegree;diffDegree;constructor(t){super(t),this.extendDegree=t?.extendDegree||0,this.x=(t.x||0)+t.width/2;const e=Math.min(t.width/2,t.height)-t.lineWidth;this.radius=e-e*Math.abs(Math.sin(O(this.extendDegree))),this.y=(t.y||0)+t.height-t.lineWidth-this.radius*Math.abs(Math.sin(O(this.extendDegree))),this.diffDegree=t.endDegree-t.startDegree,this.startDegree=180+t.startDegree-this.extendDegree,this.endDegree=180+t.endDegree+this.extendDegree,this.setAttr({"stroke-linecap":"round","stroke-width":String(t.lineWidth),stroke:t.color||"none"})}setPercent(t){this.endDegree=this.startDegree+(this.diffDegree+this.extendDegree*2)*t}toSVGPathData(){const{dx:t,dy:e}=At(O(this.startDegree),this.radius),{dx:s,dy:n}=At(O(this.endDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,n-e]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,O(this.startDegree),O(this.endDegree),!1)}}class mu extends st{percent=0;ringBg;ring;lines=[];bgColor;startColor;endColor;indicatorLineCount;constructor(t){super(t);const e=t?.startDegree||0,s=t?.endDegree||180,n=t?.extendDegree||15,r=t?.lineWidth||12;this.bgColor=t?.bgColor||"#B3C6E7",this.startColor=t?.startColor||"#5A82F0",this.endColor=t?.endColor||"#66B3FF",this.percent=t?.percent||0,this.indicatorLineCount=22+1;const a=20,o=2,h=17;this.ringBg=new Ui({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:n,lineWidth:r,color:this.bgColor}),this.addShape(this.ringBg),this.ring=new Ui({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:n,lineWidth:r}),this.addShape(this.ring);const c=this.ringBg.y-this.ringBg.radius+a;for(let l=0;l<this.indicatorLineCount;l++)this.lines.push(new ce({...t,centerX:this.ringBg.x,centerY:this.ringBg.y,x:this.ringBg.x,y:c,toX:this.ringBg.x,toY:c+h,degree:this.ringBg.startDegree+90+(s-e+n*2)/(this.indicatorLineCount-1)*l,attrs:{"stroke-linecap":"round","stroke-width":String(o),stroke:this.bgColor}}));this.addShape(this.lines)}setPercent(t){this.percent=t}shapeInit(){this.on("draging",(t,e,s)=>{this.shapes.forEach(n=>{n!=s&&(n.x+=t,n.y+=e)})})}frameUpdate(t,e){const s=this.ringBg.radius-this.ringBg.radius*Math.cos(Math.PI*this.percent),n=this.ringBg.radius*Math.sin(Math.PI*this.percent);if(e){const r=e.createLinearGradient(-this.ringBg.radius,0,-this.ringBg.radius+s,-n,{0:this.startColor,1:this.endColor});this.ring.setAttr({stroke:r})}else this.ring.setAttr({stroke:this.startColor});this.ring.setPercent(this.percent);for(let r=0;r<this.indicatorLineCount;r++){const a=r/(this.indicatorLineCount-1)<=this.percent;this.lines[r].setAttr({stroke:a&&e?e.createLinearGradient(0,0,this.lines[r].toX-this.lines[r].x,this.lines[r].toY-this.lines[r].y,{0:this.startColor,1:this.endColor}):a?this.startColor:this.bgColor})}}}class pu extends U{x;y;z;brightness;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.brightness=this.setBrightness(t?.brightness||1)}setBrightness(t){return this.brightness=yt(t,0,1),this.brightness}toSVGPathData(){return[]}}const gu=pu;class yu extends U{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(),this.points=t,this.light=new gu({x:0,y:0,z:0,brightness:1})}toSVGPathData(){const t=[];t.push(["M",this.points[0].getScreenX(),this.points[0].getScreenY()]);for(let e=0,s=this.points.length;e<=s-1;e++)t.push(["L",this.points[e].getScreenX(),this.points[e].getScreenY()]);return t.push(["L",this.points[0].getScreenX(),this.points[0].getScreenY()]),t}toCanvasContext(t){t.beginPath(),t.moveTo(0,0);for(let e=0,s=this.points.length;e<=s-1;e++)t.lineTo(this.points[e].getScreenX()-this.points[0].getScreenX(),this.points[e].getScreenY()-this.points[0].getScreenY());t.lineTo(0,0)}get length(){return this.points.length}getDepth(){return Math.min(...this.points.map(t=>t.z))}isBackface(){const t=this.points[2].getScreenX()-this.points[0].getScreenX(),e=this.points[2].getScreenY()-this.points[0].getScreenY(),s=this.points[1].getScreenX()-this.points[2].getScreenX(),n=this.points[1].getScreenY()-this.points[2].getScreenY();return t*n>e*s}getLightFactor(){const t={x:this.points[0].x-this.points[1].x,y:this.points[0].y-this.points[1].y,z:this.points[0].z-this.points[1].z},e={x:this.points[1].x-this.points[2].x,y:this.points[1].y-this.points[2].y,z:this.points[1].z-this.points[2].z},s={x:t.y*e.z-t.z*e.y,y:-(t.x*e.z-t.z*e.x),z:t.x*e.y-t.y*e.x},n=s.x*this.light.x+s.y*this.light.y+s.z*this.light.z,r=Math.sqrt(s.x*s.x+s.y*s.y+s.z*s.z),a=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(n/(r*a))/Math.PI*this.light.brightness}getAdjustedColor(t){const e=kt(t),s=this.getLightFactor();return e.r*=s,e.g*=s,e.b*=s,ye(e)}}class wu extends st{fettis=[];constructor(t,e,s){super();const{shape:n,x:r,y:a,particleCount:o,angle:h,spread:c,startVelocity:l,decay:d,gravity:g,drift:y,ticks:p,colors:x,scalar:b,flat:S}=fn(s||{},{shape:Gt,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:sr,scalar:1,flat:!1}),C=O(h),L=O(c);let R=o;for(;R--;){const Y=new n({x:t*r,y:e*a,width:10,height:10,scalar:b,attrs:{fill:x[R%x.length]},independentTransformInGroup:!0});this.addShape(Y),this.fettis.push({shape:Y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:l*.5+Math.random()*l,angle2D:-C+(.5*L-Math.random()*L),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,tick:0,totalTicks:p,decay:d,drift:y,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:g*3,scalar:b,flat:S})}}frameUpdate(t){this.fettis.length&&(this.fettis=this.fettis.filter(e=>{e.shape.x+=Math.cos(e.angle2D)*e.velocity+e.drift,e.shape.y+=Math.sin(e.angle2D)*e.velocity+e.gravity,e.velocity*=e.decay,e.flat?(e.wobble=0,e.wobbleX=e.shape.x+10*e.scalar,e.wobbleY=e.shape.y+10*e.scalar,e.tiltSin=0,e.tiltCos=0,e.random=1):(e.wobble+=e.wobbleSpeed,e.wobbleX=e.shape.x+10*e.scalar*Math.cos(e.wobble),e.wobbleY=e.shape.y+10*e.scalar*Math.sin(e.wobble),e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+2);const s=e.tick++/e.totalTicks,n=e.shape.x+e.random*e.tiltCos,r=e.shape.y+e.random*e.tiltSin,a=e.wobbleX+e.random*e.tiltCos,o=e.wobbleY+e.random*e.tiltSin;return e.shape.setAttr("fill",wi(e.shape.getAttr("fill"),1-s)),e.shape.degree=tt(Math.PI/10*e.wobble),e.shape.scalarX=Math.abs(a-n)*.1,e.shape.scalarY=Math.abs(o-r)*.1,e.tick<e.totalTicks}))}}class Gi{shapes;constructor(t){this.shapes=t}run(t){this.shapes.forEach(s=>{s.run(),t?.wall&&s.checkWall({wall:t.wall,bounce:t.bounce})});const e=this.shapes.length;for(let s=0,n=e-1;s<n;s++)for(let r=s+1;r<e;r++)this.shapes[s].checkCollision(this.shapes[r])}gravitate(){const t=this.shapes.length;this.shapes.forEach((e,s)=>{e.run();for(let n=s+1;n<t;n++)e.checkCollision(this.shapes[n]),e.gravitateTo(this.shapes[n])})}springChain(t){this.shapes.forEach((e,s)=>{s>0&&e.runSpringTo(this.shapes[s-1],t)})}springConnect(t){const e=jt(t?.springLength,100);this.shapes.forEach(s=>{s.isDragging||this.shapes.filter(n=>n.id!==s.id).forEach(n=>{const r=$t(s.x,s.y,n.x,n.y);s.runSpringTo({x:n.x-Math.cos(r)*e,y:n.y-Math.sin(r)*e},t)})})}springMass(t,e){const s=this.shapes.length,n=[];return this.shapes.forEach((r,a)=>{r.run(e),r.x>t.x+t.width?r.x=t.x:r.x<t.x&&(r.x=t.x+t.width),r.y>t.y+t.height?r.y=t.y:r.y<t.y&&(r.y=t.y+t.height);for(let o=a+1;o<s;o++)n.push([r.x,r.y,this.shapes[o].x,this.shapes[o].y,r.springMassTo(this.shapes[o],e)])}),n}polymorph(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");const t=this.shapes.length-1,e=new Array(t);for(let n=0;n<t;n++){const r=this.shapes[n].initPathD();this.shapes[n].frameStart();const a=this.shapes[n+1].initPathD();this.shapes[n+1].frameStart();const o=Math.max(r.polymorphPoints.length,a.polymorphPoints.length);e[n]=pt.getPathInterpolator(r.expendFill(o),a.expendFill(o))}const s=new U({d:e[0](0)});return n=>{const r=Et(t*n,6),a=Math.min(Math.floor(r),t-1),o=Et(r-a,6);s.originD=e[a](o);const h=this.shapes[a].getAttr("fill","none"),c=this.shapes[a+1].getAttr("fill","none");typeof h=="string"&&typeof c=="string"&&s.setAttr("fill",xi(h,c,o));const l=this.shapes[a].getAttr("stroke","none"),d=this.shapes[a+1].getAttr("stroke","none");return typeof l=="string"&&typeof d=="string"&&s.setAttr("stroke",xi(l,d,o)),s}}polymorphGroup(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");let t=0,e;const s=[];this.shapes.forEach(o=>{let h;o instanceof st?(h=o,h.sortPathD()):(h=new st,h.addShape(o)),s.push(h),t<h.shapes.length&&(t=h.shapes.length,e=h)}),s.forEach(o=>{o!==e&&o.expendFill(e)});const n=[];s.forEach((o,h)=>{o.shapes.forEach((c,l)=>{n[l]=n[l]||[],n[l][h]=c})});const r=[];n.forEach(o=>{r.push(new Gi(o).polymorph())});const a=new st;return r.forEach(o=>{a.addShape(o(0))}),o=>(r.forEach(h=>{h(o)}),a)}polymorphTween(t=6e3,e){const s=this.shapes.findIndex(o=>o instanceof st)>=0?this.polymorphGroup():this.polymorph(),n=s(0),r=e?.onUpdate,a=new ys({frameDuration:t});a.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(o,h)=>{s(o.t),r?.(o,h),e?.draw?.(n)}})),a.play()}static generatePointsShape(t,e,s,n){const r=[];for(let a=0;a<n;a++){const o=a/n*2*Math.PI,{dx:h,dy:c}=At(o,s);r.push({x:t+h,y:e+c})}return new na({points:r})}static generateRosettaShape(t,e,s,n,r){if(r==0)throw new Error("no dividing by zero, please");const a=[],o=360/r;for(let h=0;h<r;h+=1){const c=o*h*Math.PI/180,l=t+2*s*Math.cos(c),d=e+2*s*Math.sin(c);a.push(new si({x:t,y:e,rx:s,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:d})),a.push(new si({x:l,y:d,rx:s,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new U({d:pt.fromLines(a)})}}const ha={map:new Map,transform:function(i){if(_n)return i;if(this.map.has(i))return this.map.get(i);const t=new OffscreenCanvas(i.width,i.height);return t.getContext("2d")?.drawImage(i,0,0),this.map.set(i,t),t},clear:function(){this.map.clear()}};function xu(i,t,e){const s=new OffscreenCanvas(i,t),n=s.getContext("2d");if(n)return e(n),s.transferToImageBitmap()}function bu(i,t,e){const s=i.createPattern(ha.transform(t),"no-repeat");if(s){const n=mi(e);s.setTransform(n),i.fillStyle=s}}class vu{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e=!1){if(this.app=t,!(this.app.container instanceof HTMLCanvasElement))throw new Error("app.container 应该为 HTMLCanvasElement!");this.ctx=new ds(this.app.container,this.app.width,this.app.height,e),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(s,n)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=n.dx,this.dragDy+=n.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let s of this.shapes)if(this.currentMouseInShape==s){s.emit("clicked");let n=s.parent;for(;n;)n.emit("clicked",s),n=n.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}transformCtxBaseOnShape(t){t.usePathDtoCanvasContext||(this.ctx.translate(t.x,t.y),this.ctx.rotate(O(t.degree),t.cX,t.cY),this.ctx.scale(t.scalarX,t.scalarY,t.cX,t.cY))}_addDrawShape(t){this.shapes.push(t),t instanceof st&&t.shapes.forEach(e=>{this._addDrawShape(e)})}draw(t=[]){this.shapes=[],(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow)continue;if(this.ctx.save(),e.frameStart(this.app.mousePoint),k.attrsToCanvas(this.ctx,e.getAttrs()),e.followMouse&&(!es(e.x,this.app.mousePoint.x,5)||!es(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const n=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,n||r){if(e.x+=n,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",n,r)}}else e.isDragging=!1;e.frameUpdate(this.app.mousePoint,this.ctx),this.transformCtxBaseOnShape(e),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill();const s=this.ctx.currentPath2D;if(!this.currentMouseInShape){const n=this.ctx.isPointInPath(s,this.app.mousePoint.x,this.app.mousePoint.y)||this.ctx.isPointInStroke(s,this.app.mousePoint.x,this.app.mousePoint.y)||!1;e.isMouseIn=n,n&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint),this.ctx.restore()}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}drawMouseMoveLine(t="line",e){switch(t){case"brush":const s=e?.brushSize??10,n=e?.brushDensity??50,r=e?.brushColor??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,h=kt(r);return this.app.captureMove({move:()=>{if(this.isMouseDown){for(let c=0;c<n;c++){const l=Math.random()*Math.PI*2,d=Math.random()*s,g=this.app.mousePoint.x+Math.cos(l)*d|0,y=this.app.mousePoint.y+Math.sin(l)*d|0,p=(g+y*a.width)*4;o[p]=h.r,o[p+1]=h.g,o[p+2]=h.b,o[p+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureMove({start:c=>{this.ctx.beginPath(),this.ctx.moveTo(this.app.mousePoint.x,this.app.mousePoint.y)},end:()=>{this.ctx.closePath()},move:()=>{this.isMouseDown&&(this.ctx.lineTo(this.app.mousePoint.x,this.app.mousePoint.y),this.ctx.stroke())}})}}}class Su{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Oe(t),this.remoteVideoUtil=new Oe(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(s=>{this.localVideoUtil.setSrcObject(s),t(s)}).catch(s=>{this.trace(`navigator.getUserMedia error: ${s}.`),e(s)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),s=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),s.length>0&&this.trace(`Using audio device: ${s[0].label}.`);const n=void 0,r=new RTCPeerConnection(n);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(n);this.remotePeerConnection=a,this.trace("Created remote peer connection object remotePeerConnection."),a.addEventListener("icecandidate",this.handleConnection),a.addEventListener("iceconnectionstatechange",this.handleConnectionChange),a.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(s[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,s=t.candidate;if(e&&s){const n=new RTCIceCandidate(s),r=this.getOtherPeer(e);r&&(r.addIceCandidate(n).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
36
|
+
`):t.data[r.name]=r.value)}return t}function dr(i,t){return function(){return i.apply(t,arguments)}}const{toString:zh}=Object.prototype,{getPrototypeOf:vi}=Object,bs=(i=>t=>{const e=zh.call(t);return i[e]||(i[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Dt=i=>(i=i.toLowerCase(),t=>bs(t)===i),vs=i=>t=>typeof t===i,{isArray:we}=Array,Ne=vs("undefined");function qh(i){return i!==null&&!Ne(i)&&i.constructor!==null&&!Ne(i.constructor)&&xt(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const fr=Dt("ArrayBuffer");function Hh(i){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(i):t=i&&i.buffer&&fr(i.buffer),t}const jh=vs("string"),xt=vs("function"),mr=vs("number"),Ss=i=>i!==null&&typeof i=="object",Wh=i=>i===!0||i===!1,Cs=i=>{if(bs(i)!=="object")return!1;const t=vi(i);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},$h=Dt("Date"),Jh=Dt("File"),Zh=Dt("Blob"),Kh=Dt("FileList"),Qh=i=>Ss(i)&&xt(i.pipe),tc=i=>{let t;return i&&(typeof FormData=="function"&&i instanceof FormData||xt(i.append)&&((t=bs(i))==="formdata"||t==="object"&&xt(i.toString)&&i.toString()==="[object FormData]"))},ec=Dt("URLSearchParams"),sc=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Fe(i,t,{allOwnKeys:e=!1}={}){if(i===null||typeof i>"u")return;let s,n;if(typeof i!="object"&&(i=[i]),we(i))for(s=0,n=i.length;s<n;s++)t.call(null,i[s],s,i);else{const r=e?Object.getOwnPropertyNames(i):Object.keys(i),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,i[o],o,i)}}function pr(i,t){t=t.toLowerCase();const e=Object.keys(i);let s=e.length,n;for(;s-- >0;)if(n=e[s],t===n.toLowerCase())return n;return null}const gr=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),yr=i=>!Ne(i)&&i!==gr;function Si(){const{caseless:i}=yr(this)&&this||{},t={},e=(s,n)=>{const r=i&&pr(t,n)||n;Cs(t[r])&&Cs(s)?t[r]=Si(t[r],s):Cs(s)?t[r]=Si({},s):we(s)?t[r]=s.slice():t[r]=s};for(let s=0,n=arguments.length;s<n;s++)arguments[s]&&Fe(arguments[s],e);return t}const ic=(i,t,e,{allOwnKeys:s}={})=>(Fe(t,(n,r)=>{e&&xt(n)?i[r]=dr(n,e):i[r]=n},{allOwnKeys:s}),i),nc=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),rc=(i,t,e,s)=>{i.prototype=Object.create(t.prototype,s),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:t.prototype}),e&&Object.assign(i.prototype,e)},ac=(i,t,e,s)=>{let n,r,a;const o={};if(t=t||{},i==null)return t;do{for(n=Object.getOwnPropertyNames(i),r=n.length;r-- >0;)a=n[r],(!s||s(a,i,t))&&!o[a]&&(t[a]=i[a],o[a]=!0);i=e!==!1&&vi(i)}while(i&&(!e||e(i,t))&&i!==Object.prototype);return t},oc=(i,t,e)=>{i=String(i),(e===void 0||e>i.length)&&(e=i.length),e-=t.length;const s=i.indexOf(t,e);return s!==-1&&s===e},hc=i=>{if(!i)return null;if(we(i))return i;let t=i.length;if(!mr(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=i[t];return e},cc=(i=>t=>i&&t instanceof i)(typeof Uint8Array<"u"&&vi(Uint8Array)),lc=(i,t)=>{const s=(i&&i[Symbol.iterator]).call(i);let n;for(;(n=s.next())&&!n.done;){const r=n.value;t.call(i,r[0],r[1])}},uc=(i,t)=>{let e;const s=[];for(;(e=i.exec(t))!==null;)s.push(e);return s},dc=Dt("HTMLFormElement"),fc=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,n){return s.toUpperCase()+n}),wr=(({hasOwnProperty:i})=>(t,e)=>i.call(t,e))(Object.prototype),mc=Dt("RegExp"),xr=(i,t)=>{const e=Object.getOwnPropertyDescriptors(i),s={};Fe(e,(n,r)=>{let a;(a=t(n,r,i))!==!1&&(s[r]=a||n)}),Object.defineProperties(i,s)},pc=i=>{xr(i,(t,e)=>{if(xt(i)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=i[e];if(xt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},gc=(i,t)=>{const e={},s=n=>{n.forEach(r=>{e[r]=!0})};return we(i)?s(i):s(String(i).split(t)),e},yc=()=>{},wc=(i,t)=>(i=+i,Number.isFinite(i)?i:t),Ci="abcdefghijklmnopqrstuvwxyz",br="0123456789",vr={DIGIT:br,ALPHA:Ci,ALPHA_DIGIT:Ci+Ci.toUpperCase()+br},xc=(i=16,t=vr.ALPHA_DIGIT)=>{let e="";const{length:s}=t;for(;i--;)e+=t[Math.random()*s|0];return e};function bc(i){return!!(i&&xt(i.append)&&i[Symbol.toStringTag]==="FormData"&&i[Symbol.iterator])}const vc=i=>{const t=new Array(10),e=(s,n)=>{if(Ss(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[n]=s;const r=we(s)?[]:{};return Fe(s,(a,o)=>{const h=e(a,n+1);!Ne(h)&&(r[o]=h)}),t[n]=void 0,r}}return s};return e(i,0)},Sc=Dt("AsyncFunction"),E={isArray:we,isArrayBuffer:fr,isBuffer:qh,isFormData:tc,isArrayBufferView:Hh,isString:jh,isNumber:mr,isBoolean:Wh,isObject:Ss,isPlainObject:Cs,isUndefined:Ne,isDate:$h,isFile:Jh,isBlob:Zh,isRegExp:mc,isFunction:xt,isStream:Qh,isURLSearchParams:ec,isTypedArray:cc,isFileList:Kh,forEach:Fe,merge:Si,extend:ic,trim:sc,stripBOM:nc,inherits:rc,toFlatObject:ac,kindOf:bs,kindOfTest:Dt,endsWith:oc,toArray:hc,forEachEntry:lc,matchAll:uc,isHTMLForm:dc,hasOwnProperty:wr,hasOwnProp:wr,reduceDescriptors:xr,freezeMethods:pc,toObjectSet:gc,toCamelCase:fc,noop:yc,toFiniteNumber:wc,findKey:pr,global:gr,isContextDefined:yr,ALPHABET:vr,generateString:xc,isSpecCompliantForm:bc,toJSONObject:vc,isAsyncFn:Sc,isThenable:i=>i&&(Ss(i)||xt(i))&&xt(i.then)&&xt(i.catch)};function B(i,t,e,s,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),n&&(this.response=n)}E.inherits(B,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:E.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Sr=B.prototype,Cr={};["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(i=>{Cr[i]={value:i}}),Object.defineProperties(B,Cr),Object.defineProperty(Sr,"isAxiosError",{value:!0}),B.from=(i,t,e,s,n,r)=>{const a=Object.create(Sr);return E.toFlatObject(i,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),B.call(a,i.message,t,e,s,n),a.cause=i,a.name=i.name,r&&Object.assign(a,r),a};const Cc=null;function Ei(i){return E.isPlainObject(i)||E.isArray(i)}function Er(i){return E.endsWith(i,"[]")?i.slice(0,-2):i}function Tr(i,t,e){return i?i.concat(t).map(function(n,r){return n=Er(n),!e&&r?"["+n+"]":n}).join(e?".":""):t}function Ec(i){return E.isArray(i)&&!i.some(Ei)}const Tc=E.toFlatObject(E,{},null,function(t){return/^is[A-Z]/.test(t)});function Es(i,t,e){if(!E.isObject(i))throw new TypeError("target must be an object");t=t||new FormData,e=E.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,b){return!E.isUndefined(b[x])});const s=e.metaTokens,n=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(t);if(!E.isFunction(n))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(E.isDate(p))return p.toISOString();if(!h&&E.isBlob(p))throw new B("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(p)||E.isTypedArray(p)?h&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,x,b){let S=p;if(p&&!b&&typeof p=="object"){if(E.endsWith(x,"{}"))x=s?x:x.slice(0,-2),p=JSON.stringify(p);else if(E.isArray(p)&&Ec(p)||(E.isFileList(p)||E.endsWith(x,"[]"))&&(S=E.toArray(p)))return x=Er(x),S.forEach(function(L,R){!(E.isUndefined(L)||L===null)&&t.append(a===!0?Tr([x],R,r):a===null?x:x+"[]",c(L))}),!1}return Ei(p)?!0:(t.append(Tr(b,x,r),c(p)),!1)}const d=[],g=Object.assign(Tc,{defaultVisitor:l,convertValue:c,isVisitable:Ei});function y(p,x){if(!E.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+x.join("."));d.push(p),E.forEach(p,function(S,C){(!(E.isUndefined(S)||S===null)&&n.call(t,S,E.isString(C)?C.trim():C,x,g))===!0&&y(S,x?x.concat(C):[C])}),d.pop()}}if(!E.isObject(i))throw new TypeError("data must be an object");return y(i),t}function Pr(i){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Ti(i,t){this._pairs=[],i&&Es(i,this,t)}const Mr=Ti.prototype;Mr.append=function(t,e){this._pairs.push([t,e])},Mr.toString=function(t){const e=t?function(s){return t.call(this,s,Pr)}:Pr;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function Pc(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ar(i,t,e){if(!t)return i;const s=e&&e.encode||Pc,n=e&&e.serialize;let r;if(n?r=n(t,e):r=E.isURLSearchParams(t)?t.toString():new Ti(t,e).toString(s),r){const a=i.indexOf("#");a!==-1&&(i=i.slice(0,a)),i+=(i.indexOf("?")===-1?"?":"&")+r}return i}class Mc{constructor(){this.handlers=[]}use(t,e,s){return this.handlers.push({fulfilled:t,rejected:e,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){E.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Ir=Mc,Dr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ac=typeof URLSearchParams<"u"?URLSearchParams:Ti,Ic=typeof FormData<"u"?FormData:null,Dc=typeof Blob<"u"?Blob:null,kc=(()=>{let i;return typeof navigator<"u"&&((i=navigator.product)==="ReactNative"||i==="NativeScript"||i==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),_c=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),kt={isBrowser:!0,classes:{URLSearchParams:Ac,FormData:Ic,Blob:Dc},isStandardBrowserEnv:kc,isStandardBrowserWebWorkerEnv:_c,protocols:["http","https","file","blob","url","data"]};function Lc(i,t){return Es(i,new kt.classes.URLSearchParams,Object.assign({visitor:function(e,s,n,r){return kt.isNode&&E.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Rc(i){return E.matchAll(/\w+|\[(\w*)]/g,i).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Oc(i){const t={},e=Object.keys(i);let s;const n=e.length;let r;for(s=0;s<n;s++)r=e[s],t[r]=i[r];return t}function kr(i){function t(e,s,n,r){let a=e[r++];const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&E.isArray(n)?n.length:a,h?(E.hasOwnProp(n,a)?n[a]=[n[a],s]:n[a]=s,!o):((!n[a]||!E.isObject(n[a]))&&(n[a]=[]),t(e,s,n[a],r)&&E.isArray(n[a])&&(n[a]=Oc(n[a])),!o)}if(E.isFormData(i)&&E.isFunction(i.entries)){const e={};return E.forEachEntry(i,(s,n)=>{t(Rc(s),n,e,0)}),e}return null}function Nc(i,t,e){if(E.isString(i))try{return(t||JSON.parse)(i),E.trim(i)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(i)}const Pi={transitional:Dr,adapter:["xhr","http"],transformRequest:[function(t,e){const s=e.getContentType()||"",n=s.indexOf("application/json")>-1,r=E.isObject(t);if(r&&E.isHTMLForm(t)&&(t=new FormData(t)),E.isFormData(t))return n&&n?JSON.stringify(kr(t)):t;if(E.isArrayBuffer(t)||E.isBuffer(t)||E.isStream(t)||E.isFile(t)||E.isBlob(t))return t;if(E.isArrayBufferView(t))return t.buffer;if(E.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Lc(t,this.formSerializer).toString();if((o=E.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Es(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||n?(e.setContentType("application/json",!1),Nc(t)):t}],transformResponse:[function(t){const e=this.transitional||Pi.transitional,s=e&&e.forcedJSONParsing,n=this.responseType==="json";if(t&&E.isString(t)&&(s&&!this.responseType||n)){const a=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?B.from(o,B.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:kt.classes.FormData,Blob:kt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],i=>{Pi.headers[i]={}});const Mi=Pi,Fc=E.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"]),Bc=i=>{const t={};let e,s,n;return i&&i.split(`
|
|
37
|
+
`).forEach(function(a){n=a.indexOf(":"),e=a.substring(0,n).trim().toLowerCase(),s=a.substring(n+1).trim(),!(!e||t[e]&&Fc[e])&&(e==="set-cookie"?t[e]?t[e].push(s):t[e]=[s]:t[e]=t[e]?t[e]+", "+s:s)}),t},_r=Symbol("internals");function Be(i){return i&&String(i).trim().toLowerCase()}function Ts(i){return i===!1||i==null?i:E.isArray(i)?i.map(Ts):String(i)}function Xc(i){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=e.exec(i);)t[s[1]]=s[2];return t}const Yc=i=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim());function Ai(i,t,e,s,n){if(E.isFunction(s))return s.call(this,t,e);if(n&&(t=e),!!E.isString(t)){if(E.isString(s))return t.indexOf(s)!==-1;if(E.isRegExp(s))return s.test(t)}}function Uc(i){return i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,s)=>e.toUpperCase()+s)}function Gc(i,t){const e=E.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(i,s+e,{value:function(n,r,a){return this[s].call(this,t,n,r,a)},configurable:!0})})}class Ps{constructor(t){t&&this.set(t)}set(t,e,s){const n=this;function r(o,h,c){const l=Be(h);if(!l)throw new Error("header name must be a non-empty string");const d=E.findKey(n,l);(!d||n[d]===void 0||c===!0||c===void 0&&n[d]!==!1)&&(n[d||h]=Ts(o))}const a=(o,h)=>E.forEach(o,(c,l)=>r(c,l,h));return E.isPlainObject(t)||t instanceof this.constructor?a(t,e):E.isString(t)&&(t=t.trim())&&!Yc(t)?a(Bc(t),e):t!=null&&r(e,t,s),this}get(t,e){if(t=Be(t),t){const s=E.findKey(this,t);if(s){const n=this[s];if(!e)return n;if(e===!0)return Xc(n);if(E.isFunction(e))return e.call(this,n,s);if(E.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Be(t),t){const s=E.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||Ai(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let n=!1;function r(a){if(a=Be(a),a){const o=E.findKey(s,a);o&&(!e||Ai(s,s[o],o,e))&&(delete s[o],n=!0)}}return E.isArray(t)?t.forEach(r):r(t),n}clear(t){const e=Object.keys(this);let s=e.length,n=!1;for(;s--;){const r=e[s];(!t||Ai(this,this[r],r,t,!0))&&(delete this[r],n=!0)}return n}normalize(t){const e=this,s={};return E.forEach(this,(n,r)=>{const a=E.findKey(s,r);if(a){e[a]=Ts(n),delete e[r];return}const o=t?Uc(r):String(r).trim();o!==r&&delete e[r],e[o]=Ts(n),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return E.forEach(this,(s,n)=>{s!=null&&s!==!1&&(e[n]=t&&E.isArray(s)?s.join(", "):s)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
|
|
38
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(n=>s.set(n)),s}static accessor(t){const s=(this[_r]=this[_r]={accessors:{}}).accessors,n=this.prototype;function r(a){const o=Be(a);s[o]||(Gc(n,a),s[o]=!0)}return E.isArray(t)?t.forEach(r):r(t),this}}Ps.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),E.reduceDescriptors(Ps.prototype,({value:i},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>i,set(s){this[e]=s}}}),E.freezeMethods(Ps);const Xt=Ps;function Ii(i,t){const e=this||Mi,s=t||e,n=Xt.from(s.headers);let r=s.data;return E.forEach(i,function(o){r=o.call(e,r,n.normalize(),t?t.status:void 0)}),n.normalize(),r}function Lr(i){return!!(i&&i.__CANCEL__)}function Xe(i,t,e){B.call(this,i??"canceled",B.ERR_CANCELED,t,e),this.name="CanceledError"}E.inherits(Xe,B,{__CANCEL__:!0});function Vc(i,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?i(e):t(new B("Request failed with status code "+e.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const zc=kt.isStandardBrowserEnv?function(){return{write:function(e,s,n,r,a,o){const h=[];h.push(e+"="+encodeURIComponent(s)),E.isNumber(n)&&h.push("expires="+new Date(n).toGMTString()),E.isString(r)&&h.push("path="+r),E.isString(a)&&h.push("domain="+a),o===!0&&h.push("secure"),document.cookie=h.join("; ")},read:function(e){const s=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function qc(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function Hc(i,t){return t?i.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):i}function Rr(i,t){return i&&!qc(t)?Hc(i,t):t}const jc=kt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let s;function n(r){let a=r;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return s=n(window.location.href),function(a){const o=E.isString(a)?n(a):a;return o.protocol===s.protocol&&o.host===s.host}}():function(){return function(){return!0}}();function Wc(i){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return t&&t[1]||""}function $c(i,t){i=i||10;const e=new Array(i),s=new Array(i);let n=0,r=0,a;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),l=s[r];a||(a=c),e[n]=h,s[n]=c;let d=r,g=0;for(;d!==n;)g+=e[d++],d=d%i;if(n=(n+1)%i,n===r&&(r=(r+1)%i),c-a<t)return;const y=l&&c-l;return y?Math.round(g*1e3/y):void 0}}function Or(i,t){let e=0;const s=$c(50,250);return n=>{const r=n.loaded,a=n.lengthComputable?n.total:void 0,o=r-e,h=s(o),c=r<=a;e=r;const l={loaded:r,total:a,progress:a?r/a:void 0,bytes:o,rate:h||void 0,estimated:h&&a&&c?(a-r)/h:void 0,event:n};l[t?"download":"upload"]=!0,i(l)}}const Di={http:Cc,xhr:typeof XMLHttpRequest<"u"&&function(i){return new Promise(function(e,s){let n=i.data;const r=Xt.from(i.headers).normalize(),a=i.responseType;let o;function h(){i.cancelToken&&i.cancelToken.unsubscribe(o),i.signal&&i.signal.removeEventListener("abort",o)}let c;E.isFormData(n)&&(kt.isStandardBrowserEnv||kt.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?E.isString(c=r.getContentType())&&r.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(i.auth){const p=i.auth.username||"",x=i.auth.password?unescape(encodeURIComponent(i.auth.password)):"";r.set("Authorization","Basic "+btoa(p+":"+x))}const d=Rr(i.baseURL,i.url);l.open(i.method.toUpperCase(),Ar(d,i.params,i.paramsSerializer),!0),l.timeout=i.timeout;function g(){if(!l)return;const p=Xt.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),b={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:p,config:i,request:l};Vc(function(C){e(C),h()},function(C){s(C),h()},b),l=null}if("onloadend"in l?l.onloadend=g:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(g)},l.onabort=function(){l&&(s(new B("Request aborted",B.ECONNABORTED,i,l)),l=null)},l.onerror=function(){s(new B("Network Error",B.ERR_NETWORK,i,l)),l=null},l.ontimeout=function(){let x=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const b=i.transitional||Dr;i.timeoutErrorMessage&&(x=i.timeoutErrorMessage),s(new B(x,b.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,i,l)),l=null},kt.isStandardBrowserEnv){const p=(i.withCredentials||jc(d))&&i.xsrfCookieName&&zc.read(i.xsrfCookieName);p&&r.set(i.xsrfHeaderName,p)}n===void 0&&r.setContentType(null),"setRequestHeader"in l&&E.forEach(r.toJSON(),function(x,b){l.setRequestHeader(b,x)}),E.isUndefined(i.withCredentials)||(l.withCredentials=!!i.withCredentials),a&&a!=="json"&&(l.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&l.addEventListener("progress",Or(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",Or(i.onUploadProgress)),(i.cancelToken||i.signal)&&(o=p=>{l&&(s(!p||p.type?new Xe(null,i,l):p),l.abort(),l=null)},i.cancelToken&&i.cancelToken.subscribe(o),i.signal&&(i.signal.aborted?o():i.signal.addEventListener("abort",o)));const y=Wc(d);if(y&&kt.protocols.indexOf(y)===-1){s(new B("Unsupported protocol "+y+":",B.ERR_BAD_REQUEST,i));return}l.send(n||null)})}};E.forEach(Di,(i,t)=>{if(i){try{Object.defineProperty(i,"name",{value:t})}catch{}Object.defineProperty(i,"adapterName",{value:t})}});const Nr=i=>`- ${i}`,Jc=i=>E.isFunction(i)||i===null||i===!1,Fr={getAdapter:i=>{i=E.isArray(i)?i:[i];const{length:t}=i;let e,s;const n={};for(let r=0;r<t;r++){e=i[r];let a;if(s=e,!Jc(e)&&(s=Di[(a=String(e)).toLowerCase()],s===void 0))throw new B(`Unknown adapter '${a}'`);if(s)break;n[a||"#"+r]=s}if(!s){const r=Object.entries(n).map(([o,h])=>`adapter ${o} `+(h===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since :
|
|
39
|
+
`+r.map(Nr).join(`
|
|
40
|
+
`):" "+Nr(r[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:Di};function ki(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new Xe(null,i)}function Br(i){return ki(i),i.headers=Xt.from(i.headers),i.data=Ii.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),Fr.getAdapter(i.adapter||Mi.adapter)(i).then(function(s){return ki(i),s.data=Ii.call(i,i.transformResponse,s),s.headers=Xt.from(s.headers),s},function(s){return Lr(s)||(ki(i),s&&s.response&&(s.response.data=Ii.call(i,i.transformResponse,s.response),s.response.headers=Xt.from(s.response.headers))),Promise.reject(s)})}const Xr=i=>i instanceof Xt?i.toJSON():i;function xe(i,t){t=t||{};const e={};function s(c,l,d){return E.isPlainObject(c)&&E.isPlainObject(l)?E.merge.call({caseless:d},c,l):E.isPlainObject(l)?E.merge({},l):E.isArray(l)?l.slice():l}function n(c,l,d){if(E.isUndefined(l)){if(!E.isUndefined(c))return s(void 0,c,d)}else return s(c,l,d)}function r(c,l){if(!E.isUndefined(l))return s(void 0,l)}function a(c,l){if(E.isUndefined(l)){if(!E.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,d){if(d in t)return s(c,l);if(d in i)return s(void 0,c)}const h={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(c,l)=>n(Xr(c),Xr(l),!0)};return E.forEach(Object.keys(Object.assign({},i,t)),function(l){const d=h[l]||n,g=d(i[l],t[l],l);E.isUndefined(g)&&d!==o||(e[l]=g)}),e}const Yr="1.5.1",_i={};["object","boolean","number","function","string","symbol"].forEach((i,t)=>{_i[i]=function(s){return typeof s===i||"a"+(t<1?"n ":" ")+i}});const Ur={};_i.transitional=function(t,e,s){function n(r,a){return"[Axios v"+Yr+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new B(n(a," has been removed"+(e?" in "+e:"")),B.ERR_DEPRECATED);return e&&!Ur[a]&&(Ur[a]=!0,console.warn(n(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}};function Zc(i,t,e){if(typeof i!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const s=Object.keys(i);let n=s.length;for(;n-- >0;){const r=s[n],a=t[r];if(a){const o=i[r],h=o===void 0||a(o,r,i);if(h!==!0)throw new B("option "+r+" must be "+h,B.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new B("Unknown option "+r,B.ERR_BAD_OPTION)}}const Li={assertOptions:Zc,validators:_i},Kt=Li.validators;class Ms{constructor(t){this.defaults=t,this.interceptors={request:new Ir,response:new Ir}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=xe(this.defaults,e);const{transitional:s,paramsSerializer:n,headers:r}=e;s!==void 0&&Li.assertOptions(s,{silentJSONParsing:Kt.transitional(Kt.boolean),forcedJSONParsing:Kt.transitional(Kt.boolean),clarifyTimeoutError:Kt.transitional(Kt.boolean)},!1),n!=null&&(E.isFunction(n)?e.paramsSerializer={serialize:n}:Li.assertOptions(n,{encode:Kt.function,serialize:Kt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&E.merge(r.common,r[e.method]);r&&E.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=Xt.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(e)===!1||(h=h&&x.synchronous,o.unshift(x.fulfilled,x.rejected))});const c=[];this.interceptors.response.forEach(function(x){c.push(x.fulfilled,x.rejected)});let l,d=0,g;if(!h){const p=[Br.bind(this),void 0];for(p.unshift.apply(p,o),p.push.apply(p,c),g=p.length,l=Promise.resolve(e);d<g;)l=l.then(p[d++],p[d++]);return l}g=o.length;let y=e;for(d=0;d<g;){const p=o[d++],x=o[d++];try{y=p(y)}catch(b){x.call(this,b);break}}try{l=Br.call(this,y)}catch(p){return Promise.reject(p)}for(d=0,g=c.length;d<g;)l=l.then(c[d++],c[d++]);return l}getUri(t){t=xe(this.defaults,t);const e=Rr(t.baseURL,t.url);return Ar(e,t.params,t.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(t){Ms.prototype[t]=function(e,s){return this.request(xe(s||{},{method:t,url:e,data:(s||{}).data}))}}),E.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(xe(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}Ms.prototype[t]=e(),Ms.prototype[t+"Form"]=e(!0)});const As=Ms;class Ri{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const s=this;this.promise.then(n=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](n);s._listeners=null}),this.promise.then=n=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(n);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Xe(r,a,o),e(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new Ri(function(n){t=n}),cancel:t}}}const Kc=Ri;function Qc(i){return function(e){return i.apply(null,e)}}function tl(i){return E.isObject(i)&&i.isAxiosError===!0}const Oi={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:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Oi).forEach(([i,t])=>{Oi[t]=i});const el=Oi;function Gr(i){const t=new As(i),e=dr(As.prototype.request,t);return E.extend(e,As.prototype,t,{allOwnKeys:!0}),E.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return Gr(xe(i,n))},e}const q=Gr(Mi);q.Axios=As,q.CanceledError=Xe,q.CancelToken=Kc,q.isCancel=Lr,q.VERSION=Yr,q.toFormData=Es,q.AxiosError=B,q.Cancel=q.CanceledError,q.all=function(t){return Promise.all(t)},q.spread=Qc,q.isAxiosError=tl,q.mergeConfig=xe,q.AxiosHeaders=Xt,q.formToJSON=i=>kr(E.isHTMLForm(i)?new FormData(i):i),q.getAdapter=Fr.getAdapter,q.HttpStatusCode=el,q.default=q;const sl=q,Qt=window.crypto.subtle;Qt||console.warn("Crypto API not supported");function Vr(i){return La(encodeURIComponent(i)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function zr(i){let t=i.replaceAll("*","+").replaceAll("-","/");const e=t.length%4;return e&&(t=t.padEnd(t.length+(4-e),"=")),decodeURIComponent(Ra(t))}function il(i){return Vr(Xa(i))}function nl(i){return Ba(zr(i))}function Is(i){return new TextEncoder().encode(i)}function qr(i,t="utf-8"){return new TextDecoder(t).decode(i)}async function rl(i,t="AES-GCM"){const e=crypto.getRandomValues(new Uint8Array(12)),s=await Qt.generateKey({name:t,length:256},!1,["encrypt","decrypt"]),n=await Qt.encrypt({name:t,iv:e},s,Is(i));return{algorithm:t,iv:e,key:s,encryptedData:n}}async function al(i){const t=await Qt.decrypt({name:i.algorithm,iv:i.iv},i.key,i.encryptedData);return qr(t)}async function ol(i,t="ECDSA",e="SHA-384"){const{privateKey:s,publicKey:n}=await Qt.generateKey({name:t,namedCurve:"P-384"},!1,["sign","verify"]),r=Is(JSON.stringify(i)),a=await Qt.sign({name:t,hash:{name:e}},s,r);return{algorithm:t,hash:e,publicKey:n,signature:a,encodedData:r}}async function hl(i){return await Qt.verify({name:i.algorithm,hash:{name:i.hash}},i.publicKey,i.signature,i.encodedData)}async function Hr(i,t="SHA-256"){const e=await Qt.digest(t,Is(i));return Ya(e)}async function jr(i,t="SHA-256"){const e=JSON.stringify(i);return Hr(e,t)}class cl{instance;interceptors;requestCanceler;constructor(t){this.instance=sl.create(t),this.interceptors=t?.interceptors,this.requestCanceler=new Wr,this.instance.interceptors.request.use(e=>(this.requestCanceler.pendingRequest(e),e),e=>(this.requestCanceler.cancelRequest(e.config),e)),this.instance.interceptors.request.use(this.interceptors?.requestInterceptor,this.interceptors?.requestInterceptorCatch),this.instance.interceptors.response.use(this.interceptors?.responseInterceptor,this.interceptors?.responseInterceptorCatch),this.instance.interceptors.response.use(e=>new Promise((s,n)=>{this.requestCanceler.confirmRequest(e.config),e.status===200?s(e.data):n(e.data)}),async e=>{const{code:s="",config:n}=e;return!n||!n.retry||!n.retryStatus?.includes(s)||(n.retryCounted=n.retryCounted??0,n.retryCounted>=n.retry)?Promise.reject(e):(n.retryCounted++,await new Promise(r=>{setTimeout(()=>{r(void 0)},n.retryDelay)}),await this.request(n))})}request(t){return new Promise((e,s)=>{try{t.interceptors?.requestInterceptor&&(t=t.interceptors?.requestInterceptor(t)),this.instance.request(t).then(n=>{t.interceptors?.responseInterceptor&&(n=t.interceptors.responseInterceptor(n)),e(n)}).catch(n=>{t.interceptors?.responseInterceptorCatch&&(n=t.interceptors?.responseInterceptorCatch(n)),s(n)})}catch(n){t.interceptors?.requestInterceptorCatch&&t.interceptors.requestInterceptorCatch(n)}})}get(t,e){return this.request({...e,method:"get",url:t})}delete(t,e){return this.request({...e,method:"delete",url:t})}head(t,e){return this.request({...e,method:"head",url:t})}options(t,e){return this.request({...e,method:"options",url:t})}post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class Wr{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async pendingRequest(t){const e=await this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const s=new AbortController;t.signal=s.signal,this.pendingRequestMap.set(e,s)}}async confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}async cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}async cancelAllRequest(){for(const t of this.pendingRequestMap.values())t.abort();this.pendingRequestMap.clear()}async getRequestId(t){const{url:e,method:s,params:n,data:r}=t;return await jr({url:e,method:s,params:n,data:r})}}function ll(i,t,e,s,n){const r=t/e;let a=0,o=0;switch(i){case"aspectFit":r>=1?(a=s,o=a/r,o>n&&(o=n,a=o*r)):(o=n,a=o*r,a>s&&(a=s,o=a/r));break;case"aspectFill":r>=1?(o=n,a=o*r):(a=s,o=a/r);break;case"widthFix":a=s,o=a/r;break;case"heightFix":o=n,a=o*r;break;case"scaleToFill":default:a=s,o=n;break}return{width:a,height:o}}const Ds=new Map;async function ul(i){return new Promise((t,e)=>{ks(i,(s,n)=>s?e(s):t({width:n.width,height:n.height,aspectRatio:n.width/n.height}))})}const ks=(i,t)=>{if(Ds.has(i))return t(null,Ds.get(i));const e=new Image;e.onload=function(){Ds.set(i,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,Ds.get(i))},e.onerror=function(s){t(s,null)},e.src=i},dl=(i,t)=>{for(let e=0,s=i.length;e<s;e++){const n=i[e],{type:r}=n;if(r.split("/")[0]!=="image")continue;const a=new FileReader;a.onload=function(o){if(!o.target)return t("no reader target",null);const h=o.target.result,c=ln(h),l=new Blob([h]);Ni(l,(d,g)=>{if(!g)return t(d,null);ks(g,(y,p)=>{if(!p)return t(y,null);$r(g,(x,b)=>{if(!b)return t(x,null);const S={name:n.name,fileType:c,size:n.size,width:p.width,height:p.height,imgUrl:g,imageData:b,blob:l};return t(null,S)})})})},a.readAsArrayBuffer(n)}},$r=(i,t)=>{ks(i,(e,s)=>{if(!s)return t(e,null);const n=document.createElement("canvas"),r=n.getContext("2d");n.width=s.width,n.height=s.height,r.drawImage(s.element,0,0,n.width,n.height);const a=r.getImageData(0,0,n.width,n.height);return t(null,a)})},fl=(i,t=0,e=0)=>{const s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.drawImage(i,0,0,t,e),n.getImageData(0,0,t,e)},ml=(i,t=0,e=0)=>{const s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.drawImage(i,0,0,t,e),n.getImageData(0,0,t,e)},pl=i=>{const t=i.width,e=i.height,s=t*e*3,n=s+54,r=[66,77,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,s&255,s>>8&255,s>>16&255,s>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,h=i.data;let c="";const l=t<<2;let d=e;const g=String.fromCharCode;do{const p=l*(d-1);let x="";for(let b=0;b<t;b++){const S=b<<2;x+=g(h[p+S+2])+g(h[p+S+1])+g(h[p+S])}for(let b=0;b<o;b++)x+=String.fromCharCode(0);c+=x}while(--d);function y(p){if(!window.btoa)throw"btoa undefined";let x="";if(typeof p=="string")x=p;else for(let b=0;b<p.length;b++)x+=String.fromCharCode(p[b]);return btoa(x)}return y(r.concat(a))+y(c)},gl=i=>{const{width:t,height:e}=i,s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.putImageData(i,0,0,0,0,t,e),s.toDataURL("image/png")},yl=(i,t,e)=>{const{width:s,height:n}=i,r=document.createElement("canvas"),a=r.getContext("2d");r.width=s,r.height=n,a.putImageData(i,0,0,0,0,s,n);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)},Ni=(i,t)=>{const e=new FileReader;e.onload=function(s){s.target?t(null,s.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(i)},wl=(i,t)=>{Ni(i,function(e,s){if(s){const n=new Image;n.src=s}else t(e)})};function xl(i){const t=[],e=[],s=[];let n=0;for(let h=0,c=i.data.length;h<c;h+=4)t[n]=i.data[h],e[n]=i.data[h+1],s[n]=i.data[h+2],n+=1;const r=Fi(t),a=Fi(e),o=Fi(s);return"rgb("+r+","+a+","+o+")"}function Fi(i){const t={},e=[],s=[];for(let o=0;o<i.length;o++)t[i[o]]?e.push(i[o]):t[i[o]]=1;let n=0;for(let o=0;o<e.length;o++){n=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(n+=1),s[o]=n}const r=Math.max.apply(null,s);let a=0;for(;a<s.length;a++)if(s[a]===r)return;return e[a]}const bl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[(a*e+e-o-1)*4],n[h+1]=t[(a*e+e-o-1)*4+1],n[h+2]=t[(a*e+e-o-1)*4+2],n[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(n,e,s)},vl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[((s-a-1)*e+o)*4],n[h+1]=t[((s-a-1)*e+o)*4+1],n[h+2]=t[((s-a-1)*e+o)*4+2],n[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(n,e,s)},Sl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;n[h]=t[(o*e+e-a-1)*4],n[h+1]=t[(o*e+e-a-1)*4+1],n[h+2]=t[(o*e+e-a-1)*4+2],n[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(n,s,e)},Cl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;n[h]=t[((s-o-1)*e+a)*4],n[h+1]=t[((s-o-1)*e+a)*4+1],n[h+2]=t[((s-o-1)*e+a)*4+2],n[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(n,s,e)},El=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3;n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Tl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Pl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1]+t[h+2])/3>127?255:0;n[h]=l,n[h+1]=l,n[h+2]=l,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Ml=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=255-t[h],n[h+1]=255-t[h+1],n[h+2]=255-t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Al=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Il=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Dl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=0,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},kl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},_l=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Ll=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Rl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h+1]+t[h+2])/2;n[h]=t[h],n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Ol=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+2])/2;n[h]=c,n[h+1]=t[h+1],n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Nl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1])/2;n[h]=c,n[h+1]=c,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Fl=i=>Jr(i,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Bl=i=>Jr(i,[-1,-1,-1,-1,8,-1,-1,-1,-1]),Xl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=t[h+2],n[h+3]=255}return new ImageData(n,e,s)},Yl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)n[h]=255,n[h+1]=255,n[h+2]=255,n[h+3]=255;else{const c=Zr([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);n[h]=c[0],n[h+1]=c[1],n[h+2]=c[2],n[h+3]=c[3]}}return new ImageData(n,e,s)},Ul=(i,t,e,s,n,r=!1,a)=>{const{data:o,width:h,height:c}=i;let l=n,d=s,g=t,y=e;if(l<0?l=0:l>h&&(l=h),d<0?d=0:d>c&&(d=c),g<1?g=1:g>h&&(g=h),y<1?y=1:y>c&&(y=c),l+g>h&&(g=h-l),d+y>c&&(y=c-d),r){const p=new Uint8ClampedArray(o.length);for(let b=0;b<c;b++)for(let S=0;S<h;S++){const C=(b*h+S)*4;S>=l&&S<=l+g&&b>=d&&b<=d+y?(p[C]=o[C],p[C+1]=o[C+1],p[C+2]=o[C+2],p[C+3]=o[C+3]):(p[C]=255,p[C+1]=255,p[C+2]=255,p[C+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(p,h,c)}else{const p=new Uint8ClampedArray(g*y*4);for(let b=d;b<=d+y;b++)for(let S=l;S<=l+g;S++){const C=((b-d)*g+S-l)*4,L=(b*h+S)*4;p[C]=o[L],p[C+1]=o[L+1],p[C+2]=o[L+2],p[C+3]=o[L+3]}return new ImageData(p,g,y)}},Gl=(i,t,e,s)=>{const{data:n,width:r,height:a}=i;let o=t;o>Math.floor(r/2)&&(o=Math.floor(r/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const h=new Uint8ClampedArray(n.length);for(let l=0;l<a;l++)for(let d=0;d<r;d++){const g=(l*r+d)*4;let y=-1;d<o?l<o?y=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(l-(a-o),2))):d>r-o-1&&(l<o?y=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(y)>o?(h[g]=255,h[g+1]=255,h[g+2]=255,h[g+3]=s||e.toUpperCase()==="PNG"?0:255):(h[g]=n[g],h[g+1]=n[g+1],h[g+2]=n[g+2],h[g+3]=s||e.toUpperCase()==="PNG"?n[g+3]:255)}return new ImageData(h,r,a)},Vl=(i,t,e,s,n,r=1e4)=>{const a=new Image;a.src=i;const o=document.createElement("canvas"),h=o.getContext("2d");return o.width=r,o.height=r,h.drawImage(a,0,0,t,e,0,0,s,n),h.getImageData(0,0,s,n)},zl=(i,t)=>{const{data:e,width:s,height:n}=i,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;r[c]=Math.max(Math.min(e[c]+t,255),0),r[c+1]=Math.max(Math.min(e[c+1]+t,255),0),r[c+2]=Math.max(Math.min(e[c+2]+t,255),0),r[c+3]=e[c+3]}return new ImageData(r,s,n)},ql=(i,t,e=!1)=>{const{data:s,width:n,height:r}=i,a=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<n;c++){const l=(h*n+c)*4;s[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=s[l],a[l+1]=s[l+1],a[l+2]=s[l+2]);let d=s[l+3];e?d=Math.max(Math.min(Math.floor(255*t),255),0):d=Math.max(Math.min(Math.floor(d+255*t),255),0),a[l+3]=d}return new ImageData(a,n,r)},Hl=(i,t,e,s)=>{const{data:n,width:r,height:a}=i,{data:o,width:h,height:c}=t;let l=e,d=s;e+c>a&&(l=a-c),s+h>r&&(d=r-h);const g=new Uint8ClampedArray(n.length);for(let p=0;p<a;p++)for(let x=0;x<r;x++){const b=(p*r+x)*4;if(x<d||x>d+h||p<=l||p>=l+c)g[b]=n[b],g[b+1]=n[b+1],g[b+2]=n[b+2],g[b+3]=n[b+3];else{const S=(p*r+x-((l+1)*r+(p-(l+1))*(r-h))+h-d-1)*4,C=[o[S],o[S+1],o[S+2],o[S+3]],L=[n[b],n[b+1],n[b+2],n[b+3]],R=Zr(C,L);g[b]=R[0],g[b+1]=R[1],g[b+2]=R[2],g[b+3]=R[3]}}return new ImageData(g,r,a)},jl=(i,t,e,s,n,r=10)=>{const{data:a,width:o,height:h}=i;let c=n,l=s,d=t,g=e;c<0?c=0:c>o&&(c=o),l<0?l=0:l>h&&(l=h),d<1?d=1:d>o&&(d=o),g<1?g=1:g>h&&(g=h),c+d>o&&(d=o-c),l+g>h&&(g=h-l);const y=new Uint8ClampedArray(a.length);for(let x=0;x<h;x++)for(let b=0;b<o;b++){const S=(x*o+b)*4;if(b>=c&&b<=c+d&&x>=l&&x<=l+g){const C=Math.floor((b-c)/r),L=Math.floor((x-l)/r);let R=Math.floor(r*(C+1)-r/2+c),Y=Math.floor(r*(L+1)-r/2+l);R>o-1&&(R=o-1),Y>h-1&&(Y=h-1);const X=(Y*o+R)*4;y[S]=a[X],y[S+1]=a[X+1],y[S+2]=a[X+2],y[S+3]=a[X+3]}else y[S]=a[S],y[S+1]=a[S+1],y[S+2]=a[S+2],y[S+3]=a[S+3]}return new ImageData(y,o,h)},Wl=(i,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:s,width:n,height:r}=i,{data:a}=t,o=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let d=0;d<r;d++)for(let g=0;g<n;g++){const y=(d*n+g)*4,p=a[y],x=a[y+1],b=a[y+2],S=a[y+3];p===h.r&&x===h.g&&b===h.b&&S===h.a&&c.a!==0?(o[y]=c.r,o[y+1]=c.g,o[y+2]=c.b,o[y+3]=c.a):(o[y]=s[y],o[y+1]=s[y+1],o[y+2]=s[y+2],o[y+3]=s[y+3])}return new ImageData(o,n,r)}return i},Jr=(i,t)=>{const{data:e,width:s,height:n}=i,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;for(let l=0;l<3;l++){const d=c+l;h===0||h===s-1||o===0||o===n-1?r[d]=e[d]:r[d]=t[0]*e[d-s*4-4]+t[1]*e[d-s*4]+t[2]*e[d-s*4+4]+t[3]*e[d-4]+t[4]*e[d]+t[5]*e[d+4]+t[6]*e[d+s*4-4]+t[7]*e[d+s*4]+t[8]*e[d+s*4+4]}r[c+3]=e[c+3]}return new ImageData(r,s,n)},Zr=(i,t)=>{if(i&&i.length===4&&t&&t.length===4){const e=i[3],s=t[3];if(e===255||s===0)return i;if(e===0)return t;{const n=e/255,r=s/255,a=Math.max(Math.min(Math.floor(i[0]*n+t[0]*r*(1-n)),255),0),o=Math.max(Math.min(Math.floor(i[1]*n+t[1]*r*(1-n)),255),0),h=Math.max(Math.min(Math.floor(i[2]*n+t[2]*r*(1-n)),255),0),c=Math.max(Math.min(Math.floor((n+r*(1-n))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},Bi=function(){const i=[];return{writeByte(t){i.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let n=0;n<s;n++)this.writeByte(t[n+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return i},toString(){let t="[";for(let e=0,s=i.length;e<s;e++)e>0&&(t+=","),t+=i[e];return t+="]",t}}},Kr=function(){let i=0,t=0,e=0,s="";const n=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)},r=function(a){s+=String.fromCharCode(n(a&63))};return{writeByte(a){for(i=i<<8|a&255,t+=8,e+=1;t>=6;)r(i>>>t-6),t-=6},flush(){if(t>0&&(r(i<<6-t),i=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)s+="="}},toString(){return s}}},Qr=function(i,t,e){const s=new Array(i*i),n=function(o){const h=o;let c=0,l=0;return{write(d,g){if(d>>>g)throw new Error("length over");for(;c+g>=8;)h.writeByte(255&(d<<c|l)),g-=8-c,d>>>=8-c,l=0,c=0;l=d<<c|l,c=c+g},flush(){c>0&&h.writeByte(l)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let l=o+1;const d=a();for(let b=0;b<h;b++)d.add(String.fromCharCode(b));d.add(String.fromCharCode(h)),d.add(String.fromCharCode(c));const g=Bi(),y=n(g);y.write(h,l);let p=0,x=String.fromCharCode(s[p]);for(p+=1;p<s.length;){const b=String.fromCharCode(s[p]);p+=1,d.contains(x+b)?x=x+b:(y.write(d.indexOf(x),l),d.size()<4095&&(d.size()==1<<l&&(l+=1),d.add(x+b)),x=b)}return y.write(d.indexOf(x),l),y.write(c,l),y.flush(),g.toByteArray()},a=function(){const o={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);o[c]=h,h+=1},size(){return h},indexOf(c){return o[c]},contains(c){return typeof o[c]<"u"}}};return{setPixel(o,h,c){s[h*i+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(i),o.writeShort(i),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(ae("0x"+t[1]+t[2])),o.writeByte(ae("0x"+t[3]+t[4])),o.writeByte(ae("0x"+t[5]+t[6])),o.writeByte(ae("0x"+e[1]+e[2])),o.writeByte(ae("0x"+e[3]+e[4])),o.writeByte(ae("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(i),o.writeShort(i),o.writeByte(0);const h=2,c=r(h);o.writeByte(h);let l=0;for(;c.length-l>255;)o.writeByte(255),o.writeBytes(c,l,255),l+=255;o.writeByte(c.length-l),o.writeBytes(c,l,c.length-l),o.writeByte(0),o.writeString(";")}}},ta=function(i,t,e,s){const n=Qr(i,t,e);for(let c=0;c<i;c++)for(let l=0;l<i;l++)n.setPixel(l,c,s(l,c));const r=Bi();n.write(r);const a=Kr(),o=r.toByteArray();for(let c=0,l=o.length;c<l;c++)a.writeByte(o[c]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},gt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ye={M:0,L:1,H:2,Q:3},te={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},J={glog:function(i){if(i<1)throw new Error("glog("+i+")");return J.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return J.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let i=0;i<8;i++)J.EXP_TABLE[i]=1<<i;for(let i=8;i<256;i++)J.EXP_TABLE[i]=J.EXP_TABLE[i-4]^J.EXP_TABLE[i-5]^J.EXP_TABLE[i-6]^J.EXP_TABLE[i-8];for(let i=0;i<255;i++)J.LOG_TABLE[J.EXP_TABLE[i]]=i;const G={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(i){let t=i<<10;for(;G.getBCHDigit(t)-G.getBCHDigit(G.G15)>=0;)t^=G.G15<<G.getBCHDigit(t)-G.getBCHDigit(G.G15);return(i<<10|t)^G.G15_MASK},getBCHTypeNumber:function(i){let t=i<<12;for(;G.getBCHDigit(t)-G.getBCHDigit(G.G18)>=0;)t^=G.G18<<G.getBCHDigit(t)-G.getBCHDigit(G.G18);return i<<12|t},getBCHDigit:function(i){let t=0;for(;i!=0;)t++,i>>>=1;return t},getPatternPosition:function(i){return G.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,t,e){switch(i){case te.PATTERN000:return(t+e)%2==0;case te.PATTERN001:return t%2==0;case te.PATTERN010:return e%3==0;case te.PATTERN011:return(t+e)%3==0;case te.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case te.PATTERN101:return t*e%2+t*e%3==0;case te.PATTERN110:return(t*e%2+t*e%3)%2==0;case te.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){let t=new be([1],0);for(let e=0;e<i;e++)t=t.multiply(new be([1,J.gexp(e)],0));return t},getLengthInBits:function(i,t){if(1<=t&&t<10)switch(i){case gt.MODE_NUMBER:return 10;case gt.MODE_ALPHA_NUM:return 9;case gt.MODE_8BIT_BYTE:return 8;case gt.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(t<27)switch(i){case gt.MODE_NUMBER:return 12;case gt.MODE_ALPHA_NUM:return 11;case gt.MODE_8BIT_BYTE:return 16;case gt.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(t<41)switch(i){case gt.MODE_NUMBER:return 14;case gt.MODE_ALPHA_NUM:return 13;case gt.MODE_8BIT_BYTE:return 16;case gt.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+t)},getLostPoint:function(i){const t=i.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=i.isDark(r,a);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let l=-1;l<=1;l++)a+l<0||t<=a+l||c==0&&l==0||h==i.isDark(r+c,a+l)&&o++;o>5&&(e+=3+o-5)}for(let r=0;r<t-1;r++)for(let a=0;a<t-1;a++){let o=0;i.isDark(r,a)&&o++,i.isDark(r+1,a)&&o++,i.isDark(r,a+1)&&o++,i.isDark(r+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)i.isDark(r,a)&&!i.isDark(r,a+1)&&i.isDark(r,a+2)&&i.isDark(r,a+3)&&i.isDark(r,a+4)&&!i.isDark(r,a+5)&&i.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)i.isDark(a,r)&&!i.isDark(a+1,r)&&i.isDark(a+2,r)&&i.isDark(a+3,r)&&i.isDark(a+4,r)&&!i.isDark(a+5,r)&&i.isDark(a+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)i.isDark(a,r)&&s++;const n=Math.abs(100*s/t/t-50)/5;return e+=n*10,e}};class be{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let s=0;for(;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+e);for(let n=0;n<t.length-s;n++)this.num[n]=t[n+s]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let s=0;s<this.getLength();s++)for(let n=0;n<t.getLength();n++)e[s+n]^=J.gexp(J.glog(this.get(s))+J.glog(t.get(n)));return new be(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=J.glog(this.get(0))-J.glog(t.get(0)),s=new Array(this.getLength());for(let n=0;n<this.getLength();n++)s[n]=this.get(n);for(let n=0;n<t.getLength();n++)s[n]^=J.gexp(J.glog(t.get(n))+e);return new be(s,0).mod(t)}}class Yt{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const s=Yt.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const n=s.length/3,r=[];for(let a=0;a<n;a++){const o=s[a*3+0],h=s[a*3+1],c=s[a*3+2];for(let l=0;l<o;l++)r.push(new Yt(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Ye.L:return Yt.RS_BLOCK_TABLE[(t-1)*4+0];case Ye.M:return Yt.RS_BLOCK_TABLE[(t-1)*4+1];case Ye.Q:return Yt.RS_BLOCK_TABLE[(t-1)*4+2];case Ye.H:return Yt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class ea{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let s=0;s<e;s++)this.putBit((t>>>e-s-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class $l{mode;data;constructor(t){this.mode=gt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,s=this.data.length;e<s;e++)t.put(this.data.charCodeAt(e),8)}}class ee{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Ye[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new $l(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let t=1;for(t=1;t<40;t++){const e=Yt.getRSBlocks(t,this.errorCorrectLevel),s=new ea;let n=0;for(let r=0;r<e.length;r++)n+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];s.put(a.mode,4),s.put(a.getLength(),G.getLengthInBits(a.mode,t)),a.write(s)}if(s.getLengthInBits()<=n*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++)this.modules[s][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=ee.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(let n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=s&&s<=6&&(n==0||n==6)||0<=n&&n<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=n&&n<=4?this.modules[t+s][e+n]=!0:this.modules[t+s][e+n]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const n=G.getLostPoint(this);(s==0||t>n)&&(t=n,e=s)}return e}createMovieClip(t,e,s){const n=t.createEmptyMovieClip(e,s),r=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*r;for(let h=0;h<this.modules[a].length;h++){const c=h*r;this.modules[a][h]&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+r,o),n.lineTo(c+r,o+r),n.lineTo(c,o+r),n.endFill())}}return n}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=G.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let s=0;s<t.length;s++){const n=t[e],r=t[s];if(this.modules[n][r]==null)for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a==-2||a==2||o==-2||o==2||a==0&&o==0?this.modules[n+a][r+o]=!0:this.modules[n+a][r+o]=!1}}setupTypeNumber(t){const e=G.getBCHTypeNumber(this.typeNumber);for(let s=0;s<18;s++){const n=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=n}for(let s=0;s<18;s++){const n=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=n}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,n=G.getBCHTypeInfo(s);for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<6?this.modules[r][8]=a:r<8?this.modules[r+1][8]=a:this.modules[this.moduleCount-15+r][8]=a}for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=a:r<9?this.modules[8][15-r-1+1]=a:this.modules[8][15-r-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let s=-1,n=this.moduleCount-1,r=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let h=0;h<2;h++)if(this.modules[n][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),G.getMask(e,n,o-h)&&(c=!c),this.modules[n][o-h]=c,r--,r==-1&&(a++,r=7)}if(n+=s,n<0||this.moduleCount<=n){n-=s,s=-s;break}}}static createData(t,e,s){const n=Yt.getRSBlocks(t,e),r=new ea;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),G.getLengthInBits(h.mode,t)),h.write(r)}let a=0;for(let o=0;o<n.length;o++)a+=n[o].dataCount;if(r.getLengthInBits()>a*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+a*8+")");for(r.getLengthInBits()+4<=a*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=a*8||(r.put(ee.PAD0,8),r.getLengthInBits()>=a*8));)r.put(ee.PAD1,8);return ee.createBytes(r,n)}static createBytes(t,e){let s=0,n=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let d=0;d<e.length;d++){const g=e[d].dataCount,y=e[d].totalCount-g;n=Math.max(n,g),r=Math.max(r,y),a[d]=new Array(g);for(let S=0;S<a[d].length;S++)a[d][S]=255&t.buffer[S+s];s+=g;const p=G.getErrorCorrectPolynomial(y),b=new be(a[d],p.getLength()-1).mod(p);o[d]=new Array(p.getLength()-1);for(let S=0;S<o[d].length;S++){const C=S+b.getLength()-o[d].length;o[d][S]=C>=0?b.get(C):0}}let h=0;for(let d=0;d<e.length;d++)h+=e[d].totalCount;const c=new Array(h);let l=0;for(let d=0;d<n;d++)for(let g=0;g<e.length;g++)d<a[g].length&&(c[l++]=a[g][d]);for(let d=0;d<r;d++)for(let g=0;g<e.length;g++)d<o[g].length&&(c[l++]=o[g][d]);return c}}const sa=Math.ceil,Ue=Math.floor,ia=Math.round;function Jl(i,t){const e=cn(i),s=t?.ecc||"H",n=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new ee(r,s);c.addData(e),c.make();const l=c.getModuleCount(),d=(n-a*2)/l,g=a,y=n-a;return ta(n,o,h,function(p,x){if(g<=p&&p<y&&g<=x&&x<y){const b=Ue((p-g)/d),S=Ue((x-g)/d);return c.isDark(S,b)?0:1}else return 1})}function Zl(i,t){const e=t.x||0,s=t.y||0,n=cn(i),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Ue(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",d=t.background||"#ffffff",g=new ee(c,a);g.addData(n),g.make();const y=g.getModuleCount(),p=(o-h*2)/y;r.fillStyle=d,r.fillRect(e,s,o,o);for(let x=0;x<y;x++)for(let b=0;b<y;b++){const S=sa((b+1)*p)-Ue(b*p),C=sa((x+1)*p)-Ue(x*p);r.fillStyle=g.isDark(x,b)?l:d,r.fillRect(e+ia(b*p)+h,s+ia(x*p)+h,S,C)}}class st extends U{shapesCountChange=!1;constructor(t){super(t)}shapeInit(){}frameStart(t){return this.shapesCountChange&&(this.shapesCountChange=!1,this.shapes.forEach(e=>{e.parent=this,e.initPathD()}),this.pathd=this.initPathD(),this.shapes.forEach(e=>{!e.forceCXY&&!e.independentTransformInGroup&&(e.cX=this.cX-e.diffXInGroup,e.cY=this.cY-e.diffYInGroup)})),super.frameStart(t)}frameUpdate(t,e){this.shapes.forEach(s=>{!s.independentTransformInGroup&&!s.isDragging&&(s.x=this.x+s.diffXInGroup,s.y=this.y+s.diffYInGroup,s.degree=this.degree+s.diffDegreeInGroup,s.scalarX=this.scalarX*s.diffScalarXInGroup,s.scalarY=this.scalarY*s.diffScalarYInGroup)}),super.frameUpdate(t,e)}addShape(t){(Array.isArray(t)?t:[t]).forEach(e=>{this.shapes.findIndex(s=>s.id==e.id)==-1&&(e.on("draging",(s,n)=>{this.enableDrag&&(this.x+=s,this.y+=n,this.emit("draging",s,n,e))}),this.shapes.push(e),this.shapesCountChange=!0)})}getBoundingClientRect(){const t=[],e=[];this.shapes.forEach(h=>{const c=h.getBoundingClientRect();c&&(t.push(c.x,c.x+c.width),e.push(c.y,c.y+c.height))});const s=this.pathd?.getBoundingClientRect();if(s&&(s.width||s.height)&&(t.push(s.x,s.x+s.width),e.push(s.y,s.y+s.height)),t.length==0||e.length==0)return null;const n=Math.min.apply(0,t),r=Math.min.apply(0,e),a=Math.max.apply(0,t),o=Math.max.apply(0,e);return{x:n,y:r,width:a-n,height:o-r}}setAttrs(t,e){typeof t!="string"?(super.setAttr(t),this.shapes.forEach(s=>{s.setAttr(t)})):e&&(super.setAttr(t,e),this.shapes.forEach(s=>{s.setAttr(t,e)}))}sortPathD(){this.shapes=this.shapes.map(t=>{const e=t.initPathD();return{shape:t,perimeter:e.perimeterPoints()}}).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendFill(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.expendFill(this);for(let n=s;n<e;n++){const a=t.shapes[n].initPathD().polymorphPoints,o=a[0],h=a[1],c=[["M",o,h]];for(let l=2;l+5<a.length;l+=6)c.push(["C",o,h,o,h,o,h]);this.addShape(new U({attrs:{...t.shapes[n].getAttrs()},d:c}))}}strokeDashTween(t,e){switch(e?.type){case"sequence":const s=this.shapes.length-1;this.shapes.forEach((o,h)=>{o.strokeDashTween(t,{...e,delay:h,onStart:()=>{h==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{h==s&&e?.onGroupComplete?.()}})});break;case"parallel":default:const n=new gs({frameDuration:t}),r={},a={};this.shapes.forEach((o,h)=>{const c=Et(o.getTotalLength(),0);r[`offset_${h}`]=c,a[`offset_${h}`]=0,o.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),n.addTween(r,a,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,h)=>{for(let c in o){const l=Hs(c).number;this.shapes[l].setAttr("strokeDashoffset",""+Et(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),n.play();break}}}class ce extends U{toX;toY;constructor(t){super(t),this.toX=t?.toX||0,this.toY=t?.toY||0;let e=this.toX-this.x,s=this.toY-this.y;return new Proxy(this,{set(n,r,a,o){switch(r){case"x":n.toX=a+e;break;case"y":n.toY=a+s;break;case"toX":e=a-n.x;break;case"toY":s=a-n.y;break}return Reflect.set(n,r,a,o)}})}toSVGPathData(){return[["m",0,0],["l",this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.lineTo(this.toX-this.x,this.toY-this.y)}intersection(t){const e=new On({x:this.x,y:this.y,toX:this.toX,toY:this.toY}),s=new On({x:t.x,y:t.y,toX:t.toX,toY:t.toY});return e.intersection(s)}}class Kl extends U{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["m",0,0],["q",t-this.x,e-this.y,this.toX-this.x,this.toY-this.y]]}else return[["m",0,0],["q",this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e-this.x,s-this.y,this.toX-this.x,this.toY-this.y)}else t.quadraticCurveTo(this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y)}}class na extends er{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,s)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,s)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const s=eo(e);for(let n of s.stylesheet.rules)for(let r of n.declarations)for(let a of n.selectors)this.globalStyles[a]=this.globalStyles[a]||[],this.globalStyles[a].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,s)=>{let n=this.groups.length;for(;n--;)if(this.groups[n]!=this.currentItem){let r="",a="";for(let o in this.groups[n])o=="transform"?r=this.groups[n].transform:o=="class"&&this.globalStyles["."+this.groups[n][o]]?a=this.globalStyles["."+this.groups[n][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[n][o]]?a=this.globalStyles["#"+this.groups[n][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[n][o]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=a:this.currentItem.style=a+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),Yi(this.currentItem.style,this.currentItem,Ui)}switch(this.processAttrs(e,s),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let s=[],n;switch(t){case"svg":let r="",a="";if(e.width&&e.height)r=e.width,a=e.height;else if(e.viewBox){const o=e.viewBox.split(/\s+/gi);o.length==4&&(r=String(parseFloat(o[2])-parseFloat(o[0])),a=String(parseFloat(o[3])-parseFloat(o[1])))}r&&a&&this.items.push({type:"viewbox",width:r,height:a});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":n={},e.style&&Yi(e.style,n),n.offset=n.offset||e.offset,n.color=n["stop-color"]||e["stop-color"],n.opacity=n["stop-opacity"]||e["stop-opacity"],~(n.offset+"").indexOf("%")?n.offset=parseFloat(n.offset):n.offset=parseFloat(n.offset)*100,n.offset=+n.offset.toFixed(2),this.grad.stops.push(n);break;case"linearGradient":this.grad.angle=(360+Xi(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?s.push(n.color+":"+n.offset):s.push(n.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?s.push(n.color+":"+n.offset):s.push(n.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break}for(let r in e){const a=e[r];if(Ui.includes(r)&&(this.currentItem[r]=a),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&Yi(a,this.currentItem,Ui),r==="transform"&&(this.currentItem.transform=a+(this.currentItem.transform||" ")),r==="fill"){const o=a.match(/url\(#([^)]+)\)/);if(o){const h=o[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+a+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=a),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=a)}}addToItems(){this.items.push(this.currentItem)}}function Xi(i,t,e,s,n,r){if(typeof n>"u"||typeof r>"u"){const a=i-e,o=t-s;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return Xi(i,t,n,r)-Xi(e,s,n,r)}function Yi(i,t,e){const s=(i+"").split(";"),n=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){let o=s[r].split(":"),h=o[0].replace(n,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(n,""))}}const Ui=["id","class","viewBox","width","height","x","y","cx","cy","r","rx","ry","cursor","opacity","src","fill","fill-opacity","stroke","stroke-dasharray","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","font","font-family","font-size","font-style","font-weight","letter-spacing"];class Ql{app;rootEl;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e,s){this.app=t,this.rootEl=mt.createSVGElement("svg"),I.empty(this.app.container),I.insert(this.app.container,this.rootEl),e&&s?this.setSize(e,s):(this.setSize(this.app.width,this.app.height),this.app.on("resize",()=>{this.setSize(this.app.width,this.app.height)})),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(n,r)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=r.dx,this.dragDy+=r.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let n of this.shapes)if(this.currentMouseInShape==n){n.emit("clicked");let r=n.parent;for(;r;)r.emit("clicked",n),r=r.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}setSize(t,e){return I.attribute(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return mt.downloadFromSVGElement(this.rootEl)}_addDrawShape(t){this.shapes.findIndex(e=>e.id==t.id)===-1&&(this.shapes.push(t),t instanceof st&&t.shapes.forEach(e=>{this._addDrawShape(e)}))}path(t){(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow){e.el&&(I.remove(e.el),delete e.el);continue}if(e.frameStart(this.app.mousePoint),e.el||(e instanceof Ge?e.el=this.text(e.text,e.x,e.y,pn(e.getAttrs(),(n,r)=>typeof r=="string")):(e.el=mt.createSvgPath(e.toSVGPathD(),e.id),I.insert(this.rootEl,e.el))),e.followMouse&&(!es(e.x,this.app.mousePoint.x,5)||!es(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const n=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,n||r){if(e.x+=n,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",n,r)}}else e.isDragging=!1;e instanceof Ge&&(e.setAttr("x",String(e.x)),e.setAttr("y",String(e.y))),e.frameUpdate(this.app.mousePoint);const s=e.toSVGPathD();if(this.attr(e,pn(e.getAttrs(),(n,r)=>typeof r=="string")),this.attr(e,"d",s),!this.currentMouseInShape){const n=e.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||e.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||!1;e.isMouseIn=n,n&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint)}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}delete(t){(Array.isArray(t)?t:[t]).forEach(e=>{e.el&&I.remove(e.el),delete e.el,this.shapes=this.shapes.filter(s=>s.id!==e.id)})}clear(){this.shapes.forEach(t=>{t.el&&I.remove(t.el),delete t.el}),I.empty(this.rootEl),this.shapes=[]}attr(t,e,s){const n=t.el||t;return n instanceof SVGElement?e===void 0&&s===void 0?I.attribute(n):typeof e=="string"&&s===void 0?I.attribute(n,ct(e))||"":(typeof e=="object"?I.attribute(n,e):typeof e=="string"&&s!==void 0&&I.attribute(n,ct(e),s),this):this}circle(t,e,s){return this.path(new Ut({x:t,y:e,radius:s}))}circleEl(t,e,s){const n=mt.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(s)});return I.insert(this.rootEl,n),n}ellipse(t,e,s,n){return this.path(new aa({x:t,y:e,rx:s,ry:n}))}ellipseEl(t,e,s,n){const r=mt.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(s),ry:String(n)});return I.insert(this.rootEl,r),r}rect(t,e,s,n){return this.path(new Gt({x:t,y:e,width:s,height:n}))}rectEl(t,e,s,n){const r=mt.createSVGElement("rect",{x:String(t),y:String(e),width:String(s),height:String(n)});return I.insert(this.rootEl,r),r}image(t,e,s,n,r){}text(t,e,s,n){const r=mt.createSVGElement("text",{x:String(e),y:String(s)});return I.html(r,t),this.attr(r,Object.assign({"alignment-baseline":"middle"},n)),I.insert(this.rootEl,r),r}textWithTspan(t,e,s,n){const r=n?.["line-height"]||"1.2em",a=mt.createSVGElement("text",{x:String(e),y:String(s)});return t.split(`
|
|
41
|
+
`).forEach((o,h)=>{if(o.trim()){const c=mt.createSVGElement("tspan",{x:String(e),dy:h>0?r:"0"});I.html(c,o),I.insert(a,c),this.attr(c,Object.assign({"alignment-baseline":"middle"},n))}}),I.insert(this.rootEl,a),a}}class tu extends st{svgWidth=0;svgHeight=0;width=0;height=0;constructor(t){super(t);const e=new na(t.svg).parse();for(let s=0,n=e.length;s<n;s++){const r=e[s];if(r.type=="viewbox"&&r.width&&r.height){if(this.svgWidth=parseFloat(r.width),this.svgHeight=parseFloat(r.height),t.width){const l=this.svgWidth/this.svgHeight;this.width=t.width,this.height=this.width/l}else this.width=this.svgWidth,this.height=this.svgHeight;continue}if(r.type!="path"||!oe.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=oe.absolutizeSVGPath(oe.parseSVGPath(r.path)),h=[];let c=[];for(let l=0,d=o.length;l<d;l++){const g=o[l];c.push(g),g[0].toLowerCase()=="z"&&(h.push(c),c=[])}c.length&&h.push(c),h.forEach(l=>{const d=mi(r.transform??"");d.scale(this.width&&this.svgWidth?this.width/this.svgWidth:1),this.addShape(new U({...t,attrs:{...a,...t?.attrs||{}},d:l,originMatrix:d}))})}}shapeInit(){this.trim()}}class Ut extends U{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return{x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2}}toSVGPathData(){return this.radius?[["m",0,-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["m",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius&&this.mass===t.mass}midPointBtw(t){return{x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2}}length(){return as(this.x,this.y)}scalar(t){return this.x*=t,this.y*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y;return{x:s*t.x-e*t.y,y:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y}}div(t){return{x:this.x/t.x,y:this.y/t.y}}add(t){return{x:this.x+t.x,y:this.y+t.y}}sub(t){return{x:this.x-t.x,y:this.y-t.y}}dot(t){return this.x*t.x+this.y*t.y}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y}}checkCollision(t){const e=t.x-this.x,s=t.y-this.y;if(Math.sqrt(e*e+s*s)<this.radius+t.radius){const r=Math.atan2(s,e),a={x:0,y:0},o=Tt(-r,e,s),h=Tt(-r,this.vx,this.vy),c=Tt(-r,t.vx,t.vy),l=h.x-c.x;h.x=((this.mass-t.mass)*h.x+2*t.mass*c.x)/(this.mass+t.mass),c.x=l+h.x;const d=Math.abs(h.x)+Math.abs(c.x),g=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/d*g,o.x+=c.x/d*g;const y=Tt(r,a.x,a.y),p=Tt(r,o.x,o.y);t.x=this.x+p.x,t.y=this.y+p.y,this.x=this.x+y.x,this.y=this.y+y.y;const x=Tt(r,h.x,h.y),b=Tt(r,c.x,c.y);this.vx=x.x,this.vy=x.y,t.vx=b.x,t.vy=b.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,s=t.wall.x,n=t.wall.y,r=t.wall.x+t.wall.width,a=t.wall.y+t.wall.height;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=e):this.x-this.radius<s&&(this.x=s+this.radius,this.vx*=e),this.y+this.radius>a?(this.y=a-this.radius,this.vy*=e):this.y-this.radius<n&&(this.y=n+this.radius,this.vy*=e)}}class ra extends U{points;isStraight;constructor(t){if(super(t),this.points=t.points,this.points.length<3)throw new Error("points length must >= 3");this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0}toSVGPathData(){const t=[],e=this.points.length;if(this.isStraight){t.push(["M",this.points[0].x,this.points[0].y]);for(let s=1;s<=e-1;s++)t.push(["L",this.points[s].x,this.points[s].y]);t.push(["Z"])}else{const s=(this.points[0].x+this.points[e-1].x)/2,n=(this.points[0].y+this.points[e-1].y)/2;t.push(["M",s,n]);for(let r=0;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.push(["Q",this.points[r].x,this.points[r].y,a,o])}t.push(["Q",this.points[e-1].x,this.points[e-1].y,s,n])}return t}toCanvasContext(t){t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let s=1;s<=e-1;s++)t.lineTo(this.points[s].x,this.points[s].y);t.closePath()}else{const s=(this.points[0].x+this.points[e-1].x)/2,n=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(s,n);for(let r=0;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.quadraticCurveTo(this.points[r].x,this.points[r].y,a,o)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,s,n)}}isContainPoint(t,e){const s=this.points.length;let n=!1;const r=2e-10;for(let a=0,o=s-1;a<s;o=a,a++){const h=this.points[a].x,c=this.points[a].y,l=this.points[o].x,d=this.points[o].y;if(h===t&&c===e||l===t&&d===e||e===c&&e===d)return!0;if(e>=c&&e<d||e<c&&e>=d){const g=(l-h)/(d-c),y=h+g*(e-c);if(y===t||Math.abs(y-t)<r)return!0;y>t&&(n=!n)}}return n}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}}class Gt extends U{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromCubicBezier(t,e,s,n,r,a,o,h){const c=new lt({x:t,y:e,c1x:s,c1y:n,c2x:r,c2y:a,toX:o,toY:h});return new Gt(c.getBoundingClientRect())}getBoundingClientRect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toSVGPathData(){return this.borderRadius?[["m",this.borderRadius,0],["l",this.width-this.borderRadius*2,0],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,this.borderRadius],["l",0,this.height-this.borderRadius*2],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,this.borderRadius],["l",this.borderRadius*2-this.width,0],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,-this.borderRadius],["l",0,this.borderRadius*2-this.height],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,-this.borderRadius],["z"]]:[["m",0,0],["l",this.width,0],["l",0,this.height],["l",-this.width,0],["z"]]}toCanvasContext(t){t.beginPath(),this.borderRadius<=0?t.rect(0,0,this.width,this.height):(t.moveTo(0,this.borderRadius),t.lineTo(0,this.height-this.borderRadius),t.quadraticCurveTo(0,this.height,this.borderRadius,this.height),t.lineTo(this.width-this.borderRadius,this.height),t.quadraticCurveTo(this.width,this.height,this.width,this.height-this.borderRadius),t.lineTo(this.width,this.borderRadius),t.quadraticCurveTo(this.width,0,this.width-this.borderRadius,0),t.lineTo(this.borderRadius,0),t.quadraticCurveTo(0,0,0,this.borderRadius)),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height&&this.borderRadius===t.borderRadius}isIntersectRect(t){return!(this.x+this.width<t.x||t.x+t.width<this.x||this.y+this.height<t.y||t.y+t.height<this.y)}isContainPoint(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}}class aa extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return{x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2}}toSVGPathData(){return[["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class eu extends U{constructor(t){super(t)}toSVGPathData(){return[["m",-50,-25],["l",50,0],["l",0,-25],["l",50,50],["l",-50,50],["l",0,-25],["l",-50,0],["l",0,-50],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(-50,-25),t.lineTo(0,-25),t.lineTo(0,-50),t.lineTo(50,0),t.lineTo(0,50),t.lineTo(0,25),t.lineTo(-50,25),t.lineTo(-50,-25),t.closePath()}}class su extends U{constructor(t){super(t)}toSVGPathData(){return[["m",4,24],["l",4,-8],["l",6,-6],["l",1,-10],["l",-6,-10],["l",-7,10],["l",-4,0],["l",-7,-10],["l",-6,10],["l",1,10],["l",6,6],["l",4,8],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(4,24),t.lineTo(8,16),t.lineTo(14,10),t.lineTo(15,0),t.lineTo(9,-10),t.lineTo(2,0),t.lineTo(-2,0),t.lineTo(-9,-10),t.lineTo(-15,0),t.lineTo(-14,10),t.lineTo(-8,16),t.lineTo(-4,24),t.closePath()}}class iu extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx||10,this.ry=t?.ry||10}toSVGPathData(){return[["m",0,0],["l",this.rx*2.4,-this.ry*3.14],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,-this.ry*1.5],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,this.ry*1.5],["l",this.rx*2.4,this.ry*3.14],["z"]]}}class nu extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx??50,this.ry=t?.ry??50}toSVGPathData(){return[["m",0,0+this.ry*.3],["C",0,0,0-this.rx/2,0,0-this.rx/2,0+this.ry*.3],["C",0-this.rx/2,0+(this.ry+this.ry*.3)/2,0,0+(this.ry+this.ry*.3)/1.4,0,0+this.ry],["C",0,0+(this.ry+this.ry*.3)/1.8,0+this.rx/2,0+(this.ry+this.ry*.3)/2,0+this.rx/2,0+this.ry*.3],["C",0+this.rx/2,0,0,0,0,0+this.ry*.3],["z"]]}}class ru extends U{r;constructor(t){super(t),this.r=t?.r||20}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const s=288+e*144,n=this.r*Math.cos(O(s)),r=this.r*Math.sin(O(s));t.push(["l",n,r])}return t}}class au extends U{constructor(t){super(t)}toSVGPathData(){return[["M",0,0],["C",15,0,15,-40,5,-30],["L",0,0],["C",-15,0,-15,-40,-5,-30],["L",0,0],["a",15,15,0,1,1,0,2*15],["a",15,15,0,1,1,0,-2*15]]}}class ou extends U{constructor(t){super(t),this.originD="m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z"}}class hu extends st{constructor(t){super(t);const e=new ce({...t,x:this.x,y:this.y,toX:this.x,toY:this.y-140-Math.random()*20}),s=30+Math.random()*30,n=new ce({...t,x:this.x,y:this.y-s,diffYInGroup:-s,toX:this.x+Math.random()*80-40,toY:this.y-100-Math.random()*40}),r=60+Math.random()*40,a=new ce({...t,x:this.x,y:this.y-r,diffYInGroup:-r,toX:this.x+Math.random()*60-30,toY:this.y-110-Math.random()*20});this.addShape([e,n,a])}}class Ge extends U{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.getAttrs()});const e=Hs(this.getAttr("fontSize"),10).number,s=Hs(this.getAttr("fontWeight"),400).number,n=I.measureText(this.text,e,s);this.width=n.width,this.height=n.height}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class oa extends st{text;bg;padding;offset;isShow;textShape;bgShape;constructor(t){super(t),this.text=t.text,this.bg=t.bg||"rgba(0,0,0,0.5)",this.padding=t.padding||4,this.offset=t.offset||20,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!1,this.textShape=new Ge({...t,x:this.x+this.offset,y:this.y+this.offset,text:this.text,attrs:{...this.getAttrs(),fill:nr(this.bg,!0),textAnchor:"start"}}),this.bgShape=new Gt({...t,x:this.textShape.x-this.padding,y:this.textShape.y-this.textShape.height/2-this.padding,width:this.textShape.width+this.padding*2,height:this.textShape.height+this.padding*2,attrs:{...this.getAttrs(),fill:this.bg}}),this.addShape([this.bgShape,this.textShape])}shapeInit(){qs(()=>{this.textShape.x=this.x+this.offset,this.textShape.y=this.y+this.offset,this.textShape.text=this.text,this.textShape.isShow=this.isShow,this.bgShape.x=this.textShape.x-this.padding,this.bgShape.y=this.textShape.y-this.textShape.height/2-this.padding,this.bgShape.width=this.textShape.width+this.padding*2,this.bgShape.height=this.textShape.height+this.padding*2,this.bgShape.isShow=this.isShow})}}class cu extends st{radius;expandRaidus;startDegree;endDegree;text="";defaultShowText;tip="";p1=new Ut;p1Offset=10;p2=new Ut;p2Offset=40;p3=new Ut;p3Offset=10;p4=new Ut;p4Offset=10;direction=1;sectorArc;line12;line23;textShape;tipShape;constructor(t){super(t),this.radius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!!this.text,this.tip=t.tip||"",this.sectorArc=new ha({x:this.x,y:this.y,radius:this.radius,expandRaidus:this.expandRaidus,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.getAttrs()},{strokeWidth:"0"})}),this.addShape(this.sectorArc);const e=Object.assign({...this.getAttrs()},{fill:"none"});this.line12=new ce({x:this.p1.x,y:this.p1.y,toX:this.p2.x,toY:this.p2.y,attrs:{...e},isShow:this.defaultShowText}),this.line23=new ce({x:this.p2.x,y:this.p2.y,toX:this.p3.x,toY:this.p3.y,attrs:{...e},isShow:this.defaultShowText}),this.textShape=new Ge({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{stroke:e.stroke,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText}),this.text&&(this.addShape(this.line12),this.addShape(this.line23),this.addShape(this.textShape)),this.tipShape=new oa({x:0,y:0,text:this.tip,isShow:!1}),this.tip&&this.addShape(this.tipShape)}frameUpdate(t){this.text&&!this.defaultShowText&&(this.line12.isShow=this.sectorArc.isMouseIn,this.line23.isShow=this.sectorArc.isMouseIn,this.textShape.isShow=this.sectorArc.isMouseIn);const e=this.startDegree+(this.endDegree-this.startDegree)/2,{dx:s,dy:n}=At(O(e),this.sectorArc.radius+this.p1Offset);this.p1.x=this.x+s,this.p1.y=this.y+n;const{dx:r,dy:a}=At(O(e),this.sectorArc.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+r,this.p2.y=this.y+a,this.line12.x=this.p1.x,this.line12.y=this.p1.y,this.line12.toX=this.p2.x,this.line12.toY=this.p2.y,this.direction=this.p1.x>this.x?1:-1,this.p3.x=this.p2.x+this.direction*this.p3Offset,this.p3.y=this.p2.y,this.p4.x=this.p3.x+this.direction*this.p4Offset,this.p4.y=this.p3.y,this.line23.x=this.p2.x,this.line23.y=this.p2.y,this.line23.toX=this.p3.x,this.line23.toY=this.p3.y,this.textShape.x=this.p4.x,this.textShape.y=this.p4.y,this.textShape.setAttr("textAnchor",this.direction==1?"start":"end"),this.sectorArc.isMouseIn?(this.tipShape.isShow=!0,this.tipShape.x=t.x,this.tipShape.y=t.y):(this.tipShape.isShow=!1,this.tipShape.x=t.x,this.tipShape.y=t.y)}}class ha extends U{radius;realRadius;expandRaidus;startDegree;endDegree;vr;ar;bounce;durationTime;status;constructor(t){super(t),this.radius=0,this.realRadius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.vr=0,this.ar=.03,this.bounce=.6,this.durationTime=1e3/120,this.status=0}frameUpdate(){this.status==0&&this.radius<this.realRadius?(this.expand(this.realRadius),this.radius>=this.realRadius&&(this.status=1)):this.isMouseIn?this.expand(this.realRadius+this.expandRaidus):this.shrink(this.realRadius)}expand(t){this.vr+=this.ar,this.radius+=this.vr*this.durationTime,this.radius>t&&(this.radius=t,this.vr*=-this.bounce)}shrink(t){this.vr-=this.ar,this.radius+=this.vr*this.durationTime,this.radius<t&&(this.radius=t,this.vr*=-this.bounce)}toSVGPathData(){const{dx:t,dy:e}=At(O(this.startDegree),this.radius),{dx:s,dy:n}=At(O(this.endDegree),this.radius);return[["m",0,0],["l",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,n-e],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,O(this.startDegree),O(this.endDegree),!1),t.closePath()}containPoint(t,e){const s=os(this.x,this.y,t,e),n=tt($t(this.x,this.y,t,e));return s<=this.radius&&n>=this.startDegree&&n<=this.endDegree}}class lu extends st{showFlame;ship;flame;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t.showFlame:!1,this.ship=new U({...t,d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]}),this.addShape(this.ship),this.flame=new U({...t,isShow:this.showFlame,d:[["m",-10,-5],["l",-7.5,5],["l",7.5,5],["z"]]}),this.addShape(this.flame)}shapeInit(){qs(()=>{this.ship.x=this.x,this.ship.y=this.y,this.flame.x=this.x,this.flame.y=this.y,this.flame.isShow=this.showFlame})}}class uu extends st{value;backgroundRect;occupyRect;handle;constructor(t){super(t);const e=t?.min||0,s=t?.max||100,n=t?.step||1,r=Ja(e,s,n);this.value=r(typeof t?.defaultValue=="number"?yt(t.defaultValue,e,s):e);const a=this.value/(s-e),o=t?.barWidth||100,h=t?.barHeight||4,c=t?.handleRadius||10,l=h*.5,d=t?.barColor||yi.colorGrayF5,g=t?.handleColor||yi.colorPrimary;this.backgroundRect=new Gt({x:this.x,y:this.y,width:o,height:h,borderRadius:l,attrs:{fill:d},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.backgroundRect),this.occupyRect=new Gt({x:this.x,y:this.y,width:o*a,height:h,borderRadius:l,attrs:{fill:g},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.occupyRect),this.handle=new Ut({x:this.x+o*a,y:this.y+l,diffXInGroup:o*a,diffYInGroup:l,radius:c,alongPath:new Go({x:this.x,y:this.y+l,d:[["m",0,0],["l",o,0]]}),attrs:{fill:g},enableDrag:!0,independentTransformInGroup:!0}),this.addShape(this.handle),this.handle.on("draging",y=>{this.occupyRect.width=yt(this.occupyRect.width+y,0,o),this.value=r((this.handle.x-this.x)/o*(s-e)+e),this.emit("change",this.value)})}}class du extends st{width;height;cornerRadius;controlPoint;mainRect;rightPoint;constructor(t){super(t),this.width=t.width,this.height=t.height,this.cornerRadius=this.height/2,this.controlPoint=new Ut({...t,x:this.x,y:this.y,radius:2}),this.forceSetCXY(this.controlPoint.cX,this.controlPoint.cY),this.mainRect=new Gt({...t,x:this.x-this.cornerRadius,y:this.y-this.cornerRadius,diffXInGroup:-this.cornerRadius,diffYInGroup:-this.cornerRadius,width:this.width+this.cornerRadius*2,height:this.height,borderRadius:this.cornerRadius}),this.rightPoint=new Ut({...t,x:this.x+this.width,y:this.y,diffXInGroup:this.width,radius:2}),this.addShape([this.mainRect,this.controlPoint,this.rightPoint])}getPin(){return{x:this.controlPoint.x+Math.cos(O(this.controlPoint.degree))*this.width,y:this.controlPoint.y+Math.sin(O(this.controlPoint.degree))*this.width}}}class Gi extends U{extendDegree;radius;startDegree;endDegree;diffDegree;constructor(t){super(t),this.extendDegree=t?.extendDegree||0,this.x=(t.x||0)+t.width/2;const e=Math.min(t.width/2,t.height)-t.lineWidth;this.radius=e-e*Math.abs(Math.sin(O(this.extendDegree))),this.y=(t.y||0)+t.height-t.lineWidth-this.radius*Math.abs(Math.sin(O(this.extendDegree))),this.diffDegree=t.endDegree-t.startDegree,this.startDegree=180+t.startDegree-this.extendDegree,this.endDegree=180+t.endDegree+this.extendDegree,this.setAttr({"stroke-linecap":"round","stroke-width":String(t.lineWidth),stroke:t.color||"none"})}setPercent(t){this.endDegree=this.startDegree+(this.diffDegree+this.extendDegree*2)*t}toSVGPathData(){const{dx:t,dy:e}=At(O(this.startDegree),this.radius),{dx:s,dy:n}=At(O(this.endDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,n-e]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,O(this.startDegree),O(this.endDegree),!1)}}class fu extends st{percent=0;ringBg;ring;lines=[];bgColor;startColor;endColor;indicatorLineCount;constructor(t){super(t);const e=t?.startDegree||0,s=t?.endDegree||180,n=t?.extendDegree||15,r=t?.lineWidth||12;this.bgColor=t?.bgColor||"#B3C6E7",this.startColor=t?.startColor||"#5A82F0",this.endColor=t?.endColor||"#66B3FF",this.percent=t?.percent||0,this.indicatorLineCount=22+1;const a=20,o=2,h=17;this.ringBg=new Gi({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:n,lineWidth:r,color:this.bgColor}),this.addShape(this.ringBg),this.ring=new Gi({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:n,lineWidth:r}),this.addShape(this.ring);const c=this.ringBg.y-this.ringBg.radius+a;for(let l=0;l<this.indicatorLineCount;l++)this.lines.push(new ce({...t,centerX:this.ringBg.x,centerY:this.ringBg.y,x:this.ringBg.x,y:c,toX:this.ringBg.x,toY:c+h,degree:this.ringBg.startDegree+90+(s-e+n*2)/(this.indicatorLineCount-1)*l,attrs:{"stroke-linecap":"round","stroke-width":String(o),stroke:this.bgColor}}));this.addShape(this.lines)}setPercent(t){this.percent=t}shapeInit(){this.on("draging",(t,e,s)=>{this.shapes.forEach(n=>{n!=s&&(n.x+=t,n.y+=e)})})}frameUpdate(t,e){const s=this.ringBg.radius-this.ringBg.radius*Math.cos(Math.PI*this.percent),n=this.ringBg.radius*Math.sin(Math.PI*this.percent);if(e){const r=e.createLinearGradient(-this.ringBg.radius,0,-this.ringBg.radius+s,-n,{0:this.startColor,1:this.endColor});this.ring.setAttr({stroke:r})}else this.ring.setAttr({stroke:this.startColor});this.ring.setPercent(this.percent);for(let r=0;r<this.indicatorLineCount;r++){const a=r/(this.indicatorLineCount-1)<=this.percent;this.lines[r].setAttr({stroke:a&&e?e.createLinearGradient(0,0,this.lines[r].toX-this.lines[r].x,this.lines[r].toY-this.lines[r].y,{0:this.startColor,1:this.endColor}):a?this.startColor:this.bgColor})}}}class mu extends U{x;y;z;brightness;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.brightness=this.setBrightness(t?.brightness||1)}setBrightness(t){return this.brightness=yt(t,0,1),this.brightness}toSVGPathData(){return[]}}const pu=mu;class gu extends U{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(),this.points=t,this.light=new pu({x:0,y:0,z:0,brightness:1})}toSVGPathData(){const t=[];t.push(["M",this.points[0].getScreenX(),this.points[0].getScreenY()]);for(let e=0,s=this.points.length;e<=s-1;e++)t.push(["L",this.points[e].getScreenX(),this.points[e].getScreenY()]);return t.push(["L",this.points[0].getScreenX(),this.points[0].getScreenY()]),t}toCanvasContext(t){t.beginPath(),t.moveTo(0,0);for(let e=0,s=this.points.length;e<=s-1;e++)t.lineTo(this.points[e].getScreenX()-this.points[0].getScreenX(),this.points[e].getScreenY()-this.points[0].getScreenY());t.lineTo(0,0)}get length(){return this.points.length}getDepth(){return Math.min(...this.points.map(t=>t.z))}isBackface(){const t=this.points[2].getScreenX()-this.points[0].getScreenX(),e=this.points[2].getScreenY()-this.points[0].getScreenY(),s=this.points[1].getScreenX()-this.points[2].getScreenX(),n=this.points[1].getScreenY()-this.points[2].getScreenY();return t*n>e*s}getLightFactor(){const t={x:this.points[0].x-this.points[1].x,y:this.points[0].y-this.points[1].y,z:this.points[0].z-this.points[1].z},e={x:this.points[1].x-this.points[2].x,y:this.points[1].y-this.points[2].y,z:this.points[1].z-this.points[2].z},s={x:t.y*e.z-t.z*e.y,y:-(t.x*e.z-t.z*e.x),z:t.x*e.y-t.y*e.x},n=s.x*this.light.x+s.y*this.light.y+s.z*this.light.z,r=Math.sqrt(s.x*s.x+s.y*s.y+s.z*s.z),a=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(n/(r*a))/Math.PI*this.light.brightness}getAdjustedColor(t){const e=It(t),s=this.getLightFactor();return e.r*=s,e.g*=s,e.b*=s,ye(e)}}class yu extends st{fettis=[];constructor(t,e,s){super();const{shape:n,x:r,y:a,particleCount:o,angle:h,spread:c,startVelocity:l,decay:d,gravity:g,drift:y,ticks:p,colors:x,scalar:b,flat:S}=mn(s||{},{shape:Gt,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:ir,scalar:1,flat:!1}),C=O(h),L=O(c);let R=o;for(;R--;){const Y=new n({x:t*r,y:e*a,width:10,height:10,scalar:b,attrs:{fill:x[R%x.length]},independentTransformInGroup:!0});this.addShape(Y),this.fettis.push({shape:Y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:l*.5+Math.random()*l,angle2D:-C+(.5*L-Math.random()*L),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,tick:0,totalTicks:p,decay:d,drift:y,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:g*3,scalar:b,flat:S})}}frameUpdate(t){this.fettis.length&&(this.fettis=this.fettis.filter(e=>{e.shape.x+=Math.cos(e.angle2D)*e.velocity+e.drift,e.shape.y+=Math.sin(e.angle2D)*e.velocity+e.gravity,e.velocity*=e.decay,e.flat?(e.wobble=0,e.wobbleX=e.shape.x+10*e.scalar,e.wobbleY=e.shape.y+10*e.scalar,e.tiltSin=0,e.tiltCos=0,e.random=1):(e.wobble+=e.wobbleSpeed,e.wobbleX=e.shape.x+10*e.scalar*Math.cos(e.wobble),e.wobbleY=e.shape.y+10*e.scalar*Math.sin(e.wobble),e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+2);const s=e.tick++/e.totalTicks,n=e.shape.x+e.random*e.tiltCos,r=e.shape.y+e.random*e.tiltSin,a=e.wobbleX+e.random*e.tiltCos,o=e.wobbleY+e.random*e.tiltSin;return e.shape.setAttr("fill",xi(e.shape.getAttr("fill"),1-s)),e.shape.degree=tt(Math.PI/10*e.wobble),e.shape.scalarX=Math.abs(a-n)*.1,e.shape.scalarY=Math.abs(o-r)*.1,e.tick<e.totalTicks}))}}class Vi{shapes;constructor(t){this.shapes=t}run(t){this.shapes.forEach(s=>{s.run(),t?.wall&&s.checkWall({wall:t.wall,bounce:t.bounce})});const e=this.shapes.length;for(let s=0,n=e-1;s<n;s++)for(let r=s+1;r<e;r++)this.shapes[s].checkCollision(this.shapes[r])}gravitate(){const t=this.shapes.length;this.shapes.forEach((e,s)=>{e.run();for(let n=s+1;n<t;n++)e.checkCollision(this.shapes[n]),e.gravitateTo(this.shapes[n])})}springChain(t){this.shapes.forEach((e,s)=>{s>0&&e.runSpringTo(this.shapes[s-1],t)})}springConnect(t){const e=jt(t?.springLength,100);this.shapes.forEach(s=>{s.isDragging||this.shapes.filter(n=>n.id!==s.id).forEach(n=>{const r=$t(s.x,s.y,n.x,n.y);s.runSpringTo({x:n.x-Math.cos(r)*e,y:n.y-Math.sin(r)*e},t)})})}springMass(t,e){const s=this.shapes.length,n=[];return this.shapes.forEach((r,a)=>{r.run(e),r.x>t.x+t.width?r.x=t.x:r.x<t.x&&(r.x=t.x+t.width),r.y>t.y+t.height?r.y=t.y:r.y<t.y&&(r.y=t.y+t.height);for(let o=a+1;o<s;o++)n.push([r.x,r.y,this.shapes[o].x,this.shapes[o].y,r.springMassTo(this.shapes[o],e)])}),n}polymorph(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");const t=this.shapes.length-1,e=new Array(t);for(let n=0;n<t;n++){const r=this.shapes[n].initPathD();this.shapes[n].frameStart();const a=this.shapes[n+1].initPathD();this.shapes[n+1].frameStart();const o=Math.max(r.polymorphPoints.length,a.polymorphPoints.length);e[n]=pt.getPathInterpolator(r.expendFill(o),a.expendFill(o))}const s=new U({d:e[0](0)});return n=>{const r=Et(t*n,6),a=Math.min(Math.floor(r),t-1),o=Et(r-a,6);s.originD=e[a](o);const h=this.shapes[a].getAttr("fill","none"),c=this.shapes[a+1].getAttr("fill","none");typeof h=="string"&&typeof c=="string"&&s.setAttr("fill",bi(h,c,o));const l=this.shapes[a].getAttr("stroke","none"),d=this.shapes[a+1].getAttr("stroke","none");return typeof l=="string"&&typeof d=="string"&&s.setAttr("stroke",bi(l,d,o)),s}}polymorphGroup(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");let t=0,e;const s=[];this.shapes.forEach(o=>{let h;o instanceof st?(h=o,h.sortPathD()):(h=new st,h.addShape(o)),s.push(h),t<h.shapes.length&&(t=h.shapes.length,e=h)}),s.forEach(o=>{o!==e&&o.expendFill(e)});const n=[];s.forEach((o,h)=>{o.shapes.forEach((c,l)=>{n[l]=n[l]||[],n[l][h]=c})});const r=[];n.forEach(o=>{r.push(new Vi(o).polymorph())});const a=new st;return r.forEach(o=>{a.addShape(o(0))}),o=>(r.forEach(h=>{h(o)}),a)}polymorphTween(t=6e3,e){const s=this.shapes.findIndex(o=>o instanceof st)>=0?this.polymorphGroup():this.polymorph(),n=s(0),r=e?.onUpdate,a=new gs({frameDuration:t});a.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(o,h)=>{s(o.t),r?.(o,h),e?.draw?.(n)}})),a.play()}static generatePointsShape(t,e,s,n){const r=[];for(let a=0;a<n;a++){const o=a/n*2*Math.PI,{dx:h,dy:c}=At(o,s);r.push({x:t+h,y:e+c})}return new ra({points:r})}static generateRosettaShape(t,e,s,n,r){if(r==0)throw new Error("no dividing by zero, please");const a=[],o=360/r;for(let h=0;h<r;h+=1){const c=o*h*Math.PI/180,l=t+2*s*Math.cos(c),d=e+2*s*Math.sin(c);a.push(new si({x:t,y:e,rx:s,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:d})),a.push(new si({x:l,y:d,rx:s,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new U({d:pt.fromLines(a)})}}const ca={map:new Map,transform:function(i){if(Ln)return i;if(this.map.has(i))return this.map.get(i);const t=new OffscreenCanvas(i.width,i.height);return t.getContext("2d")?.drawImage(i,0,0),this.map.set(i,t),t},clear:function(){this.map.clear()}};function wu(i,t,e){const s=new OffscreenCanvas(i,t),n=s.getContext("2d");if(n)return e(n),s.transferToImageBitmap()}function xu(i,t,e){const s=i.createPattern(ca.transform(t),"no-repeat");if(s){const n=pi(e);s.setTransform(n),i.fillStyle=s}}class bu{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e=!1){if(this.app=t,!(this.app.container instanceof HTMLCanvasElement))throw new Error("app.container 应该为 HTMLCanvasElement!");this.ctx=new us(this.app.container,this.app.width,this.app.height,e),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(s,n)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=n.dx,this.dragDy+=n.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let s of this.shapes)if(this.currentMouseInShape==s){s.emit("clicked");let n=s.parent;for(;n;)n.emit("clicked",s),n=n.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}transformCtxBaseOnShape(t){t.usePathDtoCanvasContext||(this.ctx.translate(t.x,t.y),this.ctx.rotate(O(t.degree),t.cX,t.cY),this.ctx.scale(t.scalarX,t.scalarY,t.cX,t.cY))}_addDrawShape(t){this.shapes.push(t),t instanceof st&&t.shapes.forEach(e=>{this._addDrawShape(e)})}draw(t=[]){this.shapes=[],(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow)continue;if(this.ctx.save(),e.frameStart(this.app.mousePoint),I.attrsToCanvas(this.ctx,e.getAttrs()),e.followMouse&&(!es(e.x,this.app.mousePoint.x,5)||!es(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const n=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,n||r){if(e.x+=n,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",n,r)}}else e.isDragging=!1;e.frameUpdate(this.app.mousePoint,this.ctx),this.transformCtxBaseOnShape(e),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill();const s=this.ctx.currentPath2D;if(!this.currentMouseInShape){const n=this.ctx.isPointInPath(s,this.app.mousePoint.x,this.app.mousePoint.y)||this.ctx.isPointInStroke(s,this.app.mousePoint.x,this.app.mousePoint.y)||!1;e.isMouseIn=n,n&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint),this.ctx.restore()}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}drawMouseMoveLine(t="line",e){switch(t){case"brush":const s=e?.brushSize??10,n=e?.brushDensity??50,r=e?.brushColor??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,h=It(r);return this.app.captureMove({move:()=>{if(this.isMouseDown){for(let c=0;c<n;c++){const l=Math.random()*Math.PI*2,d=Math.random()*s,g=this.app.mousePoint.x+Math.cos(l)*d|0,y=this.app.mousePoint.y+Math.sin(l)*d|0,p=(g+y*a.width)*4;o[p]=h.r,o[p+1]=h.g,o[p+2]=h.b,o[p+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureMove({start:c=>{this.ctx.beginPath(),this.ctx.moveTo(this.app.mousePoint.x,this.app.mousePoint.y)},end:()=>{this.ctx.closePath()},move:()=>{this.isMouseDown&&(this.ctx.lineTo(this.app.mousePoint.x,this.app.mousePoint.y),this.ctx.stroke())}})}}}class vu{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Oe(t),this.remoteVideoUtil=new Oe(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(s=>{this.localVideoUtil.setSrcObject(s),t(s)}).catch(s=>{this.trace(`navigator.getUserMedia error: ${s}.`),e(s)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),s=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),s.length>0&&this.trace(`Using audio device: ${s[0].label}.`);const n=void 0,r=new RTCPeerConnection(n);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(n);this.remotePeerConnection=a,this.trace("Created remote peer connection object remotePeerConnection."),a.addEventListener("icecandidate",this.handleConnection),a.addEventListener("iceconnectionstatechange",this.handleConnectionChange),a.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(s[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,s=t.candidate;if(e&&s){const n=new RTCIceCandidate(s),r=this.getOtherPeer(e);r&&(r.addIceCandidate(n).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
42
42
|
${t.candidate.candidate}.`))}}handleConnectionSuccess(t){this.trace(`${this.getPeerName(t)} addIceCandidate success.`)}handleConnectionFailure(t,e){this.trace(`${this.getPeerName(t)} failed to add ICE Candidate:
|
|
43
43
|
${e.toString()}.`)}handleConnectionChange(t){const e=t.target;console.log("ICE state change event: ",t),e&&this.trace(`${this.getPeerName(e)} ICE state: ${e.iceConnectionState}.`)}createdOffer(t){this.trace(`Offer from localPeerConnection:
|
|
44
44
|
${t.sdp}`),this.localPeerConnection&&(this.trace("localPeerConnection setLocalDescription start."),this.localPeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.remotePeerConnection&&(this.trace("remotePeerConnection setRemoteDescription start."),this.remotePeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e)),this.trace("remotePeerConnection createAnswer start."),this.remotePeerConnection.createAnswer().then(e=>this.createdAnswer(e)).catch(e=>this.setSessionDescriptionError(e)))}createdAnswer(t){this.trace(`Answer from remotePeerConnection:
|
|
45
|
-
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const s=this.getPeerName(t);this.trace(`${s} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const s=document.createElement("div");s.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(s)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Cu{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function ca(i,t){return!i||i.parentElement===null?t:ca(i.parentElement,t.concat([i]))}const Vi=function(i,t){return getComputedStyle(i,null).getPropertyValue(t)},Eu=function(i){return Vi(i,"overflow")+Vi(i,"overflow-y")+Vi(i,"overflow-x")},Tu=function(i){return/(auto|scroll)/.test(Eu(i))};function Pu(i){if(!(i instanceof HTMLElement||i instanceof SVGElement))return;const t=ca(i.parentElement,[]);for(let e=0;e<t.length;e+=1)if(Tu(t[e]))return t[e];return document.scrollingElement||document.documentElement}const la=[],ua={};function zi(i){la.push(i)}function Mu(i,t=!1){const e=ar();if(ua[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{la.forEach(r=>r())});const s=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],n=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(i,{debug:t,jsApiList:s,openTagList:n})),ua[e]=!0}function Au(i){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[i],success:function(s){s.checkResult[i]?t(!0):e(!1)},fail:function(){e(!1)}})})}function ku(i){zi(function(){wx.updateAppMessageShareData(i)})}function Iu(i){zi(function(){wx.updateTimelineShareData(i)})}function Du(i){wx.chooseImage(i)}function _u(i){wx.previewImage(i)}function Lu(i){wx.uploadImage(i)}function Ru(i){wx.downloadImage(i)}function Ou(i){wx.getLocalImgData(i)}function Nu(){wx.startRecord()}function Fu(i){wx.stopRecord(i)}function Bu(i){wx.onVoiceRecordEnd(i)}function Xu(i){wx.playVoice(i)}function Yu(i){wx.pauseVoice(i)}function Uu(i){wx.stopVoice(i)}function Gu(i){wx.onVoicePlayEnd(i)}function Vu(i){wx.uploadVoice(i)}function zu(i){wx.downloadVoice(i)}function qu(i){wx.translateVoice(i)}function Hu(i){wx.getNetworkType(i)}function ju(i){wx.openLocation(i)}function Wu(i){wx.getLocation(i)}function $u(i){wx.scanQRCode(i)}function Ju(i,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",i,function(n){n.err_msg=="get_brand_wcpay_request:ok"?t():e(n.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function Zu(i){window.AlipayJSBridge?i&&i():document.addEventListener("AlipayJSBridgeReady",i,!1)}function Ve(i,t){let e="未知错误";switch(i.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${i.error}(${e}): ${i.errorMessage}`}function Ku(i,t,e){ap.tradePay(Object.assign(i,{}),function(s){let n="未知错误";switch(s.resultCode){case 9e3:return n="订单支付成功",t?.(n);case 8e3:n="正在处理中";break;case 4e3:n="订单支付失败";break;case 6001:n="用户中途取消";break;case 6002:n="网络连接出错";break;case 99:n="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(n)})}function Qu(i,t,e){ap.scan(Object.assign(i,{fail:s=>{e?.(Ve(s))}}),function(s){t?.(s.code)})}function td(i,t,e){ap.getLocation(Object.assign(i,{fail:s=>{e?.(Ve(s))}}),function(s){t?.(s)})}function ed(i,t,e){ap.openLocation(Object.assign(i,{fail:s=>{e?.(Ve(s))}}),function(){t?.()})}function sd(i,t,e){ap.chooseImage(Object.assign(i,{fail:s=>{e?.(Ve(s,"chooseImage"))}}),function(s){t?.(s)})}function id(i,t,e){ap.previewImage(Object.assign(i,{fail:s=>{e?.(Ve(s))}}),function(){t?.()})}class nd{map;constructor(t,e=120.619585,s=31.299379,n=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),n)}}class rd{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,s){this.currentPage=s?.currentPage||0,this.itemsPerPage=s?.itemsPerPage||10,this.entriesInterval=s?.entriesInterval||5,this.entriesEdge=s?.entriesEdge||1,this.linkTo=s?.linkTo||"javascript:;",this.prevText=s?.prevText||"上一页",this.nextText=s?.nextText||"下一页",this.ellipseText=s?.ellipseText||"...",this.prevShowAlways=typeof s?.prevShowAlways=="boolean"?s?.prevShowAlways:!0,this.nextShowAlways=typeof s?.nextShowAlways=="boolean"?s?.nextShowAlways:!0,this.callback=s?.callback||(n=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),ge(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return Wt("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const n=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?Wt("span",{class:`current ${r}`},n):Wt("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:a=>this.selectPage(e,a)},n))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),s=this.currentPage>e?Math.max(Math.min(this.currentPage-e,this.totalPages-this.entriesInterval),0):0,n=this.currentPage>e?Math.min(this.currentPage+e,this.totalPages):Math.min(this.entriesInterval,this.totalPages);if(this.prevText&&(this.currentPage>0||this.prevShowAlways)&&this.appendVNode(t,this.currentPage-1,{text:this.prevText,classes:"prev"}),s>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,s);for(let a=0;a<r;a++)this.appendVNode(t,a);this.entriesEdge<s&&this.ellipseText&&t.children.push(Wt("span",{},this.ellipseText))}for(let r=s;r<n;r++)this.appendVNode(t,r);if(n<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>n&&this.ellipseText&&t.children.push(Wt("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,n);for(let a=r;a<this.totalPages;a++)this.appendVNode(t,a)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),ns(this.parentVNode,t),this.parentVNode=t}selectPage(t,e){this.currentPage=t=t<0?0:t<this.totalPages?t:this.totalPages-1,this.drawLinks();const s=this.callback(t);return e&&(s||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),s}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}const se={enabled:!1,files:{},add:function(i,t){this.enabled!==!1&&(this.files[i]=t)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class ad{isLoading=!1;itemsLoaded=0;itemsTotal=0;urlModifier;handlers=[];_onStart;_onLoad;_onProgress;_onError;constructor(t){this._onStart=t?.onStart,this._onLoad=t?.onLoad,this._onProgress=t?.onProgress,this._onError=t?.onError}itemStart(t){this.itemsTotal++,this.isLoading===!1&&this._onStart?.(t,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(t){this.itemsLoaded++,this._onProgress?.(t,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this._onLoad?.())}itemError(t){this._onError?.(t)}resolveURL(t){return this.urlModifier?this.urlModifier(t):t}setURLModifier(t){return this.urlModifier=t,this}addHandler(t,e){return this.handlers.push(t,e),this}removeHandler(t){const e=this.handlers.indexOf(t);return e!==-1&&this.handlers.splice(e,2),this}getHandler(t){for(let e=0,s=this.handlers.length;e<s;e+=2){const n=this.handlers[e],r=this.handlers[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return r}return null}}const od=new ad;class hd{static DEFAULT_MATERIAL_NAME="__DEFAULT";manager;crossOrigin;withCredentials;path;resourcePath;requestHeader;constructor(t){this.manager=t!==void 0?t:od,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(t,e){}loadAsync(t,e){return new Promise((s,n)=>{this.load(t,{onLoad:s,onProgress:e,onError:n})})}parse(t){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const Ls=hd;class cd extends Ls{constructor(t){super(t)}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=se.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;const n=k.createElementNS("img"),r=()=>{o(),se.add(t,n),e?.onLoad?.(n),this.manager.itemEnd(t)},a=h=>{o(),e?.onError?.(h),this.manager.itemError(t),this.manager.itemEnd(t)};function o(){n.removeEventListener("load",r,!1),n.removeEventListener("error",a,!1)}return n.addEventListener("load",r,!1),n.addEventListener("error",a,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(n.crossOrigin=this.crossOrigin),this.manager.itemStart(t),n.src=t,n}}class ld extends Ls{isImageBitmapLoader=!0;options;constructor(t){super(t),typeof createImageBitmap>"u"&&console.warn("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=se.get(t);if(s!==void 0){if(this.manager.itemStart(t),s.then){s.then(r=>{e?.onLoad?.(r),this.manager.itemEnd(t)}).catch(r=>{e?.onError?.(r)});return}return setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s}const n=fetch(t,{credentials:this.crossOrigin==="anonymous"?"same-origin":"include",headers:this.requestHeader}).then(r=>r.blob()).then(r=>createImageBitmap(r,Object.assign(this.options,{colorSpaceConversion:"none"}))).then(r=>(se.add(t,r),e?.onLoad?.(r),this.manager.itemEnd(t),r)).catch(r=>{e?.onError?.(r),se.remove(t),this.manager.itemError(t),this.manager.itemEnd(t)});se.add(t,n),this.manager.itemStart(t)}}const Vt={};class ud extends Error{response;constructor(t,e){super(t),this.response=e}}class da extends Ls{mimeType;responseType="";constructor(t){super(t),typeof fetch>"u"&&console.warn("FileLoader: fetch() not supported.")}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=se.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;if(Vt[t]!==void 0){Vt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});return}Vt[t]=[],Vt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});const n=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),r=this.mimeType,a=this.responseType;fetch(n).then(o=>{if(o.status===200||o.status===0){if(o.status===0&&console.warn("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||o.body===void 0||o.body?.getReader===void 0)return o;const h=Vt[t],c=o.body.getReader(),l=o.headers.get("X-File-Size")||o.headers.get("Content-Length"),d=l?parseInt(l):0,g=d!==0;let y=0;const p=new ReadableStream({start(x){b();function b(){c.read().then(({done:S,value:C})=>{if(S)x.close();else{y+=C.byteLength;const L=new ProgressEvent("progress",{lengthComputable:g,loaded:y,total:d});for(let R=0,Y=h.length;R<Y;R++)h[R].onProgress?.(L);x.enqueue(C),b()}},S=>{x.error(S)})}}});return new Response(p)}else throw new ud(`fetch for "${o.url}" responded with ${o.status}: ${o.statusText}`,o)}).then(o=>{switch(a){case"arraybuffer":return o.arrayBuffer();case"blob":return o.blob();case"document":return o.text().then(h=>new DOMParser().parseFromString(h,r));case"json":return o.json();default:if(r===void 0)return o.text();{const c=/charset="?([^;"\s]*)"?/i.exec(r),l=c&&c[1]?c[1].toLowerCase():void 0,d=new TextDecoder(l);return o.arrayBuffer().then(g=>d.decode(g))}}}).then(o=>{se.add(t,o);const h=Vt[t];delete Vt[t];for(let c=0,l=h.length;c<l;c++)h[c].onLoad?.(o)}).catch(o=>{const h=Vt[t];if(h===void 0)throw this.manager.itemError(t),o;delete Vt[t];for(let c=0,l=h.length;c<l;c++)h[c].onError?.(o);this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class dd extends Ls{constructor(t){super(t)}load(t,e){const s=new da(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,{onLoad:n=>{try{const r=n.slice(0);new AudioContext().decodeAudioData(r,o=>{e?.onLoad?.(o)}).catch(o=>{e?.onError?.(o),this.manager.itemError(t)})}catch(r){e?.onError?.(r),this.manager.itemError(t)}},onProgress:e?.onProgress,onError:e?.onError})}}m.Arrow=su,m.AudioLoader=dd,m.BezierEasing=li,m.COLORS=sr,m.CSSToJSEasing=ih,m.Clock=dh,m.CommonKeyCode=xh,m.Confetti=wu,m.Cross=hu,m.CustomCanvasContext=Ae,m.CustomCanvasGradient=us,m.CustomCanvasPattern=ei,m.DOMEventBus=Qn,m.DOMKey=Kn,m.DOMParse=tr,m.DOMSVGUtil=oe,m.DOMToBlob=xn,m.DOMToString=Js,m.DOMUtil=k,m.DOMVideo=Oe,m.Easing=I,m.Ellipse=ra,m.FetchWithAxios=ll,m.FetchWithAxiosRequestCancel=jr,m.FileLoader=da,m.Fox=iu,m.Heart=nu,m.HeartVariant=ru,m.ImageBitmapLoader=ld,m.ImageLoader=cd,m.Interpolation=Bt,m.Line=ce,m.LinePicture=eu,m.LineQuadraticBezier=Ql,m.Matrix=at,m.Matrix3D=ut,m.Pagination=rd,m.Point=Ut,m.Point3D=Re,m.Point3Ds=yu,m.Points=na,m.QRCode=ee,m.Rabbit=ou,m.Rect=Gt,m.Ring=Ui,m.RingIndicator=mu,m.SVGParse=ia,m.SVGParsedPathArgsLength=De,m.Sector=lu,m.SectorArc=oa,m.Segment=fu,m.Shape=U,m.ShapeCombo=Gi,m.ShapeGroup=st,m.Ship=uu,m.Slider=du,m.Star=au,m.TWEEN=uh,m.Text=Ge,m.Timeline=ys,m.Tip=aa,m.Tree=cu,m.Tween=di,m.WebGLRenderer=Cu,m.WebRTCClient=Su,m.WebSocketClient=no,m.YZCanvas=vu,m.YZCanvasContext=ds,m.YZMessageChannel=Gh,m.YZSVG=tu,m.YZWorker=Uh,m.addWatermark=jl,m.addWxJsReadyFnBeforeConfig=zi,m.ajax=Vh,m.aliJsChooseImage=sd,m.aliJsGetLocation=td,m.aliJsOpenLocation=ed,m.aliJsPreviewImage=id,m.aliJsReady=Zu,m.aliJsScan=Qu,m.aliJsTradePay=Ku,m.angle=$t,m.appendURLSearchString=cr,m.base64EncodeOutputStream=Zr,m.base64URLDecode=Vr,m.base64URLEncode=Gr,m.bitmapMapper=ha,m.blobToRawImage=xl,m.byteArrayOutputStream=Fi,m.canDrawBitmap=_n,m.canUsePaths=ko,m.canUseWorker=Dn,m.changeBrightness=ql,m.changeDiaphaneity=Hl,m.changeSize=zl,m.checkWxJsApi=Au,m.clearCookies=Ah,m.computeImageDisplayRect=ul,m.createXMLHttpRequest=lr,m.decodeUseTextDecoder=zr,m.decryptInCommon=ol,m.distance=hs,m.distance2=cs,m.drawBitmapInCanvas=bu,m.drawQRCodeToCanvas=Kl,m.easeNameToCubicBezier=ui,m.encodeUseTextEncoder=Is,m.encryptInCommon=al,m.fileOrBlobToDataURL=Oi,m.flipSideToSide=vl,m.flipUpsideDown=Sl,m.flushURLSearchString=Yh,m.formDataToSearchString=hr,m.fpsTask=zo,m.getBitmapFromCanvas=xu,m.getBrowserClient=Ks,m.getBrowserClientVersion=po,m.getBrowserLanguage=yo,m.getColor=kt,m.getColorScheme=er,m.getCookie=Ph,m.getCookieObject=Mh,m.getDOMMatrix=mi,m.getDirection=Ro,m.getElementPositionInPage=Cn,m.getElementPositionInPage2=co,m.getElementPositionInViewport=En,m.getFileExtension=vn,m.getFileTypeFromFile=io,m.getFilesImageInfo=fl,m.getFormSubmitData=zh,m.getHexColorString=ye,m.getImageAspectRatio=dl,m.getImageDataByAIData=$l,m.getImageDataFromBitmap=pl,m.getImageDataFromUrl=Wr,m.getImageDataFromVideo=ml,m.getImageMainColor=bl,m.getInternetExplorerVersion=Mn,m.getMousePositionInElement=Mt,m.getMousePositionInPage=Tn,m.getMousePositionInViewport=fo,m.getOperatingSystem=rs,m.getOperatingSystemVersion=mo,m.getOppositeColor=yi,m.getOppositeHexColorString=ir,m.getOppositeRGBColorString=kh,m.getPageBodyElement=ao,m.getPageDocumentElement=Pe,m.getPageSize=ho,m.getRGBColorString=wi,m.getRawImageInfo=_s,m.getRelativeBoundingClientRect=lo,m.getScreenElement=ro,m.getScrollParent=Pu,m.getTimeZone=wo,m.getURL=bs,m.getUserGeolocationPromise=go,m.getVerticalScrollPercentInPage=uo,m.getViewportSize=oo,m.gifImage=Kr,m.gradientColor=xi,m.h=Wt,m.hasDocument=Po,m.hasHistory=Mo,m.hasWindow=In,m.hsb2rgb=Lh,m.hsl2rgb=Rh,m.hsv2rgb=_h,m.imageDataToBitmap=gl,m.imageDataToBlob=wl,m.imageDataToDataURL=yl,m.injectWxJsConfig=Mu,m.isAliBrowser=kn,m.isAliMiniProgram=To,m.isAndroid=Pn,m.isAppleDevice=xo,m.isBrowserSupportFileAPI=Ao,m.isDarkMode=vo,m.isElement=Io,m.isIE=So,m.isIE9or10=Co,m.isIOS=Qs,m.isMacOS=ti,m.isMobile=bo,m.isNative=as,m.isURL=Bh,m.isWxBrowser=An,m.isWxMiniProgram=Eo,m.jpgToPng=Yl,m.leftRotate=Cl,m.length=os,m.linkExport=Zs,m.localstorage=pi,m.mapTDTJSSDK=nd,m.marginSharpen=Xl,m.microTask=Wo,m.mosaic=Wl,m.mount=ge,m.multiplyArrayOfMatrix=mh,m.multiplyArrayOfMatrix3D=ph,m.multiplyMatrix=$n,m.multiplyMatrix3D=Jn,m.nextTick=jo,m.normalizePoint=Lo,m.objectHash=Hr,m.onDocumentReady=Eh,m.outputGifBase64=Qr,m.outputQRCodeBase64=Zl,m.pack=nl,m.parseTransformToMatrix=fi,m.parseURL=rr,m.patch=ns,m.patchDOM=Sn,m.pngToJpg=Ul,m.polar=At,m.prefixes=Do,m.radiusClip=Vl,m.randomColorHexString=Ih,m.randomColorNumber=nr,m.readFileInBrowser=is,m.recordToSearchString=or,m.rectClip=Gl,m.requestAnimationFrameCycle=ni,m.reverseCSSToJSEasing=nh,m.reverseEaseNameToCubicBezier=qn,m.reverseEasing=Yn,m.rgb2hsb=Nh,m.rgb2hsl=Fh,m.rgb2hsv=Oh,m.rightRotate=El,m.rotatePoint=Tt,m.scheduleIdle=Fn,m.scheduleYZIdle=hi,m.searchStringToRecord=Xh,m.selectFileInBrowser=bn,m.setColorScheme=ws,m.setCookie=Th,m.setIntervalAccurate=Vo,m.setRem=_o,m.setTimeoutAccurate=ri,m.shadeColor=Dh,m.sharpen=Bl,m.signInCommon=hl,m.singletonGlobalDOMEventBus=et,m.stringHash=qr,m.stringToBlob=$s,m.stringToDOM=so,m.theme=gi,m.toBlackAndWhite=Ml,m.toBlue=Dl,m.toBlueAndGreen=Rl,m.toBlueAndGrey=Fl,m.toDegree=tt,m.toGreen=Il,m.toGreenAndGrey=Nl,m.toGrey=Tl,m.toGrey2=Pl,m.toOpposite=Al,m.toRadian=O,m.toRed=kl,m.toRedAndBlue=Ll,m.toRedAndGreen=_l,m.toRedAndGrey=Ol,m.transformPath2D=fh,m.trimURLHash=ar,m.unpack=rl,m.verifyInCommon=cl,m.wxJsChooseImage=Du,m.wxJsDownloadImage=Ru,m.wxJsDownloadVoice=zu,m.wxJsGetLocalImgData=Ou,m.wxJsGetLocation=Wu,m.wxJsGetNetworkType=Hu,m.wxJsOnVoicePlayEnd=Gu,m.wxJsOnVoiceRecordEnd=Bu,m.wxJsOpenLocation=ju,m.wxJsPauseVoice=Yu,m.wxJsPay=Ju,m.wxJsPlayVoice=Xu,m.wxJsPreviewImage=_u,m.wxJsScanQRCode=$u,m.wxJsStartRecord=Nu,m.wxJsStopRecord=Fu,m.wxJsStopVoice=Uu,m.wxJsTranslateVoice=qu,m.wxJsUpdateAppMessageShareData=ku,m.wxJsUpdateTimelineShareData=Iu,m.wxJsUploadImage=Lu,m.wxJsUploadVoice=Vu,m.yzCancelIdleCallback=Ho,m.yzRequestIdleCallback=Xn,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
45
|
+
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const s=this.getPeerName(t);this.trace(`${s} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const s=document.createElement("div");s.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(s)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Su{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function la(i,t){return!i||i.parentElement===null?t:la(i.parentElement,t.concat([i]))}const zi=function(i,t){return getComputedStyle(i,null).getPropertyValue(t)},Cu=function(i){return zi(i,"overflow")+zi(i,"overflow-y")+zi(i,"overflow-x")},Eu=function(i){return/(auto|scroll)/.test(Cu(i))};function Tu(i){if(!(i instanceof HTMLElement||i instanceof SVGElement))return;const t=la(i.parentElement,[]);for(let e=0;e<t.length;e+=1)if(Eu(t[e]))return t[e];return document.scrollingElement||document.documentElement}const ua=[],da={};function qi(i){ua.push(i)}function Pu(i,t=!1){const e=or();if(da[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{ua.forEach(r=>r())});const s=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],n=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(i,{debug:t,jsApiList:s,openTagList:n})),da[e]=!0}function Mu(i){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[i],success:function(s){s.checkResult[i]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Au(i){qi(function(){wx.updateAppMessageShareData(i)})}function Iu(i){qi(function(){wx.updateTimelineShareData(i)})}function Du(i){wx.chooseImage(i)}function ku(i){wx.previewImage(i)}function _u(i){wx.uploadImage(i)}function Lu(i){wx.downloadImage(i)}function Ru(i){wx.getLocalImgData(i)}function Ou(){wx.startRecord()}function Nu(i){wx.stopRecord(i)}function Fu(i){wx.onVoiceRecordEnd(i)}function Bu(i){wx.playVoice(i)}function Xu(i){wx.pauseVoice(i)}function Yu(i){wx.stopVoice(i)}function Uu(i){wx.onVoicePlayEnd(i)}function Gu(i){wx.uploadVoice(i)}function Vu(i){wx.downloadVoice(i)}function zu(i){wx.translateVoice(i)}function qu(i){wx.getNetworkType(i)}function Hu(i){wx.openLocation(i)}function ju(i){wx.getLocation(i)}function Wu(i){wx.scanQRCode(i)}function $u(i,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",i,function(n){n.err_msg=="get_brand_wcpay_request:ok"?t():e(n.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function Ju(i){window.AlipayJSBridge?i&&i():document.addEventListener("AlipayJSBridgeReady",i,!1)}function Ve(i,t){let e="未知错误";switch(i.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${i.error}(${e}): ${i.errorMessage}`}function Zu(i,t,e){ap.tradePay(Object.assign(i,{}),function(s){let n="未知错误";switch(s.resultCode){case 9e3:return n="订单支付成功",t?.(n);case 8e3:n="正在处理中";break;case 4e3:n="订单支付失败";break;case 6001:n="用户中途取消";break;case 6002:n="网络连接出错";break;case 99:n="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(n)})}function Ku(i,t,e){ap.scan(Object.assign(i,{fail:s=>{e?.(Ve(s))}}),function(s){t?.(s.code)})}function Qu(i,t,e){ap.getLocation(Object.assign(i,{fail:s=>{e?.(Ve(s))}}),function(s){t?.(s)})}function td(i,t,e){ap.openLocation(Object.assign(i,{fail:s=>{e?.(Ve(s))}}),function(){t?.()})}function ed(i,t,e){ap.chooseImage(Object.assign(i,{fail:s=>{e?.(Ve(s,"chooseImage"))}}),function(s){t?.(s)})}function sd(i,t,e){ap.previewImage(Object.assign(i,{fail:s=>{e?.(Ve(s))}}),function(){t?.()})}class id{map;constructor(t,e=120.619585,s=31.299379,n=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),n)}}class nd{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,s){this.currentPage=s?.currentPage||0,this.itemsPerPage=s?.itemsPerPage||10,this.entriesInterval=s?.entriesInterval||5,this.entriesEdge=s?.entriesEdge||1,this.linkTo=s?.linkTo||"javascript:;",this.prevText=s?.prevText||"上一页",this.nextText=s?.nextText||"下一页",this.ellipseText=s?.ellipseText||"...",this.prevShowAlways=typeof s?.prevShowAlways=="boolean"?s?.prevShowAlways:!0,this.nextShowAlways=typeof s?.nextShowAlways=="boolean"?s?.nextShowAlways:!0,this.callback=s?.callback||(n=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),ge(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return Wt("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const n=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?Wt("span",{class:`current ${r}`},n):Wt("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:a=>this.selectPage(e,a)},n))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),s=this.currentPage>e?Math.max(Math.min(this.currentPage-e,this.totalPages-this.entriesInterval),0):0,n=this.currentPage>e?Math.min(this.currentPage+e,this.totalPages):Math.min(this.entriesInterval,this.totalPages);if(this.prevText&&(this.currentPage>0||this.prevShowAlways)&&this.appendVNode(t,this.currentPage-1,{text:this.prevText,classes:"prev"}),s>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,s);for(let a=0;a<r;a++)this.appendVNode(t,a);this.entriesEdge<s&&this.ellipseText&&t.children.push(Wt("span",{},this.ellipseText))}for(let r=s;r<n;r++)this.appendVNode(t,r);if(n<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>n&&this.ellipseText&&t.children.push(Wt("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,n);for(let a=r;a<this.totalPages;a++)this.appendVNode(t,a)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),is(this.parentVNode,t),this.parentVNode=t}selectPage(t,e){this.currentPage=t=t<0?0:t<this.totalPages?t:this.totalPages-1,this.drawLinks();const s=this.callback(t);return e&&(s||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),s}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}const se={enabled:!1,files:{},add:function(i,t){this.enabled!==!1&&(this.files[i]=t)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class rd{isLoading=!1;itemsLoaded=0;itemsTotal=0;urlModifier;handlers=[];_onStart;_onLoad;_onProgress;_onError;constructor(t){this._onStart=t?.onStart,this._onLoad=t?.onLoad,this._onProgress=t?.onProgress,this._onError=t?.onError}itemStart(t){this.itemsTotal++,this.isLoading===!1&&this._onStart?.(t,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(t){this.itemsLoaded++,this._onProgress?.(t,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this._onLoad?.())}itemError(t){this._onError?.(t)}resolveURL(t){return this.urlModifier?this.urlModifier(t):t}setURLModifier(t){return this.urlModifier=t,this}addHandler(t,e){return this.handlers.push(t,e),this}removeHandler(t){const e=this.handlers.indexOf(t);return e!==-1&&this.handlers.splice(e,2),this}getHandler(t){for(let e=0,s=this.handlers.length;e<s;e+=2){const n=this.handlers[e],r=this.handlers[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return r}return null}}const ad=new rd;class od{static DEFAULT_MATERIAL_NAME="__DEFAULT";manager;crossOrigin;withCredentials;path;resourcePath;requestHeader;constructor(t){this.manager=t!==void 0?t:ad,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(t,e){}loadAsync(t,e){return new Promise((s,n)=>{this.load(t,{onLoad:s,onProgress:e,onError:n})})}parse(t){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const _s=od;class hd extends _s{constructor(t){super(t)}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=se.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;const n=I.createElementNS("img"),r=()=>{o(),se.add(t,n),e?.onLoad?.(n),this.manager.itemEnd(t)},a=h=>{o(),e?.onError?.(h),this.manager.itemError(t),this.manager.itemEnd(t)};function o(){n.removeEventListener("load",r,!1),n.removeEventListener("error",a,!1)}return n.addEventListener("load",r,!1),n.addEventListener("error",a,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(n.crossOrigin=this.crossOrigin),this.manager.itemStart(t),n.src=t,n}}class cd extends _s{isImageBitmapLoader=!0;options;constructor(t){super(t),typeof createImageBitmap>"u"&&console.warn("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=se.get(t);if(s!==void 0){if(this.manager.itemStart(t),s.then){s.then(r=>{e?.onLoad?.(r),this.manager.itemEnd(t)}).catch(r=>{e?.onError?.(r)});return}return setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s}const n=fetch(t,{credentials:this.crossOrigin==="anonymous"?"same-origin":"include",headers:this.requestHeader}).then(r=>r.blob()).then(r=>createImageBitmap(r,Object.assign(this.options,{colorSpaceConversion:"none"}))).then(r=>(se.add(t,r),e?.onLoad?.(r),this.manager.itemEnd(t),r)).catch(r=>{e?.onError?.(r),se.remove(t),this.manager.itemError(t),this.manager.itemEnd(t)});se.add(t,n),this.manager.itemStart(t)}}const Vt={};class ld extends Error{response;constructor(t,e){super(t),this.response=e}}class fa extends _s{mimeType;responseType="";constructor(t){super(t),typeof fetch>"u"&&console.warn("FileLoader: fetch() not supported.")}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=se.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;if(Vt[t]!==void 0){Vt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});return}Vt[t]=[],Vt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});const n=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),r=this.mimeType,a=this.responseType;fetch(n).then(o=>{if(o.status===200||o.status===0){if(o.status===0&&console.warn("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||o.body===void 0||o.body?.getReader===void 0)return o;const h=Vt[t],c=o.body.getReader(),l=o.headers.get("X-File-Size")||o.headers.get("Content-Length"),d=l?parseInt(l):0,g=d!==0;let y=0;const p=new ReadableStream({start(x){b();function b(){c.read().then(({done:S,value:C})=>{if(S)x.close();else{y+=C.byteLength;const L=new ProgressEvent("progress",{lengthComputable:g,loaded:y,total:d});for(let R=0,Y=h.length;R<Y;R++)h[R].onProgress?.(L);x.enqueue(C),b()}},S=>{x.error(S)})}}});return new Response(p)}else throw new ld(`fetch for "${o.url}" responded with ${o.status}: ${o.statusText}`,o)}).then(o=>{switch(a){case"arraybuffer":return o.arrayBuffer();case"blob":return o.blob();case"document":return o.text().then(h=>new DOMParser().parseFromString(h,r));case"json":return o.json();default:if(r===void 0)return o.text();{const c=/charset="?([^;"\s]*)"?/i.exec(r),l=c&&c[1]?c[1].toLowerCase():void 0,d=new TextDecoder(l);return o.arrayBuffer().then(g=>d.decode(g))}}}).then(o=>{se.add(t,o);const h=Vt[t];delete Vt[t];for(let c=0,l=h.length;c<l;c++)h[c].onLoad?.(o)}).catch(o=>{const h=Vt[t];if(h===void 0)throw this.manager.itemError(t),o;delete Vt[t];for(let c=0,l=h.length;c<l;c++)h[c].onError?.(o);this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class ud extends _s{constructor(t){super(t)}load(t,e){const s=new fa(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,{onLoad:n=>{try{const r=n.slice(0);new AudioContext().decodeAudioData(r,o=>{e?.onLoad?.(o)}).catch(o=>{e?.onError?.(o),this.manager.itemError(t)})}catch(r){e?.onError?.(r),this.manager.itemError(t)}},onProgress:e?.onProgress,onError:e?.onError})}}m.Arrow=eu,m.AudioLoader=ud,m.BezierEasing=li,m.COLORS=ir,m.CSSToJSEasing=ih,m.Clock=fi,m.CommonKeyCode=wh,m.Confetti=yu,m.Cross=ou,m.CustomCanvasContext=Ae,m.CustomCanvasGradient=ls,m.CustomCanvasPattern=ei,m.DOMEventBus=tr,m.DOMKey=Qn,m.DOMParse=er,m.DOMSVGUtil=oe,m.DOMToBlob=bn,m.DOMToString=Js,m.DOMUtil=I,m.DOMVideo=Oe,m.Easing=D,m.Ellipse=aa,m.FetchWithAxios=cl,m.FetchWithAxiosRequestCancel=Wr,m.FileLoader=fa,m.Fox=su,m.Heart=iu,m.HeartVariant=nu,m.ImageBitmapLoader=cd,m.ImageLoader=hd,m.Interpolation=Bt,m.Line=ce,m.LinePicture=tu,m.LineQuadraticBezier=Kl,m.Matrix=at,m.Matrix3D=ut,m.Pagination=nd,m.Point=Ut,m.Point3D=Re,m.Point3Ds=gu,m.Points=ra,m.QRCode=ee,m.Rabbit=au,m.Rect=Gt,m.Ring=Gi,m.RingIndicator=fu,m.SVGParse=na,m.SVGParsedPathArgsLength=ke,m.Sector=cu,m.SectorArc=ha,m.Segment=du,m.Shape=U,m.ShapeCombo=Vi,m.ShapeGroup=st,m.Ship=lu,m.Slider=uu,m.Star=ru,m.TWEEN=uh,m.Text=Ge,m.Timeline=gs,m.Tip=oa,m.Tree=hu,m.Tween=di,m.WebGLRenderer=Su,m.WebRTCClient=vu,m.WebSocketClient=no,m.YZCanvas=bu,m.YZCanvasContext=us,m.YZMessageChannel=Uh,m.YZSVG=Ql,m.YZWorker=Yh,m.addWatermark=Hl,m.addWxJsReadyFnBeforeConfig=qi,m.ajax=Gh,m.aliJsChooseImage=ed,m.aliJsGetLocation=Qu,m.aliJsOpenLocation=td,m.aliJsPreviewImage=sd,m.aliJsReady=Ju,m.aliJsScan=Ku,m.aliJsTradePay=Zu,m.angle=$t,m.appendURLSearchString=lr,m.base64EncodeOutputStream=Kr,m.base64URLDecode=zr,m.base64URLEncode=Vr,m.bitmapMapper=ca,m.blobToRawImage=wl,m.byteArrayOutputStream=Bi,m.canDrawBitmap=Ln,m.canUsePaths=Io,m.canUseWorker=_n,m.changeBrightness=zl,m.changeDiaphaneity=ql,m.changeSize=Vl,m.checkWxJsApi=Mu,m.clearCookies=Mh,m.computeImageDisplayRect=ll,m.createXMLHttpRequest=ur,m.decodeUseTextDecoder=qr,m.decryptInCommon=al,m.distance=os,m.distance2=hs,m.drawBitmapInCanvas=xu,m.drawQRCodeToCanvas=Zl,m.easeNameToCubicBezier=ui,m.encodeUseTextEncoder=Is,m.encryptInCommon=rl,m.fileOrBlobToDataURL=Ni,m.flipSideToSide=bl,m.flipUpsideDown=vl,m.flushURLSearchString=Xh,m.formDataToSearchString=cr,m.fpsTask=zo,m.getBitmapFromCanvas=wu,m.getBrowserClient=Ks,m.getBrowserClientVersion=po,m.getBrowserLanguage=yo,m.getColor=It,m.getColorScheme=sr,m.getCookie=Th,m.getCookieObject=Ph,m.getDOMMatrix=pi,m.getDirection=Ro,m.getElementPositionInPage=En,m.getElementPositionInPage2=co,m.getElementPositionInViewport=Tn,m.getFileExtension=Sn,m.getFileTypeFromFile=io,m.getFilesImageInfo=dl,m.getFormSubmitData=Vh,m.getHexColorString=ye,m.getImageAspectRatio=ul,m.getImageDataByAIData=Wl,m.getImageDataFromBitmap=ml,m.getImageDataFromUrl=$r,m.getImageDataFromVideo=fl,m.getImageMainColor=xl,m.getInternetExplorerVersion=An,m.getMousePositionInElement=Mt,m.getMousePositionInPage=Pn,m.getMousePositionInViewport=fo,m.getOperatingSystem=ns,m.getOperatingSystemVersion=mo,m.getOppositeColor=wi,m.getOppositeHexColorString=nr,m.getOppositeRGBColorString=Ah,m.getPageBodyElement=ao,m.getPageDocumentElement=Pe,m.getPageSize=ho,m.getRGBColorString=xi,m.getRawImageInfo=ks,m.getRelativeBoundingClientRect=lo,m.getScreenElement=ro,m.getScrollParent=Tu,m.getTimeZone=wo,m.getURL=xs,m.getUserGeolocationPromise=go,m.getVerticalScrollPercentInPage=uo,m.getViewportSize=oo,m.gifImage=Qr,m.gradientColor=bi,m.h=Wt,m.hasDocument=Po,m.hasHistory=Mo,m.hasWindow=kn,m.hsb2rgb=_h,m.hsl2rgb=Lh,m.hsv2rgb=kh,m.imageDataToBitmap=pl,m.imageDataToBlob=yl,m.imageDataToDataURL=gl,m.injectWxJsConfig=Pu,m.isAliBrowser=Dn,m.isAliMiniProgram=To,m.isAndroid=Mn,m.isAppleDevice=xo,m.isBrowserSupportFileAPI=Ao,m.isDarkMode=vo,m.isElement=Do,m.isIE=So,m.isIE9or10=Co,m.isIOS=Qs,m.isMacOS=ti,m.isMobile=bo,m.isNative=rs,m.isURL=Fh,m.isWxBrowser=In,m.isWxMiniProgram=Eo,m.jpgToPng=Xl,m.leftRotate=Sl,m.length=as,m.linkExport=Zs,m.localstorage=gi,m.mapTDTJSSDK=id,m.marginSharpen=Bl,m.microTask=Wo,m.mosaic=jl,m.mount=ge,m.multiplyArrayOfMatrix=fh,m.multiplyArrayOfMatrix3D=mh,m.multiplyMatrix=Jn,m.multiplyMatrix3D=Zn,m.nextTick=jo,m.normalizePoint=Lo,m.objectHash=jr,m.onDocumentReady=Ch,m.outputGifBase64=ta,m.outputQRCodeBase64=Jl,m.pack=il,m.parseTransformToMatrix=mi,m.parseURL=ar,m.patch=is,m.patchDOM=Cn,m.pngToJpg=Yl,m.polar=At,m.prefixes=ko,m.radiusClip=Gl,m.randomColorHexString=Ih,m.randomColorNumber=rr,m.readFileInBrowser=ss,m.recordToSearchString=hr,m.rectClip=Ul,m.requestAnimationFrameCycle=ni,m.reverseCSSToJSEasing=nh,m.reverseEaseNameToCubicBezier=Hn,m.reverseEasing=Un,m.rgb2hsb=Oh,m.rgb2hsl=Nh,m.rgb2hsv=Rh,m.rightRotate=Cl,m.rotatePoint=Tt,m.scheduleIdle=Bn,m.scheduleYZIdle=hi,m.searchStringToRecord=Bh,m.selectFileInBrowser=vn,m.setColorScheme=ys,m.setCookie=Eh,m.setIntervalAccurate=Vo,m.setRem=_o,m.setTimeoutAccurate=ri,m.shadeColor=Dh,m.sharpen=Fl,m.signInCommon=ol,m.singletonDOMEventBus=et,m.stringHash=Hr,m.stringToBlob=$s,m.stringToDOM=so,m.theme=yi,m.toBlackAndWhite=Pl,m.toBlue=Dl,m.toBlueAndGreen=Ll,m.toBlueAndGrey=Nl,m.toDegree=tt,m.toGreen=Il,m.toGreenAndGrey=Ol,m.toGrey=El,m.toGrey2=Tl,m.toOpposite=Ml,m.toRadian=O,m.toRed=Al,m.toRedAndBlue=_l,m.toRedAndGreen=kl,m.toRedAndGrey=Rl,m.transformPath2D=dh,m.trimURLHash=or,m.unpack=nl,m.verifyInCommon=hl,m.wxJsChooseImage=Du,m.wxJsDownloadImage=Lu,m.wxJsDownloadVoice=Vu,m.wxJsGetLocalImgData=Ru,m.wxJsGetLocation=ju,m.wxJsGetNetworkType=qu,m.wxJsOnVoicePlayEnd=Uu,m.wxJsOnVoiceRecordEnd=Fu,m.wxJsOpenLocation=Hu,m.wxJsPauseVoice=Xu,m.wxJsPay=$u,m.wxJsPlayVoice=Bu,m.wxJsPreviewImage=ku,m.wxJsScanQRCode=Wu,m.wxJsStartRecord=Ou,m.wxJsStopRecord=Nu,m.wxJsStopVoice=Yu,m.wxJsTranslateVoice=zu,m.wxJsUpdateAppMessageShareData=Au,m.wxJsUpdateTimelineShareData=Iu,m.wxJsUploadImage=_u,m.wxJsUploadVoice=Gu,m.yzCancelIdleCallback=Ho,m.yzRequestIdleCallback=Yn,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
46
46
|
//# sourceMappingURL=zyzgroup_core_web.umd.cjs.map
|