@visactor/vtable-gantt
Version:
canvas table width high performance
1 lines • 2.17 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).VTableGantt={})}(this,(function(t){"use strict";var e,i,o,n;!function(t){t.default="default",t.grabing="grabing",t.scrolling="scrolling"}(e||(e={})),function(t){t.FinishToStart="finish_to_start",t.StartToStart="start_to_start",t.FinishToFinish="finish_to_finish",t.StartToFinish="start_to_finish"}(i||(i={})),function(t){t.Tasks_Separate="tasks_separate",t.Sub_Tasks_Inline="sub_tasks_inline",t.Sub_Tasks_Separate="sub_tasks_separate",t.Sub_Tasks_Arrange="sub_tasks_arrange",t.Sub_Tasks_Compact="sub_tasks_compact",t.Project_Sub_Tasks_Inline="project_sub_tasks_inline"}(o||(o={})),function(t){t.TASK="task",t.PROJECT="project",t.MILESTONE="milestone"}(n||(n={}));const r={SCROLL:"scroll",CHANGE_DATE_RANGE:"change_date_range",CLICK_TASK_BAR:"click_task_bar",CONTEXTMENU_TASK_BAR:"contextmenu_task_bar",MOUSEENTER_TASK_BAR:"mouseenter_task_bar",MOUSELEAVE_TASK_BAR:"mouseleave_task_bar",CREATE_TASK_SCHEDULE:"create_task_schedule",CREATE_DEPENDENCY_LINK:"create_dependency_link",DELETE_DEPENDENCY_LINK:"delete_dependency_link",CLICK_DEPENDENCY_LINK_POINT:"click_dependency_link_point",CONTEXTMENU_DEPENDENCY_LINK:"contextmenu_dependency_link",CLICK_MARKLINE_CREATE:"click_markline_create",CLICK_MARKLINE_CONTENT:"click_markline_content",MOVE_END_TASK_BAR:"move_end_task_bar",PROGRESS_UPDATE:"progress_update",ZOOM:"zoom"};var s=Object.freeze({__proto__:null,get DependencyType(){return i},GANTT_EVENT_TYPE:r,get InteractionState(){return e},get TaskType(){return n},get TasksShowMode(){return o}});class a{static GenAutoIncrementId(){return a.auto_increment_id++}}a.auto_increment_id=0;class l{constructor(t){this.id=a.GenAutoIncrementId(),this.registry=t}}const h="named",d="inject",c="multi_inject",u="inversify:tagged",g="inversify:paramtypes";class p{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===h?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var f=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),o=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),n=new WeakMap;function r(t,e,i){let r=n.get(t);if(h(r)){if(!i)return;r=new o,n.set(t,r)}let s=r.get(e);if(h(s)){if(!i)return;s=new o,r.set(e,s)}return s}function s(t,e,i){if(a(t,e,i))return!0;const o=f(e);return!d(o)&&s(t,o,i)}function a(t,e,i){const o=r(e,i,!1);return!h(o)&&!!o.has(t)}function l(t,e,i){if(a(t,e,i))return function(t,e,i){const o=r(e,i,!1);if(!h(o))return o.get(t)}(t,e,i);const o=f(e);return d(o)?void 0:l(t,o,i)}function h(t){return void 0===t}function d(t){return null===t}function c(t){return"object"==typeof t?null!==t:"function"==typeof t}function u(t,i){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const o=3===i?"string":5===i?"number":"default",n=function(t,e){const i=t[e];if(null!=i){if(!p(i))throw new TypeError;return i}}(t,e);if(void 0!==n){const e=n.call(t,o);if(c(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(p(e)){const i=e.call(t);if(!c(i))return i}const i=t.valueOf;if(p(i)){const e=i.call(t);if(!c(e))return e}}else{const e=t.valueOf;if(p(e)){const i=e.call(t);if(!c(i))return i}const i=t.toString;if(p(i)){const e=i.call(t);if(!c(e))return e}}throw new TypeError}(t,"default"===o?"number":o)}function g(t){const e=u(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function p(t){return"function"==typeof t}function f(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const o=t.prototype,n=o&&Object.getPrototypeOf(o);if(null==n||n===Object.prototype)return e;const r=n.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,o){if(!c(i))throw new TypeError;return n=t,s=e,void r(i,o,!0).set(n,s);var n,s})),t("hasMetadata",(function(t,e,i){if(!c(e))throw new TypeError;return h(i)||(i=g(i)),s(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!c(e))throw new TypeError;return h(i)||(i=g(i)),a(t,e,i)})),t("getMetadata",(function(t,e,i){if(!c(e))throw new TypeError;return h(i)||(i=g(i)),l(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function v(t,e,i,o){!function(t,e,i,o){const n=[o];let r={};f.hasOwnMetadata(t,e)&&(r=f.getMetadata(t,e));let s=r[i];void 0===s&&(s=[]),s.push(...n),r[i]=s,f.defineMetadata(t,r,e)}(u,t,i.toString(),o)}function m(t){return(e,i,o)=>{v(e,0,o,t)}}function b(t){return e=>(i,o,n)=>m(new p(t,e))(i,o,n)}const y=b(d),C=b(c);function w(){return function(t){return f.defineMetadata(g,null,t),t}}function x(t){return m(new p(h,t))}const _="Singleton",S="Transient",A="ConstantValue",T="DynamicValue",B="Factory",R="Function",M="Instance",k="Invalid";class P{constructor(t,e){this.id=a.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=k,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new P(this.serviceIdentifier,this.scope);return t.activated=t.scope===_&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class L{getConstructorMetadata(t){return{compilerGeneratedMetadata:f.getMetadata(g,t),userGeneratedMetadata:f.getMetadata(u,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const E=(O=h,t=>{const e=e=>{if(null==e)return!1;if(e.key===O&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===O&&i[e].value===t)return!0;return!1};return e.metaData=new p(O,t),e});var O;class H{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=_,this}inTransientScope(){return this._binding.scope=S,this}whenTargetNamed(t){return this._binding.constraint=E(t),this}}class I{constructor(t){this._binding=t}to(t){return this._binding.type=M,this._binding.implementationType=t,new H(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=T,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new H(this._binding)}toConstantValue(t){return this._binding.type=A,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=_,new H(this._binding)}toFactory(t){return this._binding.type=B,this._binding.factory=t,this._binding.scope=_,new H(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const F=Symbol("ContributionProvider");class z{constructor(t,e){this.serviceIdentifier=t,this.container=e,W.setStore(this.serviceIdentifier,this)}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}refresh(){this.caches&&(this.caches.length=0,this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier)))}}function D(t,e){t(F).toDynamicValue((({container:t})=>new z(e,t))).inSingletonScope().whenTargetNamed(e)}class W{static getStore(t){return this.store.get(t)}static setStore(t,e){this.store.set(t,e)}static refreshAllContributions(){this.store.forEach((t=>{t.refresh()}))}}W.store=new Map;class N{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let o;if("string"==typeof e)o={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof o.name||""===o.name)throw new Error("Missing name for tap");return o=Object.assign({type:t,fn:i},o),o}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let o=this.taps.length;for(;o>0;){o--;const t=this.taps[o];this.taps[o+1]=t;const n=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(n>i)){o++;break}}this.taps[o]=t}}class G extends N{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const j=Symbol.for("EnvContribution"),U=Symbol.for("VGlobal"),V=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||S,this.options=e,this.id=a.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new L}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const o=this._getNotAllArgs(t,!1,e,i);return this._get(o)}getNamed(t,e){return this.getTagged(t,h,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new P(t,e),o=this._bindingDictionary.get(t)||[];return o.push(i),this._bindingDictionary.set(t,o),new I(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const o=this.bind(i);return t(o,e),o},i=()=>t=>this.unbind(t),o=()=>t=>this.isBound(t),n=e=>i=>{const o=this.rebind(i);return t(o,e),o};return t=>({bindFunction:e(t),isboundFunction:o(),rebindFunction:n(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,o){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:o}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),o=Object.keys(i),n=[];for(let t=0;t<o.length;t++){const e=i[t],o={};e.forEach((t=>{o[t.key]=t.value}));const r={inject:o[d],multiInject:o[c]},s=r.inject||r.multiInject,a={serviceIdentifier:s,constructorArgsMetadata:e},l=(this._bindingDictionary.get(s)||[]).filter((t=>t.constraint(a)));if(l.length){const t={injectIdentifier:s,metadata:e,bindings:l};n.push(t)}}return n}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case A:case R:e=t.cache;break;case M:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===_&&(t.cache=e,t.activated=!0)}},X=Symbol.for("RenderService");const Y=new class{get renderService(){return this._renderService||(this._renderService=V.get(X)),this._renderService}};let $=0;class K{constructor(){this.nextAnimationFrameCbs=new Map,this._rafHandle=null,this.runAnimationFrame=t=>{this._rafHandle=null;const e=this.nextAnimationFrameCbs;this.nextAnimationFrameCbs=new Map,e.forEach((e=>e(t)))},this.tryRunAnimationFrameNextFrame=()=>{null===this._rafHandle&&0!==this.nextAnimationFrameCbs.size&&(this._rafHandle=Y.global.getRequestAnimationFrame()(this.runAnimationFrame))}}addAnimationFrameCb(t){return this.nextAnimationFrameCbs.set(++$,t),this.tryRunAnimationFrameNextFrame(),$}removeAnimationFrameCb(t){return!!this.nextAnimationFrameCbs.has(t)&&(this.nextAnimationFrameCbs.delete(t),!0)}}class Z{constructor(){this._listenerMap=new Map,this._eventListenerTransformer=t=>t}setEventListenerTransformer(t){this._eventListenerTransformer=t||(t=>t)}addEventListener(t,e,i){if(!e)return;const o=this._resolveCapture(i),n=this._resolveOnce(i),r=this._getOrCreateListenerTypeMap(t),s=this._getOrCreateWrappedMap(r,e);if(s.has(o))return;const a=i=>{const r=this._eventListenerTransformer(i);"function"==typeof e?e(r):e.handleEvent&&e.handleEvent(r),n&&this._deleteListenerRecord(t,e,o)};s.set(o,{wrappedListener:a,options:i}),this._nativeAddEventListener(t,a,i)}removeEventListener(t,e,i){var o,n;if(!e)return;const r=this._resolveCapture(i),s=null===(n=null===(o=this._listenerMap.get(t))||void 0===o?void 0:o.get(e))||void 0===n?void 0:n.get(r);s&&(this._nativeRemoveEventListener(t,s.wrappedListener,r),this._deleteListenerRecord(t,e,r))}dispatchEvent(t){return this._nativeDispatchEvent(t)}clearAllEventListeners(){this._listenerMap.forEach(((t,e)=>{t.forEach((t=>{t.forEach(((t,i)=>{this._nativeRemoveEventListener(e,t.wrappedListener,i)}))}))})),this._listenerMap.clear()}_resolveCapture(t){return"boolean"==typeof t?t:!!(null==t?void 0:t.capture)}_resolveOnce(t){return"object"==typeof t&&!!(null==t?void 0:t.once)}_getOrCreateListenerTypeMap(t){let e=this._listenerMap.get(t);return e||(e=new Map,this._listenerMap.set(t,e)),e}_getOrCreateWrappedMap(t,e){let i=t.get(e);return i||(i=new Map,t.set(e,i)),i}_deleteListenerRecord(t,e,i){const o=this._listenerMap.get(t);if(!o)return;const n=o.get(e);n&&(n.delete(i),0===n.size&&o.delete(e),0===o.size&&this._listenerMap.delete(t))}_nativeAddEventListener(t,e,i){throw new Error("_nativeAddEventListener must be implemented by derived classes")}_nativeRemoveEventListener(t,e,i){throw new Error("_nativeRemoveEventListener must be implemented by derived classes")}_nativeDispatchEvent(t){throw new Error("_nativeDispatchEvent must be implemented by derived classes")}}var q=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},J=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Q=function(t,e){return function(i,o){e(i,o,t)}},tt=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{l(o.next(t))}catch(t){r(t)}}function a(t){try{l(o.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(s,a)}l((o=o.apply(t,e||[])).next())}))};let et=class extends Z{get env(){return this._env}get isImageAnonymous(){return this._isImageAnonymous}set isImageAnonymous(t){this._isImageAnonymous=t}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){super(),this.contributions=t,this._isImageAnonymous=!0,this._performanceRAFList=[],this.eventListenerTransformer=t=>t,this.id=a.GenAutoIncrementId(),this.hooks={onSetEnv:new G(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}_nativeAddEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}_nativeRemoveEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}_nativeDispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const o=i.configure(this,t);o&&o.then&&e.push(o)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const o=this.bindContribution(e);if(o&&o.then)return o.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getSpecifiedRequestAnimationFrame(t){this._env||this.setEnv("browser"),this._performanceRAFList[t]||(this._performanceRAFList[t]=new K);const e=this._performanceRAFList[t];return t=>e.addAnimationFrameCb(t)}getSpecifiedCancelAnimationFrame(t){if(this._env||this.setEnv("browser"),!this._performanceRAFList[t])return()=>!1;const e=this._performanceRAFList[t];return t=>e.removeAnimationFrameCb(t)}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}loadFont(t,e,i){return tt(this,void 0,void 0,(function*(){return this._env||this.setEnv("browser"),this.envContribution.loadFont(t,e,i)}))}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}updateDom(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}getElementTop(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}isMacOS(){return this._env||this.setEnv("browser"),this.envContribution.isMacOS()}copyToClipBoard(t){return this._env||this.setEnv("browser"),this.envContribution.copyToClipBoard(t)}};var it,ot,nt,rt;et=q([w(),Q(0,y(F)),Q(0,x(j)),J("design:paramtypes",[Object])],et),function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(it||(it={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(ot||(ot={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(nt||(nt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(rt||(rt={}));var st="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function at(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var lt={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function o(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,o,r,s){if("function"!=typeof o)throw new TypeError("The listener must be a function");var a=new n(o,r||t,s),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function a(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,o,n=[];if(0===this._eventsCount)return n;for(o in t=this._events)e.call(t,o)&&n.push(i?o.slice(1):o);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,o=this._events[e];if(!o)return[];if(o.fn)return[o.fn];for(var n=0,r=o.length,s=new Array(r);n<r;n++)s[n]=o[n].fn;return s},a.prototype.listenerCount=function(t){var e=i?i+t:t,o=this._events[e];return o?o.fn?1:o.length:0},a.prototype.emit=function(t,e,o,n,r,s){var a=i?i+t:t;if(!this._events[a])return!1;var l,h,d=this._events[a],c=arguments.length;if(d.fn){switch(d.once&&this.removeListener(t,d.fn,void 0,!0),c){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,e),!0;case 3:return d.fn.call(d.context,e,o),!0;case 4:return d.fn.call(d.context,e,o,n),!0;case 5:return d.fn.call(d.context,e,o,n,r),!0;case 6:return d.fn.call(d.context,e,o,n,r,s),!0}for(h=1,l=new Array(c-1);h<c;h++)l[h-1]=arguments[h];d.fn.apply(d.context,l)}else{var u,g=d.length;for(h=0;h<g;h++)switch(d[h].once&&this.removeListener(t,d[h].fn,void 0,!0),c){case 1:d[h].fn.call(d[h].context);break;case 2:d[h].fn.call(d[h].context,e);break;case 3:d[h].fn.call(d[h].context,e,o);break;case 4:d[h].fn.call(d[h].context,e,o,n);break;default:if(!l)for(u=1,l=new Array(c-1);u<c;u++)l[u-1]=arguments[u];d[h].fn.apply(d[h].context,l)}}return!0},a.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,o,n){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return s(this,r),this;var a=this._events[r];if(a.fn)a.fn!==e||n&&!a.once||o&&a.context!==o||s(this,r);else{for(var l=0,h=[],d=a.length;l<d;l++)(a[l].fn!==e||n&&!a[l].once||o&&a[l].context!==o)&&h.push(a[l]);h.length?this._events[r]=1===h.length?h[0]:h:s(this,r)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&s(this,e)):(this._events=new o,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(lt);var ht=at(lt.exports);var dt=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var ct=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||dt(t,"Boolean");var ut=t=>"function"==typeof t;var gt=t=>null==t;var pt=t=>null!=t;var ft=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var vt=t=>"object"==typeof t&&null!==t;var mt=function(t){if(!vt(t)||!dt(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 bt=t=>void 0===t;var yt=(t,e=!1)=>{const i=typeof t;return e?"string"===i:"string"===i||dt(t,"String")};var Ct=t=>Array.isArray?Array.isArray(t):dt(t,"Array");var wt=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var xt=t=>dt(t,"Date");var _t=(t,e=!1)=>{const i=typeof t;return e?"number"===i:"number"===i||dt(t,"Number")};var St=t=>_t(t)&&Number.isFinite(t);var At=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var Tt=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 Bt=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const Rt=Object.prototype;var Mt=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Rt)};const kt=Object.prototype.hasOwnProperty;function Pt(t){if(gt(t))return!0;if(wt(t))return!t.length;const e=Bt(t);if("Map"===e||"Set"===e)return!t.size;if(Mt(t))return!Object.keys(t).length;for(const e in t)if(kt.call(t,e))return!1;return!0}var Lt=(t,e,i)=>{const o=yt(e)?e.split("."):e;for(let e=0;e<o.length;e++)t=t?t[o[e]]:void 0;return void 0===t?i:t};const Et=Object.prototype.hasOwnProperty;var Ot=(t,e)=>null!=t&&Et.call(t,e);function Ht(t,e,i){let o;if(!pt(t)||"object"!=typeof t||e&&e(t))return t;const n=Ct(t),r=t.length;o=n?new Array(r):"object"==typeof t?{}:ct(t)||_t(t)||yt(t)?t:xt(t)?new Date(+t):void 0;const s=n?void 0:Object.keys(Object(t));let a=-1;if(o)for(;++a<(s||t).length;){const n=s?s[a]:a,r=t[n];i&&i.includes(n.toString())?o[n]=r:o[n]=Ht(r,e,i)}return o}function It(t,e,i=!1,o=!1){if(e){if(t===e)return;if(pt(e)&&"object"==typeof e){const n=Object(e),r=[];for(const t in n)r.push(t);let{length:s}=r,a=-1;for(;s--;){const s=r[++a];!pt(n[s])||"object"!=typeof n[s]||o&&Ct(t[s])?zt(t,s,n[s]):Ft(t,e,s,i,o)}}}}function Ft(t,e,i,o=!1,n=!1){const r=t[i],s=e[i];let a=e[i],l=!0;if(Ct(s)){if(o)a=[];else if(Ct(r))a=r;else if(wt(r)){a=new Array(r.length);let t=-1;const e=r.length;for(;++t<e;)a[t]=r[t]}}else mt(s)?(a=null!=r?r:{},"function"!=typeof r&&"object"==typeof r||(a={})):l=!1;l&&It(a,s,o,n),zt(t,i,a)}function zt(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 Dt(t,...e){let i=-1;const o=e.length;for(;++i<o;)It(t,e[i],!0);return t}function Wt(t){return Object.prototype.toString.call(t)}function Nt(t){return Object.keys(t)}function Gt(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(Wt(t)!==Wt(e))return!1;if(ut(t))return!!(null==i?void 0:i.skipFunction);if("object"!=typeof t)return!1;if(Ct(t)){if(t.length!==e.length)return!1;for(let o=t.length-1;o>=0;o--)if(!Gt(t[o],e[o],i))return!1;return!0}if(!mt(t))return!1;const o=Nt(t),n=Nt(e);if(o.length!==n.length)return!1;o.sort(),n.sort();for(let t=o.length-1;t>=0;t--)if(o[t]!=n[t])return!1;for(let n=o.length-1;n>=0;n--){const r=o[n];if(!Gt(t[r],e[r],i))return!1}return!0}function jt(t,e,i){const o=function(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}(e);for(let n=0;n<o.length;n++){const r=o[n];(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}return t}function Ut(t,e,i=!0){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){const o=Object.getOwnPropertyNames(e);for(let n=0;n<o.length;n++){const r=o[n];"constructor"!==r&&(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}}else jt(t,e,i)}function Vt(t){return pt(t)?Ct(t)?t:[t]:[]}function Xt(t){if(wt(t))return t[t.length-1]}const Yt=(t,e)=>{var i;if(0===t.length)return;let o=t[0];for(let n=1;n<t.length;n++){const r=t[n];(null!==(i=null==e?void 0:e(r,o))&&void 0!==i?i:r-o)>0&&(o=r)}return o},$t=(t,e)=>{var i;if(0===t.length)return;let o=t[0];for(let n=1;n<t.length;n++){const r=t[n];(null!==(i=null==e?void 0:e(r,o))&&void 0!==i?i:r-o)<0&&(o=r)}return o};function Kt(t,e){if(!Ct(t)||!Ct(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 Zt(t){if(!Ct(t))return[t];const e=[];for(const i of t)e.push(...Zt(i));return e}function qt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Jt(t){return Number(t)}const Qt="undefined"!=typeof console;function te(t,e,i){const o=[e].concat([].slice.call(i));Qt&&console[t].apply(console,o)}var ee;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(ee||(ee={}));class ie{static getInstance(t,e){return ie._instance&&_t(t)?ie._instance.level(t):ie._instance||(ie._instance=new ie(t,e)),ie._instance}static setInstance(t){return ie._instance=t}static setInstanceLevel(t){ie._instance?ie._instance.level(t):ie._instance=new ie(t)}static clearInstance(){ie._instance=null}constructor(t=ee.None,e){this._onErrorHandler=[],this._level=t,this._method=e}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>=ee.Info}canLogDebug(){return this._level>=ee.Debug}canLogError(){return this._level>=ee.Error}canLogWarn(){return this._level>=ee.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=ee.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):te(null!==(e=this._method)&&void 0!==e?e:"error","ERROR",t)),this}warn(...t){return this._level>=ee.Warn&&te(this._method||"warn","WARN",t),this}info(...t){return this._level>=ee.Info&&te(this._method||"log","INFO",t),this}debug(...t){return this._level>=ee.Debug&&te(this._method||"log","DEBUG",t),this}}ie._instance=null;const oe=1e-10,ne=1e-10;function re(t,e,i=ne,o=oe){const n=o,r=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,r)}function se(t,e,i,o){return t>e&&!re(t,e,i,o)}function ae(t,e,i,o){return t<e&&!re(t,e,i,o)}const le=t=>{let e=null,i=null;return(...o)=>(e&&o.every(((t,i)=>t===e[i]))||(e=o,i=t(...o)),i)};var he=function(t,e,i){return t<e?e:t>i?i:t};var de=(t,e,i)=>{let[o,n]=t;n<o&&(o=t[1],n=t[0]);const r=n-o;return r>=i-e?[e,i]:(o=Math.min(Math.max(o,e),i-r),[o,o+r])};function ce(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}let ue=!1;try{ue="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){ue=!1}function ge(t,e,i){let o,n,r,s,a,l,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&ue;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,r=n;return o=n=void 0,h=e,s=t.apply(r,i),s}function f(t,e){return g?(cancelAnimationFrame(a),requestAnimationFrame(t)):setTimeout(t,e)}function v(t){const i=t-l;return void 0===l||i>=e||i<0||c&&t-h>=r}function m(){const t=Date.now();if(v(t))return b(t);a=f(m,function(t){const i=t-h,o=e-(t-l);return c?Math.min(o,r-i):o}(t))}function b(t){return a=void 0,u&&o?p(t):(o=n=void 0,s)}function y(...t){const i=Date.now(),r=v(i);if(o=t,n=this,l=i,r){if(void 0===a)return function(t){return h=t,a=f(m,e),d?p(t):s}(l);if(c)return a=f(m,e),p(l)}return void 0===a&&(a=f(m,e)),s}return e=+e||0,ft(i)&&(d=!!i.leading,c="maxWait"in i,c&&(r=Math.max(St(i.maxWait)?i.maxWait:0,e)),u="trailing"in i?!!i.trailing:u),y.cancel=function(){void 0!==a&&function(t){if(g)return cancelAnimationFrame(t);clearTimeout(t)}(a),h=0,o=l=n=a=void 0},y.flush=function(){return void 0===a?s:b(Date.now())},y.pending=function(){return void 0!==a},y}function pe(t,e,i){let o=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return ft(i)&&(o="leading"in i?!!i.leading:o,n="trailing"in i?!!i.trailing:n),ge(t,e,{leading:o,trailing:n,maxWait:e})}function fe(t,e){return i=>t*(1-i)+e*i}function ve(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}ue=!1;const me=1e-12,be=Math.PI,ye=be/2,Ce=2*be,we=2*Math.PI,xe=Math.abs,_e=Math.atan2,Se=Math.cos,Ae=Math.max,Te=Math.min,Be=Math.sin,Re=Math.sqrt,Me=Math.pow;function ke(t){return t>=1?ye:t<=-1?-ye:Math.asin(t)}function Pe(t,e,i,o,n){let r=i,s=o;return"number"==typeof t&&"number"==typeof i&&(r=(1-n)*t+n*i),"number"==typeof e&&"number"==typeof o&&(s=(1-n)*e+n*o),{x:r,y:s}}function Le(t,e=10){return Math.round(t*e)/e}function Ee(t){const e=t.toString().split(/[eE]/),i=(e[0].split(".")[1]||"").length-(+e[1]||0);return i>0?i:0}function Oe(t,e){return Le(t+e,10**Math.max(Ee(t),Ee(e)))}function He(t,e){return Le(t-e,10**Math.max(Ee(t),Ee(e)))}class Ie{constructor(t=0,e=0,i,o){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=o}clone(){return new Ie(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 _t(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return _t(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 Fe{static distancePP(t,e){return Re(Me(t.x-e.x,2)+Me(t.y-e.y,2))}static distanceNN(t,e,i,o){return Re(Me(t-i,2)+Me(e-o,2))}static distancePN(t,e,i){return Re(Me(e-t.x,2)+Me(i-t.y,2))}static pointAtPP(t,e,i){return new Ie((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function ze(t){return t*(Math.PI/180)}const De=(t=0)=>{if(t<0)for(;t<-Ce;)t+=Ce;else if(t>0)for(;t>Ce;)t-=Ce;return t};function We(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function Ne(t,e,i){if(null===t)return e;if(null===e)return t;const{x11:o,x12:n,y11:r,y12:s,x21:a,x22:l,y21:h,y22:d}=je(t,e,i);return o>=l||n<=a||r>=d||s<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(o,a),y1:Math.max(r,h),x2:Math.min(n,l),y2:Math.min(s,d)}}var Ge;!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Ge||(Ge={}));const je=(t,e,i)=>{let o=t.x1,n=t.x2,r=t.y1,s=t.y2,a=e.x1,l=e.x2,h=e.y1,d=e.y2;return i&&(o>n&&([o,n]=[n,o]),r>s&&([r,s]=[s,r]),a>l&&([a,l]=[l,a]),h>d&&([h,d]=[d,h])),{x11:o,x12:n,y11:r,y12:s,x21:a,x22:l,y21:h,y22:d}};function Ue(t,e,i){if(!t||!e)return Ge.NONE;const{x11:o,x12:n,y11:r,y12:s,x21:a,x22:l,y21:h,y22:d}=je(t,e,i);return o>a&&n<l&&r>h&&s<d?Ge.BBOX1:a>o&&l<n&&h>r&&d<s?Ge.BBOX2:Ge.NONE}function Ve(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:o,x12:n,y11:r,y12:s,x21:a,x22:l,y21:h,y22:d}=je(t,e,!0);return!(o>l||n<a||r>d||s<h)}return!0}function Xe(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function Ye({x:t,y:e},i,o={x:0,y:0}){return{x:(t-o.x)*Math.cos(i)-(e-o.y)*Math.sin(i)+o.x,y:(t-o.x)*Math.sin(i)+(e-o.y)*Math.cos(i)+o.y}}function $e(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function Ke(t,e){const i=e?ze(t.angle):t.angle,o=$e(t);return[Ye({x:t.x1,y:t.y1},i,o),Ye({x:t.x2,y:t.y1},i,o),Ye({x:t.x2,y:t.y2},i,o),Ye({x:t.x1,y:t.y2},i,o)]}function Ze(t,e,i=!1){const o=Ke(t,i),n=Ke(e,i),r=(t,e)=>[e.x-t.x,e.y-t.y],s=r($e(t),$e(e)),a=r(o[0],o[1]),l=r(o[1],o[2]),h=r(n[0],n[1]),d=r(n[1],n[2]),c=i?ze(t.angle):t.angle;let u=i?ze(90-t.angle):t.angle+ye;const g=i?ze(e.angle):e.angle;let p=i?ze(90-e.angle):e.angle+ye;u>we&&(u-=we),p>we&&(p-=we);const f=(t,e,i,o)=>{const n=[Math.cos(e),Math.sin(e)];return t+(Xe(n,i)+Xe(n,o))/2>Xe(n,s)};return f((t.x2-t.x1)/2,c,h,d)&&f((t.y2-t.y1)/2,u,h,d)&&f((e.x2-e.x1)/2,g,a,l)&&f((e.y2-e.y1)/2,p,a,l)}function qe(t,e,i,o,n,r){if(r>e&&r>o||r<e&&r<o)return 0;if(o===e)return 0;const s=(r-e)/(o-e);let a=o<e?1:-1;1!==s&&0!==s||(a=o<e?.5:-.5);const l=s*(i-t)+t;return l===n?1/0:l>n?a:0}const Je=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,o=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,o=e<<10|i,o+=65536),12288===o||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":8361===o||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||172===o||175===o||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":161===o||164===o||167<=o&&o<=168||170===o||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||198===o||208===o||215<=o&&o<=216||222<=o&&o<=225||230===o||232<=o&&o<=234||236<=o&&o<=237||240===o||242<=o&&o<=243||247<=o&&o<=250||252===o||254===o||257===o||273===o||275===o||283===o||294<=o&&o<=295||299===o||305<=o&&o<=307||312===o||319<=o&&o<=322||324===o||328<=o&&o<=331||333===o||338<=o&&o<=339||358<=o&&o<=359||363===o||462===o||464===o||466===o||468===o||470===o||472===o||474===o||476===o||593===o||609===o||708===o||711===o||713<=o&&o<=715||717===o||720===o||728<=o&&o<=731||733===o||735===o||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||1025===o||1040<=o&&o<=1103||1105===o||8208===o||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||8240===o||8242<=o&&o<=8243||8245===o||8251===o||8254===o||8308===o||8319===o||8321<=o&&o<=8324||8364===o||8451===o||8453===o||8457===o||8467===o||8470===o||8481<=o&&o<=8482||8486===o||8491===o||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||8585===o||8592<=o&&o<=8601||8632<=o&&o<=8633||8658===o||8660===o||8679===o||8704===o||8706<=o&&o<=8707||8711<=o&&o<=8712||8715===o||8719===o||8721===o||8725===o||8730===o||8733<=o&&o<=8736||8739===o||8741===o||8743<=o&&o<=8748||8750===o||8756<=o&&o<=8759||8764<=o&&o<=8765||8776===o||8780===o||8786===o||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||8853===o||8857===o||8869===o||8895===o||8978===o||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||9675===o||9678<=o&&o<=9681||9698<=o&&o<=9701||9711===o||9733<=o&&o<=9734||9737===o||9742<=o&&o<=9743||9748<=o&&o<=9749||9756===o||9758===o||9792===o||9794===o||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||9839===o||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||9955===o||9960<=o&&o<=9983||10045===o||10071===o||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||65533===o||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"};function Qe(t,e={},i){i||(i=1);const{fontStyle:o=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:s=e.fontSize,fontFamily:a=e.fontFamily}=t;return(o?o+" ":"")+(n?n+" ":"")+(r?r+" ":"")+s*i+"px "+(a||"sans-serif")}class ti{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(),pt(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=pt(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(gt(this._canvas)&&(pt(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),gt(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&pt(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),gt(this._context)&&pt(this._canvas)){const t=this._canvas.getContext("2d");pt(t)&&(t.save(),t.font=Qe(this.textSpec),this._contextSaved=!0,this._context=t)}return!gt(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:o={}}=this._option,{fontStyle:n=o.fontStyle,fontVariant:r=o.fontVariant,fontWeight:s=(null!==(t=o.fontWeight)&&void 0!==t?t:"normal"),fontSize:a=(null!==(e=o.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=o.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:d=(null!=h?h:"center"),baseline:c,textBaseline:u=(null!=c?c:"middle"),ellipsis:g,limit:p}=this._userSpec;let{lineHeight:f=a}=this._userSpec;if(yt(f)&&"%"===f[f.length-1]){const t=Number.parseFloat(f.substring(0,f.length-1))/100;f=a*t}return{fontStyle:n,fontVariant:r,fontFamily:l,fontSize:a,fontWeight:s,textAlign:d,textBaseline:u,ellipsis:g,limit:p,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(gt(t))return{width:0,height:0};if(gt(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:o,textAlign:n,textBaseline:r,ellipsis:s,limit:a,lineHeight:l}=this.textSpec;let h;try{const d=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:o,textAlign:n,textBaseline:r,ellipsis:!!s,maxLineWidth:a||1/0,lineHeight:l});h={width:d.width(),height:d.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:o,lineHeight:n}=this.textSpec;return{width:i.width,height:null!==(e=n)&&void 0!==e?e:o,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 o=t[i];let n=this._measureSpecialChar(o);gt(n)&&ti.NUMBERS_CHAR_SET.includes(o)&&(n=this._measureNumberChar()),gt(n)&&["F","W"].includes(Je(o))&&(n=this._measureFullSizeChar()),gt(n)&&(n=this._measureLetterChar()),e.width+=n.width,e.height=Math.max(e.height,n.height),!gt(n.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=n.fontBoundingBoxAscent),!gt(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:o,lineHeight:n}=this.textSpec;for(let e=0;e<t.length;e++){const n=t[e],r=["F","W"].includes(Je(n))?1:.53;i.width+=r*o}return i.height=null!==(e=n)&&void 0!==e?e:o,i}_measureReduce(t,e){var i;const{fontSize:o,lineHeight:n}=this.textSpec,r={width:0,height:0};if(gt(t))return r;if(Ct(t)){const s=t.filter(pt).map((t=>t.toString()));return 0===s.length?r:1===s.length?e(s[0]):{width:s.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:s.length*((null!==(i=n)&&void 0!==i?i:o)+1)+1}}return e(t.toString())}_measureNumberChar(){if(gt(this._numberCharSize)){const t=this._standardMethod(ti.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/ti.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return gt(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(ti.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(gt(this._letterCharSize)){const t=this._standardMethod(ti.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/ti.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(t){return pt(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){pt(this._canvas)&&(this._canvas=null),pt(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}ti.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",ti.NUMBERS_CHAR_SET="0123456789",ti.FULL_SIZE_CHAR="字";const ei=(t,e)=>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),ii=(t,e)=>{const i=[{x:Math.cos(t.angle),y:Math.sin(t.angle)},{x:-Math.sin(t.angle),y:Math.cos(t.angle)},{x:Math.cos(e.angle),y:Math.sin(t.angle)},{x:-Math.sin(e.angle),y:Math.cos(t.angle)}];function o(t,e,i){const o=t.getRotatedCorners().map((t=>t.x*e+t.y*i));return{min:Math.min(...o),max:Math.max(...o)}}let n=0;for(const r of i){const i=o(t,r.x,r.y),s=o(e,r.x,r.y);let a;a=i.max<s.min?s.min-i.max:s.max<i.min?i.min-s.max:0,n=Math.max(n,a)}return n};function oi(t,e,i){const{x1:o,y1:n,x2:r,y2:s}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*o+i.c*n+i.e,i.b*o+i.d*n+i.f),t.add(i.a*r+i.c*n+i.e,i.b*r+i.d*n+i.f),t.add(i.a*r+i.c*s+i.e,i.b*r+i.d*s+i.f),t.add(i.a*o+i.c*s+i.e,i.b*o+i.d*s+i.f),e)}class ni{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new ni(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(t=0,e=0,i=0,o=0){return this.x1=t,this.y1=e,this.x2=i,this.y2=o,this}set(t=0,e=0,i=0,o=0){return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),o<e?(this.y2=e,this.y1=o):(this.y1=e,this.y2=o),this}add(t=0,e=0){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(t=0){return Ct(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,i=0){const o=this.rotatedPoints(t,e,i);return this.clear().add(o[0],o[1]).add(o[2],o[3]).add(o[4],o[5]).add(o[6],o[7])}scale(t=0,e=0,i=0,o=0){const n=this.scalePoints(t,e,i,o);return this.clear().add(n[0],n[1]).add(n[2],n[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(t=0,e=0){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return oi(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:o,y1:n,x2:r,y2:s}=this,a=Math.cos(t),l=Math.sin(t),h=e-e*a+i*l,d=i-e*l-i*a;return[a*o-l*n+h,l*o+a*n+d,a*o-l*s+h,l*o+a*s+d,a*r-l*n+h,l*r+a*n+d,a*r-l*s+h,l*r+a*s+d]}scalePoints(t,e,i,o){const{x1:n,y1:r,x2:s,y2:a}=this;return[t*n+(1-t)*i,e*r+(1-e)*o,t*s+(1-t)*i,e*a+(1-e)*o]}}class ri extends ni{}class si extends ni{constructor(t,e=0){var i;super(t),t&&(this.angle=null!==(i=t.angle)&&void 0!==i?i:e)}intersects(t){return Ze(this,t)}setValue(t=0,e=0,i=0,o=0,n=0){return super.setValue(t,e,i,o),this.angle=n,this}clone(){return new si(this)}getRotatedCorners(){const t={x:(this.x1+this.