@visactor/react-vtable 1.22.3-alpha.0 → 1.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vtable"),require("react")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ReactVTable={},t.VTable,t.React)}(this,(function(t,e,n){"use strict";const i=n.createContext(null);function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}i.displayName="TableContext";var s={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,i,s,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,s||t,a),l=n?n+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 i:delete t._events[e]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,a=new Array(s);r<s;r++)a[r]=i[r].fn;return a},o.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},o.prototype.emit=function(t,e,i,r,s,a){var o=n?n+t:t;if(!this._events[o])return!1;var l,c,u=this._events[o],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,r),!0;case 5:return u.fn.call(u.context,e,i,r,s),!0;case 6:return u.fn.call(u.context,e,i,r,s,a),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(t,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,e);break;case 3:u[c].fn.call(u[c].context,e,i);break;case 4:u[c].fn.call(u[c].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},o.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},o.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},o.prototype.removeListener=function(t,e,i,r){var s=n?n+t:t;if(!this._events[s])return this;if(!e)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||i&&o.context!==i||a(this,s);else{for(var l=0,c=[],u=o.length;l<u;l++)(o[l].fn!==e||r&&!o[l].once||i&&o[l].context!==i)&&c.push(o[l]);c.length?this._events[s]=1===c.length?c[0]:c:a(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o}(s);var a=r(s.exports);var o=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var l=t=>"function"==typeof t;var c=t=>null==t;var u=t=>null!=t;var h=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var d=t=>"object"==typeof t&&null!==t;var f=function(t){if(!d(t)||!o(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 p=(t,e=!1)=>{const n=typeof t;return e?"string"===n:"string"===n||o(t,"String")};var g=t=>Array.isArray?Array.isArray(t):o(t,"Array");var m=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var b=(t,e=!1)=>{const n=typeof t;return e?"number"===n:"number"===n||o(t,"Number")};function y(t,e,n=!1,i=!1){if(e){if(t===e)return;if(u(e)&&"object"==typeof e){const r=Object(e),s=[];for(const t in r)s.push(t);let{length:a}=s,o=-1;for(;a--;){const a=s[++o];!u(r[a])||"object"!=typeof r[a]||i&&g(t[a])?x(t,a,r[a]):v(t,e,a,n,i)}}}}function v(t,e,n,i=!1,r=!1){const s=t[n],a=e[n];let o=e[n],l=!0;if(g(a)){if(i)o=[];else if(g(s))o=s;else if(m(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else f(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):l=!1;l&&y(o,a,i,r),x(t,n,o)}function x(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function _(t,...e){let n=-1;const i=e.length;for(;++n<i;)y(t,e[n],!0);return t}function S(t,e){if(!t||!f(t))return t;const n={};return Object.keys(t).forEach((i=>{const r=t[i];let s=!1;e.forEach((t=>{(p(t)&&t===i||t instanceof RegExp&&i.match(t))&&(s=!0)})),s||(n[i]=r)})),n}function A(t){return Object.prototype.toString.call(t)}function w(t){return Object.keys(t)}function T(t,e,n){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(A(t)!==A(e))return!1;if(l(t))return!!(null==n?void 0:n.skipFunction);if("object"!=typeof t)return!1;if(g(t)){if(t.length!==e.length)return!1;for(let i=t.length-1;i>=0;i--)if(!T(t[i],e[i],n))return!1;return!0}if(!f(t))return!1;const i=w(t),r=w(e);if(i.length!==r.length)return!1;i.sort(),r.sort();for(let t=i.length-1;t>=0;t--)if(i[t]!=r[t])return!1;for(let r=i.length-1;r>=0;r--){const s=i[r];if(!T(t[s],e[s],n))return!1}return!0}const C=(t="")=>{const e={};return t.split(";").forEach((t=>{if(t){const n=t.split(":");if(2===n.length){const t=n[0].trim(),i=n[1].trim();t&&i&&(e[t]=i)}}})),e};var B,k={exports:{}},M={};k.exports=function(){if(B)return M;B=1;var t,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen");function g(t){if("object"==typeof t&&null!==t){var p=t.$$typeof;switch(p){case e:switch(t=t.type){case i:case s:case r:case u:case h:return t;default:switch(t=t&&t.$$typeof){case l:case o:case c:case f:case d:case a:return t;default:return p}}case n:return p}}}return t=Symbol.for("react.module.reference"),M.ContextConsumer=o,M.ContextProvider=a,M.Element=e,M.ForwardRef=c,M.Fragment=i,M.Lazy=f,M.Memo=d,M.Portal=n,M.Profiler=s,M.StrictMode=r,M.Suspense=u,M.SuspenseList=h,M.isAsyncMode=function(){return!1},M.isConcurrentMode=function(){return!1},M.isContextConsumer=function(t){return g(t)===o},M.isContextProvider=function(t){return g(t)===a},M.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},M.isForwardRef=function(t){return g(t)===c},M.isFragment=function(t){return g(t)===i},M.isLazy=function(t){return g(t)===f},M.isMemo=function(t){return g(t)===d},M.isPortal=function(t){return g(t)===n},M.isProfiler=function(t){return g(t)===s},M.isStrictMode=function(t){return g(t)===r},M.isSuspense=function(t){return g(t)===u},M.isSuspenseList=function(t){return g(t)===h},M.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===r||e===u||e===h||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===a||e.$$typeof===o||e.$$typeof===c||e.$$typeof===t||void 0!==e.getModuleId)},M.typeOf=g,M}();var P=k.exports;const E=t=>{let e=[];return n.Children.forEach(t,(t=>{c(t)||(P.isFragment(t)?e=e.concat(E(t.props.children)):e.push(t))})),e},O={...e.TABLE_EVENT_TYPE,...e.PIVOT_TABLE_EVENT_TYPE,...e.PIVOT_CHART_EVENT_TYPE},L={onClickCell:O.CLICK_CELL,onDblClickCell:O.DBLCLICK_CELL,onMouseDownCell:O.MOUSEDOWN_CELL,onMouseUpCell:O.MOUSEUP_CELL,onSelectedCell:O.SELECTED_CELL,onSelectedClear:O.SELECTED_CLEAR,onKeyDown:O.KEYDOWN,onMouseEnterTable:O.MOUSEENTER_TABLE,onMouseLeaveTable:O.MOUSELEAVE_TABLE,onMouseDownTable:O.MOUSEDOWN_TABLE,onMouseMoveCell:O.MOUSEMOVE_CELL,onMouseMoveTable:O.MOUSEMOVE_TABLE,onMouseEnterCell:O.MOUSEENTER_CELL,onMouseLeaveCell:O.MOUSELEAVE_CELL,onContextMenuCell:O.CONTEXTMENU_CELL,onContextMenuCanvas:O.CONTEXTMENU_CANVAS,onResizeColumn:O.RESIZE_COLUMN,onResizeColumnEnd:O.RESIZE_COLUMN_END,onResizeRow:O.RESIZE_ROW,onResizeRowEnd:O.RESIZE_ROW_END,onChangeHeaderPositionStart:O.CHANGE_HEADER_POSITION_START,onChangeHeaderPosition:O.CHANGE_HEADER_POSITION,onChangeHeaderPositionFail:O.CHANGE_HEADER_POSITION_FAIL,onSortClick:O.SORT_CLICK,onAfterSort:O.AFTER_SORT,onFreezeClick:O.FREEZE_CLICK,onScroll:O.SCROLL,onScrollHorizontalEnd:O.SCROLL_HORIZONTAL_END,onScrollVerticalEnd:O.SCROLL_VERTICAL_END,onDropdownMenuClick:O.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:O.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:O.DRAG_SELECT_END,onCopyData:O.COPY_DATA,onDropdownIconClick:O.DROPDOWN_ICON_CLICK,onDropdownMenuClear:O.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:O.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:O.SHOW_MENU,onHideMenu:O.HIDE_MENU,onIconClick:O.ICON_CLICK,onLegendItemClick:O.LEGEND_ITEM_CLICK,onLegendItemHover:O.LEGEND_ITEM_HOVER,onLegendItemUnHover:O.LEGEND_ITEM_UNHOVER,onLegendChange:O.LEGEND_CHANGE,onMouseEnterAxis:O.MOUSEENTER_AXIS,onMouseLeaveAxis:O.MOUSELEAVE_AXIS,onCheckboxStateChange:O.CHECKBOX_STATE_CHANGE,onRadioStateChange:O.RADIO_STATE_CHANGE,onSwitchStateChange:O.SWITCH_STATE_CHANGE,onAfterRender:O.AFTER_RENDER,onInitialized:O.INITIALIZED,onChangeCellValue:O.CHANGE_CELL_VALUE,onDragFillHandleEnd:O.DRAG_FILL_HANDLE_END,onMousedownFillHandle:O.MOUSEDOWN_FILL_HANDLE,onDblclickFillHandle:O.DBLCLICK_FILL_HANDLE,onPivotSortClick:O.PIVOT_SORT_CLICK,onDrillMenuClick:O.DRILLMENU_CLICK,onVChartEventType:O.VCHART_EVENT_TYPE,onChangCellValue:O.CHANGE_CELL_VALUE,onEmptyTipClick:O.EMPTY_TIP_CLICK,onEmptyTipDblClick:O.EMPTY_TIP_DBLCLICK,onButtonClick:O.BUTTON_CLICK,onBeforeCacheChartImage:O.BEFORE_CACHE_CHART_IMAGE,onPastedData:O.PASTED_DATA},R=Object.keys(L),I=(t,e=L)=>{const n={};return Object.keys(t).forEach((i=>{e[i]&&t[i]&&(n[i]=t[i])})),n},N=(t,e,n,i=L)=>{if(!e&&!n||!t)return!1;const r=n?I(n,i):null,s=e?I(e,i):null;return r&&Object.keys(r).forEach((e=>{s&&s[e]&&s[e]===r[e]||t.off(i[e],n[e])})),s&&Object.keys(s).forEach((e=>{r&&r[e]&&r[e]===s[e]||t.on(i[e],s[e])})),!0};class D{static GenAutoIncrementId(){return D.auto_increment_id++}}D.auto_increment_id=0;class U{constructor(t){this.id=D.GenAutoIncrementId(),this.registry=t}}const z="named",W="inject",F="inversify:tagged",j="inversify:paramtypes";class H{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===z?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var G=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",n=Object.getPrototypeOf(Function),i=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),r=new WeakMap;function s(t,e,n){let s=r.get(t);if(c(s)){if(!n)return;s=new i,r.set(t,s)}let a=s.get(e);if(c(a)){if(!n)return;a=new i,s.set(e,a)}return a}function a(t,e,n){if(o(t,e,n))return!0;const i=g(e);return!u(i)&&a(t,i,n)}function o(t,e,n){const i=s(e,n,!1);return!c(i)&&!!i.has(t)}function l(t,e,n){if(o(t,e,n))return function(t,e,n){const i=s(e,n,!1);if(!c(i))return i.get(t)}(t,e,n);const i=g(e);return u(i)?void 0:l(t,i,n)}function c(t){return void 0===t}function u(t){return null===t}function h(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,n){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 i=3===n?"string":5===n?"number":"default",r=function(t,e){const n=t[e];if(null!=n){if(!p(n))throw new TypeError;return n}}(t,e);if(void 0!==r){const e=r.call(t,i);if(h(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(p(e)){const n=e.call(t);if(!h(n))return n}const n=t.valueOf;if(p(n)){const e=n.call(t);if(!h(e))return e}}else{const e=t.valueOf;if(p(e)){const n=e.call(t);if(!h(n))return n}const n=t.toString;if(p(n)){const e=n.call(t);if(!h(e))return e}}throw new TypeError}(t,"default"===i?"number":i)}function f(t){const e=d(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function p(t){return"function"==typeof t}function g(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===n)return e;if(e!==n)return e;const i=t.prototype,r=i&&Object.getPrototypeOf(i);if(null==r||r===Object.prototype)return e;const s=r.constructor;return"function"!=typeof s||s===t?e:s}t("defineMetadata",(function(t,e,n,i){if(!h(n))throw new TypeError;return r=t,a=e,void s(n,i,!0).set(r,a);var r,a})),t("hasMetadata",(function(t,e,n){if(!h(e))throw new TypeError;return c(n)||(n=f(n)),a(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!h(e))throw new TypeError;return c(n)||(n=f(n)),o(t,e,n)})),t("getMetadata",(function(t,e,n){if(!h(e))throw new TypeError;return c(n)||(n=f(n)),l(t,e,n)}))}((e=t,function(t,n){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n})})),t}({});function V(t,e,n,i){!function(t,e,n,i){const r=[i];let s={};G.hasOwnMetadata(t,e)&&(s=G.getMetadata(t,e));let a=s[n];void 0===a&&(a=[]),a.push(...r),s[n]=a,G.defineMetadata(t,s,e)}(F,t,n.toString(),i)}function $(t){return(e,n,i)=>{V(e,0,i,t)}}const X=(Y=W,t=>(e,n,i)=>$(new H(Y,t))(e,n,i));var Y;function K(){return function(t){return G.defineMetadata(j,null,t),t}}function q(t){return $(new H(z,t))}const Q="Singleton",Z="Transient",J="ConstantValue",tt="DynamicValue",et="Factory",nt="Function",it="Instance",rt="Invalid";class st{constructor(t,e){this.id=D.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=rt,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new st(this.serviceIdentifier,this.scope);return t.activated=t.scope===Q&&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 at{getConstructorMetadata(t){return{compilerGeneratedMetadata:G.getMetadata(j,t),userGeneratedMetadata:G.getMetadata(F,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const ot=(lt=z,t=>{const e=e=>{if(null==e)return!1;if(e.key===lt&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const n=e.constructorArgsMetadata;for(let e=0;e<n.length;e++)if(n[e].key===lt&&n[e].value===t)return!0;return!1};return e.metaData=new H(lt,t),e});var lt;class ct{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Q,this}inTransientScope(){return this._binding.scope=Z,this}whenTargetNamed(t){return this._binding.constraint=ot(t),this}}class ut{constructor(t){this._binding=t}to(t){return this._binding.type=it,this._binding.implementationType=t,new ct(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=tt,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new ct(this._binding)}toConstantValue(t){return this._binding.type=J,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Q,new ct(this._binding)}toFactory(t){return this._binding.type=et,this._binding.factory=t,this._binding.scope=Q,new ct(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const ht=Symbol("ContributionProvider");class dt{constructor(t,e){this.serviceIdentifier=t,this.container=e,pt.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 ft(t,e){t(ht).toDynamicValue((({container:t})=>new dt(e,t))).inSingletonScope().whenTargetNamed(e)}class pt{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()}))}}pt.store=new Map;class gt{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const n="string"==typeof t?t.trim():t.name;n&&(this.taps=this.taps.filter((t=>!(t.name===n&&(!e||t.fn===e)))))}_parseOptions(t,e,n){let i;if("string"==typeof e)i={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof i.name||""===i.name)throw new Error("Missing name for tap");return i=Object.assign({type:t,fn:n},i),i}_tap(t,e,n){this._insert(this._parseOptions(t,e,n))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let n=0;"number"==typeof t.stage&&(n=t.stage);let i=this.taps.length;for(;i>0;){i--;const t=this.taps[i];this.taps[i+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>n)){i++;break}}this.taps[i]=t}}class mt extends gt{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const bt=Symbol.for("EnvContribution"),yt=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Z,this.options=e,this.id=D.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new at}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,n){const i=this._getNotAllArgs(t,!1,e,n);return this._get(i)}getNamed(t,e){return this.getTagged(t,z,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,n=new st(t,e),i=this._bindingDictionary.get(t)||[];return i.push(n),this._bindingDictionary.set(t,i),new ut(n)}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=>n=>{const i=this.bind(n);return t(i,e),i},n=()=>t=>this.unbind(t),i=()=>t=>this.isBound(t),r=e=>n=>{const i=this.rebind(n);return t(i,e),i};return t=>({bindFunction:e(t),isboundFunction:i(),rebindFunction:r(t),unbindFunction:n(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,n,i){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:i}}_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:n}=this._metadataReader.getConstructorMetadata(e),i=Object.keys(n),r=[];for(let t=0;t<i.length;t++){const e=n[t],i={};e.forEach((t=>{i[t.key]=t.value}));const s={inject:i[W],multiInject:i.multi_inject},a=s.inject||s.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};r.push(t)}}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case J:case nt:e=t.cache;break;case it: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 n=this._getChildRequest(t);return this._createInstance(e,n)}_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===Q&&(t.cache=e,t.activated=!0)}},vt=Symbol.for("RenderService");const xt=new class{get renderService(){return this._renderService||(this._renderService=yt.get(vt)),this._renderService}};var _t;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(_t||(_t={}));var St=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var At=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||St(t,"Boolean");var wt=t=>"function"==typeof t;var Tt=t=>null==t;var Ct=t=>null!=t;var Bt=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var kt=t=>"object"==typeof t&&null!==t;var Mt=function(t){if(!kt(t)||!St(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 Pt=(t,e=!1)=>{const n=typeof t;return e?"string"===n:"string"===n||St(t,"String")};var Et=t=>Array.isArray?Array.isArray(t):St(t,"Array");var Ot=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var Lt=(t,e=!1)=>{const n=typeof t;return e?"number"===n:"number"===n||St(t,"Number")};var Rt=t=>Lt(t)&&Number.isFinite(t);var It=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var Nt=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 Dt=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const Ut=Object.prototype;var zt=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ut)};const Wt=Object.prototype.hasOwnProperty;function Ft(t){if(Tt(t))return!0;if(Ot(t))return!t.length;const e=Dt(t);if("Map"===e||"Set"===e)return!t.size;if(zt(t))return!Object.keys(t).length;for(const e in t)if(Wt.call(t,e))return!1;return!0}function jt(t,e,n=!1,i=!1){if(e){if(t===e)return;if(Ct(e)&&"object"==typeof e){const r=Object(e),s=[];for(const t in r)s.push(t);let{length:a}=s,o=-1;for(;a--;){const a=s[++o];!Ct(r[a])||"object"!=typeof r[a]||i&&Et(t[a])?Gt(t,a,r[a]):Ht(t,e,a,n,i)}}}}function Ht(t,e,n,i=!1,r=!1){const s=t[n],a=e[n];let o=e[n],l=!0;if(Et(a)){if(i)o=[];else if(Et(s))o=s;else if(Ot(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else Mt(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):l=!1;l&&jt(o,a,i,r),Gt(t,n,o)}function Gt(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function Vt(t,...e){let n=-1;const i=e.length;for(;++n<i;)jt(t,e[n],!0);return t}function $t(t,e){if(!Et(t)||!Et(e))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}const Xt="undefined"!=typeof console;function Yt(t,e,n){const i=[e].concat([].slice.call(n));Xt&&console[t].apply(console,i)}var Kt;!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"}(Kt||(Kt={}));class qt{static getInstance(t,e){return qt._instance&&Lt(t)?qt._instance.level(t):qt._instance||(qt._instance=new qt(t,e)),qt._instance}static setInstance(t){return qt._instance=t}static setInstanceLevel(t){qt._instance?qt._instance.level(t):qt._instance=new qt(t)}static clearInstance(){qt._instance=null}constructor(t=Kt.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>=Kt.Info}canLogDebug(){return this._level>=Kt.Debug}canLogError(){return this._level>=Kt.Error}canLogWarn(){return this._level>=Kt.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=Kt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):Yt(null!==(e=this._method)&&void 0!==e?e:"error","ERROR",t)),this}warn(...t){return this._level>=Kt.Warn&&Yt(this._method||"warn","WARN",t),this}info(...t){return this._level>=Kt.Info&&Yt(this._method||"log","INFO",t),this}debug(...t){return this._level>=Kt.Debug&&Yt(this._method||"log","DEBUG",t),this}}qt._instance=null;const Qt=1e-12,Zt=Math.PI,Jt=Zt/2,te=2*Zt,ee=2*Math.PI,ne=Math.abs,ie=Math.atan2,re=Math.cos,se=Math.max,ae=Math.min,oe=Math.sin,le=Math.sqrt,ce=Math.pow;function ue(t){return t>=1?Jt:t<=-1?-Jt:Math.asin(t)}class he{constructor(t=0,e=0,n,i){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=n,this.y1=i}clone(){return new he(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 Lt(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return Lt(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 de{static distancePP(t,e){return le(ce(t.x-e.x,2)+ce(t.y-e.y,2))}static distanceNN(t,e,n,i){return le(ce(t-n,2)+ce(e-i,2))}static distancePN(t,e,n){return le(ce(e-t.x,2)+ce(n-t.y,2))}static pointAtPP(t,e,n){return new he((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function fe(t){return t*(Math.PI/180)}const pe=(t=0)=>{if(t<0)for(;t<-te;)t+=te;else if(t>0)for(;t>te;)t-=te;return t};var ge;function me(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function be({x:t,y:e},n,i={x:0,y:0}){return{x:(t-i.x)*Math.cos(n)-(e-i.y)*Math.sin(n)+i.x,y:(t-i.x)*Math.sin(n)+(e-i.y)*Math.cos(n)+i.y}}function ye(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function ve(t,e){const n=e?fe(t.angle):t.angle,i=ye(t);return[be({x:t.x1,y:t.y1},n,i),be({x:t.x2,y:t.y1},n,i),be({x:t.x2,y:t.y2},n,i),be({x:t.x1,y:t.y2},n,i)]}function xe(t,e,n,i,r,s){if(s>e&&s>i||s<e&&s<i)return 0;if(i===e)return 0;const a=(s-e)/(i-e);let o=i<e?1:-1;1!==a&&0!==a||(o=i<e?.5:-.5);const l=a*(n-t)+t;return l===r?1/0:l>r?o:0}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(ge||(ge={}));function _e(t,e,n){const{x1:i,y1:r,x2:s,y2:a}=e;return n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f),e):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*s+n.c*r+n.e,n.b*s+n.d*r+n.f),t.add(n.a*s+n.c*a+n.e,n.b*s+n.d*a+n.f),t.add(n.a*i+n.c*a+n.e,n.b*i+n.d*a+n.f),e)}class Se{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Se(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,n=0,i=0){return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this}set(t=0,e=0,n=0,i=0){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),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 Et(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,n=0){const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])}scale(t=0,e=0,n=0,i=0){const r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[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 _e(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,n){const{x1:i,y1:r,x2:s,y2:a}=this,o=Math.cos(t),l=Math.sin(t),c=e-e*o+n*l,u=n-e*l-n*o;return[o*i-l*r+c,l*i+o*r+u,o*i-l*a+c,l*i+o*a+u,o*s-l*r+c,l*s+o*r+u,o*s-l*a+c,l*s+o*a+u]}scalePoints(t,e,n,i){const{x1:r,y1:s,x2:a,y2:o}=this;return[t*r+(1-t)*n,e*s+(1-e)*i,t*a+(1-t)*n,e*o+(1-e)*i]}}class Ae extends Se{}class we extends Se{constructor(t,e=0){var n;super(t),t&&(this.angle=null!==(n=t.angle)&&void 0!==n?n:e)}intersects(t){return function(t,e,n=!1){const i=ve(t,n),r=ve(e,n),s=(t,e)=>[e.x-t.x,e.y-t.y],a=s(ye(t),ye(e)),o=s(i[0],i[1]),l=s(i[1],i[2]),c=s(r[0],r[1]),u=s(r[1],r[2]),h=n?fe(t.angle):t.angle;let d=n?fe(90-t.angle):t.angle+Jt;const f=n?fe(e.angle):e.angle;let p=n?fe(90-e.angle):e.angle+Jt;d>ee&&(d-=ee),p>ee&&(p-=ee);const g=(t,e,n,i)=>{const r=[Math.cos(e),Math.sin(e)];return t+(me(r,n)+me(r,i))/2>me(r,a)};return g((t.x2-t.x1)/2,h,c,u)&&g((t.y2-t.y1)/2,d,c,u)&&g((e.x2-e.x1)/2,f,o,l)&&g((e.y2-e.y1)/2,p,o,l)}(this,t)}setValue(t=0,e=0,n=0,i=0,r=0){return super.setValue(t,e,n,i),this.angle=r,this}clone(){return new we(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[be({x:this.x1,y:this.y1},this.angle,t),be({x:this.x2,y:this.y1},this.angle,t),be({x:this.x1,y:this.y2},this.angle,t),be({x:this.x2,y:this.y2},this.angle,t)]}}class Te{constructor(t=1,e=0,n=0,i=1,r=0,s=0){this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,n,i,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==i||this.b!==e||this.c!==n)}setValue(t,e,n,i,r,s){return this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,a=new Te,o=t*i-e*n;return a.a=i/o,a.b=-e/o,a.c=-n/o,a.d=t/o,a.e=(n*s-i*r)/o,a.f=-(t*s-e*r)/o,a}rotate(t){const e=Math.cos(t),n=Math.sin(t),i=this.a*e+this.c*n,r=this.b*e+this.d*n,s=this.a*-n+this.c*e,a=this.b*-n+this.d*e;return this.a=i,this.b=r,this.c=s,this.d=a,this}rotateByCenter(t,e,n){const i=Math.cos(t),r=Math.sin(t),s=(1-i)*e+r*n,a=(1-i)*n-r*e,o=i*this.a-r*this.b,l=r*this.a+i*this.b,c=i*this.c-r*this.d,u=r*this.c+i*this.d,h=i*this.e-r*this.f+s,d=r*this.e+i*this.f+a;return this.a=o,this.b=l,this.c=c,this.d=u,this.e=h,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,n,i,r,s){return this.multiply(t,e,n,i,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:n,d:i,e:r,f:s}=this;return this.a=e,this.b=t,this.c=i,this.d=n,this.e=s,this.f=r,this}multiply(t,e,n,i,r,s){const a=this.a,o=this.b,l=this.c,c=this.d,u=a*t+l*e,h=o*t+c*e,d=a*n+l*i,f=o*n+c*i,p=a*r+l*s+this.e,g=o*r+c*s+this.f;return this.a=u,this.b=h,this.c=d,this.d=f,this.e=p,this.f=g,this}interpolate(t,e){const n=new Te;return n.a=this.a+(t.a-this.a)*e,n.b=this.b+(t.b-this.b)*e,n.c=this.c+(t.c-this.c)*e,n.d=this.d+(t.d-this.d)*e,n.e=this.e+(t.e-this.e)*e,n.f=this.f+(t.f-this.f)*e,n}transformPoint(t,e){const{a:n,b:i,c:r,d:s,e:a,f:o}=this,l=n*s-i*r,c=s/l,u=-i/l,h=-r/l,d=n/l,f=(r*o-s*a)/l,p=-(n*o-i*a)/l,{x:g,y:m}=t;e.x=g*c+m*h+f,e.y=g*u+m*d+p}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Te(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,n=this.c,i=this.d,r=t*i-e*n,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),s.scaleX=a,s.scaleY=r/a,s.skewX=(t*n+e*i)/r,s.skewY=0}else if(0!==n||0!==i){const a=Math.sqrt(n*n+i*i);s.rotateDeg=Math.PI/2-(i>0?Math.acos(-n/a):-Math.acos(n/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*n+e*i)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}const Ce=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),Be=te-1e-8;class ke{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,i,r,s){if(Math.abs(r-i)>Be)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let a,o,l,c,u=1/0,h=-1/0,d=1/0,f=-1/0;function p(t){l=n*Math.cos(t),c=n*Math.sin(t),l<u&&(u=l),l>h&&(h=l),c<d&&(d=c),c>f&&(f=c)}if(p(i),p(r),r!==i)if((i%=te)<0&&(i+=te),(r%=te)<0&&(r+=te),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=te,a=i-i%Jt,o=0;o<4&&a>r;++o,a-=Jt)p(a);else for(a=i-i%Jt+Jt,o=0;o<4&&a<r;++o,a+=Jt)p(a);this.bounds.add(t+u,e+d),this.bounds.add(t+h,e+f)}arcTo(t,e,n,i,r){this.bounds.add(t,e)}bezierCurveTo(t,e,n,i,r,s){this.bounds.add(t,e),this.bounds.add(n,i),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,n,i){this.bounds.add(t,e),this.bounds.add(n,i)}rect(t,e,n,i){this.bounds.add(t,e),this.bounds.add(t+n,e+i)}clear(){this.bounds.clear()}release(...t){}}class Me{constructor(){this._curves=[],this.bounds=new Ae}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Pe=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Ee={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},Oe={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Le,Re,Ie,Ne,De,Ue;var ze,We,Fe,je,He,Ge;function Ve(t){const e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=l*s,u=-o*a,h=o*s,d=l*a,f=Math.cos(i),p=Math.sin(i),g=Math.cos(r),m=Math.sin(r),b=.5*(r-i),y=Math.sin(.5*b),v=8/3*y*y/Math.sin(b),x=e+f-v*p,_=n+p+v*f,S=e+g,A=n+m,w=S+v*m,T=A-v*g;return[c*x+u*_,h*x+d*_,c*w+u*T,h*w+d*T,c*S+u*A,h*S+d*A]}function $e(t,e,n,i){const r=function(t,e,n,i,r,s,a,o,l){const c=fe(a),u=Math.sin(c),h=Math.cos(c),d=h*(o-t)*.5+u*(l-e)*.5,f=h*(l-e)*.5-u*(o-t)*.5;let p=d*d/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const g=h/n,m=u/n,b=-u/i,y=h/i,v=g*o+m*l,x=b*o+y*l,_=g*t+m*e,S=b*t+y*e;let A=1/((_-v)*(_-v)+(S-x)*(S-x))-.25;A<0&&(A=0);let w=Math.sqrt(A);s===r&&(w=-w);const T=.5*(v+_)-w*(S-x),C=.5*(x+S)+w*(_-v),B=Math.atan2(x-C,v-T);let k=Math.atan2(S-C,_-T)-B;k<0&&1===s?k+=te:k>0&&0===s&&(k-=te);const M=Math.ceil(Math.abs(k/(Jt+.001))),P=[];for(let t=0;t<M;++t){const e=B+t*k/M,r=B+(t+1)*k/M;P[t]=[T,C,e,r,n,i,u,h]}return P}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n);for(let e=0;e<r.length;++e){const n=Ve(r[e]);t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(ze||(ze={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(We||(We={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(Fe||(Fe={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(je||(je={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(He||(He={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Ge||(Ge={}));const Xe=[(t,e,n,i,r,s,a)=>e.arc(t[1]*r+n,t[2]*s+i,t[3]*(r+s)/2,t[4],t[5],t[6],a),(t,e,n,i,r,s,a)=>e.arcTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*(r+s)/2,a),(t,e,n,i,r,s,a)=>e.bezierCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*r+n,t[6]*s+i,a),(t,e,n,i)=>e.closePath(),(t,e,n,i,r,s)=>e.ellipse(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,n,i,r,s,a)=>e.lineTo(t[1]*r+n,t[2]*s+i,a),(t,e,n,i,r,s,a)=>e.moveTo(t[1]*r+n,t[2]*s+i,a),(t,e,n,i,r,s,a)=>e.quadraticCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,a),(t,e,n,i,r,s,a)=>e.rect(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,a)];function Ye(t,e,n=0,i=0,r=1,s=1,a){for(let o=0;o<t.length;o++){const l=t[o];Xe[l[0]](l,e,n,i,r,s,a)}}class Ke{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function qe(t,e){let n=0;const i=t.length;for(let r=0;r<i;r++){const s=t[r],a=e[r],o=t[(r+1)%i],l=e[(r+1)%i];n+=de.distanceNN(s,a,o,l)}return n/2}function Qe(t,e,n,i,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*n*r*r*s+i*r*r*r}function Ze(t,e,n,i,r){const s=Qe(t.x,e.x,n.x,i.x,r),a=Qe(t.y,e.y,n.y,i.y,r);return new he(s,a)}function Je(t,e,n,i){const r=1-i;return r*r*t+2*r*i*e+i*i*n}function tn(t,e,n,i){const r=Je(t.x,e.x,n.x,i),s=Je(t.y,e.y,n.y,i);return new he(r,s)}class en extends Ke{constructor(t,e,n,i){super(),this.type=He.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=n,this.p3=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return Ze(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,n=this.p2,i=this.p3,qe([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])):60;var t,e,n,i}calcProjLength(t){return t===je.ROW?ne(this.p0.x-this.p3.x):t===je.COLUMN?ne(this.p0.y-this.p3.y):0}getAngleAt(t){const e=se(t-.01,0),n=ae(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return ie(r.y-i.y,r.x-i.x)}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.bezierCurveTo(this.p1.x*i+e,this.p1.y*r+n,this.p2.x*i+e,this.p2.y*r+n,this.p3.x*i+e,this.p3.y*r+n);else if(s>0){const[a]=function(t,e){const{p0:n,p1:i,p2:r,p3:s}=t,a=Ze(n,i,r,s,e),o=de.pointAtPP(n,i,e),l=de.pointAtPP(i,r,e),c=de.pointAtPP(r,s,e),u=de.pointAtPP(o,l,e),h=de.pointAtPP(l,c,e);return[new en(n,o,u,a),new en(a,h,c,s)]}(this,s);t.bezierCurveTo(a.p1.x*i+e,a.p1.y*r+n,a.p2.x*i+e,a.p2.y*r+n,a.p3.x*i+e,a.p3.y*r+n)}}includeX(t){const e=ae(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=se(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=n}getYAt(t){const e=ae(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=(t-e)/(se(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(n).y}}class nn extends Ke{constructor(t,e){super(),this.type=He.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return de.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=ie(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?de.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===je.ROW?ne(this.p0.x-this.p1.x):t===je.COLUMN?ne(this.p0.y-this.p1.y):0}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.lineTo(this.p1.x*i+e,this.p1.y*r+n);else if(s>0){const a=this.getPointAt(s);t.lineTo(a.x*i+e,a.y*r+n)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,n=this.p1;this.p0.x>this.p1.x&&(e=this.p1,n=this.p0);const i=(t-e.x)/(n.x-e.x);return e.y+i*(n.y-e.y)}return 1/0}}class rn{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,n,i,r,s,a,o){const l=new en(new he(this._lastX,this._lastY),new he(t,e),new he(n,i),new he(r,s));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=r,this._lastY=s,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,n,i){const r=this.addLinearCurve(t,e,n,this._lastOriginP,i);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=i}moveTo(t,e,n){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=n,this._startOriginP=n,this}quadraticCurveTo(t,e,n,i){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,n,i,r){const s=new nn(new he(this._lastX,this._lastY),new he(t,e));return s.originP1=i,s.originP2=r,s.defined=n,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===je.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],n=this.curves[this.curves.length-1],i=null!==(e=n.p3)&&void 0!==e?e:n.p1;return ne(t.p0.y-i.y)}if(t===je.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return ne(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class sn extends rn{bezierCurveTo(t,e,n,i,r,s,a,o){return super.bezierCurveTo(e,t,i,n,s,r,a,o)}lineTo(t,e,n,i){return super.lineTo(e,t,n,i)}moveTo(t,e,n){return super.moveTo(e,t,n)}clear(){return super.clear()}}function an(t,e,n=1){let i=!1;for(let n=0,r=e.length;n<=r;n++)n>=r===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function on(t,e,n){const i=null!=e?e:ne(n[n.length-1].x-n[0].x)>ne(n[n.length-1].y-n[0].y)?je.ROW:je.COLUMN;return"monotoneY"===t?new sn(t,i):new rn(t,i)}class ln{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function cn(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=on("linear",n,t);return function(t,e){an(t,e,1)}(new ln(r,i),t),r}function un(t,e,n,i,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6,i,t.lastPoint1)}class hn{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&un(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;break;default:un(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function dn(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return cn(t,e);const r=on("basis",n,t);return function(t,e){an(t,e,2)}(new hn(r,i),t),r}function fn(t){return t<0?-1:1}function pn(t,e,n){const i=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(i||Number(r<0&&-0)),a=(n-t._y1)/(r||Number(i<0&&-0)),o=(s*r+a*i)/(i+r);return(fn(s)+fn(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function gn(t,e){const n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function mn(t,e,n,i,r){const s=t._x0,a=t._y0,o=t._x1,l=t._y1,c=(o-s)/3;t.context.bezierCurveTo(s+c,a+c*e,o-c,l-c*n,o,l,i,t.lastPoint1)}class bn{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:mn(this,this._t0,gn(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const n=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(n,i,t);break;case 1:this._point=2;break;case 2:this._point=3,mn(this,gn(this,e=pn(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:mn(this,this._t0,e=pn(this,n,i),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class yn extends bn{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function vn(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return cn(t,e);const r=on("monotoneX",n,t);return function(t,e){an(t,e,2)}(new bn(r,i),t),r}function xn(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return cn(t,e);const r=on("monotoneY",n,t);return function(t,e){an(t,e,2)}(new yn(r,i),t),r}class _n{constructor(t,e=.5,n){this.context=t,this._t=e,this.startPoint=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t);else{const i=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(i,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(i,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(i,n,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=n,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class Sn extends _n{lineEnd(){this.context.closePath()}}function An(t,e,n={}){const{direction:i,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const s=new rn("step",null!=i?i:ne(t[t.length-1].x-t[0].x)>ne(t[t.length-1].y-t[0].y)?je.ROW:je.COLUMN);return wn(new _n(s,e,r),t),s}function wn(t,e){return an(t,e,1)}class Tn extends ln{lineEnd(){this.context.closePath()}}function Cn(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=on("linear",n,t);return function(t,e){an(t,e,1)}(new Tn(r,i),t),r}function Bn(t,e,n,i,r){let s=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>Qt){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,n=3*t._l01_a*(t._l01_a+t._l12_a);s=(s*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/n,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/n}if(t._l23_a>Qt){const i=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,r=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*i+t._x1*t._l23_2a-e*t._l12_2a)/r,l=(l*i+t._y1*t._l23_2a-n*t._l12_2a)/r}t.context.bezierCurveTo(s,a,o,l,t._x2,t._y2,i,t.lastPoint1)}function kn(t,e){return function(n,i,r={}){const{direction:s,startPoint:a}=r;if(n.length<2-Number(!!a))return null;if(n.length<3-Number(!!a))return cn(n,r);const o=on(t,s,n);return an(new e(o,i,a),n,2),o}}const Mn=kn("catmullRom",class{constructor(t,e=.5,n){this.context=t,this.startPoint=n,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:n}=t;if(this._point){const t=this._x2-e,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Bn(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const Pn=kn("catmullRomClosed",class{constructor(t,e=.5,n){this.context=t,this.startPoint=n,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:n}=t;if(this._point){const t=this._x2-e,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=n;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=n,t);break;case 2:this._point=3,this._x5=e,this._y5=n;break;default:Bn(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class En extends Ke{constructor(t,e,n){super(),this.type=He.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=n}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return tn(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,n=this.p2,qe([t.x,e.x,n.x],[t.y,e.y,n.y])):60;var t,e,n}calcProjLength(t){return t===je.ROW?ne(this.p0.x-this.p2.x):t===je.COLUMN?ne(this.p0.y-this.p2.y):0}getAngleAt(t){const e=se(t-.01,0),n=ae(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return ie(r.y-i.y,r.x-i.x)}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.quadraticCurveTo(this.p1.x*i+e,this.p1.y*r+n,this.p2.x*i+e,this.p2.y*r+n);else if(s>0){const[a]=function(t,e){const{p0:n,p1:i,p2:r}=t,s=tn(n,i,r,e),a=de.pointAtPP(n,i,e),o=de.pointAtPP(i,r,e);return[new En(n,a,s),new En(s,o,r)]}(this,s);t.quadraticCurveTo(a.p1.x*i+e,a.p1.y*r+n,a.p2.x*i+e,a.p2.y*r+n)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class On{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const n=this.addLinearCurve(t,e);this.path.addCurve(n),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new nn(new he(this._lastX,this._lastY),new he(t,e))}quadraticCurveTo(t,e,n,i){const r=new En(new he(this._lastX,this._lastY),new he(t,e),new he(n,i));this.path.addCurve(r),this._lastX=n,this._lastY=i}bezierCurveTo(t,e,n,i,r,s){const a=new en(new he(this._lastX,this._lastY),new he(t,e),new he(n,i),new he(r,s));this.path.addCurve(a),this._lastX=r,this._lastY=s}arcTo(t,e,n,i,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,n,i,r,s,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,n,i){throw new Error("CurveContext不支持调用rect")}arc(t,e,n,i,r,s){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function Ln(t,e,n){var i,r;switch(e){case"linear":default:return cn(t,n);case"basis":return dn(t,n);case"monotoneX":return vn(t,n);case"monotoneY":return xn(t,n);case"step":return An(t,.5,n);case"stepClosed":return function(t,e,n={}){const{direction:i,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const s=new rn("step",null!=i?i:ne(t[t.length-1].x-t[0].x)>ne(t[t.length-1].y-t[0].y)?je.ROW:je.COLUMN);return wn(new Sn(s,e,r),t),s}(t,.5,n);case"stepBefore":return An(t,0,n);case"stepAfter":return An(t,1,n);case"catmullRom":return Mn(t,null!==(i=null==n?void 0:n.curveTension)&&void 0!==i?i:.5,n);case"catmullRomClosed":return Pn(t,null!==(r=null==n?void 0:n.curveTension)&&void 0!==r?r:.5,n);case"linearClosed":return Cn(t,n)}}class Rn extends Me{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new ke(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Oe.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Oe.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.commandList.push([Oe.Q,t,e,n,i]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,s){return this.commandList.push([Oe.C,t,e,n,i,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,s),this}arcTo(t,e,n,i,r){return this.commandList.push([Oe.AT,t,e,n,i,r]),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,s,a,o){return this.commandList.push([Oe.E,t,e,n,i,r,s,a,o]),this._ctx&&this._ctx.ellipse(t,e,n,i,r,s,a,o),this}rect(t,e,n,i){return this.commandList.push([Oe.R,t,e,n,i]),this._ctx&&this._ctx.rect(t,e,n,i),this}arc(t,e,n,i,r,s){return this.commandList.push([Oe.A,t,e,n,i,r,s]),this._ctx&&this._ctx.arc(t,e,n,i,r,s),this}closePath(){return this.commandList.push([Oe.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new On(this);Ye(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[Oe.M]=t=>`M${t[1]} ${t[2]}`,t[Oe.L]=t=>`L${t[1]} ${t[2]}`,t[Oe.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Oe.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Oe.A]=t=>{const e=[],n=t[1],i=t[2],r=t[3];((t,e,n,i,r,s,a,o=!1)=>{const l=2*Math.PI,c=(e%l+l)%l;let u,h=(n%l+l)%l;o?(h>=c&&(h-=l),u=h-c):(h<=c&&(h+=l),u=h-c);const d=Math.ceil(Math.abs(u)/(.5*Math.PI)),f=u/d;for(let e=0;e<d;e++){const n=c+f*e,l=c+f*(e+1),u=4/3*Math.tan(Math.abs(f)/4),h=Math.cos(n),d=Math.sin(n),p=Math.cos(l),g=Math.sin(l),m=h*s+i,b=d*a+r,y=p*s+i,v=g*a+r,x=o?-1:1,_=s*u*x,S=a*u*x;t.push(m-_*d,b+S*h,y+_*g,v-S*p,y,v)}})(e,t[4],t[5],n,i,r,r,t[6]);let s="";for(let t=0;t<e.length;t+=6)s+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return s},t[Oe.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[Oe.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((n=>{e+=t[n[0]](n)})),e}fromString(t,e,n,i,r){this.clear();const s=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let n,i;const r=[];for(let t=0,s=e.length;t<s;t++)if(Le=e[t],Re=Le.slice(1),Ie=Le[0],n=[Ie],i=Re.match(Pe),null!==i){for(let t=0,e=i.length;t<e;t++)Ne=i[t],De=parseFloat(Ne),Number.isNaN(De)||n.push(De);if(Ue=Ee[Ie],n.length-1>Ue){let t,e=Ie;for(let i=1,s=n.length;i<s;i+=Ue){t=[e];for(let e=i,r=i+Ue;e<r;e++)t.push(n[e]);r.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else r.push(n)}else r.push(n);return r}(t);return this._runCommandStrList(s,e,n,i,r),this._updateBounds(),this}fromLine(t){const{points:e,curveType:n,clipRangeByDimension:i}=t.attribute;if(!e)return;const r=Ln(e,n);"x"===i?this.direction=je.ROW:"y"===i?this.direction=je.COLUMN:"auto"===i&&(this.direction=r.direction),this._curves=r.curves}fromCustomPath2D(t,e,n,i,r){return this.clear(),this._runCommandList(t.commandList,e,n,i,r),this._updateBounds(),this}transform(t,e,n,i){const r=this.commandList;if(!this.transformCbList){const t=[];t[Oe.M]=this.moveToTransform,t[Oe.L]=this.lineToTransform,t[Oe.Q]=this.quadraticCurveToTransform,t[Oe.C]=this.bezierCurveToTransform,t[Oe.AT]=this.arcToTransform,t[Oe.E]=this.ellipseTransform,t[Oe.R]=this.rectTransform,t[Oe.A]=this.arcTransform,t[Oe.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,n,i)})),this._updateBounds()}moveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}lineToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}quadraticCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n}bezierCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*i+e,t[6]=t[6]*r+n}arcToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*(i+r)/2}ellipseTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}rectTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}arcTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*(i+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,n=0,i=1,r=1){let s,a,o,l,c,u=null,h=0,d=0,f=0,p=0;for(let g=0,m=t.length;g<m;++g){switch(s=t[g],1===i&&1===r||(s=Nn(s,i,r)),s[0]){case"l":h+=s[1],d+=s[2],this.lineTo(h+e,d+n);break;case"L":h=s[1],d=s[2],this.lineTo(h+e,d+n);break;case"h":h+=s[1],this.lineTo(h+e,d+n);break;case"H":h=s[1],this.lineTo(h+e,d+n);break;case"v":d+=s[1],this.lineTo(h+e,d+n);break;case"V":d=s[1],this.lineTo(h+e,d+n);break;case"m":h+=s[1],d+=s[2],this.moveTo(h+e,d+n);break;case"M":h=s[1],d=s[2],this.moveTo(h+e,d+n);break;case"c":a=h+s[5],o=d+s[6],f=h+s[3],p=d+s[4],this.bezierCurveTo(h+s[1]+e,d+s[2]+n,f+e,p+n,a+e,o+n),h=a,d=o;break;case"C":h=s[5],d=s[6],f=s[3],p=s[4],this.bezierCurveTo(s[1]+e,s[2]+n,f+e,p+n,h+e,d+n);break;case"s":a=h+s[3],o=d+s[4],null===u[0].match(/[CcSs]/)?(f=h,p=d):(f=2*h-f,p=2*d-p),l=h+s[1],c=d+s[2],this.bezierCurveTo(f+e,p+n,l+e,c+n,a+e,o+n),f=l,p=c,h=a,d=o;break;case"S":a=s[3],o=s[4],null===u[0].match(/[CcSs]/)?(f=h,p=d):(f=2*h-f,p=2*d-p),l=s[1],c=s[2],this.bezierCurveTo(f+e,p+n,l+e,c+n,a+e,o+n),f=l,p=c,h=a,d=o;break;case"q":a=h+s[3],o=d+s[4],f=h+s[1],p=d+s[2],this.quadraticCurveTo(f+e,p+n,a+e,o+n),h=a,d=o;break;case"Q":a=s[3],o=s[4],this.quadraticCurveTo(s[1]+e,s[2]+n,a+e,o+n),h=a,d=o,f=s[1],p=s[2];break;case"t":a=h+s[1],o=d+s[2],null===u[0].match(/[QqTt]/)?(f=h,p=d):"t"===u[0]?(f=2*h-l,p=2*d-c):"q"===u[0]&&(f=2*h-f,p=2*d-p),l=f,c=p,this.quadraticCurveTo(f+e,p+n,a+e,o+n),h=a,d=o,f=h+s[1],p=d+s[2];break;case"T":a=s[1],o=s[2],f=2*h-f,p=2*d-p,this.quadraticCurveTo(f+e,p+n,a+e,o+n),h=a,d=o;break;case"a":$e(this,h+e,d+n,[s[1],s[2],s[3],s[4],s[5],s[6]+h+e,s[7]+d+n]),h+=s[6],d+=s[7];break;case"A":$e(this,h+e,d+n,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+n]),h=s[6],d=s[7];break;case"z":case"Z":this.closePath()}u=s}}_runCommandList(t,e=0,n=0,i=1,r=1){if(0!==e||0!==n||1!==i||1!==r)for(let s=0,a=t.length;s<a;++s){const a=t[s].slice();switch(a[0]){case Oe.L:this.lineToTransform(a,e,n,i,r);break;case Oe.M:this.moveToTransform(a,e,n,i,r);break;case Oe.C:this.bezierCurveToTransform(a,e,n,i,r);break;case Oe.Q:this.quadraticCurveToTransform(a,e,n,i,r);break;case Oe.A:this.arcToTransform(a,e,n,i,r);break;case Oe.E:this.ellipseTransform(a,e,n,i,r);break;case Oe.R:this.rectTransform(a,e,n,i,r);break;case Oe.AT:this.arcToTransform(a,e,n,i,r);break;case Oe.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Ye(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===je.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ne(t.p0.y-e.p1.y)}if(this.direction===je.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ne(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const n=this.curves[e];if(n.includeX(t))return n.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,n=0;for(let i=0;i<this._curves.length;i++){e=this._curves[i];const r=e.getLength(this.direction);if(n+r>=t)break;n+=r}const i=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(i),angle:e.getAngleAt(i)}}drawWithClipRange(t,e,n,i,r){this.tryBuildCurves();const s=this.getLength()*r;let a=0;for(let r=0;r<this._curves.length;r++){const o=this._curves[r],l=o.getLength(this.direction);if(!(a+l<=s)){const r=1-(a+l-s)/l;o.draw(t,n,i,e,e,r);break}o.draw(t,n,i,e,e,1),a+=l}}}const In=["l",0,0,0,0,0,0,0];function Nn(t,e,n){const i=In[0]=t[0];if("a"===i||"A"===i)In[1]=e*t[1],In[2]=n*t[2],In[3]=t[3],In[4]=t[4],In[5]=t[5],In[6]=e*t[6],In[7]=n*t[7];else if("h"===i||"H"===i)In[1]=e*t[1];else if("v"===i||"V"===i)In[1]=n*t[1];else for(let i=1,r=t.length;i<r;++i)In[i]=(i%2==1?e:n)*t[i];return In}const Dn={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new Te},Un={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},zn=Object.assign({outerBorder:Object.assign(Object.assign({},Un),{distance:0}),innerBorder:Object.assign(Object.assign({},Un),{distance:0})},Un),Wn={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:_t.fontBounding,keepCenterInLine:!1},Fn=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),zn),{alignSelf:"auto"}),{pickStrokeBuffer:0}),jn={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Hn=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null,roughStyle:null},{_debug_bounds:!1}),Fn),Dn),Gn=Object.assign(Object.assign({},Hn),{startAngle:0,endAngle:ee,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Vn=Object.assign(Object.assign(Object.assign({},Hn),jn),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),$n=Object.assign(Object.assign({},Hn),{radius:1,startAngle:0,endAngle:ee}),Xn=Object.assign(Object.assign({},Hn),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),Yn=Object.assign(Object.assign({},Hn),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Kn=Object.assign(Object.assign(Object.assign({},Hn),jn),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),qn=Object.assign(Object.assign({},Hn),{path:new Rn,fillStrokeOrder:1,clipRange:1,customPath:()=>{qt.getInstance().warn("空函数")}}),Qn=Object.assign(Object.assign({},Hn),{points:[],cornerRadius:0,closePath:!0}),Zn=Object.assign(Object.assign({},Hn),{width:100,height:100,spikes:5,thickness:.5}),Jn=Object.assign(Object.assign({},Hn),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round",drawStrokeWhenZeroWH:!1});Object.assign(Object.assign({},Hn),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round",drawStrokeWhenZeroWH:!1});const ti=Object.assign(Object.assign({},Hn),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),ei=Object.assign(Object.assign(Object.assign({},Hn),Wn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),ni=Object.assign(Object.assign(Object.assign({},Hn),Wn),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),ii=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},Hn),{fill:!0,cornerRadius:0,cornerType:"round"}),ri=Object.assign(Object.assign({},ii),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1}),si=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function n(t){const n=new Error(e+": "+t);throw n.source=e,n}function i(){return r("linear",t.linearGradient,s)||r("radial",t.radialGradient,o)||r("conic",t.conicGradient,a)}function r(e,i,r){return function(i,s){const a=b(i);if(a){b(t.startCall)||n("Missing (");const i=function(i){const s=r();return s&&(b(t.comma)||n("Missing comma before color stops")),{type:e,orientation:s,colorStops:d(f)}}();return b(t.endCall)||n("Missing )"),i}}(i)}function s(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let n,i,r=l();return r&&(n=[],n.push(r),i=e,b(t.comma)&&(r=l(),r?n.push(r):e=i)),n}function l(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=g()||c()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=p()||c()),t}();if(t)t.at=u();else{const e=c();if(e){t=e;const n=u();n&&(t.at=n)}else{const e=h();e&&(t={type:"default-radial",at:e})}}return t}function c(){return m("extent-keyword",t.extentKeywords,1)}function u(){if(m("position",/^at/,0)){const t=h();return t||n("Missing positioning value"),t}}function h(){const t={x:p(),y:p()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let i=e();const r=[];if(i)for(r.push(i);b(t.comma);)i=e(),i?r.push(i):n("One extra comma");return r}function f(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=p(),e}function p(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||g()}function g(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,n){const i=b(e);if(i)return{type:t,value:i[n]}}function b(t){const n=/^[\n\r\t\s]+/.exec(e);n&&y(n[0].length);const i=t.exec(e);return i&&y(i[0].length),i}function y(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(i);return e.length>0&&n("Invalid input not EOF"),t}()}}();class ai{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(ai.IsGradientStr(t))try{const e=si(t)[0];if(e){if("linear"===e.type)return ai.ParseLinear(e);if("radial"===e.type)return ai.ParseRadial(e);if("conic"===e.type)return ai.ParseConic(e)}}catch(e){return t}return t}static processColorStops(t){if(!t||0===t.length)return[];if(t.some((t=>t.length))){const e=t.map((t=>({color:t.value,offset:t.length?parseFloat(t.length.value)/100:-1})));e[0].offset<0&&(e[0].offset=0),e[e.length-1].offset<0&&(e[e.length-1].offset=1);for(let t=1;t<e.length-1;t++)if(e[t].offset<0){const n=t-1;let i=t+1;for(;i<e.length&&e[i].offset<0;)i++;const r=e[n].offset,s=e[i].offset,a=i-n;for(let t=1;t<a;t++)e[n+t].offset=r+(s-r)*t/a;t=i-1}return e}return t.map(((e,n)=>{const i=t.length>1?n/(t.length-1):0;return{color:e.value,offset:i}}))}static ParseConic(t){const{orientation:e,colorStops:n=[]}=t,i=Zt/2,r=parseFloat(e.value)/180*Zt-i;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+ee,stops:ai.processColorStops(n)}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:ai.processColorStops(e)}}static ParseLinear(t){const{orientation:e,colorStops:n=[]}=t,i=Zt/2;let r="angular"===e.type?parseFloat(e.value)/180*Zt:0;for(;r<0;)r+=ee;for(;r>=ee;)r-=ee;let s=0,a=0,o=0,l=0;return r<i?(s=0,a=1,o=Math.sin(r),l=a-Math.cos(r)):r<Zt?(s=0,a=0,o=Math.cos(r-i),l=Math.sin(r-i)):r<Zt+i?(s=1,a=0,o=s-Math.sin(r-Zt),l=Math.cos(r-Zt)):(s=1,o=s-Math.cos(r-i-Zt),l-=Math.sin(r-i-Zt)),{gradient:"linear",x0:s,y0:a,x1:o,y1:l,stops:ai.processColorStops(n)}}}function oi(t,e,n){let i=e;const{a:r,b:s,c:a,d:o}=t.currentMatrix,l=Math.sign(r)*Math.sqrt(r*r+s*s),c=Math.sign(o)*Math.sqrt(a*a+o*o);return l+c===0?0:(i=i/Math.abs(l+c)*2*n,i)}function li(t,e,n,i=0,r=0){var s,a,o,l;if(!e||!0===e)return"black";let c,u;if(Et(e))for(let t=0;t<e.length&&(u=e[t],!u);t++);else u=e;if(u=ai.Parse(u),"string"==typeof u)return u;if(n.AABBBounds&&(!n.attribute||0!==n.attribute.scaleX||0!==n.attribute.scaleY)){const e=n.AABBBounds;let h=e.x2-e.x1,d=e.y2-e.y1,f=e.x1-i,p=e.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1,angle:i=0}=n.attribute;h/=t,d/=e,f/=t,p/=e,(i||1!==t||1!==e)&&(f=null!==(s=n.x1WithoutTransform)&&void 0!==s?s:0,p=null!==(a=n.y1WithoutTransform)&&void 0!==a?a:0,h=null!==(o=n.widthWithoutTransform)&&void 0!==o?o:h,d=null!==(l=n.heightWithoutTransform)&&void 0!==l?l:d)}"linear"===u.gradient?c=function(t,e,n,i,r,s){var a,o,l,c;const u=t.createLinearGradient(n+(null!==(a=e.x0)&&void 0!==a?a:0)*r,i+(null!==(o=e.y0)&&void 0!==o?o:0)*s,n+(null!==(l=e.x1)&&void 0!==l?l:1)*r,i+(null!==(c=e.y1)&&void 0!==c?c:0)*s);return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,u,f,p,h,d):"conical"===u.gradient?c=function(t,e,n,i,r,s){var a,o;const l=t.createConicGradient(n+(null!==(a=e.x)&&void 0!==a?a:0)*r,i+(null!==(o=e.y)&&void 0!==o?o:0)*s,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern?l.GetPattern(r+n,s+i,void 0):l}(t,u,f,p,h,d):"radial"===u.gradient&&(c=function(t,e,n,i,r,s){var a,o,l,c,u,h;const d=t.createRadialGradient(n+(null!==(a=e.x0)&&void 0!==a?a:.5)*r,i+(null!==(o=e.y0)&&void 0!==o?o:.5)*s,Math.max(r,s)*(null!==(l=e.r0)&&void 0!==l?l:0),n+(null!==(c=e.x1)&&void 0!==c?c:.5)*r,i+(null!==(u=e.y1)&&void 0!==u?u:.5)*s,Math.max(r,s)*(null!==(h=e.r1)&&void 0!==h?h:.5));return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d}(t,u,f,p,h,d))}return c||"orange"}const ci={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},ui=!0,hi=!1,di=/\w|\(|\)|-/,fi=/[.?!,;:/,。?!、;:]/,pi=/\S/,gi=(t,e)=>{let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily})};function mi(t,e,n,i,r){if(t.length<=1)return 0;if(!e||e<=0)return 0;const s=xt.graphicUtil.textMeasure;let a=i,o=t.slice(0,a),l=Math.floor(s.measureText(o,n).width),c=t.slice(0,a+1),u=Math.floor(s.measureText(c,n).width);for(;l>e||u<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),l=Math.floor(s.measureText(o,n).width),c=t.slice(0,a+1),u=Math.floor(s.measureText(c,n).width)}return r&&(a=function(t,e,n=!1){let i=e;for(;di.test(t[i-1])&&di.test(t[i])||fi.test(t[i]);)if(i--,i<=0)return n?bi(t,e):e;return i}(t,a)),a}function bi(t,e){let n=e;for(;di.test(t[n+1])&&di.test(t[n])||fi.test(t[n]);)if(n++,n>=t.length)return n;return n+1}function yi(t,e,n="actual"){var i;if(""===t)return{ascent:0,height:0,descent:0,width:0};const r=xt.graphicUtil.textMeasure.measureText(t,e),s={ascent:0,height:0,descent:0,width:0},a="actual"===n?r.actualBoundingBoxAscent:r.fontBoundingBoxAscent,o="actual"===n?r.actualBoundingBoxDescent:r.fontBoundingBoxDescent;"number"!=typeof a||"number"!=typeof o?(s.width=Math.floor(r.width),s.height=e.fontSize||0,s.ascent=s.height,s.descent=0):(s.width=Math.floor(r.width),s.height=Math.floor(a+o),s.ascent=Math.floor(a),s.descent=s.height-s.ascent);const l=null!==(i=e.space)&&void 0!==i?i:0;return s.width+=l,s}const vi=Symbol.for("CanvasFactory");function xi(t){return yt.getNamed(vi,xt.global.env)(t)}const _i=1e-4,Si=Math.sqrt(3),Ai=1/3;function wi(t){return t>-Di&&t<Di}function Ti(t){return t>Di||t<-Di}const Ci=[0,0],Bi=[0,0],ki=[0,0];function Mi(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Pi(t,e,n,i){const r=1-i;return r*(r*t+2*i*e)+i*i*n}function Ei(t,e,n,i,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*i+3*s*n)}function Oi(t){return(t%=ee)<0&&(t+=ee),t}function Li(t,e,n,i,r,s,a,o,l){if(0===a)return!1;const c=a;return!(l>e+c&&l>i+c&&l>s+c||l<e-c&&l<i-c&&l<s-c||o>t+c&&o>n+c&&o>r+c||o<t-c&&o<n-c&&o<r-c)&&function(t,e,n,i,r,s,a,o,l){let c=0,u=.005,h=1/0;Ci[0]=a,Ci[1]=o;for(let a=0;a<1;a+=.05){Bi[0]=Pi(t,n,r,a),Bi[1]=Pi(e,i,s,a);const o=Mi(Ci,Bi);o<h&&(c=a,h=o)}h=1/0;for(let a=0;a<32&&!(u<_i);a++){const a=c-u,o=c+u;Bi[0]=Pi(t,n,r,a),Bi[1]=Pi(e,i,s,a);const l=Mi(Bi,Ci);if(a>=0&&l<h)c=a,h=l;else{ki[0]=Pi(t,n,r,o),ki[1]=Pi(e,i,s,o);const a=Mi(ki,Ci);o<=1&&a<h?(c=o,h=a):u*=.5}}return l&&(l[0]=Pi(t,n,r,c),l[1]=Pi(e,i,s,c)),Math.sqrt(h)}(t,e,n,i,r,s,o,l,null)<=c/2}function Ri(t,e,n,i,r,s,a,o,l,c,u){if(0===l)return!1;const h=l;return!(u>e+h&&u>i+h&&u>s+h&&u>o+h||u<e-h&&u<i-h&&u<s-h&&u<o-h||c>t+h&&c>n+h&&c>r+h&&c>a+h||c<t-h&&c<n-h&&c<r-h&&c<a-h)&&function(t,e,n,i,r,s,a,o,l,c,u){let h,d,f,p,g=0,m=.005,b=1/0;Ci[0]=l,Ci[1]=c;for(let l=0;l<1;l+=.05)Bi[0]=Ei(t,n,r,a,l),Bi[1]=Ei(e,i,s,o,l),f=Mi(Ci,Bi),f<b&&(g=l,b=f);b=1/0;for(let l=0;l<32&&!(m<_i);l++)h=g-m,d=g+m,Bi[0]=Ei(t,n,r,a,h),Bi[1]=Ei(e,i,s,o,h),f=Mi(Bi,Ci),h>=0&&f<b?(g=h,b=f):(ki[0]=Ei(t,n,r,a,d),ki[1]=Ei(e,i,s,o,d),p=Mi(ki,Ci),d<=1&&p<b?(g=d,b=p):m*=.5);return u&&(u[0]=Ei(t,n,r,a,g),u[1]=Ei(e,i,s,o,g)),Math.sqrt(b)}(t,e,n,i,r,s,a,o,c,u,null)<=h/2}function Ii(t,e,n,i,r,s,a,o,l){if(0===a)return!1;const c=a;o-=t,l-=e;const u=Math.sqrt(o*o+l*l);if(u-c>n||u+c<n)return!1;if(Math.abs(i-r)%ee<1e-4)return!0;if(s){const t=i;i=Oi(r),r=Oi(t)}else i=Oi(i),r=Oi(r);i>r&&(r+=ee);let h=Math.atan2(l,o);return h<0&&(h+=ee),h>=i&&h<=r||h+ee>=i&&h+ee<=r}function Ni(t,e,n,i,r,s,a){if(0===r)return!1;const o=r,l=r/2;let c=0,u=t;if(a>e+l&&a>i+l||a<e-l&&a<i-l||s>t+l&&s>n+l||s<t-l&&s<n-l)return!1;if(t===n)return Math.abs(s-t)<=o/2;c=(e-i)/(t-n),u=(t*i-n*e)/(t-n);const h=c*s-a+u;return h*h/(c*c+1)<=o/2*o/2}const Di=1e-4;function Ui(t,e,n,i,r){const s=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,o=3*e-3*t;let l=0;if(wi(a)){if(Ti(s)){const t=-o/s;t>=0&&t<=1&&(r[l++]=t)}}else{const t=s*s-4*a*o;if(wi(t))r[0]=-s/(2*a);else if(t>0){const e=Math.sqrt(t),n=(-s+e)/(2*a),i=(-s-e)/(2*a);n>=0&&n<=1&&(r[l++]=n),i>=0&&i<=1&&(r[l++]=i)}}return l}const zi=[-1,-1,-1],Wi=[-1,-1];function Fi(){const t=Wi[0];Wi[0]=Wi[1],Wi[1]=t}function ji(t,e,n,i,r,s,a,o,l,c){if(c>e&&c>i&&c>s&&c>o||c<e&&c<i&&c<s&&c<o)return 0;const u=function(t,e,n,i,r,s){const a=i+3*(e-n)-t,o=3*(n-2*e+t),l=3*(e-t),c=t-r,u=o*o-3*a*l,h=o*l-9*a*c,d=l*l-3*o*c;let f=0;if(wi(u)&&wi(h))if(wi(o))s[0]=0;else{const t=-l/o;t>=0&&t<=1&&(s[f++]=t)}else{const t=h*h-4*u*d;if(wi(t)){const t=h/u,e=-o/a+t,n=-t/2;e>=0&&e<=1&&(s[f++]=e),n>=0&&n<=1&&(s[f++]=n)}else if(t>0){const e=Math.sqrt(t);let n=u*o+1.5*a*(-h+e),i=u*o+1.5*a*(-h-e);n=n<0?-Math.pow(-n,Ai):Math.pow(n,Ai),i=i<0?-Math.pow(-i,Ai):Math.pow(i,Ai);const r=(-o-(n+i))/(3*a);r>=0&&r<=1&&(s[f++]=r)}else{const t=(2*u*o-3*a*h)/(2*Math.sqrt(u*u*u)),e=Math.acos(t)/3,n=Math.sqrt(u),i=Math.cos(e),r=(-o-2*n*i)/(3*a),l=(-o+n*(i+Si*Math.sin(e)))/(3*a),c=(-o+n*(i-Si*Math.sin(e)))/(3*a);r>=0&&r<=1&&(s[f++]=r),l>=0&&l<=1&&(s[f++]=l),c>=0&&c<=1&&(s[f++]=c)}}return f}(e,i,s,o,c,zi);if(0===u)return 0;let h=0,d=-1,f=0,p=0;for(let c=0;c<u;c++){const u=zi[c],g=0===u||1===u?.5:1;Ei(t,n,r,a,u)<l||(d<0&&(d=Ui(e,i,s,o,Wi),Wi[1]<Wi[0]&&d>1&&Fi(),f=Ei(e,i,s,o,Wi[0]),d>1&&(p=Ei(e,i,s,o,Wi[1]))),2===d?u<Wi[0]?h+=f<e?g:-g:u<Wi[1]?h+=p<f?g:-g:h+=o<p?g:-g:u<Wi[0]?h+=f<e?g:-g:h+=o<f?g:-g)}return h}function Hi(t,e,n,i,r,s,a,o){if(o>e&&o>i&&o>s||o<e&&o<i&&o<s)return 0;const l=function(t,e,n,i,r){const s=t-2*e+n,a=2*(e-t),o=t-i;let l=0;if(wi(s)){if(Ti(a)){const t=-o/a;t>=0&&t<=1&&(r[l++]=t)}}else{const t=a*a-4*s*o;if(wi(t)){const t=-a/(2*s);t>=0&&t<=1&&(r[l++]=t)}else if(t>0){const e=Math.sqrt(t),n=(-a+e)/(2*s),i=(-a-e)/(2*s);n>=0&&n<=1&&(r[l++]=n),i>=0&&i<=1&&(r[l++]=i)}}return l}(e,i,s,o,zi);if(0===l)return 0;const c=function(t,e,n){const i=t+n-2*e;return 0===i?.5:(t-e)/i}(e,i,s);if(c>=0&&c<=1){let o=0;const u=Pi(e,i,s,c);for(let i=0;i<l;i++){const l=0===zi[i]||1===zi[i]?.5:1;Pi(t,n,r,zi[i])<a||(zi[i]<c?o+=u<e?l:-l:o+=s<u?l:-l)}return o}const u=0===zi[0]||1===zi[0]?.5:1;return Pi(t,n,r,zi[0])<a?0:s<e?u:-u}function Gi(t,e,n,i,r,s,a,o){if((o-=e)>n||o<-n)return 0;const l=Math.sqrt(n*n-o*o);zi[0]=-l,zi[1]=l;const c=Math.abs(i-r);if(c<1e-4)return 0;if(c>=ee-1e-4){i=0,r=ee;const e=s?1:-1;return a>=zi[0]+t&&a<=zi[1]+t?e:0}if(i>r){const t=i;i=r,r=t}i<0&&(i+=ee,r+=ee);let u=0;for(let e=0;e<2;e++){const n=zi[e];if(n+t>a){let t=Math.atan2(o,n),e=s?1:-1;t<0&&(t=ee+t),(t>=i&&t<=r||t+ee>=i&&t+ee<=r)&&(t>Zt/2&&t<1.5*Zt&&(e=-e),u+=e)}}return u}function Vi(t){return Math.round(t/Zt*1e8)/1e8%2*Zt}function $i(t,e){let n=Vi(t[0]);n<0&&(n+=ee);const i=n-t[0];let r=t[1];r+=i,!e&&r-n>=ee?r=n+ee:e&&n-r>=ee?r=n-ee:!e&&n>r?r=n+(ee-Vi(n-r)):e&&n<r&&(r=n-(ee-Vi(r-n))),t[0]=n,t[1]=r}const Xi=[0,0];function Yi(t,e,n,i,r){const s=t,a=t.length;let o,l,c=0,u=0,h=0,d=0,f=0;for(let t=0;t<a;t++){const a=s[t],p=0===t;a[0]===Oe.M&&t>1&&(n||(c+=xe(u,h,d,f,i,r))),p&&(u=a[1],h=a[2],d=u,f=h);const g=a[0],m=a[1],b=a[2],y=a[3],v=a[4],x=a[5],_=a[6];let S=v,A=x;Xi[0]=S,Xi[1]=A,$i(Xi,Boolean(a[6])),S=Xi[0],A=Xi[1];const w=S,T=A-S,C=!!(1-(a[6]?0:1)),B=(i-m)*y/y+m;switch(g){case Oe.M:d=m,f=b,u=d,h=f;break;case Oe.L:if(n){if(Ni(u,h,m,b,e,i,r))return!0}else c+=xe(u,h,m,b,i,r)||0;u=m,h=b;break;case Oe.C:if(n){if(Ri(u,h,m,b,y,v,x,_,e,i,r))return!0}else c+=ji(u,h,m,b,y,v,x,_,i,r)||0;u=x,h=_;break;case Oe.Q:if(n){if(Li(u,h,m,b,y,v,e,i,r))return!0}else c+=Hi(u,h,m,b,y,v,i,r)||0;u=y,h=v;break;case Oe.A:if(o=Math.cos(w)*y+m,l=Math.sin(w)*y+b,p?(d=o,f=l):c+=xe(u,h,o,l,i,r),n){if(Ii(m,b,y,w,w+T,C,e,B,r))return!0}else c+=Gi(m,b,y,w,w+T,C,B,r);u=Math.cos(w+T)*y+m,h=Math.sin(w+T)*y+b;break;case Oe.R:if(d=u=m,f=h=b,o=d+y,l=f+v,n){if(Ni(d,f,o,f,e,i,r)||Ni(o,f,o,l,e,i,r)||Ni(o,l,d,l,e,i,r)||Ni(d,l,d,f,e,i,r))return!0}else c+=xe(o,f,o,l,i,r),c+=xe(d,l,d,f,i,r);break;case Oe.Z:if(n){if(Ni(u,h,d,f,e,i,r))return!0}else c+=xe(u,h,d,f,i,r);u=d,h=f}}return n||(p=h,g=f,Math.abs(p-g)<Di)||(c+=xe(u,h,d,f,i,r)||0),0!==c;var p,g}const Ki=new class{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=xi(Object.assign({nativeCanvas:xt.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},n=xi(Object.assign({nativeCanvas:xt.global.createCanvas(e)},e));return this.allocatedCanvas.push(n),n}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},qi={arc:Gn,area:Vn,circle:$n,line:Kn,path:qn,symbol:ti,text:ei,rect:Jn,polygon:Qn,star:Zn,richtext:ni,richtextIcon:ri,image:ii,group:Xn,glyph:Yn},Qi=Object.keys(qi);function Zi(t,e){Object.keys(e).forEach((n=>{t[n]=e[n]}))}const Ji={arc:Object.assign({},qi.arc),area:Object.assign({},qi.area),circle:Object.assign({},qi.circle),line:Object.assign({},qi.line),path:Object.assign({},qi.path),symbol:Object.assign({},qi.symbol),text:Object.assign({},qi.text),rect:Object.assign({},qi.rect),polygon:Object.assign({},qi.polygon),star:Object.assign({},qi.star),richtext:Object.assign({},qi.richtext),richtextIcon:Object.assign({},qi.richtextIcon),image:Object.assign({},qi.image),group:Object.assign({},qi.group),glyph:Object.assign({},qi.glyph)};class tr{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Qi.forEach((t=>{this._defaultTheme[t]=Object.create(Ji[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const n=this.getParentWithTheme(t);return n&&(e=n.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,n=!1){if(this.dirty){const i=this.getParentWithTheme(t);if(i){const t=i.theme;(t.dirty||n)&&t.applyTheme(i,e,!0)}this.userTheme?this.doCombine(i&&i.theme.combinedTheme):(i?this.combinedTheme=i.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,qt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,n=this.combinedTheme;Qi.forEach((i=>{const r=Object.create(Ji[i]);t&&t[i]&&Zi(r,t[i]),n[i]&&Zi(r,n[i]),e[i]&&Zi(r,e[i]),this.combinedTheme[i]=r})),e.common&&Qi.forEach((t=>{Zi(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let n=this.userTheme;n?Object.keys(t).forEach((e=>{n[e]?Object.assign(n[e],t[e]):n[e]=Object.assign({},t[e])})):n=t,this.userTheme=n,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const er=new tr;function nr(t,e){return t.glyphHost?nr(t.glyphHost):e?(t.isContainer,e):function(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):er.getTheme()}return null}(t)||t.attachedThemeGraphic&&nr(t.attachedThemeGraphic)||er.getTheme()}var ir=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function o(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}l((i=i.apply(t,e||[])).next())}))};class rr extends a{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=D.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,n=0;for(;e;){if(t(e,n++))return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){if(t(e,n++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return ir(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&qt.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let n=this._firstChild;for(let t=0;t<e;t++){if(!n)return null;t>0&&(n=n._next)}if(!n)return null;t._next=n._next,t._prev=n,n._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const n=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,n)}let n;this._nodeList[e]=t;for(let t=e-1;t>=0&&(n=this._nodeList[t],!n);t--);if(n)return n._next?this.insertBefore(t,n._next):this.appendChild(t);this._ignoreWarn=!0;const i=this.insertInto(t,0);return this._ignoreWarn=!1,i}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let n=null;return this.forEachChildren(((e,i)=>!(e===this||!t(e,i)||(n=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.find(t,!0);if(i)return n=i,!0}return!1})),n}findAll(t,e=!1){let n=[];return this.forEachChildren(((e,i)=>{e!==this&&t(e,i)&&n.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.findAll(t,!0);i.length&&(n=n.concat(i))}})),n}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let n=0;n<t;n++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let n=this._firstChild;for(;n;)n[t]=e,n.setAllDescendantsProps(t,e),n=n._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,n){const i=At(n,!0)&&n||Bt(n)&&n.capture,r=Bt(n)&&n.once,s=wt(e)?void 0:e;return t=i?`${t}capture`:t,e=wt(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,n){return this.addEventListener(t,e,n)}removeEventListener(t,e,n){const i=At(n,!0)&&n||Bt(n)&&n.capture,r=wt(e)?void 0:e;t=i?`${t}capture`:t,e=wt(e)?e:e.handleEvent;const s=Bt(n)&&n.once;return super.off(t,e,r,s),this}off(t,e,n){return this.removeEventListener(t,e,n)}once(t,e,n){return Bt(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class sr{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=sr.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const n=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(n),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&wt(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&wt(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class ar extends sr{constructor(t,e){super(),this.type=t,this.detail=e}}const or={dispatchEvent(t){var e;if(!(t instanceof sr))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new ar(t,e))}};class lr{static GetImage(t,e){var n;const i=lr.cache.get(t);i?"fail"===i.loadState?xt.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&e.imageLoadSuccess(t,i.data):lr.loadImage(t,e)}static GetSvg(t,e){var n;let i=lr.cache.get(t);i?"fail"===i.loadState?xt.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&e.imageLoadSuccess(t,i.data):(i={type:"image",loadState:"init"},lr.cache.set(t,i),i.dataPromise=xt.global.loadSvg(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{var n;i.loadState=(null==e?void 0:e.data)?"success":"fail",i.data=null==e?void 0:e.data,null===(n=i.waitingMark)||void 0===n||n.map(((n,r)=>{(null==e?void 0:e.data)?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))})),i.waitingMark&&(i.waitingMark=[])}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let n=lr.cache.get(t);return n?"fail"===n.loadState?Promise.reject():"init"===n.loadState||"loading"===n.loadState?n.dataPromise.then((t=>t.data)):Promise.resolve(n.data):(n={type:e,loadState:"init"},lr.cache.set(t,n),"arrayBuffer"===e?n.dataPromise=xt.global.loadArrayBuffer(t):"blob"===e?n.dataPromise=xt.global.loadBlob(t):"json"===e&&(n.dataPromise=xt.global.loadJson(t)),n.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!lr.isLoading&&lr.toLoadAueue.length){lr.isLoading=!0;const t=lr.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:n,marks:i}=t,r={type:"image",loadState:"init"};if(lr.cache.set(n,r),r.dataPromise=xt.global.loadImage(n),r.dataPromise){r.waitingMark=i;const t=r.dataPromise.then((t=>{var e;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(e=r.waitingMark)||void 0===e||e.map(((e,i)=>{(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,e.imageLoadSuccess(n,t.data)):(r.loadState="fail",e.imageLoadFail(n))})),r.waitingMark&&(r.waitingMark=[])}));e.push(t)}else r.loadState="fail",i.forEach((t=>t.imageLoadFail(n)))})),Promise.all(e).then((()=>{lr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),lr.loading()})).catch((t=>{lr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),lr.loading()}))}}),0)}static loadImage(t,e){const n=cr(t,lr.toLoadAueue);if(-1!==n)return lr.toLoadAueue[n].marks.push(e),void lr.loading();lr.toLoadAueue.push({url:t,marks:[e]}),lr.loading()}static improveImageLoading(t){const e=cr(t,lr.toLoadAueue);if(-1!==e){const t=lr.toLoadAueue.splice(e,1);lr.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function cr(t,e){for(let n=0;n<e.length;n++)if(e[n].url===t)return n;return-1}var ur;lr.cache=new Map,lr.isLoading=!1,lr.toLoadAueue=[],lr.onLoadSuccessCb=[],function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(ur||(ur={}));const hr=[0,0,0,0],dr=t=>t?Et(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(hr[0]=t[0],hr[2]=t[0],hr[1]=t[1],hr[3]=t[1],hr):t:t:0,fr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],pr=[1,2,3,0,1,2,3,0];function gr(t,e,n,i){for(;t>=ee;)t-=ee;for(;t<0;)t+=ee;for(;t>e;)e+=ee;fr[0].x=n,fr[1].y=n,fr[2].x=-n,fr[3].y=-n;const r=Math.ceil(t/Jt)%4,s=Math.ceil(e/Jt)%4;if(i.add(re(t)*n,oe(t)*n),i.add(re(e)*n,oe(e)*n),r!==s||e-t>Zt){let t=!1;for(let e=0;e<pr.length;e++)if(t||r!==pr[e]){if(t&&s===pr[e])break;if(t){const t=fr[pr[e]];i.add(t.x,t.y)}}else{t=!0;const e=fr[r];i.add(e.x,e.y)}}}const mr=(t,e)=>{const n=((t,e)=>Pt(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(n)?n:Math.max(e,n)};class br{bounds(t,e){if(Lt(t)){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return Lt(t)?t:Math.min(t[0],t[1])}}function yr(t,e,n,i,r){return r?t.arc(n,i,e,0,te,!1,r):t.arc(n,i,e,0,te),!1}var vr=new class extends br{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,n,i,r){return yr(t,this.parseSize(e)/2,n,i,r)}drawOffset(t,e,n,i,r,s){return yr(t,this.parseSize(e)/2+r,n,i,s)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e-r}, ${n} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}};var xr=new class extends br{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-3*e+n,-e+i,r),t.lineTo(-e+n,-e+i,r),t.lineTo(-e+n,-3*e+i,r),t.lineTo(e+n,-3*e+i,r),t.lineTo(e+n,-e+i,r),t.lineTo(3*e+n,-e+i,r),t.lineTo(3*e+n,e+i,r),t.lineTo(e+n,e+i,r),t.lineTo(e+n,3*e+i,r),t.lineTo(-e+n,3*e+i,r),t.lineTo(-e+n,e+i,r),t.lineTo(-3*e+n,e+i,r),t.closePath(),!0}(t,this.parseSize(e)/6,n,i,r)}drawOffset(t,e,n,i,r,s){return function(t,e,n,i,r,s){return t.moveTo(-3*e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-3*e+i-r,s),t.lineTo(e+n+r,-3*e+i-r,s),t.lineTo(e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,e+i+r,s),t.lineTo(e+n+r,e+i+r,s),t.lineTo(e+n+r,3*e+i+r,s),t.lineTo(-e+n-r,3*e+i+r,s),t.lineTo(-e+n-r,e+i+r,s),t.lineTo(-3*e+n-r,e+i+r,s),t.closePath(),!0}(t,this.parseSize(e)/6,n,i,r,s)}};function _r(t,e,n,i,r){return t.moveTo(n,i-e,r),t.lineTo(e+n,i,r),t.lineTo(n,i+e,r),t.lineTo(n-e,i,r),t.closePath(),!0}var Sr=new class extends br{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,n,i,r){return _r(t,this.parseSize(e)/2,n,i,r)}drawFitDir(t,e,n,i,r){return _r(t,this.parseSize(e)/2,n,i,r)}drawOffset(t,e,n,i,r,s){return _r(t,this.parseSize(e)/2+r,n,i,s)}};function Ar(t,e,n,i){const r=2*e;return t.rect(n-e,i-e,r,r),!1}var wr=new class extends br{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,i){return Ar(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Ar(t,this.parseSize(e)/2+r,n,i)}};function Tr(t,e,n,i,r=0){return t.moveTo(n+e+2*r,e+i+r),t.lineTo(n-e-2*r,e+i+r),t.lineTo(n,i-e-2*r),t.closePath(),!0}class Cr extends br{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,n,i){return Tr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Tr(t,this.parseSize(e)/2,n,i,r)}}var Br=new Cr;var kr=new class extends Cr{constructor(){super(...arguments),this.type="triangle"}};const Mr=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Pr=Math.sin(te/10)*Mr,Er=-Math.cos(te/10)*Mr;function Or(t,e,n,i){const r=Pr*e,s=Er*e;t.moveTo(n,-e+i),t.lineTo(r+n,s+i);for(let a=1;a<5;++a){const o=te*a/5,l=Math.cos(o),c=Math.sin(o);t.lineTo(c*e+n,-l*e+i),t.lineTo(l*r-c*s+n,c*r+l*s+i)}return t.closePath(),!0}var Lr=new class extends br{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,n,i){return Or(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Or(t,this.parseSize(e)/2+r,n,i)}};const Rr=le(3);function Ir(t,e,n,i){const r=e,s=r/Rr,a=s/5,o=e;return t.moveTo(0+n,-r+i),t.lineTo(s/2+n,i),t.lineTo(a/2+n,i),t.lineTo(a/2+n,o+i),t.lineTo(-a/2+n,o+i),t.lineTo(-a/2+n,i),t.lineTo(-s/2+n,i),t.closePath(),!0}var Nr=new class extends br{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,n,i){return Ir(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Ir(t,this.parseSize(e)/2+r,n,i)}};function Dr(t,e,n,i){const r=2*e;return t.moveTo(n,-e+i),t.lineTo(r/3/2+n,e+i),t.lineTo(-r/3/2+n,e+i),t.closePath(),!0}var Ur=new class extends br{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,n,i){return Dr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Dr(t,this.parseSize(e)/2+r,n,i)}};function zr(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var Wr=new class extends br{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,n,i){return zr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return zr(t,this.parseSize(e)/2+r,n,i)}};const Fr=-.5,jr=le(3)/2,Hr=1/le(12);function Gr(t,e,n,i){const r=e/2,s=e*Hr,a=r,o=e*Hr+e,l=-a,c=o;return t.moveTo(r+n,s+i),t.lineTo(a+n,o+i),t.lineTo(l+n,c+i),t.lineTo(Fr*r-jr*s+n,jr*r+Fr*s+i),t.lineTo(Fr*a-jr*o+n,jr*a+Fr*o+i),t.lineTo(Fr*l-jr*c+n,jr*l+Fr*c+i),t.lineTo(Fr*r+jr*s+n,Fr*s-jr*r+i),t.lineTo(Fr*a+jr*o+n,Fr*o-jr*a+i),t.lineTo(Fr*l+jr*c+n,Fr*c-jr*l+i),t.closePath(),!1}var Vr=new class extends br{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,n,i){return Gr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Gr(t,this.parseSize(e)/2+r,n,i)}};function $r(t,e,n,i,r){return t.moveTo(-e+n-2*r,i),t.lineTo(e+n+r,e+i+2*r),t.lineTo(e+n+r,i-e-2*r),t.closePath(),!0}var Xr=new class extends br{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,n,i){return $r(t,this.parseSize(e)/2,n,i,0)}drawOffset(t,e,n,i,r){return $r(t,this.parseSize(e)/2,n,i,r)}};function Yr(t,e,n,i,r=0){return t.moveTo(n-e-r,e+i+2*r),t.lineTo(e+n+2*r,i),t.lineTo(n-e-r,i-e-2*r),t.closePath(),!0}var Kr=new class extends br{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,n,i){return Yr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Yr(t,this.parseSize(e)/2,n,i,r)}};function qr(t,e,n,i,r=0){return t.moveTo(n-e-2*r,i-e-r),t.lineTo(n+e+2*r,i-e-r),t.lineTo(n,i+e+2*r),t.closePath(),!0}var Qr=new class extends br{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,n,i){return qr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return qr(t,this.parseSize(e)/2,n,i,r)}};const Zr=le(3);function Jr(t,e,n,i){const r=e*Zr;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var ts=new class extends br{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,n,i){return Jr(t,this.parseSize(e)/2/Zr,n,i)}drawOffset(t,e,n,i,r){return Jr(t,this.parseSize(e)/2/Zr+r,n,i)}};function es(t,e,n,i){const r=2*e;return t.moveTo(e+n,i-r),t.lineTo(n-e,i),t.lineTo(e+n,r+i),!0}var ns=new class extends br{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,n,i){return es(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return es(t,this.parseSize(e)/4+r,n,i)}};function is(t,e,n,i){const r=2*e;return t.moveTo(n-e,i-r),t.lineTo(n+e,i),t.lineTo(n-e,r+i),!0}var rs=new class extends br{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,n,i){return is(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return is(t,this.parseSize(e)/4+r,n,i)}};function ss(t,e,n,i){const r=2*e;return t.moveTo(n-r,i+e),t.lineTo(n,i-e),t.lineTo(n+r,i+e),!0}var as=new class extends br{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,n,i){return ss(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return ss(t,this.parseSize(e)/4+r,n,i)}};function os(t,e,n,i){const r=2*e;return t.moveTo(n-r,i-e),t.lineTo(n,i+e),t.lineTo(n+r,i-e),!0}var ls=new class extends br{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,n,i){return os(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return os(t,this.parseSize(e)/4+r,n,i)}};function cs(t,e,n,i,r){return t.moveTo(n,i-e),t.lineTo(n,i+e),!0}var us=new class extends br{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,n,i,r){return cs(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return cs(t,this.parseSize(e)/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e}, ${n-r} L ${e},${n+r}`}};function hs(t,e,n,i,r){return t.moveTo(n-e,i),t.lineTo(n+e,i),!0}var ds=new class extends br{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,n,i,r){return hs(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return hs(t,this.parseSize(e)/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e-r}, ${n} L ${e+r},${n}`}};function fs(t,e,n,i,r){return t.moveTo(n-e,i-e),t.lineTo(n+e,i+e),t.moveTo(n+e,i-e),t.lineTo(n-e,i+e),!0}var ps=new class extends br{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,n,i,r){return fs(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return fs(t,this.parseSize(e)/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e-r}, ${n-r} L ${e+r},${n+r} M ${e+r}, ${n-r} L ${e-r},${n+r}`}};function gs(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}function ms(t,e,n,i){const r=e,s=e/2;return t.rect(n-r/2,i-s/2,r,s),!1}var bs=new class extends br{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,n,i){return Lt(e)?ms(t,e,n,i):gs(t,e,n,i)}drawWithClipRange(t,e,n,i,r,s,a){Lt(e)&&(e=[e,e/2]);const o=2*(e[0]+e[1])*r,l=[{x:n+e[0]/2,y:i-e[1]/2},{x:n+e[0]/2,y:i+e[1]/2},{x:n-e[0]/2,y:i+e[1]/2},{x:n-e[0]/2,y:i-e[1]/2}];let c=0,u=l[3];t.moveTo(u.x,u.y);for(let e=0;e<l.length;e++){const n=l[e],i=Math.sqrt((n.x-u.x)*(n.x-u.x)+(n.y-u.y)*(n.y-u.y));if(c+i>o){const e=(n.x-u.x)*(o-c)/i,r=(n.y-u.y)*(o-c)/i;t.lineTo(u.x+e,u.y+r);break}t.lineTo(n.x,n.y),u=n,c+=i}return!1}drawOffset(t,e,n,i,r){return Lt(e)?ms(t,e+2*r,n,i):gs(t,[e[0]+2*r,e[1]+2*r],n,i)}};const ys=new Ae;class vs{constructor(t,e,n=!1){this.pathStr="",this.type=t,Et(e)?this.svgCache=e:this.path=e,this.isSvg=n}drawOffset(t,e,n,i,r,s,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),Ye(r.path.commandList,t,n,i,e,e),a&&a(r.path,r.attribute)})),!1):(Ye(this.path.commandList,t,n,i,e+r,e+r),!1)}draw(t,e,n,i,r,s){return e=this.parseSize(e),this.drawOffset(t,e,n,i,0,r,s)}parseSize(t){return Lt(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,n,i,r,s,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{s.path.drawWithClipRange(t,e,n,i,r),a&&a(s.path,s.attribute)})),!1):(this.path.drawWithClipRange(t,e,n,i,r),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:n})=>{ys.x1=n.bounds.x1*t,ys.y1=n.bounds.y1*t,ys.x2=n.bounds.x2*t,ys.y2=n.bounds.y2*t,e.union(ys)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const xs={};[vr,xr,Sr,wr,ts,kr,Lr,Nr,Ur,Wr,Vr,Xr,Kr,Br,Qr,ns,rs,as,ls,bs,us,ds,ps].forEach((t=>{xs[t.type]=t}));const _s={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class Ss{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function As(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function ws(t,e,n,i=">"){const r=function(t,e,n=">"){let i,r="";for(let s=e;s<t.length;s++){let e=t[s];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,i);if(!r)return;let s=r.data;const a=r.index,o=s.search(/\s/);let l=s,c=!0;-1!==o&&(l=s.substr(0,o).replace(/\s\s*$/,""),s=s.substr(o+1));const u=l;if(n){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),c=l!==r.data.substr(t+1))}return{tagName:l,tagExp:s,closeIndex:a,attrExpPresent:c,rawTagName:u}}const Ts=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class Cs{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,n){const i=e.tagname;"string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,n){const i={};if(!t)return;const r=function(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let t=0;t<s;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n}(t,Ts),s=r.length;for(let t=0;t<s;t++){const e=r[t][1],n=r[t][4];e&&(i[e]=void 0===n||(isNaN(n)?n:Number(n)))}return i}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Ss("!xml");let n=e,i="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=As(t,">",s,"Closing Tag is not closed."),a=r.lastIndexOf(".");r=r.substring(0,a),n=this.tagsNodeStack.pop(),n&&n.child&&i&&n.child[n.child.length-1][":@"]&&(n.child[n.child.length-1][":@"].text=i),i="",s=e}else if("?"===t[s+1])s=ws(t,s,!1,"?>").closeIndex+1;else if("!--"===t.substr(s+1,3))s=As(t,"--\x3e",s+4,"Comment is not closed.");else{const a=ws(t,s,!1);let o=a.tagName,l=a.tagExp;const c=a.attrExpPresent,u=a.closeIndex;if(o!==e.tagname&&(r+=r?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),r=r.substr(0,r.length-1),l=o):l=l.substr(0,l.length-1);const t=new Ss(o);o!==l&&c&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(n,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new Ss(o);this.tagsNodeStack.push(n),o!==l&&c&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(n,t,r),n=t}i="",s=u}else i+=t[s];return e.child}}function Bs(t,e){return ks(t)}function ks(t,e){const n={};for(let e=0;e<t.length;e++){const r=t[e],s=Ms(r);if(void 0!==s&&r[s]){const t=ks(r[s]);i=t,Object.keys(i).length,r[":@"]&&Ps(t,r[":@"]),void 0!==n[s]&&n.hasOwnProperty(s)?(Array.isArray(n[s])||(n[s]=[n[s]]),n[s].push(t)):n[s]=t}}var i;return n}function Ms(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function Ps(t,e,n){if(e){const n=Object.keys(e),i=n.length;for(let r=0;r<i;r++){const i=n[r];t[i]=e[i]}}}class Es{constructor(t){this.options=Object.assign({},Es.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Bs(new Cs(this.options).parseXml(t),this.options)}}function Os(t,e,n,i=0){return t.expand(e+(i/2+(n?function(t,e){return t?e:0}(n,e):0))),t}Es.defaultOptions={};let Ls=0;function Rs(){return Ls++}var Is;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Is||(Is={}));const Ns=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Ns.set(t,!0)));const Ds=new Map;function Us(t){if(Ns.has(t))return!0;if(Ds.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Ds.set(t,!0)));const zs=Rs();Rs(),Rs(),Rs(),Rs();const Ws=Rs(),Fs=Rs();Rs(),Rs(),Rs(),Rs();const js=Rs();Rs();const Hs=Rs();Rs();const Gs=Rs(),Vs=Rs(),$s=Symbol.for("GraphicCreator"),Xs={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},Ys=Object.keys(Xs),Ks={duration:200,easing:"cubicOut"};function qs(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Qs(t,e,n){const i=n[0],r=n[1],s=n[2];let a,o,l,c,u,h,d,f,p,g,m,b;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*s+e[12],t[13]=e[1]*i+e[5]*r+e[9]*s+e[13],t[14]=e[2]*i+e[6]*r+e[10]*s+e[14],t[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],l=e[2],c=e[3],u=e[4],h=e[5],d=e[6],f=e[7],p=e[8],g=e[9],m=e[10],b=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=c,t[4]=u,t[5]=h,t[6]=d,t[7]=f,t[8]=p,t[9]=g,t[10]=m,t[11]=b,t[12]=a*i+u*r+p*s+e[12],t[13]=o*i+h*r+g*s+e[13],t[14]=l*i+d*r+m*s+e[14],t[15]=c*i+f*r+b*s+e[15]),t}function Zs(t,e,n){const i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],b=e[14],y=e[15];let v=n[0],x=n[1],_=n[2],S=n[3];return t[0]=v*i+x*o+_*h+S*g,t[1]=v*r+x*l+_*d+S*m,t[2]=v*s+x*c+_*f+S*b,t[3]=v*a+x*u+_*p+S*y,v=n[4],x=n[5],_=n[6],S=n[7],t[4]=v*i+x*o+_*h+S*g,t[5]=v*r+x*l+_*d+S*m,t[6]=v*s+x*c+_*f+S*b,t[7]=v*a+x*u+_*p+S*y,v=n[8],x=n[9],_=n[10],S=n[11],t[8]=v*i+x*o+_*h+S*g,t[9]=v*r+x*l+_*d+S*m,t[10]=v*s+x*c+_*f+S*b,t[11]=v*a+x*u+_*p+S*y,v=n[12],x=n[13],_=n[14],S=n[15],t[12]=v*i+x*o+_*h+S*g,t[13]=v*r+x*l+_*d+S*m,t[14]=v*s+x*c+_*f+S*b,t[15]=v*a+x*u+_*p+S*y,t}class Js{constructor(){this.pools=[]}static identity(t){return qs(t)}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return Js.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let n=0;n<e.length;n++)e[n]=t[n];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const ta=new class{constructor(){this.pools=[]}allocate(t,e,n,i,r,s){if(!this.pools.length)return new Te(t,e,n,i,r,s);const a=this.pools.pop();return a.a=t,a.b=e,a.c=n,a.d=i,a.e=r,a.f=s,a}allocateByObj(t){if(!this.pools.length)return new Te(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},ea=new Js;var na=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},ia=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const ra=new Te(1,0,0,1,0,0),sa={x:0,y:0};let aa=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Te(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Te(1,0,0,1,0,0),this.path=new Rn,this._clearMatrix=new Te(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return ta.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}reset(){this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Te(1,0,0,1,0,0),this.stack.length=0}restore(){this.stack.length>0&&(ta.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(ta.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,n=!0){this.matrix.scale(t,e),n&&this.setTransformForCurrent()}setScale(t,e,n=!0){this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}scalePoint(t,e,n,i,r=!0){this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}setTransform(t,e,n,i,r,s,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*n,o*i,o*r,o*s),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,n=this.dpr){this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,n,i,r,s,a=!0){this.matrix.multiply(t,e,n,i,r,s),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,n=!0){this.matrix.translate(t,e),n&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const n=t*Math.PI/180;this.rotate(n,e)}rotateAbout(t,e,n,i=!0){this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,n,i=!0){this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,n,i,r,s){this.path.arc(t,e,n,i,r,s)}arcTo(t,e,n,i,r){this.path.arcTo(t,e,n,i,r)}bezierCurveTo(t,e,n,i,r,s){this.path.bezierCurveTo(t,e,n,i,r,s)}closePath(){this.path.closePath()}ellipse(t,e,n,i,r,s,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,n,i){this.path.quadraticCurveTo(t,e,n,i)}rect(t,e,n,i){this.path.rect(t,e,n,i)}createImageData(t,e){return null}createLinearGradient(t,e,n,i){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,n,i,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,n,i){return null}fill(t,e){}fillRect(t,e,n,i){this.path.rect(t,e,n,i)}clearRect(t,e,n,i){}fillText(t,e,n){}getImageData(t,e,n,i){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},sa),function(t,e,n){return Yi(t,0,!1,e,n)}(this.path.commandList,sa.x,sa.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},sa);const n=oi(this,this.lineWidth,this.dpr);return function(t,e,n,i){return Yi(t,e,!0,n,i)}(this.path.commandList,n,sa.x,sa.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,n){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,n,i){this.path.rect(t,e,n,i)}strokeText(t,e,n){}drawImage(){}setCommonStyle(t,e,n,i,r){}_setCommonStyle(t,e,n,i){}setStrokeStyle(t,e,n,i,r){}_setStrokeStyle(t,e,n,i){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(ra,t,e)}setClearMatrix(t,e,n,i,r,s){this._clearMatrix.setValue(t,e,n,i,r,s)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>ta.free(t))),this.stack.length=0}};aa=na([K(),ia("design:paramtypes",[Object,Number])],aa);const oa=new Ae,la=new Te;new Ae;const ca=["lineWidth","scaleX","scaleY","angle","anchor","visible"],ua=["x","y"],ha=["scaleX","scaleY"],da=["angle"],fa=new he,pa={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class ga extends rr{static mixin(t){const e=Object.keys(t);for(let n=0;n<e.length;++n){const i=e[n];Object.defineProperty(ga.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(t={}){var e;super(),this._AABBBounds=new Ae,this._updateTag=ze.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}getGraphicService(){var t,e;return null!==(e=null===(t=this.stage)||void 0===t?void 0:t.graphicService)&&void 0!==e?e:xt.graphicService}getAttributes(){return this.attribute}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var n,i;const{dx:r=t.dx,dy:s=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;fa.x=r+(null!==(n=t.scrollX)&&void 0!==n?n:0),fa.y=s+(null!==(i=t.scrollY)&&void 0!==i?i:0)}else fa.x=r,fa.y=s;return fa}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new we),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let n=this.clipPathMap.get(e)||null;return n||(this.clipPathMap.size>10&&this.clipPathMap.clear(),n=this.parsePath(e),n&&this.clipPathMap.set(e,n)),n}parsePath(t){if(!t)return null;let e=xs[t];if(e)return e;if(e=ga.userSymbolMap[t],e)return e;if(!0===((n=t=_s[t]||t).startsWith("<svg")||n.startsWith("<?xml"))){const e=new Es,{svg:n}=e.parse(t);if(!n)return null;const i=Et(n.path)?n.path:[n.path];oa.clear();const r=[];i.forEach((t=>{const e=(new Rn).fromString(t.d),n={};Ys.forEach((e=>{t[e]&&(n[Xs[e]]=t[e])})),r.push({path:e,attribute:n}),oa.union(e.bounds)}));const s=oa.width(),a=oa.height(),o=1/se(s,a);r.forEach((t=>t.path.transform(0,0,o,o)));const l=new vs(t,r,!0);return ga.userSymbolMap[t]=l,l}var n;const i=(new Rn).fromString(t),r=i.bounds.width(),s=i.bounds.height(),a=1/se(r,s);i.transform(0,0,a,a);const o=new vs(t,i);return ga.userSymbolMap[t]=o,o}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const n=this.attribute,i=this.updateAABBBounds(n,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=n,s=dr(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const n=new ke(t);return Ye(e.commandList,n,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new Te),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&ze.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&ze.UPDATE_BOUNDS)&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&ze.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&ze.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&ze.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const n=this.attribute;return Number.isFinite((null!==(t=n.x)&&void 0!==t?t:0)+(null!==(e=n.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&ze.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=ze.CLEAR_SHAPE}containsPoint(t,e,n,i){if(!i)return!1;if(n===We.GLOBAL){const n=new he(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),t=n.x,e=n.y}return i.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributesAndPreventAnimate(t,e=!1,n,i){this.setAttributes(t,e,n),this.animates&&this.animates.forEach((e=>{(e.priority!==1/0||i)&&Object.keys(t).forEach((t=>{e.preventAttr(t)}))}))}setAttributes(t,e=!1,n){t&&((t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,n))}_setAttributes(t,e=!1,n){const i=Object.keys(t);for(let e=0;e<i.length;e++){const n=i[e];this.attribute[n]=t[n]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)}setAttribute(t,e,n,i){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);s?this._setAttributes(s,n,i):Tt(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t,e=ca){for(let n=0;n<e.length;n++){const i=e[n];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t,e=ca){for(let n=0;n<e.length;n++)if(t===e[n])return!0;return!1}initAttributes(t){const e={type:Fe.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=ze.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var n,i;if(0===t&&0===e)return this;const r={type:Fe.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ua,r);s&&(t=s.x,e=s.y,delete s.x,delete s.y,this._setAttributes(s));const a=this.attribute,o=a.postMatrix;return o?xt.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(n=a.x)&&void 0!==n?n:Dn.x)+t,a.y=(null!==(i=a.y)&&void 0!==i?i:Dn.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}translateTo(t,e){const n=this.attribute;if(n.x===t&&n.y===e)return this;const i={type:Fe.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ua,i);return r?(this._setAttributes(r,!1,i),this):(n.x=t,n.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}scale(t,e,n){var i,r;if(1===t&&1===e)return this;const s={type:Fe.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,ha,s);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(n){let{postMatrix:i}=this.attribute;i||(i=new Te,o.postMatrix=i),xt.transformUtil.fromMatrix(i,i).scale(t,e,n)}else o.scaleX=(null!==(i=o.scaleX)&&void 0!==i?i:Dn.scaleX)*t,o.scaleY=(null!==(r=o.scaleY)&&void 0!==r?r:Dn.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}scaleTo(t,e){const n=this.attribute;if(n.scaleX===t&&n.scaleY===e)return this;const i={type:Fe.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,ha,i);return r?(this._setAttributes(r,!1,i),this):(n.scaleX=t,n.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}rotate(t,e){var n;if(0===t)return this;const i={type:Fe.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,da,i);r&&(delete r.angle,this._setAttributes(r,!1,i));const s=this.attribute;if(e){let{postMatrix:n}=this.attribute;n||(n=new Te,s.postMatrix=n),xt.transformUtil.fromMatrix(n,n).rotate(t,e)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:Dn.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const n={type:Fe.ROTATE_TO},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,da,n);return i?(this._setAttributes(i,!1,n),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}onAttributeUpdate(t){t&&t.skipUpdateCallback||(this.getGraphicService().onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!Tt(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,n,i){var r,s;if(n){const e=Object.keys(t),n=this.getNoWorkAnimateAttr(),a={};let o;e.forEach((e=>{n[e]?(o||(o={}),o[e]=t[e]):a[e]=i&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const l=null!==(s=null!==(r=this.context&&this.context.stateAnimateConfig)&&void 0!==r?r:this.stateAnimateConfig)&&void 0!==s?s:Ks;this.applyAnimationState(["state"],[{name:"state",animation:{type:"state",to:a,duration:l.duration,easing:l.easing}}]),o&&this.setAttributesAndPreventAnimate(o,!1,{type:Fe.STATE})}else this.stopStateAnimates(),this.setAttributesAndPreventAnimate(t,!1,{type:Fe.STATE}),this.finalAttribute&&Object.assign(this.finalAttribute,t);this._emitCustomEvent("afterStateUpdate",{type:Fe.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(t="end"){this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){var e,n;const i=this.attribute[t];return this.animates?null===(e=this.finalAttribute)||void 0===e?void 0:e[t]:null!=i?i:null===(n=this.finalAttribute)||void 0===n?void 0:n[t]}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const n=Et(t)?e=>!t.includes(e):e=>e!==t,i=this.currentStates.filter(n);i.length!==this.currentStates.length&&this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const n=this.currentStates?this.currentStates.slice():[];n.push(t),this.useStates(n,e)}}addState(t,e,n){var i;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(i=this.currentStates)||void 0===i?void 0:i.length)?this.currentStates.concat([t]):[t];this.useStates(r,n)}useStates(t,e){var n;if(!t.length)return void this.clearStates(e);if((null===(n=this.currentStates)||void 0===n?void 0:n.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const i={};t.forEach((e=>{var n;const r=this.stateProxy?this.stateProxy(e,t):null===(n=this.states)||void 0===n?void 0:n[e];r&&Object.assign(i,r)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}addUpdateBoundTag(){this._updateTag|=ze.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=ze.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=ze.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&ze.UPDATE_SHAPE_AND_BOUNDS)===ze.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=ze.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=ze.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=ze.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=ze.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=ze.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=ze.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=ze.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&ze.UPDATE_LAYOUT)}getAnchor(t,e,n){const i=[0,0],r=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,n&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,n=r();i[0]=n.x1+(n.x2-n.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,n=r();i[1]=n.y1+(n.y2-n.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=Dn.x,y:e=Dn.y,scaleX:n=Dn.scaleX,scaleY:i=Dn.scaleY,angle:r=Dn.angle,scaleCenter:s,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const c={};if(a&&r&&(l=this.getAnchor(a,c)),!s||1===n&&1===i)!function(t,e,n,i,r,s,a,o){const l=e.a,c=e.b,u=e.c,h=e.d,d=e.e,f=e.f,p=re(a),g=oe(a);let m,b;o?(m=o[0],b=o[1]):(m=n,b=i);const y=m-n,v=b-i,x=l*p+u*g,_=c*p+h*g,S=u*p-l*g,A=h*p-c*g;t.a=r*x,t.b=r*_,t.c=s*S,t.d=s*A,t.e=d+l*m+u*b-x*y-S*v,t.f=f+c*m+h*b-_*y-A*v}(this._transMatrix,this._transMatrix.reset(),t,e,n,i,r,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(r),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(s,c,!0),xt.transformUtil.fromMatrix(a,a).scale(n,i,{x:l[0],y:l[1]})}const u=this.getOffsetXY(Dn);if(this._transMatrix.e+=u.x,this._transMatrix.f+=u.y,o){const t=la.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.timeline.isGlobal&&(t.setTimeline(e),e.addAnimate(t))}))}this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Fe.ANIMATE_END})}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:xt.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return Pt(t,!0)?this.pathProxy=(new Rn).fromString(t):this.pathProxy=new Rn,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const n=t;this.resources||(this.resources=new Map);const i={data:"init",state:null};this.resources.set(n,i),"string"==typeof t?(i.state="loading",t.startsWith("<svg")?(lr.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(It(t)||t.includes("/")||Nt(t))&&(lr.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):Bt(t)?(i.state="success",i.data=t,this.backgroundImg=this.backgroundImg||e):i.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,n){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="success",i.data=e,n&&n(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),xt.graphicService.onRelease(this)}_emitCustomEvent(t,e){var n,i;if(this._events&&t in this._events){const r=new ar(t,e);r.bubbles=!1,r.manager=null===(i=null===(n=this.stage)||void 0===n?void 0:n.eventSystem)||void 0===i?void 0:i.manager,this.dispatchEvent(r)}}toCustomPath(){var t,e,n;const i=null===(n=null===(e=(null===(t=this.stage)||void 0===t?void 0:t.renderService)||xt.renderService)||void 0===e?void 0:e.drawContribution)||void 0===n?void 0:n.getRenderContribution(this);if(i){const t=new aa(null,1);return i.drawShape(this,t,0,0,{},{}),t.path}return null}}var ma;ga.userSymbolMap={},ga.mixin(or),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(ma||(ma={}));let ba=class t extends ga{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Ws,this._childUpdateTag=ze.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new tr),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new tr)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,n){if(n===We.GLOBAL){const n=new he(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),this.AABBBounds.contains(n.x,n.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&ze.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=Dn.x,y:e=Dn.y,dx:n=Dn.dx,dy:i=Dn.dy,scaleX:r=Dn.scaleX,scaleY:s=Dn.scaleY,angle:a=Dn.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==n||0!==i||1!==r||1!==s||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return nr(this).group}updateAABBBounds(t,e,n){const i=n;n=n.clone();const{width:r,height:s,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{n.union(t.AABBBounds)})):null!=r&&null!=s&&n.set(0,0,Math.max(0,r),Math.max(0,s)),!o){this.forEachChildren((t=>{n.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:i=0}=t;n.translate(e,i)}return xt.graphicService.updateTempAABBBounds(n),xt.graphicService.transformAABBBounds(t,n,e,!1,this),i.copy(n),i}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=ze.CLEAR_BOUNDS,this._childUpdateTag&=ze.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=ze.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&ze.UPDATE_BOUNDS||(this._childUpdateTag|=ze.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),this.getGraphicService().onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),this.getGraphicService().onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){const n=super.appendChild(t);return e&&this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return this.getGraphicService().onRemove(t),t.stage=null,this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren((e=>{this.getGraphicService().onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&ze.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,n){let i=this._getChildByName(t);return i?i.setAttributes(e):(i=xt.graphicService.creator[n](e),i.name=t,this.add(i)),i}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}};function ya(t){return new ba(t)}function va(t,e){return!(!t&&!e)}function xa(t,e){let n;return n=Et(t)?t.some((t=>t||void 0===t)):!!t,n&&e>0}function _a(t,e,n){return n&&t*e>0}function Sa(t,e){return t*e>0}ba.NOWORK_ANIMATE_ATTR=pa;const Aa=Symbol.for("ImageRenderContribution"),wa=Symbol.for("RectRenderContribution"),Ta=Symbol.for("SymbolRenderContribution"),Ca=Symbol.for("TextRenderContribution"),Ba=Symbol.for("InteractiveSubRenderContribution");function ka(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Ma(t,e,n,i=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?i-e:t&&"alphabetic"!==t?0:(n||(n=e),-(e-n)/2-.79*n)}var Pa=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Ea=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Oa=function(t,e){return function(n,i){e(n,i,t)}};function La(t,e,n){var i;const{x:r=n.x,y:s=n.y,z:a=n.z,dx:o=n.dx,dy:l=n.dy,dz:c=n.dz,scaleX:u=n.scaleX,scaleY:h=n.scaleY,scaleZ:d=n.scaleZ,alpha:f=n.alpha,beta:p=n.beta,angle:g=n.angle,anchor3d:m=e.attribute.anchor,anchor:b}=e.attribute,y=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,n=e.AABBBounds;y[0]=n.x1+(n.x2-n.x1)*t}else y[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,n=e.AABBBounds;y[1]=n.x1+(n.x2-n.x1)*t}else y[1]=m[1];y[2]=null!==(i=m[2])&&void 0!==i?i:0}if(qs(t),Qs(t,t,[r+o,s+l,a+c]),Qs(t,t,[y[0],y[1],y[2]]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+c*i,t[5]=a*r+u*i,t[6]=o*r+h*i,t[7]=l*r+d*i,t[8]=c*r-s*i,t[9]=u*r-a*i,t[10]=h*r-o*i,t[11]=d*r-l*i}(t,t,p),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],a=e[1],o=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-c*i,t[1]=a*r-u*i,t[2]=o*r-h*i,t[3]=l*r-d*i,t[8]=s*i+c*r,t[9]=a*i+u*r,t[10]=o*i+h*r,t[11]=l*i+d*r}(t,t,f),Qs(t,t,[-y[0],-y[1],y[2]]),function(t,e,n){const i=n[0],r=n[1],s=n[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[u,h,d]),g){const n=ea.allocate(),i=[0,0];if(b){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,n=e.AABBBounds;i[0]=n.x1+(n.x2-n.x1)*t}else i[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,n=e.AABBBounds;i[1]=n.x1+(n.x2-n.x1)*t}else i[1]=m[1]}Qs(n,n,[i[0],i[1],0]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],a=e[1],o=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+c*i,t[1]=a*r+u*i,t[2]=o*r+h*i,t[3]=l*r+d*i,t[4]=c*r-s*i,t[5]=u*r-a*i,t[6]=h*r-o*i,t[7]=d*r-l*i}(n,n,g),Qs(n,n,[-i[0],-i[1],0]),Zs(t,t,n)}}let Ra=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new mt(["graphic"]),onSetStage:new mt(["graphic","stage"]),onRemove:new mt(["graphic"]),onRelease:new mt(["graphic"]),onAddIncremental:new mt(["graphic","group","stage"]),onClearIncremental:new mt(["graphic","group","stage"]),beforeUpdateAABBBounds:new mt(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new mt(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new mt(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new Ae,this.tempAABBBounds2=new Ae}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,n){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,n)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,n,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,n,i)}afterUpdateAABBBounds(t,e,n,i,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,n,i,r)}clearAABBBounds(t,e,n){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,n)}updatePathProxyAABBBounds(t,e){const n="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!n)return!1;const i=new ke(t);return Ye(n.commandList,i,0,0),!0}updateHTMLTextAABBBounds(t,e,n,i){const{textAlign:r,textBaseline:s}=t;if(null!=t.forceBoundsHeight){const e=Lt(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),i=Ma(s,e,e);n.set(n.x1,i,n.x2,i+e)}if(null!=t.forceBoundsWidth){const e=Lt(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),i=ka(r,e);n.set(i,n.y1,i+e,n.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const n=e.shadowRoot.AABBBounds;t.union(n)}}transformAABBBounds(t,e,n,i,r){if(!e.empty()){const{scaleX:r=n.scaleX,scaleY:s=n.scaleY,stroke:a=n.stroke,shadowBlur:o=n.shadowBlur,lineWidth:l=n.lineWidth,pickStrokeBuffer:c=n.pickStrokeBuffer,strokeBoundsBuffer:u=n.strokeBoundsBuffer}=t,h=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){Os(h,(l+c)/Math.abs(r+s),i,u),e.union(h),h.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:i=n.shadowOffsetX,shadowOffsetY:a=n.shadowOffsetY}=t;Os(h,o/Math.abs(r+s)*2,!1,u+1),h.translate(i,a),e.union(h)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let s=!0;const a=r.transMatrix;r&&r.isContainer&&(s=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),s&&_e(e,e,a)}validCheck(t,e,n,i){if(!i)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(i.shadowRoot||i.isContainer)return!0;const{visible:r=e.visible}=t;return!(!i.valid||!r)||(n.empty()||(i.parent&&n.transformWithMatrix(i.parent.globalTransMatrix),this.clearAABBBounds(i,i.stage,n),n.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,n=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),n.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:n}}};Ra=Pa([K(),Oa(0,X($s)),Ea("design:paramtypes",[Object])],Ra);const Ia=(t,e,n)=>{const{outerBorder:i,shadowBlur:r=e.shadowBlur}=t;if(i){const t=e.outerBorder,{distance:s=t.distance,lineWidth:a=t.lineWidth}=i;n.expand(s+(r+a)/2)}return n};class Na{constructor(t,e,n){this.fontFamily=t,this.textOptions=e,this.textMeasure=n}LayoutBBox(t,e,n,i){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===n)t.yOffset=0;else if("middle"===n)t.yOffset=t.height/-2;else if("alphabetic"===n){let e=.79;if(1===i.length){const t=i[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,n,i,r="",s,a){const{lineWidth:o,suffixPosition:l="end",measureMode:c=_t.actualBounding,keepCenterInLine:u=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const h=[],d=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let n=0,i=t.length;n<i;n++){const i=this.textMeasure.measureTextPixelADscentAndWidth(t[n],this.textOptions,c);let a=t[n].toString();if(i.width>o){const i=this.textMeasure.clipTextWithSuffix(t[n],this.textOptions,o,r,s,l);a=i.str,e=i.width}else e=i.width;h.push({str:a,width:e,ascent:i.ascent,descent:i.descent,keepCenterInLine:u})}d[0]=o}else{let e,n,i=0;for(let r=0,s=t.length;r<s;r++){n=t[r];const s=this.textMeasure.measureTextPixelADscentAndWidth(t[r],this.textOptions,c);e=s.width,i=Math.max(i,e),h.push({str:n,width:e,ascent:s.ascent,descent:s.descent,keepCenterInLine:u})}d[0]=i}d[1]=h.length*i,d[0]=h.reduce(((t,e)=>Math.max(t,e.width)),0);const f={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(f,e,n,h),this.layoutWithBBox(f,h,e,n,i)}layoutWithBBox(t,e,n,i,r){const s=[0,0],a=e.length*r;"top"===i||("middle"===i?s[1]=(t.height-a)/2:"bottom"===i&&(s[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],n,i,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:n,textBaseline:i}}lineOffset(t,e,n,i,r,s){if("left"===n||"start"===n?e.leftOffset=0:"center"===n?e.leftOffset=(t.width-e.width)/2:"right"!==n&&"end"!==n||(e.leftOffset=t.width-e.width),e.topOffset=r/2+(e.ascent-e.descent)/2+s[1],!e.keepCenterInLine){const t=0,n=e.ascent+e.descent+t;if(n<r-t&&("bottom"===i?e.topOffset+=(r-n)/2:"top"===i&&(e.topOffset-=(r-n)/2)),"alphabetic"===i){const t=r/(e.ascent+e.descent);e.topOffset=r/2+(e.ascent-e.descent)/2*t+s[1]}}return s[1]+=r,e}}const Da=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...ca];let Ua=class t extends ga{get font(){const t=this.getGraphicTheme();return this._font||(this._font=function(t,e={},n){n||(n=1);const{fontStyle:i=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(i?i+" ":"")+(r?r+" ":"")+(s?s+" ":"")+a*n+"px "+(o||"sans-serif")}(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,n=this.getGraphicTheme(),i=this.getMaxWidth(n);return Number.isFinite(i)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:n.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const n=this.getGraphicTheme(),i=this.attribute,r=this.getMaxWidth(n);if(!Number.isFinite(r))return!1;const{text:s}=this.attribute;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(s)?s.join(""):s).toString()!==t}return"vertical"===i.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==i.text.toString():null!=this.clipedText&&this.clipedText!==i.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=Vs,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return Et(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return nr(this).text}doUpdateOBBBounds(){const e=this.getGraphicTheme();this._OBBBounds.clear();const n=this.attribute,{angle:i=e.angle}=n;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new t({})),this.obbText.setAttributes(Object.assign(Object.assign({},n),{angle:0}));const r=this.obbText.AABBBounds,{x:s,y:a}=n,o={x:(r.x1+r.x2)/2,y:(r.y1+r.y2)/2},l=be(o,i,{x:s,y:a});return this._OBBBounds.copy(r),this._OBBBounds.translate(l.x-o.x,l.y-o.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,n){const{text:i=e.text}=this.attribute;Array.isArray(i)?this.updateMultilineAABBBounds(i):this.updateSingallineAABBBounds(i);const{tb1:r}=xt.graphicService.updateTempAABBBounds(n),{scaleX:s=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){Os(r,o/Math.abs(s+a),!0,l),n.union(r)}return xt.graphicService.combindShadowAABBBounds(n,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||xt.graphicService.updateHTMLTextAABBBounds(t,e,n),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,_e(n,n,this.transMatrix),n}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:n=e.direction,underlineOffset:i=e.underlineOffset}=this.attribute,r="horizontal"===n?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===n&&i&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+i),r}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e,n;const i=this.getGraphicTheme(),r=this.attribute,{fontFamily:s=i.fontFamily,textAlign:a=i.textAlign,textBaseline:o=i.textBaseline,fontSize:l=i.fontSize,fontWeight:c=i.fontWeight,ellipsis:u=i.ellipsis,maxLineWidth:h,stroke:d=i.stroke,wrap:f=i.wrap,measureMode:p=i.measureMode,lineWidth:g=i.lineWidth,whiteSpace:m=i.whiteSpace,suffixPosition:b=i.suffixPosition,ignoreBuf:y=i.ignoreBuf,keepCenterInLine:v=i.keepCenterInLine}=r,x=y?0:this.guessLineHeightBuf(l),_=this.getLineHeight(r,i,x);if("normal"===m||f)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(g/2),this._AABBBounds}const S=xt.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null===(n=this.stage)||void 0===n?void 0:n.textMeasureId)),A=new Na(s,{fontSize:l,fontWeight:c,fontFamily:s,lineHeight:_},S).GetLayoutByLines(t,a,o,_,!0===u?i.ellipsis:u||void 0,!1,{lineWidth:h,suffixPosition:b,measureMode:p,keepCenterInLine:v}),{bbox:w}=A;return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(w.xOffset,w.yOffset,w.xOffset+w.width,w.yOffset+w.height),d&&this._AABBBounds.expand(g/2),this._AABBBounds}updateWrapAABBBounds(t){var e,n,i,r;const s=this.getGraphicTheme(),{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:l=s.textBaseline,fontSize:c=s.fontSize,ellipsis:u=s.ellipsis,maxLineWidth:h,stroke:d=s.stroke,lineWidth:f=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:g=s.fontWeight,ignoreBuf:m=s.ignoreBuf,measureMode:b=s.measureMode,suffixPosition:y=s.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:_=s.keepCenterInLine}=this.attribute,S=m?0:this.guessLineHeightBuf(c),A=this.getLineHeight(this.attribute,s,S);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}const w=xt.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null===(n=this.stage)||void 0===n?void 0:n.textMeasureId)),T={fontSize:c,fontWeight:g,fontFamily:a,lineHeight:A},C=new Na(a,T,w),B=Et(t)?t.map((t=>t.toString())):[t.toString()],k=[],M=[0,0];let P=1/0;if(v>0&&(P=Math.max(Math.floor(v/A),1)),x&&(P=Math.min(P,x)),"number"==typeof h&&h!==1/0){if(h>0)for(let t=0;t<B.length;t++){const e=B[t];let n=!0;if(t===P-1){const n=w.clipTextWithSuffix(e,T,h,u,!1,y,t!==B.length-1),i=w.measureTextPixelADscentAndWidth(n.str,T,b);k.push({str:n.str,width:n.width,ascent:i.ascent,descent:i.descent,keepCenterInLine:_});break}const s=w.clipText(e,T,h,"break-all"!==p,"keep-all"===p);if(""!==e&&""===s.str||s.wordBreaked){if(u){const t=w.clipTextWithSuffix(e,T,h,u,!1,y);s.str=null!==(i=t.str)&&void 0!==i?i:"",s.width=null!==(r=t.width)&&void 0!==r?r:0}else s.str="",s.width=0;n=!1}const a=w.measureTextPixelADscentAndWidth(s.str,T,b);k.push({str:s.str,width:s.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:_});let o=s.str.length;if(!s.wordBreaked||""!==e&&""===s.str||(n=!0,o=s.wordBreaked),s.str.length===e.length);else if(n){let n=e.substring(o);"keep-all"===p&&(n=n.replace(/^\s+/g,"")),B.splice(t+1,0,n)}}let t=0;k.forEach((e=>{t=Math.max(t,e.width)})),M[0]=t}else{let t,e,n=0;for(let i=0,r=B.length;i<r;i++){if(i===P-1){const t=w.clipTextWithSuffix(B[i],T,h,u,!1,y),e=w.measureTextPixelADscentAndWidth(t.str,T,b);k.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),n=Math.max(n,t.width);break}e=B[i],t=w.measureTextWidth(e,T),n=Math.max(n,t);const r=w.measureTextPixelADscentAndWidth(e,T,b);k.push({str:e,width:t,ascent:r.ascent,descent:r.descent,keepCenterInLine:_})}M[0]=n}M[1]=k.length*A;const E={xOffset:0,yOffset:0,width:M[0],height:M[1]};C.LayoutBBox(E,o,l,k);const O=C.layoutWithBBox(E,k,o,l,A);return this.cache.layoutData=O,this.clearUpdateShapeTag(),this._AABBBounds.set(E.xOffset,E.yOffset,E.xOffset+E.width,E.yOffset+E.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var n,i,r;const s=this.getGraphicTheme(),a=xt.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null===(n=this.stage)||void 0===n?void 0:n.textMeasureId));let o;const l=this.attribute,{maxLineWidth:c=s.maxLineWidth,ellipsis:u=s.ellipsis,fontFamily:h=s.fontFamily,fontSize:d=s.fontSize,fontWeight:f=s.fontWeight,stroke:p=s.stroke,lineWidth:g=s.lineWidth,verticalMode:m=s.verticalMode,suffixPosition:b=s.suffixPosition}=l,y=this.getLineHeight(l,s,0);let{textAlign:v=s.textAlign,textBaseline:x=s.textBaseline}=l;if(!m){const e=v;v=null!==(i=t.baselineMapAlign[x])&&void 0!==i?i:"left",x=null!==(r=t.alignMapBaseline[e])&&void 0!==r?r:"top"}if(o=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);o=se(e,o)}));const t=ka(v,o),e=this.cache.verticalList.length*y,n=Ma(x,e,d);return this._AABBBounds.set(n,t,n+e,t+o),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const _=e.map((t=>function(t){const e=[];let n=0,i="";for(let r=0;r<t.length;r++)Us(t[r])?n?i+=t[r]:(n=1,i=t[r]):(n&&(e.push({text:i,direction:Is.VERTICAL}),i="",n=0),e.push({text:t[r],direction:Is.HORIZONTAL}));return i&&e.push({text:i,direction:Is.VERTICAL}),e}(t.toString())));_.forEach(((t,e)=>{if(Number.isFinite(c))if(u){const n=!0===u?s.ellipsis:u,i=a.clipTextWithSuffixVertical(t,{fontSize:d,fontWeight:f,fontFamily:h},c,n,!1,b);_[e]=i.verticalList,o=i.width}else{const n=a.clipTextVertical(t,{fontSize:d,fontWeight:f,fontFamily:h},c,!1);_[e]=n.verticalList,o=n.width}else o=0,t.forEach((t=>{const e=t.direction===Is.HORIZONTAL?d:a.measureTextWidth(t.text,{fontSize:d,fontWeight:f,fontFamily:h});o+=e,t.width=e}))})),this.cache.verticalList=_,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);o=se(e,o)}));const S=ka(v,o),A=this.cache.verticalList.length*y,w=Ma(x,A,d);return this._AABBBounds.set(w,S,w+A,S+o),p&&this._AABBBounds.expand(g/2),this._AABBBounds}getMaxWidth(t){var e,n;const i=this.attribute;return null!==(n=null!==(e=i.maxLineWidth)&&void 0!==e?e:i.maxWidth)&&void 0!==n?n:t.maxWidth}getLineHeight(t,e,n){var i;return null!==(i=mr(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==i?i:(t.fontSize||e.fontSize)+n}needUpdateTags(t,e=Da){return super.needUpdateTags(t,e)}needUpdateTag(t,e=Da){return super.needUpdateTag(t,e)}_interpolate(t,e,n,i,r){"text"===t&&(r.text=i)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return t.baselineMapAlign}getAlignMapBaseline(){return t.alignMapBaseline}};function za(t){return new Ua(t)}Ua.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},pa),Ua.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Ua.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const Wa=["heightLimit","lineClamp"];class Fa extends Ua{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return Et(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,n,i,r,s;const a=this.getGraphicTheme(),{fontFamily:o=a.fontFamily,textAlign:l=a.textAlign,textBaseline:c=a.textBaseline,fontSize:u=a.fontSize,ellipsis:h=a.ellipsis,maxLineWidth:d,stroke:f=a.stroke,lineWidth:p=a.lineWidth,wordBreak:g=a.wordBreak,fontWeight:m=a.fontWeight,ignoreBuf:b=a.ignoreBuf,heightLimit:y=0,suffixPosition:v=a.suffixPosition,lineClamp:x}=this.attribute,_=null!==(e=mr(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,S=b?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),f&&this._AABBBounds.expand(p/2),this._AABBBounds}const A=xt.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null===(i=this.stage)||void 0===i?void 0:i.textMeasureId)),w=new Na(o,{fontSize:u,fontWeight:m,fontFamily:o},A),T=t.map((t=>t.toString())),C=[],B=[0,0];let k=1/0;if(y>0&&(k=Math.max(Math.floor(y/_),1)),x&&(k=Math.min(k,x)),"number"==typeof d&&d!==1/0){if(d>0)for(let t=0;t<T.length;t++){const e=T[t];let n=!0;if(t===k-1){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,d,h,!1,v);C.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1});break}const i=w.textMeasure.clipText(e,w.textOptions,d,"break-word"===g);if(""!==e&&""===i.str){if(h){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,d,h,!1,v);i.str=null!==(r=t.str)&&void 0!==r?r:"",i.width=null!==(s=t.width)&&void 0!==s?s:0}else i.str="",i.width=0;n=!1}if(C.push({str:i.str,width:i.width,ascent:0,descent:0,keepCenterInLine:!1}),i.str.length===e.length);else if(n){const n=e.substring(i.str.length);T.splice(t+1,0,n)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),B[0]=t}else{let t,e,n=0;for(let i=0,r=T.length;i<r;i++){if(i===k-1){const t=w.textMeasure.clipTextWithSuffix(T[i],w.textOptions,d,h,!1,v);C.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1}),n=Math.max(n,t.width);break}e=T[i],t=w.textMeasure.measureTextWidth(e,w.textOptions,"break-word"===g),n=Math.max(n,t),C.push({str:e,width:t,ascent:0,descent:0,keepCenterInLine:!1})}B[0]=n}B[1]=C.length*(_+S);const M={xOffset:0,yOffset:0,width:B[0],height:B[1]};w.LayoutBBox(M,l,c);const P=w.layoutWithBBox(M,C,l,c,_);return this.cache.layoutData=P,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),f&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<Wa.length;e++){const n=Wa[e];if(-1!==t.indexOf(n))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<Wa.length;e++)if(t===Wa[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return Fa.NOWORK_ANIMATE_ATTR}}function ja(t){return new Fa(t)}const Ha=["symbolType","size",...ca];let Ga=class t extends ga{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=Gs}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(t=0,e=0,n=1){let i=null;try{i=new Path2D}catch(t){return null}const r=this.getParsedPath();if(!r)return null;r.draw(i,n,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return Et(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return nr(this).symbol}updateAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n)||(i?this.updateSymbolAABBBoundsImprecise(t,e,n):this.updateSymbolAABBBoundsAccurate(t,e,n));const{tb1:r,tb2:s}=xt.graphicService.updateTempAABBBounds(n);((t,e,n)=>{const{outerBorder:i,shadowBlur:r=e.shadowBlur,strokeBoundsBuffer:s=e.strokeBoundsBuffer}=t;if(i){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=i;Os(n,a+(r+o)/2,!0,s)}})(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,this.x1WithoutTransform=n.x1,this.y1WithoutTransform=n.y1;const{lineJoin:a=e.lineJoin}=t;return xt.graphicService.transformAABBBounds(t,n,e,"miter"===a,this),n}updateSymbolAABBBoundsImprecise(t,e,n){const{size:i=e.size}=t;if(Et(i))n.set(-i[0]/2,-i[1]/2,i[0]/2,i[1]/2);else{const t=i/2;n.set(-t,-t,t,t)}return n}updateSymbolAABBBoundsAccurate(t,e,n){const{size:i=e.size}=t;return this.getParsedPath().bounds(i,n),n}needUpdateTags(t){return super.needUpdateTags(t,Ha)}needUpdateTag(t){return super.needUpdateTag(t,Ha)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=Et(e)?e:[e,e];return t.path?(new Rn).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new Rn).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Va(t){return new Ga(t)}Ga.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},pa);const $a=["width","x1","y1","height","cornerRadius",...ca];let Xa=class t extends ga{constructor(t){super(t),this.type="rect",this.numberType=js}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return nr(this).rect}updateAABBBounds(t,e,n){if(!this.updatePathProxyAABBBounds(n)){let{width:e,height:i}=t;const{x1:r,y1:s,x:a,y:o}=t;e=null!=e?e:r-a,i=null!=i?i:s-o,(isFinite(e)||isFinite(i)||isFinite(a)||isFinite(o))&&n.set(0,0,e||0,i||0)}const{tb1:i,tb2:r}=xt.graphicService.updateTempAABBBounds(n);return Ia(t,e,i),n.union(i),i.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,xt.graphicService.transformAABBBounds(t,n,e,!1,this),n}needUpdateTags(t){return super.needUpdateTags(t,$a)}needUpdateTag(t){return super.needUpdateTag(t,$a)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute,{x:n,y:i,width:r,height:s}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=Tt(t.width)?t.x1-t.x:t.width,n=Tt(t.height)?t.y1-t.y:t.height,i=0,r=0;return e<0?(i=e,e=-e):Number.isNaN(e)&&(e=0),n<0?(r=n,n=-n):Number.isNaN(n)&&(n=0),{x:i,y:r,width:e,height:n}})(e);return t=new Rn,t.moveTo(n,i),t.rect(n,i,r,s),t}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Ya(t){return new Xa(t)}Xa.NOWORK_ANIMATE_ATTR=pa;class Ka{constructor(t,e,n,i,r,s,a,o,l,c,u,h,d,f){this.left=t,this.top=e,this.width=n,this.height=i,this.actualHeight=0,this.bottom=e+i,this.right=t+n,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=c,this.directionKey=ci[this.layoutDirection],this.isWidthMax=u,this.isHeightMax=h,this.singleLine=d,f?(f.clear(),this.icons=f):this.icons=new Map}draw(t,e){const{width:n,height:i}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,n):this.width||n||0;let s=this.isHeightMax?Math.min(this.height,i):this.height||i||0;s=Math.min(s,i);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-s/2;break;case"bottom":a=-s}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-r:"center"===this.globalAlign&&(o=-r/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let c=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n];if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return c;let s=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(s=!0,c=!0),this.lines[n].draw(t,s,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e)}else{const n=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=n:a+=n;for(let n=0;n<this.lines.length;n++)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n],s=l-this.lines[n].top-this.lines[n].height;if(0===l)this.lines[n].draw(t,!1,o,s+a,this.ellipsis,e);else{if(s+r>this[this.directionKey.top]+l||s<this[this.directionKey.top])return c;{let i=!1;this.ellipsis&&this.lines[n+1]&&s-this.lines[n+1].height<this[this.directionKey.top]&&(i=!0,c=!0),this.lines[n].draw(t,i,o,s+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let n=0;n<this.lines.length;n++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[n].height+this.lines[n].top);const{top:i,height:r}=this.lines[n];if(0===l)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e);else{if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return c;{let i=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(i=!0,c=!0),this.lines[n].draw(t,i,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e)}}}}return c}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let n=0;n<this.lines.length;n++){const i=this.lines[n];i.actualWidth>t&&(t=i.actualWidth),e+=i.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:n,height:i}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[n].getWidthWithEllips(i);r>t&&(t=r),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else{Math.floor((r-this.actualHeight)/2);for(let n=0;n<this.lines.length;n++)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else if("bottom"===this.verticalDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n],a=r-this.lines[n].top-this.lines[n].height;if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(a+s>this[this.directionKey.top]+r||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[n+1]&&a-this.lines[n+1].height<this[this.directionKey.top]){const i=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[n].getWidthWithEllips(i);r>t&&(t=r),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[n].getWidthWithEllips(i);r>t&&(t=r),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function qa(t,e,n,i){const r=Math.round(t),s=Math.round(n),a=Math.round(e),o=Math.round(i);return{left:t>r?r:r-.5,top:n>s?s:s-.5,right:a>e?a:a+.5,bottom:o>i?o:o+.5}}class Qa{constructor(t,e,n,i){var r,s;this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic",this.ascentDescentMode=i;const a=mr(n.lineHeight,this.fontSize);this.lineHeight="number"==typeof a?a>this.fontSize?a:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:o,height:l,descent:c,width:u}=yi(t,n,this.ascentDescentMode);let h=0,d=0,f=0;this.height>l&&(h=(this.height-l)/2,d=Math.ceil(h),f=Math.floor(h)),"top"===this.textBaseline?(this.ascent=h,this.descent=l-h):"bottom"===this.textBaseline?(this.ascent=l-h,this.descent=h):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+d,this.descent=c+f),this.length=t.length,this.width=u||0,this.text=t||"",this.newLine=e||!1,this.character=n,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=n.space,this.dx=null!==(r=n.dx)&&void 0!==r?r:0,this.dy=null!==(s=n.dy)&&void 0!==s?s:0,"vertical"===n.direction&&(this.direction=n.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=yi(this.text,this.character,this.ascentDescentMode);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}drawBackground(t,e,n,i,r,s,a){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let o=e+n,l=this.text,c=this.left+i;o+=this.top;let u=this.direction;if(this.verticalEllipsis)l=this.ellipsisStr,u="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)l+=this.ellipsisStr,"right"!==s&&"end"!==s||(c-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=mi(l,("vertical"===u?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,l.length-1);if(l=l.slice(0,t),l+=this.ellipsisStr,"right"===s||"end"===s)if("vertical"===u);else{const{width:e}=yi(this.text.slice(t),this.character,this.ascentDescentMode);c-=this.ellipsisWidth-e}}}const h=qa(c,c+(this.widthOrigin||this.width),e,e+a);return Object.assign(Object.assign({},h),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,n,i,r,s,a){var o;let l=e+n,c=this.text,u=this.left+i+(null!==(o=this.space)&&void 0!==o?o:0)/2;l+=this.top;let h=this.direction;if(this.verticalEllipsis)c=this.ellipsisStr,h="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)c+=this.ellipsisStr,"right"!==s&&"end"!==s||(u-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=mi(c,("vertical"===h?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,c.length-1);if(c=c.slice(0,t),c+=this.ellipsisStr,"right"===s||"end"===s)if("vertical"===h);else{const{width:e}=yi(this.text.slice(t),this.character,this.ascentDescentMode);u-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":l-=this.ascent*(1/3);break;case"sub":l+=this.descent/2}"vertical"===h&&(t.save(),t.rotateAbout(Math.PI/2,u,l),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(u,l),u=0,l=0);const{lineWidth:d=1}=this.character;if(this.character.stroke&&d&&t.strokeText(c,u+this.dx,l+this.dy),this.character.fill&&t.fillText(c,u+this.dx,l+this.dy),this.character.fill)if(this.character.lineThrough||this.character.underline){if(this.character.underline){const e=1+l,n=qa(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}if(this.character.lineThrough){const e=1+l-this.ascent/2,n=qa(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l-this.ascent/2,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){const e=1+l,n=qa(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}else if("line-through"===this.character.textDecoration){const e=1+l-this.ascent/2,n=qa(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l-this.ascent/2,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}"vertical"===h&&t.restore()}getWidthWithEllips(t){let e=this.text;const n="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return n;if("add"===this.ellipsis)return n+this.ellipsisWidth;if("replace"===this.ellipsis){const t=mi(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:i}=yi(this.text.slice(t),this.character,this.ascentDescentMode);return n+this.ellipsisWidth-i}return n}}const Za=["width","height","image",...ca];let Ja=class t extends ga{constructor(t){super(t),this.type="image",this.numberType=Fs,this.loadImage(this.attribute.image)}getImageElement(){const{image:t}=this.attribute;if(!t||!this.resources)return null;const e=this.resources.get(t);return"success"!==e.state?null:e.data}get width(){return this.tryUpdateAABBBounds(),this._actualWidth}get height(){return this.tryUpdateAABBBounds(),this._actualHeight}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,n){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()})),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,n){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,n)}setAttribute(t,e,n,i){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,n,i)}getGraphicTheme(){return nr(this).image}updateAABBBounds(t,e,n){if(!this.updatePathProxyAABBBounds(n)){const{maxWidth:i=e.maxWidth,maxHeight:r=e.maxHeight}=t;let{width:s,height:a}=t;if(null==s||null==a){const t=this.getImageElement();if(t){const e=t.width,n=t.height;if(null!=s)a=s*(n/e);else if(null!=a)s=a*(e/n);else{const t=e/n;t>i/r?(s=i,a=i/t):(a=r,s=r*t)}}else s=i,a=r}this._actualWidth=s,this._actualHeight=a,n.set(0,0,s,a)}const{tb1:i,tb2:r}=xt.graphicService.updateTempAABBBounds(n);return Ia(t,e,i),n.union(i),i.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,xt.graphicService.transformAABBBounds(t,n,e,!1,this),n}getDefaultAttribute(t){return ii[t]}needUpdateTags(t){return super.needUpdateTags(t,Za)}needUpdateTag(t){return super.needUpdateTag(t,Za)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function to(t){return new Ja(t)}Ja.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},pa);class eo extends Ja{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=dr(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,n)=>{if(Et(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){const t=dr(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=ii.width,height:e=ii.height}=this.attribute,{backgroundWidth:n=t,backgroundHeight:i=e}=this.attribute,r=(n-t)/2,s=(i-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class no{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=ci[this.direction]}store(t){if(t instanceof eo){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,n=0;"top"===t.attribute.textBaseline?(e=0,n=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,n=0):(e=t.height/2,n=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,n)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,n=new class{constructor(t,e,n,i,r,s,a,o){this.left=t,this.width=e,this.baseline=n,this.ascent=i,this.descent=r,this.top=n-i,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof eo?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=ci[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof Qa){const e=pi.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const n=this.directionKey,i=this.height;let r=this.left,s=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof eo?(t["_"+n.x]=r,r+=t[n.width]+s,t["_"+n.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?i-t.height:(i-t.height)/2):(t[n.left]=r,r+=t[n.width]+s)}))}draw(t,e,n,i,r,s){if(r&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,n=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i.overflow)t=t&&""===i.text;else if(t){n=!0;break}}let i=0;if(!n)for(let t=this.paragraphs.length-1;t>=0;t--){const n=this.paragraphs[t];if(n.overflow){if(""===n.text)break;continue}if(n instanceof eo)break;if("vertical"===this.direction&&"vertical"!==n.direction){n.verticalEllipsis=!0;break}const s=!0===r?"...":r||"";n.ellipsisStr=s;const{width:a}=yi(s,n.character,n.ascentDescentMode),o=a||0;if(o<=this.blankWidth+i){e&&(n.ellipsis="add");break}if(o<=this.blankWidth+i+n.width){n.ellipsis="replace",n.ellipsisWidth=o,n.ellipsisOtherParagraphWidth=this.blankWidth+i;break}n.ellipsis="hide",i+=n.width}}let a="",o=-1,l=[];const c=[l];this.paragraphs.forEach(((e,r)=>{if(e instanceof eo)return;const s=e.drawBackground(t,i,this.ascent,n,0===r,this.textAlign,this.height);s&&(a===s.fillStyle&&o===s.globalAlpha||(l=[],c.push(l),a=s.fillStyle,o=s.globalAlpha),l.push(s))})),c.forEach((e=>{if(0===e.length)return;const n=e[0],i=e[e.length-1];t.fillStyle=n.fillStyle,t.globalAlpha=n.globalAlpha,t.fillRect(n.left,n.top,i.right-n.left,i.bottom-n.top)})),this.paragraphs.forEach(((e,r)=>{if(e instanceof eo)return e.setAttributes({x:n+e._x,y:i+e._y}),void s(e,t,n+e._x,i+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const n=e&&e.stroke||hi;if(!n)return void(t.globalAlpha=0);const{strokeOpacity:i=1,opacity:r=1}=e;t.globalAlpha=i*r,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=n,gi(t,e)})(t,e.character),function(t,e,n){const i=e&&e.fill||ui;if(!i)return void(t.globalAlpha=0);const{fillOpacity:r=1,opacity:s=1}=e;t.globalAlpha=r*s,t.fillStyle=n?li(t,i,{AABBBounds:n}):i,gi(t,e)}(t,e.character,a),e.draw(t,i,this.ascent,n,0===r,this.textAlign,this.height)}))}getWidthWithEllips(t){let e=0;for(let n=this.paragraphs.length-1;n>=0;n--){const i=this.paragraphs[n];if(i instanceof eo)break;const{width:r}=yi(t,i.character,i.ascentDescentMode),s=r||0;if(s<=this.blankWidth+e){i.ellipsis="add",i.ellipsisWidth=s;break}if(s<=this.blankWidth+e+i.width){i.ellipsis="replace",i.ellipsisWidth=s,i.ellipsisOtherParagraphWidth=this.blankWidth+e;break}i.ellipsis="hide",e+=i.width}let n=0;return this.paragraphs.forEach(((t,e)=>{n+=t instanceof eo?t.width:t.getWidthWithEllips(this.direction)})),n}}(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(n),this.frame.actualHeight+=n.height,this.y+=n.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t,e=!1){t instanceof eo?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),(0!==t.text.length||this.newLine)&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const n=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(n/t[this.directionKey.width]*t.length)||0,r=mi(t.text,n,t.character,i,"break-word"===this.frame.wordBreak);if(0!==r){const[n,i]=function(t,e){const n=t.text.slice(0,e),i=t.text.slice(e);return[new Qa(n,t.newLine,t.character,t.ascentDescentMode),new Qa(i,!0,t.character,t.ascentDescentMode)]}(t,r);this.store(n),e?this.send():this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let io=!1;try{io=Intl&&"function"==typeof Intl.Segmenter}catch(t){io=!1}const ro=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...ca];let so=class t extends ga{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Hs,this.onBeforeAttributeUpdate=(t,e,n)=>{for(const n in t)if("hoverIconId"===n){if(t[n]===e[n])continue;const i=this._frameCache.icons.get(t[n]);this.updateHoverIconState(i)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:ni.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:ni.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:ni.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:ni.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:ni.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:ni.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:ni.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:ni.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return nr(this).richtext}static AllSingleCharacter(e){return e.lines?e.lines.every((e=>e.paragraphs.every((e=>!(e.text&&Pt(e.text)&&t.splitText(e.text).length>1))))):e.every((e=>e.isComposing||!(e.text&&Pt(e.text)&&t.splitText(e.text).length>1)))}static splitText(t){if(io){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),n=[];for(const{segment:i}of e.segment(t))n.push(i);return n}return Array.from(t)}static TransformTextConfig2SingleCharacter(e){const n=[];return e.forEach((e=>{const i=t.splitText(e.text.toString());if(Pt(e.text)&&i.length>1)for(let t=0;t<i.length;t++){const r=i[t];n.push(Object.assign(Object.assign({},e),{text:r}))}else n.push(e)})),n}updateAABBBounds(t,e,n){var i,r,s,a;const{width:o=e.width,height:l=e.height,maxWidth:c=e.maxWidth,maxHeight:u=e.maxHeight,textAlign:h=e.textAlign,textBaseline:d=(null!==(r=null!==(i=t.textBaseline)&&void 0!==i?i:e.textBaseline)&&void 0!==r?r:"top"),editOptions:f}=t;if(o>0&&l>0)n.set(0,0,o,l);else{const t=this.getFrameCache(),{width:e,height:i}=t.getActualSize();let r=o||e||0,s=l||i||0;s="number"==typeof u&&s>u?u:s||0,r="number"==typeof c&&r>c?c:r||0,n.set(0,0,r,s)}f&&f.keepHeightWhileEmpty&&!n.height()&&!(null===(s=t.textConfig)||void 0===s?void 0:s.length)&&(n.y2=n.y1+(null!==(a=t.fontSize)&&void 0!==a?a:12),n.x2=n.x1+2);let p=0;switch(d){case"top":p=0;break;case"middle":p=-n.height()/2;break;case"bottom":p=-n.height()}let g=0;switch(h){case"left":g=0;break;case"center":g=-n.width()/2;break;case"right":g=-n.width()}return l||("middle"===this.verticalDirection?p-=n.height()/2:"bottom"===this.verticalDirection&&(p-=n.height())),n.translate(g,p),xt.graphicService.updateTempAABBBounds(n),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||xt.graphicService.updateHTMLTextAABBBounds(t,e,n),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,xt.graphicService.transformAABBBounds(t,n,e,!1,this),0===n.width()&&0===n.height()&&n.clear(),n}needUpdateTags(t){return super.needUpdateTags(t,ro)}needUpdateTag(t){return super.needUpdateTag(t,ro)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){const n=t.lines[e];for(let t=0;t<n.paragraphs.length;t++){const e=n.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:n,fontSize:i,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:c,lineHeight:u,strokeOpacity:h,upgradeAttrs:d}=this.attribute,f=Object.assign({fill:e,stroke:n,fontSize:i,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:c,strokeOpacity:h},t);return(null==d?void 0:d.lineHeight)&&(f.lineHeight=u),f}doUpdateFrameCache(e){var n;const{maxWidth:i,maxHeight:r,width:s,height:a,ellipsis:o,wordBreak:l,verticalDirection:c,textAlign:u,textBaseline:h,layoutDirection:d,singleLine:f,disableAutoWrapLine:p,editable:g,ascentDescentMode:m,upgradeAttrs:b}=this.attribute,y=b&&b.multiBreakLine;let{textConfig:v=[]}=this.attribute;g&&v.length>0&&!t.AllSingleCharacter(v)&&(v=t.TransformTextConfig2SingleCharacter(v),this.attribute.textConfig=v);const x=[],_=null!=e?e:v;for(let t=0;t<_.length;t++)if("image"in _[t]){const e=this.combinedStyleToCharacter(_[t]);e.lineWidth=void 0;const n=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(n)x.push(n);else{const t=new eo(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,x.push(t)}}else{const e=this.combinedStyleToCharacter(_[t]);if(Lt(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const n=e.text.split("\n");for(let i=0;i<n.length;i++)if(0===i)x.push(new Qa(n[i],!1,e,m));else if(n[i]||t===_.length-1)x.push(new Qa(n[i],!0,e,m));else{const e=this.combinedStyleToCharacter(_[t+1]);x.push(new Qa(n[i],!0,e,m))}}else e.text&&x.push(new Qa(e.text,!1,e,m))}const S="number"==typeof i&&Number.isFinite(i)&&i>0,A="number"==typeof r&&Number.isFinite(r)&&r>0,w="number"==typeof s&&Number.isFinite(s)&&s>0&&(!S||s<=i),T="number"==typeof a&&Number.isFinite(a)&&a>0&&(!A||a<=r),C=new Ka(0,0,(w?s:S?i:0)||0,(T?a:A?r:0)||0,o,l,c,u,h,d||"horizontal",!w&&S,!T&&A,f||!1,null===(n=this._frameCache)||void 0===n?void 0:n.icons),B=new no(C);if(B.newLine=y,p){let t=0,e=!1;for(let n=0;n<x.length;n++){const i=x[n];e?(i.overflow=!0,i.left=1/0,i.top=1/0,!i.newLine&&C.lines[C.lines.length-1].paragraphs.push(i)):B.deal(i,!0),C.lines.length!==t&&(t=C.lines.length,B.lineBuffer.length=0,i.overflow=!0,i.left=1e3,i.top=1e3,C.lines[C.lines.length-1].paragraphs.push(i),e=!0),i.newLine&&(e=!1,B.lineWidth=0),B.send()}}else for(let t=0;t<x.length;t++)B.deal(x[t]);if(B.send(),!("horizontal"===C.layoutDirection?w:T)){const t=C.getActualSizeWidthEllipsis();let e="horizontal"===C.layoutDirection?t.width:t.height;("horizontal"===C.layoutDirection?S:A)&&(e=Math.min(e,"horizontal"===C.layoutDirection?i:r)),C.lines.forEach((function(t){t.calcOffset(e,!1)}))}y&&C.lines.forEach((t=>{const e=t.paragraphs;t.paragraphs=t.paragraphs.filter((t=>""!==t.text)),0===t.paragraphs.length&&e.length&&(e[0].text="\n",t.paragraphs.push(e[0]))})),this._frameCache=C}clone(){return new t(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((n=>{n.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,n,i,r,s;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(n=this.stage)||void 0===n||n.setCursor(t.attribute.cursor),null===(i=this.stage)||void 0===i||i.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:n,f:i}=this.globalTransMatrix;let r;return e.icons.forEach(((e,s)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-n,y:t.y-i})&&(r=e,r.globalX=(null!==(a=r.attribute.x)&&void 0!==a?a:0)+n+e._marginArray[3],r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+i+e._marginArray[0])})),r}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function ao(t){return new so(t)}so.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},pa);const oo=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...ca];let lo=class t extends ga{constructor(t){super(t),this.type="arc",this.numberType=zs}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:n,innerRadius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:n=t.innerPadding,outerPadding:i=t.outerPadding}=this.attribute;let{outerRadius:r=t.outerRadius,innerRadius:s=t.innerRadius}=this.attribute;if(r+=i,s-=n,0===e||"0%"===e)return 0;const a=Math.abs(r-s),o=t=>Math.min(Lt(t,!0)?t:a*parseFloat(t)/100,a/2);if(Et(e)){const t=e.map((t=>o(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:n=t.endAngle}=this.attribute;const{cap:i=t.cap}=this.attribute,r=n-e>=0?1:-1,s=n-e;if(e=pe(e),n=e+s,i&&ne(s)<ee-Qt){let s=1,a=1;i.length&&(s=Number(i[0]),a=Number(i[1]));let{outerRadius:o=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute;const{outerPadding:c=t.outerPadding,innerPadding:u=t.innerPadding}=this.attribute;o+=c,l-=u;const h=Math.abs(o-l)/2,d=h/o;if(h>Qt&&o>Qt)return{startAngle:e-r*d*s,endAngle:n+r*d*a,sc:r*d*s,ec:r*d*a}}return{startAngle:e,endAngle:n}}getParsePadAngle(t,e){const n=this.getGraphicTheme(),{innerPadding:i=n.innerPadding,outerPadding:r=n.outerPadding,padAngle:s=n.padAngle}=this.attribute;let{outerRadius:a=n.outerRadius,innerRadius:o=n.innerRadius}=this.attribute;a+=r,o-=i;const{padRadius:l=le(a*a+o*o)}=this.attribute,c=ne(e-t);let u=t,h=e,d=t,f=e;const p=s/2;let g=c,m=c;if(p>Qt&&l>Qt){const n=e>t?1:-1;let i=ue(Number(l)/o*oe(p)),r=ue(Number(l)/a*oe(p));return(g-=2*i)>Qt?(i*=n,d+=i,f-=i):(g=0,d=f=(t+e)/2),(m-=2*r)>Qt?(r*=n,u+=r,h-=r):(m=0,u=h=(t+e)/2),{outerStartAngle:u,outerEndAngle:h,innerStartAngle:d,innerEndAngle:f,innerDeltaAngle:g,outerDeltaAngle:m}}return{outerStartAngle:u,outerEndAngle:h,innerStartAngle:d,innerEndAngle:f,innerDeltaAngle:g,outerDeltaAngle:m}}getGraphicTheme(){return nr(this).arc}updateAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n)||(i?this.updateArcAABBBoundsImprecise(t,e,n):this.updateArcAABBBoundsAccurate(t,e,n));const{tb1:r,tb2:s}=xt.graphicService.updateTempAABBBounds(n);Ia(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),this.setWidthHeightWithoutTransform(n);const{lineJoin:a=e.lineJoin}=t;return xt.graphicService.transformAABBBounds(t,n,e,"miter"===a,this),n}updateArcAABBBoundsImprecise(t,e,n){let{outerRadius:i=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:a=e.innerPadding}=t;return i+=s,r-=a,i<r&&(i=r),n.set(-i,-i,i,i),n}updateArcAABBBoundsAccurate(t,e,n){let{outerRadius:i=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(i+=s,r-=a,i<r){const t=i;i=r,r=t}let{endAngle:o=e.endAngle,startAngle:l=e.startAngle}=t;if(l>o){const t=l;l=o,o=t}return i<=Qt?n.set(0,0,0,0):Math.abs(o-l)>ee-Qt?n.set(-i,-i,i,i):(gr(l,o,i,n),gr(l,o,r,n)),n}needUpdateTags(t){return super.needUpdateTags(t,oo)}needUpdateTag(t){return super.needUpdateTag(t,oo)}toCustomPath(){var t,e,n,i;let r=super.toCustomPath();if(r)return r;const s=this.attribute,{startAngle:a,endAngle:o}=this.getParsedAngle();let l=(null!==(t=s.innerRadius)&&void 0!==t?t:0)-(null!==(e=s.innerPadding)&&void 0!==e?e:0),c=(null!==(n=s.outerRadius)&&void 0!==n?n:0)-(null!==(i=s.outerPadding)&&void 0!==i?i:0);const u=ne(o-a),h=o>a;if(c<l){const t=c;c=l,l=t}if(r=new Rn,c<=Qt)r.moveTo(0,0);else if(u>=ee-Qt)r.moveTo(0+c*re(a),0+c*oe(a)),r.arc(0,0,c,a,o,!h),l>Qt&&(r.moveTo(0+l*re(o),0+l*oe(o)),r.arc(0,0,l,o,a,h));else{const t=c*re(a),e=c*oe(a),n=l*re(o),i=l*oe(o);r.moveTo(0+t,0+e),r.arc(0,0,c,a,o,!h),r.lineTo(0+n,0+i),r.arc(0,0,l,o,a,h),r.closePath()}return r}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};lo.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},pa);const co=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const n=this.store.get(t);return n?n(e):null}};let uo;function ho(t){return uo||(uo=co.CreateGraphic("text",{})),uo.initAttributes(t),uo.AABBBounds}var fo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},po=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},go=function(t,e){return function(n,i){e(n,i,t)}};class mo{constructor(){this.time=Ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){var f;const{background:p,backgroundOpacity:g=(null!==(f=t.attribute.fillOpacity)&&void 0!==f?f:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:b=l.backgroundMode,backgroundFit:y=l.backgroundFit,backgroundKeepAspectRatio:v=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:S=l.backgroundOffsetY,backgroundClip:A=l.backgroundClip}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const r=t.resources.get(p);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const n=nr(t.parent).group,{scrollX:i=n.scrollX,scrollY:r=n.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(i,r)}A&&e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,l),e.globalAlpha=g*m,this.doDrawImage(e,r.data,s,{backgroundMode:b,backgroundFit:y,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:S}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.globalAlpha=g*m,e.fillStyle=p,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,n,i){const{backgroundMode:r,backgroundFit:s,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:c=0}=i,u=n.width(),h=n.height();let d=u,f=h;if("no-repeat"===r)if(s)if(a){const i=Math.max(u/e.width,h/e.height);t.drawImage(e,n.x1+l,n.y1+c,e.width*i*o,e.height*i*o)}else t.drawImage(e,n.x1,n.y1,n.width(),n.height());else{const i=e.width*o,r=e.height*o;t.drawImage(e,n.x1+l,n.y1+c,i,r)}else{if(s&&"repeat"!==r&&(e.width||e.height)){const n=e.width,i=e.height;"repeat-x"===r?(d=n*(h/i),f=h):"repeat-y"===r&&(f=i*(u/n),d=u);const s=t.dpr,a=Ki.allocate({width:d,height:f,dpr:s}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,d,f),o.drawImage(e,0,0,d,f),e=a.nativeCanvas),Ki.free(a)}const i=t.dpr,a=t.createPattern(e,r);a.setTransform&&a.setTransform(new DOMMatrix([1/i,0,0,1/i,0,0])),t.fillStyle=a,t.translate(n.x1,n.y1),t.fillRect(0,0,u,h),t.translate(-n.x1,-n.y1)}}}const bo=new mo;let yo=class{constructor(t){this.subRenderContribitions=t,this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((f=>{f.render(t,e,n,i,r,s,a,o,l,c,u,h,d)}))}};yo=fo([K(),go(0,X(ht)),go(0,q(Ba)),po("design:paramtypes",[Object])],yo);const vo=new class{constructor(){this.time=Ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){var f,p;const{clipConfig:g}=t.attribute;if(!g)return;const m=t.getClipPath();if(!m)return;const b=!(u||h),y=t.AABBBounds,v=null!==(f=t.attribute.width)&&void 0!==f?f:y.width(),x=null!==(p=t.attribute.height)&&void 0!==p?p:y.height();b&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],n+v/2,i+x/2,0)&&e.closePath(),u&&u(e,t.attribute,l,!0),b&&e.clip()}};const xo=new class{constructor(){this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){const{clipConfig:f}=t.attribute;f&&t.getClipPath()&&(u||h||e.restore())}};const _o=new class{constructor(){this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,n,i,r){const s=(t-2*e)/2,a=i.dpr,o=Ki.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),r(s,l);const c=i.createPattern(o.nativeCanvas,"repeat");return c.setTransform&&c.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Ki.free(o),c}createCirclePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,e)=>{e.fillStyle=n,e.arc(t,t,t,0,ee),e.fill()}))}createDiamondPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{const r=t/2,s=r;i.fillStyle=n,i.moveTo(r,s-e),i.lineTo(e+r,s),i.lineTo(r,s+e),i.lineTo(r-e,s),i.closePath(),i.fill()}))}createRectPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(s,0,2*i,t)}))}createHorizontalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(0,s,t,2*i)}))}createBiasLRLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(0,0),i.lineTo(t,t);const r=t/2,s=-r;i.moveTo(r,s),i.lineTo(r+t,s+t),i.moveTo(-r,-s),i.lineTo(-r+t,-s+t),i.stroke()}))}createBiasRLLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(t,0),i.lineTo(0,t);const r=t/2,s=r;i.moveTo(t+r,s),i.lineTo(r,s+t),i.moveTo(t-r,-s),i.lineTo(-r,-s+t),i.stroke()}))}createGridPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,t,t),i.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:f=l.texture,textureColor:p=l.textureColor,textureSize:g=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;f&&this.drawTexture(f,t,e,n,i,l,p,g,m)}drawTexture(t,e,n,i,r,s,a,o,l){var c;const{textureRatio:u=s.textureRatio,textureOptions:h=null}=e.attribute;let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(o,l,a,n);break;case"diamond":d=this.createDiamondPattern(o,l,a,n);break;case"rect":d=this.createRectPattern(o,l,a,n);break;case"vertical-line":d=this.createVerticalLinePattern(o,l,a,n);break;case"horizontal-line":d=this.createHorizontalLinePattern(o,l,a,n);break;case"bias-lr":d=this.createBiasLRLinePattern(o,l,a,n);break;case"bias-rl":d=this.createBiasRLLinePattern(o,l,a,n);break;case"grid":d=this.createGridPattern(o,l,a,n)}if(h&&h.dynamicTexture){const{gridConfig:d={},useNewCanvas:f}=h,p=e.AABBBounds;i=p.x1,r=p.y1;const g=n;let m;if(f){m=Ki.allocate({width:p.width(),height:p.height(),dpr:n.dpr});const t=m.getContext("2d");t.clearRect(0,0,p.width(),p.height()),i=0,r=0,n=t}if(g.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:n=0}=e.parent.attribute;g.setTransformFromMatrix(e.parent.globalTransMatrix),g.translate(t,n,!0)}g.setCommonStyle(e,e.attribute,i,r,s),g.clip();const b=p.width(),y=p.height(),v=l,x=o,_=d.columns?d.columns:Math.ceil(b/x),S=d.rows?d.rows:Math.ceil(y/x),A=d.gutterColumn?d.gutterColumn:2*v,w=d.gutterRow?d.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=Va({}));const T=d.columns?b/d.columns:x,C=d.rows?y/d.rows:x;this._tempSymbolGraphic.setAttributes({size:[T-A,C-w],symbolType:t});const B=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<S;t++)for(let s=0;s<_;s++){const o=i+x/2+s*x,l=r+x/2+t*x;null===(c=h.beforeDynamicTexture)||void 0===c||c.call(h,n,t,s,S,_,u,e,p.width(),p.height()),n.beginPath(),!1===B.draw(n,Math.min(T-A,C-w),o,l,0)&&n.closePath(),n.fillStyle=a,h.dynamicTexture(n,t,s,S,_,u,e,p.width(),p.height())}f&&(g.globalAlpha=1,g.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,p.x1,p.y1,p.width()*g.dpr,p.height()*g.dpr)),g.restore()}else if(d)n.highPerformanceSave(),n.setCommonStyle(e,e.attribute,i,r,s),n.fillStyle=d,n.fill(),n.highPerformanceRestore();else if("wave"===t){n.save(),n.setCommonStyle(e,e.attribute,i,r,s),n.clip();const t=e.AABBBounds;(function(t,e,n,i,r,s,a){const{fill:o="orange",percent:l=.6,frequency:c=4,opacity:u,phi:h=0}=r;let{amplitude:d=10}=r;d*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const f=i*(1-l),p=n,g=Math.max(Math.round(p/70),2);t.beginPath(),t.moveTo(0+s,i+a),t.lineTo(0+s,f+a);const m=p/c*e,b=p/Math.PI/(2*c);for(let e=0;e<p;e+=g){const n=d*Math.sin((e+m+h)/b+h);t.lineTo(e+s,f+n+a)}t.lineTo(p+s,i+a),t.closePath(),t.fillStyle=o,isFinite(u)&&(t.globalAlpha=u),t.fill()})(n,u,t.width(),t.height(),Object.assign(Object.assign({},h||{}),{fill:a}),i+t.x1-i,r+t.y1-r),n.restore()}}},So=Zt/2;function Ao(t,e,n,i,r,s,a=!0,o){let l;if(Array.isArray(a)&&(o=a,a=!0),i<0&&(e+=i,i=-i),r<0&&(n+=r,r=-r),Lt(s,!0))l=[s=ne(s),s,s,s];else if(Array.isArray(s)){const t=s;let e,n;switch(t.length){case 0:l=[0,0,0,0];break;case 1:e=ne(t[0]),l=[e,e,e,e];break;case 2:case 3:e=ne(t[0]),n=ne(t[1]),l=[e,n,e,n];break;default:l=t,l[0]=ne(l[0]),l[1]=ne(l[1]),l[2]=ne(l[2]),l[3]=ne(l[3])}}else l=[0,0,0,0];if(i<0||l[0]+l[1]+l[2]+l[3]<1e-12)return t.rect(e,n,i,r);const[c,u,h,d]=[[e,n],[e+i,n],[e+i,n+r],[e,n+r]],f=Math.min(i/2,r/2),p=[Math.min(f,l[0]),Math.min(f,l[1]),Math.min(f,l[2]),Math.min(f,l[3])],g=[c[0]+p[0],c[1]],m=[c[0],c[1]+p[0]],b=[u[0]-p[1],u[1]],y=[u[0],u[1]+p[1]],v=[h[0]-p[2],h[1]],x=[h[0],h[1]-p[2]],_=[d[0]+p[3],d[1]],S=[d[0],d[1]-p[3]];if(t.moveTo(g[0],g[1]),a){if(o&&o[0]?o[0](g[0],g[1],b[0],b[1]):t.lineTo(b[0],b[1]),!$t(b,y)){o&&o[0]&&t.moveTo(b[0],b[1]);const e=b[0],n=b[1]+p[1];t.arc(e,n,p[1],-So,0,!1)}if(o&&o[1]?o[1](y[0],y[1],x[0],x[1]):t.lineTo(x[0],x[1]),!$t(v,x)){const e=x[0]-p[2],n=x[1];o&&o[1]&&t.moveTo(x[0],x[1]),t.arc(e,n,p[2],0,So,!1)}if(o&&o[2]?o[2](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!$t(_,S)){const e=_[0],n=_[1]-p[3];o&&o[2]&&t.moveTo(_[0],_[1]),t.arc(e,n,p[3],So,Zt,!1)}if(o&&o[3]?o[3](S[0],S[1],m[0],m[1]):t.lineTo(m[0],m[1]),!$t(g,m)){const e=g[0],n=g[1]+p[0];o&&o[3]&&t.moveTo(m[0],m[1]),t.arc(e,n,p[0],Zt,Zt+So,!1)}}else o&&o[0]?o[0](g[0],g[1],b[0],b[1]):t.lineTo(b[0],b[1]),o&&o[1]?o[1](b[0],b[1],v[0],v[1]):t.lineTo(v[0],v[1]),o&&o[2]?o[2](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),o&&o[2]?o[2](_[0],_[1],g[0],g[1]):t.lineTo(g[0],g[1]);return!o&&t.closePath(),t}var wo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a};class To{constructor(){this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h){const{outerBorder:d,innerBorder:f}=t.attribute,p=d&&!1!==d.visible,g=f&&!1!==f.visible;if(!p&&!g)return;const{cornerRadius:m=l.cornerRadius,cornerType:b=l.cornerType,opacity:y=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:S=l.scaleY,x1:A,y1:w,keepStrokeScale:T=l.keepStrokeScale}=t.attribute;let{width:C,height:B}=t.attribute;C=(null!=C?C:A-n)||0,B=(null!=B?B:w-i)||0;const k=(r,s)=>{const a=!(!r||!r.stroke),o="outerBorder"===s?-1:1,{distance:c=l[s].distance}=r,u=T?c:oi(e,c,e.dpr),d=n+o*u,f=i+o*u,p=2*u;if(0===m||Et(m)&&m.every((t=>0===t))?(e.beginPath(),e.rect(d,f,C-o*p,B-o*p)):(e.beginPath(),Ao(e,d,f,C-o*p,B-o*p,m,"bevel"!==b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),h)h(e,r,l[s]);else if(a){const a=l[s].opacity;l[s].opacity=y,e.setStrokeStyle(t,r,(v-n)/_,(x-i)/S,l[s]),l[s].opacity=a,e.stroke()}};p&&k(d,"outerBorder"),g&&k(f,"innerBorder")}}let Co=class{constructor(){this.time=Ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){const{stroke:f=l.stroke}=t.attribute;Array.isArray(f)&&f.some((t=>!1===t))&&(d.doStroke=!1)}};Co=wo([K()],Co);let Bo=class{constructor(){this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h){const{x1:d,y1:f,x:p=l.x,y:g=l.y,stroke:m=l.stroke,cornerRadius:b=l.cornerRadius,cornerType:y=l.cornerType}=t.attribute;let{width:v,height:x}=t.attribute;if(v=(null!=v?v:d-p)||0,x=(null!=x?x:f-g)||0,Array.isArray(m)&&m.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,n,i,l),!(0===b||Et(b)&&b.every((t=>0===t)))){let r,s=0;return Ao(e,n,i,v,x,b,"bevel"!==y,new Array(4).fill(0).map(((a,o)=>(a,c,u,h)=>{m[o]&&(s===o-1&&m[o]===r||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:m[o]}),n,i,l),e.beginPath(),e.moveTo(a,c),r=m[o]),s=o,e.lineTo(u,h),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(n,i),m[0]?e.lineTo(n+v,i):e.moveTo(n+v,i),m[1]?e.lineTo(n+v,i+x):e.moveTo(n+v,i+x),m[2]?e.lineTo(n,i+x):e.moveTo(n,i+x),m[3]){const t=m[0]?i-e.lineWidth/2:i;e.lineTo(n,t)}else e.moveTo(n,i);e.stroke()}}};Bo=wo([K()],Bo);const ko=new To,Mo=_o,Po=bo;const Eo=new class extends To{constructor(){super(...arguments),this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h){return super.drawShape(t,e,n,i,r,s,a,o,l,c,u,h)}},Oo=bo;const Lo=new class{constructor(){this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h){const d=t.getParsedPath();if(!d)return;const{outerBorder:f,innerBorder:p}=t.attribute,g=f&&!1!==f.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{size:b=l.size,opacity:y=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:S=l.scaleY,keepStrokeScale:A=l.keepStrokeScale}=t.attribute,w=(r,s)=>{const a=!(!r||!r.stroke),{distance:o=l[s].distance}=r,c=A?o:oi(e,o,e.dpr),u="outerBorder"===s?1:-1;if(e.beginPath(),!1===d.drawOffset(e,b,n,i,u*c)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),h)h(e,r,l[s]);else if(a){const a=l[s].opacity;l[s].opacity=y,e.setStrokeStyle(t,r,(v-n)/_,(x-i)/S,l[s]),l[s].opacity=a,e.stroke()}};g&&w(f,"outerBorder"),m&&w(p,"innerBorder")}},Ro=new class{constructor(){this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){const{clipRange:f=l.clipRange,x:p=l.x,y:g=l.y,z:m=l.z,size:b=l.size,scaleX:y=l.scaleX,scaleY:v=l.scaleY}=t.attribute,x=t.getParsedPath();x&&f<1&&f>0&&(e.beginPath(),x.drawWithClipRange&&x.drawWithClipRange(e,b,n,i,f,m,((r,s)=>{var a,c,u,d;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(a=s.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(c=s.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(u=s.stroke)&&void 0!==u?u:t.attribute.stroke,e.lineWidth=null!==(d=s.lineWidth)&&void 0!==d?d:t.attribute.lineWidth,s=e}s.stroke&&(h?h(e,t.attribute,l):o&&(e.setStrokeStyle(t,s,(p-n)/y,(g-i)/v,l),e.stroke()))})),s&&!x.isSvg&&(h?h(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(p-n)/y,(g-i)/v,l),e.stroke())))}},Io=_o,No=bo,Do={x:0,y:0,z:0,lastModelMatrix:null};class Uo{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(vo),this.builtinContributions.push(xo),this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===Ge.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Ge.afterFillStroke)))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,n,i,r,s,a,o,l,c,u,h,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((f=>{f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d)}))}afterRenderStep(t,e,n,i,r,s,a,o,l,c,u,h,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((f=>{f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d)}))}drawPathProxy(t,e,n,i,r,s,a,o){if(!t.pathProxy)return!1;const l=nr(t,null==s?void 0:s.theme)[t.type.replace("3d","")],{fill:c=l.fill,stroke:u=l.stroke,opacity:h=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:f=l.lineWidth,strokeOpacity:p=l.strokeOpacity,visible:g=l.visible,x:m=l.x,y:b=l.y}=t.attribute,y=_a(h,d,c),v=Sa(h,p),x=va(c),_=xa(u,f);if(!g)return!0;if(!x&&!_)return!0;if(!(y||v||a||o))return!0;e.beginPath();return Ye(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,n,i,x,_,y,v,l,r,a,o),_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,n-m,i-b,l),e.stroke())),x&&(a?a(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,n-m,i-b,l),e.fill())),this.afterRenderStep(t,e,n,i,x,_,y,v,l,r,a,o),!0}valid(t,e,n,i){const{fill:r=e.fill,background:s,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:c=e.lineWidth,strokeOpacity:u=e.strokeOpacity,visible:h=e.visible}=t.attribute,d=_a(o,l,r),f=Sa(o,u),p=va(r,s),g=xa(a,c);return!(!t.valid||!h)&&!(!p&&!g)&&!!(d||f||n||i||s)&&{fVisible:d,sVisible:f,doFill:p,doStroke:g}}transform(t,e,n,i=!1){const{x:r=e.x,y:s=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:c=e.angle,postMatrix:u}=t.attribute,h=n.modelMatrix,d=n.camera;Do.x=r,Do.y=s,Do.z=a,Do.lastModelMatrix=h;const f=d&&(i||function(t){const{alpha:e,beta:n}=t.attribute;return e||n}(t)),p=f?t.transMatrix.onlyTranslate()&&!u:1===o&&1===l&&0===c&&!u;if(f){const i=ea.allocate(),r=ea.allocate();La(r,t,e),Zs(i,h||i,r),Do.x=0,Do.y=0,Do.z=0,n.modelMatrix=i,n.setTransform(1,0,0,1,0,0,!0),ea.free(r)}if(p&&!h){const i=t.getOffsetXY(e);Do.x+=i.x,Do.y+=i.y,Do.z=a,n.setTransformForCurrent()}else if(f)Do.x=0,Do.y=0,Do.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(d&&n.project){const i=t.getOffsetXY(e);Do.x+=i.x,Do.y+=i.y,this.transformWithoutTranslate(n,Do.x,Do.y,Do.z,o,l,c)}else n.transformFromMatrix(t.transMatrix,!0),Do.x=0,Do.y=0,Do.z=0;return Do}transformUseContext2d(t,e,n,i){const r=i.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,a=i.project(0,0,n),o=i.project(r,0,n),l=i.project(r,s,n),c={x:0,y:0},u={x:r,y:0},h={x:r,y:s};i.camera=null;const d=1/(c.x*(h.y-u.y)-u.x*h.y+h.x*u.y+(u.x-h.x)*c.y),f=-(c.y*(l.x-o.x)-u.y*l.x+h.y*o.x+(u.y-h.y)*a.x)*d,p=(u.y*l.y+c.y*(o.y-l.y)-h.y*o.y+(h.y-u.y)*a.y)*d,g=(c.x*(l.x-o.x)-u.x*l.x+h.x*o.x+(u.x-h.x)*a.x)*d,m=-(u.x*l.y+c.x*(o.y-l.y)-h.x*o.y+(h.x-u.x)*a.y)*d,b=(c.x*(h.y*o.x-u.y*l.x)+c.y*(u.x*l.x-h.x*o.x)+(h.x*u.y-u.x*h.y)*a.x)*d,y=(c.x*(h.y*o.y-u.y*l.y)+c.y*(u.x*l.y-h.x*o.y)+(h.x*u.y-u.x*h.y)*a.y)*d;i.setTransform(f,p,g,m,b,y,!0)}}restoreTransformUseContext2d(t,e,n,i){this.camera&&(i.camera=this.camera)}transformWithoutTranslate(t,e,n,i,r,s,a){const o=t.project(e,n,i);t.translate(o.x,o.y,!1),t.scale(r,s,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,n,i,r,s){const{context:a}=i;if(!a)return;const{renderable:o}=t.attribute;if(!1===o)return;a.highPerformanceSave();const l=this.transform(t,e,a,n),{x:c,y:u,z:h,lastModelMatrix:d}=l;this.z=h,this.drawPathProxy(t,a,c,u,i,r)||(this.drawShape(t,a,c,u,i,r,null,null,s),this.z=0,a.modelMatrix!==d&&ea.free(a.modelMatrix),a.modelMatrix=d),a.highPerformanceRestore()}}var zo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Wo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fo=function(t,e){return function(n,i){e(n,i,t)}};let jo=class extends Uo{constructor(t){super(),this.graphicRenderContributions=t,this.type="rect",this.numberType=js,this.builtinContributions=[ko,Po,Mo],this.init(t)}drawShape(t,e,n,i,r,s,a,o,l){l=null!=l?l:nr(t,null==s?void 0:s.theme).rect;const{fill:c=l.fill,background:u,stroke:h=l.stroke,cornerRadius:d=l.cornerRadius,cornerType:f=l.cornerType,opacity:p=l.opacity,fillOpacity:g=l.fillOpacity,lineWidth:m=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:y=l.visible,x1:v,y1:x,x:_=l.x,y:S=l.y,fillStrokeOrder:A=l.fillStrokeOrder,drawStrokeWhenZeroWH:w=l.drawStrokeWhenZeroWH}=t.attribute;let{width:T,height:C}=t.attribute;T=(null!=T?T:v-_)||0,C=(null!=C?C:x-S)||0;const B=function(t,e,n,i,r){return r&&t*e>0&&0!==n&&0!==i}(p,g,T,C,c),k=function(t,e,n,i,r){return r?t*e>0:t*e>0&&0!==n&&0!==i}(p,b,T,C,w),M=va(c,u),P=xa(h,m);if(!t.valid||!y)return;if(!M&&!P)return;if(!(B||k||a||o||u))return;0===d||Et(d)&&d.every((t=>0===t))?(e.beginPath(),e.rect(n,i,T,C)):(e.beginPath(),Ao(e,n,i,T,C,d,"bevel"!==f));const E={doFill:M,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,n,i,M,P,B,k,l,r,a,o,E),A?(this._runStroke(t,e,n,i,l,E,k,_,S,o),this._runFill(t,e,n,i,l,E,B,_,S,a)):(this._runFill(t,e,n,i,l,E,B,_,S,a),this._runStroke(t,e,n,i,l,E,k,_,S,o)),this.afterRenderStep(t,e,n,i,M,P,B,k,l,r,a,o)}_runFill(t,e,n,i,r,s,a,o,l,c){s.doFill&&(c?c(e,t.attribute,r):a&&(e.setCommonStyle(t,t.attribute,o-n,l-i,r),e.fill()))}_runStroke(t,e,n,i,r,s,a,o,l,c){s.doStroke&&(c?c(e,t.attribute,r):a&&(e.setStrokeStyle(t,t.attribute,o-n,l-i,r),e.stroke()))}draw(t,e,n,i){const r=nr(t,null==i?void 0:i.theme).rect;this._draw(t,r,!1,n,i,r)}};jo=zo([K(),Fo(0,X(ht)),Fo(0,q(wa)),Wo("design:paramtypes",[Object])],jo);var Ho=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Go=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vo=function(t,e){return function(n,i){e(n,i,t)}};let $o=class extends Uo{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Gs,this.builtinContributions=[Lo,No,Io,Ro],this.init(t)}drawShape(t,e,n,i,r,s,a,o,l){var c;l=null!=l?l:nr(t,null==s?void 0:s.theme).symbol;const{size:u=l.size,x:h=l.x,y:d=l.y,scaleX:f=l.scaleX,scaleY:p=l.scaleY,fillStrokeOrder:g=l.fillStrokeOrder,clipRange:m=l.clipRange}=t.attribute,b=this.valid(t,l,a,o);if(!b)return;const{fVisible:y,sVisible:v,doFill:x,doStroke:_}=b,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:A=l.keepDirIn3d}=t.attribute,w=null!==(c=this.z)&&void 0!==c?c:0;e.beginPath();let T=n,C=i,B=w;const k=e.camera;if(A&&k&&e.project){const t=e.project(n,i,w);e.camera=null,Et(u)&&(u[0],u[1]),T=t.x,C=t.y,B=void 0}!1===S.draw(e,u,T,C,B,((r,s)=>{var c,u,b,y;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(c=s.fill)&&void 0!==c?c:t.attribute.fill,e.opacity=null!==(u=s.opacity)&&void 0!==u?u:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(b=s.stroke)&&void 0!==b?b:t.attribute.stroke,e.lineWidth=null!==(y=s.lineWidth)&&void 0!==y?y:t.attribute.lineWidth,s=e}const x=()=>{s.fill&&(a?a(e,t.attribute,l):(e.setCommonStyle(t,s,h-n,d-i,l),e.fill()))},_=()=>{s.stroke&&(o?o(e,t.attribute,l):v&&m>=1&&(e.setStrokeStyle(t,s,(h-n)/f,(d-i)/p,l),e.stroke()))};g?(_(),x()):(x(),_())}))&&e.closePath(),e.camera=k,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,n,i,x,_,y,v,l,r,a,o),g?(this._runStroke(t,e,n,i,l,_,v,h,d,S,m,f,p,o),this._runFill(t,e,n,i,l,x,y,h,d,S,a)):(this._runFill(t,e,n,i,l,x,y,h,d,S,a),this._runStroke(t,e,n,i,l,_,v,h,d,S,m,f,p,o)),this.afterRenderStep(t,e,n,i,x,_,y,v,l,r,a,o)}_runFill(t,e,n,i,r,s,a,o,l,c,u){s&&!c.isSvg&&(u?u(e,t.attribute,r):a&&(e.setCommonStyle(t,t.attribute,o-n,l-i,r),e.fill()))}_runStroke(t,e,n,i,r,s,a,o,l,c,u,h,d,f){s&&!c.isSvg&&(f?f(e,t.attribute,r):a&&u>=1&&(e.setStrokeStyle(t,t.attribute,(o-n)/h,(l-i)/d,r),e.stroke()))}draw(t,e,n,i){const r=nr(t,null==i?void 0:i.theme).symbol;this._draw(t,r,!1,n,i)}};$o=Ho([K(),Vo(0,X(ht)),Vo(0,q(Ta)),Go("design:paramtypes",[Object])],$o);const Xo=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Ae)}allocate(t,e,n,i){if(!this.pools.length)return(new Ae).setValue(t,e,n,i);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=n,r.y2=i,r}allocateByObj(t){if(!this.pools.length)return new Ae(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};const Yo=new class extends mo{constructor(){super(...arguments),this.time=Ge.beforeFillStroke}drawShape(t,e,n,i,r,s,a,o,l,c,u,h){var d,f,p,g,m,b,y,v,x,_;const{backgroundMode:S=l.backgroundMode,backgroundFit:A=l.backgroundFit,backgroundKeepAspectRatio:w=l.backgroundKeepAspectRatio}=t.attribute;let T,{background:C}=t.attribute;if(!C)return;const B=()=>{"richtext"===t.type&&(e.restore(),e.save(),T&&e.setTransformFromMatrix(T,!0,1))};let k;"richtext"===t.type&&(T=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const M=Bt(C)&&C.background,P=t.transMatrix.onlyTranslate();if(M){const e=t.AABBBounds,n=(null!==(d=C.x)&&void 0!==d?d:e.x1)+(null!==(f=C.dx)&&void 0!==f?f:0),i=(null!==(p=C.y)&&void 0!==p?p:e.y1)+(null!==(g=C.dy)&&void 0!==g?g:0),r=null!==(m=C.width)&&void 0!==m?m:e.width(),s=null!==(b=C.height)&&void 0!==b?b:e.height();if(k=Xo.allocate(n,i,n+r,i+s),C=C.background,!P){const t=k.width(),e=k.height();k.set((null!==(y=C.x)&&void 0!==y?y:0)+(null!==(v=C.dx)&&void 0!==v?v:0),(null!==(x=C.y)&&void 0!==x?x:0)+(null!==(_=C.dy)&&void 0!==_?_:0),t,e)}}else k=t.AABBBounds,P||(k=ho(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const r=t.resources.get(C);if("success"!==r.state||!r.data)return void B();e.highPerformanceSave(),P&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,n,i,l),this.doDrawImage(e,r.data,k,{backgroundMode:S,backgroundFit:A,backgroundKeepAspectRatio:w}),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:r}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=C,r?(Ao(e,k.x1,k.y1,k.width(),k.height(),r,!0),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}M&&Xo.free(k),B()}};var Ko=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},qo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qo=function(t,e){return function(n,i){e(n,i,t)}};let Zo=class extends Uo{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Vs,this.builtinContributions=[Yo],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l,c,u;const h=nr(t,null==s?void 0:s.theme).text,{text:d,underline:f=h.underline,lineThrough:p=h.lineThrough,keepDirIn3d:g=h.keepDirIn3d,direction:m=h.direction,fontSize:b=h.fontSize,verticalMode:y=h.verticalMode,x:v=h.x,y:x=h.y}=t.attribute,_=null!==(l=mr(t.attribute.lineHeight,b))&&void 0!==l?l:b,S=this.valid(t,h,a,o);if(!S)return;const{fVisible:A,sVisible:w,doFill:T,doStroke:C}=S,B=!g,k=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,i,T,C,A,w,h,r,a,o),B&&this.transformUseContext2d(t,h,k,e);const M=(r,s,l,c)=>{let u=n+s;const d=i+l;if(c){e.highPerformanceSave(),u+=b;const t=ta.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,u,d),e.transformFromMatrix(t,!0),ta.free(t)}C&&(o?o(e,t.attribute,h):w&&(e.setStrokeStyle(t,t.attribute,v-n,x-i,h),e.strokeText(r,u,d,k))),T&&(a?a(e,t.attribute,h):A&&(e.setCommonStyle(t,t.attribute,v-n,x-i,h),e.fillText(r,u,d,k))),c&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,h,k),"horizontal"===m){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:l}=r.bbox;C&&(o?o(e,t.attribute,h):w&&(e.setStrokeStyle(t,t.attribute,v-n,x-i,h),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+l+i,k)})))),T&&(a?a(e,t.attribute,h):A&&(e.setCommonStyle(t,t.attribute,v-n,x-i,h),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+n,(r.topOffset||0)+l+i,k),this.drawUnderLine(f,p,t,(r.leftOffset||0)+s+n,(r.topOffset||0)+l+i,r.descent,(r.descent-r.ascent)/2,k,h,e,{width:r.width})}))))}else{let{textAlign:n=h.textAlign,textBaseline:i=h.textBaseline}=t.attribute;if(!y){const e=n;n=null!==(c=t.getBaselineMapAlign()[i])&&void 0!==c?c:"left",i=null!==(u=t.getAlignMapBaseline()[e])&&void 0!==u?u:"top"}t.tryUpdateAABBBounds();const r=t.cache,{verticalList:s}=r;e.textAlign="left",e.textBaseline="top";const a=_*s.length;let o=0;s.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);o=se(e,o)}));let l=0,d=0;"bottom"===i?d=-a:"middle"===i&&(d=-a/2),"center"===n?l-=o/2:"right"===n&&(l-=o),s.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),r=o-i;let s=l;"center"===n?s+=r/2:"right"===n&&(s+=r),t.forEach((t=>{const{text:n,width:i,direction:r}=t;M(n,a-(e+1)*_+d,s,r),s+=i}))}))}B&&this.restoreTransformUseContext2d(t,h,k,e),this.afterRenderStep(t,e,n,i,T,C,A,w,h,r,a,o)}draw(t,e,n,i){const r=nr(t,null==i?void 0:i.theme).text,{keepDirIn3d:s=r.keepDirIn3d}=t.attribute,a=!s;this._draw(t,r,a,n,i)}drawUnderLine(t,e,n,i,r,s,a,o,l,c,u){if(e+t<=0)return;const{textAlign:h=l.textAlign,fill:d=l.fill,opacity:f=l.opacity,underlineOffset:p=l.underlineOffset,underlineDash:g=l.underlineDash,fillOpacity:m=l.fillOpacity}=n.attribute,b=!Tt(u),y=b?u.width:n.clipedWidth,v=b?0:ka(h,y),x={lineWidth:0,stroke:d,opacity:f,strokeOpacity:m};if(t){x.lineWidth=t,c.setStrokeStyle(n,x,i,r,l),g&&c.setLineDash(g),c.beginPath();const e=r+s+p;c.moveTo(i+v,e,o),c.lineTo(i+v+y,e,o),c.stroke()}if(e){x.lineWidth=e,c.setStrokeStyle(n,x,i,r,l),c.beginPath();const t=r+a;c.moveTo(i+v,t,o),c.lineTo(i+v+y,t,o),c.stroke()}}};Zo=Ko([K(),Qo(0,X(ht)),Qo(0,q(Ca)),qo("design:paramtypes",[Object])],Zo);var Jo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},tl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},el=function(t,e){return function(n,i){e(n,i,t)}};const nl=["","repeat-x","repeat-y","repeat"];let il=class extends Uo{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Fs,this.builtinContributions=[Eo,Oo],this.init(t)}drawShape(t,e,n,i,r,s,a,o){const l=nr(t).image,{repeatX:c=l.repeatX,repeatY:u=l.repeatY,x:h=l.x,y:d=l.y,cornerRadius:f=l.cornerRadius,fillStrokeOrder:p=l.fillStrokeOrder,cornerType:g=l.cornerType,image:m}=t.attribute,b=this.valid(t,l,a);if(!b)return;const{fVisible:y,sVisible:v,doFill:x,doStroke:_}=b;if(!m||!t.resources)return;const S=t.resources.get(m);if("success"!==S.state)return;const A=t.width,w=t.height;e.beginPath();let T=!1;0===f||Et(f)&&f.every((t=>0===t))?e.rect(n,i,A,w):(Ao(e,n,i,A,w,f,"bevel"!==g),T=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const C=()=>{if(x)if(a)a(e,t.attribute,l);else if(y){e.setCommonStyle(t,t.attribute,n,i,l);let r=0;if("repeat"===c&&(r|=1),"repeat"===u&&(r|=2),r){const t=e.createPattern(S.data,nl[r]);e.fillStyle=t,e.translate(n,i,!0),e.fillRect(0,0,A,w),e.translate(-n,-i,!0)}else e.drawImage(S.data,n,i,A,w)}},B=()=>{_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,h-n,d-i,l),e.stroke()))};p?(B(),T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,i,x,!1,y,!1,l,r,a),C(),T&&e.restore()):(T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,i,x,!1,y,!1,l,r,a),C(),T&&e.restore(),B()),this.afterRenderStep(t,e,n,i,x,!1,y,!1,l,r,a)}draw(t,e,n){const{image:i}=t.attribute;if(!i||!t.resources)return;const r=t.resources.get(i);if("loading"===r.state&&Pt(i))return void lr.improveImageLoading(i);if("success"!==r.state)return;const{context:s}=e.drawParams;if(!s)return;const a=nr(t).image;this._draw(t,a,!1,n)}};il=Jo([K(),el(0,X(ht)),el(0,q(Aa)),tl("design:paramtypes",[Object])],il);const rl=Symbol.for("GraphicRender"),sl=Symbol.for("RectRender"),al=Symbol.for("SymbolRender"),ol=Symbol.for("TextRender"),ll=Symbol.for("RichTextRender"),cl=Symbol.for("ImageRender");let ul;function hl(){!function(){if(null==ul)try{const t=document.createElement("canvas"),e=t.getContext("2d");ul=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),ul&&(ul=!!document.createElement)}catch(t){ul=!1}}();const t=xt.global&&xt.global.env;return t?"browser"===t:ul}var dl=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},fl=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function o(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}l((i=i.apply(t,e||[])).next())}))};let pl=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new Ae}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}loadFont(t,e,n){return fl(this,void 0,void 0,(function*(){return{loadState:"fail"}}))}isMacOS(){return!1}copyToClipBoard(t){return Promise.resolve(null)}};pl=dl([K()],pl);let gl=!1;const ml=new U((t=>{gl||(gl=!0,t(jo).toSelf().inSingletonScope(),t(sl).to(jo).inSingletonScope(),t(rl).toService(sl),t(Bo).toSelf(),t(Co).toSelf(),t(wa).toService(Bo),t(wa).toService(Co),t(wa).toService(yo),ft(t,wa))}));let bl=!1;const yl=new U((t=>{bl||(bl=!0,t($o).toSelf().inSingletonScope(),t(al).to($o).inSingletonScope(),t(rl).toService(al),t(Ta).toService(yo),ft(t,Ta))}));let vl=!1;const xl=new U((t=>{vl||(vl=!0,t(ol).to(Zo).inSingletonScope(),t(rl).toService(ol),t(Ca).toService(yo),ft(t,Ca))}));var _l=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Sl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Al=class extends Uo{constructor(){super(),this.numberType=Hs,this.builtinContributions=[Yo],this.init()}drawShape(t,e,n,i,r){const s=nr(t).richtext,{strokeOpacity:a=s.strokeOpacity,opacity:o=s.opacity,fillOpacity:l=s.fillOpacity,visible:c=s.visible}=t.attribute;if(!t.valid||!c)return;const u=_a(o,l,!0),h=_a(o,a,!0);u&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,s),e.translate(n,i),this.beforeRenderStep(t,e,n,i,u,h,u,h,s,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,n,i,u,h,u,h,s,r))}drawIcon(t,e,n,i,r){var s;const a=nr(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:c=a.opacity,image:u,backgroundFill:h=a.backgroundFill,backgroundFillOpacity:d=a.backgroundFillOpacity,backgroundStroke:f=a.backgroundStroke,backgroundStrokeOpacity:p=a.backgroundStrokeOpacity,backgroundRadius:g=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:b=o,backgroundHeight:y=l}=t.attribute;if(m&&(n+=t._marginArray[3],i+=t._marginArray[0]),t._hovered){const t=(b-o)/2,r=(y-l)/2;0===g?(e.beginPath(),e.rect(n-t,i-r,b,y)):(e.beginPath(),Ao(e,n-t,i-r,b,y,g,!0)),h&&(e.globalAlpha=d,e.fillStyle=h,e.fill()),f&&(e.globalAlpha=p,e.strokeStyle=f,e.stroke())}const v=u&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(u));v&&"success"===v.state&&(e.globalAlpha=c,e.drawImage(v.data,n,i,o,l))}draw(t,e,n){const i=nr(t).richtext;this._draw(t,i,!1,n)}};Al=_l([K(),Sl("design:paramtypes",[])],Al);let wl=!1;const Tl=new U((t=>{wl||(wl=!0,t(ll).to(Al).inSingletonScope(),t(rl).toService(ll))}));let Cl=!1;const Bl=new U((t=>{Cl||(Cl=!0,t(cl).to(il).inSingletonScope(),t(rl).toService(cl),t(Aa).toService(yo),ft(t,Aa))}));class kl{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=D.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0,this.onWheel=t=>{try{const e=new t.constructor(t.type,t);this.pluginService.stage.window.getContext().getCanvas().nativeCanvas.dispatchEvent(e)}catch(t){return}}}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML([...t.stage.getChildren()])}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),this.release()}getWrapContainer(t,e,n){let i;return i=e?"string"==typeof e?xt.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:xt.global.createDom(Object.assign({tagName:"div",parent:i},n)),nativeContainer:i}}parseDefaultStyleFromGraphic(t){return function(t){const e={},n=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((n=>{t[n]&&(e[Ce(n)]=t[n])})),["fontSize","lineHeight"].forEach((i=>{const r=Ce(i);Tt(t[i])||(e[r]=n(t[i]))})),Ct(t.maxLineWidth)&&(e["max-width"]=n(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&Pt(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:nr(t).text)}getTransformOfText(t){const e=nr(t).text,{textAlign:n=e.textAlign,textBaseline:i=e.textBaseline}=t.attribute,r=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:s,scaleX:a,scaleY:o}=r,l={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},c={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:n,transform:`translate(${l[n]},${l[i]}) rotate(${s}deg) scaleX(${a}) scaleY(${o})`,transformOrigin:`${c[n]} ${c[i]}`}}updateStyleOfWrapContainer(t,e,n,i,r){const{pointerEvents:s,penetrateEventList:a=[]}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none","none"!==o.pointerEvents&&(this.removeWrapContainerEventListener(n),a.forEach((t=>{"wheel"===t&&n.addEventListener("wheel",this.onWheel)}))),n.style.position||(n.style.position="absolute",i.style.position="relative");let l=0,c=0;const u=t.globalAABBBounds;let h=r.anchorType;if(Tt(h)&&(h="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===h&&(h="top-left"),"position"===h||u.empty()){const e=t.globalTransMatrix;l=e.e,c=e.f}else{const t=((t,e)=>{const{x1:n,x2:i,y1:r,y2:s}=t,a=Math.abs(i-n),o=Math.abs(s-r);let l=(n+i)/2,c=(r+s)/2,u=0,h=0;switch(e){case"top":case"inside-top":h=-.5;break;case"bottom":case"inside-bottom":h=.5;break;case"left":case"inside-left":u=-.5;break;case"right":case"inside-right":u=.5;break;case"top-right":u=.5,h=-.5;break;case"top-left":u=-.5,h=-.5;break;case"bottom-right":u=.5,h=.5;break;case"bottom-left":u=-.5,h=.5}return l+=u*a,c+=h*o,{x:l,y:c}})(u,h);l=t.x,c=t.y}const d=xt.global.getElementTopLeft(i,!1),f=e.window.getTopLeft(!1),p=e.viewBox,g=l+f.left-d.left+p.x1,m=c+f.top-d.top+p.y1;if(o.left=`${g}px`,o.top=`${m}px`,"text"===t.type&&"position"===h&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),wt(r.style)){const e=r.style({top:m,left:g,width:u.width(),height:u.height()},t,n);e&&(o=Object.assign(Object.assign({},o),e))}else Bt(r.style)?o=Object.assign(Object.assign({},o),r.style):Pt(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),((t="")=>{const e={};return t.split(";").forEach((t=>{if(t){const n=t.split(":");if(2===n.length){const t=n[0].trim(),i=n[1].trim();t&&i&&(e[t]=i)}}})),e})(r.style)));xt.global.updateDom(n,{width:r.width,height:r.height,style:o})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===xt.global.env&&(t.sort(((t,e)=>{var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:Hn.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:Hn.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&xt.global.removeDom(e),this.htmlMap[t]=null}removeWrapContainerEventListener(t){t.removeEventListener("wheel",this.onWheel)}renderGraphicHTML(t){var e;const{html:n}=t.attribute;if(!n)return;const i=t.stage;if(!i)return;const{dom:r,container:s}=n;if(!r)return;const a=Tt(n.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:n.id;if(this.htmlMap&&this.htmlMap[a]&&s&&s!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])"string"==typeof r?this.htmlMap[a].wrapContainer.innerHTML=r:r!==this.htmlMap[a].wrapContainer.firstChild&&(this.htmlMap[a].wrapContainer.removeChild(this.htmlMap[a].wrapContainer.firstChild),this.htmlMap[a].wrapContainer.appendChild(r));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(i,s);t&&("string"==typeof r?t.innerHTML=r:t.appendChild(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:s,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:l}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,i,o,l,n),this.htmlMap[a].renderId=this.renderId}release(){"browser"===xt.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}class Ml extends kl{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=D.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:n,unmount:i}=this.htmlMap[t];e?xt.global.getRequestAnimationFrame()((()=>{e.unmount()})):i&&i(),n&&xt.global.removeDom(n),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:n}=t.attribute;if(!n)return;const i=t.stage;if(!i)return;const r=i.params.ReactDOM,{element:s,container:a}=n;if(!s||!r||!r.createRoot&&!r.render)return;const o=Tt(n.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:n.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])r.createRoot?this.htmlMap[o].root.render(s):r.render(s,this.htmlMap[o].wrapContainer);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(i,a);if(t)if(this.htmlMap||(this.htmlMap={}),r.createRoot){const n=r.createRoot(t);n.render(s),this.htmlMap[o]={root:n,wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId}}else r.render(s,t),this.htmlMap[o]={wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId,unmount:()=>{r.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:l,nativeContainer:c}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,i,l,c,n),this.htmlMap[o].renderId=this.renderId}}const Pl=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class El extends ba{constructor(t,e){super(t),this._skipRenderAttributes=Pl,(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,n,i){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);if(r)return this._setAttributes(r,n);Mt(this.attribute[t])&&Mt(e)&&!wt(this.attribute[t])&&!wt(e)?Vt(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,n){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t,this._setAttributes(t,e)}_setAttributes(t,e){const n=Object.keys(t);this._mergeAttributes(t,n),n.every((t=>this._skipRenderAttributes.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){Tt(e)&&(e=Object.keys(t));for(let n=0;n<e.length;n++){const i=e[n];!Mt(this.attribute[i])||wt(this.attribute[i])||wt(t[i])?this.attribute[i]=t[i]:Vt(this.attribute[i],t[i])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var n;const i=new ar(t,e);i.manager=null===(n=this.stage)||void 0===n?void 0:n.eventSystem.manager,this.dispatchEvent(i)}eventPosToStagePos(t){var e,n;const i={x:0,y:0},r=null!==(n=null===(e=this.stage)||void 0===e?void 0:e.eventPointTransform(t))&&void 0!==n?n:{x:0,y:0};return this.globalTransMatrix.transformPoint(r,i),i}}const Ol=Symbol.for("MathPickerContribution"),Ll=Symbol.for("MathImagePicker"),Rl=Symbol.for("MathRectPicker"),Il=Symbol.for("MathSymbolPicker"),Nl=Symbol.for("MathTextPicker"),Dl=Symbol.for("CanvasImagePicker"),Ul=Symbol.for("CanvasRectPicker"),zl=Symbol.for("CanvasSymbolPicker"),Wl=Symbol.for("CanvasTextPicker"),Fl=Symbol.for("CanvasRichTextPicker"),jl=Symbol.for("CanvasPickerContribution"),Hl={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"};var Gl=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Vl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$l=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function o(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}l((i=i.apply(t,e||[])).next())}))};class Xl{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function Yl(t,e=!1){const n=document.createElement("img");if(xt.global.isImageAnonymous&&(n.crossOrigin="anonymous"),e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return n.src=t,n.complete?Promise.resolve(n):new Promise(((t,e)=>{n.onload=()=>{t(n)},n.onerror=()=>{e(new Error("加载失败"))}}))}let Kl=class extends pl{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var n,i;let r=0,s=0,a=0,o=0;if(t.changedTouches){const e=null!==(n=t.changedTouches[0])&&void 0!==n?n:{};r=e.clientX||0,s=e.clientY||0,a=r,o=s}else r=t.clientX||0,s=t.clientY||0,a=t.offsetX||0,o=t.offsetY||0;if(e){const t=r,n=s,a=e.getBoundingClientRect(),o=null===(i=e.getNativeHandler)||void 0===i?void 0:i.call(e).nativeCanvas;let l,c;return o&&(l=a.width/o.offsetWidth,c=a.height/o.offsetHeight),{x:(t-a.left)/(Rt(l)?l:1),y:(n-a.top)/(Rt(c)?c:1)}}return{x:a,y:o}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new Xl(t)}return new Ae}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:n,height:i,style:r}=e;return r&&(Pt(r)?t.setAttribute("style",r):Object.keys(r).forEach((e=>{t.style[e]=r[e]}))),null!=n&&(t.style.width=`${n}px`),null!=i&&(t.style.height=`${i}px`),!0}createDom(t){const{tagName:e="div",parent:n}=t,i=document.createElement(e);if(this.updateDom(i,t),n){const t=Pt(n)?this.getElementById(n):n;t&&t.appendChild&&t.appendChild(i)}return i}loadImage(t){return Yl(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Yl(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,n;const i=document.createElement("canvas");t.id&&(i.id=null!==(e=t.id)&&void 0!==e?e:D.GenAutoIncrementId().toString());const r=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(i.style.width=`${t.width}px`,i.style.height=`${t.height}px`,i.width=t.width*r,i.height=t.height*r),i}createOffscreenCanvas(t){var e;const n=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*n,t.height*n)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,n){return document.addEventListener(t,e,n)}removeEventListener(t,e,n){return document.removeEventListener(t,e,n)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(...t){}getElementTop(t,e){let n=t.offsetTop,i=t.offsetParent;for(;null!==i;)n+=i.offsetTop,i=i.offsetParent;return n}getElementLeft(t,e){let n=t.offsetLeft,i=t.offsetParent;for(;null!==i;)n+=i.offsetLeft,i=i.offsetParent;return n}getElementTopLeft(t,e){let n=t.offsetTop,i=t.offsetLeft,r=t.offsetParent;for(;null!==r;)n+=r.offsetTop,i+=r.offsetLeft,r=r.offsetParent;return{top:n,left:i}}loadFont(t,e,n){return $l(this,void 0,void 0,(function*(){return new FontFace(t,Pt(e)?`url(${e})`:e,n).load().then((function(t){return document.fonts.add(t),{loadState:"success"}})).catch((function(t){return{loadState:"fail"}}))}))}isMacOS(){if(void 0===this._isMacOS)try{this._isMacOS=navigator.platform.toUpperCase().indexOf("MAC")>=0}catch(t){this._isMacOS=!1}return this._isMacOS}copyToClipBoard(t){return navigator.clipboard.writeText(t).then((()=>{})).catch((t=>{}))}};Kl=Gl([K(),Vl("design:paramtypes",[])],Kl);class ql{contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getGraphicTheme();i.highPerformanceSave();let{x:s=r.x,y:a=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,i.setTransformForCurrent()}else s=0,a=0,i.transformFromMatrix(t.transMatrix,!0);let o=!1,l=!1;return this.canvasRenderer.drawShape(t,i,s,a,{},null,((t,n,i,r)=>!(!o&&!l)||(o=t.isPointInPath(e.x,e.y),l=r||l,o)),((t,n,r,s)=>{if(o||l)return!0;const a=n.lineWidth||r.lineWidth,c=n.pickStrokeBuffer||r.pickStrokeBuffer,u=n.keepStrokeScale||r.keepStrokeScale;return i.lineWidth=u?a+c:oi(i,a+c,i.dpr),o=t.isPointInStroke(e.x,e.y),l=s||l,o})),i.highPerformanceRestore(),o}}var Ql=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a};let Zl=class{constructor(){this.type="image",this.numberType=Fs}contains(t,e,n){const{pickContext:i}=null!=n?n:{};return!!i&&!!t.AABBBounds.containsPoint(e)}};Zl=Ql([K()],Zl);let Jl=!1;const tc=new U(((t,e,n,i)=>{Jl||(Jl=!0,t(Ll).to(Zl).inSingletonScope(),t(Zl).toService(Ll))})),ec=new Ae;class nc{constructor(){this.type="rect",this.numberType=js}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getGraphicTheme(),{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:a=r.x,y:o=r.y}=t.attribute;i.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);a+=e.x,o+=e.y,i.setTransformForCurrent()}else a=0,o=0,l=!1,i.transformFromMatrix(t.transMatrix,!0);let c=!0;if(!l||t.shadowRoot||Lt(s,!0)&&0!==s||Et(s)&&s.some((t=>0!==t)))c=!1,this.canvasRenderer.drawShape(t,i,a,o,{},null,((t,n,i)=>!!c||(c=t.isPointInPath(e.x,e.y),c)),((t,n,r)=>{if(c)return!0;const s=n.lineWidth||r.lineWidth,a=n.pickStrokeBuffer||r.pickStrokeBuffer,o=n.keepStrokeScale||r.keepStrokeScale;return i.lineWidth=o?s+a:oi(i,s+a,i.dpr),c=t.isPointInStroke(e.x,e.y),c}));else{const{fill:n=r.fill,stroke:i=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(n)c=!0;else if(i){const n=t.AABBBounds;ec.setValue(n.x1,n.y1,n.x2,n.y2),ec.expand(-s/2),c=!ec.containsPoint(e)}}return i.highPerformanceRestore(),c}}var ic=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},rc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sc=function(t,e){return function(n,i){e(n,i,t)}};let ac=class extends nc{constructor(t){super(),this.canvasRenderer=t}};ac=ic([K(),sc(0,X(sl)),rc("design:paramtypes",[Object])],ac);let oc=!1;const lc=new U(((t,e,n,i)=>{oc||(oc=!0,t(Rl).to(ac).inSingletonScope(),t(Ol).toService(Rl))}));let cc=!1;const uc=new U(((t,e,n,i)=>{cc||(cc=!0,t(Ll).to(Zl).inSingletonScope(),t(Zl).toService(Ll))}));var hc=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},dc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fc=function(t,e){return function(n,i){e(n,i,t)}};let pc=class extends ql{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Gs}};pc=hc([K(),fc(0,X(al)),dc("design:paramtypes",[Object])],pc);let gc=!1;const mc=new U(((t,e,n,i)=>{gc||(gc=!0,t(Il).to(pc).inSingletonScope(),t(Ol).toService(Il))}));var bc=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a};let yc=class{constructor(){this.type="text",this.numberType=Vs}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};yc=bc([K()],yc);let vc=!1;const xc=new U(((t,e,n,i)=>{vc||(vc=!0,t(Nl).to(yc).inSingletonScope(),t(Ol).toService(Nl))}));var _c=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Sc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ac=function(t,e){return function(n,i){e(n,i,t)}};let wc=class extends nc{constructor(t){super(),this.canvasRenderer=t}};wc=_c([K(),Ac(0,X(sl)),Sc("design:paramtypes",[Object])],wc);let Tc=!1;const Cc=new U(((t,e,n,i)=>{Tc||(Tc=!0,t(Ul).to(wc).inSingletonScope(),t(jl).toService(Ul))}));class Bc extends Uo{contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getGraphicTheme();i.highPerformanceSave();const s=this.transform(t,r,i),{x:a,y:o,z:l,lastModelMatrix:c}=s;let u=e;if(i.camera){u=e.clone();const n=t.parent.globalTransMatrix;u.x=n.a*e.x+n.c*e.y+n.e,u.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let h=!1;return this.canvasRenderer.drawShape(t,i,a,o,n,null,((t,e,n)=>!!h||(h=t.isPointInPath(u.x,u.y),h))),this.canvasRenderer.z=0,i.modelMatrix!==c&&ea.free(i.modelMatrix),i.modelMatrix=c,i.highPerformanceRestore(),h}}var kc=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Mc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pc=function(t,e){return function(n,i){e(n,i,t)}};let Ec=class extends Bc{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Gs}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getParsedPath();if(!i.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}i.highPerformanceSave();const s=t.getGraphicTheme(),a=this.transform(t,s,i),{x:o,y:l,z:c,lastModelMatrix:u}=a;let h=e;if(i.camera){h=e.clone();const n=t.parent.globalTransMatrix;h.x=n.a*e.x+n.c*e.y+n.e,h.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=c;let d=!1;return this.canvasRenderer.drawShape(t,i,o,l,{},null,((t,e,n)=>!!d||(d=t.isPointInPath(h.x,h.y),d)),((t,e,n)=>{if(d)return!0;const r=e.lineWidth||n.lineWidth,s=e.pickStrokeBuffer||n.pickStrokeBuffer,a=e.keepStrokeScale||n.keepStrokeScale;return i.lineWidth=a?r+s:oi(i,r+s,i.dpr),d=t.isPointInStroke(h.x,h.y),d})),this.canvasRenderer.z=0,i.modelMatrix!==u&&ea.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore(),d}};Ec=kc([K(),Pc(0,X(al)),Mc("design:paramtypes",[Object])],Ec);let Oc=!1;const Lc=new U(((t,e,n,i)=>{Oc||(Oc=!0,t(zl).to(Ec).inSingletonScope(),t(jl).toService(zl))}));var Rc=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Ic=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Nc=function(t,e){return function(n,i){e(n,i,t)}};let Dc=class extends Bc{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Vs}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.AABBBounds;if(!i.camera)return!!r.containsPoint(e);i.highPerformanceSave();const s=t.getGraphicTheme(),{keepDirIn3d:a=s.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,s,i,o),{x:c,y:u,z:h,lastModelMatrix:d}=l;this.canvasRenderer.z=h;let f=e;if(i.camera){f=e.clone();const n=t.parent.globalTransMatrix;f.x=n.a*e.x+n.c*e.y+n.e,f.y=n.b*e.x+n.d*e.y+n.f}let p=!1;return this.canvasRenderer.drawShape(t,i,c,u,{},null,((e,n,i)=>{if(p)return!0;const{fontSize:r=s.fontSize,textBaseline:a=s.textBaseline,textAlign:o=s.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),g=l.width(),m=Ma(a,d,r),b=ka(o,g);return e.rect(b+c,m+u,g,d,h),p=e.isPointInPath(f.x,f.y),p}),((t,e,n)=>p)),this.canvasRenderer.z=0,i.modelMatrix!==d&&ea.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),p}};Dc=Rc([K(),Nc(0,X(ol)),Ic("design:paramtypes",[Object])],Dc);let Uc=!1;const zc=new U(((t,e,n,i)=>{Uc||(Uc=!0,t(Wl).to(Dc).inSingletonScope(),t(jl).toService(Wl))}));var Wc=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Fc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jc=function(t,e){return function(n,i){e(n,i,t)}};let Hc=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Hs}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};Hc=Wc([K(),jc(0,X(ll)),Fc("design:paramtypes",[Object])],Hc);let Gc=!1;const Vc=new U(((t,e,n,i)=>{Gc||(Gc=!0,t(Fl).to(Hc).inSingletonScope(),t(jl).toService(Fl))}));var $c=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Xc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yc=function(t,e){return function(n,i){e(n,i,t)}};let Kc=class extends ql{constructor(t){super(),this.canvasRenderer=t,this.type="image",this.numberType=Fs}};Kc=$c([K(),Yc(0,X(cl)),Xc("design:paramtypes",[Object])],Kc);let qc=!1;const Qc=new U(((t,e,n,i)=>{qc||(qc=!0,t(Dl).to(Kc).inSingletonScope(),t(jl).toService(Dl))})),Zc=hl();function Jc(){Jc.__loaded||(Jc.__loaded=!0,co.RegisterGraphicCreator("group",ya))}Jc.__loaded=!1;const tu=Jc;function eu(){eu.__loaded||(eu.__loaded=!0,co.RegisterGraphicCreator("image",to),yt.load(Bl),yt.load(Zc?Qc:tc))}eu.__loaded=!1;const nu=eu;function iu(){iu.__loaded||(iu.__loaded=!0,co.RegisterGraphicCreator("rect",Ya),yt.load(ml),yt.load(Zc?Cc:lc))}iu.__loaded=!1;const ru=iu;function su(){su.__loaded||(su.__loaded=!0,co.RegisterGraphicCreator("richtext",ao),yt.load(Tl),yt.load(Zc?Vc:uc))}su.__loaded=!1;const au=su;function ou(){ou.__loaded||(ou.__loaded=!0,co.RegisterGraphicCreator("symbol",Va),yt.load(yl),yt.load(Zc?Lc:mc))}ou.__loaded=!1;const lu=ou;function cu(){cu.__loaded||(cu.__loaded=!0,co.RegisterGraphicCreator("text",za),yt.load(xl),yt.load(Zc?zc:xc))}cu.__loaded=!1;const uu=cu;function hu(){hu.__loaded||(hu.__loaded=!0,co.RegisterGraphicCreator("wrapText",ja))}hu.__loaded=!1;const du=hu,fu="PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";var pu;function gu(t,e,n={}){if(!t)return{width:0,height:0};const i=ho({text:t,fontFamily:e.fontFamily||n.fontFamily||fu,fontSize:e.fontSize||n.fontSize||12,fontWeight:e.fontWeight||n.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||n.fontSize||12});return{width:i.width(),height:i.height()}}function mu(t,e="type"){return"rich"===function(t,e="type"){var n,i;return Bt(t.text)&&"type"in t.text?null!==(n=t.text.type)&&void 0!==n?n:"text":e in t&&null!==(i=t[e])&&void 0!==i?i:"text"}(t,e)}!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(pu||(pu={})),pu.selectedReverse,pu.selected,pu.hover,pu.hoverReverse;var bu=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};tu(),ru(),lu(),au(),uu();let yu=class t extends El{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(e,n){super((null==n?void 0:n.skipDefault)?e:Vt({},t.defaultAttributes,e)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,n;this.cacheStates();const{text:i="",textStyle:r={},shape:s={},panel:a={},space:o=4,minWidth:l,maxWidth:c,padding:u=4,visible:h,state:d,type:f,textAlwaysCenter:p,containerTextAlign:g}=this.attribute,m=function(t){if(Rt(t))return[t,t,t,t];if(Et(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,n]=t;return[e,n,e,n]}if(3===e){const[e,n,i]=t;return[e,n,i,n]}if(4===e)return t}if(Bt(t)){const{top:e=0,right:n=0,bottom:i=0,left:r=0}=t;return[e,n,i,r]}return[0,0,0,0]}(u),b=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let y,v=-m[3],x=-m[0],_=m[1]+m[3],S=m[0]+m[2],A=0,w=0;const{visible:T}=s,C=bu(s,["visible"]);if(At(T)){const t=(null==C?void 0:C.size)||10,e=Lt(t)?t:Math.max(t[0],t[1]);y=b.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},C),{visible:T,x:e/2,y:e/2}),"symbol"),Ft(null==d?void 0:d.shape)||(y.states=d.shape),T&&(w=e+o)}let B,k,M;if(_+=w,A+=w,mu({text:i})||"rich"===f){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,n;return Ct(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(n=t.height)&&void 0!==n?n:0,t.textConfig=t.text.text||t.text,t}(Object.assign({type:f,text:i},r))),r),{visible:Ct(i)&&!1!==h,x:A,y:0});Tt(t.lineHeight)&&(t.lineHeight=r.fontSize),B=b.createOrUpdateChild("tag-text",t,"richtext"),k=B.AABBBounds.width(),M=B.AABBBounds.height()}else{const n=Object.assign(Object.assign({text:Bt(i)&&"type"in i&&"text"===i.type?i.text:i,visible:Ct(i)&&!1!==h,lineHeight:null==r?void 0:r.fontSize},r),{x:A,y:0});Tt(n.lineHeight)&&(n.lineHeight=r.fontSize),B=b.createOrUpdateChild("tag-text",n,"text");const s=gu(n.text,r,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text);k=s.width,M=s.height}_+=k;const P=null!==(n=s.size)&&void 0!==n?n:10,E=Lt(P)?P:Math.max(P[0],P[1]);S+=Math.max(M,s.visible?E:0);const{textAlign:O,textBaseline:L}=r;(Ct(l)||Ct(c))&&(Ct(l)&&_<l&&(_=l),Ct(c)&&_>c&&(_=c,B.setAttribute("maxLineWidth",c-m[1]-m[2]))),v=0,x=0;let R=0;"left"===O||"start"===O?R=1:"right"===O||"end"===O?R=-1:"center"===O&&(R=0),R?R<0?(v-=_,y&&y.setAttribute("x",(y.attribute.x||0)-k),b.setAttribute("x",-m[1]-w)):R>0&&b.setAttribute("x",m[3]):(v-=_/2,y&&y.setAttribute("x",(y.attribute.x||0)-k/2),b.setAttribute("x",-w/2));const I="right"===g||"end"===g,N="left"===g||"start"===g,D=(t,e)=>{var n;"richtext"===B.type?B.setAttributes({x:t,textAlign:e,textConfig:(n=B.attribute.textConfig,Ct(n)?Et(n)?n:[n]:[]).map((t=>Object.assign(Object.assign({},t),{textAlign:e})))}):B.setAttributes({x:t,textAlign:e})};if((g?"center"===g:p)&&R){const t=_-m[1]-m[3],e=k+w,n=1===R?(t-e)/2+w+k/2:m[0]+w-(_/2+e/2-w)+k/2;if(D(n,"center"),y){const t=n-k/2-w+E/2;y.setAttributes({x:t})}}if(N&&1!==R){const t=_-m[1]-m[3],e=0===R?-t/2+w/2:-_+m[3]+m[1]+w;if(D(e+w,"left"),y){const t=e+E/2;y.setAttributes({x:t})}}if(I&&-1!==R){const t=_-m[1]-m[3],e=0===R?t/2+w/2:t;if(D(e,"right"),y){const t=e-k-w+E/2;y.setAttributes({x:t})}}"middle"===L?(x-=S/2,y&&y.setAttribute("y",0)):"bottom"===L?(x-=S,y&&y.setAttribute("y",-M/2),b.setAttribute("y",-m[2])):"top"===L&&(b.setAttribute("y",m[0]),y&&y.setAttribute("y",M/2)),Ft(null==d?void 0:d.text)||(B.states=d.text);const{visible:U}=a,z=bu(a,["visible"]);if(h&&At(U)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},z),{visible:U&&!!i,width:_,height:S,x:v,y:x}),"rect");if(Ft(null==d?void 0:d.panel)||(t.states=d.panel),z.customShape){const e=z.customShape;t.pathProxy=t=>e(this,t,new Rn)}this._bgRect=t}this._textShape=B,this._symbol=y,this.resetStates()}initAttributes(e,n){e=(null==n?void 0:n.skipDefault)?e:Vt({},t.defaultAttributes,e),super.initAttributes(e),this.render()}addState(t,e,n){super.addState(t,e,n),this._textShape&&this._textShape.addState(t,e,n),this._bgRect&&this._bgRect.addState(t,e,n),this._symbol&&this._symbol.addState(t,e,n)}removeState(t,e){super.removeState(t,e),this._textShape&&this._textShape.removeState(t,e),this._bgRect&&this._bgRect.removeState(t,e),this._symbol&&this._symbol.removeState(t,e)}cacheStates(){var t,e,n,i,r,s,a,o,l,c,u,h,d,f;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(r=null===(i=null===(n=this._bgRect)||void 0===n?void 0:n.currentStates)||void 0===i?void 0:i.slice())&&void 0!==r?r:[],this._symbolStates=null!==(o=null===(a=null===(s=this._symbol)||void 0===s?void 0:s.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(u=null===(c=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===c?void 0:c.slice())&&void 0!==u?u:[],this.clearStates(),null===(h=this._bgRect)||void 0===h||h.clearStates(),null===(d=this._symbol)||void 0===d||d.clearStates(),null===(f=this._textShape)||void 0===f||f.clearStates()}resetStates(){var t,e,n;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null===(t=this._bgRect)||void 0===t||t.useStates(this._rectStates)),this._symbolStates.length&&(null===(e=this._symbol)||void 0===e||e.useStates(this._symbolStates)),this._textStates.length&&(null===(n=this._textShape)||void 0===n||n.useStates(this._textStates))}};yu.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};tu(),ru(),uu(),nu();class vu extends El{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:Vt({},vu.defaultAttributes,t)),this._handlePointerUp=()=>{this.attribute.disabled||(this.attribute.checked?(this.setAttribute("checked",!1),this.setAttribute("indeterminate",!1)):(this.setAttribute("checked",!0),this.setAttribute("indeterminate",!1)),this._dispatchEvent("checkbox_state_change",{eventType:"checkbox_state_change",checked:this.attribute.checked}),this.stage.renderNextFrame())},this.renderGroup(),this.onBeforeAttributeUpdate=(t,e,n)=>{"interactive"in t&&this.setAttribute("pickable",t.interactive),"disabled"in t&&this.setAttribute("cursor",t.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("pointerup",this._handlePointerUp)}render(){this.removeAllChild(!0),this.renderBox(),this.renderIcon(),this.renderText(),this.layout()}renderBox(){this._box=new Xa(Vt({},this.attribute.box));const t=this.attribute.checked||this.attribute.indeterminate;t&&this.attribute.disabled?this._box.setAttributes({fill:this.attribute.box.disableCheckedFill,stroke:this.attribute.box.disableCheckedStroke}):t?this._box.setAttributes({fill:this.attribute.box.checkedFill,stroke:this.attribute.box.checkedStroke}):this.attribute.disabled&&this._box.setAttributes({fill:this.attribute.box.disableFill}),this.appendChild(this._box)}renderIcon(){this._checkIcon=new Ja(Vt({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new Ja(Vt({image:this.attribute.icon.indeterminateIconImage},this.attribute.icon)),this.appendChild(this._indeterminateIcon),this.attribute.checked?(this._checkIcon.setAttribute("visible",!0),this._indeterminateIcon.setAttribute("visible",!1)):this.attribute.indeterminate?(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!0)):(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!1))}renderText(){this._text=new Ua(Vt({wrap:!0},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=this.attribute.box.height,e=this.attribute.icon.height,n=this._text.AABBBounds.height(),i=Math.max(t,e,n),r=i/2-t/2,s=i/2-e/2,a=i/2-n/2,o=this.attribute.box.width,l=this.attribute.icon.width,c=Math.max(o,l),u=c/2-o/2,h=c/2-l/2,d=c+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:u,y:r}),this._checkIcon.setAttributes({x:h,y:s}),this._indeterminateIcon.setAttributes({x:h,y:s}),this._text.setAttributes({x:d,y:a})}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:Vt({},vu.defaultAttributes,t),super.initAttributes(t),this.renderGroup(),this.render()}}vu.defaultAttributes={interactive:!0,disabled:!1,checked:!1,indeterminate:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},icon:{checkIconImage:'<svg width="200" height="200" viewBox="0 0 1024 1024" fill="#fff" xmlns="http://www.w3.org/2000/svg"><path d="M877.44815445 206.10060629a64.72691371 64.72691371 0 0 0-95.14856334 4.01306852L380.73381888 685.46812814 235.22771741 533.48933518a64.72691371 64.72691371 0 0 0-92.43003222-1.03563036l-45.82665557 45.82665443a64.72691371 64.72691371 0 0 0-0.90617629 90.61767965l239.61903446 250.10479331a64.72691371 64.72691371 0 0 0 71.19960405 15.14609778 64.33855261 64.33855261 0 0 0 35.08198741-21.23042702l36.24707186-42.71976334 40.5190474-40.77795556-3.36579926-3.49525333 411.40426297-486.74638962a64.72691371 64.72691371 0 0 0-3.88361443-87.64024149l-45.3088404-45.43829334z"></path></svg>',indeterminateIconImage:'<svg width="200" height="200" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5" d="M5 12h14"/></svg>',width:10,height:10,pickable:!1},box:{width:14,height:14,cornerRadius:2,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}},tu(),ru(),du(),nu();let xu=class t extends El{constructor(e,n){super((null==n?void 0:n.skipDefault)?e:Vt({},t.defaultAttributes,e)),this._handlePointerUp=()=>{this.attribute.disabled||this.attribute.checked||(this.setAttribute("checked",!0),this._dispatchEvent("radio_checked",{eventType:"radio_checked",target:this}),this.stage.renderNextFrame())},this.renderGroup(),this.onBeforeAttributeUpdate=(t,e,n)=>{"interactive"in t&&this.setAttribute("pickable",t.interactive),"disabled"in t&&this.setAttribute("cursor",t.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("pointerup",this._handlePointerUp)}render(){this.removeAllChild(!0),this.renderCircle(),this.renderText(),this.layout()}renderCircle(){this._circle=new lo(Vt({},this.attribute.circle));const t=this.attribute.checked;t&&this.attribute.disabled?this._circle.setAttributes({fill:this.attribute.circle.disableCheckedFill,stroke:this.attribute.circle.disableCheckedStroke}):t?this._circle.setAttributes({fill:this.attribute.circle.checkedFill,stroke:this.attribute.circle.checkedStroke}):this.attribute.disabled&&this._circle.setAttributes({fill:this.attribute.circle.disableFill}),this.appendChild(this._circle)}renderText(){this._text=new Ua(Vt({},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=2*(this.attribute.circle.outerRadius+this.attribute.circle.lineWidth),e=this._text.AABBBounds.height(),n=Math.max(t,e),i=n/2-t/2+this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,r=n/2-e/2,s=2*(this.attribute.circle.outerRadius+this.attribute.circle.lineWidth),a=this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,o=s+this.attribute.spaceBetweenTextAndIcon;this._circle.setAttributes({x:a,y:i}),this._text.setAttributes({x:o,y:r})}initAttributes(e,n){e=(null==n?void 0:n.skipDefault)?e:Vt({},t.defaultAttributes,e),super.initAttributes(e),this.renderGroup(),this.render()}};xu.defaultAttributes={interactive:!0,disabled:!1,checked:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},circle:{outerRadius:7,innerRadius:3,startAngle:0,endAngle:2*Math.PI,lineWidth:1,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}};class _u extends Ml{removeElement(t){super.removeElement(t),delete this.htmlMap[t]}renderGraphicHTML(t){const{react:e}=t.attribute;if(!e)return;const n=t.stage;if(!n)return;const i=n.params.ReactDOM,{element:r}=e;let{container:s}=e;if(s&&(s=function(t){const e=function(t){for(;t&&t.parent;){if("custom-container"===t.name)return t;t=t.parent}return null}(t);if(!e)return null;const{col:n,row:i,stage:r}=e;let{container:s}=t.attribute.react;const{table:a}=r;s===a.bodyDomContainer&&n<a.frozenColCount&&i>=a.rowCount-a.bottomFrozenRowCount?s=a.bottomFrozenBodyDomContainer:s===a.bodyDomContainer&&n>=a.colCount-a.rightFrozenColCount&&i>=a.rowCount-a.bottomFrozenRowCount?s=a.rightFrozenBottomDomContainer:s===a.bodyDomContainer&&i>=a.rowCount-a.bottomFrozenRowCount?s=a.bottomFrozenBodyDomContainer:s===a.bodyDomContainer&&n<a.frozenColCount?s=a.frozenBodyDomContainer:s===a.bodyDomContainer&&n>=a.colCount-a.rightFrozenColCount?s=a.rightFrozenBodyDomContainer:s===a.headerDomContainer&&n<a.frozenColCount?s=a.frozenHeaderDomContainer:s===a.headerDomContainer&&n>=a.colCount-a.rightFrozenColCount&&(s=a.rightFrozenHeaderDomContainer);return s}(t)),!r||!i||!i.createRoot&&!i.render)return;const a=c(e.id)?`${t.id??t._uid}_react`:e.id;if(this.htmlMap&&this.htmlMap[a]&&s&&s!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])i.createRoot?this.htmlMap[a].root.render(r):i.render(r,this.htmlMap[a].wrapContainer);else{const{wrapContainer:e,nativeContainer:o}=this.getWrapContainer(n,s);if(e)if(this.htmlMap||(this.htmlMap={}),i.createRoot){const n=i.createRoot(e);n.render(r),this.htmlMap[a]={root:n,wrapContainer:e,nativeContainer:o,container:s,renderId:this.renderId,graphic:t}}else i.render(r,e),this.htmlMap[a]={wrapContainer:e,nativeContainer:o,container:s,renderId:this.renderId,unmount:()=>{i.unmountComponentAtNode(e)},graphic:t}}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:l}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,n,o,l,e),this.htmlMap[a].renderId=this.renderId}getWrapContainer(t,e,n){let i;return i=e?"string"==typeof e?xt.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:xt.global.createDom({tagName:"div",parent:i,...n}),nativeContainer:i}}updateStyleOfWrapContainer(t,e,n,i,r){const{pointerEvents:s,penetrateEventList:a=[]}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none","none"!==o.pointerEvents&&(this.removeWrapContainerEventListener(n),a.forEach((t=>{"wheel"===t&&(n.addEventListener("wheel",this.onWheel),n.addEventListener("wheel",(t=>{t.preventDefault()}),!0))}))),n.style.position||(n.style.position="absolute");let u=0,d=0;const f=t.globalAABBBounds;let g=r.anchorType;if(c(g)&&(g="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===g&&(g="top-left"),"position"===g||f.empty()){const e=t.globalTransMatrix;u=e.e,d=e.f}else{const t=((t,e)=>{const{x1:n,x2:i,y1:r,y2:s}=t,a=Math.abs(i-n),o=Math.abs(s-r);let l=(n+i)/2,c=(r+s)/2,u=0,h=0;switch(e){case"top":case"inside-top":h=-.5;break;case"bottom":case"inside-bottom":h=.5;break;case"left":case"inside-left":u=-.5;break;case"right":case"inside-right":u=.5;break;case"top-right":u=.5,h=-.5;break;case"top-left":u=-.5,h=-.5;break;case"bottom-right":u=.5,h=.5;break;case"bottom-left":u=-.5,h=.5}return l+=u*a,c+=h*o,{x:l,y:c}})(f,g);u=t.x,d=t.y}const m=xt.global.getElementTopLeft(i,!1),b=e.window.getTopLeft(!1),y=u+b.left-m.left,v=d+b.top-m.top;if(o.left=`${y}px`,o.top=`${v}px`,"text"===t.type&&"position"===g&&(o={...o,...this.getTransformOfText(t)}),l(r.style)){const e=r.style({top:v,left:y,width:f.width(),height:f.height()},t,n);e&&(o={...o,...e})}else h(r.style)?o={...o,...r.style}:p(r.style)&&r.style&&(o={...o,...C(r.style)});xt.global.updateDom(n,{width:r.width,height:r.height,style:o,graphic:t})}drawHTML(){"browser"===xt?.global?.env&&(this.pluginService.stage.children.sort(((t,e)=>(t.attribute.zIndex??Hn.zIndex)-(e.attribute.zIndex??Hn.zIndex))).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}}const Su=new U(((t,e,n,i)=>{t(Au).toSelf().inSingletonScope(),n(bt)?i(bt).toService(Au):t(bt).toService(Au)}));class Au extends Kl{updateDom(t,n){const i=t.parentElement;if(i&&n.graphic){const r=parseInt(n.style.top,10),s=parseInt(n.style.left,10);let a,o;if(t.style.display="none"){const t=e.getTargetCell(n.graphic);a=t.attribute.width??1,o=t.attribute.height??1}else a=t.offsetWidth,o=t.offsetHeight;if(r+o<0||s+a<0||r>i.offsetHeight||s>i.offsetWidth)return t.style.display="none",!1}const{width:r,height:s,style:a}=n;return a&&(p(a)?t.setAttribute("style",a):Object.keys(a).forEach((e=>{t.style[e]=a[e]}))),null!=r&&(t.style.width=`${r}px`),null!=s&&(t.style.height=`${s}px`),!0}}hl()&&yt.load(Su);const wu=["children","hooks","ref",...R,"skipFunctionDiff","onError","onReady","option","records","container","vtableConstrouctor"],Tu=(t,e)=>`${t&&t.type&&(t.type.displayName||t.type.name)}-${e}`,Cu=n.forwardRef(((t,e)=>{const[r,s]=n.useState(0),a=n.useRef({});n.useImperativeHandle(e,(()=>a.current?.table));const o=!!t.option,l=!!t.records,u=n.useRef(!1),h=n.useRef(S(t,wu)),d=n.useRef(null),f=n.useRef(t.records),p=n.useRef(null),g=!!t.skipFunctionDiff,m=!!t.keepColumnWidthChange,b=n.useRef(new Map),y=n.useRef([]),v=n.useRef([]),x=n.useCallback((t=>o&&t.option?l&&t.records?{...t.option,clearDOM:!1,records:t.records}:{...t.option,clearDOM:!1}:{records:t.records,...h.current,...d.current,clearDOM:!1,customConfig:{...h.current.customConfig,createReactContainer:!0}}),[o,l]),_=n.useCallback((t=>{const e=new t.vtableConstrouctor(t.container,x(t));e.scenegraph.stage.reactAttribute=t.ReactDOM,e.scenegraph.stage.pluginService.register(t.reactAttributePlugin??new _u),e.scenegraph.stage.params.ReactDOM=t.ReactDOM,a.current={...a.current,table:e},u.current=!1,b.current.clear(),y.current=[],v.current=[],e.on("resize_column_end",(t=>{const n=a.current.table;if(!m)return;const{col:i,colWidths:r}=t,s=r[i];if(e.isPivotTable()){const t=n.getCellHeaderPaths(i,n.columnHeaderLevelCount);let e;e="rowHeader"===t.cellLocation?t.rowHeaderPaths:t.colHeaderPaths;let r=!1;y.current.forEach((t=>{JSON.stringify(t.dimensions)===JSON.stringify(e)&&(t.width=s,r=!0)})),r||y.current.push({dimensions:e,width:s})}else{const t=n.getBodyColumnDefine(i,0);t?.key&&b.current.set(t.key,s)}}))}),[x]),A=n.useCallback((()=>{if(!u.current){if(!a.current||!a.current.table)return;N(a.current.table,t,p.current,L),s(r+1),t.onReady&&t.onReady(a.current.table,0===r)}}),[r,s,t]),w=n.useCallback((()=>{a.current.table&&(a.current.table.render(),A())}),[A]);return n.useEffect((()=>{const e=o?null:(t=>{const e={};return E(t.children).map(((t,n)=>{const i=t&&t.type&&t.type.parseOption;if(i&&t.props){const r=i(c(t.props.componentId)?{...t.props,componentId:Tu(t,n)}:t.props);t.key&&(r.option.key=t.key),r.isSingle?e[r.optionName]=r.option:(e[r.optionName]||(e[r.optionName]=[]),e[r.optionName].push(r.option))}})),e})(t);if(!a.current?.table)return o||(d.current=e),_(t),w(),void(p.current=t);if(o){if(T(p.current.option,t.option,{skipFunction:g})){if(l&&!T(p.current.records,t.records,{skipFunction:g})){if(m){const t=ku(b.current,y.current,a.current.table);a.current.table.internalProps.columnWidthConfig=t,a.current.table.internalProps.columnWidthConfigForRowHeader=t}a.current.table.setRecords(t.records),A(),p.current=t}}else{const e=x(t);if(m){const t=ku(b.current,y.current,a.current.table);e.columnWidthConfig=t,e.columnWidthConfigForRowHeader=t}a.current.table.updateOption(e),A(),p.current=t}return}const n=S(t,wu);if(T(n,h.current,{skipFunction:g})&&T(e,d.current,{skipFunction:g})){if(l&&!T(t.records,f.current,{skipFunction:g})){if(f.current=t.records,m){const t=ku(b.current,y.current,a.current.table);a.current.table.internalProps.columnWidthConfig=t,a.current.table.internalProps.columnWidthConfigForRowHeader=t}a.current.table.setRecords(t.records),A(),p.current=t}}else{h.current=n,d.current=e;const i=x(t);if(m){const t=ku(b.current,y.current,a.current.table);i.columnWidthConfig=t,i.columnWidthConfigForRowHeader=t}a.current.table.updateOption(i),A(),p.current=t}}),[_,o,l,x,A,w,g,t]),n.useEffect((()=>()=>{a&&a.current&&a.current.table&&(a.current.table.release(),a.current=null),p.current=null,u.current=!0}),[]),n.createElement(i.Provider,{value:a.current},E(t.children).map(((t,e)=>{if("string"==typeof t)return;const i=Tu(t,e);return n.createElement(n.Fragment,{key:i},n.cloneElement(t,{updateId:r,componentId:i,componentIndex:e}))})))})),Bu=(t,e,i)=>{const r=function(t,e="TableContainer",i){const r=n.forwardRef(((e,r)=>{const s=n.useRef(),[a,o]=n.useState(!1),{className:l,style:c,width:u,...h}=e;return n.useLayoutEffect((()=>{o(!0)}),[]),n.createElement("div",{ref:s,className:l,style:{position:"relative",height:e.height||"100%",width:e.width||"100%",...c}},a?n.createElement(t,{ref:r,container:s.current,...i?i(h):h}):n.createElement(n.Fragment,null))}));return r.displayName=e||t.name,r}(Cu,t,(t=>e?Object.assign(t,e):t));return r.displayName=t,r};function ku(t,e,n){if(n.isPivotTable())return e;const i=[];return t.forEach(((t,e)=>{i.push({key:e,width:t})})),i}const Mu=Bu("ListTable",{type:"list-table",vtableConstrouctor:e.ListTable}),Pu=Bu("PivotTable",{type:"pivot-table",vtableConstrouctor:e.PivotTable}),Eu=Bu("PivotChart",{type:"pivot-chart",vtableConstrouctor:e.PivotChart});const Ou=Bu("ListTable",{type:"list-table",vtableConstrouctor:e.ListTableSimple}),Lu=Bu("PivotTable",{type:"pivot-table",vtableConstrouctor:e.PivotTableSimple});var Ru,Iu,Nu,Du,Uu={exports:{}},zu={exports:{}},Wu={};function Fu(){return Iu||(Iu=1,zu.exports=(Ru||(Ru=1,function(t){function e(t,e){var n=t.length;t.push(e);t:for(;0<n;){var i=n-1>>>1,s=t[i];if(!(0<r(s,e)))break t;t[i]=e,t[n]=s,n=i}}function n(t){return 0===t.length?null:t[0]}function i(t){if(0===t.length)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;t:for(var i=0,s=t.length,a=s>>>1;i<a;){var o=2*(i+1)-1,l=t[o],c=o+1,u=t[c];if(0>r(l,n))c<s&&0>r(u,l)?(t[i]=u,t[c]=n,i=c):(t[i]=l,t[o]=n,i=o);else{if(!(c<s&&0>r(u,n)))break t;t[i]=u,t[c]=n,i=c}}}return e}function r(t,e){var n=t.sortIndex-e.sortIndex;return 0!==n?n:t.id-e.id}if("object"==typeof performance&&"function"==typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],c=[],u=1,h=null,d=3,f=!1,p=!1,g=!1,m="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function v(t){for(var r=n(c);null!==r;){if(null===r.callback)i(c);else{if(!(r.startTime<=t))break;i(c),r.sortIndex=r.expirationTime,e(l,r)}r=n(c)}}function x(t){if(g=!1,v(t),!p)if(null!==n(l))p=!0,O(_);else{var e=n(c);null!==e&&L(x,e.startTime-t)}}function _(e,r){p=!1,g&&(g=!1,b(T),T=-1),f=!0;var s=d;try{for(v(r),h=n(l);null!==h&&(!(h.expirationTime>r)||e&&!k());){var a=h.callback;if("function"==typeof a){h.callback=null,d=h.priorityLevel;var o=a(h.expirationTime<=r);r=t.unstable_now(),"function"==typeof o?h.callback=o:h===n(l)&&i(l),v(r)}else i(l);h=n(l)}if(null!==h)var u=!0;else{var m=n(c);null!==m&&L(x,m.startTime-r),u=!1}return u}finally{h=null,d=s,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,A=!1,w=null,T=-1,C=5,B=-1;function k(){return!(t.unstable_now()-B<C)}function M(){if(null!==w){var e=t.unstable_now();B=e;var n=!0;try{n=w(!0,e)}finally{n?S():(A=!1,w=null)}}else A=!1}if("function"==typeof y)S=function(){y(M)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,E=P.port2;P.port1.onmessage=M,S=function(){E.postMessage(null)}}else S=function(){m(M,0)};function O(t){w=t,A||(A=!0,S())}function L(e,n){T=m((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(t){t.callback=null},t.unstable_continueExecution=function(){p||f||(p=!0,O(_))},t.unstable_forceFrameRate=function(t){0>t||125<t||(C=0<t?Math.floor(1e3/t):5)},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(t){switch(d){case 1:case 2:case 3:var e=3;break;default:e=d}var n=d;d=e;try{return t()}finally{d=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=d;d=t;try{return e()}finally{d=n}},t.unstable_scheduleCallback=function(i,r,s){var a=t.unstable_now();switch(s="object"==typeof s&&null!==s&&"number"==typeof(s=s.delay)&&0<s?a+s:a,i){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return i={id:u++,callback:r,priorityLevel:i,startTime:s,expirationTime:o=s+o,sortIndex:-1},s>a?(i.sortIndex=s,e(c,i),null===n(l)&&i===n(c)&&(g?(b(T),T=-1):g=!0,L(x,s-a))):(i.sortIndex=o,e(l,i),p||f||(p=!0,O(_))),i},t.unstable_shouldYield=k,t.unstable_wrapCallback=function(t){var e=d;return function(){var n=d;d=e;try{return t.apply(this,arguments)}finally{d=n}}}}(Wu)),Wu)),zu.exports}
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vtable"),require("react")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ReactVTable={},t.VTable,t.React)}(this,(function(t,e,n){"use strict";const i=n.createContext(null);function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}i.displayName="TableContext";var s={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,i,s,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,s||t,a),l=n?n+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 i:delete t._events[e]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,a=new Array(s);r<s;r++)a[r]=i[r].fn;return a},o.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},o.prototype.emit=function(t,e,i,r,s,a){var o=n?n+t:t;if(!this._events[o])return!1;var l,c,u=this._events[o],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,r),!0;case 5:return u.fn.call(u.context,e,i,r,s),!0;case 6:return u.fn.call(u.context,e,i,r,s,a),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(t,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,e);break;case 3:u[c].fn.call(u[c].context,e,i);break;case 4:u[c].fn.call(u[c].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},o.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},o.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},o.prototype.removeListener=function(t,e,i,r){var s=n?n+t:t;if(!this._events[s])return this;if(!e)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||i&&o.context!==i||a(this,s);else{for(var l=0,c=[],u=o.length;l<u;l++)(o[l].fn!==e||r&&!o[l].once||i&&o[l].context!==i)&&c.push(o[l]);c.length?this._events[s]=1===c.length?c[0]:c:a(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o}(s);var a=r(s.exports);var o=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var l=t=>"function"==typeof t;var c=t=>null==t;var u=t=>null!=t;var h=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var d=t=>"object"==typeof t&&null!==t;var f=function(t){if(!d(t)||!o(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 p=(t,e=!1)=>{const n=typeof t;return e?"string"===n:"string"===n||o(t,"String")};var g=t=>Array.isArray?Array.isArray(t):o(t,"Array");var m=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var b=(t,e=!1)=>{const n=typeof t;return e?"number"===n:"number"===n||o(t,"Number")};function y(t,e,n=!1,i=!1){if(e){if(t===e)return;if(u(e)&&"object"==typeof e){const r=Object(e),s=[];for(const t in r)s.push(t);let{length:a}=s,o=-1;for(;a--;){const a=s[++o];!u(r[a])||"object"!=typeof r[a]||i&&g(t[a])?x(t,a,r[a]):v(t,e,a,n,i)}}}}function v(t,e,n,i=!1,r=!1){const s=t[n],a=e[n];let o=e[n],l=!0;if(g(a)){if(i)o=[];else if(g(s))o=s;else if(m(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else f(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):l=!1;l&&y(o,a,i,r),x(t,n,o)}function x(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function _(t,...e){let n=-1;const i=e.length;for(;++n<i;)y(t,e[n],!0);return t}function S(t,e){if(!t||!f(t))return t;const n={};return Object.keys(t).forEach((i=>{const r=t[i];let s=!1;e.forEach((t=>{(p(t)&&t===i||t instanceof RegExp&&i.match(t))&&(s=!0)})),s||(n[i]=r)})),n}function A(t){return Object.prototype.toString.call(t)}function w(t){return Object.keys(t)}function T(t,e,n){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(A(t)!==A(e))return!1;if(l(t))return!!(null==n?void 0:n.skipFunction);if("object"!=typeof t)return!1;if(g(t)){if(t.length!==e.length)return!1;for(let i=t.length-1;i>=0;i--)if(!T(t[i],e[i],n))return!1;return!0}if(!f(t))return!1;const i=w(t),r=w(e);if(i.length!==r.length)return!1;i.sort(),r.sort();for(let t=i.length-1;t>=0;t--)if(i[t]!=r[t])return!1;for(let r=i.length-1;r>=0;r--){const s=i[r];if(!T(t[s],e[s],n))return!1}return!0}const C=(t="")=>{const e={};return t.split(";").forEach((t=>{if(t){const n=t.split(":");if(2===n.length){const t=n[0].trim(),i=n[1].trim();t&&i&&(e[t]=i)}}})),e};var B,k={exports:{}},M={};k.exports=function(){if(B)return M;B=1;var t,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen");function g(t){if("object"==typeof t&&null!==t){var p=t.$$typeof;switch(p){case e:switch(t=t.type){case i:case s:case r:case u:case h:return t;default:switch(t=t&&t.$$typeof){case l:case o:case c:case f:case d:case a:return t;default:return p}}case n:return p}}}return t=Symbol.for("react.module.reference"),M.ContextConsumer=o,M.ContextProvider=a,M.Element=e,M.ForwardRef=c,M.Fragment=i,M.Lazy=f,M.Memo=d,M.Portal=n,M.Profiler=s,M.StrictMode=r,M.Suspense=u,M.SuspenseList=h,M.isAsyncMode=function(){return!1},M.isConcurrentMode=function(){return!1},M.isContextConsumer=function(t){return g(t)===o},M.isContextProvider=function(t){return g(t)===a},M.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},M.isForwardRef=function(t){return g(t)===c},M.isFragment=function(t){return g(t)===i},M.isLazy=function(t){return g(t)===f},M.isMemo=function(t){return g(t)===d},M.isPortal=function(t){return g(t)===n},M.isProfiler=function(t){return g(t)===s},M.isStrictMode=function(t){return g(t)===r},M.isSuspense=function(t){return g(t)===u},M.isSuspenseList=function(t){return g(t)===h},M.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===r||e===u||e===h||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===a||e.$$typeof===o||e.$$typeof===c||e.$$typeof===t||void 0!==e.getModuleId)},M.typeOf=g,M}();var P=k.exports;const E=t=>{let e=[];return n.Children.forEach(t,(t=>{c(t)||(P.isFragment(t)?e=e.concat(E(t.props.children)):e.push(t))})),e},O={...e.TABLE_EVENT_TYPE,...e.PIVOT_TABLE_EVENT_TYPE,...e.PIVOT_CHART_EVENT_TYPE},L={onClickCell:O.CLICK_CELL,onDblClickCell:O.DBLCLICK_CELL,onMouseDownCell:O.MOUSEDOWN_CELL,onMouseUpCell:O.MOUSEUP_CELL,onSelectedCell:O.SELECTED_CELL,onSelectedClear:O.SELECTED_CLEAR,onKeyDown:O.KEYDOWN,onMouseEnterTable:O.MOUSEENTER_TABLE,onMouseLeaveTable:O.MOUSELEAVE_TABLE,onMouseDownTable:O.MOUSEDOWN_TABLE,onMouseMoveCell:O.MOUSEMOVE_CELL,onMouseMoveTable:O.MOUSEMOVE_TABLE,onMouseEnterCell:O.MOUSEENTER_CELL,onMouseLeaveCell:O.MOUSELEAVE_CELL,onContextMenuCell:O.CONTEXTMENU_CELL,onContextMenuCanvas:O.CONTEXTMENU_CANVAS,onResizeColumn:O.RESIZE_COLUMN,onResizeColumnEnd:O.RESIZE_COLUMN_END,onResizeRow:O.RESIZE_ROW,onResizeRowEnd:O.RESIZE_ROW_END,onChangeHeaderPositionStart:O.CHANGE_HEADER_POSITION_START,onChangeHeaderPosition:O.CHANGE_HEADER_POSITION,onChangeHeaderPositionFail:O.CHANGE_HEADER_POSITION_FAIL,onSortClick:O.SORT_CLICK,onAfterSort:O.AFTER_SORT,onFreezeClick:O.FREEZE_CLICK,onScroll:O.SCROLL,onScrollHorizontalEnd:O.SCROLL_HORIZONTAL_END,onScrollVerticalEnd:O.SCROLL_VERTICAL_END,onDropdownMenuClick:O.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:O.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:O.DRAG_SELECT_END,onCopyData:O.COPY_DATA,onDropdownIconClick:O.DROPDOWN_ICON_CLICK,onDropdownMenuClear:O.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:O.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:O.SHOW_MENU,onHideMenu:O.HIDE_MENU,onIconClick:O.ICON_CLICK,onLegendItemClick:O.LEGEND_ITEM_CLICK,onLegendItemHover:O.LEGEND_ITEM_HOVER,onLegendItemUnHover:O.LEGEND_ITEM_UNHOVER,onLegendChange:O.LEGEND_CHANGE,onMouseEnterAxis:O.MOUSEENTER_AXIS,onMouseLeaveAxis:O.MOUSELEAVE_AXIS,onCheckboxStateChange:O.CHECKBOX_STATE_CHANGE,onRadioStateChange:O.RADIO_STATE_CHANGE,onSwitchStateChange:O.SWITCH_STATE_CHANGE,onAfterRender:O.AFTER_RENDER,onInitialized:O.INITIALIZED,onChangeCellValue:O.CHANGE_CELL_VALUE,onDragFillHandleEnd:O.DRAG_FILL_HANDLE_END,onMousedownFillHandle:O.MOUSEDOWN_FILL_HANDLE,onDblclickFillHandle:O.DBLCLICK_FILL_HANDLE,onPivotSortClick:O.PIVOT_SORT_CLICK,onDrillMenuClick:O.DRILLMENU_CLICK,onVChartEventType:O.VCHART_EVENT_TYPE,onChangCellValue:O.CHANGE_CELL_VALUE,onEmptyTipClick:O.EMPTY_TIP_CLICK,onEmptyTipDblClick:O.EMPTY_TIP_DBLCLICK,onButtonClick:O.BUTTON_CLICK,onBeforeCacheChartImage:O.BEFORE_CACHE_CHART_IMAGE,onPastedData:O.PASTED_DATA},R=Object.keys(L),I=(t,e=L)=>{const n={};return Object.keys(t).forEach((i=>{e[i]&&t[i]&&(n[i]=t[i])})),n},N=(t,e,n,i=L)=>{if(!e&&!n||!t)return!1;const r=n?I(n,i):null,s=e?I(e,i):null;return r&&Object.keys(r).forEach((e=>{s&&s[e]&&s[e]===r[e]||t.off(i[e],n[e])})),s&&Object.keys(s).forEach((e=>{r&&r[e]&&r[e]===s[e]||t.on(i[e],s[e])})),!0};class U{static GenAutoIncrementId(){return U.auto_increment_id++}}U.auto_increment_id=0;class D{constructor(t){this.id=U.GenAutoIncrementId(),this.registry=t}}const z="named",W="inject",F="inversify:tagged",j="inversify:paramtypes";class H{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===z?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var G=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",n=Object.getPrototypeOf(Function),i=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),r=new WeakMap;function s(t,e,n){let s=r.get(t);if(c(s)){if(!n)return;s=new i,r.set(t,s)}let a=s.get(e);if(c(a)){if(!n)return;a=new i,s.set(e,a)}return a}function a(t,e,n){if(o(t,e,n))return!0;const i=g(e);return!u(i)&&a(t,i,n)}function o(t,e,n){const i=s(e,n,!1);return!c(i)&&!!i.has(t)}function l(t,e,n){if(o(t,e,n))return function(t,e,n){const i=s(e,n,!1);if(!c(i))return i.get(t)}(t,e,n);const i=g(e);return u(i)?void 0:l(t,i,n)}function c(t){return void 0===t}function u(t){return null===t}function h(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,n){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 i=3===n?"string":5===n?"number":"default",r=function(t,e){const n=t[e];if(null!=n){if(!p(n))throw new TypeError;return n}}(t,e);if(void 0!==r){const e=r.call(t,i);if(h(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(p(e)){const n=e.call(t);if(!h(n))return n}const n=t.valueOf;if(p(n)){const e=n.call(t);if(!h(e))return e}}else{const e=t.valueOf;if(p(e)){const n=e.call(t);if(!h(n))return n}const n=t.toString;if(p(n)){const e=n.call(t);if(!h(e))return e}}throw new TypeError}(t,"default"===i?"number":i)}function f(t){const e=d(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function p(t){return"function"==typeof t}function g(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===n)return e;if(e!==n)return e;const i=t.prototype,r=i&&Object.getPrototypeOf(i);if(null==r||r===Object.prototype)return e;const s=r.constructor;return"function"!=typeof s||s===t?e:s}t("defineMetadata",(function(t,e,n,i){if(!h(n))throw new TypeError;return r=t,a=e,void s(n,i,!0).set(r,a);var r,a})),t("hasMetadata",(function(t,e,n){if(!h(e))throw new TypeError;return c(n)||(n=f(n)),a(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!h(e))throw new TypeError;return c(n)||(n=f(n)),o(t,e,n)})),t("getMetadata",(function(t,e,n){if(!h(e))throw new TypeError;return c(n)||(n=f(n)),l(t,e,n)}))}((e=t,function(t,n){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n})})),t}({});function V(t,e,n,i){!function(t,e,n,i){const r=[i];let s={};G.hasOwnMetadata(t,e)&&(s=G.getMetadata(t,e));let a=s[n];void 0===a&&(a=[]),a.push(...r),s[n]=a,G.defineMetadata(t,s,e)}(F,t,n.toString(),i)}function $(t){return(e,n,i)=>{V(e,0,i,t)}}const X=(Y=W,t=>(e,n,i)=>$(new H(Y,t))(e,n,i));var Y;function K(){return function(t){return G.defineMetadata(j,null,t),t}}function q(t){return $(new H(z,t))}const Q="Singleton",Z="Transient",J="ConstantValue",tt="DynamicValue",et="Factory",nt="Function",it="Instance",rt="Invalid";class st{constructor(t,e){this.id=U.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=rt,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new st(this.serviceIdentifier,this.scope);return t.activated=t.scope===Q&&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 at{getConstructorMetadata(t){return{compilerGeneratedMetadata:G.getMetadata(j,t),userGeneratedMetadata:G.getMetadata(F,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const ot=(lt=z,t=>{const e=e=>{if(null==e)return!1;if(e.key===lt&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const n=e.constructorArgsMetadata;for(let e=0;e<n.length;e++)if(n[e].key===lt&&n[e].value===t)return!0;return!1};return e.metaData=new H(lt,t),e});var lt;class ct{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Q,this}inTransientScope(){return this._binding.scope=Z,this}whenTargetNamed(t){return this._binding.constraint=ot(t),this}}class ut{constructor(t){this._binding=t}to(t){return this._binding.type=it,this._binding.implementationType=t,new ct(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=tt,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new ct(this._binding)}toConstantValue(t){return this._binding.type=J,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Q,new ct(this._binding)}toFactory(t){return this._binding.type=et,this._binding.factory=t,this._binding.scope=Q,new ct(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const ht=Symbol("ContributionProvider");class dt{constructor(t,e){this.serviceIdentifier=t,this.container=e,pt.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 ft(t,e){t(ht).toDynamicValue((({container:t})=>new dt(e,t))).inSingletonScope().whenTargetNamed(e)}class pt{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()}))}}pt.store=new Map;class gt{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const n="string"==typeof t?t.trim():t.name;n&&(this.taps=this.taps.filter((t=>!(t.name===n&&(!e||t.fn===e)))))}_parseOptions(t,e,n){let i;if("string"==typeof e)i={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof i.name||""===i.name)throw new Error("Missing name for tap");return i=Object.assign({type:t,fn:n},i),i}_tap(t,e,n){this._insert(this._parseOptions(t,e,n))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let n=0;"number"==typeof t.stage&&(n=t.stage);let i=this.taps.length;for(;i>0;){i--;const t=this.taps[i];this.taps[i+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>n)){i++;break}}this.taps[i]=t}}class mt extends gt{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const bt=Symbol.for("EnvContribution"),yt=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Z,this.options=e,this.id=U.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new at}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,n){const i=this._getNotAllArgs(t,!1,e,n);return this._get(i)}getNamed(t,e){return this.getTagged(t,z,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,n=new st(t,e),i=this._bindingDictionary.get(t)||[];return i.push(n),this._bindingDictionary.set(t,i),new ut(n)}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=>n=>{const i=this.bind(n);return t(i,e),i},n=()=>t=>this.unbind(t),i=()=>t=>this.isBound(t),r=e=>n=>{const i=this.rebind(n);return t(i,e),i};return t=>({bindFunction:e(t),isboundFunction:i(),rebindFunction:r(t),unbindFunction:n(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,n,i){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:i}}_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:n}=this._metadataReader.getConstructorMetadata(e),i=Object.keys(n),r=[];for(let t=0;t<i.length;t++){const e=n[t],i={};e.forEach((t=>{i[t.key]=t.value}));const s={inject:i[W],multiInject:i.multi_inject},a=s.inject||s.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};r.push(t)}}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case J:case nt:e=t.cache;break;case it: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 n=this._getChildRequest(t);return this._createInstance(e,n)}_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===Q&&(t.cache=e,t.activated=!0)}},vt=Symbol.for("RenderService");const xt=new class{get renderService(){return this._renderService||(this._renderService=yt.get(vt)),this._renderService}};var _t;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(_t||(_t={}));var St=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var At=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||St(t,"Boolean");var wt=t=>"function"==typeof t;var Tt=t=>null==t;var Ct=t=>null!=t;var Bt=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var kt=t=>"object"==typeof t&&null!==t;var Mt=function(t){if(!kt(t)||!St(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 Pt=(t,e=!1)=>{const n=typeof t;return e?"string"===n:"string"===n||St(t,"String")};var Et=t=>Array.isArray?Array.isArray(t):St(t,"Array");var Ot=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var Lt=(t,e=!1)=>{const n=typeof t;return e?"number"===n:"number"===n||St(t,"Number")};var Rt=t=>Lt(t)&&Number.isFinite(t);var It=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var Nt=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 Ut=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const Dt=Object.prototype;var zt=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Dt)};const Wt=Object.prototype.hasOwnProperty;function Ft(t){if(Tt(t))return!0;if(Ot(t))return!t.length;const e=Ut(t);if("Map"===e||"Set"===e)return!t.size;if(zt(t))return!Object.keys(t).length;for(const e in t)if(Wt.call(t,e))return!1;return!0}function jt(t,e,n=!1,i=!1){if(e){if(t===e)return;if(Ct(e)&&"object"==typeof e){const r=Object(e),s=[];for(const t in r)s.push(t);let{length:a}=s,o=-1;for(;a--;){const a=s[++o];!Ct(r[a])||"object"!=typeof r[a]||i&&Et(t[a])?Gt(t,a,r[a]):Ht(t,e,a,n,i)}}}}function Ht(t,e,n,i=!1,r=!1){const s=t[n],a=e[n];let o=e[n],l=!0;if(Et(a)){if(i)o=[];else if(Et(s))o=s;else if(Ot(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else Mt(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):l=!1;l&&jt(o,a,i,r),Gt(t,n,o)}function Gt(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function Vt(t,...e){let n=-1;const i=e.length;for(;++n<i;)jt(t,e[n],!0);return t}function $t(t,e){if(!Et(t)||!Et(e))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}const Xt="undefined"!=typeof console;function Yt(t,e,n){const i=[e].concat([].slice.call(n));Xt&&console[t].apply(console,i)}var Kt;!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"}(Kt||(Kt={}));class qt{static getInstance(t,e){return qt._instance&&Lt(t)?qt._instance.level(t):qt._instance||(qt._instance=new qt(t,e)),qt._instance}static setInstance(t){return qt._instance=t}static setInstanceLevel(t){qt._instance?qt._instance.level(t):qt._instance=new qt(t)}static clearInstance(){qt._instance=null}constructor(t=Kt.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>=Kt.Info}canLogDebug(){return this._level>=Kt.Debug}canLogError(){return this._level>=Kt.Error}canLogWarn(){return this._level>=Kt.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=Kt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):Yt(null!==(e=this._method)&&void 0!==e?e:"error","ERROR",t)),this}warn(...t){return this._level>=Kt.Warn&&Yt(this._method||"warn","WARN",t),this}info(...t){return this._level>=Kt.Info&&Yt(this._method||"log","INFO",t),this}debug(...t){return this._level>=Kt.Debug&&Yt(this._method||"log","DEBUG",t),this}}qt._instance=null;const Qt=1e-12,Zt=Math.PI,Jt=Zt/2,te=2*Zt,ee=2*Math.PI,ne=Math.abs,ie=Math.atan2,re=Math.cos,se=Math.max,ae=Math.min,oe=Math.sin,le=Math.sqrt,ce=Math.pow;function ue(t){return t>=1?Jt:t<=-1?-Jt:Math.asin(t)}class he{constructor(t=0,e=0,n,i){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=n,this.y1=i}clone(){return new he(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 Lt(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return Lt(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 de{static distancePP(t,e){return le(ce(t.x-e.x,2)+ce(t.y-e.y,2))}static distanceNN(t,e,n,i){return le(ce(t-n,2)+ce(e-i,2))}static distancePN(t,e,n){return le(ce(e-t.x,2)+ce(n-t.y,2))}static pointAtPP(t,e,n){return new he((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function fe(t){return t*(Math.PI/180)}const pe=(t=0)=>{if(t<0)for(;t<-te;)t+=te;else if(t>0)for(;t>te;)t-=te;return t};var ge;function me(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function be({x:t,y:e},n,i={x:0,y:0}){return{x:(t-i.x)*Math.cos(n)-(e-i.y)*Math.sin(n)+i.x,y:(t-i.x)*Math.sin(n)+(e-i.y)*Math.cos(n)+i.y}}function ye(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function ve(t,e){const n=e?fe(t.angle):t.angle,i=ye(t);return[be({x:t.x1,y:t.y1},n,i),be({x:t.x2,y:t.y1},n,i),be({x:t.x2,y:t.y2},n,i),be({x:t.x1,y:t.y2},n,i)]}function xe(t,e,n,i,r,s){if(s>e&&s>i||s<e&&s<i)return 0;if(i===e)return 0;const a=(s-e)/(i-e);let o=i<e?1:-1;1!==a&&0!==a||(o=i<e?.5:-.5);const l=a*(n-t)+t;return l===r?1/0:l>r?o:0}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(ge||(ge={}));function _e(t,e,n){const{x1:i,y1:r,x2:s,y2:a}=e;return n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f),e):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*s+n.c*r+n.e,n.b*s+n.d*r+n.f),t.add(n.a*s+n.c*a+n.e,n.b*s+n.d*a+n.f),t.add(n.a*i+n.c*a+n.e,n.b*i+n.d*a+n.f),e)}class Se{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Se(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,n=0,i=0){return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this}set(t=0,e=0,n=0,i=0){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),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 Et(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,n=0){const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])}scale(t=0,e=0,n=0,i=0){const r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[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 _e(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,n){const{x1:i,y1:r,x2:s,y2:a}=this,o=Math.cos(t),l=Math.sin(t),c=e-e*o+n*l,u=n-e*l-n*o;return[o*i-l*r+c,l*i+o*r+u,o*i-l*a+c,l*i+o*a+u,o*s-l*r+c,l*s+o*r+u,o*s-l*a+c,l*s+o*a+u]}scalePoints(t,e,n,i){const{x1:r,y1:s,x2:a,y2:o}=this;return[t*r+(1-t)*n,e*s+(1-e)*i,t*a+(1-t)*n,e*o+(1-e)*i]}}class Ae extends Se{}class we extends Se{constructor(t,e=0){var n;super(t),t&&(this.angle=null!==(n=t.angle)&&void 0!==n?n:e)}intersects(t){return function(t,e,n=!1){const i=ve(t,n),r=ve(e,n),s=(t,e)=>[e.x-t.x,e.y-t.y],a=s(ye(t),ye(e)),o=s(i[0],i[1]),l=s(i[1],i[2]),c=s(r[0],r[1]),u=s(r[1],r[2]),h=n?fe(t.angle):t.angle;let d=n?fe(90-t.angle):t.angle+Jt;const f=n?fe(e.angle):e.angle;let p=n?fe(90-e.angle):e.angle+Jt;d>ee&&(d-=ee),p>ee&&(p-=ee);const g=(t,e,n,i)=>{const r=[Math.cos(e),Math.sin(e)];return t+(me(r,n)+me(r,i))/2>me(r,a)};return g((t.x2-t.x1)/2,h,c,u)&&g((t.y2-t.y1)/2,d,c,u)&&g((e.x2-e.x1)/2,f,o,l)&&g((e.y2-e.y1)/2,p,o,l)}(this,t)}setValue(t=0,e=0,n=0,i=0,r=0){return super.setValue(t,e,n,i),this.angle=r,this}clone(){return new we(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[be({x:this.x1,y:this.y1},this.angle,t),be({x:this.x2,y:this.y1},this.angle,t),be({x:this.x1,y:this.y2},this.angle,t),be({x:this.x2,y:this.y2},this.angle,t)]}}class Te{constructor(t=1,e=0,n=0,i=1,r=0,s=0){this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,n,i,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==i||this.b!==e||this.c!==n)}setValue(t,e,n,i,r,s){return this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,a=new Te,o=t*i-e*n;return a.a=i/o,a.b=-e/o,a.c=-n/o,a.d=t/o,a.e=(n*s-i*r)/o,a.f=-(t*s-e*r)/o,a}rotate(t){const e=Math.cos(t),n=Math.sin(t),i=this.a*e+this.c*n,r=this.b*e+this.d*n,s=this.a*-n+this.c*e,a=this.b*-n+this.d*e;return this.a=i,this.b=r,this.c=s,this.d=a,this}rotateByCenter(t,e,n){const i=Math.cos(t),r=Math.sin(t),s=(1-i)*e+r*n,a=(1-i)*n-r*e,o=i*this.a-r*this.b,l=r*this.a+i*this.b,c=i*this.c-r*this.d,u=r*this.c+i*this.d,h=i*this.e-r*this.f+s,d=r*this.e+i*this.f+a;return this.a=o,this.b=l,this.c=c,this.d=u,this.e=h,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,n,i,r,s){return this.multiply(t,e,n,i,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:n,d:i,e:r,f:s}=this;return this.a=e,this.b=t,this.c=i,this.d=n,this.e=s,this.f=r,this}multiply(t,e,n,i,r,s){const a=this.a,o=this.b,l=this.c,c=this.d,u=a*t+l*e,h=o*t+c*e,d=a*n+l*i,f=o*n+c*i,p=a*r+l*s+this.e,g=o*r+c*s+this.f;return this.a=u,this.b=h,this.c=d,this.d=f,this.e=p,this.f=g,this}interpolate(t,e){const n=new Te;return n.a=this.a+(t.a-this.a)*e,n.b=this.b+(t.b-this.b)*e,n.c=this.c+(t.c-this.c)*e,n.d=this.d+(t.d-this.d)*e,n.e=this.e+(t.e-this.e)*e,n.f=this.f+(t.f-this.f)*e,n}transformPoint(t,e){const{a:n,b:i,c:r,d:s,e:a,f:o}=this,l=n*s-i*r,c=s/l,u=-i/l,h=-r/l,d=n/l,f=(r*o-s*a)/l,p=-(n*o-i*a)/l,{x:g,y:m}=t;e.x=g*c+m*h+f,e.y=g*u+m*d+p}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Te(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,n=this.c,i=this.d,r=t*i-e*n,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),s.scaleX=a,s.scaleY=r/a,s.skewX=(t*n+e*i)/r,s.skewY=0}else if(0!==n||0!==i){const a=Math.sqrt(n*n+i*i);s.rotateDeg=Math.PI/2-(i>0?Math.acos(-n/a):-Math.acos(n/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*n+e*i)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}const Ce=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),Be=te-1e-8;class ke{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,i,r,s){if(Math.abs(r-i)>Be)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let a,o,l,c,u=1/0,h=-1/0,d=1/0,f=-1/0;function p(t){l=n*Math.cos(t),c=n*Math.sin(t),l<u&&(u=l),l>h&&(h=l),c<d&&(d=c),c>f&&(f=c)}if(p(i),p(r),r!==i)if((i%=te)<0&&(i+=te),(r%=te)<0&&(r+=te),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=te,a=i-i%Jt,o=0;o<4&&a>r;++o,a-=Jt)p(a);else for(a=i-i%Jt+Jt,o=0;o<4&&a<r;++o,a+=Jt)p(a);this.bounds.add(t+u,e+d),this.bounds.add(t+h,e+f)}arcTo(t,e,n,i,r){this.bounds.add(t,e)}bezierCurveTo(t,e,n,i,r,s){this.bounds.add(t,e),this.bounds.add(n,i),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,n,i){this.bounds.add(t,e),this.bounds.add(n,i)}rect(t,e,n,i){this.bounds.add(t,e),this.bounds.add(t+n,e+i)}clear(){this.bounds.clear()}release(...t){}}class Me{constructor(){this._curves=[],this.bounds=new Ae}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Pe=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Ee={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},Oe={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Le,Re,Ie,Ne,Ue,De;var ze,We,Fe,je,He,Ge;function Ve(t){const e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=l*s,u=-o*a,h=o*s,d=l*a,f=Math.cos(i),p=Math.sin(i),g=Math.cos(r),m=Math.sin(r),b=.5*(r-i),y=Math.sin(.5*b),v=8/3*y*y/Math.sin(b),x=e+f-v*p,_=n+p+v*f,S=e+g,A=n+m,w=S+v*m,T=A-v*g;return[c*x+u*_,h*x+d*_,c*w+u*T,h*w+d*T,c*S+u*A,h*S+d*A]}function $e(t,e,n,i){const r=function(t,e,n,i,r,s,a,o,l){const c=fe(a),u=Math.sin(c),h=Math.cos(c),d=h*(o-t)*.5+u*(l-e)*.5,f=h*(l-e)*.5-u*(o-t)*.5;let p=d*d/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const g=h/n,m=u/n,b=-u/i,y=h/i,v=g*o+m*l,x=b*o+y*l,_=g*t+m*e,S=b*t+y*e;let A=1/((_-v)*(_-v)+(S-x)*(S-x))-.25;A<0&&(A=0);let w=Math.sqrt(A);s===r&&(w=-w);const T=.5*(v+_)-w*(S-x),C=.5*(x+S)+w*(_-v),B=Math.atan2(x-C,v-T);let k=Math.atan2(S-C,_-T)-B;k<0&&1===s?k+=te:k>0&&0===s&&(k-=te);const M=Math.ceil(Math.abs(k/(Jt+.001))),P=[];for(let t=0;t<M;++t){const e=B+t*k/M,r=B+(t+1)*k/M;P[t]=[T,C,e,r,n,i,u,h]}return P}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n);for(let e=0;e<r.length;++e){const n=Ve(r[e]);t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(ze||(ze={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(We||(We={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(Fe||(Fe={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(je||(je={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(He||(He={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Ge||(Ge={}));const Xe=[(t,e,n,i,r,s,a)=>e.arc(t[1]*r+n,t[2]*s+i,t[3]*(r+s)/2,t[4],t[5],t[6],a),(t,e,n,i,r,s,a)=>e.arcTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*(r+s)/2,a),(t,e,n,i,r,s,a)=>e.bezierCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*r+n,t[6]*s+i,a),(t,e,n,i)=>e.closePath(),(t,e,n,i,r,s)=>e.ellipse(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,n,i,r,s,a)=>e.lineTo(t[1]*r+n,t[2]*s+i,a),(t,e,n,i,r,s,a)=>e.moveTo(t[1]*r+n,t[2]*s+i,a),(t,e,n,i,r,s,a)=>e.quadraticCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,a),(t,e,n,i,r,s,a)=>e.rect(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,a)];function Ye(t,e,n=0,i=0,r=1,s=1,a){for(let o=0;o<t.length;o++){const l=t[o];Xe[l[0]](l,e,n,i,r,s,a)}}class Ke{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function qe(t,e){let n=0;const i=t.length;for(let r=0;r<i;r++){const s=t[r],a=e[r],o=t[(r+1)%i],l=e[(r+1)%i];n+=de.distanceNN(s,a,o,l)}return n/2}function Qe(t,e,n,i,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*n*r*r*s+i*r*r*r}function Ze(t,e,n,i,r){const s=Qe(t.x,e.x,n.x,i.x,r),a=Qe(t.y,e.y,n.y,i.y,r);return new he(s,a)}function Je(t,e,n,i){const r=1-i;return r*r*t+2*r*i*e+i*i*n}function tn(t,e,n,i){const r=Je(t.x,e.x,n.x,i),s=Je(t.y,e.y,n.y,i);return new he(r,s)}class en extends Ke{constructor(t,e,n,i){super(),this.type=He.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=n,this.p3=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return Ze(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,n=this.p2,i=this.p3,qe([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])):60;var t,e,n,i}calcProjLength(t){return t===je.ROW?ne(this.p0.x-this.p3.x):t===je.COLUMN?ne(this.p0.y-this.p3.y):0}getAngleAt(t){const e=se(t-.01,0),n=ae(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return ie(r.y-i.y,r.x-i.x)}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.bezierCurveTo(this.p1.x*i+e,this.p1.y*r+n,this.p2.x*i+e,this.p2.y*r+n,this.p3.x*i+e,this.p3.y*r+n);else if(s>0){const[a]=function(t,e){const{p0:n,p1:i,p2:r,p3:s}=t,a=Ze(n,i,r,s,e),o=de.pointAtPP(n,i,e),l=de.pointAtPP(i,r,e),c=de.pointAtPP(r,s,e),u=de.pointAtPP(o,l,e),h=de.pointAtPP(l,c,e);return[new en(n,o,u,a),new en(a,h,c,s)]}(this,s);t.bezierCurveTo(a.p1.x*i+e,a.p1.y*r+n,a.p2.x*i+e,a.p2.y*r+n,a.p3.x*i+e,a.p3.y*r+n)}}includeX(t){const e=ae(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=se(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=n}getYAt(t){const e=ae(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=(t-e)/(se(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(n).y}}class nn extends Ke{constructor(t,e){super(),this.type=He.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return de.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=ie(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?de.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===je.ROW?ne(this.p0.x-this.p1.x):t===je.COLUMN?ne(this.p0.y-this.p1.y):0}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.lineTo(this.p1.x*i+e,this.p1.y*r+n);else if(s>0){const a=this.getPointAt(s);t.lineTo(a.x*i+e,a.y*r+n)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,n=this.p1;this.p0.x>this.p1.x&&(e=this.p1,n=this.p0);const i=(t-e.x)/(n.x-e.x);return e.y+i*(n.y-e.y)}return 1/0}}class rn{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,n,i,r,s,a,o){const l=new en(new he(this._lastX,this._lastY),new he(t,e),new he(n,i),new he(r,s));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=r,this._lastY=s,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,n,i){const r=this.addLinearCurve(t,e,n,this._lastOriginP,i);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=i}moveTo(t,e,n){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=n,this._startOriginP=n,this}quadraticCurveTo(t,e,n,i){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,n,i,r){const s=new nn(new he(this._lastX,this._lastY),new he(t,e));return s.originP1=i,s.originP2=r,s.defined=n,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===je.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],n=this.curves[this.curves.length-1],i=null!==(e=n.p3)&&void 0!==e?e:n.p1;return ne(t.p0.y-i.y)}if(t===je.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return ne(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class sn extends rn{bezierCurveTo(t,e,n,i,r,s,a,o){return super.bezierCurveTo(e,t,i,n,s,r,a,o)}lineTo(t,e,n,i){return super.lineTo(e,t,n,i)}moveTo(t,e,n){return super.moveTo(e,t,n)}clear(){return super.clear()}}function an(t,e,n=1){let i=!1;for(let n=0,r=e.length;n<=r;n++)n>=r===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function on(t,e,n){const i=null!=e?e:ne(n[n.length-1].x-n[0].x)>ne(n[n.length-1].y-n[0].y)?je.ROW:je.COLUMN;return"monotoneY"===t?new sn(t,i):new rn(t,i)}class ln{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function cn(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=on("linear",n,t);return function(t,e){an(t,e,1)}(new ln(r,i),t),r}function un(t,e,n,i,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6,i,t.lastPoint1)}class hn{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&un(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;break;default:un(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function dn(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return cn(t,e);const r=on("basis",n,t);return function(t,e){an(t,e,2)}(new hn(r,i),t),r}function fn(t){return t<0?-1:1}function pn(t,e,n){const i=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(i||Number(r<0&&-0)),a=(n-t._y1)/(r||Number(i<0&&-0)),o=(s*r+a*i)/(i+r);return(fn(s)+fn(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function gn(t,e){const n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function mn(t,e,n,i,r){const s=t._x0,a=t._y0,o=t._x1,l=t._y1,c=(o-s)/3;t.context.bezierCurveTo(s+c,a+c*e,o-c,l-c*n,o,l,i,t.lastPoint1)}class bn{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:mn(this,this._t0,gn(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const n=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(n,i,t);break;case 1:this._point=2;break;case 2:this._point=3,mn(this,gn(this,e=pn(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:mn(this,this._t0,e=pn(this,n,i),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class yn extends bn{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function vn(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return cn(t,e);const r=on("monotoneX",n,t);return function(t,e){an(t,e,2)}(new bn(r,i),t),r}function xn(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return cn(t,e);const r=on("monotoneY",n,t);return function(t,e){an(t,e,2)}(new yn(r,i),t),r}class _n{constructor(t,e=.5,n){this.context=t,this._t=e,this.startPoint=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t);else{const i=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(i,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(i,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(i,n,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=n,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class Sn extends _n{lineEnd(){this.context.closePath()}}function An(t,e,n={}){const{direction:i,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const s=new rn("step",null!=i?i:ne(t[t.length-1].x-t[0].x)>ne(t[t.length-1].y-t[0].y)?je.ROW:je.COLUMN);return wn(new _n(s,e,r),t),s}function wn(t,e){return an(t,e,1)}class Tn extends ln{lineEnd(){this.context.closePath()}}function Cn(t,e={}){const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=on("linear",n,t);return function(t,e){an(t,e,1)}(new Tn(r,i),t),r}function Bn(t,e,n,i,r){let s=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>Qt){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,n=3*t._l01_a*(t._l01_a+t._l12_a);s=(s*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/n,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/n}if(t._l23_a>Qt){const i=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,r=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*i+t._x1*t._l23_2a-e*t._l12_2a)/r,l=(l*i+t._y1*t._l23_2a-n*t._l12_2a)/r}t.context.bezierCurveTo(s,a,o,l,t._x2,t._y2,i,t.lastPoint1)}function kn(t,e){return function(n,i,r={}){const{direction:s,startPoint:a}=r;if(n.length<2-Number(!!a))return null;if(n.length<3-Number(!!a))return cn(n,r);const o=on(t,s,n);return an(new e(o,i,a),n,2),o}}const Mn=kn("catmullRom",class{constructor(t,e=.5,n){this.context=t,this.startPoint=n,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:n}=t;if(this._point){const t=this._x2-e,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Bn(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const Pn=kn("catmullRomClosed",class{constructor(t,e=.5,n){this.context=t,this.startPoint=n,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:n}=t;if(this._point){const t=this._x2-e,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=n;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=n,t);break;case 2:this._point=3,this._x5=e,this._y5=n;break;default:Bn(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class En extends Ke{constructor(t,e,n){super(),this.type=He.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=n}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return tn(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,n=this.p2,qe([t.x,e.x,n.x],[t.y,e.y,n.y])):60;var t,e,n}calcProjLength(t){return t===je.ROW?ne(this.p0.x-this.p2.x):t===je.COLUMN?ne(this.p0.y-this.p2.y):0}getAngleAt(t){const e=se(t-.01,0),n=ae(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return ie(r.y-i.y,r.x-i.x)}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.quadraticCurveTo(this.p1.x*i+e,this.p1.y*r+n,this.p2.x*i+e,this.p2.y*r+n);else if(s>0){const[a]=function(t,e){const{p0:n,p1:i,p2:r}=t,s=tn(n,i,r,e),a=de.pointAtPP(n,i,e),o=de.pointAtPP(i,r,e);return[new En(n,a,s),new En(s,o,r)]}(this,s);t.quadraticCurveTo(a.p1.x*i+e,a.p1.y*r+n,a.p2.x*i+e,a.p2.y*r+n)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class On{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const n=this.addLinearCurve(t,e);this.path.addCurve(n),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new nn(new he(this._lastX,this._lastY),new he(t,e))}quadraticCurveTo(t,e,n,i){const r=new En(new he(this._lastX,this._lastY),new he(t,e),new he(n,i));this.path.addCurve(r),this._lastX=n,this._lastY=i}bezierCurveTo(t,e,n,i,r,s){const a=new en(new he(this._lastX,this._lastY),new he(t,e),new he(n,i),new he(r,s));this.path.addCurve(a),this._lastX=r,this._lastY=s}arcTo(t,e,n,i,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,n,i,r,s,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,n,i){throw new Error("CurveContext不支持调用rect")}arc(t,e,n,i,r,s){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function Ln(t,e,n){var i,r;switch(e){case"linear":default:return cn(t,n);case"basis":return dn(t,n);case"monotoneX":return vn(t,n);case"monotoneY":return xn(t,n);case"step":return An(t,.5,n);case"stepClosed":return function(t,e,n={}){const{direction:i,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const s=new rn("step",null!=i?i:ne(t[t.length-1].x-t[0].x)>ne(t[t.length-1].y-t[0].y)?je.ROW:je.COLUMN);return wn(new Sn(s,e,r),t),s}(t,.5,n);case"stepBefore":return An(t,0,n);case"stepAfter":return An(t,1,n);case"catmullRom":return Mn(t,null!==(i=null==n?void 0:n.curveTension)&&void 0!==i?i:.5,n);case"catmullRomClosed":return Pn(t,null!==(r=null==n?void 0:n.curveTension)&&void 0!==r?r:.5,n);case"linearClosed":return Cn(t,n)}}class Rn extends Me{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new ke(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Oe.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Oe.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.commandList.push([Oe.Q,t,e,n,i]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,s){return this.commandList.push([Oe.C,t,e,n,i,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,s),this}arcTo(t,e,n,i,r){return this.commandList.push([Oe.AT,t,e,n,i,r]),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,s,a,o){return this.commandList.push([Oe.E,t,e,n,i,r,s,a,o]),this._ctx&&this._ctx.ellipse(t,e,n,i,r,s,a,o),this}rect(t,e,n,i){return this.commandList.push([Oe.R,t,e,n,i]),this._ctx&&this._ctx.rect(t,e,n,i),this}arc(t,e,n,i,r,s){return this.commandList.push([Oe.A,t,e,n,i,r,s]),this._ctx&&this._ctx.arc(t,e,n,i,r,s),this}closePath(){return this.commandList.push([Oe.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new On(this);Ye(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[Oe.M]=t=>`M${t[1]} ${t[2]}`,t[Oe.L]=t=>`L${t[1]} ${t[2]}`,t[Oe.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Oe.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Oe.A]=t=>{const e=[],n=t[1],i=t[2],r=t[3];((t,e,n,i,r,s,a,o=!1)=>{const l=2*Math.PI,c=(e%l+l)%l;let u,h=(n%l+l)%l;o?(h>=c&&(h-=l),u=h-c):(h<=c&&(h+=l),u=h-c);const d=Math.ceil(Math.abs(u)/(.5*Math.PI)),f=u/d;for(let e=0;e<d;e++){const n=c+f*e,l=c+f*(e+1),u=4/3*Math.tan(Math.abs(f)/4),h=Math.cos(n),d=Math.sin(n),p=Math.cos(l),g=Math.sin(l),m=h*s+i,b=d*a+r,y=p*s+i,v=g*a+r,x=o?-1:1,_=s*u*x,S=a*u*x;t.push(m-_*d,b+S*h,y+_*g,v-S*p,y,v)}})(e,t[4],t[5],n,i,r,r,t[6]);let s="";for(let t=0;t<e.length;t+=6)s+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return s},t[Oe.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[Oe.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((n=>{e+=t[n[0]](n)})),e}fromString(t,e,n,i,r){this.clear();const s=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let n,i;const r=[];for(let t=0,s=e.length;t<s;t++)if(Le=e[t],Re=Le.slice(1),Ie=Le[0],n=[Ie],i=Re.match(Pe),null!==i){for(let t=0,e=i.length;t<e;t++)Ne=i[t],Ue=parseFloat(Ne),Number.isNaN(Ue)||n.push(Ue);if(De=Ee[Ie],n.length-1>De){let t,e=Ie;for(let i=1,s=n.length;i<s;i+=De){t=[e];for(let e=i,r=i+De;e<r;e++)t.push(n[e]);r.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else r.push(n)}else r.push(n);return r}(t);return this._runCommandStrList(s,e,n,i,r),this._updateBounds(),this}fromLine(t){const{points:e,curveType:n,clipRangeByDimension:i}=t.attribute;if(!e)return;const r=Ln(e,n);"x"===i?this.direction=je.ROW:"y"===i?this.direction=je.COLUMN:"auto"===i&&(this.direction=r.direction),this._curves=r.curves}fromCustomPath2D(t,e,n,i,r){return this.clear(),this._runCommandList(t.commandList,e,n,i,r),this._updateBounds(),this}transform(t,e,n,i){const r=this.commandList;if(!this.transformCbList){const t=[];t[Oe.M]=this.moveToTransform,t[Oe.L]=this.lineToTransform,t[Oe.Q]=this.quadraticCurveToTransform,t[Oe.C]=this.bezierCurveToTransform,t[Oe.AT]=this.arcToTransform,t[Oe.E]=this.ellipseTransform,t[Oe.R]=this.rectTransform,t[Oe.A]=this.arcTransform,t[Oe.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,n,i)})),this._updateBounds()}moveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}lineToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}quadraticCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n}bezierCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*i+e,t[6]=t[6]*r+n}arcToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*(i+r)/2}ellipseTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}rectTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}arcTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*(i+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,n=0,i=1,r=1){let s,a,o,l,c,u=null,h=0,d=0,f=0,p=0;for(let g=0,m=t.length;g<m;++g){switch(s=t[g],1===i&&1===r||(s=Nn(s,i,r)),s[0]){case"l":h+=s[1],d+=s[2],this.lineTo(h+e,d+n);break;case"L":h=s[1],d=s[2],this.lineTo(h+e,d+n);break;case"h":h+=s[1],this.lineTo(h+e,d+n);break;case"H":h=s[1],this.lineTo(h+e,d+n);break;case"v":d+=s[1],this.lineTo(h+e,d+n);break;case"V":d=s[1],this.lineTo(h+e,d+n);break;case"m":h+=s[1],d+=s[2],this.moveTo(h+e,d+n);break;case"M":h=s[1],d=s[2],this.moveTo(h+e,d+n);break;case"c":a=h+s[5],o=d+s[6],f=h+s[3],p=d+s[4],this.bezierCurveTo(h+s[1]+e,d+s[2]+n,f+e,p+n,a+e,o+n),h=a,d=o;break;case"C":h=s[5],d=s[6],f=s[3],p=s[4],this.bezierCurveTo(s[1]+e,s[2]+n,f+e,p+n,h+e,d+n);break;case"s":a=h+s[3],o=d+s[4],null===u[0].match(/[CcSs]/)?(f=h,p=d):(f=2*h-f,p=2*d-p),l=h+s[1],c=d+s[2],this.bezierCurveTo(f+e,p+n,l+e,c+n,a+e,o+n),f=l,p=c,h=a,d=o;break;case"S":a=s[3],o=s[4],null===u[0].match(/[CcSs]/)?(f=h,p=d):(f=2*h-f,p=2*d-p),l=s[1],c=s[2],this.bezierCurveTo(f+e,p+n,l+e,c+n,a+e,o+n),f=l,p=c,h=a,d=o;break;case"q":a=h+s[3],o=d+s[4],f=h+s[1],p=d+s[2],this.quadraticCurveTo(f+e,p+n,a+e,o+n),h=a,d=o;break;case"Q":a=s[3],o=s[4],this.quadraticCurveTo(s[1]+e,s[2]+n,a+e,o+n),h=a,d=o,f=s[1],p=s[2];break;case"t":a=h+s[1],o=d+s[2],null===u[0].match(/[QqTt]/)?(f=h,p=d):"t"===u[0]?(f=2*h-l,p=2*d-c):"q"===u[0]&&(f=2*h-f,p=2*d-p),l=f,c=p,this.quadraticCurveTo(f+e,p+n,a+e,o+n),h=a,d=o,f=h+s[1],p=d+s[2];break;case"T":a=s[1],o=s[2],f=2*h-f,p=2*d-p,this.quadraticCurveTo(f+e,p+n,a+e,o+n),h=a,d=o;break;case"a":$e(this,h+e,d+n,[s[1],s[2],s[3],s[4],s[5],s[6]+h+e,s[7]+d+n]),h+=s[6],d+=s[7];break;case"A":$e(this,h+e,d+n,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+n]),h=s[6],d=s[7];break;case"z":case"Z":this.closePath()}u=s}}_runCommandList(t,e=0,n=0,i=1,r=1){if(0!==e||0!==n||1!==i||1!==r)for(let s=0,a=t.length;s<a;++s){const a=t[s].slice();switch(a[0]){case Oe.L:this.lineToTransform(a,e,n,i,r);break;case Oe.M:this.moveToTransform(a,e,n,i,r);break;case Oe.C:this.bezierCurveToTransform(a,e,n,i,r);break;case Oe.Q:this.quadraticCurveToTransform(a,e,n,i,r);break;case Oe.A:this.arcToTransform(a,e,n,i,r);break;case Oe.E:this.ellipseTransform(a,e,n,i,r);break;case Oe.R:this.rectTransform(a,e,n,i,r);break;case Oe.AT:this.arcToTransform(a,e,n,i,r);break;case Oe.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Ye(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===je.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ne(t.p0.y-e.p1.y)}if(this.direction===je.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ne(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const n=this.curves[e];if(n.includeX(t))return n.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,n=0;for(let i=0;i<this._curves.length;i++){e=this._curves[i];const r=e.getLength(this.direction);if(n+r>=t)break;n+=r}const i=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(i),angle:e.getAngleAt(i)}}drawWithClipRange(t,e,n,i,r){this.tryBuildCurves();const s=this.getLength()*r;let a=0;for(let r=0;r<this._curves.length;r++){const o=this._curves[r],l=o.getLength(this.direction);if(!(a+l<=s)){const r=1-(a+l-s)/l;o.draw(t,n,i,e,e,r);break}o.draw(t,n,i,e,e,1),a+=l}}}const In=["l",0,0,0,0,0,0,0];function Nn(t,e,n){const i=In[0]=t[0];if("a"===i||"A"===i)In[1]=e*t[1],In[2]=n*t[2],In[3]=t[3],In[4]=t[4],In[5]=t[5],In[6]=e*t[6],In[7]=n*t[7];else if("h"===i||"H"===i)In[1]=e*t[1];else if("v"===i||"V"===i)In[1]=n*t[1];else for(let i=1,r=t.length;i<r;++i)In[i]=(i%2==1?e:n)*t[i];return In}const Un={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new Te},Dn={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},zn=Object.assign({outerBorder:Object.assign(Object.assign({},Dn),{distance:0}),innerBorder:Object.assign(Object.assign({},Dn),{distance:0})},Dn),Wn={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:_t.fontBounding,keepCenterInLine:!1},Fn=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),zn),{alignSelf:"auto"}),{pickStrokeBuffer:0}),jn={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Hn=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null,roughStyle:null},{_debug_bounds:!1}),Fn),Un),Gn=Object.assign(Object.assign({},Hn),{startAngle:0,endAngle:ee,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Vn=Object.assign(Object.assign(Object.assign({},Hn),jn),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),$n=Object.assign(Object.assign({},Hn),{radius:1,startAngle:0,endAngle:ee}),Xn=Object.assign(Object.assign({},Hn),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),Yn=Object.assign(Object.assign({},Hn),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Kn=Object.assign(Object.assign(Object.assign({},Hn),jn),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),qn=Object.assign(Object.assign({},Hn),{path:new Rn,fillStrokeOrder:1,clipRange:1,customPath:()=>{qt.getInstance().warn("空函数")}}),Qn=Object.assign(Object.assign({},Hn),{points:[],cornerRadius:0,closePath:!0}),Zn=Object.assign(Object.assign({},Hn),{width:100,height:100,spikes:5,thickness:.5}),Jn=Object.assign(Object.assign({},Hn),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round",drawStrokeWhenZeroWH:!1});Object.assign(Object.assign({},Hn),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round",drawStrokeWhenZeroWH:!1});const ti=Object.assign(Object.assign({},Hn),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),ei=Object.assign(Object.assign(Object.assign({},Hn),Wn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),ni=Object.assign(Object.assign(Object.assign({},Hn),Wn),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),ii=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},Hn),{fill:!0,cornerRadius:0,cornerType:"round"}),ri=Object.assign(Object.assign({},ii),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1}),si=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function n(t){const n=new Error(e+": "+t);throw n.source=e,n}function i(){return r("linear",t.linearGradient,s)||r("radial",t.radialGradient,o)||r("conic",t.conicGradient,a)}function r(e,i,r){return function(i,s){const a=b(i);if(a){b(t.startCall)||n("Missing (");const i=function(i){const s=r();return s&&(b(t.comma)||n("Missing comma before color stops")),{type:e,orientation:s,colorStops:d(f)}}();return b(t.endCall)||n("Missing )"),i}}(i)}function s(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let n,i,r=l();return r&&(n=[],n.push(r),i=e,b(t.comma)&&(r=l(),r?n.push(r):e=i)),n}function l(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=g()||c()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=p()||c()),t}();if(t)t.at=u();else{const e=c();if(e){t=e;const n=u();n&&(t.at=n)}else{const e=h();e&&(t={type:"default-radial",at:e})}}return t}function c(){return m("extent-keyword",t.extentKeywords,1)}function u(){if(m("position",/^at/,0)){const t=h();return t||n("Missing positioning value"),t}}function h(){const t={x:p(),y:p()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let i=e();const r=[];if(i)for(r.push(i);b(t.comma);)i=e(),i?r.push(i):n("One extra comma");return r}function f(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=p(),e}function p(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||g()}function g(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,n){const i=b(e);if(i)return{type:t,value:i[n]}}function b(t){const n=/^[\n\r\t\s]+/.exec(e);n&&y(n[0].length);const i=t.exec(e);return i&&y(i[0].length),i}function y(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(i);return e.length>0&&n("Invalid input not EOF"),t}()}}();class ai{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(ai.IsGradientStr(t))try{const e=si(t)[0];if(e){if("linear"===e.type)return ai.ParseLinear(e);if("radial"===e.type)return ai.ParseRadial(e);if("conic"===e.type)return ai.ParseConic(e)}}catch(e){return t}return t}static processColorStops(t){if(!t||0===t.length)return[];if(t.some((t=>t.length))){const e=t.map((t=>({color:t.value,offset:t.length?parseFloat(t.length.value)/100:-1})));e[0].offset<0&&(e[0].offset=0),e[e.length-1].offset<0&&(e[e.length-1].offset=1);for(let t=1;t<e.length-1;t++)if(e[t].offset<0){const n=t-1;let i=t+1;for(;i<e.length&&e[i].offset<0;)i++;const r=e[n].offset,s=e[i].offset,a=i-n;for(let t=1;t<a;t++)e[n+t].offset=r+(s-r)*t/a;t=i-1}return e}return t.map(((e,n)=>{const i=t.length>1?n/(t.length-1):0;return{color:e.value,offset:i}}))}static ParseConic(t){const{orientation:e,colorStops:n=[]}=t,i=Zt/2,r=parseFloat(e.value)/180*Zt-i;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+ee,stops:ai.processColorStops(n)}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:ai.processColorStops(e)}}static ParseLinear(t){const{orientation:e,colorStops:n=[]}=t,i=Zt/2;let r="angular"===e.type?parseFloat(e.value)/180*Zt:0;for(;r<0;)r+=ee;for(;r>=ee;)r-=ee;let s=0,a=0,o=0,l=0;return r<i?(s=0,a=1,o=Math.sin(r),l=a-Math.cos(r)):r<Zt?(s=0,a=0,o=Math.cos(r-i),l=Math.sin(r-i)):r<Zt+i?(s=1,a=0,o=s-Math.sin(r-Zt),l=Math.cos(r-Zt)):(s=1,o=s-Math.cos(r-i-Zt),l-=Math.sin(r-i-Zt)),{gradient:"linear",x0:s,y0:a,x1:o,y1:l,stops:ai.processColorStops(n)}}}function oi(t,e,n){let i=e;const{a:r,b:s,c:a,d:o}=t.currentMatrix,l=Math.sign(r)*Math.sqrt(r*r+s*s),c=Math.sign(o)*Math.sqrt(a*a+o*o);return l+c===0?0:(i=i/Math.abs(l+c)*2*n,i)}function li(t,e,n,i=0,r=0){var s,a,o,l;if(!e||!0===e)return"black";let c,u;if(Et(e))for(let t=0;t<e.length&&(u=e[t],!u);t++);else u=e;if(u=ai.Parse(u),"string"==typeof u)return u;if(n.AABBBounds&&(!n.attribute||0!==n.attribute.scaleX||0!==n.attribute.scaleY)){const e=n.AABBBounds;let h=e.x2-e.x1,d=e.y2-e.y1,f=e.x1-i,p=e.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1,angle:i=0}=n.attribute;h/=t,d/=e,f/=t,p/=e,(i||1!==t||1!==e)&&(f=null!==(s=n.x1WithoutTransform)&&void 0!==s?s:0,p=null!==(a=n.y1WithoutTransform)&&void 0!==a?a:0,h=null!==(o=n.widthWithoutTransform)&&void 0!==o?o:h,d=null!==(l=n.heightWithoutTransform)&&void 0!==l?l:d)}"linear"===u.gradient?c=function(t,e,n,i,r,s){var a,o,l,c;const u=t.createLinearGradient(n+(null!==(a=e.x0)&&void 0!==a?a:0)*r,i+(null!==(o=e.y0)&&void 0!==o?o:0)*s,n+(null!==(l=e.x1)&&void 0!==l?l:1)*r,i+(null!==(c=e.y1)&&void 0!==c?c:0)*s);return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,u,f,p,h,d):"conical"===u.gradient?c=function(t,e,n,i,r,s){var a,o;const l=t.createConicGradient(n+(null!==(a=e.x)&&void 0!==a?a:0)*r,i+(null!==(o=e.y)&&void 0!==o?o:0)*s,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern?l.GetPattern(r+n,s+i,void 0):l}(t,u,f,p,h,d):"radial"===u.gradient&&(c=function(t,e,n,i,r,s){var a,o,l,c,u,h;const d=t.createRadialGradient(n+(null!==(a=e.x0)&&void 0!==a?a:.5)*r,i+(null!==(o=e.y0)&&void 0!==o?o:.5)*s,Math.max(r,s)*(null!==(l=e.r0)&&void 0!==l?l:0),n+(null!==(c=e.x1)&&void 0!==c?c:.5)*r,i+(null!==(u=e.y1)&&void 0!==u?u:.5)*s,Math.max(r,s)*(null!==(h=e.r1)&&void 0!==h?h:.5));return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d}(t,u,f,p,h,d))}return c||"orange"}const ci={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},ui=!0,hi=!1,di=/\w|\(|\)|-/,fi=/[.?!,;:/,。?!、;:]/,pi=/\S/,gi=(t,e)=>{let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily})};function mi(t,e,n,i,r){if(t.length<=1)return 0;if(!e||e<=0)return 0;const s=xt.graphicUtil.textMeasure;let a=i,o=t.slice(0,a),l=Math.floor(s.measureText(o,n).width),c=t.slice(0,a+1),u=Math.floor(s.measureText(c,n).width);for(;l>e||u<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),l=Math.floor(s.measureText(o,n).width),c=t.slice(0,a+1),u=Math.floor(s.measureText(c,n).width)}return r&&(a=function(t,e,n=!1){let i=e;for(;di.test(t[i-1])&&di.test(t[i])||fi.test(t[i]);)if(i--,i<=0)return n?bi(t,e):e;return i}(t,a)),a}function bi(t,e){let n=e;for(;di.test(t[n+1])&&di.test(t[n])||fi.test(t[n]);)if(n++,n>=t.length)return n;return n+1}function yi(t,e,n="actual"){var i;if(""===t)return{ascent:0,height:0,descent:0,width:0};const r=xt.graphicUtil.textMeasure.measureText(t,e),s={ascent:0,height:0,descent:0,width:0},a="actual"===n?r.actualBoundingBoxAscent:r.fontBoundingBoxAscent,o="actual"===n?r.actualBoundingBoxDescent:r.fontBoundingBoxDescent;"number"!=typeof a||"number"!=typeof o?(s.width=Math.floor(r.width),s.height=e.fontSize||0,s.ascent=s.height,s.descent=0):(s.width=Math.floor(r.width),s.height=Math.floor(a+o),s.ascent=Math.floor(a),s.descent=s.height-s.ascent);const l=null!==(i=e.space)&&void 0!==i?i:0;return s.width+=l,s}const vi=Symbol.for("CanvasFactory");function xi(t){return yt.getNamed(vi,xt.global.env)(t)}const _i=1e-4,Si=Math.sqrt(3),Ai=1/3;function wi(t){return t>-Ui&&t<Ui}function Ti(t){return t>Ui||t<-Ui}const Ci=[0,0],Bi=[0,0],ki=[0,0];function Mi(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Pi(t,e,n,i){const r=1-i;return r*(r*t+2*i*e)+i*i*n}function Ei(t,e,n,i,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*i+3*s*n)}function Oi(t){return(t%=ee)<0&&(t+=ee),t}function Li(t,e,n,i,r,s,a,o,l){if(0===a)return!1;const c=a;return!(l>e+c&&l>i+c&&l>s+c||l<e-c&&l<i-c&&l<s-c||o>t+c&&o>n+c&&o>r+c||o<t-c&&o<n-c&&o<r-c)&&function(t,e,n,i,r,s,a,o,l){let c=0,u=.005,h=1/0;Ci[0]=a,Ci[1]=o;for(let a=0;a<1;a+=.05){Bi[0]=Pi(t,n,r,a),Bi[1]=Pi(e,i,s,a);const o=Mi(Ci,Bi);o<h&&(c=a,h=o)}h=1/0;for(let a=0;a<32&&!(u<_i);a++){const a=c-u,o=c+u;Bi[0]=Pi(t,n,r,a),Bi[1]=Pi(e,i,s,a);const l=Mi(Bi,Ci);if(a>=0&&l<h)c=a,h=l;else{ki[0]=Pi(t,n,r,o),ki[1]=Pi(e,i,s,o);const a=Mi(ki,Ci);o<=1&&a<h?(c=o,h=a):u*=.5}}return l&&(l[0]=Pi(t,n,r,c),l[1]=Pi(e,i,s,c)),Math.sqrt(h)}(t,e,n,i,r,s,o,l,null)<=c/2}function Ri(t,e,n,i,r,s,a,o,l,c,u){if(0===l)return!1;const h=l;return!(u>e+h&&u>i+h&&u>s+h&&u>o+h||u<e-h&&u<i-h&&u<s-h&&u<o-h||c>t+h&&c>n+h&&c>r+h&&c>a+h||c<t-h&&c<n-h&&c<r-h&&c<a-h)&&function(t,e,n,i,r,s,a,o,l,c,u){let h,d,f,p,g=0,m=.005,b=1/0;Ci[0]=l,Ci[1]=c;for(let l=0;l<1;l+=.05)Bi[0]=Ei(t,n,r,a,l),Bi[1]=Ei(e,i,s,o,l),f=Mi(Ci,Bi),f<b&&(g=l,b=f);b=1/0;for(let l=0;l<32&&!(m<_i);l++)h=g-m,d=g+m,Bi[0]=Ei(t,n,r,a,h),Bi[1]=Ei(e,i,s,o,h),f=Mi(Bi,Ci),h>=0&&f<b?(g=h,b=f):(ki[0]=Ei(t,n,r,a,d),ki[1]=Ei(e,i,s,o,d),p=Mi(ki,Ci),d<=1&&p<b?(g=d,b=p):m*=.5);return u&&(u[0]=Ei(t,n,r,a,g),u[1]=Ei(e,i,s,o,g)),Math.sqrt(b)}(t,e,n,i,r,s,a,o,c,u,null)<=h/2}function Ii(t,e,n,i,r,s,a,o,l){if(0===a)return!1;const c=a;o-=t,l-=e;const u=Math.sqrt(o*o+l*l);if(u-c>n||u+c<n)return!1;if(Math.abs(i-r)%ee<1e-4)return!0;if(s){const t=i;i=Oi(r),r=Oi(t)}else i=Oi(i),r=Oi(r);i>r&&(r+=ee);let h=Math.atan2(l,o);return h<0&&(h+=ee),h>=i&&h<=r||h+ee>=i&&h+ee<=r}function Ni(t,e,n,i,r,s,a){if(0===r)return!1;const o=r,l=r/2;let c=0,u=t;if(a>e+l&&a>i+l||a<e-l&&a<i-l||s>t+l&&s>n+l||s<t-l&&s<n-l)return!1;if(t===n)return Math.abs(s-t)<=o/2;c=(e-i)/(t-n),u=(t*i-n*e)/(t-n);const h=c*s-a+u;return h*h/(c*c+1)<=o/2*o/2}const Ui=1e-4;function Di(t,e,n,i,r){const s=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,o=3*e-3*t;let l=0;if(wi(a)){if(Ti(s)){const t=-o/s;t>=0&&t<=1&&(r[l++]=t)}}else{const t=s*s-4*a*o;if(wi(t))r[0]=-s/(2*a);else if(t>0){const e=Math.sqrt(t),n=(-s+e)/(2*a),i=(-s-e)/(2*a);n>=0&&n<=1&&(r[l++]=n),i>=0&&i<=1&&(r[l++]=i)}}return l}const zi=[-1,-1,-1],Wi=[-1,-1];function Fi(){const t=Wi[0];Wi[0]=Wi[1],Wi[1]=t}function ji(t,e,n,i,r,s,a,o,l,c){if(c>e&&c>i&&c>s&&c>o||c<e&&c<i&&c<s&&c<o)return 0;const u=function(t,e,n,i,r,s){const a=i+3*(e-n)-t,o=3*(n-2*e+t),l=3*(e-t),c=t-r,u=o*o-3*a*l,h=o*l-9*a*c,d=l*l-3*o*c;let f=0;if(wi(u)&&wi(h))if(wi(o))s[0]=0;else{const t=-l/o;t>=0&&t<=1&&(s[f++]=t)}else{const t=h*h-4*u*d;if(wi(t)){const t=h/u,e=-o/a+t,n=-t/2;e>=0&&e<=1&&(s[f++]=e),n>=0&&n<=1&&(s[f++]=n)}else if(t>0){const e=Math.sqrt(t);let n=u*o+1.5*a*(-h+e),i=u*o+1.5*a*(-h-e);n=n<0?-Math.pow(-n,Ai):Math.pow(n,Ai),i=i<0?-Math.pow(-i,Ai):Math.pow(i,Ai);const r=(-o-(n+i))/(3*a);r>=0&&r<=1&&(s[f++]=r)}else{const t=(2*u*o-3*a*h)/(2*Math.sqrt(u*u*u)),e=Math.acos(t)/3,n=Math.sqrt(u),i=Math.cos(e),r=(-o-2*n*i)/(3*a),l=(-o+n*(i+Si*Math.sin(e)))/(3*a),c=(-o+n*(i-Si*Math.sin(e)))/(3*a);r>=0&&r<=1&&(s[f++]=r),l>=0&&l<=1&&(s[f++]=l),c>=0&&c<=1&&(s[f++]=c)}}return f}(e,i,s,o,c,zi);if(0===u)return 0;let h=0,d=-1,f=0,p=0;for(let c=0;c<u;c++){const u=zi[c],g=0===u||1===u?.5:1;Ei(t,n,r,a,u)<l||(d<0&&(d=Di(e,i,s,o,Wi),Wi[1]<Wi[0]&&d>1&&Fi(),f=Ei(e,i,s,o,Wi[0]),d>1&&(p=Ei(e,i,s,o,Wi[1]))),2===d?u<Wi[0]?h+=f<e?g:-g:u<Wi[1]?h+=p<f?g:-g:h+=o<p?g:-g:u<Wi[0]?h+=f<e?g:-g:h+=o<f?g:-g)}return h}function Hi(t,e,n,i,r,s,a,o){if(o>e&&o>i&&o>s||o<e&&o<i&&o<s)return 0;const l=function(t,e,n,i,r){const s=t-2*e+n,a=2*(e-t),o=t-i;let l=0;if(wi(s)){if(Ti(a)){const t=-o/a;t>=0&&t<=1&&(r[l++]=t)}}else{const t=a*a-4*s*o;if(wi(t)){const t=-a/(2*s);t>=0&&t<=1&&(r[l++]=t)}else if(t>0){const e=Math.sqrt(t),n=(-a+e)/(2*s),i=(-a-e)/(2*s);n>=0&&n<=1&&(r[l++]=n),i>=0&&i<=1&&(r[l++]=i)}}return l}(e,i,s,o,zi);if(0===l)return 0;const c=function(t,e,n){const i=t+n-2*e;return 0===i?.5:(t-e)/i}(e,i,s);if(c>=0&&c<=1){let o=0;const u=Pi(e,i,s,c);for(let i=0;i<l;i++){const l=0===zi[i]||1===zi[i]?.5:1;Pi(t,n,r,zi[i])<a||(zi[i]<c?o+=u<e?l:-l:o+=s<u?l:-l)}return o}const u=0===zi[0]||1===zi[0]?.5:1;return Pi(t,n,r,zi[0])<a?0:s<e?u:-u}function Gi(t,e,n,i,r,s,a,o){if((o-=e)>n||o<-n)return 0;const l=Math.sqrt(n*n-o*o);zi[0]=-l,zi[1]=l;const c=Math.abs(i-r);if(c<1e-4)return 0;if(c>=ee-1e-4){i=0,r=ee;const e=s?1:-1;return a>=zi[0]+t&&a<=zi[1]+t?e:0}if(i>r){const t=i;i=r,r=t}i<0&&(i+=ee,r+=ee);let u=0;for(let e=0;e<2;e++){const n=zi[e];if(n+t>a){let t=Math.atan2(o,n),e=s?1:-1;t<0&&(t=ee+t),(t>=i&&t<=r||t+ee>=i&&t+ee<=r)&&(t>Zt/2&&t<1.5*Zt&&(e=-e),u+=e)}}return u}function Vi(t){return Math.round(t/Zt*1e8)/1e8%2*Zt}function $i(t,e){let n=Vi(t[0]);n<0&&(n+=ee);const i=n-t[0];let r=t[1];r+=i,!e&&r-n>=ee?r=n+ee:e&&n-r>=ee?r=n-ee:!e&&n>r?r=n+(ee-Vi(n-r)):e&&n<r&&(r=n-(ee-Vi(r-n))),t[0]=n,t[1]=r}const Xi=[0,0];function Yi(t,e,n,i,r){const s=t,a=t.length;let o,l,c=0,u=0,h=0,d=0,f=0;for(let t=0;t<a;t++){const a=s[t],p=0===t;a[0]===Oe.M&&t>1&&(n||(c+=xe(u,h,d,f,i,r))),p&&(u=a[1],h=a[2],d=u,f=h);const g=a[0],m=a[1],b=a[2],y=a[3],v=a[4],x=a[5],_=a[6];let S=v,A=x;Xi[0]=S,Xi[1]=A,$i(Xi,Boolean(a[6])),S=Xi[0],A=Xi[1];const w=S,T=A-S,C=!!(1-(a[6]?0:1)),B=(i-m)*y/y+m;switch(g){case Oe.M:d=m,f=b,u=d,h=f;break;case Oe.L:if(n){if(Ni(u,h,m,b,e,i,r))return!0}else c+=xe(u,h,m,b,i,r)||0;u=m,h=b;break;case Oe.C:if(n){if(Ri(u,h,m,b,y,v,x,_,e,i,r))return!0}else c+=ji(u,h,m,b,y,v,x,_,i,r)||0;u=x,h=_;break;case Oe.Q:if(n){if(Li(u,h,m,b,y,v,e,i,r))return!0}else c+=Hi(u,h,m,b,y,v,i,r)||0;u=y,h=v;break;case Oe.A:if(o=Math.cos(w)*y+m,l=Math.sin(w)*y+b,p?(d=o,f=l):c+=xe(u,h,o,l,i,r),n){if(Ii(m,b,y,w,w+T,C,e,B,r))return!0}else c+=Gi(m,b,y,w,w+T,C,B,r);u=Math.cos(w+T)*y+m,h=Math.sin(w+T)*y+b;break;case Oe.R:if(d=u=m,f=h=b,o=d+y,l=f+v,n){if(Ni(d,f,o,f,e,i,r)||Ni(o,f,o,l,e,i,r)||Ni(o,l,d,l,e,i,r)||Ni(d,l,d,f,e,i,r))return!0}else c+=xe(o,f,o,l,i,r),c+=xe(d,l,d,f,i,r);break;case Oe.Z:if(n){if(Ni(u,h,d,f,e,i,r))return!0}else c+=xe(u,h,d,f,i,r);u=d,h=f}}return n||(p=h,g=f,Math.abs(p-g)<Ui)||(c+=xe(u,h,d,f,i,r)||0),0!==c;var p,g}const Ki=new class{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=xi(Object.assign({nativeCanvas:xt.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},n=xi(Object.assign({nativeCanvas:xt.global.createCanvas(e)},e));return this.allocatedCanvas.push(n),n}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},qi={arc:Gn,area:Vn,circle:$n,line:Kn,path:qn,symbol:ti,text:ei,rect:Jn,polygon:Qn,star:Zn,richtext:ni,richtextIcon:ri,image:ii,group:Xn,glyph:Yn},Qi=Object.keys(qi);function Zi(t,e){Object.keys(e).forEach((n=>{t[n]=e[n]}))}const Ji={arc:Object.assign({},qi.arc),area:Object.assign({},qi.area),circle:Object.assign({},qi.circle),line:Object.assign({},qi.line),path:Object.assign({},qi.path),symbol:Object.assign({},qi.symbol),text:Object.assign({},qi.text),rect:Object.assign({},qi.rect),polygon:Object.assign({},qi.polygon),star:Object.assign({},qi.star),richtext:Object.assign({},qi.richtext),richtextIcon:Object.assign({},qi.richtextIcon),image:Object.assign({},qi.image),group:Object.assign({},qi.group),glyph:Object.assign({},qi.glyph)};class tr{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Qi.forEach((t=>{this._defaultTheme[t]=Object.create(Ji[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const n=this.getParentWithTheme(t);return n&&(e=n.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,n=!1){if(this.dirty){const i=this.getParentWithTheme(t);if(i){const t=i.theme;(t.dirty||n)&&t.applyTheme(i,e,!0)}this.userTheme?this.doCombine(i&&i.theme.combinedTheme):(i?this.combinedTheme=i.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,qt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,n=this.combinedTheme;Qi.forEach((i=>{const r=Object.create(Ji[i]);t&&t[i]&&Zi(r,t[i]),n[i]&&Zi(r,n[i]),e[i]&&Zi(r,e[i]),this.combinedTheme[i]=r})),e.common&&Qi.forEach((t=>{Zi(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let n=this.userTheme;n?Object.keys(t).forEach((e=>{n[e]?Object.assign(n[e],t[e]):n[e]=Object.assign({},t[e])})):n=t,this.userTheme=n,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const er=new tr;function nr(t,e){return t.glyphHost?nr(t.glyphHost):e?(t.isContainer,e):function(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):er.getTheme()}return null}(t)||t.attachedThemeGraphic&&nr(t.attachedThemeGraphic)||er.getTheme()}var ir=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function o(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}l((i=i.apply(t,e||[])).next())}))};class rr extends a{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=U.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,n=0;for(;e;){if(t(e,n++))return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){if(t(e,n++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return ir(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&qt.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let n=this._firstChild;for(let t=0;t<e;t++){if(!n)return null;t>0&&(n=n._next)}if(!n)return null;t._next=n._next,t._prev=n,n._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const n=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,n)}let n;this._nodeList[e]=t;for(let t=e-1;t>=0&&(n=this._nodeList[t],!n);t--);if(n)return n._next?this.insertBefore(t,n._next):this.appendChild(t);this._ignoreWarn=!0;const i=this.insertInto(t,0);return this._ignoreWarn=!1,i}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let n=null;return this.forEachChildren(((e,i)=>!(e===this||!t(e,i)||(n=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.find(t,!0);if(i)return n=i,!0}return!1})),n}findAll(t,e=!1){let n=[];return this.forEachChildren(((e,i)=>{e!==this&&t(e,i)&&n.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.findAll(t,!0);i.length&&(n=n.concat(i))}})),n}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let n=0;n<t;n++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let n=this._firstChild;for(;n;)n[t]=e,n.setAllDescendantsProps(t,e),n=n._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,n){const i=At(n,!0)&&n||Bt(n)&&n.capture,r=Bt(n)&&n.once,s=wt(e)?void 0:e;return t=i?`${t}capture`:t,e=wt(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,n){return this.addEventListener(t,e,n)}removeEventListener(t,e,n){const i=At(n,!0)&&n||Bt(n)&&n.capture,r=wt(e)?void 0:e;t=i?`${t}capture`:t,e=wt(e)?e:e.handleEvent;const s=Bt(n)&&n.once;return super.off(t,e,r,s),this}off(t,e,n){return this.removeEventListener(t,e,n)}once(t,e,n){return Bt(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class sr{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=sr.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const n=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(n),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&wt(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&wt(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class ar extends sr{constructor(t,e){super(),this.type=t,this.detail=e}}const or={dispatchEvent(t){var e;if(!(t instanceof sr))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new ar(t,e))}};class lr{static GetImage(t,e){var n;const i=lr.cache.get(t);i?"fail"===i.loadState?xt.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&e.imageLoadSuccess(t,i.data):lr.loadImage(t,e)}static GetSvg(t,e){var n;let i=lr.cache.get(t);i?"fail"===i.loadState?xt.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&e.imageLoadSuccess(t,i.data):(i={type:"image",loadState:"init"},lr.cache.set(t,i),i.dataPromise=xt.global.loadSvg(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{var n;i.loadState=(null==e?void 0:e.data)?"success":"fail",i.data=null==e?void 0:e.data,null===(n=i.waitingMark)||void 0===n||n.map(((n,r)=>{(null==e?void 0:e.data)?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))})),i.waitingMark&&(i.waitingMark=[])}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let n=lr.cache.get(t);return n?"fail"===n.loadState?Promise.reject():"init"===n.loadState||"loading"===n.loadState?n.dataPromise.then((t=>t.data)):Promise.resolve(n.data):(n={type:e,loadState:"init"},lr.cache.set(t,n),"arrayBuffer"===e?n.dataPromise=xt.global.loadArrayBuffer(t):"blob"===e?n.dataPromise=xt.global.loadBlob(t):"json"===e&&(n.dataPromise=xt.global.loadJson(t)),n.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!lr.isLoading&&lr.toLoadAueue.length){lr.isLoading=!0;const t=lr.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:n,marks:i}=t,r={type:"image",loadState:"init"};if(lr.cache.set(n,r),r.dataPromise=xt.global.loadImage(n),r.dataPromise){r.waitingMark=i;const t=r.dataPromise.then((t=>{var e;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(e=r.waitingMark)||void 0===e||e.map(((e,i)=>{(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,e.imageLoadSuccess(n,t.data)):(r.loadState="fail",e.imageLoadFail(n))})),r.waitingMark&&(r.waitingMark=[])}));e.push(t)}else r.loadState="fail",i.forEach((t=>t.imageLoadFail(n)))})),Promise.all(e).then((()=>{lr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),lr.loading()})).catch((t=>{lr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),lr.loading()}))}}),0)}static loadImage(t,e){const n=cr(t,lr.toLoadAueue);if(-1!==n)return lr.toLoadAueue[n].marks.push(e),void lr.loading();lr.toLoadAueue.push({url:t,marks:[e]}),lr.loading()}static improveImageLoading(t){const e=cr(t,lr.toLoadAueue);if(-1!==e){const t=lr.toLoadAueue.splice(e,1);lr.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function cr(t,e){for(let n=0;n<e.length;n++)if(e[n].url===t)return n;return-1}var ur;lr.cache=new Map,lr.isLoading=!1,lr.toLoadAueue=[],lr.onLoadSuccessCb=[],function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(ur||(ur={}));const hr=[0,0,0,0],dr=t=>t?Et(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(hr[0]=t[0],hr[2]=t[0],hr[1]=t[1],hr[3]=t[1],hr):t:t:0,fr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],pr=[1,2,3,0,1,2,3,0];function gr(t,e,n,i){for(;t>=ee;)t-=ee;for(;t<0;)t+=ee;for(;t>e;)e+=ee;fr[0].x=n,fr[1].y=n,fr[2].x=-n,fr[3].y=-n;const r=Math.ceil(t/Jt)%4,s=Math.ceil(e/Jt)%4;if(i.add(re(t)*n,oe(t)*n),i.add(re(e)*n,oe(e)*n),r!==s||e-t>Zt){let t=!1;for(let e=0;e<pr.length;e++)if(t||r!==pr[e]){if(t&&s===pr[e])break;if(t){const t=fr[pr[e]];i.add(t.x,t.y)}}else{t=!0;const e=fr[r];i.add(e.x,e.y)}}}const mr=(t,e)=>{const n=((t,e)=>Pt(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(n)?n:Math.max(e,n)};class br{bounds(t,e){if(Lt(t)){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return Lt(t)?t:Math.min(t[0],t[1])}}function yr(t,e,n,i,r){return r?t.arc(n,i,e,0,te,!1,r):t.arc(n,i,e,0,te),!1}var vr=new class extends br{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,n,i,r){return yr(t,this.parseSize(e)/2,n,i,r)}drawOffset(t,e,n,i,r,s){return yr(t,this.parseSize(e)/2+r,n,i,s)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e-r}, ${n} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}};var xr=new class extends br{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-3*e+n,-e+i,r),t.lineTo(-e+n,-e+i,r),t.lineTo(-e+n,-3*e+i,r),t.lineTo(e+n,-3*e+i,r),t.lineTo(e+n,-e+i,r),t.lineTo(3*e+n,-e+i,r),t.lineTo(3*e+n,e+i,r),t.lineTo(e+n,e+i,r),t.lineTo(e+n,3*e+i,r),t.lineTo(-e+n,3*e+i,r),t.lineTo(-e+n,e+i,r),t.lineTo(-3*e+n,e+i,r),t.closePath(),!0}(t,this.parseSize(e)/6,n,i,r)}drawOffset(t,e,n,i,r,s){return function(t,e,n,i,r,s){return t.moveTo(-3*e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-3*e+i-r,s),t.lineTo(e+n+r,-3*e+i-r,s),t.lineTo(e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,e+i+r,s),t.lineTo(e+n+r,e+i+r,s),t.lineTo(e+n+r,3*e+i+r,s),t.lineTo(-e+n-r,3*e+i+r,s),t.lineTo(-e+n-r,e+i+r,s),t.lineTo(-3*e+n-r,e+i+r,s),t.closePath(),!0}(t,this.parseSize(e)/6,n,i,r,s)}};function _r(t,e,n,i,r){return t.moveTo(n,i-e,r),t.lineTo(e+n,i,r),t.lineTo(n,i+e,r),t.lineTo(n-e,i,r),t.closePath(),!0}var Sr=new class extends br{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,n,i,r){return _r(t,this.parseSize(e)/2,n,i,r)}drawFitDir(t,e,n,i,r){return _r(t,this.parseSize(e)/2,n,i,r)}drawOffset(t,e,n,i,r,s){return _r(t,this.parseSize(e)/2+r,n,i,s)}};function Ar(t,e,n,i){const r=2*e;return t.rect(n-e,i-e,r,r),!1}var wr=new class extends br{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,i){return Ar(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Ar(t,this.parseSize(e)/2+r,n,i)}};function Tr(t,e,n,i,r=0){return t.moveTo(n+e+2*r,e+i+r),t.lineTo(n-e-2*r,e+i+r),t.lineTo(n,i-e-2*r),t.closePath(),!0}class Cr extends br{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,n,i){return Tr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Tr(t,this.parseSize(e)/2,n,i,r)}}var Br=new Cr;var kr=new class extends Cr{constructor(){super(...arguments),this.type="triangle"}};const Mr=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Pr=Math.sin(te/10)*Mr,Er=-Math.cos(te/10)*Mr;function Or(t,e,n,i){const r=Pr*e,s=Er*e;t.moveTo(n,-e+i),t.lineTo(r+n,s+i);for(let a=1;a<5;++a){const o=te*a/5,l=Math.cos(o),c=Math.sin(o);t.lineTo(c*e+n,-l*e+i),t.lineTo(l*r-c*s+n,c*r+l*s+i)}return t.closePath(),!0}var Lr=new class extends br{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,n,i){return Or(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Or(t,this.parseSize(e)/2+r,n,i)}};const Rr=le(3);function Ir(t,e,n,i){const r=e,s=r/Rr,a=s/5,o=e;return t.moveTo(0+n,-r+i),t.lineTo(s/2+n,i),t.lineTo(a/2+n,i),t.lineTo(a/2+n,o+i),t.lineTo(-a/2+n,o+i),t.lineTo(-a/2+n,i),t.lineTo(-s/2+n,i),t.closePath(),!0}var Nr=new class extends br{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,n,i){return Ir(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Ir(t,this.parseSize(e)/2+r,n,i)}};function Ur(t,e,n,i){const r=2*e;return t.moveTo(n,-e+i),t.lineTo(r/3/2+n,e+i),t.lineTo(-r/3/2+n,e+i),t.closePath(),!0}var Dr=new class extends br{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,n,i){return Ur(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Ur(t,this.parseSize(e)/2+r,n,i)}};function zr(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var Wr=new class extends br{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,n,i){return zr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return zr(t,this.parseSize(e)/2+r,n,i)}};const Fr=-.5,jr=le(3)/2,Hr=1/le(12);function Gr(t,e,n,i){const r=e/2,s=e*Hr,a=r,o=e*Hr+e,l=-a,c=o;return t.moveTo(r+n,s+i),t.lineTo(a+n,o+i),t.lineTo(l+n,c+i),t.lineTo(Fr*r-jr*s+n,jr*r+Fr*s+i),t.lineTo(Fr*a-jr*o+n,jr*a+Fr*o+i),t.lineTo(Fr*l-jr*c+n,jr*l+Fr*c+i),t.lineTo(Fr*r+jr*s+n,Fr*s-jr*r+i),t.lineTo(Fr*a+jr*o+n,Fr*o-jr*a+i),t.lineTo(Fr*l+jr*c+n,Fr*c-jr*l+i),t.closePath(),!1}var Vr=new class extends br{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,n,i){return Gr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Gr(t,this.parseSize(e)/2+r,n,i)}};function $r(t,e,n,i,r){return t.moveTo(-e+n-2*r,i),t.lineTo(e+n+r,e+i+2*r),t.lineTo(e+n+r,i-e-2*r),t.closePath(),!0}var Xr=new class extends br{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,n,i){return $r(t,this.parseSize(e)/2,n,i,0)}drawOffset(t,e,n,i,r){return $r(t,this.parseSize(e)/2,n,i,r)}};function Yr(t,e,n,i,r=0){return t.moveTo(n-e-r,e+i+2*r),t.lineTo(e+n+2*r,i),t.lineTo(n-e-r,i-e-2*r),t.closePath(),!0}var Kr=new class extends br{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,n,i){return Yr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Yr(t,this.parseSize(e)/2,n,i,r)}};function qr(t,e,n,i,r=0){return t.moveTo(n-e-2*r,i-e-r),t.lineTo(n+e+2*r,i-e-r),t.lineTo(n,i+e+2*r),t.closePath(),!0}var Qr=new class extends br{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,n,i){return qr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return qr(t,this.parseSize(e)/2,n,i,r)}};const Zr=le(3);function Jr(t,e,n,i){const r=e*Zr;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var ts=new class extends br{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,n,i){return Jr(t,this.parseSize(e)/2/Zr,n,i)}drawOffset(t,e,n,i,r){return Jr(t,this.parseSize(e)/2/Zr+r,n,i)}};function es(t,e,n,i){const r=2*e;return t.moveTo(e+n,i-r),t.lineTo(n-e,i),t.lineTo(e+n,r+i),!0}var ns=new class extends br{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,n,i){return es(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return es(t,this.parseSize(e)/4+r,n,i)}};function is(t,e,n,i){const r=2*e;return t.moveTo(n-e,i-r),t.lineTo(n+e,i),t.lineTo(n-e,r+i),!0}var rs=new class extends br{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,n,i){return is(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return is(t,this.parseSize(e)/4+r,n,i)}};function ss(t,e,n,i){const r=2*e;return t.moveTo(n-r,i+e),t.lineTo(n,i-e),t.lineTo(n+r,i+e),!0}var as=new class extends br{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,n,i){return ss(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return ss(t,this.parseSize(e)/4+r,n,i)}};function os(t,e,n,i){const r=2*e;return t.moveTo(n-r,i-e),t.lineTo(n,i+e),t.lineTo(n+r,i-e),!0}var ls=new class extends br{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,n,i){return os(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return os(t,this.parseSize(e)/4+r,n,i)}};function cs(t,e,n,i,r){return t.moveTo(n,i-e),t.lineTo(n,i+e),!0}var us=new class extends br{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,n,i,r){return cs(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return cs(t,this.parseSize(e)/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e}, ${n-r} L ${e},${n+r}`}};function hs(t,e,n,i,r){return t.moveTo(n-e,i),t.lineTo(n+e,i),!0}var ds=new class extends br{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,n,i,r){return hs(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return hs(t,this.parseSize(e)/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e-r}, ${n} L ${e+r},${n}`}};function fs(t,e,n,i,r){return t.moveTo(n-e,i-e),t.lineTo(n+e,i+e),t.moveTo(n+e,i-e),t.lineTo(n-e,i+e),!0}var ps=new class extends br{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,n,i,r){return fs(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return fs(t,this.parseSize(e)/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e-r}, ${n-r} L ${e+r},${n+r} M ${e+r}, ${n-r} L ${e-r},${n+r}`}};function gs(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}function ms(t,e,n,i){const r=e,s=e/2;return t.rect(n-r/2,i-s/2,r,s),!1}var bs=new class extends br{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,n,i){return Lt(e)?ms(t,e,n,i):gs(t,e,n,i)}drawWithClipRange(t,e,n,i,r,s,a){Lt(e)&&(e=[e,e/2]);const o=2*(e[0]+e[1])*r,l=[{x:n+e[0]/2,y:i-e[1]/2},{x:n+e[0]/2,y:i+e[1]/2},{x:n-e[0]/2,y:i+e[1]/2},{x:n-e[0]/2,y:i-e[1]/2}];let c=0,u=l[3];t.moveTo(u.x,u.y);for(let e=0;e<l.length;e++){const n=l[e],i=Math.sqrt((n.x-u.x)*(n.x-u.x)+(n.y-u.y)*(n.y-u.y));if(c+i>o){const e=(n.x-u.x)*(o-c)/i,r=(n.y-u.y)*(o-c)/i;t.lineTo(u.x+e,u.y+r);break}t.lineTo(n.x,n.y),u=n,c+=i}return!1}drawOffset(t,e,n,i,r){return Lt(e)?ms(t,e+2*r,n,i):gs(t,[e[0]+2*r,e[1]+2*r],n,i)}};const ys=new Ae;class vs{constructor(t,e,n=!1){this.pathStr="",this.type=t,Et(e)?this.svgCache=e:this.path=e,this.isSvg=n}drawOffset(t,e,n,i,r,s,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),Ye(r.path.commandList,t,n,i,e,e),a&&a(r.path,r.attribute)})),!1):(Ye(this.path.commandList,t,n,i,e+r,e+r),!1)}draw(t,e,n,i,r,s){return e=this.parseSize(e),this.drawOffset(t,e,n,i,0,r,s)}parseSize(t){return Lt(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,n,i,r,s,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{s.path.drawWithClipRange(t,e,n,i,r),a&&a(s.path,s.attribute)})),!1):(this.path.drawWithClipRange(t,e,n,i,r),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:n})=>{ys.x1=n.bounds.x1*t,ys.y1=n.bounds.y1*t,ys.x2=n.bounds.x2*t,ys.y2=n.bounds.y2*t,e.union(ys)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const xs={};[vr,xr,Sr,wr,ts,kr,Lr,Nr,Dr,Wr,Vr,Xr,Kr,Br,Qr,ns,rs,as,ls,bs,us,ds,ps].forEach((t=>{xs[t.type]=t}));const _s={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class Ss{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function As(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function ws(t,e,n,i=">"){const r=function(t,e,n=">"){let i,r="";for(let s=e;s<t.length;s++){let e=t[s];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,i);if(!r)return;let s=r.data;const a=r.index,o=s.search(/\s/);let l=s,c=!0;-1!==o&&(l=s.substr(0,o).replace(/\s\s*$/,""),s=s.substr(o+1));const u=l;if(n){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),c=l!==r.data.substr(t+1))}return{tagName:l,tagExp:s,closeIndex:a,attrExpPresent:c,rawTagName:u}}const Ts=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class Cs{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,n){const i=e.tagname;"string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,n){const i={};if(!t)return;const r=function(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let t=0;t<s;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n}(t,Ts),s=r.length;for(let t=0;t<s;t++){const e=r[t][1],n=r[t][4];e&&(i[e]=void 0===n||(isNaN(n)?n:Number(n)))}return i}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Ss("!xml");let n=e,i="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=As(t,">",s,"Closing Tag is not closed."),a=r.lastIndexOf(".");r=r.substring(0,a),n=this.tagsNodeStack.pop(),n&&n.child&&i&&n.child[n.child.length-1][":@"]&&(n.child[n.child.length-1][":@"].text=i),i="",s=e}else if("?"===t[s+1])s=ws(t,s,!1,"?>").closeIndex+1;else if("!--"===t.substr(s+1,3))s=As(t,"--\x3e",s+4,"Comment is not closed.");else{const a=ws(t,s,!1);let o=a.tagName,l=a.tagExp;const c=a.attrExpPresent,u=a.closeIndex;if(o!==e.tagname&&(r+=r?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),r=r.substr(0,r.length-1),l=o):l=l.substr(0,l.length-1);const t=new Ss(o);o!==l&&c&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(n,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new Ss(o);this.tagsNodeStack.push(n),o!==l&&c&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(n,t,r),n=t}i="",s=u}else i+=t[s];return e.child}}function Bs(t,e){return ks(t)}function ks(t,e){const n={};for(let e=0;e<t.length;e++){const r=t[e],s=Ms(r);if(void 0!==s&&r[s]){const t=ks(r[s]);i=t,Object.keys(i).length,r[":@"]&&Ps(t,r[":@"]),void 0!==n[s]&&n.hasOwnProperty(s)?(Array.isArray(n[s])||(n[s]=[n[s]]),n[s].push(t)):n[s]=t}}var i;return n}function Ms(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function Ps(t,e,n){if(e){const n=Object.keys(e),i=n.length;for(let r=0;r<i;r++){const i=n[r];t[i]=e[i]}}}class Es{constructor(t){this.options=Object.assign({},Es.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Bs(new Cs(this.options).parseXml(t),this.options)}}function Os(t,e,n,i=0){return t.expand(e+(i/2+(n?function(t,e){return t?e:0}(n,e):0))),t}Es.defaultOptions={};let Ls=0;function Rs(){return Ls++}var Is;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Is||(Is={}));const Ns=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Ns.set(t,!0)));const Us=new Map;function Ds(t){if(Ns.has(t))return!0;if(Us.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Us.set(t,!0)));const zs=Rs();Rs(),Rs(),Rs(),Rs();const Ws=Rs(),Fs=Rs();Rs(),Rs(),Rs(),Rs();const js=Rs();Rs();const Hs=Rs();Rs();const Gs=Rs(),Vs=Rs(),$s=Symbol.for("GraphicCreator"),Xs={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},Ys=Object.keys(Xs),Ks={duration:200,easing:"cubicOut"};function qs(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Qs(t,e,n){const i=n[0],r=n[1],s=n[2];let a,o,l,c,u,h,d,f,p,g,m,b;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*s+e[12],t[13]=e[1]*i+e[5]*r+e[9]*s+e[13],t[14]=e[2]*i+e[6]*r+e[10]*s+e[14],t[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],l=e[2],c=e[3],u=e[4],h=e[5],d=e[6],f=e[7],p=e[8],g=e[9],m=e[10],b=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=c,t[4]=u,t[5]=h,t[6]=d,t[7]=f,t[8]=p,t[9]=g,t[10]=m,t[11]=b,t[12]=a*i+u*r+p*s+e[12],t[13]=o*i+h*r+g*s+e[13],t[14]=l*i+d*r+m*s+e[14],t[15]=c*i+f*r+b*s+e[15]),t}function Zs(t,e,n){const i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],b=e[14],y=e[15];let v=n[0],x=n[1],_=n[2],S=n[3];return t[0]=v*i+x*o+_*h+S*g,t[1]=v*r+x*l+_*d+S*m,t[2]=v*s+x*c+_*f+S*b,t[3]=v*a+x*u+_*p+S*y,v=n[4],x=n[5],_=n[6],S=n[7],t[4]=v*i+x*o+_*h+S*g,t[5]=v*r+x*l+_*d+S*m,t[6]=v*s+x*c+_*f+S*b,t[7]=v*a+x*u+_*p+S*y,v=n[8],x=n[9],_=n[10],S=n[11],t[8]=v*i+x*o+_*h+S*g,t[9]=v*r+x*l+_*d+S*m,t[10]=v*s+x*c+_*f+S*b,t[11]=v*a+x*u+_*p+S*y,v=n[12],x=n[13],_=n[14],S=n[15],t[12]=v*i+x*o+_*h+S*g,t[13]=v*r+x*l+_*d+S*m,t[14]=v*s+x*c+_*f+S*b,t[15]=v*a+x*u+_*p+S*y,t}class Js{constructor(){this.pools=[]}static identity(t){return qs(t)}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return Js.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let n=0;n<e.length;n++)e[n]=t[n];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const ta=new class{constructor(){this.pools=[]}allocate(t,e,n,i,r,s){if(!this.pools.length)return new Te(t,e,n,i,r,s);const a=this.pools.pop();return a.a=t,a.b=e,a.c=n,a.d=i,a.e=r,a.f=s,a}allocateByObj(t){if(!this.pools.length)return new Te(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},ea=new Js;var na=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},ia=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const ra=new Te(1,0,0,1,0,0),sa={x:0,y:0};let aa=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Te(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Te(1,0,0,1,0,0),this.path=new Rn,this._clearMatrix=new Te(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return ta.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}reset(){this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Te(1,0,0,1,0,0),this.stack.length=0}restore(){this.stack.length>0&&(ta.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(ta.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,n=!0){this.matrix.scale(t,e),n&&this.setTransformForCurrent()}setScale(t,e,n=!0){this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}scalePoint(t,e,n,i,r=!0){this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}setTransform(t,e,n,i,r,s,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*n,o*i,o*r,o*s),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,n=this.dpr){this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,n,i,r,s,a=!0){this.matrix.multiply(t,e,n,i,r,s),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,n=!0){this.matrix.translate(t,e),n&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const n=t*Math.PI/180;this.rotate(n,e)}rotateAbout(t,e,n,i=!0){this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,n,i=!0){this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,n,i,r,s){this.path.arc(t,e,n,i,r,s)}arcTo(t,e,n,i,r){this.path.arcTo(t,e,n,i,r)}bezierCurveTo(t,e,n,i,r,s){this.path.bezierCurveTo(t,e,n,i,r,s)}closePath(){this.path.closePath()}ellipse(t,e,n,i,r,s,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,n,i){this.path.quadraticCurveTo(t,e,n,i)}rect(t,e,n,i){this.path.rect(t,e,n,i)}createImageData(t,e){return null}createLinearGradient(t,e,n,i){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,n,i,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,n,i){return null}fill(t,e){}fillRect(t,e,n,i){this.path.rect(t,e,n,i)}clearRect(t,e,n,i){}fillText(t,e,n){}getImageData(t,e,n,i){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},sa),function(t,e,n){return Yi(t,0,!1,e,n)}(this.path.commandList,sa.x,sa.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},sa);const n=oi(this,this.lineWidth,this.dpr);return function(t,e,n,i){return Yi(t,e,!0,n,i)}(this.path.commandList,n,sa.x,sa.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,n){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,n,i){this.path.rect(t,e,n,i)}strokeText(t,e,n){}drawImage(){}setCommonStyle(t,e,n,i,r){}_setCommonStyle(t,e,n,i){}setStrokeStyle(t,e,n,i,r){}_setStrokeStyle(t,e,n,i){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(ra,t,e)}setClearMatrix(t,e,n,i,r,s){this._clearMatrix.setValue(t,e,n,i,r,s)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>ta.free(t))),this.stack.length=0}};aa=na([K(),ia("design:paramtypes",[Object,Number])],aa);const oa=new Ae,la=new Te;new Ae;const ca=["lineWidth","scaleX","scaleY","angle","anchor","visible"],ua=["x","y"],ha=["scaleX","scaleY"],da=["angle"],fa=new he,pa={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class ga extends rr{static mixin(t){const e=Object.keys(t);for(let n=0;n<e.length;++n){const i=e[n];Object.defineProperty(ga.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(t={}){var e;super(),this._AABBBounds=new Ae,this._updateTag=ze.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}getGraphicService(){var t,e;return null!==(e=null===(t=this.stage)||void 0===t?void 0:t.graphicService)&&void 0!==e?e:xt.graphicService}getAttributes(){return this.attribute}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var n,i;const{dx:r=t.dx,dy:s=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;fa.x=r+(null!==(n=t.scrollX)&&void 0!==n?n:0),fa.y=s+(null!==(i=t.scrollY)&&void 0!==i?i:0)}else fa.x=r,fa.y=s;return fa}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new we),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let n=this.clipPathMap.get(e)||null;return n||(this.clipPathMap.size>10&&this.clipPathMap.clear(),n=this.parsePath(e),n&&this.clipPathMap.set(e,n)),n}parsePath(t){if(!t)return null;let e=xs[t];if(e)return e;if(e=ga.userSymbolMap[t],e)return e;if(!0===((n=t=_s[t]||t).startsWith("<svg")||n.startsWith("<?xml"))){const e=new Es,{svg:n}=e.parse(t);if(!n)return null;const i=Et(n.path)?n.path:[n.path];oa.clear();const r=[];i.forEach((t=>{const e=(new Rn).fromString(t.d),n={};Ys.forEach((e=>{t[e]&&(n[Xs[e]]=t[e])})),r.push({path:e,attribute:n}),oa.union(e.bounds)}));const s=oa.width(),a=oa.height(),o=1/se(s,a);r.forEach((t=>t.path.transform(0,0,o,o)));const l=new vs(t,r,!0);return ga.userSymbolMap[t]=l,l}var n;const i=(new Rn).fromString(t),r=i.bounds.width(),s=i.bounds.height(),a=1/se(r,s);i.transform(0,0,a,a);const o=new vs(t,i);return ga.userSymbolMap[t]=o,o}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const n=this.attribute,i=this.updateAABBBounds(n,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=n,s=dr(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const n=new ke(t);return Ye(e.commandList,n,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new Te),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&ze.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&ze.UPDATE_BOUNDS)&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&ze.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&ze.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&ze.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const n=this.attribute;return Number.isFinite((null!==(t=n.x)&&void 0!==t?t:0)+(null!==(e=n.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&ze.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=ze.CLEAR_SHAPE}containsPoint(t,e,n,i){if(!i)return!1;if(n===We.GLOBAL){const n=new he(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),t=n.x,e=n.y}return i.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributesAndPreventAnimate(t,e=!1,n,i){this.setAttributes(t,e,n),this.animates&&this.animates.forEach((e=>{(e.priority!==1/0||i)&&Object.keys(t).forEach((t=>{e.preventAttr(t)}))}))}setAttributes(t,e=!1,n){t&&((t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,n))}_setAttributes(t,e=!1,n){const i=Object.keys(t);for(let e=0;e<i.length;e++){const n=i[e];this.attribute[n]=t[n]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)}setAttribute(t,e,n,i){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);s?this._setAttributes(s,n,i):Tt(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t,e=ca){for(let n=0;n<e.length;n++){const i=e[n];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t,e=ca){for(let n=0;n<e.length;n++)if(t===e[n])return!0;return!1}initAttributes(t){const e={type:Fe.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=ze.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var n,i;if(0===t&&0===e)return this;const r={type:Fe.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ua,r);s&&(t=s.x,e=s.y,delete s.x,delete s.y,this._setAttributes(s));const a=this.attribute,o=a.postMatrix;return o?xt.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(n=a.x)&&void 0!==n?n:Un.x)+t,a.y=(null!==(i=a.y)&&void 0!==i?i:Un.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}translateTo(t,e){const n=this.attribute;if(n.x===t&&n.y===e)return this;const i={type:Fe.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ua,i);return r?(this._setAttributes(r,!1,i),this):(n.x=t,n.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}scale(t,e,n){var i,r;if(1===t&&1===e)return this;const s={type:Fe.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,ha,s);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(n){let{postMatrix:i}=this.attribute;i||(i=new Te,o.postMatrix=i),xt.transformUtil.fromMatrix(i,i).scale(t,e,n)}else o.scaleX=(null!==(i=o.scaleX)&&void 0!==i?i:Un.scaleX)*t,o.scaleY=(null!==(r=o.scaleY)&&void 0!==r?r:Un.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}scaleTo(t,e){const n=this.attribute;if(n.scaleX===t&&n.scaleY===e)return this;const i={type:Fe.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,ha,i);return r?(this._setAttributes(r,!1,i),this):(n.scaleX=t,n.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}rotate(t,e){var n;if(0===t)return this;const i={type:Fe.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,da,i);r&&(delete r.angle,this._setAttributes(r,!1,i));const s=this.attribute;if(e){let{postMatrix:n}=this.attribute;n||(n=new Te,s.postMatrix=n),xt.transformUtil.fromMatrix(n,n).rotate(t,e)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:Un.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const n={type:Fe.ROTATE_TO},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,da,n);return i?(this._setAttributes(i,!1,n),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}onAttributeUpdate(t){t&&t.skipUpdateCallback||(this.getGraphicService().onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!Tt(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,n,i){var r,s;if(n){const e=Object.keys(t),n=this.getNoWorkAnimateAttr(),a={};let o;e.forEach((e=>{n[e]?(o||(o={}),o[e]=t[e]):a[e]=i&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const l=null!==(s=null!==(r=this.context&&this.context.stateAnimateConfig)&&void 0!==r?r:this.stateAnimateConfig)&&void 0!==s?s:Ks;this.applyAnimationState(["state"],[{name:"state",animation:{type:"state",to:a,duration:l.duration,easing:l.easing}}]),o&&this.setAttributesAndPreventAnimate(o,!1,{type:Fe.STATE})}else this.stopStateAnimates(),this.setAttributesAndPreventAnimate(t,!1,{type:Fe.STATE}),this.finalAttribute&&Object.assign(this.finalAttribute,t);this._emitCustomEvent("afterStateUpdate",{type:Fe.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(t="end"){this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){var e,n;const i=this.attribute[t];return this.animates?null===(e=this.finalAttribute)||void 0===e?void 0:e[t]:null!=i?i:null===(n=this.finalAttribute)||void 0===n?void 0:n[t]}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const n=Et(t)?e=>!t.includes(e):e=>e!==t,i=this.currentStates.filter(n);i.length!==this.currentStates.length&&this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const n=this.currentStates?this.currentStates.slice():[];n.push(t),this.useStates(n,e)}}addState(t,e,n){var i;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(i=this.currentStates)||void 0===i?void 0:i.length)?this.currentStates.concat([t]):[t];this.useStates(r,n)}useStates(t,e){var n;if(!t.length)return void this.clearStates(e);if((null===(n=this.currentStates)||void 0===n?void 0:n.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const i={};t.forEach((e=>{var n;const r=this.stateProxy?this.stateProxy(e,t):null===(n=this.states)||void 0===n?void 0:n[e];r&&Object.assign(i,r)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}addUpdateBoundTag(){this._updateTag|=ze.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=ze.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=ze.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&ze.UPDATE_SHAPE_AND_BOUNDS)===ze.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=ze.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=ze.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=ze.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=ze.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=ze.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=ze.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=ze.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&ze.UPDATE_LAYOUT)}getAnchor(t,e,n){const i=[0,0],r=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,n&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,n=r();i[0]=n.x1+(n.x2-n.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,n=r();i[1]=n.y1+(n.y2-n.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=Un.x,y:e=Un.y,scaleX:n=Un.scaleX,scaleY:i=Un.scaleY,angle:r=Un.angle,scaleCenter:s,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const c={};if(a&&r&&(l=this.getAnchor(a,c)),!s||1===n&&1===i)!function(t,e,n,i,r,s,a,o){const l=e.a,c=e.b,u=e.c,h=e.d,d=e.e,f=e.f,p=re(a),g=oe(a);let m,b;o?(m=o[0],b=o[1]):(m=n,b=i);const y=m-n,v=b-i,x=l*p+u*g,_=c*p+h*g,S=u*p-l*g,A=h*p-c*g;t.a=r*x,t.b=r*_,t.c=s*S,t.d=s*A,t.e=d+l*m+u*b-x*y-S*v,t.f=f+c*m+h*b-_*y-A*v}(this._transMatrix,this._transMatrix.reset(),t,e,n,i,r,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(r),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(s,c,!0),xt.transformUtil.fromMatrix(a,a).scale(n,i,{x:l[0],y:l[1]})}const u=this.getOffsetXY(Un);if(this._transMatrix.e+=u.x,this._transMatrix.f+=u.y,o){const t=la.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.timeline.isGlobal&&(t.setTimeline(e),e.addAnimate(t))}))}this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Fe.ANIMATE_END})}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:xt.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return Pt(t,!0)?this.pathProxy=(new Rn).fromString(t):this.pathProxy=new Rn,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const n=t;this.resources||(this.resources=new Map);const i={data:"init",state:null};this.resources.set(n,i),"string"==typeof t?(i.state="loading",t.startsWith("<svg")?(lr.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(It(t)||t.includes("/")||Nt(t))&&(lr.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):Bt(t)?(i.state="success",i.data=t,this.backgroundImg=this.backgroundImg||e):i.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,n){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="success",i.data=e,n&&n(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),xt.graphicService.onRelease(this)}_emitCustomEvent(t,e){var n,i;if(this._events&&t in this._events){const r=new ar(t,e);r.bubbles=!1,r.manager=null===(i=null===(n=this.stage)||void 0===n?void 0:n.eventSystem)||void 0===i?void 0:i.manager,this.dispatchEvent(r)}}toCustomPath(){var t,e,n;const i=null===(n=null===(e=(null===(t=this.stage)||void 0===t?void 0:t.renderService)||xt.renderService)||void 0===e?void 0:e.drawContribution)||void 0===n?void 0:n.getRenderContribution(this);if(i){const t=new aa(null,1);return i.drawShape(this,t,0,0,{},{}),t.path}return null}}var ma;ga.userSymbolMap={},ga.mixin(or),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(ma||(ma={}));let ba=class t extends ga{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Ws,this._childUpdateTag=ze.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new tr),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new tr)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,n){if(n===We.GLOBAL){const n=new he(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),this.AABBBounds.contains(n.x,n.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&ze.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=Un.x,y:e=Un.y,dx:n=Un.dx,dy:i=Un.dy,scaleX:r=Un.scaleX,scaleY:s=Un.scaleY,angle:a=Un.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==n||0!==i||1!==r||1!==s||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return nr(this).group}updateAABBBounds(t,e,n){const i=n;n=n.clone();const{width:r,height:s,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{n.union(t.AABBBounds)})):null!=r&&null!=s&&n.set(0,0,Math.max(0,r),Math.max(0,s)),!o){this.forEachChildren((t=>{n.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:i=0}=t;n.translate(e,i)}return xt.graphicService.updateTempAABBBounds(n),xt.graphicService.transformAABBBounds(t,n,e,!1,this),i.copy(n),i}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=ze.CLEAR_BOUNDS,this._childUpdateTag&=ze.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=ze.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&ze.UPDATE_BOUNDS||(this._childUpdateTag|=ze.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),this.getGraphicService().onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),this.getGraphicService().onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){const n=super.appendChild(t);return e&&this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return this.getGraphicService().onRemove(t),t.stage=null,this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren((e=>{this.getGraphicService().onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&ze.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,n){let i=this._getChildByName(t);return i?i.setAttributes(e):(i=xt.graphicService.creator[n](e),i.name=t,this.add(i)),i}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}};function ya(t){return new ba(t)}function va(t,e){return!(!t&&!e)}function xa(t,e){let n;return n=Et(t)?t.some((t=>t||void 0===t)):!!t,n&&e>0}function _a(t,e,n){return n&&t*e>0}function Sa(t,e){return t*e>0}ba.NOWORK_ANIMATE_ATTR=pa;const Aa=Symbol.for("ImageRenderContribution"),wa=Symbol.for("RectRenderContribution"),Ta=Symbol.for("SymbolRenderContribution"),Ca=Symbol.for("TextRenderContribution"),Ba=Symbol.for("InteractiveSubRenderContribution");function ka(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Ma(t,e,n,i=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?i-e:t&&"alphabetic"!==t?0:(n||(n=e),-(e-n)/2-.79*n)}var Pa=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Ea=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Oa=function(t,e){return function(n,i){e(n,i,t)}};function La(t,e,n){var i;const{x:r=n.x,y:s=n.y,z:a=n.z,dx:o=n.dx,dy:l=n.dy,dz:c=n.dz,scaleX:u=n.scaleX,scaleY:h=n.scaleY,scaleZ:d=n.scaleZ,alpha:f=n.alpha,beta:p=n.beta,angle:g=n.angle,anchor3d:m=e.attribute.anchor,anchor:b}=e.attribute,y=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,n=e.AABBBounds;y[0]=n.x1+(n.x2-n.x1)*t}else y[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,n=e.AABBBounds;y[1]=n.x1+(n.x2-n.x1)*t}else y[1]=m[1];y[2]=null!==(i=m[2])&&void 0!==i?i:0}if(qs(t),Qs(t,t,[r+o,s+l,a+c]),Qs(t,t,[y[0],y[1],y[2]]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+c*i,t[5]=a*r+u*i,t[6]=o*r+h*i,t[7]=l*r+d*i,t[8]=c*r-s*i,t[9]=u*r-a*i,t[10]=h*r-o*i,t[11]=d*r-l*i}(t,t,p),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],a=e[1],o=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-c*i,t[1]=a*r-u*i,t[2]=o*r-h*i,t[3]=l*r-d*i,t[8]=s*i+c*r,t[9]=a*i+u*r,t[10]=o*i+h*r,t[11]=l*i+d*r}(t,t,f),Qs(t,t,[-y[0],-y[1],y[2]]),function(t,e,n){const i=n[0],r=n[1],s=n[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[u,h,d]),g){const n=ea.allocate(),i=[0,0];if(b){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,n=e.AABBBounds;i[0]=n.x1+(n.x2-n.x1)*t}else i[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,n=e.AABBBounds;i[1]=n.x1+(n.x2-n.x1)*t}else i[1]=m[1]}Qs(n,n,[i[0],i[1],0]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],a=e[1],o=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+c*i,t[1]=a*r+u*i,t[2]=o*r+h*i,t[3]=l*r+d*i,t[4]=c*r-s*i,t[5]=u*r-a*i,t[6]=h*r-o*i,t[7]=d*r-l*i}(n,n,g),Qs(n,n,[-i[0],-i[1],0]),Zs(t,t,n)}}let Ra=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new mt(["graphic"]),onSetStage:new mt(["graphic","stage"]),onRemove:new mt(["graphic"]),onRelease:new mt(["graphic"]),onAddIncremental:new mt(["graphic","group","stage"]),onClearIncremental:new mt(["graphic","group","stage"]),beforeUpdateAABBBounds:new mt(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new mt(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new mt(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new Ae,this.tempAABBBounds2=new Ae}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,n){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,n)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,n,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,n,i)}afterUpdateAABBBounds(t,e,n,i,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,n,i,r)}clearAABBBounds(t,e,n){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,n)}updatePathProxyAABBBounds(t,e){const n="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!n)return!1;const i=new ke(t);return Ye(n.commandList,i,0,0),!0}updateHTMLTextAABBBounds(t,e,n,i){const{textAlign:r,textBaseline:s}=t;if(null!=t.forceBoundsHeight){const e=Lt(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),i=Ma(s,e,e);n.set(n.x1,i,n.x2,i+e)}if(null!=t.forceBoundsWidth){const e=Lt(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),i=ka(r,e);n.set(i,n.y1,i+e,n.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const n=e.shadowRoot.AABBBounds;t.union(n)}}transformAABBBounds(t,e,n,i,r){if(!e.empty()){const{scaleX:r=n.scaleX,scaleY:s=n.scaleY,stroke:a=n.stroke,shadowBlur:o=n.shadowBlur,lineWidth:l=n.lineWidth,pickStrokeBuffer:c=n.pickStrokeBuffer,strokeBoundsBuffer:u=n.strokeBoundsBuffer}=t,h=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){Os(h,(l+c)/Math.abs(r+s),i,u),e.union(h),h.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:i=n.shadowOffsetX,shadowOffsetY:a=n.shadowOffsetY}=t;Os(h,o/Math.abs(r+s)*2,!1,u+1),h.translate(i,a),e.union(h)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let s=!0;const a=r.transMatrix;r&&r.isContainer&&(s=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),s&&_e(e,e,a)}validCheck(t,e,n,i){if(!i)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(i.shadowRoot||i.isContainer)return!0;const{visible:r=e.visible}=t;return!(!i.valid||!r)||(n.empty()||(i.parent&&n.transformWithMatrix(i.parent.globalTransMatrix),this.clearAABBBounds(i,i.stage,n),n.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,n=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),n.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:n}}};Ra=Pa([K(),Oa(0,X($s)),Ea("design:paramtypes",[Object])],Ra);const Ia=(t,e,n)=>{const{outerBorder:i,shadowBlur:r=e.shadowBlur}=t;if(i){const t=e.outerBorder,{distance:s=t.distance,lineWidth:a=t.lineWidth}=i;n.expand(s+(r+a)/2)}return n};class Na{constructor(t,e,n){this.fontFamily=t,this.textOptions=e,this.textMeasure=n}LayoutBBox(t,e,n,i){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===n)t.yOffset=0;else if("middle"===n)t.yOffset=t.height/-2;else if("alphabetic"===n){let e=.79;if(1===i.length){const t=i[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,n,i,r="",s,a){const{lineWidth:o,suffixPosition:l="end",measureMode:c=_t.actualBounding,keepCenterInLine:u=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const h=[],d=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let n=0,i=t.length;n<i;n++){const i=this.textMeasure.measureTextPixelADscentAndWidth(t[n],this.textOptions,c);let a=t[n].toString();if(i.width>o){const i=this.textMeasure.clipTextWithSuffix(t[n],this.textOptions,o,r,s,l);a=i.str,e=i.width}else e=i.width;h.push({str:a,width:e,ascent:i.ascent,descent:i.descent,keepCenterInLine:u})}d[0]=o}else{let e,n,i=0;for(let r=0,s=t.length;r<s;r++){n=t[r];const s=this.textMeasure.measureTextPixelADscentAndWidth(t[r],this.textOptions,c);e=s.width,i=Math.max(i,e),h.push({str:n,width:e,ascent:s.ascent,descent:s.descent,keepCenterInLine:u})}d[0]=i}d[1]=h.length*i,d[0]=h.reduce(((t,e)=>Math.max(t,e.width)),0);const f={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(f,e,n,h),this.layoutWithBBox(f,h,e,n,i)}layoutWithBBox(t,e,n,i,r){const s=[0,0],a=e.length*r;"top"===i||("middle"===i?s[1]=(t.height-a)/2:"bottom"===i&&(s[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],n,i,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:n,textBaseline:i}}lineOffset(t,e,n,i,r,s){if("left"===n||"start"===n?e.leftOffset=0:"center"===n?e.leftOffset=(t.width-e.width)/2:"right"!==n&&"end"!==n||(e.leftOffset=t.width-e.width),e.topOffset=r/2+(e.ascent-e.descent)/2+s[1],!e.keepCenterInLine){const t=0,n=e.ascent+e.descent+t;if(n<r-t&&("bottom"===i?e.topOffset+=(r-n)/2:"top"===i&&(e.topOffset-=(r-n)/2)),"alphabetic"===i){const t=r/(e.ascent+e.descent);e.topOffset=r/2+(e.ascent-e.descent)/2*t+s[1]}}return s[1]+=r,e}}const Ua=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...ca];let Da=class t extends ga{get font(){const t=this.getGraphicTheme();return this._font||(this._font=function(t,e={},n){n||(n=1);const{fontStyle:i=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(i?i+" ":"")+(r?r+" ":"")+(s?s+" ":"")+a*n+"px "+(o||"sans-serif")}(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,n=this.getGraphicTheme(),i=this.getMaxWidth(n);return Number.isFinite(i)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:n.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const n=this.getGraphicTheme(),i=this.attribute,r=this.getMaxWidth(n);if(!Number.isFinite(r))return!1;const{text:s}=this.attribute;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(s)?s.join(""):s).toString()!==t}return"vertical"===i.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==i.text.toString():null!=this.clipedText&&this.clipedText!==i.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=Vs,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return Et(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return nr(this).text}doUpdateOBBBounds(){const e=this.getGraphicTheme();this._OBBBounds.clear();const n=this.attribute,{angle:i=e.angle}=n;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new t({})),this.obbText.setAttributes(Object.assign(Object.assign({},n),{angle:0}));const r=this.obbText.AABBBounds,{x:s,y:a}=n,o={x:(r.x1+r.x2)/2,y:(r.y1+r.y2)/2},l=be(o,i,{x:s,y:a});return this._OBBBounds.copy(r),this._OBBBounds.translate(l.x-o.x,l.y-o.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,n){const{text:i=e.text}=this.attribute;Array.isArray(i)?this.updateMultilineAABBBounds(i):this.updateSingallineAABBBounds(i);const{tb1:r}=xt.graphicService.updateTempAABBBounds(n),{scaleX:s=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){Os(r,o/Math.abs(s+a),!0,l),n.union(r)}return xt.graphicService.combindShadowAABBBounds(n,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||xt.graphicService.updateHTMLTextAABBBounds(t,e,n),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,_e(n,n,this.transMatrix),n}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:n=e.direction,underlineOffset:i=e.underlineOffset}=this.attribute,r="horizontal"===n?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===n&&i&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+i),r}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e,n;const i=this.getGraphicTheme(),r=this.attribute,{fontFamily:s=i.fontFamily,textAlign:a=i.textAlign,textBaseline:o=i.textBaseline,fontSize:l=i.fontSize,fontWeight:c=i.fontWeight,ellipsis:u=i.ellipsis,maxLineWidth:h,stroke:d=i.stroke,wrap:f=i.wrap,measureMode:p=i.measureMode,lineWidth:g=i.lineWidth,whiteSpace:m=i.whiteSpace,suffixPosition:b=i.suffixPosition,ignoreBuf:y=i.ignoreBuf,keepCenterInLine:v=i.keepCenterInLine}=r,x=y?0:this.guessLineHeightBuf(l),_=this.getLineHeight(r,i,x);if("normal"===m||f)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(g/2),this._AABBBounds}const S=xt.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null===(n=this.stage)||void 0===n?void 0:n.textMeasureId)),A=new Na(s,{fontSize:l,fontWeight:c,fontFamily:s,lineHeight:_},S).GetLayoutByLines(t,a,o,_,!0===u?i.ellipsis:u||void 0,!1,{lineWidth:h,suffixPosition:b,measureMode:p,keepCenterInLine:v}),{bbox:w}=A;return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(w.xOffset,w.yOffset,w.xOffset+w.width,w.yOffset+w.height),d&&this._AABBBounds.expand(g/2),this._AABBBounds}updateWrapAABBBounds(t){var e,n,i,r;const s=this.getGraphicTheme(),{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:l=s.textBaseline,fontSize:c=s.fontSize,ellipsis:u=s.ellipsis,maxLineWidth:h,stroke:d=s.stroke,lineWidth:f=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:g=s.fontWeight,ignoreBuf:m=s.ignoreBuf,measureMode:b=s.measureMode,suffixPosition:y=s.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:_=s.keepCenterInLine}=this.attribute,S=m?0:this.guessLineHeightBuf(c),A=this.getLineHeight(this.attribute,s,S);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}const w=xt.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null===(n=this.stage)||void 0===n?void 0:n.textMeasureId)),T={fontSize:c,fontWeight:g,fontFamily:a,lineHeight:A},C=new Na(a,T,w),B=Et(t)?t.map((t=>t.toString())):[t.toString()],k=[],M=[0,0];let P=1/0;if(v>0&&(P=Math.max(Math.floor(v/A),1)),x&&(P=Math.min(P,x)),"number"==typeof h&&h!==1/0){if(h>0)for(let t=0;t<B.length;t++){const e=B[t];let n=!0;if(t===P-1){const n=w.clipTextWithSuffix(e,T,h,u,!1,y,t!==B.length-1),i=w.measureTextPixelADscentAndWidth(n.str,T,b);k.push({str:n.str,width:n.width,ascent:i.ascent,descent:i.descent,keepCenterInLine:_});break}const s=w.clipText(e,T,h,"break-all"!==p,"keep-all"===p);if(""!==e&&""===s.str||s.wordBreaked){if(u){const t=w.clipTextWithSuffix(e,T,h,u,!1,y);s.str=null!==(i=t.str)&&void 0!==i?i:"",s.width=null!==(r=t.width)&&void 0!==r?r:0}else s.str="",s.width=0;n=!1}const a=w.measureTextPixelADscentAndWidth(s.str,T,b);k.push({str:s.str,width:s.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:_});let o=s.str.length;if(!s.wordBreaked||""!==e&&""===s.str||(n=!0,o=s.wordBreaked),s.str.length===e.length);else if(n){let n=e.substring(o);"keep-all"===p&&(n=n.replace(/^\s+/g,"")),B.splice(t+1,0,n)}}let t=0;k.forEach((e=>{t=Math.max(t,e.width)})),M[0]=t}else{let t,e,n=0;for(let i=0,r=B.length;i<r;i++){if(i===P-1){const t=w.clipTextWithSuffix(B[i],T,h,u,!1,y),e=w.measureTextPixelADscentAndWidth(t.str,T,b);k.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),n=Math.max(n,t.width);break}e=B[i],t=w.measureTextWidth(e,T),n=Math.max(n,t);const r=w.measureTextPixelADscentAndWidth(e,T,b);k.push({str:e,width:t,ascent:r.ascent,descent:r.descent,keepCenterInLine:_})}M[0]=n}M[1]=k.length*A;const E={xOffset:0,yOffset:0,width:M[0],height:M[1]};C.LayoutBBox(E,o,l,k);const O=C.layoutWithBBox(E,k,o,l,A);return this.cache.layoutData=O,this.clearUpdateShapeTag(),this._AABBBounds.set(E.xOffset,E.yOffset,E.xOffset+E.width,E.yOffset+E.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var n,i,r;const s=this.getGraphicTheme(),a=xt.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null===(n=this.stage)||void 0===n?void 0:n.textMeasureId));let o;const l=this.attribute,{maxLineWidth:c=s.maxLineWidth,ellipsis:u=s.ellipsis,fontFamily:h=s.fontFamily,fontSize:d=s.fontSize,fontWeight:f=s.fontWeight,stroke:p=s.stroke,lineWidth:g=s.lineWidth,verticalMode:m=s.verticalMode,suffixPosition:b=s.suffixPosition}=l,y=this.getLineHeight(l,s,0);let{textAlign:v=s.textAlign,textBaseline:x=s.textBaseline}=l;if(!m){const e=v;v=null!==(i=t.baselineMapAlign[x])&&void 0!==i?i:"left",x=null!==(r=t.alignMapBaseline[e])&&void 0!==r?r:"top"}if(o=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);o=se(e,o)}));const t=ka(v,o),e=this.cache.verticalList.length*y,n=Ma(x,e,d);return this._AABBBounds.set(n,t,n+e,t+o),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const _=e.map((t=>function(t){const e=[];let n=0,i="";for(let r=0;r<t.length;r++)Ds(t[r])?n?i+=t[r]:(n=1,i=t[r]):(n&&(e.push({text:i,direction:Is.VERTICAL}),i="",n=0),e.push({text:t[r],direction:Is.HORIZONTAL}));return i&&e.push({text:i,direction:Is.VERTICAL}),e}(t.toString())));_.forEach(((t,e)=>{if(Number.isFinite(c))if(u){const n=!0===u?s.ellipsis:u,i=a.clipTextWithSuffixVertical(t,{fontSize:d,fontWeight:f,fontFamily:h},c,n,!1,b);_[e]=i.verticalList,o=i.width}else{const n=a.clipTextVertical(t,{fontSize:d,fontWeight:f,fontFamily:h},c,!1);_[e]=n.verticalList,o=n.width}else o=0,t.forEach((t=>{const e=t.direction===Is.HORIZONTAL?d:a.measureTextWidth(t.text,{fontSize:d,fontWeight:f,fontFamily:h});o+=e,t.width=e}))})),this.cache.verticalList=_,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);o=se(e,o)}));const S=ka(v,o),A=this.cache.verticalList.length*y,w=Ma(x,A,d);return this._AABBBounds.set(w,S,w+A,S+o),p&&this._AABBBounds.expand(g/2),this._AABBBounds}getMaxWidth(t){var e,n;const i=this.attribute;return null!==(n=null!==(e=i.maxLineWidth)&&void 0!==e?e:i.maxWidth)&&void 0!==n?n:t.maxWidth}getLineHeight(t,e,n){var i;return null!==(i=mr(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==i?i:(t.fontSize||e.fontSize)+n}needUpdateTags(t,e=Ua){return super.needUpdateTags(t,e)}needUpdateTag(t,e=Ua){return super.needUpdateTag(t,e)}_interpolate(t,e,n,i,r){"text"===t&&(r.text=i)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return t.baselineMapAlign}getAlignMapBaseline(){return t.alignMapBaseline}};function za(t){return new Da(t)}Da.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},pa),Da.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Da.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const Wa=["heightLimit","lineClamp"];class Fa extends Da{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return Et(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,n,i,r,s;const a=this.getGraphicTheme(),{fontFamily:o=a.fontFamily,textAlign:l=a.textAlign,textBaseline:c=a.textBaseline,fontSize:u=a.fontSize,ellipsis:h=a.ellipsis,maxLineWidth:d,stroke:f=a.stroke,lineWidth:p=a.lineWidth,wordBreak:g=a.wordBreak,fontWeight:m=a.fontWeight,ignoreBuf:b=a.ignoreBuf,heightLimit:y=0,suffixPosition:v=a.suffixPosition,lineClamp:x}=this.attribute,_=null!==(e=mr(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,S=b?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),f&&this._AABBBounds.expand(p/2),this._AABBBounds}const A=xt.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null===(i=this.stage)||void 0===i?void 0:i.textMeasureId)),w=new Na(o,{fontSize:u,fontWeight:m,fontFamily:o},A),T=t.map((t=>t.toString())),C=[],B=[0,0];let k=1/0;if(y>0&&(k=Math.max(Math.floor(y/_),1)),x&&(k=Math.min(k,x)),"number"==typeof d&&d!==1/0){if(d>0)for(let t=0;t<T.length;t++){const e=T[t];let n=!0;if(t===k-1){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,d,h,!1,v);C.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1});break}const i=w.textMeasure.clipText(e,w.textOptions,d,"break-word"===g);if(""!==e&&""===i.str){if(h){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,d,h,!1,v);i.str=null!==(r=t.str)&&void 0!==r?r:"",i.width=null!==(s=t.width)&&void 0!==s?s:0}else i.str="",i.width=0;n=!1}if(C.push({str:i.str,width:i.width,ascent:0,descent:0,keepCenterInLine:!1}),i.str.length===e.length);else if(n){const n=e.substring(i.str.length);T.splice(t+1,0,n)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),B[0]=t}else{let t,e,n=0;for(let i=0,r=T.length;i<r;i++){if(i===k-1){const t=w.textMeasure.clipTextWithSuffix(T[i],w.textOptions,d,h,!1,v);C.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1}),n=Math.max(n,t.width);break}e=T[i],t=w.textMeasure.measureTextWidth(e,w.textOptions,"break-word"===g),n=Math.max(n,t),C.push({str:e,width:t,ascent:0,descent:0,keepCenterInLine:!1})}B[0]=n}B[1]=C.length*(_+S);const M={xOffset:0,yOffset:0,width:B[0],height:B[1]};w.LayoutBBox(M,l,c);const P=w.layoutWithBBox(M,C,l,c,_);return this.cache.layoutData=P,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),f&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<Wa.length;e++){const n=Wa[e];if(-1!==t.indexOf(n))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<Wa.length;e++)if(t===Wa[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return Fa.NOWORK_ANIMATE_ATTR}}function ja(t){return new Fa(t)}const Ha=["symbolType","size",...ca];let Ga=class t extends ga{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=Gs}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(t=0,e=0,n=1){let i=null;try{i=new Path2D}catch(t){return null}const r=this.getParsedPath();if(!r)return null;r.draw(i,n,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return Et(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return nr(this).symbol}updateAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n)||(i?this.updateSymbolAABBBoundsImprecise(t,e,n):this.updateSymbolAABBBoundsAccurate(t,e,n));const{tb1:r,tb2:s}=xt.graphicService.updateTempAABBBounds(n);((t,e,n)=>{const{outerBorder:i,shadowBlur:r=e.shadowBlur,strokeBoundsBuffer:s=e.strokeBoundsBuffer}=t;if(i){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=i;Os(n,a+(r+o)/2,!0,s)}})(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,this.x1WithoutTransform=n.x1,this.y1WithoutTransform=n.y1;const{lineJoin:a=e.lineJoin}=t;return xt.graphicService.transformAABBBounds(t,n,e,"miter"===a,this),n}updateSymbolAABBBoundsImprecise(t,e,n){const{size:i=e.size}=t;if(Et(i))n.set(-i[0]/2,-i[1]/2,i[0]/2,i[1]/2);else{const t=i/2;n.set(-t,-t,t,t)}return n}updateSymbolAABBBoundsAccurate(t,e,n){const{size:i=e.size}=t;return this.getParsedPath().bounds(i,n),n}needUpdateTags(t){return super.needUpdateTags(t,Ha)}needUpdateTag(t){return super.needUpdateTag(t,Ha)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=Et(e)?e:[e,e];return t.path?(new Rn).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new Rn).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Va(t){return new Ga(t)}Ga.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},pa);const $a=["width","x1","y1","height","cornerRadius",...ca];let Xa=class t extends ga{constructor(t){super(t),this.type="rect",this.numberType=js}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return nr(this).rect}updateAABBBounds(t,e,n){if(!this.updatePathProxyAABBBounds(n)){let{width:e,height:i}=t;const{x1:r,y1:s,x:a,y:o}=t;e=null!=e?e:r-a,i=null!=i?i:s-o,(isFinite(e)||isFinite(i)||isFinite(a)||isFinite(o))&&n.set(0,0,e||0,i||0)}const{tb1:i,tb2:r}=xt.graphicService.updateTempAABBBounds(n);return Ia(t,e,i),n.union(i),i.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,xt.graphicService.transformAABBBounds(t,n,e,!1,this),n}needUpdateTags(t){return super.needUpdateTags(t,$a)}needUpdateTag(t){return super.needUpdateTag(t,$a)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute,{x:n,y:i,width:r,height:s}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=Tt(t.width)?t.x1-t.x:t.width,n=Tt(t.height)?t.y1-t.y:t.height,i=0,r=0;return e<0?(i=e,e=-e):Number.isNaN(e)&&(e=0),n<0?(r=n,n=-n):Number.isNaN(n)&&(n=0),{x:i,y:r,width:e,height:n}})(e);return t=new Rn,t.moveTo(n,i),t.rect(n,i,r,s),t}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Ya(t){return new Xa(t)}Xa.NOWORK_ANIMATE_ATTR=pa;class Ka{constructor(t,e,n,i,r,s,a,o,l,c,u,h,d,f){this.left=t,this.top=e,this.width=n,this.height=i,this.actualHeight=0,this.bottom=e+i,this.right=t+n,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=c,this.directionKey=ci[this.layoutDirection],this.isWidthMax=u,this.isHeightMax=h,this.singleLine=d,f?(f.clear(),this.icons=f):this.icons=new Map}draw(t,e){const{width:n,height:i}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,n):this.width||n||0;let s=this.isHeightMax?Math.min(this.height,i):this.height||i||0;s=Math.min(s,i);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-s/2;break;case"bottom":a=-s}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-r:"center"===this.globalAlign&&(o=-r/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let c=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n];if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return c;let s=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(s=!0,c=!0),this.lines[n].draw(t,s,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e)}else{const n=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=n:a+=n;for(let n=0;n<this.lines.length;n++)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n],s=l-this.lines[n].top-this.lines[n].height;if(0===l)this.lines[n].draw(t,!1,o,s+a,this.ellipsis,e);else{if(s+r>this[this.directionKey.top]+l||s<this[this.directionKey.top])return c;{let i=!1;this.ellipsis&&this.lines[n+1]&&s-this.lines[n+1].height<this[this.directionKey.top]&&(i=!0,c=!0),this.lines[n].draw(t,i,o,s+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let n=0;n<this.lines.length;n++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[n].height+this.lines[n].top);const{top:i,height:r}=this.lines[n];if(0===l)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e);else{if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return c;{let i=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(i=!0,c=!0),this.lines[n].draw(t,i,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e)}}}}return c}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let n=0;n<this.lines.length;n++){const i=this.lines[n];i.actualWidth>t&&(t=i.actualWidth),e+=i.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:n,height:i}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[n].getWidthWithEllips(i);r>t&&(t=r),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else{Math.floor((r-this.actualHeight)/2);for(let n=0;n<this.lines.length;n++)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else if("bottom"===this.verticalDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n],a=r-this.lines[n].top-this.lines[n].height;if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(a+s>this[this.directionKey.top]+r||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[n+1]&&a-this.lines[n+1].height<this[this.directionKey.top]){const i=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[n].getWidthWithEllips(i);r>t&&(t=r),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[n].getWidthWithEllips(i);r>t&&(t=r),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function qa(t,e,n,i){const r=Math.round(t),s=Math.round(n),a=Math.round(e),o=Math.round(i);return{left:t>r?r:r-.5,top:n>s?s:s-.5,right:a>e?a:a+.5,bottom:o>i?o:o+.5}}class Qa{constructor(t,e,n,i){var r,s;this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic",this.ascentDescentMode=i;const a=mr(n.lineHeight,this.fontSize);this.lineHeight="number"==typeof a?a>this.fontSize?a:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:o,height:l,descent:c,width:u}=yi(t,n,this.ascentDescentMode);let h=0,d=0,f=0;this.height>l&&(h=(this.height-l)/2,d=Math.ceil(h),f=Math.floor(h)),"top"===this.textBaseline?(this.ascent=h,this.descent=l-h):"bottom"===this.textBaseline?(this.ascent=l-h,this.descent=h):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+d,this.descent=c+f),this.length=t.length,this.width=u||0,this.text=t||"",this.newLine=e||!1,this.character=n,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=n.space,this.dx=null!==(r=n.dx)&&void 0!==r?r:0,this.dy=null!==(s=n.dy)&&void 0!==s?s:0,"vertical"===n.direction&&(this.direction=n.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=yi(this.text,this.character,this.ascentDescentMode);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}drawBackground(t,e,n,i,r,s,a){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let o=e+n,l=this.text,c=this.left+i;o+=this.top;let u=this.direction;if(this.verticalEllipsis)l=this.ellipsisStr,u="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)l+=this.ellipsisStr,"right"!==s&&"end"!==s||(c-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=mi(l,("vertical"===u?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,l.length-1);if(l=l.slice(0,t),l+=this.ellipsisStr,"right"===s||"end"===s)if("vertical"===u);else{const{width:e}=yi(this.text.slice(t),this.character,this.ascentDescentMode);c-=this.ellipsisWidth-e}}}const h=qa(c,c+(this.widthOrigin||this.width),e,e+a);return Object.assign(Object.assign({},h),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,n,i,r,s,a){var o;let l=e+n,c=this.text,u=this.left+i+(null!==(o=this.space)&&void 0!==o?o:0)/2;l+=this.top;let h=this.direction;if(this.verticalEllipsis)c=this.ellipsisStr,h="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)c+=this.ellipsisStr,"right"!==s&&"end"!==s||(u-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=mi(c,("vertical"===h?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,c.length-1);if(c=c.slice(0,t),c+=this.ellipsisStr,"right"===s||"end"===s)if("vertical"===h);else{const{width:e}=yi(this.text.slice(t),this.character,this.ascentDescentMode);u-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":l-=this.ascent*(1/3);break;case"sub":l+=this.descent/2}"vertical"===h&&(t.save(),t.rotateAbout(Math.PI/2,u,l),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(u,l),u=0,l=0);const{lineWidth:d=1}=this.character;if(this.character.stroke&&d&&t.strokeText(c,u+this.dx,l+this.dy),this.character.fill&&t.fillText(c,u+this.dx,l+this.dy),this.character.fill)if(this.character.lineThrough||this.character.underline){if(this.character.underline){const e=1+l,n=qa(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}if(this.character.lineThrough){const e=1+l-this.ascent/2,n=qa(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l-this.ascent/2,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){const e=1+l,n=qa(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}else if("line-through"===this.character.textDecoration){const e=1+l-this.ascent/2,n=qa(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l-this.ascent/2,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}"vertical"===h&&t.restore()}getWidthWithEllips(t){let e=this.text;const n="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return n;if("add"===this.ellipsis)return n+this.ellipsisWidth;if("replace"===this.ellipsis){const t=mi(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:i}=yi(this.text.slice(t),this.character,this.ascentDescentMode);return n+this.ellipsisWidth-i}return n}}const Za=["width","height","image",...ca];let Ja=class t extends ga{constructor(t){super(t),this.type="image",this.numberType=Fs,this.loadImage(this.attribute.image)}getImageElement(){const{image:t}=this.attribute;if(!t||!this.resources)return null;const e=this.resources.get(t);return"success"!==e.state?null:e.data}get width(){return this.tryUpdateAABBBounds(),this._actualWidth}get height(){return this.tryUpdateAABBBounds(),this._actualHeight}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,n){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()})),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,n){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,n)}setAttribute(t,e,n,i){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,n,i)}getGraphicTheme(){return nr(this).image}updateAABBBounds(t,e,n){if(!this.updatePathProxyAABBBounds(n)){const{maxWidth:i=e.maxWidth,maxHeight:r=e.maxHeight}=t;let{width:s,height:a}=t;if(null==s||null==a){const t=this.getImageElement();if(t){const e=t.width,n=t.height;if(null!=s)a=s*(n/e);else if(null!=a)s=a*(e/n);else{const t=e/n;t>i/r?(s=i,a=i/t):(a=r,s=r*t)}}else s=i,a=r}this._actualWidth=s,this._actualHeight=a,n.set(0,0,s,a)}const{tb1:i,tb2:r}=xt.graphicService.updateTempAABBBounds(n);return Ia(t,e,i),n.union(i),i.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,xt.graphicService.transformAABBBounds(t,n,e,!1,this),n}getDefaultAttribute(t){return ii[t]}needUpdateTags(t){return super.needUpdateTags(t,Za)}needUpdateTag(t){return super.needUpdateTag(t,Za)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function to(t){return new Ja(t)}Ja.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},pa);class eo extends Ja{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=dr(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,n)=>{if(Et(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){const t=dr(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=ii.width,height:e=ii.height}=this.attribute,{backgroundWidth:n=t,backgroundHeight:i=e}=this.attribute,r=(n-t)/2,s=(i-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class no{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=ci[this.direction]}store(t){if(t instanceof eo){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,n=0;"top"===t.attribute.textBaseline?(e=0,n=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,n=0):(e=t.height/2,n=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,n)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,n=new class{constructor(t,e,n,i,r,s,a,o){this.left=t,this.width=e,this.baseline=n,this.ascent=i,this.descent=r,this.top=n-i,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof eo?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=ci[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof Qa){const e=pi.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const n=this.directionKey,i=this.height;let r=this.left,s=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof eo?(t["_"+n.x]=r,r+=t[n.width]+s,t["_"+n.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?i-t.height:(i-t.height)/2):(t[n.left]=r,r+=t[n.width]+s)}))}draw(t,e,n,i,r,s){if(r&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,n=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i.overflow)t=t&&""===i.text;else if(t){n=!0;break}}let i=0;if(!n)for(let t=this.paragraphs.length-1;t>=0;t--){const n=this.paragraphs[t];if(n.overflow){if(""===n.text)break;continue}if(n instanceof eo)break;if("vertical"===this.direction&&"vertical"!==n.direction){n.verticalEllipsis=!0;break}const s=!0===r?"...":r||"";n.ellipsisStr=s;const{width:a}=yi(s,n.character,n.ascentDescentMode),o=a||0;if(o<=this.blankWidth+i){e&&(n.ellipsis="add");break}if(o<=this.blankWidth+i+n.width){n.ellipsis="replace",n.ellipsisWidth=o,n.ellipsisOtherParagraphWidth=this.blankWidth+i;break}n.ellipsis="hide",i+=n.width}}let a="",o=-1,l=[];const c=[l];this.paragraphs.forEach(((e,r)=>{if(e instanceof eo)return;const s=e.drawBackground(t,i,this.ascent,n,0===r,this.textAlign,this.height);s&&(a===s.fillStyle&&o===s.globalAlpha||(l=[],c.push(l),a=s.fillStyle,o=s.globalAlpha),l.push(s))})),c.forEach((e=>{if(0===e.length)return;const n=e[0],i=e[e.length-1];t.fillStyle=n.fillStyle,t.globalAlpha=n.globalAlpha,t.fillRect(n.left,n.top,i.right-n.left,i.bottom-n.top)})),this.paragraphs.forEach(((e,r)=>{if(e instanceof eo)return e.setAttributes({x:n+e._x,y:i+e._y}),void s(e,t,n+e._x,i+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const n=e&&e.stroke||hi;if(!n)return void(t.globalAlpha=0);const{strokeOpacity:i=1,opacity:r=1}=e;t.globalAlpha=i*r,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=n,gi(t,e)})(t,e.character),function(t,e,n){const i=e&&e.fill||ui;if(!i)return void(t.globalAlpha=0);const{fillOpacity:r=1,opacity:s=1}=e;t.globalAlpha=r*s,t.fillStyle=n?li(t,i,{AABBBounds:n}):i,gi(t,e)}(t,e.character,a),e.draw(t,i,this.ascent,n,0===r,this.textAlign,this.height)}))}getWidthWithEllips(t){let e=0;for(let n=this.paragraphs.length-1;n>=0;n--){const i=this.paragraphs[n];if(i instanceof eo)break;const{width:r}=yi(t,i.character,i.ascentDescentMode),s=r||0;if(s<=this.blankWidth+e){i.ellipsis="add",i.ellipsisWidth=s;break}if(s<=this.blankWidth+e+i.width){i.ellipsis="replace",i.ellipsisWidth=s,i.ellipsisOtherParagraphWidth=this.blankWidth+e;break}i.ellipsis="hide",e+=i.width}let n=0;return this.paragraphs.forEach(((t,e)=>{n+=t instanceof eo?t.width:t.getWidthWithEllips(this.direction)})),n}}(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(n),this.frame.actualHeight+=n.height,this.y+=n.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t,e=!1){t instanceof eo?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),(0!==t.text.length||this.newLine)&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const n=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(n/t[this.directionKey.width]*t.length)||0,r=mi(t.text,n,t.character,i,"break-word"===this.frame.wordBreak);if(0!==r){const[n,i]=function(t,e){const n=t.text.slice(0,e),i=t.text.slice(e);return[new Qa(n,t.newLine,t.character,t.ascentDescentMode),new Qa(i,!0,t.character,t.ascentDescentMode)]}(t,r);this.store(n),e?this.send():this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let io=!1;try{io=Intl&&"function"==typeof Intl.Segmenter}catch(t){io=!1}const ro=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...ca];let so=class t extends ga{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Hs,this.onBeforeAttributeUpdate=(t,e,n)=>{for(const n in t)if("hoverIconId"===n){if(t[n]===e[n])continue;const i=this._frameCache.icons.get(t[n]);this.updateHoverIconState(i)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:ni.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:ni.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:ni.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:ni.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:ni.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:ni.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:ni.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:ni.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return nr(this).richtext}static AllSingleCharacter(e){return e.lines?e.lines.every((e=>e.paragraphs.every((e=>!(e.text&&Pt(e.text)&&t.splitText(e.text).length>1))))):e.every((e=>e.isComposing||!(e.text&&Pt(e.text)&&t.splitText(e.text).length>1)))}static splitText(t){if(io){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),n=[];for(const{segment:i}of e.segment(t))n.push(i);return n}return Array.from(t)}static TransformTextConfig2SingleCharacter(e){const n=[];return e.forEach((e=>{const i=t.splitText(e.text.toString());if(Pt(e.text)&&i.length>1)for(let t=0;t<i.length;t++){const r=i[t];n.push(Object.assign(Object.assign({},e),{text:r}))}else n.push(e)})),n}updateAABBBounds(t,e,n){var i,r,s,a;const{width:o=e.width,height:l=e.height,maxWidth:c=e.maxWidth,maxHeight:u=e.maxHeight,textAlign:h=e.textAlign,textBaseline:d=(null!==(r=null!==(i=t.textBaseline)&&void 0!==i?i:e.textBaseline)&&void 0!==r?r:"top"),editOptions:f}=t;if(o>0&&l>0)n.set(0,0,o,l);else{const t=this.getFrameCache(),{width:e,height:i}=t.getActualSize();let r=o||e||0,s=l||i||0;s="number"==typeof u&&s>u?u:s||0,r="number"==typeof c&&r>c?c:r||0,n.set(0,0,r,s)}f&&f.keepHeightWhileEmpty&&!n.height()&&!(null===(s=t.textConfig)||void 0===s?void 0:s.length)&&(n.y2=n.y1+(null!==(a=t.fontSize)&&void 0!==a?a:12),n.x2=n.x1+2);let p=0;switch(d){case"top":p=0;break;case"middle":p=-n.height()/2;break;case"bottom":p=-n.height()}let g=0;switch(h){case"left":g=0;break;case"center":g=-n.width()/2;break;case"right":g=-n.width()}return l||("middle"===this.verticalDirection?p-=n.height()/2:"bottom"===this.verticalDirection&&(p-=n.height())),n.translate(g,p),xt.graphicService.updateTempAABBBounds(n),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||xt.graphicService.updateHTMLTextAABBBounds(t,e,n),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,xt.graphicService.transformAABBBounds(t,n,e,!1,this),0===n.width()&&0===n.height()&&n.clear(),n}needUpdateTags(t){return super.needUpdateTags(t,ro)}needUpdateTag(t){return super.needUpdateTag(t,ro)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){const n=t.lines[e];for(let t=0;t<n.paragraphs.length;t++){const e=n.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:n,fontSize:i,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:c,lineHeight:u,strokeOpacity:h,upgradeAttrs:d}=this.attribute,f=Object.assign({fill:e,stroke:n,fontSize:i,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:c,strokeOpacity:h},t);return(null==d?void 0:d.lineHeight)&&(f.lineHeight=u),f}doUpdateFrameCache(e){var n;const{maxWidth:i,maxHeight:r,width:s,height:a,ellipsis:o,wordBreak:l,verticalDirection:c,textAlign:u,textBaseline:h,layoutDirection:d,singleLine:f,disableAutoWrapLine:p,editable:g,ascentDescentMode:m,upgradeAttrs:b}=this.attribute,y=b&&b.multiBreakLine;let{textConfig:v=[]}=this.attribute;g&&v.length>0&&!t.AllSingleCharacter(v)&&(v=t.TransformTextConfig2SingleCharacter(v),this.attribute.textConfig=v);const x=[],_=null!=e?e:v;for(let t=0;t<_.length;t++)if("image"in _[t]){const e=this.combinedStyleToCharacter(_[t]);e.lineWidth=void 0;const n=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(n)x.push(n);else{const t=new eo(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,x.push(t)}}else{const e=this.combinedStyleToCharacter(_[t]);if(Lt(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const n=e.text.split("\n");for(let i=0;i<n.length;i++)if(0===i)x.push(new Qa(n[i],!1,e,m));else if(n[i]||t===_.length-1)x.push(new Qa(n[i],!0,e,m));else{const e=this.combinedStyleToCharacter(_[t+1]);x.push(new Qa(n[i],!0,e,m))}}else e.text&&x.push(new Qa(e.text,!1,e,m))}const S="number"==typeof i&&Number.isFinite(i)&&i>0,A="number"==typeof r&&Number.isFinite(r)&&r>0,w="number"==typeof s&&Number.isFinite(s)&&s>0&&(!S||s<=i),T="number"==typeof a&&Number.isFinite(a)&&a>0&&(!A||a<=r),C=new Ka(0,0,(w?s:S?i:0)||0,(T?a:A?r:0)||0,o,l,c,u,h,d||"horizontal",!w&&S,!T&&A,f||!1,null===(n=this._frameCache)||void 0===n?void 0:n.icons),B=new no(C);if(B.newLine=y,p){let t=0,e=!1;for(let n=0;n<x.length;n++){const i=x[n];e?(i.overflow=!0,i.left=1/0,i.top=1/0,!i.newLine&&C.lines[C.lines.length-1].paragraphs.push(i)):B.deal(i,!0),C.lines.length!==t&&(t=C.lines.length,B.lineBuffer.length=0,i.overflow=!0,i.left=1e3,i.top=1e3,C.lines[C.lines.length-1].paragraphs.push(i),e=!0),i.newLine&&(e=!1,B.lineWidth=0),B.send()}}else for(let t=0;t<x.length;t++)B.deal(x[t]);if(B.send(),!("horizontal"===C.layoutDirection?w:T)){const t=C.getActualSizeWidthEllipsis();let e="horizontal"===C.layoutDirection?t.width:t.height;("horizontal"===C.layoutDirection?S:A)&&(e=Math.min(e,"horizontal"===C.layoutDirection?i:r)),C.lines.forEach((function(t){t.calcOffset(e,!1)}))}y&&C.lines.forEach((t=>{const e=t.paragraphs;t.paragraphs=t.paragraphs.filter((t=>""!==t.text)),0===t.paragraphs.length&&e.length&&(e[0].text="\n",t.paragraphs.push(e[0]))})),this._frameCache=C}clone(){return new t(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((n=>{n.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,n,i,r,s;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(n=this.stage)||void 0===n||n.setCursor(t.attribute.cursor),null===(i=this.stage)||void 0===i||i.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:n,f:i}=this.globalTransMatrix;let r;return e.icons.forEach(((e,s)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-n,y:t.y-i})&&(r=e,r.globalX=(null!==(a=r.attribute.x)&&void 0!==a?a:0)+n+e._marginArray[3],r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+i+e._marginArray[0])})),r}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function ao(t){return new so(t)}so.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},pa);const oo=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...ca];let lo=class t extends ga{constructor(t){super(t),this.type="arc",this.numberType=zs}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:n,innerRadius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:n=t.innerPadding,outerPadding:i=t.outerPadding}=this.attribute;let{outerRadius:r=t.outerRadius,innerRadius:s=t.innerRadius}=this.attribute;if(r+=i,s-=n,0===e||"0%"===e)return 0;const a=Math.abs(r-s),o=t=>Math.min(Lt(t,!0)?t:a*parseFloat(t)/100,a/2);if(Et(e)){const t=e.map((t=>o(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:n=t.endAngle}=this.attribute;const{cap:i=t.cap}=this.attribute,r=n-e>=0?1:-1,s=n-e;if(e=pe(e),n=e+s,i&&ne(s)<ee-Qt){let s=1,a=1;i.length&&(s=Number(i[0]),a=Number(i[1]));let{outerRadius:o=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute;const{outerPadding:c=t.outerPadding,innerPadding:u=t.innerPadding}=this.attribute;o+=c,l-=u;const h=Math.abs(o-l)/2,d=h/o;if(h>Qt&&o>Qt)return{startAngle:e-r*d*s,endAngle:n+r*d*a,sc:r*d*s,ec:r*d*a}}return{startAngle:e,endAngle:n}}getParsePadAngle(t,e){const n=this.getGraphicTheme(),{innerPadding:i=n.innerPadding,outerPadding:r=n.outerPadding,padAngle:s=n.padAngle}=this.attribute;let{outerRadius:a=n.outerRadius,innerRadius:o=n.innerRadius}=this.attribute;a+=r,o-=i;const{padRadius:l=le(a*a+o*o)}=this.attribute,c=ne(e-t);let u=t,h=e,d=t,f=e;const p=s/2;let g=c,m=c;if(p>Qt&&l>Qt){const n=e>t?1:-1;let i=ue(Number(l)/o*oe(p)),r=ue(Number(l)/a*oe(p));return(g-=2*i)>Qt?(i*=n,d+=i,f-=i):(g=0,d=f=(t+e)/2),(m-=2*r)>Qt?(r*=n,u+=r,h-=r):(m=0,u=h=(t+e)/2),{outerStartAngle:u,outerEndAngle:h,innerStartAngle:d,innerEndAngle:f,innerDeltaAngle:g,outerDeltaAngle:m}}return{outerStartAngle:u,outerEndAngle:h,innerStartAngle:d,innerEndAngle:f,innerDeltaAngle:g,outerDeltaAngle:m}}getGraphicTheme(){return nr(this).arc}updateAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n)||(i?this.updateArcAABBBoundsImprecise(t,e,n):this.updateArcAABBBoundsAccurate(t,e,n));const{tb1:r,tb2:s}=xt.graphicService.updateTempAABBBounds(n);Ia(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),this.setWidthHeightWithoutTransform(n);const{lineJoin:a=e.lineJoin}=t;return xt.graphicService.transformAABBBounds(t,n,e,"miter"===a,this),n}updateArcAABBBoundsImprecise(t,e,n){let{outerRadius:i=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:a=e.innerPadding}=t;return i+=s,r-=a,i<r&&(i=r),n.set(-i,-i,i,i),n}updateArcAABBBoundsAccurate(t,e,n){let{outerRadius:i=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(i+=s,r-=a,i<r){const t=i;i=r,r=t}let{endAngle:o=e.endAngle,startAngle:l=e.startAngle}=t;if(l>o){const t=l;l=o,o=t}return i<=Qt?n.set(0,0,0,0):Math.abs(o-l)>ee-Qt?n.set(-i,-i,i,i):(gr(l,o,i,n),gr(l,o,r,n)),n}needUpdateTags(t){return super.needUpdateTags(t,oo)}needUpdateTag(t){return super.needUpdateTag(t,oo)}toCustomPath(){var t,e,n,i;let r=super.toCustomPath();if(r)return r;const s=this.attribute,{startAngle:a,endAngle:o}=this.getParsedAngle();let l=(null!==(t=s.innerRadius)&&void 0!==t?t:0)-(null!==(e=s.innerPadding)&&void 0!==e?e:0),c=(null!==(n=s.outerRadius)&&void 0!==n?n:0)-(null!==(i=s.outerPadding)&&void 0!==i?i:0);const u=ne(o-a),h=o>a;if(c<l){const t=c;c=l,l=t}if(r=new Rn,c<=Qt)r.moveTo(0,0);else if(u>=ee-Qt)r.moveTo(0+c*re(a),0+c*oe(a)),r.arc(0,0,c,a,o,!h),l>Qt&&(r.moveTo(0+l*re(o),0+l*oe(o)),r.arc(0,0,l,o,a,h));else{const t=c*re(a),e=c*oe(a),n=l*re(o),i=l*oe(o);r.moveTo(0+t,0+e),r.arc(0,0,c,a,o,!h),r.lineTo(0+n,0+i),r.arc(0,0,l,o,a,h),r.closePath()}return r}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};lo.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},pa);const co=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const n=this.store.get(t);return n?n(e):null}};let uo;function ho(t){return uo||(uo=co.CreateGraphic("text",{})),uo.initAttributes(t),uo.AABBBounds}var fo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},po=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},go=function(t,e){return function(n,i){e(n,i,t)}};class mo{constructor(){this.time=Ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){var f;const{background:p,backgroundOpacity:g=(null!==(f=t.attribute.fillOpacity)&&void 0!==f?f:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:b=l.backgroundMode,backgroundFit:y=l.backgroundFit,backgroundKeepAspectRatio:v=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:S=l.backgroundOffsetY,backgroundClip:A=l.backgroundClip}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const r=t.resources.get(p);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const n=nr(t.parent).group,{scrollX:i=n.scrollX,scrollY:r=n.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(i,r)}A&&e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,l),e.globalAlpha=g*m,this.doDrawImage(e,r.data,s,{backgroundMode:b,backgroundFit:y,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:S}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.globalAlpha=g*m,e.fillStyle=p,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,n,i){const{backgroundMode:r,backgroundFit:s,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:c=0}=i,u=n.width(),h=n.height();let d=u,f=h;if("no-repeat"===r)if(s)if(a){const i=Math.max(u/e.width,h/e.height);t.drawImage(e,n.x1+l,n.y1+c,e.width*i*o,e.height*i*o)}else t.drawImage(e,n.x1,n.y1,n.width(),n.height());else{const i=e.width*o,r=e.height*o;t.drawImage(e,n.x1+l,n.y1+c,i,r)}else{if(s&&"repeat"!==r&&(e.width||e.height)){const n=e.width,i=e.height;"repeat-x"===r?(d=n*(h/i),f=h):"repeat-y"===r&&(f=i*(u/n),d=u);const s=t.dpr,a=Ki.allocate({width:d,height:f,dpr:s}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,d,f),o.drawImage(e,0,0,d,f),e=a.nativeCanvas),Ki.free(a)}const i=t.dpr,a=t.createPattern(e,r);a.setTransform&&a.setTransform(new DOMMatrix([1/i,0,0,1/i,0,0])),t.fillStyle=a,t.translate(n.x1,n.y1),t.fillRect(0,0,u,h),t.translate(-n.x1,-n.y1)}}}const bo=new mo;let yo=class{constructor(t){this.subRenderContribitions=t,this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((f=>{f.render(t,e,n,i,r,s,a,o,l,c,u,h,d)}))}};yo=fo([K(),go(0,X(ht)),go(0,q(Ba)),po("design:paramtypes",[Object])],yo);const vo=new class{constructor(){this.time=Ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){var f,p;const{clipConfig:g}=t.attribute;if(!g)return;const m=t.getClipPath();if(!m)return;const b=!(u||h),y=t.AABBBounds,v=null!==(f=t.attribute.width)&&void 0!==f?f:y.width(),x=null!==(p=t.attribute.height)&&void 0!==p?p:y.height();b&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],n+v/2,i+x/2,0)&&e.closePath(),u&&u(e,t.attribute,l,!0),b&&e.clip()}};const xo=new class{constructor(){this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){const{clipConfig:f}=t.attribute;f&&t.getClipPath()&&(u||h||e.restore())}};const _o=new class{constructor(){this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,n,i,r){const s=(t-2*e)/2,a=i.dpr,o=Ki.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),r(s,l);const c=i.createPattern(o.nativeCanvas,"repeat");return c.setTransform&&c.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Ki.free(o),c}createCirclePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,e)=>{e.fillStyle=n,e.arc(t,t,t,0,ee),e.fill()}))}createDiamondPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{const r=t/2,s=r;i.fillStyle=n,i.moveTo(r,s-e),i.lineTo(e+r,s),i.lineTo(r,s+e),i.lineTo(r-e,s),i.closePath(),i.fill()}))}createRectPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(s,0,2*i,t)}))}createHorizontalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(0,s,t,2*i)}))}createBiasLRLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(0,0),i.lineTo(t,t);const r=t/2,s=-r;i.moveTo(r,s),i.lineTo(r+t,s+t),i.moveTo(-r,-s),i.lineTo(-r+t,-s+t),i.stroke()}))}createBiasRLLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(t,0),i.lineTo(0,t);const r=t/2,s=r;i.moveTo(t+r,s),i.lineTo(r,s+t),i.moveTo(t-r,-s),i.lineTo(-r,-s+t),i.stroke()}))}createGridPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,t,t),i.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:f=l.texture,textureColor:p=l.textureColor,textureSize:g=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;f&&this.drawTexture(f,t,e,n,i,l,p,g,m)}drawTexture(t,e,n,i,r,s,a,o,l){var c;const{textureRatio:u=s.textureRatio,textureOptions:h=null}=e.attribute;let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(o,l,a,n);break;case"diamond":d=this.createDiamondPattern(o,l,a,n);break;case"rect":d=this.createRectPattern(o,l,a,n);break;case"vertical-line":d=this.createVerticalLinePattern(o,l,a,n);break;case"horizontal-line":d=this.createHorizontalLinePattern(o,l,a,n);break;case"bias-lr":d=this.createBiasLRLinePattern(o,l,a,n);break;case"bias-rl":d=this.createBiasRLLinePattern(o,l,a,n);break;case"grid":d=this.createGridPattern(o,l,a,n)}if(h&&h.dynamicTexture){const{gridConfig:d={},useNewCanvas:f}=h,p=e.AABBBounds;i=p.x1,r=p.y1;const g=n;let m;if(f){m=Ki.allocate({width:p.width(),height:p.height(),dpr:n.dpr});const t=m.getContext("2d");t.clearRect(0,0,p.width(),p.height()),i=0,r=0,n=t}if(g.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:n=0}=e.parent.attribute;g.setTransformFromMatrix(e.parent.globalTransMatrix),g.translate(t,n,!0)}g.setCommonStyle(e,e.attribute,i,r,s),g.clip();const b=p.width(),y=p.height(),v=l,x=o,_=d.columns?d.columns:Math.ceil(b/x),S=d.rows?d.rows:Math.ceil(y/x),A=d.gutterColumn?d.gutterColumn:2*v,w=d.gutterRow?d.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=Va({}));const T=d.columns?b/d.columns:x,C=d.rows?y/d.rows:x;this._tempSymbolGraphic.setAttributes({size:[T-A,C-w],symbolType:t});const B=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<S;t++)for(let s=0;s<_;s++){const o=i+x/2+s*x,l=r+x/2+t*x;null===(c=h.beforeDynamicTexture)||void 0===c||c.call(h,n,t,s,S,_,u,e,p.width(),p.height()),n.beginPath(),!1===B.draw(n,Math.min(T-A,C-w),o,l,0)&&n.closePath(),n.fillStyle=a,h.dynamicTexture(n,t,s,S,_,u,e,p.width(),p.height())}f&&(g.globalAlpha=1,g.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,p.x1,p.y1,p.width()*g.dpr,p.height()*g.dpr)),g.restore()}else if(d)n.highPerformanceSave(),n.setCommonStyle(e,e.attribute,i,r,s),n.fillStyle=d,n.fill(),n.highPerformanceRestore();else if("wave"===t){n.save(),n.setCommonStyle(e,e.attribute,i,r,s),n.clip();const t=e.AABBBounds;(function(t,e,n,i,r,s,a){const{fill:o="orange",percent:l=.6,frequency:c=4,opacity:u,phi:h=0}=r;let{amplitude:d=10}=r;d*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const f=i*(1-l),p=n,g=Math.max(Math.round(p/70),2);t.beginPath(),t.moveTo(0+s,i+a),t.lineTo(0+s,f+a);const m=p/c*e,b=p/Math.PI/(2*c);for(let e=0;e<p;e+=g){const n=d*Math.sin((e+m+h)/b+h);t.lineTo(e+s,f+n+a)}t.lineTo(p+s,i+a),t.closePath(),t.fillStyle=o,isFinite(u)&&(t.globalAlpha=u),t.fill()})(n,u,t.width(),t.height(),Object.assign(Object.assign({},h||{}),{fill:a}),i+t.x1-i,r+t.y1-r),n.restore()}}},So=Zt/2;function Ao(t,e,n,i,r,s,a=!0,o){let l;if(Array.isArray(a)&&(o=a,a=!0),i<0&&(e+=i,i=-i),r<0&&(n+=r,r=-r),Lt(s,!0))l=[s=ne(s),s,s,s];else if(Array.isArray(s)){const t=s;let e,n;switch(t.length){case 0:l=[0,0,0,0];break;case 1:e=ne(t[0]),l=[e,e,e,e];break;case 2:case 3:e=ne(t[0]),n=ne(t[1]),l=[e,n,e,n];break;default:l=t,l[0]=ne(l[0]),l[1]=ne(l[1]),l[2]=ne(l[2]),l[3]=ne(l[3])}}else l=[0,0,0,0];if(i<0||l[0]+l[1]+l[2]+l[3]<1e-12)return t.rect(e,n,i,r);const[c,u,h,d]=[[e,n],[e+i,n],[e+i,n+r],[e,n+r]],f=Math.min(i/2,r/2),p=[Math.min(f,l[0]),Math.min(f,l[1]),Math.min(f,l[2]),Math.min(f,l[3])],g=[c[0]+p[0],c[1]],m=[c[0],c[1]+p[0]],b=[u[0]-p[1],u[1]],y=[u[0],u[1]+p[1]],v=[h[0]-p[2],h[1]],x=[h[0],h[1]-p[2]],_=[d[0]+p[3],d[1]],S=[d[0],d[1]-p[3]];if(t.moveTo(g[0],g[1]),a){if(o&&o[0]?o[0](g[0],g[1],b[0],b[1]):t.lineTo(b[0],b[1]),!$t(b,y)){o&&o[0]&&t.moveTo(b[0],b[1]);const e=b[0],n=b[1]+p[1];t.arc(e,n,p[1],-So,0,!1)}if(o&&o[1]?o[1](y[0],y[1],x[0],x[1]):t.lineTo(x[0],x[1]),!$t(v,x)){const e=x[0]-p[2],n=x[1];o&&o[1]&&t.moveTo(x[0],x[1]),t.arc(e,n,p[2],0,So,!1)}if(o&&o[2]?o[2](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!$t(_,S)){const e=_[0],n=_[1]-p[3];o&&o[2]&&t.moveTo(_[0],_[1]),t.arc(e,n,p[3],So,Zt,!1)}if(o&&o[3]?o[3](S[0],S[1],m[0],m[1]):t.lineTo(m[0],m[1]),!$t(g,m)){const e=g[0],n=g[1]+p[0];o&&o[3]&&t.moveTo(m[0],m[1]),t.arc(e,n,p[0],Zt,Zt+So,!1)}}else o&&o[0]?o[0](g[0],g[1],b[0],b[1]):t.lineTo(b[0],b[1]),o&&o[1]?o[1](b[0],b[1],v[0],v[1]):t.lineTo(v[0],v[1]),o&&o[2]?o[2](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),o&&o[2]?o[2](_[0],_[1],g[0],g[1]):t.lineTo(g[0],g[1]);return!o&&t.closePath(),t}var wo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a};class To{constructor(){this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h){const{outerBorder:d,innerBorder:f}=t.attribute,p=d&&!1!==d.visible,g=f&&!1!==f.visible;if(!p&&!g)return;const{cornerRadius:m=l.cornerRadius,cornerType:b=l.cornerType,opacity:y=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:S=l.scaleY,x1:A,y1:w,keepStrokeScale:T=l.keepStrokeScale}=t.attribute;let{width:C,height:B}=t.attribute;C=(null!=C?C:A-n)||0,B=(null!=B?B:w-i)||0;const k=(r,s)=>{const a=!(!r||!r.stroke),o="outerBorder"===s?-1:1,{distance:c=l[s].distance}=r,u=T?c:oi(e,c,e.dpr),d=n+o*u,f=i+o*u,p=2*u;if(0===m||Et(m)&&m.every((t=>0===t))?(e.beginPath(),e.rect(d,f,C-o*p,B-o*p)):(e.beginPath(),Ao(e,d,f,C-o*p,B-o*p,m,"bevel"!==b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),h)h(e,r,l[s]);else if(a){const a=l[s].opacity;l[s].opacity=y,e.setStrokeStyle(t,r,(v-n)/_,(x-i)/S,l[s]),l[s].opacity=a,e.stroke()}};p&&k(d,"outerBorder"),g&&k(f,"innerBorder")}}let Co=class{constructor(){this.time=Ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){const{stroke:f=l.stroke}=t.attribute;Array.isArray(f)&&f.some((t=>!1===t))&&(d.doStroke=!1)}};Co=wo([K()],Co);let Bo=class{constructor(){this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h){const{x1:d,y1:f,x:p=l.x,y:g=l.y,stroke:m=l.stroke,cornerRadius:b=l.cornerRadius,cornerType:y=l.cornerType}=t.attribute;let{width:v,height:x}=t.attribute;if(v=(null!=v?v:d-p)||0,x=(null!=x?x:f-g)||0,Array.isArray(m)&&m.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,n,i,l),!(0===b||Et(b)&&b.every((t=>0===t)))){let r,s=0;return Ao(e,n,i,v,x,b,"bevel"!==y,new Array(4).fill(0).map(((a,o)=>(a,c,u,h)=>{m[o]&&(s===o-1&&m[o]===r||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:m[o]}),n,i,l),e.beginPath(),e.moveTo(a,c),r=m[o]),s=o,e.lineTo(u,h),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(n,i),m[0]?e.lineTo(n+v,i):e.moveTo(n+v,i),m[1]?e.lineTo(n+v,i+x):e.moveTo(n+v,i+x),m[2]?e.lineTo(n,i+x):e.moveTo(n,i+x),m[3]){const t=m[0]?i-e.lineWidth/2:i;e.lineTo(n,t)}else e.moveTo(n,i);e.stroke()}}};Bo=wo([K()],Bo);const ko=new To,Mo=_o,Po=bo;const Eo=new class extends To{constructor(){super(...arguments),this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h){return super.drawShape(t,e,n,i,r,s,a,o,l,c,u,h)}},Oo=bo;const Lo=new class{constructor(){this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h){const d=t.getParsedPath();if(!d)return;const{outerBorder:f,innerBorder:p}=t.attribute,g=f&&!1!==f.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{size:b=l.size,opacity:y=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:S=l.scaleY,keepStrokeScale:A=l.keepStrokeScale}=t.attribute,w=(r,s)=>{const a=!(!r||!r.stroke),{distance:o=l[s].distance}=r,c=A?o:oi(e,o,e.dpr),u="outerBorder"===s?1:-1;if(e.beginPath(),!1===d.drawOffset(e,b,n,i,u*c)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),h)h(e,r,l[s]);else if(a){const a=l[s].opacity;l[s].opacity=y,e.setStrokeStyle(t,r,(v-n)/_,(x-i)/S,l[s]),l[s].opacity=a,e.stroke()}};g&&w(f,"outerBorder"),m&&w(p,"innerBorder")}},Ro=new class{constructor(){this.time=Ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d){const{clipRange:f=l.clipRange,x:p=l.x,y:g=l.y,z:m=l.z,size:b=l.size,scaleX:y=l.scaleX,scaleY:v=l.scaleY}=t.attribute,x=t.getParsedPath();x&&f<1&&f>0&&(e.beginPath(),x.drawWithClipRange&&x.drawWithClipRange(e,b,n,i,f,m,((r,s)=>{var a,c,u,d;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(a=s.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(c=s.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(u=s.stroke)&&void 0!==u?u:t.attribute.stroke,e.lineWidth=null!==(d=s.lineWidth)&&void 0!==d?d:t.attribute.lineWidth,s=e}s.stroke&&(h?h(e,t.attribute,l):o&&(e.setStrokeStyle(t,s,(p-n)/y,(g-i)/v,l),e.stroke()))})),s&&!x.isSvg&&(h?h(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(p-n)/y,(g-i)/v,l),e.stroke())))}},Io=_o,No=bo,Uo={x:0,y:0,z:0,lastModelMatrix:null};class Do{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(vo),this.builtinContributions.push(xo),this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===Ge.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Ge.afterFillStroke)))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,n,i,r,s,a,o,l,c,u,h,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((f=>{f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d)}))}afterRenderStep(t,e,n,i,r,s,a,o,l,c,u,h,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((f=>{f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,i,r,s,a,o,l,c,u,h,d)}))}drawPathProxy(t,e,n,i,r,s,a,o){if(!t.pathProxy)return!1;const l=nr(t,null==s?void 0:s.theme)[t.type.replace("3d","")],{fill:c=l.fill,stroke:u=l.stroke,opacity:h=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:f=l.lineWidth,strokeOpacity:p=l.strokeOpacity,visible:g=l.visible,x:m=l.x,y:b=l.y}=t.attribute,y=_a(h,d,c),v=Sa(h,p),x=va(c),_=xa(u,f);if(!g)return!0;if(!x&&!_)return!0;if(!(y||v||a||o))return!0;e.beginPath();return Ye(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,n,i,x,_,y,v,l,r,a,o),_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,n-m,i-b,l),e.stroke())),x&&(a?a(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,n-m,i-b,l),e.fill())),this.afterRenderStep(t,e,n,i,x,_,y,v,l,r,a,o),!0}valid(t,e,n,i){const{fill:r=e.fill,background:s,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:c=e.lineWidth,strokeOpacity:u=e.strokeOpacity,visible:h=e.visible}=t.attribute,d=_a(o,l,r),f=Sa(o,u),p=va(r,s),g=xa(a,c);return!(!t.valid||!h)&&!(!p&&!g)&&!!(d||f||n||i||s)&&{fVisible:d,sVisible:f,doFill:p,doStroke:g}}transform(t,e,n,i=!1){const{x:r=e.x,y:s=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:c=e.angle,postMatrix:u}=t.attribute,h=n.modelMatrix,d=n.camera;Uo.x=r,Uo.y=s,Uo.z=a,Uo.lastModelMatrix=h;const f=d&&(i||function(t){const{alpha:e,beta:n}=t.attribute;return e||n}(t)),p=f?t.transMatrix.onlyTranslate()&&!u:1===o&&1===l&&0===c&&!u;if(f){const i=ea.allocate(),r=ea.allocate();La(r,t,e),Zs(i,h||i,r),Uo.x=0,Uo.y=0,Uo.z=0,n.modelMatrix=i,n.setTransform(1,0,0,1,0,0,!0),ea.free(r)}if(p&&!h){const i=t.getOffsetXY(e);Uo.x+=i.x,Uo.y+=i.y,Uo.z=a,n.setTransformForCurrent()}else if(f)Uo.x=0,Uo.y=0,Uo.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(d&&n.project){const i=t.getOffsetXY(e);Uo.x+=i.x,Uo.y+=i.y,this.transformWithoutTranslate(n,Uo.x,Uo.y,Uo.z,o,l,c)}else n.transformFromMatrix(t.transMatrix,!0),Uo.x=0,Uo.y=0,Uo.z=0;return Uo}transformUseContext2d(t,e,n,i){const r=i.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,a=i.project(0,0,n),o=i.project(r,0,n),l=i.project(r,s,n),c={x:0,y:0},u={x:r,y:0},h={x:r,y:s};i.camera=null;const d=1/(c.x*(h.y-u.y)-u.x*h.y+h.x*u.y+(u.x-h.x)*c.y),f=-(c.y*(l.x-o.x)-u.y*l.x+h.y*o.x+(u.y-h.y)*a.x)*d,p=(u.y*l.y+c.y*(o.y-l.y)-h.y*o.y+(h.y-u.y)*a.y)*d,g=(c.x*(l.x-o.x)-u.x*l.x+h.x*o.x+(u.x-h.x)*a.x)*d,m=-(u.x*l.y+c.x*(o.y-l.y)-h.x*o.y+(h.x-u.x)*a.y)*d,b=(c.x*(h.y*o.x-u.y*l.x)+c.y*(u.x*l.x-h.x*o.x)+(h.x*u.y-u.x*h.y)*a.x)*d,y=(c.x*(h.y*o.y-u.y*l.y)+c.y*(u.x*l.y-h.x*o.y)+(h.x*u.y-u.x*h.y)*a.y)*d;i.setTransform(f,p,g,m,b,y,!0)}}restoreTransformUseContext2d(t,e,n,i){this.camera&&(i.camera=this.camera)}transformWithoutTranslate(t,e,n,i,r,s,a){const o=t.project(e,n,i);t.translate(o.x,o.y,!1),t.scale(r,s,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,n,i,r,s){const{context:a}=i;if(!a)return;const{renderable:o}=t.attribute;if(!1===o)return;a.highPerformanceSave();const l=this.transform(t,e,a,n),{x:c,y:u,z:h,lastModelMatrix:d}=l;this.z=h,this.drawPathProxy(t,a,c,u,i,r)||(this.drawShape(t,a,c,u,i,r,null,null,s),this.z=0,a.modelMatrix!==d&&ea.free(a.modelMatrix),a.modelMatrix=d),a.highPerformanceRestore()}}var zo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Wo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fo=function(t,e){return function(n,i){e(n,i,t)}};let jo=class extends Do{constructor(t){super(),this.graphicRenderContributions=t,this.type="rect",this.numberType=js,this.builtinContributions=[ko,Po,Mo],this.init(t)}drawShape(t,e,n,i,r,s,a,o,l){l=null!=l?l:nr(t,null==s?void 0:s.theme).rect;const{fill:c=l.fill,background:u,stroke:h=l.stroke,cornerRadius:d=l.cornerRadius,cornerType:f=l.cornerType,opacity:p=l.opacity,fillOpacity:g=l.fillOpacity,lineWidth:m=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:y=l.visible,x1:v,y1:x,x:_=l.x,y:S=l.y,fillStrokeOrder:A=l.fillStrokeOrder,drawStrokeWhenZeroWH:w=l.drawStrokeWhenZeroWH}=t.attribute;let{width:T,height:C}=t.attribute;T=(null!=T?T:v-_)||0,C=(null!=C?C:x-S)||0;const B=function(t,e,n,i,r){return r&&t*e>0&&0!==n&&0!==i}(p,g,T,C,c),k=function(t,e,n,i,r){return r?t*e>0:t*e>0&&0!==n&&0!==i}(p,b,T,C,w),M=va(c,u),P=xa(h,m);if(!t.valid||!y)return;if(!M&&!P)return;if(!(B||k||a||o||u))return;0===d||Et(d)&&d.every((t=>0===t))?(e.beginPath(),e.rect(n,i,T,C)):(e.beginPath(),Ao(e,n,i,T,C,d,"bevel"!==f));const E={doFill:M,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,n,i,M,P,B,k,l,r,a,o,E),A?(this._runStroke(t,e,n,i,l,E,k,_,S,o),this._runFill(t,e,n,i,l,E,B,_,S,a)):(this._runFill(t,e,n,i,l,E,B,_,S,a),this._runStroke(t,e,n,i,l,E,k,_,S,o)),this.afterRenderStep(t,e,n,i,M,P,B,k,l,r,a,o)}_runFill(t,e,n,i,r,s,a,o,l,c){s.doFill&&(c?c(e,t.attribute,r):a&&(e.setCommonStyle(t,t.attribute,o-n,l-i,r),e.fill()))}_runStroke(t,e,n,i,r,s,a,o,l,c){s.doStroke&&(c?c(e,t.attribute,r):a&&(e.setStrokeStyle(t,t.attribute,o-n,l-i,r),e.stroke()))}draw(t,e,n,i){const r=nr(t,null==i?void 0:i.theme).rect;this._draw(t,r,!1,n,i,r)}};jo=zo([K(),Fo(0,X(ht)),Fo(0,q(wa)),Wo("design:paramtypes",[Object])],jo);var Ho=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Go=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vo=function(t,e){return function(n,i){e(n,i,t)}};let $o=class extends Do{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Gs,this.builtinContributions=[Lo,No,Io,Ro],this.init(t)}drawShape(t,e,n,i,r,s,a,o,l){var c;l=null!=l?l:nr(t,null==s?void 0:s.theme).symbol;const{size:u=l.size,x:h=l.x,y:d=l.y,scaleX:f=l.scaleX,scaleY:p=l.scaleY,fillStrokeOrder:g=l.fillStrokeOrder,clipRange:m=l.clipRange}=t.attribute,b=this.valid(t,l,a,o);if(!b)return;const{fVisible:y,sVisible:v,doFill:x,doStroke:_}=b,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:A=l.keepDirIn3d}=t.attribute,w=null!==(c=this.z)&&void 0!==c?c:0;e.beginPath();let T=n,C=i,B=w;const k=e.camera;if(A&&k&&e.project){const t=e.project(n,i,w);e.camera=null,Et(u)&&(u[0],u[1]),T=t.x,C=t.y,B=void 0}!1===S.draw(e,u,T,C,B,((r,s)=>{var c,u,b,y;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(c=s.fill)&&void 0!==c?c:t.attribute.fill,e.opacity=null!==(u=s.opacity)&&void 0!==u?u:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(b=s.stroke)&&void 0!==b?b:t.attribute.stroke,e.lineWidth=null!==(y=s.lineWidth)&&void 0!==y?y:t.attribute.lineWidth,s=e}const x=()=>{s.fill&&(a?a(e,t.attribute,l):(e.setCommonStyle(t,s,h-n,d-i,l),e.fill()))},_=()=>{s.stroke&&(o?o(e,t.attribute,l):v&&m>=1&&(e.setStrokeStyle(t,s,(h-n)/f,(d-i)/p,l),e.stroke()))};g?(_(),x()):(x(),_())}))&&e.closePath(),e.camera=k,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,n,i,x,_,y,v,l,r,a,o),g?(this._runStroke(t,e,n,i,l,_,v,h,d,S,m,f,p,o),this._runFill(t,e,n,i,l,x,y,h,d,S,a)):(this._runFill(t,e,n,i,l,x,y,h,d,S,a),this._runStroke(t,e,n,i,l,_,v,h,d,S,m,f,p,o)),this.afterRenderStep(t,e,n,i,x,_,y,v,l,r,a,o)}_runFill(t,e,n,i,r,s,a,o,l,c,u){s&&!c.isSvg&&(u?u(e,t.attribute,r):a&&(e.setCommonStyle(t,t.attribute,o-n,l-i,r),e.fill()))}_runStroke(t,e,n,i,r,s,a,o,l,c,u,h,d,f){s&&!c.isSvg&&(f?f(e,t.attribute,r):a&&u>=1&&(e.setStrokeStyle(t,t.attribute,(o-n)/h,(l-i)/d,r),e.stroke()))}draw(t,e,n,i){const r=nr(t,null==i?void 0:i.theme).symbol;this._draw(t,r,!1,n,i)}};$o=Ho([K(),Vo(0,X(ht)),Vo(0,q(Ta)),Go("design:paramtypes",[Object])],$o);const Xo=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Ae)}allocate(t,e,n,i){if(!this.pools.length)return(new Ae).setValue(t,e,n,i);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=n,r.y2=i,r}allocateByObj(t){if(!this.pools.length)return new Ae(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};const Yo=new class extends mo{constructor(){super(...arguments),this.time=Ge.beforeFillStroke}drawShape(t,e,n,i,r,s,a,o,l,c,u,h){var d,f,p,g,m,b,y,v,x,_;const{backgroundMode:S=l.backgroundMode,backgroundFit:A=l.backgroundFit,backgroundKeepAspectRatio:w=l.backgroundKeepAspectRatio}=t.attribute;let T,{background:C}=t.attribute;if(!C)return;const B=()=>{"richtext"===t.type&&(e.restore(),e.save(),T&&e.setTransformFromMatrix(T,!0,1))};let k;"richtext"===t.type&&(T=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const M=Bt(C)&&C.background,P=t.transMatrix.onlyTranslate();if(M){const e=t.AABBBounds,n=(null!==(d=C.x)&&void 0!==d?d:e.x1)+(null!==(f=C.dx)&&void 0!==f?f:0),i=(null!==(p=C.y)&&void 0!==p?p:e.y1)+(null!==(g=C.dy)&&void 0!==g?g:0),r=null!==(m=C.width)&&void 0!==m?m:e.width(),s=null!==(b=C.height)&&void 0!==b?b:e.height();if(k=Xo.allocate(n,i,n+r,i+s),C=C.background,!P){const t=k.width(),e=k.height();k.set((null!==(y=C.x)&&void 0!==y?y:0)+(null!==(v=C.dx)&&void 0!==v?v:0),(null!==(x=C.y)&&void 0!==x?x:0)+(null!==(_=C.dy)&&void 0!==_?_:0),t,e)}}else k=t.AABBBounds,P||(k=ho(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const r=t.resources.get(C);if("success"!==r.state||!r.data)return void B();e.highPerformanceSave(),P&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,n,i,l),this.doDrawImage(e,r.data,k,{backgroundMode:S,backgroundFit:A,backgroundKeepAspectRatio:w}),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:r}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=C,r?(Ao(e,k.x1,k.y1,k.width(),k.height(),r,!0),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}M&&Xo.free(k),B()}};var Ko=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},qo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qo=function(t,e){return function(n,i){e(n,i,t)}};let Zo=class extends Do{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Vs,this.builtinContributions=[Yo],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l,c,u;const h=nr(t,null==s?void 0:s.theme).text,{text:d,underline:f=h.underline,lineThrough:p=h.lineThrough,keepDirIn3d:g=h.keepDirIn3d,direction:m=h.direction,fontSize:b=h.fontSize,verticalMode:y=h.verticalMode,x:v=h.x,y:x=h.y}=t.attribute,_=null!==(l=mr(t.attribute.lineHeight,b))&&void 0!==l?l:b,S=this.valid(t,h,a,o);if(!S)return;const{fVisible:A,sVisible:w,doFill:T,doStroke:C}=S,B=!g,k=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,i,T,C,A,w,h,r,a,o),B&&this.transformUseContext2d(t,h,k,e);const M=(r,s,l,c)=>{let u=n+s;const d=i+l;if(c){e.highPerformanceSave(),u+=b;const t=ta.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,u,d),e.transformFromMatrix(t,!0),ta.free(t)}C&&(o?o(e,t.attribute,h):w&&(e.setStrokeStyle(t,t.attribute,v-n,x-i,h),e.strokeText(r,u,d,k))),T&&(a?a(e,t.attribute,h):A&&(e.setCommonStyle(t,t.attribute,v-n,x-i,h),e.fillText(r,u,d,k))),c&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,h,k),"horizontal"===m){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:l}=r.bbox;C&&(o?o(e,t.attribute,h):w&&(e.setStrokeStyle(t,t.attribute,v-n,x-i,h),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+l+i,k)})))),T&&(a?a(e,t.attribute,h):A&&(e.setCommonStyle(t,t.attribute,v-n,x-i,h),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+n,(r.topOffset||0)+l+i,k),this.drawUnderLine(f,p,t,(r.leftOffset||0)+s+n,(r.topOffset||0)+l+i,r.descent,(r.descent-r.ascent)/2,k,h,e,{width:r.width})}))))}else{let{textAlign:n=h.textAlign,textBaseline:i=h.textBaseline}=t.attribute;if(!y){const e=n;n=null!==(c=t.getBaselineMapAlign()[i])&&void 0!==c?c:"left",i=null!==(u=t.getAlignMapBaseline()[e])&&void 0!==u?u:"top"}t.tryUpdateAABBBounds();const r=t.cache,{verticalList:s}=r;e.textAlign="left",e.textBaseline="top";const a=_*s.length;let o=0;s.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);o=se(e,o)}));let l=0,d=0;"bottom"===i?d=-a:"middle"===i&&(d=-a/2),"center"===n?l-=o/2:"right"===n&&(l-=o),s.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),r=o-i;let s=l;"center"===n?s+=r/2:"right"===n&&(s+=r),t.forEach((t=>{const{text:n,width:i,direction:r}=t;M(n,a-(e+1)*_+d,s,r),s+=i}))}))}B&&this.restoreTransformUseContext2d(t,h,k,e),this.afterRenderStep(t,e,n,i,T,C,A,w,h,r,a,o)}draw(t,e,n,i){const r=nr(t,null==i?void 0:i.theme).text,{keepDirIn3d:s=r.keepDirIn3d}=t.attribute,a=!s;this._draw(t,r,a,n,i)}drawUnderLine(t,e,n,i,r,s,a,o,l,c,u){if(e+t<=0)return;const{textAlign:h=l.textAlign,fill:d=l.fill,opacity:f=l.opacity,underlineOffset:p=l.underlineOffset,underlineDash:g=l.underlineDash,fillOpacity:m=l.fillOpacity}=n.attribute,b=!Tt(u),y=b?u.width:n.clipedWidth,v=b?0:ka(h,y),x={lineWidth:0,stroke:d,opacity:f,strokeOpacity:m};if(t){x.lineWidth=t,c.setStrokeStyle(n,x,i,r,l),g&&c.setLineDash(g),c.beginPath();const e=r+s+p;c.moveTo(i+v,e,o),c.lineTo(i+v+y,e,o),c.stroke()}if(e){x.lineWidth=e,c.setStrokeStyle(n,x,i,r,l),c.beginPath();const t=r+a;c.moveTo(i+v,t,o),c.lineTo(i+v+y,t,o),c.stroke()}}};Zo=Ko([K(),Qo(0,X(ht)),Qo(0,q(Ca)),qo("design:paramtypes",[Object])],Zo);var Jo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},tl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},el=function(t,e){return function(n,i){e(n,i,t)}};const nl=["","repeat-x","repeat-y","repeat"];let il=class extends Do{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Fs,this.builtinContributions=[Eo,Oo],this.init(t)}drawShape(t,e,n,i,r,s,a,o){const l=nr(t).image,{repeatX:c=l.repeatX,repeatY:u=l.repeatY,x:h=l.x,y:d=l.y,cornerRadius:f=l.cornerRadius,fillStrokeOrder:p=l.fillStrokeOrder,cornerType:g=l.cornerType,image:m}=t.attribute,b=this.valid(t,l,a);if(!b)return;const{fVisible:y,sVisible:v,doFill:x,doStroke:_}=b;if(!m||!t.resources)return;const S=t.resources.get(m);if("success"!==S.state)return;const A=t.width,w=t.height;e.beginPath();let T=!1;0===f||Et(f)&&f.every((t=>0===t))?e.rect(n,i,A,w):(Ao(e,n,i,A,w,f,"bevel"!==g),T=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const C=()=>{if(x)if(a)a(e,t.attribute,l);else if(y){e.setCommonStyle(t,t.attribute,n,i,l);let r=0;if("repeat"===c&&(r|=1),"repeat"===u&&(r|=2),r){const t=e.createPattern(S.data,nl[r]);e.fillStyle=t,e.translate(n,i,!0),e.fillRect(0,0,A,w),e.translate(-n,-i,!0)}else e.drawImage(S.data,n,i,A,w)}},B=()=>{_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,h-n,d-i,l),e.stroke()))};p?(B(),T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,i,x,!1,y,!1,l,r,a),C(),T&&e.restore()):(T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,i,x,!1,y,!1,l,r,a),C(),T&&e.restore(),B()),this.afterRenderStep(t,e,n,i,x,!1,y,!1,l,r,a)}draw(t,e,n){const{image:i}=t.attribute;if(!i||!t.resources)return;const r=t.resources.get(i);if("loading"===r.state&&Pt(i))return void lr.improveImageLoading(i);if("success"!==r.state)return;const{context:s}=e.drawParams;if(!s)return;const a=nr(t).image;this._draw(t,a,!1,n)}};il=Jo([K(),el(0,X(ht)),el(0,q(Aa)),tl("design:paramtypes",[Object])],il);const rl=Symbol.for("GraphicRender"),sl=Symbol.for("RectRender"),al=Symbol.for("SymbolRender"),ol=Symbol.for("TextRender"),ll=Symbol.for("RichTextRender"),cl=Symbol.for("ImageRender");let ul;function hl(){!function(){if(null==ul)try{const t=document.createElement("canvas"),e=t.getContext("2d");ul=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),ul&&(ul=!!document.createElement)}catch(t){ul=!1}}();const t=xt.global&&xt.global.env;return t?"browser"===t:ul}var dl=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},fl=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function o(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}l((i=i.apply(t,e||[])).next())}))};let pl=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new Ae}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}loadFont(t,e,n){return fl(this,void 0,void 0,(function*(){return{loadState:"fail"}}))}isMacOS(){return!1}copyToClipBoard(t){return Promise.resolve(null)}};pl=dl([K()],pl);let gl=!1;const ml=new D((t=>{gl||(gl=!0,t(jo).toSelf().inSingletonScope(),t(sl).to(jo).inSingletonScope(),t(rl).toService(sl),t(Bo).toSelf(),t(Co).toSelf(),t(wa).toService(Bo),t(wa).toService(Co),t(wa).toService(yo),ft(t,wa))}));let bl=!1;const yl=new D((t=>{bl||(bl=!0,t($o).toSelf().inSingletonScope(),t(al).to($o).inSingletonScope(),t(rl).toService(al),t(Ta).toService(yo),ft(t,Ta))}));let vl=!1;const xl=new D((t=>{vl||(vl=!0,t(ol).to(Zo).inSingletonScope(),t(rl).toService(ol),t(Ca).toService(yo),ft(t,Ca))}));var _l=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Sl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Al=class extends Do{constructor(){super(),this.numberType=Hs,this.builtinContributions=[Yo],this.init()}drawShape(t,e,n,i,r){const s=nr(t).richtext,{strokeOpacity:a=s.strokeOpacity,opacity:o=s.opacity,fillOpacity:l=s.fillOpacity,visible:c=s.visible}=t.attribute;if(!t.valid||!c)return;const u=_a(o,l,!0),h=_a(o,a,!0);u&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,s),e.translate(n,i),this.beforeRenderStep(t,e,n,i,u,h,u,h,s,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,n,i,u,h,u,h,s,r))}drawIcon(t,e,n,i,r){var s;const a=nr(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:c=a.opacity,image:u,backgroundFill:h=a.backgroundFill,backgroundFillOpacity:d=a.backgroundFillOpacity,backgroundStroke:f=a.backgroundStroke,backgroundStrokeOpacity:p=a.backgroundStrokeOpacity,backgroundRadius:g=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:b=o,backgroundHeight:y=l}=t.attribute;if(m&&(n+=t._marginArray[3],i+=t._marginArray[0]),t._hovered){const t=(b-o)/2,r=(y-l)/2;0===g?(e.beginPath(),e.rect(n-t,i-r,b,y)):(e.beginPath(),Ao(e,n-t,i-r,b,y,g,!0)),h&&(e.globalAlpha=d,e.fillStyle=h,e.fill()),f&&(e.globalAlpha=p,e.strokeStyle=f,e.stroke())}const v=u&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(u));v&&"success"===v.state&&(e.globalAlpha=c,e.drawImage(v.data,n,i,o,l))}draw(t,e,n){const i=nr(t).richtext;this._draw(t,i,!1,n)}};Al=_l([K(),Sl("design:paramtypes",[])],Al);let wl=!1;const Tl=new D((t=>{wl||(wl=!0,t(ll).to(Al).inSingletonScope(),t(rl).toService(ll))}));let Cl=!1;const Bl=new D((t=>{Cl||(Cl=!0,t(cl).to(il).inSingletonScope(),t(rl).toService(cl),t(Aa).toService(yo),ft(t,Aa))}));class kl{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=U.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0,this.onWheel=t=>{try{const e=new t.constructor(t.type,t);this.pluginService.stage.window.getContext().getCanvas().nativeCanvas.dispatchEvent(e)}catch(t){return}}}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML([...t.stage.getChildren()])}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),this.release()}getWrapContainer(t,e,n){let i;return i=e?"string"==typeof e?xt.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:xt.global.createDom(Object.assign({tagName:"div",parent:i},n)),nativeContainer:i}}parseDefaultStyleFromGraphic(t){return function(t){const e={},n=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((n=>{t[n]&&(e[Ce(n)]=t[n])})),["fontSize","lineHeight"].forEach((i=>{const r=Ce(i);Tt(t[i])||(e[r]=n(t[i]))})),Ct(t.maxLineWidth)&&(e["max-width"]=n(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&Pt(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:nr(t).text)}getTransformOfText(t){const e=nr(t).text,{textAlign:n=e.textAlign,textBaseline:i=e.textBaseline}=t.attribute,r=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:s,scaleX:a,scaleY:o}=r,l={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},c={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:n,transform:`translate(${l[n]},${l[i]}) rotate(${s}deg) scaleX(${a}) scaleY(${o})`,transformOrigin:`${c[n]} ${c[i]}`}}updateStyleOfWrapContainer(t,e,n,i,r){const{pointerEvents:s,penetrateEventList:a=[]}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none","none"!==o.pointerEvents&&(this.removeWrapContainerEventListener(n),a.forEach((t=>{"wheel"===t&&n.addEventListener("wheel",this.onWheel)}))),n.style.position||(n.style.position="absolute",i.style.position="relative");let l=0,c=0;const u=t.globalAABBBounds;let h=r.anchorType;if(Tt(h)&&(h="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===h&&(h="top-left"),"position"===h||u.empty()){const e=t.globalTransMatrix;l=e.e,c=e.f}else{const t=((t,e)=>{const{x1:n,x2:i,y1:r,y2:s}=t,a=Math.abs(i-n),o=Math.abs(s-r);let l=(n+i)/2,c=(r+s)/2,u=0,h=0;switch(e){case"top":case"inside-top":h=-.5;break;case"bottom":case"inside-bottom":h=.5;break;case"left":case"inside-left":u=-.5;break;case"right":case"inside-right":u=.5;break;case"top-right":u=.5,h=-.5;break;case"top-left":u=-.5,h=-.5;break;case"bottom-right":u=.5,h=.5;break;case"bottom-left":u=-.5,h=.5}return l+=u*a,c+=h*o,{x:l,y:c}})(u,h);l=t.x,c=t.y}const d=xt.global.getElementTopLeft(i,!1),f=e.window.getTopLeft(!1),p=e.viewBox,g=l+f.left-d.left+p.x1,m=c+f.top-d.top+p.y1;if(o.left=`${g}px`,o.top=`${m}px`,"text"===t.type&&"position"===h&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),wt(r.style)){const e=r.style({top:m,left:g,width:u.width(),height:u.height()},t,n);e&&(o=Object.assign(Object.assign({},o),e))}else Bt(r.style)?o=Object.assign(Object.assign({},o),r.style):Pt(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),((t="")=>{const e={};return t.split(";").forEach((t=>{if(t){const n=t.split(":");if(2===n.length){const t=n[0].trim(),i=n[1].trim();t&&i&&(e[t]=i)}}})),e})(r.style)));xt.global.updateDom(n,{width:r.width,height:r.height,style:o})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===xt.global.env&&(t.sort(((t,e)=>{var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:Hn.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:Hn.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&xt.global.removeDom(e),this.htmlMap[t]=null}removeWrapContainerEventListener(t){t.removeEventListener("wheel",this.onWheel)}renderGraphicHTML(t){var e;const{html:n}=t.attribute;if(!n)return;const i=t.stage;if(!i)return;const{dom:r,container:s}=n;if(!r)return;const a=Tt(n.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:n.id;if(this.htmlMap&&this.htmlMap[a]&&s&&s!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])"string"==typeof r?this.htmlMap[a].wrapContainer.innerHTML=r:r!==this.htmlMap[a].wrapContainer.firstChild&&(this.htmlMap[a].wrapContainer.removeChild(this.htmlMap[a].wrapContainer.firstChild),this.htmlMap[a].wrapContainer.appendChild(r));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(i,s);t&&("string"==typeof r?t.innerHTML=r:t.appendChild(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:s,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:l}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,i,o,l,n),this.htmlMap[a].renderId=this.renderId}release(){"browser"===xt.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}class Ml extends kl{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=U.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:n,unmount:i}=this.htmlMap[t];e?xt.global.getRequestAnimationFrame()((()=>{e.unmount()})):i&&i(),n&&xt.global.removeDom(n),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:n}=t.attribute;if(!n)return;const i=t.stage;if(!i)return;const r=i.params.ReactDOM,{element:s,container:a}=n;if(!s||!r||!r.createRoot&&!r.render)return;const o=Tt(n.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:n.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])r.createRoot?this.htmlMap[o].root.render(s):r.render(s,this.htmlMap[o].wrapContainer);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(i,a);if(t)if(this.htmlMap||(this.htmlMap={}),r.createRoot){const n=r.createRoot(t);n.render(s),this.htmlMap[o]={root:n,wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId}}else r.render(s,t),this.htmlMap[o]={wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId,unmount:()=>{r.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:l,nativeContainer:c}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,i,l,c,n),this.htmlMap[o].renderId=this.renderId}}const Pl=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class El extends ba{constructor(t,e){super(t),this._skipRenderAttributes=Pl,(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,n,i){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);if(r)return this._setAttributes(r,n);Mt(this.attribute[t])&&Mt(e)&&!wt(this.attribute[t])&&!wt(e)?Vt(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,n){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t,this._setAttributes(t,e)}_setAttributes(t,e){const n=Object.keys(t);this._mergeAttributes(t,n),n.every((t=>this._skipRenderAttributes.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){Tt(e)&&(e=Object.keys(t));for(let n=0;n<e.length;n++){const i=e[n];!Mt(this.attribute[i])||wt(this.attribute[i])||wt(t[i])?this.attribute[i]=t[i]:Vt(this.attribute[i],t[i])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var n;const i=new ar(t,e);i.manager=null===(n=this.stage)||void 0===n?void 0:n.eventSystem.manager,this.dispatchEvent(i)}eventPosToStagePos(t){var e,n;const i={x:0,y:0},r=null!==(n=null===(e=this.stage)||void 0===e?void 0:e.eventPointTransform(t))&&void 0!==n?n:{x:0,y:0};return this.globalTransMatrix.transformPoint(r,i),i}}const Ol=Symbol.for("MathPickerContribution"),Ll=Symbol.for("MathImagePicker"),Rl=Symbol.for("MathRectPicker"),Il=Symbol.for("MathSymbolPicker"),Nl=Symbol.for("MathTextPicker"),Ul=Symbol.for("CanvasImagePicker"),Dl=Symbol.for("CanvasRectPicker"),zl=Symbol.for("CanvasSymbolPicker"),Wl=Symbol.for("CanvasTextPicker"),Fl=Symbol.for("CanvasRichTextPicker"),jl=Symbol.for("CanvasPickerContribution"),Hl={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"};var Gl=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Vl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$l=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function o(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}l((i=i.apply(t,e||[])).next())}))};class Xl{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function Yl(t,e=!1){const n=document.createElement("img");if(xt.global.isImageAnonymous&&(n.crossOrigin="anonymous"),e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return n.src=t,n.complete?Promise.resolve(n):new Promise(((t,e)=>{n.onload=()=>{t(n)},n.onerror=()=>{e(new Error("加载失败"))}}))}let Kl=class extends pl{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var n,i;let r=0,s=0,a=0,o=0;if(t.changedTouches){const e=null!==(n=t.changedTouches[0])&&void 0!==n?n:{};r=e.clientX||0,s=e.clientY||0,a=r,o=s}else r=t.clientX||0,s=t.clientY||0,a=t.offsetX||0,o=t.offsetY||0;if(e){const t=r,n=s,a=e.getBoundingClientRect(),o=null===(i=e.getNativeHandler)||void 0===i?void 0:i.call(e).nativeCanvas;let l,c;return o&&(l=a.width/o.offsetWidth,c=a.height/o.offsetHeight),{x:(t-a.left)/(Rt(l)?l:1),y:(n-a.top)/(Rt(c)?c:1)}}return{x:a,y:o}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new Xl(t)}return new Ae}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:n,height:i,style:r}=e;return r&&(Pt(r)?t.setAttribute("style",r):Object.keys(r).forEach((e=>{t.style[e]=r[e]}))),null!=n&&(t.style.width=`${n}px`),null!=i&&(t.style.height=`${i}px`),!0}createDom(t){const{tagName:e="div",parent:n}=t,i=document.createElement(e);if(this.updateDom(i,t),n){const t=Pt(n)?this.getElementById(n):n;t&&t.appendChild&&t.appendChild(i)}return i}loadImage(t){return Yl(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Yl(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,n;const i=document.createElement("canvas");t.id&&(i.id=null!==(e=t.id)&&void 0!==e?e:U.GenAutoIncrementId().toString());const r=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(i.style.width=`${t.width}px`,i.style.height=`${t.height}px`,i.width=t.width*r,i.height=t.height*r),i}createOffscreenCanvas(t){var e;const n=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*n,t.height*n)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,n){return document.addEventListener(t,e,n)}removeEventListener(t,e,n){return document.removeEventListener(t,e,n)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(...t){}getElementTop(t,e){let n=t.offsetTop,i=t.offsetParent;for(;null!==i;)n+=i.offsetTop,i=i.offsetParent;return n}getElementLeft(t,e){let n=t.offsetLeft,i=t.offsetParent;for(;null!==i;)n+=i.offsetLeft,i=i.offsetParent;return n}getElementTopLeft(t,e){let n=t.offsetTop,i=t.offsetLeft,r=t.offsetParent;for(;null!==r;)n+=r.offsetTop,i+=r.offsetLeft,r=r.offsetParent;return{top:n,left:i}}loadFont(t,e,n){return $l(this,void 0,void 0,(function*(){return new FontFace(t,Pt(e)?`url(${e})`:e,n).load().then((function(t){return document.fonts.add(t),{loadState:"success"}})).catch((function(t){return{loadState:"fail"}}))}))}isMacOS(){if(void 0===this._isMacOS)try{this._isMacOS=navigator.platform.toUpperCase().indexOf("MAC")>=0}catch(t){this._isMacOS=!1}return this._isMacOS}copyToClipBoard(t){return navigator.clipboard.writeText(t).then((()=>{})).catch((t=>{}))}};Kl=Gl([K(),Vl("design:paramtypes",[])],Kl);class ql{contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getGraphicTheme();i.highPerformanceSave();let{x:s=r.x,y:a=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,i.setTransformForCurrent()}else s=0,a=0,i.transformFromMatrix(t.transMatrix,!0);let o=!1,l=!1;return this.canvasRenderer.drawShape(t,i,s,a,{},null,((t,n,i,r)=>!(!o&&!l)||(o=t.isPointInPath(e.x,e.y),l=r||l,o)),((t,n,r,s)=>{if(o||l)return!0;const a=n.lineWidth||r.lineWidth,c=n.pickStrokeBuffer||r.pickStrokeBuffer,u=n.keepStrokeScale||r.keepStrokeScale;return i.lineWidth=u?a+c:oi(i,a+c,i.dpr),o=t.isPointInStroke(e.x,e.y),l=s||l,o})),i.highPerformanceRestore(),o}}var Ql=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a};let Zl=class{constructor(){this.type="image",this.numberType=Fs}contains(t,e,n){const{pickContext:i}=null!=n?n:{};return!!i&&!!t.AABBBounds.containsPoint(e)}};Zl=Ql([K()],Zl);let Jl=!1;const tc=new D(((t,e,n,i)=>{Jl||(Jl=!0,t(Ll).to(Zl).inSingletonScope(),t(Zl).toService(Ll))})),ec=new Ae;class nc{constructor(){this.type="rect",this.numberType=js}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getGraphicTheme(),{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:a=r.x,y:o=r.y}=t.attribute;i.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);a+=e.x,o+=e.y,i.setTransformForCurrent()}else a=0,o=0,l=!1,i.transformFromMatrix(t.transMatrix,!0);let c=!0;if(!l||t.shadowRoot||Lt(s,!0)&&0!==s||Et(s)&&s.some((t=>0!==t)))c=!1,this.canvasRenderer.drawShape(t,i,a,o,{},null,((t,n,i)=>!!c||(c=t.isPointInPath(e.x,e.y),c)),((t,n,r)=>{if(c)return!0;const s=n.lineWidth||r.lineWidth,a=n.pickStrokeBuffer||r.pickStrokeBuffer,o=n.keepStrokeScale||r.keepStrokeScale;return i.lineWidth=o?s+a:oi(i,s+a,i.dpr),c=t.isPointInStroke(e.x,e.y),c}));else{const{fill:n=r.fill,stroke:i=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(n)c=!0;else if(i){const n=t.AABBBounds;ec.setValue(n.x1,n.y1,n.x2,n.y2),ec.expand(-s/2),c=!ec.containsPoint(e)}}return i.highPerformanceRestore(),c}}var ic=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},rc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sc=function(t,e){return function(n,i){e(n,i,t)}};let ac=class extends nc{constructor(t){super(),this.canvasRenderer=t}};ac=ic([K(),sc(0,X(sl)),rc("design:paramtypes",[Object])],ac);let oc=!1;const lc=new D(((t,e,n,i)=>{oc||(oc=!0,t(Rl).to(ac).inSingletonScope(),t(Ol).toService(Rl))}));let cc=!1;const uc=new D(((t,e,n,i)=>{cc||(cc=!0,t(Ll).to(Zl).inSingletonScope(),t(Zl).toService(Ll))}));var hc=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},dc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fc=function(t,e){return function(n,i){e(n,i,t)}};let pc=class extends ql{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Gs}};pc=hc([K(),fc(0,X(al)),dc("design:paramtypes",[Object])],pc);let gc=!1;const mc=new D(((t,e,n,i)=>{gc||(gc=!0,t(Il).to(pc).inSingletonScope(),t(Ol).toService(Il))}));var bc=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a};let yc=class{constructor(){this.type="text",this.numberType=Vs}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};yc=bc([K()],yc);let vc=!1;const xc=new D(((t,e,n,i)=>{vc||(vc=!0,t(Nl).to(yc).inSingletonScope(),t(Ol).toService(Nl))}));var _c=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Sc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ac=function(t,e){return function(n,i){e(n,i,t)}};let wc=class extends nc{constructor(t){super(),this.canvasRenderer=t}};wc=_c([K(),Ac(0,X(sl)),Sc("design:paramtypes",[Object])],wc);let Tc=!1;const Cc=new D(((t,e,n,i)=>{Tc||(Tc=!0,t(Dl).to(wc).inSingletonScope(),t(jl).toService(Dl))}));class Bc extends Do{contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getGraphicTheme();i.highPerformanceSave();const s=this.transform(t,r,i),{x:a,y:o,z:l,lastModelMatrix:c}=s;let u=e;if(i.camera){u=e.clone();const n=t.parent.globalTransMatrix;u.x=n.a*e.x+n.c*e.y+n.e,u.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let h=!1;return this.canvasRenderer.drawShape(t,i,a,o,n,null,((t,e,n)=>!!h||(h=t.isPointInPath(u.x,u.y),h))),this.canvasRenderer.z=0,i.modelMatrix!==c&&ea.free(i.modelMatrix),i.modelMatrix=c,i.highPerformanceRestore(),h}}var kc=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Mc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pc=function(t,e){return function(n,i){e(n,i,t)}};let Ec=class extends Bc{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Gs}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getParsedPath();if(!i.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}i.highPerformanceSave();const s=t.getGraphicTheme(),a=this.transform(t,s,i),{x:o,y:l,z:c,lastModelMatrix:u}=a;let h=e;if(i.camera){h=e.clone();const n=t.parent.globalTransMatrix;h.x=n.a*e.x+n.c*e.y+n.e,h.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=c;let d=!1;return this.canvasRenderer.drawShape(t,i,o,l,{},null,((t,e,n)=>!!d||(d=t.isPointInPath(h.x,h.y),d)),((t,e,n)=>{if(d)return!0;const r=e.lineWidth||n.lineWidth,s=e.pickStrokeBuffer||n.pickStrokeBuffer,a=e.keepStrokeScale||n.keepStrokeScale;return i.lineWidth=a?r+s:oi(i,r+s,i.dpr),d=t.isPointInStroke(h.x,h.y),d})),this.canvasRenderer.z=0,i.modelMatrix!==u&&ea.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore(),d}};Ec=kc([K(),Pc(0,X(al)),Mc("design:paramtypes",[Object])],Ec);let Oc=!1;const Lc=new D(((t,e,n,i)=>{Oc||(Oc=!0,t(zl).to(Ec).inSingletonScope(),t(jl).toService(zl))}));var Rc=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Ic=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Nc=function(t,e){return function(n,i){e(n,i,t)}};let Uc=class extends Bc{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Vs}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.AABBBounds;if(!i.camera)return!!r.containsPoint(e);i.highPerformanceSave();const s=t.getGraphicTheme(),{keepDirIn3d:a=s.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,s,i,o),{x:c,y:u,z:h,lastModelMatrix:d}=l;this.canvasRenderer.z=h;let f=e;if(i.camera){f=e.clone();const n=t.parent.globalTransMatrix;f.x=n.a*e.x+n.c*e.y+n.e,f.y=n.b*e.x+n.d*e.y+n.f}let p=!1;return this.canvasRenderer.drawShape(t,i,c,u,{},null,((e,n,i)=>{if(p)return!0;const{fontSize:r=s.fontSize,textBaseline:a=s.textBaseline,textAlign:o=s.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),g=l.width(),m=Ma(a,d,r),b=ka(o,g);return e.rect(b+c,m+u,g,d,h),p=e.isPointInPath(f.x,f.y),p}),((t,e,n)=>p)),this.canvasRenderer.z=0,i.modelMatrix!==d&&ea.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),p}};Uc=Rc([K(),Nc(0,X(ol)),Ic("design:paramtypes",[Object])],Uc);let Dc=!1;const zc=new D(((t,e,n,i)=>{Dc||(Dc=!0,t(Wl).to(Uc).inSingletonScope(),t(jl).toService(Wl))}));var Wc=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Fc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jc=function(t,e){return function(n,i){e(n,i,t)}};let Hc=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Hs}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};Hc=Wc([K(),jc(0,X(ll)),Fc("design:paramtypes",[Object])],Hc);let Gc=!1;const Vc=new D(((t,e,n,i)=>{Gc||(Gc=!0,t(Fl).to(Hc).inSingletonScope(),t(jl).toService(Fl))}));var $c=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Xc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yc=function(t,e){return function(n,i){e(n,i,t)}};let Kc=class extends ql{constructor(t){super(),this.canvasRenderer=t,this.type="image",this.numberType=Fs}};Kc=$c([K(),Yc(0,X(cl)),Xc("design:paramtypes",[Object])],Kc);let qc=!1;const Qc=new D(((t,e,n,i)=>{qc||(qc=!0,t(Ul).to(Kc).inSingletonScope(),t(jl).toService(Ul))})),Zc=hl();function Jc(){Jc.__loaded||(Jc.__loaded=!0,co.RegisterGraphicCreator("group",ya))}Jc.__loaded=!1;const tu=Jc;function eu(){eu.__loaded||(eu.__loaded=!0,co.RegisterGraphicCreator("image",to),yt.load(Bl),yt.load(Zc?Qc:tc))}eu.__loaded=!1;const nu=eu;function iu(){iu.__loaded||(iu.__loaded=!0,co.RegisterGraphicCreator("rect",Ya),yt.load(ml),yt.load(Zc?Cc:lc))}iu.__loaded=!1;const ru=iu;function su(){su.__loaded||(su.__loaded=!0,co.RegisterGraphicCreator("richtext",ao),yt.load(Tl),yt.load(Zc?Vc:uc))}su.__loaded=!1;const au=su;function ou(){ou.__loaded||(ou.__loaded=!0,co.RegisterGraphicCreator("symbol",Va),yt.load(yl),yt.load(Zc?Lc:mc))}ou.__loaded=!1;const lu=ou;function cu(){cu.__loaded||(cu.__loaded=!0,co.RegisterGraphicCreator("text",za),yt.load(xl),yt.load(Zc?zc:xc))}cu.__loaded=!1;const uu=cu;function hu(){hu.__loaded||(hu.__loaded=!0,co.RegisterGraphicCreator("wrapText",ja))}hu.__loaded=!1;const du=hu,fu="PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";var pu;function gu(t,e,n={}){if(!t)return{width:0,height:0};const i=ho({text:t,fontFamily:e.fontFamily||n.fontFamily||fu,fontSize:e.fontSize||n.fontSize||12,fontWeight:e.fontWeight||n.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||n.fontSize||12});return{width:i.width(),height:i.height()}}function mu(t,e="type"){return"rich"===function(t,e="type"){var n,i;return Bt(t.text)&&"type"in t.text?null!==(n=t.text.type)&&void 0!==n?n:"text":e in t&&null!==(i=t[e])&&void 0!==i?i:"text"}(t,e)}!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(pu||(pu={})),pu.selectedReverse,pu.selected,pu.hover,pu.hoverReverse;var bu=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};tu(),ru(),lu(),au(),uu();let yu=class t extends El{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(e,n){super((null==n?void 0:n.skipDefault)?e:Vt({},t.defaultAttributes,e)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,n;this.cacheStates();const{text:i="",textStyle:r={},shape:s={},panel:a={},space:o=4,minWidth:l,maxWidth:c,padding:u=4,visible:h,state:d,type:f,textAlwaysCenter:p,containerTextAlign:g}=this.attribute,m=function(t){if(Rt(t))return[t,t,t,t];if(Et(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,n]=t;return[e,n,e,n]}if(3===e){const[e,n,i]=t;return[e,n,i,n]}if(4===e)return t}if(Bt(t)){const{top:e=0,right:n=0,bottom:i=0,left:r=0}=t;return[e,n,i,r]}return[0,0,0,0]}(u),b=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let y,v=-m[3],x=-m[0],_=m[1]+m[3],S=m[0]+m[2],A=0,w=0;const{visible:T}=s,C=bu(s,["visible"]);if(At(T)){const t=(null==C?void 0:C.size)||10,e=Lt(t)?t:Math.max(t[0],t[1]);y=b.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},C),{visible:T,x:e/2,y:e/2}),"symbol"),Ft(null==d?void 0:d.shape)||(y.states=d.shape),T&&(w=e+o)}let B,k,M;if(_+=w,A+=w,mu({text:i})||"rich"===f){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,n;return Ct(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(n=t.height)&&void 0!==n?n:0,t.textConfig=t.text.text||t.text,t}(Object.assign({type:f,text:i},r))),r),{visible:Ct(i)&&!1!==h,x:A,y:0});Tt(t.lineHeight)&&(t.lineHeight=r.fontSize),B=b.createOrUpdateChild("tag-text",t,"richtext"),k=B.AABBBounds.width(),M=B.AABBBounds.height()}else{const n=Object.assign(Object.assign({text:Bt(i)&&"type"in i&&"text"===i.type?i.text:i,visible:Ct(i)&&!1!==h,lineHeight:null==r?void 0:r.fontSize},r),{x:A,y:0});Tt(n.lineHeight)&&(n.lineHeight=r.fontSize),B=b.createOrUpdateChild("tag-text",n,"text");const s=gu(n.text,r,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text);k=s.width,M=s.height}_+=k;const P=null!==(n=s.size)&&void 0!==n?n:10,E=Lt(P)?P:Math.max(P[0],P[1]);S+=Math.max(M,s.visible?E:0);const{textAlign:O,textBaseline:L}=r;(Ct(l)||Ct(c))&&(Ct(l)&&_<l&&(_=l),Ct(c)&&_>c&&(_=c,B.setAttribute("maxLineWidth",c-m[1]-m[2]))),v=0,x=0;let R=0;"left"===O||"start"===O?R=1:"right"===O||"end"===O?R=-1:"center"===O&&(R=0),R?R<0?(v-=_,y&&y.setAttribute("x",(y.attribute.x||0)-k),b.setAttribute("x",-m[1]-w)):R>0&&b.setAttribute("x",m[3]):(v-=_/2,y&&y.setAttribute("x",(y.attribute.x||0)-k/2),b.setAttribute("x",-w/2));const I="right"===g||"end"===g,N="left"===g||"start"===g,U=(t,e)=>{var n;"richtext"===B.type?B.setAttributes({x:t,textAlign:e,textConfig:(n=B.attribute.textConfig,Ct(n)?Et(n)?n:[n]:[]).map((t=>Object.assign(Object.assign({},t),{textAlign:e})))}):B.setAttributes({x:t,textAlign:e})};if((g?"center"===g:p)&&R){const t=_-m[1]-m[3],e=k+w,n=1===R?(t-e)/2+w+k/2:m[0]+w-(_/2+e/2-w)+k/2;if(U(n,"center"),y){const t=n-k/2-w+E/2;y.setAttributes({x:t})}}if(N&&1!==R){const t=_-m[1]-m[3],e=0===R?-t/2+w/2:-_+m[3]+m[1]+w;if(U(e+w,"left"),y){const t=e+E/2;y.setAttributes({x:t})}}if(I&&-1!==R){const t=_-m[1]-m[3],e=0===R?t/2+w/2:t;if(U(e,"right"),y){const t=e-k-w+E/2;y.setAttributes({x:t})}}"middle"===L?(x-=S/2,y&&y.setAttribute("y",0)):"bottom"===L?(x-=S,y&&y.setAttribute("y",-M/2),b.setAttribute("y",-m[2])):"top"===L&&(b.setAttribute("y",m[0]),y&&y.setAttribute("y",M/2)),Ft(null==d?void 0:d.text)||(B.states=d.text);const{visible:D}=a,z=bu(a,["visible"]);if(h&&At(D)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},z),{visible:D&&!!i,width:_,height:S,x:v,y:x}),"rect");if(Ft(null==d?void 0:d.panel)||(t.states=d.panel),z.customShape){const e=z.customShape;t.pathProxy=t=>e(this,t,new Rn)}this._bgRect=t}this._textShape=B,this._symbol=y,this.resetStates()}initAttributes(e,n){e=(null==n?void 0:n.skipDefault)?e:Vt({},t.defaultAttributes,e),super.initAttributes(e),this.render()}addState(t,e,n){super.addState(t,e,n),this._textShape&&this._textShape.addState(t,e,n),this._bgRect&&this._bgRect.addState(t,e,n),this._symbol&&this._symbol.addState(t,e,n)}removeState(t,e){super.removeState(t,e),this._textShape&&this._textShape.removeState(t,e),this._bgRect&&this._bgRect.removeState(t,e),this._symbol&&this._symbol.removeState(t,e)}cacheStates(){var t,e,n,i,r,s,a,o,l,c,u,h,d,f;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(r=null===(i=null===(n=this._bgRect)||void 0===n?void 0:n.currentStates)||void 0===i?void 0:i.slice())&&void 0!==r?r:[],this._symbolStates=null!==(o=null===(a=null===(s=this._symbol)||void 0===s?void 0:s.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(u=null===(c=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===c?void 0:c.slice())&&void 0!==u?u:[],this.clearStates(),null===(h=this._bgRect)||void 0===h||h.clearStates(),null===(d=this._symbol)||void 0===d||d.clearStates(),null===(f=this._textShape)||void 0===f||f.clearStates()}resetStates(){var t,e,n;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null===(t=this._bgRect)||void 0===t||t.useStates(this._rectStates)),this._symbolStates.length&&(null===(e=this._symbol)||void 0===e||e.useStates(this._symbolStates)),this._textStates.length&&(null===(n=this._textShape)||void 0===n||n.useStates(this._textStates))}};yu.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};tu(),ru(),uu(),nu();class vu extends El{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:Vt({},vu.defaultAttributes,t)),this._handlePointerUp=()=>{this.attribute.disabled||(this.attribute.checked?(this.setAttribute("checked",!1),this.setAttribute("indeterminate",!1)):(this.setAttribute("checked",!0),this.setAttribute("indeterminate",!1)),this._dispatchEvent("checkbox_state_change",{eventType:"checkbox_state_change",checked:this.attribute.checked}),this.stage.renderNextFrame())},this.renderGroup(),this.onBeforeAttributeUpdate=(t,e,n)=>{"interactive"in t&&this.setAttribute("pickable",t.interactive),"disabled"in t&&this.setAttribute("cursor",t.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("pointerup",this._handlePointerUp)}render(){this.removeAllChild(!0),this.renderBox(),this.renderIcon(),this.renderText(),this.layout()}renderBox(){this._box=new Xa(Vt({},this.attribute.box));const t=this.attribute.checked||this.attribute.indeterminate;t&&this.attribute.disabled?this._box.setAttributes({fill:this.attribute.box.disableCheckedFill,stroke:this.attribute.box.disableCheckedStroke}):t?this._box.setAttributes({fill:this.attribute.box.checkedFill,stroke:this.attribute.box.checkedStroke}):this.attribute.disabled&&this._box.setAttributes({fill:this.attribute.box.disableFill}),this.appendChild(this._box)}renderIcon(){this._checkIcon=new Ja(Vt({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new Ja(Vt({image:this.attribute.icon.indeterminateIconImage},this.attribute.icon)),this.appendChild(this._indeterminateIcon),this.attribute.checked?(this._checkIcon.setAttribute("visible",!0),this._indeterminateIcon.setAttribute("visible",!1)):this.attribute.indeterminate?(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!0)):(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!1))}renderText(){this._text=new Da(Vt({wrap:!0},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=this.attribute.box.height,e=this.attribute.icon.height,n=this._text.AABBBounds.height(),i=Math.max(t,e,n),r=i/2-t/2,s=i/2-e/2,a=i/2-n/2,o=this.attribute.box.width,l=this.attribute.icon.width,c=Math.max(o,l),u=c/2-o/2,h=c/2-l/2,d=c+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:u,y:r}),this._checkIcon.setAttributes({x:h,y:s}),this._indeterminateIcon.setAttributes({x:h,y:s}),this._text.setAttributes({x:d,y:a})}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:Vt({},vu.defaultAttributes,t),super.initAttributes(t),this.renderGroup(),this.render()}}vu.defaultAttributes={interactive:!0,disabled:!1,checked:!1,indeterminate:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},icon:{checkIconImage:'<svg width="200" height="200" viewBox="0 0 1024 1024" fill="#fff" xmlns="http://www.w3.org/2000/svg"><path d="M877.44815445 206.10060629a64.72691371 64.72691371 0 0 0-95.14856334 4.01306852L380.73381888 685.46812814 235.22771741 533.48933518a64.72691371 64.72691371 0 0 0-92.43003222-1.03563036l-45.82665557 45.82665443a64.72691371 64.72691371 0 0 0-0.90617629 90.61767965l239.61903446 250.10479331a64.72691371 64.72691371 0 0 0 71.19960405 15.14609778 64.33855261 64.33855261 0 0 0 35.08198741-21.23042702l36.24707186-42.71976334 40.5190474-40.77795556-3.36579926-3.49525333 411.40426297-486.74638962a64.72691371 64.72691371 0 0 0-3.88361443-87.64024149l-45.3088404-45.43829334z"></path></svg>',indeterminateIconImage:'<svg width="200" height="200" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5" d="M5 12h14"/></svg>',width:10,height:10,pickable:!1},box:{width:14,height:14,cornerRadius:2,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}},tu(),ru(),du(),nu();let xu=class t extends El{constructor(e,n){super((null==n?void 0:n.skipDefault)?e:Vt({},t.defaultAttributes,e)),this._handlePointerUp=()=>{this.attribute.disabled||this.attribute.checked||(this.setAttribute("checked",!0),this._dispatchEvent("radio_checked",{eventType:"radio_checked",target:this}),this.stage.renderNextFrame())},this.renderGroup(),this.onBeforeAttributeUpdate=(t,e,n)=>{"interactive"in t&&this.setAttribute("pickable",t.interactive),"disabled"in t&&this.setAttribute("cursor",t.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("pointerup",this._handlePointerUp)}render(){this.removeAllChild(!0),this.renderCircle(),this.renderText(),this.layout()}renderCircle(){this._circle=new lo(Vt({},this.attribute.circle));const t=this.attribute.checked;t&&this.attribute.disabled?this._circle.setAttributes({fill:this.attribute.circle.disableCheckedFill,stroke:this.attribute.circle.disableCheckedStroke}):t?this._circle.setAttributes({fill:this.attribute.circle.checkedFill,stroke:this.attribute.circle.checkedStroke}):this.attribute.disabled&&this._circle.setAttributes({fill:this.attribute.circle.disableFill}),this.appendChild(this._circle)}renderText(){this._text=new Da(Vt({},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=2*(this.attribute.circle.outerRadius+this.attribute.circle.lineWidth),e=this._text.AABBBounds.height(),n=Math.max(t,e),i=n/2-t/2+this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,r=n/2-e/2,s=2*(this.attribute.circle.outerRadius+this.attribute.circle.lineWidth),a=this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,o=s+this.attribute.spaceBetweenTextAndIcon;this._circle.setAttributes({x:a,y:i}),this._text.setAttributes({x:o,y:r})}initAttributes(e,n){e=(null==n?void 0:n.skipDefault)?e:Vt({},t.defaultAttributes,e),super.initAttributes(e),this.renderGroup(),this.render()}};xu.defaultAttributes={interactive:!0,disabled:!1,checked:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},circle:{outerRadius:7,innerRadius:3,startAngle:0,endAngle:2*Math.PI,lineWidth:1,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}};class _u extends Ml{removeElement(t){super.removeElement(t),delete this.htmlMap[t]}renderGraphicHTML(t){const{react:n}=t.attribute;if(!n)return;const i=t.stage;if(!i)return;const r=i.params.ReactDOM,{element:s}=n;let{container:a}=n;if(a&&(a=function(t){const n=function(t){for(;t&&t.parent;){if(t.name===e.CUSTOM_CONTAINER_NAME)return t;t=t.parent}return null}(t);if(!n)return null;const{col:i,row:r,stage:s}=n;let{container:a}=t.attribute.react;const{table:o}=s;a===o.bodyDomContainer&&i<o.frozenColCount&&r>=o.rowCount-o.bottomFrozenRowCount?a=o.bottomFrozenBodyDomContainer:a===o.bodyDomContainer&&i>=o.colCount-o.rightFrozenColCount&&r>=o.rowCount-o.bottomFrozenRowCount?a=o.rightFrozenBottomDomContainer:a===o.bodyDomContainer&&r>=o.rowCount-o.bottomFrozenRowCount?a=o.bottomFrozenBodyDomContainer:a===o.bodyDomContainer&&i<o.frozenColCount?a=o.frozenBodyDomContainer:a===o.bodyDomContainer&&i>=o.colCount-o.rightFrozenColCount?a=o.rightFrozenBodyDomContainer:a===o.headerDomContainer&&i<o.frozenColCount?a=o.frozenHeaderDomContainer:a===o.headerDomContainer&&i>=o.colCount-o.rightFrozenColCount&&(a=o.rightFrozenHeaderDomContainer);return a}(t)),!s||!r||!r.createRoot&&!r.render)return;const o=c(n.id)?`${t.id??t._uid}_react`:n.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])r.createRoot?this.htmlMap[o].root.render(s):r.render(s,this.htmlMap[o].wrapContainer);else{const{wrapContainer:e,nativeContainer:n}=this.getWrapContainer(i,a);if(e)if(this.htmlMap||(this.htmlMap={}),r.createRoot){const i=r.createRoot(e);i.render(s),this.htmlMap[o]={root:i,wrapContainer:e,nativeContainer:n,container:a,renderId:this.renderId,graphic:t}}else r.render(s,e),this.htmlMap[o]={wrapContainer:e,nativeContainer:n,container:a,renderId:this.renderId,unmount:()=>{r.unmountComponentAtNode(e)},graphic:t}}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:l,nativeContainer:u}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,i,l,u,n),this.htmlMap[o].renderId=this.renderId}getWrapContainer(t,e,n){let i;return i=e?"string"==typeof e?xt.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:xt.global.createDom({tagName:"div",parent:i,...n}),nativeContainer:i}}updateStyleOfWrapContainer(t,e,n,i,r){const{pointerEvents:s,penetrateEventList:a=[]}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none","none"!==o.pointerEvents&&(this.removeWrapContainerEventListener(n),a.forEach((t=>{"wheel"===t&&(n.addEventListener("wheel",this.onWheel),n.addEventListener("wheel",(t=>{t.preventDefault()}),!0))}))),n.style.position||(n.style.position="absolute");let u=0,d=0;const f=t.globalAABBBounds;let g=r.anchorType;if(c(g)&&(g="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===g&&(g="top-left"),"position"===g||f.empty()){const e=t.globalTransMatrix;u=e.e,d=e.f}else{const t=((t,e)=>{const{x1:n,x2:i,y1:r,y2:s}=t,a=Math.abs(i-n),o=Math.abs(s-r);let l=(n+i)/2,c=(r+s)/2,u=0,h=0;switch(e){case"top":case"inside-top":h=-.5;break;case"bottom":case"inside-bottom":h=.5;break;case"left":case"inside-left":u=-.5;break;case"right":case"inside-right":u=.5;break;case"top-right":u=.5,h=-.5;break;case"top-left":u=-.5,h=-.5;break;case"bottom-right":u=.5,h=.5;break;case"bottom-left":u=-.5,h=.5}return l+=u*a,c+=h*o,{x:l,y:c}})(f,g);u=t.x,d=t.y}const m=xt.global.getElementTopLeft(i,!1),b=e.window.getTopLeft(!1),y=u+b.left-m.left,v=d+b.top-m.top;if(o.left=`${y}px`,o.top=`${v}px`,"text"===t.type&&"position"===g&&(o={...o,...this.getTransformOfText(t)}),l(r.style)){const e=r.style({top:v,left:y,width:f.width(),height:f.height()},t,n);e&&(o={...o,...e})}else h(r.style)?o={...o,...r.style}:p(r.style)&&r.style&&(o={...o,...C(r.style)});xt.global.updateDom(n,{width:r.width,height:r.height,style:o,graphic:t})}drawHTML(){"browser"===xt?.global?.env&&(this.pluginService.stage.children.sort(((t,e)=>(t.attribute.zIndex??Hn.zIndex)-(e.attribute.zIndex??Hn.zIndex))).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}}const Su=new D(((t,e,n,i)=>{t(Au).toSelf().inSingletonScope(),n(bt)?i(bt).toService(Au):t(bt).toService(Au)}));class Au extends Kl{updateDom(t,n){const i=t.parentElement;if(i&&n.graphic){const r=parseInt(n.style.top,10),s=parseInt(n.style.left,10);let a,o;if(t.style.display="none"){const t=e.getTargetCell(n.graphic);a=t.attribute.width??1,o=t.attribute.height??1}else a=t.offsetWidth,o=t.offsetHeight;if(r+o<0||s+a<0||r>i.offsetHeight||s>i.offsetWidth)return t.style.display="none",!1}const{width:r,height:s,style:a}=n;return a&&(p(a)?t.setAttribute("style",a):Object.keys(a).forEach((e=>{t.style[e]=a[e]}))),null!=r&&(t.style.width=`${r}px`),null!=s&&(t.style.height=`${s}px`),!0}}hl()&&yt.load(Su);const wu=["children","hooks","ref",...R,"skipFunctionDiff","onError","onReady","option","records","container","vtableConstrouctor"],Tu=(t,e)=>`${t&&t.type&&(t.type.displayName||t.type.name)}-${e}`,Cu=n.forwardRef(((t,e)=>{const[r,s]=n.useState(0),a=n.useRef({});n.useImperativeHandle(e,(()=>a.current?.table));const o=!!t.option,l=!!t.records,u=n.useRef(!1),h=n.useRef(S(t,wu)),d=n.useRef(null),f=n.useRef(t.records),p=n.useRef(null),g=!!t.skipFunctionDiff,m=!!t.keepColumnWidthChange,b=n.useRef(new Map),y=n.useRef([]),v=n.useRef([]),x=n.useCallback((t=>o&&t.option?l&&t.records?{...t.option,clearDOM:!1,records:t.records}:{...t.option,clearDOM:!1}:{records:t.records,...h.current,...d.current,clearDOM:!1,customConfig:{...h.current.customConfig,createReactContainer:!0}}),[o,l]),_=n.useCallback((t=>{const e=new t.vtableConstrouctor(t.container,x(t));e.scenegraph.stage.reactAttribute=t.ReactDOM,e.scenegraph.stage.pluginService.register(t.reactAttributePlugin??new _u),e.scenegraph.stage.params.ReactDOM=t.ReactDOM,a.current={...a.current,table:e},u.current=!1,b.current.clear(),y.current=[],v.current=[],e.on("resize_column_end",(t=>{const n=a.current.table;if(!m)return;const{col:i,colWidths:r}=t,s=r[i];if(e.isPivotTable()){const t=n.getCellHeaderPaths(i,n.columnHeaderLevelCount);let e;e="rowHeader"===t.cellLocation?t.rowHeaderPaths:t.colHeaderPaths;let r=!1;y.current.forEach((t=>{JSON.stringify(t.dimensions)===JSON.stringify(e)&&(t.width=s,r=!0)})),r||y.current.push({dimensions:e,width:s})}else{const t=n.getBodyColumnDefine(i,0);t?.key&&b.current.set(t.key,s)}}))}),[x]),A=n.useCallback((()=>{if(!u.current){if(!a.current||!a.current.table)return;N(a.current.table,t,p.current,L),s(r+1),t.onReady&&t.onReady(a.current.table,0===r)}}),[r,s,t]),w=n.useCallback((()=>{a.current.table&&(a.current.table.render(),A())}),[A]);return n.useEffect((()=>{const e=o?null:(t=>{const e={};return E(t.children).map(((t,n)=>{const i=t&&t.type&&t.type.parseOption;if(i&&t.props){const r=i(c(t.props.componentId)?{...t.props,componentId:Tu(t,n)}:t.props);t.key&&(r.option.key=t.key),r.isSingle?e[r.optionName]=r.option:(e[r.optionName]||(e[r.optionName]=[]),e[r.optionName].push(r.option))}})),e})(t);if(!a.current?.table)return o||(d.current=e),_(t),w(),void(p.current=t);if(o){if(T(p.current.option,t.option,{skipFunction:g})){if(l&&!T(p.current.records,t.records,{skipFunction:g})){if(m){const t=ku(b.current,y.current,a.current.table);a.current.table.internalProps.columnWidthConfig=t,a.current.table.internalProps.columnWidthConfigForRowHeader=t}a.current.table.setRecords(t.records),A(),p.current=t}}else{const e=x(t);if(m){const t=ku(b.current,y.current,a.current.table);e.columnWidthConfig=t,e.columnWidthConfigForRowHeader=t}a.current.table.updateOption(e),A(),p.current=t}return}const n=S(t,wu);if(T(n,h.current,{skipFunction:g})&&T(e,d.current,{skipFunction:g})){if(l&&!T(t.records,f.current,{skipFunction:g})){if(f.current=t.records,m){const t=ku(b.current,y.current,a.current.table);a.current.table.internalProps.columnWidthConfig=t,a.current.table.internalProps.columnWidthConfigForRowHeader=t}a.current.table.setRecords(t.records),A(),p.current=t}}else{h.current=n,d.current=e;const i=x(t);if(m){const t=ku(b.current,y.current,a.current.table);i.columnWidthConfig=t,i.columnWidthConfigForRowHeader=t}a.current.table.updateOption(i),A(),p.current=t}}),[_,o,l,x,A,w,g,t]),n.useEffect((()=>()=>{a&&a.current&&a.current.table&&(a.current.table.release(),a.current=null),p.current=null,u.current=!0}),[]),n.createElement(i.Provider,{value:a.current},E(t.children).map(((t,e)=>{if("string"==typeof t)return;const i=Tu(t,e);return n.createElement(n.Fragment,{key:i},n.cloneElement(t,{updateId:r,componentId:i,componentIndex:e}))})))})),Bu=(t,e,i)=>{const r=function(t,e="TableContainer",i){const r=n.forwardRef(((e,r)=>{const s=n.useRef(),[a,o]=n.useState(!1),{className:l,style:c,width:u,...h}=e;return n.useLayoutEffect((()=>{o(!0)}),[]),n.createElement("div",{ref:s,className:l,style:{position:"relative",height:e.height||"100%",width:e.width||"100%",...c}},a?n.createElement(t,{ref:r,container:s.current,...i?i(h):h}):n.createElement(n.Fragment,null))}));return r.displayName=e||t.name,r}(Cu,t,(t=>e?Object.assign(t,e):t));return r.displayName=t,r};function ku(t,e,n){if(n.isPivotTable())return e;const i=[];return t.forEach(((t,e)=>{i.push({key:e,width:t})})),i}const Mu=Bu("ListTable",{type:"list-table",vtableConstrouctor:e.ListTable}),Pu=Bu("PivotTable",{type:"pivot-table",vtableConstrouctor:e.PivotTable}),Eu=Bu("PivotChart",{type:"pivot-chart",vtableConstrouctor:e.PivotChart});const Ou=Bu("ListTable",{type:"list-table",vtableConstrouctor:e.ListTableSimple}),Lu=Bu("PivotTable",{type:"pivot-table",vtableConstrouctor:e.PivotTableSimple});var Ru,Iu,Nu,Uu,Du={exports:{}},zu={exports:{}},Wu={};function Fu(){return Iu||(Iu=1,zu.exports=(Ru||(Ru=1,function(t){function e(t,e){var n=t.length;t.push(e);t:for(;0<n;){var i=n-1>>>1,s=t[i];if(!(0<r(s,e)))break t;t[i]=e,t[n]=s,n=i}}function n(t){return 0===t.length?null:t[0]}function i(t){if(0===t.length)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;t:for(var i=0,s=t.length,a=s>>>1;i<a;){var o=2*(i+1)-1,l=t[o],c=o+1,u=t[c];if(0>r(l,n))c<s&&0>r(u,l)?(t[i]=u,t[c]=n,i=c):(t[i]=l,t[o]=n,i=o);else{if(!(c<s&&0>r(u,n)))break t;t[i]=u,t[c]=n,i=c}}}return e}function r(t,e){var n=t.sortIndex-e.sortIndex;return 0!==n?n:t.id-e.id}if("object"==typeof performance&&"function"==typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],c=[],u=1,h=null,d=3,f=!1,p=!1,g=!1,m="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function v(t){for(var r=n(c);null!==r;){if(null===r.callback)i(c);else{if(!(r.startTime<=t))break;i(c),r.sortIndex=r.expirationTime,e(l,r)}r=n(c)}}function x(t){if(g=!1,v(t),!p)if(null!==n(l))p=!0,O(_);else{var e=n(c);null!==e&&L(x,e.startTime-t)}}function _(e,r){p=!1,g&&(g=!1,b(T),T=-1),f=!0;var s=d;try{for(v(r),h=n(l);null!==h&&(!(h.expirationTime>r)||e&&!k());){var a=h.callback;if("function"==typeof a){h.callback=null,d=h.priorityLevel;var o=a(h.expirationTime<=r);r=t.unstable_now(),"function"==typeof o?h.callback=o:h===n(l)&&i(l),v(r)}else i(l);h=n(l)}if(null!==h)var u=!0;else{var m=n(c);null!==m&&L(x,m.startTime-r),u=!1}return u}finally{h=null,d=s,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,A=!1,w=null,T=-1,C=5,B=-1;function k(){return!(t.unstable_now()-B<C)}function M(){if(null!==w){var e=t.unstable_now();B=e;var n=!0;try{n=w(!0,e)}finally{n?S():(A=!1,w=null)}}else A=!1}if("function"==typeof y)S=function(){y(M)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,E=P.port2;P.port1.onmessage=M,S=function(){E.postMessage(null)}}else S=function(){m(M,0)};function O(t){w=t,A||(A=!0,S())}function L(e,n){T=m((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(t){t.callback=null},t.unstable_continueExecution=function(){p||f||(p=!0,O(_))},t.unstable_forceFrameRate=function(t){0>t||125<t||(C=0<t?Math.floor(1e3/t):5)},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(t){switch(d){case 1:case 2:case 3:var e=3;break;default:e=d}var n=d;d=e;try{return t()}finally{d=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=d;d=t;try{return e()}finally{d=n}},t.unstable_scheduleCallback=function(i,r,s){var a=t.unstable_now();switch(s="object"==typeof s&&null!==s&&"number"==typeof(s=s.delay)&&0<s?a+s:a,i){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return i={id:u++,callback:r,priorityLevel:i,startTime:s,expirationTime:o=s+o,sortIndex:-1},s>a?(i.sortIndex=s,e(c,i),null===n(l)&&i===n(c)&&(g?(b(T),T=-1):g=!0,L(x,s-a))):(i.sortIndex=o,e(l,i),p||f||(p=!0,O(_))),i},t.unstable_shouldYield=k,t.unstable_wrapCallback=function(t){var e=d;return function(){var n=d;d=e;try{return t.apply(this,arguments)}finally{d=n}}}}(Wu)),Wu)),zu.exports}
2
2
  /**
3
3
  * @license React
4
4
  * react-reconciler.production.min.js
@@ -7,4 +7,4 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */Uu.exports=(Du||(Du=1,Nu=function(t){var e={},i=n,r=Fu(),s=Object.assign;function a(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=Symbol.for("react.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),_=Symbol.iterator;function S(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=_&&t[_]||t["@@iterator"])?t:null}function A(t){if(null==t)return null;if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case u:return"Fragment";case c:return"Portal";case d:return"Profiler";case h:return"StrictMode";case m:return"Suspense";case b:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case p:return(t.displayName||"Context")+".Consumer";case f:return(t._context.displayName||"Context")+".Provider";case g:var e=t.render;return(t=t.displayName)||(t=""!==(t=e.displayName||e.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case y:return null!==(e=t.displayName||null)?e:A(t.type)||"Memo";case v:e=t._payload,t=t._init;try{return A(t(e))}catch(t){}}return null}function w(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=(t=e.render).displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return A(e);case 8:return e===h?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e}return null}function T(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do{0!=(4098&(e=t).flags)&&(n=e.return),t=e.return}while(t)}return 3===e.tag?n:null}function C(t){if(T(t)!==t)throw Error(a(188))}function B(t){var e=t.alternate;if(!e){if(null===(e=T(t)))throw Error(a(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(null===r)break;var s=r.alternate;if(null===s){if(null!==(i=r.return)){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return C(r),t;if(s===i)return C(r),e;s=s.sibling}throw Error(a(188))}if(n.return!==i.return)n=r,i=s;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,i=s;break}if(l===i){o=!0,i=r,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,i=r;break}if(l===i){o=!0,i=s,n=r;break}l=l.sibling}if(!o)throw Error(a(189))}}if(n.alternate!==i)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?t:e}function k(t){return null!==(t=B(t))?M(t):null}function M(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){var e=M(t);if(null!==e)return e;t=t.sibling}return null}function P(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){if(4!==t.tag){var e=P(t);if(null!==e)return e}t=t.sibling}return null}var E,O=Array.isArray,L=t.getPublicInstance,R=t.getRootHostContext,I=t.getChildHostContext,N=t.prepareForCommit,D=t.resetAfterCommit,U=t.createInstance,z=t.appendInitialChild,W=t.finalizeInitialChildren,F=t.prepareUpdate,j=t.shouldSetTextContent,H=t.createTextInstance,G=t.scheduleTimeout,V=t.cancelTimeout,$=t.noTimeout,X=t.isPrimaryRenderer,Y=t.supportsMutation,K=t.supportsPersistence,q=t.supportsHydration,Q=t.getInstanceFromNode,Z=t.preparePortalMount,J=t.getCurrentEventPriority,tt=t.detachDeletedInstance,et=t.supportsMicrotasks,nt=t.scheduleMicrotask,it=t.supportsTestSelectors,rt=t.findFiberRoot,st=t.getBoundingRect,at=t.getTextContent,ot=t.isHiddenSubtree,lt=t.matchAccessibilityRole,ct=t.setFocusIfFocusable,ut=t.setupIntersectionObserver,ht=t.appendChild,dt=t.appendChildToContainer,ft=t.commitTextUpdate,pt=t.commitMount,gt=t.commitUpdate,mt=t.insertBefore,bt=t.insertInContainerBefore,yt=t.removeChild,vt=t.removeChildFromContainer,xt=t.resetTextContent,_t=t.hideInstance,St=t.hideTextInstance,At=t.unhideInstance,wt=t.unhideTextInstance,Tt=t.clearContainer,Ct=t.cloneInstance,Bt=t.createContainerChildSet,kt=t.appendChildToContainerChildSet,Mt=t.finalizeContainerChildren,Pt=t.replaceContainerChildren,Et=t.cloneHiddenInstance,Ot=t.cloneHiddenTextInstance,Lt=t.canHydrateInstance,Rt=t.canHydrateTextInstance,It=t.canHydrateSuspenseInstance,Nt=t.isSuspenseInstancePending,Dt=t.isSuspenseInstanceFallback,Ut=t.getSuspenseInstanceFallbackErrorDetails,zt=t.registerSuspenseInstanceRetry,Wt=t.getNextHydratableSibling,Ft=t.getFirstHydratableChild,jt=t.getFirstHydratableChildWithinContainer,Ht=t.getFirstHydratableChildWithinSuspenseInstance,Gt=t.hydrateInstance,Vt=t.hydrateTextInstance,$t=t.hydrateSuspenseInstance,Xt=t.getNextHydratableInstanceAfterSuspenseInstance,Yt=t.commitHydratedContainer,Kt=t.commitHydratedSuspenseInstance,qt=t.clearSuspenseBoundary,Qt=t.clearSuspenseBoundaryFromContainer,Zt=t.shouldDeleteUnhydratedTailInstances,Jt=t.didNotMatchHydratedContainerTextInstance,te=t.didNotMatchHydratedTextInstance;function ee(t){if(void 0===E)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);E=e&&e[1]||""}return"\n"+E+t}var ne=!1;function ie(t,e){if(!t||ne)return"";ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(e,[])}catch(t){var i=t}Reflect.construct(t,[],e)}else{try{e.call()}catch(t){i=t}t.call(e.prototype)}else{try{throw Error()}catch(t){i=t}t()}}catch(e){if(e&&i&&"string"==typeof e.stack){for(var r=e.stack.split("\n"),s=i.stack.split("\n"),a=r.length-1,o=s.length-1;1<=a&&0<=o&&r[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(r[a]!==s[o]){if(1!==a||1!==o)do{if(a--,0>--o||r[a]!==s[o]){var l="\n"+r[a].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}}while(1<=a&&0<=o);break}}}finally{ne=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ee(t):""}var re=Object.prototype.hasOwnProperty,se=[],ae=-1;function oe(t){return{current:t}}function le(t){0>ae||(t.current=se[ae],se[ae]=null,ae--)}function ce(t,e){ae++,se[ae]=t.current,t.current=e}var ue={},he=oe(ue),de=oe(!1),fe=ue;function pe(t,e){var n=t.type.contextTypes;if(!n)return ue;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r,s={};for(r in n)s[r]=e[r];return i&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function ge(t){return null!=t.childContextTypes}function me(){le(de),le(he)}function be(t,e,n){if(he.current!==ue)throw Error(a(168));ce(he,e),ce(de,n)}function ye(t,e,n){var i=t.stateNode;if(e=e.childContextTypes,"function"!=typeof i.getChildContext)return n;for(var r in i=i.getChildContext())if(!(r in e))throw Error(a(108,w(t)||"Unknown",r));return s({},n,i)}function ve(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ue,fe=he.current,ce(he,t),ce(de,de.current),!0}function xe(t,e,n){var i=t.stateNode;if(!i)throw Error(a(169));n?(t=ye(t,e,fe),i.__reactInternalMemoizedMergedChildContext=t,le(de),le(he),ce(he,t)):le(de),ce(de,n)}var _e=Math.clz32?Math.clz32:function(t){return 0==(t>>>=0)?32:31-(Se(t)/Ae|0)|0},Se=Math.log,Ae=Math.LN2,we=64,Te=4194304;function Ce(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&t;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&t;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Be(t,e){var n=t.pendingLanes;if(0===n)return 0;var i=0,r=t.suspendedLanes,s=t.pingedLanes,a=268435455&n;if(0!==a){var o=a&~r;0!==o?i=Ce(o):0!=(s&=a)&&(i=Ce(s))}else 0!=(a=n&~r)?i=Ce(a):0!==s&&(i=Ce(s));if(0===i)return 0;if(0!==e&&e!==i&&0==(e&r)&&((r=i&-i)>=(s=e&-e)||16===r&&0!=(4194240&s)))return e;if(0!=(4&i)&&(i|=16&n),0!==(e=t.entangledLanes))for(t=t.entanglements,e&=i;0<e;)r=1<<(n=31-_e(e)),i|=t[n],e&=~r;return i}function ke(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;default:return-1}}function Me(t){return 0!=(t=-1073741825&t.pendingLanes)?t:1073741824&t?1073741824:0}function Pe(){var t=we;return 0==(4194240&(we<<=1))&&(we=64),t}function Ee(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Oe(t,e,n){t.pendingLanes|=e,536870912!==e&&(t.suspendedLanes=0,t.pingedLanes=0),(t=t.eventTimes)[e=31-_e(e)]=n}function Le(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-_e(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}var Re=0;function Ie(t){return 1<(t&=-t)?4<t?0!=(268435455&t)?16:536870912:4:1}var Ne=r.unstable_scheduleCallback,De=r.unstable_cancelCallback,Ue=r.unstable_shouldYield,ze=r.unstable_requestPaint,We=r.unstable_now,Fe=r.unstable_ImmediatePriority,je=r.unstable_UserBlockingPriority,He=r.unstable_NormalPriority,Ge=r.unstable_IdlePriority,Ve=null,$e=null,Xe="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},Ye=null,Ke=!1,qe=!1;function Qe(t){null===Ye?Ye=[t]:Ye.push(t)}function Ze(){if(!qe&&null!==Ye){qe=!0;var t=0,e=Re;try{var n=Ye;for(Re=1;t<n.length;t++){var i=n[t];do{i=i(!0)}while(null!==i)}Ye=null,Ke=!1}catch(e){throw null!==Ye&&(Ye=Ye.slice(t+1)),Ne(Fe,Ze),e}finally{Re=e,qe=!1}}return null}var Je=[],tn=0,en=null,nn=0,rn=[],sn=0,an=null,on=1,ln="";function cn(t,e){Je[tn++]=nn,Je[tn++]=en,en=t,nn=e}function un(t,e,n){rn[sn++]=on,rn[sn++]=ln,rn[sn++]=an,an=t;var i=on;t=ln;var r=32-_e(i)-1;i&=~(1<<r),n+=1;var s=32-_e(e)+r;if(30<s){var a=r-r%5;s=(i&(1<<a)-1).toString(32),i>>=a,r-=a,on=1<<32-_e(e)+r|n<<r|i,ln=s+t}else on=1<<s|n<<r|i,ln=t}function hn(t){null!==t.return&&(cn(t,1),un(t,1,0))}function dn(t){for(;t===en;)en=Je[--tn],Je[tn]=null,nn=Je[--tn],Je[tn]=null;for(;t===an;)an=rn[--sn],rn[sn]=null,ln=rn[--sn],rn[sn]=null,on=rn[--sn],rn[sn]=null}var fn=null,pn=null,gn=!1,mn=!1,bn=null;function yn(t,e){var n=ro(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,null===(e=t.deletions)?(t.deletions=[n],t.flags|=16):e.push(n)}function vn(t,e){switch(t.tag){case 5:return null!==(e=Lt(e,t.type,t.pendingProps))&&(t.stateNode=e,fn=t,pn=Ft(e),!0);case 6:return null!==(e=Rt(e,t.pendingProps))&&(t.stateNode=e,fn=t,pn=null,!0);case 13:if(null!==(e=It(e))){var n=null!==an?{id:on,overflow:ln}:null;return t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},(n=ro(18,null,null,0)).stateNode=e,n.return=t,t.child=n,fn=t,pn=null,!0}return!1;default:return!1}}function xn(t){return 0!=(1&t.mode)&&0==(128&t.flags)}function _n(t){if(gn){var e=pn;if(e){var n=e;if(!vn(t,e)){if(xn(t))throw Error(a(418));e=Wt(n);var i=fn;e&&vn(t,e)?yn(i,n):(t.flags=-4097&t.flags|2,gn=!1,fn=t)}}else{if(xn(t))throw Error(a(418));t.flags=-4097&t.flags|2,gn=!1,fn=t}}}function Sn(t){for(t=t.return;null!==t&&5!==t.tag&&3!==t.tag&&13!==t.tag;)t=t.return;fn=t}function An(t){if(!q||t!==fn)return!1;if(!gn)return Sn(t),gn=!0,!1;if(3!==t.tag&&(5!==t.tag||Zt(t.type)&&!j(t.type,t.memoizedProps))){var e=pn;if(e){if(xn(t))throw wn(),Error(a(418));for(;e;)yn(t,e),e=Wt(e)}}if(Sn(t),13===t.tag){if(!q)throw Error(a(316));if(!(t=null!==(t=t.memoizedState)?t.dehydrated:null))throw Error(a(317));pn=Xt(t)}else pn=fn?Wt(t.stateNode):null;return!0}function wn(){for(var t=pn;t;)t=Wt(t)}function Tn(){q&&(pn=fn=null,mn=gn=!1)}function Cn(t){null===bn?bn=[t]:bn.push(t)}var Bn=o.ReactCurrentBatchConfig;function kn(t,e){if(Xe(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!re.call(e,r)||!Xe(t[r],e[r]))return!1}return!0}function Mn(t){switch(t.tag){case 5:return ee(t.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return ie(t.type,!1);case 11:return ie(t.type.render,!1);case 1:return ie(t.type,!0);default:return""}}function Pn(t,e,n){if(null!==(t=n.ref)&&"function"!=typeof t&&"object"!=typeof t){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var i=n.stateNode}if(!i)throw Error(a(147,t));var r=i,s=""+t;return null!==e&&null!==e.ref&&"function"==typeof e.ref&&e.ref._stringRef===s?e.ref:(e=function(t){var e=r.refs;null===t?delete e[s]:e[s]=t},e._stringRef=s,e)}if("string"!=typeof t)throw Error(a(284));if(!n._owner)throw Error(a(290,t))}return t}function En(t,e){throw t=Object.prototype.toString.call(e),Error(a(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function On(t){return(0,t._init)(t._payload)}function Ln(t){function e(e,n){if(t){var i=e.deletions;null===i?(e.deletions=[n],e.flags|=16):i.push(n)}}function n(n,i){if(!t)return null;for(;null!==i;)e(n,i),i=i.sibling;return null}function i(t,e){for(t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function r(t,e){return(t=ao(t,e)).index=0,t.sibling=null,t}function s(e,n,i){return e.index=i,t?null!==(i=e.alternate)?(i=i.index)<n?(e.flags|=2,n):i:(e.flags|=2,n):(e.flags|=1048576,n)}function o(e){return t&&null===e.alternate&&(e.flags|=2),e}function h(t,e,n,i){return null===e||6!==e.tag?((e=uo(n,t.mode,i)).return=t,e):((e=r(e,n)).return=t,e)}function d(t,e,n,i){var s=n.type;return s===u?p(t,e,n.props.children,i,n.key):null!==e&&(e.elementType===s||"object"==typeof s&&null!==s&&s.$$typeof===v&&On(s)===e.type)?((i=r(e,n.props)).ref=Pn(t,e,n),i.return=t,i):((i=oo(n.type,n.key,n.props,null,t.mode,i)).ref=Pn(t,e,n),i.return=t,i)}function f(t,e,n,i){return null===e||4!==e.tag||e.stateNode.containerInfo!==n.containerInfo||e.stateNode.implementation!==n.implementation?((e=ho(n,t.mode,i)).return=t,e):((e=r(e,n.children||[])).return=t,e)}function p(t,e,n,i,s){return null===e||7!==e.tag?((e=lo(n,t.mode,i,s)).return=t,e):((e=r(e,n)).return=t,e)}function g(t,e,n){if("string"==typeof e&&""!==e||"number"==typeof e)return(e=uo(""+e,t.mode,n)).return=t,e;if("object"==typeof e&&null!==e){switch(e.$$typeof){case l:return(n=oo(e.type,e.key,e.props,null,t.mode,n)).ref=Pn(t,null,e),n.return=t,n;case c:return(e=ho(e,t.mode,n)).return=t,e;case v:return g(t,(0,e._init)(e._payload),n)}if(O(e)||S(e))return(e=lo(e,t.mode,n,null)).return=t,e;En(t,e)}return null}function m(t,e,n,i){var r=null!==e?e.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==r?null:h(t,e,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case l:return n.key===r?d(t,e,n,i):null;case c:return n.key===r?f(t,e,n,i):null;case v:return m(t,e,(r=n._init)(n._payload),i)}if(O(n)||S(n))return null!==r?null:p(t,e,n,i,null);En(t,n)}return null}function b(t,e,n,i,r){if("string"==typeof i&&""!==i||"number"==typeof i)return h(e,t=t.get(n)||null,""+i,r);if("object"==typeof i&&null!==i){switch(i.$$typeof){case l:return d(e,t=t.get(null===i.key?n:i.key)||null,i,r);case c:return f(e,t=t.get(null===i.key?n:i.key)||null,i,r);case v:return b(t,e,n,(0,i._init)(i._payload),r)}if(O(i)||S(i))return p(e,t=t.get(n)||null,i,r,null);En(e,i)}return null}function y(r,a,o,l){for(var c=null,u=null,h=a,d=a=0,f=null;null!==h&&d<o.length;d++){h.index>d?(f=h,h=null):f=h.sibling;var p=m(r,h,o[d],l);if(null===p){null===h&&(h=f);break}t&&h&&null===p.alternate&&e(r,h),a=s(p,a,d),null===u?c=p:u.sibling=p,u=p,h=f}if(d===o.length)return n(r,h),gn&&cn(r,d),c;if(null===h){for(;d<o.length;d++)null!==(h=g(r,o[d],l))&&(a=s(h,a,d),null===u?c=h:u.sibling=h,u=h);return gn&&cn(r,d),c}for(h=i(r,h);d<o.length;d++)null!==(f=b(h,r,d,o[d],l))&&(t&&null!==f.alternate&&h.delete(null===f.key?d:f.key),a=s(f,a,d),null===u?c=f:u.sibling=f,u=f);return t&&h.forEach((function(t){return e(r,t)})),gn&&cn(r,d),c}function x(r,o,l,c){var u=S(l);if("function"!=typeof u)throw Error(a(150));if(null==(l=u.call(l)))throw Error(a(151));for(var h=u=null,d=o,f=o=0,p=null,y=l.next();null!==d&&!y.done;f++,y=l.next()){d.index>f?(p=d,d=null):p=d.sibling;var v=m(r,d,y.value,c);if(null===v){null===d&&(d=p);break}t&&d&&null===v.alternate&&e(r,d),o=s(v,o,f),null===h?u=v:h.sibling=v,h=v,d=p}if(y.done)return n(r,d),gn&&cn(r,f),u;if(null===d){for(;!y.done;f++,y=l.next())null!==(y=g(r,y.value,c))&&(o=s(y,o,f),null===h?u=y:h.sibling=y,h=y);return gn&&cn(r,f),u}for(d=i(r,d);!y.done;f++,y=l.next())null!==(y=b(d,r,f,y.value,c))&&(t&&null!==y.alternate&&d.delete(null===y.key?f:y.key),o=s(y,o,f),null===h?u=y:h.sibling=y,h=y);return t&&d.forEach((function(t){return e(r,t)})),gn&&cn(r,f),u}return function t(i,s,a,h){if("object"==typeof a&&null!==a&&a.type===u&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case l:t:{for(var d=a.key,f=s;null!==f;){if(f.key===d){if((d=a.type)===u){if(7===f.tag){n(i,f.sibling),(s=r(f,a.props.children)).return=i,i=s;break t}}else if(f.elementType===d||"object"==typeof d&&null!==d&&d.$$typeof===v&&On(d)===f.type){n(i,f.sibling),(s=r(f,a.props)).ref=Pn(i,f,a),s.return=i,i=s;break t}n(i,f);break}e(i,f),f=f.sibling}a.type===u?((s=lo(a.props.children,i.mode,h,a.key)).return=i,i=s):((h=oo(a.type,a.key,a.props,null,i.mode,h)).ref=Pn(i,s,a),h.return=i,i=h)}return o(i);case c:t:{for(f=a.key;null!==s;){if(s.key===f){if(4===s.tag&&s.stateNode.containerInfo===a.containerInfo&&s.stateNode.implementation===a.implementation){n(i,s.sibling),(s=r(s,a.children||[])).return=i,i=s;break t}n(i,s);break}e(i,s),s=s.sibling}(s=ho(a,i.mode,h)).return=i,i=s}return o(i);case v:return t(i,s,(f=a._init)(a._payload),h)}if(O(a))return y(i,s,a,h);if(S(a))return x(i,s,a,h);En(i,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==s&&6===s.tag?(n(i,s.sibling),(s=r(s,a)).return=i,i=s):(n(i,s),(s=uo(a,i.mode,h)).return=i,i=s),o(i)):n(i,s)}}var Rn=Ln(!0),In=Ln(!1),Nn=oe(null),Dn=null,Un=null,zn=null;function Wn(){zn=Un=Dn=null}function Fn(t,e,n){X?(ce(Nn,e._currentValue),e._currentValue=n):(ce(Nn,e._currentValue2),e._currentValue2=n)}function jn(t){var e=Nn.current;le(Nn),X?t._currentValue=e:t._currentValue2=e}function Hn(t,e,n){for(;null!==t;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,null!==i&&(i.childLanes|=e)):null!==i&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function Gn(t,e){Dn=t,zn=Un=null,null!==(t=t.dependencies)&&null!==t.firstContext&&(0!=(t.lanes&e)&&(Or=!0),t.firstContext=null)}function Vn(t){var e=X?t._currentValue:t._currentValue2;if(zn!==t)if(t={context:t,memoizedValue:e,next:null},null===Un){if(null===Dn)throw Error(a(308));Un=t,Dn.dependencies={lanes:0,firstContext:t}}else Un=Un.next=t;return e}var $n=null;function Xn(t){null===$n?$n=[t]:$n.push(t)}function Yn(t,e,n,i){var r=e.interleaved;return null===r?(n.next=n,Xn(e)):(n.next=r.next,r.next=n),e.interleaved=n,Kn(t,i)}function Kn(t,e){t.lanes|=e;var n=t.alternate;for(null!==n&&(n.lanes|=e),n=t,t=t.return;null!==t;)t.childLanes|=e,null!==(n=t.alternate)&&(n.childLanes|=e),n=t,t=t.return;return 3===n.tag?n.stateNode:null}var qn=!1;function Qn(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zn(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Jn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ti(t,e,n){var i=t.updateQueue;if(null===i)return null;if(i=i.shared,0!=(2&ta)){var r=i.pending;return null===r?e.next=e:(e.next=r.next,r.next=e),i.pending=e,Kn(t,n)}return null===(r=i.interleaved)?(e.next=e,Xn(i)):(e.next=r.next,r.next=e),i.interleaved=e,Kn(t,n)}function ei(t,e,n){if(null!==(e=e.updateQueue)&&(e=e.shared,0!=(4194240&n))){var i=e.lanes;n|=i&=t.pendingLanes,e.lanes=n,Le(t,n)}}function ni(t,e){var n=t.updateQueue,i=t.alternate;if(null!==i&&n===(i=i.updateQueue)){var r=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===s?r=s=a:s=s.next=a,n=n.next}while(null!==n);null===s?r=s=e:s=s.next=e}else r=s=e;return n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},void(t.updateQueue=n)}null===(t=n.lastBaseUpdate)?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function ii(t,e,n,i){var r=t.updateQueue;qn=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(null!==l){r.shared.pending=null;var c=l,u=c.next;c.next=null,null===o?a=u:o.next=u,o=c;var h=t.alternate;null!==h&&(l=(h=h.updateQueue).lastBaseUpdate)!==o&&(null===l?h.firstBaseUpdate=u:l.next=u,h.lastBaseUpdate=c)}if(null!==a){var d=r.baseState;for(o=0,h=u=c=null,l=a;;){var f=l.lane,p=l.eventTime;if((i&f)===f){null!==h&&(h=h.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});t:{var g=t,m=l;switch(f=e,p=n,m.tag){case 1:if("function"==typeof(g=m.payload)){d=g.call(p,d,f);break t}d=g;break t;case 3:g.flags=-65537&g.flags|128;case 0:if(null==(f="function"==typeof(g=m.payload)?g.call(p,d,f):g))break t;d=s({},d,f);break t;case 2:qn=!0}}null!==l.callback&&0!==l.lane&&(t.flags|=64,null===(f=r.effects)?r.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===h?(u=h=p,c=d):h=h.next=p,o|=f;if(null===(l=l.next)){if(null===(l=r.shared.pending))break;l=(f=l).next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}if(null===h&&(c=d),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=h,null!==(e=r.shared.interleaved)){r=e;do{o|=r.lane,r=r.next}while(r!==e)}else null===a&&(r.shared.lanes=0);la|=o,t.lanes=o,t.memoizedState=d}}function ri(t,e,n){if(t=e.effects,e.effects=null,null!==t)for(e=0;e<t.length;e++){var i=t[e],r=i.callback;if(null!==r){if(i.callback=null,i=n,"function"!=typeof r)throw Error(a(191,r));r.call(i)}}}var si={},ai=oe(si),oi=oe(si),li=oe(si);function ci(t){if(t===si)throw Error(a(174));return t}function ui(t,e){ce(li,e),ce(oi,t),ce(ai,si),t=R(e),le(ai),ce(ai,t)}function hi(){le(ai),le(oi),le(li)}function di(t){var e=ci(li.current),n=ci(ai.current);n!==(e=I(n,t.type,e))&&(ce(oi,t),ce(ai,e))}function fi(t){oi.current===t&&(le(ai),le(oi))}var pi=oe(0);function gi(t){for(var e=t;null!==e;){if(13===e.tag){var n=e.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Nt(n)||Dt(n)))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!=(128&e.flags))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var mi=[];function bi(){for(var t=0;t<mi.length;t++){var e=mi[t];X?e._workInProgressVersionPrimary=null:e._workInProgressVersionSecondary=null}mi.length=0}var yi=o.ReactCurrentDispatcher,vi=o.ReactCurrentBatchConfig,xi=0,_i=null,Si=null,Ai=null,wi=!1,Ti=!1,Ci=0,Bi=0;function ki(){throw Error(a(321))}function Mi(t,e){if(null===e)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Xe(t[n],e[n]))return!1;return!0}function Pi(t,e,n,i,r,s){if(xi=s,_i=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,yi.current=null===t||null===t.memoizedState?fr:pr,t=n(i,r),Ti){s=0;do{if(Ti=!1,Ci=0,25<=s)throw Error(a(301));s+=1,Ai=Si=null,e.updateQueue=null,yi.current=gr,t=n(i,r)}while(Ti)}if(yi.current=dr,e=null!==Si&&null!==Si.next,xi=0,Ai=Si=_i=null,wi=!1,e)throw Error(a(300));return t}function Ei(){var t=0!==Ci;return Ci=0,t}function Oi(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ai?_i.memoizedState=Ai=t:Ai=Ai.next=t,Ai}function Li(){if(null===Si){var t=_i.alternate;t=null!==t?t.memoizedState:null}else t=Si.next;var e=null===Ai?_i.memoizedState:Ai.next;if(null!==e)Ai=e,Si=t;else{if(null===t)throw Error(a(310));t={memoizedState:(Si=t).memoizedState,baseState:Si.baseState,baseQueue:Si.baseQueue,queue:Si.queue,next:null},null===Ai?_i.memoizedState=Ai=t:Ai=Ai.next=t}return Ai}function Ri(t,e){return"function"==typeof e?e(t):e}function Ii(t){var e=Li(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var i=Si,r=i.baseQueue,s=n.pending;if(null!==s){if(null!==r){var o=r.next;r.next=s.next,s.next=o}i.baseQueue=r=s,n.pending=null}if(null!==r){s=r.next,i=i.baseState;var l=o=null,c=null,u=s;do{var h=u.lane;if((xi&h)===h)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:t(i,u.action);else{var d={lane:h,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=d,o=i):c=c.next=d,_i.lanes|=h,la|=h}u=u.next}while(null!==u&&u!==s);null===c?o=i:c.next=l,Xe(i,e.memoizedState)||(Or=!0),e.memoizedState=i,e.baseState=o,e.baseQueue=c,n.lastRenderedState=i}if(null!==(t=n.interleaved)){r=t;do{s=r.lane,_i.lanes|=s,la|=s,r=r.next}while(r!==t)}else null===r&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Ni(t){var e=Li(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(null!==r){n.pending=null;var o=r=r.next;do{s=t(s,o.action),o=o.next}while(o!==r);Xe(s,e.memoizedState)||(Or=!0),e.memoizedState=s,null===e.baseQueue&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function Di(){}function Ui(t,e){var n=_i,i=Li(),r=e(),s=!Xe(i.memoizedState,r);if(s&&(i.memoizedState=r,Or=!0),i=i.queue,qi(Fi.bind(null,n,i,t),[t]),i.getSnapshot!==e||s||null!==Ai&&1&Ai.memoizedState.tag){if(n.flags|=2048,Vi(9,Wi.bind(null,n,i,r,e),void 0,null),null===ea)throw Error(a(349));0!=(30&xi)||zi(n,e,r)}return r}function zi(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},null===(e=_i.updateQueue)?(e={lastEffect:null,stores:null},_i.updateQueue=e,e.stores=[t]):null===(n=e.stores)?e.stores=[t]:n.push(t)}function Wi(t,e,n,i){e.value=n,e.getSnapshot=i,ji(e)&&Hi(t)}function Fi(t,e,n){return n((function(){ji(e)&&Hi(t)}))}function ji(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Xe(t,n)}catch(t){return!0}}function Hi(t){var e=Kn(t,1);null!==e&&Pa(e,t,1,-1)}function Gi(t){var e=Oi();return"function"==typeof t&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:t},e.queue=t,t=t.dispatch=lr.bind(null,_i,t),[e.memoizedState,t]}function Vi(t,e,n,i){return t={tag:t,create:e,destroy:n,deps:i,next:null},null===(e=_i.updateQueue)?(e={lastEffect:null,stores:null},_i.updateQueue=e,e.lastEffect=t.next=t):null===(n=e.lastEffect)?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function $i(){return Li().memoizedState}function Xi(t,e,n,i){var r=Oi();_i.flags|=t,r.memoizedState=Vi(1|e,n,void 0,void 0===i?null:i)}function Yi(t,e,n,i){var r=Li();i=void 0===i?null:i;var s=void 0;if(null!==Si){var a=Si.memoizedState;if(s=a.destroy,null!==i&&Mi(i,a.deps))return void(r.memoizedState=Vi(e,n,s,i))}_i.flags|=t,r.memoizedState=Vi(1|e,n,s,i)}function Ki(t,e){return Xi(8390656,8,t,e)}function qi(t,e){return Yi(2048,8,t,e)}function Qi(t,e){return Yi(4,2,t,e)}function Zi(t,e){return Yi(4,4,t,e)}function Ji(t,e){return"function"==typeof e?(t=t(),e(t),function(){e(null)}):null!=e?(t=t(),e.current=t,function(){e.current=null}):void 0}function tr(t,e,n){return n=null!=n?n.concat([t]):null,Yi(4,4,Ji.bind(null,e,t),n)}function er(){}function nr(t,e){var n=Li();e=void 0===e?null:e;var i=n.memoizedState;return null!==i&&null!==e&&Mi(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function ir(t,e){var n=Li();e=void 0===e?null:e;var i=n.memoizedState;return null!==i&&null!==e&&Mi(e,i[1])?i[0]:(t=t(),n.memoizedState=[t,e],t)}function rr(t,e,n){return 0==(21&xi)?(t.baseState&&(t.baseState=!1,Or=!0),t.memoizedState=n):(Xe(n,e)||(n=Pe(),_i.lanes|=n,la|=n,t.baseState=!0),e)}function sr(t,e){var n=Re;Re=0!==n&&4>n?n:4,t(!0);var i=vi.transition;vi.transition={};try{t(!1),e()}finally{Re=n,vi.transition=i}}function ar(){return Li().memoizedState}function or(t,e,n){var i=Ma(t);n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},cr(t)?ur(e,n):null!==(n=Yn(t,e,n,i))&&(Pa(n,t,i,ka()),hr(n,e,i))}function lr(t,e,n){var i=Ma(t),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(cr(t))ur(e,r);else{var s=t.alternate;if(0===t.lanes&&(null===s||0===s.lanes)&&null!==(s=e.lastRenderedReducer))try{var a=e.lastRenderedState,o=s(a,n);if(r.hasEagerState=!0,r.eagerState=o,Xe(o,a)){var l=e.interleaved;return null===l?(r.next=r,Xn(e)):(r.next=l.next,l.next=r),void(e.interleaved=r)}}catch(t){}null!==(n=Yn(t,e,r,i))&&(Pa(n,t,i,r=ka()),hr(n,e,i))}}function cr(t){var e=t.alternate;return t===_i||null!==e&&e===_i}function ur(t,e){Ti=wi=!0;var n=t.pending;null===n?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function hr(t,e,n){if(0!=(4194240&n)){var i=e.lanes;n|=i&=t.pendingLanes,e.lanes=n,Le(t,n)}}var dr={readContext:Vn,useCallback:ki,useContext:ki,useEffect:ki,useImperativeHandle:ki,useInsertionEffect:ki,useLayoutEffect:ki,useMemo:ki,useReducer:ki,useRef:ki,useState:ki,useDebugValue:ki,useDeferredValue:ki,useTransition:ki,useMutableSource:ki,useSyncExternalStore:ki,useId:ki,unstable_isNewReconciler:!1},fr={readContext:Vn,useCallback:function(t,e){return Oi().memoizedState=[t,void 0===e?null:e],t},useContext:Vn,useEffect:Ki,useImperativeHandle:function(t,e,n){return n=null!=n?n.concat([t]):null,Xi(4194308,4,Ji.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Xi(4194308,4,t,e)},useInsertionEffect:function(t,e){return Xi(4,2,t,e)},useMemo:function(t,e){var n=Oi();return e=void 0===e?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var i=Oi();return e=void 0!==n?n(e):e,i.memoizedState=i.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},i.queue=t,t=t.dispatch=or.bind(null,_i,t),[i.memoizedState,t]},useRef:function(t){return t={current:t},Oi().memoizedState=t},useState:Gi,useDebugValue:er,useDeferredValue:function(t){return Oi().memoizedState=t},useTransition:function(){var t=Gi(!1),e=t[0];return t=sr.bind(null,t[1]),Oi().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var i=_i,r=Oi();if(gn){if(void 0===n)throw Error(a(407));n=n()}else{if(n=e(),null===ea)throw Error(a(349));0!=(30&xi)||zi(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,Ki(Fi.bind(null,i,s,t),[t]),i.flags|=2048,Vi(9,Wi.bind(null,i,s,n,e),void 0,null),n},useId:function(){var t=Oi(),e=ea.identifierPrefix;if(gn){var n=ln;e=":"+e+"R"+(n=(on&~(1<<32-_e(on)-1)).toString(32)+n),0<(n=Ci++)&&(e+="H"+n.toString(32)),e+=":"}else e=":"+e+"r"+(n=Bi++).toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},pr={readContext:Vn,useCallback:nr,useContext:Vn,useEffect:qi,useImperativeHandle:tr,useInsertionEffect:Qi,useLayoutEffect:Zi,useMemo:ir,useReducer:Ii,useRef:$i,useState:function(){return Ii(Ri)},useDebugValue:er,useDeferredValue:function(t){return rr(Li(),Si.memoizedState,t)},useTransition:function(){return[Ii(Ri)[0],Li().memoizedState]},useMutableSource:Di,useSyncExternalStore:Ui,useId:ar,unstable_isNewReconciler:!1},gr={readContext:Vn,useCallback:nr,useContext:Vn,useEffect:qi,useImperativeHandle:tr,useInsertionEffect:Qi,useLayoutEffect:Zi,useMemo:ir,useReducer:Ni,useRef:$i,useState:function(){return Ni(Ri)},useDebugValue:er,useDeferredValue:function(t){var e=Li();return null===Si?e.memoizedState=t:rr(e,Si.memoizedState,t)},useTransition:function(){return[Ni(Ri)[0],Li().memoizedState]},useMutableSource:Di,useSyncExternalStore:Ui,useId:ar,unstable_isNewReconciler:!1};function mr(t,e){if(t&&t.defaultProps){for(var n in e=s({},e),t=t.defaultProps)void 0===e[n]&&(e[n]=t[n]);return e}return e}function br(t,e,n,i){n=null==(n=n(i,e=t.memoizedState))?e:s({},e,n),t.memoizedState=n,0===t.lanes&&(t.updateQueue.baseState=n)}var yr={isMounted:function(t){return!!(t=t._reactInternals)&&T(t)===t},enqueueSetState:function(t,e,n){t=t._reactInternals;var i=ka(),r=Ma(t),s=Jn(i,r);s.payload=e,null!=n&&(s.callback=n),null!==(e=ti(t,s,r))&&(Pa(e,t,r,i),ei(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=ka(),r=Ma(t),s=Jn(i,r);s.tag=1,s.payload=e,null!=n&&(s.callback=n),null!==(e=ti(t,s,r))&&(Pa(e,t,r,i),ei(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=ka(),i=Ma(t),r=Jn(n,i);r.tag=2,null!=e&&(r.callback=e),null!==(e=ti(t,r,i))&&(Pa(e,t,i,n),ei(e,t,i))}};function vr(t,e,n,i,r,s,a){return"function"==typeof(t=t.stateNode).shouldComponentUpdate?t.shouldComponentUpdate(i,s,a):!(e.prototype&&e.prototype.isPureReactComponent&&kn(n,i)&&kn(r,s))}function xr(t,e,n){var i=!1,r=ue,s=e.contextType;return"object"==typeof s&&null!==s?s=Vn(s):(r=ge(e)?fe:he.current,s=(i=null!=(i=e.contextTypes))?pe(t,r):ue),e=new e(n,s),t.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,e.updater=yr,t.stateNode=e,e._reactInternals=t,i&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=s),e}function _r(t,e,n,i){t=e.state,"function"==typeof e.componentWillReceiveProps&&e.componentWillReceiveProps(n,i),"function"==typeof e.UNSAFE_componentWillReceiveProps&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&yr.enqueueReplaceState(e,e.state,null)}function Sr(t,e,n,i){var r=t.stateNode;r.props=n,r.state=t.memoizedState,r.refs={},Qn(t);var s=e.contextType;"object"==typeof s&&null!==s?r.context=Vn(s):(s=ge(e)?fe:he.current,r.context=pe(t,s)),r.state=t.memoizedState,"function"==typeof(s=e.getDerivedStateFromProps)&&(br(t,e,s,n),r.state=t.memoizedState),"function"==typeof e.getDerivedStateFromProps||"function"==typeof r.getSnapshotBeforeUpdate||"function"!=typeof r.UNSAFE_componentWillMount&&"function"!=typeof r.componentWillMount||(e=r.state,"function"==typeof r.componentWillMount&&r.componentWillMount(),"function"==typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),e!==r.state&&yr.enqueueReplaceState(r,r.state,null),ii(t,n,r,i),r.state=t.memoizedState),"function"==typeof r.componentDidMount&&(t.flags|=4194308)}function Ar(t,e){try{var n="",i=e;do{n+=Mn(i),i=i.return}while(i);var r=n}catch(t){r="\nError generating stack: "+t.message+"\n"+t.stack}return{value:t,source:e,stack:r,digest:null}}function wr(t,e,n){return{value:t,source:null,stack:null!=n?n:null,digest:null!=e?e:null}}var Tr="function"==typeof WeakMap?WeakMap:Map;function Cr(t,e,n){(n=Jn(-1,n)).tag=3,n.payload={element:null};var i=e.value;return n.callback=function(){ya||(ya=!0,va=i)},n}function Br(t,e,n){(n=Jn(-1,n)).tag=3;var i=t.type.getDerivedStateFromError;if("function"==typeof i){var r=e.value;n.payload=function(){return i(r)},n.callback=function(){}}var s=t.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(n.callback=function(){"function"!=typeof i&&(null===xa?xa=new Set([this]):xa.add(this));var t=e.stack;this.componentDidCatch(e.value,{componentStack:null!==t?t:""})}),n}function kr(t,e,n){var i=t.pingCache;if(null===i){i=t.pingCache=new Tr;var r=new Set;i.set(e,r)}else void 0===(r=i.get(e))&&(r=new Set,i.set(e,r));r.has(n)||(r.add(n),t=Za.bind(null,t,e,n),e.then(t,t))}function Mr(t){do{var e;if((e=13===t.tag)&&(e=null===(e=t.memoizedState)||null!==e.dehydrated),e)return t;t=t.return}while(null!==t);return null}function Pr(t,e,n,i,r){return 0==(1&t.mode)?(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((e=Jn(-1,1)).tag=2,ti(n,e,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=r,t)}var Er=o.ReactCurrentOwner,Or=!1;function Lr(t,e,n,i){e.child=null===t?In(e,null,n,i):Rn(e,t.child,n,i)}function Rr(t,e,n,i,r){n=n.render;var s=e.ref;return Gn(e,r),i=Pi(t,e,n,i,s,r),n=Ei(),null===t||Or?(gn&&n&&hn(e),e.flags|=1,Lr(t,e,i,r),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,is(t,e,r))}function Ir(t,e,n,i,r){if(null===t){var s=n.type;return"function"!=typeof s||so(s)||void 0!==s.defaultProps||null!==n.compare||void 0!==n.defaultProps?((t=oo(n.type,null,i,e,e.mode,r)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=s,Nr(t,e,s,i,r))}if(s=t.child,0==(t.lanes&r)){var a=s.memoizedProps;if((n=null!==(n=n.compare)?n:kn)(a,i)&&t.ref===e.ref)return is(t,e,r)}return e.flags|=1,(t=ao(s,i)).ref=e.ref,t.return=e,e.child=t}function Nr(t,e,n,i,r){if(null!==t){var s=t.memoizedProps;if(kn(s,i)&&t.ref===e.ref){if(Or=!1,e.pendingProps=i=s,0==(t.lanes&r))return e.lanes=t.lanes,is(t,e,r);0!=(131072&t.flags)&&(Or=!0)}}return zr(t,e,n,i,r)}function Dr(t,e,n){var i=e.pendingProps,r=i.children,s=null!==t?t.memoizedState:null;if("hidden"===i.mode)if(0==(1&e.mode))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},ce(sa,ra),ra|=n;else{if(0==(1073741824&n))return t=null!==s?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,ce(sa,ra),ra|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=null!==s?s.baseLanes:n,ce(sa,ra),ra|=i}else null!==s?(i=s.baseLanes|n,e.memoizedState=null):i=n,ce(sa,ra),ra|=i;return Lr(t,e,r,n),e.child}function Ur(t,e){var n=e.ref;(null===t&&null!==n||null!==t&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function zr(t,e,n,i,r){var s=ge(n)?fe:he.current;return s=pe(e,s),Gn(e,r),n=Pi(t,e,n,i,s,r),i=Ei(),null===t||Or?(gn&&i&&hn(e),e.flags|=1,Lr(t,e,n,r),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,is(t,e,r))}function Wr(t,e,n,i,r){if(ge(n)){var s=!0;ve(e)}else s=!1;if(Gn(e,r),null===e.stateNode)ns(t,e),xr(e,n,i),Sr(e,n,i,r),i=!0;else if(null===t){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,c=n.contextType;c="object"==typeof c&&null!==c?Vn(c):pe(e,c=ge(n)?fe:he.current);var u=n.getDerivedStateFromProps,h="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;h||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==i||l!==c)&&_r(e,a,i,c),qn=!1;var d=e.memoizedState;a.state=d,ii(e,i,a,r),l=e.memoizedState,o!==i||d!==l||de.current||qn?("function"==typeof u&&(br(e,n,u,i),l=e.memoizedState),(o=qn||vr(e,n,o,i,d,l,c))?(h||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(e.flags|=4194308)):("function"==typeof a.componentDidMount&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),a.props=i,a.state=l,a.context=c,i=o):("function"==typeof a.componentDidMount&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,Zn(t,e),o=e.memoizedProps,c=e.type===e.elementType?o:mr(e.type,o),a.props=c,h=e.pendingProps,d=a.context,l="object"==typeof(l=n.contextType)&&null!==l?Vn(l):pe(e,l=ge(n)?fe:he.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==h||d!==l)&&_r(e,a,i,l),qn=!1,d=e.memoizedState,a.state=d,ii(e,i,a,r);var p=e.memoizedState;o!==h||d!==p||de.current||qn?("function"==typeof f&&(br(e,n,f,i),p=e.memoizedState),(c=qn||vr(e,n,c,i,d,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(i,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(i,p,l)),"function"==typeof a.componentDidUpdate&&(e.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(e.flags|=1024)):("function"!=typeof a.componentDidUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=p),a.props=i,a.state=p,a.context=l,i=c):("function"!=typeof a.componentDidUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),i=!1)}return Fr(t,e,n,i,s,r)}function Fr(t,e,n,i,r,s){Ur(t,e);var a=0!=(128&e.flags);if(!i&&!a)return r&&xe(e,n,!1),is(t,e,s);i=e.stateNode,Er.current=e;var o=a&&"function"!=typeof n.getDerivedStateFromError?null:i.render();return e.flags|=1,null!==t&&a?(e.child=Rn(e,t.child,null,s),e.child=Rn(e,null,o,s)):Lr(t,e,o,s),e.memoizedState=i.state,r&&xe(e,n,!0),e.child}function jr(t){var e=t.stateNode;e.pendingContext?be(0,e.pendingContext,e.pendingContext!==e.context):e.context&&be(0,e.context,!1),ui(t,e.containerInfo)}function Hr(t,e,n,i,r){return Tn(),Cn(r),e.flags|=256,Lr(t,e,n,i),e.child}var Gr,Vr,$r,Xr,Yr={dehydrated:null,treeContext:null,retryLane:0};function Kr(t){return{baseLanes:t,cachePool:null,transitions:null}}function qr(t,e,n){var i,r=e.pendingProps,s=pi.current,o=!1,l=0!=(128&e.flags);if((i=l)||(i=(null===t||null!==t.memoizedState)&&0!=(2&s)),i?(o=!0,e.flags&=-129):null!==t&&null===t.memoizedState||(s|=1),ce(pi,1&s),null===t)return _n(e),null!==(t=e.memoizedState)&&null!==(t=t.dehydrated)?(0==(1&e.mode)?e.lanes=1:Dt(t)?e.lanes=8:e.lanes=1073741824,null):(l=r.children,t=r.fallback,o?(r=e.mode,o=e.child,l={mode:"hidden",children:l},0==(1&r)&&null!==o?(o.childLanes=0,o.pendingProps=l):o=co(l,r,0,null),t=lo(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=Kr(n),e.memoizedState=Yr,t):Qr(e,l));if(null!==(s=t.memoizedState)&&null!==(i=s.dehydrated))return function(t,e,n,i,r,s,o){if(n)return 256&e.flags?(e.flags&=-257,Zr(t,e,o,i=wr(Error(a(422))))):null!==e.memoizedState?(e.child=t.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=co({mode:"visible",children:i.children},r,0,null),(s=lo(s,r,o,null)).flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,0!=(1&e.mode)&&Rn(e,t.child,null,o),e.child.memoizedState=Kr(o),e.memoizedState=Yr,s);if(0==(1&e.mode))return Zr(t,e,o,null);if(Dt(r))return i=Ut(r).digest,Zr(t,e,o,i=wr(s=Error(a(419)),i,void 0));if(n=0!=(o&t.childLanes),Or||n){if(null!==(i=ea)){switch(o&-o){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}0!==(r=0!=(r&(i.suspendedLanes|o))?0:r)&&r!==s.retryLane&&(s.retryLane=r,Kn(t,r),Pa(i,t,r,-1))}return ja(),Zr(t,e,o,i=wr(Error(a(421))))}return Nt(r)?(e.flags|=128,e.child=t.child,e=to.bind(null,t),zt(r,e),null):(t=s.treeContext,q&&(pn=Ht(r),fn=e,gn=!0,bn=null,mn=!1,null!==t&&(rn[sn++]=on,rn[sn++]=ln,rn[sn++]=an,on=t.id,ln=t.overflow,an=e)),(e=Qr(e,i.children)).flags|=4096,e)}(t,e,l,r,i,s,n);if(o){o=r.fallback,l=e.mode,i=(s=t.child).sibling;var c={mode:"hidden",children:r.children};return 0==(1&l)&&e.child!==s?((r=e.child).childLanes=0,r.pendingProps=c,e.deletions=null):(r=ao(s,c)).subtreeFlags=14680064&s.subtreeFlags,null!==i?o=ao(i,o):(o=lo(o,l,n,null)).flags|=2,o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,l=null===(l=t.child.memoizedState)?Kr(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=t.childLanes&~n,e.memoizedState=Yr,r}return t=(o=t.child).sibling,r=ao(o,{mode:"visible",children:r.children}),0==(1&e.mode)&&(r.lanes=n),r.return=e,r.sibling=null,null!==t&&(null===(n=e.deletions)?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Qr(t,e){return(e=co({mode:"visible",children:e},t.mode,0,null)).return=t,t.child=e}function Zr(t,e,n,i){return null!==i&&Cn(i),Rn(e,t.child,null,n),(t=Qr(e,e.pendingProps.children)).flags|=2,e.memoizedState=null,t}function Jr(t,e,n){t.lanes|=e;var i=t.alternate;null!==i&&(i.lanes|=e),Hn(t.return,e,n)}function ts(t,e,n,i,r){var s=t.memoizedState;null===s?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function es(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(Lr(t,e,i.children,n),0!=(2&(i=pi.current)))i=1&i|2,e.flags|=128;else{if(null!==t&&0!=(128&t.flags))t:for(t=e.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&Jr(t,n,e);else if(19===t.tag)Jr(t,n,e);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;null===t.sibling;){if(null===t.return||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}if(ce(pi,i),0==(1&e.mode))e.memoizedState=null;else switch(r){case"forwards":for(n=e.child,r=null;null!==n;)null!==(t=n.alternate)&&null===gi(t)&&(r=n),n=n.sibling;null===(n=r)?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),ts(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;null!==r;){if(null!==(t=r.alternate)&&null===gi(t)){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}ts(e,!0,n,null,s);break;case"together":ts(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ns(t,e){0==(1&e.mode)&&null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2)}function is(t,e,n){if(null!==t&&(e.dependencies=t.dependencies),la|=e.lanes,0==(n&e.childLanes))return null;if(null!==t&&e.child!==t.child)throw Error(a(153));if(null!==e.child){for(n=ao(t=e.child,t.pendingProps),e.child=n,n.return=e;null!==t.sibling;)t=t.sibling,(n=n.sibling=ao(t,t.pendingProps)).return=e;n.sibling=null}return e.child}function rs(t){t.flags|=4}function ss(t,e){if(null!==t&&t.child===e.child)return!0;if(0!=(16&e.flags))return!1;for(t=e.child;null!==t;){if(0!=(12854&t.flags)||0!=(12854&t.subtreeFlags))return!1;t=t.sibling}return!0}if(Y)Gr=function(t,e){for(var n=e.child;null!==n;){if(5===n.tag||6===n.tag)z(t,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Vr=function(){},$r=function(t,e,n,i,r){if((t=t.memoizedProps)!==i){var s=e.stateNode,a=ci(ai.current);n=F(s,n,t,i,r,a),(e.updateQueue=n)&&rs(e)}},Xr=function(t,e,n,i){n!==i&&rs(e)};else if(K){Gr=function(t,e,n,i){for(var r=e.child;null!==r;){if(5===r.tag){var s=r.stateNode;n&&i&&(s=Et(s,r.type,r.memoizedProps,r)),z(t,s)}else if(6===r.tag)s=r.stateNode,n&&i&&(s=Ot(s,r.memoizedProps,r)),z(t,s);else if(4!==r.tag)if(22===r.tag&&null!==r.memoizedState)null!==(s=r.child)&&(s.return=r),Gr(t,r,!0,!0);else if(null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};var as=function(t,e,n,i){for(var r=e.child;null!==r;){if(5===r.tag){var s=r.stateNode;n&&i&&(s=Et(s,r.type,r.memoizedProps,r)),kt(t,s)}else if(6===r.tag)s=r.stateNode,n&&i&&(s=Ot(s,r.memoizedProps,r)),kt(t,s);else if(4!==r.tag)if(22===r.tag&&null!==r.memoizedState)null!==(s=r.child)&&(s.return=r),as(t,r,!0,!0);else if(null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Vr=function(t,e){var n=e.stateNode;if(!ss(t,e)){t=n.containerInfo;var i=Bt(t);as(i,e,!1,!1),n.pendingChildren=i,rs(e),Mt(t,i)}},$r=function(t,e,n,i,r){var s=t.stateNode,a=t.memoizedProps;if((t=ss(t,e))&&a===i)e.stateNode=s;else{var o=e.stateNode,l=ci(ai.current),c=null;a!==i&&(c=F(o,n,a,i,r,l)),t&&null===c?e.stateNode=s:(s=Ct(s,c,n,a,i,e,t,o),W(s,n,i,r,l)&&rs(e),e.stateNode=s,t?rs(e):Gr(s,e,!1,!1))}},Xr=function(t,e,n,i){n!==i?(t=ci(li.current),n=ci(ai.current),e.stateNode=H(i,t,n,e),rs(e)):e.stateNode=t.stateNode}}else Vr=function(){},$r=function(){},Xr=function(){};function os(t,e){if(!gn)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;null!==e;)null!==e.alternate&&(n=e),e=e.sibling;null===n?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?e||null===t.tail?t.tail=null:t.tail.sibling=null:i.sibling=null}}function ls(t){var e=null!==t.alternate&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;null!==r;)n|=r.lanes|r.childLanes,i|=14680064&r.subtreeFlags,i|=14680064&r.flags,r.return=t,r=r.sibling;else for(r=t.child;null!==r;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function cs(t,e,n){var i=e.pendingProps;switch(dn(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ls(e),null;case 1:case 17:return ge(e.type)&&me(),ls(e),null;case 3:return n=e.stateNode,hi(),le(de),le(he),bi(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==t&&null!==t.child||(An(e)?rs(e):null===t||t.memoizedState.isDehydrated&&0==(256&e.flags)||(e.flags|=1024,null!==bn&&(Ra(bn),bn=null))),Vr(t,e),ls(e),null;case 5:fi(e),n=ci(li.current);var r=e.type;if(null!==t&&null!=e.stateNode)$r(t,e,r,i,n),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(null===e.stateNode)throw Error(a(166));return ls(e),null}if(t=ci(ai.current),An(e)){if(!q)throw Error(a(175));t=Gt(e.stateNode,e.type,e.memoizedProps,n,t,e,!mn),e.updateQueue=t,null!==t&&rs(e)}else{var s=U(r,i,n,t,e);Gr(s,e,!1,!1),e.stateNode=s,W(s,r,i,n,t)&&rs(e)}null!==e.ref&&(e.flags|=512,e.flags|=2097152)}return ls(e),null;case 6:if(t&&null!=e.stateNode)Xr(t,e,t.memoizedProps,i);else{if("string"!=typeof i&&null===e.stateNode)throw Error(a(166));if(t=ci(li.current),n=ci(ai.current),An(e)){if(!q)throw Error(a(176));if(t=e.stateNode,n=e.memoizedProps,(i=Vt(t,n,e,!mn))&&null!==(r=fn))switch(r.tag){case 3:Jt(r.stateNode.containerInfo,t,n,0!=(1&r.mode));break;case 5:te(r.type,r.memoizedProps,r.stateNode,t,n,0!=(1&r.mode))}i&&rs(e)}else e.stateNode=H(i,t,n,e)}return ls(e),null;case 13:if(le(pi),i=e.memoizedState,null===t||null!==t.memoizedState&&null!==t.memoizedState.dehydrated){if(gn&&null!==pn&&0!=(1&e.mode)&&0==(128&e.flags))wn(),Tn(),e.flags|=98560,r=!1;else if(r=An(e),null!==i&&null!==i.dehydrated){if(null===t){if(!r)throw Error(a(318));if(!q)throw Error(a(344));if(!(r=null!==(r=e.memoizedState)?r.dehydrated:null))throw Error(a(317));$t(r,e)}else Tn(),0==(128&e.flags)&&(e.memoizedState=null),e.flags|=4;ls(e),r=!1}else null!==bn&&(Ra(bn),bn=null),r=!0;if(!r)return 65536&e.flags?e:null}return 0!=(128&e.flags)?(e.lanes=n,e):((n=null!==i)!=(null!==t&&null!==t.memoizedState)&&n&&(e.child.flags|=8192,0!=(1&e.mode)&&(null===t||0!=(1&pi.current)?0===aa&&(aa=3):ja())),null!==e.updateQueue&&(e.flags|=4),ls(e),null);case 4:return hi(),Vr(t,e),null===t&&Z(e.stateNode.containerInfo),ls(e),null;case 10:return jn(e.type._context),ls(e),null;case 19:if(le(pi),null===(r=e.memoizedState))return ls(e),null;if(i=0!=(128&e.flags),null===(s=r.rendering))if(i)os(r,!1);else{if(0!==aa||null!==t&&0!=(128&t.flags))for(t=e.child;null!==t;){if(null!==(s=gi(t))){for(e.flags|=128,os(r,!1),null!==(t=s.updateQueue)&&(e.updateQueue=t,e.flags|=4),e.subtreeFlags=0,t=n,n=e.child;null!==n;)r=t,(i=n).flags&=14680066,null===(s=i.alternate)?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,r=s.dependencies,i.dependencies=null===r?null:{lanes:r.lanes,firstContext:r.firstContext}),n=n.sibling;return ce(pi,1&pi.current|2),e.child}t=t.sibling}null!==r.tail&&We()>pa&&(e.flags|=128,i=!0,os(r,!1),e.lanes=4194304)}else{if(!i)if(null!==(t=gi(s))){if(e.flags|=128,i=!0,null!==(t=t.updateQueue)&&(e.updateQueue=t,e.flags|=4),os(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!gn)return ls(e),null}else 2*We()-r.renderingStartTime>pa&&1073741824!==n&&(e.flags|=128,i=!0,os(r,!1),e.lanes=4194304);r.isBackwards?(s.sibling=e.child,e.child=s):(null!==(t=r.last)?t.sibling=s:e.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=We(),e.sibling=null,t=pi.current,ce(pi,i?1&t|2:1&t),e):(ls(e),null);case 22:case 23:return Ua(),n=null!==e.memoizedState,null!==t&&null!==t.memoizedState!==n&&(e.flags|=8192),n&&0!=(1&e.mode)?0!=(1073741824&ra)&&(ls(e),Y&&6&e.subtreeFlags&&(e.flags|=8192)):ls(e),null;case 24:case 25:return null}throw Error(a(156,e.tag))}function us(t,e){switch(dn(e),e.tag){case 1:return ge(e.type)&&me(),65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 3:return hi(),le(de),le(he),bi(),0!=(65536&(t=e.flags))&&0==(128&t)?(e.flags=-65537&t|128,e):null;case 5:return fi(e),null;case 13:if(le(pi),null!==(t=e.memoizedState)&&null!==t.dehydrated){if(null===e.alternate)throw Error(a(340));Tn()}return 65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 19:return le(pi),null;case 4:return hi(),null;case 10:return jn(e.type._context),null;case 22:case 23:return Ua(),null;default:return null}}var hs=!1,ds=!1,fs="function"==typeof WeakSet?WeakSet:Set,ps=null;function gs(t,e){var n=t.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){Qa(t,e,n)}else n.current=null}function ms(t,e,n){try{n()}catch(n){Qa(t,e,n)}}var bs=!1;function ys(t,e,n){var i=e.updateQueue;if(null!==(i=null!==i?i.lastEffect:null)){var r=i=i.next;do{if((r.tag&t)===t){var s=r.destroy;r.destroy=void 0,void 0!==s&&ms(e,n,s)}r=r.next}while(r!==i)}}function vs(t,e){if(null!==(e=null!==(e=e.updateQueue)?e.lastEffect:null)){var n=e=e.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==e)}}function xs(t){var e=t.ref;if(null!==e){var n=t.stateNode;t=5===t.tag?L(n):n,"function"==typeof e?e(t):e.current=t}}function _s(t){var e=t.alternate;null!==e&&(t.alternate=null,_s(e)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&null!==(e=t.stateNode)&&tt(e),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Ss(t){return 5===t.tag||3===t.tag||4===t.tag}function As(t){t:for(;;){for(;null===t.sibling;){if(null===t.return||Ss(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&18!==t.tag;){if(2&t.flags)continue t;if(null===t.child||4===t.tag)continue t;t.child.return=t,t=t.child}if(!(2&t.flags))return t.stateNode}}function ws(t,e,n){var i=t.tag;if(5===i||6===i)t=t.stateNode,e?bt(n,t,e):dt(n,t);else if(4!==i&&null!==(t=t.child))for(ws(t,e,n),t=t.sibling;null!==t;)ws(t,e,n),t=t.sibling}function Ts(t,e,n){var i=t.tag;if(5===i||6===i)t=t.stateNode,e?mt(n,t,e):ht(n,t);else if(4!==i&&null!==(t=t.child))for(Ts(t,e,n),t=t.sibling;null!==t;)Ts(t,e,n),t=t.sibling}var Cs=null,Bs=!1;function ks(t,e,n){for(n=n.child;null!==n;)Ms(t,e,n),n=n.sibling}function Ms(t,e,n){if($e&&"function"==typeof $e.onCommitFiberUnmount)try{$e.onCommitFiberUnmount(Ve,n)}catch(t){}switch(n.tag){case 5:ds||gs(n,e);case 6:if(Y){var i=Cs,r=Bs;Cs=null,ks(t,e,n),Bs=r,null!==(Cs=i)&&(Bs?vt(Cs,n.stateNode):yt(Cs,n.stateNode))}else ks(t,e,n);break;case 18:Y&&null!==Cs&&(Bs?Qt(Cs,n.stateNode):qt(Cs,n.stateNode));break;case 4:Y?(i=Cs,r=Bs,Cs=n.stateNode.containerInfo,Bs=!0,ks(t,e,n),Cs=i,Bs=r):(K&&(i=n.stateNode.containerInfo,r=Bt(i),Pt(i,r)),ks(t,e,n));break;case 0:case 11:case 14:case 15:if(!ds&&null!==(i=n.updateQueue)&&null!==(i=i.lastEffect)){r=i=i.next;do{var s=r,a=s.destroy;s=s.tag,void 0!==a&&(0!=(2&s)||0!=(4&s))&&ms(n,e,a),r=r.next}while(r!==i)}ks(t,e,n);break;case 1:if(!ds&&(gs(n,e),"function"==typeof(i=n.stateNode).componentWillUnmount))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(t){Qa(n,e,t)}ks(t,e,n);break;case 21:ks(t,e,n);break;case 22:1&n.mode?(ds=(i=ds)||null!==n.memoizedState,ks(t,e,n),ds=i):ks(t,e,n);break;default:ks(t,e,n)}}function Ps(t){var e=t.updateQueue;if(null!==e){t.updateQueue=null;var n=t.stateNode;null===n&&(n=t.stateNode=new fs),e.forEach((function(e){var i=eo.bind(null,t,e);n.has(e)||(n.add(e),e.then(i,i))}))}}function Es(t,e){var n=e.deletions;if(null!==n)for(var i=0;i<n.length;i++){var r=n[i];try{var s=t,o=e;if(Y){var l=o;t:for(;null!==l;){switch(l.tag){case 5:Cs=l.stateNode,Bs=!1;break t;case 3:case 4:Cs=l.stateNode.containerInfo,Bs=!0;break t}l=l.return}if(null===Cs)throw Error(a(160));Ms(s,o,r),Cs=null,Bs=!1}else Ms(s,o,r);var c=r.alternate;null!==c&&(c.return=null),r.return=null}catch(t){Qa(r,e,t)}}if(12854&e.subtreeFlags)for(e=e.child;null!==e;)Os(e,t),e=e.sibling}function Os(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Es(e,t),Ls(t),4&i){try{ys(3,t,t.return),vs(3,t)}catch(e){Qa(t,t.return,e)}try{ys(5,t,t.return)}catch(e){Qa(t,t.return,e)}}break;case 1:Es(e,t),Ls(t),512&i&&null!==n&&gs(n,n.return);break;case 5:if(Es(e,t),Ls(t),512&i&&null!==n&&gs(n,n.return),Y){if(32&t.flags){var r=t.stateNode;try{xt(r)}catch(e){Qa(t,t.return,e)}}if(4&i&&null!=(r=t.stateNode)){var s=t.memoizedProps;if(n=null!==n?n.memoizedProps:s,i=t.type,e=t.updateQueue,t.updateQueue=null,null!==e)try{gt(r,e,i,n,s,t)}catch(e){Qa(t,t.return,e)}}}break;case 6:if(Es(e,t),Ls(t),4&i&&Y){if(null===t.stateNode)throw Error(a(162));r=t.stateNode,s=t.memoizedProps,n=null!==n?n.memoizedProps:s;try{ft(r,n,s)}catch(e){Qa(t,t.return,e)}}break;case 3:if(Es(e,t),Ls(t),4&i){if(Y&&q&&null!==n&&n.memoizedState.isDehydrated)try{Yt(e.containerInfo)}catch(e){Qa(t,t.return,e)}if(K){r=e.containerInfo,s=e.pendingChildren;try{Pt(r,s)}catch(e){Qa(t,t.return,e)}}}break;case 4:if(Es(e,t),Ls(t),4&i&&K){r=(s=t.stateNode).containerInfo,s=s.pendingChildren;try{Pt(r,s)}catch(e){Qa(t,t.return,e)}}break;case 13:Es(e,t),Ls(t),8192&(r=t.child).flags&&(s=null!==r.memoizedState,r.stateNode.isHidden=s,!s||null!==r.alternate&&null!==r.alternate.memoizedState||(fa=We())),4&i&&Ps(t);break;case 22:var o=null!==n&&null!==n.memoizedState;if(1&t.mode?(ds=(n=ds)||o,Es(e,t),ds=n):Es(e,t),Ls(t),8192&i){if(n=null!==t.memoizedState,(t.stateNode.isHidden=n)&&!o&&0!=(1&t.mode))for(ps=t,i=t.child;null!==i;){for(e=ps=i;null!==ps;){var l=(o=ps).child;switch(o.tag){case 0:case 11:case 14:case 15:ys(4,o,o.return);break;case 1:gs(o,o.return);var c=o.stateNode;if("function"==typeof c.componentWillUnmount){var u=o,h=o.return;try{var d=u;c.props=d.memoizedProps,c.state=d.memoizedState,c.componentWillUnmount()}catch(t){Qa(u,h,t)}}break;case 5:gs(o,o.return);break;case 22:if(null!==o.memoizedState){Ds(e);continue}}null!==l?(l.return=o,ps=l):Ds(e)}i=i.sibling}if(Y)t:if(i=null,Y)for(e=t;;){if(5===e.tag){if(null===i){i=e;try{r=e.stateNode,n?_t(r):At(e.stateNode,e.memoizedProps)}catch(e){Qa(t,t.return,e)}}}else if(6===e.tag){if(null===i)try{s=e.stateNode,n?St(s):wt(s,e.memoizedProps)}catch(e){Qa(t,t.return,e)}}else if((22!==e.tag&&23!==e.tag||null===e.memoizedState||e===t)&&null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;null===e.sibling;){if(null===e.return||e.return===t)break t;i===e&&(i=null),e=e.return}i===e&&(i=null),e.sibling.return=e.return,e=e.sibling}}break;case 19:Es(e,t),Ls(t),4&i&&Ps(t);break;case 21:break;default:Es(e,t),Ls(t)}}function Ls(t){var e=t.flags;if(2&e){try{if(Y){t:{for(var n=t.return;null!==n;){if(Ss(n)){var i=n;break t}n=n.return}throw Error(a(160))}switch(i.tag){case 5:var r=i.stateNode;32&i.flags&&(xt(r),i.flags&=-33),Ts(t,As(t),r);break;case 3:case 4:var s=i.stateNode.containerInfo;ws(t,As(t),s);break;default:throw Error(a(161))}}}catch(e){Qa(t,t.return,e)}t.flags&=-3}4096&e&&(t.flags&=-4097)}function Rs(t,e,n){ps=t,Is(t)}function Is(t,e,n){for(var i=0!=(1&t.mode);null!==ps;){var r=ps,s=r.child;if(22===r.tag&&i){var a=null!==r.memoizedState||hs;if(!a){var o=r.alternate,l=null!==o&&null!==o.memoizedState||ds;o=hs;var c=ds;if(hs=a,(ds=l)&&!c)for(ps=r;null!==ps;)l=(a=ps).child,22===a.tag&&null!==a.memoizedState?Us(r):null!==l?(l.return=a,ps=l):Us(r);for(;null!==s;)ps=s,Is(s),s=s.sibling;ps=r,hs=o,ds=c}Ns(t)}else 0!=(8772&r.subtreeFlags)&&null!==s?(s.return=r,ps=s):Ns(t)}}function Ns(t){for(;null!==ps;){var e=ps;if(0!=(8772&e.flags)){var n=e.alternate;try{if(0!=(8772&e.flags))switch(e.tag){case 0:case 11:case 15:ds||vs(5,e);break;case 1:var i=e.stateNode;if(4&e.flags&&!ds)if(null===n)i.componentDidMount();else{var r=e.elementType===e.type?n.memoizedProps:mr(e.type,n.memoizedProps);i.componentDidUpdate(r,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;null!==s&&ri(e,s,i);break;case 3:var o=e.updateQueue;if(null!==o){if(n=null,null!==e.child)switch(e.child.tag){case 5:n=L(e.child.stateNode);break;case 1:n=e.child.stateNode}ri(e,o,n)}break;case 5:var l=e.stateNode;null===n&&4&e.flags&&pt(l,e.type,e.memoizedProps,e);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(q&&null===e.memoizedState){var c=e.alternate;if(null!==c){var u=c.memoizedState;if(null!==u){var h=u.dehydrated;null!==h&&Kt(h)}}}break;default:throw Error(a(163))}ds||512&e.flags&&xs(e)}catch(t){Qa(e,e.return,t)}}if(e===t){ps=null;break}if(null!==(n=e.sibling)){n.return=e.return,ps=n;break}ps=e.return}}function Ds(t){for(;null!==ps;){var e=ps;if(e===t){ps=null;break}var n=e.sibling;if(null!==n){n.return=e.return,ps=n;break}ps=e.return}}function Us(t){for(;null!==ps;){var e=ps;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{vs(4,e)}catch(t){Qa(e,n,t)}break;case 1:var i=e.stateNode;if("function"==typeof i.componentDidMount){var r=e.return;try{i.componentDidMount()}catch(t){Qa(e,r,t)}}var s=e.return;try{xs(e)}catch(t){Qa(e,s,t)}break;case 5:var a=e.return;try{xs(e)}catch(t){Qa(e,a,t)}}}catch(t){Qa(e,e.return,t)}if(e===t){ps=null;break}var o=e.sibling;if(null!==o){o.return=e.return,ps=o;break}ps=e.return}}var zs=0,Ws=1,Fs=2,js=3,Hs=4;if("function"==typeof Symbol&&Symbol.for){var Gs=Symbol.for;zs=Gs("selector.component"),Ws=Gs("selector.has_pseudo_class"),Fs=Gs("selector.role"),js=Gs("selector.test_id"),Hs=Gs("selector.text")}function Vs(t){var e=Q(t);if(null!=e){if("string"!=typeof e.memoizedProps["data-testname"])throw Error(a(364));return e}if(null===(t=rt(t)))throw Error(a(362));return t.stateNode.current}function $s(t,e){switch(e.$$typeof){case zs:if(t.type===e.value)return!0;break;case Ws:t:{e=e.value,t=[t,0];for(var n=0;n<t.length;){var i=t[n++],r=t[n++],s=e[r];if(5!==i.tag||!ot(i)){for(;null!=s&&$s(i,s);)s=e[++r];if(r===e.length){e=!0;break t}for(i=i.child;null!==i;)t.push(i,r),i=i.sibling}}e=!1}return e;case Fs:if(5===t.tag&&lt(t.stateNode,e.value))return!0;break;case Hs:if((5===t.tag||6===t.tag)&&null!==(t=at(t))&&0<=t.indexOf(e.value))return!0;break;case js:if(5===t.tag&&"string"==typeof(t=t.memoizedProps["data-testname"])&&t.toLowerCase()===e.value.toLowerCase())return!0;break;default:throw Error(a(365))}return!1}function Xs(t){switch(t.$$typeof){case zs:return"<"+(A(t.value)||"Unknown")+">";case Ws:return":has("+(Xs(t)||"")+")";case Fs:return'[role="'+t.value+'"]';case Hs:return'"'+t.value+'"';case js:return'[data-testname="'+t.value+'"]';default:throw Error(a(365))}}function Ys(t,e){var n=[];t=[t,0];for(var i=0;i<t.length;){var r=t[i++],s=t[i++],a=e[s];if(5!==r.tag||!ot(r)){for(;null!=a&&$s(r,a);)a=e[++s];if(s===e.length)n.push(r);else for(r=r.child;null!==r;)t.push(r,s),r=r.sibling}}return n}function Ks(t,e){if(!it)throw Error(a(363));t=Ys(t=Vs(t),e),e=[],t=Array.from(t);for(var n=0;n<t.length;){var i=t[n++];if(5===i.tag)ot(i)||e.push(i.stateNode);else for(i=i.child;null!==i;)t.push(i),i=i.sibling}return e}var qs=Math.ceil,Qs=o.ReactCurrentDispatcher,Zs=o.ReactCurrentOwner,Js=o.ReactCurrentBatchConfig,ta=0,ea=null,na=null,ia=0,ra=0,sa=oe(0),aa=0,oa=null,la=0,ca=0,ua=0,ha=null,da=null,fa=0,pa=1/0,ga=null;function ma(){pa=We()+500}var ba,ya=!1,va=null,xa=null,_a=!1,Sa=null,Aa=0,wa=0,Ta=null,Ca=-1,Ba=0;function ka(){return 0!=(6&ta)?We():-1!==Ca?Ca:Ca=We()}function Ma(t){return 0==(1&t.mode)?1:0!=(2&ta)&&0!==ia?ia&-ia:null!==Bn.transition?(0===Ba&&(Ba=Pe()),Ba):0!==(t=Re)?t:J()}function Pa(t,e,n,i){if(50<wa)throw wa=0,Ta=null,Error(a(185));Oe(t,n,i),0!=(2&ta)&&t===ea||(t===ea&&(0==(2&ta)&&(ca|=n),4===aa&&Ia(t,ia)),Ea(t,i),1===n&&0===ta&&0==(1&e.mode)&&(ma(),Ke&&Ze()))}function Ea(t,e){var n=t.callbackNode;!function(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes;0<s;){var a=31-_e(s),o=1<<a,l=r[a];-1===l?0!=(o&n)&&0==(o&i)||(r[a]=ke(o,e)):l<=e&&(t.expiredLanes|=o),s&=~o}}(t,e);var i=Be(t,t===ea?ia:0);if(0===i)null!==n&&De(n),t.callbackNode=null,t.callbackPriority=0;else if(e=i&-i,t.callbackPriority!==e){if(null!=n&&De(n),1===e)0===t.tag?function(t){Ke=!0,Qe(t)}(Na.bind(null,t)):Qe(Na.bind(null,t)),et?nt((function(){0==(6&ta)&&Ze()})):Ne(Fe,Ze),n=null;else{switch(Ie(i)){case 1:n=Fe;break;case 4:n=je;break;case 16:default:n=He;break;case 536870912:n=Ge}n=no(n,Oa.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function Oa(t,e){if(Ca=-1,Ba=0,0!=(6&ta))throw Error(a(327));var n=t.callbackNode;if(Ka()&&t.callbackNode!==n)return null;var i=Be(t,t===ea?ia:0);if(0===i)return null;if(0!=(30&i)||0!=(i&t.expiredLanes)||e)e=Ha(t,i);else{e=i;var r=ta;ta|=2;var s=Fa();for(ea===t&&ia===e||(ga=null,ma(),za(t,e));;)try{Va();break}catch(e){Wa(t,e)}Wn(),Qs.current=s,ta=r,null!==na?e=0:(ea=null,ia=0,e=aa)}if(0!==e){if(2===e&&0!==(r=Me(t))&&(i=r,e=La(t,r)),1===e)throw n=oa,za(t,0),Ia(t,i),Ea(t,We()),n;if(6===e)Ia(t,i);else{if(r=t.current.alternate,0==(30&i)&&!function(t){for(var e=t;;){if(16384&e.flags){var n=e.updateQueue;if(null!==n&&null!==(n=n.stores))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!Xe(s(),r))return!1}catch(t){return!1}}}if(n=e.child,16384&e.subtreeFlags&&null!==n)n.return=e,e=n;else{if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}(r)&&(2===(e=Ha(t,i))&&0!==(s=Me(t))&&(i=s,e=La(t,s)),1===e))throw n=oa,za(t,0),Ia(t,i),Ea(t,We()),n;switch(t.finishedWork=r,t.finishedLanes=i,e){case 0:case 1:throw Error(a(345));case 2:case 5:Ya(t,da,ga);break;case 3:if(Ia(t,i),(130023424&i)===i&&10<(e=fa+500-We())){if(0!==Be(t,0))break;if(((r=t.suspendedLanes)&i)!==i){ka(),t.pingedLanes|=t.suspendedLanes&r;break}t.timeoutHandle=G(Ya.bind(null,t,da,ga),e);break}Ya(t,da,ga);break;case 4:if(Ia(t,i),(4194240&i)===i)break;for(e=t.eventTimes,r=-1;0<i;){var o=31-_e(i);s=1<<o,(o=e[o])>r&&(r=o),i&=~s}if(i=r,10<(i=(120>(i=We()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qs(i/1960))-i)){t.timeoutHandle=G(Ya.bind(null,t,da,ga),i);break}Ya(t,da,ga);break;default:throw Error(a(329))}}}return Ea(t,We()),t.callbackNode===n?Oa.bind(null,t):null}function La(t,e){var n=ha;return t.current.memoizedState.isDehydrated&&(za(t,e).flags|=256),2!==(t=Ha(t,e))&&(e=da,da=n,null!==e&&Ra(e)),t}function Ra(t){null===da?da=t:da.push.apply(da,t)}function Ia(t,e){for(e&=~ua,e&=~ca,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-_e(e),i=1<<n;t[n]=-1,e&=~i}}function Na(t){if(0!=(6&ta))throw Error(a(327));Ka();var e=Be(t,0);if(0==(1&e))return Ea(t,We()),null;var n=Ha(t,e);if(0!==t.tag&&2===n){var i=Me(t);0!==i&&(e=i,n=La(t,i))}if(1===n)throw n=oa,za(t,0),Ia(t,e),Ea(t,We()),n;if(6===n)throw Error(a(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Ya(t,da,ga),Ea(t,We()),null}function Da(t){null!==Sa&&0===Sa.tag&&0==(6&ta)&&Ka();var e=ta;ta|=1;var n=Js.transition,i=Re;try{if(Js.transition=null,Re=1,t)return t()}finally{Re=i,Js.transition=n,0==(6&(ta=e))&&Ze()}}function Ua(){ra=sa.current,le(sa)}function za(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==$&&(t.timeoutHandle=$,V(n)),null!==na)for(n=na.return;null!==n;){var i=n;switch(dn(i),i.tag){case 1:null!=(i=i.type.childContextTypes)&&me();break;case 3:hi(),le(de),le(he),bi();break;case 5:fi(i);break;case 4:hi();break;case 13:case 19:le(pi);break;case 10:jn(i.type._context);break;case 22:case 23:Ua()}n=n.return}if(ea=t,na=t=ao(t.current,null),ia=ra=e,aa=0,oa=null,ua=ca=la=0,da=ha=null,null!==$n){for(e=0;e<$n.length;e++)if(null!==(i=(n=$n[e]).interleaved)){n.interleaved=null;var r=i.next,s=n.pending;if(null!==s){var a=s.next;s.next=r,i.next=a}n.pending=i}$n=null}return t}function Wa(t,e){for(;;){var n=na;try{if(Wn(),yi.current=dr,wi){for(var i=_i.memoizedState;null!==i;){var r=i.queue;null!==r&&(r.pending=null),i=i.next}wi=!1}if(xi=0,Ai=Si=_i=null,Ti=!1,Ci=0,Zs.current=null,null===n||null===n.return){aa=1,oa=e,na=null;break}t:{var s=t,o=n.return,l=n,c=e;if(e=ia,l.flags|=32768,null!==c&&"object"==typeof c&&"function"==typeof c.then){var u=c,h=l,d=h.tag;if(0==(1&h.mode)&&(0===d||11===d||15===d)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=Mr(o);if(null!==p){p.flags&=-257,Pr(p,o,l,0,e),1&p.mode&&kr(s,u,e),c=u;var g=(e=p).updateQueue;if(null===g){var m=new Set;m.add(c),e.updateQueue=m}else g.add(c);break t}if(0==(1&e)){kr(s,u,e),ja();break t}c=Error(a(426))}else if(gn&&1&l.mode){var b=Mr(o);if(null!==b){0==(65536&b.flags)&&(b.flags|=256),Pr(b,o,l,0,e),Cn(Ar(c,l));break t}}s=c=Ar(c,l),4!==aa&&(aa=2),null===ha?ha=[s]:ha.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e,ni(s,Cr(0,c,e));break t;case 1:l=c;var y=s.type,v=s.stateNode;if(0==(128&s.flags)&&("function"==typeof y.getDerivedStateFromError||null!==v&&"function"==typeof v.componentDidCatch&&(null===xa||!xa.has(v)))){s.flags|=65536,e&=-e,s.lanes|=e,ni(s,Br(s,l,e));break t}}s=s.return}while(null!==s)}Xa(n)}catch(t){e=t,na===n&&null!==n&&(na=n=n.return);continue}break}}function Fa(){var t=Qs.current;return Qs.current=dr,null===t?dr:t}function ja(){0!==aa&&3!==aa&&2!==aa||(aa=4),null===ea||0==(268435455&la)&&0==(268435455&ca)||Ia(ea,ia)}function Ha(t,e){var n=ta;ta|=2;var i=Fa();for(ea===t&&ia===e||(ga=null,za(t,e));;)try{Ga();break}catch(e){Wa(t,e)}if(Wn(),ta=n,Qs.current=i,null!==na)throw Error(a(261));return ea=null,ia=0,aa}function Ga(){for(;null!==na;)$a(na)}function Va(){for(;null!==na&&!Ue();)$a(na)}function $a(t){var e=ba(t.alternate,t,ra);t.memoizedProps=t.pendingProps,null===e?Xa(t):na=e,Zs.current=null}function Xa(t){var e=t;do{var n=e.alternate;if(t=e.return,0==(32768&e.flags)){if(null!==(n=cs(n,e,ra)))return void(na=n)}else{if(null!==(n=us(n,e)))return n.flags&=32767,void(na=n);if(null===t)return aa=6,void(na=null);t.flags|=32768,t.subtreeFlags=0,t.deletions=null}if(null!==(e=e.sibling))return void(na=e);na=e=t}while(null!==e);0===aa&&(aa=5)}function Ya(t,e,n){var i=Re,r=Js.transition;try{Js.transition=null,Re=1,function(t,e,n,i){do{Ka()}while(null!==Sa);if(0!=(6&ta))throw Error(a(327));n=t.finishedWork;var r=t.finishedLanes;if(null===n)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(a(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(function(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0<n;){var r=31-_e(n),s=1<<r;e[r]=0,i[r]=-1,t[r]=-1,n&=~s}}(t,s),t===ea&&(na=ea=null,ia=0),0==(2064&n.subtreeFlags)&&0==(2064&n.flags)||_a||(_a=!0,no(He,(function(){return Ka(),null}))),s=0!=(15990&n.flags),0!=(15990&n.subtreeFlags)||s){s=Js.transition,Js.transition=null;var o=Re;Re=1;var l=ta;ta|=4,Zs.current=null,function(t,e){for(N(t.containerInfo),ps=e;null!==ps;)if(e=(t=ps).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,ps=e;else for(;null!==ps;){t=ps;try{var n=t.alternate;if(0!=(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==n){var i=n.memoizedProps,r=n.memoizedState,s=t.stateNode,o=s.getSnapshotBeforeUpdate(t.elementType===t.type?i:mr(t.type,i),r);s.__reactInternalSnapshotBeforeUpdate=o}break;case 3:Y&&Tt(t.stateNode.containerInfo);break;default:throw Error(a(163))}}catch(e){Qa(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,ps=e;break}ps=t.return}n=bs,bs=!1}(t,n),Os(n,t),D(t.containerInfo),t.current=n,Rs(n),ze(),ta=l,Re=o,Js.transition=s}else t.current=n;if(_a&&(_a=!1,Sa=t,Aa=r),0===(s=t.pendingLanes)&&(xa=null),function(t){if($e&&"function"==typeof $e.onCommitFiberRoot)try{$e.onCommitFiberRoot(Ve,t,void 0,128==(128&t.current.flags))}catch(t){}}(n.stateNode),Ea(t,We()),null!==e)for(i=t.onRecoverableError,n=0;n<e.length;n++)i((r=e[n]).value,{componentStack:r.stack,digest:r.digest});if(ya)throw ya=!1,t=va,va=null,t;0!=(1&Aa)&&0!==t.tag&&Ka(),0!=(1&(s=t.pendingLanes))?t===Ta?wa++:(wa=0,Ta=t):wa=0,Ze()}(t,e,n,i)}finally{Js.transition=r,Re=i}return null}function Ka(){if(null!==Sa){var t=Ie(Aa),e=Js.transition,n=Re;try{if(Js.transition=null,Re=16>t?16:t,null===Sa)var i=!1;else{if(t=Sa,Sa=null,Aa=0,0!=(6&ta))throw Error(a(331));var r=ta;for(ta|=4,ps=t.current;null!==ps;){var s=ps,o=s.child;if(0!=(16&ps.flags)){var l=s.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(ps=u;null!==ps;){var h=ps;switch(h.tag){case 0:case 11:case 15:ys(8,h,s)}var d=h.child;if(null!==d)d.return=h,ps=d;else for(;null!==ps;){var f=(h=ps).sibling,p=h.return;if(_s(h),h===u){ps=null;break}if(null!==f){f.return=p,ps=f;break}ps=p}}}var g=s.alternate;if(null!==g){var m=g.child;if(null!==m){g.child=null;do{var b=m.sibling;m.sibling=null,m=b}while(null!==m)}}ps=s}}if(0!=(2064&s.subtreeFlags)&&null!==o)o.return=s,ps=o;else t:for(;null!==ps;){if(0!=(2048&(s=ps).flags))switch(s.tag){case 0:case 11:case 15:ys(9,s,s.return)}var y=s.sibling;if(null!==y){y.return=s.return,ps=y;break t}ps=s.return}}var v=t.current;for(ps=v;null!==ps;){var x=(o=ps).child;if(0!=(2064&o.subtreeFlags)&&null!==x)x.return=o,ps=x;else t:for(o=v;null!==ps;){if(0!=(2048&(l=ps).flags))try{switch(l.tag){case 0:case 11:case 15:vs(9,l)}}catch(t){Qa(l,l.return,t)}if(l===o){ps=null;break t}var _=l.sibling;if(null!==_){_.return=l.return,ps=_;break t}ps=l.return}}if(ta=r,Ze(),$e&&"function"==typeof $e.onPostCommitFiberRoot)try{$e.onPostCommitFiberRoot(Ve,t)}catch(t){}i=!0}return i}finally{Re=n,Js.transition=e}}return!1}function qa(t,e,n){t=ti(t,e=Cr(0,e=Ar(n,e),1),1),e=ka(),null!==t&&(Oe(t,1,e),Ea(t,e))}function Qa(t,e,n){if(3===t.tag)qa(t,t,n);else for(;null!==e;){if(3===e.tag){qa(e,t,n);break}if(1===e.tag){var i=e.stateNode;if("function"==typeof e.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===xa||!xa.has(i))){e=ti(e,t=Br(e,t=Ar(n,t),1),1),t=ka(),null!==e&&(Oe(e,1,t),Ea(e,t));break}}e=e.return}}function Za(t,e,n){var i=t.pingCache;null!==i&&i.delete(e),e=ka(),t.pingedLanes|=t.suspendedLanes&n,ea===t&&(ia&n)===n&&(4===aa||3===aa&&(130023424&ia)===ia&&500>We()-fa?za(t,0):ua|=n),Ea(t,e)}function Ja(t,e){0===e&&(0==(1&t.mode)?e=1:(e=Te,0==(130023424&(Te<<=1))&&(Te=4194304)));var n=ka();null!==(t=Kn(t,e))&&(Oe(t,e,n),Ea(t,n))}function to(t){var e=t.memoizedState,n=0;null!==e&&(n=e.retryLane),Ja(t,n)}function eo(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;null!==r&&(n=r.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(a(314))}null!==i&&i.delete(e),Ja(t,n)}function no(t,e){return Ne(t,e)}function io(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ro(t,e,n,i){return new io(t,e,n,i)}function so(t){return!(!(t=t.prototype)||!t.isReactComponent)}function ao(t,e){var n=t.alternate;return null===n?((n=ro(t.tag,e,t.key,t.mode)).elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&t.flags,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function oo(t,e,n,i,r,s){var o=2;if(i=t,"function"==typeof t)so(t)&&(o=1);else if("string"==typeof t)o=5;else t:switch(t){case u:return lo(n.children,r,s,e);case h:o=8,r|=8;break;case d:return(t=ro(12,n,e,2|r)).elementType=d,t.lanes=s,t;case m:return(t=ro(13,n,e,r)).elementType=m,t.lanes=s,t;case b:return(t=ro(19,n,e,r)).elementType=b,t.lanes=s,t;case x:return co(n,r,s,e);default:if("object"==typeof t&&null!==t)switch(t.$$typeof){case f:o=10;break t;case p:o=9;break t;case g:o=11;break t;case y:o=14;break t;case v:o=16,i=null;break t}throw Error(a(130,null==t?t:typeof t,""))}return(e=ro(o,n,e,r)).elementType=t,e.type=i,e.lanes=s,e}function lo(t,e,n,i){return(t=ro(7,t,i,e)).lanes=n,t}function co(t,e,n,i){return(t=ro(22,t,i,e)).elementType=x,t.lanes=n,t.stateNode={isHidden:!1},t}function uo(t,e,n){return(t=ro(6,t,null,e)).lanes=n,t}function ho(t,e,n){return(e=ro(4,null!==t.children?t.children:[],t.key,e)).lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function fo(t,e,n,i,r){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=$,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ee(0),this.expirationTimes=Ee(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ee(0),this.identifierPrefix=i,this.onRecoverableError=r,q&&(this.mutableSourceEagerHydrationData=null)}function po(t,e,n,i,r,s,a,o,l){return t=new fo(t,e,n,o,l),1===e?(e=1,!0===s&&(e|=8)):e=0,s=ro(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qn(s),t}function go(t){if(!t)return ue;t:{if(T(t=t._reactInternals)!==t||1!==t.tag)throw Error(a(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break t;case 1:if(ge(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}e=e.return}while(null!==e);throw Error(a(171))}if(1===t.tag){var n=t.type;if(ge(n))return ye(t,n,e)}return e}function mo(t){var e=t._reactInternals;if(void 0===e){if("function"==typeof t.render)throw Error(a(188));throw t=Object.keys(t).join(","),Error(a(268,t))}return null===(t=k(e))?null:t.stateNode}function bo(t,e){if(null!==(t=t.memoizedState)&&null!==t.dehydrated){var n=t.retryLane;t.retryLane=0!==n&&n<e?n:e}}function yo(t,e){bo(t,e),(t=t.alternate)&&bo(t,e)}function vo(t){return null===(t=k(t))?null:t.stateNode}function xo(){return null}return ba=function(t,e,n){if(null!==t)if(t.memoizedProps!==e.pendingProps||de.current)Or=!0;else{if(0==(t.lanes&n)&&0==(128&e.flags))return Or=!1,function(t,e,n){switch(e.tag){case 3:jr(e),Tn();break;case 5:di(e);break;case 1:ge(e.type)&&ve(e);break;case 4:ui(e,e.stateNode.containerInfo);break;case 10:Fn(0,e.type._context,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(null!==i)return null!==i.dehydrated?(ce(pi,1&pi.current),e.flags|=128,null):0!=(n&e.child.childLanes)?qr(t,e,n):(ce(pi,1&pi.current),null!==(t=is(t,e,n))?t.sibling:null);ce(pi,1&pi.current);break;case 19:if(i=0!=(n&e.childLanes),0!=(128&t.flags)){if(i)return es(t,e,n);e.flags|=128}var r=e.memoizedState;if(null!==r&&(r.rendering=null,r.tail=null,r.lastEffect=null),ce(pi,pi.current),i)break;return null;case 22:case 23:return e.lanes=0,Dr(t,e,n)}return is(t,e,n)}(t,e,n);Or=0!=(131072&t.flags)}else Or=!1,gn&&0!=(1048576&e.flags)&&un(e,nn,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;ns(t,e),t=e.pendingProps;var r=pe(e,he.current);Gn(e,n),r=Pi(null,e,i,t,r,n);var s=Ei();return e.flags|=1,"object"==typeof r&&null!==r&&"function"==typeof r.render&&void 0===r.$$typeof?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ge(i)?(s=!0,ve(e)):s=!1,e.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,Qn(e),r.updater=yr,e.stateNode=r,r._reactInternals=e,Sr(e,i,t,n),e=Fr(null,e,i,!0,s,n)):(e.tag=0,gn&&s&&hn(e),Lr(null,e,r,n),e=e.child),e;case 16:i=e.elementType;t:{switch(ns(t,e),t=e.pendingProps,i=(r=i._init)(i._payload),e.type=i,r=e.tag=function(t){if("function"==typeof t)return so(t)?1:0;if(null!=t){if((t=t.$$typeof)===g)return 11;if(t===y)return 14}return 2}(i),t=mr(i,t),r){case 0:e=zr(null,e,i,t,n);break t;case 1:e=Wr(null,e,i,t,n);break t;case 11:e=Rr(null,e,i,t,n);break t;case 14:e=Ir(null,e,i,mr(i.type,t),n);break t}throw Error(a(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,zr(t,e,i,r=e.elementType===i?r:mr(i,r),n);case 1:return i=e.type,r=e.pendingProps,Wr(t,e,i,r=e.elementType===i?r:mr(i,r),n);case 3:t:{if(jr(e),null===t)throw Error(a(387));i=e.pendingProps,r=(s=e.memoizedState).element,Zn(t,e),ii(e,i,null,n);var o=e.memoizedState;if(i=o.element,q&&s.isDehydrated){if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,256&e.flags){e=Hr(t,e,i,n,r=Ar(Error(a(423)),e));break t}if(i!==r){e=Hr(t,e,i,n,r=Ar(Error(a(424)),e));break t}for(q&&(pn=jt(e.stateNode.containerInfo),fn=e,gn=!0,bn=null,mn=!1),n=In(e,null,i,n),e.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(Tn(),i===r){e=is(t,e,n);break t}Lr(t,e,i,n)}e=e.child}return e;case 5:return di(e),null===t&&_n(e),i=e.type,r=e.pendingProps,s=null!==t?t.memoizedProps:null,o=r.children,j(i,r)?o=null:null!==s&&j(i,s)&&(e.flags|=32),Ur(t,e),Lr(t,e,o,n),e.child;case 6:return null===t&&_n(e),null;case 13:return qr(t,e,n);case 4:return ui(e,e.stateNode.containerInfo),i=e.pendingProps,null===t?e.child=Rn(e,null,i,n):Lr(t,e,i,n),e.child;case 11:return i=e.type,r=e.pendingProps,Rr(t,e,i,r=e.elementType===i?r:mr(i,r),n);case 7:return Lr(t,e,e.pendingProps,n),e.child;case 8:case 12:return Lr(t,e,e.pendingProps.children,n),e.child;case 10:t:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,Fn(0,i,o=r.value),null!==s)if(Xe(s.value,o)){if(s.children===r.children&&!de.current){e=is(t,e,n);break t}}else for(null!==(s=e.child)&&(s.return=e);null!==s;){var l=s.dependencies;if(null!==l){o=s.child;for(var c=l.firstContext;null!==c;){if(c.context===i){if(1===s.tag){(c=Jn(-1,n&-n)).tag=2;var u=s.updateQueue;if(null!==u){var h=(u=u.shared).pending;null===h?c.next=c:(c.next=h.next,h.next=c),u.pending=c}}s.lanes|=n,null!==(c=s.alternate)&&(c.lanes|=n),Hn(s.return,n,e),l.lanes|=n;break}c=c.next}}else if(10===s.tag)o=s.type===e.type?null:s.child;else if(18===s.tag){if(null===(o=s.return))throw Error(a(341));o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),Hn(o,n,e),o=s.sibling}else o=s.child;if(null!==o)o.return=s;else for(o=s;null!==o;){if(o===e){o=null;break}if(null!==(s=o.sibling)){s.return=o.return,o=s;break}o=o.return}s=o}Lr(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Gn(e,n),i=i(r=Vn(r)),e.flags|=1,Lr(t,e,i,n),e.child;case 14:return r=mr(i=e.type,e.pendingProps),Ir(t,e,i,r=mr(i.type,r),n);case 15:return Nr(t,e,e.type,e.pendingProps,n);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:mr(i,r),ns(t,e),e.tag=1,ge(i)?(t=!0,ve(e)):t=!1,Gn(e,n),xr(e,i,r),Sr(e,i,r,n),Fr(null,e,i,!0,t,n);case 19:return es(t,e,n);case 22:return Dr(t,e,n)}throw Error(a(156,e.tag))},e.attemptContinuousHydration=function(t){if(13===t.tag){var e=Kn(t,134217728);null!==e&&Pa(e,t,134217728,ka()),yo(t,134217728)}},e.attemptDiscreteHydration=function(t){if(13===t.tag){var e=Kn(t,1);null!==e&&Pa(e,t,1,ka()),yo(t,1)}},e.attemptHydrationAtCurrentPriority=function(t){if(13===t.tag){var e=Ma(t),n=Kn(t,e);null!==n&&Pa(n,t,e,ka()),yo(t,e)}},e.attemptSynchronousHydration=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Ce(e.pendingLanes);0!==n&&(Le(e,1|n),Ea(e,We()),0==(6&ta)&&(ma(),Ze()))}break;case 13:Da((function(){var e=Kn(t,1);if(null!==e){var n=ka();Pa(e,t,1,n)}})),yo(t,1)}},e.batchedUpdates=function(t,e){var n=ta;ta|=1;try{return t(e)}finally{0===(ta=n)&&(ma(),Ke&&Ze())}},e.createComponentSelector=function(t){return{$$typeof:zs,value:t}},e.createContainer=function(t,e,n,i,r,s,a){return po(t,e,!1,null,0,i,0,s,a)},e.createHasPseudoClassSelector=function(t){return{$$typeof:Ws,value:t}},e.createHydrationContainer=function(t,e,n,i,r,s,a,o,l){return(t=po(n,i,!0,t,0,s,0,o,l)).context=go(null),n=t.current,(s=Jn(i=ka(),r=Ma(n))).callback=null!=e?e:null,ti(n,s,r),t.current.lanes=r,Oe(t,r,i),Ea(t,i),t},e.createPortal=function(t,e,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:c,key:null==i?null:""+i,children:t,containerInfo:e,implementation:n}},e.createRoleSelector=function(t){return{$$typeof:Fs,value:t}},e.createTestNameSelector=function(t){return{$$typeof:js,value:t}},e.createTextSelector=function(t){return{$$typeof:Hs,value:t}},e.deferredUpdates=function(t){var e=Re,n=Js.transition;try{return Js.transition=null,Re=16,t()}finally{Re=e,Js.transition=n}},e.discreteUpdates=function(t,e,n,i,r){var s=Re,a=Js.transition;try{return Js.transition=null,Re=1,t(e,n,i,r)}finally{Re=s,Js.transition=a,0===ta&&ma()}},e.findAllNodes=Ks,e.findBoundingRects=function(t,e){if(!it)throw Error(a(363));e=Ks(t,e),t=[];for(var n=0;n<e.length;n++)t.push(st(e[n]));for(e=t.length-1;0<e;e--)for(var i=(n=t[e]).x,r=i+n.width,s=n.y,o=s+n.height,l=e-1;0<=l;l--)if(e!==l){var c=t[l],u=c.x,h=u+c.width,d=c.y,f=d+c.height;if(i>=u&&s>=d&&r<=h&&o<=f){t.splice(e,1);break}if(!(i!==u||n.width!==c.width||f<s||d>o)){d>s&&(c.height+=d-s,c.y=s),f<o&&(c.height=o-d),t.splice(e,1);break}if(!(s!==d||n.height!==c.height||h<i||u>r)){u>i&&(c.width+=u-i,c.x=i),h<r&&(c.width=r-u),t.splice(e,1);break}}return t},e.findHostInstance=mo,e.findHostInstanceWithNoPortals=function(t){return null===(t=null!==(t=B(t))?P(t):null)?null:t.stateNode},e.findHostInstanceWithWarning=function(t){return mo(t)},e.flushControlled=function(t){var e=ta;ta|=1;var n=Js.transition,i=Re;try{Js.transition=null,Re=1,t()}finally{Re=i,Js.transition=n,0===(ta=e)&&(ma(),Ze())}},e.flushPassiveEffects=Ka,e.flushSync=Da,e.focusWithin=function(t,e){if(!it)throw Error(a(363));for(e=Ys(t=Vs(t),e),e=Array.from(e),t=0;t<e.length;){var n=e[t++];if(!ot(n)){if(5===n.tag&&ct(n.stateNode))return!0;for(n=n.child;null!==n;)e.push(n),n=n.sibling}}return!1},e.getCurrentUpdatePriority=function(){return Re},e.getFindAllNodesFailureDescription=function(t,e){if(!it)throw Error(a(363));var n=0,i=[];t=[Vs(t),0];for(var r=0;r<t.length;){var s=t[r++],o=t[r++],l=e[o];if((5!==s.tag||!ot(s))&&($s(s,l)&&(i.push(Xs(l)),++o>n&&(n=o)),o<e.length))for(s=s.child;null!==s;)t.push(s,o),s=s.sibling}if(n<e.length){for(t=[];n<e.length;n++)t.push(Xs(e[n]));return"findAllNodes was able to match part of the selector:\n "+i.join(" > ")+"\n\nNo matching component was found for:\n "+t.join(" > ")}return null},e.getPublicRootInstance=function(t){return(t=t.current).child?5===t.child.tag?L(t.child.stateNode):t.child.stateNode:null},e.injectIntoDevTools=function(t){if(t={bundleType:t.bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:vo,findFiberByHostInstance:t.findFiberByHostInstance||xo,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)t=!1;else{var e=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(e.isDisabled||!e.supportsFiber)t=!0;else{try{Ve=e.inject(t),$e=e}catch(t){}t=!!e.checkDCE}}return t},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(t,e,n,i){if(!it)throw Error(a(363));t=Ks(t,e);var r=ut(t,n,i).disconnect;return{disconnect:function(){r()}}},e.registerMutableSourceForHydration=function(t,e){var n=e._getVersion;n=n(e._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[e,n]:t.mutableSourceEagerHydrationData.push(e,n)},e.runWithPriority=function(t,e){var n=Re;try{return Re=t,e()}finally{Re=n}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(t,e,n,i){var r=e.current,s=ka(),a=Ma(r);return n=go(n),null===e.context?e.context=n:e.pendingContext=n,(e=Jn(s,a)).payload={element:t},null!==(i=void 0===i?null:i)&&(e.callback=i),null!==(t=ti(r,e,a))&&(Pa(t,r,a,s),ei(t,r,a)),a},e}),Nu);var ju,Hu=r(Uu.exports),Gu={exports:{}},Vu={};Gu.exports=(ju||(ju=1,Vu.ConcurrentRoot=1,Vu.ContinuousEventPriority=4,Vu.DefaultEventPriority=16,Vu.DiscreteEventPriority=1,Vu.IdleEventPriority=536870912,Vu.LegacyRoot=0),Vu);var $u=Gu.exports;const Xu=Hu({supportsMutation:!0,supportsPersistence:!1,createInstance:(t,e,n)=>{const i=function(t,e){const n=function(t,e){if("tag"===t)return new yu(e.attribute?e.attribute:e);if("radio"===t)return new xu(e.attribute?e.attribute:e);if("checkbox"===t)return new vu(e.attribute?e.attribute:e)}(t,e);if(n)return n;if(!xt.graphicService.creator[t])return;const i=xt.graphicService.creator[t](e.attribute);return i}(t,e);if(i)return function(t,e){for(const n in e)Yu(n,e)&&Hl[n]&&t.addEventListener(Hl[n],e[n])}(i,e),i},createTextInstance:(t,e)=>{},appendInitialChild:(t,e)=>{t.add(e)},finalizeInitialChildren:()=>!1,prepareUpdate:()=>!0,shouldSetTextContent:()=>!1,getRootHostContext:()=>null,getChildHostContext:()=>null,getPublicInstance:t=>t,prepareForCommit:()=>null,resetAfterCommit:()=>{},preparePortalMount:()=>null,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,isPrimaryRenderer:!1,getCurrentEventPriority:()=>$u.DefaultEventPriority,getInstanceFromNode:t=>null,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},prepareScopeUpdate:()=>{},getInstanceFromScope:()=>{},detachDeletedInstance:()=>{},supportsHydration:!1,appendChild:(t,e)=>{t.add(e)},appendChildToContainer:(t,e)=>{t.add(e)},insertBefore:(t,e,n)=>{t.insertBefore(e,n)},insertInContainerBefore:(t,e,n)=>{t.insertBefore(e,n)},removeChild:(t,e)=>{e.delete()},removeChildFromContainer:(t,e)=>{e.delete()},commitUpdate:(t,e,n,i,r)=>{!function(t,e,n){for(const i in n)Yu(i,n)&&n[i]!==e[i]&&t.removeEventListener(Hl[i],n[i]);for(const i in e)Yu(i,e)&&n[i]!==e[i]&&t.addEventListener(Hl[i],e[i]);const i=e.attribute??_({},e);t.initAttributes(i),"image"===t.type&&t.loadImage(i.image);if("flex"===i.display&&void 0===i.width&&void 0===i.height&&b(n.attribute.width)&&b(n.attribute.height)){const e=t.stage.pluginService.findPluginsByName("FlexLayoutPlugin")[0];e&&e.tryLayoutChildren(t)}}(t,r,i)},hideInstance:t=>{t.setAttribute("visible",!1)},unhideInstance:(t,e)=>{t.setAttribute("visible",!0)},clearContainer:t=>{t.removeAllChild()},commitTextUpdate:(t,e,n)=>{}});function Yu(t,e){return t.startsWith("on")&&l(e[t])}Xu.injectIntoDevTools({bundleType:0,version:n.version,rendererPackageName:"react-vtable"});const Ku=(t,e)=>{const{componentId:r,children:s}=t;if(!n.isValidElement(s))return null;const a=n.useContext(i),{table:o}=a,l="header-custom-layout"===s.props.role,c=n.useRef(new Map),u=n.useCallback((t=>{const e=`${t.originCol??t.col}-${t.originRow??t.row}${t.forComputation?"-forComputation":""}`;let n;if(c.current.has(e)){const i=c.current.get(e);qu(s,i,t),n=i.containerInfo}else{n=new ba({});const i=Xu.createContainer(n,$u.LegacyRoot,null,null,null,"custom",null,null);c.current.set(e,i),qu(s,i,t)}return{rootContainer:n,renderDefault:!!s.props.renderDefault}}),[s]),h=n.useCallback(((t,e)=>{const n=`${t}-${e}`;if(c.current.has(n)){const t=c.current.get(n);Xu.updateContainer(null,t,null),t.containerInfo.delete(),c.current.delete(n)}}),[]),d=n.useCallback((()=>{c.current.forEach(((t,e)=>{const n=t;Xu.updateContainer(null,n,null),n.containerInfo.delete()})),c.current.clear()}),[]);return n.useLayoutEffect((()=>(console.log("init",t,o),()=>{console.log("release",t,o)})),[]),n.useLayoutEffect((()=>{console.log("update props",t,o),o?.checkReactCustomLayout(),o?.reactCustomLayout?.setReactRemoveAllGraphic(r,d,l),o&&!o.reactCustomLayout?.hasReactCreateGraphic(r,l)?(o.reactCustomLayout?.setReactCreateGraphic(r,u,l),o.reactCustomLayout?.setReactRemoveGraphic(r,h,l),o.reactCustomLayout?.updateCustomCell(r,l)):o&&(o.reactCustomLayout?.setReactCreateGraphic(r,u,l),c.current.forEach(((t,e)=>{const[n,i]=e.split("-").map(Number),{width:r,height:a}=function(t,e,n){const i=n.getCellRange(t,e),r=n.getCellsRect(i.start.col,i.start.row,i.end.col,i.end.row);return r}(n,i,o),l=t,c={col:n,row:i,dataValue:o.getCellOriginValue(n,i),value:o.getCellValue(n,i)||"",rect:{left:0,top:0,right:r,bottom:a,width:r,height:a},table:o};l.containerInfo,qu(s,l,c),o.scenegraph.updateNextFrame()})))})),null};function qu(t,e,i){Xu.updateContainer(n.cloneElement(t,{...i}),e,null)}const Qu=(t,e,r,s)=>{const a=["id","updateId","componentIndex","children"],o=r?Object.keys(r).concat(a):a,l=t=>{const e=n.useContext(i),s=n.useRef(null),a=n.useRef(t.updateId);if(t.updateId!==a.current){a.current=t.updateId;!!r&&N(e.table,t,s.current,r)&&(s.current=t)}return n.useEffect((()=>()=>{r&&N(e.table,null,s.current,r)}),[]),Ju(t.children,t.componentId)};return l.displayName=t,l.parseOption=t=>{const i=S(t,o);if(t.children){const{children:e}=t;n.Children.map(e,((e,n)=>{Zu(e,t,i,o,t.componentId+"-"+n)}))}return{option:i,optionName:e,isSingle:s}},l};function Zu(t,e,i,r,s){if("custom-layout"===t.props.role&&(i.customLayout="react-custom-layout",i.customLayoutComponentId=s),"header-custom-layout"===t.props.role&&(i.headerCustomLayout="react-custom-layout",i.headerCustomLayoutComponentId=s),"ListColumn"===t.type.displayName){i.columns||(i.columns=[]);const a=S(t.props,r);i.columns.push(a),a.componentId=s,t.props.children&&n.Children.map(t.props.children,((t,n)=>{Zu(t,e,a,r,s+"-"+n)}))}}function Ju(t,e){return(i=t)&&i.$$typeof===Symbol.for("react.element")||Array.isArray(t)?n.Children.map(t,((t,i)=>t.props.children?Ju(t.props.children,e+"-"+i):"custom-layout"===t.props.role||"header-custom-layout"===t.props.role?n.createElement(Ku,{componentId:e},t):null)):null;var i}const th=Qu("ListColumn","columns"),eh=Qu("PivotColumnDimension","columns"),nh=Qu("PivotRowDimension","rows"),ih=Qu("PivotIndicator","indicators"),rh=Qu("PivotColumnHeaderTitle","columnHeaderTitle",void 0,!0),sh=Qu("PivotRowHeaderTitle","rowHeaderTitle",void 0,!0),ah=Qu("PivotCorner","corner",void 0,!0),oh=Qu("Menu","menu",void 0,!0),lh=Qu("Tooltip","tooltip",void 0,!0),ch=Qu("EmptyTip","emptyTip",void 0,!0),uh=Qu("Title","title",void 0,!0);function hh(t,e){return b(t)?t:"string"==typeof t&&t.endsWith("%")?Number(t.slice(0,-1))/100*e:0}const dh="group",fh="text",ph="tag",gh={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"#FFF"},panelStyle:{visible:!0,fill:"#165dff",lineWidth:1,cornerRadius:2},padding:10,state:{panelStyle:{hover:{fill:"#4080ff"},disabled:{fill:"#94bfff"}}}};const mh=n.forwardRef((function(t,e){const i=_({},gh,t),{disabled:r,onClick:s}=i;let a=n.useRef(null);a=e||a;const o=n.useCallback((t=>{r?"function"==typeof t?.preventDefault&&t.preventDefault():s&&s(t)}),[r,s]),l=function(t){const{textStyle:e,padding:n,panelStyle:i,minWidth:r,maxWidth:s,visible:a,cursor:o,disabled:l,state:c,children:u}=t,h={text:u,textStyle:e,padding:n,panel:i,minWidth:r,maxWidth:s,visible:a,cursor:o??l?"not-allowed":"pointer",childrenPickable:!1,state:{text:{hover:c?.textStyle?.hover,disabled:c?.textStyle?.disabled},panel:{hover:c?.panelStyle?.hover,disabled:c?.panelStyle?.disabled}}};return h}(i);return n.useEffect((()=>{a.current.addEventListener("mouseenter",(()=>{r||(a.current.addState("hover",!0,!1),a.current.stage.renderNextFrame())})),a.current.addEventListener("mouseleave",(()=>{r||(a.current.removeState("hover",!1),a.current.stage.renderNextFrame())}))})),n.useEffect((()=>{r?(a.current.removeState("disabled",!1),a.current.addState("disabled",!0,!1)):a.current.removeState("disabled",!1),a.current.stage.renderNextFrame()})),n.createElement(ph,{ref:a,attribute:l,onClick:o})}));mh.displayName="Button";const bh={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"rgb(64, 128, 255)"},panelStyle:{visible:!0,opacity:0,fill:"rgba(242, 243, 245, 0.5)",lineWidth:1,cornerRadius:2},padding:4,space:6,state:{textStyle:{disabled:{fill:"rgb(148, 191, 255)"}},panelStyle:{hover:{opacity:1}}}};const yh=n.forwardRef((function(t,e){const i=_({},bh,t),{disabled:r,href:s,onClick:a}=i;let o=n.useRef(null);o=e||o;const l=n.useCallback((t=>{r?"function"==typeof t?.preventDefault&&t.preventDefault():(a&&a(t),s&&window.open(s))}),[r,s,a]),c=function(t){const{textStyle:e,padding:n,space:i,panelStyle:r,minWidth:s,maxWidth:a,visible:o,cursor:l,disabled:c,icon:u,state:h,children:d}=t,f={text:d,textStyle:e,padding:n,panel:r,minWidth:s,maxWidth:a,visible:o,cursor:l??c?"not-allowed":"pointer",childrenPickable:!1,state:{text:{hover:h?.textStyle?.hover,disabled:h?.textStyle?.disabled},panel:{hover:h?.panelStyle?.hover,disabled:h?.panelStyle?.disabled}},space:i,shape:{visible:!!u,fill:!1,stroke:e.fill,symbolType:"M -0.2927 -15.4348 L -15.142 -0.5855 C -18.6567 2.9292 -18.6567 8.6277 -15.142 12.1424 V 12.1424 C -11.6273 15.6571 -5.9288 15.6571 -2.4141 12.1424 L 15.2636 -5.5353 C 17.6067 -7.8784 17.6067 -11.6774 15.2636 -14.0206 V -14.0206 C 12.9205 -16.3637 9.1215 -16.3637 6.7783 -14.0206 L -10.8993 3.6571 C -12.0709 4.8287 -12.0709 6.7282 -10.8993 7.8997 V 7.8997 C -9.7278 9.0713 -7.8283 9.0713 -6.6567 7.8997 L 8.1925 -6.9495"}};return f}(i);return n.useEffect((()=>{o.current.addEventListener("mouseenter",(()=>{r||(o.current.addState("hover",!0,!1),o.current.stage.renderNextFrame())})),o.current.addEventListener("mouseleave",(()=>{r||(o.current.removeState("hover",!1),o.current.stage.renderNextFrame())}))}),[]),n.useEffect((()=>{r?(o.current.removeState("disabled",!1),o.current.addState("disabled",!0,!1)):o.current.removeState("disabled",!1),o.current.stage.renderNextFrame()})),n.createElement(ph,{ref:o,attribute:c,onClick:l})}));yh.displayName="Link";const vh={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"#FFF"},panelStyle:{visible:!0,fill:"rgb(201, 205, 212)",lineWidth:1,cornerRadius:2},size:40,shape:"circle",autoFixFontSize:!0};const xh=n.forwardRef((function(t,e){const i=_({},vh,t),{size:r,children:s,onClick:a}=i;let o=n.useRef(null);o=e||o;const l=n.useCallback((t=>{a&&a(t)}),[a]),c=function(t){const{panelStyle:e,size:n,shape:i}=t,r={...e,width:n,height:n,clip:!0,cornerRadius:"circle"===i?n/2:e.cornerRadius??2,display:"flex",alignItems:"center",justifyContent:"center",visibleAll:!0,path:void 0};return r}(i);if(p(s)){const t=function(t){const{textStyle:e,size:n,children:i,autoFixFontSize:r}=t,s={text:i,...e};r&&function(t,e){const n=gu(e.text,e).width,i=t/(n+8),r=Math.max(Math.floor(e.fontSize*i),6);e.fontSize=r}(n,s);return s}(i);return n.createElement(dh,{ref:o,attribute:c,onClick:l},n.createElement(fh,{attribute:t}))}return"image"===s.type&&(s.props.attribute.width=r,s.props.attribute.height=r),n.createElement(dh,{ref:o,attribute:c,onClick:l},s)}));xh.displayName="Avatar";const _h={defaultPopupVisible:!1,position:"top"},Sh={backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 4px 10px rgba(0, 0, 0, .1)",fontSize:"14px",borderRadius:"4px",lineHeight:"1.5715",boxSizing:"border-box",color:"rgb(78, 89, 105)",border:"1px solid rgb(229, 230, 235)",padding:"12px 16px"},Ah=t=>{const e={content:"",height:"8px",width:"8px",position:"absolute",display:"block",boxSizing:"border-box",transform:"rotate(45deg)",transformOrigin:"50% 50% 0",backgroundColor:"rgb(255, 255, 255)",border:"1px solid rgb(229, 230, 235)",...wh(t.position),...t.arrowStyle};return t.visible?n.createElement(n.Fragment,null,n.createElement("div",{style:_({},Sh,t.panelStyle)},t.content),n.createElement("div",{style:e})):n.createElement(n.Fragment,null)};function wh(t){switch(t){case"top":return{top:"calc(100% - 5px)",left:"calc(50% - 5px)",borderTop:"none",borderLeft:"none"};case"tl":return{top:"calc(100% - 4px)",left:"14px",borderTop:"none",borderLeft:"none"};case"tr":return{top:"calc(100% - 4px)",left:"calc(100% - 24px)",borderTop:"none",borderLeft:"none"};case"bottom":return{top:"-4px",left:"calc(50% - 4px)",borderRight:"none",borderBottom:"none"};case"bl":return{top:"-4px",left:"14px",borderRight:"none",borderBottom:"none"};case"br":return{top:"-4px",left:"calc(100% - 24px)",borderRight:"none",borderBottom:"none"};case"left":return{top:"calc(50% - 4px)",left:"calc(100% - 5px)",borderLeft:"none",borderBottom:"none"};case"lt":return{top:"14px",left:"calc(100% - 5px)",borderLeft:"none",borderBottom:"none"};case"lb":return{top:"calc(100% - 24px)",left:"calc(100% - 5px)",borderLeft:"none",borderBottom:"none"};case"right":return{top:"calc(50% - 4px)",left:"-4px",borderRight:"none",borderTop:"none"};case"rt":return{top:"14px",left:"-4px",borderRight:"none",borderTop:"none"};case"rb":return{top:"calc(100% - 24px)",left:"-4px",borderRight:"none",borderTop:"none"}}}const Th=n.forwardRef((function(t,e){const i=_({},_h,t),{content:r,position:s,popupVisible:a,defaultPopupVisible:o,panelStyle:l,arrowStyle:c,children:h}=i;let d=n.useRef(null);d=e||d;const[f,p]=n.useState(!1);n.useEffect((()=>{p(!!a),d.current.stage.renderNextFrame()}),[a]),n.useEffect((()=>{p(a??o??!1)}),[]);const{transform:g,anchorType:m}=function(t){switch(t){case"top":return{anchorType:"top",transform:"translate(-50%, calc(-100% - 10px))"};case"tl":return{anchorType:"top-left",transform:"translate(0, calc(-100% - 10px))"};case"tr":return{anchorType:"top-right",transform:"translate(-100%, calc(-100% - 10px))"};case"bottom":return{anchorType:"bottom",transform:"translate(-50%, 10px)"};case"bl":return{anchorType:"bottom-left",transform:"translate(0, 10px)"};case"br":return{anchorType:"bottom-right",transform:"translate(-100%, 10px)"};case"left":return{anchorType:"left",transform:"translate(calc(-100% - 10px), -50%)"};case"lt":return{anchorType:"top-left",transform:"translate(calc(-100% - 10px), 0)"};case"lb":return{anchorType:"bottom-left",transform:"translate(calc(-100% - 10px), -100%)"};case"right":return{anchorType:"right",transform:"translate(10px, -50%)"};case"rt":return{anchorType:"top-right",transform:"translate(10px, 0)"};case"rb":return{anchorType:"bottom-right",transform:"translate(10px, -100%)"}}}(s),b={react:{style:{transform:g},element:n.createElement(Ah,{visible:f,content:r,position:s,panelStyle:l,arrowStyle:c}),container:null,visible:!0,pointerEvents:!1,anchorType:m}},y=n.useCallback((t=>{u(a)||(p(!0),t.currentTarget.stage.renderNextFrame())}),[]),v=n.useCallback((t=>{u(a)||(p(!1),t.currentTarget.stage.renderNextFrame())}),[]);return n.createElement(dh,{ref:d,attribute:b,onMouseEnter:y,onMouseLeave:v},h)}));Th.displayName="Popover";const Ch={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"rgb(51, 101, 238)"},panelStyle:{visible:!0,fill:"#e6fffb",lineWidth:1,cornerRadius:4}};const Bh=n.forwardRef((function(t,e){const i=_({},Ch,t),{attribute:r,panelStyle:s,children:a,...o}=i;let l=n.useRef(null);return l=e||l,n.createElement(ph,{ref:l,attribute:r??{text:a,panel:s,...o},...o})}));Bh.displayName="Tag";const kh={};const Mh=n.forwardRef((function(t,e){const i=_({},kh,t),{textStyle:r,circleStyle:s,children:a,...o}=i;let l=n.useRef(null);l=e||l;const c=n.useCallback((t=>{i.onChange&&i.onChange(t.target.attribute.checked)}),[]);return n.useEffect((()=>(l.current?.addEventListener("radio_checked",c),()=>{l.current?.removeEventListener("radio_checked",c)})),[]),n.createElement("radio",{ref:l,attribute:{text:{...r,text:a},circle:s,...o},...o})}));Mh.displayName="Radio";const Ph={};const Eh=n.forwardRef((function(t,e){const i=_({},Ph,t),{textStyle:r,boxStyle:s,iconStyle:a,children:o,...l}=i;let c=n.useRef(null);c=e||c;const u=n.useCallback((t=>{i.onChange&&i.onChange(t.target.attribute.checked)}),[]);return n.useEffect((()=>(c.current?.addEventListener("checkbox_state_change",u),()=>{c.current?.removeEventListener("checkbox_state_change",u)})),[]),n.createElement("checkbox",{ref:c,attribute:{text:{...r,text:o},box:s,icon:a,...l},...l})}));Eh.displayName="Checkbox";Object.defineProperty(t,"register",{enumerable:!0,get:function(){return e.register}}),t.Arc="arc",t.Avatar=xh,t.Button=mh,t.Checkbox=Eh,t.Circle="circle",t.CustomComponent=t=>{const e=n.useContext(i),{table:r}=e,s=function(t,e){const i=n.useMemo((()=>({...e})),[e]),r=n.useMemo((()=>{const e=_({},t);for(const t in i)void 0===e[t]&&(e[t]=i[t]);return e}),[t,i]);return r}(t,{style:{left:0,top:0},className:"vtable-custom-component",displayMode:"position",x:0,y:0,width:0,height:0,row:0,col:0,anchor:"top-left",dx:0,dy:0}),{displayMode:a,x:o,y:l,width:c,height:u,row:h,col:d,anchor:f,dx:p,dy:g,className:m,children:b,style:y}=s;let v,x,S,A;if("position"===a)v=o+p+"px",x=l+g+"px",S=c+"px",A=u+"px";else if("cell"===a){const t=r&&d>=0&&h>=0?r?.getCellRelativeRect(d,h):{width:0,height:0,left:-9999,top:-9999};S=hh(c,t.width)+"px",A=hh(u,t.height)+"px","top-left"===f?(v=t.left+hh(p,t.width)+"px",x=t.top+hh(g,t.height)+"px"):"top-right"===f?(v=t.left+hh(p,t.width)+t.width+"px",x=t.top+hh(g,t.height)+"px"):"bottom-left"===f?(v=t.left+hh(p,t.width)+"px",x=t.top+hh(g,t.height)+t.height+"px"):"bottom-right"===f&&(v=t.left+hh(p,t.width)+t.width+"px",x=t.top+hh(g,t.height)+t.height+"px")}const w=_({},y,{position:"absolute",zIndex:1e3,width:S,height:A,left:v,top:x});return n.createElement("div",{className:m,style:w},n.Children.map(b,(t=>t?n.cloneElement(t,{}):t)))},t.CustomLayout=Ku,t.EmptyTip=ch,t.Group=dh,t.Image="image",t.Line="line",t.Link=yh,t.ListColumn=th,t.ListTable=Mu,t.ListTableSimple=Ou,t.Menu=oh,t.Path="path",t.PivotChart=Eu,t.PivotColumnDimension=eh,t.PivotColumnHeaderTitle=rh,t.PivotCorner=ah,t.PivotIndicator=ih,t.PivotRowDimension=nh,t.PivotRowHeaderTitle=sh,t.PivotTable=Pu,t.PivotTableSimple=Lu,t.Polygon="polygon",t.Popover=Th,t.Radio=Mh,t.Rect="rect",t.RichText="richtext",t.Symbol="symbol",t.Tag=Bh,t.Text=fh,t.Title=uh,t.Tooltip=lh,t.VTableReactAttributePlugin=_u,t.registerChartModule=function(t,n){e.register.chartModule(t,n)},t.version="1.22.3-alpha.0"}));
10
+ */Du.exports=(Uu||(Uu=1,Nu=function(t){var e={},i=n,r=Fu(),s=Object.assign;function a(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=Symbol.for("react.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),_=Symbol.iterator;function S(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=_&&t[_]||t["@@iterator"])?t:null}function A(t){if(null==t)return null;if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case u:return"Fragment";case c:return"Portal";case d:return"Profiler";case h:return"StrictMode";case m:return"Suspense";case b:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case p:return(t.displayName||"Context")+".Consumer";case f:return(t._context.displayName||"Context")+".Provider";case g:var e=t.render;return(t=t.displayName)||(t=""!==(t=e.displayName||e.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case y:return null!==(e=t.displayName||null)?e:A(t.type)||"Memo";case v:e=t._payload,t=t._init;try{return A(t(e))}catch(t){}}return null}function w(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=(t=e.render).displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return A(e);case 8:return e===h?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e}return null}function T(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do{0!=(4098&(e=t).flags)&&(n=e.return),t=e.return}while(t)}return 3===e.tag?n:null}function C(t){if(T(t)!==t)throw Error(a(188))}function B(t){var e=t.alternate;if(!e){if(null===(e=T(t)))throw Error(a(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(null===r)break;var s=r.alternate;if(null===s){if(null!==(i=r.return)){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return C(r),t;if(s===i)return C(r),e;s=s.sibling}throw Error(a(188))}if(n.return!==i.return)n=r,i=s;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,i=s;break}if(l===i){o=!0,i=r,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,i=r;break}if(l===i){o=!0,i=s,n=r;break}l=l.sibling}if(!o)throw Error(a(189))}}if(n.alternate!==i)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?t:e}function k(t){return null!==(t=B(t))?M(t):null}function M(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){var e=M(t);if(null!==e)return e;t=t.sibling}return null}function P(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){if(4!==t.tag){var e=P(t);if(null!==e)return e}t=t.sibling}return null}var E,O=Array.isArray,L=t.getPublicInstance,R=t.getRootHostContext,I=t.getChildHostContext,N=t.prepareForCommit,U=t.resetAfterCommit,D=t.createInstance,z=t.appendInitialChild,W=t.finalizeInitialChildren,F=t.prepareUpdate,j=t.shouldSetTextContent,H=t.createTextInstance,G=t.scheduleTimeout,V=t.cancelTimeout,$=t.noTimeout,X=t.isPrimaryRenderer,Y=t.supportsMutation,K=t.supportsPersistence,q=t.supportsHydration,Q=t.getInstanceFromNode,Z=t.preparePortalMount,J=t.getCurrentEventPriority,tt=t.detachDeletedInstance,et=t.supportsMicrotasks,nt=t.scheduleMicrotask,it=t.supportsTestSelectors,rt=t.findFiberRoot,st=t.getBoundingRect,at=t.getTextContent,ot=t.isHiddenSubtree,lt=t.matchAccessibilityRole,ct=t.setFocusIfFocusable,ut=t.setupIntersectionObserver,ht=t.appendChild,dt=t.appendChildToContainer,ft=t.commitTextUpdate,pt=t.commitMount,gt=t.commitUpdate,mt=t.insertBefore,bt=t.insertInContainerBefore,yt=t.removeChild,vt=t.removeChildFromContainer,xt=t.resetTextContent,_t=t.hideInstance,St=t.hideTextInstance,At=t.unhideInstance,wt=t.unhideTextInstance,Tt=t.clearContainer,Ct=t.cloneInstance,Bt=t.createContainerChildSet,kt=t.appendChildToContainerChildSet,Mt=t.finalizeContainerChildren,Pt=t.replaceContainerChildren,Et=t.cloneHiddenInstance,Ot=t.cloneHiddenTextInstance,Lt=t.canHydrateInstance,Rt=t.canHydrateTextInstance,It=t.canHydrateSuspenseInstance,Nt=t.isSuspenseInstancePending,Ut=t.isSuspenseInstanceFallback,Dt=t.getSuspenseInstanceFallbackErrorDetails,zt=t.registerSuspenseInstanceRetry,Wt=t.getNextHydratableSibling,Ft=t.getFirstHydratableChild,jt=t.getFirstHydratableChildWithinContainer,Ht=t.getFirstHydratableChildWithinSuspenseInstance,Gt=t.hydrateInstance,Vt=t.hydrateTextInstance,$t=t.hydrateSuspenseInstance,Xt=t.getNextHydratableInstanceAfterSuspenseInstance,Yt=t.commitHydratedContainer,Kt=t.commitHydratedSuspenseInstance,qt=t.clearSuspenseBoundary,Qt=t.clearSuspenseBoundaryFromContainer,Zt=t.shouldDeleteUnhydratedTailInstances,Jt=t.didNotMatchHydratedContainerTextInstance,te=t.didNotMatchHydratedTextInstance;function ee(t){if(void 0===E)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);E=e&&e[1]||""}return"\n"+E+t}var ne=!1;function ie(t,e){if(!t||ne)return"";ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(e,[])}catch(t){var i=t}Reflect.construct(t,[],e)}else{try{e.call()}catch(t){i=t}t.call(e.prototype)}else{try{throw Error()}catch(t){i=t}t()}}catch(e){if(e&&i&&"string"==typeof e.stack){for(var r=e.stack.split("\n"),s=i.stack.split("\n"),a=r.length-1,o=s.length-1;1<=a&&0<=o&&r[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(r[a]!==s[o]){if(1!==a||1!==o)do{if(a--,0>--o||r[a]!==s[o]){var l="\n"+r[a].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}}while(1<=a&&0<=o);break}}}finally{ne=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ee(t):""}var re=Object.prototype.hasOwnProperty,se=[],ae=-1;function oe(t){return{current:t}}function le(t){0>ae||(t.current=se[ae],se[ae]=null,ae--)}function ce(t,e){ae++,se[ae]=t.current,t.current=e}var ue={},he=oe(ue),de=oe(!1),fe=ue;function pe(t,e){var n=t.type.contextTypes;if(!n)return ue;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r,s={};for(r in n)s[r]=e[r];return i&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function ge(t){return null!=t.childContextTypes}function me(){le(de),le(he)}function be(t,e,n){if(he.current!==ue)throw Error(a(168));ce(he,e),ce(de,n)}function ye(t,e,n){var i=t.stateNode;if(e=e.childContextTypes,"function"!=typeof i.getChildContext)return n;for(var r in i=i.getChildContext())if(!(r in e))throw Error(a(108,w(t)||"Unknown",r));return s({},n,i)}function ve(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ue,fe=he.current,ce(he,t),ce(de,de.current),!0}function xe(t,e,n){var i=t.stateNode;if(!i)throw Error(a(169));n?(t=ye(t,e,fe),i.__reactInternalMemoizedMergedChildContext=t,le(de),le(he),ce(he,t)):le(de),ce(de,n)}var _e=Math.clz32?Math.clz32:function(t){return 0==(t>>>=0)?32:31-(Se(t)/Ae|0)|0},Se=Math.log,Ae=Math.LN2,we=64,Te=4194304;function Ce(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&t;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&t;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Be(t,e){var n=t.pendingLanes;if(0===n)return 0;var i=0,r=t.suspendedLanes,s=t.pingedLanes,a=268435455&n;if(0!==a){var o=a&~r;0!==o?i=Ce(o):0!=(s&=a)&&(i=Ce(s))}else 0!=(a=n&~r)?i=Ce(a):0!==s&&(i=Ce(s));if(0===i)return 0;if(0!==e&&e!==i&&0==(e&r)&&((r=i&-i)>=(s=e&-e)||16===r&&0!=(4194240&s)))return e;if(0!=(4&i)&&(i|=16&n),0!==(e=t.entangledLanes))for(t=t.entanglements,e&=i;0<e;)r=1<<(n=31-_e(e)),i|=t[n],e&=~r;return i}function ke(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;default:return-1}}function Me(t){return 0!=(t=-1073741825&t.pendingLanes)?t:1073741824&t?1073741824:0}function Pe(){var t=we;return 0==(4194240&(we<<=1))&&(we=64),t}function Ee(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Oe(t,e,n){t.pendingLanes|=e,536870912!==e&&(t.suspendedLanes=0,t.pingedLanes=0),(t=t.eventTimes)[e=31-_e(e)]=n}function Le(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-_e(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}var Re=0;function Ie(t){return 1<(t&=-t)?4<t?0!=(268435455&t)?16:536870912:4:1}var Ne=r.unstable_scheduleCallback,Ue=r.unstable_cancelCallback,De=r.unstable_shouldYield,ze=r.unstable_requestPaint,We=r.unstable_now,Fe=r.unstable_ImmediatePriority,je=r.unstable_UserBlockingPriority,He=r.unstable_NormalPriority,Ge=r.unstable_IdlePriority,Ve=null,$e=null,Xe="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},Ye=null,Ke=!1,qe=!1;function Qe(t){null===Ye?Ye=[t]:Ye.push(t)}function Ze(){if(!qe&&null!==Ye){qe=!0;var t=0,e=Re;try{var n=Ye;for(Re=1;t<n.length;t++){var i=n[t];do{i=i(!0)}while(null!==i)}Ye=null,Ke=!1}catch(e){throw null!==Ye&&(Ye=Ye.slice(t+1)),Ne(Fe,Ze),e}finally{Re=e,qe=!1}}return null}var Je=[],tn=0,en=null,nn=0,rn=[],sn=0,an=null,on=1,ln="";function cn(t,e){Je[tn++]=nn,Je[tn++]=en,en=t,nn=e}function un(t,e,n){rn[sn++]=on,rn[sn++]=ln,rn[sn++]=an,an=t;var i=on;t=ln;var r=32-_e(i)-1;i&=~(1<<r),n+=1;var s=32-_e(e)+r;if(30<s){var a=r-r%5;s=(i&(1<<a)-1).toString(32),i>>=a,r-=a,on=1<<32-_e(e)+r|n<<r|i,ln=s+t}else on=1<<s|n<<r|i,ln=t}function hn(t){null!==t.return&&(cn(t,1),un(t,1,0))}function dn(t){for(;t===en;)en=Je[--tn],Je[tn]=null,nn=Je[--tn],Je[tn]=null;for(;t===an;)an=rn[--sn],rn[sn]=null,ln=rn[--sn],rn[sn]=null,on=rn[--sn],rn[sn]=null}var fn=null,pn=null,gn=!1,mn=!1,bn=null;function yn(t,e){var n=ro(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,null===(e=t.deletions)?(t.deletions=[n],t.flags|=16):e.push(n)}function vn(t,e){switch(t.tag){case 5:return null!==(e=Lt(e,t.type,t.pendingProps))&&(t.stateNode=e,fn=t,pn=Ft(e),!0);case 6:return null!==(e=Rt(e,t.pendingProps))&&(t.stateNode=e,fn=t,pn=null,!0);case 13:if(null!==(e=It(e))){var n=null!==an?{id:on,overflow:ln}:null;return t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},(n=ro(18,null,null,0)).stateNode=e,n.return=t,t.child=n,fn=t,pn=null,!0}return!1;default:return!1}}function xn(t){return 0!=(1&t.mode)&&0==(128&t.flags)}function _n(t){if(gn){var e=pn;if(e){var n=e;if(!vn(t,e)){if(xn(t))throw Error(a(418));e=Wt(n);var i=fn;e&&vn(t,e)?yn(i,n):(t.flags=-4097&t.flags|2,gn=!1,fn=t)}}else{if(xn(t))throw Error(a(418));t.flags=-4097&t.flags|2,gn=!1,fn=t}}}function Sn(t){for(t=t.return;null!==t&&5!==t.tag&&3!==t.tag&&13!==t.tag;)t=t.return;fn=t}function An(t){if(!q||t!==fn)return!1;if(!gn)return Sn(t),gn=!0,!1;if(3!==t.tag&&(5!==t.tag||Zt(t.type)&&!j(t.type,t.memoizedProps))){var e=pn;if(e){if(xn(t))throw wn(),Error(a(418));for(;e;)yn(t,e),e=Wt(e)}}if(Sn(t),13===t.tag){if(!q)throw Error(a(316));if(!(t=null!==(t=t.memoizedState)?t.dehydrated:null))throw Error(a(317));pn=Xt(t)}else pn=fn?Wt(t.stateNode):null;return!0}function wn(){for(var t=pn;t;)t=Wt(t)}function Tn(){q&&(pn=fn=null,mn=gn=!1)}function Cn(t){null===bn?bn=[t]:bn.push(t)}var Bn=o.ReactCurrentBatchConfig;function kn(t,e){if(Xe(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!re.call(e,r)||!Xe(t[r],e[r]))return!1}return!0}function Mn(t){switch(t.tag){case 5:return ee(t.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return ie(t.type,!1);case 11:return ie(t.type.render,!1);case 1:return ie(t.type,!0);default:return""}}function Pn(t,e,n){if(null!==(t=n.ref)&&"function"!=typeof t&&"object"!=typeof t){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var i=n.stateNode}if(!i)throw Error(a(147,t));var r=i,s=""+t;return null!==e&&null!==e.ref&&"function"==typeof e.ref&&e.ref._stringRef===s?e.ref:(e=function(t){var e=r.refs;null===t?delete e[s]:e[s]=t},e._stringRef=s,e)}if("string"!=typeof t)throw Error(a(284));if(!n._owner)throw Error(a(290,t))}return t}function En(t,e){throw t=Object.prototype.toString.call(e),Error(a(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function On(t){return(0,t._init)(t._payload)}function Ln(t){function e(e,n){if(t){var i=e.deletions;null===i?(e.deletions=[n],e.flags|=16):i.push(n)}}function n(n,i){if(!t)return null;for(;null!==i;)e(n,i),i=i.sibling;return null}function i(t,e){for(t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function r(t,e){return(t=ao(t,e)).index=0,t.sibling=null,t}function s(e,n,i){return e.index=i,t?null!==(i=e.alternate)?(i=i.index)<n?(e.flags|=2,n):i:(e.flags|=2,n):(e.flags|=1048576,n)}function o(e){return t&&null===e.alternate&&(e.flags|=2),e}function h(t,e,n,i){return null===e||6!==e.tag?((e=uo(n,t.mode,i)).return=t,e):((e=r(e,n)).return=t,e)}function d(t,e,n,i){var s=n.type;return s===u?p(t,e,n.props.children,i,n.key):null!==e&&(e.elementType===s||"object"==typeof s&&null!==s&&s.$$typeof===v&&On(s)===e.type)?((i=r(e,n.props)).ref=Pn(t,e,n),i.return=t,i):((i=oo(n.type,n.key,n.props,null,t.mode,i)).ref=Pn(t,e,n),i.return=t,i)}function f(t,e,n,i){return null===e||4!==e.tag||e.stateNode.containerInfo!==n.containerInfo||e.stateNode.implementation!==n.implementation?((e=ho(n,t.mode,i)).return=t,e):((e=r(e,n.children||[])).return=t,e)}function p(t,e,n,i,s){return null===e||7!==e.tag?((e=lo(n,t.mode,i,s)).return=t,e):((e=r(e,n)).return=t,e)}function g(t,e,n){if("string"==typeof e&&""!==e||"number"==typeof e)return(e=uo(""+e,t.mode,n)).return=t,e;if("object"==typeof e&&null!==e){switch(e.$$typeof){case l:return(n=oo(e.type,e.key,e.props,null,t.mode,n)).ref=Pn(t,null,e),n.return=t,n;case c:return(e=ho(e,t.mode,n)).return=t,e;case v:return g(t,(0,e._init)(e._payload),n)}if(O(e)||S(e))return(e=lo(e,t.mode,n,null)).return=t,e;En(t,e)}return null}function m(t,e,n,i){var r=null!==e?e.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==r?null:h(t,e,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case l:return n.key===r?d(t,e,n,i):null;case c:return n.key===r?f(t,e,n,i):null;case v:return m(t,e,(r=n._init)(n._payload),i)}if(O(n)||S(n))return null!==r?null:p(t,e,n,i,null);En(t,n)}return null}function b(t,e,n,i,r){if("string"==typeof i&&""!==i||"number"==typeof i)return h(e,t=t.get(n)||null,""+i,r);if("object"==typeof i&&null!==i){switch(i.$$typeof){case l:return d(e,t=t.get(null===i.key?n:i.key)||null,i,r);case c:return f(e,t=t.get(null===i.key?n:i.key)||null,i,r);case v:return b(t,e,n,(0,i._init)(i._payload),r)}if(O(i)||S(i))return p(e,t=t.get(n)||null,i,r,null);En(e,i)}return null}function y(r,a,o,l){for(var c=null,u=null,h=a,d=a=0,f=null;null!==h&&d<o.length;d++){h.index>d?(f=h,h=null):f=h.sibling;var p=m(r,h,o[d],l);if(null===p){null===h&&(h=f);break}t&&h&&null===p.alternate&&e(r,h),a=s(p,a,d),null===u?c=p:u.sibling=p,u=p,h=f}if(d===o.length)return n(r,h),gn&&cn(r,d),c;if(null===h){for(;d<o.length;d++)null!==(h=g(r,o[d],l))&&(a=s(h,a,d),null===u?c=h:u.sibling=h,u=h);return gn&&cn(r,d),c}for(h=i(r,h);d<o.length;d++)null!==(f=b(h,r,d,o[d],l))&&(t&&null!==f.alternate&&h.delete(null===f.key?d:f.key),a=s(f,a,d),null===u?c=f:u.sibling=f,u=f);return t&&h.forEach((function(t){return e(r,t)})),gn&&cn(r,d),c}function x(r,o,l,c){var u=S(l);if("function"!=typeof u)throw Error(a(150));if(null==(l=u.call(l)))throw Error(a(151));for(var h=u=null,d=o,f=o=0,p=null,y=l.next();null!==d&&!y.done;f++,y=l.next()){d.index>f?(p=d,d=null):p=d.sibling;var v=m(r,d,y.value,c);if(null===v){null===d&&(d=p);break}t&&d&&null===v.alternate&&e(r,d),o=s(v,o,f),null===h?u=v:h.sibling=v,h=v,d=p}if(y.done)return n(r,d),gn&&cn(r,f),u;if(null===d){for(;!y.done;f++,y=l.next())null!==(y=g(r,y.value,c))&&(o=s(y,o,f),null===h?u=y:h.sibling=y,h=y);return gn&&cn(r,f),u}for(d=i(r,d);!y.done;f++,y=l.next())null!==(y=b(d,r,f,y.value,c))&&(t&&null!==y.alternate&&d.delete(null===y.key?f:y.key),o=s(y,o,f),null===h?u=y:h.sibling=y,h=y);return t&&d.forEach((function(t){return e(r,t)})),gn&&cn(r,f),u}return function t(i,s,a,h){if("object"==typeof a&&null!==a&&a.type===u&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case l:t:{for(var d=a.key,f=s;null!==f;){if(f.key===d){if((d=a.type)===u){if(7===f.tag){n(i,f.sibling),(s=r(f,a.props.children)).return=i,i=s;break t}}else if(f.elementType===d||"object"==typeof d&&null!==d&&d.$$typeof===v&&On(d)===f.type){n(i,f.sibling),(s=r(f,a.props)).ref=Pn(i,f,a),s.return=i,i=s;break t}n(i,f);break}e(i,f),f=f.sibling}a.type===u?((s=lo(a.props.children,i.mode,h,a.key)).return=i,i=s):((h=oo(a.type,a.key,a.props,null,i.mode,h)).ref=Pn(i,s,a),h.return=i,i=h)}return o(i);case c:t:{for(f=a.key;null!==s;){if(s.key===f){if(4===s.tag&&s.stateNode.containerInfo===a.containerInfo&&s.stateNode.implementation===a.implementation){n(i,s.sibling),(s=r(s,a.children||[])).return=i,i=s;break t}n(i,s);break}e(i,s),s=s.sibling}(s=ho(a,i.mode,h)).return=i,i=s}return o(i);case v:return t(i,s,(f=a._init)(a._payload),h)}if(O(a))return y(i,s,a,h);if(S(a))return x(i,s,a,h);En(i,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==s&&6===s.tag?(n(i,s.sibling),(s=r(s,a)).return=i,i=s):(n(i,s),(s=uo(a,i.mode,h)).return=i,i=s),o(i)):n(i,s)}}var Rn=Ln(!0),In=Ln(!1),Nn=oe(null),Un=null,Dn=null,zn=null;function Wn(){zn=Dn=Un=null}function Fn(t,e,n){X?(ce(Nn,e._currentValue),e._currentValue=n):(ce(Nn,e._currentValue2),e._currentValue2=n)}function jn(t){var e=Nn.current;le(Nn),X?t._currentValue=e:t._currentValue2=e}function Hn(t,e,n){for(;null!==t;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,null!==i&&(i.childLanes|=e)):null!==i&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function Gn(t,e){Un=t,zn=Dn=null,null!==(t=t.dependencies)&&null!==t.firstContext&&(0!=(t.lanes&e)&&(Or=!0),t.firstContext=null)}function Vn(t){var e=X?t._currentValue:t._currentValue2;if(zn!==t)if(t={context:t,memoizedValue:e,next:null},null===Dn){if(null===Un)throw Error(a(308));Dn=t,Un.dependencies={lanes:0,firstContext:t}}else Dn=Dn.next=t;return e}var $n=null;function Xn(t){null===$n?$n=[t]:$n.push(t)}function Yn(t,e,n,i){var r=e.interleaved;return null===r?(n.next=n,Xn(e)):(n.next=r.next,r.next=n),e.interleaved=n,Kn(t,i)}function Kn(t,e){t.lanes|=e;var n=t.alternate;for(null!==n&&(n.lanes|=e),n=t,t=t.return;null!==t;)t.childLanes|=e,null!==(n=t.alternate)&&(n.childLanes|=e),n=t,t=t.return;return 3===n.tag?n.stateNode:null}var qn=!1;function Qn(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zn(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Jn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ti(t,e,n){var i=t.updateQueue;if(null===i)return null;if(i=i.shared,0!=(2&ta)){var r=i.pending;return null===r?e.next=e:(e.next=r.next,r.next=e),i.pending=e,Kn(t,n)}return null===(r=i.interleaved)?(e.next=e,Xn(i)):(e.next=r.next,r.next=e),i.interleaved=e,Kn(t,n)}function ei(t,e,n){if(null!==(e=e.updateQueue)&&(e=e.shared,0!=(4194240&n))){var i=e.lanes;n|=i&=t.pendingLanes,e.lanes=n,Le(t,n)}}function ni(t,e){var n=t.updateQueue,i=t.alternate;if(null!==i&&n===(i=i.updateQueue)){var r=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===s?r=s=a:s=s.next=a,n=n.next}while(null!==n);null===s?r=s=e:s=s.next=e}else r=s=e;return n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},void(t.updateQueue=n)}null===(t=n.lastBaseUpdate)?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function ii(t,e,n,i){var r=t.updateQueue;qn=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(null!==l){r.shared.pending=null;var c=l,u=c.next;c.next=null,null===o?a=u:o.next=u,o=c;var h=t.alternate;null!==h&&(l=(h=h.updateQueue).lastBaseUpdate)!==o&&(null===l?h.firstBaseUpdate=u:l.next=u,h.lastBaseUpdate=c)}if(null!==a){var d=r.baseState;for(o=0,h=u=c=null,l=a;;){var f=l.lane,p=l.eventTime;if((i&f)===f){null!==h&&(h=h.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});t:{var g=t,m=l;switch(f=e,p=n,m.tag){case 1:if("function"==typeof(g=m.payload)){d=g.call(p,d,f);break t}d=g;break t;case 3:g.flags=-65537&g.flags|128;case 0:if(null==(f="function"==typeof(g=m.payload)?g.call(p,d,f):g))break t;d=s({},d,f);break t;case 2:qn=!0}}null!==l.callback&&0!==l.lane&&(t.flags|=64,null===(f=r.effects)?r.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===h?(u=h=p,c=d):h=h.next=p,o|=f;if(null===(l=l.next)){if(null===(l=r.shared.pending))break;l=(f=l).next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}if(null===h&&(c=d),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=h,null!==(e=r.shared.interleaved)){r=e;do{o|=r.lane,r=r.next}while(r!==e)}else null===a&&(r.shared.lanes=0);la|=o,t.lanes=o,t.memoizedState=d}}function ri(t,e,n){if(t=e.effects,e.effects=null,null!==t)for(e=0;e<t.length;e++){var i=t[e],r=i.callback;if(null!==r){if(i.callback=null,i=n,"function"!=typeof r)throw Error(a(191,r));r.call(i)}}}var si={},ai=oe(si),oi=oe(si),li=oe(si);function ci(t){if(t===si)throw Error(a(174));return t}function ui(t,e){ce(li,e),ce(oi,t),ce(ai,si),t=R(e),le(ai),ce(ai,t)}function hi(){le(ai),le(oi),le(li)}function di(t){var e=ci(li.current),n=ci(ai.current);n!==(e=I(n,t.type,e))&&(ce(oi,t),ce(ai,e))}function fi(t){oi.current===t&&(le(ai),le(oi))}var pi=oe(0);function gi(t){for(var e=t;null!==e;){if(13===e.tag){var n=e.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Nt(n)||Ut(n)))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!=(128&e.flags))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var mi=[];function bi(){for(var t=0;t<mi.length;t++){var e=mi[t];X?e._workInProgressVersionPrimary=null:e._workInProgressVersionSecondary=null}mi.length=0}var yi=o.ReactCurrentDispatcher,vi=o.ReactCurrentBatchConfig,xi=0,_i=null,Si=null,Ai=null,wi=!1,Ti=!1,Ci=0,Bi=0;function ki(){throw Error(a(321))}function Mi(t,e){if(null===e)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Xe(t[n],e[n]))return!1;return!0}function Pi(t,e,n,i,r,s){if(xi=s,_i=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,yi.current=null===t||null===t.memoizedState?fr:pr,t=n(i,r),Ti){s=0;do{if(Ti=!1,Ci=0,25<=s)throw Error(a(301));s+=1,Ai=Si=null,e.updateQueue=null,yi.current=gr,t=n(i,r)}while(Ti)}if(yi.current=dr,e=null!==Si&&null!==Si.next,xi=0,Ai=Si=_i=null,wi=!1,e)throw Error(a(300));return t}function Ei(){var t=0!==Ci;return Ci=0,t}function Oi(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ai?_i.memoizedState=Ai=t:Ai=Ai.next=t,Ai}function Li(){if(null===Si){var t=_i.alternate;t=null!==t?t.memoizedState:null}else t=Si.next;var e=null===Ai?_i.memoizedState:Ai.next;if(null!==e)Ai=e,Si=t;else{if(null===t)throw Error(a(310));t={memoizedState:(Si=t).memoizedState,baseState:Si.baseState,baseQueue:Si.baseQueue,queue:Si.queue,next:null},null===Ai?_i.memoizedState=Ai=t:Ai=Ai.next=t}return Ai}function Ri(t,e){return"function"==typeof e?e(t):e}function Ii(t){var e=Li(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var i=Si,r=i.baseQueue,s=n.pending;if(null!==s){if(null!==r){var o=r.next;r.next=s.next,s.next=o}i.baseQueue=r=s,n.pending=null}if(null!==r){s=r.next,i=i.baseState;var l=o=null,c=null,u=s;do{var h=u.lane;if((xi&h)===h)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:t(i,u.action);else{var d={lane:h,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=d,o=i):c=c.next=d,_i.lanes|=h,la|=h}u=u.next}while(null!==u&&u!==s);null===c?o=i:c.next=l,Xe(i,e.memoizedState)||(Or=!0),e.memoizedState=i,e.baseState=o,e.baseQueue=c,n.lastRenderedState=i}if(null!==(t=n.interleaved)){r=t;do{s=r.lane,_i.lanes|=s,la|=s,r=r.next}while(r!==t)}else null===r&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Ni(t){var e=Li(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(null!==r){n.pending=null;var o=r=r.next;do{s=t(s,o.action),o=o.next}while(o!==r);Xe(s,e.memoizedState)||(Or=!0),e.memoizedState=s,null===e.baseQueue&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function Ui(){}function Di(t,e){var n=_i,i=Li(),r=e(),s=!Xe(i.memoizedState,r);if(s&&(i.memoizedState=r,Or=!0),i=i.queue,qi(Fi.bind(null,n,i,t),[t]),i.getSnapshot!==e||s||null!==Ai&&1&Ai.memoizedState.tag){if(n.flags|=2048,Vi(9,Wi.bind(null,n,i,r,e),void 0,null),null===ea)throw Error(a(349));0!=(30&xi)||zi(n,e,r)}return r}function zi(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},null===(e=_i.updateQueue)?(e={lastEffect:null,stores:null},_i.updateQueue=e,e.stores=[t]):null===(n=e.stores)?e.stores=[t]:n.push(t)}function Wi(t,e,n,i){e.value=n,e.getSnapshot=i,ji(e)&&Hi(t)}function Fi(t,e,n){return n((function(){ji(e)&&Hi(t)}))}function ji(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Xe(t,n)}catch(t){return!0}}function Hi(t){var e=Kn(t,1);null!==e&&Pa(e,t,1,-1)}function Gi(t){var e=Oi();return"function"==typeof t&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:t},e.queue=t,t=t.dispatch=lr.bind(null,_i,t),[e.memoizedState,t]}function Vi(t,e,n,i){return t={tag:t,create:e,destroy:n,deps:i,next:null},null===(e=_i.updateQueue)?(e={lastEffect:null,stores:null},_i.updateQueue=e,e.lastEffect=t.next=t):null===(n=e.lastEffect)?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function $i(){return Li().memoizedState}function Xi(t,e,n,i){var r=Oi();_i.flags|=t,r.memoizedState=Vi(1|e,n,void 0,void 0===i?null:i)}function Yi(t,e,n,i){var r=Li();i=void 0===i?null:i;var s=void 0;if(null!==Si){var a=Si.memoizedState;if(s=a.destroy,null!==i&&Mi(i,a.deps))return void(r.memoizedState=Vi(e,n,s,i))}_i.flags|=t,r.memoizedState=Vi(1|e,n,s,i)}function Ki(t,e){return Xi(8390656,8,t,e)}function qi(t,e){return Yi(2048,8,t,e)}function Qi(t,e){return Yi(4,2,t,e)}function Zi(t,e){return Yi(4,4,t,e)}function Ji(t,e){return"function"==typeof e?(t=t(),e(t),function(){e(null)}):null!=e?(t=t(),e.current=t,function(){e.current=null}):void 0}function tr(t,e,n){return n=null!=n?n.concat([t]):null,Yi(4,4,Ji.bind(null,e,t),n)}function er(){}function nr(t,e){var n=Li();e=void 0===e?null:e;var i=n.memoizedState;return null!==i&&null!==e&&Mi(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function ir(t,e){var n=Li();e=void 0===e?null:e;var i=n.memoizedState;return null!==i&&null!==e&&Mi(e,i[1])?i[0]:(t=t(),n.memoizedState=[t,e],t)}function rr(t,e,n){return 0==(21&xi)?(t.baseState&&(t.baseState=!1,Or=!0),t.memoizedState=n):(Xe(n,e)||(n=Pe(),_i.lanes|=n,la|=n,t.baseState=!0),e)}function sr(t,e){var n=Re;Re=0!==n&&4>n?n:4,t(!0);var i=vi.transition;vi.transition={};try{t(!1),e()}finally{Re=n,vi.transition=i}}function ar(){return Li().memoizedState}function or(t,e,n){var i=Ma(t);n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},cr(t)?ur(e,n):null!==(n=Yn(t,e,n,i))&&(Pa(n,t,i,ka()),hr(n,e,i))}function lr(t,e,n){var i=Ma(t),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(cr(t))ur(e,r);else{var s=t.alternate;if(0===t.lanes&&(null===s||0===s.lanes)&&null!==(s=e.lastRenderedReducer))try{var a=e.lastRenderedState,o=s(a,n);if(r.hasEagerState=!0,r.eagerState=o,Xe(o,a)){var l=e.interleaved;return null===l?(r.next=r,Xn(e)):(r.next=l.next,l.next=r),void(e.interleaved=r)}}catch(t){}null!==(n=Yn(t,e,r,i))&&(Pa(n,t,i,r=ka()),hr(n,e,i))}}function cr(t){var e=t.alternate;return t===_i||null!==e&&e===_i}function ur(t,e){Ti=wi=!0;var n=t.pending;null===n?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function hr(t,e,n){if(0!=(4194240&n)){var i=e.lanes;n|=i&=t.pendingLanes,e.lanes=n,Le(t,n)}}var dr={readContext:Vn,useCallback:ki,useContext:ki,useEffect:ki,useImperativeHandle:ki,useInsertionEffect:ki,useLayoutEffect:ki,useMemo:ki,useReducer:ki,useRef:ki,useState:ki,useDebugValue:ki,useDeferredValue:ki,useTransition:ki,useMutableSource:ki,useSyncExternalStore:ki,useId:ki,unstable_isNewReconciler:!1},fr={readContext:Vn,useCallback:function(t,e){return Oi().memoizedState=[t,void 0===e?null:e],t},useContext:Vn,useEffect:Ki,useImperativeHandle:function(t,e,n){return n=null!=n?n.concat([t]):null,Xi(4194308,4,Ji.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Xi(4194308,4,t,e)},useInsertionEffect:function(t,e){return Xi(4,2,t,e)},useMemo:function(t,e){var n=Oi();return e=void 0===e?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var i=Oi();return e=void 0!==n?n(e):e,i.memoizedState=i.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},i.queue=t,t=t.dispatch=or.bind(null,_i,t),[i.memoizedState,t]},useRef:function(t){return t={current:t},Oi().memoizedState=t},useState:Gi,useDebugValue:er,useDeferredValue:function(t){return Oi().memoizedState=t},useTransition:function(){var t=Gi(!1),e=t[0];return t=sr.bind(null,t[1]),Oi().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var i=_i,r=Oi();if(gn){if(void 0===n)throw Error(a(407));n=n()}else{if(n=e(),null===ea)throw Error(a(349));0!=(30&xi)||zi(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,Ki(Fi.bind(null,i,s,t),[t]),i.flags|=2048,Vi(9,Wi.bind(null,i,s,n,e),void 0,null),n},useId:function(){var t=Oi(),e=ea.identifierPrefix;if(gn){var n=ln;e=":"+e+"R"+(n=(on&~(1<<32-_e(on)-1)).toString(32)+n),0<(n=Ci++)&&(e+="H"+n.toString(32)),e+=":"}else e=":"+e+"r"+(n=Bi++).toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},pr={readContext:Vn,useCallback:nr,useContext:Vn,useEffect:qi,useImperativeHandle:tr,useInsertionEffect:Qi,useLayoutEffect:Zi,useMemo:ir,useReducer:Ii,useRef:$i,useState:function(){return Ii(Ri)},useDebugValue:er,useDeferredValue:function(t){return rr(Li(),Si.memoizedState,t)},useTransition:function(){return[Ii(Ri)[0],Li().memoizedState]},useMutableSource:Ui,useSyncExternalStore:Di,useId:ar,unstable_isNewReconciler:!1},gr={readContext:Vn,useCallback:nr,useContext:Vn,useEffect:qi,useImperativeHandle:tr,useInsertionEffect:Qi,useLayoutEffect:Zi,useMemo:ir,useReducer:Ni,useRef:$i,useState:function(){return Ni(Ri)},useDebugValue:er,useDeferredValue:function(t){var e=Li();return null===Si?e.memoizedState=t:rr(e,Si.memoizedState,t)},useTransition:function(){return[Ni(Ri)[0],Li().memoizedState]},useMutableSource:Ui,useSyncExternalStore:Di,useId:ar,unstable_isNewReconciler:!1};function mr(t,e){if(t&&t.defaultProps){for(var n in e=s({},e),t=t.defaultProps)void 0===e[n]&&(e[n]=t[n]);return e}return e}function br(t,e,n,i){n=null==(n=n(i,e=t.memoizedState))?e:s({},e,n),t.memoizedState=n,0===t.lanes&&(t.updateQueue.baseState=n)}var yr={isMounted:function(t){return!!(t=t._reactInternals)&&T(t)===t},enqueueSetState:function(t,e,n){t=t._reactInternals;var i=ka(),r=Ma(t),s=Jn(i,r);s.payload=e,null!=n&&(s.callback=n),null!==(e=ti(t,s,r))&&(Pa(e,t,r,i),ei(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=ka(),r=Ma(t),s=Jn(i,r);s.tag=1,s.payload=e,null!=n&&(s.callback=n),null!==(e=ti(t,s,r))&&(Pa(e,t,r,i),ei(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=ka(),i=Ma(t),r=Jn(n,i);r.tag=2,null!=e&&(r.callback=e),null!==(e=ti(t,r,i))&&(Pa(e,t,i,n),ei(e,t,i))}};function vr(t,e,n,i,r,s,a){return"function"==typeof(t=t.stateNode).shouldComponentUpdate?t.shouldComponentUpdate(i,s,a):!(e.prototype&&e.prototype.isPureReactComponent&&kn(n,i)&&kn(r,s))}function xr(t,e,n){var i=!1,r=ue,s=e.contextType;return"object"==typeof s&&null!==s?s=Vn(s):(r=ge(e)?fe:he.current,s=(i=null!=(i=e.contextTypes))?pe(t,r):ue),e=new e(n,s),t.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,e.updater=yr,t.stateNode=e,e._reactInternals=t,i&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=s),e}function _r(t,e,n,i){t=e.state,"function"==typeof e.componentWillReceiveProps&&e.componentWillReceiveProps(n,i),"function"==typeof e.UNSAFE_componentWillReceiveProps&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&yr.enqueueReplaceState(e,e.state,null)}function Sr(t,e,n,i){var r=t.stateNode;r.props=n,r.state=t.memoizedState,r.refs={},Qn(t);var s=e.contextType;"object"==typeof s&&null!==s?r.context=Vn(s):(s=ge(e)?fe:he.current,r.context=pe(t,s)),r.state=t.memoizedState,"function"==typeof(s=e.getDerivedStateFromProps)&&(br(t,e,s,n),r.state=t.memoizedState),"function"==typeof e.getDerivedStateFromProps||"function"==typeof r.getSnapshotBeforeUpdate||"function"!=typeof r.UNSAFE_componentWillMount&&"function"!=typeof r.componentWillMount||(e=r.state,"function"==typeof r.componentWillMount&&r.componentWillMount(),"function"==typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),e!==r.state&&yr.enqueueReplaceState(r,r.state,null),ii(t,n,r,i),r.state=t.memoizedState),"function"==typeof r.componentDidMount&&(t.flags|=4194308)}function Ar(t,e){try{var n="",i=e;do{n+=Mn(i),i=i.return}while(i);var r=n}catch(t){r="\nError generating stack: "+t.message+"\n"+t.stack}return{value:t,source:e,stack:r,digest:null}}function wr(t,e,n){return{value:t,source:null,stack:null!=n?n:null,digest:null!=e?e:null}}var Tr="function"==typeof WeakMap?WeakMap:Map;function Cr(t,e,n){(n=Jn(-1,n)).tag=3,n.payload={element:null};var i=e.value;return n.callback=function(){ya||(ya=!0,va=i)},n}function Br(t,e,n){(n=Jn(-1,n)).tag=3;var i=t.type.getDerivedStateFromError;if("function"==typeof i){var r=e.value;n.payload=function(){return i(r)},n.callback=function(){}}var s=t.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(n.callback=function(){"function"!=typeof i&&(null===xa?xa=new Set([this]):xa.add(this));var t=e.stack;this.componentDidCatch(e.value,{componentStack:null!==t?t:""})}),n}function kr(t,e,n){var i=t.pingCache;if(null===i){i=t.pingCache=new Tr;var r=new Set;i.set(e,r)}else void 0===(r=i.get(e))&&(r=new Set,i.set(e,r));r.has(n)||(r.add(n),t=Za.bind(null,t,e,n),e.then(t,t))}function Mr(t){do{var e;if((e=13===t.tag)&&(e=null===(e=t.memoizedState)||null!==e.dehydrated),e)return t;t=t.return}while(null!==t);return null}function Pr(t,e,n,i,r){return 0==(1&t.mode)?(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((e=Jn(-1,1)).tag=2,ti(n,e,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=r,t)}var Er=o.ReactCurrentOwner,Or=!1;function Lr(t,e,n,i){e.child=null===t?In(e,null,n,i):Rn(e,t.child,n,i)}function Rr(t,e,n,i,r){n=n.render;var s=e.ref;return Gn(e,r),i=Pi(t,e,n,i,s,r),n=Ei(),null===t||Or?(gn&&n&&hn(e),e.flags|=1,Lr(t,e,i,r),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,is(t,e,r))}function Ir(t,e,n,i,r){if(null===t){var s=n.type;return"function"!=typeof s||so(s)||void 0!==s.defaultProps||null!==n.compare||void 0!==n.defaultProps?((t=oo(n.type,null,i,e,e.mode,r)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=s,Nr(t,e,s,i,r))}if(s=t.child,0==(t.lanes&r)){var a=s.memoizedProps;if((n=null!==(n=n.compare)?n:kn)(a,i)&&t.ref===e.ref)return is(t,e,r)}return e.flags|=1,(t=ao(s,i)).ref=e.ref,t.return=e,e.child=t}function Nr(t,e,n,i,r){if(null!==t){var s=t.memoizedProps;if(kn(s,i)&&t.ref===e.ref){if(Or=!1,e.pendingProps=i=s,0==(t.lanes&r))return e.lanes=t.lanes,is(t,e,r);0!=(131072&t.flags)&&(Or=!0)}}return zr(t,e,n,i,r)}function Ur(t,e,n){var i=e.pendingProps,r=i.children,s=null!==t?t.memoizedState:null;if("hidden"===i.mode)if(0==(1&e.mode))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},ce(sa,ra),ra|=n;else{if(0==(1073741824&n))return t=null!==s?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,ce(sa,ra),ra|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=null!==s?s.baseLanes:n,ce(sa,ra),ra|=i}else null!==s?(i=s.baseLanes|n,e.memoizedState=null):i=n,ce(sa,ra),ra|=i;return Lr(t,e,r,n),e.child}function Dr(t,e){var n=e.ref;(null===t&&null!==n||null!==t&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function zr(t,e,n,i,r){var s=ge(n)?fe:he.current;return s=pe(e,s),Gn(e,r),n=Pi(t,e,n,i,s,r),i=Ei(),null===t||Or?(gn&&i&&hn(e),e.flags|=1,Lr(t,e,n,r),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,is(t,e,r))}function Wr(t,e,n,i,r){if(ge(n)){var s=!0;ve(e)}else s=!1;if(Gn(e,r),null===e.stateNode)ns(t,e),xr(e,n,i),Sr(e,n,i,r),i=!0;else if(null===t){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,c=n.contextType;c="object"==typeof c&&null!==c?Vn(c):pe(e,c=ge(n)?fe:he.current);var u=n.getDerivedStateFromProps,h="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;h||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==i||l!==c)&&_r(e,a,i,c),qn=!1;var d=e.memoizedState;a.state=d,ii(e,i,a,r),l=e.memoizedState,o!==i||d!==l||de.current||qn?("function"==typeof u&&(br(e,n,u,i),l=e.memoizedState),(o=qn||vr(e,n,o,i,d,l,c))?(h||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(e.flags|=4194308)):("function"==typeof a.componentDidMount&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),a.props=i,a.state=l,a.context=c,i=o):("function"==typeof a.componentDidMount&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,Zn(t,e),o=e.memoizedProps,c=e.type===e.elementType?o:mr(e.type,o),a.props=c,h=e.pendingProps,d=a.context,l="object"==typeof(l=n.contextType)&&null!==l?Vn(l):pe(e,l=ge(n)?fe:he.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==h||d!==l)&&_r(e,a,i,l),qn=!1,d=e.memoizedState,a.state=d,ii(e,i,a,r);var p=e.memoizedState;o!==h||d!==p||de.current||qn?("function"==typeof f&&(br(e,n,f,i),p=e.memoizedState),(c=qn||vr(e,n,c,i,d,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(i,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(i,p,l)),"function"==typeof a.componentDidUpdate&&(e.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(e.flags|=1024)):("function"!=typeof a.componentDidUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=p),a.props=i,a.state=p,a.context=l,i=c):("function"!=typeof a.componentDidUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),i=!1)}return Fr(t,e,n,i,s,r)}function Fr(t,e,n,i,r,s){Dr(t,e);var a=0!=(128&e.flags);if(!i&&!a)return r&&xe(e,n,!1),is(t,e,s);i=e.stateNode,Er.current=e;var o=a&&"function"!=typeof n.getDerivedStateFromError?null:i.render();return e.flags|=1,null!==t&&a?(e.child=Rn(e,t.child,null,s),e.child=Rn(e,null,o,s)):Lr(t,e,o,s),e.memoizedState=i.state,r&&xe(e,n,!0),e.child}function jr(t){var e=t.stateNode;e.pendingContext?be(0,e.pendingContext,e.pendingContext!==e.context):e.context&&be(0,e.context,!1),ui(t,e.containerInfo)}function Hr(t,e,n,i,r){return Tn(),Cn(r),e.flags|=256,Lr(t,e,n,i),e.child}var Gr,Vr,$r,Xr,Yr={dehydrated:null,treeContext:null,retryLane:0};function Kr(t){return{baseLanes:t,cachePool:null,transitions:null}}function qr(t,e,n){var i,r=e.pendingProps,s=pi.current,o=!1,l=0!=(128&e.flags);if((i=l)||(i=(null===t||null!==t.memoizedState)&&0!=(2&s)),i?(o=!0,e.flags&=-129):null!==t&&null===t.memoizedState||(s|=1),ce(pi,1&s),null===t)return _n(e),null!==(t=e.memoizedState)&&null!==(t=t.dehydrated)?(0==(1&e.mode)?e.lanes=1:Ut(t)?e.lanes=8:e.lanes=1073741824,null):(l=r.children,t=r.fallback,o?(r=e.mode,o=e.child,l={mode:"hidden",children:l},0==(1&r)&&null!==o?(o.childLanes=0,o.pendingProps=l):o=co(l,r,0,null),t=lo(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=Kr(n),e.memoizedState=Yr,t):Qr(e,l));if(null!==(s=t.memoizedState)&&null!==(i=s.dehydrated))return function(t,e,n,i,r,s,o){if(n)return 256&e.flags?(e.flags&=-257,Zr(t,e,o,i=wr(Error(a(422))))):null!==e.memoizedState?(e.child=t.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=co({mode:"visible",children:i.children},r,0,null),(s=lo(s,r,o,null)).flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,0!=(1&e.mode)&&Rn(e,t.child,null,o),e.child.memoizedState=Kr(o),e.memoizedState=Yr,s);if(0==(1&e.mode))return Zr(t,e,o,null);if(Ut(r))return i=Dt(r).digest,Zr(t,e,o,i=wr(s=Error(a(419)),i,void 0));if(n=0!=(o&t.childLanes),Or||n){if(null!==(i=ea)){switch(o&-o){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}0!==(r=0!=(r&(i.suspendedLanes|o))?0:r)&&r!==s.retryLane&&(s.retryLane=r,Kn(t,r),Pa(i,t,r,-1))}return ja(),Zr(t,e,o,i=wr(Error(a(421))))}return Nt(r)?(e.flags|=128,e.child=t.child,e=to.bind(null,t),zt(r,e),null):(t=s.treeContext,q&&(pn=Ht(r),fn=e,gn=!0,bn=null,mn=!1,null!==t&&(rn[sn++]=on,rn[sn++]=ln,rn[sn++]=an,on=t.id,ln=t.overflow,an=e)),(e=Qr(e,i.children)).flags|=4096,e)}(t,e,l,r,i,s,n);if(o){o=r.fallback,l=e.mode,i=(s=t.child).sibling;var c={mode:"hidden",children:r.children};return 0==(1&l)&&e.child!==s?((r=e.child).childLanes=0,r.pendingProps=c,e.deletions=null):(r=ao(s,c)).subtreeFlags=14680064&s.subtreeFlags,null!==i?o=ao(i,o):(o=lo(o,l,n,null)).flags|=2,o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,l=null===(l=t.child.memoizedState)?Kr(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=t.childLanes&~n,e.memoizedState=Yr,r}return t=(o=t.child).sibling,r=ao(o,{mode:"visible",children:r.children}),0==(1&e.mode)&&(r.lanes=n),r.return=e,r.sibling=null,null!==t&&(null===(n=e.deletions)?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Qr(t,e){return(e=co({mode:"visible",children:e},t.mode,0,null)).return=t,t.child=e}function Zr(t,e,n,i){return null!==i&&Cn(i),Rn(e,t.child,null,n),(t=Qr(e,e.pendingProps.children)).flags|=2,e.memoizedState=null,t}function Jr(t,e,n){t.lanes|=e;var i=t.alternate;null!==i&&(i.lanes|=e),Hn(t.return,e,n)}function ts(t,e,n,i,r){var s=t.memoizedState;null===s?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function es(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(Lr(t,e,i.children,n),0!=(2&(i=pi.current)))i=1&i|2,e.flags|=128;else{if(null!==t&&0!=(128&t.flags))t:for(t=e.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&Jr(t,n,e);else if(19===t.tag)Jr(t,n,e);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;null===t.sibling;){if(null===t.return||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}if(ce(pi,i),0==(1&e.mode))e.memoizedState=null;else switch(r){case"forwards":for(n=e.child,r=null;null!==n;)null!==(t=n.alternate)&&null===gi(t)&&(r=n),n=n.sibling;null===(n=r)?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),ts(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;null!==r;){if(null!==(t=r.alternate)&&null===gi(t)){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}ts(e,!0,n,null,s);break;case"together":ts(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ns(t,e){0==(1&e.mode)&&null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2)}function is(t,e,n){if(null!==t&&(e.dependencies=t.dependencies),la|=e.lanes,0==(n&e.childLanes))return null;if(null!==t&&e.child!==t.child)throw Error(a(153));if(null!==e.child){for(n=ao(t=e.child,t.pendingProps),e.child=n,n.return=e;null!==t.sibling;)t=t.sibling,(n=n.sibling=ao(t,t.pendingProps)).return=e;n.sibling=null}return e.child}function rs(t){t.flags|=4}function ss(t,e){if(null!==t&&t.child===e.child)return!0;if(0!=(16&e.flags))return!1;for(t=e.child;null!==t;){if(0!=(12854&t.flags)||0!=(12854&t.subtreeFlags))return!1;t=t.sibling}return!0}if(Y)Gr=function(t,e){for(var n=e.child;null!==n;){if(5===n.tag||6===n.tag)z(t,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Vr=function(){},$r=function(t,e,n,i,r){if((t=t.memoizedProps)!==i){var s=e.stateNode,a=ci(ai.current);n=F(s,n,t,i,r,a),(e.updateQueue=n)&&rs(e)}},Xr=function(t,e,n,i){n!==i&&rs(e)};else if(K){Gr=function(t,e,n,i){for(var r=e.child;null!==r;){if(5===r.tag){var s=r.stateNode;n&&i&&(s=Et(s,r.type,r.memoizedProps,r)),z(t,s)}else if(6===r.tag)s=r.stateNode,n&&i&&(s=Ot(s,r.memoizedProps,r)),z(t,s);else if(4!==r.tag)if(22===r.tag&&null!==r.memoizedState)null!==(s=r.child)&&(s.return=r),Gr(t,r,!0,!0);else if(null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};var as=function(t,e,n,i){for(var r=e.child;null!==r;){if(5===r.tag){var s=r.stateNode;n&&i&&(s=Et(s,r.type,r.memoizedProps,r)),kt(t,s)}else if(6===r.tag)s=r.stateNode,n&&i&&(s=Ot(s,r.memoizedProps,r)),kt(t,s);else if(4!==r.tag)if(22===r.tag&&null!==r.memoizedState)null!==(s=r.child)&&(s.return=r),as(t,r,!0,!0);else if(null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Vr=function(t,e){var n=e.stateNode;if(!ss(t,e)){t=n.containerInfo;var i=Bt(t);as(i,e,!1,!1),n.pendingChildren=i,rs(e),Mt(t,i)}},$r=function(t,e,n,i,r){var s=t.stateNode,a=t.memoizedProps;if((t=ss(t,e))&&a===i)e.stateNode=s;else{var o=e.stateNode,l=ci(ai.current),c=null;a!==i&&(c=F(o,n,a,i,r,l)),t&&null===c?e.stateNode=s:(s=Ct(s,c,n,a,i,e,t,o),W(s,n,i,r,l)&&rs(e),e.stateNode=s,t?rs(e):Gr(s,e,!1,!1))}},Xr=function(t,e,n,i){n!==i?(t=ci(li.current),n=ci(ai.current),e.stateNode=H(i,t,n,e),rs(e)):e.stateNode=t.stateNode}}else Vr=function(){},$r=function(){},Xr=function(){};function os(t,e){if(!gn)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;null!==e;)null!==e.alternate&&(n=e),e=e.sibling;null===n?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?e||null===t.tail?t.tail=null:t.tail.sibling=null:i.sibling=null}}function ls(t){var e=null!==t.alternate&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;null!==r;)n|=r.lanes|r.childLanes,i|=14680064&r.subtreeFlags,i|=14680064&r.flags,r.return=t,r=r.sibling;else for(r=t.child;null!==r;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function cs(t,e,n){var i=e.pendingProps;switch(dn(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ls(e),null;case 1:case 17:return ge(e.type)&&me(),ls(e),null;case 3:return n=e.stateNode,hi(),le(de),le(he),bi(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==t&&null!==t.child||(An(e)?rs(e):null===t||t.memoizedState.isDehydrated&&0==(256&e.flags)||(e.flags|=1024,null!==bn&&(Ra(bn),bn=null))),Vr(t,e),ls(e),null;case 5:fi(e),n=ci(li.current);var r=e.type;if(null!==t&&null!=e.stateNode)$r(t,e,r,i,n),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(null===e.stateNode)throw Error(a(166));return ls(e),null}if(t=ci(ai.current),An(e)){if(!q)throw Error(a(175));t=Gt(e.stateNode,e.type,e.memoizedProps,n,t,e,!mn),e.updateQueue=t,null!==t&&rs(e)}else{var s=D(r,i,n,t,e);Gr(s,e,!1,!1),e.stateNode=s,W(s,r,i,n,t)&&rs(e)}null!==e.ref&&(e.flags|=512,e.flags|=2097152)}return ls(e),null;case 6:if(t&&null!=e.stateNode)Xr(t,e,t.memoizedProps,i);else{if("string"!=typeof i&&null===e.stateNode)throw Error(a(166));if(t=ci(li.current),n=ci(ai.current),An(e)){if(!q)throw Error(a(176));if(t=e.stateNode,n=e.memoizedProps,(i=Vt(t,n,e,!mn))&&null!==(r=fn))switch(r.tag){case 3:Jt(r.stateNode.containerInfo,t,n,0!=(1&r.mode));break;case 5:te(r.type,r.memoizedProps,r.stateNode,t,n,0!=(1&r.mode))}i&&rs(e)}else e.stateNode=H(i,t,n,e)}return ls(e),null;case 13:if(le(pi),i=e.memoizedState,null===t||null!==t.memoizedState&&null!==t.memoizedState.dehydrated){if(gn&&null!==pn&&0!=(1&e.mode)&&0==(128&e.flags))wn(),Tn(),e.flags|=98560,r=!1;else if(r=An(e),null!==i&&null!==i.dehydrated){if(null===t){if(!r)throw Error(a(318));if(!q)throw Error(a(344));if(!(r=null!==(r=e.memoizedState)?r.dehydrated:null))throw Error(a(317));$t(r,e)}else Tn(),0==(128&e.flags)&&(e.memoizedState=null),e.flags|=4;ls(e),r=!1}else null!==bn&&(Ra(bn),bn=null),r=!0;if(!r)return 65536&e.flags?e:null}return 0!=(128&e.flags)?(e.lanes=n,e):((n=null!==i)!=(null!==t&&null!==t.memoizedState)&&n&&(e.child.flags|=8192,0!=(1&e.mode)&&(null===t||0!=(1&pi.current)?0===aa&&(aa=3):ja())),null!==e.updateQueue&&(e.flags|=4),ls(e),null);case 4:return hi(),Vr(t,e),null===t&&Z(e.stateNode.containerInfo),ls(e),null;case 10:return jn(e.type._context),ls(e),null;case 19:if(le(pi),null===(r=e.memoizedState))return ls(e),null;if(i=0!=(128&e.flags),null===(s=r.rendering))if(i)os(r,!1);else{if(0!==aa||null!==t&&0!=(128&t.flags))for(t=e.child;null!==t;){if(null!==(s=gi(t))){for(e.flags|=128,os(r,!1),null!==(t=s.updateQueue)&&(e.updateQueue=t,e.flags|=4),e.subtreeFlags=0,t=n,n=e.child;null!==n;)r=t,(i=n).flags&=14680066,null===(s=i.alternate)?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,r=s.dependencies,i.dependencies=null===r?null:{lanes:r.lanes,firstContext:r.firstContext}),n=n.sibling;return ce(pi,1&pi.current|2),e.child}t=t.sibling}null!==r.tail&&We()>pa&&(e.flags|=128,i=!0,os(r,!1),e.lanes=4194304)}else{if(!i)if(null!==(t=gi(s))){if(e.flags|=128,i=!0,null!==(t=t.updateQueue)&&(e.updateQueue=t,e.flags|=4),os(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!gn)return ls(e),null}else 2*We()-r.renderingStartTime>pa&&1073741824!==n&&(e.flags|=128,i=!0,os(r,!1),e.lanes=4194304);r.isBackwards?(s.sibling=e.child,e.child=s):(null!==(t=r.last)?t.sibling=s:e.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=We(),e.sibling=null,t=pi.current,ce(pi,i?1&t|2:1&t),e):(ls(e),null);case 22:case 23:return Da(),n=null!==e.memoizedState,null!==t&&null!==t.memoizedState!==n&&(e.flags|=8192),n&&0!=(1&e.mode)?0!=(1073741824&ra)&&(ls(e),Y&&6&e.subtreeFlags&&(e.flags|=8192)):ls(e),null;case 24:case 25:return null}throw Error(a(156,e.tag))}function us(t,e){switch(dn(e),e.tag){case 1:return ge(e.type)&&me(),65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 3:return hi(),le(de),le(he),bi(),0!=(65536&(t=e.flags))&&0==(128&t)?(e.flags=-65537&t|128,e):null;case 5:return fi(e),null;case 13:if(le(pi),null!==(t=e.memoizedState)&&null!==t.dehydrated){if(null===e.alternate)throw Error(a(340));Tn()}return 65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 19:return le(pi),null;case 4:return hi(),null;case 10:return jn(e.type._context),null;case 22:case 23:return Da(),null;default:return null}}var hs=!1,ds=!1,fs="function"==typeof WeakSet?WeakSet:Set,ps=null;function gs(t,e){var n=t.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){Qa(t,e,n)}else n.current=null}function ms(t,e,n){try{n()}catch(n){Qa(t,e,n)}}var bs=!1;function ys(t,e,n){var i=e.updateQueue;if(null!==(i=null!==i?i.lastEffect:null)){var r=i=i.next;do{if((r.tag&t)===t){var s=r.destroy;r.destroy=void 0,void 0!==s&&ms(e,n,s)}r=r.next}while(r!==i)}}function vs(t,e){if(null!==(e=null!==(e=e.updateQueue)?e.lastEffect:null)){var n=e=e.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==e)}}function xs(t){var e=t.ref;if(null!==e){var n=t.stateNode;t=5===t.tag?L(n):n,"function"==typeof e?e(t):e.current=t}}function _s(t){var e=t.alternate;null!==e&&(t.alternate=null,_s(e)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&null!==(e=t.stateNode)&&tt(e),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Ss(t){return 5===t.tag||3===t.tag||4===t.tag}function As(t){t:for(;;){for(;null===t.sibling;){if(null===t.return||Ss(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&18!==t.tag;){if(2&t.flags)continue t;if(null===t.child||4===t.tag)continue t;t.child.return=t,t=t.child}if(!(2&t.flags))return t.stateNode}}function ws(t,e,n){var i=t.tag;if(5===i||6===i)t=t.stateNode,e?bt(n,t,e):dt(n,t);else if(4!==i&&null!==(t=t.child))for(ws(t,e,n),t=t.sibling;null!==t;)ws(t,e,n),t=t.sibling}function Ts(t,e,n){var i=t.tag;if(5===i||6===i)t=t.stateNode,e?mt(n,t,e):ht(n,t);else if(4!==i&&null!==(t=t.child))for(Ts(t,e,n),t=t.sibling;null!==t;)Ts(t,e,n),t=t.sibling}var Cs=null,Bs=!1;function ks(t,e,n){for(n=n.child;null!==n;)Ms(t,e,n),n=n.sibling}function Ms(t,e,n){if($e&&"function"==typeof $e.onCommitFiberUnmount)try{$e.onCommitFiberUnmount(Ve,n)}catch(t){}switch(n.tag){case 5:ds||gs(n,e);case 6:if(Y){var i=Cs,r=Bs;Cs=null,ks(t,e,n),Bs=r,null!==(Cs=i)&&(Bs?vt(Cs,n.stateNode):yt(Cs,n.stateNode))}else ks(t,e,n);break;case 18:Y&&null!==Cs&&(Bs?Qt(Cs,n.stateNode):qt(Cs,n.stateNode));break;case 4:Y?(i=Cs,r=Bs,Cs=n.stateNode.containerInfo,Bs=!0,ks(t,e,n),Cs=i,Bs=r):(K&&(i=n.stateNode.containerInfo,r=Bt(i),Pt(i,r)),ks(t,e,n));break;case 0:case 11:case 14:case 15:if(!ds&&null!==(i=n.updateQueue)&&null!==(i=i.lastEffect)){r=i=i.next;do{var s=r,a=s.destroy;s=s.tag,void 0!==a&&(0!=(2&s)||0!=(4&s))&&ms(n,e,a),r=r.next}while(r!==i)}ks(t,e,n);break;case 1:if(!ds&&(gs(n,e),"function"==typeof(i=n.stateNode).componentWillUnmount))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(t){Qa(n,e,t)}ks(t,e,n);break;case 21:ks(t,e,n);break;case 22:1&n.mode?(ds=(i=ds)||null!==n.memoizedState,ks(t,e,n),ds=i):ks(t,e,n);break;default:ks(t,e,n)}}function Ps(t){var e=t.updateQueue;if(null!==e){t.updateQueue=null;var n=t.stateNode;null===n&&(n=t.stateNode=new fs),e.forEach((function(e){var i=eo.bind(null,t,e);n.has(e)||(n.add(e),e.then(i,i))}))}}function Es(t,e){var n=e.deletions;if(null!==n)for(var i=0;i<n.length;i++){var r=n[i];try{var s=t,o=e;if(Y){var l=o;t:for(;null!==l;){switch(l.tag){case 5:Cs=l.stateNode,Bs=!1;break t;case 3:case 4:Cs=l.stateNode.containerInfo,Bs=!0;break t}l=l.return}if(null===Cs)throw Error(a(160));Ms(s,o,r),Cs=null,Bs=!1}else Ms(s,o,r);var c=r.alternate;null!==c&&(c.return=null),r.return=null}catch(t){Qa(r,e,t)}}if(12854&e.subtreeFlags)for(e=e.child;null!==e;)Os(e,t),e=e.sibling}function Os(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Es(e,t),Ls(t),4&i){try{ys(3,t,t.return),vs(3,t)}catch(e){Qa(t,t.return,e)}try{ys(5,t,t.return)}catch(e){Qa(t,t.return,e)}}break;case 1:Es(e,t),Ls(t),512&i&&null!==n&&gs(n,n.return);break;case 5:if(Es(e,t),Ls(t),512&i&&null!==n&&gs(n,n.return),Y){if(32&t.flags){var r=t.stateNode;try{xt(r)}catch(e){Qa(t,t.return,e)}}if(4&i&&null!=(r=t.stateNode)){var s=t.memoizedProps;if(n=null!==n?n.memoizedProps:s,i=t.type,e=t.updateQueue,t.updateQueue=null,null!==e)try{gt(r,e,i,n,s,t)}catch(e){Qa(t,t.return,e)}}}break;case 6:if(Es(e,t),Ls(t),4&i&&Y){if(null===t.stateNode)throw Error(a(162));r=t.stateNode,s=t.memoizedProps,n=null!==n?n.memoizedProps:s;try{ft(r,n,s)}catch(e){Qa(t,t.return,e)}}break;case 3:if(Es(e,t),Ls(t),4&i){if(Y&&q&&null!==n&&n.memoizedState.isDehydrated)try{Yt(e.containerInfo)}catch(e){Qa(t,t.return,e)}if(K){r=e.containerInfo,s=e.pendingChildren;try{Pt(r,s)}catch(e){Qa(t,t.return,e)}}}break;case 4:if(Es(e,t),Ls(t),4&i&&K){r=(s=t.stateNode).containerInfo,s=s.pendingChildren;try{Pt(r,s)}catch(e){Qa(t,t.return,e)}}break;case 13:Es(e,t),Ls(t),8192&(r=t.child).flags&&(s=null!==r.memoizedState,r.stateNode.isHidden=s,!s||null!==r.alternate&&null!==r.alternate.memoizedState||(fa=We())),4&i&&Ps(t);break;case 22:var o=null!==n&&null!==n.memoizedState;if(1&t.mode?(ds=(n=ds)||o,Es(e,t),ds=n):Es(e,t),Ls(t),8192&i){if(n=null!==t.memoizedState,(t.stateNode.isHidden=n)&&!o&&0!=(1&t.mode))for(ps=t,i=t.child;null!==i;){for(e=ps=i;null!==ps;){var l=(o=ps).child;switch(o.tag){case 0:case 11:case 14:case 15:ys(4,o,o.return);break;case 1:gs(o,o.return);var c=o.stateNode;if("function"==typeof c.componentWillUnmount){var u=o,h=o.return;try{var d=u;c.props=d.memoizedProps,c.state=d.memoizedState,c.componentWillUnmount()}catch(t){Qa(u,h,t)}}break;case 5:gs(o,o.return);break;case 22:if(null!==o.memoizedState){Us(e);continue}}null!==l?(l.return=o,ps=l):Us(e)}i=i.sibling}if(Y)t:if(i=null,Y)for(e=t;;){if(5===e.tag){if(null===i){i=e;try{r=e.stateNode,n?_t(r):At(e.stateNode,e.memoizedProps)}catch(e){Qa(t,t.return,e)}}}else if(6===e.tag){if(null===i)try{s=e.stateNode,n?St(s):wt(s,e.memoizedProps)}catch(e){Qa(t,t.return,e)}}else if((22!==e.tag&&23!==e.tag||null===e.memoizedState||e===t)&&null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;null===e.sibling;){if(null===e.return||e.return===t)break t;i===e&&(i=null),e=e.return}i===e&&(i=null),e.sibling.return=e.return,e=e.sibling}}break;case 19:Es(e,t),Ls(t),4&i&&Ps(t);break;case 21:break;default:Es(e,t),Ls(t)}}function Ls(t){var e=t.flags;if(2&e){try{if(Y){t:{for(var n=t.return;null!==n;){if(Ss(n)){var i=n;break t}n=n.return}throw Error(a(160))}switch(i.tag){case 5:var r=i.stateNode;32&i.flags&&(xt(r),i.flags&=-33),Ts(t,As(t),r);break;case 3:case 4:var s=i.stateNode.containerInfo;ws(t,As(t),s);break;default:throw Error(a(161))}}}catch(e){Qa(t,t.return,e)}t.flags&=-3}4096&e&&(t.flags&=-4097)}function Rs(t,e,n){ps=t,Is(t)}function Is(t,e,n){for(var i=0!=(1&t.mode);null!==ps;){var r=ps,s=r.child;if(22===r.tag&&i){var a=null!==r.memoizedState||hs;if(!a){var o=r.alternate,l=null!==o&&null!==o.memoizedState||ds;o=hs;var c=ds;if(hs=a,(ds=l)&&!c)for(ps=r;null!==ps;)l=(a=ps).child,22===a.tag&&null!==a.memoizedState?Ds(r):null!==l?(l.return=a,ps=l):Ds(r);for(;null!==s;)ps=s,Is(s),s=s.sibling;ps=r,hs=o,ds=c}Ns(t)}else 0!=(8772&r.subtreeFlags)&&null!==s?(s.return=r,ps=s):Ns(t)}}function Ns(t){for(;null!==ps;){var e=ps;if(0!=(8772&e.flags)){var n=e.alternate;try{if(0!=(8772&e.flags))switch(e.tag){case 0:case 11:case 15:ds||vs(5,e);break;case 1:var i=e.stateNode;if(4&e.flags&&!ds)if(null===n)i.componentDidMount();else{var r=e.elementType===e.type?n.memoizedProps:mr(e.type,n.memoizedProps);i.componentDidUpdate(r,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;null!==s&&ri(e,s,i);break;case 3:var o=e.updateQueue;if(null!==o){if(n=null,null!==e.child)switch(e.child.tag){case 5:n=L(e.child.stateNode);break;case 1:n=e.child.stateNode}ri(e,o,n)}break;case 5:var l=e.stateNode;null===n&&4&e.flags&&pt(l,e.type,e.memoizedProps,e);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(q&&null===e.memoizedState){var c=e.alternate;if(null!==c){var u=c.memoizedState;if(null!==u){var h=u.dehydrated;null!==h&&Kt(h)}}}break;default:throw Error(a(163))}ds||512&e.flags&&xs(e)}catch(t){Qa(e,e.return,t)}}if(e===t){ps=null;break}if(null!==(n=e.sibling)){n.return=e.return,ps=n;break}ps=e.return}}function Us(t){for(;null!==ps;){var e=ps;if(e===t){ps=null;break}var n=e.sibling;if(null!==n){n.return=e.return,ps=n;break}ps=e.return}}function Ds(t){for(;null!==ps;){var e=ps;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{vs(4,e)}catch(t){Qa(e,n,t)}break;case 1:var i=e.stateNode;if("function"==typeof i.componentDidMount){var r=e.return;try{i.componentDidMount()}catch(t){Qa(e,r,t)}}var s=e.return;try{xs(e)}catch(t){Qa(e,s,t)}break;case 5:var a=e.return;try{xs(e)}catch(t){Qa(e,a,t)}}}catch(t){Qa(e,e.return,t)}if(e===t){ps=null;break}var o=e.sibling;if(null!==o){o.return=e.return,ps=o;break}ps=e.return}}var zs=0,Ws=1,Fs=2,js=3,Hs=4;if("function"==typeof Symbol&&Symbol.for){var Gs=Symbol.for;zs=Gs("selector.component"),Ws=Gs("selector.has_pseudo_class"),Fs=Gs("selector.role"),js=Gs("selector.test_id"),Hs=Gs("selector.text")}function Vs(t){var e=Q(t);if(null!=e){if("string"!=typeof e.memoizedProps["data-testname"])throw Error(a(364));return e}if(null===(t=rt(t)))throw Error(a(362));return t.stateNode.current}function $s(t,e){switch(e.$$typeof){case zs:if(t.type===e.value)return!0;break;case Ws:t:{e=e.value,t=[t,0];for(var n=0;n<t.length;){var i=t[n++],r=t[n++],s=e[r];if(5!==i.tag||!ot(i)){for(;null!=s&&$s(i,s);)s=e[++r];if(r===e.length){e=!0;break t}for(i=i.child;null!==i;)t.push(i,r),i=i.sibling}}e=!1}return e;case Fs:if(5===t.tag&&lt(t.stateNode,e.value))return!0;break;case Hs:if((5===t.tag||6===t.tag)&&null!==(t=at(t))&&0<=t.indexOf(e.value))return!0;break;case js:if(5===t.tag&&"string"==typeof(t=t.memoizedProps["data-testname"])&&t.toLowerCase()===e.value.toLowerCase())return!0;break;default:throw Error(a(365))}return!1}function Xs(t){switch(t.$$typeof){case zs:return"<"+(A(t.value)||"Unknown")+">";case Ws:return":has("+(Xs(t)||"")+")";case Fs:return'[role="'+t.value+'"]';case Hs:return'"'+t.value+'"';case js:return'[data-testname="'+t.value+'"]';default:throw Error(a(365))}}function Ys(t,e){var n=[];t=[t,0];for(var i=0;i<t.length;){var r=t[i++],s=t[i++],a=e[s];if(5!==r.tag||!ot(r)){for(;null!=a&&$s(r,a);)a=e[++s];if(s===e.length)n.push(r);else for(r=r.child;null!==r;)t.push(r,s),r=r.sibling}}return n}function Ks(t,e){if(!it)throw Error(a(363));t=Ys(t=Vs(t),e),e=[],t=Array.from(t);for(var n=0;n<t.length;){var i=t[n++];if(5===i.tag)ot(i)||e.push(i.stateNode);else for(i=i.child;null!==i;)t.push(i),i=i.sibling}return e}var qs=Math.ceil,Qs=o.ReactCurrentDispatcher,Zs=o.ReactCurrentOwner,Js=o.ReactCurrentBatchConfig,ta=0,ea=null,na=null,ia=0,ra=0,sa=oe(0),aa=0,oa=null,la=0,ca=0,ua=0,ha=null,da=null,fa=0,pa=1/0,ga=null;function ma(){pa=We()+500}var ba,ya=!1,va=null,xa=null,_a=!1,Sa=null,Aa=0,wa=0,Ta=null,Ca=-1,Ba=0;function ka(){return 0!=(6&ta)?We():-1!==Ca?Ca:Ca=We()}function Ma(t){return 0==(1&t.mode)?1:0!=(2&ta)&&0!==ia?ia&-ia:null!==Bn.transition?(0===Ba&&(Ba=Pe()),Ba):0!==(t=Re)?t:J()}function Pa(t,e,n,i){if(50<wa)throw wa=0,Ta=null,Error(a(185));Oe(t,n,i),0!=(2&ta)&&t===ea||(t===ea&&(0==(2&ta)&&(ca|=n),4===aa&&Ia(t,ia)),Ea(t,i),1===n&&0===ta&&0==(1&e.mode)&&(ma(),Ke&&Ze()))}function Ea(t,e){var n=t.callbackNode;!function(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes;0<s;){var a=31-_e(s),o=1<<a,l=r[a];-1===l?0!=(o&n)&&0==(o&i)||(r[a]=ke(o,e)):l<=e&&(t.expiredLanes|=o),s&=~o}}(t,e);var i=Be(t,t===ea?ia:0);if(0===i)null!==n&&Ue(n),t.callbackNode=null,t.callbackPriority=0;else if(e=i&-i,t.callbackPriority!==e){if(null!=n&&Ue(n),1===e)0===t.tag?function(t){Ke=!0,Qe(t)}(Na.bind(null,t)):Qe(Na.bind(null,t)),et?nt((function(){0==(6&ta)&&Ze()})):Ne(Fe,Ze),n=null;else{switch(Ie(i)){case 1:n=Fe;break;case 4:n=je;break;case 16:default:n=He;break;case 536870912:n=Ge}n=no(n,Oa.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function Oa(t,e){if(Ca=-1,Ba=0,0!=(6&ta))throw Error(a(327));var n=t.callbackNode;if(Ka()&&t.callbackNode!==n)return null;var i=Be(t,t===ea?ia:0);if(0===i)return null;if(0!=(30&i)||0!=(i&t.expiredLanes)||e)e=Ha(t,i);else{e=i;var r=ta;ta|=2;var s=Fa();for(ea===t&&ia===e||(ga=null,ma(),za(t,e));;)try{Va();break}catch(e){Wa(t,e)}Wn(),Qs.current=s,ta=r,null!==na?e=0:(ea=null,ia=0,e=aa)}if(0!==e){if(2===e&&0!==(r=Me(t))&&(i=r,e=La(t,r)),1===e)throw n=oa,za(t,0),Ia(t,i),Ea(t,We()),n;if(6===e)Ia(t,i);else{if(r=t.current.alternate,0==(30&i)&&!function(t){for(var e=t;;){if(16384&e.flags){var n=e.updateQueue;if(null!==n&&null!==(n=n.stores))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!Xe(s(),r))return!1}catch(t){return!1}}}if(n=e.child,16384&e.subtreeFlags&&null!==n)n.return=e,e=n;else{if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}(r)&&(2===(e=Ha(t,i))&&0!==(s=Me(t))&&(i=s,e=La(t,s)),1===e))throw n=oa,za(t,0),Ia(t,i),Ea(t,We()),n;switch(t.finishedWork=r,t.finishedLanes=i,e){case 0:case 1:throw Error(a(345));case 2:case 5:Ya(t,da,ga);break;case 3:if(Ia(t,i),(130023424&i)===i&&10<(e=fa+500-We())){if(0!==Be(t,0))break;if(((r=t.suspendedLanes)&i)!==i){ka(),t.pingedLanes|=t.suspendedLanes&r;break}t.timeoutHandle=G(Ya.bind(null,t,da,ga),e);break}Ya(t,da,ga);break;case 4:if(Ia(t,i),(4194240&i)===i)break;for(e=t.eventTimes,r=-1;0<i;){var o=31-_e(i);s=1<<o,(o=e[o])>r&&(r=o),i&=~s}if(i=r,10<(i=(120>(i=We()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qs(i/1960))-i)){t.timeoutHandle=G(Ya.bind(null,t,da,ga),i);break}Ya(t,da,ga);break;default:throw Error(a(329))}}}return Ea(t,We()),t.callbackNode===n?Oa.bind(null,t):null}function La(t,e){var n=ha;return t.current.memoizedState.isDehydrated&&(za(t,e).flags|=256),2!==(t=Ha(t,e))&&(e=da,da=n,null!==e&&Ra(e)),t}function Ra(t){null===da?da=t:da.push.apply(da,t)}function Ia(t,e){for(e&=~ua,e&=~ca,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-_e(e),i=1<<n;t[n]=-1,e&=~i}}function Na(t){if(0!=(6&ta))throw Error(a(327));Ka();var e=Be(t,0);if(0==(1&e))return Ea(t,We()),null;var n=Ha(t,e);if(0!==t.tag&&2===n){var i=Me(t);0!==i&&(e=i,n=La(t,i))}if(1===n)throw n=oa,za(t,0),Ia(t,e),Ea(t,We()),n;if(6===n)throw Error(a(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Ya(t,da,ga),Ea(t,We()),null}function Ua(t){null!==Sa&&0===Sa.tag&&0==(6&ta)&&Ka();var e=ta;ta|=1;var n=Js.transition,i=Re;try{if(Js.transition=null,Re=1,t)return t()}finally{Re=i,Js.transition=n,0==(6&(ta=e))&&Ze()}}function Da(){ra=sa.current,le(sa)}function za(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==$&&(t.timeoutHandle=$,V(n)),null!==na)for(n=na.return;null!==n;){var i=n;switch(dn(i),i.tag){case 1:null!=(i=i.type.childContextTypes)&&me();break;case 3:hi(),le(de),le(he),bi();break;case 5:fi(i);break;case 4:hi();break;case 13:case 19:le(pi);break;case 10:jn(i.type._context);break;case 22:case 23:Da()}n=n.return}if(ea=t,na=t=ao(t.current,null),ia=ra=e,aa=0,oa=null,ua=ca=la=0,da=ha=null,null!==$n){for(e=0;e<$n.length;e++)if(null!==(i=(n=$n[e]).interleaved)){n.interleaved=null;var r=i.next,s=n.pending;if(null!==s){var a=s.next;s.next=r,i.next=a}n.pending=i}$n=null}return t}function Wa(t,e){for(;;){var n=na;try{if(Wn(),yi.current=dr,wi){for(var i=_i.memoizedState;null!==i;){var r=i.queue;null!==r&&(r.pending=null),i=i.next}wi=!1}if(xi=0,Ai=Si=_i=null,Ti=!1,Ci=0,Zs.current=null,null===n||null===n.return){aa=1,oa=e,na=null;break}t:{var s=t,o=n.return,l=n,c=e;if(e=ia,l.flags|=32768,null!==c&&"object"==typeof c&&"function"==typeof c.then){var u=c,h=l,d=h.tag;if(0==(1&h.mode)&&(0===d||11===d||15===d)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=Mr(o);if(null!==p){p.flags&=-257,Pr(p,o,l,0,e),1&p.mode&&kr(s,u,e),c=u;var g=(e=p).updateQueue;if(null===g){var m=new Set;m.add(c),e.updateQueue=m}else g.add(c);break t}if(0==(1&e)){kr(s,u,e),ja();break t}c=Error(a(426))}else if(gn&&1&l.mode){var b=Mr(o);if(null!==b){0==(65536&b.flags)&&(b.flags|=256),Pr(b,o,l,0,e),Cn(Ar(c,l));break t}}s=c=Ar(c,l),4!==aa&&(aa=2),null===ha?ha=[s]:ha.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e,ni(s,Cr(0,c,e));break t;case 1:l=c;var y=s.type,v=s.stateNode;if(0==(128&s.flags)&&("function"==typeof y.getDerivedStateFromError||null!==v&&"function"==typeof v.componentDidCatch&&(null===xa||!xa.has(v)))){s.flags|=65536,e&=-e,s.lanes|=e,ni(s,Br(s,l,e));break t}}s=s.return}while(null!==s)}Xa(n)}catch(t){e=t,na===n&&null!==n&&(na=n=n.return);continue}break}}function Fa(){var t=Qs.current;return Qs.current=dr,null===t?dr:t}function ja(){0!==aa&&3!==aa&&2!==aa||(aa=4),null===ea||0==(268435455&la)&&0==(268435455&ca)||Ia(ea,ia)}function Ha(t,e){var n=ta;ta|=2;var i=Fa();for(ea===t&&ia===e||(ga=null,za(t,e));;)try{Ga();break}catch(e){Wa(t,e)}if(Wn(),ta=n,Qs.current=i,null!==na)throw Error(a(261));return ea=null,ia=0,aa}function Ga(){for(;null!==na;)$a(na)}function Va(){for(;null!==na&&!De();)$a(na)}function $a(t){var e=ba(t.alternate,t,ra);t.memoizedProps=t.pendingProps,null===e?Xa(t):na=e,Zs.current=null}function Xa(t){var e=t;do{var n=e.alternate;if(t=e.return,0==(32768&e.flags)){if(null!==(n=cs(n,e,ra)))return void(na=n)}else{if(null!==(n=us(n,e)))return n.flags&=32767,void(na=n);if(null===t)return aa=6,void(na=null);t.flags|=32768,t.subtreeFlags=0,t.deletions=null}if(null!==(e=e.sibling))return void(na=e);na=e=t}while(null!==e);0===aa&&(aa=5)}function Ya(t,e,n){var i=Re,r=Js.transition;try{Js.transition=null,Re=1,function(t,e,n,i){do{Ka()}while(null!==Sa);if(0!=(6&ta))throw Error(a(327));n=t.finishedWork;var r=t.finishedLanes;if(null===n)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(a(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(function(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0<n;){var r=31-_e(n),s=1<<r;e[r]=0,i[r]=-1,t[r]=-1,n&=~s}}(t,s),t===ea&&(na=ea=null,ia=0),0==(2064&n.subtreeFlags)&&0==(2064&n.flags)||_a||(_a=!0,no(He,(function(){return Ka(),null}))),s=0!=(15990&n.flags),0!=(15990&n.subtreeFlags)||s){s=Js.transition,Js.transition=null;var o=Re;Re=1;var l=ta;ta|=4,Zs.current=null,function(t,e){for(N(t.containerInfo),ps=e;null!==ps;)if(e=(t=ps).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,ps=e;else for(;null!==ps;){t=ps;try{var n=t.alternate;if(0!=(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==n){var i=n.memoizedProps,r=n.memoizedState,s=t.stateNode,o=s.getSnapshotBeforeUpdate(t.elementType===t.type?i:mr(t.type,i),r);s.__reactInternalSnapshotBeforeUpdate=o}break;case 3:Y&&Tt(t.stateNode.containerInfo);break;default:throw Error(a(163))}}catch(e){Qa(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,ps=e;break}ps=t.return}n=bs,bs=!1}(t,n),Os(n,t),U(t.containerInfo),t.current=n,Rs(n),ze(),ta=l,Re=o,Js.transition=s}else t.current=n;if(_a&&(_a=!1,Sa=t,Aa=r),0===(s=t.pendingLanes)&&(xa=null),function(t){if($e&&"function"==typeof $e.onCommitFiberRoot)try{$e.onCommitFiberRoot(Ve,t,void 0,128==(128&t.current.flags))}catch(t){}}(n.stateNode),Ea(t,We()),null!==e)for(i=t.onRecoverableError,n=0;n<e.length;n++)i((r=e[n]).value,{componentStack:r.stack,digest:r.digest});if(ya)throw ya=!1,t=va,va=null,t;0!=(1&Aa)&&0!==t.tag&&Ka(),0!=(1&(s=t.pendingLanes))?t===Ta?wa++:(wa=0,Ta=t):wa=0,Ze()}(t,e,n,i)}finally{Js.transition=r,Re=i}return null}function Ka(){if(null!==Sa){var t=Ie(Aa),e=Js.transition,n=Re;try{if(Js.transition=null,Re=16>t?16:t,null===Sa)var i=!1;else{if(t=Sa,Sa=null,Aa=0,0!=(6&ta))throw Error(a(331));var r=ta;for(ta|=4,ps=t.current;null!==ps;){var s=ps,o=s.child;if(0!=(16&ps.flags)){var l=s.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(ps=u;null!==ps;){var h=ps;switch(h.tag){case 0:case 11:case 15:ys(8,h,s)}var d=h.child;if(null!==d)d.return=h,ps=d;else for(;null!==ps;){var f=(h=ps).sibling,p=h.return;if(_s(h),h===u){ps=null;break}if(null!==f){f.return=p,ps=f;break}ps=p}}}var g=s.alternate;if(null!==g){var m=g.child;if(null!==m){g.child=null;do{var b=m.sibling;m.sibling=null,m=b}while(null!==m)}}ps=s}}if(0!=(2064&s.subtreeFlags)&&null!==o)o.return=s,ps=o;else t:for(;null!==ps;){if(0!=(2048&(s=ps).flags))switch(s.tag){case 0:case 11:case 15:ys(9,s,s.return)}var y=s.sibling;if(null!==y){y.return=s.return,ps=y;break t}ps=s.return}}var v=t.current;for(ps=v;null!==ps;){var x=(o=ps).child;if(0!=(2064&o.subtreeFlags)&&null!==x)x.return=o,ps=x;else t:for(o=v;null!==ps;){if(0!=(2048&(l=ps).flags))try{switch(l.tag){case 0:case 11:case 15:vs(9,l)}}catch(t){Qa(l,l.return,t)}if(l===o){ps=null;break t}var _=l.sibling;if(null!==_){_.return=l.return,ps=_;break t}ps=l.return}}if(ta=r,Ze(),$e&&"function"==typeof $e.onPostCommitFiberRoot)try{$e.onPostCommitFiberRoot(Ve,t)}catch(t){}i=!0}return i}finally{Re=n,Js.transition=e}}return!1}function qa(t,e,n){t=ti(t,e=Cr(0,e=Ar(n,e),1),1),e=ka(),null!==t&&(Oe(t,1,e),Ea(t,e))}function Qa(t,e,n){if(3===t.tag)qa(t,t,n);else for(;null!==e;){if(3===e.tag){qa(e,t,n);break}if(1===e.tag){var i=e.stateNode;if("function"==typeof e.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===xa||!xa.has(i))){e=ti(e,t=Br(e,t=Ar(n,t),1),1),t=ka(),null!==e&&(Oe(e,1,t),Ea(e,t));break}}e=e.return}}function Za(t,e,n){var i=t.pingCache;null!==i&&i.delete(e),e=ka(),t.pingedLanes|=t.suspendedLanes&n,ea===t&&(ia&n)===n&&(4===aa||3===aa&&(130023424&ia)===ia&&500>We()-fa?za(t,0):ua|=n),Ea(t,e)}function Ja(t,e){0===e&&(0==(1&t.mode)?e=1:(e=Te,0==(130023424&(Te<<=1))&&(Te=4194304)));var n=ka();null!==(t=Kn(t,e))&&(Oe(t,e,n),Ea(t,n))}function to(t){var e=t.memoizedState,n=0;null!==e&&(n=e.retryLane),Ja(t,n)}function eo(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;null!==r&&(n=r.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(a(314))}null!==i&&i.delete(e),Ja(t,n)}function no(t,e){return Ne(t,e)}function io(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ro(t,e,n,i){return new io(t,e,n,i)}function so(t){return!(!(t=t.prototype)||!t.isReactComponent)}function ao(t,e){var n=t.alternate;return null===n?((n=ro(t.tag,e,t.key,t.mode)).elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&t.flags,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function oo(t,e,n,i,r,s){var o=2;if(i=t,"function"==typeof t)so(t)&&(o=1);else if("string"==typeof t)o=5;else t:switch(t){case u:return lo(n.children,r,s,e);case h:o=8,r|=8;break;case d:return(t=ro(12,n,e,2|r)).elementType=d,t.lanes=s,t;case m:return(t=ro(13,n,e,r)).elementType=m,t.lanes=s,t;case b:return(t=ro(19,n,e,r)).elementType=b,t.lanes=s,t;case x:return co(n,r,s,e);default:if("object"==typeof t&&null!==t)switch(t.$$typeof){case f:o=10;break t;case p:o=9;break t;case g:o=11;break t;case y:o=14;break t;case v:o=16,i=null;break t}throw Error(a(130,null==t?t:typeof t,""))}return(e=ro(o,n,e,r)).elementType=t,e.type=i,e.lanes=s,e}function lo(t,e,n,i){return(t=ro(7,t,i,e)).lanes=n,t}function co(t,e,n,i){return(t=ro(22,t,i,e)).elementType=x,t.lanes=n,t.stateNode={isHidden:!1},t}function uo(t,e,n){return(t=ro(6,t,null,e)).lanes=n,t}function ho(t,e,n){return(e=ro(4,null!==t.children?t.children:[],t.key,e)).lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function fo(t,e,n,i,r){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=$,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ee(0),this.expirationTimes=Ee(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ee(0),this.identifierPrefix=i,this.onRecoverableError=r,q&&(this.mutableSourceEagerHydrationData=null)}function po(t,e,n,i,r,s,a,o,l){return t=new fo(t,e,n,o,l),1===e?(e=1,!0===s&&(e|=8)):e=0,s=ro(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qn(s),t}function go(t){if(!t)return ue;t:{if(T(t=t._reactInternals)!==t||1!==t.tag)throw Error(a(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break t;case 1:if(ge(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}e=e.return}while(null!==e);throw Error(a(171))}if(1===t.tag){var n=t.type;if(ge(n))return ye(t,n,e)}return e}function mo(t){var e=t._reactInternals;if(void 0===e){if("function"==typeof t.render)throw Error(a(188));throw t=Object.keys(t).join(","),Error(a(268,t))}return null===(t=k(e))?null:t.stateNode}function bo(t,e){if(null!==(t=t.memoizedState)&&null!==t.dehydrated){var n=t.retryLane;t.retryLane=0!==n&&n<e?n:e}}function yo(t,e){bo(t,e),(t=t.alternate)&&bo(t,e)}function vo(t){return null===(t=k(t))?null:t.stateNode}function xo(){return null}return ba=function(t,e,n){if(null!==t)if(t.memoizedProps!==e.pendingProps||de.current)Or=!0;else{if(0==(t.lanes&n)&&0==(128&e.flags))return Or=!1,function(t,e,n){switch(e.tag){case 3:jr(e),Tn();break;case 5:di(e);break;case 1:ge(e.type)&&ve(e);break;case 4:ui(e,e.stateNode.containerInfo);break;case 10:Fn(0,e.type._context,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(null!==i)return null!==i.dehydrated?(ce(pi,1&pi.current),e.flags|=128,null):0!=(n&e.child.childLanes)?qr(t,e,n):(ce(pi,1&pi.current),null!==(t=is(t,e,n))?t.sibling:null);ce(pi,1&pi.current);break;case 19:if(i=0!=(n&e.childLanes),0!=(128&t.flags)){if(i)return es(t,e,n);e.flags|=128}var r=e.memoizedState;if(null!==r&&(r.rendering=null,r.tail=null,r.lastEffect=null),ce(pi,pi.current),i)break;return null;case 22:case 23:return e.lanes=0,Ur(t,e,n)}return is(t,e,n)}(t,e,n);Or=0!=(131072&t.flags)}else Or=!1,gn&&0!=(1048576&e.flags)&&un(e,nn,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;ns(t,e),t=e.pendingProps;var r=pe(e,he.current);Gn(e,n),r=Pi(null,e,i,t,r,n);var s=Ei();return e.flags|=1,"object"==typeof r&&null!==r&&"function"==typeof r.render&&void 0===r.$$typeof?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ge(i)?(s=!0,ve(e)):s=!1,e.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,Qn(e),r.updater=yr,e.stateNode=r,r._reactInternals=e,Sr(e,i,t,n),e=Fr(null,e,i,!0,s,n)):(e.tag=0,gn&&s&&hn(e),Lr(null,e,r,n),e=e.child),e;case 16:i=e.elementType;t:{switch(ns(t,e),t=e.pendingProps,i=(r=i._init)(i._payload),e.type=i,r=e.tag=function(t){if("function"==typeof t)return so(t)?1:0;if(null!=t){if((t=t.$$typeof)===g)return 11;if(t===y)return 14}return 2}(i),t=mr(i,t),r){case 0:e=zr(null,e,i,t,n);break t;case 1:e=Wr(null,e,i,t,n);break t;case 11:e=Rr(null,e,i,t,n);break t;case 14:e=Ir(null,e,i,mr(i.type,t),n);break t}throw Error(a(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,zr(t,e,i,r=e.elementType===i?r:mr(i,r),n);case 1:return i=e.type,r=e.pendingProps,Wr(t,e,i,r=e.elementType===i?r:mr(i,r),n);case 3:t:{if(jr(e),null===t)throw Error(a(387));i=e.pendingProps,r=(s=e.memoizedState).element,Zn(t,e),ii(e,i,null,n);var o=e.memoizedState;if(i=o.element,q&&s.isDehydrated){if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,256&e.flags){e=Hr(t,e,i,n,r=Ar(Error(a(423)),e));break t}if(i!==r){e=Hr(t,e,i,n,r=Ar(Error(a(424)),e));break t}for(q&&(pn=jt(e.stateNode.containerInfo),fn=e,gn=!0,bn=null,mn=!1),n=In(e,null,i,n),e.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(Tn(),i===r){e=is(t,e,n);break t}Lr(t,e,i,n)}e=e.child}return e;case 5:return di(e),null===t&&_n(e),i=e.type,r=e.pendingProps,s=null!==t?t.memoizedProps:null,o=r.children,j(i,r)?o=null:null!==s&&j(i,s)&&(e.flags|=32),Dr(t,e),Lr(t,e,o,n),e.child;case 6:return null===t&&_n(e),null;case 13:return qr(t,e,n);case 4:return ui(e,e.stateNode.containerInfo),i=e.pendingProps,null===t?e.child=Rn(e,null,i,n):Lr(t,e,i,n),e.child;case 11:return i=e.type,r=e.pendingProps,Rr(t,e,i,r=e.elementType===i?r:mr(i,r),n);case 7:return Lr(t,e,e.pendingProps,n),e.child;case 8:case 12:return Lr(t,e,e.pendingProps.children,n),e.child;case 10:t:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,Fn(0,i,o=r.value),null!==s)if(Xe(s.value,o)){if(s.children===r.children&&!de.current){e=is(t,e,n);break t}}else for(null!==(s=e.child)&&(s.return=e);null!==s;){var l=s.dependencies;if(null!==l){o=s.child;for(var c=l.firstContext;null!==c;){if(c.context===i){if(1===s.tag){(c=Jn(-1,n&-n)).tag=2;var u=s.updateQueue;if(null!==u){var h=(u=u.shared).pending;null===h?c.next=c:(c.next=h.next,h.next=c),u.pending=c}}s.lanes|=n,null!==(c=s.alternate)&&(c.lanes|=n),Hn(s.return,n,e),l.lanes|=n;break}c=c.next}}else if(10===s.tag)o=s.type===e.type?null:s.child;else if(18===s.tag){if(null===(o=s.return))throw Error(a(341));o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),Hn(o,n,e),o=s.sibling}else o=s.child;if(null!==o)o.return=s;else for(o=s;null!==o;){if(o===e){o=null;break}if(null!==(s=o.sibling)){s.return=o.return,o=s;break}o=o.return}s=o}Lr(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Gn(e,n),i=i(r=Vn(r)),e.flags|=1,Lr(t,e,i,n),e.child;case 14:return r=mr(i=e.type,e.pendingProps),Ir(t,e,i,r=mr(i.type,r),n);case 15:return Nr(t,e,e.type,e.pendingProps,n);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:mr(i,r),ns(t,e),e.tag=1,ge(i)?(t=!0,ve(e)):t=!1,Gn(e,n),xr(e,i,r),Sr(e,i,r,n),Fr(null,e,i,!0,t,n);case 19:return es(t,e,n);case 22:return Ur(t,e,n)}throw Error(a(156,e.tag))},e.attemptContinuousHydration=function(t){if(13===t.tag){var e=Kn(t,134217728);null!==e&&Pa(e,t,134217728,ka()),yo(t,134217728)}},e.attemptDiscreteHydration=function(t){if(13===t.tag){var e=Kn(t,1);null!==e&&Pa(e,t,1,ka()),yo(t,1)}},e.attemptHydrationAtCurrentPriority=function(t){if(13===t.tag){var e=Ma(t),n=Kn(t,e);null!==n&&Pa(n,t,e,ka()),yo(t,e)}},e.attemptSynchronousHydration=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Ce(e.pendingLanes);0!==n&&(Le(e,1|n),Ea(e,We()),0==(6&ta)&&(ma(),Ze()))}break;case 13:Ua((function(){var e=Kn(t,1);if(null!==e){var n=ka();Pa(e,t,1,n)}})),yo(t,1)}},e.batchedUpdates=function(t,e){var n=ta;ta|=1;try{return t(e)}finally{0===(ta=n)&&(ma(),Ke&&Ze())}},e.createComponentSelector=function(t){return{$$typeof:zs,value:t}},e.createContainer=function(t,e,n,i,r,s,a){return po(t,e,!1,null,0,i,0,s,a)},e.createHasPseudoClassSelector=function(t){return{$$typeof:Ws,value:t}},e.createHydrationContainer=function(t,e,n,i,r,s,a,o,l){return(t=po(n,i,!0,t,0,s,0,o,l)).context=go(null),n=t.current,(s=Jn(i=ka(),r=Ma(n))).callback=null!=e?e:null,ti(n,s,r),t.current.lanes=r,Oe(t,r,i),Ea(t,i),t},e.createPortal=function(t,e,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:c,key:null==i?null:""+i,children:t,containerInfo:e,implementation:n}},e.createRoleSelector=function(t){return{$$typeof:Fs,value:t}},e.createTestNameSelector=function(t){return{$$typeof:js,value:t}},e.createTextSelector=function(t){return{$$typeof:Hs,value:t}},e.deferredUpdates=function(t){var e=Re,n=Js.transition;try{return Js.transition=null,Re=16,t()}finally{Re=e,Js.transition=n}},e.discreteUpdates=function(t,e,n,i,r){var s=Re,a=Js.transition;try{return Js.transition=null,Re=1,t(e,n,i,r)}finally{Re=s,Js.transition=a,0===ta&&ma()}},e.findAllNodes=Ks,e.findBoundingRects=function(t,e){if(!it)throw Error(a(363));e=Ks(t,e),t=[];for(var n=0;n<e.length;n++)t.push(st(e[n]));for(e=t.length-1;0<e;e--)for(var i=(n=t[e]).x,r=i+n.width,s=n.y,o=s+n.height,l=e-1;0<=l;l--)if(e!==l){var c=t[l],u=c.x,h=u+c.width,d=c.y,f=d+c.height;if(i>=u&&s>=d&&r<=h&&o<=f){t.splice(e,1);break}if(!(i!==u||n.width!==c.width||f<s||d>o)){d>s&&(c.height+=d-s,c.y=s),f<o&&(c.height=o-d),t.splice(e,1);break}if(!(s!==d||n.height!==c.height||h<i||u>r)){u>i&&(c.width+=u-i,c.x=i),h<r&&(c.width=r-u),t.splice(e,1);break}}return t},e.findHostInstance=mo,e.findHostInstanceWithNoPortals=function(t){return null===(t=null!==(t=B(t))?P(t):null)?null:t.stateNode},e.findHostInstanceWithWarning=function(t){return mo(t)},e.flushControlled=function(t){var e=ta;ta|=1;var n=Js.transition,i=Re;try{Js.transition=null,Re=1,t()}finally{Re=i,Js.transition=n,0===(ta=e)&&(ma(),Ze())}},e.flushPassiveEffects=Ka,e.flushSync=Ua,e.focusWithin=function(t,e){if(!it)throw Error(a(363));for(e=Ys(t=Vs(t),e),e=Array.from(e),t=0;t<e.length;){var n=e[t++];if(!ot(n)){if(5===n.tag&&ct(n.stateNode))return!0;for(n=n.child;null!==n;)e.push(n),n=n.sibling}}return!1},e.getCurrentUpdatePriority=function(){return Re},e.getFindAllNodesFailureDescription=function(t,e){if(!it)throw Error(a(363));var n=0,i=[];t=[Vs(t),0];for(var r=0;r<t.length;){var s=t[r++],o=t[r++],l=e[o];if((5!==s.tag||!ot(s))&&($s(s,l)&&(i.push(Xs(l)),++o>n&&(n=o)),o<e.length))for(s=s.child;null!==s;)t.push(s,o),s=s.sibling}if(n<e.length){for(t=[];n<e.length;n++)t.push(Xs(e[n]));return"findAllNodes was able to match part of the selector:\n "+i.join(" > ")+"\n\nNo matching component was found for:\n "+t.join(" > ")}return null},e.getPublicRootInstance=function(t){return(t=t.current).child?5===t.child.tag?L(t.child.stateNode):t.child.stateNode:null},e.injectIntoDevTools=function(t){if(t={bundleType:t.bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:vo,findFiberByHostInstance:t.findFiberByHostInstance||xo,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)t=!1;else{var e=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(e.isDisabled||!e.supportsFiber)t=!0;else{try{Ve=e.inject(t),$e=e}catch(t){}t=!!e.checkDCE}}return t},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(t,e,n,i){if(!it)throw Error(a(363));t=Ks(t,e);var r=ut(t,n,i).disconnect;return{disconnect:function(){r()}}},e.registerMutableSourceForHydration=function(t,e){var n=e._getVersion;n=n(e._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[e,n]:t.mutableSourceEagerHydrationData.push(e,n)},e.runWithPriority=function(t,e){var n=Re;try{return Re=t,e()}finally{Re=n}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(t,e,n,i){var r=e.current,s=ka(),a=Ma(r);return n=go(n),null===e.context?e.context=n:e.pendingContext=n,(e=Jn(s,a)).payload={element:t},null!==(i=void 0===i?null:i)&&(e.callback=i),null!==(t=ti(r,e,a))&&(Pa(t,r,a,s),ei(t,r,a)),a},e}),Nu);var ju,Hu=r(Du.exports),Gu={exports:{}},Vu={};Gu.exports=(ju||(ju=1,Vu.ConcurrentRoot=1,Vu.ContinuousEventPriority=4,Vu.DefaultEventPriority=16,Vu.DiscreteEventPriority=1,Vu.IdleEventPriority=536870912,Vu.LegacyRoot=0),Vu);var $u=Gu.exports;const Xu=Hu({supportsMutation:!0,supportsPersistence:!1,createInstance:(t,e,n)=>{const i=function(t,e){const n=function(t,e){if("tag"===t)return new yu(e.attribute?e.attribute:e);if("radio"===t)return new xu(e.attribute?e.attribute:e);if("checkbox"===t)return new vu(e.attribute?e.attribute:e)}(t,e);if(n)return n;if(!xt.graphicService.creator[t])return;const i=xt.graphicService.creator[t](e.attribute);return i}(t,e);if(i)return function(t,e){for(const n in e)Yu(n,e)&&Hl[n]&&t.addEventListener(Hl[n],e[n])}(i,e),i},createTextInstance:(t,e)=>{},appendInitialChild:(t,e)=>{t.add(e)},finalizeInitialChildren:()=>!1,prepareUpdate:()=>!0,shouldSetTextContent:()=>!1,getRootHostContext:()=>null,getChildHostContext:()=>null,getPublicInstance:t=>t,prepareForCommit:()=>null,resetAfterCommit:()=>{},preparePortalMount:()=>null,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,isPrimaryRenderer:!1,getCurrentEventPriority:()=>$u.DefaultEventPriority,getInstanceFromNode:t=>null,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},prepareScopeUpdate:()=>{},getInstanceFromScope:()=>{},detachDeletedInstance:()=>{},supportsHydration:!1,appendChild:(t,e)=>{t.add(e)},appendChildToContainer:(t,e)=>{t.add(e)},insertBefore:(t,e,n)=>{t.insertBefore(e,n)},insertInContainerBefore:(t,e,n)=>{t.insertBefore(e,n)},removeChild:(t,e)=>{e.delete()},removeChildFromContainer:(t,e)=>{e.delete()},commitUpdate:(t,e,n,i,r)=>{!function(t,e,n){for(const i in n)Yu(i,n)&&n[i]!==e[i]&&t.removeEventListener(Hl[i],n[i]);for(const i in e)Yu(i,e)&&n[i]!==e[i]&&t.addEventListener(Hl[i],e[i]);const i=e.attribute??_({},e);t.initAttributes(i),"image"===t.type&&t.loadImage(i.image);if("flex"===i.display&&void 0===i.width&&void 0===i.height&&b(n.attribute.width)&&b(n.attribute.height)){const e=t.stage.pluginService.findPluginsByName("FlexLayoutPlugin")[0];e&&e.tryLayoutChildren(t)}}(t,r,i)},hideInstance:t=>{t.setAttribute("visible",!1)},unhideInstance:(t,e)=>{t.setAttribute("visible",!0)},clearContainer:t=>{t.removeAllChild()},commitTextUpdate:(t,e,n)=>{}});function Yu(t,e){return t.startsWith("on")&&l(e[t])}Xu.injectIntoDevTools({bundleType:0,version:n.version,rendererPackageName:"react-vtable"});const Ku=(t,e)=>{const{componentId:r,children:s}=t;if(!n.isValidElement(s))return null;const a=n.useContext(i),{table:o}=a,l="header-custom-layout"===s.props.role,c=n.useRef(new Map),u=n.useCallback((t=>{const e=`${t.originCol??t.col}-${t.originRow??t.row}${t.forComputation?"-forComputation":""}`;let n;if(c.current.has(e)){const i=c.current.get(e);qu(s,i,t),n=i.containerInfo}else{n=new ba({});const i=Xu.createContainer(n,$u.LegacyRoot,null,null,null,"custom",null,null);c.current.set(e,i),qu(s,i,t)}return{rootContainer:n,renderDefault:!!s.props.renderDefault}}),[s]),h=n.useCallback(((t,e)=>{const n=`${t}-${e}`;if(c.current.has(n)){const t=c.current.get(n);Xu.updateContainer(null,t,null),t.containerInfo.delete(),c.current.delete(n)}}),[]),d=n.useCallback((()=>{c.current.forEach(((t,e)=>{const n=t;Xu.updateContainer(null,n,null),n.containerInfo.delete()})),c.current.clear()}),[]);return n.useLayoutEffect((()=>(console.log("init",t,o),()=>{console.log("release",t,o)})),[]),n.useLayoutEffect((()=>{console.log("update props",t,o),o?.checkReactCustomLayout(),o?.reactCustomLayout?.setReactRemoveAllGraphic(r,d,l),o&&!o.reactCustomLayout?.hasReactCreateGraphic(r,l)?(o.reactCustomLayout?.setReactCreateGraphic(r,u,l),o.reactCustomLayout?.setReactRemoveGraphic(r,h,l),o.reactCustomLayout?.updateCustomCell(r,l)):o&&(o.reactCustomLayout?.setReactCreateGraphic(r,u,l),c.current.forEach(((t,e)=>{const[n,i]=e.split("-").map(Number),{width:r,height:a}=function(t,e,n){const i=n.getCellRange(t,e),r=n.getCellsRect(i.start.col,i.start.row,i.end.col,i.end.row);return r}(n,i,o),l=t,c={col:n,row:i,dataValue:o.getCellOriginValue(n,i),value:o.getCellValue(n,i)||"",rect:{left:0,top:0,right:r,bottom:a,width:r,height:a},table:o};l.containerInfo,qu(s,l,c),o.scenegraph.updateNextFrame()})))})),null};function qu(t,e,i){Xu.updateContainer(n.cloneElement(t,{...i}),e,null)}const Qu=(t,e,r,s)=>{const a=["id","updateId","componentIndex","children"],o=r?Object.keys(r).concat(a):a,l=t=>{const e=n.useContext(i),s=n.useRef(null),a=n.useRef(t.updateId);if(t.updateId!==a.current){a.current=t.updateId;!!r&&N(e.table,t,s.current,r)&&(s.current=t)}return n.useEffect((()=>()=>{r&&N(e.table,null,s.current,r)}),[]),Ju(t.children,t.componentId)};return l.displayName=t,l.parseOption=t=>{const i=S(t,o);if(t.children){const{children:e}=t;n.Children.map(e,((e,n)=>{Zu(e,t,i,o,t.componentId+"-"+n)}))}return{option:i,optionName:e,isSingle:s}},l};function Zu(t,e,i,r,s){if("custom-layout"===t.props.role&&(i.customLayout="react-custom-layout",i.customLayoutComponentId=s),"header-custom-layout"===t.props.role&&(i.headerCustomLayout="react-custom-layout",i.headerCustomLayoutComponentId=s),"ListColumn"===t.type.displayName){i.columns||(i.columns=[]);const a=S(t.props,r);i.columns.push(a),a.componentId=s,t.props.children&&n.Children.map(t.props.children,((t,n)=>{Zu(t,e,a,r,s+"-"+n)}))}}function Ju(t,e){return(i=t)&&i.$$typeof===Symbol.for("react.element")||Array.isArray(t)?n.Children.map(t,((t,i)=>t.props.children?Ju(t.props.children,e+"-"+i):"custom-layout"===t.props.role||"header-custom-layout"===t.props.role?n.createElement(Ku,{componentId:e},t):null)):null;var i}const th=Qu("ListColumn","columns"),eh=Qu("PivotColumnDimension","columns"),nh=Qu("PivotRowDimension","rows"),ih=Qu("PivotIndicator","indicators"),rh=Qu("PivotColumnHeaderTitle","columnHeaderTitle",void 0,!0),sh=Qu("PivotRowHeaderTitle","rowHeaderTitle",void 0,!0),ah=Qu("PivotCorner","corner",void 0,!0),oh=Qu("Menu","menu",void 0,!0),lh=Qu("Tooltip","tooltip",void 0,!0),ch=Qu("EmptyTip","emptyTip",void 0,!0),uh=Qu("Title","title",void 0,!0);function hh(t,e){return b(t)?t:"string"==typeof t&&t.endsWith("%")?Number(t.slice(0,-1))/100*e:0}const dh="group",fh="text",ph="tag",gh={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"#FFF"},panelStyle:{visible:!0,fill:"#165dff",lineWidth:1,cornerRadius:2},padding:10,state:{panelStyle:{hover:{fill:"#4080ff"},disabled:{fill:"#94bfff"}}}};const mh=n.forwardRef((function(t,e){const i=_({},gh,t),{disabled:r,onClick:s}=i;let a=n.useRef(null);a=e||a;const o=n.useCallback((t=>{r?"function"==typeof t?.preventDefault&&t.preventDefault():s&&s(t)}),[r,s]),l=function(t){const{textStyle:e,padding:n,panelStyle:i,minWidth:r,maxWidth:s,visible:a,cursor:o,disabled:l,state:c,children:u}=t,h={text:u,textStyle:e,padding:n,panel:i,minWidth:r,maxWidth:s,visible:a,cursor:o??l?"not-allowed":"pointer",childrenPickable:!1,state:{text:{hover:c?.textStyle?.hover,disabled:c?.textStyle?.disabled},panel:{hover:c?.panelStyle?.hover,disabled:c?.panelStyle?.disabled}}};return h}(i);return n.useEffect((()=>{a.current.addEventListener("mouseenter",(()=>{r||(a.current.addState("hover",!0,!1),a.current.stage.renderNextFrame())})),a.current.addEventListener("mouseleave",(()=>{r||(a.current.removeState("hover",!1),a.current.stage.renderNextFrame())}))})),n.useEffect((()=>{r?(a.current.removeState("disabled",!1),a.current.addState("disabled",!0,!1)):a.current.removeState("disabled",!1),a.current.stage.renderNextFrame()})),n.createElement(ph,{ref:a,attribute:l,onClick:o})}));mh.displayName="Button";const bh={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"rgb(64, 128, 255)"},panelStyle:{visible:!0,opacity:0,fill:"rgba(242, 243, 245, 0.5)",lineWidth:1,cornerRadius:2},padding:4,space:6,state:{textStyle:{disabled:{fill:"rgb(148, 191, 255)"}},panelStyle:{hover:{opacity:1}}}};const yh=n.forwardRef((function(t,e){const i=_({},bh,t),{disabled:r,href:s,onClick:a}=i;let o=n.useRef(null);o=e||o;const l=n.useCallback((t=>{r?"function"==typeof t?.preventDefault&&t.preventDefault():(a&&a(t),s&&window.open(s))}),[r,s,a]),c=function(t){const{textStyle:e,padding:n,space:i,panelStyle:r,minWidth:s,maxWidth:a,visible:o,cursor:l,disabled:c,icon:u,state:h,children:d}=t,f={text:d,textStyle:e,padding:n,panel:r,minWidth:s,maxWidth:a,visible:o,cursor:l??c?"not-allowed":"pointer",childrenPickable:!1,state:{text:{hover:h?.textStyle?.hover,disabled:h?.textStyle?.disabled},panel:{hover:h?.panelStyle?.hover,disabled:h?.panelStyle?.disabled}},space:i,shape:{visible:!!u,fill:!1,stroke:e.fill,symbolType:"M -0.2927 -15.4348 L -15.142 -0.5855 C -18.6567 2.9292 -18.6567 8.6277 -15.142 12.1424 V 12.1424 C -11.6273 15.6571 -5.9288 15.6571 -2.4141 12.1424 L 15.2636 -5.5353 C 17.6067 -7.8784 17.6067 -11.6774 15.2636 -14.0206 V -14.0206 C 12.9205 -16.3637 9.1215 -16.3637 6.7783 -14.0206 L -10.8993 3.6571 C -12.0709 4.8287 -12.0709 6.7282 -10.8993 7.8997 V 7.8997 C -9.7278 9.0713 -7.8283 9.0713 -6.6567 7.8997 L 8.1925 -6.9495"}};return f}(i);return n.useEffect((()=>{o.current.addEventListener("mouseenter",(()=>{r||(o.current.addState("hover",!0,!1),o.current.stage.renderNextFrame())})),o.current.addEventListener("mouseleave",(()=>{r||(o.current.removeState("hover",!1),o.current.stage.renderNextFrame())}))}),[]),n.useEffect((()=>{r?(o.current.removeState("disabled",!1),o.current.addState("disabled",!0,!1)):o.current.removeState("disabled",!1),o.current.stage.renderNextFrame()})),n.createElement(ph,{ref:o,attribute:c,onClick:l})}));yh.displayName="Link";const vh={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"#FFF"},panelStyle:{visible:!0,fill:"rgb(201, 205, 212)",lineWidth:1,cornerRadius:2},size:40,shape:"circle",autoFixFontSize:!0};const xh=n.forwardRef((function(t,e){const i=_({},vh,t),{size:r,children:s,onClick:a}=i;let o=n.useRef(null);o=e||o;const l=n.useCallback((t=>{a&&a(t)}),[a]),c=function(t){const{panelStyle:e,size:n,shape:i}=t,r={...e,width:n,height:n,clip:!0,cornerRadius:"circle"===i?n/2:e.cornerRadius??2,display:"flex",alignItems:"center",justifyContent:"center",visibleAll:!0,path:void 0};return r}(i);if(p(s)){const t=function(t){const{textStyle:e,size:n,children:i,autoFixFontSize:r}=t,s={text:i,...e};r&&function(t,e){const n=gu(e.text,e).width,i=t/(n+8),r=Math.max(Math.floor(e.fontSize*i),6);e.fontSize=r}(n,s);return s}(i);return n.createElement(dh,{ref:o,attribute:c,onClick:l},n.createElement(fh,{attribute:t}))}return"image"===s.type&&(s.props.attribute.width=r,s.props.attribute.height=r),n.createElement(dh,{ref:o,attribute:c,onClick:l},s)}));xh.displayName="Avatar";const _h={defaultPopupVisible:!1,position:"top"},Sh={backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 4px 10px rgba(0, 0, 0, .1)",fontSize:"14px",borderRadius:"4px",lineHeight:"1.5715",boxSizing:"border-box",color:"rgb(78, 89, 105)",border:"1px solid rgb(229, 230, 235)",padding:"12px 16px"},Ah=t=>{const e={content:"",height:"8px",width:"8px",position:"absolute",display:"block",boxSizing:"border-box",transform:"rotate(45deg)",transformOrigin:"50% 50% 0",backgroundColor:"rgb(255, 255, 255)",border:"1px solid rgb(229, 230, 235)",...wh(t.position),...t.arrowStyle};return t.visible?n.createElement(n.Fragment,null,n.createElement("div",{style:_({},Sh,t.panelStyle)},t.content),n.createElement("div",{style:e})):n.createElement(n.Fragment,null)};function wh(t){switch(t){case"top":return{top:"calc(100% - 5px)",left:"calc(50% - 5px)",borderTop:"none",borderLeft:"none"};case"tl":return{top:"calc(100% - 4px)",left:"14px",borderTop:"none",borderLeft:"none"};case"tr":return{top:"calc(100% - 4px)",left:"calc(100% - 24px)",borderTop:"none",borderLeft:"none"};case"bottom":return{top:"-4px",left:"calc(50% - 4px)",borderRight:"none",borderBottom:"none"};case"bl":return{top:"-4px",left:"14px",borderRight:"none",borderBottom:"none"};case"br":return{top:"-4px",left:"calc(100% - 24px)",borderRight:"none",borderBottom:"none"};case"left":return{top:"calc(50% - 4px)",left:"calc(100% - 5px)",borderLeft:"none",borderBottom:"none"};case"lt":return{top:"14px",left:"calc(100% - 5px)",borderLeft:"none",borderBottom:"none"};case"lb":return{top:"calc(100% - 24px)",left:"calc(100% - 5px)",borderLeft:"none",borderBottom:"none"};case"right":return{top:"calc(50% - 4px)",left:"-4px",borderRight:"none",borderTop:"none"};case"rt":return{top:"14px",left:"-4px",borderRight:"none",borderTop:"none"};case"rb":return{top:"calc(100% - 24px)",left:"-4px",borderRight:"none",borderTop:"none"}}}const Th=n.forwardRef((function(t,e){const i=_({},_h,t),{content:r,position:s,popupVisible:a,defaultPopupVisible:o,panelStyle:l,arrowStyle:c,children:h}=i;let d=n.useRef(null);d=e||d;const[f,p]=n.useState(!1);n.useEffect((()=>{p(!!a),d.current.stage.renderNextFrame()}),[a]),n.useEffect((()=>{p(a??o??!1)}),[]);const{transform:g,anchorType:m}=function(t){switch(t){case"top":return{anchorType:"top",transform:"translate(-50%, calc(-100% - 10px))"};case"tl":return{anchorType:"top-left",transform:"translate(0, calc(-100% - 10px))"};case"tr":return{anchorType:"top-right",transform:"translate(-100%, calc(-100% - 10px))"};case"bottom":return{anchorType:"bottom",transform:"translate(-50%, 10px)"};case"bl":return{anchorType:"bottom-left",transform:"translate(0, 10px)"};case"br":return{anchorType:"bottom-right",transform:"translate(-100%, 10px)"};case"left":return{anchorType:"left",transform:"translate(calc(-100% - 10px), -50%)"};case"lt":return{anchorType:"top-left",transform:"translate(calc(-100% - 10px), 0)"};case"lb":return{anchorType:"bottom-left",transform:"translate(calc(-100% - 10px), -100%)"};case"right":return{anchorType:"right",transform:"translate(10px, -50%)"};case"rt":return{anchorType:"top-right",transform:"translate(10px, 0)"};case"rb":return{anchorType:"bottom-right",transform:"translate(10px, -100%)"}}}(s),b={react:{style:{transform:g},element:n.createElement(Ah,{visible:f,content:r,position:s,panelStyle:l,arrowStyle:c}),container:null,visible:!0,pointerEvents:!1,anchorType:m}},y=n.useCallback((t=>{u(a)||(p(!0),t.currentTarget.stage.renderNextFrame())}),[]),v=n.useCallback((t=>{u(a)||(p(!1),t.currentTarget.stage.renderNextFrame())}),[]);return n.createElement(dh,{ref:d,attribute:b,onMouseEnter:y,onMouseLeave:v},h)}));Th.displayName="Popover";const Ch={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"rgb(51, 101, 238)"},panelStyle:{visible:!0,fill:"#e6fffb",lineWidth:1,cornerRadius:4}};const Bh=n.forwardRef((function(t,e){const i=_({},Ch,t),{attribute:r,panelStyle:s,children:a,...o}=i;let l=n.useRef(null);return l=e||l,n.createElement(ph,{ref:l,attribute:r??{text:a,panel:s,...o},...o})}));Bh.displayName="Tag";const kh={};const Mh=n.forwardRef((function(t,e){const i=_({},kh,t),{textStyle:r,circleStyle:s,children:a,...o}=i;let l=n.useRef(null);l=e||l;const c=n.useCallback((t=>{i.onChange&&i.onChange(t.target.attribute.checked)}),[]);return n.useEffect((()=>(l.current?.addEventListener("radio_checked",c),()=>{l.current?.removeEventListener("radio_checked",c)})),[]),n.createElement("radio",{ref:l,attribute:{text:{...r,text:a},circle:s,...o},...o})}));Mh.displayName="Radio";const Ph={};const Eh=n.forwardRef((function(t,e){const i=_({},Ph,t),{textStyle:r,boxStyle:s,iconStyle:a,children:o,...l}=i;let c=n.useRef(null);c=e||c;const u=n.useCallback((t=>{i.onChange&&i.onChange(t.target.attribute.checked)}),[]);return n.useEffect((()=>(c.current?.addEventListener("checkbox_state_change",u),()=>{c.current?.removeEventListener("checkbox_state_change",u)})),[]),n.createElement("checkbox",{ref:c,attribute:{text:{...r,text:o},box:s,icon:a,...l},...l})}));Eh.displayName="Checkbox";Object.defineProperty(t,"register",{enumerable:!0,get:function(){return e.register}}),t.Arc="arc",t.Avatar=xh,t.Button=mh,t.Checkbox=Eh,t.Circle="circle",t.CustomComponent=t=>{const e=n.useContext(i),{table:r}=e,s=function(t,e){const i=n.useMemo((()=>({...e})),[e]),r=n.useMemo((()=>{const e=_({},t);for(const t in i)void 0===e[t]&&(e[t]=i[t]);return e}),[t,i]);return r}(t,{style:{left:0,top:0},className:"vtable-custom-component",displayMode:"position",x:0,y:0,width:0,height:0,row:0,col:0,anchor:"top-left",dx:0,dy:0}),{displayMode:a,x:o,y:l,width:c,height:u,row:h,col:d,anchor:f,dx:p,dy:g,className:m,children:b,style:y}=s;let v,x,S,A;if("position"===a)v=o+p+"px",x=l+g+"px",S=c+"px",A=u+"px";else if("cell"===a){const t=r&&d>=0&&h>=0?r?.getCellRelativeRect(d,h):{width:0,height:0,left:-9999,top:-9999};S=hh(c,t.width)+"px",A=hh(u,t.height)+"px","top-left"===f?(v=t.left+hh(p,t.width)+"px",x=t.top+hh(g,t.height)+"px"):"top-right"===f?(v=t.left+hh(p,t.width)+t.width+"px",x=t.top+hh(g,t.height)+"px"):"bottom-left"===f?(v=t.left+hh(p,t.width)+"px",x=t.top+hh(g,t.height)+t.height+"px"):"bottom-right"===f&&(v=t.left+hh(p,t.width)+t.width+"px",x=t.top+hh(g,t.height)+t.height+"px")}const w=_({},y,{position:"absolute",zIndex:1e3,width:S,height:A,left:v,top:x});return n.createElement("div",{className:m,style:w},n.Children.map(b,(t=>t?n.cloneElement(t,{}):t)))},t.CustomLayout=Ku,t.EmptyTip=ch,t.Group=dh,t.Image="image",t.Line="line",t.Link=yh,t.ListColumn=th,t.ListTable=Mu,t.ListTableSimple=Ou,t.Menu=oh,t.Path="path",t.PivotChart=Eu,t.PivotColumnDimension=eh,t.PivotColumnHeaderTitle=rh,t.PivotCorner=ah,t.PivotIndicator=ih,t.PivotRowDimension=nh,t.PivotRowHeaderTitle=sh,t.PivotTable=Pu,t.PivotTableSimple=Lu,t.Polygon="polygon",t.Popover=Th,t.Radio=Mh,t.Rect="rect",t.RichText="richtext",t.Symbol="symbol",t.Tag=Bh,t.Text=fh,t.Title=uh,t.Tooltip=lh,t.VTableReactAttributePlugin=_u,t.registerChartModule=function(t,n){e.register.chartModule(t,n)},t.version="1.22.3"}));