@zyzgroup/core-web 0.1.7 → 0.1.9

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.
Files changed (36) hide show
  1. package/dist/zyzgroup_core_web.iife.js +17 -17
  2. package/dist/zyzgroup_core_web.iife.js.map +1 -1
  3. package/dist/zyzgroup_core_web.js +2404 -2204
  4. package/dist/zyzgroup_core_web.js.map +1 -1
  5. package/dist/zyzgroup_core_web.umd.cjs +16 -16
  6. package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
  7. package/package.json +1 -1
  8. package/types/animate/schedule.d.ts +3 -3
  9. package/types/animate/schedule.d.ts.map +1 -1
  10. package/types/env.d.ts +4 -2
  11. package/types/env.d.ts.map +1 -1
  12. package/types/file.d.ts +3 -2
  13. package/types/file.d.ts.map +1 -1
  14. package/types/hooks/index.d.ts +1 -1
  15. package/types/hooks/index.d.ts.map +1 -1
  16. package/types/hooks/useAttribute.d.ts +4 -3
  17. package/types/hooks/useAttribute.d.ts.map +1 -1
  18. package/types/hooks/useDragDrop.d.ts +12 -0
  19. package/types/hooks/useDragDrop.d.ts.map +1 -0
  20. package/types/hooks/useEventListener.d.ts +1 -1
  21. package/types/hooks/useEventListener.d.ts.map +1 -1
  22. package/types/hooks/useFireEvent.d.ts +5 -2
  23. package/types/hooks/useFireEvent.d.ts.map +1 -1
  24. package/types/hooks/useHotKey.d.ts +1 -0
  25. package/types/hooks/useHotKey.d.ts.map +1 -1
  26. package/types/hooks/useObjectURL.d.ts +1 -1
  27. package/types/hooks/useObjectURL.d.ts.map +1 -1
  28. package/types/hooks/useStyle.d.ts +1 -1
  29. package/types/hooks/useStyle.d.ts.map +1 -1
  30. package/types/hooks/useVnode.d.ts +2 -2
  31. package/types/hooks/useVnode.d.ts.map +1 -1
  32. package/types/hooks/useWindow.d.ts.map +1 -1
  33. package/types/position.d.ts +3 -2
  34. package/types/position.d.ts.map +1 -1
  35. package/types/hooks/useMouse.d.ts +0 -3
  36. package/types/hooks/useMouse.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- var ZYZGroupCoreWeb=function(d){"use strict";var Ai=typeof document<"u"?document.currentScript:null;class Di extends Error{response;constructor(t,e){super(t),this.response=e}}function Ii(){return typeof window<"u"?window:typeof global<"u"?global:this||{}}const as=n=>{let t=null;switch(n){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/i;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"trim":t=/^\s+|\s+$/g;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(as("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"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"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;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"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/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"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"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;break;case"bezier":t=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/;break;case"chinese-name":t=/^(?:[\u4e00-\u9fa5·]{2,16})$/;break;case"chinese":t=new RegExp(String.raw`
1
+ var ZYZGroupCoreWeb=function(f){"use strict";var Di=typeof document<"u"?document.currentScript:null;class Ii extends Error{response;constructor(t,e){super(t),this.response=e}}function Mi(){return typeof window<"u"?window:typeof global<"u"?global:this||{}}const as=n=>{let t=null;switch(n){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/i;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"trim":t=/^\s+|\s+$/g;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(as("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"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"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;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"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/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"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"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;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,12 +7,12 @@ var ZYZGroupCoreWeb=function(d){"use strict";var Ai=typeof document<"u"?document
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},Gt=(n,t)=>(typeof n=="string"&&(n=as(n)||new RegExp(n)),n.test(t)),Mi=(n,t)=>{typeof n=="string"&&(n=as(n)||new RegExp(n));const e=t.match(n);return e?n.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},ki=(n,t)=>{typeof n=="string"&&(n=as(n)||new RegExp(n));const e=[],s=t.matchAll(n);for(const i of s)e.push({matchIndex:typeof i.index=="number"?i.index:-1,fullMatch:i[0],groupMatchs:i.slice(1)});return e};function Eo(n){const t=n.match(/[\s\S]/gu);return t?t.length:0}function Li(n,t){const e=n.codePointAt(t);return e?String.fromCodePoint(e):void 0}function Ri(n=12){const t="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz0123456789",e=t.length;let s="";for(let i=0;i<n;i++)s+=t[Math.floor(Math.random()*e)];return s}function _o(n){return n.replace(/(^\w)/g,t=>t.toLowerCase())}const mt=(n,t="-")=>{let e=n.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return e=e.replace(new RegExp(`^${t}`),""),e};function Ao(n){return n.replace(/(^\w|[_-]\w)/g,t=>t.slice(-1).toUpperCase())}function os(n){return _o(Ao(n))}function Oi(n){let t="";for(let e=0,s=n.length;e<s;e++){const i=n.charCodeAt(e);i>=1&&i<=127?t+=n.charAt(e):i>2047?(t+=String.fromCharCode(224|i>>12&15),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|i>>0&63)):(t+=String.fromCharCode(192|i>>6&31),t+=String.fromCharCode(128|i>>0&63))}return t}function Do(n){return n!=null}function Io(n,...t){return new n.constructor(...t)}function Fi(n,t){for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&!t(e,n[e])&&delete n[e];return n}function Mo(n,t="",e=["","sign","key"]){return Object.keys(n).filter(s=>{for(let i=0,r=e.length;i<r;i++)if(n[s]==e[i])return!1;return!0}).sort().map(s=>`${s}=${n[s]}`).join("&")+t}function Te(n,t){const e=n.findIndex(s=>s===t);return e>=0&&n.splice(e,1),n}function Ni(n,t){return n.findIndex(e=>e==t)>=0}function ko(n,...t){return t.forEach(e=>{Ni(n,e)||n.push(e)}),n}let Bi;try{Bi=Map}catch{Bi=function(){}}let Ui;try{Ui=Set}catch{Ui=function(){}}function Kt(n,t){if(n=parseFloat(n),isNaN(n)){if(typeof t=="number")return t;throw new Error(`parseNumber(${n}) isNaN!`)}return n}function hs(n,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(n-t)<e}const H=(n,t,e)=>n<t?t:n>e?e:n,Lo=(n,t,e)=>s=>{const i=H(s,n,t);return e==0?i:t-i<e?t:Math.round(i/e)*e};function Ro(n,t=12){return Kt(n).toFixed(t)}function Ot(n,t=12){return+Ro(n,t)}function hn(n,t){const e=Mi("number-single",String(n));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):Do(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(e.matchIndex+e.fullMatch.length):""}}function Yi(n){const t=Mi("number",n);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}Oo();function Oo(){const n=new ArrayBuffer(4),t=new Float32Array(n),e=new Uint32Array(n),s=new Uint32Array(512),i=new Uint32Array(512);for(let h=0;h<256;++h){const c=h-127;c<-27?(s[h]=0,s[h|256]=32768,i[h]=24,i[h|256]=24):c<-14?(s[h]=1024>>-c-14,s[h|256]=1024>>-c-14|32768,i[h]=-c-1,i[h|256]=-c-1):c<=15?(s[h]=c+15<<10,s[h|256]=c+15<<10|32768,i[h]=13,i[h|256]=13):c<128?(s[h]=31744,s[h|256]=64512,i[h]=24,i[h|256]=24):(s[h]=31744,s[h|256]=64512,i[h]=13,i[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:i,mantissaTable:r,exponentTable:a,offsetTable:o}}var Ft=(n=>(n.UNKNOWN="",n.TEXT="text/plain",n.MD="text/plain",n.HTML="text/html",n.XML_TEXT="text/xml",n.CSS="text/css",n.JPEG="image/jpeg",n.PNG="image/png",n.GIF="image/gif",n.BMP="image/bmp",n.WEBP="image/webp",n.SVG="image/svg+xml",n.ICON="image/x-icon",n.MICROSOFT_ICON="image/vnd.microsoft.icon",n.MPEG="audio/mpeg",n.MP3="audio/mpeg",n.MP4="video/mp4",n.OGG="audio/ogg",n.WAV="audio/wav",n.MIDI="audio/midi",n.WEBM="video/webm",n.VIDEO_OGG="video/ogg",n.OCTET_STREAM="application/octet-stream",n.JAVASCRIPT="application/javascript",n.ECMASCRIPT="application/ecmascript",n.JSON="application/json",n.XML="application/xml",n.XHTML="application/xhtml+xml",n.XWWW="application/x-www-form-urlencoded",n.DOC="application/msword",n.CSV="application/x-csv",n.EXCEL="application/vnb.ms-excel",n.PPT="application/vnb.mspowerpoint",n.PDF="application/pdf",n.ZIP="application/zip",n.TGZ="application/x-gtar",n.TAR_GZ="application/x-gzip",n.EOT="appliaction/vnd.ms-fontobject",n.TTF="aplication/font-sfnt",n.PKCS12="aplication/pkcs12",n))(Ft||{}),cs=(n=>(n.ascii="ascii",n.utf8="utf8",n.utf16le="utf16le",n.ucs2="ucs2",n.base64="base64",n.base64url="base64url",n.latin1="latin1",n.binary="binary",n.hex="hex",n))(cs||{}),Tt=(n=>(n.text="text",n.dataURL="dataURL",n.binaryString="binaryString",n.arraybuffer="arraybuffer",n))(Tt||{});const Ce=(n,t=16)=>{let e=n.toLowerCase();const s=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||i||r)&&(e=e.slice(2)),s&&(t=2),i&&(t=8),r&&(t=16);const a=parseInt(e,t);if(isNaN(a))throw new Error(`radixStringToNumber(${n}, ${t}) 无法解析!`);return a};function Fo(n){return new TextEncoder().encode(n)}function No(n){return String.fromCharCode.apply(null,new Uint16Array(n))}const cn=(n,t,e)=>t?e===cs.base64?new Blob([n],{type:`${t};${e}`}):e===cs.utf8?new Blob([n],{type:`${t};charset=${e}`}):new Blob([n],{type:`${t}`}):new Blob([n]),Bo=n=>{let t=Ft.UNKNOWN;switch(new DataView(n).getUint32(0,Uo()).toString(16).toUpperCase()){case"FFD8FFDB":t=Ft.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Ft.JPEG;break;case"89504E47":t=Ft.PNG;break;case"47494638":t=Ft.GIF;break;case"52494646":t=Ft.WEBP;break;case"25504446":t=Ft.PDF;break;case"504B0304":t=Ft.ZIP;break}return t};function Uo(){const n=Uint32Array.of(305419896),t=new Uint8Array(n.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}function Q(){return(performance||Date).now()}function Yo(n){let t=0;for(let e=5;e>=0;e=e-2)e==5?t+=n[e-1]*10+n[e]:e==3?t+=(n[e-1]*10+n[e])*60:e==1&&(t+=(n[e-1]*10+n[e])*60*60);return t=Math.floor(Math.max(0,t)),t*1e3}function Xo(n){let t=Yo(n)/1e3;const e=t%60;n[5]=e%10,n[4]=Math.floor(e/10),t=Math.floor(t/60);const s=t%60;n[3]=s%10,n[2]=Math.floor(s/10),t=Math.floor(t/60);const i=t%60%24;return n[1]=i%10,n[0]=Math.floor(i/10),n}function zo(n,t=1){return n[5]+=t,Xo(n)}const Go=(n,t=":")=>{const e=`${n[0]}${n[1]}`,s=`${n[2]}${n[3]}`,i=`${n[4]}${n[5]}`;return[e,s,i].join(t)};function Vo(n,t){let e;return function(...s){clearTimeout(e),e=setTimeout(()=>{n.apply(this,s)},t)}}class ls{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=>{s(...e)}),this}once(t,e){const i=(()=>{let r=!1;return(...a)=>{r||(r=!0,e(...a),this.off(t,i))}})();return this.on(t,i),this}}const Xi=()=>{};function qo(n){let t=!1;return function(...e){if(!t)return t=!0,n.apply(this,e)}}Array.prototype.ap=function(n){return this.reduce((t,e)=>t.concat(n.map(e)),[])};let Le;function pt(n){Le=n,n(),Le=null}class jo{subscribers=new Set;add(){Le&&!this.subscribers.has(Le)&&this.subscribers.add(Le)}notify(){this.subscribers.forEach(t=>t())}}const zi=new WeakMap;function us(n,t){let e=zi.get(n);e||(e=new Map,zi.set(n,e));let s=e.get(t);return s||(s=new jo,e.set(t,s)),s}function Ho(n,t=!1){return Object.keys(n).forEach(e=>{let s=n[e];if(t&&typeof s=="object"&&s!==null)n[e]=ln(s,t);else{const i=us(n,e);Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get(){return i.add(),s},set(r){s!=r&&(s=r,i.notify())}})}}),n}function fs(n,t=!1){return Ho({value:n},t)}function ln(n,t=!1){const e={get(i,r,a){const o=Reflect.get(i,r,a);if(t&&typeof o=="object"&&o!==null&&!("isYZReactiveProxy"in o)){const c=ln(o,t);c.YZReactiveProxyParentTarget=i,c.YZReactiveProxyParentKey=r,Reflect.set(a,r,c)}return us(i,r).add(),Reflect.get(i,r,a)},set(i,r,a,o){const h=Reflect.get(i,r,o),c=Reflect.set(i,r,a,o);return Array.isArray(i)?us(i.YZReactiveProxyParentTarget,i.YZReactiveProxyParentKey).notify():h!=a&&us(i,r).notify(),c},has(i,r){return r==="isYZReactiveProxy"||r in i}};return new Proxy(n,e)}const Gi=ln;class ue{maps=new Map;mapsAddedDuringUpdate=new Map;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)}clear(){this.maps.clear(),this.mapsAddedDuringUpdate.clear()}filter(t){let e=Array.from(this.maps.entries());for(;e.length>0;){this.mapsAddedDuringUpdate.clear();for(let s=0,i=e.length;s<i;s++){const[r,a]=e[s];t(r,a)===!1&&this.delete(r)}e=Array.from(this.mapsAddedDuringUpdate.entries())}}}function $o(n,t=(e,s)=>e<=s){const e=n.length;let s=Math.floor(e/2);for(;s>0;){for(let i=s;i<e;i++){const r=n[i];let a=i;for(;a>=s&&!t(n[a-s],r);)n[a]=n[a-s],a-=s;n[a]=r}s=Math.floor(s/2)}}function Wo(){const n={};return n.promise=new Promise((t,e)=>{n.resolve=t,n.reject=e}),n}let Vi;try{Vi=Promise}catch{Vi=function(){}}function qi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ji={exports:{}};(function(n,t){(function(e){n.exports=e()})(function(e){var s=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(v,x){var p=v[0],g=v[1],E=v[2],C=v[3];p+=(g&E|~g&C)+x[0]-680876936|0,p=(p<<7|p>>>25)+g|0,C+=(p&g|~p&E)+x[1]-389564586|0,C=(C<<12|C>>>20)+p|0,E+=(C&p|~C&g)+x[2]+606105819|0,E=(E<<17|E>>>15)+C|0,g+=(E&C|~E&p)+x[3]-1044525330|0,g=(g<<22|g>>>10)+E|0,p+=(g&E|~g&C)+x[4]-176418897|0,p=(p<<7|p>>>25)+g|0,C+=(p&g|~p&E)+x[5]+1200080426|0,C=(C<<12|C>>>20)+p|0,E+=(C&p|~C&g)+x[6]-1473231341|0,E=(E<<17|E>>>15)+C|0,g+=(E&C|~E&p)+x[7]-45705983|0,g=(g<<22|g>>>10)+E|0,p+=(g&E|~g&C)+x[8]+1770035416|0,p=(p<<7|p>>>25)+g|0,C+=(p&g|~p&E)+x[9]-1958414417|0,C=(C<<12|C>>>20)+p|0,E+=(C&p|~C&g)+x[10]-42063|0,E=(E<<17|E>>>15)+C|0,g+=(E&C|~E&p)+x[11]-1990404162|0,g=(g<<22|g>>>10)+E|0,p+=(g&E|~g&C)+x[12]+1804603682|0,p=(p<<7|p>>>25)+g|0,C+=(p&g|~p&E)+x[13]-40341101|0,C=(C<<12|C>>>20)+p|0,E+=(C&p|~C&g)+x[14]-1502002290|0,E=(E<<17|E>>>15)+C|0,g+=(E&C|~E&p)+x[15]+1236535329|0,g=(g<<22|g>>>10)+E|0,p+=(g&C|E&~C)+x[1]-165796510|0,p=(p<<5|p>>>27)+g|0,C+=(p&E|g&~E)+x[6]-1069501632|0,C=(C<<9|C>>>23)+p|0,E+=(C&g|p&~g)+x[11]+643717713|0,E=(E<<14|E>>>18)+C|0,g+=(E&p|C&~p)+x[0]-373897302|0,g=(g<<20|g>>>12)+E|0,p+=(g&C|E&~C)+x[5]-701558691|0,p=(p<<5|p>>>27)+g|0,C+=(p&E|g&~E)+x[10]+38016083|0,C=(C<<9|C>>>23)+p|0,E+=(C&g|p&~g)+x[15]-660478335|0,E=(E<<14|E>>>18)+C|0,g+=(E&p|C&~p)+x[4]-405537848|0,g=(g<<20|g>>>12)+E|0,p+=(g&C|E&~C)+x[9]+568446438|0,p=(p<<5|p>>>27)+g|0,C+=(p&E|g&~E)+x[14]-1019803690|0,C=(C<<9|C>>>23)+p|0,E+=(C&g|p&~g)+x[3]-187363961|0,E=(E<<14|E>>>18)+C|0,g+=(E&p|C&~p)+x[8]+1163531501|0,g=(g<<20|g>>>12)+E|0,p+=(g&C|E&~C)+x[13]-1444681467|0,p=(p<<5|p>>>27)+g|0,C+=(p&E|g&~E)+x[2]-51403784|0,C=(C<<9|C>>>23)+p|0,E+=(C&g|p&~g)+x[7]+1735328473|0,E=(E<<14|E>>>18)+C|0,g+=(E&p|C&~p)+x[12]-1926607734|0,g=(g<<20|g>>>12)+E|0,p+=(g^E^C)+x[5]-378558|0,p=(p<<4|p>>>28)+g|0,C+=(p^g^E)+x[8]-2022574463|0,C=(C<<11|C>>>21)+p|0,E+=(C^p^g)+x[11]+1839030562|0,E=(E<<16|E>>>16)+C|0,g+=(E^C^p)+x[14]-35309556|0,g=(g<<23|g>>>9)+E|0,p+=(g^E^C)+x[1]-1530992060|0,p=(p<<4|p>>>28)+g|0,C+=(p^g^E)+x[4]+1272893353|0,C=(C<<11|C>>>21)+p|0,E+=(C^p^g)+x[7]-155497632|0,E=(E<<16|E>>>16)+C|0,g+=(E^C^p)+x[10]-1094730640|0,g=(g<<23|g>>>9)+E|0,p+=(g^E^C)+x[13]+681279174|0,p=(p<<4|p>>>28)+g|0,C+=(p^g^E)+x[0]-358537222|0,C=(C<<11|C>>>21)+p|0,E+=(C^p^g)+x[3]-722521979|0,E=(E<<16|E>>>16)+C|0,g+=(E^C^p)+x[6]+76029189|0,g=(g<<23|g>>>9)+E|0,p+=(g^E^C)+x[9]-640364487|0,p=(p<<4|p>>>28)+g|0,C+=(p^g^E)+x[12]-421815835|0,C=(C<<11|C>>>21)+p|0,E+=(C^p^g)+x[15]+530742520|0,E=(E<<16|E>>>16)+C|0,g+=(E^C^p)+x[2]-995338651|0,g=(g<<23|g>>>9)+E|0,p+=(E^(g|~C))+x[0]-198630844|0,p=(p<<6|p>>>26)+g|0,C+=(g^(p|~E))+x[7]+1126891415|0,C=(C<<10|C>>>22)+p|0,E+=(p^(C|~g))+x[14]-1416354905|0,E=(E<<15|E>>>17)+C|0,g+=(C^(E|~p))+x[5]-57434055|0,g=(g<<21|g>>>11)+E|0,p+=(E^(g|~C))+x[12]+1700485571|0,p=(p<<6|p>>>26)+g|0,C+=(g^(p|~E))+x[3]-1894986606|0,C=(C<<10|C>>>22)+p|0,E+=(p^(C|~g))+x[10]-1051523|0,E=(E<<15|E>>>17)+C|0,g+=(C^(E|~p))+x[1]-2054922799|0,g=(g<<21|g>>>11)+E|0,p+=(E^(g|~C))+x[8]+1873313359|0,p=(p<<6|p>>>26)+g|0,C+=(g^(p|~E))+x[15]-30611744|0,C=(C<<10|C>>>22)+p|0,E+=(p^(C|~g))+x[6]-1560198380|0,E=(E<<15|E>>>17)+C|0,g+=(C^(E|~p))+x[13]+1309151649|0,g=(g<<21|g>>>11)+E|0,p+=(E^(g|~C))+x[4]-145523070|0,p=(p<<6|p>>>26)+g|0,C+=(g^(p|~E))+x[11]-1120210379|0,C=(C<<10|C>>>22)+p|0,E+=(p^(C|~g))+x[2]+718787259|0,E=(E<<15|E>>>17)+C|0,g+=(C^(E|~p))+x[9]-343485551|0,g=(g<<21|g>>>11)+E|0,v[0]=p+v[0]|0,v[1]=g+v[1]|0,v[2]=E+v[2]|0,v[3]=C+v[3]|0}function r(v){var x=[],p;for(p=0;p<64;p+=4)x[p>>2]=v.charCodeAt(p)+(v.charCodeAt(p+1)<<8)+(v.charCodeAt(p+2)<<16)+(v.charCodeAt(p+3)<<24);return x}function a(v){var x=[],p;for(p=0;p<64;p+=4)x[p>>2]=v[p]+(v[p+1]<<8)+(v[p+2]<<16)+(v[p+3]<<24);return x}function o(v){var x=v.length,p=[1732584193,-271733879,-1732584194,271733878],g,E,C,F,G,V;for(g=64;g<=x;g+=64)i(p,r(v.substring(g-64,g)));for(v=v.substring(g-64),E=v.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0;g<E;g+=1)C[g>>2]|=v.charCodeAt(g)<<(g%4<<3);if(C[g>>2]|=128<<(g%4<<3),g>55)for(i(p,C),g=0;g<16;g+=1)C[g]=0;return F=x*8,F=F.toString(16).match(/(.*?)(.{0,8})$/),G=parseInt(F[2],16),V=parseInt(F[1],16)||0,C[14]=G,C[15]=V,i(p,C),p}function h(v){var x=v.length,p=[1732584193,-271733879,-1732584194,271733878],g,E,C,F,G,V;for(g=64;g<=x;g+=64)i(p,a(v.subarray(g-64,g)));for(v=g-64<x?v.subarray(g-64):new Uint8Array(0),E=v.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0;g<E;g+=1)C[g>>2]|=v[g]<<(g%4<<3);if(C[g>>2]|=128<<(g%4<<3),g>55)for(i(p,C),g=0;g<16;g+=1)C[g]=0;return F=x*8,F=F.toString(16).match(/(.*?)(.{0,8})$/),G=parseInt(F[2],16),V=parseInt(F[1],16)||0,C[14]=G,C[15]=V,i(p,C),p}function c(v){var x="",p;for(p=0;p<4;p+=1)x+=s[v>>p*8+4&15]+s[v>>p*8&15];return x}function l(v){var x;for(x=0;x<v.length;x+=1)v[x]=c(v[x]);return v.join("")}l(o("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function v(x,p){return x=x|0||0,x<0?Math.max(x+p,0):Math.min(x,p)}ArrayBuffer.prototype.slice=function(x,p){var g=this.byteLength,E=v(x,g),C=g,F,G,V,J;return p!==e&&(C=v(p,g)),E>C?new ArrayBuffer(0):(F=C-E,G=new ArrayBuffer(F),V=new Uint8Array(G),J=new Uint8Array(this,E,F),V.set(J),G)}}();function f(v){return/[\u0080-\uFFFF]/.test(v)&&(v=unescape(encodeURIComponent(v))),v}function y(v,x){var p=v.length,g=new ArrayBuffer(p),E=new Uint8Array(g),C;for(C=0;C<p;C+=1)E[C]=v.charCodeAt(C);return x?E:g}function b(v){return String.fromCharCode.apply(null,new Uint8Array(v))}function w(v,x,p){var g=new Uint8Array(v.byteLength+x.byteLength);return g.set(new Uint8Array(v)),g.set(new Uint8Array(x),v.byteLength),p?g:g.buffer}function _(v){var x=[],p=v.length,g;for(g=0;g<p-1;g+=2)x.push(parseInt(v.substr(g,2),16));return String.fromCharCode.apply(String,x)}function S(){this.reset()}return S.prototype.append=function(v){return this.appendBinary(f(v)),this},S.prototype.appendBinary=function(v){this._buff+=v,this._length+=v.length;var x=this._buff.length,p;for(p=64;p<=x;p+=64)i(this._hash,r(this._buff.substring(p-64,p)));return this._buff=this._buff.substring(p-64),this},S.prototype.end=function(v){var x=this._buff,p=x.length,g,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C;for(g=0;g<p;g+=1)E[g>>2]|=x.charCodeAt(g)<<(g%4<<3);return this._finish(E,p),C=l(this._hash),v&&(C=_(C)),this.reset(),C},S.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},S.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},S.prototype.setState=function(v){return this._buff=v.buff,this._length=v.length,this._hash=v.hash,this},S.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},S.prototype._finish=function(v,x){var p=x,g,E,C;if(v[p>>2]|=128<<(p%4<<3),p>55)for(i(this._hash,v),p=0;p<16;p+=1)v[p]=0;g=this._length*8,g=g.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(g[2],16),C=parseInt(g[1],16)||0,v[14]=E,v[15]=C,i(this._hash,v)},S.hash=function(v,x){return S.hashBinary(f(v),x)},S.hashBinary=function(v,x){var p=o(v),g=l(p);return x?_(g):g},S.ArrayBuffer=function(){this.reset()},S.ArrayBuffer.prototype.append=function(v){var x=w(this._buff.buffer,v,!0),p=x.length,g;for(this._length+=v.byteLength,g=64;g<=p;g+=64)i(this._hash,a(x.subarray(g-64,g)));return this._buff=g-64<p?new Uint8Array(x.buffer.slice(g-64)):new Uint8Array(0),this},S.ArrayBuffer.prototype.end=function(v){var x=this._buff,p=x.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E,C;for(E=0;E<p;E+=1)g[E>>2]|=x[E]<<(E%4<<3);return this._finish(g,p),C=l(this._hash),v&&(C=_(C)),this.reset(),C},S.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},S.ArrayBuffer.prototype.getState=function(){var v=S.prototype.getState.call(this);return v.buff=b(v.buff),v},S.ArrayBuffer.prototype.setState=function(v){return v.buff=y(v.buff,!0),S.prototype.setState.call(this,v)},S.ArrayBuffer.prototype.destroy=S.prototype.destroy,S.ArrayBuffer.prototype._finish=S.prototype._finish,S.ArrayBuffer.hash=function(v,x){var p=h(new Uint8Array(v)),g=l(p);return x?_(g):g},S})})(ji);var Jo=ji.exports;const Zo=qi(Jo);function Hi(n,t){return function(){return n.apply(t,arguments)}}const{toString:Ko}=Object.prototype,{getPrototypeOf:un}=Object,ds=(n=>t=>{const e=Ko.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),At=n=>(n=n.toLowerCase(),t=>ds(t)===n),ms=n=>t=>typeof t===n,{isArray:Pe}=Array,Re=ms("undefined");function Qo(n){return n!==null&&!Re(n)&&n.constructor!==null&&!Re(n.constructor)&&xt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const $i=At("ArrayBuffer");function th(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&$i(n.buffer),t}const eh=ms("string"),xt=ms("function"),Wi=ms("number"),ps=n=>n!==null&&typeof n=="object",sh=n=>n===!0||n===!1,gs=n=>{if(ds(n)!=="object")return!1;const t=un(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},nh=At("Date"),ih=At("File"),rh=At("Blob"),ah=At("FileList"),oh=n=>ps(n)&&xt(n.pipe),hh=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||xt(n.append)&&((t=ds(n))==="formdata"||t==="object"&&xt(n.toString)&&n.toString()==="[object FormData]"))},ch=At("URLSearchParams"),[lh,uh,fh,dh]=["ReadableStream","Request","Response","Headers"].map(At),mh=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Oe(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let s,i;if(typeof n!="object"&&(n=[n]),Pe(n))for(s=0,i=n.length;s<i;s++)t.call(null,n[s],s,n);else{const r=e?Object.getOwnPropertyNames(n):Object.keys(n),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,n[o],o,n)}}function Ji(n,t){t=t.toLowerCase();const e=Object.keys(n);let s=e.length,i;for(;s-- >0;)if(i=e[s],t===i.toLowerCase())return i;return null}const fe=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Zi=n=>!Re(n)&&n!==fe;function fn(){const{caseless:n}=Zi(this)&&this||{},t={},e=(s,i)=>{const r=n&&Ji(t,i)||i;gs(t[r])&&gs(s)?t[r]=fn(t[r],s):gs(s)?t[r]=fn({},s):Pe(s)?t[r]=s.slice():t[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Oe(arguments[s],e);return t}const ph=(n,t,e,{allOwnKeys:s}={})=>(Oe(t,(i,r)=>{e&&xt(i)?n[r]=Hi(i,e):n[r]=i},{allOwnKeys:s}),n),gh=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),yh=(n,t,e,s)=>{n.prototype=Object.create(t.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},wh=(n,t,e,s)=>{let i,r,a;const o={};if(t=t||{},n==null)return t;do{for(i=Object.getOwnPropertyNames(n),r=i.length;r-- >0;)a=i[r],(!s||s(a,n,t))&&!o[a]&&(t[a]=n[a],o[a]=!0);n=e!==!1&&un(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},xh=(n,t,e)=>{n=String(n),(e===void 0||e>n.length)&&(e=n.length),e-=t.length;const s=n.indexOf(t,e);return s!==-1&&s===e},bh=n=>{if(!n)return null;if(Pe(n))return n;let t=n.length;if(!Wi(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},vh=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&un(Uint8Array)),Sh=(n,t)=>{const s=(n&&n[Symbol.iterator]).call(n);let i;for(;(i=s.next())&&!i.done;){const r=i.value;t.call(n,r[0],r[1])}},Th=(n,t)=>{let e;const s=[];for(;(e=n.exec(t))!==null;)s.push(e);return s},Ch=At("HTMLFormElement"),Ph=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),Ki=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),Eh=At("RegExp"),Qi=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};Oe(e,(i,r)=>{let a;(a=t(i,r,n))!==!1&&(s[r]=a||i)}),Object.defineProperties(n,s)},_h=n=>{Qi(n,(t,e)=>{if(xt(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=n[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+"'")})}})},Ah=(n,t)=>{const e={},s=i=>{i.forEach(r=>{e[r]=!0})};return Pe(n)?s(n):s(String(n).split(t)),e},Dh=()=>{},Ih=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t;function Mh(n){return!!(n&&xt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const kh=n=>{const t=new Array(10),e=(s,i)=>{if(ps(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const r=Pe(s)?[]:{};return Oe(s,(a,o)=>{const h=e(a,i+1);!Re(h)&&(r[o]=h)}),t[i]=void 0,r}}return s};return e(n,0)},Lh=At("AsyncFunction"),Rh=n=>n&&(ps(n)||xt(n))&&xt(n.then)&&xt(n.catch),tr=((n,t)=>n?setImmediate:t?((e,s)=>(fe.addEventListener("message",({source:i,data:r})=>{i===fe&&r===e&&s.length&&s.shift()()},!1),i=>{s.push(i),fe.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",xt(fe.postMessage)),Oh=typeof queueMicrotask<"u"?queueMicrotask.bind(fe):typeof process<"u"&&process.nextTick||tr,D={isArray:Pe,isArrayBuffer:$i,isBuffer:Qo,isFormData:hh,isArrayBufferView:th,isString:eh,isNumber:Wi,isBoolean:sh,isObject:ps,isPlainObject:gs,isReadableStream:lh,isRequest:uh,isResponse:fh,isHeaders:dh,isUndefined:Re,isDate:nh,isFile:ih,isBlob:rh,isRegExp:Eh,isFunction:xt,isStream:oh,isURLSearchParams:ch,isTypedArray:vh,isFileList:ah,forEach:Oe,merge:fn,extend:ph,trim:mh,stripBOM:gh,inherits:yh,toFlatObject:wh,kindOf:ds,kindOfTest:At,endsWith:xh,toArray:bh,forEachEntry:Sh,matchAll:Th,isHTMLForm:Ch,hasOwnProperty:Ki,hasOwnProp:Ki,reduceDescriptors:Qi,freezeMethods:_h,toObjectSet:Ah,toCamelCase:Ph,noop:Dh,toFiniteNumber:Ih,findKey:Ji,global:fe,isContextDefined:Zi,isSpecCompliantForm:Mh,toJSONObject:kh,isAsyncFn:Lh,isThenable:Rh,setImmediate:tr,asap:Oh};function N(n,t,e,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),i&&(this.response=i,this.status=i.status?i.status:null)}D.inherits(N,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:D.toJSONObject(this.config),code:this.code,status:this.status}}});const er=N.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(n=>{sr[n]={value:n}}),Object.defineProperties(N,sr),Object.defineProperty(er,"isAxiosError",{value:!0}),N.from=(n,t,e,s,i,r)=>{const a=Object.create(er);return D.toFlatObject(n,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),N.call(a,n.message,t,e,s,i),a.cause=n,a.name=n.name,r&&Object.assign(a,r),a};const Fh=null;function dn(n){return D.isPlainObject(n)||D.isArray(n)}function nr(n){return D.endsWith(n,"[]")?n.slice(0,-2):n}function ir(n,t,e){return n?n.concat(t).map(function(i,r){return i=nr(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Nh(n){return D.isArray(n)&&!n.some(dn)}const Bh=D.toFlatObject(D,{},null,function(t){return/^is[A-Z]/.test(t)});function ys(n,t,e){if(!D.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=D.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,S){return!D.isUndefined(S[_])});const s=e.metaTokens,i=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(i))throw new TypeError("visitor must be a function");function c(w){if(w===null)return"";if(D.isDate(w))return w.toISOString();if(!h&&D.isBlob(w))throw new N("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(w)||D.isTypedArray(w)?h&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function l(w,_,S){let v=w;if(w&&!S&&typeof w=="object"){if(D.endsWith(_,"{}"))_=s?_:_.slice(0,-2),w=JSON.stringify(w);else if(D.isArray(w)&&Nh(w)||(D.isFileList(w)||D.endsWith(_,"[]"))&&(v=D.toArray(w)))return _=nr(_),v.forEach(function(p,g){!(D.isUndefined(p)||p===null)&&t.append(a===!0?ir([_],g,r):a===null?_:_+"[]",c(p))}),!1}return dn(w)?!0:(t.append(ir(S,_,r),c(w)),!1)}const f=[],y=Object.assign(Bh,{defaultVisitor:l,convertValue:c,isVisitable:dn});function b(w,_){if(!D.isUndefined(w)){if(f.indexOf(w)!==-1)throw Error("Circular reference detected in "+_.join("."));f.push(w),D.forEach(w,function(v,x){(!(D.isUndefined(v)||v===null)&&i.call(t,v,D.isString(x)?x.trim():x,_,y))===!0&&b(v,_?_.concat(x):[x])}),f.pop()}}if(!D.isObject(n))throw new TypeError("data must be an object");return b(n),t}function rr(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function mn(n,t){this._pairs=[],n&&ys(n,this,t)}const ar=mn.prototype;ar.append=function(t,e){this._pairs.push([t,e])},ar.toString=function(t){const e=t?function(s){return t.call(this,s,rr)}:rr;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function Uh(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function or(n,t,e){if(!t)return n;const s=e&&e.encode||Uh;D.isFunction(e)&&(e={serialize:e});const i=e&&e.serialize;let r;if(i?r=i(t,e):r=D.isURLSearchParams(t)?t.toString():new mn(t,e).toString(s),r){const a=n.indexOf("#");a!==-1&&(n=n.slice(0,a)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class Yh{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){D.forEach(this.handlers,function(s){s!==null&&t(s)})}}const hr=Yh,cr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xh={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:mn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},pn=typeof window<"u"&&typeof document<"u",gn=typeof navigator=="object"&&navigator||void 0,zh=pn&&(!gn||["ReactNative","NativeScript","NS"].indexOf(gn.product)<0),Gh=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Vh=pn&&window.location.href||"http://localhost",it={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pn,hasStandardBrowserEnv:zh,hasStandardBrowserWebWorkerEnv:Gh,navigator:gn,origin:Vh},Symbol.toStringTag,{value:"Module"})),...Xh};function qh(n,t){return ys(n,new it.classes.URLSearchParams,Object.assign({visitor:function(e,s,i,r){return it.isNode&&D.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function jh(n){return D.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Hh(n){const t={},e=Object.keys(n);let s;const i=e.length;let r;for(s=0;s<i;s++)r=e[s],t[r]=n[r];return t}function lr(n){function t(e,s,i,r){let a=e[r++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&D.isArray(i)?i.length:a,h?(D.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!o):((!i[a]||!D.isObject(i[a]))&&(i[a]=[]),t(e,s,i[a],r)&&D.isArray(i[a])&&(i[a]=Hh(i[a])),!o)}if(D.isFormData(n)&&D.isFunction(n.entries)){const e={};return D.forEachEntry(n,(s,i)=>{t(jh(s),i,e,0)}),e}return null}function $h(n,t,e){if(D.isString(n))try{return(t||JSON.parse)(n),D.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(n)}const yn={transitional:cr,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",i=s.indexOf("application/json")>-1,r=D.isObject(t);if(r&&D.isHTMLForm(t)&&(t=new FormData(t)),D.isFormData(t))return i?JSON.stringify(lr(t)):t;if(D.isArrayBuffer(t)||D.isBuffer(t)||D.isStream(t)||D.isFile(t)||D.isBlob(t)||D.isReadableStream(t))return t;if(D.isArrayBufferView(t))return t.buffer;if(D.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 qh(t,this.formSerializer).toString();if((o=D.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return ys(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),$h(t)):t}],transformResponse:[function(t){const e=this.transitional||yn.transitional,s=e&&e.forcedJSONParsing,i=this.responseType==="json";if(D.isResponse(t)||D.isReadableStream(t))return t;if(t&&D.isString(t)&&(s&&!this.responseType||i)){const a=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?N.from(o,N.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:it.classes.FormData,Blob:it.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],n=>{yn.headers[n]={}});const wn=yn,Wh=D.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"]),Jh=n=>{const t={};let e,s,i;return n&&n.split(`
11
- `).forEach(function(a){i=a.indexOf(":"),e=a.substring(0,i).trim().toLowerCase(),s=a.substring(i+1).trim(),!(!e||t[e]&&Wh[e])&&(e==="set-cookie"?t[e]?t[e].push(s):t[e]=[s]:t[e]=t[e]?t[e]+", "+s:s)}),t},ur=Symbol("internals");function Fe(n){return n&&String(n).trim().toLowerCase()}function ws(n){return n===!1||n==null?n:D.isArray(n)?n.map(ws):String(n)}function Zh(n){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=e.exec(n);)t[s[1]]=s[2];return t}const Kh=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function xn(n,t,e,s,i){if(D.isFunction(s))return s.call(this,t,e);if(i&&(t=e),!!D.isString(t)){if(D.isString(s))return t.indexOf(s)!==-1;if(D.isRegExp(s))return s.test(t)}}function Qh(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,s)=>e.toUpperCase()+s)}function tc(n,t){const e=D.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+e,{value:function(i,r,a){return this[s].call(this,t,i,r,a)},configurable:!0})})}class xs{constructor(t){t&&this.set(t)}set(t,e,s){const i=this;function r(o,h,c){const l=Fe(h);if(!l)throw new Error("header name must be a non-empty string");const f=D.findKey(i,l);(!f||i[f]===void 0||c===!0||c===void 0&&i[f]!==!1)&&(i[f||h]=ws(o))}const a=(o,h)=>D.forEach(o,(c,l)=>r(c,l,h));if(D.isPlainObject(t)||t instanceof this.constructor)a(t,e);else if(D.isString(t)&&(t=t.trim())&&!Kh(t))a(Jh(t),e);else if(D.isHeaders(t))for(const[o,h]of t.entries())r(h,o,s);else t!=null&&r(e,t,s);return this}get(t,e){if(t=Fe(t),t){const s=D.findKey(this,t);if(s){const i=this[s];if(!e)return i;if(e===!0)return Zh(i);if(D.isFunction(e))return e.call(this,i,s);if(D.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Fe(t),t){const s=D.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||xn(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let i=!1;function r(a){if(a=Fe(a),a){const o=D.findKey(s,a);o&&(!e||xn(s,s[o],o,e))&&(delete s[o],i=!0)}}return D.isArray(t)?t.forEach(r):r(t),i}clear(t){const e=Object.keys(this);let s=e.length,i=!1;for(;s--;){const r=e[s];(!t||xn(this,this[r],r,t,!0))&&(delete this[r],i=!0)}return i}normalize(t){const e=this,s={};return D.forEach(this,(i,r)=>{const a=D.findKey(s,r);if(a){e[a]=ws(i),delete e[r];return}const o=t?Qh(r):String(r).trim();o!==r&&delete e[r],e[o]=ws(i),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return D.forEach(this,(s,i)=>{s!=null&&s!==!1&&(e[i]=t&&D.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(`
12
- `)}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(i=>s.set(i)),s}static accessor(t){const s=(this[ur]=this[ur]={accessors:{}}).accessors,i=this.prototype;function r(a){const o=Fe(a);s[o]||(tc(i,a),s[o]=!0)}return D.isArray(t)?t.forEach(r):r(t),this}}xs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.reduceDescriptors(xs.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[e]=s}}}),D.freezeMethods(xs);const Dt=xs;function bn(n,t){const e=this||wn,s=t||e,i=Dt.from(s.headers);let r=s.data;return D.forEach(n,function(o){r=o.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function fr(n){return!!(n&&n.__CANCEL__)}function Ee(n,t,e){N.call(this,n??"canceled",N.ERR_CANCELED,t,e),this.name="CanceledError"}D.inherits(Ee,N,{__CANCEL__:!0});function dr(n,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?n(e):t(new N("Request failed with status code "+e.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function ec(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function sc(n,t){n=n||10;const e=new Array(n),s=new Array(n);let i=0,r=0,a;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),l=s[r];a||(a=c),e[i]=h,s[i]=c;let f=r,y=0;for(;f!==i;)y+=e[f++],f=f%n;if(i=(i+1)%n,i===r&&(r=(r+1)%n),c-a<t)return;const b=l&&c-l;return b?Math.round(y*1e3/b):void 0}}function nc(n,t){let e=0,s=1e3/t,i,r;const a=(c,l=Date.now())=>{e=l,i=null,r&&(clearTimeout(r),r=null),n.apply(null,c)};return[(...c)=>{const l=Date.now(),f=l-e;f>=s?a(c,l):(i=c,r||(r=setTimeout(()=>{r=null,a(i)},s-f)))},()=>i&&a(i)]}const bs=(n,t,e=3)=>{let s=0;const i=sc(50,250);return nc(r=>{const a=r.loaded,o=r.lengthComputable?r.total:void 0,h=a-s,c=i(h),l=a<=o;s=a;const f={loaded:a,total:o,progress:o?a/o:void 0,bytes:h,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:r,lengthComputable:o!=null,[t?"download":"upload"]:!0};n(f)},e)},mr=(n,t)=>{const e=n!=null;return[s=>t[0]({lengthComputable:e,total:n,loaded:s}),t[1]]},pr=n=>(...t)=>D.asap(()=>n(...t)),ic=it.hasStandardBrowserEnv?((n,t)=>e=>(e=new URL(e,it.origin),n.protocol===e.protocol&&n.host===e.host&&(t||n.port===e.port)))(new URL(it.origin),it.navigator&&/(msie|trident)/i.test(it.navigator.userAgent)):()=>!0,rc=it.hasStandardBrowserEnv?{write(n,t,e,s,i,r){const a=[n+"="+encodeURIComponent(t)];D.isNumber(e)&&a.push("expires="+new Date(e).toGMTString()),D.isString(s)&&a.push("path="+s),D.isString(i)&&a.push("domain="+i),r===!0&&a.push("secure"),document.cookie=a.join("; ")},read(n){const t=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ac(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function oc(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function gr(n,t,e){let s=!ac(t);return n&&(s||e==!1)?oc(n,t):t}const yr=n=>n instanceof Dt?{...n}:n;function de(n,t){t=t||{};const e={};function s(c,l,f,y){return D.isPlainObject(c)&&D.isPlainObject(l)?D.merge.call({caseless:y},c,l):D.isPlainObject(l)?D.merge({},l):D.isArray(l)?l.slice():l}function i(c,l,f,y){if(D.isUndefined(l)){if(!D.isUndefined(c))return s(void 0,c,f,y)}else return s(c,l,f,y)}function r(c,l){if(!D.isUndefined(l))return s(void 0,l)}function a(c,l){if(D.isUndefined(l)){if(!D.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,f){if(f in t)return s(c,l);if(f in n)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,withXSRFToken: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,f)=>i(yr(c),yr(l),f,!0)};return D.forEach(Object.keys(Object.assign({},n,t)),function(l){const f=h[l]||i,y=f(n[l],t[l],l);D.isUndefined(y)&&f!==o||(e[l]=y)}),e}const wr=n=>{const t=de({},n);let{data:e,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:r,headers:a,auth:o}=t;t.headers=a=Dt.from(a),t.url=or(gr(t.baseURL,t.url,t.allowAbsoluteUrls),n.params,n.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let h;if(D.isFormData(e)){if(it.hasStandardBrowserEnv||it.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((h=a.getContentType())!==!1){const[c,...l]=h?h.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...l].join("; "))}}if(it.hasStandardBrowserEnv&&(s&&D.isFunction(s)&&(s=s(t)),s||s!==!1&&ic(t.url))){const c=i&&r&&rc.read(r);c&&a.set(i,c)}return t},hc=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(e,s){const i=wr(n);let r=i.data;const a=Dt.from(i.headers).normalize();let{responseType:o,onUploadProgress:h,onDownloadProgress:c}=i,l,f,y,b,w;function _(){b&&b(),w&&w(),i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let S=new XMLHttpRequest;S.open(i.method.toUpperCase(),i.url,!0),S.timeout=i.timeout;function v(){if(!S)return;const p=Dt.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),E={data:!o||o==="text"||o==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:p,config:n,request:S};dr(function(F){e(F),_()},function(F){s(F),_()},E),S=null}"onloadend"in S?S.onloadend=v:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(v)},S.onabort=function(){S&&(s(new N("Request aborted",N.ECONNABORTED,n,S)),S=null)},S.onerror=function(){s(new N("Network Error",N.ERR_NETWORK,n,S)),S=null},S.ontimeout=function(){let g=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const E=i.transitional||cr;i.timeoutErrorMessage&&(g=i.timeoutErrorMessage),s(new N(g,E.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,n,S)),S=null},r===void 0&&a.setContentType(null),"setRequestHeader"in S&&D.forEach(a.toJSON(),function(g,E){S.setRequestHeader(E,g)}),D.isUndefined(i.withCredentials)||(S.withCredentials=!!i.withCredentials),o&&o!=="json"&&(S.responseType=i.responseType),c&&([y,w]=bs(c,!0),S.addEventListener("progress",y)),h&&S.upload&&([f,b]=bs(h),S.upload.addEventListener("progress",f),S.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(l=p=>{S&&(s(!p||p.type?new Ee(null,n,S):p),S.abort(),S=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const x=ec(i.url);if(x&&it.protocols.indexOf(x)===-1){s(new N("Unsupported protocol "+x+":",N.ERR_BAD_REQUEST,n));return}S.send(r||null)})},cc=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let s=new AbortController,i;const r=function(c){if(!i){i=!0,o();const l=c instanceof Error?c:this.reason;s.abort(l instanceof N?l:new Ee(l instanceof Error?l.message:l))}};let a=t&&setTimeout(()=>{a=null,r(new N(`timeout ${t} of ms exceeded`,N.ETIMEDOUT))},t);const o=()=>{n&&(a&&clearTimeout(a),a=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),n=null)};n.forEach(c=>c.addEventListener("abort",r));const{signal:h}=s;return h.unsubscribe=()=>D.asap(o),h}},lc=function*(n,t){let e=n.byteLength;if(!t||e<t){yield n;return}let s=0,i;for(;s<e;)i=s+t,yield n.slice(s,i),s=i},uc=async function*(n,t){for await(const e of fc(n))yield*lc(e,t)},fc=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const t=n.getReader();try{for(;;){const{done:e,value:s}=await t.read();if(e)break;yield s}}finally{await t.cancel()}},xr=(n,t,e,s)=>{const i=uc(n,t);let r=0,a,o=h=>{a||(a=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:c,value:l}=await i.next();if(c){o(),h.close();return}let f=l.byteLength;if(e){let y=r+=f;e(y)}h.enqueue(new Uint8Array(l))}catch(c){throw o(c),c}},cancel(h){return o(h),i.return()}},{highWaterMark:2})},vs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",br=vs&&typeof ReadableStream=="function",dc=vs&&(typeof TextEncoder=="function"?(n=>t=>n.encode(t))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),vr=(n,...t)=>{try{return!!n(...t)}catch{return!1}},mc=br&&vr(()=>{let n=!1;const t=new Request(it.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t}),Sr=64*1024,vn=br&&vr(()=>D.isReadableStream(new Response("").body)),Ss={stream:vn&&(n=>n.body)};vs&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ss[t]&&(Ss[t]=D.isFunction(n[t])?e=>e[t]():(e,s)=>{throw new N(`Response type '${t}' is not supported`,N.ERR_NOT_SUPPORT,s)})})})(new Response);const pc=async n=>{if(n==null)return 0;if(D.isBlob(n))return n.size;if(D.isSpecCompliantForm(n))return(await new Request(it.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(D.isArrayBufferView(n)||D.isArrayBuffer(n))return n.byteLength;if(D.isURLSearchParams(n)&&(n=n+""),D.isString(n))return(await dc(n)).byteLength},gc=async(n,t)=>{const e=D.toFiniteNumber(n.getContentLength());return e??pc(t)},Sn={http:Fh,xhr:hc,fetch:vs&&(async n=>{let{url:t,method:e,data:s,signal:i,cancelToken:r,timeout:a,onDownloadProgress:o,onUploadProgress:h,responseType:c,headers:l,withCredentials:f="same-origin",fetchOptions:y}=wr(n);c=c?(c+"").toLowerCase():"text";let b=cc([i,r&&r.toAbortSignal()],a),w;const _=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let S;try{if(h&&mc&&e!=="get"&&e!=="head"&&(S=await gc(l,s))!==0){let E=new Request(t,{method:"POST",body:s,duplex:"half"}),C;if(D.isFormData(s)&&(C=E.headers.get("content-type"))&&l.setContentType(C),E.body){const[F,G]=mr(S,bs(pr(h)));s=xr(E.body,Sr,F,G)}}D.isString(f)||(f=f?"include":"omit");const v="credentials"in Request.prototype;w=new Request(t,{...y,signal:b,method:e.toUpperCase(),headers:l.normalize().toJSON(),body:s,duplex:"half",credentials:v?f:void 0});let x=await fetch(w);const p=vn&&(c==="stream"||c==="response");if(vn&&(o||p&&_)){const E={};["status","statusText","headers"].forEach(V=>{E[V]=x[V]});const C=D.toFiniteNumber(x.headers.get("content-length")),[F,G]=o&&mr(C,bs(pr(o),!0))||[];x=new Response(xr(x.body,Sr,F,()=>{G&&G(),_&&_()}),E)}c=c||"text";let g=await Ss[D.findKey(Ss,c)||"text"](x,n);return!p&&_&&_(),await new Promise((E,C)=>{dr(E,C,{data:g,headers:Dt.from(x.headers),status:x.status,statusText:x.statusText,config:n,request:w})})}catch(v){throw _&&_(),v&&v.name==="TypeError"&&/fetch/i.test(v.message)?Object.assign(new N("Network Error",N.ERR_NETWORK,n,w),{cause:v.cause||v}):N.from(v,v&&v.code,n,w)}})};D.forEach(Sn,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const Tr=n=>`- ${n}`,yc=n=>D.isFunction(n)||n===null||n===!1,Cr={getAdapter:n=>{n=D.isArray(n)?n:[n];const{length:t}=n;let e,s;const i={};for(let r=0;r<t;r++){e=n[r];let a;if(s=e,!yc(e)&&(s=Sn[(a=String(e)).toLowerCase()],s===void 0))throw new N(`Unknown adapter '${a}'`);if(s)break;i[a||"#"+r]=s}if(!s){const r=Object.entries(i).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 :
13
- `+r.map(Tr).join(`
14
- `):" "+Tr(r[0]):"as no adapter specified";throw new N("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:Sn};function Tn(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Ee(null,n)}function Pr(n){return Tn(n),n.headers=Dt.from(n.headers),n.data=bn.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Cr.getAdapter(n.adapter||wn.adapter)(n).then(function(s){return Tn(n),s.data=bn.call(n,n.transformResponse,s),s.headers=Dt.from(s.headers),s},function(s){return fr(s)||(Tn(n),s&&s.response&&(s.response.data=bn.call(n,n.transformResponse,s.response),s.response.headers=Dt.from(s.response.headers))),Promise.reject(s)})}const Er="1.8.4",Ts={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{Ts[n]=function(s){return typeof s===n||"a"+(t<1?"n ":" ")+n}});const _r={};Ts.transitional=function(t,e,s){function i(r,a){return"[Axios v"+Er+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new N(i(a," has been removed"+(e?" in "+e:"")),N.ERR_DEPRECATED);return e&&!_r[a]&&(_r[a]=!0,console.warn(i(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}},Ts.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function wc(n,t,e){if(typeof n!="object")throw new N("options must be an object",N.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let i=s.length;for(;i-- >0;){const r=s[i],a=t[r];if(a){const o=n[r],h=o===void 0||a(o,r,n);if(h!==!0)throw new N("option "+r+" must be "+h,N.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new N("Unknown option "+r,N.ERR_BAD_OPTION)}}const Cs={assertOptions:wc,validators:Ts},Nt=Cs.validators;class Ps{constructor(t){this.defaults=t,this.interceptors={request:new hr,response:new hr}}async request(t,e){try{return await this._request(t,e)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const r=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?r&&!String(s.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(s.stack+=`
15
- `+r):s.stack=r}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=de(this.defaults,e);const{transitional:s,paramsSerializer:i,headers:r}=e;s!==void 0&&Cs.assertOptions(s,{silentJSONParsing:Nt.transitional(Nt.boolean),forcedJSONParsing:Nt.transitional(Nt.boolean),clarifyTimeoutError:Nt.transitional(Nt.boolean)},!1),i!=null&&(D.isFunction(i)?e.paramsSerializer={serialize:i}:Cs.assertOptions(i,{encode:Nt.function,serialize:Nt.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Cs.assertOptions(e,{baseUrl:Nt.spelling("baseURL"),withXsrfToken:Nt.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&D.merge(r.common,r[e.method]);r&&D.forEach(["delete","get","head","post","put","patch","common"],w=>{delete r[w]}),e.headers=Dt.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(e)===!1||(h=h&&_.synchronous,o.unshift(_.fulfilled,_.rejected))});const c=[];this.interceptors.response.forEach(function(_){c.push(_.fulfilled,_.rejected)});let l,f=0,y;if(!h){const w=[Pr.bind(this),void 0];for(w.unshift.apply(w,o),w.push.apply(w,c),y=w.length,l=Promise.resolve(e);f<y;)l=l.then(w[f++],w[f++]);return l}y=o.length;let b=e;for(f=0;f<y;){const w=o[f++],_=o[f++];try{b=w(b)}catch(S){_.call(this,S);break}}try{l=Pr.call(this,b)}catch(w){return Promise.reject(w)}for(f=0,y=c.length;f<y;)l=l.then(c[f++],c[f++]);return l}getUri(t){t=de(this.defaults,t);const e=gr(t.baseURL,t.url,t.allowAbsoluteUrls);return or(e,t.params,t.paramsSerializer)}}D.forEach(["delete","get","head","options"],function(t){Ps.prototype[t]=function(e,s){return this.request(de(s||{},{method:t,url:e,data:(s||{}).data}))}}),D.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(de(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}Ps.prototype[t]=e(),Ps.prototype[t+"Form"]=e(!0)});const Es=Ps;class Cn{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(i=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](i);s._listeners=null}),this.promise.then=i=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(i);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Ee(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)}toAbortSignal(){const t=new AbortController,e=s=>{t.abort(s)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new Cn(function(i){t=i}),cancel:t}}}const xc=Cn;function bc(n){return function(e){return n.apply(null,e)}}function vc(n){return D.isObject(n)&&n.isAxiosError===!0}const Pn={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(Pn).forEach(([n,t])=>{Pn[t]=n});const Sc=Pn;function Ar(n){const t=new Es(n),e=Hi(Es.prototype.request,t);return D.extend(e,Es.prototype,t,{allOwnKeys:!0}),D.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return Ar(de(n,i))},e}const K=Ar(wn);K.Axios=Es,K.CanceledError=Ee,K.CancelToken=xc,K.isCancel=fr,K.VERSION=Er,K.toFormData=ys,K.AxiosError=N,K.Cancel=K.CanceledError,K.all=function(t){return Promise.all(t)},K.spread=bc,K.isAxiosError=vc,K.mergeConfig=de,K.AxiosHeaders=Dt,K.formToJSON=n=>lr(D.isHTMLForm(n)?new FormData(n):n),K.getAdapter=Cr.getAdapter,K.HttpStatusCode=Sc,K.default=K;const Tc=K,Dr=window.crypto.subtle;Dr||console.warn("Crypto API not supported");async function Ir(n,t="SHA-256"){const e=await Dr.digest(t,Fo(n));return No(e)}async function Mr(n,t="SHA-256"){const e=JSON.stringify(Mo(n));return Ir(e,t)}class kr{instance;constructor(t){this.instance=Tc.create(t);const e=new Lr;this.instance.interceptors.request.use(s=>(e.pendingRequest(s),s),s=>(e.cancelRequest(s.config),s)),t?.interceptor&&(this.instance.interceptors.request.use(t.interceptor.request,t.interceptor.requestError),this.instance.interceptors.response.use(t.interceptor.response,t.interceptor.responseError)),this.instance.interceptors.response.use(async s=>(await e.confirmRequest(s.config),s.data),async s=>{const{code:i="",config:r}=s;return!r||!r.retry||(r.retryCounted=r.retryCounted||0,r.retryCounted>=r.retry)?Promise.reject(s):(r.retryCounted++,await new Promise(a=>{setTimeout(a,r.retryDelay)}),await this.request(r))})}async request(t){return await this.instance.request(t)}async get(t,e){return this.request({...e,method:"get",url:t})}async delete(t,e){return this.request({...e,method:"delete",url:t})}async head(t,e){return this.request({...e,method:"head",url:t})}async options(t,e){return this.request({...e,method:"options",url:t})}async post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}async postBlob(t,e,s){return s={...s,headers:{...s?.headers,"Content-Type":"multipart/form-data"}},this.request({...s,method:"post",url:t,data:e})}async postForm(t,e,s){return this.instance.postForm(t,e,{...s})}async put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}async patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class Lr{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async getRequestId(t){const{url:e,method:s,params:i,data:r}=t;return await Mr({url:e,method:s,params:i,data:r})}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(){const t=this.pendingRequestMap.values();for(const e of t)e.abort();this.pendingRequestMap.clear()}}const En=n=>new XMLSerializer().serializeToString(n),Cc=(n,t="text/html")=>new DOMParser().parseFromString(n,t),Rr=(n,t=Ft.SVG,e=cs.utf8)=>cn(En(n),t,e);async function _n(n=["*"],t){if(!document||!(document instanceof Document))throw new Error("This is not a browser environment");let e=[];const s=document.createElement("input");return s.setAttribute("type","file"),s.setAttribute("visibility","hidden"),s.setAttribute("accept",n.join(",")),t&&s.setAttribute("multiple","true"),s.addEventListener("click",i=>{s.value=""},!1),new Promise((i,r)=>{s.addEventListener("change",a=>{e=Array.from(a.target.files||[]),e.length===0?r(new Error("Cancel")):i(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&r(new Error("Cancel"))},1e3)},{once:!0}),s.click()}).then(i=>(s.remove(),i)).catch(i=>{throw s.remove(),i})}function Ne(n,t=Tt.text,e){return new Promise((s,i)=>{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=>{i(a)}),t){case Tt.dataURL:r.readAsDataURL(n);break;case Tt.binaryString:r.readAsBinaryString(n);break;case Tt.arraybuffer:r.readAsArrayBuffer(n);break;case Tt.text:default:r.readAsText(n)}})}async function Pc(n){const t=await Ne(n,Tt.arraybuffer);return Bo(t)}const Ec=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Or(n,t,e,s,i,r,a){const o=new FileReader;o.addEventListener("load",h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),a<s.size)Or(n,t,e,s,i,a,Math.min(a+i,s.size));else return n(e.end())}),o.addEventListener("error",h=>t(h)),o.readAsArrayBuffer(s.slice(r,a))}async function Fr(n,t=1048576){return await new Promise((e,s)=>Or(e,s,new Zo.ArrayBuffer,n,t,0,Math.min(t,n.size)))}class _c{axios;checkURL;uploadURL;file;fileHash;chunkSize;chunks;currentChunk=0;isUploading=!1;begin=0;end=0;timer;timeData=[0,0,0,0,0,0];onExist;onStart;onProgress;onComplete;onTime;constructor(t){this.axios=new kr({baseURL:t.baseURL,interceptor:{request:e=>e,response:e=>(e.config.url==this.uploadURL&&e.status==200&&(this.onProgress?.(this.currentChunk++,this.chunks),this.end==this.file.size?(this.isUploading=!1,this.stopTimeCount(),this.onComplete?.()):this.isUploading&&this.uploadChunk()),e)}}),this.checkURL=t.checkURL,this.uploadURL=t.uploadURL,this.file=t.file,this.chunkSize=t.chunkSize||1048576,this.chunks=Math.ceil(this.file.size/this.chunkSize),this.onExist=t.onExist,this.onStart=t.onStart,this.onProgress=t.onProgress,this.onComplete=t.onComplete,this.onTime=t.onTime}async start(){this.fileHash||(this.fileHash=await Fr(this.file,this.chunkSize)),(await this.axios.post(this.checkURL,{fileName:this.file.name,fileHash:this.fileHash})).isExist?(this.isUploading=!1,this.onExist?.()):this.isUploading||(this.onStart?.(),this.startTimeCount(),await this.uploadChunk())}pause(){this.isUploading&&(this.isUploading=!1,this.stopTimeCount())}async uploadChunk(){this.isUploading=!0,this.begin=this.currentChunk*this.chunkSize,this.end=Math.min(this.begin+this.chunkSize,this.file.size);const t=this.file.slice(this.begin,this.end),e=new FormData;e.append("fileData",t),e.append("fileName",this.file.name),e.append("fileHash",this.fileHash),e.append("chunkIndex",String(this.currentChunk)),e.append("chunks",String(this.chunks)),await this.axios.postBlob(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{zo(this.timeData,1),this.onTime?.(Go(this.timeData))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}function Ac(n,t){const e=fs(t?.value||"");if(!e.value){const s=`; ${document.cookie}`.split(`; ${n}=`).pop()?.split(";").shift();s&&(e.value=decodeURIComponent(s))}return pt(()=>{if(e.value&&t?.days){const s="; expires="+new Date(Date.now()+t.days*864e5).toUTCString(),i=t?.domain?"; domain="+t?.domain:"",r=t?.path?"; path="+t?.path:"",a=t?.secure==!0?"; secure":"";document.cookie=n+"="+encodeURIComponent(e.value)+s+i+r+a}}),e}function Dc(){const n=document.cookie.split("; ");for(let t=0;t<n.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const s=encodeURIComponent(n[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",i=location.pathname.split("/");for(document.cookie=s+"/";i.length>0;)document.cookie=s+i.join("/"),i.pop();e.shift()}}}function Nr(n,t){const e=fs(t||"");if(!t)try{let s=window.localStorage.getItem(n);s&&(s=JSON.parse(s),e.value=s?s.value:"")}catch{}return pt(()=>{if(e.value)try{window.localStorage.setItem(n,JSON.stringify(e))}catch{}else window.localStorage.removeItem(n)}),e}function Ic(n,t){const e=fs(t||"");if(!t)try{let s=window.sessionStorage.getItem(n);s&&(s=JSON.parse(s),e.value=s?s.value:"")}catch{}return pt(()=>{if(e.value)try{window.sessionStorage.setItem(n,JSON.stringify(e))}catch{}else window.sessionStorage.removeItem(n)}),e}function Mc(n,t){let e;return n.objectStoreNames.contains(t)||(e=n.createObjectStore(t,{keyPath:"id"})),e}function kc(n,t=1,e){return new Promise((s,i)=>{let r;const a=window.indexedDB.open(n,t);a.onerror=()=>{i("无法使用IndexDB!")},a.onsuccess=o=>{r=o.target.result,Mc(r,e),s(r)}})}function Lc(n,t,e={id:1,name:"xxx"}){return new Promise((s,i)=>{const r=n.transaction([t],"readwrite");r.objectStore(t).add(e),r.oncomplete=o=>{s(o)},r.onerror=o=>{i(o)}})}const ht=(n,t,e)=>{const s=async i=>{await e(i)};return n.addEventListener(t,s,!1),()=>{n.removeEventListener(t,s,!1)}},Rc=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],Oc=["keydown","keyup","keypress"],Fc=["touchstart","touchend","touchcancel","touchmove"],Nc=["pointerdown","pointerup","pointercancel","pointermove"],Bc=["dragstart","dragend","dragenter","dragover","drop"],Uc=["change"];function Yc(n,t,e={bubbles:!0,detail:{}}){let s;Rc.includes(t)?s=new MouseEvent(t,e):Oc.includes(t)?s=new KeyboardEvent(t,e):Fc.includes(t)?s=new TouchEvent(t,e):Nc.includes(t)?s=new PointerEvent(t,e):Bc.includes(t)?s=new DragEvent(t,e):Uc.includes(t)?s=new Event(t,e):s=new CustomEvent(t,e),Br(n,s)}function Br(n,t){n.dispatchEvent(t)}function Xc(n,t){const e=n.changedTouches[0];return new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function Qt(){const n=new ls;return{on:(t,e)=>{n.on(t,e)},off:(t,e)=>{n.off(t,e)},emit:(t,...e)=>{n.emit(t,...e)}}}function Ur(n="(prefers-color-scheme: dark)"){const t=window.matchMedia(n),e=fs(t.matches);return ht(t,"change",s=>{e.value=s.matches}),e}const te=Nr("__theme__");if(!te.value){const n=Ur("(prefers-color-scheme: dark)");te.value=n.value?"dark":"light"}const Yr=()=>{switch(te.value){case"dark":document.documentElement.classList.add("dark");break;default:document.documentElement.classList.remove("dark");break}};pt(()=>{Yr()}),setTimeout(Yr);function zc(n){return n&&(te.value=n),te}function Gc(){return te.value=te.value=="light"?"dark":"light",te}const z=Qt();let Xr="";new MutationObserver((n,t)=>{location.href!==Xr&&(Xr=location.href,z.emit("urlchange",location.href))}).observe(document,{attributes:!0,childList:!0,subtree:!0}),ht(window,"hashchange",()=>{z.emit("hashchange",location.hash)}),ht(window,"popstate",n=>{z.emit("popstate",n.state)}),ht(window,"orientationchange"in window?"orientationchange":"resize",n=>{const t=n.target.innerWidth,e=n.target.innerHeight;z.emit("windowresize",t,e)});let zr=!1;ht(window,"load",()=>{z.emit("load"),zr=!0}),ht(window,"beforeunload",n=>{z.emit("beforeunload",n)}),ht(window,"pagehide",n=>{z.emit("pagehide",n)}),ht(window,"focus",n=>{z.emit("focus",n)}),ht(window,"blur",n=>{z.emit("blur",n)}),ht(window,"visibilitychange",n=>{document.hidden?z.emit("windowhidden",n):z.emit("windowvisible",n)});const _e={getSelectedText:()=>window.getSelection()?.toString()||"",isTabInView:()=>!document.hidden,onurlchange:n=>(z.on("urlchange",n),()=>{z.off("urlchange",n)}),onhashchange:n=>(z.on("hashchange",n),()=>{z.off("hashchange",n)}),onpopstate:n=>(z.on("popstate",n),()=>{z.off("popstate",n)}),pushstate:(n,t=null)=>{history.pushState(t,"",n)},replacestate:(n,t=null)=>{history.replaceState(t,"",n)},onwindowresize:n=>(z.on("windowresize",n),()=>{z.off("windowresize",n)}),onload:n=>{const t=qo(n);return z.on("load",t),zr&&t(),()=>{z.off("load",t)}},onbeforeunload:n=>(z.on("beforeunload",n),()=>{z.off("beforeunload",n)}),onpagehide:n=>(z.on("pagehide",n),()=>{z.off("pagehide",n)}),onfocus:n=>(z.on("focus",n),()=>{z.off("focus",n)}),onblur:n=>(z.on("blur",n),()=>{z.off("blur",n)}),onwindowvisible:n=>(z.on("windowvisible",n),()=>{z.off("windowvisible",n)}),onwindowhidden:n=>(z.on("windowhidden",n),()=>{z.off("windowhidden",n)})};function Vc(n){let t=!1;function e(){if(document.readyState!=="loading"){if(t){document.removeEventListener("DOMContentLoaded",e,!1);return}t=!0,document.removeEventListener("DOMContentLoaded",e,!1),n()}}document.addEventListener("DOMContentLoaded",e,!1),e()}function qc(n){document.getElementsByTagName("title")[0].innerText=n,document.title=n}const _s=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(n)?t="iOS":/android/i.test(n)?t="Android":/BlackBerry/i.test(n)?t="BlackBerry":/mac/i.test(n)?t="macOS":/win/i.test(n)?t="Windows":/linux/i.test(n)?t="Linux":/bsd/i.test(n)&&(t="BSD"),t.toLowerCase()};function jc(n=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(n)){const e=n.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(n)){const e=n.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(n)){const e=n.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(n)){const e=n.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function Hc(n,t){const e=n.split("."),s=t.split(".");for(let i=0,r=e.length;i<r;i++){if(s.length==i)return 1;if(e[i]!=s[i])return e[i]>s[i]?1:-1}return e.length!=s.length?-1:0}const An=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(n)||/opera/i.test(n)?t="Opera":/chrome/i.test(n)?t="Chrome":/firefox/i.test(n)?t="Firefox":/safari/i.test(n)?t="Safari":/edge/i.test(n)?t="Edge":/msie|trident/i.test(n)?t="IE":/MicroMessenger/i.test(n)?t="Wechat":/alipay/i.test(n)&&(t="Ali"),t.toLowerCase()},$c=()=>{const n=navigator.userAgent;let t="Unknown";if(/Chrome/.test(n)){const e=n.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(n)){const e=n.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(n)){const e=n.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(n)){const e=n.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(n)){const e=n.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t};function Wc(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function Jc(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Dn(){return _s()==="ios"}function In(){return _s()==="macos"}function Zc(){return Dn()|In()}function Gr(){return _s()==="android"}function Kc(){return Dn()||Gr()}function Vr(){const n=window.navigator.userAgent,t=n.indexOf("MSIE ");if(t>0)return parseInt(n.substring(t+5,n.indexOf(".",t)),10);if(n.indexOf("Trident/")>0){const i=n.indexOf("rv:");return parseInt(n.substring(i+3,n.indexOf(".",i)),10)}const s=n.indexOf("Edge/");return s>0?parseInt(n.substring(s+5,n.indexOf(".",s)),10):-1}const Qc=Vr()!==-1;function tl(){const n=document.documentMode;return n&&(n===9||n===10)}function qr(){return An()==="wechat"}function jr(){return An()==="ali"}function el(){return qr()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function sl(){return jr()&&navigator.userAgent.match(/miniprogram/i)}const nl=typeof document<"u",Hr=typeof window<"u",il=typeof history<"u",rl=Hr&&window.File&&window.FileReader&&window.FileList&&window.Blob,$r=(()=>{const n=Ii();return!!(n.Worker&&n.Blob&&n.Promise&&n.OffscreenCanvas&&n.OffscreenCanvasRenderingContext2D&&n.HTMLCanvasElement&&n.HTMLCanvasElement.prototype.transferControlToOffscreen&&n.URL&&n.URL.createObjectURL)})(),al=typeof Path2D=="function"&&typeof DOMMatrix=="function",Wr=function(){if(!Ii().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}(),ol=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},hl="webkit moz ms o".split(" ");function As(n){return typeof n=="function"&&/native code/.test(n.toString())}(function(){if(!window.requestAnimationFrame){let n=Q();window.requestAnimationFrame=function(t){const e=Q(),s=Math.max(0,16-(e-n)),i=window.setTimeout(function(){t(e+s)},s);return n=e+s,i}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})})();const Mn=n=>{let t=!1;return window.requestAnimationFrame(function e(s){!t&&n(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}};function kn(n,t=0){if(t==0)return n(Q()),()=>{};{const e=Q();return Mn(s=>s-e>=t?(n(s),!1):!0)}}function cl(n,t=0){let e=!1,s=0;const i=Q(),r=a=>{if(e)return;s++;const o=a-i-s*t;n(a,s,t<=o),kn(r,Math.max(0,t-o))};return kn(r,t),()=>{e=!0}}function ll(n,t=20){const e=1e3/t;let s=0,i;return()=>(Q()-s>=e&&(s=Q(),i=n()),i)}const ee=new ue;let Ln=!1;function Jr(n,t,e){n&&t&&ee.set(n,t),!Ln&&(Ln=!0,requestIdleCallback(s=>{for(Ln=!1;s.timeRemaining()>0&&ee.length>0;){const i=ee.shift();i&&i[1]()}ee.length>0&&Jr()},{timeout:e}))}let Rn=!1;function On(n,t,e){if(n&&t&&ee.set(n,t),Rn)return;Rn=!0;const s=Q();fl(i=>{for(Rn=!1;(i.timeRemaining()>0||e&&Q()-s>=e)&&ee.length>0;){const r=ee.shift();r&&r[1]()}ee.length>0&&On()})}let Ds=0,me=33,se=33,Fn;const Zr=new MessageChannel,ul=Zr.port2;Zr.port1.onmessage=n=>{Fn!==null&&Fn({didTimeout:Ds<=Q(),timeRemaining:()=>Math.max(0,Ds-Q())})};function fl(n){return Fn=n,requestAnimationFrame(t=>{let e=t-Ds+se;e<se&&me<se?(e<8&&(e=8),se=e<me?me:e):e>se&&me>se?se=e<me?me:e:me=e,Ds=t+se,ul.postMessage(null)})}function dl(n){if(typeof setImmediate<"u"&&As(setImmediate))setImmediate(n);else if(typeof MessageChannel<"u"&&(As(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=n,t.postMessage(null)}else typeof Promise<"u"&&As(Promise)?Promise.resolve().then(n):setTimeout(n,0)}function ml(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(t=>setTimeout(()=>{throw t}))}class Be{static _nextId=0;static nextId(){return Be._nextId++}}const L={Linear:{None:function(n){return n}},Ease:{In:function(n){return Math.pow(n,1.7)}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}},Exponential:{In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}},Back:{In:function(n){return n===1?1:n*n*((1.70158+1)*n-1.70158)},Out:function(n){return n===0?0:--n*n*((1.70158+1)*n+1.70158)+1},InOut:function(n){const t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-L.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?L.Bounce.In(n*2)*.5:L.Bounce.Out(n*2-1)*.5+.5}},generatePow:function(n=4){return n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return t**n},Out:function(t){return 1-(1-t)**n},InOut:function(t){return t<.5?(t*2)**n/2:(1-(2-t*2)**n)/2+.5}}},random:function(n){return Math.random()},createStep:function(n){return function(t){return Math.floor(t*n)/n}},createNoisyEasing:function(n,t=.1){const e=1-t;return function(s){return t*Math.random()+e*n(s)}},swing:function(n){return n+Math.sin(n*Math.PI*2)/2},causeSeizures:function(n){return n+.2*Math.random()-.1}};function Kr(n){switch(n){case L.Quadratic.In:return L.Quadratic.Out;case L.Quadratic.Out:return L.Quadratic.In;case L.Quadratic.InOut:return L.Quadratic.InOut;case L.Cubic.In:return L.Cubic.Out;case L.Cubic.Out:return L.Cubic.In;case L.Cubic.InOut:return L.Cubic.InOut;case L.Quartic.In:return L.Quartic.Out;case L.Quartic.Out:return L.Quartic.In;case L.Quartic.InOut:return L.Quartic.InOut;case L.Quintic.In:return L.Quintic.Out;case L.Quintic.Out:return L.Quintic.In;case L.Quintic.InOut:return L.Quintic.InOut;case L.Sinusoidal.In:return L.Sinusoidal.Out;case L.Sinusoidal.Out:return L.Sinusoidal.In;case L.Sinusoidal.InOut:return L.Sinusoidal.InOut;case L.Exponential.In:return L.Exponential.Out;case L.Exponential.Out:return L.Exponential.In;case L.Exponential.InOut:return L.Exponential.InOut;case L.Circular.In:return L.Circular.Out;case L.Circular.Out:return L.Circular.In;case L.Circular.InOut:return L.Circular.InOut;case L.Elastic.In:return L.Elastic.Out;case L.Elastic.Out:return L.Elastic.In;case L.Elastic.InOut:return L.Elastic.InOut;case L.Back.In:return L.Back.Out;case L.Back.Out:return L.Back.In;case L.Back.InOut:return L.Back.InOut;case L.Bounce.In:return L.Bounce.Out;case L.Bounce.Out:return L.Bounce.In;case L.Bounce.InOut:return L.Bounce.InOut;default:return n}}const pl=4,gl=.001,yl=1e-7,wl=10,Ue=11,Is=1/(Ue-1),xl=typeof Float32Array=="function";function Qr(n,t){return 1-3*t+3*n}function ta(n,t){return 3*t-6*n}function ea(n){return 3*n}function Ms(n,t,e){return((Qr(t,e)*n+ta(t,e))*n+ea(t))*n}function sa(n,t,e){return 3*Qr(t,e)*n*n+2*ta(t,e)*n+ea(t)}function bl(n,t,e,s,i){let r,a,o=0;do a=t+(e-t)/2,r=Ms(a,s,i)-n,r>0?e=a:t=a;while(Math.abs(r)>yl&&++o<wl);return a}function vl(n,t,e,s){for(let i=0;i<pl;++i){const r=sa(t,e,s);if(r===0)return t;const a=Ms(t,e,s)-n;t-=a/r}return t}function Sl(n){return n}function Nn(n,t,e,s){if(!(0<=n&&n<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===t&&e===s)return Sl;const i=xl?new Float32Array(Ue):new Array(Ue);for(let a=0;a<Ue;++a)i[a]=Ms(a*Is,n,e);function r(a){let o=0,h=1;const c=Ue-1;for(;h!==c&&i[h]<=a;++h)o+=Is;--h;const l=(a-i[h])/(i[h+1]-i[h]),f=o+l*Is,y=sa(f,n,e);return y>=gl?vl(a,f,n,e):y===0?f:bl(a,o,o+Is,n,e)}return a=>a===0||a===1?a:Ms(r(a),t,s)}function Bn(n){switch(n){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 na(n){const[t,e,s,i]=Bn(n);return[1-s,1-i,1-t,1-e]}function Tl(n){return Nn(...Bn(n))}function Cl(n){return Nn(...na(n))}const Vt={Utils:{Linear:function(n,t,e){return(t-n)*e+n},Factorial:function(){const n=[1];return function(t){let e=1;if(n[t])return n[t];for(let s=t;s>1;s--)e*=s;return n[t]=e,e}}(),Bernstein:function(n,t){const e=Vt.Utils.Factorial;return e(n)/e(t)/e(n-t)},CatmullRom:function(n,t,e,s,i){const r=(e-n)*.5,a=(s-t)*.5,o=i*i,h=i*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*i+t},QuadraticBezier:(n,t,e,s)=>{const i=1-s;return i*i*n+2*i*s*t+s*s*e},CubicBezier:(n,t,e,s,i)=>{const r=1-i;return r*r*r*n+3*r*r*i*t+3*r*i*i*e+i*i*i*s}},Linear:function(n,t){const e=n.length-1,s=e*t,i=Math.floor(s),r=Vt.Utils.Linear;return t<0?r(n[0],n[1],s):t>1?r(n[e],n[e-1],e-s):r(n[i],n[i+1>e?e:i+1],s-i)},Bezier:function(n,t){let e=0;const s=n.length-1,i=Math.pow,r=Vt.Utils.Bernstein;for(let a=0;a<=s;a++)e+=i(1-t,s-a)*i(t,a)*n[a]*r(s,a);return e},CatmullRom:function(n,t){const e=n.length-1;let s=e*t,i=Math.floor(s);const r=Vt.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(i=Math.floor(s=e*(1+t))),r(n[(i-1+e)%e],n[i],n[(i+1)%e],n[(i+2)%e],s-i)):t<0?n[0]-(r(n[0],n[0],n[1],n[1],-s)-n[0]):t>1?n[e]-(r(n[e],n[e],n[e-1],n[e-1],s-e)-n[e]):r(n[i?i-1:0],n[i],n[e<i+1?e:i+1],n[e<i+2?e:i+2],s-i)}};class ia{_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=Q(),e=!1){const s=Object.keys(this._tweens);for(let i=0;i<s.length;i++){const r=this._tweens[s[i]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[i]]}return!!Object.keys(this._tweens).length}}const Ct=new ia;class Un{constructor(t,e=Ct){this._object=t,this._group=e}_id=Be.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=L.Linear.None;_interpolationFunction=Vt.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=Q()){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,i){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];i[r]=o?[]:{},this._setupProperties(a,e[r],s[r],i[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?i[r]=s[r].slice().reverse():i[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=Q()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=Q()){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=Ct){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=L.Linear.None){return this._easingFunction=t,this}interpolation(t=Vt.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=Q(),e=!0){if(this._isPaused)return!0;let s,i;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),i=(t-this._startTime)/this._durationTime,i=this._durationTime===0||i>1?1:i;const a=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===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,i){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,i):typeof o=="object"&&o?this._updateProperties(t[r],a,o,i):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*i))}}_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 Pl=Be.nextId,El=Ct.getAll.bind(Ct),_l=Ct.removeAll.bind(Ct),Al=Ct.add.bind(Ct),Dl=Ct.remove.bind(Ct),Il=Ct.update.bind(Ct),Ml={now:Q,Sequence:Be,Easing:L,Interpolation:Vt,Group:ia,Tween:Un,nextId:Pl,getAll:El,removeAll:_l,add:Al,remove:Dl,update:Il};class Yn{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=Q(),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=Q();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class ks{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){$o(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const i={...s};delete i.tween,i.fromValues={...i.fromValues},i.toValues={...i.toValues},e.push(i)}),e}addTween(t,e,s){const i={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||L.Linear.None,interpolationFunction:s?.interpolationFunction||Vt.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(i),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Yn,s=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=Mn(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 Un({...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?.(),i()),a})})}isPaused=!1;pausedClock=new Yn;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=Kr(s.easeFunction);const i={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...i}}),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}}const Ls=new ue,ra=(n=!0)=>{Ls.filter((t,e)=>(e.alternate&&(js(e,e.alternate),n&&Ls.set(t,e.alternate),e.alternate=void 0),n))};function Xn(n){let t=Ls.get(n);return t||(t=qs(n),Ls.set(n,t)),t}function aa(n){const t=Xn(n);return t.alternate||(t.alternate=qs(n)),t.alternate}function zn(n,t,e=!0){t(aa(n)),On("FLUSH_DOM_ACTION",()=>ra(e),50)}function kl(n,t,e=!0){t(aa(n)),ra(e)}function B(n){return n*Math.PI/180}function rt(n){return n*180/Math.PI}function Rs(n,t,e=0){return Math.sqrt(n*n+t*t+e*e)}function Os(n,t,e,s){return Rs(e-n,s-t)}function Fs(n,t,e,s){const i=e-n,r=s-t;return i*i+r*r}function ne(n,t,e,s){let i=Math.atan2(s-t,e-n);return i<0&&(i+=Math.PI*2),i}function Bt(n,t){return{dx:Math.cos(n)*t,dy:Math.sin(n)*t}}function Ll(n,t,e){if(typeof e=="number"){const s=Math.sqrt(Math.pow(n,2)+Math.pow(t,2)+Math.pow(e,2));return{x:n/=s,y:t/=s,z:e/=s}}else{const s=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return{x:n/=s,y:t/=s}}}function Rl(n,t,e,s,i=10){if(Math.abs(e-n)<i&&Math.abs(s-t)<i)return"no";const r=rt(ne(n,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 oa=Ol("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 Ol(n,t=10){const e={},s=n.split(",");for(let i=0;i<s.length;i+=2){const r="&"+s[i+1]+";",a=parseInt(s[i],t);e[r]="&#"+a+";"}return e["\\xa0"]="&#160;",e}function ct(n,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)n=n.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return n}function Ns(n){let t,e;if(!n)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(n[t]);return t}function Fl(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function Nl(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const Ye={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 Bs{__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",ct("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 Gn{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Xe{__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(Ye);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=Ye[i].canvas}}__getStyleState(){const t={},e=Object.keys(Ye);for(let s=0,i=e.length;s<i;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,i=e.length;s<i;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];i.setAttribute(o,e[o])}return i}__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 i=Object.keys(Ye);for(let r=0;r<i.length;r++){const a=Ye[i[r]],o=this[i[r]];if(a.apply){if(o instanceof Gn){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,ct("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof Bs)e.setAttribute(a.apply,ct("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,ct("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const f=this.globalAlpha;f!=null&&(l*=f),e.setAttribute(a.svgAttr+"-opacity",""+l)}}else{let h=a.svgAttr;if(i[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 i=Object.keys(oa);for(let r=0,a=i.length;r<a;r++){const o=i[r],h=oa[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 i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}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(ct("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(ct("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(ct("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,i,r,a){this.__addTransform(ct("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:i,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(ct("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(ct("L {x} {y}",this.__currentPosition)):this.__addPathCommand(ct("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(ct("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:i,x:r,y:a}))}quadraticCurveTo(t,e,s,i){this.__currentPosition={x:s,y:i},this.__addPathCommand(ct("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:i}))}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,i,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===i||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,i-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],f=Math.acos(Math.abs(l)),y=this.normalize([h[0]+c[0],h[1]+c[1]]),b=r/Math.sin(f/2),w=t+b*y[0],_=e+b*y[1],S=[-h[1],h[0]],v=[c[1],-c[0]],x=function(E){const C=E[0];return E[1]>=0?Math.acos(C):-Math.acos(C)},p=x(S),g=x(v);this.lineTo(w+S[0]*r,_+S[1]*r),this.arc(w,_,r,p,g)}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,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],i=s.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&s.removeChild(i[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,i){if(t===0&&e===0&&s===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:i,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,i){const r=this.__createElement("linearGradient",{id:Ns(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Bs(r,this)}createRadialGradient(t,e,s,i,r,a){const o=this.__createElement("radialGradient",{id:Ns(this.__ids),cx:i+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new Bs(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,i){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":Fl(this.textAlign),"dominant-baseline":Nl(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(i),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,i,r,a){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===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(i),l=e+s*Math.sin(i),f=a?0:1;let y=0,b=r-i;b<0&&(b+=2*Math.PI),a?y=b>Math.PI?0:1:y=b>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(ct("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:y,sweepFlag:f,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=Ns(this.__ids),i=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",ct("url(#{id})",{id:s})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],s,i,r,a,o=0,h=0,c,l,f,y,b,w,_,S;if(t.length===3)s=t[1],i=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],i=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],i=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const v=this.__closestGroupOrSvg();this.__currentElement;const x="translate("+s+", "+i+")";if(e instanceof Xe){if(f=e.getSvg().cloneNode(!0),f.childNodes&&f.childNodes.length>1){for(y=f.childNodes[0];y.childNodes.length;)S=y.childNodes[0].getAttribute("id"),this.__ids[S]=S,this.__SVGdefs.appendChild(y.childNodes[0]);if(b=f.childNodes[1],b){const p=b.getAttribute("transform");let g;p?g=p+" "+x:g=x,b.setAttribute("transform",g),v.appendChild(b)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(w=this.__createElement("image"),w.setAttribute("width",r),w.setAttribute("height",a),w.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(_=this.__document.createElement("canvas"),_.width=r,_.height=a,_.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=_),w.setAttribute("transform",x),w.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),v.appendChild(w))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=Ns(this.__ids);let r;return s.setAttribute("id",i),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 Xe&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new Gn(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,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new Xe({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,i){return this.context.fillRect(t,e,s,i),this.customContext&&this.customContext.fillRect(t,e,s,i),this}fillText(t,e,s,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,i),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,i){return this.context.strokeText(t,e,s,i),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,i){return this.context.strokeRect(t,e,s,i),this.customContext&&this.customContext.strokeRect(t,e,s,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,s,i),this.customContext&&this.customContext.clearRect(t,e,s,i),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,i=0){return this.translate(s,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-i),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,i,r,a){return this.context.arc(t,e,s,i,r,a),this.customContext&&this.customContext.arc(t,e,s,i,r,a?-1:1),this.currentPath2D.arc(t,e,s,i,r,a),this}arcTo(t,e,s,i,r){return this.context.arcTo(t,e,s,i,r),this.customContext&&this.customContext.arcTo(t,e,s,i,r),this.currentPath2D.arcTo(t,e,s,i,r),this}ellipse(t,e,s,i,r,a,o,h){return this.context.ellipse(t,e,s,i,r,a,o,h),this.currentPath2D.ellipse(t,e,s,i,r,a,o,h),this}quadraticCurveTo(t,e,s,i){return this.context.quadraticCurveTo(t,e,s,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,i),this.currentPath2D.quadraticCurveTo(t,e,s,i),this}bezierCurveTo(t,e,s,i,r,a){return this.context.bezierCurveTo(t,e,s,i,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,i,r,a),this.currentPath2D.bezierCurveTo(t,e,s,i,r,a),this}rect(t,e,s,i){return this.context.rect(t,e,s,i),this.customContext&&this.customContext.rect(t,e,s,i),this.currentPath2D.rect(t,e,s,i),this}createLinearGradient(t,e,s,i,r){const a=this.context.createLinearGradient(t,e,s,i);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,i,r,a,o){const h=this.context.createRadialGradient(t,e,s,i,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],i=e[1];this.context.drawImage(t,s,i)}else if(e.length===4){const s=e[0],i=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,i,r,a)}else if(e.length===8){const s=e[0],i=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,i,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,i=this.canvas.height,r){return this.context.getImageData(t,e,s,i,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}}}let Ys=class{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=ne(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),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:i-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),i=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(i,r),y:Math.min(a,o),width:Math.max(i,r)-Math.min(i,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,i=t.toX,r=t.toY,a=this.toX-e,o=t.x-i;if(!a&&!o)return null;const h=(this.toY-s)/a,c=(t.y-r)/o;if(a){if(!o)return{x:i,y:h*(i-e)+s}}else return{x:e,y:c*(e-i)+r};const l=(-c*i+r+h*e-s)/(h-c),f=h*(l-e)+s;return isNaN(l)||isNaN(f)?null:{x:l,y:f}}};const ha=Ys;class Vn extends Ys{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,i,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,i,r,a,o,h,!this.sweepFlag)}convert(t,e,s,i,r,a,o,h,c){const l=o/180*Math.PI,f=(t-s)/2,y=(e-i)/2,b=Math.cos(l)*f+Math.sin(l)*y,w=-Math.sin(l)*f+Math.cos(l)*y,_=b*b/(r*r)+w*w/(a*a);if(_>1){const Z=Math.sqrt(_);throw r=Z*r,a=Z*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const S=Math.sqrt((r*r*a*a-r*r*w*w-a*a*b*b)/(r*r*w*w+a*a*b*b)),v=h!=c?1:-1,x=v*S*r*w/a,p=v*S*-a*b/r,g=(t+s)/2,E=(e+i)/2,C=Math.cos(l)*x-Math.sin(l)*p+g,F=Math.sin(l)*x+Math.cos(l)*p+E,G=(Z,ot,Pt,wt)=>(Z*wt>=ot*Pt?1:-1)*Math.acos((Z*Pt+ot*wt)/(Math.sqrt(Z*Z+ot*ot)*Math.sqrt(Pt*Pt+wt*wt))),V=G(1,0,t-C,e-F)-l,J=G(t-C,e-F,s-C,i-F);return[C,F,r,a,l,V,V+J]}}class Bl extends Ys{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,i,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,i=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=-i/(2*s),0<a&&a<1&&[t,e][c].push(s*a*a+i*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 Ul=Bl;class gt extends Ys{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,i=(-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(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),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,i=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),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=[],f=c.length;for(let w=0;w<f;w++){for(let _=w+1;_<f;_++)c[w].X===c[_].X&&c[w].Y===c[_].Y&&(_=++w);l.push({X:c[w].X,Y:c[w].Y})}const y={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},b={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:y.x,y:y.y,width:b.x-y.x,height:b.y-y.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,i,r){const a=-3*e+9*s-9*i+3*r,o=t*a+6*e-12*s+6*i;return t*o-3*e+3*s}static bezlen(t,e,s,i,r,a,o,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],y=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let b=0;for(let w=0;w<12;w++){const _=l*f[w]+l,S=this.base3(_,t,s,r,o),v=this.base3(_,e,i,a,h);b+=y[w]*Math.sqrt(S*S+v*v)}return l*b}length(t=1){return gt.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,i=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.toX,c=this.toY;if(t<0||gt.bezlen(e,s,i,r,a,o,h,c)<t)return 0;let l=1,f=l/2,y=l-f,b=gt.bezlen(e,s,i,r,a,o,h,c,y);for(;Math.abs(b-t)>.01;)f/=2,y+=(b<t?1:-1)*f,b=gt.bezlen(e,s,i,r,a,o,h,c,y);return y}getPointAtSegmentLength(t){const e=this.getTatLen(t);let s=1-e,i=Math.pow(s,3),r=Math.pow(s,2),a=e*e,o=a*e,h=i*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+o*this.toX,c=i*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),f=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),y=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),b=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),w=s*this.x+e*this.c1x,_=s*this.y+e*this.c1y,S=s*this.c2x+e*this.toX,v=s*this.c2y+e*this.toY,x=90-Math.atan2(l-y,f-b)*180/Math.PI;return{x:h,y:c,m:{x:l,y:f},n:{x:y,y:b},start:{x:w,y:_},end:{x:S,y:v},alpha:x}}}const ze=Math.PI*2;function ca(n,t,e,s){const i=n*s-t*e<0?-1:1;let r=n*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function Yl(n,t,e,s,i,r,a,o,h,c){const l=c*(n-e)/2+h*(t-s)/2,f=-h*(n-e)/2+c*(t-s)/2,y=a*a,b=o*o,w=l*l,_=f*f;let S=y*b-y*_-b*w;S<0&&(S=0),S/=y*_+b*w,S=Math.sqrt(S)*(i===r?-1:1);const v=S*a/o*f,x=S*-o/a*l,p=c*v-h*x+(n+e)/2,g=h*v+c*x+(t+s)/2,E=(l-v)/a,C=(f-x)/o,F=(-l-v)/a,G=(-f-x)/o,V=ca(1,0,E,C);let J=ca(E,C,F,G);return r===0&&J>0&&(J-=ze),r===1&&J<0&&(J+=ze),[p,g,V,J]}function Xl(n,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(n),i=Math.sin(n),r=Math.cos(n+t),a=Math.sin(n+t);return[s,i,s-i*e,i+s*e,r+a*e,a-r*e,r,a]}function la(n,t,e,s,i,r,a,o,h){const c=Math.sin(h*ze/360),l=Math.cos(h*ze/360),f=l*(n-e)/2+c*(t-s)/2,y=-c*(n-e)/2+l*(t-s)/2;if(f===0&&y===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const b=f*f/(a*a)+y*y/(o*o);b>1&&(a*=Math.sqrt(b),o*=Math.sqrt(b));const w=Yl(n,t,e,s,i,r,a,o,c,l),_=[];let S=w[2],v=w[3];const x=Math.max(Math.ceil(Math.abs(v)/(ze/4)),1);v/=x;for(let p=0;p<x;p++)_.push(Xl(S,v)),S+=v;return _.map(p=>{for(let g=0;g<p.length;g+=2){let E=p[g+0],C=p[g+1];E*=a,C*=o;const F=l*E-c*C,G=c*E+l*C;p[g+0]=F+w[0],p[g+1]=G+w[1]}return p})}function qn(n,t,e,s,i,r){return[n/3+.6666666666666666*e,t/3+.6666666666666666*s,i/3+.6666666666666666*e,r/3+.6666666666666666*s,i,r]}function Ge(n,t,e,s){return[n,t,e,s,e,s]}const Ve={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class pe{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&oe(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||Ri()})}static downloadFromSVGElement(t,e="shape"){return ci(Rr(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return ci(cn(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return En(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 pe.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,i,r)=>{let a=i.toLowerCase();const o=Yi(r);for(a=="m"&&o.length>Ve[a]&&(e.push([i,...o.splice(0,Ve[a])]),a="l",i=i=="m"?"l":"L");o.length;){if(o.length<Ve[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${i} } args:{ ${o} }`);e.push([i,...o.splice(0,Ve[a])])}return a=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,i=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]+=i,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=i;break;default:for(let c=1;c<a.length;)a[c++]+=i,a[c++]+=r}switch(h){case"Z":i=e,r=s;break;case"H":i=a[1];break;case"V":r=a[1];break;case"M":i=e=a[1],r=s=a[2];break;default:i=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,i=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]-=i,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=i;break;default:for(let c=1;c<a.length;)a[c++]-=i,a[c++]-=r}switch(h){case"z":i=e,r=s;break;case"h":i+=a[1];break;case"v":r+=a[1];break;case"m":i+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:i+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){const e=[];let s=0,i=0,r=0,a=0,o=0,h=0,c=0,l=0,f;for(let y=0,b=t.length;y<b;y++){let w=t[y];const _=w[0];switch(_){case"M":s=w[1],i=w[2];break;case"A":const S=la(r,a,w[6],w[7],w[4],w[5],w[1],w[2],w[3]);if(!S.length)continue;S.forEach((p,g)=>{const[E,C,F,G,V,J,Z,ot]=p;w=["C",F,G,V,J,Z,ot],g<S.length-1&&e.push(w)});break;case"S":let v=r,x=a;(f=="C"||f=="S")&&(v+=v-c,x+=x-l),w=["C",v,x,w[1],w[2],w[3],w[4]];break;case"T":f=="Q"||f=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),w=["C",...qn(r,a,o,h,w[1],w[2])];break;case"Q":o=w[1],h=w[2],w=["C",...qn(r,a,w[1],w[2],w[3],w[4])];break;case"L":w=["C",...Ge(r,a,w[1],w[2])];break;case"H":w=["C",...Ge(r,a,w[1],a)];break;case"V":w=["C",...Ge(r,a,r,w[1])];break;case"Z":w=["C",...Ge(r,a,s,i)];break}f=_,r=w[w.length-2],a=w[w.length-1],w.length>4?(c=w[w.length-4],l=w[w.length-3]):(c=r,l=a),e.push(w)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,i=t.length;i-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]}]:i-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],i;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":i=e[e.length-1]||["L",0,0],e.push(["L",o[1],i[i.length-1]]);break;case"V":i=e[e.length-1]||["L",0,0],e.push(["L",i[i.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,i=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?(i=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(i=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,i,r)),s=h}return t}}const bt=pe;class vt{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(bt.parseSVGPath(t),e):t instanceof vt?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=bt.normalizeSVGPath(bt.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let i=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];if(o[0]=="M"){i||(i=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2];continue}this.appendLine(new gt({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 vt;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,i=t.length;s+5<i;s+=6)e.appendLine(new gt({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 vt;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,i=t.length;s<i;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof Vn){la(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,f,y,b,w,_,S,v]=c;this.normalizedLines.push(new gt({x:this.prevPathX,y:this.prevPathY,c1x:y,c1y:b,c2x:w,c2y:_,toX:S,toY:v})),this.prevPathX=S,this.prevPathY=v});return}let e,s,i,r,a,o;t instanceof gt?(e=t.c1x,s=t.c1y,i=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof Ul?[e,s,i,r,a,o]=qn(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,a,o]=Ge(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new gt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:i,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),i=[];i.push(["M",t,e]);for(let r=0,a=s.length;r<a;r++)i.push(...s[r].toSVGPathData());return i}toSVGPathD(){return bt.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform();t.beginPath(),t.moveTo(e,s),i.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 i=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:i,y:r,width:a-i,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 lt;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 i=[];return this.normalizedLines.forEach(r=>{let a=r.x,o=r.y,h=r.c1x,c=r.c1y,l=r.c2x,f=r.c2y,y=r.toX,b=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:f}=t.transformPoint({x:l,y:f}),{x:y,y:b}=t.transformPoint({x:y,y:b}),i.push(new gt({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:f,toX:y,toY:b}))}),{startPathX:e,startPathY:s,normalizedLines:i}}}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 i=e.length;for(let r=0;r<i;r++){const a=e[r],o=a.length();if(s+o>=t)return a.getPointAtSegmentLength(t-s);s+=o}return e[i-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform(),r=i.length;if(r===0)return{x:e,y:s};if(r===1)return i[0].interpolate(t);{let a=t*r,o=i[0];if(a--,a>1)for(let h=1;h<r&&(o=i[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:i,startPathY:r,normalizedLines:a}=t.updateTransform();let o=null,h=0;const c=new vt;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let l=0,f=a.length;l<f;l++){const y=a[l],b=y.length();if(h+b>e&&!o){const w=y.getPointAtSegmentLength(e-h);if(c.appendLine(new gt({c1x:w.start.x,c1y:w.start.y,c2x:w.m.x,c2y:w.m.y,toX:w.x,toY:w.y})),s)return c;o=c,c.appendLine(new gt({c1x:w.n.x,c1y:w.n.y,c2x:w.end.x,c2y:w.end.y,toX:y.x,toY:y.y})),h+=b;continue}h+=b,c.appendLine(y)}return c}closestPoint(t,e){const s=this.getTotalLength();let i={x:t,y:e},r=0,a=1/0,o=8;for(let c=0;c<=s;c+=o){let l=this.getPointAtLength(c),f=Fs(l.x,l.y,t,e);f<a&&(i=l,r=c,a=f)}for(o/=2;o>.5;){let c=r-o,l=this.getPointAtLength(c),f=Fs(l.x,l.y,t,e),y=r+o,b=this.getPointAtLength(y),w=Fs(b.x,b.y,t,e);c>=0&&f<a?(i=l,r=c,a=f):y<=s&&w<a?(i=b,r=y,a=w):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?ne(h.x,h.y,i.x,i.y):ne(i.x,i.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((i,r)=>i.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],i=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=Os(t[a],t[a+1],s,i),s=t[a],i=t[a+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let i=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++],f=e[o++],y=e[o++],b=e[o++];a.push(["C",h,c,l,f,y,b]);let w=0;for(;w<r&&i>0;)a.push(["C",y,b,y,b,y,b]),i-=6,w++}return a}static mixPoints(t,e,s){const i=t.length,r=new Array(i);for(let a=0;a<i;a++)r[a]=Ot(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:vt.fromPolymorphPoints(vt.mixPoints(new vt({d:t}).polymorphPoints,new vt({d:e}).polymorphPoints,s)).toSVGPathData()}}const zl=vt;class j extends ls{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=Ri(),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=Yi(s).reduce((i,r)=>i+r,0)}return Gi(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new vt,pt(()=>{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 i=s.originMatrix?s.originMatrix.clone():new lt;i.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new lt;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 i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(i);{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 i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}clone(){return Io(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,i])=>[mt(s),i]))):e&&(this.attrs[mt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[mt(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[mt(t)]}distance(t){return Os(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=rt(ne(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:i}=Bt(B(this.degree),e);this.vx=s,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:i}=Bt(B(this.degree),e);this.ax=s,this.ay=i,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,i=e*e+s*s,r=Math.sqrt(i),a=this.mass*t.mass/i,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=Kt(t?.gravity,0);this.vy+=e;const s=Kt(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=Kt(e?.easing,.05),i=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=i*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=Kt(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.cX-this.x,a=i.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=Kt(e?.springLength,100),i=Kt(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*i,c=a*i;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(),i=Ot(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${i} ${i}`,strokeDashoffset:`${i}`});const r=e?.onUpdate,a=new ks({frameDuration:t});a.addTween({offset:i},{offset:0},Object.assign(e||{},{onUpdate:(o,h)=>{this.setAttr("strokeDashoffset",""+Ot(o.offset,2)),r?.(o,h)}})),a.play()}}class qe extends j{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}=It(B(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=It(B(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=It(B(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 Rs(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,i=t.z-this.z;return Math.sqrt(e*e+s*s+i*i)}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,i=this.z;return{x:s*t.z-i*t.y,y:i*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 ua=[1,0,0,1,0,0],fa=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class lt{value;_m13=0;_m23=0;_m33=1;matrix3d;constructor(t=ua){this.value=Array.from(t),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D()}static fromString(t){const e=new lt,s=ki("number",t);return s.length===6&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.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 yt(e)}identity(){return this.value=Array.from(ua),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 lt([...this.value])}multiply(t){const e=this.clone(),s=t instanceof lt?t:new lt(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,i=this.m21,r=this.m22,a=this.m23,o=this.m31,h=this.m32,c=this.m33,l=c*r-a*h,f=-c*i+a*o,y=h*i-r*o;let b=t*l+e*f+s*y;return b?(b=1/b,this.m11=l*b,this.m12=(-c*e+s*h)*b,this.m13=(a*e-s*r)*b,this.m21=f*b,this.m22=(c*t-s*o)*b,this.m23=(-a*t+s*i)*b,this.m31=y*b,this.m32=(-h*t+e*o)*b,this.m33=(r*t-e*i)*b,this):null}adjugate(){const t=new lt;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=rt(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:rt(Math.atan2(-this.m21,this.m22)),skewY:rt(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],i=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],f=t.value[3],y=t.value[4],b=t.value[5],w=h*f,_=c*l,S=(l*s-e*f)/(_-w),v=(h*s-e*c)/(w-_),x=(l*r-i*f)/(_-w),p=(h*r-i*c)/(w-_),g=(l*(o-b)+f*(y-a))/(_-w),E=(h*(o-b)+c*(y-a))/(w-_),C=[S,v,x,p,g,E];return new lt(C)}toString(t=6){return this.matrix3d.is2D()?`matrix(${this.value.map(e=>Ot(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 i=B(t),r=Math.cos(i),a=Math.sin(i);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:i}=this.split();return this.rotate(t-i,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:i,degreeY:r,degreeZ:a}=this.matrix3d.split();return this.rotate3d(t-i,e-r,s-a),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.multiply([t,0,0,e,0,0]),this.translate(-s,-i),this.toMatrix3D(),this}scaleTo(t,e=t,s=0,i=0){return this.scale(t/this.m11,e/this.m22,s,i)}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:i,scalarY:r,scalarZ:a}=this.matrix3d.split();return this.scale3d(t/i,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(B(e)),Math.sin(B(e)),-Math.sin(B(t)),Math.cos(B(t)),0,0]),this.toMatrix3D(),this}skewTo(t,e=t){const{skewX:s,skewY:i}=this.split();return this.skew(t-s,e-i)}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 yt{value;is3dSpecial=!1;constructor(t=fa){this.value=Array.from(t)}static fromString(t){const e=new yt,s=ki("number",t);return s.length===16&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.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(fa),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 yt([...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:i,skewY:r,x:a,y:o}=this.split(),h=[e,r,i,s,a,o];return t?(t.value=h,t):new lt(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=>Ot(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),i=rt(H(Math.asin(-this.m13),-1,1));let r=rt(Math.atan2(this.m23,this.m33));Math.cos(B(i))===0&&(r=rt(Math.atan2(-this.m31,this.m22)));let a=rt(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:i,degreeZ:a,skewX:rt(this.m14),skewY:rt(this.m24),skewZ:rt(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}inverse(){const t=[],e=this.m11,s=this.m12,i=this.m13,r=this.m14,a=this.m21,o=this.m22,h=this.m23,c=this.m24,l=this.m31,f=this.m32,y=this.m33,b=this.m34,w=this.m41,_=this.m42,S=this.m43,v=this.m44;t[0]=h*b*_-c*y*_+c*f*S-o*b*S-h*f*v+o*y*v,t[1]=r*y*_-i*b*_-r*f*S+s*b*S+i*f*v-s*y*v,t[2]=i*c*_-r*h*_+r*o*S-s*c*S-i*o*v+s*h*v,t[3]=r*h*f-i*c*f-r*o*y+s*c*y+i*o*b-s*h*b;const x=e*t[0]+a*t[1]+l*t[2]+w*t[3];if(x==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=c*y*w-h*b*w-c*l*S+a*b*S+h*l*v-a*y*v,t[5]=i*b*w-r*y*w+r*l*S-e*b*S-i*l*v+e*y*v,t[6]=r*h*w-i*c*w-r*a*S+e*c*S+i*a*v-e*h*v,t[7]=i*c*l-r*h*l+r*a*y-e*c*y-i*a*b+e*h*b,t[8]=o*b*w-c*f*w+c*l*_-a*b*_-o*l*v+a*f*v,t[9]=r*f*w-s*b*w-r*l*_+e*b*_+s*l*v-e*f*v,t[10]=s*c*w-r*o*w+r*a*_-e*c*_-s*a*v+e*o*v,t[11]=r*o*l-s*c*l-r*a*f+e*c*f+s*a*b-e*o*b,t[12]=h*f*w-o*y*w-h*l*_+a*y*_+o*l*S-a*f*S,t[13]=s*y*w-i*f*w+i*l*_-e*y*_-s*l*S+e*f*S,t[14]=i*o*w-s*h*w-i*a*_+e*h*_+s*a*S-e*o*S,t[15]=s*h*l-i*o*l+i*a*f-e*h*f-s*a*y+e*o*y,this.value=t,this.scalar(1/x)}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 yt([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 yt([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}rotateX(t){const e=B(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new yt([1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1]))}rotateY(t){const e=B(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new yt([s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=B(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new yt([s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new yt([1,0,0,B(t),0,1,0,B(e),0,0,1,B(s),0,0,0,1]))}perspective(t){return this.multiply(new yt([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,i=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=i+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,i/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-i;if(l==0)return{x:e,y:s,z:i,mass:r};const f=-i/l;return e+=f*(a-e),s+=f*(o-s),{x:e,y:s,z:i,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,i=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,i/=r,r<0&&(s-=this.m41,i-=this.m42,s*=1/r,i*=1/r,s+=this.m41,i+=this.m42),{x:s,y:i,z:e,mass:r}}bounds(t,e,s,i){const r=new qe({x:t,y:e}),a=new qe({x:t+s,y:e}),o=new qe({x:t+s,y:e+i}),h=new qe({x:t,y:e+i});({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),f=Math.max(r.x,a.x,o.x,h.x)-c,y=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:f,height:y}}}function jn(n){const t=new lt;return n.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let a=0,o=i.length;a<o;a++)i[a].trim()&&r.push(parseFloat(""+i[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 yt(r)),t.matrix3d.toMatrix(t);break}return""}),t}function It(n,t,e){const s=new lt;return s.rotate(rt(n)),s.transformPoint({x:t,y:e})}function Hn(n){const t=typeof n?.x=="number"?n?.x:0,e=typeof n?.y=="number"?n?.y:0,s=typeof n?.degree=="number"?n?.degree:0,i=typeof n?.scalarX=="number"?n?.scalarX:1,r=typeof n?.scalarY=="number"?n?.scalarY:1,a=B(s),o=Math.cos(a),h=Math.sin(a),c=new DOMMatrix([o*i,h*i,-h*r,o*r,t,e]);return c.multiplySelf(new DOMMatrix(n?.originMatrix||"")),c}function Gl(n,t){const e=new Path2D(n),s=new Path2D;return s.addPath(e,Hn(t)),s}function da(n,t){const e={x:t.m11,y:t.m12,z:t.m13},s={x:t.m21,y:t.m22,z:t.m23},i={x:t.m31,y:t.m32,z:t.m33},r=n.transformPoint(e),a=n.transformPoint(s),o=n.transformPoint(i),h=new lt;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 ma(n,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},i={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=n.transformPoint(e),o=n.transformPoint(s),h=n.transformPoint(i),c=n.transformPoint(r);return new yt([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 Vl(n){let t=n[0];for(let e=1,s=n.length;e<s;e++)t=da(t,n[e]);return t}function ql(n){let t=n[0];for(let e=1,s=n.length;e<s;e++)t=ma(t,n[e]);return t}function ge(n,t,e){const s=Xn(n);return s.props.style=s.props.style||{},t?s.props.style[t]||s.props.style[os(t)]||s.props.style[mt(t)]||"":s.props.style}function $n(n,t,e){zn(n,s=>{s.props.style=s.props.style||{},typeof t=="string"&&e?s.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(i=>{s.props.style[i]=t[i]})},!0)}function Wn(n){const t=[];if(getComputedStyle){const e=getComputedStyle(n);for(let s=0,i=e.length;s<i;s++)t.push(e[s]+":"+e.getPropertyValue(e[s]))}else{const e=n.currentStyle;for(const s in e)t.push(s+":"+e[s])}return t.push(...(n.style.cssText||"").split(";")),Object.fromEntries(t.filter(e=>!!e).map(e=>e.split(":").map((s,i)=>i==0?os(s).trim():s.trim())))}function jl(n,t,e){if(getComputedStyle){t=mt(t);const s=getComputedStyle(n,e),i=s.getPropertyPriority(t);return s.getPropertyValue(t).trim()+(i?"!"+i:"")}else return n.currentStyle[os(t)]}function Xs(n,t,e){typeof t=="string"&&e?n.style.setProperty(mt(t),e.replace(/!important/i,""),String(e).toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(s=>{Xs(n,s,t[s])})}function Jn(n,t){typeof t=="string"?n.style.removeProperty(mt(t)):Object.keys(t).forEach(e=>{Jn(n,e)})}function pa(n,t){let e;if(typeof t=="string"){const i=document.querySelector(t)?.shadowRoot;i?e=i:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];const s=document.createElement("style");if(s.innerHTML=n,e)return e.appendChild(s),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(s)};{const i=document.styleSheets[0].insertRule(n);return()=>{document.styleSheets[0].deleteRule(i)}}}function Hl(n,t,e={}){Object.prototype.hasOwnProperty.call(e,"transform")||Object.assign(e,{transform:ge(n,"transform")||""});const s=jn(e.transform),i={};for(const r in t){const a=t[r];switch(r){case"transform":break;case"translate":s.translate(a[0]||0,a[1]||0);break;case"translateTo":s.translateTo(a[0]||0,a[1]||0);break;case"translateX":s.translateX(a||0);break;case"translateXTo":s.translateXTo(a||0);break;case"translateY":s.translateY(a||0);break;case"translateYTo":s.translateYTo(a||0);break;case"translateZ":s.translateZ(a||0);break;case"translateZTo":s.translateZTo(a||0);break;case"translate3d":s.translate3d(a[0]||0,a[1]||0,a[2]||0);break;case"translate3dTo":s.translate3dTo(a[0]||0,a[1]||0,a[2]||0);break;case"rotate":typeof a=="number"?s.rotate(a||0):s.rotate(a[0]||0,a[1]||0,a[2]||0);break;case"rotateTo":typeof a=="number"?s.rotateTo(a||0):s.rotateTo(a[0]||0,a[1]||0,a[2]||0);break;case"rotateX":s.rotateX(a||0);break;case"rotateXTo":s.rotateXTo(a||0);break;case"rotateY":s.rotateY(a||0);break;case"rotateYTo":s.rotateYTo(a||0);break;case"rotateZ":s.rotateZ(a||0);break;case"rotateZTo":s.rotateZTo(a||0);break;case"rotate3d":s.rotate3d(a[0]||0,a[1]||0,a[2]||0);break;case"rotate3dTo":s.rotate3dTo(a[0]||0,a[1]||0,a[2]||0);break;case"scale":typeof a=="number"?s.scale(a||1):s.scale(a[0]||1,a[1]||1,a[2]||0,a[3]||0);break;case"scaleTo":typeof a=="number"?s.scaleTo(a||1):s.scaleTo(a[0]||1,a[1]||1,a[2]||0,a[3]||0);break;case"scaleX":s.scaleX(a||1);break;case"scaleXTo":s.scaleXTo(a||1);break;case"scaleY":s.scaleY(a||1);break;case"scaleYTo":s.scaleYTo(a||1);break;case"scaleZ":s.scaleZ(a||1);break;case"scaleZTo":s.scaleZTo(a||1);break;case"scale3d":typeof a=="number"?s.scale3d(a||1):s.scale3d(a[0]||1,a[1]||1,a[2]||1);break;case"scale3dTo":typeof a=="number"?s.scale3dTo(a||1):s.scale3dTo(a[0]||1,a[1]||1,a[2]||1);break;case"skew":typeof a=="number"?s.skew(a||0):s.skew(a[0]||0,a[1]||0);break;case"skewTo":typeof a=="number"?s.skewTo(a||0):s.skewTo(a[0]||0,a[1]||0);break;case"skewX":s.skewX(a||0);break;case"skewXTo":s.skewXTo(a||0);break;case"skewY":s.skewY(a||0);break;case"skewYTo":s.skewYTo(a||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":s.perspective(a||0);break;default:Object.prototype.hasOwnProperty.call(e,r)||(e[r]=ge(n,r)),Object.assign(i,{[r]:`${a}`});break}}return Object.assign(i,{transform:s.toString()}),i}let ga=!1;function zs(){ga||(ga=!0,pa(`
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},zt=(n,t)=>(typeof n=="string"&&(n=as(n)||new RegExp(n)),n.test(t)),ki=(n,t)=>{typeof n=="string"&&(n=as(n)||new RegExp(n));const e=t.match(n);return e?n.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},Li=(n,t)=>{typeof n=="string"&&(n=as(n)||new RegExp(n));const e=[],s=t.matchAll(n);for(const i of s)e.push({matchIndex:typeof i.index=="number"?i.index:-1,fullMatch:i[0],groupMatchs:i.slice(1)});return e};function Eo(n){const t=n.match(/[\s\S]/gu);return t?t.length:0}function Ri(n,t){const e=n.codePointAt(t);return e?String.fromCodePoint(e):void 0}function Oi(n=12){const t="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz0123456789",e=t.length;let s="";for(let i=0;i<n;i++)s+=t[Math.floor(Math.random()*e)];return s}function _o(n){return n.replace(/(^\w)/g,t=>t.toLowerCase())}const ct=(n,t="-")=>{let e=n.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return e=e.replace(new RegExp(`^${t}`),""),e};function Ao(n){return n.replace(/(^\w|[_-]\w)/g,t=>t.slice(-1).toUpperCase())}function Fi(n){return _o(Ao(n))}function Ni(n){let t="";for(let e=0,s=n.length;e<s;e++){const i=n.charCodeAt(e);i>=1&&i<=127?t+=n.charAt(e):i>2047?(t+=String.fromCharCode(224|i>>12&15),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|i>>0&63)):(t+=String.fromCharCode(192|i>>6&31),t+=String.fromCharCode(128|i>>0&63))}return t}const Do="[object String]",Io="[object Symbol]";function Bi(n){return Object.prototype.toString.call(n)}function Mo(n){return n!=null}function ko(n){return Bi(n)===Do}function Lo(n){return n===n+0}function Ro(n){return Bi(n)===Io}function Oo(n,...t){return new n.constructor(...t)}function Ui(n,t){for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&!t(e,n[e])&&delete n[e];return n}function Fo(n,t="",e=["","sign","key"]){return Object.keys(n).filter(s=>{for(let i=0,r=e.length;i<r;i++)if(n[s]==e[i])return!1;return!0}).sort().map(s=>`${s}=${n[s]}`).join("&")+t}function Ce(n,t){const e=n.findIndex(s=>s===t);return e>=0&&n.splice(e,1),n}function Yi(n,t){return n.findIndex(e=>e==t)>=0}function No(n,...t){return t.forEach(e=>{Yi(n,e)||n.push(e)}),n}let Xi;try{Xi=Map}catch{Xi=function(){}}let zi;try{zi=Set}catch{zi=function(){}}function Bo(n){return typeof n=="number"&&Number.isNaN(n)}function Kt(n,t){if(n=parseFloat(n),Bo(n)){if(typeof t=="number")return t;throw new Error(`parseNumber(${n}) isNaN!`)}return n}function os(n,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(n-t)<e}const H=(n,t,e)=>n<t?t:n>e?e:n,Uo=(n,t,e)=>s=>{const i=H(s,n,t);return e==0?i:t-i<e?t:Math.round(i/e)*e};function Yo(n,t=12){return Kt(n,0).toFixed(t)}function Ot(n,t=12){return+Yo(n,t)}function hn(n,t){const e=ki("number-single",String(n));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):Mo(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(e.matchIndex+e.fullMatch.length):""}}function Gi(n){const t=ki("number",n);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}Xo();function Xo(){const n=new ArrayBuffer(4),t=new Float32Array(n),e=new Uint32Array(n),s=new Uint32Array(512),i=new Uint32Array(512);for(let h=0;h<256;++h){const c=h-127;c<-27?(s[h]=0,s[h|256]=32768,i[h]=24,i[h|256]=24):c<-14?(s[h]=1024>>-c-14,s[h|256]=1024>>-c-14|32768,i[h]=-c-1,i[h|256]=-c-1):c<=15?(s[h]=c+15<<10,s[h|256]=c+15<<10|32768,i[h]=13,i[h|256]=13):c<128?(s[h]=31744,s[h|256]=64512,i[h]=24,i[h|256]=24):(s[h]=31744,s[h|256]=64512,i[h]=13,i[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:i,mantissaTable:r,exponentTable:a,offsetTable:o}}var lt=(n=>(n.UNKNOWN="",n.TEXT="text/plain",n.MD="text/plain",n.HTML="text/html",n.XML_TEXT="text/xml",n.CSS="text/css",n.JPEG="image/jpeg",n.PNG="image/png",n.GIF="image/gif",n.BMP="image/bmp",n.WEBP="image/webp",n.SVG="image/svg+xml",n.ICON="image/x-icon",n.MICROSOFT_ICON="image/vnd.microsoft.icon",n.MPEG="audio/mpeg",n.MP3="audio/mpeg",n.MP4="video/mp4",n.OGG="audio/ogg",n.WAV="audio/wav",n.MIDI="audio/midi",n.WEBM="video/webm",n.VIDEO_OGG="video/ogg",n.OCTET_STREAM="application/octet-stream",n.JAVASCRIPT="application/javascript",n.ECMASCRIPT="application/ecmascript",n.JSON="application/json",n.XML="application/xml",n.XHTML="application/xhtml+xml",n.XWWW="application/x-www-form-urlencoded",n.DOC="application/msword",n.CSV="application/x-csv",n.EXCEL="application/vnb.ms-excel",n.PPT="application/vnb.mspowerpoint",n.PDF="application/pdf",n.ZIP="application/zip",n.TGZ="application/x-gtar",n.TAR_GZ="application/x-gzip",n.EOT="appliaction/vnd.ms-fontobject",n.TTF="aplication/font-sfnt",n.PKCS12="aplication/pkcs12",n))(lt||{}),hs=(n=>(n.ascii="ascii",n.utf8="utf8",n.utf16le="utf16le",n.ucs2="ucs2",n.base64="base64",n.base64url="base64url",n.latin1="latin1",n.binary="binary",n.hex="hex",n))(hs||{}),Ct=(n=>(n.text="text",n.dataURL="dataURL",n.binaryString="binaryString",n.arraybuffer="arraybuffer",n))(Ct||{});const Pe=(n,t=16)=>{let e=n.toLowerCase();const s=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||i||r)&&(e=e.slice(2)),s&&(t=2),i&&(t=8),r&&(t=16);const a=parseInt(e,t);if(isNaN(a))throw new Error(`radixStringToNumber(${n}, ${t}) 无法解析!`);return a};function zo(n){return new TextEncoder().encode(n)}function Go(n){return String.fromCharCode.apply(null,new Uint16Array(n))}const cn=(n,t,e)=>t?e===hs.base64?new Blob([n],{type:`${t};${e}`}):e===hs.utf8?new Blob([n],{type:`${t};charset=${e}`}):new Blob([n],{type:`${t}`}):new Blob([n]),Vo=n=>{let t=lt.UNKNOWN;switch(new DataView(n).getUint32(0,qo()).toString(16).toUpperCase()){case"FFD8FFDB":t=lt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=lt.JPEG;break;case"89504E47":t=lt.PNG;break;case"47494638":t=lt.GIF;break;case"52494646":t=lt.WEBP;break;case"25504446":t=lt.PDF;break;case"504B0304":t=lt.ZIP;break}return t};function qo(){const n=Uint32Array.of(305419896),t=new Uint8Array(n.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}function $(){return(performance||Date).now()}function jo(n,t=3,e=":"){let s=""+n[0]+n[1];switch(t){case 1:break;case 2:s+=e+n[2]+n[3];break;case 3:s+=e+n[4]+n[5];break}return s}function Ho(n){let t=0;for(let e=5;e>=0;e=e-2)e==5?t+=n[e-1]*10+n[e]:e==3?t+=(n[e-1]*10+n[e])*60:e==1&&(t+=(n[e-1]*10+n[e])*60*60);return t=Math.floor(Math.max(0,t)),t*1e3}function $o(n){let t=Ho(n)/1e3;const e=t%60;n[5]=e%10,n[4]=Math.floor(e/10),t=Math.floor(t/60);const s=t%60;n[3]=s%10,n[2]=Math.floor(s/10),t=Math.floor(t/60);const i=t%60%24;return n[1]=i%10,n[0]=Math.floor(i/10),n}function Wo(n,t=1){return n[5]+=t,$o(n)}function Jo(n,t){let e;return function(...s){clearTimeout(e),e=setTimeout(()=>{n.apply(this,s)},t)}}class cs{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=>{s(...e)}),this}once(t,e){const i=(()=>{let r=!1;return(...a)=>{r||(r=!0,e(...a),this.off(t,i))}})();return this.on(t,i),this}}const Vi=()=>{};function Zo(n){let t=!1;return function(...e){if(!t)return t=!0,n.apply(this,e)}}Array.prototype.ap=function(n){return this.reduce((t,e)=>t.concat(n.map(e)),[])};let Le;function gt(n){Le=n,n(),Le=null}class Ko{subscribers=new Set;add(){Le&&!this.subscribers.has(Le)&&this.subscribers.add(Le)}notify(){this.subscribers.forEach(t=>t())}}const qi=new WeakMap;function ls(n,t){let e=qi.get(n);e||(e=new Map,qi.set(n,e));let s=e.get(t);return s||(s=new Ko,e.set(t,s)),s}function Qo(n,t=!1){return Object.keys(n).forEach(e=>{let s=n[e];if(t&&typeof s=="object"&&s!==null)n[e]=ln(s,t);else{const i=ls(n,e);Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get(){return i.add(),s},set(r){s!=r&&(s=r,i.notify())}})}}),n}function us(n,t=!1){return Qo({value:n},t)}function ln(n,t=!1){const e={get(i,r,a){const o=Reflect.get(i,r,a);if(t&&typeof o=="object"&&o!==null&&!("isYZReactiveProxy"in o)){const c=ln(o,t);c.YZReactiveProxyParentTarget=i,c.YZReactiveProxyParentKey=r,Reflect.set(a,r,c)}return ls(i,r).add(),Reflect.get(i,r,a)},set(i,r,a,o){const h=Reflect.get(i,r,o),c=Reflect.set(i,r,a,o);return Array.isArray(i)?ls(i.YZReactiveProxyParentTarget,i.YZReactiveProxyParentKey).notify():h!=a&&ls(i,r).notify(),c},has(i,r){return r==="isYZReactiveProxy"||r in i}};return new Proxy(n,e)}const ji=ln;class ue{maps=new Map;mapsAddedDuringUpdate=new Map;entries(){return Array.from(this.maps.entries())}keys(){return Array.from(this.maps.keys())}values(){return Array.from(this.maps.values())}json(){return this.entries().reduce((t,[e,s])=>((ko(e)||Lo(e)||Ro(e))&&(t[e]=s),t),{})}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)}getIndex(t){const e=this.entries();if(e.length&&e[t]){const[s,i]=e[t];return[s,i]}}top(){return this.getIndex(0)}shift(){const t=this.top();if(t){const[e]=t;this.delete(e)}return t}delete(t){return this.mapsAddedDuringUpdate.delete(t),this.maps.delete(t)}clear(){this.maps.clear(),this.mapsAddedDuringUpdate.clear()}filter(t){let e=Array.from(this.maps.entries());for(;e.length>0;){this.mapsAddedDuringUpdate.clear();for(let s=0,i=e.length;s<i;s++){const[r,a]=e[s];t(r,a)===!1&&this.delete(r)}e=Array.from(this.mapsAddedDuringUpdate.entries())}}}function th(n,t=(e,s)=>e<=s){const e=n.length;let s=Math.floor(e/2);for(;s>0;){for(let i=s;i<e;i++){const r=n[i];let a=i;for(;a>=s&&!t(n[a-s],r);)n[a]=n[a-s],a-=s;n[a]=r}s=Math.floor(s/2)}}function eh(){const n={};return n.promise=new Promise((t,e)=>{n.resolve=t,n.reject=e}),n}let Hi;try{Hi=Promise}catch{Hi=function(){}}function $i(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Wi={exports:{}};(function(n,t){(function(e){n.exports=e()})(function(e){var s=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(v,x){var p=v[0],g=v[1],E=v[2],C=v[3];p+=(g&E|~g&C)+x[0]-680876936|0,p=(p<<7|p>>>25)+g|0,C+=(p&g|~p&E)+x[1]-389564586|0,C=(C<<12|C>>>20)+p|0,E+=(C&p|~C&g)+x[2]+606105819|0,E=(E<<17|E>>>15)+C|0,g+=(E&C|~E&p)+x[3]-1044525330|0,g=(g<<22|g>>>10)+E|0,p+=(g&E|~g&C)+x[4]-176418897|0,p=(p<<7|p>>>25)+g|0,C+=(p&g|~p&E)+x[5]+1200080426|0,C=(C<<12|C>>>20)+p|0,E+=(C&p|~C&g)+x[6]-1473231341|0,E=(E<<17|E>>>15)+C|0,g+=(E&C|~E&p)+x[7]-45705983|0,g=(g<<22|g>>>10)+E|0,p+=(g&E|~g&C)+x[8]+1770035416|0,p=(p<<7|p>>>25)+g|0,C+=(p&g|~p&E)+x[9]-1958414417|0,C=(C<<12|C>>>20)+p|0,E+=(C&p|~C&g)+x[10]-42063|0,E=(E<<17|E>>>15)+C|0,g+=(E&C|~E&p)+x[11]-1990404162|0,g=(g<<22|g>>>10)+E|0,p+=(g&E|~g&C)+x[12]+1804603682|0,p=(p<<7|p>>>25)+g|0,C+=(p&g|~p&E)+x[13]-40341101|0,C=(C<<12|C>>>20)+p|0,E+=(C&p|~C&g)+x[14]-1502002290|0,E=(E<<17|E>>>15)+C|0,g+=(E&C|~E&p)+x[15]+1236535329|0,g=(g<<22|g>>>10)+E|0,p+=(g&C|E&~C)+x[1]-165796510|0,p=(p<<5|p>>>27)+g|0,C+=(p&E|g&~E)+x[6]-1069501632|0,C=(C<<9|C>>>23)+p|0,E+=(C&g|p&~g)+x[11]+643717713|0,E=(E<<14|E>>>18)+C|0,g+=(E&p|C&~p)+x[0]-373897302|0,g=(g<<20|g>>>12)+E|0,p+=(g&C|E&~C)+x[5]-701558691|0,p=(p<<5|p>>>27)+g|0,C+=(p&E|g&~E)+x[10]+38016083|0,C=(C<<9|C>>>23)+p|0,E+=(C&g|p&~g)+x[15]-660478335|0,E=(E<<14|E>>>18)+C|0,g+=(E&p|C&~p)+x[4]-405537848|0,g=(g<<20|g>>>12)+E|0,p+=(g&C|E&~C)+x[9]+568446438|0,p=(p<<5|p>>>27)+g|0,C+=(p&E|g&~E)+x[14]-1019803690|0,C=(C<<9|C>>>23)+p|0,E+=(C&g|p&~g)+x[3]-187363961|0,E=(E<<14|E>>>18)+C|0,g+=(E&p|C&~p)+x[8]+1163531501|0,g=(g<<20|g>>>12)+E|0,p+=(g&C|E&~C)+x[13]-1444681467|0,p=(p<<5|p>>>27)+g|0,C+=(p&E|g&~E)+x[2]-51403784|0,C=(C<<9|C>>>23)+p|0,E+=(C&g|p&~g)+x[7]+1735328473|0,E=(E<<14|E>>>18)+C|0,g+=(E&p|C&~p)+x[12]-1926607734|0,g=(g<<20|g>>>12)+E|0,p+=(g^E^C)+x[5]-378558|0,p=(p<<4|p>>>28)+g|0,C+=(p^g^E)+x[8]-2022574463|0,C=(C<<11|C>>>21)+p|0,E+=(C^p^g)+x[11]+1839030562|0,E=(E<<16|E>>>16)+C|0,g+=(E^C^p)+x[14]-35309556|0,g=(g<<23|g>>>9)+E|0,p+=(g^E^C)+x[1]-1530992060|0,p=(p<<4|p>>>28)+g|0,C+=(p^g^E)+x[4]+1272893353|0,C=(C<<11|C>>>21)+p|0,E+=(C^p^g)+x[7]-155497632|0,E=(E<<16|E>>>16)+C|0,g+=(E^C^p)+x[10]-1094730640|0,g=(g<<23|g>>>9)+E|0,p+=(g^E^C)+x[13]+681279174|0,p=(p<<4|p>>>28)+g|0,C+=(p^g^E)+x[0]-358537222|0,C=(C<<11|C>>>21)+p|0,E+=(C^p^g)+x[3]-722521979|0,E=(E<<16|E>>>16)+C|0,g+=(E^C^p)+x[6]+76029189|0,g=(g<<23|g>>>9)+E|0,p+=(g^E^C)+x[9]-640364487|0,p=(p<<4|p>>>28)+g|0,C+=(p^g^E)+x[12]-421815835|0,C=(C<<11|C>>>21)+p|0,E+=(C^p^g)+x[15]+530742520|0,E=(E<<16|E>>>16)+C|0,g+=(E^C^p)+x[2]-995338651|0,g=(g<<23|g>>>9)+E|0,p+=(E^(g|~C))+x[0]-198630844|0,p=(p<<6|p>>>26)+g|0,C+=(g^(p|~E))+x[7]+1126891415|0,C=(C<<10|C>>>22)+p|0,E+=(p^(C|~g))+x[14]-1416354905|0,E=(E<<15|E>>>17)+C|0,g+=(C^(E|~p))+x[5]-57434055|0,g=(g<<21|g>>>11)+E|0,p+=(E^(g|~C))+x[12]+1700485571|0,p=(p<<6|p>>>26)+g|0,C+=(g^(p|~E))+x[3]-1894986606|0,C=(C<<10|C>>>22)+p|0,E+=(p^(C|~g))+x[10]-1051523|0,E=(E<<15|E>>>17)+C|0,g+=(C^(E|~p))+x[1]-2054922799|0,g=(g<<21|g>>>11)+E|0,p+=(E^(g|~C))+x[8]+1873313359|0,p=(p<<6|p>>>26)+g|0,C+=(g^(p|~E))+x[15]-30611744|0,C=(C<<10|C>>>22)+p|0,E+=(p^(C|~g))+x[6]-1560198380|0,E=(E<<15|E>>>17)+C|0,g+=(C^(E|~p))+x[13]+1309151649|0,g=(g<<21|g>>>11)+E|0,p+=(E^(g|~C))+x[4]-145523070|0,p=(p<<6|p>>>26)+g|0,C+=(g^(p|~E))+x[11]-1120210379|0,C=(C<<10|C>>>22)+p|0,E+=(p^(C|~g))+x[2]+718787259|0,E=(E<<15|E>>>17)+C|0,g+=(C^(E|~p))+x[9]-343485551|0,g=(g<<21|g>>>11)+E|0,v[0]=p+v[0]|0,v[1]=g+v[1]|0,v[2]=E+v[2]|0,v[3]=C+v[3]|0}function r(v){var x=[],p;for(p=0;p<64;p+=4)x[p>>2]=v.charCodeAt(p)+(v.charCodeAt(p+1)<<8)+(v.charCodeAt(p+2)<<16)+(v.charCodeAt(p+3)<<24);return x}function a(v){var x=[],p;for(p=0;p<64;p+=4)x[p>>2]=v[p]+(v[p+1]<<8)+(v[p+2]<<16)+(v[p+3]<<24);return x}function o(v){var x=v.length,p=[1732584193,-271733879,-1732584194,271733878],g,E,C,F,G,V;for(g=64;g<=x;g+=64)i(p,r(v.substring(g-64,g)));for(v=v.substring(g-64),E=v.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0;g<E;g+=1)C[g>>2]|=v.charCodeAt(g)<<(g%4<<3);if(C[g>>2]|=128<<(g%4<<3),g>55)for(i(p,C),g=0;g<16;g+=1)C[g]=0;return F=x*8,F=F.toString(16).match(/(.*?)(.{0,8})$/),G=parseInt(F[2],16),V=parseInt(F[1],16)||0,C[14]=G,C[15]=V,i(p,C),p}function h(v){var x=v.length,p=[1732584193,-271733879,-1732584194,271733878],g,E,C,F,G,V;for(g=64;g<=x;g+=64)i(p,a(v.subarray(g-64,g)));for(v=g-64<x?v.subarray(g-64):new Uint8Array(0),E=v.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0;g<E;g+=1)C[g>>2]|=v[g]<<(g%4<<3);if(C[g>>2]|=128<<(g%4<<3),g>55)for(i(p,C),g=0;g<16;g+=1)C[g]=0;return F=x*8,F=F.toString(16).match(/(.*?)(.{0,8})$/),G=parseInt(F[2],16),V=parseInt(F[1],16)||0,C[14]=G,C[15]=V,i(p,C),p}function c(v){var x="",p;for(p=0;p<4;p+=1)x+=s[v>>p*8+4&15]+s[v>>p*8&15];return x}function l(v){var x;for(x=0;x<v.length;x+=1)v[x]=c(v[x]);return v.join("")}l(o("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function v(x,p){return x=x|0||0,x<0?Math.max(x+p,0):Math.min(x,p)}ArrayBuffer.prototype.slice=function(x,p){var g=this.byteLength,E=v(x,g),C=g,F,G,V,K;return p!==e&&(C=v(p,g)),E>C?new ArrayBuffer(0):(F=C-E,G=new ArrayBuffer(F),V=new Uint8Array(G),K=new Uint8Array(this,E,F),V.set(K),G)}}();function d(v){return/[\u0080-\uFFFF]/.test(v)&&(v=unescape(encodeURIComponent(v))),v}function y(v,x){var p=v.length,g=new ArrayBuffer(p),E=new Uint8Array(g),C;for(C=0;C<p;C+=1)E[C]=v.charCodeAt(C);return x?E:g}function b(v){return String.fromCharCode.apply(null,new Uint8Array(v))}function w(v,x,p){var g=new Uint8Array(v.byteLength+x.byteLength);return g.set(new Uint8Array(v)),g.set(new Uint8Array(x),v.byteLength),p?g:g.buffer}function _(v){var x=[],p=v.length,g;for(g=0;g<p-1;g+=2)x.push(parseInt(v.substr(g,2),16));return String.fromCharCode.apply(String,x)}function S(){this.reset()}return S.prototype.append=function(v){return this.appendBinary(d(v)),this},S.prototype.appendBinary=function(v){this._buff+=v,this._length+=v.length;var x=this._buff.length,p;for(p=64;p<=x;p+=64)i(this._hash,r(this._buff.substring(p-64,p)));return this._buff=this._buff.substring(p-64),this},S.prototype.end=function(v){var x=this._buff,p=x.length,g,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C;for(g=0;g<p;g+=1)E[g>>2]|=x.charCodeAt(g)<<(g%4<<3);return this._finish(E,p),C=l(this._hash),v&&(C=_(C)),this.reset(),C},S.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},S.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},S.prototype.setState=function(v){return this._buff=v.buff,this._length=v.length,this._hash=v.hash,this},S.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},S.prototype._finish=function(v,x){var p=x,g,E,C;if(v[p>>2]|=128<<(p%4<<3),p>55)for(i(this._hash,v),p=0;p<16;p+=1)v[p]=0;g=this._length*8,g=g.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(g[2],16),C=parseInt(g[1],16)||0,v[14]=E,v[15]=C,i(this._hash,v)},S.hash=function(v,x){return S.hashBinary(d(v),x)},S.hashBinary=function(v,x){var p=o(v),g=l(p);return x?_(g):g},S.ArrayBuffer=function(){this.reset()},S.ArrayBuffer.prototype.append=function(v){var x=w(this._buff.buffer,v,!0),p=x.length,g;for(this._length+=v.byteLength,g=64;g<=p;g+=64)i(this._hash,a(x.subarray(g-64,g)));return this._buff=g-64<p?new Uint8Array(x.buffer.slice(g-64)):new Uint8Array(0),this},S.ArrayBuffer.prototype.end=function(v){var x=this._buff,p=x.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E,C;for(E=0;E<p;E+=1)g[E>>2]|=x[E]<<(E%4<<3);return this._finish(g,p),C=l(this._hash),v&&(C=_(C)),this.reset(),C},S.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},S.ArrayBuffer.prototype.getState=function(){var v=S.prototype.getState.call(this);return v.buff=b(v.buff),v},S.ArrayBuffer.prototype.setState=function(v){return v.buff=y(v.buff,!0),S.prototype.setState.call(this,v)},S.ArrayBuffer.prototype.destroy=S.prototype.destroy,S.ArrayBuffer.prototype._finish=S.prototype._finish,S.ArrayBuffer.hash=function(v,x){var p=h(new Uint8Array(v)),g=l(p);return x?_(g):g},S})})(Wi);var sh=Wi.exports;const nh=$i(sh);function Ji(n,t){return function(){return n.apply(t,arguments)}}const{toString:ih}=Object.prototype,{getPrototypeOf:un}=Object,fs=(n=>t=>{const e=ih.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Dt=n=>(n=n.toLowerCase(),t=>fs(t)===n),ds=n=>t=>typeof t===n,{isArray:Ee}=Array,Re=ds("undefined");function rh(n){return n!==null&&!Re(n)&&n.constructor!==null&&!Re(n.constructor)&&bt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const Zi=Dt("ArrayBuffer");function ah(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&Zi(n.buffer),t}const oh=ds("string"),bt=ds("function"),Ki=ds("number"),ms=n=>n!==null&&typeof n=="object",hh=n=>n===!0||n===!1,ps=n=>{if(fs(n)!=="object")return!1;const t=un(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},ch=Dt("Date"),lh=Dt("File"),uh=Dt("Blob"),fh=Dt("FileList"),dh=n=>ms(n)&&bt(n.pipe),mh=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||bt(n.append)&&((t=fs(n))==="formdata"||t==="object"&&bt(n.toString)&&n.toString()==="[object FormData]"))},ph=Dt("URLSearchParams"),[gh,yh,wh,xh]=["ReadableStream","Request","Response","Headers"].map(Dt),bh=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Oe(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let s,i;if(typeof n!="object"&&(n=[n]),Ee(n))for(s=0,i=n.length;s<i;s++)t.call(null,n[s],s,n);else{const r=e?Object.getOwnPropertyNames(n):Object.keys(n),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,n[o],o,n)}}function Qi(n,t){t=t.toLowerCase();const e=Object.keys(n);let s=e.length,i;for(;s-- >0;)if(i=e[s],t===i.toLowerCase())return i;return null}const fe=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),tr=n=>!Re(n)&&n!==fe;function fn(){const{caseless:n}=tr(this)&&this||{},t={},e=(s,i)=>{const r=n&&Qi(t,i)||i;ps(t[r])&&ps(s)?t[r]=fn(t[r],s):ps(s)?t[r]=fn({},s):Ee(s)?t[r]=s.slice():t[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Oe(arguments[s],e);return t}const vh=(n,t,e,{allOwnKeys:s}={})=>(Oe(t,(i,r)=>{e&&bt(i)?n[r]=Ji(i,e):n[r]=i},{allOwnKeys:s}),n),Sh=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Th=(n,t,e,s)=>{n.prototype=Object.create(t.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},Ch=(n,t,e,s)=>{let i,r,a;const o={};if(t=t||{},n==null)return t;do{for(i=Object.getOwnPropertyNames(n),r=i.length;r-- >0;)a=i[r],(!s||s(a,n,t))&&!o[a]&&(t[a]=n[a],o[a]=!0);n=e!==!1&&un(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},Ph=(n,t,e)=>{n=String(n),(e===void 0||e>n.length)&&(e=n.length),e-=t.length;const s=n.indexOf(t,e);return s!==-1&&s===e},Eh=n=>{if(!n)return null;if(Ee(n))return n;let t=n.length;if(!Ki(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},_h=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&un(Uint8Array)),Ah=(n,t)=>{const s=(n&&n[Symbol.iterator]).call(n);let i;for(;(i=s.next())&&!i.done;){const r=i.value;t.call(n,r[0],r[1])}},Dh=(n,t)=>{let e;const s=[];for(;(e=n.exec(t))!==null;)s.push(e);return s},Ih=Dt("HTMLFormElement"),Mh=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),er=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),kh=Dt("RegExp"),sr=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};Oe(e,(i,r)=>{let a;(a=t(i,r,n))!==!1&&(s[r]=a||i)}),Object.defineProperties(n,s)},Lh=n=>{sr(n,(t,e)=>{if(bt(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=n[e];if(bt(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+"'")})}})},Rh=(n,t)=>{const e={},s=i=>{i.forEach(r=>{e[r]=!0})};return Ee(n)?s(n):s(String(n).split(t)),e},Oh=()=>{},Fh=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t;function Nh(n){return!!(n&&bt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Bh=n=>{const t=new Array(10),e=(s,i)=>{if(ms(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const r=Ee(s)?[]:{};return Oe(s,(a,o)=>{const h=e(a,i+1);!Re(h)&&(r[o]=h)}),t[i]=void 0,r}}return s};return e(n,0)},Uh=Dt("AsyncFunction"),Yh=n=>n&&(ms(n)||bt(n))&&bt(n.then)&&bt(n.catch),nr=((n,t)=>n?setImmediate:t?((e,s)=>(fe.addEventListener("message",({source:i,data:r})=>{i===fe&&r===e&&s.length&&s.shift()()},!1),i=>{s.push(i),fe.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",bt(fe.postMessage)),Xh=typeof queueMicrotask<"u"?queueMicrotask.bind(fe):typeof process<"u"&&process.nextTick||nr,D={isArray:Ee,isArrayBuffer:Zi,isBuffer:rh,isFormData:mh,isArrayBufferView:ah,isString:oh,isNumber:Ki,isBoolean:hh,isObject:ms,isPlainObject:ps,isReadableStream:gh,isRequest:yh,isResponse:wh,isHeaders:xh,isUndefined:Re,isDate:ch,isFile:lh,isBlob:uh,isRegExp:kh,isFunction:bt,isStream:dh,isURLSearchParams:ph,isTypedArray:_h,isFileList:fh,forEach:Oe,merge:fn,extend:vh,trim:bh,stripBOM:Sh,inherits:Th,toFlatObject:Ch,kindOf:fs,kindOfTest:Dt,endsWith:Ph,toArray:Eh,forEachEntry:Ah,matchAll:Dh,isHTMLForm:Ih,hasOwnProperty:er,hasOwnProp:er,reduceDescriptors:sr,freezeMethods:Lh,toObjectSet:Rh,toCamelCase:Mh,noop:Oh,toFiniteNumber:Fh,findKey:Qi,global:fe,isContextDefined:tr,isSpecCompliantForm:Nh,toJSONObject:Bh,isAsyncFn:Uh,isThenable:Yh,setImmediate:nr,asap:Xh};function N(n,t,e,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),i&&(this.response=i,this.status=i.status?i.status:null)}D.inherits(N,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:D.toJSONObject(this.config),code:this.code,status:this.status}}});const ir=N.prototype,rr={};["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(n=>{rr[n]={value:n}}),Object.defineProperties(N,rr),Object.defineProperty(ir,"isAxiosError",{value:!0}),N.from=(n,t,e,s,i,r)=>{const a=Object.create(ir);return D.toFlatObject(n,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),N.call(a,n.message,t,e,s,i),a.cause=n,a.name=n.name,r&&Object.assign(a,r),a};const zh=null;function dn(n){return D.isPlainObject(n)||D.isArray(n)}function ar(n){return D.endsWith(n,"[]")?n.slice(0,-2):n}function or(n,t,e){return n?n.concat(t).map(function(i,r){return i=ar(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Gh(n){return D.isArray(n)&&!n.some(dn)}const Vh=D.toFlatObject(D,{},null,function(t){return/^is[A-Z]/.test(t)});function gs(n,t,e){if(!D.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=D.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,S){return!D.isUndefined(S[_])});const s=e.metaTokens,i=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(i))throw new TypeError("visitor must be a function");function c(w){if(w===null)return"";if(D.isDate(w))return w.toISOString();if(!h&&D.isBlob(w))throw new N("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(w)||D.isTypedArray(w)?h&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function l(w,_,S){let v=w;if(w&&!S&&typeof w=="object"){if(D.endsWith(_,"{}"))_=s?_:_.slice(0,-2),w=JSON.stringify(w);else if(D.isArray(w)&&Gh(w)||(D.isFileList(w)||D.endsWith(_,"[]"))&&(v=D.toArray(w)))return _=ar(_),v.forEach(function(p,g){!(D.isUndefined(p)||p===null)&&t.append(a===!0?or([_],g,r):a===null?_:_+"[]",c(p))}),!1}return dn(w)?!0:(t.append(or(S,_,r),c(w)),!1)}const d=[],y=Object.assign(Vh,{defaultVisitor:l,convertValue:c,isVisitable:dn});function b(w,_){if(!D.isUndefined(w)){if(d.indexOf(w)!==-1)throw Error("Circular reference detected in "+_.join("."));d.push(w),D.forEach(w,function(v,x){(!(D.isUndefined(v)||v===null)&&i.call(t,v,D.isString(x)?x.trim():x,_,y))===!0&&b(v,_?_.concat(x):[x])}),d.pop()}}if(!D.isObject(n))throw new TypeError("data must be an object");return b(n),t}function hr(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function mn(n,t){this._pairs=[],n&&gs(n,this,t)}const cr=mn.prototype;cr.append=function(t,e){this._pairs.push([t,e])},cr.toString=function(t){const e=t?function(s){return t.call(this,s,hr)}:hr;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function qh(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function lr(n,t,e){if(!t)return n;const s=e&&e.encode||qh;D.isFunction(e)&&(e={serialize:e});const i=e&&e.serialize;let r;if(i?r=i(t,e):r=D.isURLSearchParams(t)?t.toString():new mn(t,e).toString(s),r){const a=n.indexOf("#");a!==-1&&(n=n.slice(0,a)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class jh{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){D.forEach(this.handlers,function(s){s!==null&&t(s)})}}const ur=jh,fr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Hh={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:mn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},pn=typeof window<"u"&&typeof document<"u",gn=typeof navigator=="object"&&navigator||void 0,$h=pn&&(!gn||["ReactNative","NativeScript","NS"].indexOf(gn.product)<0),Wh=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Jh=pn&&window.location.href||"http://localhost",rt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pn,hasStandardBrowserEnv:$h,hasStandardBrowserWebWorkerEnv:Wh,navigator:gn,origin:Jh},Symbol.toStringTag,{value:"Module"})),...Hh};function Zh(n,t){return gs(n,new rt.classes.URLSearchParams,Object.assign({visitor:function(e,s,i,r){return rt.isNode&&D.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Kh(n){return D.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Qh(n){const t={},e=Object.keys(n);let s;const i=e.length;let r;for(s=0;s<i;s++)r=e[s],t[r]=n[r];return t}function dr(n){function t(e,s,i,r){let a=e[r++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&D.isArray(i)?i.length:a,h?(D.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!o):((!i[a]||!D.isObject(i[a]))&&(i[a]=[]),t(e,s,i[a],r)&&D.isArray(i[a])&&(i[a]=Qh(i[a])),!o)}if(D.isFormData(n)&&D.isFunction(n.entries)){const e={};return D.forEachEntry(n,(s,i)=>{t(Kh(s),i,e,0)}),e}return null}function tc(n,t,e){if(D.isString(n))try{return(t||JSON.parse)(n),D.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(n)}const yn={transitional:fr,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",i=s.indexOf("application/json")>-1,r=D.isObject(t);if(r&&D.isHTMLForm(t)&&(t=new FormData(t)),D.isFormData(t))return i?JSON.stringify(dr(t)):t;if(D.isArrayBuffer(t)||D.isBuffer(t)||D.isStream(t)||D.isFile(t)||D.isBlob(t)||D.isReadableStream(t))return t;if(D.isArrayBufferView(t))return t.buffer;if(D.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 Zh(t,this.formSerializer).toString();if((o=D.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return gs(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),tc(t)):t}],transformResponse:[function(t){const e=this.transitional||yn.transitional,s=e&&e.forcedJSONParsing,i=this.responseType==="json";if(D.isResponse(t)||D.isReadableStream(t))return t;if(t&&D.isString(t)&&(s&&!this.responseType||i)){const a=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?N.from(o,N.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:rt.classes.FormData,Blob:rt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],n=>{yn.headers[n]={}});const wn=yn,ec=D.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"]),sc=n=>{const t={};let e,s,i;return n&&n.split(`
11
+ `).forEach(function(a){i=a.indexOf(":"),e=a.substring(0,i).trim().toLowerCase(),s=a.substring(i+1).trim(),!(!e||t[e]&&ec[e])&&(e==="set-cookie"?t[e]?t[e].push(s):t[e]=[s]:t[e]=t[e]?t[e]+", "+s:s)}),t},mr=Symbol("internals");function Fe(n){return n&&String(n).trim().toLowerCase()}function ys(n){return n===!1||n==null?n:D.isArray(n)?n.map(ys):String(n)}function nc(n){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=e.exec(n);)t[s[1]]=s[2];return t}const ic=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function xn(n,t,e,s,i){if(D.isFunction(s))return s.call(this,t,e);if(i&&(t=e),!!D.isString(t)){if(D.isString(s))return t.indexOf(s)!==-1;if(D.isRegExp(s))return s.test(t)}}function rc(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,s)=>e.toUpperCase()+s)}function ac(n,t){const e=D.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+e,{value:function(i,r,a){return this[s].call(this,t,i,r,a)},configurable:!0})})}class ws{constructor(t){t&&this.set(t)}set(t,e,s){const i=this;function r(o,h,c){const l=Fe(h);if(!l)throw new Error("header name must be a non-empty string");const d=D.findKey(i,l);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||h]=ys(o))}const a=(o,h)=>D.forEach(o,(c,l)=>r(c,l,h));if(D.isPlainObject(t)||t instanceof this.constructor)a(t,e);else if(D.isString(t)&&(t=t.trim())&&!ic(t))a(sc(t),e);else if(D.isHeaders(t))for(const[o,h]of t.entries())r(h,o,s);else t!=null&&r(e,t,s);return this}get(t,e){if(t=Fe(t),t){const s=D.findKey(this,t);if(s){const i=this[s];if(!e)return i;if(e===!0)return nc(i);if(D.isFunction(e))return e.call(this,i,s);if(D.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Fe(t),t){const s=D.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||xn(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let i=!1;function r(a){if(a=Fe(a),a){const o=D.findKey(s,a);o&&(!e||xn(s,s[o],o,e))&&(delete s[o],i=!0)}}return D.isArray(t)?t.forEach(r):r(t),i}clear(t){const e=Object.keys(this);let s=e.length,i=!1;for(;s--;){const r=e[s];(!t||xn(this,this[r],r,t,!0))&&(delete this[r],i=!0)}return i}normalize(t){const e=this,s={};return D.forEach(this,(i,r)=>{const a=D.findKey(s,r);if(a){e[a]=ys(i),delete e[r];return}const o=t?rc(r):String(r).trim();o!==r&&delete e[r],e[o]=ys(i),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return D.forEach(this,(s,i)=>{s!=null&&s!==!1&&(e[i]=t&&D.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(`
12
+ `)}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(i=>s.set(i)),s}static accessor(t){const s=(this[mr]=this[mr]={accessors:{}}).accessors,i=this.prototype;function r(a){const o=Fe(a);s[o]||(ac(i,a),s[o]=!0)}return D.isArray(t)?t.forEach(r):r(t),this}}ws.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.reduceDescriptors(ws.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[e]=s}}}),D.freezeMethods(ws);const It=ws;function bn(n,t){const e=this||wn,s=t||e,i=It.from(s.headers);let r=s.data;return D.forEach(n,function(o){r=o.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function pr(n){return!!(n&&n.__CANCEL__)}function _e(n,t,e){N.call(this,n??"canceled",N.ERR_CANCELED,t,e),this.name="CanceledError"}D.inherits(_e,N,{__CANCEL__:!0});function gr(n,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?n(e):t(new N("Request failed with status code "+e.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function oc(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function hc(n,t){n=n||10;const e=new Array(n),s=new Array(n);let i=0,r=0,a;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),l=s[r];a||(a=c),e[i]=h,s[i]=c;let d=r,y=0;for(;d!==i;)y+=e[d++],d=d%n;if(i=(i+1)%n,i===r&&(r=(r+1)%n),c-a<t)return;const b=l&&c-l;return b?Math.round(y*1e3/b):void 0}}function cc(n,t){let e=0,s=1e3/t,i,r;const a=(c,l=Date.now())=>{e=l,i=null,r&&(clearTimeout(r),r=null),n.apply(null,c)};return[(...c)=>{const l=Date.now(),d=l-e;d>=s?a(c,l):(i=c,r||(r=setTimeout(()=>{r=null,a(i)},s-d)))},()=>i&&a(i)]}const xs=(n,t,e=3)=>{let s=0;const i=hc(50,250);return cc(r=>{const a=r.loaded,o=r.lengthComputable?r.total:void 0,h=a-s,c=i(h),l=a<=o;s=a;const d={loaded:a,total:o,progress:o?a/o:void 0,bytes:h,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:r,lengthComputable:o!=null,[t?"download":"upload"]:!0};n(d)},e)},yr=(n,t)=>{const e=n!=null;return[s=>t[0]({lengthComputable:e,total:n,loaded:s}),t[1]]},wr=n=>(...t)=>D.asap(()=>n(...t)),lc=rt.hasStandardBrowserEnv?((n,t)=>e=>(e=new URL(e,rt.origin),n.protocol===e.protocol&&n.host===e.host&&(t||n.port===e.port)))(new URL(rt.origin),rt.navigator&&/(msie|trident)/i.test(rt.navigator.userAgent)):()=>!0,uc=rt.hasStandardBrowserEnv?{write(n,t,e,s,i,r){const a=[n+"="+encodeURIComponent(t)];D.isNumber(e)&&a.push("expires="+new Date(e).toGMTString()),D.isString(s)&&a.push("path="+s),D.isString(i)&&a.push("domain="+i),r===!0&&a.push("secure"),document.cookie=a.join("; ")},read(n){const t=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function fc(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function dc(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function xr(n,t,e){let s=!fc(t);return n&&(s||e==!1)?dc(n,t):t}const br=n=>n instanceof It?{...n}:n;function de(n,t){t=t||{};const e={};function s(c,l,d,y){return D.isPlainObject(c)&&D.isPlainObject(l)?D.merge.call({caseless:y},c,l):D.isPlainObject(l)?D.merge({},l):D.isArray(l)?l.slice():l}function i(c,l,d,y){if(D.isUndefined(l)){if(!D.isUndefined(c))return s(void 0,c,d,y)}else return s(c,l,d,y)}function r(c,l){if(!D.isUndefined(l))return s(void 0,l)}function a(c,l){if(D.isUndefined(l)){if(!D.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 n)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,withXSRFToken: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,d)=>i(br(c),br(l),d,!0)};return D.forEach(Object.keys(Object.assign({},n,t)),function(l){const d=h[l]||i,y=d(n[l],t[l],l);D.isUndefined(y)&&d!==o||(e[l]=y)}),e}const vr=n=>{const t=de({},n);let{data:e,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:r,headers:a,auth:o}=t;t.headers=a=It.from(a),t.url=lr(xr(t.baseURL,t.url,t.allowAbsoluteUrls),n.params,n.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let h;if(D.isFormData(e)){if(rt.hasStandardBrowserEnv||rt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((h=a.getContentType())!==!1){const[c,...l]=h?h.split(";").map(d=>d.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...l].join("; "))}}if(rt.hasStandardBrowserEnv&&(s&&D.isFunction(s)&&(s=s(t)),s||s!==!1&&lc(t.url))){const c=i&&r&&uc.read(r);c&&a.set(i,c)}return t},mc=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(e,s){const i=vr(n);let r=i.data;const a=It.from(i.headers).normalize();let{responseType:o,onUploadProgress:h,onDownloadProgress:c}=i,l,d,y,b,w;function _(){b&&b(),w&&w(),i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let S=new XMLHttpRequest;S.open(i.method.toUpperCase(),i.url,!0),S.timeout=i.timeout;function v(){if(!S)return;const p=It.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),E={data:!o||o==="text"||o==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:p,config:n,request:S};gr(function(F){e(F),_()},function(F){s(F),_()},E),S=null}"onloadend"in S?S.onloadend=v:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(v)},S.onabort=function(){S&&(s(new N("Request aborted",N.ECONNABORTED,n,S)),S=null)},S.onerror=function(){s(new N("Network Error",N.ERR_NETWORK,n,S)),S=null},S.ontimeout=function(){let g=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const E=i.transitional||fr;i.timeoutErrorMessage&&(g=i.timeoutErrorMessage),s(new N(g,E.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,n,S)),S=null},r===void 0&&a.setContentType(null),"setRequestHeader"in S&&D.forEach(a.toJSON(),function(g,E){S.setRequestHeader(E,g)}),D.isUndefined(i.withCredentials)||(S.withCredentials=!!i.withCredentials),o&&o!=="json"&&(S.responseType=i.responseType),c&&([y,w]=xs(c,!0),S.addEventListener("progress",y)),h&&S.upload&&([d,b]=xs(h),S.upload.addEventListener("progress",d),S.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(l=p=>{S&&(s(!p||p.type?new _e(null,n,S):p),S.abort(),S=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const x=oc(i.url);if(x&&rt.protocols.indexOf(x)===-1){s(new N("Unsupported protocol "+x+":",N.ERR_BAD_REQUEST,n));return}S.send(r||null)})},pc=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let s=new AbortController,i;const r=function(c){if(!i){i=!0,o();const l=c instanceof Error?c:this.reason;s.abort(l instanceof N?l:new _e(l instanceof Error?l.message:l))}};let a=t&&setTimeout(()=>{a=null,r(new N(`timeout ${t} of ms exceeded`,N.ETIMEDOUT))},t);const o=()=>{n&&(a&&clearTimeout(a),a=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),n=null)};n.forEach(c=>c.addEventListener("abort",r));const{signal:h}=s;return h.unsubscribe=()=>D.asap(o),h}},gc=function*(n,t){let e=n.byteLength;if(!t||e<t){yield n;return}let s=0,i;for(;s<e;)i=s+t,yield n.slice(s,i),s=i},yc=async function*(n,t){for await(const e of wc(n))yield*gc(e,t)},wc=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const t=n.getReader();try{for(;;){const{done:e,value:s}=await t.read();if(e)break;yield s}}finally{await t.cancel()}},Sr=(n,t,e,s)=>{const i=yc(n,t);let r=0,a,o=h=>{a||(a=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:c,value:l}=await i.next();if(c){o(),h.close();return}let d=l.byteLength;if(e){let y=r+=d;e(y)}h.enqueue(new Uint8Array(l))}catch(c){throw o(c),c}},cancel(h){return o(h),i.return()}},{highWaterMark:2})},bs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Tr=bs&&typeof ReadableStream=="function",xc=bs&&(typeof TextEncoder=="function"?(n=>t=>n.encode(t))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Cr=(n,...t)=>{try{return!!n(...t)}catch{return!1}},bc=Tr&&Cr(()=>{let n=!1;const t=new Request(rt.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t}),Pr=64*1024,vn=Tr&&Cr(()=>D.isReadableStream(new Response("").body)),vs={stream:vn&&(n=>n.body)};bs&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!vs[t]&&(vs[t]=D.isFunction(n[t])?e=>e[t]():(e,s)=>{throw new N(`Response type '${t}' is not supported`,N.ERR_NOT_SUPPORT,s)})})})(new Response);const vc=async n=>{if(n==null)return 0;if(D.isBlob(n))return n.size;if(D.isSpecCompliantForm(n))return(await new Request(rt.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(D.isArrayBufferView(n)||D.isArrayBuffer(n))return n.byteLength;if(D.isURLSearchParams(n)&&(n=n+""),D.isString(n))return(await xc(n)).byteLength},Sc=async(n,t)=>{const e=D.toFiniteNumber(n.getContentLength());return e??vc(t)},Sn={http:zh,xhr:mc,fetch:bs&&(async n=>{let{url:t,method:e,data:s,signal:i,cancelToken:r,timeout:a,onDownloadProgress:o,onUploadProgress:h,responseType:c,headers:l,withCredentials:d="same-origin",fetchOptions:y}=vr(n);c=c?(c+"").toLowerCase():"text";let b=pc([i,r&&r.toAbortSignal()],a),w;const _=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let S;try{if(h&&bc&&e!=="get"&&e!=="head"&&(S=await Sc(l,s))!==0){let E=new Request(t,{method:"POST",body:s,duplex:"half"}),C;if(D.isFormData(s)&&(C=E.headers.get("content-type"))&&l.setContentType(C),E.body){const[F,G]=yr(S,xs(wr(h)));s=Sr(E.body,Pr,F,G)}}D.isString(d)||(d=d?"include":"omit");const v="credentials"in Request.prototype;w=new Request(t,{...y,signal:b,method:e.toUpperCase(),headers:l.normalize().toJSON(),body:s,duplex:"half",credentials:v?d:void 0});let x=await fetch(w);const p=vn&&(c==="stream"||c==="response");if(vn&&(o||p&&_)){const E={};["status","statusText","headers"].forEach(V=>{E[V]=x[V]});const C=D.toFiniteNumber(x.headers.get("content-length")),[F,G]=o&&yr(C,xs(wr(o),!0))||[];x=new Response(Sr(x.body,Pr,F,()=>{G&&G(),_&&_()}),E)}c=c||"text";let g=await vs[D.findKey(vs,c)||"text"](x,n);return!p&&_&&_(),await new Promise((E,C)=>{gr(E,C,{data:g,headers:It.from(x.headers),status:x.status,statusText:x.statusText,config:n,request:w})})}catch(v){throw _&&_(),v&&v.name==="TypeError"&&/fetch/i.test(v.message)?Object.assign(new N("Network Error",N.ERR_NETWORK,n,w),{cause:v.cause||v}):N.from(v,v&&v.code,n,w)}})};D.forEach(Sn,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const Er=n=>`- ${n}`,Tc=n=>D.isFunction(n)||n===null||n===!1,_r={getAdapter:n=>{n=D.isArray(n)?n:[n];const{length:t}=n;let e,s;const i={};for(let r=0;r<t;r++){e=n[r];let a;if(s=e,!Tc(e)&&(s=Sn[(a=String(e)).toLowerCase()],s===void 0))throw new N(`Unknown adapter '${a}'`);if(s)break;i[a||"#"+r]=s}if(!s){const r=Object.entries(i).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 :
13
+ `+r.map(Er).join(`
14
+ `):" "+Er(r[0]):"as no adapter specified";throw new N("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:Sn};function Tn(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new _e(null,n)}function Ar(n){return Tn(n),n.headers=It.from(n.headers),n.data=bn.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),_r.getAdapter(n.adapter||wn.adapter)(n).then(function(s){return Tn(n),s.data=bn.call(n,n.transformResponse,s),s.headers=It.from(s.headers),s},function(s){return pr(s)||(Tn(n),s&&s.response&&(s.response.data=bn.call(n,n.transformResponse,s.response),s.response.headers=It.from(s.response.headers))),Promise.reject(s)})}const Dr="1.8.4",Ss={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{Ss[n]=function(s){return typeof s===n||"a"+(t<1?"n ":" ")+n}});const Ir={};Ss.transitional=function(t,e,s){function i(r,a){return"[Axios v"+Dr+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new N(i(a," has been removed"+(e?" in "+e:"")),N.ERR_DEPRECATED);return e&&!Ir[a]&&(Ir[a]=!0,console.warn(i(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}},Ss.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function Cc(n,t,e){if(typeof n!="object")throw new N("options must be an object",N.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let i=s.length;for(;i-- >0;){const r=s[i],a=t[r];if(a){const o=n[r],h=o===void 0||a(o,r,n);if(h!==!0)throw new N("option "+r+" must be "+h,N.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new N("Unknown option "+r,N.ERR_BAD_OPTION)}}const Ts={assertOptions:Cc,validators:Ss},Ft=Ts.validators;class Cs{constructor(t){this.defaults=t,this.interceptors={request:new ur,response:new ur}}async request(t,e){try{return await this._request(t,e)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const r=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?r&&!String(s.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(s.stack+=`
15
+ `+r):s.stack=r}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=de(this.defaults,e);const{transitional:s,paramsSerializer:i,headers:r}=e;s!==void 0&&Ts.assertOptions(s,{silentJSONParsing:Ft.transitional(Ft.boolean),forcedJSONParsing:Ft.transitional(Ft.boolean),clarifyTimeoutError:Ft.transitional(Ft.boolean)},!1),i!=null&&(D.isFunction(i)?e.paramsSerializer={serialize:i}:Ts.assertOptions(i,{encode:Ft.function,serialize:Ft.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ts.assertOptions(e,{baseUrl:Ft.spelling("baseURL"),withXsrfToken:Ft.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&D.merge(r.common,r[e.method]);r&&D.forEach(["delete","get","head","post","put","patch","common"],w=>{delete r[w]}),e.headers=It.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(e)===!1||(h=h&&_.synchronous,o.unshift(_.fulfilled,_.rejected))});const c=[];this.interceptors.response.forEach(function(_){c.push(_.fulfilled,_.rejected)});let l,d=0,y;if(!h){const w=[Ar.bind(this),void 0];for(w.unshift.apply(w,o),w.push.apply(w,c),y=w.length,l=Promise.resolve(e);d<y;)l=l.then(w[d++],w[d++]);return l}y=o.length;let b=e;for(d=0;d<y;){const w=o[d++],_=o[d++];try{b=w(b)}catch(S){_.call(this,S);break}}try{l=Ar.call(this,b)}catch(w){return Promise.reject(w)}for(d=0,y=c.length;d<y;)l=l.then(c[d++],c[d++]);return l}getUri(t){t=de(this.defaults,t);const e=xr(t.baseURL,t.url,t.allowAbsoluteUrls);return lr(e,t.params,t.paramsSerializer)}}D.forEach(["delete","get","head","options"],function(t){Cs.prototype[t]=function(e,s){return this.request(de(s||{},{method:t,url:e,data:(s||{}).data}))}}),D.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(de(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}Cs.prototype[t]=e(),Cs.prototype[t+"Form"]=e(!0)});const Ps=Cs;class Cn{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(i=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](i);s._listeners=null}),this.promise.then=i=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(i);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new _e(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)}toAbortSignal(){const t=new AbortController,e=s=>{t.abort(s)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new Cn(function(i){t=i}),cancel:t}}}const Pc=Cn;function Ec(n){return function(e){return n.apply(null,e)}}function _c(n){return D.isObject(n)&&n.isAxiosError===!0}const Pn={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(Pn).forEach(([n,t])=>{Pn[t]=n});const Ac=Pn;function Mr(n){const t=new Ps(n),e=Ji(Ps.prototype.request,t);return D.extend(e,Ps.prototype,t,{allOwnKeys:!0}),D.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return Mr(de(n,i))},e}const tt=Mr(wn);tt.Axios=Ps,tt.CanceledError=_e,tt.CancelToken=Pc,tt.isCancel=pr,tt.VERSION=Dr,tt.toFormData=gs,tt.AxiosError=N,tt.Cancel=tt.CanceledError,tt.all=function(t){return Promise.all(t)},tt.spread=Ec,tt.isAxiosError=_c,tt.mergeConfig=de,tt.AxiosHeaders=It,tt.formToJSON=n=>dr(D.isHTMLForm(n)?new FormData(n):n),tt.getAdapter=_r.getAdapter,tt.HttpStatusCode=Ac,tt.default=tt;const Dc=tt,kr=window.crypto.subtle;kr||console.warn("Crypto API not supported");async function Lr(n,t="SHA-256"){const e=await kr.digest(t,zo(n));return Go(e)}async function Rr(n,t="SHA-256"){const e=JSON.stringify(Fo(n));return Lr(e,t)}class Or{instance;constructor(t){this.instance=Dc.create(t);const e=new Fr;this.instance.interceptors.request.use(s=>(e.pendingRequest(s),s),s=>(e.cancelRequest(s.config),s)),t?.interceptor&&(this.instance.interceptors.request.use(t.interceptor.request,t.interceptor.requestError),this.instance.interceptors.response.use(t.interceptor.response,t.interceptor.responseError)),this.instance.interceptors.response.use(async s=>(await e.confirmRequest(s.config),s.data),async s=>{const{code:i="",config:r}=s;return!r||!r.retry||(r.retryCounted=r.retryCounted||0,r.retryCounted>=r.retry)?Promise.reject(s):(r.retryCounted++,await new Promise(a=>{setTimeout(a,r.retryDelay)}),await this.request(r))})}async request(t){return await this.instance.request(t)}async get(t,e){return this.request({...e,method:"get",url:t})}async delete(t,e){return this.request({...e,method:"delete",url:t})}async head(t,e){return this.request({...e,method:"head",url:t})}async options(t,e){return this.request({...e,method:"options",url:t})}async post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}async postBlob(t,e,s){return s={...s,headers:{...s?.headers,"Content-Type":"multipart/form-data"}},this.request({...s,method:"post",url:t,data:e})}async postForm(t,e,s){return this.instance.postForm(t,e,{...s})}async put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}async patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class Fr{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async getRequestId(t){const{url:e,method:s,params:i,data:r}=t;return await Rr({url:e,method:s,params:i,data:r})}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(){const t=this.pendingRequestMap.values();for(const e of t)e.abort();this.pendingRequestMap.clear()}}const En=n=>new XMLSerializer().serializeToString(n),Ic=(n,t="text/html")=>new DOMParser().parseFromString(n,t),Nr=(n,t=lt.SVG,e=hs.utf8)=>cn(En(n),t,e);async function _n(n=["*"],t){if(!document||!(document instanceof Document))throw new Error("This is not a browser environment");let e=[];const s=document.createElement("input");return s.setAttribute("type","file"),s.setAttribute("visibility","hidden"),s.setAttribute("accept",n.join(",")),t&&s.setAttribute("multiple","true"),s.addEventListener("click",i=>{s.value=""},!1),new Promise((i,r)=>{s.addEventListener("change",a=>{e=Array.from(a.target.files||[]),e.length===0?r(new Error("Cancel")):i(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&r(new Error("Cancel"))},1e3)},{once:!0}),s.click()}).then(i=>(s.remove(),i)).catch(i=>{throw s.remove(),i})}function Ne(n,t=Ct.text,e){return new Promise((s,i)=>{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=>{i(a)}),t){case Ct.dataURL:r.readAsDataURL(n);break;case Ct.binaryString:r.readAsBinaryString(n);break;case Ct.arraybuffer:r.readAsArrayBuffer(n);break;case Ct.text:default:r.readAsText(n)}})}async function Mc(n){const t=await Ne(n,Ct.arraybuffer);return Vo(t)}const kc=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Lc(n){switch(n.toLowerCase()){case"jpg":case"jpeg":return lt.JPEG;case"gif":return lt.GIF;case"svg":return lt.SVG;case"pdf":return lt.PDF;case"png":default:return lt.PNG}}function Br(n,t,e,s,i,r,a){const o=new FileReader;o.addEventListener("load",h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),a<s.size)Br(n,t,e,s,i,a,Math.min(a+i,s.size));else return n(e.end())}),o.addEventListener("error",h=>t(h)),o.readAsArrayBuffer(s.slice(r,a))}async function Ur(n,t=1048576){return await new Promise((e,s)=>Br(e,s,new nh.ArrayBuffer,n,t,0,Math.min(t,n.size)))}class Rc{axios;checkURL;uploadURL;file;fileHash;chunkSize;chunks;currentChunk=0;isUploading=!1;begin=0;end=0;timer;time=[0,0,0,0,0,0];onExist;onStart;onProgress;onComplete;onTime;constructor(t){this.axios=new Or({baseURL:t.baseURL,interceptor:{request:e=>e,response:e=>(e.config.url==this.uploadURL&&e.status==200&&(this.onProgress?.(this.currentChunk++,this.chunks),this.end==this.file.size?(this.isUploading=!1,this.stopTimeCount(),this.onComplete?.()):this.isUploading&&this.uploadChunk()),e)}}),this.checkURL=t.checkURL,this.uploadURL=t.uploadURL,this.file=t.file,this.chunkSize=t.chunkSize||1048576,this.chunks=Math.ceil(this.file.size/this.chunkSize),this.onExist=t.onExist,this.onStart=t.onStart,this.onProgress=t.onProgress,this.onComplete=t.onComplete,this.onTime=t.onTime}async start(){this.fileHash||(this.fileHash=await Ur(this.file,this.chunkSize)),(await this.axios.post(this.checkURL,{fileName:this.file.name,fileHash:this.fileHash})).isExist?(this.isUploading=!1,this.onExist?.()):this.isUploading||(this.onStart?.(),this.startTimeCount(),await this.uploadChunk())}pause(){this.isUploading&&(this.isUploading=!1,this.stopTimeCount())}async uploadChunk(){this.isUploading=!0,this.begin=this.currentChunk*this.chunkSize,this.end=Math.min(this.begin+this.chunkSize,this.file.size);const t=this.file.slice(this.begin,this.end),e=new FormData;e.append("fileData",t),e.append("fileName",this.file.name),e.append("fileHash",this.fileHash),e.append("chunkIndex",String(this.currentChunk)),e.append("chunks",String(this.chunks)),await this.axios.postBlob(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{Wo(this.time,1),this.onTime?.(jo(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}function Oc(n,t){const e=us(t?.value||"");if(!e.value){const s=`; ${document.cookie}`.split(`; ${n}=`).pop()?.split(";").shift();s&&(e.value=decodeURIComponent(s))}return gt(()=>{if(e.value&&t?.days){const s="; expires="+new Date(Date.now()+t.days*864e5).toUTCString(),i=t?.domain?"; domain="+t?.domain:"",r=t?.path?"; path="+t?.path:"",a=t?.secure==!0?"; secure":"";document.cookie=n+"="+encodeURIComponent(e.value)+s+i+r+a}}),e}function Fc(){const n=document.cookie.split("; ");for(let t=0;t<n.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const s=encodeURIComponent(n[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",i=location.pathname.split("/");for(document.cookie=s+"/";i.length>0;)document.cookie=s+i.join("/"),i.pop();e.shift()}}}function Yr(n,t){const e=us(t||"");if(!t)try{let s=window.localStorage.getItem(n);s&&(s=JSON.parse(s),e.value=s?s.value:"")}catch{}return gt(()=>{if(e.value)try{window.localStorage.setItem(n,JSON.stringify(e))}catch{}else window.localStorage.removeItem(n)}),e}function Nc(n,t){const e=us(t||"");if(!t)try{let s=window.sessionStorage.getItem(n);s&&(s=JSON.parse(s),e.value=s?s.value:"")}catch{}return gt(()=>{if(e.value)try{window.sessionStorage.setItem(n,JSON.stringify(e))}catch{}else window.sessionStorage.removeItem(n)}),e}function Bc(n,t){let e;return n.objectStoreNames.contains(t)||(e=n.createObjectStore(t,{keyPath:"id"})),e}function Uc(n,t=1,e){return new Promise((s,i)=>{let r;const a=window.indexedDB.open(n,t);a.onerror=()=>{i("无法使用IndexDB!")},a.onsuccess=o=>{r=o.target.result,Bc(r,e),s(r)}})}function Yc(n,t,e={id:1,name:"xxx"}){return new Promise((s,i)=>{const r=n.transaction([t],"readwrite");r.objectStore(t).add(e),r.oncomplete=o=>{s(o)},r.onerror=o=>{i(o)}})}function Z(n,t,e,s=!1){const i=async r=>{await e(r)};try{n.addEventListener(t,i,s)}catch{n.attachEvent("on"+t,i)}return()=>{try{n.removeEventListener(t,i,s)}catch{n.detachEvent("on"+t,i)}}}const Xc=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],zc=["keydown","keyup","keypress"],Gc=["touchstart","touchend","touchcancel","touchmove"],Vc=["pointerdown","pointerup","pointercancel","pointermove"],qc=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],jc=["change"];function Hc(n,t,e={bubbles:!0,detail:{}}){if(!n)return;let s;try{Xc.includes(t)?s=new MouseEvent(t,e):zc.includes(t)?s=new KeyboardEvent(t,e):Gc.includes(t)?s=new TouchEvent(t,e):Vc.includes(t)?s=new PointerEvent(t,e):qc.includes(t)?s=new DragEvent(t,e):jc.includes(t)?s=new Event(t,e):s=new CustomEvent(t,e)}catch{document.createEvent?s=document.createEvent("HTMLEvents").initEvent(t,!0,!0):document.createEventObject&&(s=document.createEventObject())}if(n.dispatchEvent)n.dispatchEvent(s);else if(n.fireEvent&&document.createEventObject)n.fireEvent("on"+t,s);else throw new Error(`Can't fire event : ${t}`)}function $c(n,t){const e=n.changedTouches[0];return new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function Qt(n){n.preventDefault&&n.preventDefault();try{n.returnValue=!1}catch{}}function Xr(n){n.stopPropagation&&n.stopPropagation();try{n.cancelBubble=!0}catch{}}function Wc(n,t){let e=document.createElement(n);t="on"+t;let s=t in e;return s||(e.setAttribute(t,"return;"),s=typeof e[t]=="function"),e=null,s}function Jc(n){if(document.implementation.hasFeature("MouseEvents","2.0"))return n.button;switch(n.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}function te(){const n=new cs;return{on:(t,e)=>{n.on(t,e)},off:(t,e)=>{n.off(t,e)},emit:(t,...e)=>{n.emit(t,...e)}}}const Es=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(n)?t="iOS":/android/i.test(n)?t="Android":/BlackBerry/i.test(n)?t="BlackBerry":/mac/i.test(n)?t="macOS":/win/i.test(n)?t="Windows":/linux/i.test(n)?t="Linux":/bsd/i.test(n)&&(t="BSD"),t.toLowerCase()};function Zc(n=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(n)){const e=n.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(n)){const e=n.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(n)){const e=n.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(n)){const e=n.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function Kc(n,t){const e=n.split("."),s=t.split(".");for(let i=0,r=e.length;i<r;i++){if(s.length==i)return 1;if(e[i]!=s[i])return e[i]>s[i]?1:-1}return e.length!=s.length?-1:0}function An(){const n=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(n)||/opera/i.test(n)?t="Opera":/chrome/i.test(n)?t="Chrome":/firefox/i.test(n)?t="Firefox":/safari/i.test(n)?t="Safari":/edge/i.test(n)?t="Edge":/msie|trident/i.test(n)?t="IE":/MicroMessenger/i.test(n)?t="Wechat":/alipay/i.test(n)&&(t="Ali"),t.toLowerCase()}const Qc=()=>{const n=navigator.userAgent;let t="Unknown";if(/Chrome/.test(n)){const e=n.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(n)){const e=n.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(n)){const e=n.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(n)){const e=n.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(n)){const e=n.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t};function tl(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function el(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Dn(){return Es()==="ios"}function In(){return Es()==="macos"}function sl(){return Dn()|In()}function zr(){return Es()==="android"}function nl(){return Dn()||zr()}function Gr(){const n=window.navigator.userAgent,t=n.indexOf("MSIE ");if(t>0)return parseInt(n.substring(t+5,n.indexOf(".",t)),10);if(n.indexOf("Trident/")>0){const i=n.indexOf("rv:");return parseInt(n.substring(i+3,n.indexOf(".",i)),10)}const s=n.indexOf("Edge/");return s>0?parseInt(n.substring(s+5,n.indexOf(".",s)),10):-1}const il=Gr()!==-1,rl=document.documentMode?document.documentMode===9:!1,al=document.documentMode?document.documentMode===10:!1,ol=document.documentMode?document.documentMode===11:!1;function Vr(){return An()==="wechat"}function qr(){return An()==="ali"}function hl(){return Vr()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function cl(){return qr()&&navigator.userAgent.match(/miniprogram/i)}const ll=typeof document<"u",jr=typeof window<"u",ul=typeof history<"u",fl=jr&&window.File&&window.FileReader&&window.FileList&&window.Blob,Hr=(()=>{const n=Mi();return!!(n.Worker&&n.Blob&&n.Promise&&n.OffscreenCanvas&&n.OffscreenCanvasRenderingContext2D&&n.HTMLCanvasElement&&n.HTMLCanvasElement.prototype.transferControlToOffscreen&&n.URL&&n.URL.createObjectURL)})(),dl=typeof Path2D=="function"&&typeof DOMMatrix=="function",$r=function(){if(!Mi().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}(),ml=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},pl="webkit moz ms o".split(" ");function _s(n){return typeof n=="function"&&/native code/.test(n.toString())}(function(){if(!window.requestAnimationFrame){let n=$();window.requestAnimationFrame=function(t){const e=$(),s=Math.max(0,16-(e-n)),i=window.setTimeout(function(){t(e+s)},s);return n=e+s,i}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})})();function Mn(n){let t=!1;return window.requestAnimationFrame(function e(s){!t&&n(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}}function kn(n,t=0){if(t==0)return n($()),()=>{};{const e=$();return Mn(s=>s-e>=t?(n(s),!1):!0)}}function gl(n,t=0){let e=!1,s=0;const i=$(),r=a=>{if(e)return;s++;const o=a-i-s*t;n(a,s,t<=o),kn(r,Math.max(0,t-o))};return kn(r,t),()=>{e=!0}}function yl(n,t=20){const e=1e3/t;let s=0,i;return()=>($()-s>=e&&(s=$(),i=n()),i)}window.requestIdleCallback=window.requestIdleCallback||function(n,t){const e=$();return setTimeout(function(){n({didTimeout:$()-e>50,timeRemaining:()=>Math.max(0,50-($()-e))})},t?.timeout)},window.cancelIdleCallback=window.cancelIdleCallback||function(n){clearTimeout(n)};function Wr(n,t){requestIdleCallback(e=>{e.timeRemaining()>0||t?n():Wr(n,t)},{timeout:t})}const Ln=new ue;let Rn=!1;function On(n,t,e){n&&t&&Ln.set(n,{cb:t,startTime:$(),timeout:e}),!Rn&&(Rn=!0,xl(s=>{Rn=!1;let i=s.timeRemaining();Ln.filter((r,a)=>{let o=!1;const h=$();(i>0||a.timeout&&$()-a.startTime>=a.timeout)&&(a.cb(),o=!0);const c=$();return i-=c-h,!o}),Ln.length>0&&On()}))}let As=0,me=33,ee=33,Fn;const Jr=new MessageChannel,wl=Jr.port2;Jr.port1.onmessage=n=>{Fn!==null&&Fn({didTimeout:As<=$(),timeRemaining:()=>Math.max(0,As-$())})};function xl(n){return Fn=n,requestAnimationFrame(t=>{let e=t-As+ee;e<ee&&me<ee?(e<8&&(e=8),ee=e<me?me:e):e>ee&&me>ee?ee=e<me?me:e:me=e,As=t+ee,wl.postMessage(null)})}function bl(n){if(typeof setImmediate<"u"&&_s(setImmediate))setImmediate(n);else if(typeof MessageChannel<"u"&&(_s(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=n,t.postMessage(null)}else typeof Promise<"u"&&_s(Promise)?Promise.resolve().then(n):setTimeout(n,0)}function vl(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(t=>setTimeout(()=>{throw t}))}class Be{static _nextId=0;static nextId(){return Be._nextId++}}const L={Linear:{None:function(n){return n}},Ease:{In:function(n){return Math.pow(n,1.7)}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}},Exponential:{In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}},Back:{In:function(n){return n===1?1:n*n*((1.70158+1)*n-1.70158)},Out:function(n){return n===0?0:--n*n*((1.70158+1)*n+1.70158)+1},InOut:function(n){const t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-L.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?L.Bounce.In(n*2)*.5:L.Bounce.Out(n*2-1)*.5+.5}},generatePow:function(n=4){return n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return t**n},Out:function(t){return 1-(1-t)**n},InOut:function(t){return t<.5?(t*2)**n/2:(1-(2-t*2)**n)/2+.5}}},random:function(n){return Math.random()},createStep:function(n){return function(t){return Math.floor(t*n)/n}},createNoisyEasing:function(n,t=.1){const e=1-t;return function(s){return t*Math.random()+e*n(s)}},swing:function(n){return n+Math.sin(n*Math.PI*2)/2},causeSeizures:function(n){return n+.2*Math.random()-.1}};function Zr(n){switch(n){case L.Quadratic.In:return L.Quadratic.Out;case L.Quadratic.Out:return L.Quadratic.In;case L.Quadratic.InOut:return L.Quadratic.InOut;case L.Cubic.In:return L.Cubic.Out;case L.Cubic.Out:return L.Cubic.In;case L.Cubic.InOut:return L.Cubic.InOut;case L.Quartic.In:return L.Quartic.Out;case L.Quartic.Out:return L.Quartic.In;case L.Quartic.InOut:return L.Quartic.InOut;case L.Quintic.In:return L.Quintic.Out;case L.Quintic.Out:return L.Quintic.In;case L.Quintic.InOut:return L.Quintic.InOut;case L.Sinusoidal.In:return L.Sinusoidal.Out;case L.Sinusoidal.Out:return L.Sinusoidal.In;case L.Sinusoidal.InOut:return L.Sinusoidal.InOut;case L.Exponential.In:return L.Exponential.Out;case L.Exponential.Out:return L.Exponential.In;case L.Exponential.InOut:return L.Exponential.InOut;case L.Circular.In:return L.Circular.Out;case L.Circular.Out:return L.Circular.In;case L.Circular.InOut:return L.Circular.InOut;case L.Elastic.In:return L.Elastic.Out;case L.Elastic.Out:return L.Elastic.In;case L.Elastic.InOut:return L.Elastic.InOut;case L.Back.In:return L.Back.Out;case L.Back.Out:return L.Back.In;case L.Back.InOut:return L.Back.InOut;case L.Bounce.In:return L.Bounce.Out;case L.Bounce.Out:return L.Bounce.In;case L.Bounce.InOut:return L.Bounce.InOut;default:return n}}const Sl=4,Tl=.001,Cl=1e-7,Pl=10,Ue=11,Ds=1/(Ue-1),El=typeof Float32Array=="function";function Kr(n,t){return 1-3*t+3*n}function Qr(n,t){return 3*t-6*n}function ta(n){return 3*n}function Is(n,t,e){return((Kr(t,e)*n+Qr(t,e))*n+ta(t))*n}function ea(n,t,e){return 3*Kr(t,e)*n*n+2*Qr(t,e)*n+ta(t)}function _l(n,t,e,s,i){let r,a,o=0;do a=t+(e-t)/2,r=Is(a,s,i)-n,r>0?e=a:t=a;while(Math.abs(r)>Cl&&++o<Pl);return a}function Al(n,t,e,s){for(let i=0;i<Sl;++i){const r=ea(t,e,s);if(r===0)return t;const a=Is(t,e,s)-n;t-=a/r}return t}function Dl(n){return n}function Nn(n,t,e,s){if(!(0<=n&&n<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===t&&e===s)return Dl;const i=El?new Float32Array(Ue):new Array(Ue);for(let a=0;a<Ue;++a)i[a]=Is(a*Ds,n,e);function r(a){let o=0,h=1;const c=Ue-1;for(;h!==c&&i[h]<=a;++h)o+=Ds;--h;const l=(a-i[h])/(i[h+1]-i[h]),d=o+l*Ds,y=ea(d,n,e);return y>=Tl?Al(a,d,n,e):y===0?d:_l(a,o,o+Ds,n,e)}return a=>a===0||a===1?a:Is(r(a),t,s)}function Bn(n){switch(n){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 sa(n){const[t,e,s,i]=Bn(n);return[1-s,1-i,1-t,1-e]}function Il(n){return Nn(...Bn(n))}function Ml(n){return Nn(...sa(n))}const Gt={Utils:{Linear:function(n,t,e){return(t-n)*e+n},Factorial:function(){const n=[1];return function(t){let e=1;if(n[t])return n[t];for(let s=t;s>1;s--)e*=s;return n[t]=e,e}}(),Bernstein:function(n,t){const e=Gt.Utils.Factorial;return e(n)/e(t)/e(n-t)},CatmullRom:function(n,t,e,s,i){const r=(e-n)*.5,a=(s-t)*.5,o=i*i,h=i*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*i+t},QuadraticBezier:(n,t,e,s)=>{const i=1-s;return i*i*n+2*i*s*t+s*s*e},CubicBezier:(n,t,e,s,i)=>{const r=1-i;return r*r*r*n+3*r*r*i*t+3*r*i*i*e+i*i*i*s}},Linear:function(n,t){const e=n.length-1,s=e*t,i=Math.floor(s),r=Gt.Utils.Linear;return t<0?r(n[0],n[1],s):t>1?r(n[e],n[e-1],e-s):r(n[i],n[i+1>e?e:i+1],s-i)},Bezier:function(n,t){let e=0;const s=n.length-1,i=Math.pow,r=Gt.Utils.Bernstein;for(let a=0;a<=s;a++)e+=i(1-t,s-a)*i(t,a)*n[a]*r(s,a);return e},CatmullRom:function(n,t){const e=n.length-1;let s=e*t,i=Math.floor(s);const r=Gt.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(i=Math.floor(s=e*(1+t))),r(n[(i-1+e)%e],n[i],n[(i+1)%e],n[(i+2)%e],s-i)):t<0?n[0]-(r(n[0],n[0],n[1],n[1],-s)-n[0]):t>1?n[e]-(r(n[e],n[e],n[e-1],n[e-1],s-e)-n[e]):r(n[i?i-1:0],n[i],n[e<i+1?e:i+1],n[e<i+2?e:i+2],s-i)}};class na{_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=$(),e=!1){const s=Object.keys(this._tweens);for(let i=0;i<s.length;i++){const r=this._tweens[s[i]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[i]]}return!!Object.keys(this._tweens).length}}const Pt=new na;class Un{constructor(t,e=Pt){this._object=t,this._group=e}_id=Be.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=L.Linear.None;_interpolationFunction=Gt.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=$()){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,i){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];i[r]=o?[]:{},this._setupProperties(a,e[r],s[r],i[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?i[r]=s[r].slice().reverse():i[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=$()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=$()){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=Pt){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=L.Linear.None){return this._easingFunction=t,this}interpolation(t=Gt.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=$(),e=!0){if(this._isPaused)return!0;let s,i;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),i=(t-this._startTime)/this._durationTime,i=this._durationTime===0||i>1?1:i;const a=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===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,i){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,i):typeof o=="object"&&o?this._updateProperties(t[r],a,o,i):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*i))}}_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 kl=Be.nextId,Ll=Pt.getAll.bind(Pt),Rl=Pt.removeAll.bind(Pt),Ol=Pt.add.bind(Pt),Fl=Pt.remove.bind(Pt),Nl=Pt.update.bind(Pt),Bl={now:$,Sequence:Be,Easing:L,Interpolation:Gt,Group:na,Tween:Un,nextId:kl,getAll:Ll,removeAll:Rl,add:Ol,remove:Fl,update:Nl};class Yn{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=$(),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=$();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class Ms{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){th(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const i={...s};delete i.tween,i.fromValues={...i.fromValues},i.toValues={...i.toValues},e.push(i)}),e}addTween(t,e,s){const i={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||L.Linear.None,interpolationFunction:s?.interpolationFunction||Gt.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(i),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Yn,s=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=Mn(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 Un({...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(),Ce(t,c))})}const a=!!t.length;return a||(this.onGroupComplete?.(),i()),a})})}isPaused=!1;pausedClock=new Yn;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=Zr(s.easeFunction);const i={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...i}}),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}}const ks=new ue,ia=(n=!0)=>{ks.filter((t,e)=>(e.alternate&&(js(e,e.alternate),n&&ks.set(t,e.alternate),e.alternate=void 0),n))};function Xn(n){let t=ks.get(n);return t||(t=qs(n),ks.set(n,t)),t}function ra(n){const t=Xn(n);return t.alternate||(t.alternate=qs(n)),t.alternate}function Ul(n,t,e=!0){t(ra(n)),ia(e)}function zn(n,t,e=!0){t(ra(n)),On("FLUSH_DOM_ACTION",()=>ia(e),50)}function B(n){return n*Math.PI/180}function at(n){return n*180/Math.PI}function Ls(n,t,e=0){return Math.sqrt(n*n+t*t+e*e)}function Rs(n,t,e,s){return Ls(e-n,s-t)}function Os(n,t,e,s){const i=e-n,r=s-t;return i*i+r*r}function se(n,t,e,s){let i=Math.atan2(s-t,e-n);return i<0&&(i+=Math.PI*2),i}function Nt(n,t){return{dx:Math.cos(n)*t,dy:Math.sin(n)*t}}function Yl(n,t,e){if(typeof e=="number"){const s=Math.sqrt(Math.pow(n,2)+Math.pow(t,2)+Math.pow(e,2));return{x:n/=s,y:t/=s,z:e/=s}}else{const s=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return{x:n/=s,y:t/=s}}}function Xl(n,t,e,s,i=10){if(Math.abs(e-n)<i&&Math.abs(s-t)<i)return"no";const r=at(se(n,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 aa=zl("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 zl(n,t=10){const e={},s=n.split(",");for(let i=0;i<s.length;i+=2){const r="&"+s[i+1]+";",a=parseInt(s[i],t);e[r]="&#"+a+";"}return e["\\xa0"]="&#160;",e}function ut(n,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)n=n.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return n}function Fs(n){let t,e;if(!n)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(n[t]);return t}function Gl(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function Vl(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const Ye={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 Ns{__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",ut("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 Gn{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Xe{__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(Ye);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=Ye[i].canvas}}__getStyleState(){const t={},e=Object.keys(Ye);for(let s=0,i=e.length;s<i;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,i=e.length;s<i;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];i.setAttribute(o,e[o])}return i}__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 i=Object.keys(Ye);for(let r=0;r<i.length;r++){const a=Ye[i[r]],o=this[i[r]];if(a.apply){if(o instanceof Gn){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,ut("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof Ns)e.setAttribute(a.apply,ut("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,ut("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(i[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 i=Object.keys(aa);for(let r=0,a=i.length;r<a;r++){const o=i[r],h=aa[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 i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}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(ut("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(ut("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(ut("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,i,r,a){this.__addTransform(ut("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:i,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(ut("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(ut("L {x} {y}",this.__currentPosition)):this.__addPathCommand(ut("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(ut("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:i,x:r,y:a}))}quadraticCurveTo(t,e,s,i){this.__currentPosition={x:s,y:i},this.__addPathCommand(ut("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:i}))}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,i,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===i||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,i-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)),y=this.normalize([h[0]+c[0],h[1]+c[1]]),b=r/Math.sin(d/2),w=t+b*y[0],_=e+b*y[1],S=[-h[1],h[0]],v=[c[1],-c[0]],x=function(E){const C=E[0];return E[1]>=0?Math.acos(C):-Math.acos(C)},p=x(S),g=x(v);this.lineTo(w+S[0]*r,_+S[1]*r),this.arc(w,_,r,p,g)}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,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],i=s.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&s.removeChild(i[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,i){if(t===0&&e===0&&s===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:i,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,i){const r=this.__createElement("linearGradient",{id:Fs(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Ns(r,this)}createRadialGradient(t,e,s,i,r,a){const o=this.__createElement("radialGradient",{id:Fs(this.__ids),cx:i+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new Ns(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,i){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":Gl(this.textAlign),"dominant-baseline":Vl(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(i),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,i,r,a){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===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(i),l=e+s*Math.sin(i),d=a?0:1;let y=0,b=r-i;b<0&&(b+=2*Math.PI),a?y=b>Math.PI?0:1:y=b>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(ut("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:y,sweepFlag:d,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=Fs(this.__ids),i=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",ut("url(#{id})",{id:s})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],s,i,r,a,o=0,h=0,c,l,d,y,b,w,_,S;if(t.length===3)s=t[1],i=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],i=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],i=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const v=this.__closestGroupOrSvg();this.__currentElement;const x="translate("+s+", "+i+")";if(e instanceof Xe){if(d=e.getSvg().cloneNode(!0),d.childNodes&&d.childNodes.length>1){for(y=d.childNodes[0];y.childNodes.length;)S=y.childNodes[0].getAttribute("id"),this.__ids[S]=S,this.__SVGdefs.appendChild(y.childNodes[0]);if(b=d.childNodes[1],b){const p=b.getAttribute("transform");let g;p?g=p+" "+x:g=x,b.setAttribute("transform",g),v.appendChild(b)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(w=this.__createElement("image"),w.setAttribute("width",r),w.setAttribute("height",a),w.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(_=this.__document.createElement("canvas"),_.width=r,_.height=a,_.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=_),w.setAttribute("transform",x),w.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),v.appendChild(w))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=Fs(this.__ids);let r;return s.setAttribute("id",i),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 Xe&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new Gn(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class Bs{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new Xe({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,i){return this.context.fillRect(t,e,s,i),this.customContext&&this.customContext.fillRect(t,e,s,i),this}fillText(t,e,s,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,i),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,i){return this.context.strokeText(t,e,s,i),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,i){return this.context.strokeRect(t,e,s,i),this.customContext&&this.customContext.strokeRect(t,e,s,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,s,i),this.customContext&&this.customContext.clearRect(t,e,s,i),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,i=0){return this.translate(s,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-i),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,i,r,a){return this.context.arc(t,e,s,i,r,a),this.customContext&&this.customContext.arc(t,e,s,i,r,a?-1:1),this.currentPath2D.arc(t,e,s,i,r,a),this}arcTo(t,e,s,i,r){return this.context.arcTo(t,e,s,i,r),this.customContext&&this.customContext.arcTo(t,e,s,i,r),this.currentPath2D.arcTo(t,e,s,i,r),this}ellipse(t,e,s,i,r,a,o,h){return this.context.ellipse(t,e,s,i,r,a,o,h),this.currentPath2D.ellipse(t,e,s,i,r,a,o,h),this}quadraticCurveTo(t,e,s,i){return this.context.quadraticCurveTo(t,e,s,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,i),this.currentPath2D.quadraticCurveTo(t,e,s,i),this}bezierCurveTo(t,e,s,i,r,a){return this.context.bezierCurveTo(t,e,s,i,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,i,r,a),this.currentPath2D.bezierCurveTo(t,e,s,i,r,a),this}rect(t,e,s,i){return this.context.rect(t,e,s,i),this.customContext&&this.customContext.rect(t,e,s,i),this.currentPath2D.rect(t,e,s,i),this}createLinearGradient(t,e,s,i,r){const a=this.context.createLinearGradient(t,e,s,i);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,i,r,a,o){const h=this.context.createRadialGradient(t,e,s,i,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],i=e[1];this.context.drawImage(t,s,i)}else if(e.length===4){const s=e[0],i=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,i,r,a)}else if(e.length===8){const s=e[0],i=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,i,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,i=this.canvas.height,r){return this.context.getImageData(t,e,s,i,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}}}let Us=class{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=se(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),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:i-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),i=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(i,r),y:Math.min(a,o),width:Math.max(i,r)-Math.min(i,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,i=t.toX,r=t.toY,a=this.toX-e,o=t.x-i;if(!a&&!o)return null;const h=(this.toY-s)/a,c=(t.y-r)/o;if(a){if(!o)return{x:i,y:h*(i-e)+s}}else return{x:e,y:c*(e-i)+r};const l=(-c*i+r+h*e-s)/(h-c),d=h*(l-e)+s;return isNaN(l)||isNaN(d)?null:{x:l,y:d}}};const oa=Us;class Vn extends Us{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,i,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,i,r,a,o,h,!this.sweepFlag)}convert(t,e,s,i,r,a,o,h,c){const l=o/180*Math.PI,d=(t-s)/2,y=(e-i)/2,b=Math.cos(l)*d+Math.sin(l)*y,w=-Math.sin(l)*d+Math.cos(l)*y,_=b*b/(r*r)+w*w/(a*a);if(_>1){const Q=Math.sqrt(_);throw r=Q*r,a=Q*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const S=Math.sqrt((r*r*a*a-r*r*w*w-a*a*b*b)/(r*r*w*w+a*a*b*b)),v=h!=c?1:-1,x=v*S*r*w/a,p=v*S*-a*b/r,g=(t+s)/2,E=(e+i)/2,C=Math.cos(l)*x-Math.sin(l)*p+g,F=Math.sin(l)*x+Math.cos(l)*p+E,G=(Q,ht,Et,xt)=>(Q*xt>=ht*Et?1:-1)*Math.acos((Q*Et+ht*xt)/(Math.sqrt(Q*Q+ht*ht)*Math.sqrt(Et*Et+xt*xt))),V=G(1,0,t-C,e-F)-l,K=G(t-C,e-F,s-C,i-F);return[C,F,r,a,l,V,V+K]}}class ql extends Us{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,i,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,i=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=-i/(2*s),0<a&&a<1&&[t,e][c].push(s*a*a+i*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 jl=ql;class yt extends Us{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,i=(-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(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),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,i=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),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 w=0;w<d;w++){for(let _=w+1;_<d;_++)c[w].X===c[_].X&&c[w].Y===c[_].Y&&(_=++w);l.push({X:c[w].X,Y:c[w].Y})}const y={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},b={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:y.x,y:y.y,width:b.x-y.x,height:b.y-y.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,i,r){const a=-3*e+9*s-9*i+3*r,o=t*a+6*e-12*s+6*i;return t*o-3*e+3*s}static bezlen(t,e,s,i,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],y=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let b=0;for(let w=0;w<12;w++){const _=l*d[w]+l,S=this.base3(_,t,s,r,o),v=this.base3(_,e,i,a,h);b+=y[w]*Math.sqrt(S*S+v*v)}return l*b}length(t=1){return yt.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,i=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.toX,c=this.toY;if(t<0||yt.bezlen(e,s,i,r,a,o,h,c)<t)return 0;let l=1,d=l/2,y=l-d,b=yt.bezlen(e,s,i,r,a,o,h,c,y);for(;Math.abs(b-t)>.01;)d/=2,y+=(b<t?1:-1)*d,b=yt.bezlen(e,s,i,r,a,o,h,c,y);return y}getPointAtSegmentLength(t){const e=this.getTatLen(t);let s=1-e,i=Math.pow(s,3),r=Math.pow(s,2),a=e*e,o=a*e,h=i*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+o*this.toX,c=i*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),y=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),b=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),w=s*this.x+e*this.c1x,_=s*this.y+e*this.c1y,S=s*this.c2x+e*this.toX,v=s*this.c2y+e*this.toY,x=90-Math.atan2(l-y,d-b)*180/Math.PI;return{x:h,y:c,m:{x:l,y:d},n:{x:y,y:b},start:{x:w,y:_},end:{x:S,y:v},alpha:x}}}const ze=Math.PI*2;function ha(n,t,e,s){const i=n*s-t*e<0?-1:1;let r=n*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function Hl(n,t,e,s,i,r,a,o,h,c){const l=c*(n-e)/2+h*(t-s)/2,d=-h*(n-e)/2+c*(t-s)/2,y=a*a,b=o*o,w=l*l,_=d*d;let S=y*b-y*_-b*w;S<0&&(S=0),S/=y*_+b*w,S=Math.sqrt(S)*(i===r?-1:1);const v=S*a/o*d,x=S*-o/a*l,p=c*v-h*x+(n+e)/2,g=h*v+c*x+(t+s)/2,E=(l-v)/a,C=(d-x)/o,F=(-l-v)/a,G=(-d-x)/o,V=ha(1,0,E,C);let K=ha(E,C,F,G);return r===0&&K>0&&(K-=ze),r===1&&K<0&&(K+=ze),[p,g,V,K]}function $l(n,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(n),i=Math.sin(n),r=Math.cos(n+t),a=Math.sin(n+t);return[s,i,s-i*e,i+s*e,r+a*e,a-r*e,r,a]}function ca(n,t,e,s,i,r,a,o,h){const c=Math.sin(h*ze/360),l=Math.cos(h*ze/360),d=l*(n-e)/2+c*(t-s)/2,y=-c*(n-e)/2+l*(t-s)/2;if(d===0&&y===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const b=d*d/(a*a)+y*y/(o*o);b>1&&(a*=Math.sqrt(b),o*=Math.sqrt(b));const w=Hl(n,t,e,s,i,r,a,o,c,l),_=[];let S=w[2],v=w[3];const x=Math.max(Math.ceil(Math.abs(v)/(ze/4)),1);v/=x;for(let p=0;p<x;p++)_.push($l(S,v)),S+=v;return _.map(p=>{for(let g=0;g<p.length;g+=2){let E=p[g+0],C=p[g+1];E*=a,C*=o;const F=l*E-c*C,G=c*E+l*C;p[g+0]=F+w[0],p[g+1]=G+w[1]}return p})}function qn(n,t,e,s,i,r){return[n/3+.6666666666666666*e,t/3+.6666666666666666*s,i/3+.6666666666666666*e,r/3+.6666666666666666*s,i,r]}function Ge(n,t,e,s){return[n,t,e,s,e,s]}const Ve={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class pe{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&ne(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||Oi()})}static downloadFromSVGElement(t,e="shape"){return fi(Nr(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return fi(cn(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return En(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 pe.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,i,r)=>{let a=i.toLowerCase();const o=Gi(r);for(a=="m"&&o.length>Ve[a]&&(e.push([i,...o.splice(0,Ve[a])]),a="l",i=i=="m"?"l":"L");o.length;){if(o.length<Ve[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${i} } args:{ ${o} }`);e.push([i,...o.splice(0,Ve[a])])}return a=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,i=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]+=i,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=i;break;default:for(let c=1;c<a.length;)a[c++]+=i,a[c++]+=r}switch(h){case"Z":i=e,r=s;break;case"H":i=a[1];break;case"V":r=a[1];break;case"M":i=e=a[1],r=s=a[2];break;default:i=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,i=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]-=i,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=i;break;default:for(let c=1;c<a.length;)a[c++]-=i,a[c++]-=r}switch(h){case"z":i=e,r=s;break;case"h":i+=a[1];break;case"v":r+=a[1];break;case"m":i+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:i+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){const e=[];let s=0,i=0,r=0,a=0,o=0,h=0,c=0,l=0,d;for(let y=0,b=t.length;y<b;y++){let w=t[y];const _=w[0];switch(_){case"M":s=w[1],i=w[2];break;case"A":const S=ca(r,a,w[6],w[7],w[4],w[5],w[1],w[2],w[3]);if(!S.length)continue;S.forEach((p,g)=>{const[E,C,F,G,V,K,Q,ht]=p;w=["C",F,G,V,K,Q,ht],g<S.length-1&&e.push(w)});break;case"S":let v=r,x=a;(d=="C"||d=="S")&&(v+=v-c,x+=x-l),w=["C",v,x,w[1],w[2],w[3],w[4]];break;case"T":d=="Q"||d=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),w=["C",...qn(r,a,o,h,w[1],w[2])];break;case"Q":o=w[1],h=w[2],w=["C",...qn(r,a,w[1],w[2],w[3],w[4])];break;case"L":w=["C",...Ge(r,a,w[1],w[2])];break;case"H":w=["C",...Ge(r,a,w[1],a)];break;case"V":w=["C",...Ge(r,a,r,w[1])];break;case"Z":w=["C",...Ge(r,a,s,i)];break}d=_,r=w[w.length-2],a=w[w.length-1],w.length>4?(c=w[w.length-4],l=w[w.length-3]):(c=r,l=a),e.push(w)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,i=t.length;i-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]}]:i-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],i;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":i=e[e.length-1]||["L",0,0],e.push(["L",o[1],i[i.length-1]]);break;case"V":i=e[e.length-1]||["L",0,0],e.push(["L",i[i.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,i=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?(i=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(i=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,i,r)),s=h}return t}}const vt=pe;class St{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(vt.parseSVGPath(t),e):t instanceof St?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=vt.normalizeSVGPath(vt.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let i=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];if(o[0]=="M"){i||(i=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2];continue}this.appendLine(new yt({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 St;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,i=t.length;s+5<i;s+=6)e.appendLine(new yt({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 St;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,i=t.length;s<i;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof Vn){ca(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,d,y,b,w,_,S,v]=c;this.normalizedLines.push(new yt({x:this.prevPathX,y:this.prevPathY,c1x:y,c1y:b,c2x:w,c2y:_,toX:S,toY:v})),this.prevPathX=S,this.prevPathY=v});return}let e,s,i,r,a,o;t instanceof yt?(e=t.c1x,s=t.c1y,i=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof jl?[e,s,i,r,a,o]=qn(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,a,o]=Ge(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new yt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:i,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),i=[];i.push(["M",t,e]);for(let r=0,a=s.length;r<a;r++)i.push(...s[r].toSVGPathData());return i}toSVGPathD(){return vt.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform();t.beginPath(),t.moveTo(e,s),i.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 i=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:i,y:r,width:a-i,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 ft;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 i=[];return this.normalizedLines.forEach(r=>{let a=r.x,o=r.y,h=r.c1x,c=r.c1y,l=r.c2x,d=r.c2y,y=r.toX,b=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:y,y:b}=t.transformPoint({x:y,y:b}),i.push(new yt({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:d,toX:y,toY:b}))}),{startPathX:e,startPathY:s,normalizedLines:i}}}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 i=e.length;for(let r=0;r<i;r++){const a=e[r],o=a.length();if(s+o>=t)return a.getPointAtSegmentLength(t-s);s+=o}return e[i-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform(),r=i.length;if(r===0)return{x:e,y:s};if(r===1)return i[0].interpolate(t);{let a=t*r,o=i[0];if(a--,a>1)for(let h=1;h<r&&(o=i[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:i,startPathY:r,normalizedLines:a}=t.updateTransform();let o=null,h=0;const c=new St;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let l=0,d=a.length;l<d;l++){const y=a[l],b=y.length();if(h+b>e&&!o){const w=y.getPointAtSegmentLength(e-h);if(c.appendLine(new yt({c1x:w.start.x,c1y:w.start.y,c2x:w.m.x,c2y:w.m.y,toX:w.x,toY:w.y})),s)return c;o=c,c.appendLine(new yt({c1x:w.n.x,c1y:w.n.y,c2x:w.end.x,c2y:w.end.y,toX:y.x,toY:y.y})),h+=b;continue}h+=b,c.appendLine(y)}return c}closestPoint(t,e){const s=this.getTotalLength();let i={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=Os(l.x,l.y,t,e);d<a&&(i=l,r=c,a=d)}for(o/=2;o>.5;){let c=r-o,l=this.getPointAtLength(c),d=Os(l.x,l.y,t,e),y=r+o,b=this.getPointAtLength(y),w=Os(b.x,b.y,t,e);c>=0&&d<a?(i=l,r=c,a=d):y<=s&&w<a?(i=b,r=y,a=w):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?se(h.x,h.y,i.x,i.y):se(i.x,i.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((i,r)=>i.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],i=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=Rs(t[a],t[a+1],s,i),s=t[a],i=t[a+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let i=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++],y=e[o++],b=e[o++];a.push(["C",h,c,l,d,y,b]);let w=0;for(;w<r&&i>0;)a.push(["C",y,b,y,b,y,b]),i-=6,w++}return a}static mixPoints(t,e,s){const i=t.length,r=new Array(i);for(let a=0;a<i;a++)r[a]=Ot(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:St.fromPolymorphPoints(St.mixPoints(new St({d:t}).polymorphPoints,new St({d:e}).polymorphPoints,s)).toSVGPathData()}}const Wl=St;class j extends cs{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=Oi(),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=Gi(s).reduce((i,r)=>i+r,0)}return ji(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new St,gt(()=>{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 i=s.originMatrix?s.originMatrix.clone():new ft;i.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new ft;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof Bs)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(i);{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 Bs)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}clone(){return Oo(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,i])=>[ct(s),i]))):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 Rs(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=at(se(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:i}=Nt(B(this.degree),e);this.vx=s,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:i}=Nt(B(this.degree),e);this.ax=s,this.ay=i,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,i=e*e+s*s,r=Math.sqrt(i),a=this.mass*t.mass/i,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=Kt(t?.gravity,0);this.vy+=e;const s=Kt(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=Kt(e?.easing,.05),i=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=i*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=Kt(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.cX-this.x,a=i.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=Kt(e?.springLength,100),i=Kt(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*i,c=a*i;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(),i=Ot(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${i} ${i}`,strokeDashoffset:`${i}`});const r=e?.onUpdate,a=new Ms({frameDuration:t});a.addTween({offset:i},{offset:0},Object.assign(e||{},{onUpdate:(o,h)=>{this.setAttr("strokeDashoffset",""+Ot(o.offset,2)),r?.(o,h)}})),a.play()}}class qe extends j{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}=Mt(B(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Mt(B(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Mt(B(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 Ls(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,i=t.z-this.z;return Math.sqrt(e*e+s*s+i*i)}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,i=this.z;return{x:s*t.z-i*t.y,y:i*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 la=[1,0,0,1,0,0],ua=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class ft{value;_m13=0;_m23=0;_m33=1;matrix3d;constructor(t=la){this.value=Array.from(t),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D()}static fromString(t){const e=new ft,s=Li("number",t);return s.length===6&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.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 wt(e)}identity(){return this.value=Array.from(la),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 ft([...this.value])}multiply(t){const e=this.clone(),s=t instanceof ft?t:new ft(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,i=this.m21,r=this.m22,a=this.m23,o=this.m31,h=this.m32,c=this.m33,l=c*r-a*h,d=-c*i+a*o,y=h*i-r*o;let b=t*l+e*d+s*y;return b?(b=1/b,this.m11=l*b,this.m12=(-c*e+s*h)*b,this.m13=(a*e-s*r)*b,this.m21=d*b,this.m22=(c*t-s*o)*b,this.m23=(-a*t+s*i)*b,this.m31=y*b,this.m32=(-h*t+e*o)*b,this.m33=(r*t-e*i)*b,this):null}adjugate(){const t=new ft;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=at(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:at(Math.atan2(-this.m21,this.m22)),skewY:at(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],i=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],y=t.value[4],b=t.value[5],w=h*d,_=c*l,S=(l*s-e*d)/(_-w),v=(h*s-e*c)/(w-_),x=(l*r-i*d)/(_-w),p=(h*r-i*c)/(w-_),g=(l*(o-b)+d*(y-a))/(_-w),E=(h*(o-b)+c*(y-a))/(w-_),C=[S,v,x,p,g,E];return new ft(C)}toString(t=6){return this.matrix3d.is2D()?`matrix(${this.value.map(e=>Ot(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 i=B(t),r=Math.cos(i),a=Math.sin(i);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:i}=this.split();return this.rotate(t-i,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:i,degreeY:r,degreeZ:a}=this.matrix3d.split();return this.rotate3d(t-i,e-r,s-a),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.multiply([t,0,0,e,0,0]),this.translate(-s,-i),this.toMatrix3D(),this}scaleTo(t,e=t,s=0,i=0){return this.scale(t/this.m11,e/this.m22,s,i)}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:i,scalarY:r,scalarZ:a}=this.matrix3d.split();return this.scale3d(t/i,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(B(e)),Math.sin(B(e)),-Math.sin(B(t)),Math.cos(B(t)),0,0]),this.toMatrix3D(),this}skewTo(t,e=t){const{skewX:s,skewY:i}=this.split();return this.skew(t-s,e-i)}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 wt{value;is3dSpecial=!1;constructor(t=ua){this.value=Array.from(t)}static fromString(t){const e=new wt,s=Li("number",t);return s.length===16&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.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(ua),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 wt([...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:i,skewY:r,x:a,y:o}=this.split(),h=[e,r,i,s,a,o];return t?(t.value=h,t):new ft(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=>Ot(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),i=at(H(Math.asin(-this.m13),-1,1));let r=at(Math.atan2(this.m23,this.m33));Math.cos(B(i))===0&&(r=at(Math.atan2(-this.m31,this.m22)));let a=at(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:i,degreeZ:a,skewX:at(this.m14),skewY:at(this.m24),skewZ:at(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}inverse(){const t=[],e=this.m11,s=this.m12,i=this.m13,r=this.m14,a=this.m21,o=this.m22,h=this.m23,c=this.m24,l=this.m31,d=this.m32,y=this.m33,b=this.m34,w=this.m41,_=this.m42,S=this.m43,v=this.m44;t[0]=h*b*_-c*y*_+c*d*S-o*b*S-h*d*v+o*y*v,t[1]=r*y*_-i*b*_-r*d*S+s*b*S+i*d*v-s*y*v,t[2]=i*c*_-r*h*_+r*o*S-s*c*S-i*o*v+s*h*v,t[3]=r*h*d-i*c*d-r*o*y+s*c*y+i*o*b-s*h*b;const x=e*t[0]+a*t[1]+l*t[2]+w*t[3];if(x==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=c*y*w-h*b*w-c*l*S+a*b*S+h*l*v-a*y*v,t[5]=i*b*w-r*y*w+r*l*S-e*b*S-i*l*v+e*y*v,t[6]=r*h*w-i*c*w-r*a*S+e*c*S+i*a*v-e*h*v,t[7]=i*c*l-r*h*l+r*a*y-e*c*y-i*a*b+e*h*b,t[8]=o*b*w-c*d*w+c*l*_-a*b*_-o*l*v+a*d*v,t[9]=r*d*w-s*b*w-r*l*_+e*b*_+s*l*v-e*d*v,t[10]=s*c*w-r*o*w+r*a*_-e*c*_-s*a*v+e*o*v,t[11]=r*o*l-s*c*l-r*a*d+e*c*d+s*a*b-e*o*b,t[12]=h*d*w-o*y*w-h*l*_+a*y*_+o*l*S-a*d*S,t[13]=s*y*w-i*d*w+i*l*_-e*y*_-s*l*S+e*d*S,t[14]=i*o*w-s*h*w-i*a*_+e*h*_+s*a*S-e*o*S,t[15]=s*h*l-i*o*l+i*a*d-e*h*d-s*a*y+e*o*y,this.value=t,this.scalar(1/x)}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 wt([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 wt([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}rotateX(t){const e=B(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new wt([1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1]))}rotateY(t){const e=B(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new wt([s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=B(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new wt([s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new wt([1,0,0,B(t),0,1,0,B(e),0,0,1,B(s),0,0,0,1]))}perspective(t){return this.multiply(new wt([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,i=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=i+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,i/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-i;if(l==0)return{x:e,y:s,z:i,mass:r};const d=-i/l;return e+=d*(a-e),s+=d*(o-s),{x:e,y:s,z:i,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,i=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,i/=r,r<0&&(s-=this.m41,i-=this.m42,s*=1/r,i*=1/r,s+=this.m41,i+=this.m42),{x:s,y:i,z:e,mass:r}}bounds(t,e,s,i){const r=new qe({x:t,y:e}),a=new qe({x:t+s,y:e}),o=new qe({x:t+s,y:e+i}),h=new qe({x:t,y:e+i});({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,y=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:d,height:y}}}function jn(n){const t=new ft;return n.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let a=0,o=i.length;a<o;a++)i[a].trim()&&r.push(parseFloat(""+i[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 wt(r)),t.matrix3d.toMatrix(t);break}return""}),t}function Mt(n,t,e){const s=new ft;return s.rotate(at(n)),s.transformPoint({x:t,y:e})}function Hn(n){const t=typeof n?.x=="number"?n?.x:0,e=typeof n?.y=="number"?n?.y:0,s=typeof n?.degree=="number"?n?.degree:0,i=typeof n?.scalarX=="number"?n?.scalarX:1,r=typeof n?.scalarY=="number"?n?.scalarY:1,a=B(s),o=Math.cos(a),h=Math.sin(a),c=new DOMMatrix([o*i,h*i,-h*r,o*r,t,e]);return c.multiplySelf(new DOMMatrix(n?.originMatrix||"")),c}function Jl(n,t){const e=new Path2D(n),s=new Path2D;return s.addPath(e,Hn(t)),s}function fa(n,t){const e={x:t.m11,y:t.m12,z:t.m13},s={x:t.m21,y:t.m22,z:t.m23},i={x:t.m31,y:t.m32,z:t.m33},r=n.transformPoint(e),a=n.transformPoint(s),o=n.transformPoint(i),h=new ft;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 da(n,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},i={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=n.transformPoint(e),o=n.transformPoint(s),h=n.transformPoint(i),c=n.transformPoint(r);return new wt([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 Zl(n){let t=n[0];for(let e=1,s=n.length;e<s;e++)t=fa(t,n[e]);return t}function Kl(n){let t=n[0];for(let e=1,s=n.length;e<s;e++)t=da(t,n[e]);return t}function ge(n,t,e){const s=Xn(n);return s.props.style=s.props.style||{},t?s.props.style[t]||s.props.style[Fi(t)]||s.props.style[ct(t)]||"":s.props.style}function $n(n,t,e){zn(n,s=>{s.props.style=s.props.style||{},typeof t=="string"&&e?s.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(i=>{s.props.style[i]=t[i]})},!0)}function Wn(n){const t={};if(getComputedStyle){const e=getComputedStyle(n);for(let s=0,i=e.length;s<i;s++)t[e[s]]=e.getPropertyValue(t[s])}else{const e=n.currentStyle;for(const s in e)t[s]=e[s]}return n.style.cssText&&n.style.cssText.split(";").filter(e=>!!e).forEach(e=>{const[s,i]=e.split(":");s&&i&&(t[s.trim()]=i.trim())}),t}function Ql(n,t,e){if(getComputedStyle){t=ct(t);const s=getComputedStyle(n,e),i=s.getPropertyPriority(t);return s.getPropertyValue(t).trim()+(i?"!"+i:"")}else return n.currentStyle[t]}function Ys(n,t,e){typeof t=="string"&&e?n.style.setProperty(ct(t),e.replace(/!important/i,""),String(e).toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(s=>{Ys(n,s,t[s])})}function Jn(n,t){typeof t=="string"?n.style.removeProperty(ct(t)):Object.keys(t).forEach(e=>{Jn(n,e)})}function ma(n,t){let e;if(typeof t=="string"){const i=document.querySelector(t)?.shadowRoot;i?e=i:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];const s=document.createElement("style");if(s.innerHTML=n,e)return e.appendChild(s),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(s)};{const i=document.styleSheets[0].insertRule(n);return()=>{document.styleSheets[0].deleteRule(i)}}}function tu(n,t,e={}){Object.prototype.hasOwnProperty.call(e,"transform")||Object.assign(e,{transform:ge(n,"transform")||""});const s=jn(e.transform),i={};for(const r in t){const a=t[r];switch(r){case"transform":break;case"translate":s.translate(a[0]||0,a[1]||0);break;case"translateTo":s.translateTo(a[0]||0,a[1]||0);break;case"translateX":s.translateX(a||0);break;case"translateXTo":s.translateXTo(a||0);break;case"translateY":s.translateY(a||0);break;case"translateYTo":s.translateYTo(a||0);break;case"translateZ":s.translateZ(a||0);break;case"translateZTo":s.translateZTo(a||0);break;case"translate3d":s.translate3d(a[0]||0,a[1]||0,a[2]||0);break;case"translate3dTo":s.translate3dTo(a[0]||0,a[1]||0,a[2]||0);break;case"rotate":typeof a=="number"?s.rotate(a||0):s.rotate(a[0]||0,a[1]||0,a[2]||0);break;case"rotateTo":typeof a=="number"?s.rotateTo(a||0):s.rotateTo(a[0]||0,a[1]||0,a[2]||0);break;case"rotateX":s.rotateX(a||0);break;case"rotateXTo":s.rotateXTo(a||0);break;case"rotateY":s.rotateY(a||0);break;case"rotateYTo":s.rotateYTo(a||0);break;case"rotateZ":s.rotateZ(a||0);break;case"rotateZTo":s.rotateZTo(a||0);break;case"rotate3d":s.rotate3d(a[0]||0,a[1]||0,a[2]||0);break;case"rotate3dTo":s.rotate3dTo(a[0]||0,a[1]||0,a[2]||0);break;case"scale":typeof a=="number"?s.scale(a||1):s.scale(a[0]||1,a[1]||1,a[2]||0,a[3]||0);break;case"scaleTo":typeof a=="number"?s.scaleTo(a||1):s.scaleTo(a[0]||1,a[1]||1,a[2]||0,a[3]||0);break;case"scaleX":s.scaleX(a||1);break;case"scaleXTo":s.scaleXTo(a||1);break;case"scaleY":s.scaleY(a||1);break;case"scaleYTo":s.scaleYTo(a||1);break;case"scaleZ":s.scaleZ(a||1);break;case"scaleZTo":s.scaleZTo(a||1);break;case"scale3d":typeof a=="number"?s.scale3d(a||1):s.scale3d(a[0]||1,a[1]||1,a[2]||1);break;case"scale3dTo":typeof a=="number"?s.scale3dTo(a||1):s.scale3dTo(a[0]||1,a[1]||1,a[2]||1);break;case"skew":typeof a=="number"?s.skew(a||0):s.skew(a[0]||0,a[1]||0);break;case"skewTo":typeof a=="number"?s.skewTo(a||0):s.skewTo(a[0]||0,a[1]||0);break;case"skewX":s.skewX(a||0);break;case"skewXTo":s.skewXTo(a||0);break;case"skewY":s.skewY(a||0);break;case"skewYTo":s.skewYTo(a||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":s.perspective(a||0);break;default:Object.prototype.hasOwnProperty.call(e,r)||(e[r]=ge(n,r)),Object.assign(i,{[r]:`${a}`});break}}return Object.assign(i,{transform:s.toString()}),i}function ne(n,t,e){if(t===void 0&&e===void 0)return Zn(n);if(typeof t=="string"&&e===void 0)return pa(n,t);let s={};typeof t=="object"?s=t:typeof t=="string"&&typeof e=="string"&&(s[t]=""+e),zn(n,i=>{Object.entries(s).forEach(([r,a])=>{i.props[r]=""+a})})}const eu=["-o-","-ms-","-moz-","-webkit-",""];function Zn(n){const t={};for(let e=0,s=n.attributes,i=s.length;e<i;e++){const r=s[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=Wn(n):t[r.nodeName]=r.nodeValue)}return t}function pa(n,t){return t==="style"?Wn(n):n.getAttribute(ct(t))}function Xs(n,t,e){return n.setAttribute(ct(t),""+e)}function su(n,t){t.split(/[,\s]+/i).forEach(e=>{const s=ct(e.trim());s!=""&&n.removeAttribute(s)})}function nu(n,t){Xs(n,"draggable","true");const e=[];return e.push(Z(n,"dragstart",s=>{Qt(s),Xr(s);const i=s.dataTransfer;i&&(i.effectAllowed="move",i.setData("text/plain","some-data")),t?.onStart?.(s)},!0)),e.push(Z(n,"drag",s=>{Qt(s),t?.onDrag?.(s)})),e.push(Z(n,"dragend",s=>{Qt(s),t?.onEnd?.(s)})),()=>{e.forEach(s=>s())}}function iu(n,t){const e=[];return e.push(Z(n,"dragenter",s=>{Qt(s),t?.onEnter?.(s)})),e.push(Z(n,"dragover",s=>{Qt(s);const i=s.dataTransfer;i&&(i.dropEffect="move"),t?.onOver?.(s)})),e.push(Z(n,"dragleave",s=>{Qt(s),t?.onLeave?.(s)})),e.push(Z(n,"drop",s=>{Qt(s);const i=s.dataTransfer;if(!i){t?.onDrop?.(s,[]);return}t?.onDrop?.(s,[...i.files])})),()=>{e.forEach(s=>s())}}function ga(n="(prefers-color-scheme: dark)"){const t=window.matchMedia(n),e=us(t.matches);return Z(t,"change",s=>{e.value=s.matches}),e}const ie=Yr("__theme__");if(!ie.value){const n=ga("(prefers-color-scheme: dark)");ie.value=n.value?"dark":"light"}const ya=()=>{switch(ie.value){case"dark":document.documentElement.classList.add("dark");break;default:document.documentElement.classList.remove("dark");break}};gt(()=>{ya()}),setTimeout(ya);function ru(n){return n&&(ie.value=n),ie}function au(){return ie.value=ie.value=="light"?"dark":"light",ie}const z=te();let wa="";new MutationObserver((n,t)=>{location.href!==wa&&(wa=location.href,z.emit("urlchange",location.href))}).observe(document,{attributes:!0,childList:!0,subtree:!0}),Z(window,"hashchange",()=>{z.emit("hashchange",location.hash)}),Z(window,"popstate",n=>{z.emit("popstate",n.state)}),Z(window,"orientationchange"in window?"orientationchange":"resize",n=>{const t=n.target.innerWidth,e=n.target.innerHeight;z.emit("windowresize",t,e)}),Z(window,"load",n=>{z.emit("load",n)}),Z(window,"beforeunload",n=>{z.emit("beforeunload",n)}),Z(window,"pagehide",n=>{z.emit("pagehide",n)}),Z(window,"focus",n=>{z.emit("focus",n)}),Z(window,"blur",n=>{z.emit("blur",n)}),Z(window,"visibilitychange",n=>{document.hidden?z.emit("windowhidden",n):z.emit("windowvisible",n)});const ye={getSelectedText:()=>window.getSelection()?.toString()||"",isTabInView:()=>!document.hidden,onurlchange:n=>(z.on("urlchange",n),()=>{z.off("urlchange",n)}),onhashchange:n=>(z.on("hashchange",n),()=>{z.off("hashchange",n)}),onpopstate:n=>(z.on("popstate",n),()=>{z.off("popstate",n)}),pushstate:(n,t=null)=>{history.pushState(t,"",n)},replacestate:(n,t=null)=>{history.replaceState(t,"",n)},onwindowresize:n=>(z.on("windowresize",n),()=>{z.off("windowresize",n)}),onload:n=>{const t=Zo(n);return z.on("load",t),()=>{z.off("load",t)}},onbeforeunload:n=>(z.on("beforeunload",n),()=>{z.off("beforeunload",n)}),onpagehide:n=>(z.on("pagehide",n),()=>{z.off("pagehide",n)}),onfocus:n=>(z.on("focus",n),()=>{z.off("focus",n)}),onblur:n=>(z.on("blur",n),()=>{z.off("blur",n)}),onwindowvisible:n=>(z.on("windowvisible",n),()=>{z.off("windowvisible",n)}),onwindowhidden:n=>(z.on("windowhidden",n),()=>{z.off("windowhidden",n)})};function ou(n){let t=!1,e;function s(){if(document.readyState!=="loading"){if(t){try{document.removeEventListener("DOMContentLoaded",s,!1)}catch{e?.()}return}t=!0;try{document.removeEventListener("DOMContentLoaded",s,!1)}catch{e?.()}n()}}try{document.addEventListener("DOMContentLoaded",s,!1)}catch{e=ye.onload(s)}s()}function hu(n){document.getElementsByTagName("title")[0].innerText=n,document.title=n}let xa=!1;function zs(){xa||(xa=!0,ma(`
16
16
  /* iOS > 11.2 */
17
17
  /* 注意:--xxx:后面不要有空格 */
18
18
  :root {
@@ -27,24 +27,24 @@ var ZYZGroupCoreWeb=function(d){"use strict";var Ai=typeof document<"u"?document
27
27
  --sab:env(safe-area-inset-bottom, 0px);
28
28
  --sal:env(safe-area-inset-left, 0px);
29
29
  }
30
- `))}const ie=Qt(),$l={onTop:n=>(zs(),setTimeout(()=>{const t=getComputedStyle(document.documentElement);ie.emit("top",t.getPropertyValue("--sat"))},1),ie.on("top",n)),onRight:n=>(zs(),setTimeout(()=>{const t=getComputedStyle(document.documentElement);ie.emit("right",t.getPropertyValue("--sar"))},1),ie.on("right",n)),onBottom:n=>(zs(),setTimeout(()=>{const t=getComputedStyle(document.documentElement);ie.emit("bottom",t.getPropertyValue("--sab"))},1),ie.on("bottom",n)),onLeft:n=>(zs(),setTimeout(()=>{const t=getComputedStyle(document.documentElement);ie.emit("left",t.getPropertyValue("--sal"))},1),ie.on("left",n))};function Wl(n){return _e.onpopstate(()=>{const{pathname:t,search:e}=location;n[t]?.()}),{goto:_e.pushstate,replace:_e.replacestate}}function Jl(){const n=Qt();return{destroy:ht(document,"scroll",t=>{n.emit("scroll",t)}),on:t=>(n.on("scroll",t),()=>{n.off("scroll",t)})}}function Zl(){return ht(document,"touchmove",n=>{n.preventDefault()})}function Kl(n,t){window.scrollTo(n,t)}function Ql(){let n=Xi,t=Xi;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",n=_e.onbeforeunload(()=>{window.history.scrollRestoration="auto"}),t=_e.onload(()=>{window.history.scrollRestoration="manual"})),()=>{n(),t()}}function ya(n){const t=Qt(),e=new ResizeObserver(s=>{const i=s[0],{width:r,height:a}=i.contentRect;t.emit("resize",r,a)});return e.observe(n),{on:s=>(t.on("resize",s),()=>{t.off("resize",s)}),destroy:()=>{e.unobserve(n)}}}function tu(n,t=.5,e){const s=Qt();let i;const r=new IntersectionObserver((a,o)=>{let h=a[0];if(a.length>1){const l=a.find(f=>f.isIntersecting);l&&(h=l)}const c=h.isIntersecting&&h.intersectionRatio>=t;i!==c&&(c?s.emit("show"):s.emit("hide"),i=c)},{threshold:t,root:e});return r.observe(n),{onshow:a=>(s.on("show",a),()=>{s.off("show",a)}),onhide:a=>(s.on("hide",a),()=>{s.off("hide",a)}),destroy:()=>{r.unobserve(n)}}}function eu(n){const t=Qt(),e=new MutationObserver((s,i)=>{t.emit("mutation",s,i)});return e.observe(n,{attributes:!0,childList:!0,subtree:!0}),{on:s=>(t.on("mutation",s),()=>{t.off("mutation",s)}),destroy:()=>{e.disconnect()}}}function su(n,t,e,s,i){const r=t/e;let a=0,o=0;switch(n){case"aspectFit":r>=1?(a=s,o=a/r,o>i&&(o=i,a=o*r)):(o=i,a=o*r,a>s&&(a=s,o=a/r));break;case"aspectFill":r>=1?(o=i,a=o*r):(a=s,o=a/r);break;case"widthFix":a=s,o=a/r;break;case"heightFix":o=i,a=o*r;break;case"scaleToFill":default:a=s,o=i;break}return{width:a,height:o}}function wa(n){try{const t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)}catch{return new ImageData(n.width,n.height)}}const nu=n=>{const t=n.width,e=n.height,s=t*e*3,i=s+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>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=n.data;let c="";const l=t<<2;let f=e;const y=String.fromCharCode;do{const w=l*(f-1);let _="";for(let S=0;S<t;S++){const v=S<<2;_+=y(h[w+v+2])+y(h[w+v+1])+y(h[w+v])}for(let S=0;S<o;S++)_+=String.fromCharCode(0);c+=_}while(--f);function b(w){if(!window.btoa)throw"btoa undefined";let _="";if(typeof w=="string")_=w;else for(let S=0;S<w.length;S++)_+=String.fromCharCode(w[S]);return btoa(_)}return b(r.concat(a))+b(c)},iu=n=>{const{width:t,height:e}=n,s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.putImageData(n,0,0,0,0,t,e),s.toDataURL("image/png")},ru=(n,t,e)=>{const{width:s,height:i}=n,r=document.createElement("canvas"),a=r.getContext("2d");r.width=s,r.height=i,a.putImageData(n,0,0,0,0,s,i);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)};function au(n,t){return createImageBitmap(n,t)}function ou(n){const t=[],e=[],s=[];let i=0;for(let h=0,c=n.data.length;h<c;h+=4)t[i]=n.data[h],e[i]=n.data[h+1],s[i]=n.data[h+2],i+=1;const r=Zn(t),a=Zn(e),o=Zn(s);return"rgb("+r+","+a+","+o+")"}function Zn(n){const t={},e=[],s=[];for(let o=0;o<n.length;o++)t[n[o]]?e.push(n[o]):t[n[o]]=1;let i=0;for(let o=0;o<e.length;o++){i=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(i+=1),s[o]=i}const r=Math.max.apply(null,s);let a=0;for(;a<s.length;a++)if(s[a]===r)return;return e[a]}const hu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[(a*e+e-o-1)*4],i[h+1]=t[(a*e+e-o-1)*4+1],i[h+2]=t[(a*e+e-o-1)*4+2],i[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(i,e,s)},cu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[((s-a-1)*e+o)*4],i[h+1]=t[((s-a-1)*e+o)*4+1],i[h+2]=t[((s-a-1)*e+o)*4+2],i[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(i,e,s)},lu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;i[h]=t[(o*e+e-a-1)*4],i[h+1]=t[(o*e+e-a-1)*4+1],i[h+2]=t[(o*e+e-a-1)*4+2],i[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(i,s,e)},uu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;i[h]=t[((s-o-1)*e+a)*4],i[h+1]=t[((s-o-1)*e+a)*4+1],i[h+2]=t[((s-o-1)*e+a)*4+2],i[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(i,s,e)},fu=n=>{const{data:t,width:e,height:s}=n,i=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;i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},du=n=>{const{data:t,width:e,height:s}=n,i=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];i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},mu=n=>{const{data:t,width:e,height:s}=n,i=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;i[h]=l,i[h+1]=l,i[h+2]=l,i[h+3]=t[h+3]}return new ImageData(i,e,s)},pu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=255-t[h],i[h+1]=255-t[h+1],i[h+2]=255-t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},gu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=0,i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},yu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},wu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=0,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},xu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},bu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=0,i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,s)},vu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,s)},Su=n=>{const{data:t,width:e,height:s}=n,i=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;i[h]=t[h],i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},Tu=n=>{const{data:t,width:e,height:s}=n,i=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;i[h]=c,i[h+1]=t[h+1],i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},Cu=n=>{const{data:t,width:e,height:s}=n,i=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;i[h]=c,i[h+1]=c,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},Pu=n=>xa(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Eu=n=>xa(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),_u=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=t[h+2],i[h+3]=255}return new ImageData(i,e,s)},Au=n=>{const{data:t,width:e,height:s}=n,i=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)i[h]=255,i[h+1]=255,i[h+2]=255,i[h+3]=255;else{const c=ba([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);i[h]=c[0],i[h+1]=c[1],i[h+2]=c[2],i[h+3]=c[3]}}return new ImageData(i,e,s)},Du=(n,t,e,s,i,r=!1,a)=>{const{data:o,width:h,height:c}=n;let l=i,f=s,y=t,b=e;if(l<0?l=0:l>h&&(l=h),f<0?f=0:f>c&&(f=c),y<1?y=1:y>h&&(y=h),b<1?b=1:b>c&&(b=c),l+y>h&&(y=h-l),f+b>c&&(b=c-f),r){const w=new Uint8ClampedArray(o.length);for(let S=0;S<c;S++)for(let v=0;v<h;v++){const x=(S*h+v)*4;v>=l&&v<=l+y&&S>=f&&S<=f+b?(w[x]=o[x],w[x+1]=o[x+1],w[x+2]=o[x+2],w[x+3]=o[x+3]):(w[x]=255,w[x+1]=255,w[x+2]=255,w[x+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(w,h,c)}else{const w=new Uint8ClampedArray(y*b*4);for(let S=f;S<=f+b;S++)for(let v=l;v<=l+y;v++){const x=((S-f)*y+v-l)*4,p=(S*h+v)*4;w[x]=o[p],w[x+1]=o[p+1],w[x+2]=o[p+2],w[x+3]=o[p+3]}return new ImageData(w,y,b)}},Iu=(n,t,e,s)=>{const{data:i,width:r,height:a}=n;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(i.length);for(let l=0;l<a;l++)for(let f=0;f<r;f++){const y=(l*r+f)*4;let b=-1;f<o?l<o?b=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(b=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(l-(a-o),2))):f>r-o-1&&(l<o?b=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(b=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(b)>o?(h[y]=255,h[y+1]=255,h[y+2]=255,h[y+3]=s||e.toUpperCase()==="PNG"?0:255):(h[y]=i[y],h[y+1]=i[y+1],h[y+2]=i[y+2],h[y+3]=s||e.toUpperCase()==="PNG"?i[y+3]:255)}return new ImageData(h,r,a)},Mu=(n,t,e,s,i,r=1e4)=>{const a=new Image;a.src=n;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,i),h.getImageData(0,0,s,i)},ku=(n,t)=>{const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;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,i)},Lu=(n,t,e=!1)=>{const{data:s,width:i,height:r}=n,a=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<i;c++){const l=(h*i+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 f=s[l+3];e?f=Math.max(Math.min(Math.floor(255*t),255),0):f=Math.max(Math.min(Math.floor(f+255*t),255),0),a[l+3]=f}return new ImageData(a,i,r)},Ru=(n,t,e,s)=>{const{data:i,width:r,height:a}=n,{data:o,width:h,height:c}=t;let l=e,f=s;e+c>a&&(l=a-c),s+h>r&&(f=r-h);const y=new Uint8ClampedArray(i.length);for(let w=0;w<a;w++)for(let _=0;_<r;_++){const S=(w*r+_)*4;if(_<f||_>f+h||w<=l||w>=l+c)y[S]=i[S],y[S+1]=i[S+1],y[S+2]=i[S+2],y[S+3]=i[S+3];else{const v=(w*r+_-((l+1)*r+(w-(l+1))*(r-h))+h-f-1)*4,x=[o[v],o[v+1],o[v+2],o[v+3]],p=[i[S],i[S+1],i[S+2],i[S+3]],g=ba(x,p);y[S]=g[0],y[S+1]=g[1],y[S+2]=g[2],y[S+3]=g[3]}}return new ImageData(y,r,a)},Ou=(n,t,e,s,i,r=10)=>{const{data:a,width:o,height:h}=n;let c=i,l=s,f=t,y=e;c<0?c=0:c>o&&(c=o),l<0?l=0:l>h&&(l=h),f<1?f=1:f>o&&(f=o),y<1?y=1:y>h&&(y=h),c+f>o&&(f=o-c),l+y>h&&(y=h-l);const b=new Uint8ClampedArray(a.length);for(let _=0;_<h;_++)for(let S=0;S<o;S++){const v=(_*o+S)*4;if(S>=c&&S<=c+f&&_>=l&&_<=l+y){const x=Math.floor((S-c)/r),p=Math.floor((_-l)/r);let g=Math.floor(r*(x+1)-r/2+c),E=Math.floor(r*(p+1)-r/2+l);g>o-1&&(g=o-1),E>h-1&&(E=h-1);const C=(E*o+g)*4;b[v]=a[C],b[v+1]=a[C+1],b[v+2]=a[C+2],b[v+3]=a[C+3]}else b[v]=a[v],b[v+1]=a[v+1],b[v+2]=a[v+2],b[v+3]=a[v+3]}return new ImageData(b,o,h)},Fu=(n,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:i,height:r}=n,{data:a}=t,o=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let f=0;f<r;f++)for(let y=0;y<i;y++){const b=(f*i+y)*4,w=a[b],_=a[b+1],S=a[b+2],v=a[b+3];w===h.r&&_===h.g&&S===h.b&&v===h.a&&c.a!==0?(o[b]=c.r,o[b+1]=c.g,o[b+2]=c.b,o[b+3]=c.a):(o[b]=s[b],o[b+1]=s[b+1],o[b+2]=s[b+2],o[b+3]=s[b+3])}return new ImageData(o,i,r)}return n},xa=(n,t)=>{const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;for(let l=0;l<3;l++){const f=c+l;h===0||h===s-1||o===0||o===i-1?r[f]=e[f]:r[f]=t[0]*e[f-s*4-4]+t[1]*e[f-s*4]+t[2]*e[f-s*4+4]+t[3]*e[f-4]+t[4]*e[f]+t[5]*e[f+4]+t[6]*e[f+s*4-4]+t[7]*e[f+s*4]+t[8]*e[f+s*4+4]}r[c+3]=e[c+3]}return new ImageData(r,s,i)},ba=(n,t)=>{if(n&&n.length===4&&t&&t.length===4){const e=n[3],s=t[3];if(e===255||s===0)return n;if(e===0)return t;{const i=e/255,r=s/255,a=Math.max(Math.min(Math.floor(n[0]*i+t[0]*r*(1-i)),255),0),o=Math.max(Math.min(Math.floor(n[1]*i+t[1]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor(n[2]*i+t[2]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},Kn=function(){const n=[];return{writeByte(t){n.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let i=0;i<s;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return n},toString(){let t="[";for(let e=0,s=n.length;e<s;e++)e>0&&(t+=","),t+=n[e];return t+="]",t}}},va=function(){let n=0,t=0,e=0,s="";const i=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(i(a&63))};return{writeByte(a){for(n=n<<8|a&255,t+=8,e+=1;t>=6;)r(n>>>t-6),t-=6},flush(){if(t>0&&(r(n<<6-t),n=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)s+="="}},toString(){return s}}},Sa=function(n,t,e){const s=new Array(n*n),i=function(o){const h=o;let c=0,l=0;return{write(f,y){if(f>>>y)throw new Error("length over");for(;c+y>=8;)h.writeByte(255&(f<<c|l)),y-=8-c,f>>>=8-c,l=0,c=0;l=f<<c|l,c=c+y},flush(){c>0&&h.writeByte(l)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let l=o+1;const f=a();for(let S=0;S<h;S++)f.add(String.fromCharCode(S));f.add(String.fromCharCode(h)),f.add(String.fromCharCode(c));const y=Kn(),b=i(y);b.write(h,l);let w=0,_=String.fromCharCode(s[w]);for(w+=1;w<s.length;){const S=String.fromCharCode(s[w]);w+=1,f.contains(_+S)?_=_+S:(b.write(f.indexOf(_),l),f.size()<4095&&(f.size()==1<<l&&(l+=1),f.add(_+S)),_=S)}return b.write(f.indexOf(_),l),b.write(c,l),b.flush(),y.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*n+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(n),o.writeShort(n),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(Ce("0x"+t[1]+t[2])),o.writeByte(Ce("0x"+t[3]+t[4])),o.writeByte(Ce("0x"+t[5]+t[6])),o.writeByte(Ce("0x"+e[1]+e[2])),o.writeByte(Ce("0x"+e[3]+e[4])),o.writeByte(Ce("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(n),o.writeShort(n),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(n,t,e,s){const i=Sa(n,t,e);for(let c=0;c<n;c++)for(let l=0;l<n;l++)i.setPixel(l,c,s(l,c));const r=Kn();i.write(r);const a=va(),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},St={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},je={M:0,L:1,H:2,Q:3},re={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},tt={glog:function(n){if(n<1)throw new Error("glog("+n+")");return tt.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return tt.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)tt.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)tt.EXP_TABLE[n]=tt.EXP_TABLE[n-4]^tt.EXP_TABLE[n-5]^tt.EXP_TABLE[n-6]^tt.EXP_TABLE[n-8];for(let n=0;n<255;n++)tt.LOG_TABLE[tt.EXP_TABLE[n]]=n;const $={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(n){let t=n<<10;for(;$.getBCHDigit(t)-$.getBCHDigit($.G15)>=0;)t^=$.G15<<$.getBCHDigit(t)-$.getBCHDigit($.G15);return(n<<10|t)^$.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;$.getBCHDigit(t)-$.getBCHDigit($.G18)>=0;)t^=$.G18<<$.getBCHDigit(t)-$.getBCHDigit($.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return $.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case re.PATTERN000:return(t+e)%2==0;case re.PATTERN001:return t%2==0;case re.PATTERN010:return e%3==0;case re.PATTERN011:return(t+e)%3==0;case re.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case re.PATTERN101:return t*e%2+t*e%3==0;case re.PATTERN110:return(t*e%2+t*e%3)%2==0;case re.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new Ae([1],0);for(let e=0;e<n;e++)t=t.multiply(new Ae([1,tt.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case St.MODE_NUMBER:return 10;case St.MODE_ALPHA_NUM:return 9;case St.MODE_8BIT_BYTE:return 8;case St.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case St.MODE_NUMBER:return 12;case St.MODE_ALPHA_NUM:return 11;case St.MODE_8BIT_BYTE:return 16;case St.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case St.MODE_NUMBER:return 14;case St.MODE_ALPHA_NUM:return 13;case St.MODE_8BIT_BYTE:return 16;case St.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+t)},getLostPoint:function(n){const t=n.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=n.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==n.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;n.isDark(r,a)&&o++,n.isDark(r+1,a)&&o++,n.isDark(r,a+1)&&o++,n.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++)n.isDark(r,a)&&!n.isDark(r,a+1)&&n.isDark(r,a+2)&&n.isDark(r,a+3)&&n.isDark(r,a+4)&&!n.isDark(r,a+5)&&n.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)n.isDark(a,r)&&!n.isDark(a+1,r)&&n.isDark(a+2,r)&&n.isDark(a+3,r)&&n.isDark(a+4,r)&&!n.isDark(a+5,r)&&n.isDark(a+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)n.isDark(a,r)&&s++;const i=Math.abs(100*s/t/t-50)/5;return e+=i*10,e}};class Ae{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 i=0;i<t.length-s;i++)this.num[i]=t[i+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 i=0;i<t.getLength();i++)e[s+i]^=tt.gexp(tt.glog(this.get(s))+tt.glog(t.get(i)));return new Ae(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=tt.glog(this.get(0))-tt.glog(t.get(0)),s=new Array(this.getLength());for(let i=0;i<this.getLength();i++)s[i]=this.get(i);for(let i=0;i<t.getLength();i++)s[i]^=tt.gexp(tt.glog(t.get(i))+e);return new Ae(s,0).mod(t)}}class qt{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=qt.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=s.length/3,r=[];for(let a=0;a<i;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 qt(h,c))}return r}static getRsBlockTable(t,e){switch(e){case je.L:return qt.RS_BLOCK_TABLE[(t-1)*4+0];case je.M:return qt.RS_BLOCK_TABLE[(t-1)*4+1];case je.Q:return qt.RS_BLOCK_TABLE[(t-1)*4+2];case je.H:return qt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Ca{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 Nu{mode;data;constructor(t){this.mode=St.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 ae{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=je[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Nu(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=qt.getRSBlocks(t,this.errorCorrectLevel),s=new Ca;let i=0;for(let r=0;r<e.length;r++)i+=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(),$.getLengthInBits(a.mode,t)),a.write(s)}if(s.getLengthInBits()<=i*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 i=0;i<this.moduleCount;i++)this.modules[s][i]=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=ae.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 i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=s&&s<=6&&(i==0||i==6)||0<=i&&i<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=i&&i<=4?this.modules[t+s][e+i]=!0:this.modules[t+s][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const i=$.getLostPoint(this);(s==0||t>i)&&(t=i,e=s)}return e}createMovieClip(t,e,s){const i=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]&&(i.beginFill(0,100),i.moveTo(c,o),i.lineTo(c+r,o),i.lineTo(c+r,o+r),i.lineTo(c,o+r),i.endFill())}}return i}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=$.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let s=0;s<t.length;s++){const i=t[e],r=t[s];if(this.modules[i][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[i+a][r+o]=!0:this.modules[i+a][r+o]=!1}}setupTypeNumber(t){const e=$.getBCHTypeNumber(this.typeNumber);for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=i}for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=i}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,i=$.getBCHTypeInfo(s);for(let r=0;r<15;r++){const a=!t&&(i>>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&&(i>>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,i=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[i][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),$.getMask(e,i,o-h)&&(c=!c),this.modules[i][o-h]=c,r--,r==-1&&(a++,r=7)}if(i+=s,i<0||this.moduleCount<=i){i-=s,s=-s;break}}}static createData(t,e,s){const i=qt.getRSBlocks(t,e),r=new Ca;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),$.getLengthInBits(h.mode,t)),h.write(r)}let a=0;for(let o=0;o<i.length;o++)a+=i[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(ae.PAD0,8),r.getLengthInBits()>=a*8));)r.put(ae.PAD1,8);return ae.createBytes(r,i)}static createBytes(t,e){let s=0,i=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let f=0;f<e.length;f++){const y=e[f].dataCount,b=e[f].totalCount-y;i=Math.max(i,y),r=Math.max(r,b),a[f]=new Array(y);for(let v=0;v<a[f].length;v++)a[f][v]=255&t.buffer[v+s];s+=y;const w=$.getErrorCorrectPolynomial(b),S=new Ae(a[f],w.getLength()-1).mod(w);o[f]=new Array(w.getLength()-1);for(let v=0;v<o[f].length;v++){const x=v+S.getLength()-o[f].length;o[f][v]=x>=0?S.get(x):0}}let h=0;for(let f=0;f<e.length;f++)h+=e[f].totalCount;const c=new Array(h);let l=0;for(let f=0;f<i;f++)for(let y=0;y<e.length;y++)f<a[y].length&&(c[l++]=a[y][f]);for(let f=0;f<r;f++)for(let y=0;y<e.length;y++)f<o[y].length&&(c[l++]=o[y][f]);return c}}const Pa=Math.ceil,He=Math.floor,Ea=Math.round;function Bu(n,t){const e=Oi(n),s=t?.ecc||"H",i=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new ae(r,s);c.addData(e),c.make();const l=c.getModuleCount(),f=(i-a*2)/l,y=a,b=i-a;return Ta(i,o,h,function(w,_){if(y<=w&&w<b&&y<=_&&_<b){const S=He((w-y)/f),v=He((_-y)/f);return c.isDark(v,S)?0:1}else return 1})}function Uu(n,t){const e=t.x||0,s=t.y||0,i=Oi(n),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?He(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",f=t.background||"#ffffff",y=new ae(c,a);y.addData(i),y.make();const b=y.getModuleCount(),w=(o-h*2)/b;r.fillStyle=f,r.fillRect(e,s,o,o);for(let _=0;_<b;_++)for(let S=0;S<b;S++){const v=Pa((S+1)*w)-He(S*w),x=Pa((_+1)*w)-He(_*w);r.fillStyle=y.isDark(_,S)?l:f,r.fillRect(e+Ea(S*w)+h,s+Ea(_*w)+h,v,x)}}class at extends j{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,i)=>{this.enableDrag&&(this.x+=s,this.y+=i,this.emit("draging",s,i,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 i=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:i,y:r,width:a-i,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 i=s;i<e;i++){const a=t.shapes[i].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 j({attrs:{...t.shapes[i].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 i=new ks({frameDuration:t}),r={},a={};this.shapes.forEach((o,h)=>{const c=Ot(o.getTotalLength(),0);r[`offset_${h}`]=c,a[`offset_${h}`]=0,o.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),i.addTween(r,a,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,h)=>{for(let c in o){const l=hn(c).number;this.shapes[l].setAttr("strokeDashoffset",""+Ot(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),i.play();break}}}const _a=getComputedStyle(document.documentElement);function U(n){return _a.getPropertyValue(n)}function Yu(n,t){document.documentElement.style.setProperty(n,t),_a.setProperty(n,t)}const Qn={colorPrimary:U("--color-primary")||"#5A82F0",colorRed:U("--color-red")||"#FA503C",colorOrange:U("--color-orange")||"#fa8c00",colorYellow:U("--color-yellow")||"#fadc32",colorGreen:U("--color-green")||"#00c878",colorBlue:U("--color-blue")||"#00b4fa",colorPurple:U("--color-purple")||"#6464fa",colorBlack:U("--color-black")||"#001428",colorGray00:U("--color-gray-00")||"#000000",colorGray33:U("--color-gray-33")||"#333333",colorGray66:U("--color-gray-66")||"#666666",colorGray99:U("--color-gray-99")||"#999999",colorGrayCC:U("--color-gray-cc")||"#cccccc",colorGrayDD:U("--color-gray-dd")||"#dddddd",colorGrayE6:U("--color-gray-e6")||"#e6e6e6",colorGrayEE:U("--color-gray-ee")||"#eeeeee",colorGrayEF:U("--color-gray-ef")||"#efefef",colorGrayF5:U("--color-gray-f5")||"#f5f5f5",colorGrayFF:U("--color-gray-ff")||"#ffffff",fontLineHeight:U("--font-line-height")||"1.4",fontSize32:U("--font-size-32")||"32px",fontSize24:U("--font-size-24")||"24px",fontSize22:U("--font-size-22")||"22px",fontSize20:U("--font-size-20")||"20px",fontSize18:U("--font-size-18")||"18px",fontSize16:U("--font-size-16")||"16px",fontSize14:U("--font-size-14")||"14px",fontSize12:U("--font-size-12")||"12px",fontSize10:U("--font-size-10")||"10px",d4:U("--distance-4")||"4px",d8:U("--distance-8")||"8px",d12:U("--distance-12")||"12px",d16:U("--distance-16")||"16px",d20:U("--distance-20")||"20px",d32:U("--distance-32")||"32px",d40:U("--distance-40")||"40px",d44:U("--distance-44")||"44px"};class ut{__color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),typeof e=="number"&&this.setAlpha(e)}get color(){return this.__color}set color(t){this.__color=ti(t)}setColor(t){return this.color=t,this}get r(){return this.__color.r}set r(t){this.__color.r=H(Math.round(t),0,255)}get g(){return this.__color.g}set g(t){this.__color.g=H(Math.round(t),0,255)}get b(){return this.__color.b}set b(t){this.__color.b=H(Math.round(t),0,255)}get a(){return this.__color.a}set a(t){this.__color.a=H(t,0,1)}setAlpha(t){return this.a=t,this}setRGB(t,e,s){return this.r=t,this.g=e,this.b=s,this}setRGBA(t,e,s,i){return this.r=t,this.g=e,this.b=s,this.a=i,this}get hex(){return(this.r<<16)+(this.g<<8)+this.b}toString(){if(this.a===1){const t="000000"+this.hex.toString(16);return"#"+t.slice(t.length-6)}else return`rgba(${this.r},${this.g},${this.b},${Ot(this.a,6)})`}clone(){return new ut(this.color)}copy(t){this.setColor(t.color)}opposite(t=!1,e="#000000",s="#ffffff"){if(t)return new ut(this.r*.299+this.g*.587+this.b*.114>186?e:s);{const i=this.clone();return i.r=255-i.r,i.g=255-i.g,i.b=255-i.b,i}}lighten(t){t=H(Math.abs(t),0,1);let{r:e,g:s,b:i}=this.color;return e+=(255-e)*t,s+=(255-s)*t,i+=(255-i)*t,new ut().setRGBA(e,s,i,this.color.a)}darken(t){t=H(Math.abs(t),0,1);let{r:e,g:s,b:i}=this.color;return e=e*(1-t),s=s*(1-t),i=i*(1-t),new ut().setRGBA(e,s,i,this.color.a)}static gradient(t,e,s){try{const i=ti(t),r=ti(e);return new ut().setRGB((r.r-i.r)*s+i.r,(r.g-i.g)*s+i.g,(r.b-i.b)*s+i.b)}catch{return new ut(e)}}static random(){return new ut(Math.random()*16777215)}get hsv(){const{r:t,g:e,b:s,a:i}=this.color,r=Math.max(t,e,s),a=Math.min(t,e,s),o=r-a;let h;return t===r?h=(e-s)/o:e===r?h=2+(s-t)/o:h=4+(t-e)/o,h/=6,h<0&&(h+=1),{h:o==0?0:h*360,s:r===0?0:o/r,v:r/255,a:i}}set h(t){const e=this.hsv;e.h=H(t,0,360),this.setColor(e)}get h(){return this.hsv.h}set s(t){const e=this.hsv;e.s=H(t,0,1),this.setColor(e)}get s(){return this.hsv.s}set v(t){const e=this.hsv;e.v=H(t,0,1),this.setColor(e)}get v(){return this.hsv.v}}function $e(n,t){return new ut(n,t)}function ti(n){const t=Object.prototype.hasOwnProperty.call(n,"a")?H(n.a,0,1):1;if(Object.prototype.hasOwnProperty.call(n,"r")&&Object.prototype.hasOwnProperty.call(n,"g")&&Object.prototype.hasOwnProperty.call(n,"b"))return n.r=H(Math.round(n.r),0,255),n.g=H(Math.round(n.g),0,255),n.b=H(Math.round(n.b),0,255),n.a=t,n;if(Object.prototype.hasOwnProperty.call(n,"h")&&Object.prototype.hasOwnProperty.call(n,"s")&&Object.prototype.hasOwnProperty.call(n,"v")){const s=H(n.h,0,360),i=H(n.s,0,1),r=H(n.v,0,1),a=Math.floor(s/60)%6,o=s/60-Math.floor(s/60),h=r*(1-i),c=r*(1-o*i),l=r*(1-(1-o)*i),f=[[r,l,h],[c,r,h],[h,r,l],[h,c,r],[l,h,r],[r,h,c]][a];return{r:Math.round(f[0]*255),g:Math.round(f[1]*255),b:Math.round(f[2]*255),a:t}}const e={r:0,g:0,b:0,a:t};if(typeof n=="number")n<Math.pow(2,24)?(e.r=n>>16&255,e.g=n>>8&255,e.b=n&255):(e.r=n>>24&255,e.g=n>>16&255,e.b=n>>8&255,e.a=(n&255)/255);else if(typeof n=="string"){const s=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(n);if(s)e.r=parseInt(s[1]),e.g=parseInt(s[2]),e.b=parseInt(s[3]),s[4]&&(e.a=parseFloat(s[4]));else{let i=n.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);i?(e.r=parseInt(`${i[1]}${i[1]}`,16),e.g=parseInt(`${i[2]}${i[2]}`,16),e.b=parseInt(`${i[3]}${i[3]}`,16)):(i=n.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),i?(e.r=parseInt(i[1],16),e.g=parseInt(i[2],16),e.b=parseInt(i[3],16)):(i=n.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),i?(e.r=parseInt(i[1],16),e.g=parseInt(i[2],16),e.b=parseInt(i[3],16),e.a=parseInt(i[4],16)/255):n==="none"&&(e.a=0)))}}else throw new Error("parseColor 不支持的颜色解析:"+n);return e.r=H(e.r,0,255),e.g=H(e.g,0,255),e.b=H(e.b,0,255),e.a=H(e.a,0,1),e}const Aa=["#0ac2d2","#7bb7fa","#60d7a9","#fdc162","#fd6a62","#f68dbb","#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff","#dc4916","#6871b1","#d1b935","#1bbc9b","#FF7F50","#4BBFC3","#ff9900"],ye={backgroundColor:"#1a1a1a",numberColor:"#2FA1D6",booleanColor:"#806787",stringColor:"#1ed36f",functionColor:"#e61d5f",saveRowColor:"#dad5cb",buttonColor:"",borderColor:"",inputColor:""};ye.buttonColor=new ut(ye.saveRowColor).darken(.1).toString(),ye.borderColor=new ut(ye.backgroundColor).lighten(.07).toString(),ye.inputColor=new ut(ye.backgroundColor).lighten(.085).toString();class we extends j{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(i,r,a,o){switch(r){case"x":i.toX=a+e;break;case"y":i.toY=a+s;break;case"toX":e=a-i.x;break;case"toY":s=a-i.y;break}return Reflect.set(i,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 ha({x:this.x,y:this.y,toX:this.toX,toY:this.toY}),s=new ha({x:t.x,y:t.y,toX:t.toX,toY:t.toY});return e.intersection(s)}}class Xu extends j{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)}}var Da={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
30
+ `))}const re=te(),cu={onTop:n=>(zs(),setTimeout(()=>{const t=getComputedStyle(document.documentElement);re.emit("top",t.getPropertyValue("--sat"))},1),re.on("top",n)),onRight:n=>(zs(),setTimeout(()=>{const t=getComputedStyle(document.documentElement);re.emit("right",t.getPropertyValue("--sar"))},1),re.on("right",n)),onBottom:n=>(zs(),setTimeout(()=>{const t=getComputedStyle(document.documentElement);re.emit("bottom",t.getPropertyValue("--sab"))},1),re.on("bottom",n)),onLeft:n=>(zs(),setTimeout(()=>{const t=getComputedStyle(document.documentElement);re.emit("left",t.getPropertyValue("--sal"))},1),re.on("left",n))};function lu(n){return ye.onpopstate(()=>{const{pathname:t,search:e}=location;n[t]?.()}),{goto:ye.pushstate,replace:ye.replacestate}}function uu(){const n=te();return{destroy:Z(document,"scroll",t=>{n.emit("scroll",t)}),on:t=>(n.on("scroll",t),()=>{n.off("scroll",t)})}}function fu(){return Z(document,"touchmove",n=>{n.preventDefault()})}function du(n,t){window.scrollTo(n,t)}function mu(){let n=Vi,t=Vi;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",n=ye.onbeforeunload(()=>{window.history.scrollRestoration="auto"}),t=ye.onload(()=>{window.history.scrollRestoration="manual"})),()=>{n(),t()}}function ba(n){const t=te(),e=new ResizeObserver(s=>{const i=s[0],{width:r,height:a}=i.contentRect;t.emit("resize",r,a)});return e.observe(n),{on:s=>(t.on("resize",s),()=>{t.off("resize",s)}),destroy:()=>{e.unobserve(n)}}}function pu(n,t=.5,e){const s=te();let i;const r=new IntersectionObserver((a,o)=>{let h=a[0];if(a.length>1){const l=a.find(d=>d.isIntersecting);l&&(h=l)}const c=h.isIntersecting&&h.intersectionRatio>=t;i!==c&&(c?s.emit("show"):s.emit("hide"),i=c)},{threshold:t,root:e});return r.observe(n),{onshow:a=>(s.on("show",a),()=>{s.off("show",a)}),onhide:a=>(s.on("hide",a),()=>{s.off("hide",a)}),destroy:()=>{r.unobserve(n)}}}function gu(n){const t=te(),e=new MutationObserver((s,i)=>{t.emit("mutation",s,i)});return e.observe(n,{attributes:!0,childList:!0,subtree:!0}),{on:s=>(t.on("mutation",s),()=>{t.off("mutation",s)}),destroy:()=>{e.disconnect()}}}function yu(n,t,e,s,i){const r=t/e;let a=0,o=0;switch(n){case"aspectFit":r>=1?(a=s,o=a/r,o>i&&(o=i,a=o*r)):(o=i,a=o*r,a>s&&(a=s,o=a/r));break;case"aspectFill":r>=1?(o=i,a=o*r):(a=s,o=a/r);break;case"widthFix":a=s,o=a/r;break;case"heightFix":o=i,a=o*r;break;case"scaleToFill":default:a=s,o=i;break}return{width:a,height:o}}function va(n){try{const t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)}catch{return new ImageData(n.width,n.height)}}const wu=n=>{const t=n.width,e=n.height,s=t*e*3,i=s+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>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=n.data;let c="";const l=t<<2;let d=e;const y=String.fromCharCode;do{const w=l*(d-1);let _="";for(let S=0;S<t;S++){const v=S<<2;_+=y(h[w+v+2])+y(h[w+v+1])+y(h[w+v])}for(let S=0;S<o;S++)_+=String.fromCharCode(0);c+=_}while(--d);function b(w){if(!window.btoa)throw"btoa undefined";let _="";if(typeof w=="string")_=w;else for(let S=0;S<w.length;S++)_+=String.fromCharCode(w[S]);return btoa(_)}return b(r.concat(a))+b(c)},xu=n=>{const{width:t,height:e}=n,s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.putImageData(n,0,0,0,0,t,e),s.toDataURL("image/png")},bu=(n,t,e)=>{const{width:s,height:i}=n,r=document.createElement("canvas"),a=r.getContext("2d");r.width=s,r.height=i,a.putImageData(n,0,0,0,0,s,i);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)};function vu(n,t){return createImageBitmap(n,t)}function Su(n){const t=[],e=[],s=[];let i=0;for(let h=0,c=n.data.length;h<c;h+=4)t[i]=n.data[h],e[i]=n.data[h+1],s[i]=n.data[h+2],i+=1;const r=Kn(t),a=Kn(e),o=Kn(s);return"rgb("+r+","+a+","+o+")"}function Kn(n){const t={},e=[],s=[];for(let o=0;o<n.length;o++)t[n[o]]?e.push(n[o]):t[n[o]]=1;let i=0;for(let o=0;o<e.length;o++){i=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(i+=1),s[o]=i}const r=Math.max.apply(null,s);let a=0;for(;a<s.length;a++)if(s[a]===r)return;return e[a]}const Tu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[(a*e+e-o-1)*4],i[h+1]=t[(a*e+e-o-1)*4+1],i[h+2]=t[(a*e+e-o-1)*4+2],i[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(i,e,s)},Cu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[((s-a-1)*e+o)*4],i[h+1]=t[((s-a-1)*e+o)*4+1],i[h+2]=t[((s-a-1)*e+o)*4+2],i[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(i,e,s)},Pu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;i[h]=t[(o*e+e-a-1)*4],i[h+1]=t[(o*e+e-a-1)*4+1],i[h+2]=t[(o*e+e-a-1)*4+2],i[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(i,s,e)},Eu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;i[h]=t[((s-o-1)*e+a)*4],i[h+1]=t[((s-o-1)*e+a)*4+1],i[h+2]=t[((s-o-1)*e+a)*4+2],i[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(i,s,e)},_u=n=>{const{data:t,width:e,height:s}=n,i=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;i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},Au=n=>{const{data:t,width:e,height:s}=n,i=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];i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},Du=n=>{const{data:t,width:e,height:s}=n,i=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;i[h]=l,i[h+1]=l,i[h+2]=l,i[h+3]=t[h+3]}return new ImageData(i,e,s)},Iu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=255-t[h],i[h+1]=255-t[h+1],i[h+2]=255-t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},Mu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=0,i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},ku=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},Lu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=0,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},Ru=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},Ou=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=0,i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,s)},Fu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,s)},Nu=n=>{const{data:t,width:e,height:s}=n,i=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;i[h]=t[h],i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},Bu=n=>{const{data:t,width:e,height:s}=n,i=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;i[h]=c,i[h+1]=t[h+1],i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},Uu=n=>{const{data:t,width:e,height:s}=n,i=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;i[h]=c,i[h+1]=c,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},Yu=n=>Sa(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Xu=n=>Sa(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),zu=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=t[h+2],i[h+3]=255}return new ImageData(i,e,s)},Gu=n=>{const{data:t,width:e,height:s}=n,i=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)i[h]=255,i[h+1]=255,i[h+2]=255,i[h+3]=255;else{const c=Ta([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);i[h]=c[0],i[h+1]=c[1],i[h+2]=c[2],i[h+3]=c[3]}}return new ImageData(i,e,s)},Vu=(n,t,e,s,i,r=!1,a)=>{const{data:o,width:h,height:c}=n;let l=i,d=s,y=t,b=e;if(l<0?l=0:l>h&&(l=h),d<0?d=0:d>c&&(d=c),y<1?y=1:y>h&&(y=h),b<1?b=1:b>c&&(b=c),l+y>h&&(y=h-l),d+b>c&&(b=c-d),r){const w=new Uint8ClampedArray(o.length);for(let S=0;S<c;S++)for(let v=0;v<h;v++){const x=(S*h+v)*4;v>=l&&v<=l+y&&S>=d&&S<=d+b?(w[x]=o[x],w[x+1]=o[x+1],w[x+2]=o[x+2],w[x+3]=o[x+3]):(w[x]=255,w[x+1]=255,w[x+2]=255,w[x+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(w,h,c)}else{const w=new Uint8ClampedArray(y*b*4);for(let S=d;S<=d+b;S++)for(let v=l;v<=l+y;v++){const x=((S-d)*y+v-l)*4,p=(S*h+v)*4;w[x]=o[p],w[x+1]=o[p+1],w[x+2]=o[p+2],w[x+3]=o[p+3]}return new ImageData(w,y,b)}},qu=(n,t,e,s)=>{const{data:i,width:r,height:a}=n;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(i.length);for(let l=0;l<a;l++)for(let d=0;d<r;d++){const y=(l*r+d)*4;let b=-1;d<o?l<o?b=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(b=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(l-(a-o),2))):d>r-o-1&&(l<o?b=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(b=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(b)>o?(h[y]=255,h[y+1]=255,h[y+2]=255,h[y+3]=s||e.toUpperCase()==="PNG"?0:255):(h[y]=i[y],h[y+1]=i[y+1],h[y+2]=i[y+2],h[y+3]=s||e.toUpperCase()==="PNG"?i[y+3]:255)}return new ImageData(h,r,a)},ju=(n,t,e,s,i,r=1e4)=>{const a=new Image;a.src=n;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,i),h.getImageData(0,0,s,i)},Hu=(n,t)=>{const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;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,i)},$u=(n,t,e=!1)=>{const{data:s,width:i,height:r}=n,a=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<i;c++){const l=(h*i+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,i,r)},Wu=(n,t,e,s)=>{const{data:i,width:r,height:a}=n,{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 y=new Uint8ClampedArray(i.length);for(let w=0;w<a;w++)for(let _=0;_<r;_++){const S=(w*r+_)*4;if(_<d||_>d+h||w<=l||w>=l+c)y[S]=i[S],y[S+1]=i[S+1],y[S+2]=i[S+2],y[S+3]=i[S+3];else{const v=(w*r+_-((l+1)*r+(w-(l+1))*(r-h))+h-d-1)*4,x=[o[v],o[v+1],o[v+2],o[v+3]],p=[i[S],i[S+1],i[S+2],i[S+3]],g=Ta(x,p);y[S]=g[0],y[S+1]=g[1],y[S+2]=g[2],y[S+3]=g[3]}}return new ImageData(y,r,a)},Ju=(n,t,e,s,i,r=10)=>{const{data:a,width:o,height:h}=n;let c=i,l=s,d=t,y=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),y<1?y=1:y>h&&(y=h),c+d>o&&(d=o-c),l+y>h&&(y=h-l);const b=new Uint8ClampedArray(a.length);for(let _=0;_<h;_++)for(let S=0;S<o;S++){const v=(_*o+S)*4;if(S>=c&&S<=c+d&&_>=l&&_<=l+y){const x=Math.floor((S-c)/r),p=Math.floor((_-l)/r);let g=Math.floor(r*(x+1)-r/2+c),E=Math.floor(r*(p+1)-r/2+l);g>o-1&&(g=o-1),E>h-1&&(E=h-1);const C=(E*o+g)*4;b[v]=a[C],b[v+1]=a[C+1],b[v+2]=a[C+2],b[v+3]=a[C+3]}else b[v]=a[v],b[v+1]=a[v+1],b[v+2]=a[v+2],b[v+3]=a[v+3]}return new ImageData(b,o,h)},Zu=(n,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:i,height:r}=n,{data:a}=t,o=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let d=0;d<r;d++)for(let y=0;y<i;y++){const b=(d*i+y)*4,w=a[b],_=a[b+1],S=a[b+2],v=a[b+3];w===h.r&&_===h.g&&S===h.b&&v===h.a&&c.a!==0?(o[b]=c.r,o[b+1]=c.g,o[b+2]=c.b,o[b+3]=c.a):(o[b]=s[b],o[b+1]=s[b+1],o[b+2]=s[b+2],o[b+3]=s[b+3])}return new ImageData(o,i,r)}return n},Sa=(n,t)=>{const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;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===i-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,i)},Ta=(n,t)=>{if(n&&n.length===4&&t&&t.length===4){const e=n[3],s=t[3];if(e===255||s===0)return n;if(e===0)return t;{const i=e/255,r=s/255,a=Math.max(Math.min(Math.floor(n[0]*i+t[0]*r*(1-i)),255),0),o=Math.max(Math.min(Math.floor(n[1]*i+t[1]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor(n[2]*i+t[2]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},Qn=function(){const n=[];return{writeByte(t){n.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let i=0;i<s;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return n},toString(){let t="[";for(let e=0,s=n.length;e<s;e++)e>0&&(t+=","),t+=n[e];return t+="]",t}}},Ca=function(){let n=0,t=0,e=0,s="";const i=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(i(a&63))};return{writeByte(a){for(n=n<<8|a&255,t+=8,e+=1;t>=6;)r(n>>>t-6),t-=6},flush(){if(t>0&&(r(n<<6-t),n=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)s+="="}},toString(){return s}}},Pa=function(n,t,e){const s=new Array(n*n),i=function(o){const h=o;let c=0,l=0;return{write(d,y){if(d>>>y)throw new Error("length over");for(;c+y>=8;)h.writeByte(255&(d<<c|l)),y-=8-c,d>>>=8-c,l=0,c=0;l=d<<c|l,c=c+y},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 S=0;S<h;S++)d.add(String.fromCharCode(S));d.add(String.fromCharCode(h)),d.add(String.fromCharCode(c));const y=Qn(),b=i(y);b.write(h,l);let w=0,_=String.fromCharCode(s[w]);for(w+=1;w<s.length;){const S=String.fromCharCode(s[w]);w+=1,d.contains(_+S)?_=_+S:(b.write(d.indexOf(_),l),d.size()<4095&&(d.size()==1<<l&&(l+=1),d.add(_+S)),_=S)}return b.write(d.indexOf(_),l),b.write(c,l),b.flush(),y.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*n+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(n),o.writeShort(n),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(Pe("0x"+t[1]+t[2])),o.writeByte(Pe("0x"+t[3]+t[4])),o.writeByte(Pe("0x"+t[5]+t[6])),o.writeByte(Pe("0x"+e[1]+e[2])),o.writeByte(Pe("0x"+e[3]+e[4])),o.writeByte(Pe("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(n),o.writeShort(n),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(";")}}},Ea=function(n,t,e,s){const i=Pa(n,t,e);for(let c=0;c<n;c++)for(let l=0;l<n;l++)i.setPixel(l,c,s(l,c));const r=Qn();i.write(r);const a=Ca(),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},Tt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},je={M:0,L:1,H:2,Q:3},ae={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},et={glog:function(n){if(n<1)throw new Error("glog("+n+")");return et.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return et.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)et.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)et.EXP_TABLE[n]=et.EXP_TABLE[n-4]^et.EXP_TABLE[n-5]^et.EXP_TABLE[n-6]^et.EXP_TABLE[n-8];for(let n=0;n<255;n++)et.LOG_TABLE[et.EXP_TABLE[n]]=n;const W={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(n){let t=n<<10;for(;W.getBCHDigit(t)-W.getBCHDigit(W.G15)>=0;)t^=W.G15<<W.getBCHDigit(t)-W.getBCHDigit(W.G15);return(n<<10|t)^W.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;W.getBCHDigit(t)-W.getBCHDigit(W.G18)>=0;)t^=W.G18<<W.getBCHDigit(t)-W.getBCHDigit(W.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return W.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case ae.PATTERN000:return(t+e)%2==0;case ae.PATTERN001:return t%2==0;case ae.PATTERN010:return e%3==0;case ae.PATTERN011:return(t+e)%3==0;case ae.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case ae.PATTERN101:return t*e%2+t*e%3==0;case ae.PATTERN110:return(t*e%2+t*e%3)%2==0;case ae.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new Ae([1],0);for(let e=0;e<n;e++)t=t.multiply(new Ae([1,et.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case Tt.MODE_NUMBER:return 10;case Tt.MODE_ALPHA_NUM:return 9;case Tt.MODE_8BIT_BYTE:return 8;case Tt.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case Tt.MODE_NUMBER:return 12;case Tt.MODE_ALPHA_NUM:return 11;case Tt.MODE_8BIT_BYTE:return 16;case Tt.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case Tt.MODE_NUMBER:return 14;case Tt.MODE_ALPHA_NUM:return 13;case Tt.MODE_8BIT_BYTE:return 16;case Tt.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+t)},getLostPoint:function(n){const t=n.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=n.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==n.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;n.isDark(r,a)&&o++,n.isDark(r+1,a)&&o++,n.isDark(r,a+1)&&o++,n.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++)n.isDark(r,a)&&!n.isDark(r,a+1)&&n.isDark(r,a+2)&&n.isDark(r,a+3)&&n.isDark(r,a+4)&&!n.isDark(r,a+5)&&n.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)n.isDark(a,r)&&!n.isDark(a+1,r)&&n.isDark(a+2,r)&&n.isDark(a+3,r)&&n.isDark(a+4,r)&&!n.isDark(a+5,r)&&n.isDark(a+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)n.isDark(a,r)&&s++;const i=Math.abs(100*s/t/t-50)/5;return e+=i*10,e}};class Ae{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 i=0;i<t.length-s;i++)this.num[i]=t[i+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 i=0;i<t.getLength();i++)e[s+i]^=et.gexp(et.glog(this.get(s))+et.glog(t.get(i)));return new Ae(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=et.glog(this.get(0))-et.glog(t.get(0)),s=new Array(this.getLength());for(let i=0;i<this.getLength();i++)s[i]=this.get(i);for(let i=0;i<t.getLength();i++)s[i]^=et.gexp(et.glog(t.get(i))+e);return new Ae(s,0).mod(t)}}class Vt{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=Vt.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=s.length/3,r=[];for(let a=0;a<i;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 Vt(h,c))}return r}static getRsBlockTable(t,e){switch(e){case je.L:return Vt.RS_BLOCK_TABLE[(t-1)*4+0];case je.M:return Vt.RS_BLOCK_TABLE[(t-1)*4+1];case je.Q:return Vt.RS_BLOCK_TABLE[(t-1)*4+2];case je.H:return Vt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class _a{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 Ku{mode;data;constructor(t){this.mode=Tt.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 oe{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=je[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Ku(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=Vt.getRSBlocks(t,this.errorCorrectLevel),s=new _a;let i=0;for(let r=0;r<e.length;r++)i+=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(),W.getLengthInBits(a.mode,t)),a.write(s)}if(s.getLengthInBits()<=i*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 i=0;i<this.moduleCount;i++)this.modules[s][i]=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=oe.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 i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=s&&s<=6&&(i==0||i==6)||0<=i&&i<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=i&&i<=4?this.modules[t+s][e+i]=!0:this.modules[t+s][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const i=W.getLostPoint(this);(s==0||t>i)&&(t=i,e=s)}return e}createMovieClip(t,e,s){const i=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]&&(i.beginFill(0,100),i.moveTo(c,o),i.lineTo(c+r,o),i.lineTo(c+r,o+r),i.lineTo(c,o+r),i.endFill())}}return i}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=W.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let s=0;s<t.length;s++){const i=t[e],r=t[s];if(this.modules[i][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[i+a][r+o]=!0:this.modules[i+a][r+o]=!1}}setupTypeNumber(t){const e=W.getBCHTypeNumber(this.typeNumber);for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=i}for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=i}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,i=W.getBCHTypeInfo(s);for(let r=0;r<15;r++){const a=!t&&(i>>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&&(i>>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,i=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[i][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),W.getMask(e,i,o-h)&&(c=!c),this.modules[i][o-h]=c,r--,r==-1&&(a++,r=7)}if(i+=s,i<0||this.moduleCount<=i){i-=s,s=-s;break}}}static createData(t,e,s){const i=Vt.getRSBlocks(t,e),r=new _a;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),W.getLengthInBits(h.mode,t)),h.write(r)}let a=0;for(let o=0;o<i.length;o++)a+=i[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(oe.PAD0,8),r.getLengthInBits()>=a*8));)r.put(oe.PAD1,8);return oe.createBytes(r,i)}static createBytes(t,e){let s=0,i=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let d=0;d<e.length;d++){const y=e[d].dataCount,b=e[d].totalCount-y;i=Math.max(i,y),r=Math.max(r,b),a[d]=new Array(y);for(let v=0;v<a[d].length;v++)a[d][v]=255&t.buffer[v+s];s+=y;const w=W.getErrorCorrectPolynomial(b),S=new Ae(a[d],w.getLength()-1).mod(w);o[d]=new Array(w.getLength()-1);for(let v=0;v<o[d].length;v++){const x=v+S.getLength()-o[d].length;o[d][v]=x>=0?S.get(x):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<i;d++)for(let y=0;y<e.length;y++)d<a[y].length&&(c[l++]=a[y][d]);for(let d=0;d<r;d++)for(let y=0;y<e.length;y++)d<o[y].length&&(c[l++]=o[y][d]);return c}}const Aa=Math.ceil,He=Math.floor,Da=Math.round;function Qu(n,t){const e=Ni(n),s=t?.ecc||"H",i=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new oe(r,s);c.addData(e),c.make();const l=c.getModuleCount(),d=(i-a*2)/l,y=a,b=i-a;return Ea(i,o,h,function(w,_){if(y<=w&&w<b&&y<=_&&_<b){const S=He((w-y)/d),v=He((_-y)/d);return c.isDark(v,S)?0:1}else return 1})}function tf(n,t){const e=t.x||0,s=t.y||0,i=Ni(n),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?He(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",d=t.background||"#ffffff",y=new oe(c,a);y.addData(i),y.make();const b=y.getModuleCount(),w=(o-h*2)/b;r.fillStyle=d,r.fillRect(e,s,o,o);for(let _=0;_<b;_++)for(let S=0;S<b;S++){const v=Aa((S+1)*w)-He(S*w),x=Aa((_+1)*w)-He(_*w);r.fillStyle=y.isDark(_,S)?l:d,r.fillRect(e+Da(S*w)+h,s+Da(_*w)+h,v,x)}}class ot extends j{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,i)=>{this.enableDrag&&(this.x+=s,this.y+=i,this.emit("draging",s,i,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 i=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:i,y:r,width:a-i,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 i=s;i<e;i++){const a=t.shapes[i].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 j({attrs:{...t.shapes[i].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 i=new Ms({frameDuration:t}),r={},a={};this.shapes.forEach((o,h)=>{const c=Ot(o.getTotalLength(),0);r[`offset_${h}`]=c,a[`offset_${h}`]=0,o.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),i.addTween(r,a,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,h)=>{for(let c in o){const l=hn(c).number;this.shapes[l].setAttr("strokeDashoffset",""+Ot(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),i.play();break}}}const Ia=getComputedStyle(document.documentElement);function U(n){return Ia.getPropertyValue(n)}function ef(n,t){document.documentElement.style.setProperty(n,t),Ia.setProperty(n,t)}const ti={colorPrimary:U("--color-primary")||"#5A82F0",colorRed:U("--color-red")||"#FA503C",colorOrange:U("--color-orange")||"#fa8c00",colorYellow:U("--color-yellow")||"#fadc32",colorGreen:U("--color-green")||"#00c878",colorBlue:U("--color-blue")||"#00b4fa",colorPurple:U("--color-purple")||"#6464fa",colorBlack:U("--color-black")||"#001428",colorGray00:U("--color-gray-00")||"#000000",colorGray33:U("--color-gray-33")||"#333333",colorGray66:U("--color-gray-66")||"#666666",colorGray99:U("--color-gray-99")||"#999999",colorGrayCC:U("--color-gray-cc")||"#cccccc",colorGrayDD:U("--color-gray-dd")||"#dddddd",colorGrayE6:U("--color-gray-e6")||"#e6e6e6",colorGrayEE:U("--color-gray-ee")||"#eeeeee",colorGrayEF:U("--color-gray-ef")||"#efefef",colorGrayF5:U("--color-gray-f5")||"#f5f5f5",colorGrayFF:U("--color-gray-ff")||"#ffffff",fontLineHeight:U("--font-line-height")||"1.4",fontSize32:U("--font-size-32")||"32px",fontSize24:U("--font-size-24")||"24px",fontSize22:U("--font-size-22")||"22px",fontSize20:U("--font-size-20")||"20px",fontSize18:U("--font-size-18")||"18px",fontSize16:U("--font-size-16")||"16px",fontSize14:U("--font-size-14")||"14px",fontSize12:U("--font-size-12")||"12px",fontSize10:U("--font-size-10")||"10px",d4:U("--distance-4")||"4px",d8:U("--distance-8")||"8px",d12:U("--distance-12")||"12px",d16:U("--distance-16")||"16px",d20:U("--distance-20")||"20px",d32:U("--distance-32")||"32px",d40:U("--distance-40")||"40px",d44:U("--distance-44")||"44px"};class dt{__color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),typeof e=="number"&&this.setAlpha(e)}get color(){return this.__color}set color(t){this.__color=ei(t)}setColor(t){return this.color=t,this}get r(){return this.__color.r}set r(t){this.__color.r=H(Math.round(t),0,255)}get g(){return this.__color.g}set g(t){this.__color.g=H(Math.round(t),0,255)}get b(){return this.__color.b}set b(t){this.__color.b=H(Math.round(t),0,255)}get a(){return this.__color.a}set a(t){this.__color.a=H(t,0,1)}setAlpha(t){return this.a=t,this}setRGB(t,e,s){return this.r=t,this.g=e,this.b=s,this}setRGBA(t,e,s,i){return this.r=t,this.g=e,this.b=s,this.a=i,this}get hex(){return(this.r<<16)+(this.g<<8)+this.b}toString(){if(this.a===1){const t="000000"+this.hex.toString(16);return"#"+t.slice(t.length-6)}else return`rgba(${this.r},${this.g},${this.b},${Ot(this.a,6)})`}clone(){return new dt(this.color)}copy(t){this.setColor(t.color)}opposite(t=!1,e="#000000",s="#ffffff"){if(t)return new dt(this.r*.299+this.g*.587+this.b*.114>186?e:s);{const i=this.clone();return i.r=255-i.r,i.g=255-i.g,i.b=255-i.b,i}}lighten(t){t=H(Math.abs(t),0,1);let{r:e,g:s,b:i}=this.color;return e+=(255-e)*t,s+=(255-s)*t,i+=(255-i)*t,new dt().setRGBA(e,s,i,this.color.a)}darken(t){t=H(Math.abs(t),0,1);let{r:e,g:s,b:i}=this.color;return e=e*(1-t),s=s*(1-t),i=i*(1-t),new dt().setRGBA(e,s,i,this.color.a)}static gradient(t,e,s){try{const i=ei(t),r=ei(e);return new dt().setRGB((r.r-i.r)*s+i.r,(r.g-i.g)*s+i.g,(r.b-i.b)*s+i.b)}catch{return new dt(e)}}static random(){return new dt(Math.random()*16777215)}get hsv(){const{r:t,g:e,b:s,a:i}=this.color,r=Math.max(t,e,s),a=Math.min(t,e,s),o=r-a;let h;return t===r?h=(e-s)/o:e===r?h=2+(s-t)/o:h=4+(t-e)/o,h/=6,h<0&&(h+=1),{h:o==0?0:h*360,s:r===0?0:o/r,v:r/255,a:i}}set h(t){const e=this.hsv;e.h=H(t,0,360),this.setColor(e)}get h(){return this.hsv.h}set s(t){const e=this.hsv;e.s=H(t,0,1),this.setColor(e)}get s(){return this.hsv.s}set v(t){const e=this.hsv;e.v=H(t,0,1),this.setColor(e)}get v(){return this.hsv.v}}function $e(n,t){return new dt(n,t)}function ei(n){const t=Object.prototype.hasOwnProperty.call(n,"a")?H(n.a,0,1):1;if(Object.prototype.hasOwnProperty.call(n,"r")&&Object.prototype.hasOwnProperty.call(n,"g")&&Object.prototype.hasOwnProperty.call(n,"b"))return n.r=H(Math.round(n.r),0,255),n.g=H(Math.round(n.g),0,255),n.b=H(Math.round(n.b),0,255),n.a=t,n;if(Object.prototype.hasOwnProperty.call(n,"h")&&Object.prototype.hasOwnProperty.call(n,"s")&&Object.prototype.hasOwnProperty.call(n,"v")){const s=H(n.h,0,360),i=H(n.s,0,1),r=H(n.v,0,1),a=Math.floor(s/60)%6,o=s/60-Math.floor(s/60),h=r*(1-i),c=r*(1-o*i),l=r*(1-(1-o)*i),d=[[r,l,h],[c,r,h],[h,r,l],[h,c,r],[l,h,r],[r,h,c]][a];return{r:Math.round(d[0]*255),g:Math.round(d[1]*255),b:Math.round(d[2]*255),a:t}}const e={r:0,g:0,b:0,a:t};if(typeof n=="number")n<Math.pow(2,24)?(e.r=n>>16&255,e.g=n>>8&255,e.b=n&255):(e.r=n>>24&255,e.g=n>>16&255,e.b=n>>8&255,e.a=(n&255)/255);else if(typeof n=="string"){const s=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(n);if(s)e.r=parseInt(s[1]),e.g=parseInt(s[2]),e.b=parseInt(s[3]),s[4]&&(e.a=parseFloat(s[4]));else{let i=n.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);i?(e.r=parseInt(`${i[1]}${i[1]}`,16),e.g=parseInt(`${i[2]}${i[2]}`,16),e.b=parseInt(`${i[3]}${i[3]}`,16)):(i=n.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),i?(e.r=parseInt(i[1],16),e.g=parseInt(i[2],16),e.b=parseInt(i[3],16)):(i=n.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),i?(e.r=parseInt(i[1],16),e.g=parseInt(i[2],16),e.b=parseInt(i[3],16),e.a=parseInt(i[4],16)/255):n==="none"&&(e.a=0)))}}else throw new Error("parseColor 不支持的颜色解析:"+n);return e.r=H(e.r,0,255),e.g=H(e.g,0,255),e.b=H(e.b,0,255),e.a=H(e.a,0,1),e}const Ma=["#0ac2d2","#7bb7fa","#60d7a9","#fdc162","#fd6a62","#f68dbb","#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff","#dc4916","#6871b1","#d1b935","#1bbc9b","#FF7F50","#4BBFC3","#ff9900"],we={backgroundColor:"#1a1a1a",numberColor:"#2FA1D6",booleanColor:"#806787",stringColor:"#1ed36f",functionColor:"#e61d5f",saveRowColor:"#dad5cb",buttonColor:"",borderColor:"",inputColor:""};we.buttonColor=new dt(we.saveRowColor).darken(.1).toString(),we.borderColor=new dt(we.backgroundColor).lighten(.07).toString(),we.inputColor=new dt(we.backgroundColor).lighten(.085).toString();class xe extends j{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(i,r,a,o){switch(r){case"x":i.toX=a+e;break;case"y":i.toY=a+s;break;case"toX":e=a-i.x;break;case"toY":s=a-i.y;break}return Reflect.set(i,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 oa({x:this.x,y:this.y,toX:this.toX,toY:this.toY}),s=new oa({x:t.x,y:t.y,toX:t.toX,toY:t.toY});return e.intersection(s)}}class sf extends j{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)}}var ka={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
31
31
  * http://hammerjs.github.io/
32
32
  *
33
33
  * Copyright (c) 2016 Jorik Tangelder;
34
- * Licensed under the MIT license */(function(n){(function(t,e,s,i){var r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",h=Math.round,c=Math.abs,l=Date.now;function f(u,m,P){return setTimeout(p(u,P),m)}function y(u,m,P){return Array.isArray(u)?(b(u,P[m],P),!0):!1}function b(u,m,P){var A;if(u)if(u.forEach)u.forEach(m,P);else if(u.length!==i)for(A=0;A<u.length;)m.call(P,u[A],A,u),A++;else for(A in u)u.hasOwnProperty(A)&&m.call(P,u[A],A,u)}function w(u,m,P){var A="DEPRECATED METHOD: "+m+`
34
+ * Licensed under the MIT license */(function(n){(function(t,e,s,i){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,m,P){return setTimeout(p(u,P),m)}function y(u,m,P){return Array.isArray(u)?(b(u,P[m],P),!0):!1}function b(u,m,P){var A;if(u)if(u.forEach)u.forEach(m,P);else if(u.length!==i)for(A=0;A<u.length;)m.call(P,u[A],A,u),A++;else for(A in u)u.hasOwnProperty(A)&&m.call(P,u[A],A,u)}function w(u,m,P){var A="DEPRECATED METHOD: "+m+`
35
35
  `+P+` AT
36
- `;return function(){var M=new Error("get-stack-trace"),R=M&&M.stack?M.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",X=t.console&&(t.console.warn||t.console.log);return X&&X.call(t.console,A,R),u.apply(this,arguments)}}var _;typeof Object.assign!="function"?_=function(m){if(m===i||m===null)throw new TypeError("Cannot convert undefined or null to object");for(var P=Object(m),A=1;A<arguments.length;A++){var M=arguments[A];if(M!==i&&M!==null)for(var R in M)M.hasOwnProperty(R)&&(P[R]=M[R])}return P}:_=Object.assign;var S=w(function(m,P,A){for(var M=Object.keys(P),R=0;R<M.length;)(!A||A&&m[M[R]]===i)&&(m[M[R]]=P[M[R]]),R++;return m},"extend","Use `assign`."),v=w(function(m,P){return S(m,P,!0)},"merge","Use `assign`.");function x(u,m,P){var A=m.prototype,M;M=u.prototype=Object.create(A),M.constructor=u,M._super=A,P&&_(M,P)}function p(u,m){return function(){return u.apply(m,arguments)}}function g(u,m){return typeof u==o?u.apply(m&&m[0]||i,m):u}function E(u,m){return u===i?m:u}function C(u,m,P){b(J(m),function(A){u.addEventListener(A,P,!1)})}function F(u,m,P){b(J(m),function(A){u.removeEventListener(A,P,!1)})}function G(u,m){for(;u;){if(u==m)return!0;u=u.parentNode}return!1}function V(u,m){return u.indexOf(m)>-1}function J(u){return u.trim().split(/\s+/g)}function Z(u,m,P){if(u.indexOf&&!P)return u.indexOf(m);for(var A=0;A<u.length;){if(P&&u[A][P]==m||!P&&u[A]===m)return A;A++}return-1}function ot(u){return Array.prototype.slice.call(u,0)}function Pt(u,m,P){for(var A=[],M=[],R=0;R<u.length;){var X=m?u[R][m]:u[R];Z(M,X)<0&&A.push(u[R]),M[R]=X,R++}return P&&(m?A=A.sort(function(nt,dt){return nt[m]>dt[m]}):A=A.sort()),A}function wt(u,m){for(var P,A,M=m[0].toUpperCase()+m.slice(1),R=0;R<r.length;){if(P=r[R],A=P?P+M:m,A in u)return A;R++}return i}var Ie=1;function ce(){return Ie++}function be(u){var m=u.ownerDocument||u;return m.defaultView||m.parentWindow||t}var Me=/mobile|tablet|ip(ad|hone|od)|android/i,O="ontouchstart"in t,k=wt(t,"PointerEvent")!==i,Y=O&&Me.test(navigator.userAgent),q="touch",ft="pen",Lt="mouse",Ws="kinect",Js=25,et=1,Ut=2,W=4,I=8,Zs=1,Qe=2,ts=4,es=8,ss=16,Yt=Qe|ts,ve=es|ss,ao=Yt|ve,oo=["x","y"],Ks=["clientX","clientY"];function Et(u,m){var P=this;this.manager=u,this.callback=m,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(A){g(u.options.enable,[u])&&P.handler(A)},this.init()}Et.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(be(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&F(this.element,this.evEl,this.domHandler),this.evTarget&&F(this.target,this.evTarget,this.domHandler),this.evWin&&F(be(this.element),this.evWin,this.domHandler)}};function Jd(u){var m,P=u.options.inputClass;return P?m=P:k?m=xi:Y?m=en:O?m=bi:m=tn,new m(u,Zd)}function Zd(u,m,P){var A=P.pointers.length,M=P.changedPointers.length,R=m&et&&A-M===0,X=m&(W|I)&&A-M===0;P.isFirst=!!R,P.isFinal=!!X,R&&(u.session={}),P.eventType=m,Kd(u,P),u.emit("hammer.input",P),u.recognize(P),u.session.prevInput=P}function Kd(u,m){var P=u.session,A=m.pointers,M=A.length;P.firstInput||(P.firstInput=ho(m)),M>1&&!P.firstMultiple?P.firstMultiple=ho(m):M===1&&(P.firstMultiple=!1);var R=P.firstInput,X=P.firstMultiple,st=X?X.center:R.center,nt=m.center=co(A);m.timeStamp=l(),m.deltaTime=m.timeStamp-R.timeStamp,m.angle=wi(st,nt),m.distance=Qs(st,nt),Qd(P,m),m.offsetDirection=uo(m.deltaX,m.deltaY);var dt=lo(m.deltaTime,m.deltaX,m.deltaY);m.overallVelocityX=dt.x,m.overallVelocityY=dt.y,m.overallVelocity=c(dt.x)>c(dt.y)?dt.x:dt.y,m.scale=X?sm(X.pointers,A):1,m.rotation=X?em(X.pointers,A):0,m.maxPointers=P.prevInput?m.pointers.length>P.prevInput.maxPointers?m.pointers.length:P.prevInput.maxPointers:m.pointers.length,tm(P,m);var zt=u.element;G(m.srcEvent.target,zt)&&(zt=m.srcEvent.target),m.target=zt}function Qd(u,m){var P=m.center,A=u.offsetDelta||{},M=u.prevDelta||{},R=u.prevInput||{};(m.eventType===et||R.eventType===W)&&(M=u.prevDelta={x:R.deltaX||0,y:R.deltaY||0},A=u.offsetDelta={x:P.x,y:P.y}),m.deltaX=M.x+(P.x-A.x),m.deltaY=M.y+(P.y-A.y)}function tm(u,m){var P=u.lastInterval||m,A=m.timeStamp-P.timeStamp,M,R,X,st;if(m.eventType!=I&&(A>Js||P.velocity===i)){var nt=m.deltaX-P.deltaX,dt=m.deltaY-P.deltaY,zt=lo(A,nt,dt);R=zt.x,X=zt.y,M=c(zt.x)>c(zt.y)?zt.x:zt.y,st=uo(nt,dt),u.lastInterval=m}else M=P.velocity,R=P.velocityX,X=P.velocityY,st=P.direction;m.velocity=M,m.velocityX=R,m.velocityY=X,m.direction=st}function ho(u){for(var m=[],P=0;P<u.pointers.length;)m[P]={clientX:h(u.pointers[P].clientX),clientY:h(u.pointers[P].clientY)},P++;return{timeStamp:l(),pointers:m,center:co(m),deltaX:u.deltaX,deltaY:u.deltaY}}function co(u){var m=u.length;if(m===1)return{x:h(u[0].clientX),y:h(u[0].clientY)};for(var P=0,A=0,M=0;M<m;)P+=u[M].clientX,A+=u[M].clientY,M++;return{x:h(P/m),y:h(A/m)}}function lo(u,m,P){return{x:m/u||0,y:P/u||0}}function uo(u,m){return u===m?Zs:c(u)>=c(m)?u<0?Qe:ts:m<0?es:ss}function Qs(u,m,P){P||(P=oo);var A=m[P[0]]-u[P[0]],M=m[P[1]]-u[P[1]];return Math.sqrt(A*A+M*M)}function wi(u,m,P){P||(P=oo);var A=m[P[0]]-u[P[0]],M=m[P[1]]-u[P[1]];return Math.atan2(M,A)*180/Math.PI}function em(u,m){return wi(m[1],m[0],Ks)+wi(u[1],u[0],Ks)}function sm(u,m){return Qs(m[0],m[1],Ks)/Qs(u[0],u[1],Ks)}var nm={mousedown:et,mousemove:Ut,mouseup:W},im="mousedown",rm="mousemove mouseup";function tn(){this.evEl=im,this.evWin=rm,this.pressed=!1,Et.apply(this,arguments)}x(tn,Et,{handler:function(m){var P=nm[m.type];P&et&&m.button===0&&(this.pressed=!0),P&Ut&&m.which!==1&&(P=W),this.pressed&&(P&W&&(this.pressed=!1),this.callback(this.manager,P,{pointers:[m],changedPointers:[m],pointerType:Lt,srcEvent:m}))}});var am={pointerdown:et,pointermove:Ut,pointerup:W,pointercancel:I,pointerout:I},om={2:q,3:ft,4:Lt,5:Ws},fo="pointerdown",mo="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(fo="MSPointerDown",mo="MSPointerMove MSPointerUp MSPointerCancel");function xi(){this.evEl=fo,this.evWin=mo,Et.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}x(xi,Et,{handler:function(m){var P=this.store,A=!1,M=m.type.toLowerCase().replace("ms",""),R=am[M],X=om[m.pointerType]||m.pointerType,st=X==q,nt=Z(P,m.pointerId,"pointerId");R&et&&(m.button===0||st)?nt<0&&(P.push(m),nt=P.length-1):R&(W|I)&&(A=!0),!(nt<0)&&(P[nt]=m,this.callback(this.manager,R,{pointers:P,changedPointers:[m],pointerType:X,srcEvent:m}),A&&P.splice(nt,1))}});var hm={touchstart:et,touchmove:Ut,touchend:W,touchcancel:I},cm="touchstart",lm="touchstart touchmove touchend touchcancel";function po(){this.evTarget=cm,this.evWin=lm,this.started=!1,Et.apply(this,arguments)}x(po,Et,{handler:function(m){var P=hm[m.type];if(P===et&&(this.started=!0),!!this.started){var A=um.call(this,m,P);P&(W|I)&&A[0].length-A[1].length===0&&(this.started=!1),this.callback(this.manager,P,{pointers:A[0],changedPointers:A[1],pointerType:q,srcEvent:m})}}});function um(u,m){var P=ot(u.touches),A=ot(u.changedTouches);return m&(W|I)&&(P=Pt(P.concat(A),"identifier",!0)),[P,A]}var fm={touchstart:et,touchmove:Ut,touchend:W,touchcancel:I},dm="touchstart touchmove touchend touchcancel";function en(){this.evTarget=dm,this.targetIds={},Et.apply(this,arguments)}x(en,Et,{handler:function(m){var P=fm[m.type],A=mm.call(this,m,P);A&&this.callback(this.manager,P,{pointers:A[0],changedPointers:A[1],pointerType:q,srcEvent:m})}});function mm(u,m){var P=ot(u.touches),A=this.targetIds;if(m&(et|Ut)&&P.length===1)return A[P[0].identifier]=!0,[P,P];var M,R,X=ot(u.changedTouches),st=[],nt=this.target;if(R=P.filter(function(dt){return G(dt.target,nt)}),m===et)for(M=0;M<R.length;)A[R[M].identifier]=!0,M++;for(M=0;M<X.length;)A[X[M].identifier]&&st.push(X[M]),m&(W|I)&&delete A[X[M].identifier],M++;if(st.length)return[Pt(R.concat(st),"identifier",!0),st]}var pm=2500,go=25;function bi(){Et.apply(this,arguments);var u=p(this.handler,this);this.touch=new en(this.manager,u),this.mouse=new tn(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}x(bi,Et,{handler:function(m,P,A){var M=A.pointerType==q,R=A.pointerType==Lt;if(!(R&&A.sourceCapabilities&&A.sourceCapabilities.firesTouchEvents)){if(M)gm.call(this,P,A);else if(R&&ym.call(this,A))return;this.callback(m,P,A)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function gm(u,m){u&et?(this.primaryTouch=m.changedPointers[0].identifier,yo.call(this,m)):u&(W|I)&&yo.call(this,m)}function yo(u){var m=u.changedPointers[0];if(m.identifier===this.primaryTouch){var P={x:m.clientX,y:m.clientY};this.lastTouches.push(P);var A=this.lastTouches,M=function(){var R=A.indexOf(P);R>-1&&A.splice(R,1)};setTimeout(M,pm)}}function ym(u){for(var m=u.srcEvent.clientX,P=u.srcEvent.clientY,A=0;A<this.lastTouches.length;A++){var M=this.lastTouches[A],R=Math.abs(m-M.x),X=Math.abs(P-M.y);if(R<=go&&X<=go)return!0}return!1}var wo=wt(a.style,"touchAction"),xo=wo!==i,bo="compute",vo="auto",vi="manipulation",Se="none",ns="pan-x",is="pan-y",sn=xm();function Si(u,m){this.manager=u,this.set(m)}Si.prototype={set:function(u){u==bo&&(u=this.compute()),xo&&this.manager.element.style&&sn[u]&&(this.manager.element.style[wo]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return b(this.manager.recognizers,function(m){g(m.options.enable,[m])&&(u=u.concat(m.getTouchAction()))}),wm(u.join(" "))},preventDefaults:function(u){var m=u.srcEvent,P=u.offsetDirection;if(this.manager.session.prevented){m.preventDefault();return}var A=this.actions,M=V(A,Se)&&!sn[Se],R=V(A,is)&&!sn[is],X=V(A,ns)&&!sn[ns];if(M){var st=u.pointers.length===1,nt=u.distance<2,dt=u.deltaTime<250;if(st&&nt&&dt)return}if(!(X&&R)&&(M||R&&P&Yt||X&&P&ve))return this.preventSrc(m)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function wm(u){if(V(u,Se))return Se;var m=V(u,ns),P=V(u,is);return m&&P?Se:m||P?m?ns:is:V(u,vi)?vi:vo}function xm(){if(!xo)return!1;var u={},m=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(P){u[P]=m?t.CSS.supports("touch-action",P):!0}),u}var nn=1,_t=2,ke=4,le=8,Wt=le,rs=16,Xt=32;function Jt(u){this.options=_({},this.defaults,u||{}),this.id=ce(),this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=nn,this.simultaneous={},this.requireFail=[]}Jt.prototype={defaults:{},set:function(u){return _(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(y(u,"recognizeWith",this))return this;var m=this.simultaneous;return u=rn(u,this),m[u.id]||(m[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return y(u,"dropRecognizeWith",this)?this:(u=rn(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(y(u,"requireFailure",this))return this;var m=this.requireFail;return u=rn(u,this),Z(m,u)===-1&&(m.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(y(u,"dropRequireFailure",this))return this;u=rn(u,this);var m=Z(this.requireFail,u);return m>-1&&this.requireFail.splice(m,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var m=this,P=this.state;function A(M){m.manager.emit(M,u)}P<le&&A(m.options.event+So(P)),A(m.options.event),u.additionalEvent&&A(u.additionalEvent),P>=le&&A(m.options.event+So(P))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=Xt},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(Xt|nn)))return!1;u++}return!0},recognize:function(u){var m=_({},u);if(!g(this.options.enable,[this,m])){this.reset(),this.state=Xt;return}this.state&(Wt|rs|Xt)&&(this.state=nn),this.state=this.process(m),this.state&(_t|ke|le|rs)&&this.tryEmit(m)},process:function(u){},getTouchAction:function(){},reset:function(){}};function So(u){return u&rs?"cancel":u&le?"end":u&ke?"move":u&_t?"start":""}function To(u){return u==ss?"down":u==es?"up":u==Qe?"left":u==ts?"right":""}function rn(u,m){var P=m.manager;return P?P.get(u):u}function Rt(){Jt.apply(this,arguments)}x(Rt,Jt,{defaults:{pointers:1},attrTest:function(u){var m=this.options.pointers;return m===0||u.pointers.length===m},process:function(u){var m=this.state,P=u.eventType,A=m&(_t|ke),M=this.attrTest(u);return A&&(P&I||!M)?m|rs:A||M?P&W?m|le:m&_t?m|ke:_t:Xt}});function an(){Rt.apply(this,arguments),this.pX=null,this.pY=null}x(an,Rt,{defaults:{event:"pan",threshold:10,pointers:1,direction:ao},getTouchAction:function(){var u=this.options.direction,m=[];return u&Yt&&m.push(is),u&ve&&m.push(ns),m},directionTest:function(u){var m=this.options,P=!0,A=u.distance,M=u.direction,R=u.deltaX,X=u.deltaY;return M&m.direction||(m.direction&Yt?(M=R===0?Zs:R<0?Qe:ts,P=R!=this.pX,A=Math.abs(u.deltaX)):(M=X===0?Zs:X<0?es:ss,P=X!=this.pY,A=Math.abs(u.deltaY))),u.direction=M,P&&A>m.threshold&&M&m.direction},attrTest:function(u){return Rt.prototype.attrTest.call(this,u)&&(this.state&_t||!(this.state&_t)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var m=To(u.direction);m&&(u.additionalEvent=this.options.event+m),this._super.emit.call(this,u)}});function Ti(){Rt.apply(this,arguments)}x(Ti,Rt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Se]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&_t)},emit:function(u){if(u.scale!==1){var m=u.scale<1?"in":"out";u.additionalEvent=this.options.event+m}this._super.emit.call(this,u)}});function Ci(){Jt.apply(this,arguments),this._timer=null,this._input=null}x(Ci,Jt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[vo]},process:function(u){var m=this.options,P=u.pointers.length===m.pointers,A=u.distance<m.threshold,M=u.deltaTime>m.time;if(this._input=u,!A||!P||u.eventType&(W|I)&&!M)this.reset();else if(u.eventType&et)this.reset(),this._timer=f(function(){this.state=Wt,this.tryEmit()},m.time,this);else if(u.eventType&W)return Wt;return Xt},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===Wt&&(u&&u.eventType&W?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Pi(){Rt.apply(this,arguments)}x(Pi,Rt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Se]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&_t)}});function Ei(){Rt.apply(this,arguments)}x(Ei,Rt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Yt|ve,pointers:1},getTouchAction:function(){return an.prototype.getTouchAction.call(this)},attrTest:function(u){var m=this.options.direction,P;return m&(Yt|ve)?P=u.overallVelocity:m&Yt?P=u.overallVelocityX:m&ve&&(P=u.overallVelocityY),this._super.attrTest.call(this,u)&&m&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&c(P)>this.options.velocity&&u.eventType&W},emit:function(u){var m=To(u.offsetDirection);m&&this.manager.emit(this.options.event+m,u),this.manager.emit(this.options.event,u)}});function on(){Jt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}x(on,Jt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[vi]},process:function(u){var m=this.options,P=u.pointers.length===m.pointers,A=u.distance<m.threshold,M=u.deltaTime<m.time;if(this.reset(),u.eventType&et&&this.count===0)return this.failTimeout();if(A&&M&&P){if(u.eventType!=W)return this.failTimeout();var R=this.pTime?u.timeStamp-this.pTime<m.interval:!0,X=!this.pCenter||Qs(this.pCenter,u.center)<m.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!X||!R?this.count=1:this.count+=1,this._input=u;var st=this.count%m.taps;if(st===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=Wt,this.tryEmit()},m.interval,this),_t):Wt}return Xt},failTimeout:function(){return this._timer=f(function(){this.state=Xt},this.options.interval,this),Xt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Wt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Zt(u,m){return m=m||{},m.recognizers=E(m.recognizers,Zt.defaults.preset),new _i(u,m)}Zt.VERSION="2.0.7",Zt.defaults={domEvents:!1,touchAction:bo,enable:!0,inputTarget:null,inputClass:null,preset:[[Pi,{enable:!1}],[Ti,{enable:!1},["rotate"]],[Ei,{direction:Yt}],[an,{direction:Yt},["swipe"]],[on],[on,{event:"doubletap",taps:2},["tap"]],[Ci]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var bm=1,Co=2;function _i(u,m){this.options=_({},Zt.defaults,m||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=Jd(this),this.touchAction=new Si(this,this.options.touchAction),Po(this,!0),b(this.options.recognizers,function(P){var A=this.add(new P[0](P[1]));P[2]&&A.recognizeWith(P[2]),P[3]&&A.requireFailure(P[3])},this)}_i.prototype={set:function(u){return _(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?Co:bm},recognize:function(u){var m=this.session;if(!m.stopped){this.touchAction.preventDefaults(u);var P,A=this.recognizers,M=m.curRecognizer;(!M||M&&M.state&Wt)&&(M=m.curRecognizer=null);for(var R=0;R<A.length;)P=A[R],m.stopped!==Co&&(!M||P==M||P.canRecognizeWith(M))?P.recognize(u):P.reset(),!M&&P.state&(_t|ke|le)&&(M=m.curRecognizer=P),R++}},get:function(u){if(u instanceof Jt)return u;for(var m=this.recognizers,P=0;P<m.length;P++)if(m[P].options.event==u)return m[P];return null},add:function(u){if(y(u,"add",this))return this;var m=this.get(u.options.event);return m&&this.remove(m),this.recognizers.push(u),u.manager=this,this.touchAction.update(),u},remove:function(u){if(y(u,"remove",this))return this;if(u=this.get(u),u){var m=this.recognizers,P=Z(m,u);P!==-1&&(m.splice(P,1),this.touchAction.update())}return this},on:function(u,m){if(u!==i&&m!==i){var P=this.handlers;return b(J(u),function(A){P[A]=P[A]||[],P[A].push(m)}),this}},off:function(u,m){if(u!==i){var P=this.handlers;return b(J(u),function(A){m?P[A]&&P[A].splice(Z(P[A],m),1):delete P[A]}),this}},emit:function(u,m){this.options.domEvents&&vm(u,m);var P=this.handlers[u]&&this.handlers[u].slice();if(!(!P||!P.length)){m.type=u,m.preventDefault=function(){m.srcEvent.preventDefault()};for(var A=0;A<P.length;)P[A](m),A++}},destroy:function(){this.element&&Po(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Po(u,m){var P=u.element;if(P.style){var A;b(u.options.cssProps,function(M,R){A=wt(P.style,R),m?(u.oldCssProps[A]=P.style[A],P.style[A]=M):P.style[A]=u.oldCssProps[A]||""}),m||(u.oldCssProps={})}}function vm(u,m){var P=e.createEvent("Event");P.initEvent(u,!0,!0),P.gesture=m,m.target.dispatchEvent(P)}_(Zt,{INPUT_START:et,INPUT_MOVE:Ut,INPUT_END:W,INPUT_CANCEL:I,STATE_POSSIBLE:nn,STATE_BEGAN:_t,STATE_CHANGED:ke,STATE_ENDED:le,STATE_RECOGNIZED:Wt,STATE_CANCELLED:rs,STATE_FAILED:Xt,DIRECTION_NONE:Zs,DIRECTION_LEFT:Qe,DIRECTION_RIGHT:ts,DIRECTION_UP:es,DIRECTION_DOWN:ss,DIRECTION_HORIZONTAL:Yt,DIRECTION_VERTICAL:ve,DIRECTION_ALL:ao,Manager:_i,Input:Et,TouchAction:Si,TouchInput:en,MouseInput:tn,PointerEventInput:xi,TouchMouseInput:bi,SingleTouchInput:po,Recognizer:Jt,AttrRecognizer:Rt,Tap:on,Pan:an,Swipe:Ei,Pinch:Ti,Rotate:Pi,Press:Ci,on:C,off:F,each:b,merge:v,extend:S,assign:_,inherit:x,bindFn:p,prefixed:wt});var Sm=typeof t<"u"?t:typeof self<"u"?self:{};Sm.Hammer=Zt,typeof i=="function"&&i.amd?i(function(){return Zt}):n.exports?n.exports=Zt:t[s]=Zt})(window,document,"Hammer")})(Da);var zu=Da.exports;const Gu=qi(zu);function Vu(){const n=window.screen;return{screenWidth:n.width,screenHeight:n.height,screenX:window.screenX,screenY:window.screenY}}function We(){const n=document.documentElement;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function qu(){const n=document.body;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function ju(){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 Hu(){const{scrollWidth:n,scrollHeight:t}=We();return{width:n,height:t}}function Ia(n){const{top:t,left:e,width:s,height:i}=n.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=We();return{x:e+r,y:t+a,width:s,height:i}}function $u(n){let t=n,e=0,s=0;for(;t!==null;)e+=t.offsetLeft,s+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:s,width:n.offsetWidth,height:n.offsetHeight}}function Ma(n){return n.getBoundingClientRect()}function Wu(n){const t=n.getBoundingClientRect();return{x:n.offsetLeft,y:n.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function Ju(){const{clientHeight:n,scrollTop:t,scrollHeight:e}=We(),s=e-n;return s<=0?0:t/s*100}function Zu(n){if("center"in n){const t=n.center,e=Ma(n.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:n.clientX,y:n.clientY}}function ka(n){if("center"in n)return n.center;if(typeof n.pageX=="number"&&typeof n.pageY=="number")return{x:n.pageX,y:n.pageY};const{scrollLeft:t,scrollTop:e}=We();return{x:n.clientX+t,y:n.clientY+e}}function Mt(n,t){if(!t&&"offsetX"in n)return{x:n.offsetX,y:n.offsetY};const e=ka(n),s=Ia(t||n.target);return{x:e.x-s.x,y:e.y-s.y}}class Ku extends ls{container;width;height;mousePoint={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0};hammer;removes=[];constructor(t=document.documentElement,e=!0,s){super(),this.container=t,this.width=t.offsetWidth,this.height=t.offsetHeight,this.hammer=new Gu(this.container),e&&this.start(s)}emitDebounce=Vo((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.registerTransitionEventListeners(),this.registerAnimationEventListeners(),this.registerResizeObserver(),t&&t.forEach(e=>{this.addRemoves(e())}),this.on("pointerMove",e=>{this.setMousePoint(Mt(e,this.container))})}destroy(){this.removes.forEach(t=>t()),this.removes=[],this.removeAllListeners()}restart(){this.destroy(),this.start()}addRemoves(t){this.removes.push(t)}registerMouseEventListeners(){const t=I=>{this.emit("mouseDown",I)},e=I=>{this.emit("mouseUp",I)},s=I=>{this.emit("mouseMove",I)},i=I=>{this.emit("mouseOver",I)},r=I=>{this.emit("mouseOut",I)},a=I=>{this.emit("mouseEnter",I)},o=I=>{this.emit("mouseLeave",I)},h=I=>{this.emit("mouseClick",I)},c=I=>{this.emit("mouseDoubleClick",I)},l=I=>{this.emit("mouseWheel",I)},f=I=>{this.emit("mouseContextMenu",I)},y=I=>{this.emit("touchStart",I)},b=I=>{this.emit("touchEnd",I)},w=I=>{this.emit("touchCancel",I)},_=I=>{this.emit("touchMove",I)},S=I=>{this.emit("pointerDown",I)},v=I=>{this.emit("pointerUp",I)},x=I=>{this.emit("pointerCancel",I)},p=I=>{this.emit("pointerMove",I)},g=I=>{this.emit("pan",I)},E=I=>{this.emit("panStart",I)},C=I=>{this.emit("panMove",I)},F=I=>{this.emit("panEnd",I)},G=I=>{this.emit("panCancel",I)},V=I=>{this.emit("panLeft",I)},J=I=>{this.emit("panRight",I)},Z=I=>{this.emit("panUp",I)},ot=I=>{this.emit("panDown",I)},Pt=I=>{this.emit("pinch",I)},wt=I=>{this.emit("press",I)},Ie=I=>{this.emit("rotate",I)},ce=I=>{this.emit("swipe",I)},be=I=>{this.emit("swipeLeft",I)},Me=I=>{this.emit("swipeRight",I)},O=I=>{this.emit("swipeUp",I)},k=I=>{this.emit("swipeDown",I)},Y=I=>{this.emit("tap",I)},q=I=>{!I.target||this.container==I.target||this.container.contains(I.target)||this.emit("tapOutSide",I)},ft=I=>{this.emit("inputChange",I,this.container.files)},Lt=I=>{this.emit("dragstart",I)},Ws=I=>{I.dataTransfer&&(I.dataTransfer.dropEffect="copy"),this.emit("dragover",I)},Js=I=>{this.emit("dragenter",I)},et=I=>{this.emit("dragend",I)},Ut=I=>{I.dataTransfer,this.emit("drop",I,I.dataTransfer?.files)};this.container.addEventListener("mousedown",t,!1),this.container.addEventListener("mouseup",e,!1),this.container.addEventListener("mousemove",s,!1),this.container.addEventListener("mouseover",i,!1),this.container.addEventListener("mouseout",r,!1),this.container.addEventListener("mouseenter",a,!1),this.container.addEventListener("mouseleave",o,!1),this.container.addEventListener("click",h,!1),this.container.addEventListener("dblclick",c,!1),this.container.addEventListener("wheel",l,!1),this.container.addEventListener("contextmenu",f,!1),this.container.addEventListener("touchstart",y,!1),this.container.addEventListener("touchend",b,!1),this.container.addEventListener("touchcancel",w,!1),this.container.addEventListener("touchmove",_,!1),this.container.addEventListener("pointerdown",S,!1),this.container.addEventListener("pointerup",v,!1),this.container.addEventListener("pointercancel",x,!1),this.container.addEventListener("pointermove",p,!1),this.hammer.on("pan",g),this.hammer.on("panstart",E),this.hammer.on("panmove",C),this.hammer.on("panend",F),this.hammer.on("pancancel",G),this.hammer.on("panleft",V),this.hammer.on("panright",J),this.hammer.on("panup",Z),this.hammer.on("pandown",ot),this.hammer.on("pinch",Pt),this.hammer.on("press",wt),this.hammer.on("rotate",Ie),this.hammer.on("swipe",ce),this.hammer.on("swipeleft",be),this.hammer.on("swiperight",Me),this.hammer.on("swipeup",O),this.hammer.on("swipedown",k),this.hammer.on("tap",Y),document.addEventListener("pointerdown",q,!1),this.container instanceof HTMLInputElement&&this.container.addEventListener("change",ft,!1),this.container.addEventListener("dragstart",Lt,!1),this.container.addEventListener("dragover",Ws,!1),this.container.addEventListener("dragenter",Js,!1),this.container.addEventListener("dragend",et,!1),this.container.addEventListener("drop",Ut,!1);const W=()=>{this.container.removeEventListener("mousedown",t,!1),this.container.removeEventListener("mouseup",e,!1),this.container.removeEventListener("mousemove",s,!1),this.container.removeEventListener("mouseover",i,!1),this.container.removeEventListener("mouseout",r,!1),this.container.removeEventListener("mouseenter",a,!1),this.container.removeEventListener("mouseleave",o,!1),this.container.removeEventListener("click",h,!1),this.container.removeEventListener("dblclick",c,!1),this.container.removeEventListener("wheel",l,!1),this.container.removeEventListener("contextmenu",f,!1),this.container.removeEventListener("touchstart",y,!1),this.container.removeEventListener("touchend",b,!1),this.container.removeEventListener("touchcancel",w,!1),this.container.removeEventListener("touchmove",_,!1),this.container.removeEventListener("pointerdown",S,!1),this.container.removeEventListener("pointerup",v,!1),this.container.removeEventListener("pointercancel",x),this.container.removeEventListener("pointermove",p,!1),this.hammer.off("pan",g),this.hammer.off("panstart",E),this.hammer.off("panmove",C),this.hammer.off("panend",F),this.hammer.off("pancancel",G),this.hammer.off("panleft",V),this.hammer.off("panright",J),this.hammer.off("panup",Z),this.hammer.off("pandown",ot),this.hammer.off("pinch",Pt),this.hammer.off("press",wt),this.hammer.off("rotate",Ie),this.hammer.off("swipe",ce),this.hammer.off("swipeleft",be),this.hammer.off("swiperight",Me),this.hammer.off("swipeup",O),this.hammer.off("swipedown",k),this.hammer.off("tap",Y),document.removeEventListener("pointerdown",q,!1),document.removeEventListener("touchstart",q,!1),document.removeEventListener("mousedown",q,!1),this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",ft,!1),this.container.removeEventListener("dragstart",Lt,!1),this.container.removeEventListener("dragover",Ws,!1),this.container.removeEventListener("dragenter",Js,!1),this.container.removeEventListener("dragend",et,!1),this.container.removeEventListener("drop",Ut,!1)};return this.addRemoves(W),W}registerTransitionEventListeners(){const t=i=>{this.emit("transitionstart",i)},e=i=>{this.emit("transitionend",i)};this.container.addEventListener("transitionstart",t,!1),this.container.addEventListener("transitionend",e,!1);const s=()=>{this.container.removeEventListener("transitionstart",t,!1),this.container.removeEventListener("transitionend",e,!1)};return this.addRemoves(s),s}registerAnimationEventListeners(){const t=i=>{this.emit("animationstart",i)},e=i=>{this.emit("animationend",i)};this.container.addEventListener("animationstart",t,!1),this.container.addEventListener("animationend",e,!1);const s=()=>{this.container.removeEventListener("animationstart",t,!1),this.container.removeEventListener("animationend",e,!1)};return this.addRemoves(s),s}registerResizeObserver(){const{on:t,destroy:e}=ya(this.container),s=t((r,a)=>{this.width=r,this.height=a,this.emit("resize",r,a)}),i=()=>{s(),e()};return this.addRemoves(i),i}registerPullDownRefresh(t){const e=t?.distance||50;return this.captureDrag({move:(s,i)=>{i.dStartY>0&&i.dStartY<e&&this.emit("pullDowning",i.dStartY)},end:(s,i)=>{i.dStartY>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;return this.captureDrag({move:(s,i)=>{i.dStartY>0&&i.dStartY<e&&this.emit("pullUping",i.dStartY)},end:(s,i)=>{i.dStartY>=e&&this.emit("pullUp")}})}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}captureDrag(t){return this.captureDragUsePointer(t)}captureDragUsePointer(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),this.on("pointerMove",a),this.on("pointerUp",r),this.on("pointerCancel",r),s=Mt(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("pointerMove",a),this.off("pointerUp",r),this.off("pointerCancel",r),s=Mt(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=Mt(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("pointerDown",i);const o=()=>{this.off("pointerDown",i)};return this.addRemoves(o),o}captureDragUseMouse(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",r,!1),s=Mt(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",r,!1),s=Mt(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=Mt(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("mouseDown",i);const o=()=>{this.off("mouseDown",i)};return this.addRemoves(o),o}captureDragUseTouch(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),this.on("touchMove",a),this.on("touchEnd",r),this.on("touchCancel",r);const c=h.changedTouches[0];s=Mt(c,this.container);const l={...s};e=l,this.setMousePoint(l),t?.start?.(c,l)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("touchMove",a),this.off("touchEnd",r),this.off("touchCancel",r);const c=h.changedTouches[0];s=Mt(c,this.container);const l={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.end?.(c,l),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c=h.changedTouches[0],l={...s};s=Mt(c,this.container);const f={...s,dx:s.x-(l.x||0),dy:s.y-(l.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(f),t?.move?.(c,f)};this.on("touchStart",i);const o=()=>{this.off("touchStart",i)};return this.addRemoves(o),o}}class Je{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"),i=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),i.src=URL.createObjectURL(r),i.media="(min-width:10px)",s.append(i),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(()=>{Je.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 La extends ls{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Eo(this.source);if(t===0){this.emit("finish");return}let e,s,i=Li(this.source,0);for(let r=1;r<t;r++)e=s,s=i,i=Li(this.source,r),this.raw+=s,s&&this.step(s,i,e);i&&this.step(i,void 0,s),this.emit("finish")}step(t,e,s){t==`
37
- `&&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":Gt("whitespace",t)?(this.textchunk+=Ra(this.entity),this.mode="text"):t==";"?(this.textchunk+=Ra(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(!Gt("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":Gt("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(Gt("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(Gt("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":Gt("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(Gt("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(!Gt("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(Gt("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 Ra(n){const t={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 e;return n.charAt(0)=="#"?n.charAt(1).toLowerCase()=="x"?e=parseInt(n.substring(2),16):e=parseInt(n.substring(1),10):e=t[n],e?String.fromCharCode(e):"&"+n}var Oa=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Fa(n,t={}){var e=1,s=1;function i(O){var k=O.match(/\n/g);k&&(e+=k.length);var Y=O.lastIndexOf(`
38
- `);s=~Y?O.length-Y:s+O.length}function r(){var O={line:e,column:s};return function(k){return k.position=new a(O),w(),k}}function a(O){this.start=O,this.end={line:e,column:s},this.source=t.source}a.prototype.content=n;var o=[];function h(O){var k=new Error(t.source+":"+e+":"+s+": "+O);if(k.reason=O,k.filename=t.source,k.line=e,k.column=s,k.source=n,t.silent)o.push(k);else throw k}function c(){var O=y();return{type:"stylesheet",stylesheet:{source:t.source,rules:O,parsingErrors:o}}}function l(){return b(/^{\s*/)}function f(){return b(/^}/)}function y(){var O,k=[];for(w(),_(k);n.length&&n.charAt(0)!="}"&&(O=be()||Me());)O!==!1&&(k.push(O),_(k));return k}function b(O){var k=O.exec(n);if(k){var Y=k[0];return i(Y),n=n.slice(Y.length),k}}function w(){b(/^\s*/)}function _(O){var k;for(O=O||[];k=S();)k!==!1&&O.push(k);return O}function S(){var O=r();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var k=2;n.charAt(k)!=""&&(n.charAt(k)!="*"||n.charAt(k+1)!="/");)++k;if(k+=2,n.charAt(k-1)==="")return h("End of comment missing");var Y=n.slice(2,k-2);return s+=2,i(Y),n=n.slice(k),s+=2,O({type:"comment",comment:Y})}}function v(){var O=b(/^([^{]+)/);if(O)return jt(O[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(k){return k.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(k){return k.replace(/\u200C/g,",")})}function x(){var O=r(),k=b(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(k){if(k=jt(k[0]),!b(/^:\s*/))return h("property missing ':'");var Y=b(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),q=O({type:"declaration",property:k.replace(Oa,""),value:Y?jt(Y[0]).replace(Oa,""):""});return b(/^[;\s]*/),q}}function p(){var O=[];if(!l())return h("missing '{'");_(O);for(var k;k=x();)k!==!1&&(O.push(k),_(O));return f()?O:h("missing '}'")}function g(){for(var O,k=[],Y=r();O=b(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)k.push(O[1]),b(/^,\s*/);if(k.length)return Y({type:"keyframe",values:k,declarations:p()})}function E(){var O=r(),k=b(/^@([-\w]+)?keyframes\s*/);if(k){var Y=k[1];if(k=b(/^([-\w]+)\s*/),!k)return h("@keyframes missing name");var q=k[1];if(!l())return h("@keyframes missing '{'");for(var ft,Lt=_();ft=g();)Lt.push(ft),Lt=Lt.concat(_());return f()?O({type:"keyframes",name:q,vendor:Y,keyframes:Lt}):h("@keyframes missing '}'")}}function C(){var O=r(),k=b(/^@supports *([^{]+)/);if(k){var Y=jt(k[1]);if(!l())return h("@supports missing '{'");var q=_().concat(y());return f()?O({type:"supports",supports:Y,rules:q}):h("@supports missing '}'")}}function F(){var O=r(),k=b(/^@host\s*/);if(k){if(!l())return h("@host missing '{'");var Y=_().concat(y());return f()?O({type:"host",rules:Y}):h("@host missing '}'")}}function G(){var O=r(),k=b(/^@media *([^{]+)/);if(k){var Y=jt(k[1]);if(!l())return h("@media missing '{'");var q=_().concat(y());return f()?O({type:"media",media:Y,rules:q}):h("@media missing '}'")}}function V(){var O=r(),k=b(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(k)return O({type:"custom-media",name:jt(k[1]),media:jt(k[2])})}function J(){var O=r(),k=b(/^@page */);if(k){var Y=v()||[];if(!l())return h("@page missing '{'");for(var q=_(),ft;ft=x();)q.push(ft),q=q.concat(_());return f()?O({type:"page",selectors:Y,declarations:q}):h("@page missing '}'")}}function Z(){var O=r(),k=b(/^@([-\w]+)?document *([^{]+)/);if(k){var Y=jt(k[1]),q=jt(k[2]);if(!l())return h("@document missing '{'");var ft=_().concat(y());return f()?O({type:"document",document:q,vendor:Y,rules:ft}):h("@document missing '}'")}}function ot(){var O=r(),k=b(/^@font-face\s*/);if(k){if(!l())return h("@font-face missing '{'");for(var Y=_(),q;q=x();)Y.push(q),Y=Y.concat(_());return f()?O({type:"font-face",declarations:Y}):h("@font-face missing '}'")}}var Pt=ce("import"),wt=ce("charset"),Ie=ce("namespace");function ce(O){var k=new RegExp("^@"+O+"\\s*([^;]+);");return function(){var Y=r(),q=b(k);if(q){var ft={type:O};return ft[O]=q[1].trim(),Y(ft)}}}function be(){if(n[0]=="@")return E()||G()||V()||C()||Pt()||wt()||Ie()||Z()||J()||F()||ot()}function Me(){var O=r(),k=v();return k?(_(),O({type:"rule",selectors:k,declarations:p()})):h("selector missing")}return ei(c())}function jt(n){return n?n.replace(/^\s+|\s+$/g,""):""}function ei(n,t){var e=n&&typeof n.type=="string",s=e?n:t;for(var i in n){var r=n[i];Array.isArray(r)?r.forEach(function(a){ei(a,s)}):r&&typeof r=="object"&&ei(r,s)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}class Na extends La{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=Fa(e);for(const i of s.stylesheet.rules)for(const r of i.declarations)for(const a of i.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 i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",a="";for(const o in this.groups[i])o=="transform"?r=this.groups[i].transform:o=="class"&&this.globalStyles["."+this.groups[i][o]]?a=this.globalStyles["."+this.groups[i][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[i][o]]?a=this.globalStyles["#"+this.groups[i][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[i][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),ni(this.currentItem.style,this.currentItem,ii)}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=[],i;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":i={},e.style&&ni(e.style,i),i.offset=i.offset||e.offset,i.color=i["stop-color"]||e["stop-color"],i.opacity=i["stop-opacity"]||e["stop-opacity"],~(i.offset+"").indexOf("%")?i.offset=parseFloat(i.offset):i.offset=parseFloat(i.offset)*100,i.offset=+i.offset.toFixed(2),this.grad.stops.push(i);break;case"linearGradient":this.grad.angle=(360+si(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++)i=this.grad.stops[o],o&&o!=h-1?s.push(i.color+":"+i.offset):s.push(i.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++)i=this.grad.stops[o],o&&o!=h-1?s.push(i.color+":"+i.offset):s.push(i.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(const r in e){const a=e[r];if(ii.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"&&ni(a,this.currentItem,ii),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 si(n,t,e,s,i,r){if(typeof i>"u"||typeof r>"u"){const a=n-e,o=t-s;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return si(n,t,i,r)-si(e,s,i,r)}function ni(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){const o=s[r].split(":"),h=o[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(i,""))}}const ii=["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 Qu{app;rootEl;ue;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e,s){this.app=t,this.rootEl=bt.createSVGElement("svg"),this.ue=kt(this.rootEl);const i=kt(this.app.container);i.empty(),i.insert(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.captureDrag({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:(r,a)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=a.dx,this.dragDy+=a.dy),this.setCursor()}}),this.app.on("tap",()=>{for(const r of this.shapes)if(this.currentMouseInShape==r){r.emit("clicked");let a=r.parent;for(;a;)a.emit("clicked",r),a=a.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 oe(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return bt.downloadFromSVGElement(this.rootEl)}_addDrawShape(t){this.shapes.findIndex(e=>e.id==t.id)===-1&&(this.shapes.push(t),t instanceof at&&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(const e of this.shapes){if(!e.isShow){e.el&&(e.el.remove(),delete e.el);continue}if(e.frameStart(this.app.mousePoint),e.el||(e instanceof Ze?e.el=this.text(e.text,e.x,e.y,Fi(e.getAttrs(),(i,r)=>typeof r=="string")):(e.el=bt.createSvgPath(e.toSVGPathD(),e.id),this.ue.insert(e.el))),e.followMouse&&(!hs(e.x,this.app.mousePoint.x,5)||!hs(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 i=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,i||r){if(e.x+=i,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",i,r)}}else e.isDragging=!1;e instanceof Ze&&(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,Fi(e.getAttrs(),(i,r)=>typeof r=="string")),this.attr(e,"d",s),!this.currentMouseInShape){const i=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=i,i&&(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&&e.el.remove(),delete e.el,this.shapes=this.shapes.filter(s=>s.id!==e.id)})}clear(){this.shapes.forEach(t=>{t.el&&t.el.remove(),delete t.el}),this.ue.empty(),this.shapes=[]}attr(t,e,s){const i=t.el||t;return i instanceof SVGElement?e===void 0&&s===void 0?oe(i):typeof e=="string"&&s===void 0?oe(i,mt(e))||"":(typeof e=="object"?oe(i,e):typeof e=="string"&&s!==void 0&&oe(i,mt(e),s),this):this}circle(t,e,s){return this.path(new Ht({x:t,y:e,radius:s}))}circleEl(t,e,s){const i=bt.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(s)});return this.ue.insert(i),i}ellipse(t,e,s,i){return this.path(new Ua({x:t,y:e,rx:s,ry:i}))}ellipseEl(t,e,s,i){const r=bt.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(s),ry:String(i)});return this.ue.insert(r),r}rect(t,e,s,i){return this.path(new $t({x:t,y:e,width:s,height:i}))}rectEl(t,e,s,i){const r=bt.createSVGElement("rect",{x:String(t),y:String(e),width:String(s),height:String(i)});return this.ue.insert(r),r}image(t,e,s,i,r){}text(t,e,s,i){const r=bt.createSVGElement("text",{x:String(e),y:String(s)});return kt(r).html(t),this.attr(r,Object.assign({"alignment-baseline":"middle"},i)),this.ue.insert(r),r}textWithTspan(t,e,s,i){const r=i?.["line-height"]||"1.2em",a=bt.createSVGElement("text",{x:String(e),y:String(s)});return t.split(`
39
- `).forEach((o,h)=>{if(o.trim()){const c=bt.createSVGElement("tspan",{x:String(e),dy:h>0?r:"0"});kt(c).html(o),kt(a).insert(c),this.attr(c,Object.assign({"alignment-baseline":"middle"},i))}}),this.ue.insert(a),a}}class tf extends at{svgWidth=0;svgHeight=0;width=0;height=0;constructor(t){super(t);const e=new Na(t.svg).parse();for(let s=0,i=e.length;s<i;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"||!pe.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=pe.absolutizeSVGPath(pe.parseSVGPath(r.path)),h=[];let c=[];for(let l=0,f=o.length;l<f;l++){const y=o[l];c.push(y),y[0].toLowerCase()=="z"&&(h.push(c),c=[])}c.length&&h.push(c),h.forEach(l=>{const f=jn(r.transform??"");f.scale(this.width&&this.svgWidth?this.width/this.svgWidth:1),this.addShape(new j({...t,attrs:{...a,...t?.attrs||{}},d:l,originMatrix:f}))})}}shapeInit(){this.trim()}}class Ht extends j{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 Rs(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=It(-r,e,s),h=It(-r,this.vx,this.vy),c=It(-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 f=Math.abs(h.x)+Math.abs(c.x),y=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/f*y,o.x+=c.x/f*y;const b=It(r,a.x,a.y),w=It(r,o.x,o.y);t.x=this.x+w.x,t.y=this.y+w.y,this.x=this.x+b.x,this.y=this.y+b.y;const _=It(r,h.x,h.y),S=It(r,c.x,c.y);this.vx=_.x,this.vy=_.y,t.vx=S.x,t.vy=S.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,s=t.wall.x,i=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<i&&(this.y=i+this.radius,this.vy*=e)}}class Ba extends j{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,i=(this.points[0].y+this.points[e-1].y)/2;t.push(["M",s,i]);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,i])}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,i=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(s,i);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,i)}}isContainPoint(t,e){const s=this.points.length;let i=!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,f=this.points[o].y;if(h===t&&c===e||l===t&&f===e||e===c&&e===f)return!0;if(e>=c&&e<f||e<c&&e>=f){const y=(l-h)/(f-c),b=h+y*(e-c);if(b===t||Math.abs(b-t)<r)return!0;b>t&&(i=!i)}}return i}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}}class $t extends j{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,i,r,a,o,h){const c=new gt({x:t,y:e,c1x:s,c1y:i,c2x:r,c2y:a,toX:o,toY:h});return new $t(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 Ua extends j{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 ef extends j{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 sf extends j{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 nf extends j{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 rf extends j{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 af extends j{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,i=this.r*Math.cos(B(s)),r=this.r*Math.sin(B(s));t.push(["l",i,r])}return t}}class of extends j{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,30],["a",15,15,0,1,1,0,-30]]}}class hf extends j{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 cf extends at{constructor(t){super(t);const e=new we({...t,x:this.x,y:this.y,toX:this.x,toY:this.y-140-Math.random()*20}),s=30+Math.random()*30,i=new we({...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 we({...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,i,a])}}class Ze extends j{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=hn(this.getAttr("fontSize"),10).number,s=hn(this.getAttr("fontWeight"),400).number,i=this.measureText(this.text,e,s);this.width=i.width,this.height=i.height}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}measureText(t,e=12,s=400){const i=document.createElement("span");i.style.visibility="hidden",i.style.margin="0",i.style.padding="0",i.style.inset="0",i.style.whiteSpace="nowrap",i.style.overflow="visible",i.style.fontSize=e+"px",i.style.fontWeight=s.toString(),i.innerText=t,document.body.appendChild(i);const r=i.offsetWidth,a=i.offsetHeight;return document.body.removeChild(i),{width:r,height:a}}getFixedWidthText(t,e,s=12,i=400,r=!0){let a="";if(!t||e<s)return a;const o=t.split(""),h="...";let c=r?this.measureText(h,s,i).width:0;for(let l=0,f=o.length;l<f;l++)if(c+=this.measureText(o[l],s,i).width,c>e){r&&(a+=h);break}else a+=o[l];return a}}class Ya extends at{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 Ze({...t,x:this.x+this.offset,y:this.y+this.offset,text:this.text,attrs:{...this.getAttrs(),fill:$e(this.bg).opposite(!0).toString(),textAnchor:"start"}}),this.bgShape=new $t({...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(){pt(()=>{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 lf extends at{radius;expandRaidus;startDegree;endDegree;text="";defaultShowText;tip="";p1=new Ht;p1Offset=10;p2=new Ht;p2Offset=40;p3=new Ht;p3Offset=10;p4=new Ht;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 Xa({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 we({x:this.p1.x,y:this.p1.y,toX:this.p2.x,toY:this.p2.y,attrs:{...e},isShow:this.defaultShowText}),this.line23=new we({x:this.p2.x,y:this.p2.y,toX:this.p3.x,toY:this.p3.y,attrs:{...e},isShow:this.defaultShowText}),this.textShape=new Ze({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 Ya({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:i}=Bt(B(e),this.sectorArc.radius+this.p1Offset);this.p1.x=this.x+s,this.p1.y=this.y+i;const{dx:r,dy:a}=Bt(B(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 Xa extends j{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=8.333333333333334,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}=Bt(B(this.startDegree),this.radius),{dx:s,dy:i}=Bt(B(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,i-e],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,B(this.startDegree),B(this.endDegree),!1),t.closePath()}containPoint(t,e){const s=Os(this.x,this.y,t,e),i=rt(ne(this.x,this.y,t,e));return s<=this.radius&&i>=this.startDegree&&i<=this.endDegree}}class uf extends at{showFlame;ship;flame;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t.showFlame:!1,this.ship=new j({...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 j({...t,isShow:this.showFlame,d:[["m",-10,-5],["l",-7.5,5],["l",7.5,5],["z"]]}),this.addShape(this.flame)}shapeInit(){pt(()=>{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 ff extends at{value;backgroundRect;occupyRect;handle;constructor(t){super(t);const e=t?.min||0,s=t?.max||100,i=t?.step||1,r=Lo(e,s,i);this.value=r(typeof t?.defaultValue=="number"?H(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,f=t?.barColor||Qn.colorGrayF5,y=t?.handleColor||Qn.colorPrimary;this.backgroundRect=new $t({x:this.x,y:this.y,width:o,height:h,borderRadius:l,attrs:{fill:f},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.backgroundRect),this.occupyRect=new $t({x:this.x,y:this.y,width:o*a,height:h,borderRadius:l,attrs:{fill:y},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.occupyRect),this.handle=new Ht({x:this.x+o*a,y:this.y+l,diffXInGroup:o*a,diffYInGroup:l,radius:c,alongPath:new zl({x:this.x,y:this.y+l,d:[["m",0,0],["l",o,0]]}),attrs:{fill:y},enableDrag:!0,independentTransformInGroup:!0}),this.addShape(this.handle),this.handle.on("draging",b=>{this.occupyRect.width=H(this.occupyRect.width+b,0,o),this.value=r((this.handle.x-this.x)/o*(s-e)+e),this.emit("change",this.value)})}}class df extends at{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 Ht({...t,x:this.x,y:this.y,radius:2}),this.forceSetCXY(this.controlPoint.cX,this.controlPoint.cY),this.mainRect=new $t({...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 Ht({...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(B(this.controlPoint.degree))*this.width,y:this.controlPoint.y+Math.sin(B(this.controlPoint.degree))*this.width}}}class ri extends j{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(B(this.extendDegree))),this.y=(t.y||0)+t.height-t.lineWidth-this.radius*Math.abs(Math.sin(B(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}=Bt(B(this.startDegree),this.radius),{dx:s,dy:i}=Bt(B(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,i-e]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,B(this.startDegree),B(this.endDegree),!1)}}class mf extends at{percent=0;ringBg;ring;lines=[];bgColor;startColor;endColor;indicatorLineCount;constructor(t){super(t);const e=t?.startDegree||0,s=t?.endDegree||180,i=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=23;const a=20,o=2,h=17;this.ringBg=new ri({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:i,lineWidth:r,color:this.bgColor}),this.addShape(this.ringBg),this.ring=new ri({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:i,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 we({...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+i*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(i=>{i!=s&&(i.x+=t,i.y+=e)})})}frameUpdate(t,e){const s=this.ringBg.radius-this.ringBg.radius*Math.cos(Math.PI*this.percent),i=this.ringBg.radius*Math.sin(Math.PI*this.percent);if(e){const r=e.createLinearGradient(-this.ringBg.radius,0,-this.ringBg.radius+s,-i,{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 pf extends j{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=H(t,0,1),this.brightness}toSVGPathData(){return[]}}const gf=pf;class yf extends j{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(),this.points=t,this.light=new gf({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(),i=this.points[1].getScreenY()-this.points[2].getScreenY();return t*i>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},i=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(i/(r*a))/Math.PI*this.light.brightness}getAdjustedColor(t){const e=$e(t),s=this.getLightFactor();return e.r*=s,e.g*=s,e.b*=s,e.toString()}}class wf extends at{fettis=[];constructor(t,e,s){super();const{shape:i,x:r,y:a,particleCount:o,angle:h,spread:c,startVelocity:l,decay:f,gravity:y,drift:b,ticks:w,colors:_,scalar:S,flat:v}=Object.assign({shape:$t,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:Aa,scalar:1,flat:!1},s||{}),x=B(h),p=B(c);let g=o;for(;g--;){const E=_[g%_.length],C=new i({x:t*r,y:e*a,width:10,height:10,scalar:S,attrs:{fill:E},independentTransformInGroup:!0});this.addShape(C),this.fettis.push({shape:C,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:l*.5+Math.random()*l,angle2D:-x+(.5*p-Math.random()*p),tiltAngle:(Math.random()*.5+.25)*Math.PI,tick:0,totalTicks:w,decay:f,drift:b,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:y*3,scalar:S,flat:v,color:$e(E)})}}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,i=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",e.color.setAlpha(1-s).toString()),e.shape.degree=rt(Math.PI/10*e.wobble),e.shape.scalarX=Math.abs(a-i)*.1,e.shape.scalarY=Math.abs(o-r)*.1,e.tick<e.totalTicks}))}}class ai{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,i=e-1;s<i;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 i=s+1;i<t;i++)e.checkCollision(this.shapes[i]),e.gravitateTo(this.shapes[i])})}springChain(t){this.shapes.forEach((e,s)=>{s>0&&e.runSpringTo(this.shapes[s-1],t)})}springConnect(t){const e=Kt(t?.springLength,100);this.shapes.forEach(s=>{s.isDragging||this.shapes.filter(i=>i.id!==s.id).forEach(i=>{const r=ne(s.x,s.y,i.x,i.y);s.runSpringTo({x:i.x-Math.cos(r)*e,y:i.y-Math.sin(r)*e},t)})})}springMass(t,e){const s=this.shapes.length,i=[];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++)i.push([r.x,r.y,this.shapes[o].x,this.shapes[o].y,r.springMassTo(this.shapes[o],e)])}),i}polymorph(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");const t=this.shapes.length-1,e=new Array(t);for(let i=0;i<t;i++){const r=this.shapes[i].initPathD();this.shapes[i].frameStart();const a=this.shapes[i+1].initPathD();this.shapes[i+1].frameStart();const o=Math.max(r.polymorphPoints.length,a.polymorphPoints.length);e[i]=vt.getPathInterpolator(r.expendFill(o),a.expendFill(o))}const s=new j({d:e[0](0)});return i=>{const r=Ot(t*i,6),a=Math.min(Math.floor(r),t-1),o=Ot(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",ut.gradient(h,c,o).toString());const l=this.shapes[a].getAttr("stroke","none"),f=this.shapes[a+1].getAttr("stroke","none");return typeof l=="string"&&typeof f=="string"&&s.setAttr("stroke",ut.gradient(l,f,o).toString()),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 at?(h=o,h.sortPathD()):(h=new at,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 i=[];s.forEach((o,h)=>{o.shapes.forEach((c,l)=>{i[l]=i[l]||[],i[l][h]=c})});const r=[];i.forEach(o=>{r.push(new ai(o).polymorph())});const a=new at;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 at)>=0?this.polymorphGroup():this.polymorph(),i=s(0),r=e?.onUpdate,a=new ks({frameDuration:t});a.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(o,h)=>{s(o.t),r?.(o,h),e?.draw?.(i)}})),a.play()}static generatePointsShape(t,e,s,i){const r=[];for(let a=0;a<i;a++){const o=a/i*2*Math.PI,{dx:h,dy:c}=Bt(o,s);r.push({x:t+h,y:e+c})}return new Ba({points:r})}static generateRosettaShape(t,e,s,i,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),f=e+2*s*Math.sin(c);a.push(new Vn({x:t,y:e,rx:s,ry:i,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:f})),a.push(new Vn({x:l,y:f,rx:s,ry:i,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new j({d:vt.fromLines(a)})}}const za={map:new Map,transform:function(n){if(Wr)return n;if(this.map.has(n))return this.map.get(n);const t=new OffscreenCanvas(n.width,n.height);return t.getContext("2d")?.drawImage(n,0,0),this.map.set(n,t),t},clear:function(){this.map.clear()}};function xf(n,t,e){const s=new OffscreenCanvas(n,t),i=s.getContext("2d");if(i)return e(i),s.transferToImageBitmap()}function bf(n,t,e){const s=n.createPattern(za.transform(t),"no-repeat");if(s){const i=Hn(e);s.setTransform(i),n.fillStyle=s}}function Ga(n){return window.URL.createObjectURL(n)}function vf(n){return window.URL.revokeObjectURL(n)}const Va=new ue;async function qa(n,t=6e4){const e=typeof n=="string"?n:Ga(n);return new Promise((s,i)=>{const r=Va.get(e);if(r)return s(r);const a=document.createElement("img");a.onload=h=>{clearTimeout(o);const c=a.naturalWidth||a.width,l=a.naturalHeight||a.height,f={width:c,height:l,aspectRatio:c/l,element:a,imageData:wa(a)};Va.set(e,f),s(f),a.onerror=a.onload=null},a.onerror=h=>{clearTimeout(o),i(h)},a.src=e;const o=setTimeout(()=>{i("Timeout!")},t)})}async function oi(n=Tt.text,t=["*"]){const s=(await _n(t))[0],i=await Ne(s,n);return{type:s.type,name:s.name,size:s.size,data:i}}async function Sf(n=["image/*"]){const e=(await _n(n))[0];if(!e.type.match(/image\/*/))return new Error("Not Image Type!");const s=await Ne(e,Tt.arraybuffer),i=cn(s),r=await qa(i);return{type:e.type,name:e.name,size:e.size,data:s,width:r.width,height:r.height,aspectRatio:r.aspectRatio,imageData:r.imageData}}function Tf(n,t){const e=t.ctrl||!1,s=t.shift||!1,i=t.alt||!1;return(e===n.metaKey||e===n.ctrlKey)&&s===n.shiftKey&&i===n.altKey&&t.keys.map(r=>r.toLowerCase()).includes(n.key.toLowerCase())}function Cf(n){const t=[];return n.ctrl&&t.push(In()?"Cmd":"Ctrl"),n.shift&&t.push("Shift"),n.alt&&t.push("Alt"),t.push(...n.keys),t}function hi(n,t,e){const s=n.target||document||window;let i=!1,r=!1;const a=ht(s,"keydown",async h=>{r||(i=Tf(h,n),i&&(h.stopPropagation(),h.preventDefault(),await t()))}),o=ht(s,"keyup",async h=>{r||i&&e&&(h.stopPropagation(),h.preventDefault(),await e())});return{hotKeys:Cf(n),destroy:()=>{a(),o()},pause:()=>r=!0,resume:()=>r=!1}}const Pf={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};async function Ef(n={keys:["o"]},t=Tt.text){const e=Wo(),s=hi(n,async()=>{try{e.resolve(await oi(t))}catch(i){e.reject(i)}s.destroy()},()=>{});return await e.promise}function _f(n={keys:["o"]},t=Tt.text){const e=Qt();return hi(n,async()=>{try{e.emit("file",await oi(t))}catch{}},()=>{}),{on:s=>{e.on("file",s)},off:s=>{e.off("file",s)}}}async function Af(n,t=6e4){return new Promise((e,s)=>{const i=document.createElement("script");i.type="text/javascript",i.async=!1,i.onload=a=>{clearTimeout(r),e(a),i.onerror=i.onload=null},i.onerror=a=>{clearTimeout(r),s(a)},i.src=n;const r=setTimeout(()=>{s("Timeout!")},t);document.body.appendChild(i)})}async function Df(n,t=document.getElementsByTagName("head")[0],e=6e4){return new Promise((s,i)=>{const r=document.createElement("link");r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.onload=o=>{clearTimeout(a),s(o),r.onerror=r.onload=null},r.onerror=o=>{clearTimeout(a),i(o)},r.setAttribute("href",n);const a=setTimeout(()=>{i("Timeout!")},e);t.appendChild(r)})}function If(){return new Promise(n=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const s=()=>e>=t.length?(n(),!0):!1;s()||t.forEach(i=>{i.onload=()=>{e+=1,s()}})})}function ci(n,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof n=="string"?e.href=n:e.href=window.URL.createObjectURL(n),e.click()}const li=new ue;async function ja(n,t){if(typeof fetch>"u")throw new Error("fetch() not supported!");if(typeof AbortController>"u")throw new Error("AbortController not supported!");const e=Gs(n,t),s=new AbortController;li.set(e,s);const{responseType:i,onProgress:r,timeout:a}={responseType:"json",timeout:6e4,...t},o=setTimeout(()=>{throw s.abort(),new Error(`${a} ms Timeout!`)},a);let h=await fetch(new Request(n,{...t,signal:s.signal}));if(li.delete(e),clearTimeout(o),h.status===200||h.status===0){if(h.status===0&&console.warn("useFetch: HTTP Status 0 received."),typeof ReadableStream<"u"&&h.body!==void 0&&h.body?.getReader!==void 0&&r){const c=h.body.getReader(),l=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),f=l?parseInt(l):0,y=f!==0;let b=0;const w=new ReadableStream({start(_){function S(){c.read().then(({done:v,value:x})=>{v?_.close():(b+=x.byteLength,r?.(new ProgressEvent("progress",{lengthComputable:y,loaded:b,total:f})),_.enqueue(x),S())}).catch(v=>{_.error(v)})}S()}});h=new Response(w)}switch(i){case"arraybuffer":return[h.arrayBuffer(),h];case"blob":return[h.blob(),h];case"json":return[h.json(),h];case"text":default:return[h.text(),h]}}else throw new Di(`useFetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}const Ha=new ue,ui=new ue;async function Mf(n,t){const e=Gs(n,t);try{const s=Ha.get(e);if(s)return s;const i=ui.get(e);if(i)return await i;const r=ja(n,t);ui.set(e,r);const a=await r;return Ha.set(e,a),ui.delete(e),a}catch{}}function kf(n,t){const e=li.get(Gs(n,t));e&&e.abort()}function Gs(n,t){return JSON.stringify({url:n,...t})}function oe(n,t,e){if(t===void 0&&e===void 0)return fi(n);if(typeof t=="string"&&e===void 0)return $a(n,t);let s={};typeof t=="object"?s=t:typeof t=="string"&&typeof e=="string"&&(s[t]=e),zn(n,i=>{Object.entries(s).forEach(([r,a])=>{i.props[r]=a})})}function fi(n){const t={};for(let e=0,s=n.attributes,i=s.length;e<i;e++){const r=s[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=Wn(n):t[r.nodeName]=r.nodeValue)}return t}function $a(n,t){return t==="style"?Wn(n):n.getAttribute(mt(t))}function di(n,t,e){return n.setAttribute(mt(t),e)}function Lf(n,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&n.removeAttribute(e.trim())})}function Rf(n,t,e){if(typeof t=="string"&&(t=os(t)),(typeof t=="string"||t===void 0)&&e===void 0){const s=Object.assign({},n.dataset);return Object.keys(s).forEach(i=>{if(s[i]?.startsWith("[")||s[i]?.startsWith("{"))try{s[i]=JSON.parse(s[i]||"")}catch{}}),typeof t=="string"?s[t]:s}else{let s={};typeof t=="object"?s=t:typeof t=="string"&&(s[t]=e),Object.entries(s).forEach(([i,r])=>{r?n.dataset[i]=r instanceof Object?JSON.stringify(r):r:delete n.dataset[i]})}}function Of(n,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete n.dataset[e.trim()]})}function mi(n,t,e="toggle"){const s=t.split(/[,\s]+/);if(n.classList)s.forEach(i=>{const r=i.trim();r!==""&&n.classList[e](r)});else{const i=n.className.split(/ +/);let r=!1;s.forEach(a=>{const o=a.trim();if(o!==""){const h=i.indexOf(o);switch(e){case"add":h===-1&&(i.push(o),r=!0);break;case"remove":h!==-1&&(i.splice(h,1),r=!0);break;case"toggle":h===-1?i.push(o):i.splice(h,1),r=!0;break}}}),r&&oe(n,"class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function Ff(n,t){mi(n,t,"add")}function Nf(n,t){mi(n,t,"remove")}function Bf(n,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(n.className)||!1}function Uf(n,t){ge(n,"display")=="none"&&t===void 0||t===!0?Wa(n):Ja(n)}function Wa(n){$n(n,"display",n instanceof HTMLTableRowElement?"table-row":n instanceof HTMLTableCellElement?"table-cell":"block")}function Ja(n){$n(n,"display","none")}function kt(n){return{el:n,isRoot:()=>/(html|body)/i.test(n.tagName)||n===document.documentElement,isActive:()=>n===document.activeElement&&(n.type||n.href),getRemSize:function(){return parseFloat(getComputedStyle(document.documentElement).fontSize)},rem2px:function(t){return t*this.getRemSize()},getEmSize:function(){return n.parentElement?parseFloat(getComputedStyle(n.parentElement).fontSize):this.getRemSize()},nearestElement:()=>{let t=n;for(;t&&t.nodeType!==1&&t.parentElement;)t=t.parentElement;return t},parent:()=>n.parentElement,parents:function(t=n,e=[]){return!t||t.parentElement===null?e:this.parents(t.parentElement,e.concat([t]))},scrollParent:function(){const t=this.parents();for(let e=0,s=t.length;e<s;e++)if(/(auto|scroll)/.test(ge(t[e],"overflow")+ge(t[e],"overflow-y")+ge(t[e],"overflow-x")))return t[e];return document.scrollingElement||document.documentElement},contains:t=>n.contains?n!=t&&n.contains(t):!!(n.compareDocumentPosition(t)&16),siblings:()=>Array.prototype.slice.call(n.parentElement?.children).filter(t=>t!==n),nextElementSibling:()=>n.nextElementSibling,previousElementSibling:()=>n.previousElementSibling,closest:t=>n.closest(t),shadowRoot:()=>n.shadowRoot,isInput:()=>n.tagName==="INPUT"||n instanceof HTMLInputElement,isSelect:()=>n.tagName==="SELECT"||n instanceof HTMLSelectElement,isTextArea:()=>n.tagName==="TEXTAREA"||n instanceof HTMLTextAreaElement,isInputCheckbox:function(){return this.isInput(n)&&n.getAttribute("type")==="checkbox"},isInputRadio:function(){return this.isInput(n)&&n.getAttribute("type")==="radio"},isInputText:function(){return this.isInput(n)&&n.getAttribute("type")==="text"},isInputNumber:function(){return this.isInput(n)&&n.getAttribute("type")==="number"},changeSelected:function(t){if(this.isSelect()){const e=n.options;for(let s=0,i=e.length;s<i;s++)e[s].selected=e[s].value==t}},changeRadioChecked:function(t){if(this.isInputRadio()){const e=document.getElementsByName(n.name);for(let s=0,i=e.length;s<i;s++){const r=e[s];r.checked=r.value==t}}},changeCheckboxChecked:function(t){this.isInputCheckbox()&&(n.checked=t)},insert:(t,e="append")=>{typeof t=="string"?n[e](Za(t)):n[e](t)},html:function(t){if(typeof t=="string"){n.innerHTML=t;const e=Ka(n);e!=n&&(n=e)}else this.insert(t,"replaceWith")},empty:function(){this.html("")},text:t=>{n.textContent=t},getInnerText:()=>{if(n instanceof SVGElement)return"";let t=n.innerText;if(!t){const e=n.querySelector("slot")?.assignedNodes()||[];let s=0;for(;!t&&s<=e.length-1;)"innerText"in e[s]&&(t=e[s].innerText),s++}return t},remove:()=>n.remove()}}function Za(n){const t=document.createElement("template");return t.innerHTML=n,t.content.childNodes.forEach(e=>{const s=Ka(e);s!=e&&t.content.replaceChild(s,e)}),t.content}function Yf(n){return document.createElement.call(document,n)}function Xf(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function zf(n){return document.createTextNode.call(document,n)}function Ka(n){return n.tagName=="SCRIPT"&&(n=Qa(n)),n.querySelectorAll&&n.querySelectorAll("script").forEach(t=>{t.parentNode?.replaceChild(Qa(t),t)}),n}function Qa(n){const t=n.ownerDocument.createElement("script");t.text=n.text;const e=n.attributes;for(let s=0,i=e.length;s<i;s++)t.setAttribute(e[s].name,e[s].value);return t}function Gf(n){return{shadowRoot:()=>{let t=n;for(;t;){const e=n.parentElement||n.parentNode;if(e)t=e;else break}return t}}}function Vf(n){if(document.implementation.hasFeature("MouseEvents","2.0"))return n.button;switch(n.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}function qf(n,t=n.target){const e=n.relatedTarget||n.fromElement,s=n.relatedTarget||n.toElement;return t===null||e===null||s===null?!0:n.type=="mouseover"?!kt(t).contains(e)&&e!==t:!kt(t).contains(s)&&s!==t}function jf(n,t="http://test.com/localstorage.html"){const e=document.createElement("iframe");e.src=t,document.body.append(e),setTimeout(function(){e.contentWindow?.postMessage(n,t)},4e3),setTimeout(function(){e.remove()},6e3)}async function Hf(n){if(navigator.clipboard)return await navigator.clipboard.writeText(n);{const t=document.createElement("textarea");return t.value=n,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function $f(){return"geolocation"in navigator?new Promise((n,t)=>{navigator.geolocation.getCurrentPosition(e=>{const s=e.coords.latitude,i=e.coords.longitude;n({latitude:s,longitude:i})},e=>{t(e)})}):Promise.reject("Geolocation is not available.")}function Wf(n=200){"vibrate"in navigator?window.navigator.vibrate(n):console.error("Your device is not support vibrate on this browser.")}function Jf(n){const t=new Proxy(window,{get(e,s,i){if(typeof s=="string"&&["open","location","document"].includes(s))throw new Error(`禁止访问 key: ${s}`);return s==="window"?t:Reflect.get(e,s,i)},set(e,s,i,r){return Reflect.set(e,s,i,r)}});new Function("window",`with(window) { ${n} }`)(t,null)}const Zf={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:(n,t)=>{switch(t){case"W":return`${n}周`;default:return`${n}日`}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:(n,t)=>{const e=n*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}},Kf={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:n=>{const t=["th","st","nd","rd"],e=n%100;return`[${n}${t[(e-20)%10]||t[e]||t[0]}]`}},he=new ue;let Vs="zh-cn";pi(Kf),pi(Zf);function pi(n,t){if(!n)return he.get(Vs);let e;if(typeof n=="string"){const s=n.toLowerCase();if(he.get(s))e=s;else if(t)he.set(s,t),e=s;else return he.get(Vs)}else{const{name:s}=n;he.set(s,n),e=s}return e&&(Vs=e),he.get(e)||he.get(Vs)}function xe(n,t={},e=[],s){return{tag:n,props:t,children:e,el:s}}function qs(n){return xe(n.tagName,fi(n),Array.from(n.children).map(t=>qs(t)),n)}function De(n,t=document.documentElement){if(n.el)return n.el;if(n.el=document.createElement(n.tag),n.props)for(const e in n.props){const s=n.props[e];e.startsWith("on")?n.el.addEventListener(e.slice(2).toLowerCase(),s):e==="style"?Xs(n.el,n.props[e]):di(n.el,e,s)}return n.children&&(typeof n.children=="string"?n.el.appendChild(document.createTextNode(n.children)):n.children.forEach(e=>{De(e,n.el)})),t.appendChild(n.el),n.el}function js(n,t){if(!n.el)return;if(n.tag!==t.tag){(n.el.parentElement||document.body).replaceChild(De(t),n.el);return}const e=t.el=n.el,s=n.props,i=t.props;for(const o in s)o in i||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),s[o]):e.removeAttribute(o));for(const o in i){const h=s[o],c=i[o];if(c!=h)if(o.startsWith("on")){const l=o.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else if(o==="style"){for(const l in h)l in c||Jn(e,l);Xs(e,c)}else di(e,o,c)}const r=n.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{De(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)js(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{De(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}class Qf{state;el;constructor(t,e){this.state=Gi(t,!0),this.el=e,this.compile(this.el)}compile(t){t.childNodes.forEach(e=>{switch(e.nodeType){case 1:const s=e;[...s.attributes].forEach(o=>{const h=o.name,c=o.value;if(h==="v-model")if(kt(s).isInputRadio()){const l=s;pt(()=>{l.checked=this.getStateValue(c)==l.value}),l.addEventListener("change",f=>{this.setStateValue(c,f.target.value)})}else if(kt(s).isInputCheckbox()){const l=s;pt(()=>{l.checked=Ni(this.getStateValue(c),l.value)}),l.addEventListener("change",f=>{const y=f.target,b=y.value;y.checked?ko(this.getStateValue(c),b):Te(this.getStateValue(c),b)})}else if(kt(s).isSelect()){const l=s;pt(()=>{l.value=this.getStateValue(c)}),l.addEventListener("change",f=>{this.setStateValue(c,f.target.value)})}else{const l=s;pt(()=>{l.value=this.getStateValue(c)});const f=y=>{this.setStateValue(c,y.target.value)};l.addEventListener("input",f)}else h==="v-text"?pt(()=>{s.innerText=this.getStateValue(c)}):h==="v-html"&&pt(()=>{s.innerHTML=this.getStateValue(c)})}),s.childNodes.length>0&&this.compile(s);break;case 3:const i=e.textContent||"",r=/\{\{\s*([^{}\s]+)\s*\}\}/g,a=r.exec(i);a&&a[1]&&pt(()=>{e.textContent=i.replace(r,this.getStateValue(a[1]))});break}})}getStateValue(t){let e=this.state;return t.split(".").forEach(s=>{e=e[s]}),e}setStateValue(t,e){let s=this.state;const i=t.split("."),r=i.length;for(let a=0;a<r-1;a++)s=s[i[a]];s[i[r-1]]=e}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){
36
+ `;return function(){var M=new Error("get-stack-trace"),R=M&&M.stack?M.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",X=t.console&&(t.console.warn||t.console.log);return X&&X.call(t.console,A,R),u.apply(this,arguments)}}var _;typeof Object.assign!="function"?_=function(m){if(m===i||m===null)throw new TypeError("Cannot convert undefined or null to object");for(var P=Object(m),A=1;A<arguments.length;A++){var M=arguments[A];if(M!==i&&M!==null)for(var R in M)M.hasOwnProperty(R)&&(P[R]=M[R])}return P}:_=Object.assign;var S=w(function(m,P,A){for(var M=Object.keys(P),R=0;R<M.length;)(!A||A&&m[M[R]]===i)&&(m[M[R]]=P[M[R]]),R++;return m},"extend","Use `assign`."),v=w(function(m,P){return S(m,P,!0)},"merge","Use `assign`.");function x(u,m,P){var A=m.prototype,M;M=u.prototype=Object.create(A),M.constructor=u,M._super=A,P&&_(M,P)}function p(u,m){return function(){return u.apply(m,arguments)}}function g(u,m){return typeof u==o?u.apply(m&&m[0]||i,m):u}function E(u,m){return u===i?m:u}function C(u,m,P){b(K(m),function(A){u.addEventListener(A,P,!1)})}function F(u,m,P){b(K(m),function(A){u.removeEventListener(A,P,!1)})}function G(u,m){for(;u;){if(u==m)return!0;u=u.parentNode}return!1}function V(u,m){return u.indexOf(m)>-1}function K(u){return u.trim().split(/\s+/g)}function Q(u,m,P){if(u.indexOf&&!P)return u.indexOf(m);for(var A=0;A<u.length;){if(P&&u[A][P]==m||!P&&u[A]===m)return A;A++}return-1}function ht(u){return Array.prototype.slice.call(u,0)}function Et(u,m,P){for(var A=[],M=[],R=0;R<u.length;){var X=m?u[R][m]:u[R];Q(M,X)<0&&A.push(u[R]),M[R]=X,R++}return P&&(m?A=A.sort(function(it,pt){return it[m]>pt[m]}):A=A.sort()),A}function xt(u,m){for(var P,A,M=m[0].toUpperCase()+m.slice(1),R=0;R<r.length;){if(P=r[R],A=P?P+M:m,A in u)return A;R++}return i}var Ie=1;function ce(){return Ie++}function ve(u){var m=u.ownerDocument||u;return m.defaultView||m.parentWindow||t}var Me=/mobile|tablet|ip(ad|hone|od)|android/i,O="ontouchstart"in t,k=xt(t,"PointerEvent")!==i,Y=O&&Me.test(navigator.userAgent),q="touch",mt="pen",Lt="mouse",Ws="kinect",Js=25,st=1,Bt=2,J=4,I=8,Zs=1,Qe=2,ts=4,es=8,ss=16,Ut=Qe|ts,Se=es|ss,ao=Ut|Se,oo=["x","y"],Ks=["clientX","clientY"];function _t(u,m){var P=this;this.manager=u,this.callback=m,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(A){g(u.options.enable,[u])&&P.handler(A)},this.init()}_t.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(ve(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&F(this.element,this.evEl,this.domHandler),this.evTarget&&F(this.target,this.evTarget,this.domHandler),this.evWin&&F(ve(this.element),this.evWin,this.domHandler)}};function cm(u){var m,P=u.options.inputClass;return P?m=P:k?m=bi:Y?m=en:O?m=vi:m=tn,new m(u,lm)}function lm(u,m,P){var A=P.pointers.length,M=P.changedPointers.length,R=m&st&&A-M===0,X=m&(J|I)&&A-M===0;P.isFirst=!!R,P.isFinal=!!X,R&&(u.session={}),P.eventType=m,um(u,P),u.emit("hammer.input",P),u.recognize(P),u.session.prevInput=P}function um(u,m){var P=u.session,A=m.pointers,M=A.length;P.firstInput||(P.firstInput=ho(m)),M>1&&!P.firstMultiple?P.firstMultiple=ho(m):M===1&&(P.firstMultiple=!1);var R=P.firstInput,X=P.firstMultiple,nt=X?X.center:R.center,it=m.center=co(A);m.timeStamp=l(),m.deltaTime=m.timeStamp-R.timeStamp,m.angle=xi(nt,it),m.distance=Qs(nt,it),fm(P,m),m.offsetDirection=uo(m.deltaX,m.deltaY);var pt=lo(m.deltaTime,m.deltaX,m.deltaY);m.overallVelocityX=pt.x,m.overallVelocityY=pt.y,m.overallVelocity=c(pt.x)>c(pt.y)?pt.x:pt.y,m.scale=X?pm(X.pointers,A):1,m.rotation=X?mm(X.pointers,A):0,m.maxPointers=P.prevInput?m.pointers.length>P.prevInput.maxPointers?m.pointers.length:P.prevInput.maxPointers:m.pointers.length,dm(P,m);var Xt=u.element;G(m.srcEvent.target,Xt)&&(Xt=m.srcEvent.target),m.target=Xt}function fm(u,m){var P=m.center,A=u.offsetDelta||{},M=u.prevDelta||{},R=u.prevInput||{};(m.eventType===st||R.eventType===J)&&(M=u.prevDelta={x:R.deltaX||0,y:R.deltaY||0},A=u.offsetDelta={x:P.x,y:P.y}),m.deltaX=M.x+(P.x-A.x),m.deltaY=M.y+(P.y-A.y)}function dm(u,m){var P=u.lastInterval||m,A=m.timeStamp-P.timeStamp,M,R,X,nt;if(m.eventType!=I&&(A>Js||P.velocity===i)){var it=m.deltaX-P.deltaX,pt=m.deltaY-P.deltaY,Xt=lo(A,it,pt);R=Xt.x,X=Xt.y,M=c(Xt.x)>c(Xt.y)?Xt.x:Xt.y,nt=uo(it,pt),u.lastInterval=m}else M=P.velocity,R=P.velocityX,X=P.velocityY,nt=P.direction;m.velocity=M,m.velocityX=R,m.velocityY=X,m.direction=nt}function ho(u){for(var m=[],P=0;P<u.pointers.length;)m[P]={clientX:h(u.pointers[P].clientX),clientY:h(u.pointers[P].clientY)},P++;return{timeStamp:l(),pointers:m,center:co(m),deltaX:u.deltaX,deltaY:u.deltaY}}function co(u){var m=u.length;if(m===1)return{x:h(u[0].clientX),y:h(u[0].clientY)};for(var P=0,A=0,M=0;M<m;)P+=u[M].clientX,A+=u[M].clientY,M++;return{x:h(P/m),y:h(A/m)}}function lo(u,m,P){return{x:m/u||0,y:P/u||0}}function uo(u,m){return u===m?Zs:c(u)>=c(m)?u<0?Qe:ts:m<0?es:ss}function Qs(u,m,P){P||(P=oo);var A=m[P[0]]-u[P[0]],M=m[P[1]]-u[P[1]];return Math.sqrt(A*A+M*M)}function xi(u,m,P){P||(P=oo);var A=m[P[0]]-u[P[0]],M=m[P[1]]-u[P[1]];return Math.atan2(M,A)*180/Math.PI}function mm(u,m){return xi(m[1],m[0],Ks)+xi(u[1],u[0],Ks)}function pm(u,m){return Qs(m[0],m[1],Ks)/Qs(u[0],u[1],Ks)}var gm={mousedown:st,mousemove:Bt,mouseup:J},ym="mousedown",wm="mousemove mouseup";function tn(){this.evEl=ym,this.evWin=wm,this.pressed=!1,_t.apply(this,arguments)}x(tn,_t,{handler:function(m){var P=gm[m.type];P&st&&m.button===0&&(this.pressed=!0),P&Bt&&m.which!==1&&(P=J),this.pressed&&(P&J&&(this.pressed=!1),this.callback(this.manager,P,{pointers:[m],changedPointers:[m],pointerType:Lt,srcEvent:m}))}});var xm={pointerdown:st,pointermove:Bt,pointerup:J,pointercancel:I,pointerout:I},bm={2:q,3:mt,4:Lt,5:Ws},fo="pointerdown",mo="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(fo="MSPointerDown",mo="MSPointerMove MSPointerUp MSPointerCancel");function bi(){this.evEl=fo,this.evWin=mo,_t.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}x(bi,_t,{handler:function(m){var P=this.store,A=!1,M=m.type.toLowerCase().replace("ms",""),R=xm[M],X=bm[m.pointerType]||m.pointerType,nt=X==q,it=Q(P,m.pointerId,"pointerId");R&st&&(m.button===0||nt)?it<0&&(P.push(m),it=P.length-1):R&(J|I)&&(A=!0),!(it<0)&&(P[it]=m,this.callback(this.manager,R,{pointers:P,changedPointers:[m],pointerType:X,srcEvent:m}),A&&P.splice(it,1))}});var vm={touchstart:st,touchmove:Bt,touchend:J,touchcancel:I},Sm="touchstart",Tm="touchstart touchmove touchend touchcancel";function po(){this.evTarget=Sm,this.evWin=Tm,this.started=!1,_t.apply(this,arguments)}x(po,_t,{handler:function(m){var P=vm[m.type];if(P===st&&(this.started=!0),!!this.started){var A=Cm.call(this,m,P);P&(J|I)&&A[0].length-A[1].length===0&&(this.started=!1),this.callback(this.manager,P,{pointers:A[0],changedPointers:A[1],pointerType:q,srcEvent:m})}}});function Cm(u,m){var P=ht(u.touches),A=ht(u.changedTouches);return m&(J|I)&&(P=Et(P.concat(A),"identifier",!0)),[P,A]}var Pm={touchstart:st,touchmove:Bt,touchend:J,touchcancel:I},Em="touchstart touchmove touchend touchcancel";function en(){this.evTarget=Em,this.targetIds={},_t.apply(this,arguments)}x(en,_t,{handler:function(m){var P=Pm[m.type],A=_m.call(this,m,P);A&&this.callback(this.manager,P,{pointers:A[0],changedPointers:A[1],pointerType:q,srcEvent:m})}});function _m(u,m){var P=ht(u.touches),A=this.targetIds;if(m&(st|Bt)&&P.length===1)return A[P[0].identifier]=!0,[P,P];var M,R,X=ht(u.changedTouches),nt=[],it=this.target;if(R=P.filter(function(pt){return G(pt.target,it)}),m===st)for(M=0;M<R.length;)A[R[M].identifier]=!0,M++;for(M=0;M<X.length;)A[X[M].identifier]&&nt.push(X[M]),m&(J|I)&&delete A[X[M].identifier],M++;if(nt.length)return[Et(R.concat(nt),"identifier",!0),nt]}var Am=2500,go=25;function vi(){_t.apply(this,arguments);var u=p(this.handler,this);this.touch=new en(this.manager,u),this.mouse=new tn(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}x(vi,_t,{handler:function(m,P,A){var M=A.pointerType==q,R=A.pointerType==Lt;if(!(R&&A.sourceCapabilities&&A.sourceCapabilities.firesTouchEvents)){if(M)Dm.call(this,P,A);else if(R&&Im.call(this,A))return;this.callback(m,P,A)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Dm(u,m){u&st?(this.primaryTouch=m.changedPointers[0].identifier,yo.call(this,m)):u&(J|I)&&yo.call(this,m)}function yo(u){var m=u.changedPointers[0];if(m.identifier===this.primaryTouch){var P={x:m.clientX,y:m.clientY};this.lastTouches.push(P);var A=this.lastTouches,M=function(){var R=A.indexOf(P);R>-1&&A.splice(R,1)};setTimeout(M,Am)}}function Im(u){for(var m=u.srcEvent.clientX,P=u.srcEvent.clientY,A=0;A<this.lastTouches.length;A++){var M=this.lastTouches[A],R=Math.abs(m-M.x),X=Math.abs(P-M.y);if(R<=go&&X<=go)return!0}return!1}var wo=xt(a.style,"touchAction"),xo=wo!==i,bo="compute",vo="auto",Si="manipulation",Te="none",ns="pan-x",is="pan-y",sn=km();function Ti(u,m){this.manager=u,this.set(m)}Ti.prototype={set:function(u){u==bo&&(u=this.compute()),xo&&this.manager.element.style&&sn[u]&&(this.manager.element.style[wo]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return b(this.manager.recognizers,function(m){g(m.options.enable,[m])&&(u=u.concat(m.getTouchAction()))}),Mm(u.join(" "))},preventDefaults:function(u){var m=u.srcEvent,P=u.offsetDirection;if(this.manager.session.prevented){m.preventDefault();return}var A=this.actions,M=V(A,Te)&&!sn[Te],R=V(A,is)&&!sn[is],X=V(A,ns)&&!sn[ns];if(M){var nt=u.pointers.length===1,it=u.distance<2,pt=u.deltaTime<250;if(nt&&it&&pt)return}if(!(X&&R)&&(M||R&&P&Ut||X&&P&Se))return this.preventSrc(m)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function Mm(u){if(V(u,Te))return Te;var m=V(u,ns),P=V(u,is);return m&&P?Te:m||P?m?ns:is:V(u,Si)?Si:vo}function km(){if(!xo)return!1;var u={},m=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(P){u[P]=m?t.CSS.supports("touch-action",P):!0}),u}var nn=1,At=2,ke=4,le=8,Wt=le,rs=16,Yt=32;function Jt(u){this.options=_({},this.defaults,u||{}),this.id=ce(),this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=nn,this.simultaneous={},this.requireFail=[]}Jt.prototype={defaults:{},set:function(u){return _(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(y(u,"recognizeWith",this))return this;var m=this.simultaneous;return u=rn(u,this),m[u.id]||(m[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return y(u,"dropRecognizeWith",this)?this:(u=rn(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(y(u,"requireFailure",this))return this;var m=this.requireFail;return u=rn(u,this),Q(m,u)===-1&&(m.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(y(u,"dropRequireFailure",this))return this;u=rn(u,this);var m=Q(this.requireFail,u);return m>-1&&this.requireFail.splice(m,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var m=this,P=this.state;function A(M){m.manager.emit(M,u)}P<le&&A(m.options.event+So(P)),A(m.options.event),u.additionalEvent&&A(u.additionalEvent),P>=le&&A(m.options.event+So(P))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=Yt},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(Yt|nn)))return!1;u++}return!0},recognize:function(u){var m=_({},u);if(!g(this.options.enable,[this,m])){this.reset(),this.state=Yt;return}this.state&(Wt|rs|Yt)&&(this.state=nn),this.state=this.process(m),this.state&(At|ke|le|rs)&&this.tryEmit(m)},process:function(u){},getTouchAction:function(){},reset:function(){}};function So(u){return u&rs?"cancel":u&le?"end":u&ke?"move":u&At?"start":""}function To(u){return u==ss?"down":u==es?"up":u==Qe?"left":u==ts?"right":""}function rn(u,m){var P=m.manager;return P?P.get(u):u}function Rt(){Jt.apply(this,arguments)}x(Rt,Jt,{defaults:{pointers:1},attrTest:function(u){var m=this.options.pointers;return m===0||u.pointers.length===m},process:function(u){var m=this.state,P=u.eventType,A=m&(At|ke),M=this.attrTest(u);return A&&(P&I||!M)?m|rs:A||M?P&J?m|le:m&At?m|ke:At:Yt}});function an(){Rt.apply(this,arguments),this.pX=null,this.pY=null}x(an,Rt,{defaults:{event:"pan",threshold:10,pointers:1,direction:ao},getTouchAction:function(){var u=this.options.direction,m=[];return u&Ut&&m.push(is),u&Se&&m.push(ns),m},directionTest:function(u){var m=this.options,P=!0,A=u.distance,M=u.direction,R=u.deltaX,X=u.deltaY;return M&m.direction||(m.direction&Ut?(M=R===0?Zs:R<0?Qe:ts,P=R!=this.pX,A=Math.abs(u.deltaX)):(M=X===0?Zs:X<0?es:ss,P=X!=this.pY,A=Math.abs(u.deltaY))),u.direction=M,P&&A>m.threshold&&M&m.direction},attrTest:function(u){return Rt.prototype.attrTest.call(this,u)&&(this.state&At||!(this.state&At)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var m=To(u.direction);m&&(u.additionalEvent=this.options.event+m),this._super.emit.call(this,u)}});function Ci(){Rt.apply(this,arguments)}x(Ci,Rt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Te]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&At)},emit:function(u){if(u.scale!==1){var m=u.scale<1?"in":"out";u.additionalEvent=this.options.event+m}this._super.emit.call(this,u)}});function Pi(){Jt.apply(this,arguments),this._timer=null,this._input=null}x(Pi,Jt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[vo]},process:function(u){var m=this.options,P=u.pointers.length===m.pointers,A=u.distance<m.threshold,M=u.deltaTime>m.time;if(this._input=u,!A||!P||u.eventType&(J|I)&&!M)this.reset();else if(u.eventType&st)this.reset(),this._timer=d(function(){this.state=Wt,this.tryEmit()},m.time,this);else if(u.eventType&J)return Wt;return Yt},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===Wt&&(u&&u.eventType&J?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Ei(){Rt.apply(this,arguments)}x(Ei,Rt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Te]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&At)}});function _i(){Rt.apply(this,arguments)}x(_i,Rt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ut|Se,pointers:1},getTouchAction:function(){return an.prototype.getTouchAction.call(this)},attrTest:function(u){var m=this.options.direction,P;return m&(Ut|Se)?P=u.overallVelocity:m&Ut?P=u.overallVelocityX:m&Se&&(P=u.overallVelocityY),this._super.attrTest.call(this,u)&&m&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&c(P)>this.options.velocity&&u.eventType&J},emit:function(u){var m=To(u.offsetDirection);m&&this.manager.emit(this.options.event+m,u),this.manager.emit(this.options.event,u)}});function on(){Jt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}x(on,Jt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Si]},process:function(u){var m=this.options,P=u.pointers.length===m.pointers,A=u.distance<m.threshold,M=u.deltaTime<m.time;if(this.reset(),u.eventType&st&&this.count===0)return this.failTimeout();if(A&&M&&P){if(u.eventType!=J)return this.failTimeout();var R=this.pTime?u.timeStamp-this.pTime<m.interval:!0,X=!this.pCenter||Qs(this.pCenter,u.center)<m.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!X||!R?this.count=1:this.count+=1,this._input=u;var nt=this.count%m.taps;if(nt===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=Wt,this.tryEmit()},m.interval,this),At):Wt}return Yt},failTimeout:function(){return this._timer=d(function(){this.state=Yt},this.options.interval,this),Yt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Wt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Zt(u,m){return m=m||{},m.recognizers=E(m.recognizers,Zt.defaults.preset),new Ai(u,m)}Zt.VERSION="2.0.7",Zt.defaults={domEvents:!1,touchAction:bo,enable:!0,inputTarget:null,inputClass:null,preset:[[Ei,{enable:!1}],[Ci,{enable:!1},["rotate"]],[_i,{direction:Ut}],[an,{direction:Ut},["swipe"]],[on],[on,{event:"doubletap",taps:2},["tap"]],[Pi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Lm=1,Co=2;function Ai(u,m){this.options=_({},Zt.defaults,m||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=cm(this),this.touchAction=new Ti(this,this.options.touchAction),Po(this,!0),b(this.options.recognizers,function(P){var A=this.add(new P[0](P[1]));P[2]&&A.recognizeWith(P[2]),P[3]&&A.requireFailure(P[3])},this)}Ai.prototype={set:function(u){return _(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?Co:Lm},recognize:function(u){var m=this.session;if(!m.stopped){this.touchAction.preventDefaults(u);var P,A=this.recognizers,M=m.curRecognizer;(!M||M&&M.state&Wt)&&(M=m.curRecognizer=null);for(var R=0;R<A.length;)P=A[R],m.stopped!==Co&&(!M||P==M||P.canRecognizeWith(M))?P.recognize(u):P.reset(),!M&&P.state&(At|ke|le)&&(M=m.curRecognizer=P),R++}},get:function(u){if(u instanceof Jt)return u;for(var m=this.recognizers,P=0;P<m.length;P++)if(m[P].options.event==u)return m[P];return null},add:function(u){if(y(u,"add",this))return this;var m=this.get(u.options.event);return m&&this.remove(m),this.recognizers.push(u),u.manager=this,this.touchAction.update(),u},remove:function(u){if(y(u,"remove",this))return this;if(u=this.get(u),u){var m=this.recognizers,P=Q(m,u);P!==-1&&(m.splice(P,1),this.touchAction.update())}return this},on:function(u,m){if(u!==i&&m!==i){var P=this.handlers;return b(K(u),function(A){P[A]=P[A]||[],P[A].push(m)}),this}},off:function(u,m){if(u!==i){var P=this.handlers;return b(K(u),function(A){m?P[A]&&P[A].splice(Q(P[A],m),1):delete P[A]}),this}},emit:function(u,m){this.options.domEvents&&Rm(u,m);var P=this.handlers[u]&&this.handlers[u].slice();if(!(!P||!P.length)){m.type=u,m.preventDefault=function(){m.srcEvent.preventDefault()};for(var A=0;A<P.length;)P[A](m),A++}},destroy:function(){this.element&&Po(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Po(u,m){var P=u.element;if(P.style){var A;b(u.options.cssProps,function(M,R){A=xt(P.style,R),m?(u.oldCssProps[A]=P.style[A],P.style[A]=M):P.style[A]=u.oldCssProps[A]||""}),m||(u.oldCssProps={})}}function Rm(u,m){var P=e.createEvent("Event");P.initEvent(u,!0,!0),P.gesture=m,m.target.dispatchEvent(P)}_(Zt,{INPUT_START:st,INPUT_MOVE:Bt,INPUT_END:J,INPUT_CANCEL:I,STATE_POSSIBLE:nn,STATE_BEGAN:At,STATE_CHANGED:ke,STATE_ENDED:le,STATE_RECOGNIZED:Wt,STATE_CANCELLED:rs,STATE_FAILED:Yt,DIRECTION_NONE:Zs,DIRECTION_LEFT:Qe,DIRECTION_RIGHT:ts,DIRECTION_UP:es,DIRECTION_DOWN:ss,DIRECTION_HORIZONTAL:Ut,DIRECTION_VERTICAL:Se,DIRECTION_ALL:ao,Manager:Ai,Input:_t,TouchAction:Ti,TouchInput:en,MouseInput:tn,PointerEventInput:bi,TouchMouseInput:vi,SingleTouchInput:po,Recognizer:Jt,AttrRecognizer:Rt,Tap:on,Pan:an,Swipe:_i,Pinch:Ci,Rotate:Ei,Press:Pi,on:C,off:F,each:b,merge:v,extend:S,assign:_,inherit:x,bindFn:p,prefixed:xt});var Om=typeof t<"u"?t:typeof self<"u"?self:{};Om.Hammer=Zt,typeof i=="function"&&i.amd?i(function(){return Zt}):n.exports?n.exports=Zt:t[s]=Zt})(window,document,"Hammer")})(ka);var nf=ka.exports;const rf=$i(nf);function af(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,screenX:window.screenX,screenY:window.screenY}}function We(){const n=document.documentElement;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function of(){const n=document.body;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function hf(){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 cf(){const{scrollWidth:n,scrollHeight:t}=We();return{width:n,height:t}}function si(n){const{top:t,left:e,width:s,height:i}=n.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=We();return{x:e+r,y:t+a,width:s,height:i}}function lf(n){let t=n,e=0,s=0;for(;t!==null;)e+=t.offsetLeft,s+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:s,width:n.offsetWidth,height:n.offsetHeight}}function La(n){return n.getBoundingClientRect()}function uf(n){const t=n.getBoundingClientRect();return{x:n.offsetLeft,y:n.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ff(){const{clientHeight:n,scrollTop:t,scrollHeight:e}=We(),s=e-n;return s<=0?0:t/s*100}function df(n){if("center"in n){const t=n.center,e=La(n.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:n.clientX,y:n.clientY}}function ni(n){if("center"in n)return n.center;if(typeof n.pageX=="number"&&typeof n.pageY=="number")return{x:n.pageX,y:n.pageY};const{scrollLeft:t,scrollTop:e}=We();return{x:n.clientX+t,y:n.clientY+e}}function kt(n,t){const e={x:0,y:0};if(t){const s=ni(n),i=si(t);e.x=s.x-i.x,e.y=s.y-i.y}else{let s=0,i=0;if("currentTarget"in n&&n.currentTarget&&n.target&&n.currentTarget!=n.target){const r=n.currentTarget.getBoundingClientRect(),a=n.target.getBoundingClientRect();s=a.left-r.left,i=a.top-r.top}if("offsetX"in n)e.x=n.offsetX+s,e.y=n.offsetY+i;else{const r=ni(n),a=si(n.target);e.x=r.x-a.x+s,e.y=r.y-a.y+i}}return e}class mf extends cs{container;width;height;mousePoint={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0};hammer;removes=[];constructor(t=document.documentElement,e=!0,s){super(),this.container=t,this.width=t.offsetWidth,this.height=t.offsetHeight,this.hammer=new rf(this.container),e&&this.start(s)}emitDebounce=Jo((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.registerTransitionEventListeners(),this.registerAnimationEventListeners(),this.registerResizeObserver(),t&&t.forEach(e=>{this.addRemoves(e())}),this.on("pointerMove",e=>{this.setMousePoint(kt(e,this.container))})}destroy(){this.removes.forEach(t=>t()),this.removes=[],this.removeAllListeners()}restart(){this.destroy(),this.start()}addRemoves(t){this.removes.push(t)}registerMouseEventListeners(){const t=I=>{this.emit("mouseDown",I)},e=I=>{this.emit("mouseUp",I)},s=I=>{this.emit("mouseMove",I)},i=I=>{this.emit("mouseOver",I)},r=I=>{this.emit("mouseOut",I)},a=I=>{this.emit("mouseEnter",I)},o=I=>{this.emit("mouseLeave",I)},h=I=>{this.emit("mouseClick",I)},c=I=>{this.emit("mouseDoubleClick",I)},l=I=>{this.emit("mouseWheel",I)},d=I=>{this.emit("mouseContextMenu",I)},y=I=>{this.emit("touchStart",I)},b=I=>{this.emit("touchEnd",I)},w=I=>{this.emit("touchCancel",I)},_=I=>{this.emit("touchMove",I)},S=I=>{this.emit("pointerDown",I)},v=I=>{this.emit("pointerUp",I)},x=I=>{this.emit("pointerCancel",I)},p=I=>{this.emit("pointerMove",I)},g=I=>{this.emit("pan",I)},E=I=>{this.emit("panStart",I)},C=I=>{this.emit("panMove",I)},F=I=>{this.emit("panEnd",I)},G=I=>{this.emit("panCancel",I)},V=I=>{this.emit("panLeft",I)},K=I=>{this.emit("panRight",I)},Q=I=>{this.emit("panUp",I)},ht=I=>{this.emit("panDown",I)},Et=I=>{this.emit("pinch",I)},xt=I=>{this.emit("press",I)},Ie=I=>{this.emit("rotate",I)},ce=I=>{this.emit("swipe",I)},ve=I=>{this.emit("swipeLeft",I)},Me=I=>{this.emit("swipeRight",I)},O=I=>{this.emit("swipeUp",I)},k=I=>{this.emit("swipeDown",I)},Y=I=>{this.emit("tap",I)},q=I=>{!I.target||this.container==I.target||this.container.contains(I.target)||this.emit("tapOutSide",I)},mt=I=>{this.emit("inputChange",I,this.container.files)},Lt=I=>{this.emit("dragstart",I)},Ws=I=>{I.dataTransfer&&(I.dataTransfer.dropEffect="copy"),this.emit("dragover",I)},Js=I=>{this.emit("dragenter",I)},st=I=>{this.emit("dragend",I)},Bt=I=>{I.dataTransfer,this.emit("drop",I,I.dataTransfer?.files)};this.container.addEventListener("mousedown",t,!1),this.container.addEventListener("mouseup",e,!1),this.container.addEventListener("mousemove",s,!1),this.container.addEventListener("mouseover",i,!1),this.container.addEventListener("mouseout",r,!1),this.container.addEventListener("mouseenter",a,!1),this.container.addEventListener("mouseleave",o,!1),this.container.addEventListener("click",h,!1),this.container.addEventListener("dblclick",c,!1),this.container.addEventListener("wheel",l,!1),this.container.addEventListener("contextmenu",d,!1),this.container.addEventListener("touchstart",y,!1),this.container.addEventListener("touchend",b,!1),this.container.addEventListener("touchcancel",w,!1),this.container.addEventListener("touchmove",_,!1),this.container.addEventListener("pointerdown",S,!1),this.container.addEventListener("pointerup",v,!1),this.container.addEventListener("pointercancel",x,!1),this.container.addEventListener("pointermove",p,!1),this.hammer.on("pan",g),this.hammer.on("panstart",E),this.hammer.on("panmove",C),this.hammer.on("panend",F),this.hammer.on("pancancel",G),this.hammer.on("panleft",V),this.hammer.on("panright",K),this.hammer.on("panup",Q),this.hammer.on("pandown",ht),this.hammer.on("pinch",Et),this.hammer.on("press",xt),this.hammer.on("rotate",Ie),this.hammer.on("swipe",ce),this.hammer.on("swipeleft",ve),this.hammer.on("swiperight",Me),this.hammer.on("swipeup",O),this.hammer.on("swipedown",k),this.hammer.on("tap",Y),document.addEventListener("pointerdown",q,!1),this.container instanceof HTMLInputElement&&this.container.addEventListener("change",mt,!1),this.container.addEventListener("dragstart",Lt,!1),this.container.addEventListener("dragover",Ws,!1),this.container.addEventListener("dragenter",Js,!1),this.container.addEventListener("dragend",st,!1),this.container.addEventListener("drop",Bt,!1);const J=()=>{this.container.removeEventListener("mousedown",t,!1),this.container.removeEventListener("mouseup",e,!1),this.container.removeEventListener("mousemove",s,!1),this.container.removeEventListener("mouseover",i,!1),this.container.removeEventListener("mouseout",r,!1),this.container.removeEventListener("mouseenter",a,!1),this.container.removeEventListener("mouseleave",o,!1),this.container.removeEventListener("click",h,!1),this.container.removeEventListener("dblclick",c,!1),this.container.removeEventListener("wheel",l,!1),this.container.removeEventListener("contextmenu",d,!1),this.container.removeEventListener("touchstart",y,!1),this.container.removeEventListener("touchend",b,!1),this.container.removeEventListener("touchcancel",w,!1),this.container.removeEventListener("touchmove",_,!1),this.container.removeEventListener("pointerdown",S,!1),this.container.removeEventListener("pointerup",v,!1),this.container.removeEventListener("pointercancel",x),this.container.removeEventListener("pointermove",p,!1),this.hammer.off("pan",g),this.hammer.off("panstart",E),this.hammer.off("panmove",C),this.hammer.off("panend",F),this.hammer.off("pancancel",G),this.hammer.off("panleft",V),this.hammer.off("panright",K),this.hammer.off("panup",Q),this.hammer.off("pandown",ht),this.hammer.off("pinch",Et),this.hammer.off("press",xt),this.hammer.off("rotate",Ie),this.hammer.off("swipe",ce),this.hammer.off("swipeleft",ve),this.hammer.off("swiperight",Me),this.hammer.off("swipeup",O),this.hammer.off("swipedown",k),this.hammer.off("tap",Y),document.removeEventListener("pointerdown",q,!1),document.removeEventListener("touchstart",q,!1),document.removeEventListener("mousedown",q,!1),this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",mt,!1),this.container.removeEventListener("dragstart",Lt,!1),this.container.removeEventListener("dragover",Ws,!1),this.container.removeEventListener("dragenter",Js,!1),this.container.removeEventListener("dragend",st,!1),this.container.removeEventListener("drop",Bt,!1)};return this.addRemoves(J),J}registerTransitionEventListeners(){const t=i=>{this.emit("transitionstart",i)},e=i=>{this.emit("transitionend",i)};this.container.addEventListener("transitionstart",t,!1),this.container.addEventListener("transitionend",e,!1);const s=()=>{this.container.removeEventListener("transitionstart",t,!1),this.container.removeEventListener("transitionend",e,!1)};return this.addRemoves(s),s}registerAnimationEventListeners(){const t=i=>{this.emit("animationstart",i)},e=i=>{this.emit("animationend",i)};this.container.addEventListener("animationstart",t,!1),this.container.addEventListener("animationend",e,!1);const s=()=>{this.container.removeEventListener("animationstart",t,!1),this.container.removeEventListener("animationend",e,!1)};return this.addRemoves(s),s}registerResizeObserver(){const{on:t,destroy:e}=ba(this.container),s=t((r,a)=>{this.width=r,this.height=a,this.emit("resize",r,a)}),i=()=>{s(),e()};return this.addRemoves(i),i}registerPullDownRefresh(t){const e=t?.distance||50;return this.captureDrag({move:(s,i)=>{i.dStartY>0&&i.dStartY<e&&this.emit("pullDowning",i.dStartY)},end:(s,i)=>{i.dStartY>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;return this.captureDrag({move:(s,i)=>{i.dStartY>0&&i.dStartY<e&&this.emit("pullUping",i.dStartY)},end:(s,i)=>{i.dStartY>=e&&this.emit("pullUp")}})}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}captureDrag(t){return this.captureDragUsePointer(t)}captureDragUsePointer(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),this.on("pointerMove",a),this.on("pointerUp",r),this.on("pointerCancel",r),s=kt(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("pointerMove",a),this.off("pointerUp",r),this.off("pointerCancel",r),s=kt(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=kt(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("pointerDown",i);const o=()=>{this.off("pointerDown",i)};return this.addRemoves(o),o}captureDragUseMouse(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",r,!1),s=kt(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",r,!1),s=kt(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=kt(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("mouseDown",i);const o=()=>{this.off("mouseDown",i)};return this.addRemoves(o),o}captureDragUseTouch(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),this.on("touchMove",a),this.on("touchEnd",r),this.on("touchCancel",r);const c=h.changedTouches[0];s=kt(c,this.container);const l={...s};e=l,this.setMousePoint(l),t?.start?.(c,l)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("touchMove",a),this.off("touchEnd",r),this.off("touchCancel",r);const c=h.changedTouches[0];s=kt(c,this.container);const l={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.end?.(c,l),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c=h.changedTouches[0],l={...s};s=kt(c,this.container);const d={...s,dx:s.x-(l.x||0),dy:s.y-(l.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(d),t?.move?.(c,d)};this.on("touchStart",i);const o=()=>{this.off("touchStart",i)};return this.addRemoves(o),o}}class Je{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"),i=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),i.src=URL.createObjectURL(r),i.media="(min-width:10px)",s.append(i),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(()=>{Je.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 Ra extends cs{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Eo(this.source);if(t===0){this.emit("finish");return}let e,s,i=Ri(this.source,0);for(let r=1;r<t;r++)e=s,s=i,i=Ri(this.source,r),this.raw+=s,s&&this.step(s,i,e);i&&this.step(i,void 0,s),this.emit("finish")}step(t,e,s){t==`
37
+ `&&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":zt("whitespace",t)?(this.textchunk+=Oa(this.entity),this.mode="text"):t==";"?(this.textchunk+=Oa(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(!zt("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":zt("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(zt("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(zt("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":zt("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(zt("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(!zt("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(zt("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 Oa(n){const t={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 e;return n.charAt(0)=="#"?n.charAt(1).toLowerCase()=="x"?e=parseInt(n.substring(2),16):e=parseInt(n.substring(1),10):e=t[n],e?String.fromCharCode(e):"&"+n}var Fa=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Na(n,t={}){var e=1,s=1;function i(O){var k=O.match(/\n/g);k&&(e+=k.length);var Y=O.lastIndexOf(`
38
+ `);s=~Y?O.length-Y:s+O.length}function r(){var O={line:e,column:s};return function(k){return k.position=new a(O),w(),k}}function a(O){this.start=O,this.end={line:e,column:s},this.source=t.source}a.prototype.content=n;var o=[];function h(O){var k=new Error(t.source+":"+e+":"+s+": "+O);if(k.reason=O,k.filename=t.source,k.line=e,k.column=s,k.source=n,t.silent)o.push(k);else throw k}function c(){var O=y();return{type:"stylesheet",stylesheet:{source:t.source,rules:O,parsingErrors:o}}}function l(){return b(/^{\s*/)}function d(){return b(/^}/)}function y(){var O,k=[];for(w(),_(k);n.length&&n.charAt(0)!="}"&&(O=ve()||Me());)O!==!1&&(k.push(O),_(k));return k}function b(O){var k=O.exec(n);if(k){var Y=k[0];return i(Y),n=n.slice(Y.length),k}}function w(){b(/^\s*/)}function _(O){var k;for(O=O||[];k=S();)k!==!1&&O.push(k);return O}function S(){var O=r();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var k=2;n.charAt(k)!=""&&(n.charAt(k)!="*"||n.charAt(k+1)!="/");)++k;if(k+=2,n.charAt(k-1)==="")return h("End of comment missing");var Y=n.slice(2,k-2);return s+=2,i(Y),n=n.slice(k),s+=2,O({type:"comment",comment:Y})}}function v(){var O=b(/^([^{]+)/);if(O)return qt(O[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(k){return k.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(k){return k.replace(/\u200C/g,",")})}function x(){var O=r(),k=b(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(k){if(k=qt(k[0]),!b(/^:\s*/))return h("property missing ':'");var Y=b(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),q=O({type:"declaration",property:k.replace(Fa,""),value:Y?qt(Y[0]).replace(Fa,""):""});return b(/^[;\s]*/),q}}function p(){var O=[];if(!l())return h("missing '{'");_(O);for(var k;k=x();)k!==!1&&(O.push(k),_(O));return d()?O:h("missing '}'")}function g(){for(var O,k=[],Y=r();O=b(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)k.push(O[1]),b(/^,\s*/);if(k.length)return Y({type:"keyframe",values:k,declarations:p()})}function E(){var O=r(),k=b(/^@([-\w]+)?keyframes\s*/);if(k){var Y=k[1];if(k=b(/^([-\w]+)\s*/),!k)return h("@keyframes missing name");var q=k[1];if(!l())return h("@keyframes missing '{'");for(var mt,Lt=_();mt=g();)Lt.push(mt),Lt=Lt.concat(_());return d()?O({type:"keyframes",name:q,vendor:Y,keyframes:Lt}):h("@keyframes missing '}'")}}function C(){var O=r(),k=b(/^@supports *([^{]+)/);if(k){var Y=qt(k[1]);if(!l())return h("@supports missing '{'");var q=_().concat(y());return d()?O({type:"supports",supports:Y,rules:q}):h("@supports missing '}'")}}function F(){var O=r(),k=b(/^@host\s*/);if(k){if(!l())return h("@host missing '{'");var Y=_().concat(y());return d()?O({type:"host",rules:Y}):h("@host missing '}'")}}function G(){var O=r(),k=b(/^@media *([^{]+)/);if(k){var Y=qt(k[1]);if(!l())return h("@media missing '{'");var q=_().concat(y());return d()?O({type:"media",media:Y,rules:q}):h("@media missing '}'")}}function V(){var O=r(),k=b(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(k)return O({type:"custom-media",name:qt(k[1]),media:qt(k[2])})}function K(){var O=r(),k=b(/^@page */);if(k){var Y=v()||[];if(!l())return h("@page missing '{'");for(var q=_(),mt;mt=x();)q.push(mt),q=q.concat(_());return d()?O({type:"page",selectors:Y,declarations:q}):h("@page missing '}'")}}function Q(){var O=r(),k=b(/^@([-\w]+)?document *([^{]+)/);if(k){var Y=qt(k[1]),q=qt(k[2]);if(!l())return h("@document missing '{'");var mt=_().concat(y());return d()?O({type:"document",document:q,vendor:Y,rules:mt}):h("@document missing '}'")}}function ht(){var O=r(),k=b(/^@font-face\s*/);if(k){if(!l())return h("@font-face missing '{'");for(var Y=_(),q;q=x();)Y.push(q),Y=Y.concat(_());return d()?O({type:"font-face",declarations:Y}):h("@font-face missing '}'")}}var Et=ce("import"),xt=ce("charset"),Ie=ce("namespace");function ce(O){var k=new RegExp("^@"+O+"\\s*([^;]+);");return function(){var Y=r(),q=b(k);if(q){var mt={type:O};return mt[O]=q[1].trim(),Y(mt)}}}function ve(){if(n[0]=="@")return E()||G()||V()||C()||Et()||xt()||Ie()||Q()||K()||F()||ht()}function Me(){var O=r(),k=v();return k?(_(),O({type:"rule",selectors:k,declarations:p()})):h("selector missing")}return ii(c())}function qt(n){return n?n.replace(/^\s+|\s+$/g,""):""}function ii(n,t){var e=n&&typeof n.type=="string",s=e?n:t;for(var i in n){var r=n[i];Array.isArray(r)?r.forEach(function(a){ii(a,s)}):r&&typeof r=="object"&&ii(r,s)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}class Ba extends Ra{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=Na(e);for(const i of s.stylesheet.rules)for(const r of i.declarations)for(const a of i.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 i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",a="";for(const o in this.groups[i])o=="transform"?r=this.groups[i].transform:o=="class"&&this.globalStyles["."+this.groups[i][o]]?a=this.globalStyles["."+this.groups[i][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[i][o]]?a=this.globalStyles["#"+this.groups[i][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[i][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),ai(this.currentItem.style,this.currentItem,oi)}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=[],i;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":i={},e.style&&ai(e.style,i),i.offset=i.offset||e.offset,i.color=i["stop-color"]||e["stop-color"],i.opacity=i["stop-opacity"]||e["stop-opacity"],~(i.offset+"").indexOf("%")?i.offset=parseFloat(i.offset):i.offset=parseFloat(i.offset)*100,i.offset=+i.offset.toFixed(2),this.grad.stops.push(i);break;case"linearGradient":this.grad.angle=(360+ri(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++)i=this.grad.stops[o],o&&o!=h-1?s.push(i.color+":"+i.offset):s.push(i.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++)i=this.grad.stops[o],o&&o!=h-1?s.push(i.color+":"+i.offset):s.push(i.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(const r in e){const a=e[r];if(oi.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"&&ai(a,this.currentItem,oi),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 ri(n,t,e,s,i,r){if(typeof i>"u"||typeof r>"u"){const a=n-e,o=t-s;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return ri(n,t,i,r)-ri(e,s,i,r)}function ai(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){const o=s[r].split(":"),h=o[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(i,""))}}const oi=["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 pf{app;rootEl;ue;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e,s){this.app=t,this.rootEl=vt.createSVGElement("svg"),this.ue=$t(this.rootEl);const i=$t(this.app.container);i.empty(),i.insert(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.captureDrag({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:(r,a)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=a.dx,this.dragDy+=a.dy),this.setCursor()}}),this.app.on("tap",()=>{for(const r of this.shapes)if(this.currentMouseInShape==r){r.emit("clicked");let a=r.parent;for(;a;)a.emit("clicked",r),a=a.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 ne(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return vt.downloadFromSVGElement(this.rootEl)}_addDrawShape(t){this.shapes.findIndex(e=>e.id==t.id)===-1&&(this.shapes.push(t),t instanceof ot&&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(const e of this.shapes){if(!e.isShow){e.el&&(e.el.remove(),delete e.el);continue}if(e.frameStart(this.app.mousePoint),e.el||(e instanceof Ze?e.el=this.text(e.text,e.x,e.y,Ui(e.getAttrs(),(i,r)=>typeof r=="string")):(e.el=vt.createSvgPath(e.toSVGPathD(),e.id),this.ue.insert(e.el))),e.followMouse&&(!os(e.x,this.app.mousePoint.x,5)||!os(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 i=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,i||r){if(e.x+=i,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",i,r)}}else e.isDragging=!1;e instanceof Ze&&(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,Ui(e.getAttrs(),(i,r)=>typeof r=="string")),this.attr(e,"d",s),!this.currentMouseInShape){const i=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=i,i&&(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&&e.el.remove(),delete e.el,this.shapes=this.shapes.filter(s=>s.id!==e.id)})}clear(){this.shapes.forEach(t=>{t.el&&t.el.remove(),delete t.el}),this.ue.empty(),this.shapes=[]}attr(t,e,s){const i=t.el||t;return i instanceof SVGElement?e===void 0&&s===void 0?ne(i):typeof e=="string"&&s===void 0?ne(i,ct(e))||"":(typeof e=="object"?ne(i,e):typeof e=="string"&&s!==void 0&&ne(i,ct(e),s),this):this}circle(t,e,s){return this.path(new jt({x:t,y:e,radius:s}))}circleEl(t,e,s){const i=vt.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(s)});return this.ue.insert(i),i}ellipse(t,e,s,i){return this.path(new Ya({x:t,y:e,rx:s,ry:i}))}ellipseEl(t,e,s,i){const r=vt.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(s),ry:String(i)});return this.ue.insert(r),r}rect(t,e,s,i){return this.path(new Ht({x:t,y:e,width:s,height:i}))}rectEl(t,e,s,i){const r=vt.createSVGElement("rect",{x:String(t),y:String(e),width:String(s),height:String(i)});return this.ue.insert(r),r}image(t,e,s,i,r){}text(t,e,s,i){const r=vt.createSVGElement("text",{x:String(e),y:String(s)});return $t(r).html(t),this.attr(r,Object.assign({"alignment-baseline":"middle"},i)),this.ue.insert(r),r}textWithTspan(t,e,s,i){const r=i?.["line-height"]||"1.2em",a=vt.createSVGElement("text",{x:String(e),y:String(s)});return t.split(`
39
+ `).forEach((o,h)=>{if(o.trim()){const c=vt.createSVGElement("tspan",{x:String(e),dy:h>0?r:"0"});$t(c).html(o),$t(a).insert(c),this.attr(c,Object.assign({"alignment-baseline":"middle"},i))}}),this.ue.insert(a),a}}class gf extends ot{svgWidth=0;svgHeight=0;width=0;height=0;constructor(t){super(t);const e=new Ba(t.svg).parse();for(let s=0,i=e.length;s<i;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"||!pe.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=pe.absolutizeSVGPath(pe.parseSVGPath(r.path)),h=[];let c=[];for(let l=0,d=o.length;l<d;l++){const y=o[l];c.push(y),y[0].toLowerCase()=="z"&&(h.push(c),c=[])}c.length&&h.push(c),h.forEach(l=>{const d=jn(r.transform??"");d.scale(this.width&&this.svgWidth?this.width/this.svgWidth:1),this.addShape(new j({...t,attrs:{...a,...t?.attrs||{}},d:l,originMatrix:d}))})}}shapeInit(){this.trim()}}class jt extends j{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 Ls(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=Mt(-r,e,s),h=Mt(-r,this.vx,this.vy),c=Mt(-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),y=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/d*y,o.x+=c.x/d*y;const b=Mt(r,a.x,a.y),w=Mt(r,o.x,o.y);t.x=this.x+w.x,t.y=this.y+w.y,this.x=this.x+b.x,this.y=this.y+b.y;const _=Mt(r,h.x,h.y),S=Mt(r,c.x,c.y);this.vx=_.x,this.vy=_.y,t.vx=S.x,t.vy=S.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,s=t.wall.x,i=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<i&&(this.y=i+this.radius,this.vy*=e)}}class Ua extends j{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,i=(this.points[0].y+this.points[e-1].y)/2;t.push(["M",s,i]);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,i])}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,i=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(s,i);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,i)}}isContainPoint(t,e){const s=this.points.length;let i=!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 y=(l-h)/(d-c),b=h+y*(e-c);if(b===t||Math.abs(b-t)<r)return!0;b>t&&(i=!i)}}return i}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}}class Ht extends j{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,i,r,a,o,h){const c=new yt({x:t,y:e,c1x:s,c1y:i,c2x:r,c2y:a,toX:o,toY:h});return new Ht(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 Ya extends j{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 yf extends j{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 wf extends j{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 xf extends j{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 bf extends j{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 vf extends j{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,i=this.r*Math.cos(B(s)),r=this.r*Math.sin(B(s));t.push(["l",i,r])}return t}}class Sf extends j{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,30],["a",15,15,0,1,1,0,-30]]}}class Tf extends j{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 Cf extends ot{constructor(t){super(t);const e=new xe({...t,x:this.x,y:this.y,toX:this.x,toY:this.y-140-Math.random()*20}),s=30+Math.random()*30,i=new xe({...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 xe({...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,i,a])}}class Ze extends j{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=hn(this.getAttr("fontSize"),10).number,s=hn(this.getAttr("fontWeight"),400).number,i=this.measureText(this.text,e,s);this.width=i.width,this.height=i.height}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}measureText(t,e=12,s=400){const i=document.createElement("span");i.style.visibility="hidden",i.style.margin="0",i.style.padding="0",i.style.inset="0",i.style.whiteSpace="nowrap",i.style.overflow="visible",i.style.fontSize=e+"px",i.style.fontWeight=s.toString(),i.innerText=t,document.body.appendChild(i);const r=i.offsetWidth,a=i.offsetHeight;return document.body.removeChild(i),{width:r,height:a}}getFixedWidthText(t,e,s=12,i=400,r=!0){let a="";if(!t||e<s)return a;const o=t.split(""),h="...";let c=r?this.measureText(h,s,i).width:0;for(let l=0,d=o.length;l<d;l++)if(c+=this.measureText(o[l],s,i).width,c>e){r&&(a+=h);break}else a+=o[l];return a}}class Xa extends ot{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 Ze({...t,x:this.x+this.offset,y:this.y+this.offset,text:this.text,attrs:{...this.getAttrs(),fill:$e(this.bg).opposite(!0).toString(),textAnchor:"start"}}),this.bgShape=new Ht({...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(){gt(()=>{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 Pf extends ot{radius;expandRaidus;startDegree;endDegree;text="";defaultShowText;tip="";p1=new jt;p1Offset=10;p2=new jt;p2Offset=40;p3=new jt;p3Offset=10;p4=new jt;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 za({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 xe({x:this.p1.x,y:this.p1.y,toX:this.p2.x,toY:this.p2.y,attrs:{...e},isShow:this.defaultShowText}),this.line23=new xe({x:this.p2.x,y:this.p2.y,toX:this.p3.x,toY:this.p3.y,attrs:{...e},isShow:this.defaultShowText}),this.textShape=new Ze({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 Xa({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:i}=Nt(B(e),this.sectorArc.radius+this.p1Offset);this.p1.x=this.x+s,this.p1.y=this.y+i;const{dx:r,dy:a}=Nt(B(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 za extends j{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=8.333333333333334,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}=Nt(B(this.startDegree),this.radius),{dx:s,dy:i}=Nt(B(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,i-e],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,B(this.startDegree),B(this.endDegree),!1),t.closePath()}containPoint(t,e){const s=Rs(this.x,this.y,t,e),i=at(se(this.x,this.y,t,e));return s<=this.radius&&i>=this.startDegree&&i<=this.endDegree}}class Ef extends ot{showFlame;ship;flame;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t.showFlame:!1,this.ship=new j({...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 j({...t,isShow:this.showFlame,d:[["m",-10,-5],["l",-7.5,5],["l",7.5,5],["z"]]}),this.addShape(this.flame)}shapeInit(){gt(()=>{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 _f extends ot{value;backgroundRect;occupyRect;handle;constructor(t){super(t);const e=t?.min||0,s=t?.max||100,i=t?.step||1,r=Uo(e,s,i);this.value=r(typeof t?.defaultValue=="number"?H(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||ti.colorGrayF5,y=t?.handleColor||ti.colorPrimary;this.backgroundRect=new Ht({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 Ht({x:this.x,y:this.y,width:o*a,height:h,borderRadius:l,attrs:{fill:y},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.occupyRect),this.handle=new jt({x:this.x+o*a,y:this.y+l,diffXInGroup:o*a,diffYInGroup:l,radius:c,alongPath:new Wl({x:this.x,y:this.y+l,d:[["m",0,0],["l",o,0]]}),attrs:{fill:y},enableDrag:!0,independentTransformInGroup:!0}),this.addShape(this.handle),this.handle.on("draging",b=>{this.occupyRect.width=H(this.occupyRect.width+b,0,o),this.value=r((this.handle.x-this.x)/o*(s-e)+e),this.emit("change",this.value)})}}class Af extends ot{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 jt({...t,x:this.x,y:this.y,radius:2}),this.forceSetCXY(this.controlPoint.cX,this.controlPoint.cY),this.mainRect=new Ht({...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 jt({...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(B(this.controlPoint.degree))*this.width,y:this.controlPoint.y+Math.sin(B(this.controlPoint.degree))*this.width}}}class hi extends j{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(B(this.extendDegree))),this.y=(t.y||0)+t.height-t.lineWidth-this.radius*Math.abs(Math.sin(B(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}=Nt(B(this.startDegree),this.radius),{dx:s,dy:i}=Nt(B(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,i-e]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,B(this.startDegree),B(this.endDegree),!1)}}class Df extends ot{percent=0;ringBg;ring;lines=[];bgColor;startColor;endColor;indicatorLineCount;constructor(t){super(t);const e=t?.startDegree||0,s=t?.endDegree||180,i=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=23;const a=20,o=2,h=17;this.ringBg=new hi({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:i,lineWidth:r,color:this.bgColor}),this.addShape(this.ringBg),this.ring=new hi({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:i,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 xe({...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+i*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(i=>{i!=s&&(i.x+=t,i.y+=e)})})}frameUpdate(t,e){const s=this.ringBg.radius-this.ringBg.radius*Math.cos(Math.PI*this.percent),i=this.ringBg.radius*Math.sin(Math.PI*this.percent);if(e){const r=e.createLinearGradient(-this.ringBg.radius,0,-this.ringBg.radius+s,-i,{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 If extends j{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=H(t,0,1),this.brightness}toSVGPathData(){return[]}}const Mf=If;class kf extends j{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(),this.points=t,this.light=new Mf({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(),i=this.points[1].getScreenY()-this.points[2].getScreenY();return t*i>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},i=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(i/(r*a))/Math.PI*this.light.brightness}getAdjustedColor(t){const e=$e(t),s=this.getLightFactor();return e.r*=s,e.g*=s,e.b*=s,e.toString()}}class Lf extends ot{fettis=[];constructor(t,e,s){super();const{shape:i,x:r,y:a,particleCount:o,angle:h,spread:c,startVelocity:l,decay:d,gravity:y,drift:b,ticks:w,colors:_,scalar:S,flat:v}=Object.assign({shape:Ht,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:Ma,scalar:1,flat:!1},s||{}),x=B(h),p=B(c);let g=o;for(;g--;){const E=_[g%_.length],C=new i({x:t*r,y:e*a,width:10,height:10,scalar:S,attrs:{fill:E},independentTransformInGroup:!0});this.addShape(C),this.fettis.push({shape:C,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:l*.5+Math.random()*l,angle2D:-x+(.5*p-Math.random()*p),tiltAngle:(Math.random()*.5+.25)*Math.PI,tick:0,totalTicks:w,decay:d,drift:b,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:y*3,scalar:S,flat:v,color:$e(E)})}}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,i=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",e.color.setAlpha(1-s).toString()),e.shape.degree=at(Math.PI/10*e.wobble),e.shape.scalarX=Math.abs(a-i)*.1,e.shape.scalarY=Math.abs(o-r)*.1,e.tick<e.totalTicks}))}}class ci{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,i=e-1;s<i;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 i=s+1;i<t;i++)e.checkCollision(this.shapes[i]),e.gravitateTo(this.shapes[i])})}springChain(t){this.shapes.forEach((e,s)=>{s>0&&e.runSpringTo(this.shapes[s-1],t)})}springConnect(t){const e=Kt(t?.springLength,100);this.shapes.forEach(s=>{s.isDragging||this.shapes.filter(i=>i.id!==s.id).forEach(i=>{const r=se(s.x,s.y,i.x,i.y);s.runSpringTo({x:i.x-Math.cos(r)*e,y:i.y-Math.sin(r)*e},t)})})}springMass(t,e){const s=this.shapes.length,i=[];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++)i.push([r.x,r.y,this.shapes[o].x,this.shapes[o].y,r.springMassTo(this.shapes[o],e)])}),i}polymorph(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");const t=this.shapes.length-1,e=new Array(t);for(let i=0;i<t;i++){const r=this.shapes[i].initPathD();this.shapes[i].frameStart();const a=this.shapes[i+1].initPathD();this.shapes[i+1].frameStart();const o=Math.max(r.polymorphPoints.length,a.polymorphPoints.length);e[i]=St.getPathInterpolator(r.expendFill(o),a.expendFill(o))}const s=new j({d:e[0](0)});return i=>{const r=Ot(t*i,6),a=Math.min(Math.floor(r),t-1),o=Ot(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",dt.gradient(h,c,o).toString());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",dt.gradient(l,d,o).toString()),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 ot?(h=o,h.sortPathD()):(h=new ot,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 i=[];s.forEach((o,h)=>{o.shapes.forEach((c,l)=>{i[l]=i[l]||[],i[l][h]=c})});const r=[];i.forEach(o=>{r.push(new ci(o).polymorph())});const a=new ot;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 ot)>=0?this.polymorphGroup():this.polymorph(),i=s(0),r=e?.onUpdate,a=new Ms({frameDuration:t});a.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(o,h)=>{s(o.t),r?.(o,h),e?.draw?.(i)}})),a.play()}static generatePointsShape(t,e,s,i){const r=[];for(let a=0;a<i;a++){const o=a/i*2*Math.PI,{dx:h,dy:c}=Nt(o,s);r.push({x:t+h,y:e+c})}return new Ua({points:r})}static generateRosettaShape(t,e,s,i,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 Vn({x:t,y:e,rx:s,ry:i,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:d})),a.push(new Vn({x:l,y:d,rx:s,ry:i,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new j({d:St.fromLines(a)})}}const Ga={map:new Map,transform:function(n){if($r)return n;if(this.map.has(n))return this.map.get(n);const t=new OffscreenCanvas(n.width,n.height);return t.getContext("2d")?.drawImage(n,0,0),this.map.set(n,t),t},clear:function(){this.map.clear()}};function Rf(n,t,e){const s=new OffscreenCanvas(n,t),i=s.getContext("2d");if(i)return e(i),s.transferToImageBitmap()}function Of(n,t,e){const s=n.createPattern(Ga.transform(t),"no-repeat");if(s){const i=Hn(e);s.setTransform(i),n.fillStyle=s}}function Va(n){return window.URL.createObjectURL(n)}function Ff(n){return window.URL.revokeObjectURL(n)}const qa=new ue;async function ja(n,t=6e4){const e=typeof n=="string"?n:Va(n);return new Promise((s,i)=>{const r=qa.get(e);if(r)return s(r);const a=document.createElement("img");a.onload=h=>{clearTimeout(o);const c=a.naturalWidth||a.width,l=a.naturalHeight||a.height,d={width:c,height:l,aspectRatio:c/l,element:a,imageData:va(a)};qa.set(e,d),s(d),a.onerror=a.onload=null},a.onerror=h=>{clearTimeout(o),i(h)},a.src=e;const o=setTimeout(()=>{i("Timeout!")},t)})}async function li(n=Ct.text,t=["*"]){const s=(await _n(t))[0],i=await Ne(s,n);return{type:s.type,name:s.name,size:s.size,data:i}}async function Nf(n=["image/*"]){const e=(await _n(n))[0];if(!e.type.match(/image\/*/))return new Error("Not Image Type!");const s=await Ne(e,Ct.arraybuffer),i=cn(s),r=await ja(i);return{type:e.type,name:e.name,size:e.size,data:s,width:r.width,height:r.height,aspectRatio:r.aspectRatio,imageData:r.imageData}}function Bf(n,t){const e=t.ctrl||!1,s=t.shift||!1,i=t.alt||!1;return(e===n.metaKey||e===n.ctrlKey)&&s===n.shiftKey&&i===n.altKey&&t.keys.map(r=>r.toLowerCase()).includes(n.key.toLowerCase())}function Uf(n){const t=[];return n.ctrl&&t.push(In()?"Cmd":"Ctrl"),n.shift&&t.push("Shift"),n.alt&&t.push("Alt"),t.push(...n.keys),t}function ui(n,t,e){const s=n.target||document||window;let i=!1,r=!1;const a=Z(s,"keydown",async h=>{r||(i=Bf(h,n),i&&(h.stopPropagation(),h.preventDefault(),await t()))}),o=Z(s,"keyup",async h=>{r||i&&e&&(h.stopPropagation(),h.preventDefault(),await e())});return{hotKeys:Uf(n),destroy:()=>{a(),o()},pause:()=>r=!0,resume:()=>r=!1}}const Yf={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};function Xf(n){if(n.key)return n.key;if(n.keyCode)return n.keyCode;if(n.which)return n.which}async function zf(n={keys:["o"]},t=Ct.text){const e=eh(),s=ui(n,async()=>{try{e.resolve(await li(t))}catch(i){e.reject(i)}s.destroy()},()=>{});return await e.promise}function Gf(n={keys:["o"]},t=Ct.text){const e=te();return ui(n,async()=>{try{e.emit("file",await li(t))}catch{}},()=>{}),{on:s=>{e.on("file",s)},off:s=>{e.off("file",s)}}}async function Vf(n,t=6e4){return new Promise((e,s)=>{const i=document.createElement("script");i.type="text/javascript",i.async=!1,i.onload=a=>{clearTimeout(r),e(a),i.onerror=i.onload=null},i.onerror=a=>{clearTimeout(r),s(a)},i.src=n;const r=setTimeout(()=>{s("Timeout!")},t);document.body.appendChild(i)})}async function qf(n,t=document.getElementsByTagName("head")[0],e=6e4){return new Promise((s,i)=>{const r=document.createElement("link");r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.onload=o=>{clearTimeout(a),s(o),r.onerror=r.onload=null},r.onerror=o=>{clearTimeout(a),i(o)},r.setAttribute("href",n);const a=setTimeout(()=>{i("Timeout!")},e);t.appendChild(r)})}function jf(){return new Promise(n=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const s=()=>e>=t.length?(n(),!0):!1;s()||t.forEach(i=>{i.onload=()=>{e+=1,s()}})})}function fi(n,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof n=="string"?e.href=n:e.href=window.URL.createObjectURL(n),e.click()}const di=new ue;async function Ha(n,t){if(typeof fetch>"u")throw new Error("fetch() not supported!");if(typeof AbortController>"u")throw new Error("AbortController not supported!");const e=Gs(n,t),s=new AbortController;di.set(e,s);const{responseType:i,onProgress:r,timeout:a}={responseType:"json",timeout:6e4,...t},o=setTimeout(()=>{throw s.abort(),new Error(`${a} ms Timeout!`)},a);let h=await fetch(new Request(n,{...t,signal:s.signal}));if(di.delete(e),clearTimeout(o),h.status===200||h.status===0){if(h.status===0&&console.warn("useFetch: HTTP Status 0 received."),typeof ReadableStream<"u"&&h.body!==void 0&&h.body?.getReader!==void 0&&r){const c=h.body.getReader(),l=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),d=l?parseInt(l):0,y=d!==0;let b=0;const w=new ReadableStream({start(_){function S(){c.read().then(({done:v,value:x})=>{v?_.close():(b+=x.byteLength,r?.(new ProgressEvent("progress",{lengthComputable:y,loaded:b,total:d})),_.enqueue(x),S())}).catch(v=>{_.error(v)})}S()}});h=new Response(w)}switch(i){case"arraybuffer":return[h.arrayBuffer(),h];case"blob":return[h.blob(),h];case"json":return[h.json(),h];case"text":default:return[h.text(),h]}}else throw new Ii(`useFetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}const $a=new ue,mi=new ue;async function Hf(n,t){const e=Gs(n,t);try{const s=$a.get(e);if(s)return s;const i=mi.get(e);if(i)return await i;const r=Ha(n,t);mi.set(e,r);const a=await r;return $a.set(e,a),mi.delete(e),a}catch{}}function $f(n,t){const e=di.get(Gs(n,t));e&&e.abort()}function Gs(n,t){return JSON.stringify({url:n,...t})}function Wf(n,t,e){if(typeof t=="string"&&(t=Fi(t)),(typeof t=="string"||t===void 0)&&e===void 0){const s=Object.assign({},n.dataset);return Object.keys(s).forEach(i=>{if(s[i]?.startsWith("[")||s[i]?.startsWith("{"))try{s[i]=JSON.parse(s[i]||"")}catch{}}),typeof t=="string"?s[t]:s}else{let s={};typeof t=="object"?s=t:typeof t=="string"&&(s[t]=e),Object.entries(s).forEach(([i,r])=>{r?n.dataset[i]=r instanceof Object?JSON.stringify(r):r:delete n.dataset[i]})}}function Jf(n,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete n.dataset[e.trim()]})}function pi(n,t,e="toggle"){const s=t.split(/[,\s]+/);if(n.classList)s.forEach(i=>{const r=i.trim();r!==""&&n.classList[e](r)});else{const i=n.className.split(/ +/);let r=!1;s.forEach(a=>{const o=a.trim();if(o!==""){const h=i.indexOf(o);switch(e){case"add":h===-1&&(i.push(o),r=!0);break;case"remove":h!==-1&&(i.splice(h,1),r=!0);break;case"toggle":h===-1?i.push(o):i.splice(h,1),r=!0;break}}}),r&&ne(n,"class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function Zf(n,t){pi(n,t,"add")}function Kf(n,t){pi(n,t,"remove")}function Qf(n,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(n.className)||!1}function td(n,t){ge(n,"display")=="none"&&t===void 0||t===!0?Wa(n):Ja(n)}function Wa(n){$n(n,"display",n instanceof HTMLTableRowElement?"table-row":n instanceof HTMLTableCellElement?"table-cell":"block")}function Ja(n){$n(n,"display","none")}function $t(n){return{el:n,isRoot:()=>/(html|body)/i.test(n.tagName)||n===document.documentElement,isActive:()=>n===document.activeElement&&(n.type||n.href),getRemSize:function(){return parseFloat(getComputedStyle(document.documentElement).fontSize)},rem2px:function(t){return t*this.getRemSize()},getEmSize:function(){return n.parentElement?parseFloat(getComputedStyle(n.parentElement).fontSize):this.getRemSize()},nearestElement:()=>{let t=n;for(;t&&t.nodeType!==1&&t.parentElement;)t=t.parentElement;return t},parent:()=>n.parentElement,parents:function(t=n,e=[]){return!t||t.parentElement===null?e:this.parents(t.parentElement,e.concat([t]))},scrollParent:function(){const t=this.parents();for(let e=0,s=t.length;e<s;e++)if(/(auto|scroll)/.test(ge(t[e],"overflow")+ge(t[e],"overflow-y")+ge(t[e],"overflow-x")))return t[e];return document.scrollingElement||document.documentElement},contains:t=>n.contains?n!=t&&n.contains(t):!!(n.compareDocumentPosition(t)&16),siblings:()=>Array.prototype.slice.call(n.parentElement?.children).filter(t=>t!==n),nextElementSibling:()=>n.nextElementSibling,previousElementSibling:()=>n.previousElementSibling,closest:t=>n.closest(t),shadowRoot:()=>n.shadowRoot,isInput:()=>n.tagName==="INPUT"||n instanceof HTMLInputElement,isSelect:()=>n.tagName==="SELECT"||n instanceof HTMLSelectElement,isTextArea:()=>n.tagName==="TEXTAREA"||n instanceof HTMLTextAreaElement,isInputCheckbox:function(){return this.isInput(n)&&n.getAttribute("type")==="checkbox"},isInputRadio:function(){return this.isInput(n)&&n.getAttribute("type")==="radio"},isInputText:function(){return this.isInput(n)&&n.getAttribute("type")==="text"},isInputNumber:function(){return this.isInput(n)&&n.getAttribute("type")==="number"},changeSelected:function(t){if(this.isSelect()){const e=n.options;for(let s=0,i=e.length;s<i;s++)e[s].selected=e[s].value==t}},changeRadioChecked:function(t){if(this.isInputRadio()){const e=document.getElementsByName(n.name);for(let s=0,i=e.length;s<i;s++){const r=e[s];r.checked=r.value==t}}},changeCheckboxChecked:function(t){this.isInputCheckbox()&&(n.checked=t)},insert:(t,e="append")=>{typeof t=="string"?n[e](Za(t)):n[e](t)},html:function(t){if(typeof t=="string"){n.innerHTML=t;const e=Ka(n);e!=n&&(n=e)}else this.insert(t,"replaceWith")},empty:function(){this.html("")},text:t=>{n.textContent=t},getInnerText:()=>{if(n instanceof SVGElement)return"";let t=n.innerText;if(!t){const e=n.querySelector("slot")?.assignedNodes()||[];let s=0;for(;!t&&s<=e.length-1;)"innerText"in e[s]&&(t=e[s].innerText),s++}return t},remove:()=>n.remove()}}function Za(n){const t=document.createElement("template");return t.innerHTML=n,t.content.childNodes.forEach(e=>{const s=Ka(e);s!=e&&t.content.replaceChild(s,e)}),t.content}function ed(n){return document.createElement.call(document,n)}function sd(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function nd(n){return document.createTextNode.call(document,n)}function Ka(n){return n.tagName=="SCRIPT"&&(n=Qa(n)),n.querySelectorAll&&n.querySelectorAll("script").forEach(t=>{t.parentNode?.replaceChild(Qa(t),t)}),n}function Qa(n){const t=n.ownerDocument.createElement("script");t.text=n.text;const e=n.attributes;for(let s=0,i=e.length;s<i;s++)t.setAttribute(e[s].name,e[s].value);return t}function id(n){return{shadowRoot:()=>{let t=n;for(;t;){const e=n.parentElement||n.parentNode;if(e)t=e;else break}return t}}}function rd(n,t="http://test.com/localstorage.html"){const e=document.createElement("iframe");e.src=t,document.body.append(e),setTimeout(function(){e.contentWindow?.postMessage(n,t)},4e3),setTimeout(function(){e.remove()},6e3)}async function ad(n){if(navigator.clipboard)return await navigator.clipboard.writeText(n);{const t=document.createElement("textarea");return t.value=n,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function od(){return"geolocation"in navigator?new Promise((n,t)=>{navigator.geolocation.getCurrentPosition(e=>{const s=e.coords.latitude,i=e.coords.longitude;n({latitude:s,longitude:i})},e=>{t(e)})}):Promise.reject("Geolocation is not available.")}function hd(n=200){"vibrate"in navigator?window.navigator.vibrate(n):console.error("Your device is not support vibrate on this browser.")}function cd(n){const t=new Proxy(window,{get(e,s,i){if(typeof s=="string"&&["open","location","document"].includes(s))throw new Error(`禁止访问 key: ${s}`);return s==="window"?t:Reflect.get(e,s,i)},set(e,s,i,r){return Reflect.set(e,s,i,r)}});new Function("window",`with(window) { ${n} }`)(t,null)}const ld={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:(n,t)=>{switch(t){case"W":return`${n}周`;default:return`${n}日`}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:(n,t)=>{const e=n*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}},ud={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:n=>{const t=["th","st","nd","rd"],e=n%100;return`[${n}${t[(e-20)%10]||t[e]||t[0]}]`}},he=new ue;let Vs="zh-cn";gi(ud),gi(ld);function gi(n,t){if(!n)return he.get(Vs);let e;if(typeof n=="string"){const s=n.toLowerCase();if(he.get(s))e=s;else if(t)he.set(s,t),e=s;else return he.get(Vs)}else{const{name:s}=n;he.set(s,n),e=s}return e&&(Vs=e),he.get(e)||he.get(Vs)}function be(n,t={},e=[],s){return{tag:n,props:t,children:e,el:s}}function qs(n){return be(n.tagName,Zn(n),Array.from(n.children).map(t=>qs(t)),n)}function De(n,t=document.documentElement){if(n.el)return n.el;if(n.el=document.createElement(n.tag),n.props)for(const e in n.props){const s=n.props[e];e.startsWith("on")?n.el.addEventListener(e.slice(2).toLowerCase(),s):e==="style"?Ys(n.el,n.props[e]):Xs(n.el,e,s)}return n.children&&(typeof n.children=="string"?n.el.appendChild(document.createTextNode(n.children)):n.children.forEach(e=>{De(e,n.el)})),t.appendChild(n.el),n.el}function js(n,t){if(!n.el)return;if(n.tag!==t.tag){(n.el.parentElement||document.body).replaceChild(De(t),n.el);return}const e=t.el=n.el,s=n.props,i=t.props;for(const o in s)o in i||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),s[o]):e.removeAttribute(o));for(const o in i){const h=s[o],c=i[o];if(c!=h)if(o.startsWith("on")){const l=o.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else if(o==="style"){for(const l in h)l in c||Jn(e,l);Ys(e,c)}else Xs(e,o,c)}const r=n.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{De(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)js(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{De(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}class fd{state;el;constructor(t,e){this.state=ji(t,!0),this.el=e,this.compile(this.el)}compile(t){t.childNodes.forEach(e=>{switch(e.nodeType){case 1:const s=e;[...s.attributes].forEach(o=>{const h=o.name,c=o.value;if(h==="v-model")if($t(s).isInputRadio()){const l=s;gt(()=>{l.checked=this.getStateValue(c)==l.value}),l.addEventListener("change",d=>{this.setStateValue(c,d.target.value)})}else if($t(s).isInputCheckbox()){const l=s;gt(()=>{l.checked=Yi(this.getStateValue(c),l.value)}),l.addEventListener("change",d=>{const y=d.target,b=y.value;y.checked?No(this.getStateValue(c),b):Ce(this.getStateValue(c),b)})}else if($t(s).isSelect()){const l=s;gt(()=>{l.value=this.getStateValue(c)}),l.addEventListener("change",d=>{this.setStateValue(c,d.target.value)})}else{const l=s;gt(()=>{l.value=this.getStateValue(c)});const d=y=>{this.setStateValue(c,y.target.value)};l.addEventListener("input",d)}else h==="v-text"?gt(()=>{s.innerText=this.getStateValue(c)}):h==="v-html"&&gt(()=>{s.innerHTML=this.getStateValue(c)})}),s.childNodes.length>0&&this.compile(s);break;case 3:const i=e.textContent||"",r=/\{\{\s*([^{}\s]+)\s*\}\}/g,a=r.exec(i);a&&a[1]&&gt(()=>{e.textContent=i.replace(r,this.getStateValue(a[1]))});break}})}getStateValue(t){let e=this.state;return t.split(".").forEach(s=>{e=e[s]}),e}setStateValue(t,e){let s=this.state;const i=t.split("."),r=i.length;for(let a=0;a<r-1;a++)s=s[i[a]];s[i[r-1]]=e}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){
40
40
  let output = "";
41
41
  function echo(html){
42
42
  output += html;
43
43
  }
44
44
  ${t}
45
45
  return output;
46
- })`}}class td{requestid=0;url;socket;waitings={};messageQueue=[];constructor(t){this.url=t,this._connect()}_connect(){this.socket=new WebSocket(this.url),this.socket.onopen=()=>{const t=this.messageQueue.slice();this.messageQueue=[],t.forEach(this._send)},this.socket.onclose=t=>{const{code:e,reason:s,wasClean:i}=t;console.log(`ws(${this.url}) closed : ${e} ${s} ${i}`)},this.socket.onerror=t=>{console.log(`ws(${this.url}) error : ${t.type}`)},this.socket.onmessage=t=>{if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const s=this.waitings[e.requestid];s&&s.resolve?.(e)}}catch{}else t.data instanceof ArrayBuffer||t.data instanceof Blob}}_send(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):(this.messageQueue.push(t),this._connect())}open(){this._connect()}close(){this.socket&&this.socket.close()}async send(t,e=5e3){this.requestid++;const s=this.waitings[this.requestid]={requestid:this.requestid};let i;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?i=t:i=JSON.stringify({...s,...t});const r=await new Promise((a,o)=>{s.resolve=a,this._send(i),setTimeout(()=>{o("Timeout!")},e)});return delete this.waitings[this.requestid],r}}function ed(n){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const i=function(){const r=Math.min(t.clientWidth,n);t.dataset.width=r,t.dataset.rem=s=Math.round(100*(r/n)),t.style.fontSize=s+"px"};i(),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",i,!1)}function sd(n,t=Ai&&Ai.src||new URL("zyzgroup_core_web.iife.js",document.baseURI).href){return new URL(n,t)}function Hs(n=window.location.href){try{return new URL(n)}catch{const e="(?<protocol>https?:)",s="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",i="(?<pathname>(?:\\/[^/#?]+)*\\/?)",r="(?<search>(?:\\?[^#]*)?)",a="(?<hash>(?:#.*)?)",h=new RegExp(`^${e}//${s}${i}${r}${a}$`).exec(n);return{href:n,protocol:h?.groups?.protocol??"",host:h?.groups?.host??"",hostname:h?.groups?.hostname??"",port:h?.groups?.port??"",pathname:h?.groups?.pathname??"",search:h?.groups?.search??"",hash:h?.groups?.hash??""}}}function nd(n){const t=Hs(n);return t.protocol==="http:"||t.protocol==="https:"}function to(n=window.location.href){const t=Hs(n),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function id(n=Hs().search){n=decodeURIComponent(n).replace(/^[#?&]/,"");const t={};if(!n)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let s=e.exec(n);for(;s;)t[s[1]]=s[2],s=e.exec(n);return t}const rd=(n=window.location.href)=>JSON.parse('{"'+decodeURI(n.split("?")[1]).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}');function $s(n){return"?"+Object.entries(n).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function eo(n){return"?"+[...n.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function so(n,t){return n.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function ad(n,t){return so(n,$s(t))}function gi(n,t){return n+t.replace(/^[&?]/,n.indexOf("?")>=0?"&":"?")}function od(n,t){return gi(n,$s(t))}class hd{worker;cbs={};constructor(t){if($r)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 i=Math.random().toString(36).slice(2),r=a=>{a.data.id===i&&(this.worker.removeEventListener("message",r),delete this.cbs[i],e(),s())};this.cbs[i]=r.bind(this,{data:{id:i}}),this.worker.addEventListener("message",r),this.worker.postMessage({...t,id:i})}else this.worker.postMessage(t),s()})}}class cd{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(i=>i(this.port1,s))}),this.port1.addEventListener("messageerror",s=>{this.port1MessageErrorCbs.forEach(i=>i(this.port1,s))}),this.port1.start(),this.port2.addEventListener("message",s=>{this.port2MessageCbs.forEach(i=>i(this.port2,s))}),this.port2.addEventListener("messageerror",s=>{this.port2MessageErrorCbs.forEach(i=>i(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 no(){let n=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0,s=t.length;e<s;e++)try{n=new window.ActiveXObject(t[e]);break}catch{continue}}else n=new XMLHttpRequest;return n}function ld(n,t){return new Promise((e,s)=>{const{method:i="GET",data:r={},multipartFormDataString:a="",boundary:o="",headers:h={},withCredentials:c=!1,responseType:l="json",timeout:f=3e4}=t||{},y=no();y.timeout=f,y.responseType=l,y.onreadystatechange=function(x){y.readyState===4&&(y.status===200?e(y.response):s(y.statusText))},y.ontimeout=()=>{s(`${n} is timed out for ${f}ms.`)},y.addEventListener("load",x=>t?.load?.(x,y),!1),y.addEventListener("loadstart",x=>t?.loadstart?.(x,y),!1),y.addEventListener("loadend",x=>t?.loadend?.(x,y),!1),y.addEventListener("progress",x=>{if(x.lengthComputable){const p=Math.round(x.loaded*100/x.total);t?.progress?.(x,y,p)}},!1),y.addEventListener("error",x=>t?.error?.(x,y),!1),y.addEventListener("abort",x=>t?.abort?.(x,y),!1);const b=i.toUpperCase();Object.assign(h,{Accept:"*/*"});let w=!1,_=!1,S=!1;function v(){c&&(y.withCredentials=!0);for(const x in h)mt(x).toLowerCase()=="content-type"&&h[x].toLowerCase()=="multipart/form-data"?(w=!0,y.setRequestHeader("Content-Type","multipart/form-data; boundary="+o)):(mt(x).toLowerCase()=="content-type"&&(h[x].toLowerCase().indexOf("text/plain")>=0?_=!0:h[x].toLowerCase().indexOf("application/json")>=0&&(S=!0)),y.setRequestHeader(x,h[x]))}switch(b){case"GET":let x="";r instanceof FormData?x=eo(r):x=$s(r),y.open("GET",gi(n,x),!0),v(),y.send(null);break;default:y.open(b,n,!0),v(),w?y.sendAsBinary(a):S?y.send(JSON.stringify(r)):_?y.send(Object.entries(r).map(([p,g])=>`${p}=${g}`).join(`\r
47
- `)):y.send(Object.entries(r).map(([p,g])=>`${encodeURIComponent(p)}=${encodeURIComponent(g)}`).join("&"));break}})}async function ud(n){const t={url:n.action||"",data:{},contentType:n.method.toLowerCase()==="post"&&n.enctype?n.enctype:"application/x-www-form-urlencoded",multipartFormDataString:"",boundary:"---------------------------"+Date.now().toString(16)},e=[],s=t.contentType=="multipart/form-data";for(let i=0;i<n.elements.length;i++){const r=n.elements[i];if(!r.hasAttribute("name"))continue;const a=r.getAttribute("type");switch(r.nodeName.toUpperCase()==="INPUT"&&a?a.toUpperCase():""){case"FILE":const h=r;if(s)for(let f=0,y=h.files?.length||0;f<y;f++){const b=h.files?.[f];if(b){const w=await Ne(b,Tt.binaryString);e.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+b.name+`"\r
46
+ })`}}class dd{requestid=0;url;socket;waitings={};messageQueue=[];constructor(t){this.url=t,this._connect()}_connect(){this.socket=new WebSocket(this.url),this.socket.onopen=()=>{const t=this.messageQueue.slice();this.messageQueue=[],t.forEach(this._send)},this.socket.onclose=t=>{const{code:e,reason:s,wasClean:i}=t;console.log(`ws(${this.url}) closed : ${e} ${s} ${i}`)},this.socket.onerror=t=>{console.log(`ws(${this.url}) error : ${t.type}`)},this.socket.onmessage=t=>{if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const s=this.waitings[e.requestid];s&&s.resolve?.(e)}}catch{}else t.data instanceof ArrayBuffer||t.data instanceof Blob}}_send(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):(this.messageQueue.push(t),this._connect())}open(){this._connect()}close(){this.socket&&this.socket.close()}async send(t,e=5e3){this.requestid++;const s=this.waitings[this.requestid]={requestid:this.requestid};let i;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?i=t:i=JSON.stringify({...s,...t});const r=await new Promise((a,o)=>{s.resolve=a,this._send(i),setTimeout(()=>{o("Timeout!")},e)});return delete this.waitings[this.requestid],r}}function md(n){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const i=function(){const r=Math.min(t.clientWidth,n);t.dataset.width=r,t.dataset.rem=s=Math.round(100*(r/n)),t.style.fontSize=s+"px"};i(),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",i,!1)}function pd(n,t=Di&&Di.src||new URL("zyzgroup_core_web.iife.js",document.baseURI).href){return new URL(n,t)}function Hs(n=window.location.href){try{return new URL(n)}catch{const e="(?<protocol>https?:)",s="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",i="(?<pathname>(?:\\/[^/#?]+)*\\/?)",r="(?<search>(?:\\?[^#]*)?)",a="(?<hash>(?:#.*)?)",h=new RegExp(`^${e}//${s}${i}${r}${a}$`).exec(n);return{href:n,protocol:h?.groups?.protocol??"",host:h?.groups?.host??"",hostname:h?.groups?.hostname??"",port:h?.groups?.port??"",pathname:h?.groups?.pathname??"",search:h?.groups?.search??"",hash:h?.groups?.hash??""}}}function gd(n){const t=Hs(n);return t.protocol==="http:"||t.protocol==="https:"}function to(n=window.location.href){const t=Hs(n),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function yd(n=Hs().search){n=decodeURIComponent(n).replace(/^[#?&]/,"");const t={};if(!n)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let s=e.exec(n);for(;s;)t[s[1]]=s[2],s=e.exec(n);return t}const wd=(n=window.location.href)=>JSON.parse('{"'+decodeURI(n.split("?")[1]).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}');function $s(n){return"?"+Object.entries(n).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function eo(n){return"?"+[...n.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function so(n,t){return n.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function xd(n,t){return so(n,$s(t))}function yi(n,t){return n+t.replace(/^[&?]/,n.indexOf("?")>=0?"&":"?")}function bd(n,t){return yi(n,$s(t))}class vd{worker;cbs={};constructor(t){if(Hr)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 i=Math.random().toString(36).slice(2),r=a=>{a.data.id===i&&(this.worker.removeEventListener("message",r),delete this.cbs[i],e(),s())};this.cbs[i]=r.bind(this,{data:{id:i}}),this.worker.addEventListener("message",r),this.worker.postMessage({...t,id:i})}else this.worker.postMessage(t),s()})}}class Sd{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(i=>i(this.port1,s))}),this.port1.addEventListener("messageerror",s=>{this.port1MessageErrorCbs.forEach(i=>i(this.port1,s))}),this.port1.start(),this.port2.addEventListener("message",s=>{this.port2MessageCbs.forEach(i=>i(this.port2,s))}),this.port2.addEventListener("messageerror",s=>{this.port2MessageErrorCbs.forEach(i=>i(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){Ce(this.port1MessageCbs,t)}offPort1MessageError(t){Ce(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){Ce(this.port2MessageCbs,t)}offPort2MessageError(t){Ce(this.port2MessageErrorCbs,t)}}function no(){let n=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0,s=t.length;e<s;e++)try{n=new window.ActiveXObject(t[e]);break}catch{continue}}else n=new XMLHttpRequest;return n}function Td(n,t){return new Promise((e,s)=>{const{method:i="GET",data:r={},multipartFormDataString:a="",boundary:o="",headers:h={},withCredentials:c=!1,responseType:l="json",timeout:d=3e4}=t||{},y=no();y.timeout=d,y.responseType=l,y.onreadystatechange=function(x){y.readyState===4&&(y.status===200?e(y.response):s(y.statusText))},y.ontimeout=()=>{s(`${n} is timed out for ${d}ms.`)},y.addEventListener("load",x=>t?.load?.(x,y),!1),y.addEventListener("loadstart",x=>t?.loadstart?.(x,y),!1),y.addEventListener("loadend",x=>t?.loadend?.(x,y),!1),y.addEventListener("progress",x=>{if(x.lengthComputable){const p=Math.round(x.loaded*100/x.total);t?.progress?.(x,y,p)}},!1),y.addEventListener("error",x=>t?.error?.(x,y),!1),y.addEventListener("abort",x=>t?.abort?.(x,y),!1);const b=i.toUpperCase();Object.assign(h,{Accept:"*/*"});let w=!1,_=!1,S=!1;function v(){c&&(y.withCredentials=!0);for(const x in h)ct(x).toLowerCase()=="content-type"&&h[x].toLowerCase()=="multipart/form-data"?(w=!0,y.setRequestHeader("Content-Type","multipart/form-data; boundary="+o)):(ct(x).toLowerCase()=="content-type"&&(h[x].toLowerCase().indexOf("text/plain")>=0?_=!0:h[x].toLowerCase().indexOf("application/json")>=0&&(S=!0)),y.setRequestHeader(x,h[x]))}switch(b){case"GET":let x="";r instanceof FormData?x=eo(r):x=$s(r),y.open("GET",yi(n,x),!0),v(),y.send(null);break;default:y.open(b,n,!0),v(),w?y.sendAsBinary(a):S?y.send(JSON.stringify(r)):_?y.send(Object.entries(r).map(([p,g])=>`${p}=${g}`).join(`\r
47
+ `)):y.send(Object.entries(r).map(([p,g])=>`${encodeURIComponent(p)}=${encodeURIComponent(g)}`).join("&"));break}})}async function Cd(n){const t={url:n.action||"",data:{},contentType:n.method.toLowerCase()==="post"&&n.enctype?n.enctype:"application/x-www-form-urlencoded",multipartFormDataString:"",boundary:"---------------------------"+Date.now().toString(16)},e=[],s=t.contentType=="multipart/form-data";for(let i=0;i<n.elements.length;i++){const r=n.elements[i];if(!r.hasAttribute("name"))continue;const a=r.getAttribute("type");switch(r.nodeName.toUpperCase()==="INPUT"&&a?a.toUpperCase():""){case"FILE":const h=r;if(s)for(let d=0,y=h.files?.length||0;d<y;d++){const b=h.files?.[d];if(b){const w=await Ne(b,Ct.binaryString);e.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+b.name+`"\r
48
48
  Content-Type: `+b.type+`\r
49
49
  \r
50
50
  `+w+`\r
@@ -54,9 +54,9 @@ Content-Type: `+b.type+`\r
54
54
  `):t.data[l.name]=l.value;break}}return t.multipartFormDataString="--"+t.boundary+`\r
55
55
  `+e.join("--"+t.boundary+`\r
56
56
  `)+"--"+t.boundary+`--\r
57
- `,t}class fd{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.captureDrag({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,i)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=i.dx,this.dragDy+=i.dy),this.setCursor()}}),this.app.on("tap",()=>{for(const s of this.shapes)if(this.currentMouseInShape==s){s.emit("clicked");let i=s.parent;for(;i;)i.emit("clicked",s),i=i.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(B(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 at&&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(const e of this.shapes){if(!e.isShow)continue;if(this.ctx.save(),e.frameStart(this.app.mousePoint),dd(this.ctx,e.getAttrs()),e.followMouse&&(!hs(e.x,this.app.mousePoint.x,5)||!hs(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 i=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,i||r){if(e.x+=i,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",i,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 i=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=i,i&&(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,i=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=$e(r);return this.app.captureDrag({move:()=>{if(this.isMouseDown){for(let c=0;c<i;c++){const l=Math.random()*Math.PI*2,f=Math.random()*s,y=this.app.mousePoint.x+Math.cos(l)*f|0,b=this.app.mousePoint.y+Math.sin(l)*f|0,w=(y+b*a.width)*4;o[w]=h.r,o[w+1]=h.g,o[w+2]=h.b,o[w+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureDrag({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())}})}}}function dd(n,t){for(const e in t){const s=t[e];switch(e){case"fill":s!=="none"&&(n.fillStyle=s);break;case"stroke":s!=="none"&&(n.strokeStyle=s);break;case"stroke-width":case"strokeWidth":n.lineWidth=Number(s);break;case"stroke-linecap":case"strokeLinecap":n.lineCap=s;break;case"stroke-linejoin":case"strokeLinejoin":switch(s){case"round":case"bevel":case"miter":n.lineJoin=s;break;default:n.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":n.miterLimit=Number(s);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":n.lineDashOffset=Number(s);break;case"stroke-dasharray":case"strokeDasharray":typeof s=="string"&&n.setLineDash(s.split(/\s+/).map(i=>Number(i)));break;case"cursor":break;case"font":typeof s=="string"&&(n.font=s);break;case"font-size":case"fontSize":n.font+=` ${s}`;break;case"font-family":case"fontFamily":n.font+=` ${s}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(s){case"middle":n.textAlign="center";break;case"end":n.textAlign="end";break;case"start":n.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(s){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":n.textBaseline=s;break;default:n.textBaseline="alphabetic";break}break}}}class md{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Je(t),this.remoteVideoUtil=new Je(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 i=void 0,r=new RTCPeerConnection(i);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(i);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 i=new RTCIceCandidate(s),r=this.getOtherPeer(e);r&&(r.addIceCandidate(i).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
57
+ `,t}class Pd{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 Bs(this.app.container,this.app.width,this.app.height,e),this.app.captureDrag({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,i)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=i.dx,this.dragDy+=i.dy),this.setCursor()}}),this.app.on("tap",()=>{for(const s of this.shapes)if(this.currentMouseInShape==s){s.emit("clicked");let i=s.parent;for(;i;)i.emit("clicked",s),i=i.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(B(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 ot&&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(const e of this.shapes){if(!e.isShow)continue;if(this.ctx.save(),e.frameStart(this.app.mousePoint),Ed(this.ctx,e.getAttrs()),e.followMouse&&(!os(e.x,this.app.mousePoint.x,5)||!os(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 i=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,i||r){if(e.x+=i,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",i,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 i=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=i,i&&(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,i=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=$e(r);return this.app.captureDrag({move:()=>{if(this.isMouseDown){for(let c=0;c<i;c++){const l=Math.random()*Math.PI*2,d=Math.random()*s,y=this.app.mousePoint.x+Math.cos(l)*d|0,b=this.app.mousePoint.y+Math.sin(l)*d|0,w=(y+b*a.width)*4;o[w]=h.r,o[w+1]=h.g,o[w+2]=h.b,o[w+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureDrag({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())}})}}}function Ed(n,t){for(const e in t){const s=t[e];switch(e){case"fill":s!=="none"&&(n.fillStyle=s);break;case"stroke":s!=="none"&&(n.strokeStyle=s);break;case"stroke-width":case"strokeWidth":n.lineWidth=Number(s);break;case"stroke-linecap":case"strokeLinecap":n.lineCap=s;break;case"stroke-linejoin":case"strokeLinejoin":switch(s){case"round":case"bevel":case"miter":n.lineJoin=s;break;default:n.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":n.miterLimit=Number(s);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":n.lineDashOffset=Number(s);break;case"stroke-dasharray":case"strokeDasharray":typeof s=="string"&&n.setLineDash(s.split(/\s+/).map(i=>Number(i)));break;case"cursor":break;case"font":typeof s=="string"&&(n.font=s);break;case"font-size":case"fontSize":n.font+=` ${s}`;break;case"font-family":case"fontFamily":n.font+=` ${s}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(s){case"middle":n.textAlign="center";break;case"end":n.textAlign="end";break;case"start":n.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(s){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":n.textBaseline=s;break;default:n.textBaseline="alphabetic";break}break}}}class _d{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Je(t),this.remoteVideoUtil=new Je(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 i=void 0,r=new RTCPeerConnection(i);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(i);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 i=new RTCIceCandidate(s),r=this.getOtherPeer(e);r&&(r.addIceCandidate(i).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
58
58
  ${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:
59
59
  ${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:
60
60
  ${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:
61
- ${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 pd{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.")}}const io=[],ro={};function yi(n){io.push(n)}function gd(n,t=!1){const e=to();if(ro[e])return;wx.error(r=>{console.log(r.errMsg||JSON.stringify(r))}),wx.ready(()=>{io.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"],i=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(n,{debug:t,jsApiList:s,openTagList:i})),ro[e]=!0}function yd(n){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[n],success:function(s){s.checkResult[n]?t(!0):e(!1)},fail:function(){e(!1)}})})}function wd(n){yi(function(){wx.updateAppMessageShareData(n)})}function xd(n){yi(function(){wx.updateTimelineShareData(n)})}function bd(n){wx.chooseImage(n)}function vd(n){wx.previewImage(n)}function Sd(n){wx.uploadImage(n)}function Td(n){wx.downloadImage(n)}function Cd(n){wx.getLocalImgData(n)}function Pd(){wx.startRecord()}function Ed(n){wx.stopRecord(n)}function _d(n){wx.onVoiceRecordEnd(n)}function Ad(n){wx.playVoice(n)}function Dd(n){wx.pauseVoice(n)}function Id(n){wx.stopVoice(n)}function Md(n){wx.onVoicePlayEnd(n)}function kd(n){wx.uploadVoice(n)}function Ld(n){wx.downloadVoice(n)}function Rd(n){wx.translateVoice(n)}function Od(n){wx.getNetworkType(n)}function Fd(n){wx.openLocation(n)}function Nd(n){wx.getLocation(n)}function Bd(n){wx.scanQRCode(n)}function Ud(n,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",n,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function Yd(n,t,e="snsapi_userinfo",s=""){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${n}&redirect_uri=${encodeURIComponent(t)}&response_type=code&scope=${e}&state=${s}#wechat_redirect`}function Xd(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function Ke(n,t){let e="未知错误";switch(n.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`${n.error}(${e}): ${n.errorMessage}`}function zd(n,t,e){ap.tradePay(Object.assign(n,{}),function(s){let i="未知错误";switch(s.resultCode){case 9e3:return i="订单支付成功",t?.(i);case 8e3:i="正在处理中";break;case 4e3:i="订单支付失败";break;case 6001:i="用户中途取消";break;case 6002:i="网络连接出错";break;case 99:i="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(i)})}function Gd(n,t,e){ap.scan(Object.assign(n,{fail:s=>{e?.(Ke(s))}}),function(s){t?.(s.code)})}function Vd(n,t,e){ap.getLocation(Object.assign(n,{fail:s=>{e?.(Ke(s))}}),function(s){t?.(s)})}function qd(n,t,e){ap.openLocation(Object.assign(n,{fail:s=>{e?.(Ke(s))}}),function(){t?.()})}function jd(n,t,e){ap.chooseImage(Object.assign(n,{fail:s=>{e?.(Ke(s,"chooseImage"))}}),function(s){t?.(s)})}function Hd(n,t,e){ap.previewImage(Object.assign(n,{fail:s=>{e?.(Ke(s))}}),function(){t?.()})}class $d{map;constructor(t,e=120.619585,s=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),i)}}class Wd{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||(i=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),De(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return xe("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const i=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?xe("span",{class:`current ${r}`},i):xe("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:a=>this.selectPage(e,a)},i))}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,i=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(xe("span",{},this.ellipseText))}for(let r=s;r<i;r++)this.appendVNode(t,r);if(i<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>i&&this.ellipseText&&t.children.push(xe("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,i);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"}),js(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)}}return d.Arrow=ef,d.BezierEasing=Nn,d.CSSToJSEasing=Tl,d.Clock=Yn,d.Color=ut,d.CommonKeyCode=Pf,d.Confetti=wf,d.ControlsColorPattern=ye,d.Cross=hf,d.CustomCanvasContext=Xe,d.CustomCanvasGradient=Bs,d.CustomCanvasPattern=Gn,d.DOMEventBus=Ku,d.DOMParse=La,d.DOMSVGUtil=pe,d.DOMToBlob=Rr,d.DOMToString=En,d.DOMVideo=Je,d.Easing=L,d.Ellipse=Ua,d.FetchWithAxios=kr,d.FetchWithAxiosRequestCancel=Lr,d.FileUpload=_c,d.Fox=sf,d.Heart=nf,d.HeartVariant=rf,d.HttpError=Di,d.Interpolation=Vt,d.Line=we,d.LinePicture=tf,d.LineQuadraticBezier=Xu,d.Ls=he,d.MVVM=Qf,d.Matrix=lt,d.Matrix3D=yt,d.NormalColors=Aa,d.Pagination=Wd,d.Point=Ht,d.Point3D=qe,d.Point3Ds=yf,d.Points=Ba,d.QRCode=ae,d.Rabbit=of,d.Rect=$t,d.Ring=ri,d.RingIndicator=mf,d.SVGParse=Na,d.SVGParsedPathArgsLength=Ve,d.Sector=lf,d.SectorArc=Xa,d.Segment=df,d.Shape=j,d.ShapeCombo=ai,d.ShapeGroup=at,d.Ship=uf,d.Slider=ff,d.Star=af,d.TWEEN=Ml,d.Text=Ze,d.Timeline=ks,d.Tip=Ya,d.Tree=cf,d.Tween=Un,d.WebGLRenderer=pd,d.WebRTCClient=md,d.WebSocketClient=td,d.YZCanvas=fd,d.YZCanvasContext=Us,d.YZMessageChannel=cd,d.YZSVG=Qu,d.YZWorker=hd,d.addClass=Ff,d.addWatermark=Ru,d.addWxJsReadyFnBeforeConfig=yi,d.ajax=ld,d.aliJsChooseImage=jd,d.aliJsGetLocation=Vd,d.aliJsOpenLocation=qd,d.aliJsPreviewImage=Hd,d.aliJsReady=Xd,d.aliJsScan=Gd,d.aliJsTradePay=zd,d.angle=ne,d.appendURL=gi,d.appendURLRecord=od,d.atomReadAttribute=$a,d.atomReadAttributes=fi,d.atomReadStyle=jl,d.atomReadStyles=Wn,d.atomRemoveAttribute=Lf,d.atomRemoveDataset=Of,d.atomRemoveStyle=Jn,d.atomWriteAttribute=di,d.atomWriteStyle=Xs,d.base64EncodeOutputStream=va,d.bitmapMapper=za,d.blobToImageData=au,d.byteArrayOutputStream=Kn,d.canDrawBitmap=Wr,d.canUsePaths=al,d.canUseWorker=$r,d.cancelFetch=kf,d.changeBrightness=ku,d.changeDiaphaneity=Lu,d.changeSize=Mu,d.checkWxJsApi=yd,d.clearCookies=Dc,d.color=$e,d.combineTransformToMatrix=Hl,d.compareVersion=Hc,d.computeImageDisplayRect=su,d.createElement=Yf,d.createElementNS=Xf,d.createFragment=Za,d.createIndexDB=kc,d.createObjectURL=Ga,d.createTextNode=zf,d.createXMLHttpRequest=no,d.dispatchEvent=Br,d.distance=Os,d.distance2=Fs,d.drawBitmapInCanvas=bf,d.drawQRCodeToCanvas=Uu,d.easeNameToCubicBezier=Bn,d.flipSideToSide=hu,d.flipUpsideDown=cu,d.flushURL=so,d.flushURLRecord=ad,d.formDataToSearch=eo,d.fpsTask=ll,d.getBitmapFromCanvas=xf,d.getBodyPosition=qu,d.getBrowserClient=An,d.getBrowserClientVersion=$c,d.getBrowserLanguage=Wc,d.getCSSVar=U,d.getDOMMatrix=Hn,d.getDirection=Rl,d.getDocumentElementPosition=We,d.getElementPositionInPage=Ia,d.getElementPositionInPage2=$u,d.getElementPositionInViewport=Ma,d.getFetchId=Gs,d.getFileExtension=Ec,d.getFileMD5Hash=Fr,d.getFileTypeFromFile=Pc,d.getFormSubmitData=ud,d.getImageData=wa,d.getImageDataByAIData=Fu,d.getImageMainColor=ou,d.getInternetExplorerVersion=Vr,d.getMouseButton=Vf,d.getMousePositionInElement=Mt,d.getMousePositionInPage=ka,d.getMousePositionInViewport=Zu,d.getOperatingSystem=_s,d.getOperatingSystemVersion=jc,d.getPageSize=Hu,d.getParameters=rd,d.getPath=sd,d.getRelativeBoundingClientRect=Wu,d.getScreenPosition=Vu,d.getStyle=ge,d.getTimeZone=Jc,d.getURL=Hs,d.getVerticalScrollPercentInPage=Ju,d.getViewportSize=ju,d.getVnode=Xn,d.gifImage=Sa,d.h=xe,d.hFromEl=qs,d.hasClass=Bf,d.hasDocument=nl,d.hasHistory=il,d.hasWindow=Hr,d.hideEl=Ja,d.iframePostMessage=jf,d.imageDataToBitmap=nu,d.imageDataToBlob=ru,d.imageDataToDataURL=iu,d.immediateVnode=kl,d.injectStyle=pa,d.injectWxJsConfig=gd,d.isAliBrowser=jr,d.isAliMiniProgram=sl,d.isAndroid=Gr,d.isAppleDevice=Zc,d.isBrowserSupportFileAPI=rl,d.isElement=ol,d.isIE=Qc,d.isIE9or10=tl,d.isIOS=Dn,d.isMacOS=In,d.isMobile=Kc,d.isMouseHover=qf,d.isNative=As,d.isURL=nd,d.isWxBrowser=qr,d.isWxMiniProgram=el,d.jpgToPng=_u,d.leftRotate=lu,d.length=Rs,d.mapTDTJSSDK=$d,d.marginSharpen=Eu,d.microTask=ml,d.mosaic=Ou,d.mount=De,d.multiplyArrayOfMatrix=Vl,d.multiplyArrayOfMatrix3D=ql,d.multiplyMatrix=da,d.multiplyMatrix3D=ma,d.nextTick=dl,d.normalizePoint=Ll,d.objectSignature=Mr,d.onDocumentReady=Vc,d.outputGifBase64=Ta,d.outputQRCodeBase64=Bu,d.parseCSS=Fa,d.parseTransformToMatrix=jn,d.patch=js,d.pngToJpg=Au,d.polar=Bt,d.prefixes=hl,d.radiusClip=Iu,d.readFileInBrowser=Ne,d.recordToSearch=$s,d.rectClip=Du,d.removeClass=Nf,d.requestAnimationFrameCycle=Mn,d.reverseCSSToJSEasing=Cl,d.reverseEaseNameToCubicBezier=na,d.reverseEasing=Kr,d.revokeObjectURL=vf,d.rightRotate=uu,d.rotatePoint=It,d.scheduleIdle=Jr,d.scheduleVnode=zn,d.scheduleYZIdle=On,d.scrollTo=Kl,d.searchToRecord=id,d.selectFileInBrowser=_n,d.setCSSVar=Yu,d.setIntervalAccurate=cl,d.setManualScroll=Ql,d.setRem=ed,d.setStyle=$n,d.setTimeoutAccurate=kn,d.setWindowTitle=qc,d.sharpen=Pu,d.showEl=Wa,d.signature=Ir,d.simulateMouseEventFromTouch=Xc,d.stringToDOM=Cc,d.theme=Qn,d.toBlackAndWhite=mu,d.toBlue=wu,d.toBlueAndGreen=vu,d.toBlueAndGrey=Cu,d.toDegree=rt,d.toGreen=yu,d.toGreenAndGrey=Tu,d.toGrey=fu,d.toGrey2=du,d.toOpposite=pu,d.toRadian=B,d.toRed=gu,d.toRedAndBlue=bu,d.toRedAndGreen=xu,d.toRedAndGrey=Su,d.toggleClass=mi,d.toggleElDisplay=Uf,d.transformPath2D=Gl,d.trimHash=to,d.useAttribute=oe,d.useClickA=ci,d.useClipboard=Hf,d.useCookie=Ac,d.useDataset=Rf,d.useElement=kt,d.useEmit=Qt,d.useEventListener=ht,d.useFetch=ja,d.useFetchCache=Mf,d.useFireEvent=Yc,d.useHistoryRouter=Wl,d.useHotKey=hi,d.useHotKeyFileLoop=_f,d.useHotKeyFileOnce=Ef,d.useLoadImage=qa,d.useLoadLink=Df,d.useLoadScript=Af,d.useLocalStorage=Nr,d.useLocale=pi,d.useLocation=$f,d.useMedia=Ur,d.useMutation=eu,d.usePreventScroll=Zl,d.useResize=ya,d.useRunInSandbox=Jf,d.useSafeArea=$l,d.useScroll=Jl,d.useSelectFile=oi,d.useSelectFileImage=Sf,d.useSessionStorage=Ic,d.useShadowRoot=Gf,d.useTheme=zc,d.useThemeToggle=Gc,d.useVibrate=Wf,d.useVisible=tu,d.useWindow=_e,d.waitForStyleSheetsLoaded=If,d.writeToIndexDB=Lc,d.wxJsChooseImage=bd,d.wxJsDownloadImage=Td,d.wxJsDownloadVoice=Ld,d.wxJsGetLocalImgData=Cd,d.wxJsGetLocation=Nd,d.wxJsGetNetworkType=Od,d.wxJsLogin=Yd,d.wxJsOnVoicePlayEnd=Md,d.wxJsOnVoiceRecordEnd=_d,d.wxJsOpenLocation=Fd,d.wxJsPauseVoice=Dd,d.wxJsPay=Ud,d.wxJsPlayVoice=Ad,d.wxJsPreviewImage=vd,d.wxJsScanQRCode=Bd,d.wxJsStartRecord=Pd,d.wxJsStopRecord=Ed,d.wxJsStopVoice=Id,d.wxJsTranslateVoice=Rd,d.wxJsUpdateAppMessageShareData=wd,d.wxJsUpdateTimelineShareData=xd,d.wxJsUploadImage=Sd,d.wxJsUploadVoice=kd,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),d}({});
61
+ ${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 Ad{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.")}}const io=[],ro={};function wi(n){io.push(n)}function Dd(n,t=!1){const e=to();if(ro[e])return;wx.error(r=>{console.log(r.errMsg||JSON.stringify(r))}),wx.ready(()=>{io.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"],i=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(n,{debug:t,jsApiList:s,openTagList:i})),ro[e]=!0}function Id(n){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[n],success:function(s){s.checkResult[n]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Md(n){wi(function(){wx.updateAppMessageShareData(n)})}function kd(n){wi(function(){wx.updateTimelineShareData(n)})}function Ld(n){wx.chooseImage(n)}function Rd(n){wx.previewImage(n)}function Od(n){wx.uploadImage(n)}function Fd(n){wx.downloadImage(n)}function Nd(n){wx.getLocalImgData(n)}function Bd(){wx.startRecord()}function Ud(n){wx.stopRecord(n)}function Yd(n){wx.onVoiceRecordEnd(n)}function Xd(n){wx.playVoice(n)}function zd(n){wx.pauseVoice(n)}function Gd(n){wx.stopVoice(n)}function Vd(n){wx.onVoicePlayEnd(n)}function qd(n){wx.uploadVoice(n)}function jd(n){wx.downloadVoice(n)}function Hd(n){wx.translateVoice(n)}function $d(n){wx.getNetworkType(n)}function Wd(n){wx.openLocation(n)}function Jd(n){wx.getLocation(n)}function Zd(n){wx.scanQRCode(n)}function Kd(n,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",n,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function Qd(n,t,e="snsapi_userinfo",s=""){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${n}&redirect_uri=${encodeURIComponent(t)}&response_type=code&scope=${e}&state=${s}#wechat_redirect`}function tm(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function Ke(n,t){let e="未知错误";switch(n.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`${n.error}(${e}): ${n.errorMessage}`}function em(n,t,e){ap.tradePay(Object.assign(n,{}),function(s){let i="未知错误";switch(s.resultCode){case 9e3:return i="订单支付成功",t?.(i);case 8e3:i="正在处理中";break;case 4e3:i="订单支付失败";break;case 6001:i="用户中途取消";break;case 6002:i="网络连接出错";break;case 99:i="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(i)})}function sm(n,t,e){ap.scan(Object.assign(n,{fail:s=>{e?.(Ke(s))}}),function(s){t?.(s.code)})}function nm(n,t,e){ap.getLocation(Object.assign(n,{fail:s=>{e?.(Ke(s))}}),function(s){t?.(s)})}function im(n,t,e){ap.openLocation(Object.assign(n,{fail:s=>{e?.(Ke(s))}}),function(){t?.()})}function rm(n,t,e){ap.chooseImage(Object.assign(n,{fail:s=>{e?.(Ke(s,"chooseImage"))}}),function(s){t?.(s)})}function am(n,t,e){ap.previewImage(Object.assign(n,{fail:s=>{e?.(Ke(s))}}),function(){t?.()})}class om{map;constructor(t,e=120.619585,s=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),i)}}class hm{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||(i=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),De(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return be("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const i=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?be("span",{class:`current ${r}`},i):be("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:a=>this.selectPage(e,a)},i))}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,i=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(be("span",{},this.ellipseText))}for(let r=s;r<i;r++)this.appendVNode(t,r);if(i<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>i&&this.ellipseText&&t.children.push(be("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,i);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"}),js(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)}}return f.Arrow=yf,f.BezierEasing=Nn,f.CSSToJSEasing=Il,f.Clock=Yn,f.Color=dt,f.CommonKeyCode=Yf,f.Confetti=Lf,f.ControlsColorPattern=we,f.Cross=Tf,f.CustomCanvasContext=Xe,f.CustomCanvasGradient=Ns,f.CustomCanvasPattern=Gn,f.DOMEventBus=mf,f.DOMParse=Ra,f.DOMSVGUtil=pe,f.DOMToBlob=Nr,f.DOMToString=En,f.DOMVideo=Je,f.Easing=L,f.Ellipse=Ya,f.FetchWithAxios=Or,f.FetchWithAxiosRequestCancel=Fr,f.FileUpload=Rc,f.Fox=wf,f.Heart=xf,f.HeartVariant=bf,f.HttpError=Ii,f.Interpolation=Gt,f.Line=xe,f.LinePicture=gf,f.LineQuadraticBezier=sf,f.Ls=he,f.MVVM=fd,f.Matrix=ft,f.Matrix3D=wt,f.NormalColors=Ma,f.Pagination=hm,f.Point=jt,f.Point3D=qe,f.Point3Ds=kf,f.Points=Ua,f.QRCode=oe,f.Rabbit=Sf,f.Rect=Ht,f.Ring=hi,f.RingIndicator=Df,f.SVGParse=Ba,f.SVGParsedPathArgsLength=Ve,f.Sector=Pf,f.SectorArc=za,f.Segment=Af,f.Shape=j,f.ShapeCombo=ci,f.ShapeGroup=ot,f.Ship=Ef,f.Slider=_f,f.Star=vf,f.TWEEN=Bl,f.Text=Ze,f.Timeline=Ms,f.Tip=Xa,f.Tree=Cf,f.Tween=Un,f.WebGLRenderer=Ad,f.WebRTCClient=_d,f.WebSocketClient=dd,f.YZCanvas=Pd,f.YZCanvasContext=Bs,f.YZMessageChannel=Sd,f.YZSVG=pf,f.YZWorker=vd,f.addClass=Zf,f.addWatermark=Wu,f.addWxJsReadyFnBeforeConfig=wi,f.ajax=Td,f.aliJsChooseImage=rm,f.aliJsGetLocation=nm,f.aliJsOpenLocation=im,f.aliJsPreviewImage=am,f.aliJsReady=tm,f.aliJsScan=sm,f.aliJsTradePay=em,f.angle=se,f.appendURL=yi,f.appendURLRecord=bd,f.atomReadAttribute=pa,f.atomReadAttributes=Zn,f.atomReadStyle=Ql,f.atomReadStyles=Wn,f.atomRemoveAttribute=su,f.atomRemoveDataset=Jf,f.atomRemoveStyle=Jn,f.atomWriteAttribute=Xs,f.atomWriteStyle=Ys,f.base64EncodeOutputStream=Ca,f.bitmapMapper=Ga,f.blobToImageData=vu,f.byteArrayOutputStream=Qn,f.canDrawBitmap=$r,f.canUsePaths=dl,f.canUseWorker=Hr,f.cancelBubble=Xr,f.cancelFetch=$f,f.changeBrightness=Hu,f.changeDiaphaneity=$u,f.changeSize=ju,f.checkWxJsApi=Id,f.clearCookies=Fc,f.color=$e,f.combineTransformToMatrix=tu,f.compareVersion=Kc,f.computeImageDisplayRect=yu,f.createElement=ed,f.createElementNS=sd,f.createFragment=Za,f.createIndexDB=Uc,f.createObjectURL=Va,f.createRunCycleInMaxRate=yl,f.createTextNode=nd,f.createXMLHttpRequest=no,f.distance=Rs,f.distance2=Os,f.domPrefixes=eu,f.drawBitmapInCanvas=Of,f.drawQRCodeToCanvas=tf,f.easeNameToCubicBezier=Bn,f.flipSideToSide=Tu,f.flipUpsideDown=Cu,f.flushURL=so,f.flushURLRecord=xd,f.formDataToSearch=eo,f.getBitmapFromCanvas=Rf,f.getBodyPosition=of,f.getBrowserClient=An,f.getBrowserClientVersion=Qc,f.getBrowserLanguage=tl,f.getCSSVar=U,f.getDOMMatrix=Hn,f.getDirection=Xl,f.getDocumentElementPosition=We,f.getElementPositionInPage=si,f.getElementPositionInPage2=lf,f.getElementPositionInViewport=La,f.getFetchId=Gs,f.getFileExtension=kc,f.getFileMD5Hash=Ur,f.getFileTypeFromFile=Mc,f.getFormSubmitData=Cd,f.getImageData=va,f.getImageDataByAIData=Zu,f.getImageMainColor=Su,f.getInternetExplorerVersion=Gr,f.getKeyCode=Xf,f.getMIME=Lc,f.getMouseButton=Jc,f.getMousePositionInElement=kt,f.getMousePositionInPage=ni,f.getMousePositionInViewport=df,f.getOperatingSystem=Es,f.getOperatingSystemVersion=Zc,f.getPageSize=cf,f.getParameters=wd,f.getPath=pd,f.getRelativeBoundingClientRect=uf,f.getScreenPosition=af,f.getStyle=ge,f.getTimeZone=el,f.getURL=Hs,f.getVerticalScrollPercentInPage=ff,f.getViewportSize=hf,f.getVnode=Xn,f.gifImage=Pa,f.h=be,f.hFromEl=qs,f.hasClass=Qf,f.hasDocument=ll,f.hasHistory=ul,f.hasWindow=jr,f.hideEl=Ja,f.iframePostMessage=rd,f.imageDataToBitmap=wu,f.imageDataToBlob=bu,f.imageDataToDataURL=xu,f.immediateVnode=Ul,f.injectStyle=ma,f.injectWxJsConfig=Dd,f.isAliBrowser=qr,f.isAliMiniProgram=cl,f.isAndroid=zr,f.isAppleDevice=sl,f.isBrowserSupportFileAPI=fl,f.isElement=ml,f.isEventSupported=Wc,f.isIE=il,f.isIE10=al,f.isIE11=ol,f.isIE9=rl,f.isIOS=Dn,f.isMacOS=In,f.isMobile=nl,f.isNative=_s,f.isURL=gd,f.isWxBrowser=Vr,f.isWxMiniProgram=hl,f.jpgToPng=zu,f.leftRotate=Pu,f.length=Ls,f.mapTDTJSSDK=om,f.marginSharpen=Xu,f.microTask=vl,f.mosaic=Ju,f.mount=De,f.multiplyArrayOfMatrix=Zl,f.multiplyArrayOfMatrix3D=Kl,f.multiplyMatrix=fa,f.multiplyMatrix3D=da,f.nextTick=bl,f.normalizePoint=Yl,f.objectSignature=Rr,f.onDocumentReady=ou,f.outputGifBase64=Ea,f.outputQRCodeBase64=Qu,f.parseCSS=Na,f.parseTransformToMatrix=jn,f.patch=js,f.pngToJpg=Gu,f.polar=Nt,f.prefixes=pl,f.preventDefault=Qt,f.radiusClip=qu,f.readFileInBrowser=Ne,f.recordToSearch=$s,f.rectClip=Vu,f.removeClass=Kf,f.requestAnimationFrameCycle=Mn,f.reverseCSSToJSEasing=Ml,f.reverseEaseNameToCubicBezier=sa,f.reverseEasing=Zr,f.revokeObjectURL=Ff,f.rightRotate=Eu,f.rotatePoint=Mt,f.scheduleIdle=Wr,f.scheduleVnode=zn,f.scheduleYZIdle=On,f.scrollTo=du,f.searchToRecord=yd,f.selectFileInBrowser=_n,f.setCSSVar=ef,f.setIntervalAccurate=gl,f.setManualScroll=mu,f.setRem=md,f.setStyle=$n,f.setTimeoutAccurate=kn,f.setWindowTitle=hu,f.sharpen=Yu,f.showEl=Wa,f.signature=Lr,f.simulateMouseEventFromTouch=$c,f.stringToDOM=Ic,f.theme=ti,f.toBlackAndWhite=Du,f.toBlue=Lu,f.toBlueAndGreen=Fu,f.toBlueAndGrey=Uu,f.toDegree=at,f.toGreen=ku,f.toGreenAndGrey=Bu,f.toGrey=_u,f.toGrey2=Au,f.toOpposite=Iu,f.toRadian=B,f.toRed=Mu,f.toRedAndBlue=Ou,f.toRedAndGreen=Ru,f.toRedAndGrey=Nu,f.toggleClass=pi,f.toggleElDisplay=td,f.transformPath2D=Jl,f.trimHash=to,f.useAttribute=ne,f.useClickA=fi,f.useClipboard=ad,f.useCookie=Oc,f.useDataset=Wf,f.useDraggable=nu,f.useDrop=iu,f.useElement=$t,f.useEmit=te,f.useEventListener=Z,f.useFetch=Ha,f.useFetchCache=Hf,f.useFireEvent=Hc,f.useHistoryRouter=lu,f.useHotKey=ui,f.useHotKeyFileLoop=Gf,f.useHotKeyFileOnce=zf,f.useLoadImage=ja,f.useLoadLink=qf,f.useLoadScript=Vf,f.useLocalStorage=Yr,f.useLocale=gi,f.useLocation=od,f.useMedia=ga,f.useMutation=gu,f.usePreventScroll=fu,f.useResize=ba,f.useRunInSandbox=cd,f.useSafeArea=cu,f.useScroll=uu,f.useSelectFile=li,f.useSelectFileImage=Nf,f.useSessionStorage=Nc,f.useShadowRoot=id,f.useTheme=ru,f.useThemeToggle=au,f.useVibrate=hd,f.useVisible=pu,f.useWindow=ye,f.waitForStyleSheetsLoaded=jf,f.writeToIndexDB=Yc,f.wxJsChooseImage=Ld,f.wxJsDownloadImage=Fd,f.wxJsDownloadVoice=jd,f.wxJsGetLocalImgData=Nd,f.wxJsGetLocation=Jd,f.wxJsGetNetworkType=$d,f.wxJsLogin=Qd,f.wxJsOnVoicePlayEnd=Vd,f.wxJsOnVoiceRecordEnd=Yd,f.wxJsOpenLocation=Wd,f.wxJsPauseVoice=zd,f.wxJsPay=Kd,f.wxJsPlayVoice=Xd,f.wxJsPreviewImage=Rd,f.wxJsScanQRCode=Zd,f.wxJsStartRecord=Bd,f.wxJsStopRecord=Ud,f.wxJsStopVoice=Gd,f.wxJsTranslateVoice=Hd,f.wxJsUpdateAppMessageShareData=Md,f.wxJsUpdateTimelineShareData=kd,f.wxJsUploadImage=Od,f.wxJsUploadVoice=qd,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}),f}({});
62
62
  //# sourceMappingURL=zyzgroup_core_web.iife.js.map