@visactor/vchart
Version:
charts lib based @visactor/VGrammar
15 lines (13 loc) • 2.29 MB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChart={})}(this,(function(t){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function e(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i}function i(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))}const s=t=>t;var n,r;function a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}t.RenderModeEnum=void 0,(n=t.RenderModeEnum||(t.RenderModeEnum={}))["desktop-browser"]="desktop-browser",n["mobile-browser"]="mobile-browser",n.node="node",n.worker="worker",n.miniApp="miniApp",n.wx="wx",n.tt="tt",n.harmony="harmony",n["desktop-miniApp"]="desktop-miniApp",n.lynx="lynx",function(t){t.cartesianAxis="cartesianAxis",t.cartesianBandAxis="cartesianAxis-band",t.cartesianLinearAxis="cartesianAxis-linear",t.cartesianTimeAxis="cartesianAxis-time",t.cartesianLogAxis="cartesianAxis-log",t.cartesianSymlogAxis="cartesianAxis-symlog",t.polarAxis="polarAxis",t.polarBandAxis="polarAxis-band",t.polarLinearAxis="polarAxis-linear",t.crosshair="crosshair",t.cartesianCrosshair="cartesianCrosshair",t.polarCrosshair="polarCrosshair",t.dataZoom="dataZoom",t.geoCoordinate="geoCoordinate",t.indicator="indicator",t.discreteLegend="discreteLegend",t.continuousLegend="continuousLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend",t.markLine="markLine",t.markArea="markArea",t.markPoint="markPoint",t.polarMarkLine="polarMarkLine",t.polarMarkArea="polarMarkArea",t.polarMarkPoint="polarMarkPoint",t.geoMarkPoint="geoMarkPoint",t.tooltip="tooltip",t.title="title",t.player="player",t.scrollBar="scrollBar",t.label="label",t.totalLabel="totalLabel",t.brush="brush",t.poptip="poptip",t.customMark="customMark"}(r||(r={}));var o={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,s,r,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new n(s,r||t,a),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,a=new Array(r);n<r;n++)a[n]=s[n].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,s=this._events[e];return s?s.fn?1:s.length:0},o.prototype.emit=function(t,e,s,n,r,a){var o=i?i+t:t;if(!this._events[o])return!1;var l,h,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,s),!0;case 4:return c.fn.call(c.context,e,s,n),!0;case 5:return c.fn.call(c.context,e,s,n,r),!0;case 6:return c.fn.call(c.context,e,s,n,r,a),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,p=c.length;for(h=0;h<p;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,s);break;case 4:c[h].fn.call(c[h].context,e,s,n);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},o.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,s,n){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return a(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||n&&!o.once||s&&o.context!==s||a(this,r);else{for(var l=0,h=[],c=o.length;l<c;l++)(o[l].fn!==e||n&&!o[l].once||s&&o[l].context!==s)&&h.push(o[l]);h.length?this._events[r]=1===h.length?h[0]:h:a(this,r)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new s,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(o);var l=a(o.exports);var h=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var c=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||h(t,"Boolean");var u=t=>"function"==typeof t;var d=t=>null==t;var p=t=>null===t;var g=t=>null!=t;var f=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var m=t=>"object"==typeof t&&null!==t;var v=function(t){if(!m(t)||!h(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var y=t=>void 0===t;var _=(t,e=!1)=>{const i=typeof t;return e?"string"===i:"string"===i||h(t,"String")};var b=t=>Array.isArray?Array.isArray(t):h(t,"Array");var x=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var S=t=>h(t,"Date");var A=(t,e=!1)=>{const i=typeof t;return e?"number"===i:"number"===i||h(t,"Number")};var k=t=>"string"==typeof t&&!isNaN(Number(t))&&!isNaN(parseFloat(t));var C=t=>A(t)&&Number.isFinite(t);var M=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var T=t=>h(t,"RegExp");var w=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);var D=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const E=Object.prototype;var B=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||E)};const P=Object.prototype.hasOwnProperty;function R(t){if(d(t))return!0;if(x(t))return!t.length;const e=D(t);if("Map"===e||"Set"===e)return!t.size;if(B(t))return!Object.keys(t).length;for(const e in t)if(P.call(t,e))return!1;return!0}var L=(t,e,i)=>{const s=_(e)?e.split("."):e;for(let e=0;e<s.length;e++)t=t?t[s[e]]:void 0;return void 0===t?i:t};const I=Object.prototype.hasOwnProperty;var O=(t,e)=>null!=t&&I.call(t,e);function F(t,e,i){let s;if(!g(t)||"object"!=typeof t||e&&e(t))return t;const n=b(t),r=t.length;s=n?new Array(r):"object"==typeof t?{}:c(t)||A(t)||_(t)?t:S(t)?new Date(+t):void 0;const a=n?void 0:Object.keys(Object(t));let o=-1;if(s)for(;++o<(a||t).length;){const n=a?a[o]:o,r=t[n];i&&i.includes(n.toString())?s[n]=r:s[n]=F(r,e,i)}return s}function z(t,e,i=!1,s=!1){if(e){if(t===e)return;if(g(e)&&"object"==typeof e){const n=Object(e),r=[];for(const t in n)r.push(t);let{length:a}=r,o=-1;for(;a--;){const a=r[++o];!g(n[a])||"object"!=typeof n[a]||s&&b(t[a])?H(t,a,n[a]):j(t,e,a,i,s)}}}}function j(t,e,i,s=!1,n=!1){const r=t[i],a=e[i];let o=e[i],l=!0;if(b(a)){if(s)o=[];else if(b(r))o=r;else if(x(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++t<e;)o[t]=r[t]}}else v(a)?(o=null!=r?r:{},"function"!=typeof r&&"object"==typeof r||(o={})):l=!1;l&&z(o,a,s,n),H(t,i,o)}function H(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function N(t,...e){let i=-1;const s=e.length;for(;++i<s;)z(t,e[i],!0);return t}const U=Object.prototype.hasOwnProperty;function V(t,e){if(!t||!v(t))return t;const i={};return Object.keys(t).forEach((s=>{const n=t[s];let r=!1;e.forEach((t=>{(_(t)&&t===s||t instanceof RegExp&&s.match(t))&&(r=!0)})),r||(i[s]=n)})),i}function W(t){return Object.prototype.toString.call(t)}function G(t){return Object.keys(t)}function Y(t,e,i){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(W(t)!==W(e))return!1;if(u(t))return!!(null==i?void 0:i.skipFunction);if("object"!=typeof t)return!1;if(b(t)){if(t.length!==e.length)return!1;for(let s=t.length-1;s>=0;s--)if(!Y(t[s],e[s],i))return!1;return!0}if(!v(t))return!1;const s=G(t),n=G(e);if(s.length!==n.length)return!1;s.sort(),n.sort();for(let t=s.length-1;t>=0;t--)if(s[t]!=n[t])return!1;for(let n=s.length-1;n>=0;n--){const r=s[n];if(!Y(t[r],e[r],i))return!1}return!0}function X(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function $(t){return b(t)?t.length:f(t)?Object.keys(t).length:0}function K(t){if(!t)return[];if(Object.keys)return Object.keys(t);const e=[];for(const i in t)t.hasOwnProperty(i)&&e.push(i);return e}function q(t,e,i){const s=K(e);for(let n=0;n<s.length;n++){const r=s[n];(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}return t}function Z(t,e,i=!0){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){const s=Object.getOwnPropertyNames(e);for(let n=0;n<s.length;n++){const r=s[n];"constructor"!==r&&(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}}else q(t,e,i)}function J(t){return g(t)?b(t)?t:[t]:[]}function Q(t){if(x(t))return t[t.length-1]}const et=(t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let n=1;n<t.length;n++){const r=t[n];(null!==(i=null==e?void 0:e(r,s))&&void 0!==i?i:r-s)>0&&(s=r)}return s},it=(t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let n=1;n<t.length;n++){const r=t[n];(null!==(i=null==e?void 0:e(r,s))&&void 0!==i?i:r-s)<0&&(s=r)}return s};function st(t,e){if(!b(t)||!b(e))return!1;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function nt(t){return t&&b(t)?Array.from(new Set(J(t))):t}function rt(t,e=Math.random){let i,s,n=t.length;for(;n;)i=Math.floor(e()*n),s=t[--n],t[n]=t[i],t[i]=s;return t}function at(t){if(!b(t))return[t];const e=[];for(const i of t)e.push(...at(i));return e}function ot(t,e,i){g(e)||(e=t,t=0),g(i)||(i=1);let s=-1;const n=0|Math.max(0,Math.ceil((e-t)/i)),r=new Array(n);for(;++s<n;)r[s]=t+s*i;return r}function lt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ht(t){return Number(t)}function ct(t,e,i=ht){const s=t.length;if(!s)return;if(e<=0||s<2)return i(t[0],0,t);if(e>=1)return i(t[s-1],s-1,t);const n=(s-1)*e,r=Math.floor(n),a=i(t[r],r,t);return a+(i(t[r+1],r+1,t)-a)*(n-r)}const ut="undefined"!=typeof console;function dt(t,e,i){const s=[e].concat([].slice.call(i));ut&&console[t].apply(console,s)}var pt;t.LoggerLevel=void 0,(pt=t.LoggerLevel||(t.LoggerLevel={}))[pt.None=0]="None",pt[pt.Error=1]="Error",pt[pt.Warn=2]="Warn",pt[pt.Info=3]="Info",pt[pt.Debug=4]="Debug";class gt{static getInstance(t,e){return gt._instance&&A(t)?gt._instance.level(t):gt._instance||(gt._instance=new gt(t,e)),gt._instance}static setInstance(t){return gt._instance=t}static setInstanceLevel(t){gt._instance?gt._instance.level(t):gt._instance=new gt(t)}static clearInstance(){gt._instance=null}constructor(e=t.LoggerLevel.None,i){this._onErrorHandler=[],this._level=e,this._method=i}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach((e=>e(...t)))}canLogInfo(){return this._level>=t.LoggerLevel.Info}canLogDebug(){return this._level>=t.LoggerLevel.Debug}canLogError(){return this._level>=t.LoggerLevel.Error}canLogWarn(){return this._level>=t.LoggerLevel.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...e){var i;return this._level>=t.LoggerLevel.Error&&(this._onErrorHandler.length?this.callErrorHandler(...e):dt(null!==(i=this._method)&&void 0!==i?i:"error","ERROR",e)),this}warn(...e){return this._level>=t.LoggerLevel.Warn&&dt(this._method||"warn","WARN",e),this}info(...e){return this._level>=t.LoggerLevel.Info&&dt(this._method||"log","INFO",e),this}debug(...e){return this._level>=t.LoggerLevel.Debug&&dt(this._method||"log","DEBUG",e),this}}function ft(t,e,i=0,s){for(d(s)&&(s=t.length);i<s;){const n=i+s>>>1;lt(t[n],e)>0?s=n:i=n+1}return i}function mt(t,e,i,s){var n,r;const a=null!==(n=null==s?void 0:s.maxIterations)&&void 0!==n?n:100,o=null!==(r=null==s?void 0:s.tolerance)&&void 0!==r?r:1e-10,l=t(e),h=t(i);let c=i-e;if(l*h>0)return gt.getInstance().error("Initial bisect points must have opposite signs"),NaN;if(0===l)return e;if(0===h)return i;for(let i=0;i<a;++i){c/=2;const i=e+c,s=t(i);if(s*l>=0&&(e=i),Math.abs(c)<o||0===s)return i}return e+c}gt._instance=null;const vt=(t,e)=>yt(0,t.length,(i=>e(t[i]))),yt=(t,e,i)=>{let s=t,n=e;for(;s<n;){const t=Math.floor((s+n)/2);i(t)>=0?n=t:s=t+1}return s};function _t(t,e){let i,s=0,n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(i=e-n,n+=i/++s,r+=i*(e-n));else{let a=-1;for(let o of t)null!=(o=e(o,++a,t))&&(o=+o)>=o&&(i=o-n,n+=i/++s,r+=i*(o-n))}return s>1?r/(s-1):0}const bt=(t,e)=>{let i=t;return!0!==e&&(i=t.sort(lt)),ct(i,.5)},xt=Math.sqrt(50),St=Math.sqrt(10),At=Math.sqrt(2);const kt=1e-10,Ct=1e-10;function Mt(t,e,i=Ct,s=kt){const n=s,r=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,r)}function Tt(t,e,i,s){return t>e&&!Mt(t,e,i,s)}function wt(t,e,i,s){return t<e&&!Mt(t,e,i,s)}var Dt=t=>u(t)?t:()=>t;const Et=t=>{let e=null,i=null;return(...s)=>(e&&s.every(((t,i)=>t===e[i]))||(e=s,i=t(...s)),i)},Bt=(t,e=0)=>{let i="",s=e-1;for(;s>=0;)i=`${i}${t}`,s-=1;return i};var Pt=(t,e,i=" ",s="right")=>{const n=i,r=t+"",a=e-r.length;return a<=0?r:"left"===s?Bt(n,a)+r:"center"===s?Bt(n,Math.floor(a/2))+r+Bt(n,Math.ceil(a/2)):r+Bt(n,a)};var Rt=(t,e,i="right",s)=>{const n=d(s)?"…":s,r=t+"",a=r.length,o=Math.max(0,e-n.length);return a<=e?r:"left"===i?n+r.slice(a-o):"center"===i?r.slice(0,Math.ceil(o/2))+n+r.slice(a-Math.floor(o/2)):r.slice(0,o)+n};var Lt=(t,e)=>{const i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[];let n;if(e=e||i.length,t)for(n=0;n<t;n++)s[n]=i[0|Math.random()*e];else{let t;for(s[8]=s[13]=s[18]=s[23]="-",s[14]="4",n=0;n<36;n++)s[n]||(t=0|16*Math.random(),s[n]=i[19===n?3&t|8:t])}return s.join("")};var It=function(t,e,i){return t<e?e:t>i?i:t};var Ot=(t,e,i)=>{let[s,n]=t;n<s&&(s=t[1],n=t[0]);const r=n-s;return r>=i-e?[e,i]:(s=Math.min(Math.max(s,e),i-r),[s,s+r])};function Ft(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}let zt=!1;try{zt="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){zt=!1}function jt(t,e,i){let s,n,r,a,o,l,h=0,c=!1,u=!1,d=!0;const p=!e&&0!==e&&zt;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){const i=s,r=n;return s=n=void 0,h=e,a=t.apply(r,i),a}function m(t,e){return p?(cancelAnimationFrame(o),requestAnimationFrame(t)):setTimeout(t,e)}function v(t){const i=t-l;return void 0===l||i>=e||i<0||u&&t-h>=r}function y(){const t=Date.now();if(v(t))return _(t);o=m(y,function(t){const i=t-h,s=e-(t-l);return u?Math.min(s,r-i):s}(t))}function _(t){return o=void 0,d&&s?g(t):(s=n=void 0,a)}function b(...t){const i=Date.now(),r=v(i);if(s=t,n=this,l=i,r){if(void 0===o)return function(t){return h=t,o=m(y,e),c?g(t):a}(l);if(u)return o=m(y,e),g(l)}return void 0===o&&(o=m(y,e)),a}return e=+e||0,f(i)&&(c=!!i.leading,u="maxWait"in i,u&&(r=Math.max(C(i.maxWait)?i.maxWait:0,e)),d="trailing"in i?!!i.trailing:d),b.cancel=function(){void 0!==o&&function(t){if(p)return cancelAnimationFrame(t);clearTimeout(t)}(o),h=0,s=l=n=o=void 0},b.flush=function(){return void 0===o?a:_(Date.now())},b.pending=function(){return void 0!==o},b}function Ht(t,e,i){let s=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return f(i)&&(s="leading"in i?!!i.leading:s,n="trailing"in i?!!i.trailing:n),jt(t,e,{leading:s,trailing:n,maxWait:e})}function Nt(t,e){return i=>t*(1-i)+e*i}function Ut(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}function Vt(t,e){const i=t.valueOf(),s=e.valueOf(),n=new Date;return t=>(n.setTime(i*(1-t)+s*t),n)}zt=!1;const Wt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gt=new RegExp(Wt.source,"g");const Yt=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function Xt(t){if(t instanceof Date)return t;if(_(t)){const e=Yt.exec(t);if(!e)return new Date(NaN);if(!e[8])return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0);let i=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(i-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,i,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}return d(t)?new Date(NaN):new Date(Math.round(t))}function $t(t){if(C(t))return t;const e=+t;return C(e)?e:0}var Kt=function(t){return t.charAt(0).toLowerCase()+t.substring(1)};var qt=function(t){return t.charAt(0).toUpperCase()+t.substring(1)};function Zt(t){return parseFloat("0."+Math.sin(t).toString().substring(6))}const Jt=4294967296;function Qt(t=1){let e=t;return()=>(e=(1664525*e+1013904223)%Jt)/Jt}const te=()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])},ee=t=>e=>L(e,t),ie=(t,e={})=>{if(u(t))return t;const i=[t];return(e&&e.get||ee)(i)},se=(t,e={})=>{if(b(t)){const i=t.map((t=>ie(t,e)));return t=>i.map((e=>e(t)))}return ie(t,e)},ne=t=>t?"string"==typeof t||"number"==typeof t?()=>t:u(t)?t:e=>e[t.field]:null,re=(t,e)=>d(t)?e:_(t)?e*parseFloat(t)/100:t,ae=t=>0,oe=(t,e)=>{const i=u(e)?e:t=>t;let s,n;if(t&&t.length){const e=t.length;for(let r=0;r<e;r+=1){let e=i(t[r]);d(e)||!A(e=+e)||Number.isNaN(e)||(d(s)?(s=e,n=e):(s=Math.min(s,e),n=Math.max(n,e)))}return[s,n]}return[s,n]};function le(t){if(t<=0||t>=1)return 0;const e=-.00778489400243029,i=-.322396458041136,s=-2.40075827716184,n=-2.54973253934373,r=4.37466414146497,a=2.93816398269878,o=.00778469570904146,l=.32246712907004,h=2.445134137143,c=3.75440866190742;let u,d;return t<.02425?(u=Math.sqrt(-2*Math.log(t)),(((((e*u+i)*u+s)*u+n)*u+r)*u+a)/((((o*u+l)*u+h)*u+c)*u+1)):t<=.97575?(u=t-.5,d=u*u,(((((-39.6968302866538*d+220.946098424521)*d-275.928510446969)*d+138.357751867269)*d-30.6647980661472)*d+2.50662827745924)*u/(((((-54.4760987982241*d+161.585836858041)*d-155.698979859887)*d+66.8013118877197)*d-13.2806815528857)*d+1)):(u=Math.sqrt(-2*Math.log(1-t)),-(((((e*u+i)*u+s)*u+n)*u+r)*u+a)/((((o*u+l)*u+h)*u+c)*u+1))}function he(t,e,i,s){let n=1/0,r=-1/0,a=0,o=0;for(let s=0;s<t.length;s++){const l=t[s];let h=e(l),c=i(l);!d(h)&&(h=+h)>=h&&!d(c)&&(c=+c)>=c&&(h<n&&(n=h),h>r&&(r=h),a++,o+=h)}if(0===a)return{min:n,max:r,n:a,X:0,SSE:0,Sxx:0};const l=o/a;let h=0,c=0;for(let n=0;n<t.length;n++){const r=t[n];let a=e(r),o=i(r);if(!d(a)&&(a=+a)>=a&&!d(o)&&(o=+o)>=o){const t=o-s(a);h+=t*t;const e=a-l;c+=e*e}}return{min:n,max:r,n:a,X:l,SSE:h,Sxx:c}}function ce(t,e){const{n:i,X:s,Sxx:n,SSE:r}=e,a=i>2?r/(i-2):0;return{seMean:n>0?Math.sqrt(a*(1/i+(t-s)*(t-s)/n)):Math.sqrt(a/i),sePred:Math.sqrt(a*(1+1/i+(n>0?(t-s)*(t-s)/n:0)))}}function ue(t,e,i,s){const n=s-t*t;if(Math.abs(n)<Number.EPSILON)return{a:e,b:0};const r=(i-t*e)/n;return{a:e-r*t,b:r}}function de(t,e,i,s){for(let n=0;n<t.length;n++){const r=t[n];let a=e(r),o=i(r);!d(a)&&(a=+a)>=a&&!d(o)&&(o=+o)>=o&&s(a,o,n)}}function pe(t,e,i,s,n){let r=0,a=0;for(let o=0;o<t.length;o++){const l=t[o];let h=i(l);if(!d(h)&&(h=+h)>=h){const t=h-n(e(l));r+=t*t;const i=h-s;a+=i*i}}return 0===a?0:1-r/a}function ge(t,e=(t=>t.x),i=(t=>t.y),s){var n;const r=null!==(n=null==s?void 0:s.alpha)&&void 0!==n?n:.05;let a=0,o=0,l=0,h=0,c=0;de(t,e,i,((t,e)=>{a++,o+=(t-o)/a,l+=(e-l)/a,h+=(t*e-h)/a,c+=(t*t-c)/a}));const{a:u,b:d}=ue(o,l,h,c),p=t=>u+d*t,g=he(t,e,i,p);return{coef:{a:u,b:d},predict:p,rSquared:pe(t,e,i,l,p),evaluateGrid:function(t){const e=[];if(0===g.n||t<=0)return e;if(g.min===g.max){for(let i=0;i<t;i++)e.push({x:g.min,y:p(g.min)});return e}const i=(g.max-g.min)/(t-1);for(let s=0;s<t;s++){const n=s===t-1?g.max:g.min+i*s;e.push({x:n,y:p(n)})}return e},confidenceInterval:function(t=50){const e=[];if(0===g.n||t<=0)return e;const i=le(1-r/2);if(g.min===g.max){const s=p(g.min),n=ce(g.min,g);for(let r=0;r<t;r++)e.push({x:g.min,mean:s,lower:s-i*n.seMean,upper:s+i*n.seMean,predLower:s-i*n.sePred,predUpper:s+i*n.sePred});return e}const s=(g.max-g.min)/(t-1);for(let n=0;n<t;n++){const r=n===t-1?g.max:g.min+s*n,a=p(r),o=ce(r,g);e.push({x:r,mean:a,lower:a-i*o.seMean,upper:a+i*o.seMean,predLower:a-i*o.sePred,predUpper:a+i*o.sePred})}return e}}}function fe(t){const e=Math.abs(t);if(e>=1)return 0;const i=1-e*e*e;return i*i*i}const me=t=>1/Math.sqrt(2*Math.PI)*Math.exp(-.5*t*t);function ve(t,e,i=1){return t<=0||0===e?0:e*Math.pow(t,-1/(i+4))}function ye(t,e,i=1){return t<=0||0===e?0:Math.pow(4/(i+2),1/(i+4))*e*Math.pow(t,-1/(i+4))}class _e{}const be=1e-12,xe=Math.PI,Se=xe/2,Ae=2*xe,ke=2*Math.PI,Ce=Math.abs,Me=Math.atan2,Te=Math.cos,we=Math.max,De=Math.min,Ee=Math.sin,Be=Math.sqrt,Pe=Math.pow;function Re(t){return t>1?0:t<-1?xe:Math.acos(t)}function Le(t){return t>=1?Se:t<=-1?-Se:Math.asin(t)}function Ie(t,e,i,s,n){let r=i,a=s;return"number"==typeof t&&"number"==typeof i&&(r=(1-n)*t+n*i),"number"==typeof e&&"number"==typeof s&&(a=(1-n)*e+n*s),{x:r,y:a}}function Oe(t,e,i){const s=i.x-e.x,n=i.y-e.y,r=t.x-e.x,a=t.y-e.y;return Math.abs(s*a-r*n)/Math.sqrt(s*s+n*n)}function Fe(t,e){return t[0]*e[1]-t[1]*e[0]}function ze(t,e){return t.x*e.y-t.y*e.x}function je(t,e){let i=0;for(let s=0;s<t.length;++s)i+=t[s]*e[s];return i}function He(t,e){return Ce(t[0]-e[0])+Ce(t[1]-e[1])<1e-12}function Ne(t,e=10){return Math.round(t*e)/e}function Ue(t){const e=t.toString().split(/[eE]/),i=(e[0].split(".")[1]||"").length-(+e[1]||0);return i>0?i:0}function Ve(t,e){return Ne(t+e,10**Math.max(Ue(t),Ue(e)))}function We(t,e){return Ne(t-e,10**Math.max(Ue(t),Ue(e)))}class Ge{constructor(t=0,e=0,i,s){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=s}clone(){return new Ge(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return A(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return A(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class Ye{static distancePP(t,e){return Be(Pe(t.x-e.x,2)+Pe(t.y-e.y,2))}static distanceNN(t,e,i,s){return Be(Pe(t-i,2)+Pe(e-s,2))}static distancePN(t,e,i){return Be(Pe(e-t.x,2)+Pe(i-t.y,2))}static pointAtPP(t,e,i){return new Ge((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}class Xe{constructor(t=0,e=0,i,s){this.r=0,this.theta=0,this.r=t,this.theta=e,this.r1=i,this.theta1=s}clone(){return new Xe(this.r,this.theta)}copyFrom(t){return this.r=t.r,this.theta=t.theta,this.r1=t.r1,this.theta1=t.theta1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.r=t,this.theta=e,this}}function $e(t){return t*(Math.PI/180)}function Ke(t){return 180*t/Math.PI}const qe=(t=0)=>{if(t<0)for(;t<-Ae;)t+=Ae;else if(t>0)for(;t>Ae;)t-=Ae;return t},Ze=qe,Je=(t=0)=>t>360||t<-360?t%360:t,Qe=Je;function ti(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}function ei(t,e={x:0,y:0},i=0,s=2*Math.PI){const{x:n,y:r}=t,{x:a,y:o}=e;let l=n-a,h=r-o;const c=Math.sqrt(l*l+h*h);if(0===c)return{radius:0,angle:0};l/=c,h/=c;let u=Math.atan2(h,l);if(u<i)for(;u<=i;)u+=2*Math.PI;if(u>s)for(;u>=s;)u-=2*Math.PI;return{radius:c,angle:u}}function ii(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function si(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function ni(t,e){const i=Math.abs(e-t);if(i>=2*Math.PI||2*Math.PI-i<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];const s=si(Math.min(t,e)),n=s+i,r=[s,n];let a=Math.floor(s/Math.PI)*Math.PI/2;for(;a<n;)a>s&&r.push(a),a+=Math.PI/2;return r}function ri(t,e,i,s){const{x:n,y:r}=e,a=ni(i,s),{width:o,height:l}=t,h=[];return a.forEach((t=>{const e=Math.sin(t),i=Math.cos(t);1===e?h.push(l-r):-1===e?h.push(r):1===i?h.push(o-n):-1===i?h.push(n):(e>0?h.push(Math.abs((l-r)/e)):h.push(Math.abs(r/e)),i>0?h.push(Math.abs((o-n)/i)):h.push(Math.abs(n/i)))})),Math.min.apply(null,h)}function ai(t){return(t=si(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1}function oi(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function li(t,e,i,s){let n=t[0],r=e[0],a=i[0],o=s[0];return r<n&&([n,r]=[r,n]),o<a&&([o,a]=[a,o]),!(r<a||o<n||(n=t[1],r=e[1],a=i[1],o=s[1],r<n&&([n,r]=[r,n]),o<a&&([o,a]=[a,o]),r<a||o<n))}function hi(t,e,i,s){if(!li(t,e,i,s))return!1;const n=[0,0],r=[0,0],a=[0,0];if(oi(n,e,t),oi(r,s,i),He(n,r))return!0;oi(a,i,t);const o=Fe(a,r)/Fe(n,r);return o>=0&&o<=1&&[t[0]+n[0]*o,t[1]+n[1]*o]}function ci(t,e,i){if(null===t)return e;if(null===e)return t;const{x11:s,x12:n,y11:r,y12:a,x21:o,x22:l,y21:h,y22:c}=di(t,e,i);return s>=l||n<=o||r>=c||a<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(s,o),y1:Math.max(r,h),x2:Math.min(n,l),y2:Math.min(a,c)}}var ui;t.InnerBBox=void 0,(ui=t.InnerBBox||(t.InnerBBox={}))[ui.NONE=0]="NONE",ui[ui.BBOX1=1]="BBOX1",ui[ui.BBOX2=2]="BBOX2";const di=(t,e,i)=>{let s=t.x1,n=t.x2,r=t.y1,a=t.y2,o=e.x1,l=e.x2,h=e.y1,c=e.y2;return i&&(s>n&&([s,n]=[n,s]),r>a&&([r,a]=[a,r]),o>l&&([o,l]=[l,o]),h>c&&([h,c]=[c,h])),{x11:s,x12:n,y11:r,y12:a,x21:o,x22:l,y21:h,y22:c}};function pi(e,i,s){if(!e||!i)return t.InnerBBox.NONE;const{x11:n,x12:r,y11:a,y12:o,x21:l,x22:h,y21:c,y22:u}=di(e,i,s);return n>l&&r<h&&a>c&&o<u?t.InnerBBox.BBOX1:l>n&&h<r&&c>a&&u<o?t.InnerBBox.BBOX2:t.InnerBBox.NONE}function gi(t,e,i){if(t&&e){if(!i)return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1);const{x11:s,x12:n,y11:r,y12:a,x21:o,x22:l,y21:h,y22:c}=di(t,e,!0);return!(s>l||n<o||r>c||a<h)}return!0}function fi(t,e,i){if(!e)return!0;if(!i)return t.x>=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;let s=e.x1,n=e.x2,r=e.y1,a=e.y2;return s>n&&([s,n]=[n,s]),r>a&&([r,a]=[a,r]),t.x>=s&&t.x<=n&&t.y>=r&&t.y<=a}function mi(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function vi({x:t,y:e},i,s={x:0,y:0}){return{x:(t-s.x)*Math.cos(i)-(e-s.y)*Math.sin(i)+s.x,y:(t-s.x)*Math.sin(i)+(e-s.y)*Math.cos(i)+s.y}}function yi(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function _i(t,e){const i=e?$e(t.angle):t.angle,s=yi(t);return[vi({x:t.x1,y:t.y1},i,s),vi({x:t.x2,y:t.y1},i,s),vi({x:t.x2,y:t.y2},i,s),vi({x:t.x1,y:t.y2},i,s)]}function bi(t,e,i=!1){const s=_i(t,i),n=_i(e,i),r=(t,e)=>[e.x-t.x,e.y-t.y],a=r(yi(t),yi(e)),o=r(s[0],s[1]),l=r(s[1],s[2]),h=r(n[0],n[1]),c=r(n[1],n[2]),u=i?$e(t.angle):t.angle;let d=i?$e(90-t.angle):t.angle+Se;const p=i?$e(e.angle):e.angle;let g=i?$e(90-e.angle):e.angle+Se;d>ke&&(d-=ke),g>ke&&(g-=ke);const f=(t,e,i,s)=>{const n=[Math.cos(e),Math.sin(e)];return t+(mi(n,i)+mi(n,s))/2>mi(n,a)};return f((t.x2-t.x1)/2,u,h,c)&&f((t.y2-t.y1)/2,d,h,c)&&f((e.x2-e.x1)/2,p,o,l)&&f((e.y2-e.y1)/2,g,o,l)}let xi,Si,Ai,ki,Ci,Mi,Ti,wi,Di,Ei,Bi,Pi;function Ri(t,e,i=3,s=!1){let n=t.x1,r=t.x2,a=t.y1,o=t.y2,l=e.x1,h=e.x2,c=e.y1,u=e.y2;if(s){let t;n>r&&(t=n,n=r,r=t),a>o&&(t=a,a=o,o=t),l>h&&(t=l,l=h,h=t),c>u&&(t=c,c=u,u=t)}if(n>=h||r<=l||a>=u||o<=c)return[t,e];const d=(r-n+2*i)*(o-a+2*i),p=(h-l+2*i)*(u-c+2*i),g=Math.min(n,l),f=Math.min(a,c),m=Math.max(r,h),v=Math.max(o,u);return d+p>(m-g)*(v-f)?[{x1:g,x2:m,y1:f,y2:v}]:[t,e]}const Li={x:0,y:0},Ii={x:0,y:0};function Oi(t,e,i,s){return Oe(t,e,i)<=s/2&&Hi(t,e,i)}const Fi={x:0,y:0},zi={x:0,y:0},ji={x:0,y:0};function Hi(t,e,i){return Fi.x=e.x-t.x,Fi.y=e.y-t.y,zi.x=i.x-t.x,zi.y=i.y-t.y,ji.x=e.y-i.y,ji.y=i.x-e.x,ze(Fi,ji)*ze(zi,ji)<0}const Ni=1e-8;function Ui(t,e,i,s,n){for(let r=0,a=n[n.length-1];r<n.length;r++){const o=n[r];if(li([t,e],[i,s],[o.x,o.y],[a.x,a.y]))return!0;a=o}return!1}function Vi(t,e,i){let s=0,n=t[0];if(!n)return!1;for(let r=1;r<t.length;r++){const a=t[r];s+=Wi(n.x,n.y,a.x,a.y,e,i),n=a}const r=t[0];return Gi(n.x,r.x)&&Gi(n.y,r.y)||(s+=Wi(n.x,n.y,r.x,r.y,e,i)),0!==s}function Wi(t,e,i,s,n,r){if(r>e&&r>s||r<e&&r<s)return 0;if(s===e)return 0;const a=(r-e)/(s-e);let o=s<e?1:-1;1!==a&&0!==a||(o=s<e?.5:-.5);const l=a*(i-t)+t;return l===n?1/0:l>n?o:0}function Gi(t,e){return Math.abs(t-e)<Ni}function Yi(t,e){for(let i=0;i<e.length;i++){if(Vi(t,e[i].x,e[i].y))return!0;if(i>0&&Ui(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}const Xi=t=>{if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace($i(),"")},$i=({onlyFirst:t=!1}={})=>{const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")},Ki=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,s=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,s=e<<10|i,s+=65536),12288===s||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":8361===s||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||172===s||175===s||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":161===s||164===s||167<=s&&s<=168||170===s||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||198===s||208===s||215<=s&&s<=216||222<=s&&s<=225||230===s||232<=s&&s<=234||236<=s&&s<=237||240===s||242<=s&&s<=243||247<=s&&s<=250||252===s||254===s||257===s||273===s||275===s||283===s||294<=s&&s<=295||299===s||305<=s&&s<=307||312===s||319<=s&&s<=322||324===s||328<=s&&s<=331||333===s||338<=s&&s<=339||358<=s&&s<=359||363===s||462===s||464===s||466===s||468===s||470===s||472===s||474===s||476===s||593===s||609===s||708===s||711===s||713<=s&&s<=715||717===s||720===s||728<=s&&s<=731||733===s||735===s||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||1025===s||1040<=s&&s<=1103||1105===s||8208===s||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||8240===s||8242<=s&&s<=8243||8245===s||8251===s||8254===s||8308===s||8319===s||8321<=s&&s<=8324||8364===s||8451===s||8453===s||8457===s||8467===s||8470===s||8481<=s&&s<=8482||8486===s||8491===s||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||8585===s||8592<=s&&s<=8601||8632<=s&&s<=8633||8658===s||8660===s||8679===s||8704===s||8706<=s&&s<=8707||8711<=s&&s<=8712||8715===s||8719===s||8721===s||8725===s||8730===s||8733<=s&&s<=8736||8739===s||8741===s||8743<=s&&s<=8748||8750===s||8756<=s&&s<=8759||8764<=s&&s<=8765||8776===s||8780===s||8786===s||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||8853===s||8857===s||8869===s||8895===s||8978===s||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||9675===s||9678<=s&&s<=9681||9698<=s&&s<=9701||9711===s||9733<=s&&s<=9734||9737===s||9742<=s&&s<=9743||9748<=s&&s<=9749||9756===s||9758===s||9792===s||9794===s||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||9839===s||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||9955===s||9960<=s&&s<=9983||10045===s||10071===s||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||65533===s||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},qi=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Zi(t,e={},i){i||(i=1);const{fontStyle:s=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(s?s+" ":"")+(n?n+" ":"")+(r?r+" ":"")+a*i+"px "+(o||"sans-serif")}class Ji{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),g(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=g(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(d(this._canvas)&&(g(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),d(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&g(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),d(this._context)&&g(this._canvas)){const t=this._canvas.getContext("2d");g(t)&&(t.save(),t.font=Zi(this.textSpec),this._contextSaved=!0,this._context=t)}return!d(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:s={}}=this._option,{fontStyle:n=s.fontStyle,fontVariant:r=s.fontVariant,fontWeight:a=(null!==(t=s.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=s.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=s.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:c=(null!=h?h:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:p,limit:g}=this._userSpec;let{lineHeight:f=o}=this._userSpec;if(_(f)&&"%"===f[f.length-1]){const t=Number.parseFloat(f.substring(0,f.length-1))/100;f=o*t}return{fontStyle:n,fontVariant:r,fontFamily:l,fontSize:o,fontWeight:a,textAlign:c,textBaseline:d,ellipsis:p,limit:g,lineHeight:f}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(d(t))return{width:0,height:0};if(d(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:s,textAlign:n,textBaseline:r,ellipsis:a,limit:o,lineHeight:l}=this.textSpec;let h;try{const c=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:s,textAlign:n,textBaseline:r,ellipsis:!!a,maxLineWidth:o||1/0,lineHeight:l});h={width:c.width(),height:c.height()}}catch(e){this._notSupportVRender=!0,h=this.measureWithNaiveCanvas(t)}return h}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:s,lineHeight:n}=this.textSpec;return{width:i.width,height:null!==(e=n)&&void 0!==e?e:s,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const s=t[i];let n=this._measureSpecialChar(s);d(n)&&Ji.NUMBERS_CHAR_SET.includes(s)&&(n=this._measureNumberChar()),d(n)&&["F","W"].includes(Ki(s))&&(n=this._measureFullSizeChar()),d(n)&&(n=this._measureLetterChar()),e.width+=n.width,e.height=Math.max(e.height,n.height),!d(n.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=n.fontBoundingBoxAscent),!d(n.fontBoundingBoxDescent)&&(e.fontBoundingBoxDescent=n.fontBoundingBoxDescent)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:s,lineHeight:n}=this.textSpec;for(let e=0;e<t.length;e++){const n=t[e],r=["F","W"].includes(Ki(n))?1:.53;i.width+=r*s}return i.height=null!==(e=n)&&void 0!==e?e:s,i}_measureReduce(t,e){var i;const{fontSize:s,lineHeight:n}=this.textSpec,r={width:0,height:0};if(d(t))return r;if(b(t)){const a=t.filter(g).map((t=>t.toString()));return 0===a.length?r:1===a.length?e(a[0]):{width:a.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:a.length*((null!==(i=n)&&void 0!==i?i:s)+1)+1}}return e(t.toString())}_measureNumberChar(){if(d(this._numberCharSize)){const t=this._standardMethod(Ji.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/Ji.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return d(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(Ji.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(d(this._letterCharSize)){const t=this._standardMethod(Ji.ALPHABET_CHAR_SET